wengyuwen 4 år sedan
förälder
incheckning
b356ed358d

+ 59 - 37
src/views/purchaseIssue/index.vue

@@ -68,6 +68,7 @@
         @change="change"
         :tatolLabel="tatolLabel"
         :isItHidden="isItHidden"
+        :hasPermi="hasPermi"
         :customButton="contentButton"
         :listStyle="contentStyle"
         :queryList="purchaseList"
@@ -165,7 +166,7 @@ import {
   warehouse,
   listDelete,
   tableDeleteQuery,
-  confirmDeletion, pleaseCheck, revoke, queryUserVal, getName
+  confirmDeletion, pleaseCheck, revoke, queryUserVal, getName,revokeBill
 } from '@/api/purchaseIssue/index'
 import Cookies from 'js-cookie'
 
@@ -173,6 +174,7 @@ export default {
   name: 'index',
   data() {
     return {
+      before:'',
       hasPermi:{
         lookup:['anpin:stockControl:query'],
         disappear:['anpin:stockControl:remove']
@@ -752,8 +754,8 @@ export default {
       let date = this.$route.query
       if (this.$route.query.list){
         console.log(this.$route.query.list)
-        this.contentButton = this.$options.data().contentButton
-        this.contentButton.push(JSON.parse(this.$route.query.list))
+        // this.contentButton = this.$options.data().contentButton
+        // this.contentButton.push(JSON.parse(this.$route.query.list))
         console.log(this.contentButton)
         let scope = {
           row:{
@@ -883,6 +885,30 @@ export default {
           this.$refs.avatar.form = list.warehouseBills
           this.contentList = list.tWarehousebillsfees
           this.contentButton = this.$options.data().contentButton
+          console.log(this.$route.query.list)
+          if(this.$route.query.list){
+            this.contentButton.push(JSON.parse(this.$route.query.list))
+          }
+          let data = {
+            actId: 550,
+            id: this.$refs.avatar.form.fId
+          }
+          getName(data).then(response => {
+            console.log(response)
+            if (response.data.length != 0) {
+              this.before = response.data[0].userName
+              if(this.$refs.avatar.form.fBillstatus == 6 && this.before == this.lander){
+                console.log(this.contentButton)
+                this.contentButton.push({
+                  type: 'warning',
+                  size: 'mini',
+                  icon: 'el-icon-refresh-left',
+                  name: '撤销出库',
+                  disabled: false
+                })
+              }
+            }
+          })
           if(this.$refs.avatar.form.fBillstatus == 4){
             this.contentButton.push({
               type: 'danger',
@@ -902,16 +928,6 @@ export default {
               disabled: false
             })
           }
-          if(this.$refs.avatar.form.fBillstatus == 6){
-            console.log(this.contentButton)
-            this.contentButton.push({
-              type: 'warning',
-              size: 'mini',
-              icon: 'el-icon-refresh-left',
-              name: '撤销出库',
-              disabled: false
-            })
-          }
           let operator = this.$refs.avatar.form.createBy
           for(let li in this.contentButton){
             if(this.$refs.avatar.form.fBillstatus < 4){
@@ -921,22 +937,13 @@ export default {
                 this.contentButton[li].disabled = true
               }
             }else{
-              if(this.contentButton[li].name == '返回列表' || this.contentButton[li].name == '申请发票' || this.contentButton[li].name == '查看审批' || this.contentButton[li].name == '撤销出库'){
+              if(this.contentButton[li].name == '返回列表' || this.contentButton[li].name == '申请发票' || this.contentButton[li].name == '修改' ||this.contentButton[li].name == '查看审批' || this.contentButton[li].name == '撤销出库'){
                 this.contentButton[li].disabled = false
               }else {
                 this.contentButton[li].disabled = true
               }
             }
-            let data = {
-              actId: 550,
-              id: this.$refs.avatar.form.fId
-            }
-            getName(data).then(response => {
-              if (response.data.length != 0) {
-                this.before = response.data[0].userName
-              }
-            })
-            if(this.$refs.avatar.form.fBillstatus == 6 && this.before == this.lander){
+            if(this.$refs.avatar.form.fBillstatus == 6 ){
               this.contentButton[li].disabled = false
             }
             if(this.contentButton[li].name == '撤销审批' && this.lander === operator){
@@ -1101,6 +1108,7 @@ export default {
       switch (row.name) {
         case '新增':
           this.contentList = []
+          this.contentButton = this.$options.data().contentButton
           data = {
             tableName: this.purchaseList.tableName,
             userId: Cookies.get('userName')
@@ -1209,28 +1217,42 @@ export default {
           this.addOrUpdateHand()
           break
         case '撤销审批':
-          this.revocationOfApproval()
+          this.revocationOfApproval(1)
           break
         case '撤销出库':
-
+          this.revocationOfApproval(2)
           break
         default:
           this.$message.error('该按钮暂无功能')
       }
     },
     //撤销审批
-    revocationOfApproval(){
-      let data = {
-        id: this.$refs.avatar.form.fId,
-        actId: 550,
-        billId: this.$refs.avatar.form.fId,
-      };
-      revoke(data).then(res=>{
-        if(res.code == 200){
-          this.$message.success("撤销成功");
-          this.pageDisplay = true
+    revocationOfApproval(res){
+      if(res == 1){
+        let data = {
+          id: this.$refs.avatar.form.fId,
+          actId: 550,
+          billId: this.$refs.avatar.form.fId,
+        };
+        revoke(data).then(res=>{
+          if(res.code == 200){
+            this.$message.success("撤销成功");
+            this.getList()
+            this.pageDisplay = true
+          }
+        })
+      }else if(res == 2){
+        let data ={
+          fId:this.$refs.avatar.form.fId
         }
-      })
+        revokeBill(data).then(res=>{
+          if(res.code == 200){
+            this.$message.success("撤销成功");
+            this.getList()
+            this.pageDisplay = true
+          }
+        })
+      }
     },
     // 显示搜索条件、点击后会调用此方法
     showSearch() {

+ 1 - 0
src/views/warehouse/inStock/index.vue

@@ -68,6 +68,7 @@
         :seachButton="confirmButton"
         :customButton="detailButton"
         :listStyle="detailStyle"
+        :hasPermi="hasPermi"
         :setRowList="detailStyle"
         :tatolLabel="tatolLabel"
         :listData="listData"

+ 1 - 0
src/views/warehouse/outStock/index.vue

@@ -68,6 +68,7 @@
         :seachButton="confirmButton"
         :customButton="detailButton"
         :listStyle="detailStyle"
+        :hasPermi="hasPermi"
         :setRowList="detailStyle"
         :tatolLabel="tatolLabel"
         :listData="listData"

+ 2 - 2
vue.config.js

@@ -34,9 +34,9 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        target: `http://192.168.1.143:9020`,
+        // target: `http://192.168.1.143:9020`,
         // target: `http://localhost:8080`,
-        // target: `https://ap.tubaosoft.com/prod-api/`,
+        target: `https://ap.tubaosoft.com/prod-api/`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''