|
@@ -1,17 +1,28 @@
|
|
|
<template>
|
|
|
<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="68px"
|
|
|
+ >
|
|
|
<el-form-item label="申请编号" prop="applyNum">
|
|
|
<el-input
|
|
|
v-model="queryParams.applyNum"
|
|
|
placeholder="请输入申请编号"
|
|
|
clearable
|
|
|
size="small"
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="高压停电" prop="highVoltage">
|
|
|
- <el-select v-model="queryParams.highVoltage" placeholder="请选择是否高压停电" clearable size="small">
|
|
|
+ <el-select
|
|
|
+ v-model="queryParams.highVoltage"
|
|
|
+ placeholder="请选择是否高压停电"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ >
|
|
|
<el-option label="否" value="0" />
|
|
|
<el-option label="是" value="1" />
|
|
|
</el-select>
|
|
@@ -22,15 +33,19 @@
|
|
|
placeholder="请输入申请人"
|
|
|
clearable
|
|
|
size="small"
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="申请时间" prop="applyTime">
|
|
|
- <el-date-picker clearable size="small" style="width: 200px"
|
|
|
+ <el-date-picker
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ style="width: 200px"
|
|
|
v-model="queryParams.applyTime"
|
|
|
type="date"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
- placeholder="选择申请时间">
|
|
|
+ placeholder="选择申请时间"
|
|
|
+ >
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="流程实例" prop="instanceId">
|
|
@@ -39,12 +54,20 @@
|
|
|
placeholder="请输入流程实例ID"
|
|
|
clearable
|
|
|
size="small"
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
+ <el-button
|
|
|
+ type="cyan"
|
|
|
+ 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>
|
|
|
|
|
@@ -56,27 +79,69 @@
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
v-hasPermi="['example:demo:add']"
|
|
|
- >新增</el-button>
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ <right-toolbar
|
|
|
+ :showSearch="showSearch"
|
|
|
+ @queryTable="getList"
|
|
|
+ ></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-table v-loading="loading" :data="demoList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table
|
|
|
+ v-loading="loading"
|
|
|
+ :data="demoList"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ >
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<el-table-column label="ID" align="center" prop="id" width="60" />
|
|
|
- <el-table-column label="申请编号" align="center" prop="applyNum" width="120" />
|
|
|
- <el-table-column label="是否高压停电" align="center" prop="highVoltage" width="100">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ scope.row.highVoltage === '0' ? '否' : '是' }}</span>
|
|
|
+ <el-table-column
|
|
|
+ label="申请编号"
|
|
|
+ align="center"
|
|
|
+ prop="applyNum"
|
|
|
+ width="120"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="是否高压停电"
|
|
|
+ align="center"
|
|
|
+ prop="highVoltage"
|
|
|
+ width="100"
|
|
|
+ >
|
|
|
+ <template :slot-scope="scope">
|
|
|
+ <span>{{ scope.row.highVoltage === "0" ? "否" : "是" }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="申请人" align="center" prop="applyUserName" width="90" />
|
|
|
- <el-table-column label="申请时间" align="center" prop="applyTime" width="180" />
|
|
|
- <el-table-column label="流程实例ID" align="center" prop="instanceId" width="100" />
|
|
|
+ <el-table-column
|
|
|
+ label="申请人"
|
|
|
+ align="center"
|
|
|
+ prop="applyUserName"
|
|
|
+ width="90"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="申请时间"
|
|
|
+ align="center"
|
|
|
+ prop="applyTime"
|
|
|
+ width="180"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="流程实例ID"
|
|
|
+ align="center"
|
|
|
+ prop="instanceId"
|
|
|
+ width="100"
|
|
|
+ />
|
|
|
<el-table-column label="备注" align="center" prop="remark" width="180" />
|
|
|
- <el-table-column label="当前任务名称" align="center" prop="taskName" width="150" />
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
- <template slot-scope="scope">
|
|
|
+ <el-table-column
|
|
|
+ label="当前任务名称"
|
|
|
+ align="center"
|
|
|
+ prop="taskName"
|
|
|
+ width="150"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ label="操作"
|
|
|
+ align="center"
|
|
|
+ class-name="small-padding fixed-width"
|
|
|
+ >
|
|
|
+ <template :slot-scope="scope">
|
|
|
<!--本案例提交申请前有做会签参与人选择的操作,因此不引入 ApplyBefore 子组件-->
|
|
|
<el-button
|
|
|
v-show="!scope.row.instanceId"
|
|
@@ -84,21 +149,24 @@
|
|
|
type="text"
|
|
|
icon="el-icon-check"
|
|
|
@click="handleApplyView(scope.row)"
|
|
|
- >提交申请</el-button>
|
|
|
+ >提交申请</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
v-show="!scope.row.instanceId"
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
- >修改</el-button>
|
|
|
+ >修改</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
v-show="!scope.row.instanceId"
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
- >删除</el-button>
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
<apply-after
|
|
|
v-show="scope.row.instanceId"
|
|
|
:row="scope.row"
|
|
@@ -111,15 +179,15 @@
|
|
|
</el-table>
|
|
|
|
|
|
<pagination
|
|
|
- v-show="total>0"
|
|
|
+ v-show="total > 0"
|
|
|
:total="total"
|
|
|
- :page.sync="queryParams.pageNum"
|
|
|
- :limit.sync="queryParams.pageSize"
|
|
|
+ :page="queryParams.pageNum"
|
|
|
+ :limit="queryParams.pageSize"
|
|
|
@pagination="getList"
|
|
|
/>
|
|
|
|
|
|
<!-- 添加或修改示例Demo对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
+ <el-dialog :title="title" :visible="open" width="500px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
|
|
<el-form-item label="申请编号" prop="applyNum">
|
|
|
<el-input v-model="form.applyNum" placeholder="请输入申请编号" />
|
|
@@ -131,17 +199,28 @@
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
- <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
|
|
+ <el-input
|
|
|
+ v-model="form.remark"
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
- <el-button @click="cancel">取 消</el-button>
|
|
|
- </div>
|
|
|
+ <template v-slot:footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</el-dialog>
|
|
|
|
|
|
<!--选择会签参与人对话框-->
|
|
|
- <el-dialog title="选择调度会会签参与人" :visible.sync="showSelectUser" width="400px" append-to-body>
|
|
|
+ <el-dialog
|
|
|
+ title="选择调度会会签参与人"
|
|
|
+ :visible="showSelectUser"
|
|
|
+ width="400px"
|
|
|
+ append-to-body
|
|
|
+ >
|
|
|
<el-form ref="selectUserForm" :rules="selectUserRules" label-width="80px">
|
|
|
<el-form-item label="参与人">
|
|
|
<el-select v-model="userNames" multiple placeholder="请选择">
|
|
@@ -155,23 +234,36 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="handleApply">确 定</el-button>
|
|
|
- <el-button @click="userNames=[];showSelectUser=false">取 消</el-button>
|
|
|
- </div>
|
|
|
+ <template v-slot:footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="handleApply">确 定</el-button>
|
|
|
+ <el-button
|
|
|
+ @click="
|
|
|
+ userNames = [];
|
|
|
+ showSelectUser = false;
|
|
|
+ "
|
|
|
+ >取 消</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listDemo, getDemo, delDemo, addDemo, updateDemo, exportDemo } from "@/api/example/demo";
|
|
|
+import {
|
|
|
+ listDemo,
|
|
|
+ getDemo,
|
|
|
+ delDemo,
|
|
|
+ addDemo,
|
|
|
+ updateDemo,
|
|
|
+ exportDemo,
|
|
|
+} from "@/api/example/demo";
|
|
|
import ApplyBefore from "@/components/Activiti/ApplyBefore/index";
|
|
|
import ApplyAfter from "@/components/Activiti/ApplyAfter/index";
|
|
|
import { listUser } from "@/api/system/user";
|
|
|
-import request from '@/utils/request'
|
|
|
-
|
|
|
+import request from "@/utils/request";
|
|
|
export default {
|
|
|
- name: "Demo",
|
|
|
components: {
|
|
|
ApplyBefore,
|
|
|
ApplyAfter,
|
|
@@ -213,20 +305,20 @@ export default {
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
applyNum: [
|
|
|
- { required: true, message: "申请编号不能为空", trigger: "blur" }
|
|
|
+ { required: true, message: "申请编号不能为空", trigger: "blur" },
|
|
|
],
|
|
|
highVoltage: [
|
|
|
- { required: true, message: "是否高压停电不能为空", trigger: "blur" }
|
|
|
+ { required: true, message: "是否高压停电不能为空", trigger: "blur" },
|
|
|
],
|
|
|
},
|
|
|
- requestMapping: '/example/demo',
|
|
|
+ requestMapping: "/example/demo",
|
|
|
|
|
|
selectedRow: {},
|
|
|
selectUserForm: {},
|
|
|
showSelectUser: false,
|
|
|
selectUserRules: {
|
|
|
userOptions: [
|
|
|
- { required: true, message: '参与人不能为空', trigger: 'blur' },
|
|
|
+ { required: true, message: "参与人不能为空", trigger: "blur" },
|
|
|
],
|
|
|
},
|
|
|
userOptions: [],
|
|
@@ -240,12 +332,13 @@ export default {
|
|
|
/** 查询示例Demo列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
- listDemo(this.queryParams).then(response => {
|
|
|
- this.demoList = response.rows;
|
|
|
- this.total = response.total;
|
|
|
- this.loading = false;
|
|
|
- }).then(() => {
|
|
|
- });
|
|
|
+ listDemo(this.queryParams)
|
|
|
+ .then((response) => {
|
|
|
+ this.demoList = response.rows;
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
+ .then(() => {});
|
|
|
},
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
@@ -268,7 +361,7 @@ export default {
|
|
|
createTime: null,
|
|
|
updateBy: null,
|
|
|
updateTime: null,
|
|
|
- remark: null
|
|
|
+ remark: null,
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
},
|
|
@@ -284,9 +377,9 @@ export default {
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.id)
|
|
|
- this.single = selection.length!==1
|
|
|
- this.multiple = !selection.length
|
|
|
+ this.ids = selection.map((item) => item.id);
|
|
|
+ this.single = selection.length !== 1;
|
|
|
+ this.multiple = !selection.length;
|
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
@@ -297,8 +390,8 @@ export default {
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
this.reset();
|
|
|
- const id = row.id || this.ids
|
|
|
- getDemo(id).then(response => {
|
|
|
+ const id = row.id || this.ids;
|
|
|
+ getDemo(id).then((response) => {
|
|
|
this.form = response.data;
|
|
|
this.open = true;
|
|
|
this.title = "修改示例Demo";
|
|
@@ -306,16 +399,16 @@ export default {
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
+ this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (this.form.id != null) {
|
|
|
- updateDemo(this.form).then(response => {
|
|
|
+ updateDemo(this.form).then((response) => {
|
|
|
this.msgSuccess("修改成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
});
|
|
|
} else {
|
|
|
- addDemo(this.form).then(response => {
|
|
|
+ addDemo(this.form).then((response) => {
|
|
|
this.msgSuccess("新增成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
@@ -327,33 +420,41 @@ export default {
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
const ids = row.id || this.ids;
|
|
|
- this.$confirm('是否确认删除示例Demo编号为"' + ids + '"的数据项?', "警告", {
|
|
|
+ this.$confirm(
|
|
|
+ '是否确认删除示例Demo编号为"' + ids + '"的数据项?',
|
|
|
+ "警告",
|
|
|
+ {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(function() {
|
|
|
+ type: "warning",
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(function () {
|
|
|
return delDemo(ids);
|
|
|
- }).then(() => {
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
this.getList();
|
|
|
this.msgSuccess("删除成功");
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
const queryParams = this.queryParams;
|
|
|
- this.$confirm('是否确认导出所有示例Demo数据项?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(function() {
|
|
|
+ this.$confirm("是否确认导出所有示例Demo数据项?", "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(function () {
|
|
|
return exportDemo(queryParams);
|
|
|
- }).then(response => {
|
|
|
- this.download(response.msg);
|
|
|
})
|
|
|
+ .then((response) => {
|
|
|
+ this.download(response.msg);
|
|
|
+ });
|
|
|
},
|
|
|
handleApply: function () {
|
|
|
if (this.userNames.length === 0) {
|
|
|
- this.msgError('请先选择会签参与人');
|
|
|
+ this.msgError("请先选择会签参与人");
|
|
|
return;
|
|
|
}
|
|
|
const selectedRow = this.selectedRow;
|
|
@@ -362,19 +463,23 @@ export default {
|
|
|
this.$confirm('是否提交ID为"' + selectedRow.id + '"的申请单据?', "警告", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(function() {
|
|
|
- return request({
|
|
|
- url: requestMapping + '/submitApply/' + selectedRow.id,
|
|
|
- method: 'post',
|
|
|
- params: { "variablesStr": { "gytd": selectedRow.highVoltage, "users": userNames } },
|
|
|
- });
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.msgSuccess("申请成功");
|
|
|
- this.userNames = [];
|
|
|
- this.showSelectUser = false;
|
|
|
+ type: "warning",
|
|
|
})
|
|
|
+ .then(function () {
|
|
|
+ return request({
|
|
|
+ url: requestMapping + "/submitApply/" + selectedRow.id,
|
|
|
+ method: "post",
|
|
|
+ params: {
|
|
|
+ variablesStr: { gytd: selectedRow.highVoltage, users: userNames },
|
|
|
+ },
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.msgSuccess("申请成功");
|
|
|
+ this.userNames = [];
|
|
|
+ this.showSelectUser = false;
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
handleApplyView(row) {
|
|
@@ -385,12 +490,10 @@ export default {
|
|
|
|
|
|
/** 查询用户列表 */
|
|
|
getUserList() {
|
|
|
- listUser().then(response => {
|
|
|
- this.userOptions = response.rows;
|
|
|
- }
|
|
|
- );
|
|
|
+ listUser().then((response) => {
|
|
|
+ this.userOptions = response.rows;
|
|
|
+ });
|
|
|
},
|
|
|
-
|
|
|
- }
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|