[update] 市场清单发布流程
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
<a-input :placeholder="$t('pleaseEnter') + $t('processName')"
|
||||
disabled
|
||||
:maxLength="50"
|
||||
v-decorator="['prcName', validatorRules.prcName]" />
|
||||
v-decorator="['processName', validatorRules.processName]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
@@ -41,7 +41,7 @@
|
||||
style="width: 100%"
|
||||
:disabled="disabled"
|
||||
value-format="YYYY-MM-DD"
|
||||
v-decorator="['dueTime']" />
|
||||
v-decorator="['processDueDate']" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
@@ -55,7 +55,7 @@
|
||||
:maxLength="500"
|
||||
:rows="4"
|
||||
:disabled="disabled"
|
||||
v-decorator="['prcMes']" />
|
||||
v-decorator="['processDescription']" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<template v-if="currentNode !== 1">
|
||||
@@ -107,11 +107,11 @@
|
||||
<a-textarea :placeholder="$t('pleaseEnter') + $t('remarks')"
|
||||
:maxLength="500"
|
||||
:rows="4"
|
||||
v-decorator="['commitText', validatorRules.commitText]" />
|
||||
v-decorator="['handleText', validatorRules.handleText]" />
|
||||
</a-form-item>
|
||||
<!--附件-->
|
||||
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('attach')" :colon="formItemColon">
|
||||
<j-upload v-decorator="['commitFile']" return-id multiple />
|
||||
<j-upload v-decorator="['handleFile']" return-id multiple />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</div>
|
||||
@@ -285,13 +285,13 @@ export default {
|
||||
},
|
||||
validatorRules: {
|
||||
// 流程名称
|
||||
prcName: {
|
||||
processName: {
|
||||
rules: [
|
||||
{ required: true, message: this.$t('pleaseEnter') + this.$t('processName') }
|
||||
],
|
||||
validateTrigger: 'blur'
|
||||
},
|
||||
commitText: {
|
||||
handleText: {
|
||||
rules: [
|
||||
{ required: false, message: this.$t('pleaseEnter') + this.$t('remarks') }
|
||||
],
|
||||
@@ -322,19 +322,19 @@ export default {
|
||||
this.$nextTick(() => {
|
||||
if (type === 'todo') {
|
||||
// 初始化流程信息
|
||||
this.processInfoForm.setFieldsValue(pick(this.model.common, 'prcName', 'dueTime', 'prcMes'))
|
||||
this.processInfoForm.setFieldsValue(pick(this.model.common, 'processName', 'processDueDate', 'processDescription'))
|
||||
}
|
||||
// 有草稿json按草稿进来的回显
|
||||
if (this.model.infoJsonStr) {
|
||||
// 初始化流程信息
|
||||
const prcObj = Object.assign({}, this.model)
|
||||
prcObj.dueTime = this.model.processDueDate
|
||||
prcObj.prcMes = this.model.processDescription
|
||||
this.processInfoForm.setFieldsValue(pick(prcObj, 'prcName', 'dueTime', 'prcMes'))
|
||||
prcObj.processDueDate = this.model.processDueDate
|
||||
prcObj.processDescription = this.model.processDescription
|
||||
this.processInfoForm.setFieldsValue(pick(prcObj, 'processName', 'processDueDate', 'processDescription'))
|
||||
// 初始化流程审批信息
|
||||
prcObj.commitText = this.model.handleText
|
||||
prcObj.commitFile = this.model.handleFile
|
||||
this.approvalInfoForm.setFieldsValue(pick(prcObj, 'commitText', 'commitFile'))
|
||||
prcObj.handleText = this.model.handleText
|
||||
prcObj.handleFile = this.model.handleFile
|
||||
this.approvalInfoForm.setFieldsValue(pick(prcObj, 'handleText', 'handleFile'))
|
||||
this.model.data = JSON.parse(this.model.infoJsonStr).data
|
||||
// 如果是节点1的保存回显人员信息
|
||||
if (this.currentNode === 1) {
|
||||
@@ -359,9 +359,9 @@ export default {
|
||||
},
|
||||
// 业务基本信息组件中获取到流程名称改变后的值
|
||||
processNameChange (value) {
|
||||
const param = { prcName: value }
|
||||
const param = { processName: value }
|
||||
this.$nextTick(() => {
|
||||
this.processInfoForm.setFieldsValue(pick(param, 'prcName'))
|
||||
this.processInfoForm.setFieldsValue(pick(param, 'processName'))
|
||||
})
|
||||
},
|
||||
// 保存
|
||||
@@ -389,14 +389,9 @@ export default {
|
||||
const paramObj = {}
|
||||
// 流程信息
|
||||
paramObj.basicProcessInfoDTO = Object.assign({}, processInfoForm)
|
||||
paramObj.basicProcessInfoDTO.processName = paramObj.basicProcessInfoDTO.prcName
|
||||
paramObj.basicProcessInfoDTO.processDueDate = paramObj.basicProcessInfoDTO.dueTime
|
||||
paramObj.basicProcessInfoDTO.processDescription = paramObj.basicProcessInfoDTO.prcMes
|
||||
paramObj.basicProcessInfoDTO.processInstanceId = this.$route.query.processInstanceId
|
||||
// 流程审批信息
|
||||
paramObj.basicTaskInfoDTO = Object.assign({}, approvalInfoForm)
|
||||
paramObj.basicTaskInfoDTO.handleText = paramObj.basicTaskInfoDTO.commitText
|
||||
paramObj.basicTaskInfoDTO.handleFile = paramObj.basicTaskInfoDTO.commitFile
|
||||
paramObj.basicTaskInfoDTO.taskId = this.$route.query.taskId
|
||||
// 草稿id
|
||||
if (this.model.infoJsonStr) {
|
||||
@@ -428,50 +423,58 @@ export default {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
// if (this.loading) return
|
||||
// // 流程信息的校验
|
||||
// this.processInfoForm.validateFields((err, values) => {
|
||||
// // 流程审批信息的校验
|
||||
// this.approvalInfoForm.validateFields(async (approvalErr, approvalValues) => {
|
||||
// const data = await this.$refs.baseInfoRef.getDataValidate()
|
||||
// if (!err && !approvalErr && data) {
|
||||
// // 人员信息的数据, 处理成对象
|
||||
// const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
|
||||
// if (!personnelObj) {
|
||||
// this.switchValue = 'user'
|
||||
// return
|
||||
// }
|
||||
// this.loading = true
|
||||
// const paramObj = {} // 需要传给后端的数据
|
||||
// paramObj.common = { ...values, ...approvalValues }
|
||||
// // 草稿id
|
||||
// if (this.model.infoJsonStr) {
|
||||
// paramObj.common.draftId = this.model.id
|
||||
// }
|
||||
// paramObj.flowUser = personnelObj
|
||||
// paramObj.data = data.formInline
|
||||
// let func
|
||||
// if (this.$route.query.taskId) {
|
||||
// // 有taskId说明是驳回的提交
|
||||
// func = marketListReleaseAgree
|
||||
// paramObj.common.taskId = this.$route.query.taskId
|
||||
// } else {
|
||||
// func = marketListReleaseApproval
|
||||
// }
|
||||
// func(paramObj).then(res => {
|
||||
// if (res.success) {
|
||||
// this.$message.success(res.message)
|
||||
// this.goBack()
|
||||
// } else {
|
||||
// this.$message.warning(res.message)
|
||||
// this.loading = false
|
||||
// }
|
||||
// })
|
||||
// } else {
|
||||
// this.switchValue = 'base'
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
if (this.loading) return
|
||||
// 流程信息的校验
|
||||
this.processInfoForm.validateFields((err, values) => {
|
||||
// 流程审批信息的校验
|
||||
this.approvalInfoForm.validateFields(async (approvalErr, approvalValues) => {
|
||||
// 获取业务信息businessInfoDTO
|
||||
const data = await this.$refs.baseInfoRef.getDataValidate()
|
||||
if (!err && !approvalErr && data) {
|
||||
// 人员信息的数据, 处理成对象
|
||||
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
|
||||
if (!personnelObj) {
|
||||
this.switchValue = 'user'
|
||||
return
|
||||
}
|
||||
this.loading = true
|
||||
const paramObj = {} // 需要传给后端的数据
|
||||
// 流程信息
|
||||
paramObj.basicProcessInfoDTO = values
|
||||
// 流程审批信息
|
||||
paramObj.basicTaskInfoDTO = approvalValues
|
||||
// 草稿id
|
||||
if (this.model.infoJsonStr) {
|
||||
paramObj.draftId = this.model.id
|
||||
}
|
||||
// 人员信息
|
||||
paramObj.userInfoMap = personnelObj
|
||||
// 业务信息
|
||||
paramObj.businessInfoDTO = data
|
||||
// JSON字符串
|
||||
paramObj.infoJsonStr = JSON.stringify(paramObj)
|
||||
let func
|
||||
if (this.$route.query.taskId) {
|
||||
// 有taskId说明是驳回的提交
|
||||
func = marketListReleaseAgree
|
||||
paramObj.common.taskId = this.$route.query.taskId
|
||||
} else {
|
||||
func = marketListReleaseApproval
|
||||
}
|
||||
func(paramObj).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.goBack()
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.switchValue = 'base'
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 转办
|
||||
handleTurnTo () {
|
||||
@@ -502,9 +505,9 @@ export default {
|
||||
// 同意
|
||||
handleAgree () {
|
||||
if (this.loading) return
|
||||
this.validatorRules.commitText.rules[0].required = false
|
||||
if (!this.approvalInfoForm.getFieldValue('commitText')) {
|
||||
this.approvalInfoForm.setFieldsValue({ commitText: '同意' })
|
||||
this.validatorRules.handleText.rules[0].required = false
|
||||
if (!this.approvalInfoForm.getFieldValue('handleText')) {
|
||||
this.approvalInfoForm.setFieldsValue({ handleText: '同意' })
|
||||
}
|
||||
this.approvalInfoForm.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
@@ -527,8 +530,8 @@ export default {
|
||||
// 驳回
|
||||
handleReject () {
|
||||
if (this.loading) return
|
||||
this.validatorRules.commitText.rules[0].required = true
|
||||
if (!this.approvalInfoForm.getFieldValue('commitText')) {
|
||||
this.validatorRules.handleText.rules[0].required = true
|
||||
if (!this.approvalInfoForm.getFieldValue('handleText')) {
|
||||
this.$message.warning(this.$t('pleaseEnterRemarks'))
|
||||
this.switchValue = 'base'
|
||||
}
|
||||
@@ -548,7 +551,7 @@ export default {
|
||||
this.loading = false
|
||||
}
|
||||
}).finally(() => {
|
||||
this.validatorRules.commitText.rules[0].required = false
|
||||
this.validatorRules.handleText.rules[0].required = false
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user