From 5b62f70d5df5731a571d709f0f9ff312a7cec5dc Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期四, 20 十一月 2025 16:25:59 +0800
Subject: [PATCH] fix: 巡检加上绞合外径可选
---
src/pages/production/twist/receive/monofil.vue | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 57 insertions(+), 2 deletions(-)
diff --git a/src/pages/production/twist/receive/monofil.vue b/src/pages/production/twist/receive/monofil.vue
index 9456e8e..b4998fc 100644
--- a/src/pages/production/twist/receive/monofil.vue
+++ b/src/pages/production/twist/receive/monofil.vue
@@ -25,7 +25,12 @@
<block v-for="item in nodeList" :key="item">
<wd-tab :title="item.twistedLayer" :name="item.twistedLayer">
<scroll-view class="content" scroll-y>
- <MonofilCard v-for="(m, i) in item.strandedWireDish" :key="i" :data="m" />
+ <MonofilCard
+ v-for="(m, i) in item.strandedWireDish"
+ :key="i"
+ :data="m"
+ @delete="handleDeleteCard(item, m)"
+ />
</scroll-view>
</wd-tab>
</block>
@@ -123,8 +128,20 @@
toast.error("鏈壘鍒板綋鍓嶉�変腑鐨勫眰");
return;
}
+
+ // 瑙f瀽鎵爜鏁版嵁
+ const scanData = JSON.parse(code.code);
+
+ // 鍒ゆ柇灞傜骇鏄惁鍖归厤
+ if (scanData.layer && scanData.layer !== currentLayer.twistedLayer) {
+ toast.error(
+ `棰嗙敤灞傜骇涓嶅锛屽綋鍓嶅眰鏄細${currentLayer.twistedLayer}锛岄鐢ㄥ崟涓濆眰鏄細${scanData.layer}`
+ );
+ // return;
+ }
+
const { data } = await TwistApi.getScarn({
- outPutId: JSON.parse(code.code).id,
+ outPutId: scanData.id,
twistId: currentLayer.twistId,
});
@@ -333,6 +350,44 @@
}
};
+// 鍒犻櫎鍗$墖
+const handleDeleteCard = async (layer: any, cardData: any) => {
+ // 鏄剧ず纭鎻愮ず
+ uni.showModal({
+ title: "鎻愮ず",
+ content: "纭畾瑕佸垹闄よ鍗曚笣鍚楋紵",
+ success: async (res) => {
+ if (res.confirm) {
+ try {
+ // 濡傛灉鏈塱d锛岃皟鐢ㄦ帴鍙e垹闄�
+ if (cardData.id !== undefined && cardData.id !== null) {
+ const { code, msg } = await TwistApi.deleteStrandedWireDish(cardData.id);
+ if (code !== 200) {
+ toast.error(msg || "鍒犻櫎澶辫触");
+ return;
+ }
+ }
+
+ // 鍓嶇鐩存帴鍒犻櫎锛堟棤璁烘槸鍚︽湁id锛岄兘浠庡墠绔垹闄わ級
+ if (layer.strandedWireDish && Array.isArray(layer.strandedWireDish)) {
+ const index = layer.strandedWireDish.findIndex(
+ (item: any) => item.monofilamentNumber === cardData.monofilamentNumber
+ );
+ if (index !== -1) {
+ layer.strandedWireDish.splice(index, 1);
+ toast.success("鍒犻櫎鎴愬姛");
+ // 鍒锋柊褰撳墠灞傜殑鏁版嵁鏄剧ず
+ getList();
+ }
+ }
+ } catch (error: any) {
+ toast.error(error.msg || "鍒犻櫎澶辫触");
+ }
+ }
+ },
+ });
+};
+
onLoad(async (options: any) => {
// 寮�鍚箍鎾洃鍚簨浠�
uni.$on("scanMono", getScanCode);
--
Gitblit v1.9.3