|
|
@@ -4,15 +4,15 @@
|
|
|
<div slot="header" class="clearfix">
|
|
|
<span class="el-icon-document">待办任务</span>
|
|
|
<el-tag style="margin-left:10px">发起人:{{ startUser }}</el-tag>
|
|
|
- <el-tag>任务节点:{{ taskName }}</el-tag>
|
|
|
+ <el-tag>任务节点:{{ taskName }}||{{ taskDefKey }}</el-tag>
|
|
|
<el-button style="float: right;" size="mini" type="danger" @click="goBack">关闭</el-button>
|
|
|
</div>
|
|
|
<el-tabs tab-position="top" v-model="activeName" @tab-click="handleClick">
|
|
|
<!--表单信息-->
|
|
|
<el-tab-pane label="表单信息" name="1">
|
|
|
<el-col :span="16" :offset="4">
|
|
|
- <div class="test-form">
|
|
|
- <!-- <parser :key="new Date().getTime()" :form-conf="variablesData"/>-->
|
|
|
+<!-- <div class="test-form">
|
|
|
+ <!– <parser :key="new Date().getTime()" :form-conf="variablesData"/>–>
|
|
|
<parser :key="new Date().getTime()" :form-conf="variablesData" @submit="submitForm" ref="parser"/>
|
|
|
|
|
|
</div>
|
|
|
@@ -20,11 +20,24 @@
|
|
|
<el-button v-if="!formKeyExist" icon="el-icon-edit-outline" type="success" size="mini"
|
|
|
@click="handleComplete">审批
|
|
|
</el-button>
|
|
|
- <!-- <el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleDelegate">委派</el-button>-->
|
|
|
- <!-- <el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleAssign">转办</el-button>-->
|
|
|
- <!-- <el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleDelegate">签收</el-button>-->
|
|
|
- <!-- <el-button icon="el-icon-refresh-left" type="warning" size="mini" @click="handleReturn">退回</el-button>-->
|
|
|
- <!-- <el-button icon="el-icon-circle-close" type="danger" size="mini" @click="handleReject">驳回</el-button>-->
|
|
|
+ <!– <el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleDelegate">委派</el-button>–>
|
|
|
+ <!– <el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleAssign">转办</el-button>–>
|
|
|
+ <!– <el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleDelegate">签收</el-button>–>
|
|
|
+ <!– <el-button icon="el-icon-refresh-left" type="warning" size="mini" @click="handleReturn">退回</el-button>–>
|
|
|
+ <!– <el-button icon="el-icon-circle-close" type="danger" size="mini" @click="handleReject">驳回</el-button>–>
|
|
|
+ </div>-->
|
|
|
+ <v-form-render ref="vFormRef"/>
|
|
|
+ <div style="margin-left:10%;margin-bottom: 20px;font-size: 14px;">
|
|
|
+ <!-- taskDefKey 为“暂存”时显示提交、关闭 -->
|
|
|
+ <template v-if="taskDefKey === 'modifyApply'||taskDefKey === 'Activity_0iaxnuk'">
|
|
|
+ <el-button type="primary" @click="handleComplete(true)">提交</el-button>
|
|
|
+ <el-button type="primary" @click="handleComplete(false)">关闭</el-button>
|
|
|
+ </template>
|
|
|
+ <!-- taskDefKey 不为“暂存”时显示审批、驳回 -->
|
|
|
+ <template v-else>
|
|
|
+ <el-button type="primary" @click="handleComplete(true)">审批</el-button>
|
|
|
+ <el-button type="primary" @click="handleComplete(false)">驳回</el-button>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-tab-pane>
|
|
|
@@ -167,6 +180,7 @@ export default {
|
|
|
props: {},
|
|
|
data() {
|
|
|
return {
|
|
|
+ eventName: "click",
|
|
|
// 模型xml数据
|
|
|
xmlData: "",
|
|
|
flowData: {},
|
|
|
@@ -222,14 +236,17 @@ export default {
|
|
|
checkSendRole: false,// 是否展示角色选择模块
|
|
|
checkType: 'single', // 选择类型
|
|
|
taskName: null, // 任务节点
|
|
|
+ taskDefKey:null,//节点Id
|
|
|
startUser: null, // 发起人信息,
|
|
|
multiInstanceVars: '', // 会签节点
|
|
|
formKeyExist: false, // 当前节点是否存在表单
|
|
|
+ formJson:{}
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
if (this.$route.query) {
|
|
|
this.taskName = this.$route.query.taskName;
|
|
|
+ this.taskDefKey = this.$route.query.taskDefKey;
|
|
|
this.startUser = this.$route.query.startUser;
|
|
|
this.taskForm.deployId = this.$route.query.deployId;
|
|
|
this.taskForm.taskId = this.$route.query.taskId;
|
|
|
@@ -324,17 +341,31 @@ export default {
|
|
|
if (taskId) {
|
|
|
// 提交流程申请时填写的表单存入了流程变量中后续任务处理时需要展示
|
|
|
flowTaskForm({taskId: taskId}).then(res => {
|
|
|
- this.variablesData = res.data.formData;
|
|
|
+ /*this.variablesData = res.data.formData;
|
|
|
this.taskForm.variables = res.data.formData;
|
|
|
- this.formKeyExist = res.data.formKeyExist;
|
|
|
+ this.formKeyExist = res.data.formKeyExist;*/
|
|
|
+ // 回显表单
|
|
|
+ this.$refs.vFormRef.setFormJson(res.data.formJson);
|
|
|
+ this.formJson = res.data.formJson;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ // 加载表单填写的数据
|
|
|
+ this.$refs.vFormRef.setFormData(res.data);
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // // 表单禁用
|
|
|
+ // this.$refs.vFormRef.disableForm();
|
|
|
+ // })
|
|
|
+ })
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
/** 加载审批任务弹框 */
|
|
|
- handleComplete() {
|
|
|
+ handleComplete(flag) {
|
|
|
// this.completeOpen = true;
|
|
|
// this.completeTitle = "流程审批";
|
|
|
- this.submitForm(null);
|
|
|
+ //this.submitForm(null);
|
|
|
+ this.completeOpen = true;
|
|
|
+ this.completeTitle = "流程审批";
|
|
|
+ this.submitForm(flag);
|
|
|
},
|
|
|
/** 用户审批任务 */
|
|
|
taskComplete() {
|
|
|
@@ -443,11 +474,11 @@ export default {
|
|
|
this.returnTaskList = [];
|
|
|
},
|
|
|
/** 申请流程表单数据提交 */
|
|
|
- submitForm(formData) {
|
|
|
+ submitForm(flag) {
|
|
|
// 根据当前任务或者流程设计配置的下一步节点 todo 暂时未涉及到考虑网关、表达式和多节点情况
|
|
|
const params = {taskId: this.taskForm.taskId}
|
|
|
getNextFlowNode(params).then(res => {
|
|
|
- const data = res.data;
|
|
|
+ /*const data = res.data;
|
|
|
this.taskForm.formData = formData;
|
|
|
if (data) {
|
|
|
if (data.dataType === 'dynamic') {
|
|
|
@@ -468,9 +499,40 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
this.completeOpen = true;
|
|
|
- this.completeTitle = "流程审批";
|
|
|
+ this.completeTitle = "流程审批";*/
|
|
|
+ this.$refs.vFormRef.getFormData().then(formData => {
|
|
|
+ formData.auditPass=flag;
|
|
|
+ Object.assign(this.taskForm.variables, formData);
|
|
|
+ this.taskForm.variables.formJson = this.formJson;
|
|
|
+ console.log(this.taskForm, "流程审批提交表单数据1")
|
|
|
+ }).catch(error => {
|
|
|
+ // this.$modal.msgError(error)
|
|
|
+ })
|
|
|
+ const data = res.data;
|
|
|
+ if (data) {
|
|
|
+ if (data.dataType === 'dynamic') {
|
|
|
+ if (data.type === 'assignee') { // 指定人员
|
|
|
+ this.checkSendUser = true;
|
|
|
+ this.checkType = "single";
|
|
|
+ } else if (data.type === 'candidateUsers') { // 候选人员(多个)
|
|
|
+ this.checkSendUser = true;
|
|
|
+ this.checkType = "multiple";
|
|
|
+ } else if (data.type === 'candidateGroups') { // 指定组(所属角色接收任务)
|
|
|
+ this.checkSendRole = true;
|
|
|
+ } else { // 会签
|
|
|
+ // 流程设计指定的 elementVariable 作为会签人员列表
|
|
|
+ this.multiInstanceVars = data.vars;
|
|
|
+ this.checkSendUser = true;
|
|
|
+ this.checkType = "multiple";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
+ // 动态绑定操作按钮的点击事件
|
|
|
+ handleButtonClick(method) {
|
|
|
+ this[method]();
|
|
|
+ }
|
|
|
},
|
|
|
};
|
|
|
</script>
|