From f42a646e394dbf4b68cb1beba0015ca8de03a61c Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 27 五月 2026 14:19:43 +0800
Subject: [PATCH] 君歌 1.不合格管理修改

---
 src/views/qualityManagement/nonconformingManagement/index.vue |  293 +++++++++++++++++++++++++++-------------------------------
 1 files changed, 137 insertions(+), 156 deletions(-)

diff --git a/src/views/qualityManagement/nonconformingManagement/index.vue b/src/views/qualityManagement/nonconformingManagement/index.vue
index 132921a..97e2f6d 100644
--- a/src/views/qualityManagement/nonconformingManagement/index.vue
+++ b/src/views/qualityManagement/nonconformingManagement/index.vue
@@ -1,38 +1,40 @@
-// 涓嶅悎鏍肩鐞�
+// 涓嶅悎鏍煎搧澶勭悊鍗�
 <template>
   <div class="app-container">
     <div class="search_form">
       <div style="display: flex;flex-direction: row;align-items: center;">
         <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-select>
-        </div>
-        <div style="margin-left: 10px">
           <span class="search_title">鐘舵�侊細</span>
-          <el-select v-model="searchForm.inspectState" clearable style="width: 200px" @change="handleQuery">
-            <el-option label="寰呭鐞�" :value="0" />
-            <el-option label="宸插鐞�" :value="1" />
+          <el-select v-model="searchForm.status" 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="3" />
+            <el-option label="宸查┏鍥�" :value="4" />
           </el-select>
         </div>
         <div style="margin-left: 10px">
-          <span class="search_title">浜у搧鍚嶇О锛�</span>
+          <span class="search_title">椤圭洰鍚嶇О锛�</span>
           <el-input
-              v-model="searchForm.productName"
+              v-model="searchForm.projectName"
               style="width: 200px"
-              placeholder="璇疯緭鍏ヤ骇鍝佸悕绉版悳绱�"
+              placeholder="璇疯緭鍏ラ」鐩悕绉版悳绱�"
               @change="handleQuery"
               clearable
               :prefix-icon="Search"
           />
         </div>
-        <span  style="margin-left: 10px" class="search_title">妫�娴嬫棩鏈燂細</span>
-        <el-date-picker  v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange"
-												 style="width: 300px"
-                         placeholder="璇烽�夋嫨" clearable @change="changeDaterange" />
+        <div style="margin-left: 10px">
+          <span class="search_title">澶勭悊鍗曞彿锛�</span>
+          <el-input
+              v-model="searchForm.orderNo"
+              style="width: 200px"
+              placeholder="璇疯緭鍏ュ鐞嗗崟鍙锋悳绱�"
+              @change="handleQuery"
+              clearable
+              :prefix-icon="Search"
+          />
+        </div>
         <el-button type="primary" @click="handleQuery" style="margin-left: 10px">鎼滅储</el-button>
       </div>
       <div>
@@ -55,9 +57,7 @@
       >
       </PIMTable>
     </div>
-    <DetailDia ref="detailDiaRef" />
     <FormDia ref="formDia" @close="handleQuery"></FormDia>
-    <InspectionFormDia ref="inspectionFormDia" @close="handleQuery"></InspectionFormDia>
   </div>
 </template>
 
@@ -67,136 +67,130 @@
 import FormDia from "@/views/qualityManagement/nonconformingManagement/components/formDia.vue";
 import {ElMessageBox} from "element-plus";
 import {qualityUnqualifiedDel, qualityUnqualifiedListPage} from "@/api/qualityManagement/nonconformingManagement.js";
