|
@@ -5,6 +5,27 @@
|
|
|
:close-on-click-modal="false"
|
|
|
:visible.sync="visible">
|
|
|
<div style="margin-left: 20px;margin-right: 20px">
|
|
|
+ <!-- 工作流 -->
|
|
|
+ <div v-show="dataForm.workFlowBusinessExt">
|
|
|
+ <el-steps :active="dataForm.workFlowBusinessExt?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-show="isFlow">
|
|
|
+ <approve-component ref="approve" @approveFinished="approveFinished"/>
|
|
|
+ </div>
|
|
|
<e-desc title="基本信息" column="3">
|
|
|
<e-desc-item label="模板出库编码">{{dataForm.recordCode}}</e-desc-item>
|
|
|
<e-desc-item label="产品编号">{{dataForm.recordNumber}}</e-desc-item>
|
|
@@ -82,35 +103,63 @@
|
|
|
import EDesc from '../common/e-desc'
|
|
|
import EDescItem from '../common/e-desc-item'
|
|
|
import { getDeliveryDetail } from '@/api/warehouse'
|
|
|
+ import { dealStepData, dealStepLogs } from '@/api/util'
|
|
|
+ import ApproveComponent from '../common/approve-component'
|
|
|
export default {
|
|
|
name: 'template-deliver-detail',
|
|
|
components: {
|
|
|
- EDesc, EDescItem
|
|
|
+ EDesc, EDescItem, ApproveComponent
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
visible: false,
|
|
|
+ isFlow: false,
|
|
|
id: 0,
|
|
|
dataForm: {},
|
|
|
- materialList: []
|
|
|
+ materialList: [],
|
|
|
+ stepList: [],
|
|
|
+ logList: []
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- async init (id) {
|
|
|
+ async init (id, businessType) {
|
|
|
this.visible = true
|
|
|
+ this.isFlow = !!(businessType && businessType !== '')
|
|
|
+ this.stepList = []
|
|
|
+ this.logList = []
|
|
|
this.id = id || 0
|
|
|
this.dataForm = {}
|
|
|
this.materialList = []
|
|
|
- this.getDetails()
|
|
|
+ this.getDetails(businessType)
|
|
|
},
|
|
|
- getDetails () {
|
|
|
+ getDetails (businessType) {
|
|
|
getDeliveryDetail(this.id).then(({data}) => {
|
|
|
if (data && data.code === '200') {
|
|
|
this.dataForm = data.data
|
|
|
+ // 流程图展示
|
|
|
+ if (data.data.workFlowBusinessExt) {
|
|
|
+ dealStepData(data.data.workFlowBusinessExt.workFlowProcessStepList, this.stepList)
|
|
|
+ dealStepLogs(data.data.workFlowBusinessExt.processLogList, this.logList)
|
|
|
+ }
|
|
|
// 模板对应的零件
|
|
|
this.materialList = data.data.whTemplateItemPlanList
|
|
|
+ // 初始化审批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')
|
|
|
}
|
|
|
}
|
|
|
}
|