From 61a529b98c0994b5e78804a6e95df11f49764a91 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期三, 20 十二月 2023 13:20:43 +0800
Subject: [PATCH] 	modified:   src/views/plan/customerorder/index.vue 	modified:   src/views/technology/completeproductstructure/index.vue 	modified:   src/views/technology/document/index.vue 	modified:   src/views/technology/routing/index.vue 	modified:   src/views/technology/routing/routing-form.vue

---
 src/views/plan/customerorder/index.vue                  |    1 
 src/views/technology/routing/routing-form.vue           |    3 
 src/views/technology/document/index.vue                 |   83 ++++++-------
 src/views/technology/routing/index.vue                  |  116 ++++++------------
 src/views/technology/completeproductstructure/index.vue |  109 ++++++-----------
 5 files changed, 120 insertions(+), 192 deletions(-)

diff --git a/src/views/plan/customerorder/index.vue b/src/views/plan/customerorder/index.vue
index 159596c..061bfc5 100644
--- a/src/views/plan/customerorder/index.vue
+++ b/src/views/plan/customerorder/index.vue
@@ -414,6 +414,7 @@
             width: '100px',
             prop: 'contractNo',
             label: '鍚堝悓缂栧彿',
+            sort: true,
             isTrue: true,
             isSearch: true,
             searchInfoType: 'text',
diff --git a/src/views/technology/completeproductstructure/index.vue b/src/views/technology/completeproductstructure/index.vue
index 7903eab..b1b962e 100644
--- a/src/views/technology/completeproductstructure/index.vue
+++ b/src/views/technology/completeproductstructure/index.vue
@@ -10,7 +10,21 @@
         :ajaxFun="ajaxFun"
         ref="completeProductStructureTable"
       >
-        <template #toolbar></template>
+        <template #toolbar>
+          <el-button type="primary" @click="addByStructureHandle" 
+          v-if="permissions.technology_completeproductstructure_bom">浜у搧缁撴瀯鐢熸垚BOM</el-button>
+          <el-button @click="() => {this.approveHandle('ACCEPT')}" 
+          :disabled="uniqueStateArr.includes('01draft')"
+          v-if="permissions.technology_completeproductstructure_accept">鎵瑰噯</el-button>
+          <el-button @click="() => {this.approveHandle('REVOKE')}" 
+          :disabled="uniqueStateArr.includes('02accepted')"
+          v-if="permissions.technology_completeproductstructure_revoke">鎾ゅ洖</el-button>
+          <el-button @click="() => {this.approveHandle('CANCEL')}"
+          :disabled="uniqueStateArr.includes('02accepted')"
+          v-if="permissions.technology_completeproductstructure_cancel">鎷掔粷</el-button>
+          <el-button @click="() => {this.deleteAll()}" type="primary" 
+          v-if="permissions.technology_completeproductstructure_batch_delete">鎵归噺鍒犻櫎</el-button>
+        </template>
       </ttable>
     </basic-container>
   </div>
@@ -214,54 +228,7 @@
             searchInfoType: 'datetimerange',
           },
         ],
-        toolbar: [
-          // {
-          //   text: '鏂板',
-          //   type: 'primary',
-          //   fun: this.addOrUpdateHandle,
-          //   disabled: false,
-          //   permitArr: []
-          // },
-          {
-            type: 'primary',
-            text: '浜у搧缁撴瀯鐢熸垚BOM',
-            fun: this.addByStructureHandle,
-            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.deleteAll()
-            },
-            disabled: false,
-            permitArr: [],
-          },
-        ],
+        toolbar: [],
         operator: [
           {
             text: '鍒犻櫎',
@@ -291,6 +258,7 @@
           label: '宸插彇娑�',
         },
       ],
+      uniqueStateArr: [],
       bomTypeDbOptions: [],
     }
   },
