update 标准预警

This commit is contained in:
赵霄
2023-10-31 18:47:12 +08:00
parent 763284d5bd
commit 3eed614bf2
3 changed files with 270 additions and 2 deletions
+5
View File
@@ -509,6 +509,11 @@ module.exports = {
specialty: '特点',
comparisonItem: '比对项',
relatedAccessory: '相关附件'
},
// 标准预警
standardWarning: {
implementEarlyWarningForNewModels: '新车型实施预警',
implementEarlyWarningInProductionVehicles: '在产车实施预警'
}
},
// 业务支持
+10 -2
View File
@@ -52,7 +52,7 @@
<!-- 不需要更多按钮 -->
<template v-for="(operation, index) in operSpecialJudge(record)">
<a :key="index" @click="operationClick(operation,record)">{{ operation.text }}</a>
<a-divider type="vertical" v-if="index !== operSpecialJudge(record).length - 1"/>
<a-divider type="vertical" v-if="index !== operSpecialJudge(record).length - 1" />
</template>
</template>
</template>
@@ -80,7 +80,7 @@
<template v-else-if="getLineOperationList(record).length > 0">
<template v-for="(operation, index) in getLineOperationList(record)">
<a :key="index" @click="operationClick(operation,record)">{{ operation.text }}</a>
<a-divider type="vertical" v-if="index !== getLineOperationList(record).length - 1"/>
<a-divider type="vertical" v-if="index !== getLineOperationList(record).length - 1" />
</template>
</template>
</template>
@@ -289,6 +289,12 @@ export default {
// 自定义列配置修改后,更新表格字段
this.setResultColumns(this.columns)
}
},
columns: {
handler () {
this.setResultColumns(this.columns)
},
deep: true
}
},
methods: {
@@ -649,9 +655,11 @@ export default {
touch-action: none;
}
}
// 解决每行都有dataIndex时会有横向滚动条的问题
.resize-table-th:last-child {
border-right: none;
.table-draggable-handle {
width: 0px !important;
min-width: 0px !important;
@@ -0,0 +1,255 @@
<template>
<a-card :bordered="false">
<a-tabs type="card" v-model="activeTab" @change="handleTabChange">
<!--新车型实施预警-->
<a-tab-pane key="1" :tab="$t('docTool.standardWarning.implementEarlyWarningForNewModels')"></a-tab-pane>
<!--在产车实施预警-->
<a-tab-pane key="2" :tab="$t('docTool.standardWarning.implementEarlyWarningInProductionVehicles')"></a-tab-pane>
</a-tabs>
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<!--来源-->
<a-col :md="6" :sm="12">
<a-form-item :label="$t('standardSelect.source')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag
class="box-input"
v-model="queryParam.source"
:placeholder="$t('pleaseSelect') + $t('standardSelect.source')"
:type="'select'"
:triggerChange="false"
:options="sourceOptions" />
</a-form-item>
</a-col>
<!--标准号/标准名称-->
<a-col :md="6" :sm="12">
<a-form-item :label="$t('standardSelect.standardNumOrName')">
<a-input :placeholder="$t('pleaseEnter') + $t('standardSelect.standardNumOrName')"
v-model="queryParam.standardNumberOrName"></a-input>
</a-form-item>
</a-col>
<!--责任部门-->
<a-col :md="6" :sm="12">
<a-form-model-item :label="$t('projectLibrary.vehicleItemLibrary.responsibleDepartment')"
:labelCol="labelCol"
:wrapperCol="wrapperCol">
<a-tree-select
tree-node-filter-prop="title"
v-model="queryParam.responsibleDepartment"
:maxTagCount="1"
:show-search="true"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
class="box-input"
style="width: 100%"
:tree-data="departList"
:placeholder="$t('pleaseSelect') + $t('projectLibrary.vehicleItemLibrary.responsibleDepartment')"
@change="handleDepartsChange"
/>
</a-form-model-item>
</a-col>
<a-col :md="6" :sm="8">
<div style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchReset" icon="reload" ghost>{{ $t('reset') }}</a-button>
<a-button type="primary"
@click="searchQuery"
icon="search"
style="margin-left: 8px"
v-has="'standardWarning:search'">
{{ $t('query') }}
</a-button>
</div>
</a-col>
</a-row>
</a-form>
</div>
<div>
<j-table
v-if="columns && columns.length > 0"
:columns="columns"
:dataSource="dataSource"
:can-drag="true"
rowKey="id"
:pagination="ipagination"
:scroll="{x: '100%'}"
:loading="loading"
@change="handleTableChange"
@operationClick="operationClick">
<!--跳转标准详情-->
<template v-slot:detail="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text can-click-table-text" v-if="text || text === 0" @click="toDetailPage(record)">{{ text }}</div>
<div v-else class="table-text">{{ global.emptyLine }}</div>
</a-tooltip>
</template>
<!--实施日期内容-->
<template v-slot:date="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text">
{{
activeTab === '1' ? record.newModelImplementationDate || global.emptyLine : record.onTheProductionDate || global.emptyLine
}}
</div>
</a-tooltip>
</template>
</j-table>
</div>
</a-card>
</template>
<script>
import { JeroListMixin } from '../../../mixins/JeroListMixin'
import { queryDepartTreeList, ajaxGetDictItems } from '../../../api/api'
import JTable from '../../../components/jero/JTable'
import { mapGetters } from 'vuex'
import { StandardSource } from '../../../enums/commonEnums'
export default {
name: 'StandardWarningList',
components: { JTable },
mixins: [JeroListMixin],
data () {
return {
departList: [],
disableMixinCreated: true,
activeTab: '1',
sourceOptions: [],
columns: [
// 来源
{
dataIndex: 'source',
title: this.$t('standardSelect.source'),
width: 150
},
// 标准号
{
dataIndex: 'standardNumber',
title: this.$t('standardNumber'),
width: 150,
scopedSlots: { customRender: 'detail' }
},
// 标准名称
{
dataIndex: 'standardName',
title: this.$t('standardName'),
width: 150,
scopedSlots: { customRender: 'detail' }
},
// 新车型实施日期
{
dataIndex: 'newModelImplementationDate',
title: this.$t('projectLibrary.vehicleItemLibrary.newModelImplementationDate'),
width: 150
}
],
url: {
list: '/laws/localTool/standardEarlyWarning/newModelImplementation'
}
}
},
computed: {
...mapGetters(['userInfo'])
},
created () {
this.queryParam.responsibleDepartment = this.userInfo.departIds
this.getDepartTreeList()
this.getSourceOptions()
this.loadData()
},
methods: {
getDepartTreeList () {
queryDepartTreeList().then((res) => {
if (res.success) {
this.departList = res.result
} else {
this.departList = []
}
})
},
getSourceOptions () {
ajaxGetDictItems('standard_source').then(res => {
if (res.success) {
this.sourceOptions = res.result || []
}
})
},
handleTabChange () {
this.dataSource = []
switch (this.activeTab) {
// 新车型实施预警
case '1':
this.url.list = '/laws/localTool/standardEarlyWarning/newModelImplementation'
this.columns.splice(this.columns.length - 1, 1)
this.columns.push({
dataIndex: 'newModelImplementationDate',
title: this.$t('projectLibrary.vehicleItemLibrary.newModelImplementationDate'),
width: 150
})
break
// 在产车实施预警
case '2':
this.url.list = '/laws/localTool/standardEarlyWarning/onTheProduction'
this.columns.splice(this.columns.length - 1, 1)
this.columns.push({
dataIndex: 'onTheProductionDate',
title: this.$t('personalCenter.collection.productCarDate'),
width: 150
})
break
default:
break
}
this.queryParam = { responsibleDepartment: this.userInfo.departIds }
this.loadData()
},
/**
* 跳转标准详情
* @param id
* @param source
*/
toDetailPage ({ id, source }) {
let path
// 根据来源跳转不同的详情页
switch (source) {
// 国内
case StandardSource.DOMESTIC.value:
path = '/standardRegulationLibrary/DomesticStandardDetail'
break
// 海外
case StandardSource.OVERSEAS.value:
path = '/standardRegulationLibrary/OverseasStandardDetail'
break
// 企标
case StandardSource.ENTERPRISE.value:
path = '/enterpriseStandardLibrary/enterpriseStandardDetail'
break
default:
break
}
if (!path) {
return
}
const query = {
id
}
this.$openPageNewSheet({
path, query
})
},
handleDepartsChange () {
this.$forceUpdate()
}
}
}
</script>
<style scoped lang="less">
</style>