chris %!s(int64=3) %!d(string=hai) anos
pai
achega
c3c5f1a592

+ 25 - 4
src/views/modules/cus/contract-detail.vue

@@ -23,6 +23,9 @@
           </el-collapse-item>
         </el-collapse>
       </div>
+      <div v-show="isFlow">
+        <approve-component ref="approve" @approveFinished="approveFinished"/>
+      </div>
       <e-desc title="基本信息" column="3">
         <e-desc-item label="评审编码">{{dataForm.reCode}}</e-desc-item>
         <e-desc-item label="沟通编码">{{dataForm.coCode}}</e-desc-item>
@@ -50,14 +53,16 @@
   import { geTreDetail } from '@/api/cus'
   import uploadComponent from '../common/upload-component'
   import { dealStepData, dealStepLogs } from '@/api/util'
+  import ApproveComponent from '../common/approve-component'
   export default {
     name: 'contract-detail',
     components: {
-      EDesc, EDescItem, uploadComponent
+      EDesc, EDescItem, uploadComponent, ApproveComponent
     },
     data () {
       return {
         visible: false,
+        isFlow: false,
         id: 0,
         dataForm: {},
         cusRCommProductVOS: [],
@@ -68,8 +73,9 @@
       }
     },
     methods: {
-      async init (id) {
+      async init (id, businessType) {
         this.visible = true
+        this.isFlow = !!(businessType && businessType !== '')
         this.id = id || 0
         this.dataForm = {}
         this.cusRCommProductVOS = []
@@ -77,9 +83,9 @@
         this.fileList1 = []
         this.stepList = []
         this.logList = []
-        this.getDetails()
+        this.getDetails(businessType)
       },
-      getDetails () {
+      getDetails (businessType) {
         geTreDetail(this.id).then(({data}) => {
           if (data && data.code === '200') {
             this.dataForm = data.data
@@ -97,8 +103,23 @@
                 id: item.url
               })
             })
+            // 初始化审批Form
+            this.showApproveForm(businessType, this.id)
           }
         })
+      },
+      // 初始化审批Form
+      showApproveForm (businessType, businessId) {
+        if (this.isFlow) {
+          this.$nextTick(() => {
+            this.$refs.approve.init(businessType, businessId)
+          })
+        }
+      },
+      // 审批完成
+      approveFinished () {
+        this.visible = false
+        this.$emit('approveFinished')
       }
     }
   }

+ 4 - 2
src/views/modules/msg-center/approve-add-or-update.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <div v-show="businessType === 'warehouse_flow_in'">
+    <div v-show="businessType === 'warehouse_flow_in'|| this.businessType === 'warehouse_flow_out'">
       <stock-order-detail ref="stockOrderDetail" @approveFinished="approveFinished"/>
     </div>
     <div v-show="businessType === 'contract_review'">
@@ -29,8 +29,10 @@
         this.businessType = businessType || ''
         this.businessId = businessId || 0
         this.display = display
-        if (this.businessType === 'warehouse_flow_in') {
+        if (this.businessType === 'warehouse_flow_in' || this.businessType === 'warehouse_flow_out') {
           this.display ? this.$refs.stockOrderDetail.init(this.businessId) : this.$refs.stockOrderDetail.init(this.businessId, businessType)
+        } else if (this.businessType === 'contract_review') {
+          this.display ? this.$refs.contractDetail.init(this.businessId) : this.$refs.contractDetail.init(this.businessId, businessType)
         } else {
           this.$message.error('类型错误,请联系管理员!')
         }

+ 46 - 1
src/views/modules/msg-center/approve.vue

@@ -2,6 +2,18 @@
 <template>
   <div class="order">
     <el-form :inline="true" :model="dataForm" @keyup.enter.native="queryData()">
+      <el-form-item label="业务类型">
+        <el-select
+          v-model="dataForm.businessType"
+          placeholder="请选择">
+          <el-option
+            v-for="item in optionsType"
+            :key="item.code"
+            :label="item.value"
+            :value="item.code">
+          </el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item label="状态">
         <el-select
           v-model="dataForm.state"
@@ -158,6 +170,38 @@
             code: '4', value: '审批不通过'
           }
         ],
+        optionsType: [
+          {
+            code: null, value: '全部'
+          },
+          {
+            code: 'warehouse_flow_in', value: '入库申请'
+          },
+          {
+            code: 'warehouse_flow_out', value: '出库申请'
+          },
+          {
+            code: 'contract_review', value: '合同评审'
+          },
+          {
+            code: 'sale_order_flow', value: '订单评审'
+          },
+          {
+            code: 'sale_purchase_flow', value: '采购申请'
+          },
+          {
+            code: 'wh_template_record_flow', value: '模板出库'
+          },
+          {
+            code: 'pro_technology_flow', value: '工艺'
+          },
+          {
+            code: 'pro_product_flow', value: '产品'
+          },
+          {
+            code: 'wh_inventory_record_flow', value: '盘点'
+          }
+        ],
         optionsCustomer: []
       }
     },
@@ -174,7 +218,8 @@
           'current': this.pageIndex,
           'size': this.pageSize,
           'createTime': this.dataForm.createTime ? this.dataForm.createTime : null,
-          'state': this.dataForm.state ? this.dataForm.state : null
+          'state': this.dataForm.state ? this.dataForm.state : null,
+          'businessType': this.dataForm.businessType ? this.dataForm.businessType : null
         }
         getApprovalList(params).then(({data}) => {
           if (data && data.code === '200') {