[update] 市场法规清单

This commit is contained in:
lideqin
2024-07-04 10:31:48 +08:00
parent e07ce3a071
commit fe3bb43b7d
3 changed files with 49 additions and 20 deletions
+4 -1
View File
@@ -142,6 +142,8 @@ const getMarketRegulationListByIdNoPerm = (params) => getAction('', params)
const marketRegulationListAdd = (params) => postAction('/laws/marketStandard/add', params) const marketRegulationListAdd = (params) => postAction('/laws/marketStandard/add', params)
// 市场法规清单-编辑 // 市场法规清单-编辑
const marketRegulationListEdit = (params) => postAction('/laws/marketStandard/edit', params) const marketRegulationListEdit = (params) => postAction('/laws/marketStandard/edit', params)
// 市场法规清单-获取详情列表
const marketRegulationDetailListById = (params) => getAction('/laws/marketStandardDetail/list', params)
export { export {
// 国内标准 // 国内标准
@@ -224,5 +226,6 @@ export {
getMarketRegulationListById, getMarketRegulationListById,
getMarketRegulationListByIdNoPerm, getMarketRegulationListByIdNoPerm,
marketRegulationListAdd, marketRegulationListAdd,
marketRegulationListEdit marketRegulationListEdit,
marketRegulationDetailListById
} }
@@ -112,7 +112,7 @@
import InternalDetailPage from '../../../components/InternalDetailPage' import InternalDetailPage from '../../../components/InternalDetailPage'
import FileEcho from '../../../components/FileEcho' import FileEcho from '../../../components/FileEcho'
import HistoryVersionModal from './modules/HistoryVersionModal' import HistoryVersionModal from './modules/HistoryVersionModal'
import { getMarketRegulationListById } from '../../../api/standardRegulationLibraryApi' import { getMarketRegulationListById, marketRegulationDetailListById } from '../../../api/standardRegulationLibraryApi'
import JTable from '../../../components/jero/JTable' import JTable from '../../../components/jero/JTable'
import { StandardSource } from '../../../enums/commonEnums' import { StandardSource } from '../../../enums/commonEnums'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
@@ -324,18 +324,37 @@ export default {
this.loading = true this.loading = true
const param = Object.assign({}, this.filters) const param = Object.assign({}, this.filters)
param.manifestId = ids param.manifestId = ids
getMarketRegulationListById(param).then(res => { if (this.ids.length <= 1) {
if (res.success) { // 只有一条数据,需要获取基础信息和列表
this.model = Object.assign({}, res.result) getMarketRegulationListById(param).then(res => {
if (!this.model.manifest) { if (res.success) {
this.model.manifest = {} 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)) } else {
} // 有多条数据只需要调用获取列表的接口
}).finally(() => { marketRegulationDetailListById(param).then(res => {
this.loading = false 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 () { searchQuery () {
@@ -211,6 +211,7 @@ import MarketRegulationsListSelectionModal from '../../../components/selection/M
import { import {
getForeignStandardDocumentInfo, getForeignStandardDocumentInfo,
getMarketRegulationListById, getMarketRegulationListById,
marketRegulationDetailListById,
marketRegulationListAdd, marketRegulationListAdd,
marketRegulationListEdit marketRegulationListEdit
} from '../../../api/standardRegulationLibraryApi' } from '../../../api/standardRegulationLibraryApi'
@@ -509,6 +510,7 @@ export default {
this.loading = true this.loading = true
const param = {} const param = {}
param.manifestId = id param.manifestId = id
// 获取基础信息和历史版本
getMarketRegulationListById(param).then(res => { getMarketRegulationListById(param).then(res => {
if (res.success) { if (res.success) {
this.model = Object.assign({}, res.result) this.model = Object.assign({}, res.result)
@@ -517,17 +519,22 @@ export default {
return { value: item } 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.$nextTick(() => {
this.form.setFieldsValue(pick(this.model.manifest, 'country', 'manifestNo', 'customName', 'drivePosition', 'securityLevel', 'manifestDesc', 'file')) 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
}) })
}, },
// 点击历史版本 // 点击历史版本