wengyuwen 4 gadi atpakaļ
vecāks
revīzija
6afde720fb

+ 16 - 0
src/api/purchaseRequest/index.js

@@ -127,3 +127,19 @@ export function confirmDeletion(fIds) {
     method: 'delete'
   })
 }
+//获取审批人
+export function getName(data) {
+  return request({
+    url: 'warehouse/paths/projectEndQueryPendingVal',
+    method: 'post',
+    data: data
+  })
+}
+// 查询当前登录用户信息
+export function queryUserVal(data) {
+  return request({
+    url: '/system/user/queryUserVal',
+    method: 'post',
+    data:data
+  })
+}

+ 15 - 15
src/views/purchaseIssue/index.vue

@@ -886,6 +886,8 @@ export default {
           }
         }
         this.viewMethod(scope)
+      }else{
+        this.pageDisplay = true
       }
     },
     // 查看审批流
@@ -1033,7 +1035,8 @@ export default {
               }
             }
           })
-          if (this.$refs.avatar.form.fBillstatus == 4) {
+          let operator = this.$refs.avatar.form.createBy
+          if (this.$refs.avatar.form.fBillstatus == 4 && this.lander === operator) {
             this.contentButton.push({
               type: 'danger',
               size: 'mini',
@@ -1052,27 +1055,25 @@ export default {
               disabled: false
             })
           }
-          let operator = this.$refs.avatar.form.createBy
           for (let li in this.contentButton) {
             if (this.$refs.avatar.form.fBillstatus < 4) {
-              if (this.contentButton[li].name == '返回列表' || this.contentButton[li].name == '修改'||this.contentButton[li].name === '打印') {
-                this.contentButton[li].disabled = false
-              } else {
+              if (this.contentButton[li].name == '录入' || this.contentButton[li].name == '保存'||
+                this.contentButton[li].name == '请核') {
                 this.contentButton[li].disabled = true
+              } else {
+                this.contentButton[li].disabled = false
               }
             } else {
-              if (this.contentButton[li].name == '返回列表' || 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 {
+              if (this.contentButton[li].name == '录入' || this.contentButton[li].name == '保存'||
+                this.contentButton[li].name == '请核' || this.contentButton[li].name == '修改') {
                 this.contentButton[li].disabled = true
+              } else {
+                this.contentButton[li].disabled = false
               }
             }
-            if (this.$refs.avatar.form.fBillstatus == 6) {
-              this.contentButton[li].disabled = false
-            }
-            if (this.contentButton[li].name == '撤销审批' && this.lander === operator) {
-              this.contentButton[li].disabled = false
-            }
+            // if (this.contentButton[li].name == '撤销审批' && this.lander === operator) {
+            //   this.contentButton[li].disabled = false
+            // }
           }
         }
       })
@@ -1096,7 +1097,6 @@ export default {
           this.$refs.avatar.form = {}
           this.getRow(data, list)
         }
-        console.log(this.contentStyle)
       })
     },
     //请核

+ 75 - 24
src/views/purchaseRequest/index.vue

@@ -170,7 +170,9 @@ import {
   pleaseCheck,
   copyNew,
   revoke,
-  withdrawBy
+  withdrawBy,
+  getName,
+  queryUserVal
 } from '@/api/purchaseRequest/index'
 import Cookies from 'js-cookie'
 
