[update] 市场法规清单联调

This commit is contained in:
lideqin
2024-07-02 14:40:30 +08:00
parent 1cab56b378
commit b2409bffab
5 changed files with 142 additions and 40 deletions
@@ -72,7 +72,8 @@ module.exports = {
templateName: 'Market regulation list import template',
historicalVersion: 'Historical version',
standardExist: 'The standard already exists',
haveStandardExist: 'Some standards already exist'
haveStandardExist: 'Some standards already exist',
pleaseSelectAListPublish: 'Please select a list to publish'
},
// 市场清单详情列表字段
marketListField: {
@@ -73,7 +73,8 @@ module.exports = {
templateName: '市场法规清单导入模版',
historicalVersion: '历史版本',
standardExist: '标准已经存在',
haveStandardExist: '部分标准已存在'
haveStandardExist: '部分标准已存在',
pleaseSelectAListPublish: '请选择一个清单进行发布'
},
// 市场清单详情列表字段
marketListField: {
@@ -1,41 +1,42 @@
<template>
<internal-detail-page :title="$route.query.title" :content-padding="0" :loading="loading">
<div class="content-wrapper">
<a-row>
<a-row class="basic-info" v-if="ids.length <= 1">
<!-- 国家/地区 -->
<a-col :span="12">
<label>{{ $t('standardRegulationLibrary.marketRegulationsList.countryRegion') }}</label>
<span>{{ model.country }}</span>
<span>{{ model.manifest.country_dictText || global.emptyLine }}</span>
</a-col>
<!-- 清单编号 -->
<a-col :span="12">
<label>{{ $t('standardRegulationLibrary.marketRegulationsList.listNumber') }}</label>
<span>{{ model.manifestNo }}</span>
<span>{{ model.manifest.manifestNo || global.emptyLine }}</span>
</a-col>
<!-- 清单名称 -->
<a-col :span="12">
<label>{{ $t('standardRegulationLibrary.marketRegulationsList.listName') }}</label>
<span>{{ model.mainfestName }}</span>
<span>{{ model.manifest.mainfestName || global.emptyLine }}</span>
</a-col>
<!-- 驾驶位置 -->
<a-col :span="12">
<label>{{ $t('standardRegulationLibrary.marketRegulationsList.drivingPosition') }}</label>
<span>{{ model.drivePosition }}</span>
<span>{{ model.manifest.drivePosition_dictText || global.emptyLine }}</span>
</a-col>
<!-- 密级 -->
<a-col :span="12">
<label>{{ $t('standardRegulationLibrary.marketRegulationsList.securityClass') }}</label>
<span>{{ model.securityLevel_dictText }}</span>
<span>{{ model.manifest.securityLevel_dictText || global.emptyLine }}</span>
</a-col>
<!-- 清单说明 -->
<a-col :span="12">
<label>{{ $t('standardRegulationLibrary.marketRegulationsList.listDeclaration') }}</label>
<span>{{ model.listDeclaration }}</span>
<span>{{ model.manifest.manifestDesc || global.emptyLine }}</span>
</a-col>
<!-- 附件 -->
<a-col :span="12">
<a-col :span="12" class="file-echo-col">
<label>{{ $t('attach') }}</label>
<file-echo :fileIds="model.attach"/>
<file-echo v-if="model.manifest.file" class="file-echo-div" :fileIds="model.manifest.file"/>
<span v-else>{{ global.emptyLine }}</span>
</a-col>
</a-row>
<!-- 市场法规清单 -->
@@ -83,7 +84,6 @@
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<!-- 标准编号标准名称 -->
@@ -104,18 +104,30 @@
<script>
import InternalDetailPage from '../../../components/InternalDetailPage'
import FileEcho from '../../../components/FileEcho'
import { JeroListMixin } from '../../../mixins/JeroListMixin'
import { getMarketRegulationListById } from '../../../api/standardRegulationLibraryApi'
import JTable from '../../../components/jero/JTable'
import { StandardSource } from '../../../enums/commonEnums'
import { mapGetters } from 'vuex'
export default {
name: 'MarketRegulationsDetailPage',
components: { InternalDetailPage, FileEcho, JTable },
mixins: [JeroListMixin],
computed: {
...mapGetters(['defaultHeight']),
yScrollHeight () {
/**
* 前几个使用变量是为了配合iframe嵌套,算出页面显示范围的高度
* 48px:分页器的高度
* 48pxa-card的padding(上24+下24
* 54px:表头行的高度
*/
return `calc(100vh - ${this.defaultHeight['user-info-height']} - ${this.defaultHeight['breadcrumb-height']} - ${this.defaultHeight.oneLineSearchHeight} - ${this.defaultHeight.oneLineOperationHeight} - 48px - 48px - 54px - ${this.isBackTitle ? '56px' : '0px'})`
}
},
data () {
return {
model: {},
loading: false,
model: { manifest: {}, lists: [] },
columns: [
{ // 序号
title: this.$t('serialNumber'),
@@ -173,21 +185,21 @@ export default {
title: this.$t('standardRegulationLibrary.marketListField.applicableCountryRegion'),
align: 'center',
width: 180,
dataIndex: 'applicableCountryRegion',
dataIndex: 'applicableCountryRegion_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 适用车型
title: this.$t('standardRegulationLibrary.marketListField.applicableVehicleType'),
align: 'center',
width: 180,
dataIndex: 'applicableVehicle',
dataIndex: 'applicableVehicle_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 认证对象
title: this.$t('standardRegulationLibrary.marketListField.authenticationObject'),
align: 'center',
width: 180,
dataIndex: 'authenticationObject',
dataIndex: 'authenticationObject_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 认证交付物
@@ -201,91 +213,138 @@ export default {
title: this.$t('standardRegulationLibrary.marketListField.type'),
align: 'center',
width: 180,
dataIndex: 'stanardClass',
dataIndex: 'stanardClass_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 动力类型
title: this.$t('standardRegulationLibrary.marketListField.dynamicType'),
align: 'center',
width: 180,
dataIndex: 'dynamicType',
dataIndex: 'dynamicType_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 主控部门
title: this.$t('standardRegulationLibrary.marketListField.mainControlDepartment'),
align: 'center',
width: 180,
dataIndex: 'mainDept',
dataIndex: 'mainDept_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 主控部门专业模块
title: this.$t('standardRegulationLibrary.marketListField.masterControlDepartmentProfessionalModule'),
align: 'center',
width: 180,
dataIndex: 'mainDeptProfMode',
dataIndex: 'mainDeptProfMode_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 关联部门
title: this.$t('standardRegulationLibrary.marketListField.relatedDepartment'),
align: 'center',
width: 180,
dataIndex: 'associateDept',
dataIndex: 'associateDept_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 关联部门专业模块
title: this.$t('standardRegulationLibrary.marketListField.associateDepartmentSpecializedModules'),
align: 'center',
width: 180,
dataIndex: 'associateDeptProfMode',
dataIndex: 'associateDeptProfMode_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 批量限制
title: this.$t('standardRegulationLibrary.marketListField.batchRestriction'),
align: 'center',
width: 180,
dataIndex: 'batchLimit',
dataIndex: 'batchLimit_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 自动驾驶等级
title: this.$t('standardRegulationLibrary.marketListField.automaticDrivingLevel'),
align: 'center',
width: 180,
dataIndex: 'autopilotLevel',
dataIndex: 'autopilotLevel_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 要求类型
title: this.$t('standardRegulationLibrary.marketListField.requirementType'),
align: 'center',
width: 180,
dataIndex: 'requireType',
dataIndex: 'requireType_dictText',
scopedSlots: { customRender: 'text' }
}
],
disableMixinCreated: true
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
},
queryParam: {},
filters: {},
ids: []
}
},
mounted () {
if (this.$route.query.ids) {
this.filters.ids = this.$route.query.ids
}
if (this.$route.query.versionNumber) {
this.filters.manifestVersion = this.$route.query.versionNumber
}
this.initData()
this.ids = this.$route.query.ids.split(',')
console.log('----ids', this.ids)
this.initData(this.$route.query.ids)
},
methods: {
initData (id) {
initData (ids) {
this.loading = true
getMarketRegulationListById({ id }).then(res => {
const param = Object.assign({}, this.filters)
param.manifestId = ids
getMarketRegulationListById(param).then(res => {
if (res.success) {
this.model = Object.assign({}, res.result)
this.dataSource = JSON.parse(JSON.stringify(this.model.data))
this.dataList = JSON.parse(JSON.stringify(this.model.data))
if (!this.model.manifest) {
this.model.manifest = {}
}
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
},
toDetail (record) {
let path = ''
// 需要先判断是哪种标准
@@ -312,4 +371,19 @@ export default {
overflow: auto;
padding: 32px 20px;
}
.basic-info {
/deep/ .ant-col {
margin-bottom: 5px;
}
label {
display: inline-block;
width: 150px;
}
.file-echo-col {
display: flex;
.file-echo-div {
width: calc(100% - 150px)
}
}
}
</style>
@@ -530,7 +530,6 @@ export default {
},
// 查询
searchQuery () {
console.log('-----this.queryParam', this.queryParam)
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
@@ -274,7 +274,18 @@ export default {
},
// 批量发布
handleBatchPublish () {
if (this.selectedRowKeys.length !== 1) {
// 提示请选择一个清单进行发布
this.$message.warning(this.$t('standardRegulationLibrary.marketRegulationsList.pleaseSelectAListPublish'))
return
}
// 跳转市场清单发布流程
this.$router.push({
path: '/workCenter/MarketListReleaseProcess',
query: {
marketRegulationId: this.selectedRowKeys[0]
}
})
},
// 查看
handleLook () {
@@ -295,9 +306,25 @@ export default {
}
})
},
// 点击清单编号/清单名称查看详情
toDetail (record) {
this.$router.push({
path: '/standardRegulationLibrary/marketRegulationsList/marketRegulationsDetailPage',
query: {
title: this.$t('view'),
ids: record.id
}
})
},
// 发布
handlePublish () {
handlePublish (record) {
// 跳转市场清单发布流程
this.$router.push({
path: '/workCenter/MarketListReleaseProcess',
query: {
marketRegulationId: record.id
}
})
}
}
}