diff --git a/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue b/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue index 0cae01ffb..0d40145df 100644 --- a/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue +++ b/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue @@ -133,6 +133,7 @@ import { getAccessToken } from '@/utils/auth' import { getJmreportBaseUrl } from '@/utils/systemParam' import { formatDate } from '@/utils/formatTime' import { usePageLoading } from '@/hooks/web/usePageLoading' +import * as SubjectAccountApi from '@/api/wms/subjectAccount' const { loadStart, loadDone } = usePageLoading() // 计划外入库申请 defineOptions({ name: 'UnplannedreceiptRequestMain' }) @@ -246,6 +247,23 @@ 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 + } + } + } } if(formField === 'projectCode'){ setV['projectCode'] = val[0]['projectCode'] diff --git a/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts b/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts index cd7947c15..53bf8f0cd 100644 --- a/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts +++ b/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts @@ -650,6 +650,9 @@ export const UnplannedreceiptRequestMainRules = reactive({ costCenterType: [ { required: true, message: '请输入成本中心类型', trigger: 'blur' } ], + projectCode: [ + { required: false, message: '请输入项目代码', trigger: 'blur' } + ], reasonCodeRequisition: [ { required: true, message: '请输入领用原因代码', trigger: 'blur' } ],