[update] 市场法规清单增加修改清单版本功能
This commit is contained in:
@@ -156,6 +156,8 @@ const marketRegulationDetailCopy = (params) => postAction('/laws/marketStandardD
|
|||||||
const marketRegulationDetailAdd = (params) => postAction('/laws/marketStandardDetail/add', params)
|
const marketRegulationDetailAdd = (params) => postAction('/laws/marketStandardDetail/add', params)
|
||||||
// 市场法规清单-清单列表-编辑
|
// 市场法规清单-清单列表-编辑
|
||||||
const marketRegulationDetailEdit = (params) => postAction('/laws/marketStandardDetail/edit', params)
|
const marketRegulationDetailEdit = (params) => postAction('/laws/marketStandardDetail/edit', params)
|
||||||
|
// 市场法规清单-清单列表-编辑清单版本
|
||||||
|
const marketRegulationDetailEditVersion = (params) => postAction('/laws/marketStandard/editManifestVersion', params)
|
||||||
// 市场法规清单-清单列表-上移、下移
|
// 市场法规清单-清单列表-上移、下移
|
||||||
const marketRegulationDetailMove = (params) => postAction('/laws/marketStandardDetail/move', params)
|
const marketRegulationDetailMove = (params) => postAction('/laws/marketStandardDetail/move', params)
|
||||||
// 市场法规清单-发布-看该清单是否可以发布
|
// 市场法规清单-发布-看该清单是否可以发布
|
||||||
@@ -252,6 +254,7 @@ export {
|
|||||||
marketRegulationDetailCopy,
|
marketRegulationDetailCopy,
|
||||||
marketRegulationDetailAdd,
|
marketRegulationDetailAdd,
|
||||||
marketRegulationDetailEdit,
|
marketRegulationDetailEdit,
|
||||||
|
marketRegulationDetailEditVersion,
|
||||||
marketRegulationDetailMove,
|
marketRegulationDetailMove,
|
||||||
marketRegulationDetailPublish,
|
marketRegulationDetailPublish,
|
||||||
marketRegulationDirectRelease
|
marketRegulationDirectRelease
|
||||||
|
|||||||
@@ -83,7 +83,8 @@ module.exports = {
|
|||||||
listNumberEnglishPart: 'List number English abbreviation',
|
listNumberEnglishPart: 'List number English abbreviation',
|
||||||
directRelease: 'Direct release',
|
directRelease: 'Direct release',
|
||||||
confirmDirectRelease: 'Want to publish directly?',
|
confirmDirectRelease: 'Want to publish directly?',
|
||||||
directReleaseAData: 'Do you want to publish selected data directly?'
|
directReleaseAData: 'Do you want to publish selected data directly?',
|
||||||
|
editVersion: 'Modify List Version'
|
||||||
},
|
},
|
||||||
// 市场清单详情列表字段
|
// 市场清单详情列表字段
|
||||||
marketListField: {
|
marketListField: {
|
||||||
|
|||||||
@@ -83,7 +83,8 @@ module.exports = {
|
|||||||
listNumberEnglishPart: '清单编号英文缩写',
|
listNumberEnglishPart: '清单编号英文缩写',
|
||||||
directRelease: '直接发布',
|
directRelease: '直接发布',
|
||||||
confirmDirectRelease: '确认直接发布?',
|
confirmDirectRelease: '确认直接发布?',
|
||||||
directReleaseAData: '是否直接发布选中数据?'
|
directReleaseAData: '是否直接发布选中数据?',
|
||||||
|
editVersion: '修改清单版本'
|
||||||
},
|
},
|
||||||
// 市场清单详情列表字段
|
// 市场清单详情列表字段
|
||||||
marketListField: {
|
marketListField: {
|
||||||
|
|||||||
+19
-1
@@ -119,6 +119,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- table区域-end -->
|
<!-- table区域-end -->
|
||||||
|
|
||||||
|
<!-- 编辑清单版本弹框 -->
|
||||||
|
<edit-version-modal ref="editVersionModal" @ok="modalFormOk"/>
|
||||||
|
|
||||||
</a-card>
|
</a-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -130,10 +133,11 @@ import { ListState } from '../../../enums/commonEnums'
|
|||||||
import { getFormDictTreeList } from '../../../api/api'
|
import { getFormDictTreeList } from '../../../api/api'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import { marketRegulationDetailPublish, marketRegulationDirectRelease } from '../../../api/standardRegulationLibraryApi'
|
import { marketRegulationDetailPublish, marketRegulationDirectRelease } from '../../../api/standardRegulationLibraryApi'
|
||||||
|
import EditVersionModal from './modules/EditVersionModal'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'MarketRegulationsList',
|
name: 'MarketRegulationsList',
|
||||||
components: { JTable, JDictSelectTag },
|
components: { JTable, JDictSelectTag, EditVersionModal },
|
||||||
mixins: [JeroListMixin],
|
mixins: [JeroListMixin],
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['userInfo']),
|
...mapGetters(['userInfo']),
|
||||||
@@ -242,6 +246,16 @@ export default {
|
|||||||
return this.isAdmin || this.userInfo.id === record.author
|
return this.isAdmin || this.userInfo.id === record.author
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 修改清单版本
|
||||||
|
{
|
||||||
|
text: this.$t('standardRegulationLibrary.marketRegulationsList.editVersion'),
|
||||||
|
clickEvent: 'handleEditVersion',
|
||||||
|
has: 'marketStandard:editVersion',
|
||||||
|
// 只有作者和管理员可以编辑,只能编辑已发布的数据
|
||||||
|
show: (record) => {
|
||||||
|
return record.manifestStatus === ListState.RELEASED.value && (this.isAdmin || this.userInfo.id === record.author)
|
||||||
|
}
|
||||||
|
},
|
||||||
// 删除
|
// 删除
|
||||||
{
|
{
|
||||||
text: this.$t('delete'),
|
text: this.$t('delete'),
|
||||||
@@ -294,6 +308,10 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 修改清单版本
|
||||||
|
handleEditVersion (record) {
|
||||||
|
this.$refs.editVersionModal.edit(record)
|
||||||
|
},
|
||||||
// 批量发布
|
// 批量发布
|
||||||
handleBatchPublish () {
|
handleBatchPublish () {
|
||||||
if (this.selectedRowKeys.length !== 1) {
|
if (this.selectedRowKeys.length !== 1) {
|
||||||
|
|||||||
+101
@@ -0,0 +1,101 @@
|
|||||||
|
<template>
|
||||||
|
<j-modal
|
||||||
|
:title="title"
|
||||||
|
:maskClosable="false"
|
||||||
|
:width="width"
|
||||||
|
:visible="visible"
|
||||||
|
:confirm-loading="confirmLoading"
|
||||||
|
switchFullscreen
|
||||||
|
@ok="handleOk"
|
||||||
|
@cancel="handleCancel">
|
||||||
|
<a-form :form="form">
|
||||||
|
<!-- 清单版本 -->
|
||||||
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('standardRegulationLibrary.marketRegulationsList.listVersion')">
|
||||||
|
<a-input :placeholder="$t('pleaseEnter') + $t('standardRegulationLibrary.marketRegulationsList.listVersion')"
|
||||||
|
:maxLength="50"
|
||||||
|
v-decorator.trim="[ 'manifestVersion', validatorRules.manifestVersion ]" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import pick from 'lodash.pick'
|
||||||
|
import {
|
||||||
|
marketRegulationDetailEditVersion
|
||||||
|
} from '@/api/standardRegulationLibraryApi'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'EditVersionModal',
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
title: this.$t('standardRegulationLibrary.marketRegulationsList.editVersion'),
|
||||||
|
width: 800,
|
||||||
|
visible: false,
|
||||||
|
confirmLoading: false,
|
||||||
|
form: this.$form.createForm(this),
|
||||||
|
model: {},
|
||||||
|
labelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 6 }
|
||||||
|
},
|
||||||
|
wrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 16 }
|
||||||
|
},
|
||||||
|
validatorRules: {
|
||||||
|
// 清单版本
|
||||||
|
manifestVersion: {
|
||||||
|
rules: [{
|
||||||
|
required: true,
|
||||||
|
message: this.$t('pleaseEnter') + this.$t('standardRegulationLibrary.marketRegulationsList.listVersion')
|
||||||
|
}],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
edit (record) {
|
||||||
|
this.form.resetFields()
|
||||||
|
this.visible = true
|
||||||
|
this.model = Object.assign({}, record)
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(pick(this.model, 'manifestVersion'))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleOk () {
|
||||||
|
if (this.confirmLoading) return
|
||||||
|
this.form.validateFields((err, values) => {
|
||||||
|
if (!err) {
|
||||||
|
this.confirmLoading = true
|
||||||
|
const param = Object.assign({}, values)
|
||||||
|
param.id = this.model.id
|
||||||
|
marketRegulationDetailEditVersion(param).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message.success(res.message)
|
||||||
|
this.$emit('ok')
|
||||||
|
this.close()
|
||||||
|
} else {
|
||||||
|
this.$message.warn(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
this.confirmLoading = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleCancel () {
|
||||||
|
this.close()
|
||||||
|
},
|
||||||
|
close () {
|
||||||
|
this.visible = false
|
||||||
|
this.model = {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user