From c05b81c7f50df80ab247a05f9f92af2d799e77cd Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期五, 10 四月 2026 15:59:04 +0800
Subject: [PATCH] feat:1.销售添加是否生产 2.生产订单添加备注

---
 src/views/qualityManagement/nonconformingManagement/index.vue |   63 ++++++++++++++++++++++---------
 1 files changed, 44 insertions(+), 19 deletions(-)

diff --git a/src/views/qualityManagement/nonconformingManagement/index.vue b/src/views/qualityManagement/nonconformingManagement/index.vue
index 169a2f3..a20a47a 100644
--- a/src/views/qualityManagement/nonconformingManagement/index.vue
+++ b/src/views/qualityManagement/nonconformingManagement/index.vue
@@ -5,9 +5,8 @@
         <div>
           <span class="search_title">绫诲瀷锛�</span>
           <el-select v-model="searchForm.inspectType" clearable style="width: 200px" @change="handleQuery">
-            <el-option label="鍘熸潗鏂欐楠�" :value="0" />
             <el-option label="杩囩▼妫�楠�" :value="1" />
-            <el-option label="鍑哄巶妫�楠�" :value="2" />
+            <el-option label="鎴愬搧妫�楠�" :value="2" />
           </el-select>
         </div>
         <div style="margin-left: 10px">
@@ -35,7 +34,7 @@
         <el-button type="primary" @click="handleQuery" style="margin-left: 10px">鎼滅储</el-button>
       </div>
       <div>
-        <el-button type="primary" @click="openForm('add')">鏂板</el-button>
+        <!-- <el-button type="primary" @click="openForm('add')">鏂板</el-button> -->
         <el-button @click="handleOut">瀵煎嚭</el-button>
         <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
       </div>
@@ -60,10 +59,10 @@
 
 <script setup>
 import { Search } from "@element-plus/icons-vue";
-import {onMounted, ref} from "vue";
+import {onMounted, ref, reactive, toRefs, nextTick, getCurrentInstance} from "vue";
 import FormDia from "@/views/qualityManagement/nonconformingManagement/components/formDia.vue";
 import {ElMessageBox} from "element-plus";
-import {qualityUnqualifiedDel, qualityUnqualifiedListPage} from "@/api/qualityManagement/nonconformingManagement.js";
+import {qualityUnqualifiedDel, qualityUnqualifiedListPage, liftTheQuarantineQualityUnqualified} from "@/api/qualityManagement/nonconformingManagement.js";
 import InspectionFormDia from "@/views/qualityManagement/nonconformingManagement/components/inspectionFormDia.vue";
 import dayjs from "dayjs";
 
@@ -72,12 +71,9 @@
     inspectType: "",
     inspectState: "",
     productName: "",
-    entryDate: [
-      dayjs().format("YYYY-MM-DD"),
-      dayjs().add(1, "day").format("YYYY-MM-DD"),
-    ], // 褰曞叆鏃ユ湡
-    entryDateStart: dayjs().format("YYYY-MM-DD"),
-    entryDateEnd: dayjs().add(1, "day").format("YYYY-MM-DD"),
+    entryDate: undefined, // 褰曞叆鏃ユ湡
+    entryDateStart: undefined,
+    entryDateEnd: undefined,
   },
 });
 const { searchForm } = toRefs(data);
@@ -116,12 +112,10 @@
     dataType: "tag",
     width: 120,
     formatData: (params) => {
-      if (params == 0) {
-        return "鍘熸潗鏂欐楠�";
-      } else if (params == 1) {
+      if (params == 1) {
         return "杩囩▼妫�楠�";
       } else {
-        return '鍑哄巶妫�楠�';
+        return '鎴愬搧妫�楠�';
       }
     },
     formatType: (params) => {
@@ -145,6 +139,15 @@
   {
     label: "瑙勬牸鍨嬪彿",
     prop: "model",
+  },
+  {
+    label: "鐢熶骇鎵瑰彿",
+    prop: "batchNo",
+    width: 140,
+  },
+  {
+    label: "鏂欏彿",
+    prop: "materialCode",
   },
   {
     label: "鍗曚綅",
@@ -180,14 +183,15 @@
     label: "鎿嶄綔",
     align: "center",
     fixed: "right",
-    width: 120,
+    width: 100,
     operation: [
       {
-        name: "缂栬緫",
+        name: "鍙栨秷闅旂",
         type: "text",
         clickFun: (row) => {
-          openForm("edit", row);
+          liftTheQuarantine(row);
         },
+        showHide: (row) => row.dealResult === '闅旂' && !row.quarantineLifted
       },
       {
         name: "澶勭悊",
@@ -195,6 +199,7 @@
         clickFun: (row) => {
           openInspectionForm("edit", row);
         },
+        disabled: (row) => row.inspectState === 1,
       },
     ],
   },
@@ -237,7 +242,11 @@
   params.entryDate = undefined
   qualityUnqualifiedListPage(params).then(res => {
     tableLoading.value = false;
-    tableData.value = res.data.records
+    const records = res.data.records || [];
+    tableData.value = records.map((row) => ({
+      ...row,
+      batchNo: row.batchNo ?? row.productionBatchNo ?? "",
+    }));
     page.total = res.data.total;
   }).catch(err => {
     tableLoading.value = false;
@@ -250,17 +259,33 @@
 
 // 鎵撳紑寮规
 const openForm = (type, row) => {
+  if (type !== 'add' && row?.inspectState === 1) {
+    proxy.$modal.msgWarning("宸插鐞嗙殑鏁版嵁涓嶈兘鍐嶇紪杈�");
+    return;
+  }
   nextTick(() => {
     formDia.value?.openDialog(type, row)
   })
 };
 // 鎵撳紑澶勭悊寮规
 const openInspectionForm = (type, row) => {
+  if (row?.inspectState === 1) {
+    proxy.$modal.msgWarning("宸插鐞嗙殑鏁版嵁涓嶈兘鍐嶅鐞�");
+    return;
+  }
   nextTick(() => {
     inspectionFormDia.value?.openDialog(type, row)
   })
 };
 
+const liftTheQuarantine = (row) => {
+  proxy.$modal.confirm("鏄惁纭鍙栨秷闅旂?").then(function () {
+    return liftTheQuarantineQualityUnqualified(row)
+  }).then(() => {
+    proxy.$modal.msgSuccess("鍙栨秷闅旂鎴愬姛");
+    getList();
+  }).catch(() => {})
+}
 // 鍒犻櫎
 const handleDelete = () => {
   let ids = [];

--
Gitblit v1.9.3