From 6b0e90800f1a34e3ea482ca70eb0180044e1f342 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期一, 20 十月 2025 16:48:22 +0800
Subject: [PATCH] 逻辑优化
---
components/mold.vue | 40 ++++++++++------------------------------
1 files changed, 10 insertions(+), 30 deletions(-)
diff --git a/components/mold.vue b/components/mold.vue
index de5a74d..8b76410 100644
--- a/components/mold.vue
+++ b/components/mold.vue
@@ -263,7 +263,7 @@
workOrderNo: this.workOrderNo,
machineNo: this.machineNo,
toolNo: this.selectedToolNo,
- type: '涓婂垁',
+ type: '涓婃満',
useLimit,
sdjs // 涓婂垁璁℃暟锛堝伐鍗曞綋鍓嶆暟閲囷級
};
@@ -274,24 +274,14 @@
data: JSON.stringify(payload),
headers: { 'Content-Type': 'application/json' }
});
- if (res.data && res.data.outMsg) {
- const isRepeat = res.data.outMsg === '閲嶅涓婁笅鍒�';
+ if (res.data && res.data.outSum === "0") {
uni.showToast({
- title: res.data.outMsg,
- icon: isRepeat ? 'error' : 'none'
- });
- if (isRepeat) return; // 鎶ラ敊鏃朵笉鍐嶇户缁�
- } else if (res.status === 0) {
- uni.showToast({
- title: '涓嬪垁鎻愪氦鎴愬姛',
- icon: 'success'
- });
- } else {
- uni.showToast({
- title: res.message || '涓嬪垁鎻愪氦澶辫触',
+ title: res.data.outMsg || '',
icon: 'error'
});
+ return;
}
+ else uni.showToast({ title: res.data.outMsg || '' });
if (res.status === 0) {
await this.fetchFormData();
}
@@ -318,7 +308,7 @@
workOrderNo: this.workOrderNo,
machineNo: this.machineNo,
toolNo: this.selectedToolNo,
- type: '涓嬪垁',
+ type: '涓嬫満',
useLimit,
xdjs // 涓嬪垁璁℃暟
};
@@ -329,24 +319,14 @@
data: JSON.stringify(payload),
headers: { 'Content-Type': 'application/json' }
});
- if (res.data && res.data.outMsg) {
- const isRepeat = res.data.outMsg === '閲嶅涓婁笅鍒�';
+ if (res.data && res.data.outSum === "0") {
uni.showToast({
- title: res.data.outMsg,
- icon: isRepeat ? 'error' : 'none'
- });
- if (isRepeat) return; // 鎶ラ敊鏃朵笉鍐嶇户缁�
- } else if (res.status === 0) {
- uni.showToast({
- title: '涓嬪垁鎻愪氦鎴愬姛',
- icon: 'success'
- });
- } else {
- uni.showToast({
- title: res.message || '涓嬪垁鎻愪氦澶辫触',
+ title: res.data.outMsg || '',
icon: 'error'
});
+ return;
}
+ else uni.showToast({ title: res.data.outMsg || '' });
if (res.status === 0) {
await this.fetchFormData();
}
--
Gitblit v1.9.3