From 5e34912486ada6c57dc67c06b6c4aec7f11608ea Mon Sep 17 00:00:00 2001 From: yufei_wang <2267742828@qq.com> Date: Fri, 25 Oct 2024 08:46:51 +0800 Subject: [PATCH] =?UTF-8?q?HL-6322=E7=BA=BF=E8=BE=B9=E5=8E=9F=E6=96=99?= =?UTF-8?q?=E6=8A=A5=E5=BA=9F=E4=B8=AD=E7=9A=84=E9=A1=B9=E7=9B=AE=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=98=AF=E5=90=A6=E4=B8=BA=E5=A1=AB=E5=86=99=E9=A1=B9?= =?UTF-8?q?=EF=BC=8C=E8=A6=81=E6=B1=82=E6=A0=B9=E6=8D=AE=E9=A2=86=E7=94=A8?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E6=89=80=E9=80=89=E4=BB=A3=E7=A0=81=E6=8E=A7?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../productionscrapRequestMain/index.vue | 21 +++++++++++++++++++ .../productionscrapRequestMain.data.ts | 3 +++ 2 files changed, 24 insertions(+) diff --git a/src/views/wms/issueManage/productionscrap/productionscrapRequestMain/index.vue b/src/views/wms/issueManage/productionscrap/productionscrapRequestMain/index.vue index 002bbac51..5096dda96 100644 --- a/src/views/wms/issueManage/productionscrap/productionscrapRequestMain/index.vue +++ b/src/views/wms/issueManage/productionscrap/productionscrapRequestMain/index.vue @@ -299,6 +299,27 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => } if(formField == 'reasonCodeRequisition'){ setV['reasonCodeRequisition'] = val[0]['code'] + // 项目是否必填 + if(ProductionscrapRequestMainRules['projectCode']){ + ProductionscrapRequestMainRules['projectCode'][0].required = val[0]['isProject']=='TRUE' + } + ProductionscrapRequestMain.allSchemas.formSchema.forEach((item) => { + if (item.field == 'projectCode') { + //项目代码 + if(val[0]['isProject']=='TRUE'){ + //是-可编辑,可选择 + item.componentProps.enterSearch = true + item.componentProps.isSearchList = true + item.componentProps.disabled = false + }else{ + //否-不可编辑,内容为空 + setV['projectCode'] = '' + item.componentProps.enterSearch = false + item.componentProps.isSearchList = false + item.componentProps.disabled = true + } + } + }) } setV[formField] = val[0][searchField] tableData.value = [] // 重置明细数据 diff --git a/src/views/wms/issueManage/productionscrap/productionscrapRequestMain/productionscrapRequestMain.data.ts b/src/views/wms/issueManage/productionscrap/productionscrapRequestMain/productionscrapRequestMain.data.ts index d13a65b4f..959141c48 100644 --- a/src/views/wms/issueManage/productionscrap/productionscrapRequestMain/productionscrapRequestMain.data.ts +++ b/src/views/wms/issueManage/productionscrap/productionscrapRequestMain/productionscrapRequestMain.data.ts @@ -1453,6 +1453,9 @@ export const ProductionscrapRequestMain = useCrudSchemas( //表单校验 export const ProductionscrapRequestMainRules = reactive({ + projectCode: [ + { required: false, message: '请输入项目代码', trigger: 'blur' } + ], departmentCode: [ { required: true, message: '请输入部门', trigger: 'blur' } ],