From 74153a0bb445f8841a2af40a3835177a6ccece6e Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Thu, 28 Nov 2024 17:38:14 +0800 Subject: [PATCH] =?UTF-8?q?YT-1300:=20bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/deliverRecordMain/index.ts | 4 +- src/components/BasicForm/src/BasicForm.vue | 1 - src/utils/dict.ts | 1 + .../eam/equipmentTransferRecord/index.vue | 2 +- .../deliverRecordMain/index.vue | 2 +- .../deliverRecordMain.data.ts | 32 ++++++- .../deliverRecordMain/index.vue | 87 ++++++++++++++++--- 7 files changed, 113 insertions(+), 16 deletions(-) diff --git a/src/api/wms/deliverRecordMain/index.ts b/src/api/wms/deliverRecordMain/index.ts index 45b38bdea..a0f1e4e3e 100644 --- a/src/api/wms/deliverRecordMain/index.ts +++ b/src/api/wms/deliverRecordMain/index.ts @@ -103,8 +103,8 @@ export const inducedProductUpdate = () => { } // 创建发货记录信息 -export const inducedProductCreate = () => { - return request.download({ url: '/wms/deliver-record-main/inducedProductCreate' }) +export const inducedProductCreate = (data) => { + return request.post({ url: '/wms/deliver-record-main/inducedProductCreate',data }) } diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index e0aeebd07..0c71124df 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -622,7 +622,6 @@ const opensearchTable = ( const _searchTableTitle = searchTitle const _searchTableAllSchemas = searchAllSchemas const _searchTablePage = searchPage - debugger searchTableRef.value.open( _searchTableTitle, _searchTableAllSchemas, diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 460094590..b946ce79a 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -418,6 +418,7 @@ export enum DICT_TYPE { SUPPLIER_TOOL_APPORT_STATEMENT_MAIN = 'supplier_tool_apport_statement_main', // 供应商模具费用主 SUPPLIER_TOOL_APPORT_STATEMENT_DETAIL = 'supplier_tool_apport_statement_detail', // 供应商模具费用子 PRODUCTION_LINE_ITEM = 'production_line_item', //顺引生产线项 + CLASS_ITEM = 'class_item', //顺引班组项 } diff --git a/src/views/eam/equipmentTransferRecord/index.vue b/src/views/eam/equipmentTransferRecord/index.vue index fa7a9b4ef..dcf8991ef 100644 --- a/src/views/eam/equipmentTransferRecord/index.vue +++ b/src/views/eam/equipmentTransferRecord/index.vue @@ -255,7 +255,7 @@ const searchFormClick = (searchData) => { } const onEnter = (a,b,c,d) =>{ - debugger + } /** 初始化 **/ diff --git a/src/views/wms/deliversettlementManage/ftSuppliesRecordMain/deliverRecordMain/index.vue b/src/views/wms/deliversettlementManage/ftSuppliesRecordMain/deliverRecordMain/index.vue index 4017621c6..3a6653aa8 100644 --- a/src/views/wms/deliversettlementManage/ftSuppliesRecordMain/deliverRecordMain/index.vue +++ b/src/views/wms/deliversettlementManage/ftSuppliesRecordMain/deliverRecordMain/index.vue @@ -288,7 +288,7 @@ const submitForm = async (formType, submitData) => { try { if (formType === 'create') { - await DeliverRecordMainApi.createDeliverRecordMain(data) + await DeliverRecordMainApi.createDeliverRecordMain(data) message.success(t('common.createSuccess')) getList() } else { diff --git a/src/views/wms/deliversettlementManage/inducedProduct/deliverRecordMain/deliverRecordMain.data.ts b/src/views/wms/deliversettlementManage/inducedProduct/deliverRecordMain/deliverRecordMain.data.ts index aa0d04312..4266f4874 100644 --- a/src/views/wms/deliversettlementManage/inducedProduct/deliverRecordMain/deliverRecordMain.data.ts +++ b/src/views/wms/deliversettlementManage/inducedProduct/deliverRecordMain/deliverRecordMain.data.ts @@ -32,6 +32,7 @@ export const DeliverRecordMain = useCrudSchemas( table: { width: 150 }, + isForm: false, form: { component: 'Select', componentProps: { @@ -647,7 +648,7 @@ export const DeliverRecordDetail = useCrudSchemas(reactive([ }, tableForm: { type: 'InputNumber', - min: 0, + min: 1, max:999999, // precision: 6 } @@ -664,6 +665,34 @@ export const DeliverRecordDetail = useCrudSchemas(reactive([ }, isTableForm: false, }, + { + label: '顺序号', + field: 'serialNo', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + isTableForm: true, + tableForm: { + component: 'InputNumber' + } + }, + { + label: '班次', + field: 'classes', + dictType: DICT_TYPE.CLASS_ITEM, + dictClass: 'string', + isTable: false, + sort: 'custom', + table: { + width: 150 + }, + isTableForm: true, + tableForm: { + type: 'Select' + }, + }, { label: '单价', field: 'singlePrice', @@ -889,6 +918,7 @@ export const DeliverRecordDetail = useCrudSchemas(reactive([ width: 150 }, isTable: true, + isTableForm: false, }, { label: '最后更新时间', diff --git a/src/views/wms/deliversettlementManage/inducedProduct/deliverRecordMain/index.vue b/src/views/wms/deliversettlementManage/inducedProduct/deliverRecordMain/index.vue index 4ee8caab5..72ab8373d 100644 --- a/src/views/wms/deliversettlementManage/inducedProduct/deliverRecordMain/index.vue +++ b/src/views/wms/deliversettlementManage/inducedProduct/deliverRecordMain/index.vue @@ -151,16 +151,16 @@ DeliverRecordDetail.allSchemas.tableFormColumns.map(item => { value: 'customerCode' , isMainValue: true }] - item.form.componentProps.searchCondition = [ - { - key: 'businessType', - value: businessType.value, - isMainValue: false - },{ - key: 'customerCode', - value: 'customerCode' , - isMainValue: true - }] + // item.form.componentProps.searchCondition = [ + // { + // key: 'businessType', + // value: businessType.value, + // isMainValue: false + // },{ + // key: 'customerCode', + // value: 'customerCode' , + // isMainValue: true + // }] } }) @@ -207,6 +207,73 @@ const buttonBaseClick = (val, item) => { } } +//为true表示子表数据中存在数量为0的数据 +const flag = ref(false) + +const submitForm = async (formType, submitData) => { + + let data = {...submitData} + if(formType == 'create'){ + if(data.masterId){ + data.id = data.masterId + } + flag.value = false + data.subList = tableData.value // 拼接子表数据参数 + data.subList.forEach(item=>{ + item.toWarehouseCode = data.toWarehouseCode + item.toLocationCode = data.toLocationCode + }) + let isExist = false + tableData.value.forEach(item => { + let rs = tableData.value.filter(filterItem => (filterItem.itemCode == item.itemCode)) + if(rs.length > 1) isExist = true + }) + data.businessType = businessType.value + console.log(data); + if (isExist) { + return message.warning('物料代码重复') + } + data.subList.forEach(obj => { + if(obj.qty == 0){ + message.warning(`数量不能为0!`) + flag.value = true + return; + } + }) + if(flag.value){ + return + } + formRef.value.formLoading = true + + try { + if (formType === 'create') { + if(tableData.value.length <= 0){ + message.warning(`子表明细不能为空!`) + flag.value = true + formRef.value.formLoading = false + return; + } + await DeliverRecordMainApi.inducedProductCreate(data).then(res=>{ + if(res.code == 200){ + } + }) + message.success(t('common.createSuccess')) + } + formRef.value.dialogVisible = false + // 刷新当前列表 + if (formType === 'create') { + getList() + }else{ + buttonBaseClick('refresh',null) + } + } finally { + formRef.value.formLoading = false + } + + } + +} + // 列表-操作按钮