Browse Source

审批全局注册

caojunjie 4 years ago
parent
commit
d4760fc31d
2 changed files with 69 additions and 1 deletions
  1. 6 0
      src/main.js
  2. 63 1
      src/views/purchaseRequest/index.vue

+ 6 - 0
src/main.js

@@ -32,6 +32,12 @@ Vue.component('formComponent', formComponent)
 import draggable from "vuedraggable";
 Vue.component('draggable', draggable)
 
+//审批页面
+import ApprovalComments from "@/views/startApproval";
+import AddOrUpdate from "@/views/viewApproval";
+Vue.component('ApprovalComments', ApprovalComments)
+Vue.component('AddOrUpdate', AddOrUpdate)
+
 import Print from '@/combination/plugs/print'
 Vue.use(Print) // 注册
 // 全局方法挂载

+ 63 - 1
src/views/purchaseRequest/index.vue

@@ -72,6 +72,17 @@
         :listData="listData"
       />
     </div>
+    <add-or-update
+      v-if="addOrUpdateVisible"
+      ref="addOrUpdate"
+      @refreshDataList="getDataList"
+    ></add-or-update>
+    <approval-comments
+      v-if="addOrUpdateVisib"
+      ref="ApprovalComments"
+      @refreshDataList="returnData"
+    ></approval-comments>
+
     <el-dialog
       title="打印采购"
       :visible.sync="dialogVisible"
@@ -162,6 +173,8 @@ export default {
   name: 'index',
   data() {
     return {
+      addOrUpdateVisible: false,
+      addOrUpdateVisib: false,
       total:0,
       selection:[],
       formDataList:{
@@ -464,6 +477,12 @@ export default {
           name: '请核',
           disabled: false
         },{
+          type: 'primary',
+          size: 'mini',
+          icon: 'el-icon-edit-outline',
+          name: '查看审批',
+          disabled: false
+        },{
           type: 'info',
           size: 'mini',
           icon: 'el-icon-edit-outline',
@@ -720,6 +739,46 @@ export default {
     this.fCompany(2)
   },
   methods: {
+    // 查看审批流
+    getDataList() {
+      this.addOrUpdateVisible = false;
+    },
+    returnData() {
+      this.addOrUpdateVisib = false;
+      this.open = false;
+      this.cancelTwo();
+    },
+    addOrUpdateHandle() {
+      this.addOrUpdateVisible = true;
+      this.$nextTick(() => {
+        this.$refs.addOrUpdate.init(this.$refs.avatar.form.fId,520);
+      });
+    },
+    //首页审批跳转关闭返回首页
+    cancelTwo() {
+      this.open = false
+      let view = {
+        fullPath: '/domesticTrade/orderInformation?data=%7B%22fId%22%3A687%7D',
+        hash: '',
+        matched: Array(2),
+        meta: Object,
+        name: 'OrderInformation',
+        params: Object,
+        path: '/domesticTrade/orderInformation',
+        query: Object,
+        title: '订单信息'
+      }
+      this.$router.push({ path: '/index' })
+      this.$store
+        .dispatch('tagsView/delView', view)
+        .then(({ visitedViews }) => {
+          if (this.isActive(view)) {
+            this.toLastView(visitedViews, view)
+          }
+        })
+      Global.$emit('removeCache', 'closeSelectedTag', view)
+    },
+    //分页
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
       this.formDataList.pageSize = val
@@ -958,7 +1017,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
@@ -992,6 +1051,9 @@ export default {
             operation: '',
           })
           break
+        case '查看审批':
+          this.addOrUpdateHandle()
+          break
         case '返回列表':
           if (!this.$refs.avatar.form.fId && this.contentList !== 0 || this.$refs.avatar.form.fBillstatus > 3) {
             data = {