瀏覽代碼

审批流申请

wengyuwen 4 年之前
父節點
當前提交
4fae450cb6
共有 3 個文件被更改,包括 70 次插入7 次删除
  1. 35 2
      src/views/project/index1.vue
  2. 31 3
      src/views/purchaseIssue/index.vue
  3. 4 2
      src/views/purchaseRequest/index.vue

+ 35 - 2
src/views/project/index1.vue

@@ -365,6 +365,9 @@
           <el-button size="mini" :disabled="doNot" type="primary" @click="approval">请核</el-button>
         </el-col>
         <el-col :span="1.5">
+          <el-button size="mini" v-if="approvedBy" type="primary" @click="addOrUpdateHand">审批</el-button>
+        </el-col>
+        <el-col :span="1.5">
           <el-button size="mini" v-if="detailform.fBillstatus >= 4" type="primary" @click="addOrUpdateHandle">查看审批</el-button>
         </el-col>
         <div style="margin: 0 12px;float: right">
@@ -595,6 +598,7 @@ export default {
   },
   data() {
     return {
+      approvedBy:false,
       addOrUpdateVisible: false,
       addOrUpdateVisib: false,
       liableOption:[],
@@ -800,6 +804,9 @@ export default {
       name:''
     }
   },
+  activated(){
+    this.homePage()
+  },
   created(){
     this.setRowList = this.getRowList = this.tableDate
     this.setRowList2 = this.getRowList2 = this.tableDate2
@@ -815,6 +822,28 @@ export default {
 
   },
   methods: {
+    addOrUpdateHand() {
+      this.addOrUpdateVisib = true;
+      this.$nextTick(() => {
+        this.$refs.ApprovalComments.init(this.detailform.fId,510);
+      });
+    },
+    homePage(){
+      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
+          }
+        }
+        this.handleUpdate(scope.row)
+        this.approvedBy = true
+      }
+    },
     // 查看审批流
     getDataList() {
       this.addOrUpdateVisible = false;
@@ -909,6 +938,7 @@ 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) {
@@ -976,9 +1006,12 @@ export default {
       })
     },
     goBack() {
-      if (this.doNot == true) {
+      console.log(this.$route.query)
+      if (this.doNot == true && !this.$route.query) {
         this.mainTabel = false
-      }else{
+      }else if(this.$route.query){
+        this.$router.push({path:'/index'})
+      } else{
           this.$confirm('返回列表,是否保存?', '提示', {
             confirmButtonText: '保存',
             cancelButtonText: '取消',

+ 31 - 3
src/views/purchaseIssue/index.vue

@@ -662,6 +662,8 @@ export default {
         }
       ]
     }
+  },activated(){
+    this.homePage()
   },
   created() {
     let data = {
@@ -736,6 +738,21 @@ export default {
     this.fCompany(2)
   },
   methods: {
+    homePage(){
+      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
+          }
+        }
+        this.viewMethod(scope)
+      }
+    },
     // 查看审批流
     getDataList() {
       this.addOrUpdateVisible = false;
@@ -952,6 +969,12 @@ export default {
     selectionbox(selection) {
       console.log(selection)
     },
+    addOrUpdateHand() {
+      this.addOrUpdateVisib = true;
+      this.$nextTick(() => {
+        this.$refs.ApprovalComments.init(this.$refs.avatar.form.fId,520);
+      });
+    },
     //详情内容保存
     submitAndSave(item) {
       let formData = new window.FormData()
@@ -1035,7 +1058,7 @@ export default {
         case '修改':
           this.contentButton.forEach(item =>{
             if (this.$refs.avatar.form.fBillstatus >= 4){
-              if (item.name === '返回列表' || item.name === '修改' || item.name === '申请发票' || item.name === '查看审批'){
+              if (item.name === '返回列表' || item.name === '修改' || item.name === '申请发票' || item.name === '查看审批' || item.name === '审批'){
                 item.disabled = false
               }else {
                 item.disabled = true
@@ -1070,14 +1093,16 @@ export default {
           })
           break
         case '返回列表':
-          if (!this.$refs.avatar.form.fId && this.contentList !== 0 || this.$refs.avatar.form.fBillstatus >= 4) {
+          if (!this.$refs.avatar.form.fId && this.contentList !== 0 || this.$refs.avatar.form.fBillstatus >= 4 && !this.$route.query) {
             data = {
               tableName: this.queryList.tableName,
               userId: Cookies.get('userName')
             }
             this.getRow(data)
             this.query(this.formDataList)
-          } else {
+          } else if(this.$route.query){
+            this.$router.push({path:'/index'})
+          }else {
             this.$confirm('当前数据未保存是否保存?', '提示', {
               confirmButtonText: '保存',
               cancelButtonText: '取消',
@@ -1104,6 +1129,9 @@ export default {
         case '查看审批':
           this.addOrUpdateHandle()
           break
+        case '审批':
+          this.addOrUpdateHand()
+          break
         default:
           this.$message.error('该按钮暂无功能')
       }

+ 4 - 2
src/views/purchaseRequest/index.vue

@@ -1082,14 +1082,16 @@ export default {
           this.addOrUpdateHand()
           break
         case '返回列表':
-          if (!this.$refs.avatar.form.fId && this.contentList !== 0 || this.$refs.avatar.form.fBillstatus > 3) {
+          if (!this.$refs.avatar.form.fId && this.contentList !== 0 || this.$refs.avatar.form.fBillstatus > 3 && !this.$route.query) {
             data = {
               tableName: this.queryList.tableName,
               userId: Cookies.get('userName')
             }
             this.getRow(data)
             this.query(this.formDataList)
-          } else {
+          } else if(this.$route.query){
+            this.$router.push({path:'/index'})
+          }else {
             this.$confirm('当前数据未保存是否保存?', '提示', {
               confirmButtonText: '保存',
               cancelButtonText: '取消',