wengyuwen 4 gadi atpakaļ
vecāks
revīzija
296b945a50

+ 144 - 0
src/api/purchaseIssue/index.js

@@ -0,0 +1,144 @@
+import request from '@/utils/request'
+
+// 查询列宽修改列表
+export function listQuery(query) {
+  return request({
+    url: '/anpin/stockControl/list',
+    method: 'get',
+    params:query
+  })
+}
+// 查询单条数据
+export function viewSingle(query) {
+  return request({
+    url: '/anpin/stockControl/'+query,
+    method: 'get',
+  })
+}
+// 查询项目名称
+export function queryItem(query) {
+  return request({
+    url: '/anpin/project/projectName',
+    method: 'post',
+    data: {
+      projectName:query
+    }
+  })
+}
+// 查询供应商开票单位付款单位
+export function company(query) {
+  return request({
+    url: '/basicdata/corps/getCorpName',
+    method: 'post',
+    data: {
+      fTypeid:query
+    }
+  })
+}
+// 查询仓库
+export function warehouse() {
+  return request({
+    url: '/basicdata/warehouse/lists',
+    method: 'get'
+  })
+}
+// 查询品名数据
+export function productName(query) {
+  return request({
+    url: '/basicdata/fees/list',
+    method: 'get',
+    params:query
+  })
+}
+//保存详情页面内容
+export function submit(data) {
+  return request({
+    url: '/anpin/stockControl/anPingApply',
+    method: 'post',
+    data:data
+  })
+}
+//请核
+export function pleaseCheck(data) {
+  return request({
+    url: '/anpin/stockControl/anPinSubmit',
+    method: 'post',
+    data:data
+  })
+}
+//复制新增、生成入库单、生成销售单
+export function copyNew(data) {
+  return request({
+    url: '/anpin/stockControl/generateReceipts',
+    method: 'post',
+    data: {
+      fId:data.fId,
+      fBilltype:data.fBilltype
+    }
+  })
+}
+//查询详情页面内容能否删除
+export function deleteQuery(fId,time) {
+  return request({
+    url: '/anpin/stockControl/judge',
+    method: 'post',
+    data: {
+      fId:fId,
+      fDateChanged:time
+    }
+  })
+}
+//删除详情单条列表
+export function listDelete(fId) {
+  return request({
+    url: '/anpin/stockControl/removeFee/' + fId,
+    method: 'delete'
+  })
+}
+//删除整个表前的查询
+export function tableDeleteQuery(fIds) {
+  return request({
+    url: '/anpin/stockControl/' + fIds,
+    method: 'delete'
+  })
+}
+//确认删除整个表
+export function confirmDeletion(fIds) {
+  return request({
+    url: '/anpin/stockControl/remove/' + fIds,
+    method: 'delete'
+  })
+}
+// 查询当前登录用户信息
+export function queryUserVal(data) {
+  return request({
+    url: '/system/user/queryUserVal',
+    method: 'post',
+    data:data
+  })
+}
+//撤销审批
+export function revoke(data) {
+  return request({
+    url: '/warehouse/paths/revoke',
+    method: 'post',
+    data:data
+  })
+}
+//大撤销
+export function revokeBill(data) {
+  return request({
+    url: '/anpin/stockControl/withdrawById',
+    method: 'post',
+    data:data
+  })
+}
+//获取审批人
+
+export function getName(data) {
+  return request({
+    url: 'warehouse/paths/projectEndQueryPendingVal',
+    method: 'post',
+    data: data
+  })
+}

+ 5 - 1
src/combination/listComponent.vue

@@ -84,7 +84,7 @@
             </span>
           </span>
           <span v-else-if="item.changeable && listData">
-            <el-select v-if="item.changeable == 1" :disabled="item.disabled" v-model="scope.row[item.label]" slot="prepend" placeholder="请选择">
+            <el-select v-if="item.changeable == 1" :disabled="item.disabled" @change="change(scope)" v-model="scope.row[item.label]" slot="prepend" placeholder="请选择">
               <el-option
                 v-for="(item,index) in listData[item.label]"
                 :key="index"
