From 5c135980cc00787be64ed50eef716aa64d4f0aa7 Mon Sep 17 00:00:00 2001
From: zhang_li <2235006734@qqq.com>
Date: Fri, 22 Mar 2024 16:24:21 +0800
Subject: [PATCH] fix: bug
---
src/pages/deviceReport/addForm.vue | 6 ++-
src/pages/overhaulOrder/addForm.vue | 12 +++++-
src/pages/overhaulOrder/addServiceRecord.vue | 12 +++++-
src/pages/repairOrder/addForm.vue | 12 +++++-
src/pages/repairOrder/addServiceRecord.vue | 12 +++++-
src/pages/repairOrder/detail.vue | 37 ++++++++++++++++---
src/pages/repairOrder/transfer.vue | 6 ++-
src/pages/sparePartsApplication/addForm.vue | 6 ++-
.../addForm.vue | 6 ++-
src/pages/spotCheckOrder/addForm.vue | 6 ++-
src/pages/upkeepOrder/addServiceRecord.vue | 16 ++++++--
11 files changed, 109 insertions(+), 22 deletions(-)
diff --git a/src/pages/deviceReport/addForm.vue b/src/pages/deviceReport/addForm.vue
index 00e6f81..14e3205 100644
--- a/src/pages/deviceReport/addForm.vue
+++ b/src/pages/deviceReport/addForm.vue
@@ -220,7 +220,11 @@
loading.value = false
}, 1500)
} else {
- proxy.$modal.showToast('添加失败')
+ if(res.msg){
+ proxy.$modal.showToast(res.msg)
+ }else{
+ proxy.$modal.showToast('添加失败')
+ }
loading.value = false
}
}).catch(() => {
diff --git a/src/pages/overhaulOrder/addForm.vue b/src/pages/overhaulOrder/addForm.vue
index 6b314e1..134413e 100644
--- a/src/pages/overhaulOrder/addForm.vue
+++ b/src/pages/overhaulOrder/addForm.vue
@@ -149,7 +149,11 @@
loading.value = false
}, 1500)
} else {
- proxy.$modal.showToast('添加失败')
+ if(res.msg){
+ proxy.$modal.showToast(res.msg)
+ }else{
+ proxy.$modal.showToast('添加失败')
+ }
loading.value = false
}
}).catch(() => {
@@ -170,7 +174,11 @@
loading.value = false
}, 1500)
} else {
- proxy.$modal.showToast('添加失败')
+ if(res.msg){
+ proxy.$modal.showToast(res.msg)
+ }else{
+ proxy.$modal.showToast('添加失败')
+ }
loading.value = false
}
}).catch(() => {
diff --git a/src/pages/overhaulOrder/addServiceRecord.vue b/src/pages/overhaulOrder/addServiceRecord.vue
index 01d5794..9cd12e9 100644
--- a/src/pages/overhaulOrder/addServiceRecord.vue
+++ b/src/pages/overhaulOrder/addServiceRecord.vue
@@ -282,7 +282,11 @@
loading.value = false
}, 1500)
} else {
- proxy.$modal.showToast('添加失败')
+ if(res.msg){
+ proxy.$modal.showToast(res.msg)
+ }else{
+ proxy.$modal.showToast('添加失败')
+ }
loading.value = false
}
}).catch(() => {
@@ -303,7 +307,11 @@
loading.value = false
}, 1500)
} else {
- proxy.$modal.showToast('添加失败')
+ if(res.msg){
+ proxy.$modal.showToast(res.msg)
+ }else{
+ proxy.$modal.showToast('添加失败')
+ }
loading.value = false
}
}).catch(() => {
diff --git a/src/pages/repairOrder/addForm.vue b/src/pages/repairOrder/addForm.vue
index d70c758..9a48d63 100644
--- a/src/pages/repairOrder/addForm.vue
+++ b/src/pages/repairOrder/addForm.vue
@@ -234,7 +234,11 @@
loading.value = false
}, 1500)
} else {
- proxy.$modal.showToast('添加失败')
+ if(res.msg){
+ proxy.$modal.showToast(res.msg)
+ }else{
+ proxy.$modal.showToast('添加失败')
+ }
loading.value = false
}
}).catch(() => {
@@ -255,7 +259,11 @@
loading.value = false
}, 1500)
} else {
- proxy.$modal.showToast('添加失败')
+ if(res.msg){
+ proxy.$modal.showToast(res.msg)
+ }else{
+ proxy.$modal.showToast('添加失败')
+ }
loading.value = false
}
}).catch(() => {
diff --git a/src/pages/repairOrder/addServiceRecord.vue b/src/pages/repairOrder/addServiceRecord.vue
index ba0cd14..6f4ec97 100644
--- a/src/pages/repairOrder/addServiceRecord.vue
+++ b/src/pages/repairOrder/addServiceRecord.vue
@@ -178,7 +178,11 @@
loading.value = false
}, 1500)
} else {
- proxy.$modal.showToast('添加失败')
+ if(res.msg){
+ proxy.$modal.showToast(res.msg)
+ }else{
+ proxy.$modal.showToast('添加失败')
+ }
loading.value = false
}
}).catch(() => {
@@ -199,7 +203,11 @@
loading.value = false
}, 1500)
} else {
- proxy.$modal.showToast('添加失败')
+ if(res.msg){
+ proxy.$modal.showToast(res.msg)
+ }else{
+ proxy.$modal.showToast('添加失败')
+ }
loading.value = false
}
}).catch(() => {
diff --git a/src/pages/repairOrder/detail.vue b/src/pages/repairOrder/detail.vue
index cb18c34..72b9ac7 100644
--- a/src/pages/repairOrder/detail.vue
+++ b/src/pages/repairOrder/detail.vue
@@ -322,7 +322,7 @@
orderClick(2)
}
// APP维修工单接单、点击完成、验证
- function orderClick(type) {
+ async function orderClick(type) {
// 如果是接单
// if (this.data.status == 'PENDING') {
// if (this.$store.state.user.dept.parentId != this.data.factoryAreaNumber) {
@@ -353,9 +353,7 @@
classes: data.value.classes,
faultType: data.value.faultType
}
- let tips = data.value.status == 'PENDING' ? '是否接单?' : data.value.status == 'PECEIVED' ? '是否完成?' : data
- .value.status == 'COMPLETED' ? '是否验证完结?' : ''
- proxy.$modal.confirm(tips).then(async () => {
+ if(type ==2){
proxy.$modal.loading('加载中')
loading.value = true
// 如果直接点击完成先走修改工单接口
@@ -380,7 +378,36 @@
proxy.$modal.closeLoading()
loading.value = false
})
- })
+ }else{
+ let tips = data.value.status == 'PENDING' ? '是否接单?' : data.value.status == 'PECEIVED' ? '是否完成?' : data
+ .value.status == 'COMPLETED' ? '是否验证完结?' : ''
+ proxy.$modal.confirm(tips).then(async () => {
+ proxy.$modal.loading('加载中')
+ loading.value = true
+ // 如果直接点击完成先走修改工单接口
+ if (data.value.status == 'PECEIVED') {
+ await repairOrderApi.repairOrderUpdate(dataTwo).then((res) => { }).catch(() => {
+ proxy.$modal.closeLoading()
+ loading.value = false
+ })
+ }
+ await repairOrderApi.orderClick(dataOne).then((res) => {
+ if (res.data) {
+ proxy.$modal.showToast('操作成功')
+ setTimeout(() => {
+ proxy.$tab.navigateBack()
+ loading.value = false
+ }, 1500)
+ } else {
+ proxy.$modal.showToast('操作失败')
+ loading.value = false
+ }
+ }).catch(() => {
+ proxy.$modal.closeLoading()
+ loading.value = false
+ })
+ })
+ }
}
// 获取维修报修信息
function getDeviceRepairDetailsByNumber() {
diff --git a/src/pages/repairOrder/transfer.vue b/src/pages/repairOrder/transfer.vue
index c032d3a..0d1232f 100644
--- a/src/pages/repairOrder/transfer.vue
+++ b/src/pages/repairOrder/transfer.vue
@@ -183,7 +183,11 @@
loading.value = false
}, 1500)
} else {
- proxy.$modal.showToast('转办失败')
+ if(res.msg){
+ proxy.$modal.showToast(res.msg)
+ }else{
+ proxy.$modal.showToast('转办失败')
+ }
loading.value = false
}
}).catch(() => {
diff --git a/src/pages/sparePartsApplication/addForm.vue b/src/pages/sparePartsApplication/addForm.vue
index 8fb0464..b257d78 100644
--- a/src/pages/sparePartsApplication/addForm.vue
+++ b/src/pages/sparePartsApplication/addForm.vue
@@ -185,7 +185,11 @@
loading.value = false
}, 1500)
} else {
- proxy.$modal.showToast('添加失败')
+ if(res.msg){
+ proxy.$modal.showToast(res.msg)
+ }else{
+ proxy.$modal.showToast('添加失败')
+ }
loading.value = false
}
}).catch(() => {
diff --git a/src/pages/sparePartsServiceWorkOrderList/addForm.vue b/src/pages/sparePartsServiceWorkOrderList/addForm.vue
index 22c8a2d..1a1da93 100644
--- a/src/pages/sparePartsServiceWorkOrderList/addForm.vue
+++ b/src/pages/sparePartsServiceWorkOrderList/addForm.vue
@@ -162,7 +162,11 @@
loading.value = false
}, 1500)
} else {
- proxy.$modal.showToast('添加失败')
+ if(res.msg){
+ proxy.$modal.showToast(res.msg)
+ }else{
+ proxy.$modal.showToast('添加失败')
+ }
loading.value = false
}
}).catch(() => {
diff --git a/src/pages/spotCheckOrder/addForm.vue b/src/pages/spotCheckOrder/addForm.vue
index 0e872e5..56d0d47 100644
--- a/src/pages/spotCheckOrder/addForm.vue
+++ b/src/pages/spotCheckOrder/addForm.vue
@@ -189,7 +189,11 @@
loading.value = false
}, 1500)
} else {
- proxy.$modal.showToast('添加失败')
+ if(res.msg){
+ proxy.$modal.showToast(res.msg)
+ }else{
+ proxy.$modal.showToast('添加失败')
+ }
loading.value = false
}
}).catch(() => {
diff --git a/src/pages/upkeepOrder/addServiceRecord.vue b/src/pages/upkeepOrder/addServiceRecord.vue
index 8446884..aeb038a 100644
--- a/src/pages/upkeepOrder/addServiceRecord.vue
+++ b/src/pages/upkeepOrder/addServiceRecord.vue
@@ -9,10 +9,10 @@
-->
-
+
-
+
@@ -263,7 +263,11 @@ const form = ref({
loading.value = false
}, 1500)
} else {
- proxy.$modal.showToast('添加失败')
+ if(res.msg){
+ proxy.$modal.showToast(res.msg)
+ }else{
+ proxy.$modal.showToast('添加失败')
+ }
loading.value = false
}
}).catch(() => {
@@ -284,7 +288,11 @@ const form = ref({
loading.value = false
}, 1500)
} else {
- proxy.$modal.showToast('添加失败')
+ if(res.msg){
+ proxy.$modal.showToast(res.msg)
+ }else{
+ proxy.$modal.showToast('添加失败')
+ }
loading.value = false
}
}).catch(() => {