From 8d826a244e392610222886704e3fb0a114eb3c5d Mon Sep 17 00:00:00 2001
From: lideqin <694785430@qq.com>
Date: Mon, 8 Jul 2024 16:31:27 +0800
Subject: [PATCH] =?UTF-8?q?[update]=20=E6=B3=95=E8=A7=84=E7=AC=A6=E5=90=88?=
=?UTF-8?q?=E6=80=A7=E6=8E=92=E6=9F=A5=E6=B5=81=E7=A8=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/workCenter.js | 3 +
src/common/lang/workCenter/en.js | 6 +-
src/common/lang/workCenter/zh.js | 6 +-
src/enums/commonEnums.js | 26 ++-
.../modules/EngineerInitBaseInfo.vue | 204 ++++++++++--------
.../modules/ManualAddModal.vue | 16 +-
6 files changed, 158 insertions(+), 103 deletions(-)
diff --git a/src/api/workCenter.js b/src/api/workCenter.js
index 94699a3..d8c3971 100644
--- a/src/api/workCenter.js
+++ b/src/api/workCenter.js
@@ -51,6 +51,8 @@ const regulatoryComplianceCheckGetDataDraft = (params) => getAction('/process/es
const selectStandardFromSplit = (params) => getAction('', params)
// 法规工程师节点,获取条款表信息
const getClauseListInfo = (params) => getAction('', params)
+// 生成
+const regulatoryComplianceCheckGenerate = (params) => postAction('/process/standardComplianceCheck/generate', params)
// 市场清单发布流程
// 保存
@@ -125,6 +127,7 @@ export {
regulatoryComplianceCheckGetDataDraft,
selectStandardFromSplit,
getClauseListInfo,
+ regulatoryComplianceCheckGenerate,
marketListReleaseSave,
marketListReleaseApproval,
diff --git a/src/common/lang/workCenter/en.js b/src/common/lang/workCenter/en.js
index 8edca96..3207f8c 100644
--- a/src/common/lang/workCenter/en.js
+++ b/src/common/lang/workCenter/en.js
@@ -46,7 +46,11 @@ module.exports = {
rectificationCost: 'Rectification cost',
sharedWithOtherProjects: 'Shared with other projects',
costOfThisItemAfterSharing: 'Cost of this item after sharing',
- appraiser: 'Appraiser'
+ appraiser: 'Appraiser',
+ salvageListTemplateDownload: 'Split single file template download',
+ salvageListTemplateName: 'Decomposes a single file upload template',
+ carTypeFileTemplateDownload: 'Model project file template download',
+ carTypeFileTemplateName: 'Model project file upload template'
},
// 市场清单发布流程
marketListReleaseProcess: {
diff --git a/src/common/lang/workCenter/zh.js b/src/common/lang/workCenter/zh.js
index 9e9ac32..7275de6 100644
--- a/src/common/lang/workCenter/zh.js
+++ b/src/common/lang/workCenter/zh.js
@@ -46,7 +46,11 @@ module.exports = {
rectificationCost: '整改费用',
sharedWithOtherProjects: '与其他项目共用性',
costOfThisItemAfterSharing: '共用后本项目所需费用',
- appraiser: '评估人'
+ appraiser: '评估人',
+ salvageListTemplateDownload: '分解单文件模板下载',
+ salvageListTemplateName: '分解单文件上传模板',
+ carTypeFileTemplateDownload: '车型项目文件模板下载',
+ carTypeFileTemplateName: '车型项目文件上传模板'
},
// 市场清单发布流程
marketListReleaseProcess: {
diff --git a/src/enums/commonEnums.js b/src/enums/commonEnums.js
index e10411b..5ae06b1 100644
--- a/src/enums/commonEnums.js
+++ b/src/enums/commonEnums.js
@@ -147,7 +147,7 @@ export const ProcessKey = {
// 标准解读流程
STANDARD_INTERPRETATION_PROCESS: { text: 'standard_interpret', value: 'standard_interpret' },
// 法规符合性排查流程
- REGULATORY_COMPLIANCE_CHECK: { text: '', value: '' },
+ REGULATORY_COMPLIANCE_CHECK: { text: 'laws-evaluation-main', value: 'laws-evaluation-main' },
// 市场清单发布流程
MARKET_LIST_RELEASE: { text: '', value: '' }
}
@@ -174,15 +174,15 @@ export const NewRegulationsImportNodes = new EsEnums({
// 法规符合性排查流程
export const RegulatoryComplianceCheckNodes = new EsEnums({
- initiated: { text: '法规工程师发起', value: '' },
- interfacesDistributed: { text: '各部门接口人分发', value: '' },
- mainFinderDistributes: { text: '主排查人分发', value: '' },
- designEngineerEvaluation: { text: '设计工程师评估', value: '' },
- mainFinderSingleLineAudit: { text: '主排查人单线审核', value: '' },
- mainFinderCollect: { text: '主排查人汇总', value: '' },
- countersign: { text: '会签', value: '' },
- designEngineerManagerReview: { text: '设计工程师科室经理审核', value: '' },
- seniorManagerApproved: { text: '高级经理/技术官批准', value: '' }
+ initiated: { text: '法规工程师发起', value: 'sid-F144BD89-366F-482C-89DE-3AE2BD22D371' },
+ interfacesDistributed: { text: '各部门接口人分发', value: 'sid-F07416DD-65BF-499E-AC96-F7A407AA3CEB' },
+ mainFinderDistributes: { text: '主排查人分发', value: 'sid-96A59284-7EE2-4F10-A327-F76BC26B95F8' },
+ designEngineerEvaluation: { text: '设计工程师评估', value: 'sid-45FC4ED6-DB83-49E0-A080-55192B7860EB' },
+ mainFinderSingleLineAudit: { text: '主排查人单线审核', value: 'sid-C9A2FE2E-8A8A-4846-8010-5AE4ECF14DFE' },
+ mainFinderCollect: { text: '主排查人汇总', value: 'sid-A478E1B2-84B6-4884-875B-E6C53392BC4F' },
+ countersign: { text: '会签', value: 'sid-D3B3377E-9392-44D6-81D5-9DDDA91FB083' },
+ designEngineerManagerReview: { text: '设计工程师科室经理审核', value: 'sid-B253F229-2E92-4882-A054-EAA068069F0F' },
+ seniorManagerApproved: { text: '高级经理/技术官批准', value: 'sid-31D9FF6F-D1BE-4B02-910C-5DB7A5D0A626' }
})
// 市场清单发布流程节点
@@ -240,3 +240,9 @@ export const EvaluationResult = {
NOT_INVOLVE: { text: '不涉及', value: '3' },
TO_BE_VERIFIED: { text: '待验证', value: '4' }
}
+
+// 法规符合性排查流程-新增方式
+export const AddType = {
+ SELECT_STANDARD: { text: '选择标准', value: '1' },
+ MANUAL_ADD: { text: '手动新增', value: '2' }
+}
diff --git a/src/views/workCenter/regulatoryComplianceCheckProcess/modules/EngineerInitBaseInfo.vue b/src/views/workCenter/regulatoryComplianceCheckProcess/modules/EngineerInitBaseInfo.vue
index b3df299..eaf3c7a 100644
--- a/src/views/workCenter/regulatoryComplianceCheckProcess/modules/EngineerInitBaseInfo.vue
+++ b/src/views/workCenter/regulatoryComplianceCheckProcess/modules/EngineerInitBaseInfo.vue
@@ -18,6 +18,14 @@
{{ $t('delete') }}
+
+
+ {{ $t('workCenter.regulatoryComplianceCheckProcess.salvageListTemplateDownload') }}
+
+
+
+ {{ $t('workCenter.regulatoryComplianceCheckProcess.carTypeFileTemplateDownload') }}
+
@@ -26,14 +34,15 @@
:scroll="{x: '100%'}"
ref="table"
rowKey="standardNumber"
- :columns="columns"
- :dataSource="dataSource"
+ :columns="standardColumns"
+ :dataSource="standardDataSource"
:pagination="false"
:loading="loading">
@@ -49,10 +58,10 @@
{{ $t('workCenter.regulatoryComplianceCheckProcess.vehicleTypeItem') }}
-
+
+ v-model="formInline.modelFile">
@@ -65,11 +74,12 @@
-
-
+
@@ -80,11 +90,11 @@
{{ $t('workCenter.regulatoryComplianceCheckProcess.isAlike') }}
-
+
+ v-model="formInline.isSameLastVersion">
@@ -147,10 +157,10 @@
:scroll="{x: '100%'}"
ref="table"
rowKey="id"
- :columns="clauseColumns"
- :dataSource="clauseDataSource"
+ :columns="columns"
+ :dataSource="dataSource"
+ :pagination="ipagination"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
- :pagination="false"
:loading="loading">
@@ -182,17 +192,22 @@ import JTable from '@/components/jero/JTable'
import StandardSelectionModal from '@/components/selection/StandardSelectionModal'
import { getForeignStandardDetail } from '@/api/standardRegulationLibraryApi'
import ManualAddModal from './ManualAddModal'
-import { StandardSource } from '@/enums/commonEnums'
-import { getClauseListInfo } from '@/api/workCenter'
-import { queryDepartTreeList } from '../../../../api/api'
+import STreeSelect from '@/components/STreeSelect'
+import { StandardSource, AddType } from '@/enums/commonEnums'
+import { regulatoryComplianceCheckGenerate } from '@/api/workCenter'
+import { getFormDictTreeList, queryDepartTreeList } from '../../../../api/api'
+import { downloadFile } from '../../../../api/manage'
+import { JeroListMixin } from '@/mixins/JeroListMixin'
export default {
name: 'EngineerInitBaseInfo',
components: {
JTable,
ManualAddModal,
- StandardSelectionModal
+ StandardSelectionModal,
+ STreeSelect
},
+ mixins: [JeroListMixin],
props: {
disabled: {
type: Boolean,
@@ -202,11 +217,12 @@ export default {
},
data () {
return {
+ AddType,
loading: false,
formInline: {},
rules: {
// 车型项目
- vehicleTypeItem: [
+ modelFile: [
{
required: true,
message: this.$t('workCenter.regulatoryComplianceCheckProcess.vehicleTypeItem') + this.$t('cannotEmpty'),
@@ -222,7 +238,7 @@ export default {
}
],
// 是否与上一版相同
- isAlike: [
+ isSameLastVersion: [
{
required: true,
message: this.$t('workCenter.regulatoryComplianceCheckProcess.isAlike') + this.$t('cannotEmpty'),
@@ -230,7 +246,7 @@ export default {
}
]
},
- columns: [
+ standardColumns: [
{ // 标准编号
title: this.$t('standardNumber'),
align: 'center',
@@ -249,17 +265,18 @@ export default {
title: this.$t('standardState'),
align: 'center',
width: 180,
- dataIndex: 'standardState',
+ dataIndex: 'standardState_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 分解单来源
title: this.$t('workCenter.regulatoryComplianceCheckProcess.decompositionSingleSource'),
align: 'center',
width: 180,
- dataIndex: 'decompositionSingleSource',
+ dataIndex: 'splitFileSource',
customRender: (value, row, index) => {
return
@@ -269,14 +286,14 @@ export default {
title: this.$t('newProductionVehicleImplementationDate'),
align: 'center',
width: 180,
- dataIndex: 'newProductionVehicleImplementationDate',
+ dataIndex: 'newProductImplDate',
scopedSlots: { customRender: 'text' }
},
{ // 新认证车实施日期
title: this.$t('newCertifiedVehicleImplementationDate'),
align: 'center',
width: 180,
- dataIndex: 'newCertifiedVehicleImplementationDate',
+ dataIndex: 'newAuthImplDate',
scopedSlots: { customRender: 'text' }
},
{
@@ -287,7 +304,7 @@ export default {
width: 170
}
],
- dataSource: [],
+ standardDataSource: [],
isGetDataAfter: false, // 是否获取完数据了,获取完数据有的字段不显示placeholder
isGenerateAfter: false, // 是否点击了生成按钮
queryParam: {},
@@ -300,7 +317,7 @@ export default {
sm: { span: 18 }
},
categoryTreeList: [], // 组织机构下拉框数据
- clauseColumns: [
+ columns: [
{
title: this.$t('serialNumber'),
dataIndex: '',
@@ -361,14 +378,24 @@ export default {
width: 170
}
],
- clauseDataSource: [],
+ dataSource: [],
clauseDataList: [], // 防止查询数据丢失
selectedRowKeys: [],
- selectionRows: []
+ selectionRows: [],
+ url: {
+ salvageListDownTemplateUrl: '/process/standardComplianceCheck/splitTemplateDownload', // 分解单上传模板
+ carTypeFileDownTemplateUrl: '/process/standardComplianceCheck/modelTemplateDownload', // 车型项目文件上传模板
+ list: '',
+ deleteBatch: '',
+ delete: ''
+ },
+ disableMixinCreated: true,
+ countryOptions: [] // 适用市场下拉框
}
},
mounted () {
this.getSysCategoryTree()
+ this.getCountryOption()
},
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
@@ -396,6 +423,13 @@ export default {
})
return data
},
+ getCountryOption () {
+ getFormDictTreeList({ dictId: '1801130851452059649' }).then(res => {
+ if (res.success) {
+ this.countryOptions = res.result
+ }
+ })
+ },
// 获取组织机构树
getSysCategoryTree () {
queryDepartTreeList().then((res) => {
@@ -413,11 +447,13 @@ export default {
// 添加标准了,需要回显内容,返回流程名称
listChange (value) {
console.log(value)
- let obj
+ let obj = {}
if (!value || value.length <= 0) {
obj = {}
} else {
this.loading = true
+ // 标准编号
+ obj.standardNumber = value[0].standardNumber
// 标准名称
obj.standardName = value[0].standardName
// 根据返回的id查询标准数据
@@ -426,20 +462,23 @@ export default {
const result = res.result
// 标准状态
obj.standardState = result.standard_state
+ obj.standardState_dictText = result.standard_state_dictText
// 分解单来源初始化成发布稿
- obj.decompositionSingleSource = '1'
+ obj.splitFileSource = '2'
// 新生产车实施日期
obj.newProductImplDate = result.new_product_impl_date
// 新认证车实施日期
obj.newAuthImplDate = result.new_auth_impl_date
- this.dataSource[0] = obj
+ // 新增方式-选择标准
+ obj.addType = AddType.SELECT_STANDARD.value
+ this.standardDataSource[0] = obj
this.isGetDataAfter = true
}
}).finally(() => {
this.loading = false
})
+ this.$emit('processNameChange', (obj.standardNumber || '') + '-' + (obj.standardName || '') + '-' + '法规符合性排查')
}
- this.$emit('processNameChange', (obj.standardNumber || '') + '-' + (obj.standardName || '') + '-' + '法规符合性排查')
},
// 手动新增
handleAdd () {
@@ -453,7 +492,15 @@ export default {
},
// 手动新增或者编辑完的回调
manualAddOk (result, isEdit) {
- this.dataSource[0] = result
+ console.log(result)
+ // 新增方式-手动新增
+ result.addType = AddType.MANUAL_ADD.value
+ if (!isEdit) {
+ // 新增,分解单来源设置为发布稿
+ result.splitFileSource = '2'
+ }
+ this.standardDataSource[0] = Object.assign({}, result)
+ this.$forceUpdate()
},
// 删除
handleDelete () {
@@ -461,10 +508,24 @@ export default {
title: this.$t('confirmDeletion'),
content: this.$t('areYouSure'),
onOk: () => {
- this.dataSource = []
+ this.standardDataSource = []
}
})
},
+ // 下载分解单上传模板
+ salvageListTemplateDownload (fileName, fileSuffix = '.xls') {
+ if (!fileName || typeof fileName !== 'string') {
+ fileName = '模板文件'
+ }
+ downloadFile(this.url.salvageListDownTemplateUrl, fileName + fileSuffix)
+ },
+ // 车型项目文件上传模板
+ carTypeFileTemplateDownload (fileName, fileSuffix = '.xls') {
+ if (!fileName || typeof fileName !== 'string') {
+ fileName = '模板文件'
+ }
+ downloadFile(this.url.carTypeFileDownTemplateUrl, fileName + fileSuffix)
+ },
// 跳转标准详情
toDetail (record) {
let path = ''
@@ -483,60 +544,29 @@ export default {
},
// 生成
handleGenerate () {
- // 显示下方列表信息,生成列表信息
- this.isGenerateAfter = true
- if (this.dataSource.length < 1) {
- // 有标准才可以获取
- this.clauseDataSource = []
- return
- }
- // 获取下方列表信息
- const param = {}
- param.standardNumber = this.dataSource[0].standardNumber
- // 分解单来源
- param.decompositionSingleSource = this.dataSource[0].decompositionSingleSource
- getClauseListInfo(param).then(res => {
- if (res.success) {
- this.clauseDataSource = res.result
- }
- })
- },
- // 查询
- searchQuery () {
- if (this.queryParam.authDept) {
- this.clauseDataSource = this.clauseDataList.filter(item => {
- return item.authDept + '' === this.queryParam.authDept + ''
- })
- } else {
- this.dataSource = JSON.parse(JSON.stringify(this.clauseDataList))
- }
- this.selectedRowKeys = []
- this.selectionRows = []
- },
- // 重置
- searchReset () {
- this.dataSource = JSON.parse(JSON.stringify(this.clauseDataList))
- this.selectedRowKeys = []
- this.selectionRows = []
- },
- batchDel () {
- if (this.selectedRowKeys.length <= 0) {
- this.$message.warning(this.$t('selectARecord'))
- } else {
- this.$confirm({
- title: this.$t('confirmBatchDeletion'),
- content: this.$t('deleteAData'),
- onOk: () => {
- this.clauseDataSource = this.clauseDataSource.filter(item => !this.selectedRowKeys.includes(item.id))
- this.clauseDataList = this.clauseDataList.filter(item => !this.selectedRowKeys.includes(item.id))
+ if (this.standardDataSource.length >= 1) {
+ this.$refs.ruleForm.validate(valid => {
+ if (valid) {
+ const param = Object.assign({}, this.standardDataSource[0], this.formInline)
+ param.applicableMarket = param.applicableMarket.map(item => item.value).join(',')
+ regulatoryComplianceCheckGenerate(param).then(res => {
+ if (res.success) {
+ this.$message.success(res.message)
+ // 显示下方列表信息
+ this.isGenerateAfter = true
+ // 获取下方列表信息
+ this.filters.pid = res.result
+ this.loadData(1)
+ } else {
+ this.$message.warning(res.message)
+ }
+ })
}
})
+ } else {
+ this.$message.warning(this.$t('workCenter.regulatoryComplianceCheckProcess.pleaseAddStandard'))
}
},
- onSelectChange (selectedRowKeys, selectionRows) {
- this.selectedRowKeys = selectedRowKeys
- this.selectionRows = selectionRows
- },
filterTreeOption (input, option) {
const text = option.componentOptions.propsData.title || option.componentOptions.propsData.label
return text.toLowerCase().indexOf(input.toLowerCase()) >= 0
diff --git a/src/views/workCenter/regulatoryComplianceCheckProcess/modules/ManualAddModal.vue b/src/views/workCenter/regulatoryComplianceCheckProcess/modules/ManualAddModal.vue
index 607f52c..a8908fe 100644
--- a/src/views/workCenter/regulatoryComplianceCheckProcess/modules/ManualAddModal.vue
+++ b/src/views/workCenter/regulatoryComplianceCheckProcess/modules/ManualAddModal.vue
@@ -30,8 +30,10 @@
-
@@ -55,7 +57,7 @@
:wrapperCol="$i18n.locale === EN ? wrapperColEn : wrapperCol"
:label="$t('workCenter.regulatoryComplianceCheckProcess.resolutionAttachment')">
+ v-decorator="['splitFile', validatorRules.splitFile]" />
@@ -129,6 +131,12 @@ export default {
this.form.setFieldsValue(this.model)
})
},
+ // 标准状态改变
+ standardStateChange (value) {
+ const valueArr = value.split(this.$refs.standardState.spliter)
+ const arr = this.$refs.standardState.dictOptions.filter(item => valueArr.includes(item.value))
+ this.model.standardState_dictText = arr.map(item => item.title).join(',')
+ },
close () {
this.visible = false
},
@@ -137,8 +145,8 @@ export default {
if (!err) {
this.confirmLoading = true
const isEdit = this.model.standardNumber
- const formData = Object.assign(this.model, values, isEdit)
- this.$emit('ok', formData)
+ const formData = Object.assign(this.model, values)
+ this.$emit('ok', formData, isEdit)
this.confirmLoading = false
this.close()
}