feat(oa-project-flow) add oa-project-flow

approve-sys
bob 2 years ago
parent b1a7634cb1
commit 643355f110

@ -86,6 +86,14 @@ export function saveXml(data) {
}) })
} }
// 获取最新流程id
export function getLatestIdByKey(procKey) {
return request({
url: '/flowable/definition/getLatestIdByKey/' + procKey,
method: 'get'
});
}
// 新增流程定义 // 新增流程定义
export function addDeployment(data) { export function addDeployment(data) {
return request({ return request({

@ -8,6 +8,12 @@ export function listProject(query) {
params: query params: query
}) })
} }
export function optionProject() {
return request({
url: '/system/project/option',
method: 'get'
})
}
// 查询项目详细 // 查询项目详细
export function getProject(projectId) { export function getProject(projectId) {

@ -404,7 +404,7 @@ export default {
}) })
}, },
/** 启动流程 */ /** 启动流程 */
handleDefinitionStart(row){ handleDefinitionStart(){
definitionStart(row.id).then(res =>{ definitionStart(row.id).then(res =>{
this.msgSuccess(res.msg); this.msgSuccess(res.msg);
}) })

@ -12,8 +12,8 @@
<el-option <el-option
v-for="(item,index) in projectList" v-for="(item,index) in projectList"
:key="index" :key="index"
:label="item.name" :label="item.label"
:value="item.id"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -52,7 +52,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="startFlow"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -64,6 +64,8 @@
import {listForm, getForm, delForm, addForm, updateForm, exportForm} from "@/api/flowable/form"; import {listForm, getForm, delForm, addForm, updateForm, exportForm} from "@/api/flowable/form";
import Editor from '@/components/Editor'; import Editor from '@/components/Editor';
import Parser from '@/components/parser/Parser' import Parser from '@/components/parser/Parser'
import {optionProject} from "@/api/system/project";
import {definitionStart, getLatestIdByKey} from "@/api/flowable/definition";
export default { export default {
name: "Form", name: "Form",
@ -110,11 +112,12 @@ export default {
}], }],
// //
form: { form: {
projectId: 0, projectId: undefined,
workRecord: '', workRecord: '',
issue: '', issue: '',
solution: '', solution: '',
}, },
oaProjectFlowId: '',
projectList: [], projectList: [],
// //
rules: {} rules: {}
@ -123,6 +126,27 @@ export default {
methods: { methods: {
init() { init() {
this.open = true this.open = true
this.optionList()
this.getLatestIdByKey()
},
/** 启动流程 */
startFlow(){
definitionStart(this.oaProjectFlowId).then(res =>{
this.msgSuccess(res.msg);
})
}, /** 获取最新流程id */
getLatestIdByKey(){
getLatestIdByKey("oa_project_flow").then(res => {
this.oaProjectFlowId = res.data;
});
},
/** 查询项目列表 */
optionList() {
this.loading = true;
optionProject().then(response => {
this.projectList = response.data;
this.loading = false;
});
}, },
/** 查询流程表单列表 */ /** 查询流程表单列表 */
getList() { getList() {

@ -14,25 +14,11 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :xs="24" :sm="24" :md="12" :lg="14" style="padding-left: 20px"> <el-col :xs="24" :sm="24" :md="12" :lg="14" style="padding-left: 20px">
<el-card class="update-log"> <el-card class="update-log">
<div class="block">
<h2 class="demonstration">人活着就是为了樱岛麻衣 () </h2>
<el-image style="width: 100%" :fit="contain" src="https://oscimg.oschina.net/oscnet/up-eb83b8d00104b97842d19dbadeec90fbb54.JPEG"/>
</div>
</el-card> </el-card>
</el-col> </el-col>
<el-col :xs="24" :sm="24" :md="12" :lg="8"> <el-col :xs="24" :sm="24" :md="12" :lg="8">
<el-card class="update-log"> <el-card class="update-log">
<div slot="header" class="clearfix">
<span>更新日志</span>
</div>
<el-collapse accordion>
<el-collapse-item title="v1.0.0 - 2021-04-07">
<ol>
<li>单流程完善</li>
</ol>
</el-collapse-item>
</el-collapse>
</el-card> </el-card>
</el-col> </el-col>

@ -1,6 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="项目名称" prop="name"> <el-form-item label="项目名称" prop="name">
<el-input <el-input
v-model="queryParams.name" v-model="queryParams.name"
@ -123,7 +123,7 @@
<!-- 添加或修改项目对话框 --> <!-- 添加或修改项目对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="项目名称" prop="name"> <el-form-item label="项目名称" prop="name">
<el-input v-model="form.name" placeholder="请输入项目名称" /> <el-input v-model="form.name" placeholder="请输入项目名称" />
</el-form-item> </el-form-item>
@ -146,9 +146,6 @@
placeholder="选择项目结束时间"> placeholder="选择项目结束时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="删除标志" prop="delFlag">
<el-input v-model="form.delFlag" placeholder="请输入删除标志" />
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@ -159,7 +156,15 @@
</template> </template>
<script> <script>
import { listProject, getProject, delProject, addProject, updateProject, exportProject } from "@/api/system/project"; import {
listProject,
getProject,
delProject,
addProject,
updateProject,
exportProject,
optionProject
} from "@/api/system/project";
export default { export default {
name: "Project", name: "Project",
@ -200,24 +205,12 @@ export default {
rules: { rules: {
name: [ name: [
{ required: true, message: "项目名称不能为空", trigger: "blur" } { required: true, message: "项目名称不能为空", trigger: "blur" }
],
startDate: [
{ required: true, message: "项目开始时间不能为空", trigger: "blur" }
],
delFlag: [
{ required: true, message: "删除标志不能为空", trigger: "blur" }
],
updateTime: [
{ required: true, message: "更新时间不能为空", trigger: "blur" }
],
updateBy: [
{ required: true, message: "更新人不能为空", trigger: "blur" }
] ]
} }
}; };
}, },
created() { activated() {
this.getList(); this.optionList();
}, },
methods: { methods: {
/** 查询项目列表 */ /** 查询项目列表 */
@ -228,6 +221,14 @@ export default {
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
}, /** 查询项目列表 */
optionList() {
this.loading = true;
optionProject().then(response => {
this.projectList = response.rows;
this.total = response.total;
this.loading = false;
});
}, },
// //
cancel() { cancel() {

Loading…
Cancel
Save