From 1dc18db8439ce29fee28edf6627aaadc8726c49c Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期一, 25 十二月 2023 17:02:02 +0800
Subject: [PATCH] 	modified:   src/api/plan/productionschedul.js 	modified:   src/views/plan/productionschedul/index.vue 	modified:   src/views/quality/rawMaterial/rawMaterial-form.vue 	modified:   src/views/technology/routing/index.vue 	modified:   vue.config.js

---
 src/views/technology/routing/index.vue |  139 +++++++++++++++++-----------------------------
 1 files changed, 51 insertions(+), 88 deletions(-)

diff --git a/src/views/technology/routing/index.vue b/src/views/technology/routing/index.vue
index 4c685f1..8c9a5b9 100644
--- a/src/views/technology/routing/index.vue
+++ b/src/views/technology/routing/index.vue
@@ -13,20 +13,21 @@
         ref="routingTable"
       >
         <template #toolbar>
-          <el-button
-            v-if="permissions.technology_routing_ifssync"
-            type="primary"
-            :loading="ifsSynsLoading"
-            @click="syncIfs"
-            >IFS鍚屾</el-button
-          >
-          <el-button
-            v-if="permissions.technology_routing_advancecalc"
-            type="primary"
-            :loading="preCalcLoading"
-            @click="calcTech"
-            >鎻愬墠璁$畻</el-button
-          >
+          <el-button v-if="permissions.technology_routing_add"
+          type="primary" @click="addOrUpdateHandle">鏂板</el-button>
+          <el-button @click="() => {this.approveHandle('ACCEPT')}" 
+          :disabled="!uniqueStateArr.includes('01draft')"
+          v-if="permissions.technology_routing_accept">鎵瑰噯</el-button>
+          <el-button @click="() => {this.approveHandle('REVOKE')}" 
+          :disabled="!uniqueStateArr.includes('02accepted')"
+          v-if="permissions.technology_routing_revoke">鎾ゅ洖</el-button>
+          <el-button @click="() => {this.approveHandle('CANCEL')}"
+          :disabled="!uniqueStateArr.includes('02accepted')"
+          v-if="permissions.technology_routing_cancel">鎷掔粷</el-button>
+          <el-button @click="copyRouting"
+          v-if="permissions.technology_routing_cancel">澶嶅埗</el-button>
+          <el-button @click="() => {this.deleteAll()}" type="primary" 
+          v-if="permissions.technology_routing_batch_del">鎵归噺鍒犻櫎</el-button>
         </template>
       </ttable>
       <el-dialog title="瀵煎叆" :visible.sync="importRoutingVisible" width="50%">
@@ -114,7 +115,6 @@
 import {
   fetchList,
   delObj,
-  changeState,
   changeStateBatch,
   exportRoutingTemplate,
   routingIfsSync,
@@ -132,6 +132,7 @@
   data() {
     return {
       ids: [],
+      uniqueStateArr: [],
       ajaxFun: fetchList,
       multipleSelection: [],
       isShowQuery: false,
@@ -356,65 +357,8 @@
             searchInfoType: 'datetimerange'
           }
         ],
-        toolbar: [
-          {
-            text: '鏂板',
-            type: 'primary',
-            fun: this.addOrUpdateHandle,
-            disabled: false,
-            permitArr: []
-          },
-          {
-            text: '鎵瑰噯',
-            fun: () => {
-              this.approveHandle('ACCEPT')
-            },
-            disabled: false,
-            permitArr: ['01draft']
-          },
-          {
-            text: '鎾ゅ洖',
-            fun: () => {
-              this.approveHandle('REVOKE')
-            },
-            disabled: false,
-            permitArr: ['02accepted']
-          },
-          {
-            text: '鎷掔粷',
-            fun: () => {
-              this.approveHandle('CANCEL')
-            },
-            disabled: false,
-            permitArr: ['02accepted']
-          },
-          {
-            text: '澶嶅埗',
-            fun: this.copyRouting,
-            disabled: false,
-            permitArr: []
-          },
-          {
-            text: '鍒犻櫎',
-            fun: () => {
-              this.deleteAll()
-            },
-            disabled: false,
-            permitArr: []
-          }
-        ],
-        operator: [
-          {
-            text: '鍒犻櫎',
-            type: 'text',
-            size: 'small',
-            fun: this.deleteHandle
-            // show: {
-            //   val: ['01draft'],
-            //   key: 'state'
-            // }
-          }
-        ],
+        toolbar: [],
+        operator: null,
         operatorConfig: {
           fixed: 'right',
           label: '鎿嶄綔',
@@ -491,6 +435,20 @@
     this.getData()
   },
   created() {
+    if(this.permissions.technology_routing_del){
+      this.table.operator = [
+          {
+            text: '鍒犻櫎',
+            type: 'text',
+            size: 'small',
+            fun: this.deleteHandle
+            // show: {
+            //   val: ['01draft'],
+            //   key: 'state'
+            // }
+          }
+        ]
+    }
     this.getBomTypeDbOptions()
   },
   methods: {
@@ -508,6 +466,10 @@
     },
     // 鏂板 / 淇敼
     addOrUpdateHandle(row) {
+      if(!this.permissions.technology_routing_edit && row.id!=null){
+        this.$message.error("璇ヨ鑹叉病鏈夋搷浣滄潈闄�")
+        return
+      }
       this.$router.push({
         name: 'routingForm',
         query: { id: row == null ? null : row.id }
@@ -613,21 +575,22 @@
           uniqueStateArr.push(stateArr[i])
         }
       }
+      this.uniqueStateArr = uniqueStateArr
       // 寰幆琛ㄥご鎸夐挳锛屽垽鏂瘡涓寜閽殑permitArr鏄惁瀹屽叏鍖呭惈閫変腑鐘舵�侊紝鑻ュ畬鍏ㄥ寘鍚紝鍒欐寜閽寒锛屽惁鍒欐寜閽伆
-      var toolbar = this.table.toolbar
-      for (var j = 0; j < toolbar.length; j++) {
-        if (
-          uniqueStateArr.every((val) =>
-            toolbar[j].permitArr.length <= 0
-              ? true
-              : toolbar[j].permitArr.includes(val)
-          )
-        ) {
-          toolbar[j].disabled = false
-        } else {
-          toolbar[j].disabled = true
-        }
-      }
+      // var toolbar = this.table.toolbar
+      // for (var j = 0; j < toolbar.length; j++) {
+      //   if (
+      //     uniqueStateArr.every((val) =>
+      //       toolbar[j].permitArr.length <= 0
+      //         ? true
+      //         : toolbar[j].permitArr.includes(val)
+      //     )
+      //   ) {
+      //     toolbar[j].disabled = false
+      //   } else {
+      //     toolbar[j].disabled = true
+      //   }
+      // }
       // 灏嗛�変腑璁板綍璧嬪�肩粰multipleSelection
       this.multipleSelection = val
     },

--
Gitblit v1.9.3