From 2f03e1f738092cfb906cd548d18e8deb4f39b658 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期三, 06 五月 2026 14:05:33 +0800
Subject: [PATCH] 生产追溯接口对接

---
 src/views/productionManagement/workOrderManagement/index.vue |   35 ++++++++++++++++++++++++++++++-----
 1 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/src/views/productionManagement/workOrderManagement/index.vue b/src/views/productionManagement/workOrderManagement/index.vue
index c1b0474..600b274 100644
--- a/src/views/productionManagement/workOrderManagement/index.vue
+++ b/src/views/productionManagement/workOrderManagement/index.vue
@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <div class="search_form">
+    <div class="search_form mb20">
       <div class="search-row">
         <div class="search-item">
           <span class="search_title">宸ュ崟缂栧彿锛�</span>
@@ -13,7 +13,7 @@
         </div>
         <div class="search-item">
           <span class="search_title">鐢熶骇璁㈠崟鍙凤細</span>
-          <el-input v-model="searchForm.productOrderNpsNo"
+          <el-input v-model="searchForm.npsNo"
                     style="width: 240px"
                     placeholder="璇疯緭鍏�"
                     @change="handleQuery"
@@ -244,6 +244,7 @@
                     @refresh="getList" />
     <FileList v-if="fileDialogVisible"
               v-model:visible="fileDialogVisible"
+              :editable="!currentWorkOrderRow?.endOrder"
               :record-type="'production_operation_task'"
               :record-id="currentWorkOrderId" />
   </div>
@@ -264,8 +265,13 @@
   import QRCode from "qrcode";
   import { getCurrentInstance, reactive, toRefs } from "vue";
   import MaterialDialog from "./components/MaterialDialog.vue";
-  import FileList from "@/components/Dialog/FileList.vue";
+  const FileList = defineAsyncComponent(() =>
+    import("@/components/Dialog/FileList.vue")
+  );
+
+  import useUserStore from "@/store/modules/user";
   const { proxy } = getCurrentInstance();
+  const userStore = useUserStore();
 
   const tableColumn = ref([
     {
@@ -368,7 +374,23 @@
           clickFun: row => {
             showReportDialog(row);
           },
-          disabled: row => row.planQuantity <= 0,
+          showHide: row => !row.endOrder,
+          disabled: row => {
+            if (row.planQuantity <= 0) return true;
+            if (!row.userIds) return false;
+            try {
+              const userIds =
+                typeof row.userIds === "string"
+                  ? JSON.parse(row.userIds)
+                  : row.userIds;
+              if (Array.isArray(userIds)) {
+                return !userIds.some(id => String(id) === String(userStore.id));
+              }
+              return true;
+            } catch (e) {
+              return true;
+            }
+          },
         },
       ],
     },
@@ -505,7 +527,7 @@
   const data = reactive({
     searchForm: {
       workOrderNo: "",
-      productOrderNpsNo: "",
+      npsNo: "",
     },
   });
   const { searchForm } = toRefs(data);
@@ -614,9 +636,11 @@
   const printTransferCard = () => {
     window.print();
   };
+  const currentWorkOrderRow = ref(null);
 
   const openWorkOrderFiles = row => {
     currentWorkOrderId.value = row.id;
+    currentWorkOrderRow.value = row;
     fileDialogVisible.value = true;
   };
 
@@ -801,6 +825,7 @@
   };
 
   onMounted(() => {
+    userStore.getInfo();
     getList();
     // 鑾峰彇鐢ㄦ埛鍒楄〃
     userListNoPageByTenantId().then(res => {

--
Gitblit v1.9.3