diff --git a/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/customerreturnRequestMain.data.ts b/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/customerreturnRequestMain.data.ts index 6a5fc0684..54425d775 100644 --- a/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/customerreturnRequestMain.data.ts +++ b/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/customerreturnRequestMain.data.ts @@ -517,6 +517,75 @@ export const CustomerreturnRequestMain = useCrudSchemas( }, isTable: false }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + enterSearch: true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择到库位代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '到库位代码', // 查询弹窗标题 + searchAllSchemas: Location.allSchemas, // 查询弹窗所需类 + searchPage: LocationApi.selectBusinessTypeOutLocation, // 查询弹窗所需分页方法 + searchCondition: [ + { + key: 'businessType', + value: 'CustomerReject', + isMainValue: false + }, + { + key: 'isIn', + value: 'in', + isMainValue: false + } + ], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 + } + } + // tableForm: { + // enterSearch:true, + // isRepeat: true, + // isInpuFocusShow: true, // 开启查询弹窗 + // searchListPlaceholder: '请选择到库位代码', + // searchField: 'toLocationCode', + // searchTitle: '到库位代码', + // searchAllSchemas: Location.allSchemas, + // searchPage: LocationApi.selectBusinessTypeOutLocation, // 查询弹窗所需分页方法 + // searchCondition: [{ + // key: 'businessType', + // value: 'CustomerReject', + // isMainValue: false + // }, + // { + // key: 'isIn', + // value: 'in', + // isMainValue: false + // }], + // verificationParams: [{ + // key: 'code', + // action: '==', + // value: '', + // isMainValue: false, + // isSearch: true, + // isFormModel: true, + // }], // 失去焦点校验参数 + // }, + }, { label: '自动提交', field: 'autoCommit', @@ -691,6 +760,9 @@ export const CustomerreturnRequestMain = useCrudSchemas( //表单校验 export const CustomerreturnRequestMainRules = reactive({ + toLocationCode: [ + { required: true, message: '请选择到库位代码', trigger: 'blur' } + ], // deliverRecordNumber: [ // { required: true, message: '请选择发货记录单号', trigger: 'change' } // ], @@ -1031,43 +1103,43 @@ export const CustomerreturnRequestDetail = useCrudSchemas(reactive } } }, - { - label: '到库位代码', - field: 'toLocationCode', - sort: 'custom', - table: { - width: 150 - }, - isSearch: true, - tableForm: { - enterSearch:true, - isRepeat: true, - isInpuFocusShow: true, // 开启查询弹窗 - searchListPlaceholder: '请选择到库位代码', - searchField: 'toLocationCode', - searchTitle: '到库位代码', - searchAllSchemas: Location.allSchemas, - searchPage: LocationApi.selectBusinessTypeOutLocation, // 查询弹窗所需分页方法 - searchCondition: [{ - key: 'businessType', - value: 'CustomerReject', - isMainValue: false - }, - { - key: 'isIn', - value: 'in', - isMainValue: false - }], - verificationParams: [{ - key: 'code', - action: '==', - value: '', - isMainValue: false, - isSearch: true, - isFormModel: true, - }], // 失去焦点校验参数 - }, - }, + // { 拿到主表 + // label: '到库位代码', + // field: 'toLocationCode', + // sort: 'custom', + // table: { + // width: 150 + // }, + // isSearch: true, + // tableForm: { + // enterSearch:true, + // isRepeat: true, + // isInpuFocusShow: true, // 开启查询弹窗 + // searchListPlaceholder: '请选择到库位代码', + // searchField: 'toLocationCode', + // searchTitle: '到库位代码', + // searchAllSchemas: Location.allSchemas, + // searchPage: LocationApi.selectBusinessTypeOutLocation, // 查询弹窗所需分页方法 + // searchCondition: [{ + // key: 'businessType', + // value: 'CustomerReject', + // isMainValue: false + // }, + // { + // key: 'isIn', + // value: 'in', + // isMainValue: false + // }], + // verificationParams: [{ + // key: 'code', + // action: '==', + // value: '', + // isMainValue: false, + // isSearch: true, + // isFormModel: true, + // }], // 失去焦点校验参数 + // }, + // }, { label: '库存状态', field: 'inventoryStatus', @@ -1234,9 +1306,9 @@ export const CustomerreturnRequestDetailRules = reactive({ itemCode: [ { required: true, message: '请选择物料代码', trigger: 'change' } ], - toLocationCode: [ - { required: true, message: '请选择到库位代码', trigger: 'blur' } - ], + // toLocationCode: [ + // { required: true, message: '请选择到库位代码', trigger: 'blur' } + // ], remark: [ { max: 50, message: '不得超过50个字符', trigger: 'blur' } ], diff --git a/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue b/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue index de5efcccd..21670b425 100644 --- a/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue +++ b/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue @@ -168,6 +168,7 @@ const onEnter = async (field,value)=>{ // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { nextTick(() => { + console.log('searchTableSuccess',formField, searchField, val, formRef, type, row) CustomerreturnRequestMain.allSchemas.formSchema.forEach(item => { if(item.field == 'deliverRecordNumber') { if(customerCode.value != null){ @@ -195,9 +196,6 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => }else if(formField == 'packUnit'){ row['packUnit'] = val[0]['packUnit'] row['packQty'] = val[0]['packQty'] - }else if(formField == 'toLocationCode') { - //到库位代码 - row['toLocationCode'] = val[0]['code'] } else { row[formField] = val[0][searchField] } @@ -767,6 +765,9 @@ const submitForm = async (formType, submitData) => { formRef.value.formLoading = true try { if (formType === 'create') { + data.subList.forEach(item=>{ + item['toLocationCode'] = data['toLocationCode'] + }) await CustomerreturnRequestMainApi.createCustomerreturnRequestMain(data) message.success(t('common.createSuccess')) } else {