Browse Source

项目管理修改

wengyuwen 4 years ago
parent
commit
9d86bca80b
1 changed files with 56 additions and 8 deletions
  1. 56 8
      src/views/project/index1.vue

+ 56 - 8
src/views/project/index1.vue

@@ -370,10 +370,16 @@
         <el-col :span="1.5">
           <el-button size="mini" v-if="detailform.fBillstatus >= 4" type="primary" @click="addOrUpdateHandle">查看审批</el-button>
         </el-col>
+        <el-col :span="1.5">
+          <el-button size="mini" v-if="detailform.fBillstatus == 4 && this.lander == this.operator" type="danger" @click="backApproval(1)">撤销审批</el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button size="mini" v-if="detailform.fBillstatus == 6 && this.lander == this.before" type="warning" @click="backApproval(2)">撤销项目管理</el-button>
+        </el-col>
         <div style="margin: 0 12px;float: right">
           <el-button
             icon="el-icon-setting"
-            size="mini"
+            size="mini"t
             circle
             @click="showSetting = !showSetting"
           ></el-button>
@@ -535,6 +541,7 @@ import draggable from "vuedraggable";
 import { addChange, getChange, listCharge, getCorps, getliable, listmaterial, delProject, addproject} from '@/api/project'
 import Cookies from 'js-cookie'
 import { addSet, resetModule, select } from '@/api/system/set'
+import { getName, queryUserVal, revoke, revokeBill } from '@/api/purchaseIssue'
 Vue.directive('dialogDrag', {
   bind(el, binding, vnode, oldVnode) {
     const dialogHeaderEl = el.querySelector('.el-dialog__header')
@@ -598,6 +605,9 @@ export default {
   },
   data() {
     return {
+      operator:'',
+      lander:'',
+      before:'',
       approvedBy:false,
       addOrUpdateVisible: false,
       addOrUpdateVisib: false,
@@ -808,6 +818,10 @@ export default {
     this.homePage()
   },
   created(){
+    //获取登陆人
+    queryUserVal().then((response) => {
+      this.lander = response.user.userName;
+    })
     this.setRowList = this.getRowList = this.tableDate
     this.setRowList2 = this.getRowList2 = this.tableDate2
     this.getList()
@@ -822,6 +836,35 @@ export default {
 
   },
   methods: {
+    //撤销审批
+    backApproval(res) {
+      if(res == 1){
+        let data = {
+          id: this.detailform.fId,
+          actId: 510,
+          billId: this.detailform.fId,
+        };
+        revoke(data).then((response) => {
+          if (response.code === 200) {
+            this.msgSuccess("撤销审批成功");
+            this.mainTabel = false
+            this.getList();
+          }
+        });
+      }else if(res == 2){
+        let data ={
+          fId:this.detailform.fId
+        }
+        revokeBill(data).then(res=>{
+          if(res.code == 200){
+            this.$message.success("撤销成功");
+            this.getList()
+            this.mainTabel = false
+          }
+        })
+      }
+    },
+    //物料带出单位
     change(scope){
       for(let item in this.detailList){
         for(let li in this.materialOption){
@@ -841,9 +884,6 @@ export default {
       let date = this.$route.query
       console.log(date)
       if (this.$route.query.list){
-        // console.log(this.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
@@ -947,11 +987,11 @@ export default {
       this.mainTabel = true
     },
     handleUpdate(row, res) {
-      console.log(row)
       const fId = row.fId || this.ids
       getChange(fId).then(response => {
         if (response.data.projectItemsList) {
           this.detailform = response.data.tProject
+          this.operator = this.detailform.createBy
         }
         if (response.data.tProject) {
           this.detailList = response.data.projectItemsList
@@ -962,14 +1002,22 @@ export default {
         }
         console.log(this.detailform.fBillstatus)
         if(this.detailform.fBillstatus >= 4){
+          console.log("111")
           this.doNot = true
           this.doNotchange = true
         }else{
-          console.log("111")
           this.doNot = true
-
+          this.doNotchange = false
         }
-
+          let data = {
+            actId: 510,
+            id: this.detailform.fId
+          }
+          getName(data).then(response => {
+            if (response.data.length != 0) {
+              this.before = response.data[0].userName
+            }
+          })
         this.mainTabel = true
       })
     },