From a38cdfdd1f32f5a99eb64089cbd15719a37bb810 Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Wed, 30 Oct 2024 09:46:41 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E6=8D=A2=E8=B4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchaseBarterRequest/index.vue | 19 ++++++++----------- .../purchaseBarterRequestMain.data.ts | 3 +++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/index.vue b/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/index.vue index f2ebbc2fa..922eb890a 100644 --- a/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/index.vue +++ b/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/index.vue @@ -59,7 +59,6 @@ @tableSelectionDelete="tableSelectionDelete" @searchTableSuccess="searchTableSuccess" @submitForm="submitForm" - @inputNumberChange="inputNumberChange" @tableFormSelectOnBlur="tableFormSelectOnBlur" > @@ -76,7 +75,6 @@ :Echo="Echo" @searchTableSuccessDetail="searchTableSuccessDetail" :detailValidate="detailValidate" - @detailOpenForm="detailOpenForm" @onBlur="onBlur" /> @@ -490,6 +488,10 @@ const submitForm = async (formType, submitData) => { data.id = data.masterId } data.subList = tableData.value // 拼接子表数据参数 + const cmdExists = data.subList.some(filter => + parseFloat(filter.inventoryQty) < parseFloat(filter.qty) + ); + try { if (formType === 'create') { if(data.subList.length == 0){ @@ -507,6 +509,10 @@ const submitForm = async (formType, submitData) => { if(flag){ return } + if(cmdExists){ + message.warning("换货数量不能大于库存数量") + return + } formRef.value.formLoading = true await PurchaseBarterRequestMainApi.createPurchaseBarterRequestMain(data) message.success(t('common.createSuccess')) @@ -566,14 +572,6 @@ const searchFormClick = (searchData) => { getList() // 刷新当前列表 } -// 创建标签 -const inputNumberChange = (field, index, row, val) => { - if(field == 'qty' || field == 'singlePrice'){ - row.amount = row.qty * row.singlePrice - } -} - - let validityDays = 0 const detailOpenForm = (type, row)=>{ console.log('detailOpenForm',row) @@ -607,7 +605,6 @@ const tableFormSelectOnBlur = (field, val, row, index) => { tableData.value[index][field] = val.target.value } } - /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/purchaseBarterRequestMain.data.ts b/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/purchaseBarterRequestMain.data.ts index 2639dbbfc..b724fb19f 100644 --- a/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/purchaseBarterRequestMain.data.ts +++ b/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/purchaseBarterRequestMain.data.ts @@ -297,4 +297,7 @@ export const PurchaseBarterRequestDetailRules = reactive({ qty:[ { validator:validateQty, message: '换货数量必须是一个正数', trigger: 'change'} ], + itemCode: [ + { required: true, message: '请输入物料代码', trigger: 'blur' } + ], })