@@ -333,6 +301,10 @@
     },
     // 鏂板 / 淇敼
     addOrUpdateHandle(row) {
+      if(!this.permissions.technology_completeproductstructure_edit && row.id!=null){
+        this.$message.error("璇ヨ鑹叉病鏈夋搷浣滄潈闄�")
+        return
+      }
       this.$router.push({
         name: 'completeProductStructure',
         params: { id: row == null ? null : row.id },
@@ -341,8 +313,6 @@
     // 鎸変骇鍝佺粨鏋勭敓鎴怋OM
     addByStructureHandle() {
       addByStructure().then((res) => {
-        // let result = Array.from(new Set(res.data.data))
-        // this.$message.success(result.join(','))
         console.log(res.data.data);
         let mes="";
         res.data.data.forEach(item=>{
@@ -355,13 +325,13 @@
         })
         this.getData()
       })
-      // this.$message({
-      //   message: '宸插湪鍚庡彴鐢熸垚BOM锛岃鎵ц缁撴潫鍚庡埛鏂伴〉闈�',
-      //   type: 'success',
-      // })
     },
     // 鍒犻櫎
     deleteHandle(row) {
+      if(!this.permissions.technology_completeproductstructure_del){
+        this.$message.error("璇ヨ鑹叉病鏈夋搷浣滄潈闄�")
+        return
+      }
       this.$confirm('鏄惁纭鍒犻櫎缂栧彿涓�' + row.number, '鎻愮ず', {
         confirmButtonText: '纭畾',
         cancelButtonText: '鍙栨秷',
@@ -453,21 +423,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
     },
diff --git a/src/views/technology/document/index.vue b/src/views/technology/document/index.vue
index d9f05e7..7ba962f 100644
--- a/src/views/technology/document/index.vue
+++ b/src/views/technology/document/index.vue
@@ -14,6 +14,20 @@
           <!-- <el-button type="primary" :loading="ifsSynsLoading" @click="syncIfs"
             >ERP鍚屾</el-button
           > -->
+          <el-button v-if="permissions.technology_document_add"
+          type="primary" @click="addOrUpdateHandle">鏂板</el-button>
+
+          <el-button @click="() => {this.changeState('accept')}" 
+          :disabled="uniqueStateArr.includes(['01draft', '03accepted', '04reject'])"
+          v-if="permissions.technology_document_accept">鎵瑰噯</el-button>
+
+          <el-button @click="() => {this.changeState('reject')}"
+          :disabled="uniqueStateArr.includes(['01draft', '03accepted', '04reject'])"
+          v-if="permissions.technology_document_reject">鎷掔粷</el-button>
+
+          <el-button @click="() => {this.changeState('cancel')}" 
+          :disabled="uniqueStateArr.includes(['01draft', '03accepted', '04reject'])"
+          v-if="permissions.technology_document_cancel">鎾ら攢</el-button>
           <el-button
             type="primary"
             @click="deleteBatch"
@@ -88,6 +102,7 @@
   data() {
     return {
       ids: [],
+      uniqueStateArr: [],
       ajaxFun: fetchList,
       multipleSelection: [],
       isShowQuery: false,
@@ -323,43 +338,12 @@
           }
         ],
         toolbar: [
-          {
-            text: '鏂板',
-            type: 'primary',
-            fun: this.addOrUpdateHandle,
-            disabled: false,
-            permitArr: []
-          },
           // {
           //   text: '澶嶅埗',
           //   fun: this.copyDocument,
           //   disabled: false,
           //   permitArr: []
           // },
-          {
-            text: '鎵瑰噯',
-            fun: () => {
-              this.changeState('accept')
-            },
-            disabled: false,
-            permitArr: ['01draft', '03accepted', '04reject']
-          },
-          {
-            text: '鎷掔粷',
-            fun: () => {
-              this.changeState('reject')
-            },
-            disabled: false,
-            permitArr: ['01draft', '03accepted', '04reject']
-          },
-          {
-            text: '鎾ら攢',
-            fun: () => {
-              this.changeState('cancel')
-            },
-            disabled: false,
-            permitArr: ['01draft', '03accepted', '04reject']
-          }
           /*,
           {
             text: '娴风紗OA',
@@ -523,6 +507,10 @@
     },
     // 鏂板 / 淇敼
     addOrUpdateHandle(row) {
+      if(!this.permissions.technology_document_edit && row.id!=null){
+        this.$message.error("璇ヨ鑹叉病鏈夋搷浣滄潈闄�")
+        return
+      }
       this.$router.push({
         name: 'documentForm',
         query: { id: row == null ? null : row.id }
@@ -530,6 +518,10 @@
     },
     // 鍒犻櫎
     deleteHandle(row) {
+      if(!this.permissions.technology_document_del){
+        this.$message.error("璇ヨ鑹叉病鏈夋搷浣滄潈闄�")
+        return
+      }
       this.$confirm('鏄惁纭鍒犻櫎宸ヨ壓鏂囦欢缂栧彿锛�' + row.number + '鎻愮ず', {
         confirmButtonText: '纭畾',
         cancelButtonText: '鍙栨秷',
@@ -585,21 +577,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
     },
diff --git a/src/views/technology/routing/index.vue b/src/views/technology/routing/index.vue
index 4c685f1..113abba 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,53 +357,7 @@
             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: []
-          }
-        ],
+        toolbar: [],
         operator: [
           {
             text: '鍒犻櫎',
@@ -508,6 +463,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 }
@@ -515,6 +474,10 @@
     },
     // 鍒犻櫎
     deleteHandle(row) {
+      if(!this.permissions.technology_routing_del){
+        this.$message.error("璇ヨ鑹叉病鏈夋搷浣滄潈闄�")
+        return
+      }
       this.$confirm('鏄惁纭鍒犻櫎宸ヨ壓缂栧彿锛�' + row.routingNo + '鎻愮ず', {
         confirmButtonText: '纭畾',
         cancelButtonText: '鍙栨秷',
@@ -613,21 +576,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
     },
diff --git a/src/views/technology/routing/routing-form.vue b/src/views/technology/routing/routing-form.vue
index a2b260e..c2ddbf2 100644
--- a/src/views/technology/routing/routing-form.vue
+++ b/src/views/technology/routing/routing-form.vue
@@ -657,8 +657,7 @@
       typeOptions: [],
       paramTemplateSelArr: [],
       paramTemplateSelCol: 'operationTemplateNo',
-      // templateDefaultObj: { dataType: '鐢熶骇瑕佹眰' },
-      templateDefaultObj: {},
+      templateDefaultObj: { dataType: '鐢熶骇瑕佹眰' },
       paramSelArr: [],
       paramSelCol: 'code',
       operationIndex: null,

--
Gitblit v1.9.3