[update] 修改企标流程bug

This commit is contained in:
lideqin
2023-11-27 12:04:10 +08:00
parent 770c9a4970
commit da73b49cbf
4 changed files with 51 additions and 34 deletions
+12 -9
View File
@@ -99,6 +99,7 @@ import { previewPdf } from '../utils/previewPdf.js'
import { Base64 } from 'js-base64'
import FlowChartModal from './FlowChartModal.vue'
import UploadFile from './UploadFile'
import { filterObj } from '../utils/util'
// 支持预览的文件后缀
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx']
@@ -209,10 +210,6 @@ export default {
this.$message.warning('请设置url.list属性!')
return
}
// 加载数据 若传入参数1则加载第一页的内容
if (arg === 1) {
this.ipagination.current = 1
}
const params = this.getQueryParams()// 查询条件
if (this.$route.query.processInstanceId) {
params.processInstanceId = this.$route.query.processInstanceId
@@ -225,11 +222,6 @@ export default {
if (res.success) {
// update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
this.dataSource = res.result.records || res.result
if (res.result.total) {
this.ipagination.total = res.result.total
} else {
this.ipagination.total = 0
}
// update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
} else {
this.$message.warning(res.message)
@@ -238,6 +230,17 @@ export default {
this.loading = false
})
},
getQueryParams () {
// 获取查询条件
const sqp = {}
if (this.superQueryParams) {
sqp.superQueryParams = encodeURI(this.superQueryParams)
sqp.superQueryMatchType = this.superQueryMatchType
}
const param = Object.assign(sqp, this.queryParam, this.isorter, this.filters)
param.field = this.getQueryField()
return filterObj(param)
},
// 计算耗时
computedTimeConsuming (record) {
// 结束时间和创建时间
@@ -167,10 +167,13 @@
<!-- 所长,节点6需要选所长 -->
<a-col :span="12" v-if="currentNode === 7">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('workCenter.enterpriseInitChangePlan.superintendent')">
<user-selection :placeholder="$t('pleaseSelect') + $t('workCenter.enterpriseInitChangePlan.superintendent')"
type="radio"
v-decorator="['newMainDraftUserLeader', validatorRules.newMainDraftUserLeader]"
input-type="textarea" />
<user-selection :placeholder="$t('pleaseSelect') + $t('workCenter.enterpriseInitChangePlan.superintendent')"
type="radio"
v-decorator="['newMainDraftUserLeader', validatorRules.newMainDraftUserLeader]"
@nameChange="userSelectNameChange"
fieldName="newMainDraftUserLeader"
:nameStr="userFormModel.newMainDraftUserLeader_dictText"
input-type="textarea" />
</a-form-item>
</a-col>
<!-- 相关人员,节点7需要选相关人员 -->
@@ -179,6 +182,9 @@
<user-selection :placeholder="$t('pleaseSelect') + $t('workCenter.enterpriseInitChangePlan.relatedPersonnel')"
type="checkbox"
v-decorator="['relatedUser', validatorRules.relatedUser]"
@nameChange="userSelectNameChange"
fieldName="relatedUser"
:nameStr="userFormModel.relatedUser_dictText"
input-type="textarea" />
</a-form-item>
</a-col>
@@ -343,7 +349,7 @@ export default {
this.disabled = true
}
}
if (this.$route.query.taskId) {
if (this.$route.query.taskId && !this.$route.query.draftId) {
// 有流程id说明是从流程中心来的,需要初始化数据
this.getProcessData('todo', { taskId: this.$route.query.taskId })
}
@@ -448,6 +454,7 @@ export default {
]
},
userForm: this.$form.createForm(this), // 部分节点需要选人的表单
userFormModel: {},
approvalInfoForm: this.$form.createForm(this), // 审批信息表单
personnelInfoDataAll: [], // 整体人员信息
personnelInfoData: [], // 传给人员信息组件的人员信息
@@ -516,14 +523,15 @@ export default {
func(params).then(res => {
if (res.success) {
this.model = res.result
this.$nextTick(() => {
// 初始化流程信息
this.processInfoForm.setFieldsValue(pick(this.model.common, 'prcName', 'dueTime', 'prcMes'))
// 初始化流程审批信息,草稿进来的才回显审批信息
if (type === 'draft') {
this.approvalInfoForm.setFieldsValue(pick(this.model.common, 'commitText', 'commitFile'))
}
})
// 初始化流程信息
this.processInfoForm.setFieldsValue(pick(this.model.common, 'prcName', 'dueTime', 'prcMes'))
// 初始化流程审批信息,草稿进来的才回显审批信息
if (type === 'draft') {
this.approvalInfoForm.setFieldsValue(pick(this.model.common, 'commitText', 'commitFile'))
}
// this.$nextTick(() => {
//
// })
// 初始化业务基本信息的申请类型和项目类别,分开赋值是因为项目类别会没有下拉数据无法回显
const baseInfoForm = {}
baseInfoForm.applicationCategory = this.model.dataList[0].applicationCategory
@@ -581,6 +589,9 @@ export default {
}
this.$refs.changeBaseInfo.formInline = param
})
// 回显部分节点选人
this.userFormModel = Object.assign({}, this.model.dataList[0])
this.userForm.setFieldsValue(pick(this.model.dataList[0], 'newMainDraftUserLeader', 'relatedUser'))
})
}
} else {
@@ -620,6 +631,10 @@ export default {
}
}
},
// 选择用户得到用户名
userSelectNameChange (value, fieldName) {
this.userFormModel[fieldName + '_dictText'] = value
},
// 业务基本信息组件中获取到流程名称改变后的值
processNameChange (value) {
const param = { prcName: value }
@@ -688,7 +703,7 @@ export default {
this.$message.warning(this.$t('pleaseFillInAtLeastOneItem'))
return
}
arr.push({ ...ruleForm, ...dutyDepartChangeForm })
arr.push({ ...ruleForm, ...dutyDepartChangeForm, ...userInfoForm })
} else if (this.formInline.projectType === ProjectType.MERGE.value) {
// 业务基本信息-变更-合并
const mergeForm = this.$refs.changeBaseInfo.formInline
@@ -354,15 +354,6 @@ export default {
width: 50%;
}
.form-flex-item-line {
width: 100%;
}
.form-flex-item-long {
width: 100%;
padding: 0;
}
.box-title-text {
.title-text {
width: 200px;
@@ -371,4 +362,12 @@ export default {
width: clac(100% - 220px)
}
}
.form-flex-item-long {
width: 100%;
padding: 0;
.title-text {
width: 180px;
}
}
</style>
@@ -171,10 +171,10 @@ export default {
query: {
draftId: record.id, // 草稿id
projectId: record.projectId,
taskName: record.taskName,
taskName: record.nodeName,
taskId: record.taskId, // 任务id
processInstanceId: record.processInstanceId, // 流程实例id,必须传人员信息右侧表格查询需要用
nodeId: record.nodeId // 节点的id
nodeId: record.nodeId // 节点的id,
}
})
}