From 8fb48c2b4d22df41ff06f0ac30254ea9a31dcea1 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Tue, 19 Nov 2024 16:10:01 +0800 Subject: [PATCH] =?UTF-8?q?YT-1078=E7=94=9F=E4=BA=A7=E9=80=80=E6=96=99?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=88=9B=E5=BB=BA=E6=A0=87=E7=AD=BE=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E4=B8=8D=E5=BA=94=E8=AF=A5=E5=90=8C=E6=97=B6=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E2=80=9C=E6=A0=87=E7=AD=BE=E7=94=9F=E4=BA=A7=E7=BA=BF?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E2=80=9D=E5=92=8C=E2=80=9C=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E4=BB=A3=E7=A0=81=E2=80=9D=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../productionreturnRequestMain/index.vue | 44 +++++-------------- 1 file changed, 11 insertions(+), 33 deletions(-) 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 + '】')