diff --git a/src/views/workCenter/regulatoryComplianceCheckProcess/RegulatoryComplianceCheckProcess.vue b/src/views/workCenter/regulatoryComplianceCheckProcess/RegulatoryComplianceCheckProcess.vue index 8c41b5f..ba9eb0f 100644 --- a/src/views/workCenter/regulatoryComplianceCheckProcess/RegulatoryComplianceCheckProcess.vue +++ b/src/views/workCenter/regulatoryComplianceCheckProcess/RegulatoryComplianceCheckProcess.vue @@ -179,7 +179,7 @@ import UserSelectModal from '@/components/selection/UserSelectModal' import { WorkCenterMixin } from '@/mixins/WorkCenterMixin' import { RegulatoryComplianceCheckNodes, ProcessKey } from '../../../enums/commonEnums' import { - getDataDraft, + getDataDraft, getLookData, regulatoryComplianceCheckAgree, regulatoryComplianceCheckApproval, regulatoryComplianceCheckGetDataById, regulatoryComplianceCheckReject, @@ -273,6 +273,14 @@ export default { // 有草稿id,说明是从流程中心-草稿来的,需要初始化数据 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) { // 说明是已发起流程 this.currentNodeName = this.$route.query.taskName @@ -291,6 +299,7 @@ export default { currentNodeName: '', currentNodeId: RegulatoryComplianceCheckNodes.initiated.value, // 当前节点id model: {}, + draftModel: {}, // 草稿Json转化的对象 processInfoForm: this.$form.createForm(this), labelCol: { xs: { span: 24 }, @@ -341,7 +350,8 @@ export default { }, formInline: {}, approvalInfoForm: this.$form.createForm(this), // 审批信息表单 - personnelInfoData: [] + personnelInfoData: [], + isLook: false } }, methods: { @@ -353,6 +363,9 @@ export default { if (type === 'todo') { func = regulatoryComplianceCheckGetDataById params = param.taskId + } else if (type === 'look') { + func = getLookData + params = param } else { func = getDataDraft params = param @@ -374,24 +387,25 @@ export default { } // 有草稿json按草稿进来的回显 if (this.model.infoJsonStr) { - this.model = JSON.parse(this.model.infoJsonStr) + this.draftModel = JSON.parse(this.model.infoJsonStr) // 初始化流程信息 - const prcObj = Object.assign({}, this.model) - prcObj.processDueDate = this.model.processDueDate - prcObj.processDescription = this.model.processDescription - this.processInfoForm.setFieldsValue(pick(prcObj, 'processName', 'processDueDate', 'processDescription')) + if (this.currentNode !== 1) { + // 需要回显上方的标准编号/标准名称和适用市场 + // 标准编号/标准名称 + 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 - prcObj.handleFile = this.model.handleFile - this.approvalInfoForm.setFieldsValue(pick(prcObj, 'handleText', 'handleFile')) - this.model.data = JSON.parse(this.model.infoJsonStr).data + this.approvalInfoForm.setFieldsValue(pick(this.draftModel.basicTaskInfoDTO, 'handleText', 'handleFile')) // 如果是节点1的保存回显人员信息 if (this.currentNode === 1) { - this.draftInitPersonInfo(JSON.parse(this.model.infoJsonStr).personnelObj) + this.draftInitPersonInfo(this.draftModel.userInfoMap) } } if (this.$refs.baseInfoRef) { - this.$refs.baseInfoRef.initData(this.model.data) + this.$refs.baseInfoRef.initData(this.draftModel.businessInfoDTO || this.model.businessInfoDTO) } }) // 初始化业务基本信息中组件内容 diff --git a/src/views/workCenter/regulatoryComplianceCheckProcess/modules/EngineerInitBaseInfo.vue b/src/views/workCenter/regulatoryComplianceCheckProcess/modules/EngineerInitBaseInfo.vue index 54a21a4..dc3eb92 100644 --- a/src/views/workCenter/regulatoryComplianceCheckProcess/modules/EngineerInitBaseInfo.vue +++ b/src/views/workCenter/regulatoryComplianceCheckProcess/modules/EngineerInitBaseInfo.vue @@ -39,6 +39,23 @@ :pagination="false" :loading="loading"> + + +
@@ -201,8 +218,17 @@ import ManualAddModal from './ManualAddModal' import { StandardSource, AddType } from '@/enums/commonEnums' import { regulatoryComplianceCheckGenerate } from '@/api/workCenter' import { getFormDictTreeList, queryDepartTreeList } from '../../../../api/api' -import { downloadFile } from '../../../../api/manage' 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 = () => { return '-' + parseInt(Math.random() * 10000 + 1, 10) @@ -282,14 +308,15 @@ export default { align: 'center', width: 180, dataIndex: 'splitFileSource', - customRender: (value, row, index) => { - return - } + scopedSlots: { customRender: 'splitFileSource' } + // customRender: (value, row, index) => { + // return + // } }, { // 新生产车实施日期 title: this.$t('newProductionVehicleImplementationDate'), @@ -537,10 +564,6 @@ export default { console.log(result) // 新增方式-手动新增 result.addType = AddType.MANUAL_ADD.value - if (!isEdit) { - // 新增,分解单来源设置为发布稿 - result.splitFileSource = '2' - } this.standardDataSource[0] = Object.assign({}, result) this.$emit('processNameChange', (result.standardNumber || '') + '-' + (result.standardName || '') + '-' + '法规符合性排查') this.$forceUpdate() @@ -704,7 +727,43 @@ export default { filterTreeOption (input, option) { const text = option.componentOptions.propsData.title || option.componentOptions.propsData.label 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) + }, } } diff --git a/src/views/workCenter/regulatoryComplianceCheckProcess/modules/InterfacePersonDeliveryBaseInfo.vue b/src/views/workCenter/regulatoryComplianceCheckProcess/modules/InterfacePersonDeliveryBaseInfo.vue index 0d209aa..d6dee5a 100644 --- a/src/views/workCenter/regulatoryComplianceCheckProcess/modules/InterfacePersonDeliveryBaseInfo.vue +++ b/src/views/workCenter/regulatoryComplianceCheckProcess/modules/InterfacePersonDeliveryBaseInfo.vue @@ -35,8 +35,9 @@ rowKey="id" :columns="columns" :dataSource="dataSource" - :pagination="false" - :loading="loading"> + :pagination="ipagination" + :loading="loading" + @change="handleTableChange">
@@ -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: [ { title: this.$t('serialNumber'), @@ -150,6 +163,10 @@ export default { }) return data }, + handleTableChange (pagination, filters, sorter) { + // 分页、排序、筛选变化时触发 + this.ipagination = pagination + }, // 选择用户得到用户名 userSelectNameChange (value, fieldName) { this.formInline[fieldName + '_dictText'] = value diff --git a/src/views/workCenter/regulatoryComplianceCheckProcess/modules/ManualAddModal.vue b/src/views/workCenter/regulatoryComplianceCheckProcess/modules/ManualAddModal.vue index 7348874..ac216d6 100644 --- a/src/views/workCenter/regulatoryComplianceCheckProcess/modules/ManualAddModal.vue +++ b/src/views/workCenter/regulatoryComplianceCheckProcess/modules/ManualAddModal.vue @@ -40,23 +40,31 @@ - + - + @@ -137,6 +145,10 @@ export default { const arr = this.$refs.standardState.dictOptions.filter(item => valueArr.includes(item.value)) this.model.standardState_dictText = arr.map(item => item.title).join(',') }, + // 上传拆解单文件改变 + splitFileChange (value) { + this.model.splitFile_dictText = this.$refs.splitFileRef.fileList[0].name + }, close () { this.visible = false },