Forráskód Böngészése

面损列表-判断指派人

jbb 2 éve
szülő
commit
3121448ffb

+ 2 - 1
src/api/document/fabricLossesSummary.js

@@ -10,6 +10,7 @@ const cancelSubmit = params => postAction('/orderData/syCostLossReview/cancelSub
 
 //审批历史
 const historyApproval  = params => getAction('/orderData/syCostLossReview/querySyApprovalHistory', params)
+const assignedData  = params => getAction('/orderData/syCostLossReview/querySyApprovalAssignedBy', params)
 
 
-export { checkList,cancelSubmit,historyApproval}
+export { checkList,cancelSubmit,historyApproval,assignedData}

+ 31 - 6
src/views/cost-allocation-total/modal/detailFabricLossTable.vue

@@ -11,16 +11,16 @@
         <a-button @click="Submit" :disabled="!(status=='保存'||status=='返单')">
           提交
         </a-button>
-        <a-button @click="assign" :disabled="!(status=='提交')"   v-has="'zpqx:kj'">
+        <a-button @click="assign" :disabled="!(status=='提交')"   v-has="'zpqx:kj'" v-if="AssignedPerson=='no'">
          指派
         </a-button>
-        <a-button @click="Approved" :disabled="!(status=='已指派')" v-has="'qxan:kj'">
+        <a-button @click="Approved" :disabled="!(status=='已指派')" v-if="AssignedPersonQx=='yes'">
          审批通过
         </a-button>
-        <a-button @click="reject" :disabled="!(status=='已指派')" v-has="'qxan:kj'">
+        <a-button @click="reject" :disabled="!(status=='已指派')" v-if="AssignedPersonQx=='yes'">
          驳回
         </a-button>
-        <a-button @click="revokeApproval" :disabled="!(status=='完成')" v-has="'qxan:kj'">
+        <a-button @click="revokeApproval" :disabled="!(status=='完成')" v-if="AssignedPersonQx=='yes'">
          撤销审批
         </a-button>
         <a-button  @click="handlecLose">
@@ -352,7 +352,7 @@ import JEllipsis from '@/components/jeecg/JEllipsis'
 import JUpload from '@/components/jeecg/JUpload'
 import moment from 'moment'
 import { runInThisContext } from 'vm'
-import {cancelSubmit } from '@api/document/fabricLossesSummary.js'
+import {cancelSubmit,assignedData } from '@api/document/fabricLossesSummary.js'
 
 export default {
   name: 'FabricLossTable', // 面料损耗表
@@ -667,7 +667,9 @@ export default {
       noteTwo: '', // 备注 2
       dd:0,
       status:'',
-      detailModVis:false 
+      detailModVis:false ,
+      AssignedPerson:'no',
+      AssignedPersonQx:'no',
     }
   },
   methods: {
@@ -828,6 +830,7 @@ export default {
               this.fabricLoss = {fabricPoOrderList:[],fabricOMOrderList1:[],fabricOMOrderList2:[],fabricCostAssistList:[],fabricCostClothList:[],fabricCostClothesList:[],fabricCostInvoiceList:[],fabricExpensesList:[],fabricAccidentList:[]};
               this.$message.info(res.message);
             }
+            this.determineAssignedPerson()
           })
         })
       }
@@ -951,6 +954,26 @@ export default {
       this.$refs.submitInformation.text = '提交'
 
     },
+    //判断有无指派人
+    determineAssignedPerson(){
+      assignedData({code:this.planNO}).then(res => {
+          if (res.success) {
+            var array = res.result.split(",")
+            if(array.length!==0){
+              this.AssignedPerson='yes'
+            }
+            array.every(item=>{
+              if(item==this.$store.getters.userInfo.realname){
+                this.AssignedPersonQx='yes'
+                return false
+              }
+              return true
+            })
+          }else{
+            this.$message.error(res.message);
+          }
+        })
+    },
     assign(){
       this.$refs.SelectUserModal.visible = true
     },
@@ -991,6 +1014,7 @@ export default {
             this.$message.success('指派成功')
             this.handlecLose()
             this.$emit('close')
+            this.determineAssignedPerson()
           }else{
             this.$message.error(res.message);
           }
@@ -1033,6 +1057,7 @@ export default {
             this.$message.success('撤销审批成功')
             this.handlecLose()
             this.$emit('close')
+            this.AssignedPerson='yes'
           }else{
             this.$message.error(res.message);
           }