|
@@ -11,6 +11,9 @@
|
|
|
ref="form"
|
|
|
:businessId="businessId"
|
|
|
:is="form"
|
|
|
+ :status="status"
|
|
|
+ @callBackFunc="callBackFunc"
|
|
|
+ @changeLoading="changeLoading"
|
|
|
></component>
|
|
|
|
|
|
<PreviewForm
|
|
@@ -46,26 +49,87 @@
|
|
|
<el-tab-pane label="流转记录" v-if="procInsId" name="form-forth">
|
|
|
<flow-step :historicTaskList="historicTaskList" />
|
|
|
</el-tab-pane>
|
|
|
+ <el-tab-pane label="入库修改历史" v-if="commonJS.isNotEmpty(wareHouseId)" name="form-sixth">
|
|
|
+ <vxe-table
|
|
|
+ ref="wareHouseTable"
|
|
|
+ border="inner"
|
|
|
+ size="small"
|
|
|
+ :key="222"
|
|
|
+ max-height="1000px"
|
|
|
+ class="vxe-table-element"
|
|
|
+ :data="dataListHi">
|
|
|
+ <vxe-column type="seq" width="60" title="序号"></vxe-column>
|
|
|
+ <vxe-column min-width="120" align="center" title="修改类型" field="updateTradeType">
|
|
|
+ <template #default="scope">
|
|
|
+ <span v-if="commonJS.isNotEmpty(scope.row.updateTradeType)"> {{scope.row.updateTradeType}} </span>
|
|
|
+ <span v-else> -- </span>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column min-width="160" align="center" title="修改商品" field="updateTradeName">
|
|
|
+ <template #default="scope">
|
|
|
+ <span v-if="commonJS.isNotEmpty(scope.row.updateTradeName)"> {{scope.row.updateTradeName}} </span>
|
|
|
+ <span v-else> -- </span>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column min-width="160" align="center" title="修改人" field="updateUser">
|
|
|
+ <template #default="scope">
|
|
|
+ <span v-if="scope.row.endflag === '2'">(创建人) {{scope.row.updateUser}} </span>
|
|
|
+ <span v-else>{{scope.row.updateUser}} </span>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column min-width="160" align="center" title="修改时间" field="createDate"></vxe-column>
|
|
|
+ <vxe-column title="操作" width="150px" fixed="right" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button type="text" size="small" @click="hiDetail(scope.row)">修改详情</el-button>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ </vxe-table>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="领用退回历史" v-if="returnId" name="form-seventh">
|
|
|
+ <vxe-table
|
|
|
+ ref="returnTable"
|
|
|
+ border="inner"
|
|
|
+ :key="111"
|
|
|
+ size="small"
|
|
|
+ class="vxe-table-element"
|
|
|
+ max-height="1000px"
|
|
|
+ :data="dataListHiCollect">
|
|
|
+ <vxe-column type="seq" width="60" title="序号"></vxe-column>
|
|
|
+ <vxe-column min-width="160" align="center" title="退回物品" field="returnGoods">
|
|
|
+ <template #default="scope">
|
|
|
+ <span v-if="commonJS.isNotEmpty(scope.row.returnGoods)"> {{scope.row.returnGoods}} </span>
|
|
|
+ <span v-else> -- </span>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column min-width="160" align="center" title="退回申请人" field="returnUserName"></vxe-column>
|
|
|
+ <vxe-column min-width="160" align="center" title="退回时间" field="createDate"></vxe-column>
|
|
|
+ <vxe-column title="操作" width="150px" fixed="right" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button type="text" size="small" @click="hiDetailCollect(scope.row)">退回详情</el-button>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ </vxe-table>
|
|
|
+ </el-tab-pane>
|
|
|
</el-tabs>
|
|
|
|
|
|
<el-card
|
|
|
style="margin-top: 10px; padding-bottom: 66px"
|
|
|
v-if="!procInsId || taskId"
|
|
|
>
|
|
|
- <el-form :model="auditForm" ref="auditForm" label-width="120px">
|
|
|
+ <el-form :model="auditForm" ref="auditForm" v-loading="loading" label-width="120px">
|
|
|
<el-row>
|
|
|
<el-col :span="16">
|
|
|
- <el-form-item
|
|
|
- v-if="!procInsId"
|
|
|
- label="流程标题"
|
|
|
- prop="title"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- placeholder="请输入流程标题"
|
|
|
- v-model="title"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
+<!-- <el-form-item-->
|
|
|
+<!-- v-if="!procInsId"-->
|
|
|
+<!-- label="流程标题"-->
|
|
|
+<!-- prop="title"-->
|
|
|
+<!-- >-->
|
|
|
+<!-- <el-input-->
|
|
|
+<!-- placeholder="请输入流程标题"-->
|
|
|
+<!-- v-model="title"-->
|
|
|
+<!-- >-->
|
|
|
+<!-- </el-input>-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
<el-form-item
|
|
|
v-if="taskId"
|
|
|
label="审批信息"
|
|
@@ -137,19 +201,25 @@
|
|
|
<template v-for="(button, index) in buttons">
|
|
|
<template v-if="button.isHide === '0'">
|
|
|
<el-button
|
|
|
+ size="large"
|
|
|
type="primary"
|
|
|
v-if="button.code !== '_flow_print'"
|
|
|
:key="index"
|
|
|
@click="submit(button, buttons)"
|
|
|
v-noMoreClick
|
|
|
+ v-loading="loading"
|
|
|
+ plain
|
|
|
>{{ button.name }}</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
+ size="large"
|
|
|
type="primary"
|
|
|
v-if="button.code === '_flow_print'"
|
|
|
@click="print"
|
|
|
:key="index"
|
|
|
v-noMoreClick
|
|
|
+ v-loading="loading"
|
|
|
+ plain
|
|
|
>{{ button.name }}</el-button
|
|
|
>
|
|
|
</template>
|
|
@@ -191,6 +261,7 @@ import formService from "@/api/flowable/formService.js";
|
|
|
import flowCopyService from "@/api/flowable/flowCopyService.js";
|
|
|
import processService from "@/api/flowable/processService.js";
|
|
|
import print2 from "@/utils/print.js";
|
|
|
+import { shallowRef } from 'vue'
|
|
|
export default {
|
|
|
activated() {
|
|
|
this.init();
|
|
@@ -204,7 +275,7 @@ export default {
|
|
|
Object.keys(modules).forEach((path) => {
|
|
|
const dir = path.split("views")[1].split(".vue")[0];
|
|
|
if (dir === this.formUrl) {
|
|
|
- this.form = modules[path].default;
|
|
|
+ this.form = shallowRef(modules[path].default);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -234,8 +305,27 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
// 读取按钮配置
|
|
|
+ // 先清除缓存按钮
|
|
|
+ this.buttons = null
|
|
|
if (this.status === "start") {
|
|
|
this.buttons = [{ code: "_flow_start", name: "启动", isHide: "0" }];
|
|
|
+ }else if (this.status === 'startAndClose') { // 送审、关闭
|
|
|
+ this.buttons = [{code: '_flow_start', name: '送审', isHide: '0'}, {code: '_flow_close', name: '关闭', isHide: '0'}]
|
|
|
+ } else if (this.status === 'reapplyFlag') { // 重新申请、流程终止、关闭
|
|
|
+ this.buttons = [{code: '_flow_reapply', name: '重新申请', isHide: '0'}, {code: '_flow_stop', name: '流程终止', isHide: '0'}, {code: '_flow_close', name: '关闭', isHide: '0'}]
|
|
|
+ } else if (this.status === 'startAndHold') { // 送审、暂存、关闭
|
|
|
+ this.buttons = [{code: '_flow_start', name: '送审', isHide: '0'}, {code: '_flow_save', name: '暂存', isHide: '0'}, {code: '_flow_close', name: '关闭', isHide: '0'}]
|
|
|
+ } else if (this.status === 'startAndCloseFiled') { // 送审、关闭
|
|
|
+ this.buttons = [{code: '_flow_start', name: '送审', isHide: '0'}, {code: '_flow_close', name: '关闭', isHide: '0'}]
|
|
|
+ } else if (this.status === 'startAndHoldFiled') { // 送审、暂存、关闭
|
|
|
+ this.buttons = [{code: '_flow_start', name: '送审', isHide: '0'}, {code: '_flow_save', name: '暂存', isHide: '0'}, {code: '_flow_close', name: '关闭', isHide: '0'}]
|
|
|
+ } else if (this.status === 'startAndCloseBorrow') {
|
|
|
+ this.buttons = [{code: '_flow_start', name: '送审', isHide: '0'}, {code: '_flow_close', name: '关闭', isHide: '0'}]
|
|
|
+ } else if (this.status === 'reback') {
|
|
|
+ this.buttons = [{code: '_flow_reback', name: '撤回', isHide: '0'}]
|
|
|
+ } else if (this.status === 'agreeAndReject') {
|
|
|
+ this.buttons = [{code: '_flow_agree', name: '同意', isHide: '0'}, {code: '_flow_reject', name: '驳回', isHide: '0'}]
|
|
|
+ this.status = 'audit'
|
|
|
} else if (this.procDefKey && this.taskDefKey) {
|
|
|
// 读取按钮
|
|
|
taskDefExtensionService
|
|
@@ -244,6 +334,11 @@ export default {
|
|
|
taskDefId: this.taskDefKey,
|
|
|
})
|
|
|
.then((data) => {
|
|
|
+ data.flowButtonList.forEach(item => {
|
|
|
+ if (item.code === '_flow_agree') {
|
|
|
+ this.status = 'audit'
|
|
|
+ }
|
|
|
+ })
|
|
|
this.buttons = data.flowButtonList;
|
|
|
});
|
|
|
}
|
|
@@ -279,6 +374,10 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ changeBusiness () {
|
|
|
+ this.$refs.form.close()
|
|
|
+ this.businessId = 'false'
|
|
|
+ },
|
|
|
init() {
|
|
|
this.taskSelectedTab = "form-first";
|
|
|
this.procDefId = this.$route.query.procDefId;
|
|
@@ -301,6 +400,31 @@ export default {
|
|
|
this.auditForm.assignee = null;
|
|
|
this.auditForm.userIds = null;
|
|
|
this.auditForm.message = "";
|
|
|
+ this.cUser = this.commonJS.isEmpty(this.$route.query.cUser) ? false : this.$route.query.cUser
|
|
|
+ this.contractTitle = this.$route.query.contractTitle
|
|
|
+ this.statusFlag = this.$route.query.statusFlag
|
|
|
+ this.wareHouseId = this.$route.query.wareHouseId
|
|
|
+ this.returnId = this.$route.query.returnId
|
|
|
+ if (this.commonJS.isEmpty(this.$route.query.isShow)) {
|
|
|
+ this.isShow = 'true'
|
|
|
+ } else {
|
|
|
+ this.isShow = this.$route.query.isShow
|
|
|
+ }
|
|
|
+ let _this = this
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // try {
|
|
|
+ // _this.$refs.form.getKeyWatch(Math.random().toString())
|
|
|
+ // } catch (e) {
|
|
|
+ // console.log(e)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ setTimeout(function () {
|
|
|
+ try {
|
|
|
+ _this.$refs.form.getKeyWatch(Math.random().toString())
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e)
|
|
|
+ }
|
|
|
+ }, 500)
|
|
|
},
|
|
|
cc(procInsId) {
|
|
|
if (this.isCC && this.auditForm.userIds) {
|
|
@@ -319,7 +443,21 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 暂存草稿
|
|
|
- save() {},
|
|
|
+ save() {
|
|
|
+ if (this.formType === '2') { // 外置表单
|
|
|
+ this.$refs.form.saveForm(() => {
|
|
|
+ this.$message.success('操作成功')
|
|
|
+ this.changeBusiness()
|
|
|
+ useTabs.close()
|
|
|
+ if (!this.commonJS.isEmpty(this.$route.query.routePath)) {
|
|
|
+ this.$router.push({path: this.$route.query.routePath})
|
|
|
+ } else {
|
|
|
+ this.$router.push({path: '/flowable/task/TodoList'})
|
|
|
+ }
|
|
|
+ // this.$router.push({path: this.$route.query.routePath})
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
print() {
|
|
|
//直接传入REF或者querySelector
|
|
|
print2(this.$refs.form);
|
|
@@ -328,22 +466,44 @@ export default {
|
|
|
start(vars) {
|
|
|
if (this.formType === "2") {
|
|
|
// 外置表单
|
|
|
- this.$refs.form.saveForm(
|
|
|
+ this.$refs.form.startForm(
|
|
|
(businessTable, businessId, inputForm) => {
|
|
|
- vars = { ...vars, ...inputForm };
|
|
|
+ vars = { ...vars, ...inputForm }
|
|
|
+ if (inputForm.procDefId) {
|
|
|
+ this.procDefId = inputForm.procDefId
|
|
|
+ }
|
|
|
+ if (inputForm.procDefKey) {
|
|
|
+ this.procDefId = inputForm.procDefKey
|
|
|
+ }
|
|
|
+ if (inputForm.title) {
|
|
|
+ this.title = inputForm.title
|
|
|
+ }
|
|
|
+ if (inputForm.formTitle) {
|
|
|
+ this.formTitle = inputForm.formTitle
|
|
|
+ }
|
|
|
+ let assignee = this.auditForm.assignee
|
|
|
+ if (!this.commonJS.isEmpty(inputForm.assignee)) {
|
|
|
+ assignee = inputForm.assignee
|
|
|
+ }
|
|
|
taskService
|
|
|
.start({
|
|
|
+ procDefId: this.procDefId,
|
|
|
procDefKey: this.procDefKey,
|
|
|
businessTable: businessTable,
|
|
|
businessId: businessId,
|
|
|
...vars,
|
|
|
title: this.title,
|
|
|
- assignee: this.auditForm.assignee,
|
|
|
+ assignee: assignee,
|
|
|
})
|
|
|
.then((data) => {
|
|
|
this.$message.success("启动成功");
|
|
|
+ this.changeBusiness()
|
|
|
useTabs.close();
|
|
|
- this.$router.push("/flowable/task/TodoList");
|
|
|
+ if (!this.commonJS.isEmpty(this.$route.query.routePath)) {
|
|
|
+ this.$router.push({path: this.$route.query.routePath})
|
|
|
+ } else {
|
|
|
+ this.$router.push({path: '/flowable/task/TodoList'})
|
|
|
+ }
|
|
|
this.cc(data);
|
|
|
});
|
|
|
}
|
|
@@ -358,33 +518,315 @@ export default {
|
|
|
assignee: this.auditForm.assignee,
|
|
|
},
|
|
|
(data) => {
|
|
|
+ this.changeBusiness()
|
|
|
useTabs.close();
|
|
|
- this.$router.push("/flowable/task/TodoList");
|
|
|
+ if (!this.commonJS.isEmpty(this.$route.query.routePath)) {
|
|
|
+ this.$router.push({path: this.$route.query.routePath})
|
|
|
+ } else {
|
|
|
+ this.$router.push({path: '/flowable/task/TodoList'})
|
|
|
+ }
|
|
|
this.cc(data);
|
|
|
}
|
|
|
);
|
|
|
}
|
|
|
},
|
|
|
// 同意
|
|
|
- agree() {
|
|
|
- this.commit(); // 同意
|
|
|
+ agree(vars) {
|
|
|
+ vars = {...vars, agree: true}
|
|
|
+ if (this.formType === '2') {
|
|
|
+ this.commit(vars)
|
|
|
+ }
|
|
|
},
|
|
|
+ // 重新申请
|
|
|
+ reapply (vars) {
|
|
|
+ vars = {...vars, agree: true}
|
|
|
+ if (this.formType === '2') { // 外置表单
|
|
|
+ let param = {
|
|
|
+ num: this.$route.query.num,
|
|
|
+ taskId: this.taskId,
|
|
|
+ taskDefKey: this.taskDefKey,
|
|
|
+ procInsId: this.procInsId,
|
|
|
+ procDefId: this.procDefId,
|
|
|
+ vars: vars,
|
|
|
+ comment: this.auditForm,
|
|
|
+ assignee: this.auditForm.assignee,
|
|
|
+ cope: {
|
|
|
+ userIds: this.auditForm.userIds,
|
|
|
+ procDefId: this.procDefId,
|
|
|
+ procInsId: '',
|
|
|
+ procDefName: '',
|
|
|
+ procInsName: this.title,
|
|
|
+ taskName: ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$refs.form.reapplyForm((businessTable, businessId, inputForm) => {
|
|
|
+ vars = {...vars, ...inputForm}
|
|
|
+ if (inputForm.procDefId) {
|
|
|
+ param.procDefId = inputForm.procDefId
|
|
|
+ }
|
|
|
+ let assignee = this.auditForm.assignee
|
|
|
+ if (!this.commonJS.isEmpty(inputForm.assignee)) {
|
|
|
+ assignee = inputForm.assignee
|
|
|
+ }
|
|
|
+ taskService.audit({
|
|
|
+ taskId: this.taskId,
|
|
|
+ taskDefKey: this.taskDefKey,
|
|
|
+ procInsId: this.procInsId,
|
|
|
+ procDefId: this.procDefId,
|
|
|
+ vars: vars,
|
|
|
+ comment: this.auditForm,
|
|
|
+ assignee: assignee
|
|
|
+ }).then((data) => {
|
|
|
+ this.$message.success('提交成功')
|
|
|
+ this.changeBusiness()
|
|
|
+ this.$refs.form.close()
|
|
|
+ // 我的通知
|
|
|
+ let createDate = ''
|
|
|
+ this.myNotice(data, this.procDefId, this.title, vars.userName, createDate)
|
|
|
+ useTabs.close()
|
|
|
+ // this.$router.push({path: '/flowable/task/TodoList'})
|
|
|
+ // this.cc(data)
|
|
|
+ if (this.$route.query.routePath) {
|
|
|
+ this.$router.push({path: this.$route.query.routePath})
|
|
|
+ } else {
|
|
|
+ var num = this.$route.query.num
|
|
|
+ if (num === '2') {
|
|
|
+ this.$router.push({path: '/sys/dashboard/workBench/Pending'})
|
|
|
+ this.cc(data)
|
|
|
+ } else if (num === '3') {
|
|
|
+ this.$router.push({path: '/sys/dashboard/workBench/PendingList'})
|
|
|
+ this.cc(data)
|
|
|
+ } else {
|
|
|
+ this.$router.push({path: '/flowable/task/TodoList'})
|
|
|
+ this.cc(data)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }, param)
|
|
|
+ } else { // 动态表单
|
|
|
+ this.$refs.form.submitTaskFormData(vars, this.procInsId, this.taskId, this.auditForm.assignee, this.auditForm, (data) => {
|
|
|
+ this.changeBusiness()
|
|
|
+ this.$refs.form.close()
|
|
|
+ useTabs.close()
|
|
|
+ // this.$router.push({path: '/flowable/task/TodoList'})
|
|
|
+ // this.cc(data)
|
|
|
+ if (this.$route.query.routePath) {
|
|
|
+ this.$router.push({path: this.$route.query.routePath})
|
|
|
+ } else {
|
|
|
+ var num = this.$route.query.num
|
|
|
+ if (num === '2') {
|
|
|
+ this.$router.push({path: '/sys/dashboard/workBench/Pending'})
|
|
|
+ this.cc(data)
|
|
|
+ } else if (num === '3') {
|
|
|
+ this.$router.push({path: '/sys/dashboard/workBench/PendingList'})
|
|
|
+ this.cc(data)
|
|
|
+ } else {
|
|
|
+ this.$router.push({path: '/flowable/task/TodoList'})
|
|
|
+ this.cc(data)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // Process_1667978088459 客户修改
|
|
|
+ // Process_1668394732246 项目登记
|
|
|
+ // Process_1668503117077 报告质控管理员审核
|
|
|
+ // Process_1669014216650 报告签章-公章
|
|
|
+ // Process_1669087010742 报告签章-公章+执业章
|
|
|
+ // Process_1668677901585 项目报告归档
|
|
|
+ // Process_1670486210438 报告复核
|
|
|
+ // Process_1668759076824 报告作废申请
|
|
|
+ // Process_1670548572652 报告作废归档
|
|
|
+ // Process_1669700915383 合同登记纸质归档
|
|
|
+ // Process_1669271524486 报销审批
|
|
|
+ // Process_1669275081328 发票申请
|
|
|
+ // Process_1669275380218 发票作废
|
|
|
+ // Process_1672738002595 发起通知
|
|
|
+ // Process_1662628133027 评估-合同登记新建
|
|
|
+ // Process_1663743217785 评估-合同登记归档
|
|
|
+ // Process_1664370362499 评估-项目登记流程
|
|
|
+ // Process_1666169509264 评估-项目一级校审
|
|
|
+ // Process_1666266316011 评估-项目二级校审
|
|
|
+ // Process_1666266494837 评估-项目三级校审
|
|
|
+ // Process_1666331430821 评估-报告签发审批
|
|
|
+ // Process_1666332258192 评估-项目登记归档
|
|
|
+ // Process_1665383385070 评估-报销申请
|
|
|
+ // Process_1665628043339 评估-发票作废
|
|
|
+ // Process_1665458731435 评估-发票申请
|
|
|
+ // Process_1669961023358 物资管理-采购申请
|
|
|
+ // Process_1672729521837 物资管理-领用申请 Process_1673513775015
|
|
|
+ // Process_1673332958749 财务-报告签章-实体章 Process_1673513595904
|
|
|
+ // Process_1673514092406 物资管理-入库修改
|
|
|
+ // Process_1673600899831 物资管理-合同
|
|
|
+ // Process_1673924346231 中审-报销审批
|
|
|
+ // Process_1667894339167 会计-合同登记
|
|
|
+ // Process_1678692643340 会计-项目报告归档-苏州分部
|
|
|
+ // Process_1683767097901 物资管理-领用退回申请
|
|
|
// 驳回
|
|
|
- reject() {
|
|
|
- this.$confirm(`确定驳回流程吗?`, "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
+ reject(vars) {
|
|
|
+ if (this.procDefId.includes('Process_1667978088459') ||
|
|
|
+ this.procDefId.includes('Process_1668394732246') ||
|
|
|
+ this.procDefId.includes('Process_1668503117077') ||
|
|
|
+ this.procDefId.includes('Process_1669014216650') ||
|
|
|
+ this.procDefId.includes('Process_1669087010742') ||
|
|
|
+ this.procDefId.includes('Process_1668677901585') ||
|
|
|
+ this.procDefId.includes('Process_1670486210438') ||
|
|
|
+ this.procDefId.includes('Process_1668759076824') ||
|
|
|
+ this.procDefId.includes('Process_1670548572652') ||
|
|
|
+ this.procDefId.includes('Process_1669700915383') ||
|
|
|
+ this.procDefId.includes('Process_1669271524486') ||
|
|
|
+ this.procDefId.includes('Process_1669275081328') ||
|
|
|
+ this.procDefId.includes('Process_1669275380218') ||
|
|
|
+ this.procDefId.includes('Process_1672738002595') ||
|
|
|
+ this.procDefId.includes('Process_1662628133027') ||
|
|
|
+ this.procDefId.includes('Process_1663743217785') ||
|
|
|
+ this.procDefId.includes('Process_1664370362499') ||
|
|
|
+ this.procDefId.includes('Process_1666169509264') ||
|
|
|
+ this.procDefId.includes('Process_1666266316011') ||
|
|
|
+ this.procDefId.includes('Process_1666266494837') ||
|
|
|
+ this.procDefId.includes('Process_1666331430821') ||
|
|
|
+ this.procDefId.includes('Process_1666332258192') ||
|
|
|
+ this.procDefId.includes('Process_1665383385070') ||
|
|
|
+ this.procDefId.includes('Process_1665628043339') ||
|
|
|
+ this.procDefId.includes('Process_1665458731435') ||
|
|
|
+ this.procDefId.includes('Process_1669961023358') ||
|
|
|
+ this.procDefId.includes('Process_1673513775015') ||
|
|
|
+ this.procDefId.includes('Process_1673513595904') ||
|
|
|
+ this.procDefId.includes('Process_1673514092406') ||
|
|
|
+ this.procDefId.includes('Process_1673600899831') ||
|
|
|
+ this.procDefId.includes('Process_1673924346231') ||
|
|
|
+ this.procDefId.includes('Process_1667894339167') ||
|
|
|
+ this.procDefId.includes('Process_1678692643340') ||
|
|
|
+ this.procDefId.includes('Process_1683767097901')
|
|
|
+ ) {
|
|
|
+ console.log('进入新版驳回')
|
|
|
+ this.$confirm(`确定驳回流程吗?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(async () => {
|
|
|
+ if (this.formType === '2') {
|
|
|
+ vars = {...vars, agree: false}
|
|
|
+ // await this.commit(vars) // 驳回
|
|
|
+ this.$refs.form.updateStatusById('reject', () => {
|
|
|
+ console.log('333')
|
|
|
+ taskService.audit({
|
|
|
+ taskId: this.taskId,
|
|
|
+ taskDefKey: this.taskDefKey,
|
|
|
+ procInsId: this.procInsId,
|
|
|
+ procDefId: this.procDefId,
|
|
|
+ vars: vars,
|
|
|
+ comment: this.auditForm,
|
|
|
+ assignee: this.auditForm.assignee
|
|
|
+ }).then((data) => {
|
|
|
+ this.$message.success('提交成功')
|
|
|
+ this.changeBusiness()
|
|
|
+ this.$refs.form.close()
|
|
|
+ // 我的通知
|
|
|
+ let createDate = ''
|
|
|
+ this.myNotice(data, this.procDefId, this.title, vars.userName, createDate)
|
|
|
+ useTabs.close()
|
|
|
+ // this.$router.push({path: '/flowable/task/TodoList'})
|
|
|
+ // this.cc(data)
|
|
|
+ if (this.$route.query.routePath) {
|
|
|
+ this.$router.push({path: this.$route.query.routePath})
|
|
|
+ } else {
|
|
|
+ var num = this.$route.query.num
|
|
|
+ if (num === '2') {
|
|
|
+ this.$router.push({path: '/sys/dashboard/workBench/Pending'})
|
|
|
+ this.cc(data)
|
|
|
+ } else if (num === '3') {
|
|
|
+ this.$router.push({path: '/sys/dashboard/workBench/PendingList'})
|
|
|
+ this.cc(data)
|
|
|
+ } else {
|
|
|
+ this.$router.push({path: '/flowable/task/TodoList'})
|
|
|
+ this.cc(data)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ console.log('进入旧版驳回')
|
|
|
+ this.$confirm(`确定驳回流程吗?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(async () => {
|
|
|
+ if (this.formType === '2') {
|
|
|
+ if (this.cUser === true || this.cUser === 'true') { // cUser为true则页面审核人为自定义多选,驳回时要将审核人重新定义一次
|
|
|
+ await this.$refs.form.updateStatusById('reject', (businessTable, businessId, inputForm) => {
|
|
|
+ this.auditForm.candidateUserList = inputForm.assignee
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ taskService.backNodes(this.taskId).then((data) => {
|
|
|
+ let backNodes = data
|
|
|
+ if (backNodes.length > 0) {
|
|
|
+ let backTaskDefKey = backNodes[backNodes.length - 1].taskDefKey
|
|
|
+ this.back(backTaskDefKey)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }, 100)
|
|
|
+ } else {
|
|
|
+ await this.$refs.form.updateStatusById('reject')
|
|
|
+ taskService.backNodes(this.taskId).then((data) => {
|
|
|
+ let backNodes = data
|
|
|
+ if (backNodes.length > 0) {
|
|
|
+ let backTaskDefKey = backNodes[backNodes.length - 1].taskDefKey
|
|
|
+ this.back(backTaskDefKey)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 驳回至指定节点(节点是从0开始)
|
|
|
+ rejectToPointNum (num) {
|
|
|
+ this.$confirm(`确定驳回流程吗?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
}).then(() => {
|
|
|
taskService.backNodes(this.taskId).then((data) => {
|
|
|
- let backNodes = data;
|
|
|
+ let backNodes = data
|
|
|
+ if (backNodes.length > 0 && backNodes.length > num) {
|
|
|
+ let backTaskDefKey = backNodes[num].taskDefKey
|
|
|
+ this.back(backTaskDefKey)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ if (this.formType === '2') {
|
|
|
+ this.$refs.form.updateStatusById('reject')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 撤回
|
|
|
+ reback () {
|
|
|
+ this.$confirm(`确定撤回流程吗?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(async () => {
|
|
|
+ await this.$refs.form.updateStatusById('reback')
|
|
|
+ taskService.backNodes(this.taskId).then((data) => {
|
|
|
+ let backNodes = data
|
|
|
+ this.changeBusiness()
|
|
|
+ // this.$router.push({path: this.$route.query.routePath})
|
|
|
if (backNodes.length > 0) {
|
|
|
- let backTaskDefKey =
|
|
|
- backNodes[backNodes.length - 1].taskDefKey;
|
|
|
- this.back(backTaskDefKey);
|
|
|
+ let backTaskDefKey = backNodes[0].taskDefKey
|
|
|
+ this.back(backTaskDefKey)
|
|
|
+ } else {
|
|
|
+ useTabs.close()
|
|
|
+ if (!this.commonJS.isEmpty(this.$route.query.routePath)) {
|
|
|
+ this.$router.push({path: this.$route.query.routePath})
|
|
|
+ } else {
|
|
|
+ this.$router.push({path: '/flowable/task/TodoList'})
|
|
|
+ }
|
|
|
}
|
|
|
- });
|
|
|
- });
|
|
|
+ // this.$refs.form.close()
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
// 驳回到任意节点
|
|
|
turnBack() {
|
|
@@ -400,8 +842,16 @@ export default {
|
|
|
})
|
|
|
.then((data) => {
|
|
|
this.$message.success("回退成功");
|
|
|
+ this.changeBusiness()
|
|
|
useTabs.close();
|
|
|
- this.$router.push("/flowable/task/TodoList");
|
|
|
+ var num = this.$route.query.num
|
|
|
+ if (num === '2') {
|
|
|
+ this.$router.push({path: '/sys/dashboard/workBench/Pending'})
|
|
|
+ } else if (num === '3') {
|
|
|
+ this.$router.push({path: '/sys/dashboard/workBench/PendingList'})
|
|
|
+ } else {
|
|
|
+ this.$router.push({path: '/flowable/task/TodoList'})
|
|
|
+ }
|
|
|
this.cc(data);
|
|
|
});
|
|
|
},
|
|
@@ -435,7 +885,7 @@ export default {
|
|
|
selectUsersToTransferTask(user) {
|
|
|
taskService.transfer(this.taskId, user[0].id).then((data) => {
|
|
|
this.$message.success(data);
|
|
|
- this.$router.push("/flowable/task/TodoList");
|
|
|
+ this.$router.push({path: '/flowable/task/TodoList'});
|
|
|
});
|
|
|
},
|
|
|
// 委托
|
|
@@ -445,7 +895,7 @@ export default {
|
|
|
selectUsersToDelateTask(user) {
|
|
|
taskService.delegate(this.taskId, user[0].id).then((data) => {
|
|
|
this.$message.success(data);
|
|
|
- this.$router.push("/flowable/task/TodoList");
|
|
|
+ this.$router.push({path: '/flowable/task/TodoList'});
|
|
|
});
|
|
|
},
|
|
|
// 终止
|
|
@@ -455,22 +905,74 @@ export default {
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
|
}).then(() => {
|
|
|
- processService
|
|
|
- .stop(this.procInsId, this.auditForm.message)
|
|
|
- .then((data) => {
|
|
|
- this.$message.success(data);
|
|
|
- this.$router.push("/flowable/task/TodoList");
|
|
|
- });
|
|
|
+ // 将数据状态更改为暂存状态
|
|
|
+ this.$refs.form.updateStatusById('hold', () => {
|
|
|
+ // this.auditForm.candidateUserList = inputForm.assignee
|
|
|
+ processService.stop(this.procInsId, this.auditForm.message).then((data) => {
|
|
|
+ this.$message.success(data)
|
|
|
+ useTabs.close()
|
|
|
+ // this.cc(data)
|
|
|
+ if (this.$route.query.routePath) {
|
|
|
+ this.$router.push({path: this.$route.query.routePath})
|
|
|
+ } else {
|
|
|
+ var num = this.$route.query.num
|
|
|
+ if (num === '2') {
|
|
|
+ this.$router.push({path: '/sys/dashboard/workBench/Pending'})
|
|
|
+ this.cc(data)
|
|
|
+ } else if (num === '3') {
|
|
|
+ this.$router.push({path: '/sys/dashboard/workBench/PendingList'})
|
|
|
+ this.cc(data)
|
|
|
+ } else {
|
|
|
+ this.$router.push({path: '/flowable/task/TodoList'})
|
|
|
+ this.cc(data)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
});
|
|
|
},
|
|
|
+ // 关闭
|
|
|
+ close () {
|
|
|
+ this.changeBusiness()
|
|
|
+ useTabs.close()
|
|
|
+ console.log(this.$route.query)
|
|
|
+ if (!this.commonJS.isEmpty(this.$route.query.routePath)) {
|
|
|
+ this.$router.push({path: this.$route.query.routePath})
|
|
|
+ } else {
|
|
|
+ this.$router.push({path: '/flowable/task/TodoList'})
|
|
|
+ }
|
|
|
+ },
|
|
|
// 自定义按钮提交
|
|
|
commit(vars) {
|
|
|
if (this.formType === "2") {
|
|
|
// 外置表单
|
|
|
+ let param = {
|
|
|
+ num: this.$route.query.num,
|
|
|
+ taskId: this.taskId,
|
|
|
+ taskDefKey: this.taskDefKey,
|
|
|
+ procInsId: this.procInsId,
|
|
|
+ procDefId: this.procDefId,
|
|
|
+ vars: vars,
|
|
|
+ comment: this.auditForm,
|
|
|
+ assignee: this.auditForm.assignee,
|
|
|
+ cope: {
|
|
|
+ userIds: this.auditForm.userIds,
|
|
|
+ procDefId: this.procDefId,
|
|
|
+ procInsId: '',
|
|
|
+ procDefName: '',
|
|
|
+ procInsName: this.title,
|
|
|
+ taskName: ''
|
|
|
+ }
|
|
|
+ }
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
- this.$refs.form.saveForm(
|
|
|
+ this.$refs.form.agreeForm(
|
|
|
(businessTable, businessId, inputForm) => {
|
|
|
- vars = { ...vars, ...inputForm };
|
|
|
+ if (this.commonJS.isNotEmpty(inputForm)) {
|
|
|
+ if (this.commonJS.isNotEmpty(inputForm.assignee)) {
|
|
|
+ this.auditForm.assignee = inputForm.assignee
|
|
|
+ }
|
|
|
+ }
|
|
|
+ vars = { ...vars, ...inputForm }
|
|
|
taskService
|
|
|
.audit({
|
|
|
taskId: this.taskId,
|
|
@@ -484,10 +986,28 @@ export default {
|
|
|
.then((data) => {
|
|
|
this.$message.success("提交成功");
|
|
|
useTabs.close();
|
|
|
- this.$router.push("/flowable/task/TodoList");
|
|
|
- this.cc(data);
|
|
|
+ // 我的通知
|
|
|
+ let createDate = ''
|
|
|
+ this.myNotice(data, this.procDefId, this.title, vars.userName, createDate)
|
|
|
+ // this.$router.push({path: "/flowable/task/TodoList"});
|
|
|
+ // this.cc(data);
|
|
|
+ if (this.$route.query.routePath) {
|
|
|
+ this.$router.push({path: this.$route.query.routePath})
|
|
|
+ } else {
|
|
|
+ var num = this.$route.query.num
|
|
|
+ if (num === '2') {
|
|
|
+ this.$router.push({path: '/sys/dashboard/workBench/Pending'})
|
|
|
+ this.cc(data)
|
|
|
+ } else if (num === '3') {
|
|
|
+ this.$router.push({path: '/sys/dashboard/workBench/PendingList'})
|
|
|
+ this.cc(data)
|
|
|
+ } else {
|
|
|
+ this.$router.push({path: '/flowable/task/TodoList'})
|
|
|
+ this.cc(data)
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
- }
|
|
|
+ }, param
|
|
|
);
|
|
|
} else {
|
|
|
// 动态表单
|
|
@@ -498,9 +1018,25 @@ export default {
|
|
|
this.auditForm.assignee,
|
|
|
this.auditForm,
|
|
|
(data) => {
|
|
|
+ this.changeBusiness()
|
|
|
useTabs.close();
|
|
|
- this.$router.push("/flowable/task/TodoList");
|
|
|
- this.cc(data);
|
|
|
+ // this.$router.push({path: "/flowable/task/TodoList"});
|
|
|
+ // this.cc(data);
|
|
|
+ if (this.$route.query.routePath) {
|
|
|
+ this.$router.push({path: this.$route.query.routePath})
|
|
|
+ } else {
|
|
|
+ var num = this.$route.query.num
|
|
|
+ if (num === '2') {
|
|
|
+ this.$router.push({path: '/sys/dashboard/workBench/Pending'})
|
|
|
+ this.cc(data)
|
|
|
+ } else if (num === '3') {
|
|
|
+ this.$router.push({path: '/sys/dashboard/workBench/PendingList'})
|
|
|
+ this.cc(data)
|
|
|
+ } else {
|
|
|
+ this.$router.push({path: '/flowable/task/TodoList'})
|
|
|
+ this.cc(data)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
);
|
|
|
}
|
|
@@ -556,10 +1092,125 @@ export default {
|
|
|
case "_flow_print": // 打印
|
|
|
this.print();
|
|
|
break;
|
|
|
+ case '_flow_reapply':// 重新申请
|
|
|
+ this.reapply()
|
|
|
+ break
|
|
|
+ case '_flow_close':// 关闭
|
|
|
+ this.close()
|
|
|
+ break
|
|
|
+ case '_flow_reback':// 撤回
|
|
|
+ this.reback()
|
|
|
+ break
|
|
|
default:
|
|
|
this.commit(vars); // 自定义按钮提交
|
|
|
}
|
|
|
},
|
|
|
+ myNotice (taskId, proDefId, title, userName, createDate) {
|
|
|
+ this.inputForm = {
|
|
|
+ taskId: '',
|
|
|
+ title: '',
|
|
|
+ defId: '',
|
|
|
+ taskName: '',
|
|
|
+ createUser: '',
|
|
|
+ createTime: '',
|
|
|
+ noticeName: '',
|
|
|
+ noticeId: ''
|
|
|
+ }
|
|
|
+ taskService.historicTaskList(taskId).then((data) => {
|
|
|
+ if (data[data.length - 1].comment.status === '结束') {
|
|
|
+ this.inputForm.taskId = taskId
|
|
|
+ // 实例标题
|
|
|
+ this.inputForm.title = title
|
|
|
+ // 流程id
|
|
|
+ this.inputForm.defId = proDefId
|
|
|
+ // 流程名称
|
|
|
+ processService.getById(proDefId).then((data) => {
|
|
|
+ this.inputForm.taskName = data.name
|
|
|
+ })
|
|
|
+ // 流程发起人
|
|
|
+ this.inputForm.createUser = data[0].assigneeName
|
|
|
+ // 创建时间
|
|
|
+ this.inputForm.createTime = data[0].histIns.endTime
|
|
|
+ // 通知人
|
|
|
+ this.inputForm.noticeName = data[0].assigneeName
|
|
|
+ // 通知人Id
|
|
|
+ this.inputForm.noticeId = data[0].assigneeId
|
|
|
+ noticeService.addInfo(this.inputForm)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ callBackFunc (type) {
|
|
|
+ // 隐藏同意按钮
|
|
|
+ if (type === 'hide') {
|
|
|
+ // 读取按钮
|
|
|
+ taskDefExtensionService.queryByDefIdAndTaskId({
|
|
|
+ processDefId: this.procDefKey,
|
|
|
+ taskDefId: this.taskDefKey
|
|
|
+ }).then((data) => {
|
|
|
+ // console.log('buttons', data)
|
|
|
+ data.flowButtonList.forEach(item => {
|
|
|
+ if (item.code === '_flow_agree') {
|
|
|
+ item.isHide = '1'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.buttons = data.flowButtonList
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 展示同意按钮
|
|
|
+ if (type === 'show') {
|
|
|
+ // 读取按钮
|
|
|
+ taskDefExtensionService.queryByDefIdAndTaskId({
|
|
|
+ processDefId: this.procDefKey,
|
|
|
+ taskDefId: this.taskDefKey
|
|
|
+ }).then((data) => {
|
|
|
+ // console.log('buttons', data)
|
|
|
+ data.flowButtonList.forEach(item => {
|
|
|
+ if (item.code === '_flow_agree') {
|
|
|
+ item.isHide = '0'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.buttons = data.flowButtonList
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 开启/关闭taskForm页面的加载中状态
|
|
|
+ changeLoading (loading) {
|
|
|
+ if (this.commonJS.isNotEmpty(loading)) {
|
|
|
+ this.loading = loading
|
|
|
+ } else {
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onTabChange (event) {
|
|
|
+ if (event.name === 'form-sixth') {
|
|
|
+ if (this.commonJS.isNotEmpty(this.wareHouseId)) {
|
|
|
+ this.wareHouseService.findHiById(this.wareHouseId).then((data) => {
|
|
|
+ this.dataListHi = data
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (event.name === 'form-seventh') {
|
|
|
+ if (this.commonJS.isNotEmpty(this.returnId)) {
|
|
|
+ this.collectService.findByReturnId(this.returnId).then((data) => {
|
|
|
+ this.collectService.findHiById(data.id).then((data) => {
|
|
|
+ this.dataListHiCollect = data
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 打开入库修改历史详情页
|
|
|
+ hiDetail (row) {
|
|
|
+ if (this.commonJS.isNotEmpty(row.id)) {
|
|
|
+ this.$refs.wareHouseHi.init(row.id)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 打开领用退回历史详情页
|
|
|
+ hiDetailCollect (row) {
|
|
|
+ if (this.commonJS.isNotEmpty(row.id)) {
|
|
|
+ this.$refs.collectReturnHi.init(row.id)
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -581,6 +1232,7 @@ export default {
|
|
|
buttons: [],
|
|
|
isCC: false,
|
|
|
isAssign: false,
|
|
|
+ isShow: true,
|
|
|
printObj: {
|
|
|
id: "printForm",
|
|
|
popTitle: "",
|
|
@@ -595,6 +1247,12 @@ export default {
|
|
|
userIds: null,
|
|
|
assignee: null,
|
|
|
},
|
|
|
+ cUser: false,
|
|
|
+ loading: false,
|
|
|
+ wareHouseId: '',
|
|
|
+ returnId: '',
|
|
|
+ dataListHi: [],
|
|
|
+ dataListHiCollect: []
|
|
|
};
|
|
|
},
|
|
|
};
|