From 8cc901ed214f3885b34a07d0520fbcfd50063439 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期三, 19 十一月 2025 14:30:39 +0800
Subject: [PATCH] fix: 完成绞线自检,生产确认等功能新增
---
src/pages/production/twist/report/index.vue | 63 ++++++++++++++++++++-----------
1 files changed, 41 insertions(+), 22 deletions(-)
diff --git a/src/pages/production/twist/report/index.vue b/src/pages/production/twist/report/index.vue
index b9244b1..c1b3b25 100644
--- a/src/pages/production/twist/report/index.vue
+++ b/src/pages/production/twist/report/index.vue
@@ -2,7 +2,29 @@
<view class="list">
<z-paging ref="pagingRef" v-model="twistReportList" :fixed="false" @query="getTwistReportList">
<template #top>
- <CardTitle title="鎶ュ伐淇℃伅" :hideAction="true" :full="false" @action="addReport" />
+ <CardTitle title="鎶ュ伐淇℃伅" :hideAction="false" :full="false">
+ <template #action>
+ <wd-button
+ icon="chart"
+ :round="false"
+ size="small"
+ plain
+ style="margin-right: 10px"
+ @click="handleSelfCheck"
+ >
+ 鑷
+ </wd-button>
+ <wd-button
+ icon="file-add"
+ :round="false"
+ size="small"
+ custom-class="add_btn"
+ @click="addReport"
+ >
+ 鏂板
+ </wd-button>
+ </template>
+ </CardTitle>
</template>
<wd-card v-for="item in twistReportList" :key="item.id" type="rectangle" custom-class="round">
<template #title>
@@ -19,14 +41,6 @@
<template #footer>
<wd-button size="small" plain style="margin-right: 10px" @click="toAttachment(item)">
闄勪欢
- </wd-button>
- <wd-button
- size="small"
- plain
- style="margin-right: 10px"
- @click="handleSelfCheck(item.id)"
- >
- 鑷
</wd-button>
<wd-button size="small" plain type="error" @click="handleDelete(item)">鍒犻櫎</wd-button>
</template>
@@ -68,7 +82,7 @@
import TwistApi from "@/api/product/twist";
import Draw from "./draw.vue";
import HomeApi from "@/api/home";
-import { setTeamId, getTeamId } from "@/utils/cache";
+import { setTeamId, getTeamId, setPrepareId } from "@/utils/cache";
const drawFormRef = reactive({
visible: false,
@@ -149,24 +163,30 @@
const twistReportList = ref<any[]>([]);
const teamId = ref<string | number | null>(null);
-// 鑾峰彇骞剁紦瀛樼彮缁処D
+// 鑾峰彇骞剁紦瀛樼彮缁処D鍜岀敓浜у噯澶嘔D
const initTeamId = async () => {
// 鍏堝皾璇曚粠缂撳瓨鑾峰彇
const cachedTeamId = getTeamId();
if (cachedTeamId) {
teamId.value = cachedTeamId;
- return;
}
- // 濡傛灉缂撳瓨涓病鏈夛紝鍒欒皟鐢ㄦ帴鍙h幏鍙�
+ // 璋冪敤鎺ュ彛鑾峰彇鏈�鏂版暟鎹�
try {
const { data } = await HomeApi.getIndex();
- if (data && data.team) {
- teamId.value = data.team;
- setTeamId(data.team);
+ if (data) {
+ // 瀛樺偍鐝粍ID
+ if (data.team) {
+ teamId.value = data.team;
+ setTeamId(data.team);
+ }
+ // 瀛樺偍鐢熶骇鍑嗗ID
+ if (data.prepareId) {
+ setPrepareId(data.prepareId);
+ }
}
} catch (error) {
- console.error("鑾峰彇鐝粍ID澶辫触:", error);
+ console.error("鑾峰彇鏁版嵁澶辫触:", error);
}
};
@@ -293,11 +313,10 @@
}
};
-const handleSelfCheck = (id: string) => {
- console.log("鎵ц鑷鎿嶄綔锛孖D:", id);
- uni.showToast({
- title: "鑷鍔熻兘寮�鍙戜腑",
- icon: "none",
+const handleSelfCheck = () => {
+ // 璺宠浆鍒拌嚜妫�椤甸潰锛屼紶閫� wireId
+ uni.navigateTo({
+ url: `/pages/production/twist/selfInspect/index?id=${paramsId.value}`,
});
};
--
Gitblit v1.9.3