fix 标准入库/变更、标准征求意见、法规采购流程保存
This commit is contained in:
@@ -13,11 +13,7 @@ function fillZero (str) {
|
||||
return realNum
|
||||
}
|
||||
|
||||
/**
|
||||
* kkFile预览文件并添加水印
|
||||
* @param fileUrl
|
||||
*/
|
||||
export const kkFilePreview = (fileUrl) => {
|
||||
export function dealUrl (fileUrl) {
|
||||
const userInfo = Vue.ls.get(USER_INFO)
|
||||
// 获取当前时间
|
||||
const date = new Date()
|
||||
@@ -32,6 +28,13 @@ export const kkFilePreview = (fileUrl) => {
|
||||
const watermarkTxt = `${userInfo.username} ${userInfo.realname} ${time}`
|
||||
// 客户环境预览需要加的加密参数
|
||||
const watermarkSign = md5(watermarkTxt + 'cnhtc')
|
||||
const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileUrl))}&watermarkTxt=${encodeURIComponent(watermarkTxt)}&watermarkSign=${watermarkSign}`
|
||||
window.open(url)
|
||||
}
|
||||
return `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileUrl))}&watermarkTxt=${encodeURIComponent(watermarkTxt)}&watermarkSign=${watermarkSign}`
|
||||
}
|
||||
|
||||
/**
|
||||
* kkFile预览文件并添加水印
|
||||
* @param fileUrl
|
||||
*/
|
||||
export const kkFilePreview = (fileUrl) => {
|
||||
window.open(dealUrl(fileUrl))
|
||||
}
|
||||
|
||||
@@ -2,6 +2,9 @@ import Vue from 'vue'
|
||||
import * as api from '@/api/api'
|
||||
import { isURL } from '@/utils/validate'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import { getFileInfo } from '@/api/api'
|
||||
import { dealUrl, kkFilePreview } from './kkFilePreview'
|
||||
import { previewPdf } from './previewPdf'
|
||||
// import onlineCommons from '@/components/onlineForm/onlineForm'
|
||||
|
||||
//
|
||||
@@ -678,3 +681,37 @@ export function getConfusionCode (tableName, fieldName) {
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过文件id在当前窗口预览文件
|
||||
* @param fileId
|
||||
*/
|
||||
export function previewFileCurrentWindowByFileId (fileId) {
|
||||
return new Promise((resolve, reject) => {
|
||||
getFileInfo({ id: fileId }).then(res => {
|
||||
if (res.success) {
|
||||
const file = res.result || {}
|
||||
// 支持预览的文件后缀
|
||||
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx']
|
||||
const fileSuffix = file.fileName ? file.fileName.split('.')[file.fileName.split('.').length - 1] : ''
|
||||
const canPreview = CAN_PREVIEW_FILE_SUFFIX.some(tt => fileSuffix.toLowerCase() === tt)
|
||||
// 判断是否为可预览格式的文件
|
||||
if (!canPreview) {
|
||||
reject('该文件类型不支持预览')
|
||||
}
|
||||
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}`
|
||||
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
|
||||
const FILE_TYPE_PDF = 'pdf'
|
||||
// pdf预览
|
||||
if (canPreview && FILE_TYPE_PDF.includes(fileSuffix)) {
|
||||
const url = previewPdf(file.id)
|
||||
window.open(url, '_self')
|
||||
return
|
||||
}
|
||||
// 其余可预览文件仍使用KKFile进行预览
|
||||
const kkFileUrl = dealUrl(fileFullUrl)
|
||||
window.open(kkFileUrl, '_self')
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -140,6 +140,7 @@ import { downloadFile, getFileAccessHttpUrl } from '../../../api/manage.js'
|
||||
import { previewPdf } from '../../../utils/previewPdf.js'
|
||||
import { Base64 } from 'js-base64'
|
||||
import { kkFilePreview } from '../../../utils/kkFilePreview'
|
||||
import { previewFileCurrentWindowByFileId } from '../../../utils/util'
|
||||
|
||||
// 国内标准权限
|
||||
const DomesticStandardPermission = {
|
||||
@@ -251,6 +252,16 @@ export default {
|
||||
}
|
||||
},
|
||||
async created () {
|
||||
// 如果是要直接看文件
|
||||
// if (this.$route.query.viewFile) {
|
||||
// // TODO 这里需要调一个接口,通过标准id按规则获取文件
|
||||
// const fileId = '1734843741558288385'
|
||||
// previewFileCurrentWindowByFileId(fileId).then(() => {
|
||||
// }).catch((message) => {
|
||||
// this.$message.warning(message)
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
await this.initForm()
|
||||
this.initDetailData()
|
||||
},
|
||||
|
||||
@@ -140,7 +140,8 @@
|
||||
<user-selection v-decorator="['moduleOwnerId', validatorRules.moduleOwnerId]"
|
||||
:name-str="dispatchInfo.moduleOwnerId_dictText"
|
||||
type="checkbox"
|
||||
:placeholder="$t('pleaseSelect') + $t('workCenter.standardConsultationProcess.moduleOwner')" />
|
||||
:placeholder="$t('pleaseSelect') + $t('workCenter.standardConsultationProcess.moduleOwner')"
|
||||
@nameChange="handleModuleOwnerNameChange" />
|
||||
</a-form-item>
|
||||
</div>
|
||||
<!--下发人员类型选了模块负责人或者模块负责人分发节点都显示这个选项-->
|
||||
@@ -151,7 +152,8 @@
|
||||
<user-selection v-decorator="['designEngineerId', validatorRules.designEngineerId]"
|
||||
:name-str="dispatchInfo.designEngineerId_dictText"
|
||||
type="checkbox"
|
||||
:placeholder="$t('pleaseSelect') + $t('workCenter.standardConsultationProcess.designEngineer')" />
|
||||
:placeholder="$t('pleaseSelect') + $t('workCenter.standardConsultationProcess.designEngineer')"
|
||||
@nameChange="handleDesignEngineerNameChange" />
|
||||
</a-form-item>
|
||||
</div>
|
||||
</div>
|
||||
@@ -977,6 +979,7 @@ export default {
|
||||
basicServiceInfo = Object.assign(this.basicServiceInfo, this.basicServiceInfoForm.getFieldsValue())
|
||||
// 流程审批信息
|
||||
approvalInfo = Object.assign(this.approvalInfo, this.approvalInfoForm.getFieldsValue())
|
||||
approvalInfo.finishFlag = 1 // 保存——1;提交/同意/驳回——2
|
||||
// 业务分派信息
|
||||
if (this.showDispatchInformation) {
|
||||
dispatchInfo = Object.assign(this.dispatchInfo, this.dispatchInfoForm.getFieldsValue())
|
||||
@@ -1012,6 +1015,7 @@ export default {
|
||||
this.approvalInfoForm.validateFields((errors, values) => {
|
||||
if (!errors) {
|
||||
approvalInfo = Object.assign(this.approvalInfo, values)
|
||||
approvalInfo.finishFlag = 2 // 保存——1;提交/同意/驳回——2
|
||||
} else {
|
||||
flag = false
|
||||
}
|
||||
@@ -1248,6 +1252,20 @@ export default {
|
||||
*/
|
||||
consultationDueDateDisabledDate (current) {
|
||||
return current && current < moment().subtract(1, 'days').endOf('day')
|
||||
},
|
||||
/**
|
||||
* 模块负责人名字
|
||||
* @param name
|
||||
*/
|
||||
handleModuleOwnerNameChange (name) {
|
||||
this.dispatchInfo.moduleOwnerId_dictText = name
|
||||
},
|
||||
/**
|
||||
* 设计工程师名字
|
||||
* @param name
|
||||
*/
|
||||
handleDesignEngineerNameChange (name) {
|
||||
this.dispatchInfo.designEngineerId_dictText = name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -846,6 +846,7 @@ export default {
|
||||
if (!errors) {
|
||||
formData.basicTaskInfoDTO = Object.assign(this.approvalInfo, values)
|
||||
formData.basicTaskInfoDTO.taskId = this.$route.query.taskId
|
||||
formData.basicTaskInfoDTO.finishFlag = 2 // 保存——1;提交/同意/驳回——2
|
||||
} else {
|
||||
flag = false
|
||||
this.$message.warning(this.$t('pleaseEnterRemarks'))
|
||||
@@ -890,7 +891,10 @@ export default {
|
||||
businessMap: formInline,
|
||||
id: this.businessId
|
||||
}, // 业务信息
|
||||
basicTaskInfoDTO: Object.assign(this.approvalInfo, this.approvalInfoForm.getFieldsValue(), { taskId: this.$route.query.taskId }), // 流程审批信息
|
||||
basicTaskInfoDTO: Object.assign(this.approvalInfo, this.approvalInfoForm.getFieldsValue(), {
|
||||
taskId: this.$route.query.taskId,
|
||||
finishFlag: 1 // 保存——1;提交/同意/驳回——2
|
||||
}), // 流程审批信息
|
||||
userInfoMap: this.$refs.personnelInfo.getDataObj() // 用户信息
|
||||
}
|
||||
const params = { ...formData.basicProcessInfoDTO, ...this.formInline, ...formData.basicTaskInfoDTO }
|
||||
|
||||
@@ -364,6 +364,7 @@ export default {
|
||||
businessInfo = this.dataSource
|
||||
approvalInfo = Object.assign(this.approvalInfo, this.approvalInfoForm.getFieldsValue())
|
||||
approvalInfo.taskId = approvalInfo.taskId || this.$route.query.taskId
|
||||
approvalInfo.finishFlag = 1 // 保存——1;提交/同意/驳回——2
|
||||
userInfoMap = this.$refs.personnelInfo.getDataObj()
|
||||
const params = { ...processInfo, ...businessInfo, ...approvalInfo, ...userInfoMap }
|
||||
if (!Object.values(params).some(tt => !!tt || (tt && tt.length > 0))) {
|
||||
@@ -391,6 +392,7 @@ export default {
|
||||
if (!errors) {
|
||||
approvalInfo = Object.assign(this.approvalInfo, values)
|
||||
approvalInfo.taskId = approvalInfo.taskId || this.$route.query.taskId
|
||||
approvalInfo.finishFlag = 2 // 保存——1;提交/同意/驳回——2
|
||||
} else {
|
||||
flag = false
|
||||
this.$message.warning(this.$t('pleaseEnterRemarks'))
|
||||
|
||||
Reference in New Issue
Block a user