diff --git a/src/api/standardRegulationLibraryApi.js b/src/api/standardRegulationLibraryApi.js index 85fa49d..fd2e696 100644 --- a/src/api/standardRegulationLibraryApi.js +++ b/src/api/standardRegulationLibraryApi.js @@ -134,16 +134,22 @@ const addStandardMasterPlan = (params) => postAction('/laws/StandardMasterPlan/a // 标准主计划-编辑 const editStandardMasterPlan = (params) => postAction('/laws/StandardMasterPlan/edit', params) -// 市场法规清单-根据id查询-用于编辑 +// 市场法规清单-基础信息-根据id查询 const getMarketRegulationListById = (params) => getAction('/laws/marketStandard/detail', params) -// 市场法规清单-根据id查询-无权限 -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) +// 市场法规清单-清单列表-复制 +const marketRegulationDetailCopy = (params) => postAction('/laws/marketStandardDetail/copy', params) +// 市场法规清单-清单列表-新增 +const marketRegulationDetailAdd = (params) => postAction('/laws/marketStandardDetail/add', params) +// 市场法规清单-清单列表-编辑 +const marketRegulationDetailEdit = (params) => postAction('/laws/marketStandardDetail/edit', params) +// 市场法规清单-发布-暂时的 todo,测试状态变更是否正确 +const marketRegulationDetailPublish = (params) => postAction('/laws/marketStandard/publish', params) export { // 国内标准 @@ -224,8 +230,11 @@ export { // 市场法规清单 getMarketRegulationListById, - getMarketRegulationListByIdNoPerm, marketRegulationListAdd, marketRegulationListEdit, - marketRegulationDetailListById + marketRegulationDetailListById, + marketRegulationDetailCopy, + marketRegulationDetailAdd, + marketRegulationDetailEdit, + marketRegulationDetailPublish } diff --git a/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsDetailPage.vue b/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsDetailPage.vue index 6535325..d17ae57 100644 --- a/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsDetailPage.vue +++ b/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsDetailPage.vue @@ -112,14 +112,15 @@ import InternalDetailPage from '../../../components/InternalDetailPage' import FileEcho from '../../../components/FileEcho' import HistoryVersionModal from './modules/HistoryVersionModal' -import { getMarketRegulationListById, marketRegulationDetailListById } from '../../../api/standardRegulationLibraryApi' +import { getMarketRegulationListById } from '../../../api/standardRegulationLibraryApi' import JTable from '../../../components/jero/JTable' -import { StandardSource } from '../../../enums/commonEnums' import { mapGetters } from 'vuex' +import { JeroListMixin } from '@/mixins/JeroListMixin' export default { name: 'MarketRegulationsDetailPage', components: { InternalDetailPage, FileEcho, JTable, HistoryVersionModal }, + mixins: [JeroListMixin], computed: { ...mapGetters(['defaultHeight']), ...mapGetters(['userInfo']), @@ -143,7 +144,7 @@ export default { data () { return { loading: false, - model: { manifest: {}, lists: [] }, + model: {}, columns: [ { // 序号 title: this.$t('serialNumber'), @@ -290,22 +291,11 @@ export default { } ], dataSource: [], - dataList: [], // 用于查询的数据,保证查询后数据不变 - /* 分页参数 */ - ipagination: { - current: 1, - pageSize: 10, - pageSizeOptions: ['10', '20', '30'], - showTotal: (total, range) => { - return range[0] + '-' + range[1] + ' 共' + total + '条' - }, - showQuickJumper: true, - showSizeChanger: true, - total: 0 + ids: [], + url: { + list: '/laws/marketStandardDetail/page' }, - queryParam: {}, - filters: {}, - ids: [] + disableMixinCreated: true } }, beforeRouteUpdate (to, from, next) { @@ -314,6 +304,7 @@ export default { this.filters.manifestVersion = to.query.manifestVersion } this.ids = to.query.ids.split(',') + this.filters.manifestId = to.query.ids this.initData(to.query.ids) next() } else { @@ -325,80 +316,29 @@ export default { this.filters.manifestVersion = this.$route.query.manifestVersion } this.ids = this.$route.query.ids.split(',') + this.filters.manifestId = this.$route.query.ids this.initData(this.$route.query.ids) + this.loadData() }, methods: { initData (ids) { + // 只有一条数据,需要获取基础信息 + if (this.ids.length > 1) { + return + } this.loading = true const param = Object.assign({}, this.filters) param.manifestId = ids - 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 - }) - } - }) - } 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 () { - if (this.queryParam.standardNumber && this.queryParam.standardName) { - this.dataSource = this.dataList.filter(item => { - return item.standardNumber.indexOf(this.queryParam.standardNumber) !== -1 && item.standardName.indexOf(this.queryParam.standardName) !== -1 - }) - } else if (this.queryParam.standardNumber) { - this.dataSource = this.dataList.filter(item => { - return item.standardNumber.indexOf(this.queryParam.standardNumber) !== -1 - }) - } else if (this.queryParam.standardName) { - this.dataSource = this.dataList.filter(item => { - return item.standardName.indexOf(this.queryParam.standardName) !== -1 - }) - } else { - this.dataSource = JSON.parse(JSON.stringify(this.dataList)) - } - }, - // 重置 - searchReset () { - this.queryParam = {} - this.dataSource = JSON.parse(JSON.stringify(this.dataList)) - }, - handleTableChange (pagination, filters, sorter) { - // 分页、排序、筛选变化时触发 - this.ipagination = pagination + getMarketRegulationListById(param).then(res => { + if (res.success) { + this.model = Object.assign({}, res.result) + } + }).finally(() => { + this.loading = false + }) }, toDetail (record) { - let path = '' - // 需要先判断是哪种标准 - if (record.source === StandardSource.FOREIGN.value) { - path = '/standardRegulationLibrary/foreignStandardDetailPage' - } else if (record.source === StandardSource.ENTERPRISE.value) { - path = '/enterpriseStandardLibrary/enterpriseStandardDetail' - } + const path = '/standardRegulationLibrary/foreignStandardDetailPage' this.$openPageNewSheet({ path: path, query: { diff --git a/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsFormPage.vue b/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsFormPage.vue index 650ec24..2c8c176 100644 --- a/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsFormPage.vue +++ b/src/views/standardRegulationLibrary/marketRegulationsList/MarketRegulationsFormPage.vue @@ -1,7 +1,7 @@