diff --git a/src/views/wms/inventoryjobManage/scrap/scrapJobMain/scrapJobMain.data.ts b/src/views/wms/inventoryjobManage/scrap/scrapJobMain/scrapJobMain.data.ts index b711a2a2b..77076f60f 100644 --- a/src/views/wms/inventoryjobManage/scrap/scrapJobMain/scrapJobMain.data.ts +++ b/src/views/wms/inventoryjobManage/scrap/scrapJobMain/scrapJobMain.data.ts @@ -89,8 +89,9 @@ export const ScrapJobMain = useCrudSchemas( table: { width: 150 }, - isTable:false, - isForm:false, + isTable:true, + sortTableDefault:9997, + isForm:true, isTableForm:false, tableForm: { isInpuFocusShow: true, // 开启查询弹窗 @@ -944,6 +945,7 @@ export const ScrapJobDetail = useCrudSchemas(reactive([ table: { width: 150 }, + sortTableDefault:9998 }, { label: '货主代码', @@ -995,6 +997,7 @@ export const ScrapJobDetail = useCrudSchemas(reactive([ } }, isTable: true, + sortTableDefault:9999 }, { label: '创建者', @@ -1004,6 +1007,7 @@ export const ScrapJobDetail = useCrudSchemas(reactive([ width: 150 }, isTable: true, + sortTableDefault:10000 }, ])) diff --git a/src/views/wms/inventoryjobManage/scrap/scrapRecordMain/scrapRecordMain.data.ts b/src/views/wms/inventoryjobManage/scrap/scrapRecordMain/scrapRecordMain.data.ts index fc7019e3c..1a74f4e71 100644 --- a/src/views/wms/inventoryjobManage/scrap/scrapRecordMain/scrapRecordMain.data.ts +++ b/src/views/wms/inventoryjobManage/scrap/scrapRecordMain/scrapRecordMain.data.ts @@ -98,8 +98,9 @@ export const ScrapRecordMain = useCrudSchemas( table: { width: 150 }, - isTable:false, - isForm:false, + isTable:true, + sortTableDefault:9992, + isForm:true, isTableForm:false, tableForm: { isInpuFocusShow: true, // 开启查询弹窗 @@ -112,11 +113,6 @@ export const ScrapRecordMain = useCrudSchemas( key: 'available', value: 'TRUE', isMainValue: false - },{ - key: 'costcentreType', - value: 'costCenterType', - message: '成本中心类型不能为空!', - isMainValue: true }] }, form: { @@ -132,11 +128,6 @@ export const ScrapRecordMain = useCrudSchemas( key: 'available', value: 'TRUE', isMainValue: false - },{ - key: 'costcentreType', - value: 'costCenterType', - message: '成本中心类型不能为空!', - isMainValue: true }] } } @@ -727,6 +718,7 @@ export const ScrapRecordDetail = useCrudSchemas(reactive([ table: { width: 150 }, + sortTableDefault:9993 }, { label: '单价', @@ -737,7 +729,8 @@ export const ScrapRecordDetail = useCrudSchemas(reactive([ }, form: { component: 'InputNumber', - } + }, + sortTableDefault:9994 }, { label: '金额', @@ -748,7 +741,8 @@ export const ScrapRecordDetail = useCrudSchemas(reactive([ }, form: { component: 'InputNumber', - } + }, + sortTableDefault:9995 }, { label: '从库位组代码', @@ -757,6 +751,7 @@ export const ScrapRecordDetail = useCrudSchemas(reactive([ table: { width: 150 }, + sortTableDefault:9996 }, { label: '从库区代码', @@ -765,6 +760,7 @@ export const ScrapRecordDetail = useCrudSchemas(reactive([ table: { width: 150 }, + sortTableDefault:9997 }, { label: '从货主代码', @@ -806,6 +802,7 @@ export const ScrapRecordDetail = useCrudSchemas(reactive([ table: { width: 150 }, + sortTableDefault:9998 }, { label: '创建时间', @@ -826,6 +823,7 @@ export const ScrapRecordDetail = useCrudSchemas(reactive([ valueFormat: 'x', } }, + sortTableDefault:9999 }, { label: '创建者', @@ -834,6 +832,7 @@ export const ScrapRecordDetail = useCrudSchemas(reactive([ table: { width: 150 }, + sortTableDefault:10000 }, // { // label: '任务明细ID', diff --git a/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/index.vue b/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/index.vue index 9585b6cb3..c9a058bd5 100644 --- a/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/index.vue +++ b/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/index.vue @@ -71,7 +71,6 @@ @searchTableSuccess="searchTableSuccess" @inputNumberChange="inputNumberChange" @submitForm="submitForm" - @tableFormSelectOnBlur="tableFormSelectOnBlur" @clearSearchInput="clearSearchInput" /> @@ -90,7 +89,6 @@ @searchTableSuccessDetail="searchTableSuccessDetail" @detailBasicFormOnChange="qtyOnChange" :detailValidate="detailValidate" - @onBlur="onBlur" /> @@ -139,7 +137,11 @@ const tableColumns = ref([ const updataTableColumns = (val) => { tableColumns.value = val } - +const defaultReasonCodeRequisition = ref(true) +const setDefaultrReasonCodeRequisition = ()=>{ + formRef.value.setDefaultBlurValue('reasonCodeRequisition','SC99') + defaultReasonCodeRequisition.value = false +} // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { nextTick(() => { @@ -201,6 +203,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => } if (formField == 'q2Number') { setV['noticeRemark'] = val[0]['desc'] + if(val[0]['number']){ + setV['reasonCodeRequisition'] = '' + setV['projectCode'] = '' + } ScrapRequestMain.allSchemas.formSchema.forEach((item) => { if (item.field == 'q1Number' || item.field == 'q3Number') { item.componentProps.enterSearch = false @@ -227,14 +233,43 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => setV['costcentreCode'] = val[0]['costcentreCode'] setV['costCenterType'] = val[0]['costcentreType'] } - if(formField === 'reasonCodeRequisition'){ + if(formField == 'reasonCodeRequisition'){ setV['reasonCodeRequisition'] = val[0]['code'] + // 项目是否必填 + if(ScrapRequestMainRules['projectCode']){ + ScrapRequestMainRules['projectCode'][0].required = val[0]['isProject']=='TRUE' + } + ScrapRequestMain.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 + } + } + }) + if(val[0]['code']){ + setV['q2Number'] = '' + } } if(formField === 'projectCode'){ setV['projectCode'] = val[0]['projectCode'] } setV[formField] = val[0][searchField] formRef.setValues(setV) + if(formField == 'costCenterCode'){ + if(defaultReasonCodeRequisition.value){ + setDefaultrReasonCodeRequisition() + } + } } }) @@ -578,6 +613,12 @@ const openForm = async (type: string, row?: any) => { tableData.value = [] // 重置明细数据 formRef.value.open(type, row) + if(type == 'create'){ + nextTick(()=>{ + defaultReasonCodeRequisition.value = true + // formRef.value.setDefaultBlurValue('costCenterCode','DEFC') + }) + } } // 获取部门 用于详情 部门回显 diff --git a/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts b/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts index dd69b6f42..5f72d3c58 100644 --- a/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts +++ b/src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts @@ -169,8 +169,9 @@ export const ScrapRequestMain = useCrudSchemas( table: { width: 150 }, - isTable:false, - isForm:false, + isTable:true, + sortTableDefault:9997, + isForm:true, isTableForm:false, tableForm: { enterSearch: true, @@ -184,12 +185,7 @@ export const ScrapRequestMain = useCrudSchemas( key: 'available', value: 'TRUE', isMainValue: false - },{ - key: 'costcentreType', - value: 'costCenterType', - message: '成本中心类型不能为空!', - isMainValue: true - }], + }], verificationParams: [{ key: 'code', action: '==', @@ -200,11 +196,12 @@ export const ScrapRequestMain = useCrudSchemas( }], // 失去焦点校验参数 }, form: { + value:'SC99', // labelMessage: '信息提示说明!!!', componentProps: { enterSearch: true, isSearchList: true, // 开启查询弹窗 - searchListPlaceholder: '请选择成本中心代码', // 输入框占位文本 + searchListPlaceholder: '请选择领用原因代码', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '领用原因代码', // 查询弹窗标题 searchAllSchemas: SubjectAccount.allSchemas, // 查询弹窗所需类 @@ -213,12 +210,7 @@ export const ScrapRequestMain = useCrudSchemas( key: 'available', value: 'TRUE', isMainValue: false - },{ - key: 'costcentreType', - value: 'costCenterType', - message: '成本中心类型不能为空!', - isMainValue: true - }], + }], verificationParams: [{ key: 'code', action: '==', @@ -1183,6 +1175,7 @@ export const ScrapRequestDetail = useCrudSchemas(reactive([ table: { width: 150 }, + sortTableDefault:9998 }, { label: '项目订单号', @@ -1249,7 +1242,8 @@ export const ScrapRequestDetail = useCrudSchemas(reactive([ } }, isTableForm: false, - isForm: false + isForm: false, + sortTableDefault:9999 }, { label: '创建者', @@ -1259,7 +1253,8 @@ export const ScrapRequestDetail = useCrudSchemas(reactive([ width: 150 }, isTableForm: false, - isForm: false + isForm: false, + sortTableDefault:10000 }, { label: '最后更新时间',