diff --git a/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue b/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue index b34096e2f..59ab3f8b5 100644 --- a/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue +++ b/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue @@ -83,7 +83,7 @@ ref="formLabelRef" @success="getList" :tableAllSchemas="detailListTableColumns" - :tableFormRules="ProductionreturnRequestDetailLabelRules" + :tableFormRules="detailListTableColumnsRules" :tableData="detatableData.tableList" :isBusiness="true" :isShowButton="false" @@ -118,6 +118,7 @@ import * as LocationApi from '@/api/wms/location' import * as SupplieritemApi from '@/api/wms/supplieritem' import * as ProductionlineitemApi from '@/api/wms/productionlineitem' const { loadStart, loadDone } = usePageLoading() +import { cloneDeep } from 'lodash-es' // 生产退料申请 defineOptions({ name: 'ProductionreturnRequestMain' }) @@ -130,7 +131,8 @@ routeName.value = route.name const tableColumns = ref([...ProductionreturnRequestMain.allSchemas.tableColumns,...ProductionreturnRequestDetail.allSchemas.tableMainColumns]) //创建标签 -const detailListTableColumns = ProductionreturnRequestDetailLabel.allSchemas +const detailListTableColumns =cloneDeep(ProductionreturnRequestDetailLabel.allSchemas) +const detailListTableColumnsRules =cloneDeep(ProductionreturnRequestDetailLabel) const isCreateLabel = ref(false) const formLabelRef = ref() const labelType = ref('') // 标签类别 采购还是制造等 @@ -558,15 +560,13 @@ const buttonTableClick = async (val, row) => { }).then(res => { if (res.list.length > 0) { // 判断物料 可采购 + detailListTableColumnsRules.value = cloneDeep(ProductionreturnRequestDetailLabelRules) if (res.list[0].enableBuy == "TRUE") { - // 修改 tableform 属性 + detailListTableColumns.tableFormColumns = ProductionreturnRequestDetailLabel.allSchemas.tableFormColumns.filter(item=>item.field != 'productionLineCodePackage') + delete detailListTableColumnsRules.value.productionLineCodePackage + // 修改 tableform 属性 detailListTableColumns.tableFormColumns.map(itemColumns => { - // 修改 tableform 属性 if(itemColumns.field == 'supplierItemCode') { - itemColumns.tableForm.isInpuFocusShow = true - itemColumns.tableForm.disabled = false - ProductionreturnRequestDetailLabelRules.supplierItemCode[0].required = true - formLabelRef.value.formLoading = true SupplieritemApi.getSupplieritemPage({ pageSize: 10, pageNo: 1, @@ -579,27 +579,14 @@ const buttonTableClick = async (val, row) => { }) } }) - - } else { - // 修改 tableform 属性 - detailListTableColumns.tableFormColumns.map(itemColumns => { - if(itemColumns.field == 'supplierItemCode') { - itemColumns.tableForm.isInpuFocusShow = false - itemColumns.tableForm.disabled = true - ProductionreturnRequestDetailLabelRules.supplierItemCode[0].required = false - } - }) } // 判断物料 可制造 if (res.list[0].enableMake == "TRUE") { - // 修改 tableform 属性 + // 修改 tableform 属性 + detailListTableColumns.tableFormColumns = ProductionreturnRequestDetailLabel.allSchemas.tableFormColumns.filter(item=>item.field != 'supplierItemCode') + delete detailListTableColumnsRules.value.supplierItemCode detailListTableColumns.tableFormColumns.map(itemColumns => { if(itemColumns.field == 'productionLineCodePackage') { - item.productionLineCodePackage = item.productionLineCode - itemColumns.tableForm.isInpuFocusShow = true - itemColumns.tableForm.disabled = true - ProductionreturnRequestDetailLabelRules.productionLineCodePackage[0].required = true - formLabelRef.value.formLoading = true ProductionlineitemApi.getProductionlineitemPage({ pageNo: 1, code: item.itemCode, @@ -611,15 +598,6 @@ const buttonTableClick = async (val, row) => { }) } }) - } else { - // 修改 tableform 属性 - detailListTableColumns.tableFormColumns.map(itemColumns => { - if(itemColumns.field == 'productionLineCodePackage') { - itemColumns.tableForm.isInpuFocusShow = false - itemColumns.tableForm.disabled = true - ProductionreturnRequestDetailLabelRules.productionLineCodePackage[0].required = false - } - }) } } else { message.warning('没有查询到物料代码:【' + item.itemCode + '】')