358 lines
11 KiB
Vue
358 lines
11 KiB
Vue
<template>
|
|
<process-common-layout ref="personnelInfo" class="page-box" :loading="loading" :process-key="ProcessKey.NO_MATCH_TRACKING.value">
|
|
<template v-slot:process>
|
|
<!--流程信息-->
|
|
<div class="process-part">
|
|
<div class="process-part-title">{{ $t('processInformation') }}</div>
|
|
<van-form input-align="right" label-width="7.2em">
|
|
<!--流程名称-->
|
|
<van-field v-model="processInfo.processName"
|
|
:label="$t('processName')"
|
|
type="textarea"
|
|
autosize
|
|
readonly
|
|
rows="1"
|
|
:placeholder="$t('pleaseEnter')+$t('processName')"
|
|
:border="false" />
|
|
<!--截止日期-->
|
|
<van-field v-model="processInfo.processDueDate"
|
|
:label="$t('expirationDate')"
|
|
type="textarea"
|
|
autosize
|
|
readonly
|
|
rows="1"
|
|
:placeholder="$t('pleaseSelect')+$t('expirationDate')"
|
|
:border="false" />
|
|
<!--流程说明-->
|
|
<van-field v-model="processInfo.processDescription"
|
|
:label="$t('processExplain')"
|
|
type="textarea"
|
|
autosize
|
|
disabled
|
|
rows="1"
|
|
:placeholder="$t('pleaseEnter')+$t('processExplain')"
|
|
:border="false"
|
|
input-align="left"
|
|
class="vertical-form-item">
|
|
</van-field>
|
|
</van-form>
|
|
</div>
|
|
|
|
<!--业务基本信息-->
|
|
<div class="process-part">
|
|
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
|
|
<z-expand-table :columns="columns"
|
|
:dataSource="dataSource"
|
|
bordered
|
|
rowKey="id"
|
|
:scroll="{x: '100%'}"
|
|
:pagination="false"
|
|
:extra-form="extraForm"
|
|
:all-disabled="true">
|
|
</z-expand-table>
|
|
</div>
|
|
|
|
<!--流程审批信息-->
|
|
<div class="process-part">
|
|
<div class="process-part-title">{{ $t('processApprovalInfo') }}</div>
|
|
<van-form input-align="right" ref="approvalForm">
|
|
<!--备注-->
|
|
<van-field v-model="approvalInfo.handleText"
|
|
:label="$t('remark')"
|
|
type="textarea"
|
|
autosize
|
|
rows="1"
|
|
:placeholder="$t('pleaseEnter')+$t('remark')"
|
|
:border="false"
|
|
input-align="left"
|
|
:rules="rules.handleText"
|
|
class="vertical-form-item">
|
|
</van-field>
|
|
<!--附件-->
|
|
<z-upload v-model="approvalInfo.handleFile" />
|
|
</van-form>
|
|
</div>
|
|
</template>
|
|
|
|
<template v-slot:operation>
|
|
<!--转办-->
|
|
<van-button class="operation-common-btn" @click="handleTurnTo">
|
|
<template #icon>
|
|
<van-icon class="iconfont" class-prefix="icon" name="xunhuan" />
|
|
</template>
|
|
{{ $t('turnTo') }}
|
|
</van-button>
|
|
<!--同意-->
|
|
<van-button icon="revoke" class="operation-common-btn" type="primary" @click="handleAgree">
|
|
<template #icon>
|
|
<van-icon class="iconfont" class-prefix="icon" name="check" />
|
|
</template>
|
|
{{ $t('agree') }}
|
|
</van-button>
|
|
<!--驳回-->
|
|
<van-button icon="revoke" class="operation-common-btn light-color-button" @click="handleReject">
|
|
<template #icon>
|
|
<van-icon class="iconfont" class-prefix="icon" name="close" />
|
|
</template>
|
|
{{ $t('reject') }}
|
|
</van-button>
|
|
</template>
|
|
|
|
<!--转办选人-->
|
|
<select-user ref="selectUser" @selected-change="continueTurnTo" />
|
|
</process-common-layout>
|
|
</template>
|
|
|
|
<script>
|
|
import ProcessCommonLayout from '../../../components/ProcessCommonLayout'
|
|
import { ProcessKey } from '../../../enums/commonEnums'
|
|
import { processTransfer, queryNoMatchTrackingProcess, agreeNoMatchTrackingProcess, rejectNoMatchTrackingProcess } from '../../../api/api'
|
|
import ZExpandTable from '../../../components/ZExpandTable'
|
|
import SelectUser from '../../../components/SelectUser'
|
|
import ZUpload from '../../../components/ZUpload'
|
|
|
|
export default {
|
|
name: 'NoMatchTrackingProcess',
|
|
components: { ZUpload, SelectUser, ProcessCommonLayout, ZExpandTable },
|
|
data () {
|
|
return {
|
|
ProcessKey,
|
|
loading: false,
|
|
processInfo: {}, // 流程信息
|
|
columns: [
|
|
// 标准编号
|
|
{
|
|
dataIndex: 'standardNumber',
|
|
title: this.$t('standardNumber'),
|
|
width: 150,
|
|
align: 'center'
|
|
},
|
|
// 标准名称
|
|
{
|
|
dataIndex: 'standardName',
|
|
title: this.$t('standardName'),
|
|
width: 150,
|
|
align: 'center'
|
|
},
|
|
// 条款号
|
|
{
|
|
dataIndex: 'termNum',
|
|
title: this.$t('noMatchTracking.clauseNumber'),
|
|
width: 150,
|
|
align: 'center'
|
|
},
|
|
// 条款名称
|
|
{
|
|
title: this.$t('noMatchTracking.clauseName'),
|
|
width: 150,
|
|
dataIndex: 'termName',
|
|
align: 'center'
|
|
},
|
|
// 问题类型
|
|
{
|
|
dataIndex: 'assessResults_dictText',
|
|
title: this.$t('noMatchTracking.problemTypes'),
|
|
width: 150,
|
|
align: 'center'
|
|
|
|
},
|
|
// 相关项目
|
|
{
|
|
title: this.$t('noMatchTracking.relevantProject'),
|
|
width: 150,
|
|
dataIndex: 'projectName',
|
|
align: 'center'
|
|
},
|
|
// 设计工程师
|
|
{
|
|
dataIndex: 'engineerId_dictText',
|
|
title: this.$t('noMatchTracking.designEngineer'),
|
|
width: 120,
|
|
align: 'center'
|
|
},
|
|
// 预计整改完成日期
|
|
{
|
|
dataIndex: 'expectedTime',
|
|
title: this.$t('noMatchTracking.estimatedDateOfCompletionOfRectification'),
|
|
width: 180,
|
|
align: 'center'
|
|
|
|
}
|
|
],
|
|
dataSource: [],
|
|
// 展开表格的规则
|
|
extraForm: {
|
|
rules: {
|
|
// 依据描述
|
|
description: {
|
|
required: true,
|
|
message: this.$t('pleaseEnter') + this.$t('standardConsultation.basisDescription'),
|
|
trigger: 'blur'
|
|
},
|
|
// 佐证材料
|
|
fileId: {
|
|
required: false,
|
|
message: this.$t('pleaseUpload') + this.$t('standardConsultation.supportingMaterial'),
|
|
trigger: 'change'
|
|
}
|
|
},
|
|
formArr: [
|
|
{
|
|
fieldShowType: 1,
|
|
dbFieldTxt: this.$t('standardConsultation.basisDescription'),
|
|
dbFieldName: 'description'
|
|
},
|
|
{
|
|
fieldShowType: 2,
|
|
dbFieldTxt: this.$t('standardConsultation.supportingMaterial'),
|
|
dbFieldName: 'fileId'
|
|
}
|
|
]
|
|
},
|
|
rules: {
|
|
handleText: [{ required: false, message: this.$t('pleaseEnter') + this.$t('remark'), trigger: 'onBlur' }]
|
|
},
|
|
approvalInfo: {} // 流程审批信息
|
|
}
|
|
},
|
|
created () {
|
|
this.initProcess()
|
|
},
|
|
methods: {
|
|
/**
|
|
* 获取流程数据
|
|
*/
|
|
initProcess () {
|
|
this.loading = true
|
|
const params = {
|
|
processInstanceId: this.$route.query.processInstanceId,
|
|
taskId: this.$route.query.taskId
|
|
}
|
|
queryNoMatchTrackingProcess(params).then(res => {
|
|
if (res.success) {
|
|
const { result = {} } = res
|
|
this.processInfo = Object.assign({}, result.basicProcessInfoDTO || {})
|
|
this.dataSource = result.businessInfoDTO.processProjectNotMetLinks || []
|
|
}
|
|
}).finally(() => {
|
|
this.loading = false
|
|
})
|
|
},
|
|
/**
|
|
* 转办
|
|
*/
|
|
handleTurnTo () {
|
|
this.$refs.selectUser.open()
|
|
},
|
|
continueTurnTo (userId) {
|
|
const params = {
|
|
taskId: this.$route.query.taskId,
|
|
userId
|
|
}
|
|
this.loading = true
|
|
processTransfer(params).then(res => {
|
|
this.$message(res.message)
|
|
if (res.success) {
|
|
this.goBack()
|
|
}
|
|
}).finally(() => {
|
|
this.loading = false
|
|
})
|
|
},
|
|
goBack () {
|
|
let timer = setTimeout(() => {
|
|
clearTimeout(timer)
|
|
timer = null
|
|
this.$router.go(-1)
|
|
}, 700)
|
|
},
|
|
validateForm (formName) {
|
|
let flag = true
|
|
return new Promise(resolve => {
|
|
if (this.$refs[formName]) {
|
|
this.$refs[formName].validate().then(() => {
|
|
}).catch(() => {
|
|
flag = false
|
|
}).finally(() => {
|
|
resolve(flag)
|
|
})
|
|
} else {
|
|
resolve(flag)
|
|
}
|
|
})
|
|
},
|
|
/**
|
|
* 数据处理
|
|
* @returns {Promise<{businessInfoDTO: {processProjectNotMetLinks: any}, userInfoMap, basicProcessInfoDTO: {}, basicTaskInfoDTO: {}}|boolean>}
|
|
*/
|
|
async dealFormData () {
|
|
let flag = true, basicTaskInfoDTO = {}
|
|
const approvalCheckResult = await this.validateForm('approvalForm')
|
|
if (approvalCheckResult) {
|
|
basicTaskInfoDTO = { ...this.approvalInfo, taskId: this.$route.query.taskId }
|
|
} else {
|
|
flag = false
|
|
this.$message(this.$t('pleaseEnterRemarks'))
|
|
}
|
|
if (!flag) {
|
|
return false
|
|
}
|
|
return {
|
|
basicProcessInfoDTO: { ...this.processInfo },
|
|
basicTaskInfoDTO,
|
|
businessInfoDTO: {
|
|
processProjectNotMetLinks: JSON.parse(JSON.stringify(this.dataSource))
|
|
},
|
|
userInfoMap: this.$refs.personnelInfo.getDataObj()
|
|
}
|
|
},
|
|
/**
|
|
* 同意
|
|
*/
|
|
async handleAgree () {
|
|
this.rules.handleText[0].required = false
|
|
if (!this.approvalInfo.handleText) {
|
|
this.approvalInfo.handleText = '同意'
|
|
}
|
|
const formData = await this.dealFormData()
|
|
if (!formData) {
|
|
return
|
|
}
|
|
this.loading = true
|
|
agreeNoMatchTrackingProcess(formData).then(res => {
|
|
this.$message(res.message)
|
|
if (res.success) {
|
|
this.goBack()
|
|
}
|
|
}).finally(() => {
|
|
this.loading = false
|
|
})
|
|
},
|
|
/**
|
|
* 驳回
|
|
* @returns {Promise<void>}
|
|
*/
|
|
async handleReject () {
|
|
this.rules.handleText[0].required = true
|
|
const formData = await this.dealFormData()
|
|
if (!formData) {
|
|
return
|
|
}
|
|
this.loading = true
|
|
rejectNoMatchTrackingProcess(formData).then(res => {
|
|
this.$message(res.message)
|
|
if (res.success) {
|
|
this.goBack()
|
|
}
|
|
}).finally(() => {
|
|
this.loading = false
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="less">
|
|
@import '~../../../assets/less/common.less';
|
|
|
|
</style> |