caojunjie 4 gadi atpakaļ
vecāks
revīzija
3e1dd6a17a

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

@@ -88,6 +88,24 @@ export function deleteQuery(fId,time) {
     }
   })
 }
+//审批撤销
+export function revoke(data) {
+  return request({
+    url: '/warehouse/paths/revoke',
+    method: 'post',
+    data: data
+  })
+}
+//采购审批撤销
+export function withdrawBy(fId) {
+  return request({
+    url: '/anpin/stockControl/withdrawById',
+    method: 'post',
+    data: {
+      fId:fId
+    }
+  })
+}
 //删除详情单条列表
 export function listDelete(fId) {
   return request({

+ 1 - 1
src/combination/formComponent.vue

@@ -27,7 +27,7 @@
         <div style="width: 100%;display:flex;" v-if="item.inputType == 5">
           <el-input v-model="number" :onkeyup="item.onabort" :style="{ width: item.width + 'px' }" placeholder="请输入内容" :disabled="item.disabled" @input="spellNumbers(item.label)"></el-input>
           <span style="padding-left: 10px;padding-right: 10px">至</span>
-          <el-input v-model="numBer" :onkeyup="item.onabort" placeholder="请输入内容" :disabled="item.disabled" @input="spellNumbers(item.label)"></el-input>
+          <el-input v-model="numBer" :onkeyup="item.onabort" :style="{ width: item.width + 'px' }" placeholder="请输入内容" :disabled="item.disabled" @input="spellNumbers(item.label)"></el-input>
         </div>
         <el-date-picker
           v-if="item.inputType == 6"

+ 2 - 2
src/combination/listComponent.vue

@@ -28,7 +28,7 @@
           @queryTable="getList"
         ></right-toolbar>
       </div>
-      <div style="margin:10px 10px 0px 0px;float: right;" v-if="isItHidden">
+      <div style="margin:10px 10px 0 0;float: right;" v-if="isItHidden">
         <el-button
           type="success"
           plain
@@ -77,7 +77,7 @@
             <span v-if="item.operation == 1">
               <el-button type="text" @click="viewMethod(scope)">查看</el-button>
 <!--              <el-button type="text" @click="modification(scope)">修改</el-button>-->
-              <el-button type="text" @click="deletion(scope)" v-if="scope.row.fBillstatus > 3">删除</el-button>
+              <el-button type="text" @click="deletion(scope)" v-if="scope.row.fBillstatus < 4">删除</el-button>
             </span>
             <span v-if="item.operation == 2">
               <el-button type="text" @click="deleteRow(scope.$index, tableData)" :disabled="item.disabled">移除</el-button>

+ 70 - 3
src/views/purchaseRequest/index.vue

@@ -165,7 +165,9 @@ import {
   tableDeleteQuery,
   confirmDeletion,
   pleaseCheck,
-  copyNew
+  copyNew,
+  revoke,
+  withdrawBy
 } from '@/api/purchaseRequest/index'
 import Cookies from 'js-cookie'
 
@@ -281,6 +283,7 @@ export default {
           name: '操作',
           checked: 0,
           width: 160,
+          fixed:'right',
           operation: '1',
           onabort: ''
         }
@@ -397,6 +400,7 @@ export default {
           checked: 0,
           disabled: false,
           width: 160,
+          fixed:'right',
           operation: '2',
           onabort: ''
         }
@@ -549,7 +553,7 @@ export default {
           label: 'cLoadDate',
           name: '申请日期',
           inputType: 3,
-          width: 200,
+          width: 300,
           labelSize: '80',
           rules: [{ required: false, message: ' ' }]
         }
@@ -896,6 +900,31 @@ 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 === 6){
+            this.contentButton.push({
+              type: 'danger',
+              size: 'mini',
+              icon: 'el-icon-edit-outline',
+              name: '撤销采购',
+              disabled: false
+            })
+          }else if(this.$refs.avatar.form.fBillstatus === 4){
+            this.contentButton.push({
+              type: 'danger',
+              size: 'mini',
+              icon: 'el-icon-edit-outline',
+              name: '撤销审批',
+              disabled: false
+            })
+          }
+          this.contentButton.forEach(item =>{
+            if (item.name == '返回列表' || item.name == '修改' || item.name == '打印'){
+              item.disabled = false
+            }else {
+              item.disabled = true
+            }
+          })
         }
       })
     },
@@ -926,6 +955,7 @@ export default {
           }
           this.$refs.avatar.form = {}
           this.getRow(data,list)
+
         }
       })
     },
@@ -1046,15 +1076,19 @@ export default {
         case '打印':
           if (!this.$refs.avatar.form.fId){
             this.$message.error('未保存,不允许打印');
+          }else if (this.$refs.avatar.form.fBillstatus >= 4){
+            this.formList = this.$refs.avatar.form
+            this.dialogVisible = true
           }else {
             this.formList = this.$refs.avatar.form
+            console.log(this.$refs.avatar.form.fBillstatus)
             this.submitAndSave(1)
           }
           break
         case '修改':
           this.contentButton.forEach(item =>{
             if (this.$refs.avatar.form.fBillstatus >= 4){
-              if (item.name === '返回列表' || item.name === '修改' || item.name === '生成入库单' || item.name === '生成销售单' || item.name === '查看审批' || item.name === '审批'){
+              if (item.name === '返回列表' || item.name == '打印' || item.name === '修改' || item.name === '生成入库单' || item.name === '生成销售单' || item.name === '查看审批' || item.name === '审批' || item.name === '撤销采购' || item.name === '撤销审批'){
                 item.disabled = false
               }else {
                 item.disabled = true
@@ -1174,6 +1208,39 @@ export default {
             this.$message.warning('未选择列表,请选择后再点击');
           }
           break
+        case '撤销审批':
+          let date = new Date()
+          let y = date.getFullYear()
+          let m = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1)
+          let d = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate())
+          data = {
+            actId:520,
+            id:this.$refs.avatar.form.fId,
+            billId:this.$refs.avatar.form.fId,
+            auditItem:y + '-' + m + '-' + d
+          }
+          console.log(data)
+          // revoke(data).then(res=>{
+          //   console.log(res)
+          // })
+          break
+        case '撤销采购':
+          withdrawBy(this.$refs.avatar.form.fId).then(res=>{
+            if (res.code === 200){
+              this.$message({
+                showClose: true,
+                message: '撤销成功',
+                type: 'success'
+              })
+              data = {
+                tableName: this.queryList.tableName,
+                userId: Cookies.get('userName')
+              }
+              this.getRow(data)
+              this.query(this.formDataList)
+            }
+          })
+          break
         default:
           this.$message.error('该按钮暂无功能')
       }

+ 4 - 4
src/views/startApproval.vue

@@ -96,10 +96,10 @@ import Global from '@/layout/components/global'
         this.$set(this.dataForm, 'auditItem', Date.parse(new Date()))
       },
       getTime(){
-        var date = new Date(this.dataForm.auditItem)
-        var y = date.getFullYear()
-        var m = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1)
-        var d = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate())
+        let date = new Date(this.dataForm.auditItem)
+        let y = date.getFullYear()
+        let m = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1)
+        let d = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate())
         this.$set(this.dataForm, 'auditItem', y + '-' + m + '-' + d)
       },
       approved () {

+ 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]: ''