[update] 市场法规清单-历史版本

This commit is contained in:
lideqin
2024-07-08 11:24:56 +08:00
parent 8bceb86ae0
commit c3e83bad67
3 changed files with 17 additions and 9 deletions
@@ -295,7 +295,8 @@ export default {
url: { url: {
list: '/laws/marketStandardDetail/page' list: '/laws/marketStandardDetail/page'
}, },
disableMixinCreated: true disableMixinCreated: true,
historyVersions: [] // 历史版本数据
} }
}, },
beforeRouteUpdate (to, from, next) { beforeRouteUpdate (to, from, next) {
@@ -306,6 +307,7 @@ export default {
this.ids = to.query.ids.split(',') this.ids = to.query.ids.split(',')
this.filters.manifestId = to.query.ids this.filters.manifestId = to.query.ids
this.initData(to.query.ids) this.initData(to.query.ids)
this.loadData()
next() next()
} else { } else {
next() next()
@@ -332,6 +334,7 @@ export default {
getMarketRegulationListById(param).then(res => { getMarketRegulationListById(param).then(res => {
if (res.success) { if (res.success) {
this.model = Object.assign({}, res.result.manifest) this.model = Object.assign({}, res.result.manifest)
this.historyVersions = JSON.parse(JSON.stringify(res.result.historyVersions))
} }
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
@@ -348,7 +351,7 @@ export default {
}, },
// 点击历史版本 // 点击历史版本
clickHistoryVersion () { clickHistoryVersion () {
this.$refs.historyVersionModal.open(this.model) this.$refs.historyVersionModal.open(this.model.id, this.historyVersions)
} }
} }
} }
@@ -459,7 +459,8 @@ export default {
delete: '/laws/marketStandardDetail/delete' delete: '/laws/marketStandardDetail/delete'
}, },
disableMixinCreated: true, disableMixinCreated: true,
importData: {} importData: {},
historyVersions: [] // 历史版本
} }
}, },
mounted () { mounted () {
@@ -489,6 +490,7 @@ export default {
getMarketRegulationListById(param).then(res => { getMarketRegulationListById(param).then(res => {
if (res.success) { if (res.success) {
this.model = Object.assign({}, res.result.manifest) this.model = Object.assign({}, res.result.manifest)
this.historyVersions = JSON.parse(JSON.stringify(res.result.historyVersions))
if (this.model.country) { if (this.model.country) {
this.model.country = this.model.country.split(',').map(item => { this.model.country = this.model.country.split(',').map(item => {
return { value: item } return { value: item }
@@ -504,7 +506,7 @@ export default {
}, },
// 点击历史版本 // 点击历史版本
clickHistoryVersion () { clickHistoryVersion () {
this.$refs.historyVersionModal.open(this.model) this.$refs.historyVersionModal.open(this.model.id, this.historyVersions)
}, },
// 下一步或提交, 提交基础信息 // 下一步或提交, 提交基础信息
handleNext () { handleNext () {
@@ -530,6 +532,9 @@ export default {
if (!this.model.id) { if (!this.model.id) {
// 没有id,是新增会返回id,用于下方表格处理 // 没有id,是新增会返回id,用于下方表格处理
this.model.id = res.message this.model.id = res.message
this.filters.manifestId = this.model.id
// 更新清单编号
this.initData(this.model.id)
} }
this.showList = true this.showList = true
} else { } else {
@@ -648,7 +653,7 @@ export default {
} }
.content-wrapper { .content-wrapper {
height: calc(100% - 52px); height: 100%;
box-sizing: border-box; box-sizing: border-box;
overflow: auto; overflow: auto;
padding: 32px 20px; padding: 32px 20px;
@@ -54,10 +54,10 @@ export default {
} }
}, },
methods: { methods: {
open (model) { open (manifestId, historyVersions) {
this.visible = true this.visible = true
this.model = Object.assign({}, model) this.model.id = manifestId
this.dataSource = this.model.historyVersions.map(item => { this.dataSource = historyVersions.map(item => {
return { version: item } return { version: item }
}) })
}, },
@@ -67,7 +67,7 @@ export default {
path: '/standardRegulationLibrary/marketRegulationsList/marketRegulationsDetailPage', path: '/standardRegulationLibrary/marketRegulationsList/marketRegulationsDetailPage',
query: { query: {
title: this.$t('view'), title: this.$t('view'),
ids: this.model.manifest.id, ids: this.model.id,
manifestVersion: record.version manifestVersion: record.version
} }
}) })