diff --git a/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/index.vue b/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/index.vue index 64dcbae7c..c7d328cce 100644 --- a/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/index.vue +++ b/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/index.vue @@ -151,6 +151,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => if(formField === 'reasonCodeRequisition'){ setV['reasonCodeRequisition'] = val[0]['code'] setV['reasonDescRequisition'] = val[0]['accountingName'] + // 项目是否必填 + if(UnplannedissueRequestMainRules['projectCode']){ + UnplannedissueRequestMainRules['projectCode'][0].required = val[0]['isProject']=='TRUE' + } } if(formField === 'projectCode'){ setV['projectCode'] = val[0]['projectCode'] diff --git a/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/unplannedissueRequestMain.data.ts b/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/unplannedissueRequestMain.data.ts index 434031a00..ecd638f82 100644 --- a/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/unplannedissueRequestMain.data.ts +++ b/src/views/wms/inventoryjobManage/unplannedissue/unplannedissueRequestMain/unplannedissueRequestMain.data.ts @@ -674,6 +674,9 @@ export const UnplannedissueRequestMainRules = reactive({ reasonCodeRequisition: [ { required: true, message: '请输入领用原因代码', trigger: 'blur' } ], + projectCode: [ + { required: false, message: '请输入项目代码', trigger: 'blur' } + ], }) /** diff --git a/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue b/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue index 9d3005e6d..c79258b9a 100644 --- a/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue +++ b/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue @@ -247,22 +247,26 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => } if(formField === 'reasonCodeRequisition'){ setV['reasonCodeRequisition'] = val[0]['code'] - let accountRes = await SubjectAccountApi.getSubjectAccountPage({ - pageSize: 20, - pageNo: 1, - code: val[0]['code'], - costcentreType: formRef.formModel['costCenterType'], - sort: '', - by: 'ASC' - }) - console.log('UnplannedreceiptRequestMainRules',UnplannedreceiptRequestMainRules) - if( UnplannedreceiptRequestMainRules['projectCode']){ - UnplannedreceiptRequestMainRules['projectCode'][0]['required'] = false - if(accountRes&&accountRes.list&&accountRes.list.length>0){ - if(accountRes.list[0]['isProject']=='TRUE'){ - UnplannedreceiptRequestMainRules['projectCode'][0]['required'] = true - } - } + // let accountRes = await SubjectAccountApi.getSubjectAccountPage({ + // pageSize: 20, + // pageNo: 1, + // code: val[0]['code'], + // costcentreType: formRef.formModel['costCenterType'], + // sort: '', + // by: 'ASC' + // }) + // console.log('UnplannedreceiptRequestMainRules',UnplannedreceiptRequestMainRules) + // if( UnplannedreceiptRequestMainRules['projectCode']){ + // UnplannedreceiptRequestMainRules['projectCode'][0]['required'] = false + // if(accountRes&&accountRes.list&&accountRes.list.length>0){ + // if(accountRes.list[0]['isProject']=='TRUE'){ + // UnplannedreceiptRequestMainRules['projectCode'][0]['required'] = true + // } + // } + // } + // 项目是否必填 + if(UnplannedreceiptRequestMainRules['projectCode']){ + UnplannedreceiptRequestMainRules['projectCode'][0].required = val[0]['isProject']=='TRUE' } } if(formField === 'projectCode'){