From 9ea44f5804ad962cb0f1de8f2286ecade02465d5 Mon Sep 17 00:00:00 2001
From: lideqin <694785430@qq.com>
Date: Thu, 11 Jul 2024 11:24:03 +0800
Subject: [PATCH] =?UTF-8?q?[update]=20=E5=B8=82=E5=9C=BA=E6=B8=85=E5=8D=95?=
=?UTF-8?q?=E5=8F=91=E5=B8=83=E6=B5=81=E7=A8=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../lang/standardRegulationLibrary/en-us.js | 3 +-
.../lang/standardRegulationLibrary/zh-cn.js | 3 +-
.../MarketRegulationsList.vue | 5 +
.../MarketListReleaseProcess.vue | 100 +++++++++++-------
.../modules/BaseInfoForm.vue | 57 ++++++----
.../NewRegulationIntroductionProcess.vue | 1 -
6 files changed, 108 insertions(+), 61 deletions(-)
diff --git a/src/common/lang/standardRegulationLibrary/en-us.js b/src/common/lang/standardRegulationLibrary/en-us.js
index 1d20409..75ae605 100644
--- a/src/common/lang/standardRegulationLibrary/en-us.js
+++ b/src/common/lang/standardRegulationLibrary/en-us.js
@@ -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: {
diff --git a/src/common/lang/standardRegulationLibrary/zh-cn.js b/src/common/lang/standardRegulationLibrary/zh-cn.js
index 1491a51..718e5f4 100644
--- a/src/common/lang/standardRegulationLibrary/zh-cn.js
+++ b/src/common/lang/standardRegulationLibrary/zh-cn.js
@@ -74,7 +74,8 @@ module.exports = {
historicalVersion: '历史版本',
standardExist: '标准已经存在',
haveStandardExist: '部分标准已存在',
- pleaseSelectAListPublish: '请选择一个清单进行发布'
+ pleaseSelectAListPublish: '请选择一个清单进行发布',
+ pleaseSelectCorrectData: '请选择未发布或者修改中的清单进行发布'
},
// 市场清单详情列表字段
marketListField: {
diff --git a/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsList.vue b/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsList.vue
index 265201e..33b3e1e 100644
--- a/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsList.vue
+++ b/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsList.vue
@@ -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',
diff --git a/src/views/workCenter/marketListReleaseProcess/MarketListReleaseProcess.vue b/src/views/workCenter/marketListReleaseProcess/MarketListReleaseProcess.vue
index 8a79620..5f379c9 100644
--- a/src/views/workCenter/marketListReleaseProcess/MarketListReleaseProcess.vue
+++ b/src/views/workCenter/marketListReleaseProcess/MarketListReleaseProcess.vue
@@ -80,10 +80,14 @@
-
+
@@ -93,7 +97,7 @@
{{ $t('basicServiceInformation') }}
-
+
@@ -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)
diff --git a/src/views/workCenter/marketListReleaseProcess/modules/BaseInfoForm.vue b/src/views/workCenter/marketListReleaseProcess/modules/BaseInfoForm.vue
index d401dbd..ed039dd 100644
--- a/src/views/workCenter/marketListReleaseProcess/modules/BaseInfoForm.vue
+++ b/src/views/workCenter/marketListReleaseProcess/modules/BaseInfoForm.vue
@@ -10,12 +10,12 @@
{{ $t('listNumber') }}
-
+
+ v-model="formInline.manifestId" />
@@ -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
},
diff --git a/src/views/workCenter/newRegulationIntroductionProcess/NewRegulationIntroductionProcess.vue b/src/views/workCenter/newRegulationIntroductionProcess/NewRegulationIntroductionProcess.vue
index f48eeb4..3114192 100644
--- a/src/views/workCenter/newRegulationIntroductionProcess/NewRegulationIntroductionProcess.vue
+++ b/src/views/workCenter/newRegulationIntroductionProcess/NewRegulationIntroductionProcess.vue
@@ -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'))
// 初始化流程审批信息