update 法规采购流程
This commit is contained in:
+25
-1
@@ -180,6 +180,22 @@ 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 saveProcurementProcess = (params) => postAction('/process/fb/processFbStandardPurchase/saveToDraft', params)
|
||||
// 发起
|
||||
const initProcurementProcess = (params) => postAction('/process/fb/processFbStandardPurchase/startProcess', 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) => postAction('/process/fb/processFbStandardPurchase/carbonCopy', params)
|
||||
|
||||
export {
|
||||
getProcessNodeList,
|
||||
|
||||
@@ -270,5 +286,13 @@ export {
|
||||
submitConsultationProcess,
|
||||
transferConsultationProcess,
|
||||
agreeConsultationProcess,
|
||||
rejectConsultationProcess
|
||||
rejectConsultationProcess,
|
||||
|
||||
queryProcurementProcessInfo,
|
||||
saveProcurementProcess,
|
||||
initProcurementProcess,
|
||||
agreeProcurementProcess,
|
||||
rejectProcurementProcess,
|
||||
transferProcurementProcess,
|
||||
carbonCopyProcurementProcess
|
||||
}
|
||||
|
||||
@@ -350,5 +350,10 @@ module.exports = {
|
||||
meetingName: '会议名称',
|
||||
attendanceDate: '参会日期',
|
||||
relevantData: '相关材料'
|
||||
},
|
||||
// 法规采购流程
|
||||
standardProcurementProcess: {
|
||||
reasonForPurchase: '采购理由',
|
||||
addAtLeastOne: '请添加至少一条数据'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,5 +269,5 @@ export const ProcurementProcessNodes = new EsEnums({
|
||||
sponsorLeaderApproval: { text: '发起人主管级领导审批', value: 'Activity_1fr1x5i', btn: ['return', 'save', 'agree', 'reject'] },
|
||||
standardLeaderApproval: { text: '标准化主管级领导审批', value: 'Activity_06jy4oo', btn: ['return', 'save', 'agree', 'reject'] },
|
||||
standardSuperiorLeaderApproval: { text: '标准化主管级上一级领导审批', value: 'Activity_1u5337a', btn: ['return', 'save', 'agree', 'reject'] },
|
||||
regulatoryEngineerConfirmation: { text: '法规工程师确认', value: 'Activity_1q01zfq', btn: ['return', 'save', 'agree', 'reject'] }
|
||||
regulatoryEngineerConfirmation: { text: '法规工程师确认', value: 'Activity_1q01zfq', btn: ['carbonCopy', 'submit'] }
|
||||
})
|
||||
@@ -39,7 +39,7 @@
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
v-decorator="['processDueDate']"
|
||||
:disabled="disabled"
|
||||
:disabled="processInfoDisabled"
|
||||
style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -50,7 +50,7 @@
|
||||
@change="event => event.target.value = event.target.value.trim()"
|
||||
:maxLength="500"
|
||||
type="textarea"
|
||||
:disabled="disabled"
|
||||
:disabled="processInfoDisabled"
|
||||
v-decorator="['processDescription']" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
@@ -72,9 +72,13 @@
|
||||
:dataSource="dataSource"
|
||||
:pagination="false"
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||
:loading="loading"
|
||||
:operation-list="operationList"
|
||||
@operationClick="operationClick">
|
||||
:loading="loading">
|
||||
|
||||
<template v-slot:action="{text, record, index}">
|
||||
<a @click="handleEdit(record, index)">{{ $t('edit') }}</a>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="handleDelete(index)">{{ $t('delete') }}</a>
|
||||
</template>
|
||||
|
||||
</j-table>
|
||||
</div>
|
||||
@@ -112,6 +116,10 @@
|
||||
<a-button type="primary" :loading="loading" ghost icon="arrow-up" v-if="btnList.includes('return')" @click="handleTurnTo">
|
||||
{{ $t('turnTo') }}
|
||||
</a-button>
|
||||
<!--抄送-->
|
||||
<a-button type="primary" :loading="loading" ghost icon="arrow-up" v-if="btnList.includes('return')" @click="handleCarbonCopy">
|
||||
{{ $t('turnTo') }}
|
||||
</a-button>
|
||||
<!--保存 发起节点、审批节点都存在-->
|
||||
<a-button type="primary" :loading="loading" ghost v-if="btnList.includes('save')" @click="handleSave">
|
||||
<i class="iconfont icon-save" />{{ $t('preservation') }}
|
||||
@@ -131,7 +139,9 @@
|
||||
</div>
|
||||
|
||||
<!--表格新增、编辑表单-->
|
||||
<table-form-modal ref="modalForm" />
|
||||
<table-form-modal ref="modalForm" @ok="modalFormOk" />
|
||||
<!--转办选人-->
|
||||
<user-select-modal ref="userSelectModal" check-required :type="isTransfer ? 'radio' : 'checkbox'" @change="handleSelectedUser" />
|
||||
</internal-detail-page>
|
||||
</template>
|
||||
|
||||
@@ -143,21 +153,26 @@ import ProcessDetailList from '../../../components/ProcessDetailList'
|
||||
import { ProcessKey, ProcurementProcessNodes } from '../../../enums/commonEnums'
|
||||
import JTable from '../../../components/jero/JTable'
|
||||
import TableFormModal from './modules/TableFormModal'
|
||||
import {
|
||||
queryProcurementProcessInfo,
|
||||
saveProcurementProcess,
|
||||
initProcurementProcess,
|
||||
agreeProcurementProcess,
|
||||
rejectProcurementProcess,
|
||||
transferProcurementProcess,
|
||||
carbonCopyProcurementProcess
|
||||
} from '../../../api/workCenter'
|
||||
import UserSelection from '../../../components/selection/UserSelection'
|
||||
import UserSelectModal from '../../../components/selection/UserSelectModal'
|
||||
|
||||
export default {
|
||||
name: 'StandardProcurementProcess',
|
||||
components: { JTable, ProcessDetailList, PersonnelInfo, InternalDetailPage, TableFormModal },
|
||||
components: { UserSelectModal, UserSelection, JTable, ProcessDetailList, PersonnelInfo, InternalDetailPage, TableFormModal },
|
||||
mixins: [WorkCenterMixin],
|
||||
computed: {
|
||||
pageTitle () {
|
||||
return `${this.$t('flowCenter')}${this.$route.meta.title}`
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
loading: false,
|
||||
btnList: [],
|
||||
disabled: false,
|
||||
// 流程信息表单
|
||||
processInfoForm: this.$form.createForm(this),
|
||||
processInfo: {},
|
||||
@@ -211,19 +226,19 @@ export default {
|
||||
scopedSlots: { customRender: 'action' }
|
||||
}
|
||||
],
|
||||
operationList: [
|
||||
{ // 编辑
|
||||
text: this.$t('edit'),
|
||||
clickEvent: 'handleEdit'
|
||||
},
|
||||
{ // 删除
|
||||
text: this.$t('delete'),
|
||||
clickEvent: 'handleDelete'
|
||||
}
|
||||
],
|
||||
dataSource: [{ id: 1 }],
|
||||
dataSource: [],
|
||||
selectedRowKeys: [],
|
||||
currentNode: ''
|
||||
currentNode: '',
|
||||
isTransfer: true // 是否转办
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
pageTitle () {
|
||||
return `${this.$t('flowCenter')}${this.$route.meta.title}`
|
||||
},
|
||||
// 流程信息部分禁用
|
||||
processInfoDisabled () {
|
||||
return !(this.currentNode === ProcurementProcessNodes.initiate.value && !this.$route.query.processInstanceId)
|
||||
}
|
||||
},
|
||||
created () {
|
||||
@@ -233,28 +248,209 @@ export default {
|
||||
this.currentNode = ProcurementProcessNodes.initiate.value
|
||||
}
|
||||
this.btnList = ProcurementProcessNodes.propertyOfValue('btn', this.currentNode)
|
||||
this.getPersonInfoStructure(ProcessKey.LEGAL_PROCUREMENT.value)
|
||||
this.getPersonInfoStructure(ProcessKey.LEGAL_PROCUREMENT.value, () => {
|
||||
this.initPersonInfoData(this.currentNode === ProcurementProcessNodes.initiate.value)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
onSelectChange (selectedRowKeys) {
|
||||
this.selectedRowKeys = selectedRowKeys
|
||||
},
|
||||
/**
|
||||
* 循环操作按钮的操作
|
||||
* @param operation
|
||||
* @param record
|
||||
*/
|
||||
operationClick (operation, record) {
|
||||
this[operation.clickEvent](record)
|
||||
},
|
||||
handleAdd () {
|
||||
this.$refs.modalForm.add()
|
||||
},
|
||||
batchDel () {
|
||||
|
||||
if (!this.selectedRowKeys || this.selectedRowKeys.length === 0) {
|
||||
this.$message.warning(this.$t('selectARecord'))
|
||||
return
|
||||
}
|
||||
const data = JSON.parse(JSON.stringify(this.dataSource))
|
||||
this.dataSource = data.map((tt, index) => {
|
||||
return this.selectedRowKeys.includes(index) ? null : tt
|
||||
}).filter(tt => !!tt)
|
||||
this.selectedRowKeys = []
|
||||
},
|
||||
handleEdit (record) {
|
||||
this.$refs.modalForm.edit(record)
|
||||
handleEdit (record, index) {
|
||||
this.$refs.modalForm.edit(record, index)
|
||||
},
|
||||
handleDelete (index) {
|
||||
this.$confirm({
|
||||
title: this.$t('confirmDeletion'),
|
||||
content: this.$t('areYouSure'),
|
||||
ok: () => {
|
||||
this.dataSource.splice(index, 1)
|
||||
}
|
||||
})
|
||||
},
|
||||
modalFormOk (record, index) {
|
||||
if (index || index === 0) {
|
||||
this.$set(this.dataSource, index, record)
|
||||
} else {
|
||||
this.dataSource.push(record)
|
||||
}
|
||||
},
|
||||
dealFormData (isSave) {
|
||||
let flag = true, formData = {}, processInfo = {}, approvalInfo = {}, businessInfo = [], userInfoMap = {}
|
||||
if (isSave) {
|
||||
processInfo = Object.assign(this.processInfo, this.processInfoForm.getFieldsValue())
|
||||
businessInfo = this.dataSource
|
||||
approvalInfo = Object.assign(this.approvalInfo, this.approvalInfoForm.getFieldsValue())
|
||||
userInfoMap = this.$refs.personnelInfo.getDataObj()
|
||||
const params = { ...processInfo, ...businessInfo, ...approvalInfo, ...userInfoMap }
|
||||
if (!Object.values(params).some(tt => !!tt || (tt && tt.length > 0))) {
|
||||
// 提示至少填写一项
|
||||
this.$message.warning(this.$t('pleaseFillInAtLeastOneItem'))
|
||||
flag = false
|
||||
}
|
||||
} else {
|
||||
// 流程信息
|
||||
this.processInfoForm.validateFields((errors, values) => {
|
||||
if (!errors) {
|
||||
processInfo = Object.assign(this.processInfo, values)
|
||||
} else {
|
||||
flag = false
|
||||
}
|
||||
})
|
||||
// 业务信息
|
||||
if (!this.dataSource || this.dataSource.length === 0) {
|
||||
this.$message.warning(this.$t('workCenter.standardProcurementProcess.addAtLeastOne'))
|
||||
flag = false
|
||||
}
|
||||
businessInfo = this.dataSource
|
||||
// 审批信息
|
||||
this.approvalInfoForm.validateFields((errors, values) => {
|
||||
if (!errors) {
|
||||
approvalInfo = Object.assign(this.approvalInfo, values)
|
||||
} else {
|
||||
flag = false
|
||||
}
|
||||
})
|
||||
// 人员信息
|
||||
const userInfo = this.$refs.personnelInfo.getDataObjVerify()
|
||||
userInfoMap = userInfo ? userInfo : flag = false
|
||||
}
|
||||
formData = {
|
||||
basicProcessInfoDTO: processInfo,
|
||||
basicTaskInfoDTO: approvalInfo,
|
||||
businessInfoDTO: businessInfo,
|
||||
userInfoMap
|
||||
}
|
||||
return !flag ? flag : formData
|
||||
},
|
||||
/**
|
||||
* 转办
|
||||
*/
|
||||
handleTurnTo () {
|
||||
this.isTransfer = true
|
||||
this.$refs.userSelectModal.open()
|
||||
},
|
||||
/**
|
||||
* 抄送
|
||||
*/
|
||||
handleCarbonCopy () {
|
||||
this.isTransfer = false
|
||||
this.$refs.userSelectModal.open()
|
||||
},
|
||||
handleSelectedUser (userId) {
|
||||
const params = {
|
||||
taskId: this.$route.query.taskId,
|
||||
userId
|
||||
}
|
||||
const func = this.isTransfer ? transferProcurementProcess : carbonCopyProcurementProcess
|
||||
this.loading = true
|
||||
func(params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.goBack()
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
handleSave () {
|
||||
const formData = this.dealFormData(true)
|
||||
this.loading = true
|
||||
saveProcurementProcess(formData).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.goBack()
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 提交
|
||||
*/
|
||||
handleSubmit () {
|
||||
const formData = this.dealFormData()
|
||||
if (!formData) {
|
||||
return
|
||||
}
|
||||
let submitFunc
|
||||
if (this.currentNode === ProcurementProcessNodes.initiate.value && !this.$route.query.processInstanceId) {
|
||||
submitFunc = initProcurementProcess
|
||||
} else {
|
||||
submitFunc = agreeProcurementProcess
|
||||
}
|
||||
this.loading = true
|
||||
submitFunc(formData).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.goBack()
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 同意
|
||||
*/
|
||||
handleAgree () {
|
||||
const formData = this.dealFormData()
|
||||
if (!formData) {
|
||||
return
|
||||
}
|
||||
this.loading = true
|
||||
agreeProcurementProcess(formData).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.goBack()
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 驳回
|
||||
*/
|
||||
handleReject () {
|
||||
const formData = this.dealFormData()
|
||||
if (!formData) {
|
||||
return
|
||||
}
|
||||
this.loading = true
|
||||
rejectProcurementProcess(formData).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.goBack()
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,13 +9,41 @@
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<!--标准编号-->
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('standardNumber')">
|
||||
<standard-selection :placeholder="$t('pleaseSelect') + $t('standardNumber')"
|
||||
v-decorator="['standardNumber', validatorRules.standardNumber]"
|
||||
type="radio"
|
||||
@nameChange="handleStandardChange" />
|
||||
</a-form-item>
|
||||
<!--标准名称-->
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('standardName')">
|
||||
<a-input v-decorator="['standardName', validatorRules.standardName]"
|
||||
:maxLength="50"
|
||||
disabled
|
||||
:placeholder="$t('pleaseEnter') + $t('standardName')"
|
||||
@change="e => {e.target.value = (e.target.value + '').trim()}" />
|
||||
</a-form-item>
|
||||
<!--采购理由-->
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('workCenter.standardProcurementProcess.reasonForPurchase')">
|
||||
<a-input v-decorator="['purchaseReason', validatorRules.purchaseReason]"
|
||||
:maxLength="500"
|
||||
type="textarea"
|
||||
:placeholder="$t('pleaseEnter') + $t('workCenter.standardProcurementProcess.reasonForPurchase')"
|
||||
@change="e => {e.target.value = (e.target.value + '').trim()}" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import StandardSelection from '../../../../components/selection/StandardSelection'
|
||||
|
||||
export default {
|
||||
name: 'TableFormModal',
|
||||
components: { StandardSelection },
|
||||
data () {
|
||||
return {
|
||||
title: this.$t('operation'),
|
||||
@@ -31,28 +59,61 @@ export default {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 }
|
||||
},
|
||||
model: {}
|
||||
model: {},
|
||||
validatorRules: {
|
||||
// 标准编号
|
||||
standardNumber: {
|
||||
rules: [{ required: true, message: this.$t('pleaseSelect') + this.$t('standardNumber') }],
|
||||
validateTrigger: 'change'
|
||||
},
|
||||
// 标准名称
|
||||
standardName: {
|
||||
rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('standardName') }],
|
||||
validateTrigger: 'blur'
|
||||
},
|
||||
// 采购理由
|
||||
purchaseReason: {
|
||||
rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('workCenter.standardProcurementProcess.reasonForPurchase') }],
|
||||
validateTrigger: 'blur'
|
||||
}
|
||||
},
|
||||
dataIndex: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
add () {
|
||||
this.title = this.$t('newlyAdded')
|
||||
this.dataIndex = null
|
||||
this.visible = true
|
||||
},
|
||||
edit (record) {
|
||||
edit (record, index) {
|
||||
this.title = this.$t('edit')
|
||||
this.dataIndex = index
|
||||
this.visible = true
|
||||
this.model = Object.assign({}, record)
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(this.model)
|
||||
})
|
||||
},
|
||||
handleOk() {
|
||||
|
||||
handleOk () {
|
||||
this.form.validateFields((errors, values) => {
|
||||
if (!errors) {
|
||||
const formData = Object.assign(this.model, values)
|
||||
this.$emit('ok', formData, this.dataIndex)
|
||||
this.close()
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel() {
|
||||
handleCancel () {
|
||||
this.close()
|
||||
},
|
||||
close() {
|
||||
close () {
|
||||
this.visible = false
|
||||
this.form.resetFields()
|
||||
this.model = {}
|
||||
},
|
||||
handleStandardChange (name) {
|
||||
this.form.setFieldsValue({ standardName: name })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user