From 9466beabfee1725a8e3c11d1c0ed0a7e00d55662 Mon Sep 17 00:00:00 2001 From: wangyufei <2267742828@qq.com> Date: Fri, 9 Aug 2024 15:09:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=93=E5=AD=98=E7=A7=BB=E5=8A=A8=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=96=B0=E5=A2=9E=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inventorymoveRecordMainNew/index.vue | 29 +++-- .../inventorymoveRecordRequestMain.data.ts | 120 ++++-------------- 2 files changed, 42 insertions(+), 107 deletions(-) diff --git a/src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/index.vue b/src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/index.vue index 3173482dd..4bea72d15 100644 --- a/src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/index.vue +++ b/src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/index.vue @@ -253,17 +253,17 @@ const submitForm = async (formType, submitData) => { } formRef.value.formLoading = true console.log('data',data) - // try { - // if (formType === 'create') { - // await InventorymoveRecordMainApi.createInventorymoveRecordMain(data) - // message.success(t('common.createSuccess')) - // } - // formRef.value.dialogVisible = false - // // 刷新当前列表 - // getList() - // } finally { - // formRef.value.formLoading = false - // } + try { + if (formType === 'create') { + await InventorymoveRecordMainApi.createInventorymoveRecordMain(data) + message.success(t('common.createSuccess')) + } + formRef.value.dialogVisible = false + // 刷新当前列表 + getList() + } finally { + formRef.value.formLoading = false + } } // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { @@ -292,6 +292,13 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => } } else { const setV = {} + if(formField=='fromLocationCode'){ + //从库位代码 + setV['fromWarehouseCode'] = val[0]['warehouseCode'] + }else if(formField=='toLocationCode'){ + //到库位代码 + setV['toWarehouseCode'] = val[0]['warehouseCode'] + } setV[formField] = val[0][searchField] formRef.setValues(setV) } diff --git a/src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/inventorymoveRecordRequestMain.data.ts b/src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/inventorymoveRecordRequestMain.data.ts index 20784f2cc..4674afe6c 100644 --- a/src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/inventorymoveRecordRequestMain.data.ts +++ b/src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/inventorymoveRecordRequestMain.data.ts @@ -35,102 +35,6 @@ const queryParams = { * @returns {Array} 库存转移申请主表 */ export const InventorymoveRequestMain = useCrudSchemas(reactive([ - { - label: '从仓库代码', - field: 'fromWarehouseCode', - sort: 'custom', - table: { - width: 150 - }, - tableForm: { - enterSearch: true, - isInpuFocusShow: true, // 开启查询弹窗 - searchListPlaceholder: '请选择从仓库代码', - searchField: 'code', - searchTitle: '仓库基础信息', - searchAllSchemas: Warehouse.allSchemas, - searchPage: WarehouseApi.pageBusinessTypeToWarehouse, - searchCondition: [ - { - key: 'available', - value: 'TRUE', - isMainValue: false - }, - { - key: 'businessType', - value: 'Move', - isMainValue: false - },{ - key: 'isIn', - value: 'out', - isMainValue: false - }], - verificationParams: [{ - key: 'code', - action: '==', - value: '', - isMainValue: false, - isSearch: true, - isFormModel: true, - }], // 失去焦点校验参数 - }, - form: { - // labelMessage: '信息提示说明!!!', - componentProps: { - enterSearch: true, - isSearchList: true, - searchListPlaceholder: '请选择从仓库代码', - searchField: 'code', - searchTitle: '仓库基础信息', - searchAllSchemas: Warehouse.allSchemas, - searchPage: WarehouseApi.pageBusinessTypeToWarehouse, - searchCondition: [ - { - key: 'available', - value: 'TRUE', - isMainValue: false - }, - { - key: 'businessType', - value: 'Move', - isMainValue: false - },{ - key: 'isIn', - value: 'out', - isMainValue: false - }], - verificationParams: [{ - key: 'code', - action: '==', - value: '', - isMainValue: false, - isSearch: true, - isFormModel: true, - }], // 失去焦点校验参数 - } - } - }, - { - label: '截止时间', - field: 'dueTime', - formatter: dateFormatter, - detail: { - dateFormat: 'YYYY-MM-DD HH:mm:ss' - }, - sort: 'custom', - table: { - width: 180 - }, - form: { - component: 'DatePicker', - componentProps: { - style: { width:'100%'}, - type: 'datetime', - dateFormat: 'YYYY-MM-DD HH:mm:ss', - valueFormat: 'x', - } - }, - }, { label: '从库位代码', field: 'fromLocationCode', @@ -263,6 +167,27 @@ export const InventorymoveRequestMain = useCrudSchemas(reactive([ } } }, + { + label: '截止时间', + field: 'dueTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width:'100%'}, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, ])) //表单校验 @@ -270,6 +195,9 @@ export const InventorymoveRequestMainRules = reactive({ fromWarehouseCode: [ { required: true, message: '请选择从仓库代码', trigger: 'blur' } ], + toWarehouseCode: [ + { required: true, message: '请选择到仓库代码', trigger: 'blur' } + ], fromLocationCode: [ { required: true, message: '请选择从库位代码', trigger: 'change' } ],