-import InspectionFormDia from "@/views/qualityManagement/nonconformingManagement/components/inspectionFormDia.vue";
-import DetailDia from "@/views/qualityManagement/nonconformingManagement/components/detailDia.vue";
-import dayjs from "dayjs";
 
 const data = reactive({
   searchForm: {
-    inspectType: "",
-    inspectState: "",
-    productName: "",
-    entryDate: undefined, // 褰曞叆鏃ユ湡
-    entryDateStart: undefined,
-    entryDateEnd: undefined,
+    status: "",
+    projectName: "",
+    orderNo: "",
   },
 });
 const { searchForm } = toRefs(data);
 const tableColumn = ref([
   {
     label: "鐘舵��",
-    prop: "inspectState",
+    prop: "status",
     dataType: "tag",
+    width: 100,
     formatData: (params) => {
-      if (params == 0) {
-        return "寰呭鐞�";
-      } else if (params == 1) {
-        return "宸插鐞�";
-      } else {
-        return null;
-      }
+      const statusMap = {
+        0: "鑽夌",
+        1: "寰呭鏍�",
+        2: "瀹℃壒涓�",
+        3: "宸插畬鎴�",
+        4: "宸查┏鍥�"
+      };
+      return statusMap[params] || "-";
     },
     formatType: (params) => {
-      if (params == '涓嶅悎鏍�') {
-        return "danger";
-      } else if (params == '鍚堟牸') {
-        return "success";
-      } else {
-        return null;
-      }
+      const typeMap = {
+        0: "info",
+        1: "warning",
+        2: "primary",
+        3: "success",
+        4: "danger"
+      };
+      return typeMap[params] || "info";
     },
   },
   {
-    label: "妫�娴嬫棩鏈�",
-    prop: "checkTime",
+    label: "澶勭悊鍗曞彿",
+    prop: "orderNo",
+    width: 160
+  },
+  {
+    label: "椤圭洰鍚嶇О",
+    prop: "projectName",
+    width: 140
+  },
+  {
+    label: "椤圭洰缂栧彿",
+    prop: "projectNo",
+    width: 140
+  },
+  {
+    label: "璁惧鍚嶇О",
+    prop: "equipmentName",
+    width: 140
+  },
+  {
+    label: "鐗╂枡/閮ㄤ欢鍚嶇О",
+    prop: "materialName",
+    width: 160
+  },
+  {
+    label: "鍨嬪彿瑙勬牸",
+    prop: "specificationModel",
     width: 120
-  },
-  {
-    label: "绫诲埆",
-    prop: "inspectType",
-    dataType: "tag",
-    width: 120,
-    formatData: (params) => {
-      if (params == 0) {
-        return "鍘熸潗鏂欐楠�";
-      } else if (params == 1) {
-        return "杩囩▼妫�楠�";
-      } else {
-        return '鍑哄巶妫�楠�';
-      }
-    },
-    formatType: (params) => {
-      if (params == '涓嶅悎鏍�') {
-        return "info";
-      } else if (params == '鍚堟牸') {
-        return "success";
-      } else {
-        return 'primary';
-      }
-    },
-  },
-  {
-    label: "妫�楠屽憳",
-    prop: "checkName",
-  },
-  {
-    label: "浜у搧鍚嶇О",
-    prop: "productName",
-  },
-  {
-    label: "瑙勬牸鍨嬪彿",
-    prop: "model",
-  },
-  {
-    label: "鍗曚綅",
-    prop: "unit",
   },
   {
     label: "鏁伴噺",
     prop: "quantity",
+    width: 80
+  },
+  {
+    label: "涓嶅悎鏍兼暟",
+    prop: "unqualifiedQuantity",
+    width: 90
+  },
+  {
+    label: "涓嶅悎鏍煎伐搴�",
+    prop: "unqualifiedProcess",
+    width: 100,
+    formatData: (params) => {
+      const processMap = {
+        1: "鏉ユ枡",
+        2: "鍒剁▼",
+        3: "鎴愬搧"
+      };
+      return processMap[params] || "-";
+    },
+  },
+  {
+    label: "妫�楠屽憳",
+    prop: "inspectorName",
     width: 100
   },
   {
-    label: "涓嶅悎鏍肩幇璞�",
-    prop: "defectivePhenomena",
+    label: "妫�楠屾棩鏈�",
+    prop: "inspectDate",
     width: 120
   },
   {
-    label: "澶勭悊缁撴灉",
-    prop: "dealResult",
+    label: "璐d换浜�",
+    prop: "responsiblePerson",
+    width: 100
+  },
+  {
+    label: "璐d换閮ㄩ棬",
+    prop: "responsibleDept",
     width: 120
   },
   {
-    label: "澶勭悊浜�",
-    prop: "dealName",
-    width: 120
-  },
-  {
-    label: "澶勭悊鏃ユ湡",
-    prop: "dealTime",
-    width: 120
-  },
-  {
-    label: "鍘熷洜鍒嗘瀽",
-    prop: "reasonAnalysis",
-    slot: "reasonAnalysis",
-    width: 120
-  },
-  {
-    label: "棰勯槻涓庣籂姝f帾鏂�",
-    prop: "preventiveCorrective",
-    slot: "preventiveCorrective",
-    width: 120
-  },
-  {
-    label: "宸ユ椂鎹熷け",
-    prop: "lossWorking",
-    width: 140
-  },
-  {
-    label: "鏉愭枡璐规崯澶�",
-    prop: "lossMaterial",
-    width: 140
+    label: "澶勭疆鏂瑰紡",
+    prop: "disposalMethod",
+    width: 100,
+    formatData: (params) => {
+      const disposalMap = {
+        1: "璁╂鎺ユ敹",
+        2: "鍘傚唴缁翠慨",
+        3: "杩斿巶缁翠慨",
+        4: "鎹㈣揣",
+        5: "閫�璐�",
+        6: "鎶ュ簾"
+      };
+      return disposalMap[params] || "-";
+    },
   },
   {
     dataType: "action",
@@ -206,19 +200,18 @@
     width: 140,
     operation: [
       {
-        name: "璇︽儏",
+        name: "缂栬緫",
         type: "text",
         clickFun: (row) => {
-          openDetailDialog(row);
+          openForm("edit", row);
         },
       },
       {
-        name: "澶勭悊",
+        name: "鍒犻櫎",
         type: "text",
         clickFun: (row) => {
-          openInspectionForm("edit", row);
+          handleDeleteRow(row);
         },
-        disabled: (row) => row.inspectState === 1,
       },
     ],
   },
@@ -232,19 +225,8 @@
   total: 0
 });
 const formDia = ref()