@@ -178,6 +180,9 @@ export default {
   name: 'index',
   data() {
     return {
+      before:'',
+      lander:'',
+      operator:'',
       addOrUpdateVisible: false,
       addOrUpdateVisib: false,
       total:0,
@@ -478,11 +483,25 @@ export default {
         }, {
           type: 'primary',
           size: 'mini',
-          icon: 'el-icon-plus',
+          icon: 'el-icon-check',
           name: '保存',
           plain: true,
           disabled: false
         }, {
+          type: 'primary',
+          size: 'mini',
+          icon: 'el-icon-plus',
+          name: '新增(详情页)',
+          plain: true,
+          disabled: false
+        },{
+          type: 'primary',
+          size: 'mini',
+          icon: 'el-icon-plus',
+          name: '复制新增(行)',
+          plain: true,
+          disabled: false
+        },{
           type: 'success',
           size: 'mini',
           icon: 'el-icon-edit',
@@ -716,6 +735,10 @@ export default {
     this.homePage()
   },
   created() {
+    //获取登陆人
+    queryUserVal().then((response) => {
+      this.lander = response.user.userName
+    })
     let data = {
       tableName: this.queryList.tableName,
       userId: Cookies.get('userName')
@@ -795,8 +818,8 @@ export default {
       let date = this.$route.query
       console.log(date)
       if (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:{
@@ -804,6 +827,9 @@ export default {
           }
         }
         this.viewMethod(scope)
+      }else{
+        console.log("111")
+        this.pageDisplay = true
       }
     },
     // 查看审批流
@@ -937,15 +963,30 @@ export default {
           this.$refs.avatar.form = list.warehouseBills
           this.contentList = list.tWarehousebillsfees
           this.contentButton = this.$options.data().contentButton
-          if (this.$refs.avatar.form.fBillstatus === 6){
-            this.contentButton.push({
-              type: 'danger',
-              size: 'mini',
-              icon: 'el-icon-edit-outline',
-              name: '撤销采购',
-              disabled: false
-            })
-          }else if(this.$refs.avatar.form.fBillstatus === 4){
+          if (this.$route.query.list) {
+            this.contentButton.push(JSON.parse(this.$route.query.list))
+          }
+          let data = {
+            actId: 520,
+            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) {
+                this.contentButton.push({
+                  type: 'danger',
+                  size: 'mini',
+                  icon: 'el-icon-edit-outline',
+                  name: '撤销采购',
+                  disabled: false
+                })
+              }
+            }
+          })
+          let operator = this.$refs.avatar.form.createBy
+          if(this.$refs.avatar.form.fBillstatus === 4 && this.lander === operator){
             this.contentButton.push({
               type: 'danger',
               size: 'mini',
@@ -955,10 +996,18 @@ export default {
             })
           }
           this.contentButton.forEach(item =>{
-            if (item.name == '返回列表' || item.name == '修改' || item.name == '打印'){
-              item.disabled = false
-            }else {
-              item.disabled = true
+            if(this.$refs.avatar.form.fBillstatus < 4){
+              if (item.name == '录入' || item.name == '保存' || item.name == '请核'){
+                item.disabled = true
+              }else {
+                item.disabled = false
+              }
+            }else{
+              if (item.name == '录入' || item.name == '保存' || item.name == '请核' || item.name == '修改'){
+                item.disabled = true
+              }else {
+                item.disabled = false
+              }
             }
           })
         }
@@ -972,13 +1021,13 @@ export default {
       this.contentOption.forEach(item => item.disabled = true)
       this.contentStyle.forEach(item => item.disabled = true)
       console.log(this.contentStyle)
-      this.contentButton.forEach(item =>{
-        if (item.name == '返回列表' || item.name == '修改'){
-          item.disabled = false
-        }else {
-          item.disabled = true
-        }
-      })
+      // this.contentButton.forEach(item =>{
+      //   if (item.name == '录入' || item.name == '保存' || item.name == '请核'){
+      //     item.disabled = true
+      //   }else {
+      //     item.disabled = false
+      //   }
+      // })
       viewSingle(scope.row.fId).then(res => {
         if (res.code === 200) {
           let data = {
@@ -1108,6 +1157,8 @@ export default {
         case '保存':
           this.$refs.avatar.submitForm('submit')
           break
+        case '新增(详情页)':
+          break
         case '打印':
           console.log(this.listData.fFeeid,this.contentList)
           for (let item in this.contentList){

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

@@ -1116,7 +1116,8 @@ export default {
               this.detailButton[li].disabled = true
             }
           } else {
-            if(this.detailButton[li].name == '返回列表' || this.detailButton[li].name == '修改'){
+            if(this.detailButton[li].name == '返回列表' || this.detailButton[li].name == '修改' ||
+              this.detailButton[li].name == '打印' || this.detailButton[li].name == '刷新'){
               this.detailButton[li].disabled = false
             }else{
               this.detailButton[li].disabled = true

+ 15 - 6
src/views/warehouse/outStock/index.vue

@@ -914,7 +914,7 @@ export default {
           })
         }else if(this.detailOption[li].name == '开票公司'){
           //获取付款单位
-          let queryParams = { pageNum: 1, fTypeid: 1}
+          let queryParams = { pageNum: 1, fTypeid: 2}
           getustomer(queryParams).then(res => {
             for(let item in res.data){
               this.detailOption[li].data.push({
@@ -1094,7 +1094,11 @@ export default {
               this.detailData = res.data.tWarehousebillsfees
               for(let li in this.detailData){
                 this.$set(this.detailData[li],'fFeeunitid',JSON.stringify(this.detailData[li].fFeeunitid))
-                this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
+                if(this.detailData[li].fStltypeid == null){
+                  this.$set(this.detailData[li],'fStltypeid','')
+                }else{
+                  this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
+                }
               }
             }
           }
@@ -1112,10 +1116,11 @@ export default {
                 this.detailButton[li].disabled = true
               }
             } else {
-              if(this.detailButton[li].name == '返回列表' || this.detailButton[li].name == '修改'){
-                this.detailButton[li].disabled = false
-              }else{
+              if(this.detailButton[li].name == '录入' || this.detailButton[li].name == '保存' ||
+                this.detailButton[li].name == '出库确认'|| this.detailButton[li].name == '刷新'){
                 this.detailButton[li].disabled = true
+              }else{
+                this.detailButton[li].disabled = false
               }
             }
           }
@@ -1280,7 +1285,11 @@ export default {
             this.detailData = res.data.tWarehousebillsCntrs
             for(let li in this.detailData){
               this.$set(this.detailData[li],'fFeeunitid',JSON.stringify(this.detailData[li].fFeeunitid))
-              this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
+              if(this.detailData[li].fStltypeid == null){
+                this.$set(this.detailData[li],'fStltypeid','')
+              }else{
+                this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
+              }
             }
             this.$message.success("操作成功")
             this.getList();