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' } ],