Browse Source

HL-5757 计划外出入库界面增加前端逻辑校验,根据输入的领用原因代码,查找科目配置表,如果项目必填字段为YES,界面填写项目代码为空,则提示项目代码为空,必须指定一个项目

hella_online_20240829
wangyufei 3 months ago
parent
commit
c2ae35e820
  1. 18
      src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue
  2. 3
      src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts

18
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']

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

Loading…
Cancel
Save