[update] 市场清单发布流程
This commit is contained in:
@@ -73,7 +73,8 @@ module.exports = {
|
||||
historicalVersion: 'Historical version',
|
||||
standardExist: 'The standard already exists',
|
||||
haveStandardExist: 'Some standards already exist',
|
||||
pleaseSelectAListPublish: 'Please select a list to publish'
|
||||
pleaseSelectAListPublish: 'Please select a list to publish',
|
||||
pleaseSelectCorrectData: 'Select an unpublished or modified list to publish'
|
||||
},
|
||||
// 市场清单详情列表字段
|
||||
marketListField: {
|
||||
|
||||
@@ -74,7 +74,8 @@ module.exports = {
|
||||
historicalVersion: '历史版本',
|
||||
standardExist: '标准已经存在',
|
||||
haveStandardExist: '部分标准已存在',
|
||||
pleaseSelectAListPublish: '请选择一个清单进行发布'
|
||||
pleaseSelectAListPublish: '请选择一个清单进行发布',
|
||||
pleaseSelectCorrectData: '请选择未发布或者修改中的清单进行发布'
|
||||
},
|
||||
// 市场清单详情列表字段
|
||||
marketListField: {
|
||||
|
||||
@@ -289,6 +289,11 @@ export default {
|
||||
this.$message.warning(this.$t('standardRegulationLibrary.marketRegulationsList.pleaseSelectAListPublish'))
|
||||
return
|
||||
}
|
||||
if (this.selectionRows[0].manifestStatus === ListState.RELEASED.value) {
|
||||
// 提示请选择未发布或修改中的数据
|
||||
this.$message.warning(this.$t('standardRegulationLibrary.marketRegulationsList.pleaseSelectCorrectData'))
|
||||
return
|
||||
}
|
||||
// 跳转市场清单发布流程
|
||||
this.$router.push({
|
||||
path: '/workCenter/MarketListReleaseProcess',
|
||||
|
||||
@@ -80,10 +80,14 @@
|
||||
<!-- 国家/地区 -->
|
||||
<a-col :span="24">
|
||||
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('countryRegion')" :colon="formItemColon">
|
||||
<a-input :placeholder="$t('pleaseEnter') + $t('countryRegion')"
|
||||
disabled
|
||||
:maxLength="50"
|
||||
v-decorator="['country', validatorRules.country]" />
|
||||
<s-tree-select v-decorator="['country', validatorRules.country]"
|
||||
:getPopupContainer="triggerNode=> triggerNode.parentNode"
|
||||
style="width: 100%"
|
||||
:tree-data="countryOptions"
|
||||
tree-checkable
|
||||
treeCheckStrictly
|
||||
disabled
|
||||
:placeholder="isGetDataAfter ? '' : $t('pleaseSelect')+$t('countryRegion')" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
@@ -93,7 +97,7 @@
|
||||
<!-- 业务基本信息 -->
|
||||
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
|
||||
<!-- 节点1、法规工程师发起 -->
|
||||
<base-info-form v-if="currentNode === 1" ref="baseInfoRef" :current-node="currentNode" @processNameChange="processNameChange"></base-info-form>
|
||||
<base-info-form v-if="currentNode === 1" ref="baseInfoRef" :current-node="currentNode" @processNameChange="processNameChange" :countryOptions="countryOptions"></base-info-form>
|
||||
<!-- 节点2、会签 -->
|
||||
<!-- 节点3、高级经理审核 -->
|
||||
<!-- 节点4、总监批准 -->
|
||||
@@ -166,6 +170,8 @@ import {
|
||||
import pick from 'lodash.pick'
|
||||
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
|
||||
import { marketRegulationDetailPublish } from '../../../api/standardRegulationLibraryApi'
|
||||
import { getDataDraft, processTransfer } from '../../../api/workCenter'
|
||||
import { getFormDictTreeList } from '../../../api/api'
|
||||
|
||||
export default {
|
||||
name: 'MarketListReleaseProcess',
|
||||
@@ -183,6 +189,8 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
// 获取国家/地区下拉数据
|
||||
this.getCountryOption()
|
||||
// 初始化节点
|
||||
const nodeId = this.$route.query.nodeId
|
||||
if (nodeId) {
|
||||
@@ -300,10 +308,19 @@ export default {
|
||||
},
|
||||
formInline: {},
|
||||
approvalInfoForm: this.$form.createForm(this), // 审批信息表单
|
||||
personnelInfoData: []
|
||||
personnelInfoData: [],
|
||||
countryOptions: [] // 国家/地区下拉框
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 获取国家/地区下拉框数据
|
||||
getCountryOption () {
|
||||
getFormDictTreeList({ dictId: '1801130851452059649' }).then(res => {
|
||||
if (res.success) {
|
||||
this.countryOptions = res.result
|
||||
}
|
||||
})
|
||||
},
|
||||
// 根据流程id获取数据并回显
|
||||
getProcessData (type, param) {
|
||||
this.loading = true
|
||||
@@ -313,7 +330,7 @@ export default {
|
||||
func = marketListReleaseGetDataById
|
||||
params = param.taskId
|
||||
} else {
|
||||
func = marketListReleaseGetDataDraft
|
||||
func = getDataDraft
|
||||
params = param
|
||||
}
|
||||
func(params).then(res => {
|
||||
@@ -322,27 +339,36 @@ export default {
|
||||
this.$nextTick(() => {
|
||||
if (type === 'todo') {
|
||||
// 初始化流程信息
|
||||
this.processInfoForm.setFieldsValue(pick(this.model.common, 'processName', 'processDueDate', 'processDescription'))
|
||||
const processInfo = Object.assign({}, this.model.basicProcessInfoDTO)
|
||||
// 清单编号
|
||||
processInfo.manifestNo = this.model.businessInfoDTO.manifestNo
|
||||
// 清单名称
|
||||
processInfo.manifestName = this.model.businessInfoDTO.manifestName
|
||||
// 国家/地区
|
||||
processInfo.country = this.model.businessInfoDTO.country
|
||||
this.processInfoForm.setFieldsValue(pick(processInfo, 'processName', 'processDueDate', 'processDescription', 'manifestNo', 'manifestName', 'country'))
|
||||
}
|
||||
// 有草稿json按草稿进来的回显
|
||||
if (this.model.infoJsonStr) {
|
||||
this.draftModel = JSON.parse(this.model.infoJsonStr)
|
||||
// 初始化流程信息
|
||||
const prcObj = Object.assign({}, this.model)
|
||||
prcObj.processDueDate = this.model.processDueDate
|
||||
prcObj.processDescription = this.model.processDescription
|
||||
this.processInfoForm.setFieldsValue(pick(prcObj, 'processName', 'processDueDate', 'processDescription'))
|
||||
const processInfo = Object.assign({}, this.draftModel.basicProcessInfoDTO)
|
||||
// 清单编号
|
||||
processInfo.manifestNo = this.draftModel.businessInfoDTO.manifestNo
|
||||
// 清单名称
|
||||
processInfo.manifestName = this.draftModel.businessInfoDTO.manifestName
|
||||
// 国家/地区
|
||||
processInfo.country = this.draftModel.businessInfoDTO.country
|
||||
this.processInfoForm.setFieldsValue(pick(processInfo, 'processName', 'processDueDate', 'processDescription', 'manifestNo', 'manifestName', 'country'))
|
||||
// 初始化流程审批信息
|
||||
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
|
||||
this.approvalInfoForm.setFieldsValue(pick(this.draftModel.basicTaskInfoDTO, 'handleText', 'handleFile'))
|
||||
// 如果是节点1的保存回显人员信息
|
||||
if (this.currentNode === 1) {
|
||||
this.draftInitPersonInfo(JSON.parse(this.model.infoJsonStr).personnelObj)
|
||||
this.draftInitPersonInfo(this.draftModel.userInfoMap)
|
||||
}
|
||||
}
|
||||
if (this.$refs.baseInfoRef) {
|
||||
this.$refs.baseInfoRef.initData(this.model.data)
|
||||
this.$refs.baseInfoRef.initData(this.draftModel.businessInfoDTO || this.model.businessInfoDTO)
|
||||
}
|
||||
})
|
||||
// 初始化业务基本信息中组件内容
|
||||
@@ -378,6 +404,7 @@ export default {
|
||||
const personnelObj = this.$refs.personnelInfo.getDataObj()
|
||||
// 业务基本信息
|
||||
const baseInfo = this.$refs.baseInfoRef.getData()
|
||||
// 判断是否每一项都没填
|
||||
const param = { ...processInfoForm, ...baseInfo.formInline, ...approvalInfoForm, ...personnelObj }
|
||||
const flag = Object.values(param).some(v => !!v || v === 0)
|
||||
if (!flag) {
|
||||
@@ -393,15 +420,16 @@ export default {
|
||||
// 流程审批信息
|
||||
paramObj.basicTaskInfoDTO = Object.assign({}, approvalInfoForm)
|
||||
paramObj.basicTaskInfoDTO.taskId = this.$route.query.taskId
|
||||
// 业务信息
|
||||
paramObj.businessInfoDTO = baseInfo
|
||||
// 人员信息
|
||||
paramObj.userInfoMap = personnelObj
|
||||
// 草稿id
|
||||
if (this.model.infoJsonStr) {
|
||||
paramObj.draftId = this.model.id
|
||||
}
|
||||
// 业务基本信息和人员信息
|
||||
paramObj.infoJsonStr = JSON.stringify({
|
||||
data: baseInfo.formInline,
|
||||
personnelObj: personnelObj
|
||||
})
|
||||
// 草稿JSON
|
||||
paramObj.infoJsonStr = JSON.stringify(paramObj)
|
||||
this.loading = true
|
||||
// 保存到草稿
|
||||
marketListReleaseSave(paramObj).then(res => {
|
||||
@@ -416,13 +444,13 @@ export default {
|
||||
},
|
||||
// 节点一时候的提交
|
||||
handleStart () {
|
||||
marketRegulationDetailPublish({id: this.$route.query.marketRegulationId}).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
// marketRegulationDetailPublish({id: this.$route.query.marketRegulationId}).then(res => {
|
||||
// if (res.success) {
|
||||
// this.$message.success(res.message)
|
||||
// } else {
|
||||
// this.$message.warning(res.message)
|
||||
// }
|
||||
// })
|
||||
if (this.loading) return
|
||||
// 流程信息的校验
|
||||
this.processInfoForm.validateFields((err, values) => {
|
||||
@@ -457,7 +485,7 @@ export default {
|
||||
if (this.$route.query.taskId) {
|
||||
// 有taskId说明是驳回的提交
|
||||
func = marketListReleaseAgree
|
||||
paramObj.common.taskId = this.$route.query.taskId
|
||||
paramObj.basicTaskInfoDTO.taskId = this.$route.query.taskId
|
||||
} else {
|
||||
func = marketListReleaseApproval
|
||||
}
|
||||
@@ -490,7 +518,7 @@ export default {
|
||||
const param = Object.assign({}, values)
|
||||
param.userId = userIds
|
||||
param.taskId = this.$route.query.taskId
|
||||
marketListReleaseTurnTo(param).then(res => {
|
||||
processTransfer(param).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.goBack()
|
||||
@@ -513,8 +541,8 @@ export default {
|
||||
if (!err) {
|
||||
this.loading = true
|
||||
const param = {}
|
||||
param.common = Object.assign({}, values)
|
||||
param.common.taskId = this.$route.query.taskId
|
||||
param.basicTaskInfoDTO = Object.assign({}, values)
|
||||
param.basicTaskInfoDTO.taskId = this.$route.query.taskId
|
||||
marketListReleaseAgree(param).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
@@ -540,8 +568,8 @@ export default {
|
||||
if (!err) {
|
||||
this.loading = true
|
||||
const param = {}
|
||||
param.common = Object.assign({}, values)
|
||||
param.common.taskId = this.$route.query.taskId
|
||||
param.basicTaskInfoDTO = Object.assign({}, values)
|
||||
param.basicTaskInfoDTO.taskId = this.$route.query.taskId
|
||||
marketListReleaseReject(param).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
{{ $t('listNumber') }}
|
||||
</span>
|
||||
</div>
|
||||
<a-form-model-item class="item-model" prop="listId">
|
||||
<a-form-model-item class="item-model" prop="manifestId">
|
||||
<market-regulations-list-selection type="radio"
|
||||
selectOnly
|
||||
:name-str="formInline.manifestNo"
|
||||
:placeholder="$t('pleaseSelect') + $t('listNumber')"
|
||||
v-model="formInline.listId" />
|
||||
v-model="formInline.manifestId" />
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
<!-- 清单名称 -->
|
||||
@@ -106,12 +106,10 @@
|
||||
import MarketRegulationsListSelection from '@/components/selection/MarketRegulationsListSelection'
|
||||
import UserSelection from '@/components/selection/UserSelection'
|
||||
import JTable from '@/components/jero/JTable'
|
||||
import { StandardSource } from '../../../../enums/commonEnums'
|
||||
import {
|
||||
getMarketRegulationListById,
|
||||
marketRegulationDetailListById
|
||||
} from '@/api/standardRegulationLibraryApi'
|
||||
import { getFormDictTreeList } from '../../../../api/api'
|
||||
import STreeSelect from '@/components/STreeSelect'
|
||||
|
||||
export default {
|
||||
@@ -127,6 +125,13 @@ export default {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 1
|
||||
},
|
||||
countryOptions: {
|
||||
type: Array,
|
||||
required: false,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
data () {
|
||||
@@ -136,7 +141,7 @@ export default {
|
||||
userFormInline: {},
|
||||
rules: {
|
||||
// 清单编号
|
||||
listId: [
|
||||
manifestId: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('listNumber') + this.$t('cannotEmpty'),
|
||||
@@ -297,22 +302,10 @@ export default {
|
||||
showSizeChanger: true,
|
||||
total: 0
|
||||
},
|
||||
countryOptions: [], // 国家/地区下拉框
|
||||
isGetDataAfter: false // 是否获取完数据了,获取完数据有的字段不显示placeholder
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.getCountryOption()
|
||||
},
|
||||
methods: {
|
||||
// 获取国家/地区下拉框数据
|
||||
getCountryOption () {
|
||||
getFormDictTreeList({ dictId: '1801130851452059649' }).then(res => {
|
||||
if (res.success) {
|
||||
this.countryOptions = res.result
|
||||
}
|
||||
})
|
||||
},
|
||||
// 从市场法规清单
|
||||
setFormById (marketRegulationId) {
|
||||
this.loading = true
|
||||
@@ -324,7 +317,7 @@ export default {
|
||||
const result = Object.assign({}, res.result.manifest)
|
||||
const formInline = {}
|
||||
// 清单编号id
|
||||
formInline.listId = result.id
|
||||
formInline.manifestId = result.id
|
||||
// 清单编号
|
||||
formInline.manifestNo = result.manifestNo
|
||||
// 清单名称
|
||||
@@ -344,12 +337,20 @@ export default {
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
this.$emit('processNameChange', (this.formInline.manifestName || '') + '-' + (this.formInline.manifestVersion || '') + '-' + '发布')
|
||||
let manifestVersion = ''
|
||||
if (this.formInline.manifestVersion) {
|
||||
console.log('this.formInline.manifestVersion', this.formInline.manifestVersion)
|
||||
manifestVersion = this.getStringBetween(this.formInline.manifestVersion, 'V', '.')
|
||||
console.log('-----manifestVersion1', manifestVersion)
|
||||
manifestVersion = 'V' + (Number(manifestVersion) + 1) + '.0'
|
||||
console.log('-----manifestVersion2', manifestVersion)
|
||||
}
|
||||
this.$emit('processNameChange', (this.formInline.manifestName || '') + '-' + (manifestVersion || 'V1.0') + '-' + '发布')
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
|
||||
// 拿到外面传进来的businessInfoDTO
|
||||
initData (data) {
|
||||
// 给表单赋值
|
||||
this.formInline = Object.assign({}, data)
|
||||
@@ -403,7 +404,7 @@ export default {
|
||||
const result = Object.assign({}, res.result.manifest)
|
||||
const formInline = {}
|
||||
// 清单编号id
|
||||
formInline.listId = result.id
|
||||
formInline.manifestId = result.id
|
||||
// 清单编号
|
||||
formInline.manifestNo = result.manifestNo
|
||||
// 清单名称
|
||||
@@ -423,12 +424,24 @@ export default {
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
this.$emit('processNameChange', (this.formInline.manifestName || '') + '-' + (this.formInline.manifestVersion || '') + '-' + '发布')
|
||||
let manifestVersion = ''
|
||||
if (this.formInline.manifestVersion) {
|
||||
manifestVersion = this.getStringBetween(this.formInline.manifestVersion, 'V', '.')
|
||||
manifestVersion = 'V' + (Number(manifestVersion) + 1) + '.0'
|
||||
}
|
||||
this.$emit('processNameChange', (this.formInline.manifestName || '') + '-' + (manifestVersion || 'V1.0') + '-' + '发布')
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
// 截取某两个字符之间的字符串
|
||||
getStringBetween (text, start, end) {
|
||||
const startIndex = text.indexOf(start)
|
||||
const endIndex = text.indexOf(end)
|
||||
const str = text.slice(startIndex + 1, endIndex)
|
||||
return str || ''
|
||||
},
|
||||
handleTableChange (pagination, filters, sorter) {
|
||||
this.ipagination = pagination
|
||||
},
|
||||
|
||||
-1
@@ -295,7 +295,6 @@ export default {
|
||||
// 有草稿json按草稿进来的回显
|
||||
if (this.model.infoJsonStr) {
|
||||
this.draftModel = JSON.parse(this.model.infoJsonStr)
|
||||
console.log('=========draftModel', this.draftModel)
|
||||
// 初始化流程信息
|
||||
this.processInfoForm.setFieldsValue(pick(this.draftModel.basicProcessInfoDTO, 'processName', 'processDueDate', 'processDescription'))
|
||||
// 初始化流程审批信息
|
||||
|
||||
Reference in New Issue
Block a user