From fe3bb43b7d99d1e247fd0427b5e01911c6381984 Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Thu, 4 Jul 2024 10:31:48 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E5=B8=82=E5=9C=BA=E6=B3=95=E8=A7=84?= =?UTF-8?q?=E6=B8=85=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/standardRegulationLibraryApi.js | 5 ++- .../MarketRegulationsDetailPage.vue | 43 +++++++++++++------ .../MarketRegulationsFormPage.vue | 21 ++++++--- 3 files changed, 49 insertions(+), 20 deletions(-) diff --git a/src/api/standardRegulationLibraryApi.js b/src/api/standardRegulationLibraryApi.js index aedc098..85fa49d 100644 --- a/src/api/standardRegulationLibraryApi.js +++ b/src/api/standardRegulationLibraryApi.js @@ -142,6 +142,8 @@ const getMarketRegulationListByIdNoPerm = (params) => getAction('', params) const marketRegulationListAdd = (params) => postAction('/laws/marketStandard/add', params) // 市场法规清单-编辑 const marketRegulationListEdit = (params) => postAction('/laws/marketStandard/edit', params) +// 市场法规清单-获取详情列表 +const marketRegulationDetailListById = (params) => getAction('/laws/marketStandardDetail/list', params) export { // 国内标准 @@ -224,5 +226,6 @@ export { getMarketRegulationListById, getMarketRegulationListByIdNoPerm, marketRegulationListAdd, - marketRegulationListEdit + marketRegulationListEdit, + marketRegulationDetailListById } diff --git a/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsDetailPage.vue b/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsDetailPage.vue index 0325332..2aba6b0 100644 --- a/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsDetailPage.vue +++ b/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsDetailPage.vue @@ -112,7 +112,7 @@ import InternalDetailPage from '../../../components/InternalDetailPage' import FileEcho from '../../../components/FileEcho' import HistoryVersionModal from './modules/HistoryVersionModal' -import { getMarketRegulationListById } from '../../../api/standardRegulationLibraryApi' +import { getMarketRegulationListById, marketRegulationDetailListById } from '../../../api/standardRegulationLibraryApi' import JTable from '../../../components/jero/JTable' import { StandardSource } from '../../../enums/commonEnums' import { mapGetters } from 'vuex' @@ -324,18 +324,37 @@ export default { this.loading = true const param = Object.assign({}, this.filters) param.manifestId = ids - getMarketRegulationListById(param).then(res => { - if (res.success) { - this.model = Object.assign({}, res.result) - if (!this.model.manifest) { - this.model.manifest = {} + if (this.ids.length <= 1) { + // 只有一条数据,需要获取基础信息和列表 + getMarketRegulationListById(param).then(res => { + if (res.success) { + this.model = Object.assign({}, res.result) + if (!this.model.manifest) { + this.model.manifest = {} + } + marketRegulationDetailListById(param).then(res => { + if (res.success) { + this.model.lists = res.result + this.dataSource = JSON.parse(JSON.stringify(this.model.lists)) + this.dataList = JSON.parse(JSON.stringify(this.model.lists)) + } + }).finally(() => { + this.loading = false + }) } - this.dataSource = JSON.parse(JSON.stringify(this.model.lists)) - this.dataList = JSON.parse(JSON.stringify(this.model.lists)) - } - }).finally(() => { - this.loading = false - }) + }) + } else { + // 有多条数据只需要调用获取列表的接口 + marketRegulationDetailListById(param).then(res => { + if (res.success) { + this.model.lists = res.result + this.dataSource = JSON.parse(JSON.stringify(this.model.lists)) + this.dataList = JSON.parse(JSON.stringify(this.model.lists)) + } + }).finally(() => { + this.loading = false + }) + } }, // 查询 searchQuery () { diff --git a/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsFormPage.vue b/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsFormPage.vue index c39925a..2d9becf 100644 --- a/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsFormPage.vue +++ b/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsFormPage.vue @@ -211,6 +211,7 @@ import MarketRegulationsListSelectionModal from '../../../components/selection/M import { getForeignStandardDocumentInfo, getMarketRegulationListById, + marketRegulationDetailListById, marketRegulationListAdd, marketRegulationListEdit } from '../../../api/standardRegulationLibraryApi' @@ -509,6 +510,7 @@ export default { this.loading = true const param = {} param.manifestId = id + // 获取基础信息和历史版本 getMarketRegulationListById(param).then(res => { if (res.success) { this.model = Object.assign({}, res.result) @@ -517,17 +519,22 @@ export default { return { value: item } }) } - for (const item of this.model.lists) { - const uid = uidGenerator() - this.dataSource.push({ ...item, uid }) - this.dataList.push({ ...item, uid }) - } this.$nextTick(() => { this.form.setFieldsValue(pick(this.model.manifest, 'country', 'manifestNo', 'customName', 'drivePosition', 'securityLevel', 'manifestDesc', 'file')) }) + marketRegulationDetailListById(param).then(res => { + if (res.success) { + this.model.lists = res.result + for (const item of this.model.lists) { + const uid = uidGenerator() + this.dataSource.push({ ...item, uid }) + this.dataList.push({ ...item, uid }) + } + } + }).finally(() => { + this.loading = false + }) } - }).finally(() => { - this.loading = false }) }, // 点击历史版本