[update] 企标流程联调

This commit is contained in:
lideqin
2023-10-31 14:08:32 +08:00
parent 39bb7afd20
commit 49658c110d
6 changed files with 102 additions and 26 deletions
+3
View File
@@ -38,6 +38,8 @@ const activelyReportTurnTo = (params) => postAction('/process/es/annualReport/tr
const activelyReportAgree = (params) => postAction('/process/es/annualReport/agree', params)
// 拒绝
const activelyReportReject = (params) => postAction('/process/es/annualReport/reject', params)
// 根据流程id获取流程信息
const activelyReportGetDataById = (taskId, params) => getAction(`/process/es/annualReport/handle/${taskId}`, params)
// 年度制修订计划(标准化发起)
// 发起
@@ -148,6 +150,7 @@ export {
activelyReportTurnTo,
activelyReportAgree,
activelyReportReject,
activelyReportGetDataById,
standardizationInitApproval,
standardizationInitSave,
+40 -12
View File
@@ -9,16 +9,16 @@
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<!--项目名称-->
<a-col :md="8" :sm="12">
<a-form-item :label="$t('expirationDate')">
<a-range-picker
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
v-model="queryParam.publicizeData"
@change="searchQuery">
</a-range-picker>
</a-form-item>
</a-col>
<!--<a-col :md="8" :sm="12">-->
<!-- <a-form-item :label="$t('expirationDate')">-->
<!-- <a-range-picker-->
<!-- value-format="YYYY-MM-DD"-->
<!-- format="YYYY-MM-DD"-->
<!-- v-model="queryParam.publicizeData"-->
<!-- @change="searchQuery">-->
<!-- </a-range-picker>-->
<!-- </a-form-item>-->
<!--</a-col>-->
<a-col :md="6" :sm="8">
<div style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
@@ -44,6 +44,16 @@
:scroll="{x: '100%'}"
@change="handleTableChange">
<!-- 耗时 -->
<template v-slot:timeConsuming="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ record.endTime && record.createTime ? computedTimeConsuming(record) : global.emptyLine }}</template>
<div class="table-text">
{{ record.endTime && record.createTime ? computedTimeConsuming(record) : global.emptyLine }}
</div>
</a-tooltip>
</template>
<!--审批意见-->
<template v-slot:approvalOpinion="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
@@ -158,9 +168,9 @@ export default {
},
// 耗时
{
dataIndex: 'projectHealth_dictText',
title: this.$t('workCenter.processDetail.timeConsuming'),
width: 100
width: 100,
scopedSlots: { customRender: 'timeConsuming' }
},
// 审批意见
{
@@ -228,6 +238,24 @@ export default {
this.loading = false
})
},
// 计算耗时
computedTimeConsuming (record) {
// 结束时间和创建时间
const endTime = new Date(record.endTime)
const createTime = new Date(record.createTime)
// 计算时间差 转化为秒数
const time = parseInt((endTime.getTime() - createTime.getTime()) / 1000)
// 总秒数转化为对应的天数
const days = parseInt(time / (24 * 60 * 60))
// 计算小时
const hours = parseInt((time % (24 * 60 * 60)) / (60 * 60))
// 计算分钟
const minutes = parseInt((time % (60 * 60)) / 60)
// 计算秒
const seconds = time % 60
return (days ? days + '天 ' : '') + (hours ? hours + '小时 ' : '') +
(minutes ? minutes + '分钟 ' : '') + (seconds ? seconds + '秒' : '')
},
// 附件列的查看点击
fileLook (record) {
this.$refs.uploadFile.open(record.commitFile)
+2 -2
View File
@@ -314,7 +314,7 @@ export default {
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/download/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
console.log(fileSuffix)
// 图片预览,使用自己添加的组件
if (!canPreview && FILE_TYPE_IMGS.includes(fileSuffix)) {
if (canPreview && FILE_TYPE_IMGS.includes(fileSuffix)) {
this.imageUrl = getFileAccessHttpUrl(file.response.result.id)
// 获取viewer实例
const viewer = this.$el.querySelector('.image').$viewer
@@ -324,7 +324,7 @@ export default {
return
}
// pdf预览
if (!canPreview && FILE_TYPE_PDF.includes(fileSuffix)) {
if (canPreview && FILE_TYPE_PDF.includes(fileSuffix)) {
const url = previewPdf(file.response.result.id)
window.open(url)
return
@@ -156,10 +156,12 @@ import {
activelyReportSave,
activelyReportTurnTo,
activelyReportAgree,
activelyReportReject
activelyReportReject,
activelyReportGetDataById
} from '@/api/workCenter'
import Vue from 'vue'
import { USER_INFO } from '@/store/mutation-types'
import pick from 'lodash.pick'
const personData = [
{
@@ -236,12 +238,8 @@ export default {
}
},
mounted () {
if (this.currentNode === 1) {
this.personnelInfoData = personData
} else {
this.personnelInfoData = personData.map(item => {
return { ...item, canChoose: false, fieldName: undefined }
})
if (this.$route.query.taskId) {
this.getProcessData(this.$route.query.taskId)
}
// 如果是查看进入的,不可编辑,不可操作
if (this.$route.query.onlyLook) {
@@ -299,10 +297,50 @@ export default {
personnelInfoData: [], // 人员信息数据
url: {
list: '' // 人员信息右侧表的分页查询接口
}
},
model: {}
}
},
methods: {
getProcessData (taskId) {
activelyReportGetDataById(taskId).then(res => {
if (res.success) {
this.model = res.result
this.$nextTick(() => {
// 初始化流程信息
this.processInfoForm.setFieldsValue(pick(this.model.common, 'prcName', 'dueTime', 'prcMes'))
// 初始化流程审批信息,todo:需要判断是不是草稿进来的,草稿进来的才回显审批信息
// this.approvalInfoForm.setFieldsValue(pick(this.model[0], 'commitText', 'commitFile'))
})
const taskName = this.$route.query.taskName
if (taskName) {
if (taskName === '标准化工程师发起') {
this.currentNode = 1
} else if (taskName === '各部所联络人填写/下发任务') {
this.currentNode = 2
} else if (taskName === '工作组/所联络人填写企标') {
this.currentNode = 3
} else if (taskName === '收集联络人主管级领导审批') {
this.currentNode = 4
} else if (taskName === '各部所联络人汇总') {
this.currentNode = 5
} else if (taskName === '联络人主管级上一级领导审批') {
this.currentNode = 6
} else {
this.currentNode = 7
}
}
if (this.currentNode === 1) {
this.personnelInfoData = personData
} else {
this.personnelInfoData = personData.map(item => {
return { ...item, canChoose: false, fieldName: undefined }
})
}
this.$refs.baseInfoFormRef.initData(this.model.dataList)
}
})
},
switchChange (value) {
this.switchValue = value
},
@@ -829,10 +829,10 @@ export default {
this.$message.warning(this.$t('pleaseEnterPersonnelInfo'))
return
}
// 专家审批至少需要选两个专家
if (personnelObj.standardExpert.split(',').length < 2) {
this.$message.warning(this.$t('workCenter.enterpriseInitChangePlan.pleaseSelectLeastTwoExpert'))
}
// 专家审批至少需要选两个专家 todo: 后端选多人流程进行不下去,暂时不限制传多人
// if (personnelObj.standardExpert.split(',').length < 2) {
// this.$message.warning(this.$t('workCenter.enterpriseInitChangePlan.pleaseSelectLeastTwoExpert'))
// }
console.log(this.formInline)
this.processInfoForm.validateFields((err, values) => {
this.$refs.ruleForm.validate(valid => {
@@ -143,6 +143,13 @@ export default {
switch (record.prcType + '') {
case '7':
path = '/workCenter/enterpriseStandardInitChange/planApprovalChangeFlow'
break
case '8':
path = '/workCenter/annualRevisionPlanActivelyReport/revisionPlanActivelyReportFlow'
break
case '9':
path = '/workCenter/annualRevisionPlanStandardizationInit/revisionPlanStandardizationInitFlow'
break
}
this.$router.push({
path: path,