feat(oa-project-flow) approve page

approve-sys
bob 2 years ago
parent 70a52b2e2f
commit 6ebb427edb

@ -118,6 +118,7 @@ export default {
solution: '', solution: '',
}, },
oaProjectFlowId: '', oaProjectFlowId: '',
oaProjectFlowKey: 'process_l9kpb443',
projectList: [], projectList: [],
// //
rules: {} rules: {}
@ -131,12 +132,12 @@ export default {
}, },
/** 启动流程 */ /** 启动流程 */
startFlow(){ startFlow(){
definitionStart(this.oaProjectFlowId).then(res =>{ definitionStart(this.oaProjectFlowId, JSON.stringify(this.form)).then(res => {
this.msgSuccess(res.msg); this.msgSuccess(res.msg);
}) })
}, /** 获取最新流程id */ }, /** 获取最新流程id */
getLatestIdByKey(){ getLatestIdByKey(){
getLatestIdByKey("oa_project_flow").then(res => { getLatestIdByKey(this.oaProjectFlowKey).then(res => {
this.oaProjectFlowId = res.data; this.oaProjectFlowId = res.data;
}); });
}, },
@ -216,26 +217,6 @@ export default {
// }); // });
this.$router.push({path: '/tool/build/index', query: {formId: row.formId}}) this.$router.push({path: '/tool/build/index', query: {formId: row.formId}})
}, },
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.formId != null) {
updateForm(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addForm(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const formIds = row.formId || this.ids; const formIds = row.formId || this.ids;

@ -9,7 +9,54 @@
<!--流程处理表单模块--> <!--流程处理表单模块-->
<el-col :span="16" :offset="6" v-if="variableOpen"> <el-col :span="16" :offset="6" v-if="variableOpen">
<div> <div>
<parser :key="new Date().getTime()" :form-conf="variablesData" /> <el-form ref="form" :model="form" :rules="rules" label-width="100px" :disabled="true">
<el-form-item label="所属项目">
<el-select v-model="form.projectId"
clearable
filterable
placeholder="请选择">
<el-option
v-for="(item,index) in projectList"
:key="index"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="项目问题">
<el-input type="textarea" v-model="form.issue"/>
</el-form-item>
<el-form-item label="解决方案">
<el-input type="textarea" v-model="form.solution"/>
</el-form-item>
<el-form-item label="工作记录">
<el-input type="textarea" v-model="form.workRecord"/>
</el-form-item>
<el-form-item label="图片上传" prop="remark">
<el-upload
class="upload-demo"
action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview"
:on-remove="handleRemove"
:file-list="fileList">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
</el-form-item>
<el-form-item label="文件上传" prop="remark">
<el-upload
class="upload-demo"
action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview"
:on-remove="handleRemove"
multiple
:limit="3"
:file-list="fileList">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
</el-form-item>
</el-form>
</div> </div>
<div style="margin-left:10%;margin-bottom: 20px;font-size: 14px;" v-if="finished === 'true'"> <div style="margin-left:10%;margin-bottom: 20px;font-size: 14px;" v-if="finished === 'true'">
<el-button icon="el-icon-edit-outline" type="success" size="mini" @click="handleComplete"></el-button> <el-button icon="el-icon-edit-outline" type="success" size="mini" @click="handleComplete"></el-button>
@ -22,9 +69,56 @@
</el-col> </el-col>
<!--初始化流程加载表单信息--> <!--初始化流程加载表单信息-->
<el-col :span="16" :offset="4" v-if="formConfOpen"> <el-col :span="16" :offset="4" v-if="formConfOpen" >
<div class="test-form"> <div class="test-form">
<parser :key="new Date().getTime()" :form-conf="formConf" @submit="submitForm" ref="parser" @getData="getData" /> <el-form ref="form" :model="form" :rules="rules" label-width="100px" :disabled="true">
<el-form-item label="所属项目">
<el-select v-model="form.projectId"
clearable
filterable
placeholder="请选择">
<el-option
v-for="(item,index) in projectList"
:key="index"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="项目问题">
<el-input type="textarea" v-model="form.issue"/>
</el-form-item>
<el-form-item label="解决方案">
<el-input type="textarea" v-model="form.solution"/>
</el-form-item>
<el-form-item label="工作记录">
<el-input type="textarea" v-model="form.workRecord"/>
</el-form-item>
<el-form-item label="图片上传" prop="remark">
<el-upload
class="upload-demo"
action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview"
:on-remove="handleRemove"
:file-list="fileList">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
</el-form-item>
<el-form-item label="文件上传" prop="remark">
<el-upload
class="upload-demo"
action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview"
:on-remove="handleRemove"
multiple
:limit="3"
:file-list="fileList">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
</el-form-item>
</el-form>
</div> </div>
</el-col> </el-col>
</el-card> </el-card>
@ -84,12 +178,12 @@
</div> </div>
</el-col> </el-col>
</el-card> </el-card>
<el-card class="box-card"> <!-- <el-card class="box-card">-->
<div slot="header" class="clearfix"> <!-- <div slot="header" class="clearfix">-->
<span class="el-icon-picture-outline">流程图</span> <!-- <span class="el-icon-picture-outline">流程图</span>-->
</div> <!-- </div>-->
<flow :xmlData="xmlData" :taskData="taskList"></flow> <!-- <flow :xmlData="xmlData" :taskData="taskList"></flow>-->
</el-card> <!-- </el-card>-->
<!--审批正常流程--> <!--审批正常流程-->
<el-dialog :title="completeTitle" :visible.sync="completeOpen" :width="checkSendUser? '60%':'40%'" append-to-body> <el-dialog :title="completeTitle" :visible.sync="completeOpen" :width="checkSendUser? '60%':'40%'" append-to-body>
@ -203,6 +297,7 @@ import {treeselect} from "@/api/system/dept";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import {listUser} from "@/api/system/user"; import {listUser} from "@/api/system/user";
import {optionProject} from "@/api/system/project";
export default { export default {
name: "Record", name: "Record",
@ -260,6 +355,14 @@ export default {
variables: [], // variables: [], //
variablesData: {}, // variablesData: {}, //
variableOpen: false, // variableOpen: false, //
//
form: {
projectId: 0,
workRecord: '',
issue: '',
solution: '',
},
projectList: [],
returnTaskList: [], // 退 returnTaskList: [], // 退
finished: 'false', finished: 'false',
completeTitle: null, completeTitle: null,
@ -289,6 +392,7 @@ export default {
this.getNextFlowNode(this.taskForm.taskId) this.getNextFlowNode(this.taskForm.taskId)
this.taskForm.deployId = null this.taskForm.deployId = null
} }
this.optionList();
this.getFlowRecordList( this.taskForm.procInsId, this.taskForm.deployId); this.getFlowRecordList( this.taskForm.procInsId, this.taskForm.deployId);
this.finished = this.$route.query && this.$route.query.finished this.finished = this.$route.query && this.$route.query.finished
}, },
@ -382,10 +486,14 @@ export default {
flowRecord(params).then(res => { flowRecord(params).then(res => {
this.flowRecordList = res.data.flowList; this.flowRecordList = res.data.flowList;
// //
if (res.data.formData) { // if (res.data.formData) {
this.formConf = res.data.formData; this.form = res.data.form;
console.log("res.data.form;", res.data.form)
console.log("this.form ", this.form)
if (this.taskForm.executionId === undefined) {
this.formConfOpen = true this.formConfOpen = true
} }
// }
}).catch(res => { }).catch(res => {
this.goBack(); this.goBack();
}) })
@ -404,11 +512,19 @@ export default {
// //
getProcessVariables(taskId).then(res => { getProcessVariables(taskId).then(res => {
// this.variables = res.data.variables; // this.variables = res.data.variables;
this.variablesData = res.data.variables; this.form = res.data;
this.variableOpen = true this.variableOpen = true
}); });
} }
}, },
/** 查询项目列表 */
optionList() {
this.loading = true;
optionProject().then(response => {
this.projectList = response.data;
this.loading = false;
});
},
/** 根据当前任务或者流程设计配置的下一步节点 */ /** 根据当前任务或者流程设计配置的下一步节点 */
getNextFlowNode(taskId) { getNextFlowNode(taskId) {
// todo // todo

Loading…
Cancel
Save