From b3e77e218df41d05bb5d5039e6e4c7cd0fb4c5c5 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 06 三月 2025 14:23:29 +0800
Subject: [PATCH] 业务流程添加按钮权限

---
 src/views/business/productOrder/index.vue |   52 +++++++++++++++++++++++++++++++---------------------
 1 files changed, 31 insertions(+), 21 deletions(-)

diff --git a/src/views/business/productOrder/index.vue b/src/views/business/productOrder/index.vue
index f26f4dd..a7a22f7 100644
--- a/src/views/business/productOrder/index.vue
+++ b/src/views/business/productOrder/index.vue
@@ -46,8 +46,13 @@
     <div class="table-tab">
       <div>
         <ul class="tab">
-          <li v-for="(m, i) in tabList" :key="i + 'afgh'" :class="{ active: i == tabIndex }" @click="handleTab(m, i)">{{ m.label }}
-          </li>
+          <li :class="{ active: tabIndex === 0 }" v-if="checkPermi(['get:insOrder:reviewed'])" @click="handleTab(0)">寰呭鏍�</li>
+          <li :class="{ active: tabIndex === 1 }" v-if="checkPermi(['get:insOrder:checkout'])" @click="handleTab(1)">妫�楠屼腑</li>
+          <li :class="{ active: tabIndex === 2 }" v-if="checkPermi(['get:insOrder:customerOrdered'])" @click="handleTab(2)">濮旀墭宸叉</li>
+          <li :class="{ active: tabIndex === 3 }" v-if="checkPermi(['get:insOrder:spotCheck'])" @click="handleTab(3)">鎶芥牱宸叉</li>
+          <li :class="{ active: tabIndex === 4 }" v-if="checkPermi(['get:insOrder:sendBack'])" @click="handleTab(4)">閫�鍥�</li>
+          <li :class="{ active: tabIndex === 5 }" v-if="checkPermi(['get:insOrder:revocation'])" @click="handleTab(5)">鎾ら攢</li>
+          <li :class="{ active: tabIndex === 6 }" v-if="checkPermi(['get:insOrder:all'])" @click="handleTab(6)">鍏ㄩ儴</li>
         </ul>
       </div>
       <div>
@@ -55,7 +60,7 @@
           @click="downLoad">瀵煎嚭</el-button>
         <el-button v-if="tabIndex === 1" size="small" type="primary" @click="openAddIns">娣诲姞妫�楠岄」</el-button>
         <el-button size="small" type="primary" @click="openPrint">鏍囩鎵撳嵃</el-button>
-        <el-button size="small" type="primary" @click="playOrder(1)">涓嬪崟</el-button>
+        <el-button v-if="checkPermi(['add:insOrder'])" size="small" type="primary" @click="playOrder(1)">涓嬪崟</el-button>
       </div>
     </div>
     <div class="table">
@@ -168,8 +173,7 @@
         <span slot="footer" class="dialog-footer">
           <el-row>
             <el-button @click="handleNo">{{ deleteTilte == '鎾ら攢' ? '鍙� 娑�' : '涓嶉�氳繃' }}</el-button>
-            <el-button :loading="printLoading" type="primary" @click="submitDelete">{{ deleteTilte == '鎾ら攢' ? '纭� 瀹�' : '閫�
-              杩�'}}</el-button>
+            <el-button :loading="printLoading" type="primary" @click="submitDelete">{{ deleteTilte == '鎾ら攢' ? '纭� 瀹�' : '閫氳繃'}}</el-button>
           </el-row>
         </span>
       </el-dialog>
@@ -316,6 +320,7 @@
 } from "@/api/business/productOrder";
 import { selectUserCondition } from "@/api/performance/class";
 import { downFile, getFileList, selectSampleAndProductByOrderId } from "@/api/business/rawMaterialOrder";
+import {mapGetters} from "vuex";
 // import Inspection from "../do/b1-inspect-order-plan/Inspection.vue";
 export default {
   components: {
@@ -334,7 +339,7 @@
       tableData: [],
       tableLoading: false,
       column: [
-        { label: '濮旀墭缂栧彿', prop: 'entrustCode' },
+        { label: '濮旀墭缂栧彿', prop: 'entrustCode', width: '160px' },
         { label: '濮旀墭鍗曚綅', prop: 'company' },
         { label: '鏍峰搧鍚嶇О', prop: 'sampleName' },
         { label: '鏍峰搧鍨嬪彿', prop: 'sampleModel' },
@@ -550,7 +555,7 @@
         current: 1
       },
       tableDataLookColumn: [
-        { label: '鏍峰搧缂栧彿', prop: 'sampleCode' },
+        { label: '鏍峰搧缂栧彿', prop: 'sampleCode', width: '160px' },
         { label: '鏍峰搧鍚嶇О', prop: 'sample' },
         { label: '妫�楠岄」鍒嗙被', prop: 'inspectionItemClass' },
         { label: '妫�楠岄」', prop: 'inspectionItem' },
@@ -660,7 +665,7 @@
       componentDataDelete: [],
       tableLoadingDelete: false,
       columnDelete: [
-        { label: '鏍峰搧缂栧彿', prop: 'sampleCode' },
+        { label: '鏍峰搧缂栧彿', prop: 'sampleCode', width: '160px' },
         { label: '妫�楠岄」鍒嗙被', prop: 'inspectionItemClass' },
         { label: '妫�楠岄」', prop: 'inspectionItem' },
         { label: '妫�楠岄」瀛愮被', prop: 'inspectionItemSubclass' },
@@ -684,7 +689,7 @@
           label: '寰呭鏍�',
           value: 0
         }, {
-          label: '寰呮楠�',
+          label: '妫�楠屼腑',
           value: 1
         },
         {
@@ -735,6 +740,9 @@
         this.isIndeterminate = true;
       }
     }
+  },
+  computed: {
+    ...mapGetters(["nickName"]),
   },
   mounted() {
     this.refreshTable()
@@ -869,8 +877,8 @@
     // 瀵煎嚭璁板綍
     downLoad() {
       rawAllInsOrderExport({ ...this.entity }).then(res => {
-        let url = this.javaApi + '/word/' + res.data
-        this.$download.saveAs(url, '濮旀墭妫�娴嬩俊鎭鍑�.xlsx');
+        const blob = new Blob([res], { type: 'application/octet-stream' });
+        this.$download.saveAs(blob, '濮旀墭妫�娴嬩俊鎭鍑�.xlsx');
       }).catch(err => {
         console.log('err---', err);
       })
@@ -1172,7 +1180,7 @@
     handleVerify(row) {
       this.$router.push({ path: "/productOrder/add", query: { examine: 1, active: 3, currentId: row.id } });
     },
-    handleTab(m, i) {
+    handleTab(i) {
       this.tabIndex = i;
       this.refreshTable()
     },
@@ -1183,15 +1191,17 @@
       if (row.userName) {
         inspectorList = row.userName.split(',')
       }
-      let user = JSON.parse(localStorage.getItem('user'))
-      if (user) {
-        inspectorList.push(user.name)
-      }
-      this.inspectorList = inspectorList
-      this.sonLaboratory = row.sonLaboratory
-      this.state = 3;
-      this.typeSource = row.typeSource
-      this.orderId = row.id
+      inspectorList.push(this.nickName)
+      this.$router.push({
+        path: "/inspectionTask/inspection",
+        query: {
+          sonLaboratory: row.sonLaboratory,
+          state: 3,
+          typeSource: row.typeSource,
+          orderId: row.id,
+          inspectorList: inspectorList,
+        },
+      })
     },
     goback() {
       this.state = 0

--
Gitblit v1.9.3