From bc365ef47ae4e01754aeadbae26170e11c9bb80e Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 22 六月 2026 16:56:12 +0800
Subject: [PATCH] 新疆马铃薯 1.删除按钮添加操作权限

---
 src/views/qualityManagement/processInspection/index.vue |   46 ++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 40 insertions(+), 6 deletions(-)

diff --git a/src/views/qualityManagement/processInspection/index.vue b/src/views/qualityManagement/processInspection/index.vue
index dd40a5e..8d838c8 100644
--- a/src/views/qualityManagement/processInspection/index.vue
+++ b/src/views/qualityManagement/processInspection/index.vue
@@ -21,7 +21,7 @@
       <el-button type="primary" @click="openQuickCheck">蹇�熸楠�</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>
+      <el-button type="danger" plain @click="handleDelete" v-hasPermi="['qualityManagement:processInspection:remove']">鍒犻櫎</el-button>
     </div>
       <PIMTable rowKey="id"
                 :column="tableColumn"
@@ -81,10 +81,10 @@
           <div class="template-icon weilong-icon">浼�</div>
           <div class="template-name">浼熼緳妯℃澘</div>
         </div>
-        <!-- <div class="template-item" @click="handleTemplateExport('baishi')">
+        <div class="template-item" @click="handleTemplateExport('baishi')">
           <div class="template-icon baishi-icon">鐧�</div>
           <div class="template-name">鐧句簨妯℃澘</div>
-        </div> -->
+        </div>
         <div class="template-item" @click="handleTemplateExport('dali')">
           <div class="template-icon dali-icon">杈�</div>
           <div class="template-name">杈惧埄妯℃澘</div>
@@ -128,7 +128,6 @@
     exportWeilongTemplate,
     exportBaishiTemplate,
     exportDaliTemplate,
-    exportCommonTemplate,
   } from "@/api/qualityManagement/rawMaterialInspection.js";
   import FilesDia from "@/views/qualityManagement/processInspection/components/filesDia.vue";
   import dayjs from "dayjs";
@@ -236,6 +235,22 @@
           return "鏈彁浜�";
         }
       },
+    },
+    {
+      label: "妫�楠岃鍒�",
+      prop: "inspectRule",
+      width: 100,
+      formatData: (val) => val === 0 ? "鍏ㄦ" : val === 1 ? "鎶芥" : ""
+    },
+    {
+      label: "鎶芥姣斾緥(%)",
+      prop: "sampleRatio",
+      width: 120,
+    },
+    {
+      label: "鎶芥鏁伴噺",
+      prop: "sampleQuantity",
+      width: 100,
     },
     {
       dataType: "action",
@@ -498,17 +513,36 @@
       return;
     }
     const id = currentExportRow.value.id;
+
+    if (templateType === 'common') {
+      downloadQualityInspect({ id }).then(blobData => {
+        const blob = new Blob([blobData], {
+          type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
+        });
+        const link = document.createElement("a");
+        link.href = URL.createObjectURL(blob);
+        link.download = "杩囩▼妫�楠屾姤鍛�.docx";
+        document.body.appendChild(link);
+        link.click();
+        document.body.removeChild(link);
+        URL.revokeObjectURL(link.href);
+        proxy.$modal.msgSuccess("瀵煎嚭鎴愬姛");
+        closeTemplateDialog();
+      }).catch(() => {
+        proxy.$modal.msgError("瀵煎嚭澶辫触");
+      });
+      return;
+    }
+
     const fileNameMap = {
       weilong: "浼熼緳妯$増妫�楠岀粨鏋�.doc",
       baishi: "鐧句簨妯$増妫�楠岀粨鏋�.doc",
       dali: "杈惧埄妯$増妫�楠岀粨鏋�.doc",
-      common: "閫氱敤妯$増妫�楠岀粨鏋�.doc",
     };
     const exportFuncMap = {
       weilong: exportWeilongTemplate,
       baishi: exportBaishiTemplate,
       dali: exportDaliTemplate,
-      common: exportCommonTemplate,
     };
     try {
       const response = await exportFuncMap[templateType](id);

--
Gitblit v1.9.3