Browse Source

面损列表-按钮

jbb 1 year ago
parent
commit
c0b8e007f2
1 changed files with 10 additions and 2 deletions
  1. 10 2
      src/views/cost-allocation-total/modal/detailFabricLossTable.vue

+ 10 - 2
src/views/cost-allocation-total/modal/detailFabricLossTable.vue

@@ -11,7 +11,7 @@
         <a-button @click="Submit" :disabled="!(status=='保存'||status=='返单')">
           提交
         </a-button>
-        <a-button @click="assign" :disabled="!(status=='提交')"   v-has="'zpqx:kj'" v-if="AssignedPerson=='no'">
+        <a-button @click="assign" :disabled="!(status=='提交')"   v-if="AssignedPerson=='no'&& authority=='yes'">
          指派
         </a-button>
         <a-button @click="Approved" :disabled="!(status=='已指派')" v-if="AssignedPersonQx=='yes'">
@@ -353,6 +353,7 @@ import JUpload from '@/components/jeecg/JUpload'
 import moment from 'moment'
 import { runInThisContext } from 'vm'
 import {cancelSubmit,assignedData } from '@api/document/fabricLossesSummary.js'
+import { USER_AUTH } from "@/store/mutation-types"
 
 export default {
   name: 'FabricLossTable', // 面料损耗表
@@ -670,6 +671,7 @@ export default {
       detailModVis:false ,
       AssignedPerson:'no',
       AssignedPersonQx:'no',
+      authority:'no'
     }
   },
   methods: {
@@ -958,10 +960,16 @@ export default {
     determineAssignedPerson(){
       assignedData({code:this.planNO}).then(res => {
           if (res.success) {
-            var array = res.result.split(",")
+            var array = res.result!==''?res.result.split(","):[]
             if(array.length!==0){
               this.AssignedPerson='yes'
             }
+          let allAuthes = JSON.parse(sessionStorage.getItem(USER_AUTH));
+           var quanXian = []
+           allAuthes.map(item=>{ quanXian.push(item.action)})
+           if(quanXian.indexOf('zpqx:kj')!==-1){
+            this.authority = 'yes'
+           }
             array.every(item=>{
               if(item==this.$store.getters.userInfo.realname){
                 this.AssignedPersonQx='yes'