@@ -188,6 +188,10 @@ export default {
     console.log(this.queryList.columnList.length)
   },
   methods: {
+    //下拉数据变动时触发
+    change(){
+      this.$emit('change')
+    },
     //输入框数据变动时触发
     totalAmount(scope){
       this.$emit('totalAmount',scope)

+ 98 - 19
src/views/purchaseIssue/index.vue

@@ -163,8 +163,8 @@ import {
   warehouse,
   listDelete,
   tableDeleteQuery,
-  confirmDeletion, pleaseCheck, revoke
-} from '@/api/purchaseRequest/index'
+  confirmDeletion, pleaseCheck, revoke, queryUserVal, getName
+} from '@/api/purchaseIssue/index'
 import Cookies from 'js-cookie'
 
 export default {
@@ -660,6 +660,10 @@ export default {
     this.homePage()
   },
   created() {
+    //获取登陆人
+    queryUserVal().then((response) => {
+      this.lander = response.user.userName;
+    })
     let data = {
       tableName: this.queryList.tableName,
       userId: Cookies.get('userName')
@@ -724,11 +728,18 @@ export default {
     this.fCompany(2)
   },
   methods: {
+    change(){
+      // if(){
+      //
+      // }
+    },
     homePage(){
       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))
+        console.log(this.contentButton)
         let scope = {
           row:{
             fId:JSON.parse(this.$route.query.data).billId
@@ -856,15 +867,18 @@ export default {
         if (list){
           this.$refs.avatar.form = list.warehouseBills
           this.contentList = list.tWarehousebillsfees
+          this.contentButton = this.$options.data().contentButton
           if(this.$refs.avatar.form.fBillstatus == 4){
             this.contentButton.push({
               type: 'danger',
               size: 'mini',
-              icon: 'el-icon-arrow-left',
+              icon: 'el-icon-refresh-left',
               name: '撤销审批',
               disabled: false
             })
-          }else if(this.$refs.avatar.form.fBillstatus > 3){
+          }
+          if(this.$refs.avatar.form.fBillstatus > 3){
+            console.log(this.contentButton)
             this.contentButton.push({
               type: 'primary',
                 size: 'mini',
@@ -873,6 +887,47 @@ 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){
+              if(this.contentButton[li].name == '返回列表' || this.contentButton[li].name == '修改'){
+                this.contentButton[li].disabled = false
+              }else {
+                this.contentButton[li].disabled = true
+              }
+            }else{
+              if(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){
+              this.contentButton[li].disabled = false
+            }
+            if(this.contentButton[li].name == '撤销审批' && this.lander === operator){
+              this.contentButton[li].disabled = false
+            }
+          }
         }
       })
     },
@@ -894,13 +949,13 @@ export default {
           }
           this.$refs.avatar.form = {}
           this.getRow(data,list)
-            for(let li in this.contentButton){
-              if(this.contentButton[li].name == '返回列表' || this.contentButton[li].name == '修改' || this.contentButton[li].name == '查看审批'){
-                this.contentButton[li].disabled = false
-              }else {
-                this.contentButton[li].disabled = true
-              }
-          }
+          //   for(let li in this.contentButton){
+          //     if(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
+          //     }
+          // }
         }
       })
     },
@@ -913,17 +968,36 @@ export default {
       pleaseCheck(formData).then(res => {
         if (res.code == 200) {
           this.$message.success('请核成功')
-          this.$refs.avatar.form = res.data.warehouseBills
-          this.contentList = res.data.tWarehousebillsCntrs
+          // this.$refs.avatar.form = res.data.warehouseBills
+          // this.contentList = res.data.tWarehousebillsCntrs
           this.contentOption.forEach(item => item.disabled = true)
           this.contentStyle.forEach(item => item.disabled = true)
-          this.contentButton.forEach(item =>{
-            if (item.name == '返回列表' || item.name == '查看审批'){
-              item.disabled = false
+          this.contentButton = this.$options.data().contentButton
+          this.contentButton.push({
+              type: 'danger',
+              size: 'mini',
+              icon: 'el-icon-refresh-left',
+              name: '撤销审批',
+              disabled: false
+            })
+            this.contentButton.push({
+              type: 'primary',
+              size: 'mini',
+              icon: 'el-icon-edit-outline',
+              name: '查看审批',
+              disabled: false
+            })
+          let operator = this.$refs.avatar.form.createBy
+          for(let li in this.contentButton){
+            if(this.contentButton[li].name == '返回列表' || this.contentButton[li].name == '申请发票' || this.contentButton[li].name == '查看审批'){
+              this.contentButton[li].disabled = false
             }else {
-              item.disabled = true
+              this.contentButton[li].disabled = true
             }
-          })
+            if(this.contentButton[li].name == '撤销审批' && this.lander === operator){
+              this.contentButton[li].disabled = false
+            }
+          }
         }
       })
     },
@@ -1120,6 +1194,11 @@ export default {
           this.addOrUpdateHand()
           break
         case '撤销审批':
+          this.revocationOfApproval()
+          break
+        case '撤销出库':
+
+          break
         default:
           this.$message.error('该按钮暂无功能')
       }
@@ -1134,7 +1213,7 @@ export default {
       revoke(data).then(res=>{
         if(res.code == 200){
           this.$message.success("撤销成功");
-
+          this.pageDisplay = true
         }
       })
     },