-const inspectionFormDia = ref()
-const detailDiaRef = ref()
 const { proxy } = getCurrentInstance()
 
-const changeDaterange = (value) => {
-  searchForm.value.entryDateStart = undefined;
-  searchForm.value.entryDateEnd = undefined;
-  if (value) {
-    searchForm.value.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD");
-    searchForm.value.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD");
-  }
-  getList();
-};
 // 鏌ヨ鍒楄〃
 /** 鎼滅储鎸夐挳鎿嶄綔 */
 const handleQuery = () => {
@@ -259,7 +241,6 @@
 const getList = () => {
   tableLoading.value = true;
   const params = { ...searchForm.value, ...page };
-  params.entryDate = undefined
   qualityUnqualifiedListPage(params).then(res => {
     tableLoading.value = false;
     tableData.value = res.data.records
@@ -275,27 +256,27 @@
 
 // 鎵撳紑寮规
 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 handleDeleteRow = (row) => {
+  ElMessageBox.confirm("纭鍒犻櫎璇ヤ笉鍚堟牸鍝佸鐞嗗崟锛�", "鎻愮ず", {
+    confirmButtonText: "纭",
+    cancelButtonText: "鍙栨秷",
+    type: "warning",
   })
-};
-// 鎵撳紑璇︽儏寮规
-const openDetailDialog = (row) => {
-  detailDiaRef.value?.openDialog(row);
+      .then(() => {
+        qualityUnqualifiedDel([row.id]).then((res) => {
+          proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+          getList();
+        });
+      })
+      .catch(() => {
+        proxy.$modal.msg("宸插彇娑�");
+      });
 };
 
 // 鍒犻櫎
@@ -307,7 +288,7 @@
     proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
     return;
   }
-  ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
+  ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鎻愮ず", {
     confirmButtonText: "纭",
     cancelButtonText: "鍙栨秷",
     type: "warning",
@@ -330,7 +311,7 @@
     type: "warning",
   })
       .then(() => {
-        proxy.download("/quality/qualityUnqualified/export", {}, "涓嶅悎鏍肩鐞�.xlsx");
+        proxy.download("/qualityUnqualifiedOrder/export", {}, "涓嶅悎鏍煎搧澶勭悊鍗�.xlsx");
       })
       .catch(() => {
         proxy.$modal.msg("宸插彇娑�");

--
Gitblit v1.9.3