add 法规采购流程
This commit is contained in:
+20
-1
@@ -12,6 +12,7 @@ const queryPermissionsByUser = () => getAction('/sys/permission/getUserPermissio
|
||||
const getFormDictTreeList = (params) => getAction('/sys/dictItem/treeListOption', params)
|
||||
// 字典标签专用(通过code获取字典数组)
|
||||
export const ajaxGetDictItems = (code, params) => getAction(`/sys/dict/getDictItems/${code}`, params)
|
||||
|
||||
// 从缓存中获取字典配置
|
||||
function getDictItemsFromCache (dictCode) {
|
||||
if (Vue.ls.get(UI_CACHE_DB_DICT_DATA) && Vue.ls.get(UI_CACHE_DB_DICT_DATA)[dictCode] && Vue.ls.get(UI_CACHE_DB_DICT_DATA)[dictCode].length > 0) {
|
||||
@@ -108,6 +109,18 @@ const agreeConsultationProcess = (params) => postAction('/process/fb/processFbSt
|
||||
// 驳回
|
||||
const rejectConsultationProcess = (params) => postAction('/process/fb/processFbStandardConsultation/reject', params)
|
||||
|
||||
/* 法规采购流程 */
|
||||
// 获取流程信息
|
||||
const queryProcurementProcessInfo = (params) => getAction('/process/fb/processFbStandardPurchase/queryProcessInfoVO', params)
|
||||
// 同意
|
||||
const agreeProcurementProcess = (params) => postAction('/process/fb/processFbStandardPurchase/agree', params)
|
||||
// 驳回
|
||||
const rejectProcurementProcess = (params) => postAction('/process/fb/processFbStandardPurchase/reject', params)
|
||||
// 转办
|
||||
const transferProcurementProcess = (params) => postAction('/process/fb/processFbStandardPurchase/transfer', params)
|
||||
// 抄送
|
||||
const carbonCopyProcurementProcess = (params) => getAction('/process/fb/processFbStandardPurchase/carbonCopy', params)
|
||||
|
||||
export {
|
||||
queryPermissionsByUser,
|
||||
getFormDictTreeList,
|
||||
@@ -155,5 +168,11 @@ export {
|
||||
transferConsultationProcess,
|
||||
saveConsultationProcess,
|
||||
agreeConsultationProcess,
|
||||
rejectConsultationProcess
|
||||
rejectConsultationProcess,
|
||||
|
||||
queryProcurementProcessInfo,
|
||||
agreeProcurementProcess,
|
||||
rejectProcurementProcess,
|
||||
transferProcurementProcess,
|
||||
carbonCopyProcurementProcess
|
||||
}
|
||||
|
||||
@@ -147,5 +147,12 @@ module.exports = {
|
||||
pleaseUpload: '请上传',
|
||||
theFollowingDocuments: 'M以下文件',
|
||||
file: '文件'
|
||||
},
|
||||
// 法规采购流程
|
||||
procurement: {
|
||||
reasonForPurchase: '采购理由',
|
||||
export: '导出',
|
||||
goToThePCToExport: '请前往PC端导出',
|
||||
carbonCopy: '抄送'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,3 +120,12 @@ export const ConsultationProcess = new EsEnums({
|
||||
leaderSummary: { text: '各部所主管级领导汇总', value: 'depart_leader_collect', btn: ['return', 'save', 'submit'] },
|
||||
regulatoryEngineerApproval: { text: '法规工程师审批', value: 'engineer_end', btn: ['return', 'agree', 'reject'] }
|
||||
})
|
||||
|
||||
// 法规采购流程节点
|
||||
export const ProcurementProcessNodes = {
|
||||
initiate: { text: '申请采购标准法规', value: 'Activity_0fmr3id' },
|
||||
sponsorLeaderApproval: { text: '发起人主管级领导审批', value: 'Activity_1fr1x5i' },
|
||||
standardLeaderApproval: { text: '标准化主管级领导审批', value: 'Activity_06jy4oo' },
|
||||
standardSuperiorLeaderApproval: { text: '标准化主管级上一级领导审批', value: 'Activity_1u5337a' },
|
||||
regulatoryEngineerConfirmation: { text: '法规工程师确认', value: 'Activity_1q01zfq' }
|
||||
}
|
||||
@@ -59,5 +59,15 @@ export default [
|
||||
hasBack: true
|
||||
},
|
||||
component: () => import('@/views/workCenter/standardConsultation/StandardConsultationProcess')
|
||||
},
|
||||
// 法规采购流程
|
||||
{
|
||||
path: '/workCenter/standardProcurementProcess',
|
||||
name: 'StandardProcurementProcess',
|
||||
meta: {
|
||||
hasNavBar: true,
|
||||
hasBack: true
|
||||
},
|
||||
component: () => import('@/views/workCenter/standardProcurementProcess/StandardProcurementProcess')
|
||||
}
|
||||
]
|
||||
|
||||
@@ -0,0 +1,338 @@
|
||||
<template>
|
||||
<process-common-layout class="page-box" :loading="loading" :process-key="ProcessKey.LEGAL_PROCUREMENT.value" ref="personInfo">
|
||||
<template v-slot:process>
|
||||
<!--流程信息-->
|
||||
<div class="process-part">
|
||||
<div class="process-part-title">{{ $t('processInformation') }}</div>
|
||||
<van-form input-align="right">
|
||||
<!--流程名称-->
|
||||
<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>
|
||||
<!--导出-->
|
||||
<van-button class="export-btn" type="primary" @click="handleExport" plain>
|
||||
{{ $t('procurement.export') }}
|
||||
</van-button>
|
||||
<a-table
|
||||
bordered
|
||||
:scroll="{x: '100%'}"
|
||||
ref="table"
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="false">
|
||||
</a-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>
|
||||
<template v-if="isRegulatoryEngineerConfirmation">
|
||||
<!--抄送-->
|
||||
<van-button class="operation-common-btn" @click="handleCarbonCopy">
|
||||
<template #icon>
|
||||
<van-icon class="iconfont" class-prefix="icon" name="xunhuan" />
|
||||
</template>
|
||||
{{ $t('procurement.carbonCopy') }}
|
||||
</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('submit') }}
|
||||
</van-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<!--转办-->
|
||||
<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>
|
||||
</template>
|
||||
|
||||
<select-user ref="selectUser" @selected-change="continueTurnTo" :type="isTransfer ? 'radio' : 'checkbox'"/>
|
||||
</process-common-layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ProcessCommonLayout from '../../../components/ProcessCommonLayout'
|
||||
import { ProcessKey, ProcurementProcessNodes } from '../../../enums/commonEnums'
|
||||
import ZUpload from '../../../components/ZUpload'
|
||||
import {
|
||||
queryProcurementProcessInfo,
|
||||
transferProcurementProcess,
|
||||
agreeProcurementProcess,
|
||||
rejectProcurementProcess,
|
||||
carbonCopyProcurementProcess
|
||||
} from '../../../api/api'
|
||||
import SelectUser from '../../../components/SelectUser'
|
||||
|
||||
export default {
|
||||
name: 'StandardProcurementProcess',
|
||||
components: { SelectUser, ZUpload, ProcessCommonLayout },
|
||||
data () {
|
||||
return {
|
||||
ProcessKey,
|
||||
loading: false,
|
||||
processInfo: {},
|
||||
approvalInfo: {},
|
||||
columns: [
|
||||
{ // 标准编号
|
||||
title: this.$t('standardNumber'),
|
||||
width: 180,
|
||||
dataIndex: 'standardNumber',
|
||||
align: 'center'
|
||||
},
|
||||
{ // 标准名称
|
||||
title: this.$t('standardName'),
|
||||
width: 180,
|
||||
dataIndex: 'standardName',
|
||||
align: 'center'
|
||||
},
|
||||
{ // 采购理由
|
||||
title: this.$t('procurement.reasonForPurchase'),
|
||||
width: 380,
|
||||
dataIndex: 'purchaseReason',
|
||||
align: 'center'
|
||||
}
|
||||
],
|
||||
dataSource: [],
|
||||
rules: {
|
||||
handleText: [{ required: false, message: this.$t('pleaseEnter') + this.$t('remark'), trigger: 'onBlur' }]
|
||||
},
|
||||
currentNode: null,
|
||||
isTransfer: true // 是否转办
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 是否法规工程师确认节点
|
||||
isRegulatoryEngineerConfirmation () {
|
||||
return this.currentNode === ProcurementProcessNodes.regulatoryEngineerConfirmation.value
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.currentNode = this.$route.query.nodeId
|
||||
this.initProcessData()
|
||||
},
|
||||
methods: {
|
||||
initProcessData () {
|
||||
this.loading = true
|
||||
const params = {
|
||||
processInstanceId: this.$route.query.processInstanceId,
|
||||
draftId: this.$route.query.draftId,
|
||||
taskId: this.$route.query.taskId
|
||||
}
|
||||
queryProcurementProcessInfo(params).then(res => {
|
||||
if (res.success) {
|
||||
const { result = {} } = res
|
||||
this.processInfo = Object.assign({}, result.basicProcessInfoDTO || {})
|
||||
this.dataSource = result.businessInfoDTO || []
|
||||
this.approvalInfo = Object.assign({}, result.basicTaskInfoDTO || {})
|
||||
} else {
|
||||
this.$message(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
handleExport () {
|
||||
this.$message(this.$t('procurement.goToThePCToExport'))
|
||||
},
|
||||
goBack () {
|
||||
let timer = setTimeout(() => {
|
||||
clearTimeout(timer)
|
||||
timer = null
|
||||
this.$router.go(-1)
|
||||
}, 700)
|
||||
},
|
||||
/**
|
||||
* 转办
|
||||
*/
|
||||
handleTurnTo () {
|
||||
this.isTransfer = true
|
||||
this.$refs.selectUser.open()
|
||||
},
|
||||
/**
|
||||
* 抄送
|
||||
*/
|
||||
handleCarbonCopy () {
|
||||
this.isTransfer = false
|
||||
this.$refs.selectUser.open()
|
||||
},
|
||||
continueTurnTo (value) {
|
||||
const params = {
|
||||
taskId: this.$route.query.taskId,
|
||||
userId: value
|
||||
}
|
||||
const func = this.isTransfer ? transferProcurementProcess : carbonCopyProcurementProcess
|
||||
this.loading = true
|
||||
func(params).then(res => {
|
||||
this.$message(res.message)
|
||||
if (res.success) {
|
||||
this.goBack()
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
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)
|
||||
}
|
||||
})
|
||||
},
|
||||
async dealFormData () {
|
||||
let flag = true
|
||||
const validateResult = await this.validateForm('approvalForm')
|
||||
if (!validateResult) {
|
||||
flag = false
|
||||
}
|
||||
const userInfoMap = await this.$refs.personInfo.getDataObjVerify()
|
||||
if (!userInfoMap) {
|
||||
flag = false
|
||||
}
|
||||
if (!flag) {
|
||||
return false
|
||||
}
|
||||
const approvalInfo = { ...this.approvalInfo }
|
||||
approvalInfo.taskId = approvalInfo.taskId || this.$route.query.taskId
|
||||
return {
|
||||
basicProcessInfoDTO: { ...this.processInfo },
|
||||
basicTaskInfoDTO: approvalInfo,
|
||||
businessInfoDTO: this.dataSource,
|
||||
userInfoMap: userInfoMap || {}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 同意
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
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
|
||||
agreeProcurementProcess(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
|
||||
rejectProcurementProcess(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';
|
||||
|
||||
.export-btn {
|
||||
margin: 0 0.32rem;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user