整合前端
This commit is contained in:
329
ruoyi-ui/src/views/oa/apply/absence/index.vue
Normal file
329
ruoyi-ui/src/views/oa/apply/absence/index.vue
Normal file
@@ -0,0 +1,329 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<!-- <el-form-item label="流程分类" prop="category">
|
||||
<el-select v-model="queryParams.category" clearable placeholder="请选择" size="small">
|
||||
<el-option
|
||||
v-for="item in categoryOptions"
|
||||
:key="item.categoryId"
|
||||
:label="item.categoryName"
|
||||
:value="item.code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="提交时间">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="btnLoading"
|
||||
@click="handleStart"
|
||||
>发起请假
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="ownProcessList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<!-- <el-table-column label="流程编号" align="center" prop="procInsId" :show-overflow-tooltip="true"/>-->
|
||||
<el-table-column label="请假事由" align="left" prop="procVars" :show-overflow-tooltip="true"/>
|
||||
<!-- <el-table-column label="流程类别" align="center" prop="category" :formatter="categoryFormat" />-->
|
||||
<el-table-column label="当前节点" width="150" align="center" prop="taskName"/>
|
||||
<el-table-column label="提交时间" align="center" prop="createTime" width="160"/>
|
||||
<el-table-column label="当前状态" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.wf_process_status" :value="scope.row.processStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="耗时" align="center" prop="duration" width="130"/>
|
||||
<el-table-column label="操作" align="center" width="240" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-tickets"
|
||||
@click="handleFlowRecord(scope.row)"
|
||||
v-hasPermi="['workflow:process:query']"
|
||||
>详情
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-if="scope.row.finishTime"
|
||||
v-hasPermi="['workflow:process:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-circle-close"
|
||||
@click="handleStop(scope.row)"
|
||||
v-hasPermi="['workflow:process:cancel']"
|
||||
>取消
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-refresh-right"
|
||||
v-hasPermi="['workflow:process:start']"
|
||||
@click="handleAgain(scope.row)"
|
||||
>重新发起
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listOwnProcess, stopProcess, delProcess, listProcess} from '@/api/workflow/process';
|
||||
import {listAllCategory} from '@/api/workflow/category';
|
||||
import {detailProcess} from '@/api/workflow/process'
|
||||
|
||||
export default {
|
||||
name: "Own",
|
||||
dicts: ['wf_process_status'],
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
processLoading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
categoryOptions: [],
|
||||
processTotal: 0,
|
||||
// 我发起的流程列表数据
|
||||
ownProcessList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
process: {},
|
||||
src: "",
|
||||
definitionList: [],
|
||||
// 日期范围
|
||||
dateRange: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
processKey: undefined,
|
||||
processName: undefined,
|
||||
category: "absence"
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
btnLoading:true
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getCategoryList();
|
||||
},
|
||||
beforeRouteEnter(to, from, next) {
|
||||
next(vm => {
|
||||
vm.getList()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
handleStart() {
|
||||
const row = this.process
|
||||
this.$router.push({
|
||||
path: '/workflow/process/start/' + row.deploymentId,
|
||||
query: {
|
||||
definitionId: row.definitionId,
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 查询流程分类列表 */
|
||||
getCategoryList() {
|
||||
listAllCategory().then(response => this.categoryOptions = response.data)
|
||||
},
|
||||
/** 查询流程定义列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.btnLoading = true;
|
||||
listOwnProcess(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
listProcess(this.queryParams).then(response => {
|
||||
this.process = response.rows[response.rows.length - 1];
|
||||
this.btnLoading = false;
|
||||
})
|
||||
this.ownProcessList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
/**流程标题搜索**/
|
||||
searchList(list, str) {
|
||||
let arr = [];
|
||||
list.forEach((item) => {
|
||||
if (item.procVars.description.indexOf(str) > -1) {
|
||||
arr.push(item)
|
||||
}
|
||||
})
|
||||
return arr;
|
||||
},
|
||||
|
||||
//对象数组排序(文本类)
|
||||
/* compare(propertyName, order) {
|
||||
return function (object1, object2) {
|
||||
var value1 = object1[propertyName];
|
||||
var value2 = object2[propertyName];
|
||||
if (order == 0) {
|
||||
if (value2 < value1) {
|
||||
return -1;
|
||||
} else if (value2 > value1) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (order == 1) {
|
||||
if (value2 > value1) {
|
||||
return -1;
|
||||
} else if (value2 < value1) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},*/
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
name: null,
|
||||
category: null,
|
||||
key: null,
|
||||
tenantId: null,
|
||||
deployTime: null,
|
||||
derivedFrom: null,
|
||||
derivedFromRoot: null,
|
||||
parentDeploymentId: null,
|
||||
engineVersion: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.procInsId);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
handleAgain(row) {
|
||||
this.$router.push({
|
||||
path: '/workflow/process/start/' + row.deployId,
|
||||
query: {
|
||||
definitionId: row.procDefId,
|
||||
procInsId: row.procInsId
|
||||
}
|
||||
})
|
||||
// console.log(row);
|
||||
},
|
||||
/** 取消流程申请 */
|
||||
handleStop(row) {
|
||||
const params = {
|
||||
procInsId: row.procInsId
|
||||
}
|
||||
stopProcess(params).then(res => {
|
||||
this.$modal.msgSuccess(res.msg);
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
/** 流程流转记录 */
|
||||
handleFlowRecord(row) {
|
||||
this.$router.push({
|
||||
path: '/workflow/process/detail/' + row.procInsId,
|
||||
query: {
|
||||
processed: false
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.procInsId || this.ids;
|
||||
this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function () {
|
||||
return delProcess(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('workflow/process/ownExport', {
|
||||
...this.queryParams
|
||||
}, `wf_own_process_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
categoryFormat(row, column) {
|
||||
return this.categoryOptions.find(k => k.code === row.category)?.categoryName ?? '';
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
329
ruoyi-ui/src/views/oa/apply/entertain/index.vue
Normal file
329
ruoyi-ui/src/views/oa/apply/entertain/index.vue
Normal file
@@ -0,0 +1,329 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<!-- <el-form-item label="流程分类" prop="category">
|
||||
<el-select v-model="queryParams.category" clearable placeholder="请选择" size="small">
|
||||
<el-option
|
||||
v-for="item in categoryOptions"
|
||||
:key="item.categoryId"
|
||||
:label="item.categoryName"
|
||||
:value="item.code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="提交时间">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="btnLoading"
|
||||
@click="handleStart"
|
||||
>发起招待申请
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="ownProcessList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<!-- <el-table-column label="流程编号" align="center" prop="procInsId" :show-overflow-tooltip="true"/>-->
|
||||
<el-table-column label="招待事由" align="left" prop="procVars" :show-overflow-tooltip="true"/>
|
||||
<!-- <el-table-column label="流程类别" align="center" prop="category" :formatter="categoryFormat" />-->
|
||||
<el-table-column label="当前节点" width="150" align="center" prop="taskName"/>
|
||||
<el-table-column label="提交时间" align="center" prop="createTime" width="160"/>
|
||||
<el-table-column label="当前状态" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.wf_process_status" :value="scope.row.processStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="耗时" align="center" prop="duration" width="130"/>
|
||||
<el-table-column label="操作" align="center" width="240" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-tickets"
|
||||
@click="handleFlowRecord(scope.row)"
|
||||
v-hasPermi="['workflow:process:query']"
|
||||
>详情
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-if="scope.row.finishTime"
|
||||
v-hasPermi="['workflow:process:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-circle-close"
|
||||
@click="handleStop(scope.row)"
|
||||
v-hasPermi="['workflow:process:cancel']"
|
||||
>取消
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-refresh-right"
|
||||
v-hasPermi="['workflow:process:start']"
|
||||
@click="handleAgain(scope.row)"
|
||||
>重新发起
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listAllCategory } from '@/api/workflow/category';
|
||||
import { delProcess, listOwnProcess, listProcess, stopProcess } from '@/api/workflow/process';
|
||||
|
||||
export default {
|
||||
name: "Own",
|
||||
dicts: ['wf_process_status'],
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
processLoading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
categoryOptions: [],
|
||||
processTotal: 0,
|
||||
// 我发起的流程列表数据
|
||||
ownProcessList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
process: {},
|
||||
src: "",
|
||||
definitionList: [],
|
||||
// 日期范围
|
||||
dateRange: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
processKey: undefined,
|
||||
processName: undefined,
|
||||
category: "entertain"
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
btnLoading:true
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getCategoryList();
|
||||
},
|
||||
beforeRouteEnter(to, from, next) {
|
||||
next(vm => {
|
||||
vm.getList()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
handleStart() {
|
||||
const row = this.process
|
||||
this.$router.push({
|
||||
path: '/workflow/process/start/' + row.deploymentId,
|
||||
query: {
|
||||
definitionId: row.definitionId,
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 查询流程分类列表 */
|
||||
getCategoryList() {
|
||||
listAllCategory().then(response => this.categoryOptions = response.data)
|
||||
},
|
||||
/** 查询流程定义列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.btnLoading = true;
|
||||
listOwnProcess(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
listProcess(this.queryParams).then(response => {
|
||||
console.log(response, 'response');
|
||||
this.process = response.rows[response.rows.length - 1];
|
||||
this.btnLoading = false;
|
||||
})
|
||||
this.ownProcessList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
/**流程标题搜索**/
|
||||
searchList(list, str) {
|
||||
let arr = [];
|
||||
list.forEach((item) => {
|
||||
if (item.procVars.description.indexOf(str) > -1) {
|
||||
arr.push(item)
|
||||
}
|
||||
})
|
||||
return arr;
|
||||
},
|
||||
|
||||
//对象数组排序(文本类)
|
||||
/* compare(propertyName, order) {
|
||||
return function (object1, object2) {
|
||||
var value1 = object1[propertyName];
|
||||
var value2 = object2[propertyName];
|
||||
if (order == 0) {
|
||||
if (value2 < value1) {
|
||||
return -1;
|
||||
} else if (value2 > value1) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (order == 1) {
|
||||
if (value2 > value1) {
|
||||
return -1;
|
||||
} else if (value2 < value1) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},*/
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
name: null,
|
||||
category: null,
|
||||
key: null,
|
||||
tenantId: null,
|
||||
deployTime: null,
|
||||
derivedFrom: null,
|
||||
derivedFromRoot: null,
|
||||
parentDeploymentId: null,
|
||||
engineVersion: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.procInsId);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
handleAgain(row) {
|
||||
this.$router.push({
|
||||
path: '/workflow/process/start/' + row.deployId,
|
||||
query: {
|
||||
definitionId: row.procDefId,
|
||||
procInsId: row.procInsId
|
||||
}
|
||||
})
|
||||
// console.log(row);
|
||||
},
|
||||
/** 取消流程申请 */
|
||||
handleStop(row) {
|
||||
const params = {
|
||||
procInsId: row.procInsId
|
||||
}
|
||||
stopProcess(params).then(res => {
|
||||
this.$modal.msgSuccess(res.msg);
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
/** 流程流转记录 */
|
||||
handleFlowRecord(row) {
|
||||
this.$router.push({
|
||||
path: '/workflow/process/detail/' + row.procInsId,
|
||||
query: {
|
||||
processed: false
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.procInsId || this.ids;
|
||||
this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function () {
|
||||
return delProcess(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('workflow/process/ownExport', {
|
||||
...this.queryParams
|
||||
}, `wf_own_process_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
categoryFormat(row, column) {
|
||||
return this.categoryOptions.find(k => k.code === row.category)?.categoryName ?? '';
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
384
ruoyi-ui/src/views/oa/apply/index.vue
Normal file
384
ruoyi-ui/src/views/oa/apply/index.vue
Normal file
@@ -0,0 +1,384 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="提交时间">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请类型">
|
||||
<el-select v-model="queryParams.category" placeholder="请选择申请类型" clearable>
|
||||
<el-option v-for="item in applyCategory" :key="item.name" :label="item.label" :value="item.name"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="btnLoading"
|
||||
@click="openApplyDialog"
|
||||
>发起申请
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="ownProcessList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<!-- <el-table-column label="流程编号" align="center" prop="procInsId" :show-overflow-tooltip="true"/>-->
|
||||
<el-table-column label="申请详情" align="left" prop="procVars" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="申请类型" align="left" prop="category">
|
||||
<template slot-scope="scope">
|
||||
{{ applyCategory.find(item => item.name === scope.row.category).label }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="流程类别" align="center" prop="category" :formatter="categoryFormat" />-->
|
||||
<el-table-column label="当前节点" width="150" align="center" prop="taskName"/>
|
||||
<el-table-column label="提交时间" align="center" prop="createTime" width="160"/>
|
||||
<el-table-column label="当前状态" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.wf_process_status" :value="scope.row.processStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="耗时" align="center" prop="duration" width="130"/>
|
||||
<el-table-column label="操作" align="center" width="240" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-tickets"
|
||||
@click="handleFlowRecord(scope.row)"
|
||||
v-hasPermi="['workflow:process:query']"
|
||||
>详情
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-if="scope.row.finishTime"
|
||||
v-hasPermi="['workflow:process:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-circle-close"
|
||||
@click="handleStop(scope.row)"
|
||||
v-hasPermi="['workflow:process:cancel']"
|
||||
>取消
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-refresh-right"
|
||||
v-hasPermi="['workflow:process:start']"
|
||||
@click="handleAgain(scope.row)"
|
||||
>重新发起
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-row>
|
||||
<el-col :span="8" v-for="item in applyCategory" :key="item.name" @click="handleApply(item)">
|
||||
<div class="apply-item">
|
||||
{{ item.label }}
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listAllCategory } from '@/api/workflow/category';
|
||||
import { delProcess, listOwnProcess, listProcess, stopProcess } from '@/api/workflow/process';
|
||||
|
||||
const applyCategory = [
|
||||
{
|
||||
label: '用印申请',
|
||||
name: 'seal',
|
||||
},
|
||||
{
|
||||
label: '拨款申请',
|
||||
name: 'money',
|
||||
},
|
||||
{
|
||||
label: '报销申请',
|
||||
name: 'claim',
|
||||
},
|
||||
{
|
||||
label: '请假申请',
|
||||
name: 'absence',
|
||||
},
|
||||
{
|
||||
label: '差旅申请',
|
||||
name: 'trip',
|
||||
},
|
||||
{
|
||||
label: '招待申请',
|
||||
name: 'entertain',
|
||||
},
|
||||
{
|
||||
label: '其他申请',
|
||||
name: 'other',
|
||||
}
|
||||
]
|
||||
|
||||
export default {
|
||||
name: "Own",
|
||||
dicts: ['wf_process_status'],
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
applyCategory,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
processLoading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
categoryOptions: [],
|
||||
processTotal: 0,
|
||||
// 我发起的流程列表数据
|
||||
ownProcessList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
process: {},
|
||||
src: "",
|
||||
definitionList: [],
|
||||
// 日期范围
|
||||
dateRange: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
processKey: undefined,
|
||||
processName: undefined,
|
||||
category: undefined
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
btnLoading:true
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getCategoryList();
|
||||
},
|
||||
beforeRouteEnter(to, from, next) {
|
||||
next(vm => {
|
||||
vm.getList()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
openApplyDialog() {
|
||||
this.open = true;
|
||||
},
|
||||
handleStart() {
|
||||
const row = this.process
|
||||
this.$router.push({
|
||||
path: '/workflow/process/start/' + row.deploymentId,
|
||||
query: {
|
||||
definitionId: row.definitionId,
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 查询流程分类列表 */
|
||||
getCategoryList() {
|
||||
listAllCategory().then(response => this.categoryOptions = response.data)
|
||||
},
|
||||
/** 查询流程定义列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.btnLoading = true;
|
||||
listOwnProcess(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
listProcess(this.queryParams).then(response => {
|
||||
this.process = response.rows[response.rows.length - 1];
|
||||
this.btnLoading = false;
|
||||
})
|
||||
this.ownProcessList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
/**流程标题搜索**/
|
||||
searchList(list, str) {
|
||||
let arr = [];
|
||||
list.forEach((item) => {
|
||||
if (item.procVars.description.indexOf(str) > -1) {
|
||||
arr.push(item)
|
||||
}
|
||||
})
|
||||
return arr;
|
||||
},
|
||||
|
||||
//对象数组排序(文本类)
|
||||
/* compare(propertyName, order) {
|
||||
return function (object1, object2) {
|
||||
var value1 = object1[propertyName];
|
||||
var value2 = object2[propertyName];
|
||||
if (order == 0) {
|
||||
if (value2 < value1) {
|
||||
return -1;
|
||||
} else if (value2 > value1) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (order == 1) {
|
||||
if (value2 > value1) {
|
||||
return -1;
|
||||
} else if (value2 < value1) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},*/
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
name: null,
|
||||
category: null,
|
||||
key: null,
|
||||
tenantId: null,
|
||||
deployTime: null,
|
||||
derivedFrom: null,
|
||||
derivedFromRoot: null,
|
||||
parentDeploymentId: null,
|
||||
engineVersion: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dateRange = [];
|
||||
this.queryParams.category = undefined;
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.procInsId);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
handleAgain(row) {
|
||||
this.$router.push({
|
||||
path: '/workflow/process/start/' + row.deployId,
|
||||
query: {
|
||||
definitionId: row.procDefId,
|
||||
procInsId: row.procInsId
|
||||
}
|
||||
})
|
||||
// console.log(row);
|
||||
},
|
||||
/** 取消流程申请 */
|
||||
handleStop(row) {
|
||||
const params = {
|
||||
procInsId: row.procInsId
|
||||
}
|
||||
stopProcess(params).then(res => {
|
||||
this.$modal.msgSuccess(res.msg);
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
/** 流程流转记录 */
|
||||
handleFlowRecord(row) {
|
||||
this.$router.push({
|
||||
path: '/workflow/process/detail/' + row.procInsId,
|
||||
query: {
|
||||
processed: false
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.procInsId || this.ids;
|
||||
this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function () {
|
||||
return delProcess(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('workflow/process/ownExport', {
|
||||
...this.queryParams
|
||||
}, `wf_own_process_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
categoryFormat(row, column) {
|
||||
return this.categoryOptions.find(k => k.code === row.category)?.categoryName ?? '';
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.apply-item {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background-color: #f0f2f5;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
191
ruoyi-ui/src/views/oa/apply/money/add.vue
Normal file
191
ruoyi-ui/src/views/oa/apply/money/add.vue
Normal file
@@ -0,0 +1,191 @@
|
||||
<template>
|
||||
<div class="main" v-loading="loading">
|
||||
<div class="">
|
||||
<div class="">
|
||||
<el-card style="">
|
||||
<el-row>
|
||||
<div>
|
||||
<h1>拨款申请单</h1>
|
||||
</div>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<div class="header">
|
||||
基本信息
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<div>
|
||||
<el-form :form="form" label-width="100px" :rules="rules">
|
||||
<el-form-item label="拨款描述:" prop="remark">
|
||||
<el-input type="textarea" v-model="form.remark" :rows="5"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="申请时间:" prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="form.startTime"
|
||||
align="right"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="拨款总额:" prop="cost">
|
||||
<el-input v-model="form.cost" placeholder="请输入拨款总额">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="关联项目:" prop="projectId">
|
||||
<el-select v-model="form.projectId" filterable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in projectList"
|
||||
:key="item.projectId"
|
||||
:label="item.projectName"
|
||||
:value="item.projectId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="附件总数:" prop="detailNumber">
|
||||
<el-input v-model="form.detailNumber" placeholder="请输入附件总数">
|
||||
<template slot="append">张</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-divider></el-divider>
|
||||
<div style="font-weight: 900;display: flex;">
|
||||
<div style="width: 50%">
|
||||
最终拨款金额:
|
||||
<span style="color: red">{{form.cost===""?'请输入金额':form.cost}}</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
大写:<span style="color: red">{{numberToCNY(form.cost)}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<div style="display: flex">
|
||||
<div style="margin-right: 20px">
|
||||
上传附件:
|
||||
</div>
|
||||
<div>
|
||||
<fileUpload v-model="files"/>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex;justify-content: center;margin-top: 20px">
|
||||
<el-button type="primary">
|
||||
<i class="el-icon-check" @click="addTripClaim">提交</i>
|
||||
</el-button>
|
||||
<el-button type="primary">
|
||||
<i class="el-icon-refresh" @click="reset">重置</i>
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
import { addOaClaim } from "@/api/oa/claim";
|
||||
import { listProject } from "@/api/oa/project";
|
||||
import { startMoney } from "@/api/workflow/process";
|
||||
import { numberToCNY } from "@/utils/currencyFormatter";
|
||||
|
||||
export default {
|
||||
dicts: ['claim_detail_type'],
|
||||
data() {
|
||||
return {
|
||||
projectList: [],
|
||||
loading:false,
|
||||
form:{},
|
||||
files: [],
|
||||
// 表单校验
|
||||
rules: {
|
||||
|
||||
startTime: [
|
||||
{ required: true, message: "开始时间不能为空", trigger: "blur" }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: "拨款描述不能为空", trigger: "blur" }
|
||||
],
|
||||
cost: [
|
||||
{ required: true, message: "报销金额不能为空", trigger: "blur" }
|
||||
],
|
||||
detailNumber: [
|
||||
{ required: true, message: "票据总数不能为空", trigger: "blur" }
|
||||
]
|
||||
},
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
created() {
|
||||
this.getProjectList();
|
||||
},
|
||||
methods: {
|
||||
numberToCNY,
|
||||
getProjectList(){
|
||||
let query = {
|
||||
pageSize:9999,
|
||||
pageNum:1,
|
||||
}
|
||||
listProject(query).then(res => {
|
||||
this.projectList = res.rows
|
||||
})
|
||||
},
|
||||
reset(){
|
||||
this.form={}
|
||||
},
|
||||
// 提交拨款表单
|
||||
addTripClaim(){
|
||||
this.loading = true
|
||||
// 将文件列表进行处理
|
||||
this.form.fileList = this.files
|
||||
startMoney().then(res=>{
|
||||
this.form.procInsId = res.data
|
||||
addOaClaim(this.form).then(res => {
|
||||
this.loading = false
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.goBack()
|
||||
})
|
||||
})
|
||||
},
|
||||
goBack() {
|
||||
// 关闭当前标签页并返回上个页面
|
||||
this.$tab.closePage(this.$route)
|
||||
this.$router.back()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.main {
|
||||
|
||||
padding: 10px;
|
||||
width: 80%;
|
||||
margin: 10px auto;
|
||||
}
|
||||
|
||||
.container {
|
||||
margin: 10px;
|
||||
padding: 10px;
|
||||
background-color: white;
|
||||
border-radius: 10px;
|
||||
}
|
||||
</style>
|
||||
231
ruoyi-ui/src/views/oa/apply/money/index.vue
Normal file
231
ruoyi-ui/src/views/oa/apply/money/index.vue
Normal file
@@ -0,0 +1,231 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:oaClaim:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:oaClaim:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:oaClaim:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="oaClaimList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" type="index" v-if="true"/>
|
||||
<el-table-column label="描述" align="center" prop="remark" />
|
||||
<el-table-column label="报销金额" align="center" prop="cost" />
|
||||
<el-table-column label="关联项目" align="center" prop="projectName" >
|
||||
<template slot-scope="scope">
|
||||
<span type="text" >{{ scope.row.projectName!==null?scope.row.projectName:'未关联项目' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="projectId">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.status_===1?'success':'warning'">{{scope.row.status_===1?'完成':'进行中'}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="申请时间" align="center" prop="startTime" width="180">
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleDetail(scope.row)"
|
||||
v-hasPermi="['system:oaClaim:edit']"
|
||||
>查看附件</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:oaClaim:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { delOaClaim, listMoney } from "@/api/oa/claim";
|
||||
|
||||
export default {
|
||||
name: "OaClaim",
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 差旅费报销表格数据
|
||||
oaClaimList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
userId: undefined,
|
||||
fileIds: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
tripDays: undefined,
|
||||
cost: undefined,
|
||||
detailNumber: undefined,
|
||||
projectId: undefined,
|
||||
procInsId: undefined,
|
||||
completedTime: undefined
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询差旅费报销列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listMoney(this.queryParams).then(response => {
|
||||
console.log(response);
|
||||
this.oaClaimList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
claimId: undefined,
|
||||
userId: undefined,
|
||||
fileIds: undefined,
|
||||
remark: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
tripDays: undefined,
|
||||
cost: undefined,
|
||||
detailNumber: undefined,
|
||||
projectId: undefined,
|
||||
createTime: undefined,
|
||||
createBy: undefined,
|
||||
updateTime: undefined,
|
||||
updateBy: undefined,
|
||||
delFlag: undefined,
|
||||
procInsId: undefined,
|
||||
completedTime: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.claimId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.$router.push('/money/addMoney')
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const claimIds = row.claimId || this.ids;
|
||||
this.$modal.confirm('是否确认删除拨款单编号为"' + claimIds + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delOaClaim(claimIds);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/oaClaim/export', {
|
||||
...this.queryParams
|
||||
}, `oaClaim_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
|
||||
/******************路由*******************/
|
||||
/** 流程流转记录 */
|
||||
handleDetail(row) {
|
||||
this.$router.push({
|
||||
path: '/workflow/process/detail/' + row.procInsId,
|
||||
query: {
|
||||
processed: false,
|
||||
category:"money"
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
329
ruoyi-ui/src/views/oa/apply/other/index.vue
Normal file
329
ruoyi-ui/src/views/oa/apply/other/index.vue
Normal file
@@ -0,0 +1,329 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<!-- <el-form-item label="流程分类" prop="category">
|
||||
<el-select v-model="queryParams.category" clearable placeholder="请选择" size="small">
|
||||
<el-option
|
||||
v-for="item in categoryOptions"
|
||||
:key="item.categoryId"
|
||||
:label="item.categoryName"
|
||||
:value="item.code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="提交时间">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="btnLoading"
|
||||
@click="handleStart"
|
||||
>发起申请
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="ownProcessList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<!-- <el-table-column label="流程编号" align="center" prop="procInsId" :show-overflow-tooltip="true"/>-->
|
||||
<el-table-column label="申请事由" align="left" prop="procVars" :show-overflow-tooltip="true"/>
|
||||
<!-- <el-table-column label="流程类别" align="center" prop="category" :formatter="categoryFormat" />-->
|
||||
<el-table-column label="当前节点" width="150" align="center" prop="taskName"/>
|
||||
<el-table-column label="提交时间" align="center" prop="createTime" width="160"/>
|
||||
<el-table-column label="当前状态" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.wf_process_status" :value="scope.row.processStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="耗时" align="center" prop="duration" width="130"/>
|
||||
<el-table-column label="操作" align="center" width="240" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-tickets"
|
||||
@click="handleFlowRecord(scope.row)"
|
||||
v-hasPermi="['workflow:process:query']"
|
||||
>详情
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-if="scope.row.finishTime"
|
||||
v-hasPermi="['workflow:process:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-circle-close"
|
||||
@click="handleStop(scope.row)"
|
||||
v-hasPermi="['workflow:process:cancel']"
|
||||
>取消
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-refresh-right"
|
||||
v-hasPermi="['workflow:process:start']"
|
||||
@click="handleAgain(scope.row)"
|
||||
>重新发起
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listOwnProcess, stopProcess, delProcess, listProcess} from '@/api/workflow/process';
|
||||
import {listAllCategory} from '@/api/workflow/category';
|
||||
import {detailProcess} from '@/api/workflow/process'
|
||||
|
||||
export default {
|
||||
name: "Own",
|
||||
dicts: ['wf_process_status'],
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
processLoading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
categoryOptions: [],
|
||||
processTotal: 0,
|
||||
// 我发起的流程列表数据
|
||||
ownProcessList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
process: {},
|
||||
src: "",
|
||||
definitionList: [],
|
||||
// 日期范围
|
||||
dateRange: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
processKey: undefined,
|
||||
processName: undefined,
|
||||
category: "other"
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
btnLoading:true
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getCategoryList();
|
||||
},
|
||||
beforeRouteEnter(to, from, next) {
|
||||
next(vm => {
|
||||
vm.getList()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
handleStart() {
|
||||
const row = this.process
|
||||
this.$router.push({
|
||||
path: '/workflow/process/start/' + row.deploymentId,
|
||||
query: {
|
||||
definitionId: row.definitionId,
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 查询流程分类列表 */
|
||||
getCategoryList() {
|
||||
listAllCategory().then(response => this.categoryOptions = response.data)
|
||||
},
|
||||
/** 查询流程定义列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.btnLoading = true;
|
||||
listOwnProcess(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
listProcess(this.queryParams).then(response => {
|
||||
this.process = response.rows[response.rows.length - 1];
|
||||
this.btnLoading = false;
|
||||
})
|
||||
this.ownProcessList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
/**流程标题搜索**/
|
||||
searchList(list, str) {
|
||||
let arr = [];
|
||||
list.forEach((item) => {
|
||||
if (item.procVars.description.indexOf(str) > -1) {
|
||||
arr.push(item)
|
||||
}
|
||||
})
|
||||
return arr;
|
||||
},
|
||||
|
||||
//对象数组排序(文本类)
|
||||
/* compare(propertyName, order) {
|
||||
return function (object1, object2) {
|
||||
var value1 = object1[propertyName];
|
||||
var value2 = object2[propertyName];
|
||||
if (order == 0) {
|
||||
if (value2 < value1) {
|
||||
return -1;
|
||||
} else if (value2 > value1) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (order == 1) {
|
||||
if (value2 > value1) {
|
||||
return -1;
|
||||
} else if (value2 < value1) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},*/
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
name: null,
|
||||
category: null,
|
||||
key: null,
|
||||
tenantId: null,
|
||||
deployTime: null,
|
||||
derivedFrom: null,
|
||||
derivedFromRoot: null,
|
||||
parentDeploymentId: null,
|
||||
engineVersion: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.procInsId);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
handleAgain(row) {
|
||||
this.$router.push({
|
||||
path: '/workflow/process/start/' + row.deployId,
|
||||
query: {
|
||||
definitionId: row.procDefId,
|
||||
procInsId: row.procInsId
|
||||
}
|
||||
})
|
||||
// console.log(row);
|
||||
},
|
||||
/** 取消流程申请 */
|
||||
handleStop(row) {
|
||||
const params = {
|
||||
procInsId: row.procInsId
|
||||
}
|
||||
stopProcess(params).then(res => {
|
||||
this.$modal.msgSuccess(res.msg);
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
/** 流程流转记录 */
|
||||
handleFlowRecord(row) {
|
||||
this.$router.push({
|
||||
path: '/workflow/process/detail/' + row.procInsId,
|
||||
query: {
|
||||
processed: false
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.procInsId || this.ids;
|
||||
this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function () {
|
||||
return delProcess(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('workflow/process/ownExport', {
|
||||
...this.queryParams
|
||||
}, `wf_own_process_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
categoryFormat(row, column) {
|
||||
return this.categoryOptions.find(k => k.code === row.category)?.categoryName ?? '';
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
329
ruoyi-ui/src/views/oa/apply/seal/index.vue
Normal file
329
ruoyi-ui/src/views/oa/apply/seal/index.vue
Normal file
@@ -0,0 +1,329 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<!-- <el-form-item label="流程分类" prop="category">
|
||||
<el-select v-model="queryParams.category" clearable placeholder="请选择" size="small">
|
||||
<el-option
|
||||
v-for="item in categoryOptions"
|
||||
:key="item.categoryId"
|
||||
:label="item.categoryName"
|
||||
:value="item.code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="提交时间">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="btnLoading"
|
||||
@click="handleStart"
|
||||
>发起用印申请
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="ownProcessList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<!-- <el-table-column label="流程编号" align="center" prop="procInsId" :show-overflow-tooltip="true"/>-->
|
||||
<el-table-column label="用印事由" align="left" prop="procVars" :show-overflow-tooltip="true"/>
|
||||
<!-- <el-table-column label="流程类别" align="center" prop="category" :formatter="categoryFormat" />-->
|
||||
<el-table-column label="当前节点" width="150" align="center" prop="taskName"/>
|
||||
<el-table-column label="提交时间" align="center" prop="createTime" width="160"/>
|
||||
<el-table-column label="当前状态" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.wf_process_status" :value="scope.row.processStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="耗时" align="center" prop="duration" width="130"/>
|
||||
<el-table-column label="操作" align="center" width="240" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-tickets"
|
||||
@click="handleFlowRecord(scope.row)"
|
||||
v-hasPermi="['workflow:process:query']"
|
||||
>详情
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-if="scope.row.finishTime"
|
||||
v-hasPermi="['workflow:process:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-circle-close"
|
||||
@click="handleStop(scope.row)"
|
||||
v-hasPermi="['workflow:process:cancel']"
|
||||
>取消
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-refresh-right"
|
||||
v-hasPermi="['workflow:process:start']"
|
||||
@click="handleAgain(scope.row)"
|
||||
>重新发起
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listOwnProcess, stopProcess, delProcess, listProcess} from '@/api/workflow/process';
|
||||
import {listAllCategory} from '@/api/workflow/category';
|
||||
import {detailProcess} from '@/api/workflow/process'
|
||||
|
||||
export default {
|
||||
name: "Own",
|
||||
dicts: ['wf_process_status'],
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
processLoading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
categoryOptions: [],
|
||||
processTotal: 0,
|
||||
// 我发起的流程列表数据
|
||||
ownProcessList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
process: {},
|
||||
src: "",
|
||||
definitionList: [],
|
||||
// 日期范围
|
||||
dateRange: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
processKey: undefined,
|
||||
processName: undefined,
|
||||
category: "seal"
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
btnLoading:true
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getCategoryList();
|
||||
},
|
||||
beforeRouteEnter(to, from, next) {
|
||||
next(vm => {
|
||||
vm.getList()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
handleStart() {
|
||||
const row = this.process
|
||||
this.$router.push({
|
||||
path: '/workflow/process/start/' + row.deploymentId,
|
||||
query: {
|
||||
definitionId: row.definitionId,
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 查询流程分类列表 */
|
||||
getCategoryList() {
|
||||
listAllCategory().then(response => this.categoryOptions = response.data)
|
||||
},
|
||||
/** 查询流程定义列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.btnLoading = true;
|
||||
listOwnProcess(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
listProcess(this.queryParams).then(response => {
|
||||
this.process = response.rows[response.rows.length - 1];
|
||||
this.btnLoading = false;
|
||||
})
|
||||
this.ownProcessList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
/**流程标题搜索**/
|
||||
searchList(list, str) {
|
||||
let arr = [];
|
||||
list.forEach((item) => {
|
||||
if (item.procVars.description.indexOf(str) > -1) {
|
||||
arr.push(item)
|
||||
}
|
||||
})
|
||||
return arr;
|
||||
},
|
||||
|
||||
//对象数组排序(文本类)
|
||||
/* compare(propertyName, order) {
|
||||
return function (object1, object2) {
|
||||
var value1 = object1[propertyName];
|
||||
var value2 = object2[propertyName];
|
||||
if (order == 0) {
|
||||
if (value2 < value1) {
|
||||
return -1;
|
||||
} else if (value2 > value1) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (order == 1) {
|
||||
if (value2 > value1) {
|
||||
return -1;
|
||||
} else if (value2 < value1) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},*/
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
name: null,
|
||||
category: null,
|
||||
key: null,
|
||||
tenantId: null,
|
||||
deployTime: null,
|
||||
derivedFrom: null,
|
||||
derivedFromRoot: null,
|
||||
parentDeploymentId: null,
|
||||
engineVersion: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.procInsId);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
handleAgain(row) {
|
||||
this.$router.push({
|
||||
path: '/workflow/process/start/' + row.deployId,
|
||||
query: {
|
||||
definitionId: row.procDefId,
|
||||
procInsId: row.procInsId
|
||||
}
|
||||
})
|
||||
// console.log(row);
|
||||
},
|
||||
/** 取消流程申请 */
|
||||
handleStop(row) {
|
||||
const params = {
|
||||
procInsId: row.procInsId
|
||||
}
|
||||
stopProcess(params).then(res => {
|
||||
this.$modal.msgSuccess(res.msg);
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
/** 流程流转记录 */
|
||||
handleFlowRecord(row) {
|
||||
this.$router.push({
|
||||
path: '/workflow/process/detail/' + row.procInsId,
|
||||
query: {
|
||||
processed: false
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.procInsId || this.ids;
|
||||
this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function () {
|
||||
return delProcess(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('workflow/process/ownExport', {
|
||||
...this.queryParams
|
||||
}, `wf_own_process_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
categoryFormat(row, column) {
|
||||
return this.categoryOptions.find(k => k.code === row.category)?.categoryName ?? '';
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
327
ruoyi-ui/src/views/oa/apply/trip/index.vue
Normal file
327
ruoyi-ui/src/views/oa/apply/trip/index.vue
Normal file
@@ -0,0 +1,327 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<!-- <el-form-item label="流程分类" prop="category">
|
||||
<el-select v-model="queryParams.category" clearable placeholder="请选择" size="small">
|
||||
<el-option
|
||||
v-for="item in categoryOptions"
|
||||
:key="item.categoryId"
|
||||
:label="item.categoryName"
|
||||
:value="item.code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="提交时间">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="btnLoading"
|
||||
@click="handleStart"
|
||||
>发起差旅申请
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="ownProcessList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<!-- <el-table-column label="流程编号" align="center" prop="procInsId" :show-overflow-tooltip="true"/>-->
|
||||
<el-table-column label="差旅详情" align="left" prop="procVars" :show-overflow-tooltip="true"/>
|
||||
<!-- <el-table-column label="流程类别" align="center" prop="category" :formatter="categoryFormat" />-->
|
||||
<el-table-column label="当前节点" width="150" align="center" prop="taskName"/>
|
||||
<el-table-column label="提交时间" align="center" prop="createTime" width="160"/>
|
||||
<el-table-column label="当前状态" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.wf_process_status" :value="scope.row.processStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="耗时" align="center" prop="duration" width="130"/>
|
||||
<el-table-column label="操作" align="center" width="240" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-tickets"
|
||||
@click="handleFlowRecord(scope.row)"
|
||||
v-hasPermi="['workflow:process:query']"
|
||||
>详情
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-if="scope.row.finishTime"
|
||||
v-hasPermi="['workflow:process:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-circle-close"
|
||||
@click="handleStop(scope.row)"
|
||||
v-hasPermi="['workflow:process:cancel']"
|
||||
>取消
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-refresh-right"
|
||||
v-hasPermi="['workflow:process:start']"
|
||||
@click="handleAgain(scope.row)"
|
||||
>重新发起
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listAllCategory } from '@/api/workflow/category';
|
||||
import { delProcess, listOwnProcess, listProcess, stopProcess } from '@/api/workflow/process';
|
||||
|
||||
export default {
|
||||
name: "Own",
|
||||
dicts: ['wf_process_status'],
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
processLoading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
categoryOptions: [],
|
||||
processTotal: 0,
|
||||
// 我发起的流程列表数据
|
||||
ownProcessList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
process: {},
|
||||
src: "",
|
||||
definitionList: [],
|
||||
// 日期范围
|
||||
dateRange: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
processKey: undefined,
|
||||
processName: undefined,
|
||||
category: "trip"
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
btnLoading:true
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getCategoryList();
|
||||
},
|
||||
beforeRouteEnter(to, from, next) {
|
||||
next(vm => {
|
||||
vm.getList()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
handleStart() {
|
||||
const row = this.process
|
||||
this.$router.push({
|
||||
path: '/workflow/process/start/' + row.deploymentId,
|
||||
query: {
|
||||
definitionId: row.definitionId,
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 查询流程分类列表 */
|
||||
getCategoryList() {
|
||||
listAllCategory().then(response => this.categoryOptions = response.data)
|
||||
},
|
||||
/** 查询流程定义列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.btnLoading = true;
|
||||
listOwnProcess(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
listProcess(this.queryParams).then(response => {
|
||||
this.process = response.rows[response.rows.length - 1];
|
||||
this.btnLoading = false;
|
||||
})
|
||||
this.ownProcessList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
/**流程标题搜索**/
|
||||
searchList(list, str) {
|
||||
let arr = [];
|
||||
list.forEach((item) => {
|
||||
if (item.procVars.description.indexOf(str) > -1) {
|
||||
arr.push(item)
|
||||
}
|
||||
})
|
||||
return arr;
|
||||
},
|
||||
|
||||
//对象数组排序(文本类)
|
||||
/* compare(propertyName, order) {
|
||||
return function (object1, object2) {
|
||||
var value1 = object1[propertyName];
|
||||
var value2 = object2[propertyName];
|
||||
if (order == 0) {
|
||||
if (value2 < value1) {
|
||||
return -1;
|
||||
} else if (value2 > value1) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (order == 1) {
|
||||
if (value2 > value1) {
|
||||
return -1;
|
||||
} else if (value2 < value1) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},*/
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
name: null,
|
||||
category: null,
|
||||
key: null,
|
||||
tenantId: null,
|
||||
deployTime: null,
|
||||
derivedFrom: null,
|
||||
derivedFromRoot: null,
|
||||
parentDeploymentId: null,
|
||||
engineVersion: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.procInsId);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
handleAgain(row) {
|
||||
this.$router.push({
|
||||
path: '/workflow/process/start/' + row.deployId,
|
||||
query: {
|
||||
definitionId: row.procDefId,
|
||||
procInsId: row.procInsId
|
||||
}
|
||||
})
|
||||
// console.log(row);
|
||||
},
|
||||
/** 取消流程申请 */
|
||||
handleStop(row) {
|
||||
const params = {
|
||||
procInsId: row.procInsId
|
||||
}
|
||||
stopProcess(params).then(res => {
|
||||
this.$modal.msgSuccess(res.msg);
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
/** 流程流转记录 */
|
||||
handleFlowRecord(row) {
|
||||
this.$router.push({
|
||||
path: '/workflow/process/detail/' + row.procInsId,
|
||||
query: {
|
||||
processed: false
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.procInsId || this.ids;
|
||||
this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function () {
|
||||
return delProcess(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('workflow/process/ownExport', {
|
||||
...this.queryParams
|
||||
}, `wf_own_process_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
categoryFormat(row, column) {
|
||||
return this.categoryOptions.find(k => k.code === row.category)?.categoryName ?? '';
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user