From c8a72fc733419194f32b72630d8ca1d4f4e6eb29 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Tue, 19 Mar 2024 17:00:20 +0800 Subject: [PATCH] fix: bug --- .env.development | 2 +- src/pages/inLocation/addForm.vue | 10 ++++++---- src/pages/inLocation/index.vue | 2 +- src/pages/index.vue | 18 +++++++++++++++--- src/pages/outLocation/addForm.vue | 9 ++++++--- src/pages/sparePartsReturn/addForm.vue | 21 +++++++++++++-------- 6 files changed, 42 insertions(+), 20 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/pages/inLocation/addForm.vue b/src/pages/inLocation/addForm.vue index eebc62c..8014dda 100644 --- a/src/pages/inLocation/addForm.vue +++ b/src/pages/inLocation/addForm.vue @@ -93,11 +93,11 @@ - + - @@ -159,6 +159,7 @@ const locationList = ref([])//备件的库位列表 const locationItem = ref('')//备件账内库 const isFocus = ref(false) + const msg = ref('') function submit() { console.log(form.value) if (form.value.itemNumbers.length === 0) { @@ -220,7 +221,7 @@ return; } if (!form1.value.itemName) { - proxy.$modal.showToast('找不到该备件') + proxy.$modal.showToast(msg.value) return; } if (!form1.value.locationNumber) { @@ -265,7 +266,8 @@ function getLocation() { locationApi.getLocation(form1.value.locationNumber).then(res => { if (!res.data) { - proxy.$modal.showToast('找不到该库位') + msg.value = res.msg + proxy.$modal.showToast(res.msg) return; } locationItem.value = res.data diff --git a/src/pages/inLocation/index.vue b/src/pages/inLocation/index.vue index 91a46dd..f59e50a 100644 --- a/src/pages/inLocation/index.vue +++ b/src/pages/inLocation/index.vue @@ -19,7 +19,7 @@ 采购人:{{item.purchaser}} - 采购时间:{{item.date}} + 采购时间:{{`${item.date[0]}-${item.date[1]>=10?item.date[1]:'0'+item.date[1]}-${item.date[2]>=10?item.date[2]:'0'+item.date[2]}`}} diff --git a/src/pages/index.vue b/src/pages/index.vue index 3651178..838fadf 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -14,8 +14,10 @@ - {{store.name}} {{store.post.name}} - {{store.dept.name}} + {{store.name}} + + + @@ -32,6 +34,17 @@ + + 扫码 + + + + + 扫码 + + + + 采购入库 @@ -50,7 +63,6 @@ - diff --git a/src/pages/outLocation/addForm.vue b/src/pages/outLocation/addForm.vue index e68d95f..046b63a 100644 --- a/src/pages/outLocation/addForm.vue +++ b/src/pages/outLocation/addForm.vue @@ -89,7 +89,7 @@ - @@ -159,6 +159,7 @@ const isInAccount = ref('FALSE') const isFocus = ref(false) + const msg = ref('') // 触发提交表单 function submit() { if (form.value.itemNumbers.length === 0) { @@ -227,7 +228,7 @@ return; } if (!form1.value.itemNumber) { - proxy.$modal.showToast('库位没有对应的备件,请重新选择') + proxy.$modal.showToast(msg.value) return; } @@ -268,6 +269,7 @@ id: form.value.id, }).then(res => { if (!res.data) { + msg.value = res.msg return; } form1.value.areaNumber = res.data.areaNumber; @@ -278,7 +280,8 @@ form1.value.stockQty = res.data.qty || 0; isInAccount.value = res.data.isInAccount || '' // this.itemNumber = res.data.itemNumber || '' - }).catch(() => { + }).catch((error) => { + msg.value = error.msg form1.value.areaNumber = ''; form1.value.itemName = ''; form1.value.itemNumber = ''; diff --git a/src/pages/sparePartsReturn/addForm.vue b/src/pages/sparePartsReturn/addForm.vue index d248511..c68a3d6 100644 --- a/src/pages/sparePartsReturn/addForm.vue +++ b/src/pages/sparePartsReturn/addForm.vue @@ -58,16 +58,16 @@ - + - + - + 扫描 @@ -130,6 +130,7 @@ const singleColumnShow = ref(false) const choosesingleColumnItem = ref() const itemNumber = ref() + const msg = ref() // 触发提交表单 function submit() { @@ -170,7 +171,8 @@ const singleColumnShow = ref(false) form.value.reverterId = ''; form.value.itemNumbers = [] } else { - form.value = {} + form.value.reverterId = ''; + form.value.itemNumbers = [] } } @@ -228,7 +230,7 @@ const singleColumnShow = ref(false) return; } if (!form1.value.itemName) { - proxy.$modal.showToast('找不到该备件') + proxy.$modal.showToast(msg.value) return; } if (!form1.value.locationNumber) { @@ -240,7 +242,7 @@ const singleColumnShow = ref(false) return; } if (itemNumber.value) { - proxy.$modal.showToast('该库位已绑定过备件') + proxy.$modal.showToast(msg.value) return; } if (!form1.value.qty) { @@ -265,7 +267,8 @@ const singleColumnShow = ref(false) function getLocation() { locationApi.getLocation(form1.value.locationNumber).then(res => { if(!res.data){ - proxy.$modal.showToast('找不到该库位') + proxy.$modal.showToast(res.msg) + msg.value = res.msg return; } locationItem.value = res.data @@ -300,7 +303,8 @@ const singleColumnShow = ref(false) number: form1.value.itemNumber, }).then(res => { if(!res.data){ - proxy.$modal.showToast('找不到该备件') + proxy.$modal.showToast(res.msg) + msg.value = res.msg itemNumber.value = '' form1.value.areaNumber = '' form1.value.locationNumber = ''; @@ -323,6 +327,7 @@ const singleColumnShow = ref(false) isShow.value =true } }).catch((err)=>{ + msg.value = res.msg itemNumber.value = '' form1.value.areaNumber = '' form1.value.itemName = ''