[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 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
}
@@ -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 () {
@@ -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
})
},
// 点击历史版本