소스 검색

报价管理详情页

damon227 1 년 전
부모
커밋
b03427c019
2개의 변경된 파일75개의 추가작업 그리고 7개의 파일을 삭제
  1. 67 6
      src/views/modules/cus/quoted-detail.vue
  2. 8 1
      src/views/modules/msg-center/approve-add-or-update.vue

+ 67 - 6
src/views/modules/cus/quoted-detail.vue

@@ -2,6 +2,43 @@
   <div>
     <div class="my-title">详情</div>
     <div style="margin-left: 20px; margin-right: 20px">
+      <!-- 工作流 -->
+      <div v-show="dataForm.workFlowBusinessExt">
+        <el-steps
+          :active="
+            dataForm.workFlowBusinessExt &&
+            dataForm.workFlowBusinessExt.workFlowProcessStepList
+              ? dataForm.workFlowBusinessExt.workFlowProcessStepList.length + 2
+              : 0
+          "
+          align-center
+          style="margin-bottom: 20px"
+        >
+          <template v-for="(item, i) in stepList">
+            <el-step
+              :icon="item.icon"
+              :title="item.title"
+              :description="item.description"
+            ></el-step>
+          </template>
+        </el-steps>
+        <el-collapse style="margin-bottom: 20px">
+          <el-collapse-item>
+            <template slot="title">
+              <span style="color: red">审批日志(展开查看更多):</span>
+            </template>
+            <template v-for="(item, i) in logList">
+              <div>
+                {{ ++i }}:{{ item.approverName }} {{ item.createTime }}
+                {{ item.approvalValue }}
+              </div>
+            </template>
+          </el-collapse-item>
+        </el-collapse>
+      </div>
+      <div v-if="isFlow">
+        <approve-component ref="approve" @approveFinished="approveFinished" />
+      </div>
       <e-desc title="基本信息" column="3">
         <e-desc-item label="沟通信息">{{ dataForm.coCode }}</e-desc-item>
         <e-desc-item label="项目名称">{{ dataForm.projectName }}</e-desc-item>
@@ -283,6 +320,8 @@ import EDesc from '../common/e-desc'
 import EDescItem from '../common/e-desc-item'
 import UploadComponent from '../common/upload-component-v2'
 import AttachDetailDialog from '../common/attach-detail-dialog'
+import ApproveComponent from '../common/approve-component'
+import { dealStepData, dealStepLogs } from '@/api/util'
 import { getDetail } from '@/api/quoted'
 import { getCoCode } from '@/api/cus'
 import { getProductList, getProductAllDetail } from '@/api/product'
@@ -292,11 +331,12 @@ import {
   rankTypeOption
 } from '@/utils/enums'
 export default {
-  name: '',
-  components: { EDesc, EDescItem, UploadComponent, AttachDetailDialog },
+  name: 'cus-quoted-detail',
+  components: { EDesc, EDescItem, UploadComponent, AttachDetailDialog, ApproveComponent },
   props: {},
   data () {
     return {
+      isFlow: false,
       id: 0,
       productTypeOption: productTypeOption,
       taskTypeOption: taskTypeOption,
@@ -311,7 +351,9 @@ export default {
         quotedPriceProductList: [], // 报价物料清单
         workInfoList: []
       },
-      productList: []
+      productList: [],
+      stepList: [],
+      logList: []
     }
   },
   watch: {},
@@ -323,11 +365,17 @@ export default {
     onChose () {
       this.$emit('onChose')
     },
-    async init (id) {
+    async init (id, businessType) {
       this.id = id || 0
+      this.isFlow = !!(businessType && businessType !== '')
+      this.dataForm = {
+        workFlowBusinessExt: null
+      }
+      this.stepList = []
+      this.logList = []
       await this.getCoCode()
       await this.getProductList()
-      this.getDetail(id)
+      this.getDetail(id, businessType)
     },
     async getCoCode () {
       await getCoCode().then(({ data }) => {
@@ -354,7 +402,7 @@ export default {
         }
       })
     },
-    getDetail (id) {
+    getDetail (id, businessType) {
       getDetail(id).then(({ data }) => {
         if (data && data.code === '200') {
           this.dataForm = data.data
@@ -369,6 +417,19 @@ export default {
           ).label
 
           this.productIdChangeHandle(this.dataForm.productId)
+
+          // 流程图展示
+          dealStepData(
+            data.data.workFlowBusinessExt.workFlowProcessStepList,
+            this.stepList
+          )
+          dealStepLogs(
+            data.data.workFlowBusinessExt.processLogList,
+            this.logList
+          )
+
+          // 初始化审批Form
+          this.showApproveForm(businessType, this.id)
         }
       })
     },

+ 8 - 1
src/views/modules/msg-center/approve-add-or-update.vue

@@ -42,6 +42,9 @@
     <div v-show="businessType === 'nonconforming_hear_flow'">
       <disqualification-detail ref="disqualificationDetail" @approveFinished="approveFinished" @onChose="onChose"/>
     </div>
+    <div v-show="businessType === 'project_estimate'">
+      <cus-quoted-detail ref="cusQuotedDetail" @approveFinished="approveFinished" @onChose="onChose"/>
+    </div>
   </div>
 </template>
 
@@ -60,6 +63,7 @@
   import damageDetails from '../production/damage-details'
   import CommunicateDetail from '@/views/modules/cus/communicate-detail'
   import DisqualificationDetail from '@/views/modules/quality/disqualification-detail'
+  import CusQuotedDetail from '@/views/modules/cus/quoted-detail'
 export default {
     name: 'approve-add-or-update',
     components: {
@@ -76,7 +80,8 @@ export default {
       OutsourceDetail,
       ExpenseDetail,
       damageDetails,
-      DisqualificationDetail
+      DisqualificationDetail,
+      CusQuotedDetail
     },
     data () {
       return {
@@ -121,6 +126,8 @@ export default {
           this.display ? this.$refs.communicateDetail.init(this.businessId) : this.$refs.communicateDetail.init(this.businessId, businessType)
         } else if (this.businessType === 'nonconforming_hear_flow') {
           this.display ? this.$refs.disqualificationDetail.init(this.businessId) : this.$refs.disqualificationDetail.init(this.businessId, businessType)
+        } else if (this.businessType === 'project_estimate') {
+          this.display ? this.$refs.cusQuotedDetail.init(this.businessId) : this.$refs.cusQuotedDetail.init(this.businessId, businessType)
         } else {
           this.$message.error('流程类别不支持,请联系管理员!')
         }