[update] 法规符合性排查流程

This commit is contained in:
lideqin
2024-07-12 20:50:01 +08:00
parent c499a18741
commit 2dc1ab89ff
4 changed files with 137 additions and 35 deletions
@@ -179,7 +179,7 @@ import UserSelectModal from '@/components/selection/UserSelectModal'
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin' import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
import { RegulatoryComplianceCheckNodes, ProcessKey } from '../../../enums/commonEnums' import { RegulatoryComplianceCheckNodes, ProcessKey } from '../../../enums/commonEnums'
import { import {
getDataDraft, getDataDraft, getLookData,
regulatoryComplianceCheckAgree, regulatoryComplianceCheckApproval, regulatoryComplianceCheckAgree, regulatoryComplianceCheckApproval,
regulatoryComplianceCheckGetDataById, regulatoryComplianceCheckGetDataById,
regulatoryComplianceCheckReject, regulatoryComplianceCheckReject,
@@ -273,6 +273,14 @@ export default {
// 有草稿id,说明是从流程中心-草稿来的,需要初始化数据 // 有草稿id,说明是从流程中心-草稿来的,需要初始化数据
this.getProcessData('draft', { draftId: this.$route.query.draftId, projectId: this.$route.query.projectId }) this.getProcessData('draft', { draftId: this.$route.query.draftId, projectId: this.$route.query.projectId })
} }
if (this.$route.query.isLook + '' === '1') {
// 是查看
this.isLook = true
// 人员信息全部不可选
this.initPersonInfoData(false)
// 查询数据
this.getProcessData('look', { snapshotId: this.$route.query.snapshotId })
}
if (this.$route.query.taskName) { if (this.$route.query.taskName) {
// 说明是已发起流程 // 说明是已发起流程
this.currentNodeName = this.$route.query.taskName this.currentNodeName = this.$route.query.taskName
@@ -291,6 +299,7 @@ export default {
currentNodeName: '', currentNodeName: '',
currentNodeId: RegulatoryComplianceCheckNodes.initiated.value, // 当前节点id currentNodeId: RegulatoryComplianceCheckNodes.initiated.value, // 当前节点id
model: {}, model: {},
draftModel: {}, // 草稿Json转化的对象
processInfoForm: this.$form.createForm(this), processInfoForm: this.$form.createForm(this),
labelCol: { labelCol: {
xs: { span: 24 }, xs: { span: 24 },
@@ -341,7 +350,8 @@ export default {
}, },
formInline: {}, formInline: {},
approvalInfoForm: this.$form.createForm(this), // 审批信息表单 approvalInfoForm: this.$form.createForm(this), // 审批信息表单
personnelInfoData: [] personnelInfoData: [],
isLook: false
} }
}, },
methods: { methods: {
@@ -353,6 +363,9 @@ export default {
if (type === 'todo') { if (type === 'todo') {
func = regulatoryComplianceCheckGetDataById func = regulatoryComplianceCheckGetDataById
params = param.taskId params = param.taskId
} else if (type === 'look') {
func = getLookData
params = param
} else { } else {
func = getDataDraft func = getDataDraft
params = param params = param
@@ -374,24 +387,25 @@ export default {
} }
// 有草稿json按草稿进来的回显 // 有草稿json按草稿进来的回显
if (this.model.infoJsonStr) { if (this.model.infoJsonStr) {
this.model = JSON.parse(this.model.infoJsonStr) this.draftModel = JSON.parse(this.model.infoJsonStr)
// 初始化流程信息 // 初始化流程信息
const prcObj = Object.assign({}, this.model) if (this.currentNode !== 1) {
prcObj.processDueDate = this.model.processDueDate // 需要回显上方的标准编号/标准名称和适用市场
prcObj.processDescription = this.model.processDescription // 标准编号/标准名称
this.processInfoForm.setFieldsValue(pick(prcObj, 'processName', 'processDueDate', 'processDescription')) this.draftModel.basicProcessInfoDTO.standardNumberName = this.draftModel.businessInfoDTO.standardInfo.standardNumber + ' ' + this.model.businessInfoDTO.standardInfo.standardName
// 适用市场
this.draftModel.basicProcessInfoDTO.applicableMarket_dictText = this.draftModel.businessInfoDTO.standardInfo.applicableMarket_dictText
}
this.processInfoForm.setFieldsValue(pick(this.draftModel.basicProcessInfoDTO, 'processName', 'processDueDate', 'processDescription', 'standardNumberName', 'applicableMarket_dictText'))
// 初始化流程审批信息 // 初始化流程审批信息
prcObj.handleText = this.model.handleText this.approvalInfoForm.setFieldsValue(pick(this.draftModel.basicTaskInfoDTO, 'handleText', 'handleFile'))
prcObj.handleFile = this.model.handleFile
this.approvalInfoForm.setFieldsValue(pick(prcObj, 'handleText', 'handleFile'))
this.model.data = JSON.parse(this.model.infoJsonStr).data
// 如果是节点1的保存回显人员信息 // 如果是节点1的保存回显人员信息
if (this.currentNode === 1) { if (this.currentNode === 1) {
this.draftInitPersonInfo(JSON.parse(this.model.infoJsonStr).personnelObj) this.draftInitPersonInfo(this.draftModel.userInfoMap)
} }
} }
if (this.$refs.baseInfoRef) { if (this.$refs.baseInfoRef) {
this.$refs.baseInfoRef.initData(this.model.data) this.$refs.baseInfoRef.initData(this.draftModel.businessInfoDTO || this.model.businessInfoDTO)
} }
}) })
// 初始化业务基本信息中组件内容 // 初始化业务基本信息中组件内容
@@ -39,6 +39,23 @@
:pagination="false" :pagination="false"
:loading="loading"> :loading="loading">
<!-- 分解单来源是添加标准的标准的话显示下拉框否则显示上传的分解单或者空 -->
<template v-slot:splitFileSource="{record}" class="action-span-cell">
<!-- 通过添加标准新增的 -->
<j-dict-select-tag v-if="record.addType === AddType.SELECT_STANDARD.value"
style="width: '100%'"
v-model="record.splitFileSource"
dict-code="decomposition_single_source"
:disabled="disabled"
:placeholder="$t('pleaseSelect')" />
<!-- 手动新增的显示上传的分解单或者空 -->
<a-tooltip v-else overlay-class-name="tooltip-style">
<template slot="title">{{ record.splitFile_dictText ? record.splitFile_dictText : global.emptyLine }}</template>
<a v-if="record.splitFile" class="link-a" @click="handleSplitFile(record)">{{ record.splitFile_dictText }}</a>
<div v-else class="table-text">{{ global.emptyLine }}</div>
</a-tooltip>
</template>
<!-- 操作栏 --> <!-- 操作栏 -->
<div slot="action" slot-scope="{record}" class="action-span-cell"> <div slot="action" slot-scope="{record}" class="action-span-cell">
<!-- 手动新增才允许编辑 --> <!-- 手动新增才允许编辑 -->
@@ -201,8 +218,17 @@ import ManualAddModal from './ManualAddModal'
import { StandardSource, AddType } from '@/enums/commonEnums' import { StandardSource, AddType } from '@/enums/commonEnums'
import { regulatoryComplianceCheckGenerate } from '@/api/workCenter' import { regulatoryComplianceCheckGenerate } from '@/api/workCenter'
import { getFormDictTreeList, queryDepartTreeList } from '../../../../api/api' import { getFormDictTreeList, queryDepartTreeList } from '../../../../api/api'
import { downloadFile } from '../../../../api/manage'
import MarketRegulationsListSelection from '../../../../components/selection/MarketRegulationsListSelection' import MarketRegulationsListSelection from '../../../../components/selection/MarketRegulationsListSelection'
import Vue from 'vue'
import { ACCESS_TOKEN, USER_INFO } from '@/store/mutation-types'
import { previewPdf } from '@/utils/previewPdf'
import { getFileAccessHttpUrl, downloadFile } from '@/api/manage'
import { kkFilePreview } from '@/utils/kkFilePreview'
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
const FILE_TYPE_PDF = 'pdf'
// 支持预览的文件后缀
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx']
const uidGenerator = () => { const uidGenerator = () => {
return '-' + parseInt(Math.random() * 10000 + 1, 10) return '-' + parseInt(Math.random() * 10000 + 1, 10)
@@ -282,14 +308,15 @@ export default {
align: 'center', align: 'center',
width: 180, width: 180,
dataIndex: 'splitFileSource', dataIndex: 'splitFileSource',
customRender: (value, row, index) => { scopedSlots: { customRender: 'splitFileSource' }
return <j-dict-select-tag // customRender: (value, row, index) => {
style={{ width: '100%' }} // return <j-dict-select-tag
v-model={row.splitFileSource} // style={{ width: '100%' }}
dictCode={'decomposition_single_source'} // v-model={row.splitFileSource}
disabled={this.disabled} // dictCode={'decomposition_single_source'}
placeholder={this.$t('pleaseSelect')} /> // disabled={this.disabled}
} // placeholder={this.$t('pleaseSelect')} />
// }
}, },
{ // 新生产车实施日期 { // 新生产车实施日期
title: this.$t('newProductionVehicleImplementationDate'), title: this.$t('newProductionVehicleImplementationDate'),
@@ -537,10 +564,6 @@ export default {
console.log(result) console.log(result)
// 新增方式-手动新增 // 新增方式-手动新增
result.addType = AddType.MANUAL_ADD.value result.addType = AddType.MANUAL_ADD.value
if (!isEdit) {
// 新增,分解单来源设置为发布稿
result.splitFileSource = '2'
}
this.standardDataSource[0] = Object.assign({}, result) this.standardDataSource[0] = Object.assign({}, result)
this.$emit('processNameChange', (result.standardNumber || '') + '-' + (result.standardName || '') + '-' + '法规符合性排查') this.$emit('processNameChange', (result.standardNumber || '') + '-' + (result.standardName || '') + '-' + '法规符合性排查')
this.$forceUpdate() this.$forceUpdate()
@@ -704,7 +727,43 @@ export default {
filterTreeOption (input, option) { filterTreeOption (input, option) {
const text = option.componentOptions.propsData.title || option.componentOptions.propsData.label const text = option.componentOptions.propsData.title || option.componentOptions.propsData.label
return text.toLowerCase().indexOf(input.toLowerCase()) >= 0 return text.toLowerCase().indexOf(input.toLowerCase()) >= 0
} },
// 点击相关材料
handleSplitFile (record) {
// 截取文件后缀名
const fileSuffix = record.splitFile_dictText ? record.splitFile_dictText.split('.')[record.splitFile_dictText.split('.').length - 1] : ''
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${record.splitFile}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${record.splitFile_dictText}`
const canPreview = CAN_PREVIEW_FILE_SUFFIX.some(tt => fileSuffix === tt)
// 判断是否为可预览格式的文件
if (!canPreview) {
this.$message.loading(this.$t('uploadFile.cannotPreview')).then(() => {
this.handleDownload(record.splitFile, record.splitFile_dictText)
})
return
}
// 图片预览,使用自己添加的组件
if (FILE_TYPE_IMGS.includes(fileSuffix.toLowerCase())) {
this.imageUrl = getFileAccessHttpUrl(record.splitFile)
// 获取viewer实例
const viewer = this.$el.querySelector('.image').$viewer
// 调用show方法进行显示预览图
viewer.show()
// this.$refs.imagePreviewModal.open(file)
return
}
// pdf预览
if (FILE_TYPE_PDF.includes(fileSuffix.toLowerCase())) {
const url = previewPdf(record.splitFile)
window.open(url)
return
}
// 其余可预览文件仍使用KKFile进行预览
kkFilePreview(fileFullUrl)
},
handleDownload (id, name) {
// 下载文件
downloadFile(`/sys/common/download/${id}`, name)
},
} }
} }
</script> </script>
@@ -35,8 +35,9 @@
rowKey="id" rowKey="id"
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="false" :pagination="ipagination"
:loading="loading"> :loading="loading"
@change="handleTableChange">
</j-table> </j-table>
</div> </div>
</div> </div>
@@ -70,6 +71,18 @@ export default {
} }
] ]
}, },
/* 分页参数 */
ipagination: {
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '30', '50', '100', '150', '200'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' ' + this.$t('total') + ' ' + total + ' ' + this.$t('strip')
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
columns: [ columns: [
{ {
title: this.$t('serialNumber'), title: this.$t('serialNumber'),
@@ -150,6 +163,10 @@ export default {
}) })
return data return data
}, },
handleTableChange (pagination, filters, sorter) {
// 分页、排序、筛选变化时触发
this.ipagination = pagination
},
// 选择用户得到用户名 // 选择用户得到用户名
userSelectNameChange (value, fieldName) { userSelectNameChange (value, fieldName) {
this.formInline[fieldName + '_dictText'] = value this.formInline[fieldName + '_dictText'] = value
@@ -40,23 +40,31 @@
<a-form-item :labelCol="$i18n.locale === EN ? labelColEn : labelCol" <a-form-item :labelCol="$i18n.locale === EN ? labelColEn : labelCol"
:wrapperCol="$i18n.locale === EN ? wrapperColEn : wrapperCol" :wrapperCol="$i18n.locale === EN ? wrapperColEn : wrapperCol"
:label="$t('newProductionVehicleImplementationDate')"> :label="$t('newProductionVehicleImplementationDate')">
<j-multiple-date-picker :placeholder="$t('pleaseSelect') + $t('newProductionVehicleImplementationDate')" <a-date-picker style="width: 100%"
fieldName="newProductImplDate" :placeholder="$t('pleaseSelect') + $t('newProductionVehicleImplementationDate')"
v-decorator="['newProductImplDate', validatorRules.newProductImplDate]" /> format="YYYY-MM-DD"
valueFormat="YYYY-MM-DD"
v-decorator="['newProductImplDate', validatorRules.newProductImplDate]" />
</a-form-item> </a-form-item>
<!-- 新认证车实施日期 --> <!-- 新认证车实施日期 -->
<a-form-item :labelCol="$i18n.locale === EN ? labelColEn : labelCol" <a-form-item :labelCol="$i18n.locale === EN ? labelColEn : labelCol"
:wrapperCol="$i18n.locale === EN ? wrapperColEn : wrapperCol" :wrapperCol="$i18n.locale === EN ? wrapperColEn : wrapperCol"
:label="$t('newCertifiedVehicleImplementationDate')"> :label="$t('newCertifiedVehicleImplementationDate')">
<j-multiple-date-picker :placeholder="$t('pleaseSelect') + $t('newCertifiedVehicleImplementationDate')" <a-date-picker style="width: 100%"
fieldName="newAuthImplDate" :placeholder="$t('pleaseSelect') + $t('newCertifiedVehicleImplementationDate')"
v-decorator="['newAuthImplDate', validatorRules.newAuthImplDate]" /> format="YYYY-MM-DD"
valueFormat="YYYY-MM-DD"
v-decorator="['newAuthImplDate', validatorRules.newAuthImplDate]" />
</a-form-item> </a-form-item>
<!-- 分解单附件 --> <!-- 分解单附件 -->
<a-form-item :labelCol="$i18n.locale === EN ? labelColEn : labelCol" <a-form-item :labelCol="$i18n.locale === EN ? labelColEn : labelCol"
:wrapperCol="$i18n.locale === EN ? wrapperColEn : wrapperCol" :wrapperCol="$i18n.locale === EN ? wrapperColEn : wrapperCol"
:label="$t('workCenter.regulatoryComplianceCheckProcess.resolutionAttachment')"> :label="$t('workCenter.regulatoryComplianceCheckProcess.resolutionAttachment')">
<j-upload return-id <j-upload return-id
ref="splitFileRef"
:multiple="false"
:number="1"
@change="splitFileChange"
v-decorator="['splitFile', validatorRules.splitFile]" /> v-decorator="['splitFile', validatorRules.splitFile]" />
</a-form-item> </a-form-item>
</a-form> </a-form>
@@ -137,6 +145,10 @@ export default {
const arr = this.$refs.standardState.dictOptions.filter(item => valueArr.includes(item.value)) const arr = this.$refs.standardState.dictOptions.filter(item => valueArr.includes(item.value))
this.model.standardState_dictText = arr.map(item => item.title).join(',') this.model.standardState_dictText = arr.map(item => item.title).join(',')
}, },
// 上传拆解单文件改变
splitFileChange (value) {
this.model.splitFile_dictText = this.$refs.splitFileRef.fileList[0].name
},
close () { close () {
this.visible = false this.visible = false
}, },