From e4b4ac1a1b4b6e2063c3919bdd6f727bd3bb64e6 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Tue, 26 Mar 2024 14:07:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E5=BA=93=E6=95=B0=E9=87=8F=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- src/api/location.js | 4 +- src/pages/inLocation/addForm.vue | 4 +- src/pages/outLocation/addForm.vue | 117 ++++++++++++++++++------- src/pages/sparePartsReturn/addForm.vue | 2 + 5 files changed, 91 insertions(+), 38 deletions(-) diff --git a/.env.development b/.env.development index 1244d0b..7dc61fc 100644 --- a/.env.development +++ b/.env.development @@ -1,3 +1,3 @@ -VITE_BASE_URL=http://localhost:12080/admin-api +VITE_BASE_URL=http://192.168.0.106:12080/admin-api VITE_BASE_URL_IMAGE=http://localhost:12080/admin-api \ No newline at end of file diff --git a/src/api/location.js b/src/api/location.js index 1a7e8eb..02738b5 100644 --- a/src/api/location.js +++ b/src/api/location.js @@ -5,8 +5,8 @@ export function getLocation(number) { return http.get('/eam/location/scanCodeByNumber?number='+number) } // 出库获取库位 -export function getOutLocation(params) { - return http.get('/eam/location/outScanCodeByNumber',{params}) +export function getOutLocation(data) { + return http.post('/eam/location/outScanCodeByNumber',data) } // 首页扫码获取详情 export function pdaItemAndLocation(number) { diff --git a/src/pages/inLocation/addForm.vue b/src/pages/inLocation/addForm.vue index 8014dda..780a560 100644 --- a/src/pages/inLocation/addForm.vue +++ b/src/pages/inLocation/addForm.vue @@ -83,7 +83,8 @@ 添加备件 - + + @@ -115,6 +116,7 @@ + 取消 确认 diff --git a/src/pages/outLocation/addForm.vue b/src/pages/outLocation/addForm.vue index 4285ef2..44fe33c 100644 --- a/src/pages/outLocation/addForm.vue +++ b/src/pages/outLocation/addForm.vue @@ -67,6 +67,21 @@ 申请数量:{{item.applyQty}} + + + 库位编码:{{item.locationNumber}} + + + + + + 库位类型:{{item.isInAccount == 'FALSE'?'帐外库' :'帐内库'}} + + @@ -86,35 +101,40 @@ 添加备件 - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 取消 确认 @@ -153,6 +173,7 @@ applyQty: '', receiveQty: '', stockQty: '', + totalReception:'', qty: '' }) const isShow = ref(false) @@ -194,9 +215,17 @@ } // 获取订单信息详情 async function getInLocationDetail() { + // let itemNumbers = form.value.itemNumbers.map(item=>{ + // return { + // itemNumber:item.itemNumber, + // qty:item.qty, + // locationNumber:item.locationNumber, + // } + // }) await outLocationApi.getOutLocationDetail({ id: form.value.id, - number: form.value.number + number: form.value.number, + // itemNumbers:itemNumbers || [] }).then(res => { form.value.applyName = res.data.applyName form.value.approveName = res.data.approveName @@ -239,14 +268,14 @@ proxy.$modal.showToast('已出库数量和出库数量不可大于申请数量') return; } - if (Number(form1.value.qty) > Number(form1.value.stockQty)) { - proxy.$modal.showToast('出库数量不可大于库存数量') + if (Number(form1.value.qty) > Number(form1.value.totalReception)) { + proxy.$modal.showToast('出库数量不可大于剩余出库数量') return; } if (form.value.itemNumbers && form.value.itemNumbers.length > 0) { - let arr = form.value.itemNumbers.filter(item => item.itemNumber == form1.value.itemNumber) + let arr = form.value.itemNumbers.filter(item => item.locationNumber == form1.value.locationNumber) if (arr && arr.length > 0) { - proxy.$modal.showToast('该备件已添加') + proxy.$modal.showToast('该库位已添加') return; } let arr1 = form.value.subList.filter(item => item.itemNumber == form1.value.itemNumber) @@ -263,12 +292,29 @@ form.value.itemNumbers.splice(index, 1) } function getLocation() { + let itemNumbers = form.value.itemNumbers.map(item=>{ + return { + itemNumber:item.itemNumber, + qty:item.qty, + locationNumber:item.locationNumber, + } + }) locationApi.getOutLocation({ number: form1.value.locationNumber, id: form.value.id, + itemNumbers:itemNumbers }).then(res => { if (!res.data) { msg.value = res.msg + form1.value.areaNumber = ''; + form1.value.itemName = ''; + form1.value.itemNumber = ''; + form1.value.receiveQty =''; + form1.value.applyQty =''; + form1.value.stockQty = ''; + form1.value.totalReception =''; + form1.value.isInAccount =''; + isInAccount.value =''; return; } form1.value.areaNumber = res.data.areaNumber; @@ -277,7 +323,10 @@ form1.value.receiveQty = res.data.receiveQty || 0; form1.value.applyQty = res.data.applyQty || 0; form1.value.stockQty = res.data.qty || 0; + form1.value.totalReception = res.data.totalReception || 0; + form1.value.isInAccount = res.data.isInAccount; isInAccount.value = res.data.isInAccount || '' + // this.itemNumber = res.data.itemNumber || '' }).catch((error) => { msg.value = error.msg diff --git a/src/pages/sparePartsReturn/addForm.vue b/src/pages/sparePartsReturn/addForm.vue index d8b6a5c..2a8e62d 100644 --- a/src/pages/sparePartsReturn/addForm.vue +++ b/src/pages/sparePartsReturn/addForm.vue @@ -54,6 +54,7 @@ 添加备件 + @@ -80,6 +81,7 @@ + 取消 确认