From d72f14301480b146be606cb91455f8fe943309c7 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Mon, 02 Jan 2023 10:17:11 +0800
Subject: [PATCH] 添加申请撤销功能,删除申请撤销包
---
/dev/null | 192 --------------------------------------
src/config/website.js | 2
src/page/login/index.vue | 14 +-
src/api/work/work.js | 6
src/page/login/userlogin.vue | 18 +-
src/views/work/send.vue | 14 ++
6 files changed, 29 insertions(+), 217 deletions(-)
diff --git a/src/api/applicationCancel/applicationCancel.js b/src/api/applicationCancel/applicationCancel.js
deleted file mode 100644
index 81f6d70..0000000
--- a/src/api/applicationCancel/applicationCancel.js
+++ /dev/null
@@ -1,50 +0,0 @@
-import request from '@/router/axios';
-
-export const getList = (current, size, params) => {
- return request({
- url: '/api/applicationCancel/applicationCancel/list',
- method: 'get',
- params: {
- ...params,
- current,
- size,
- }
- })
-}
-
-export const getDetail = (id) => {
- return request({
- url: '/api/applicationCancel/applicationCancel/detail',
- method: 'get',
- params: {
- id
- }
- })
-}
-
-export const remove = (ids) => {
- return request({
- url: '/api/applicationCancel/applicationCancel/remove',
- method: 'post',
- params: {
- ids,
- }
- })
-}
-
-export const add = (row) => {
- return request({
- url: '/api/applicationCancel/applicationCancel/submit',
- method: 'post',
- data: row
- })
-}
-
-export const update = (row) => {
- return request({
- url: '/api/applicationCancel/applicationCancel/submit',
- method: 'post',
- data: row
- })
-}
-
diff --git a/src/api/work/work.js b/src/api/work/work.js
index bd5069a..b7a6b10 100644
--- a/src/api/work/work.js
+++ b/src/api/work/work.js
@@ -80,12 +80,10 @@
})
}
-export const withdrawTask = (userId) => {
+export const withdrawTask = (row) => {
return request({
url: '/api/blade-flow/work/withdraw-task',
method: 'post',
- params: {
- userId
- }
+ data:row
})
}
diff --git a/src/config/website.js b/src/config/website.js
index 27efe4a..8875077 100644
--- a/src/config/website.js
+++ b/src/config/website.js
@@ -2,7 +2,7 @@
* 全局配置文件
*/
export default {
- title: "saber",
+ // title: "saber",
logo: "S",
key: 'saber',//配置主键,目前用于存储
indexTitle: '大件审批系统',
diff --git a/src/const/applicationCancel/applicationCancel.js b/src/const/applicationCancel/applicationCancel.js
deleted file mode 100644
index 09b1da3..0000000
--- a/src/const/applicationCancel/applicationCancel.js
+++ /dev/null
@@ -1,105 +0,0 @@
-export default {
- height:'auto',
- calcHeight: 30,
- tip: false,
- searchShow: true,
- searchMenuSpan: 6,
- border: true,
- index: true,
- viewBtn: true,
- selection: true,
- dialogClickModal: false,
- column: [
- {
- label: "主键",
- prop: "id",
- type: "input",
- addDisplay: false,
- editDisplay: false,
- viewDisplay: false,
- hide: true,
- },
- {
- label: "申请表主键",
- prop: "applicationId",
- type: "input",
- },
- {
- label: "撤销原因",
- prop: "content",
- type: "input",
- },
- {
- label: "租户id",
- prop: "tenantId",
- type: "input",
- addDisplay: false,
- editDisplay: false,
- viewDisplay: false,
- hide: true,
- },
- {
- label: "创建人",
- prop: "createUser",
- type: "input",
- addDisplay: false,
- editDisplay: false,
- viewDisplay: false,
- hide: true,
- },
- {
- label: "创建部门",
- prop: "createDept",
- type: "input",
- addDisplay: false,
- editDisplay: false,
- viewDisplay: false,
- hide: true,
- },
- {
- label: "创建时间",
- prop: "createTime",
- type: "input",
- addDisplay: false,
- editDisplay: false,
- viewDisplay: false,
- hide: true,
- },
- {
- label: "修改人",
- prop: "updateUser",
- type: "input",
- addDisplay: false,
- editDisplay: false,
- viewDisplay: false,
- hide: true,
- },
- {
- label: "修改时间",
- prop: "updateTime",
- type: "input",
- addDisplay: false,
- editDisplay: false,
- viewDisplay: false,
- hide: true,
- },
- {
- label: "状态",
- prop: "status",
- type: "input",
- addDisplay: false,
- editDisplay: false,
- viewDisplay: false,
- hide: true,
- },
- {
- label: "是否已删除",
- prop: "isDeleted",
- type: "input",
- addDisplay: false,
- editDisplay: false,
- viewDisplay: false,
- hide: true,
- },
- ]
-}
diff --git a/src/page/login/index.vue b/src/page/login/index.vue
index d04c978..53d066a 100644
--- a/src/page/login/index.vue
+++ b/src/page/login/index.vue
@@ -36,17 +36,17 @@
<div class="login-main">
<h4 class="login-title">
{{ $t('login.title') }}{{website.title}}
- <top-lang></top-lang>
+<!-- <top-lang></top-lang>-->
</h4>
<userLogin v-if="activeName==='user'"></userLogin>
<codeLogin v-else-if="activeName==='code'"></codeLogin>
<thirdLogin v-else-if="activeName==='third'"></thirdLogin>
- <div class="login-menu">
- <a href="#" @click.stop="activeName='user'">{{ $t('login.userLogin') }}</a>
- <!--<a href="#" @click.stop="activeName='code'">{{ $t('login.phoneLogin') }}</a>-->
- <a href="#" @click.stop="activeName='third'">{{ $t('login.thirdLogin') }}</a>
- <a :href="website.ssoUrl + website.redirectUri">{{ $t('login.ssoLogin') }}</a>
- </div>
+<!-- <div class="login-menu">-->
+<!-- <a href="#" @click.stop="activeName='user'">{{ $t('login.userLogin') }}</a>-->
+<!-- <!–<a href="#" @click.stop="activeName='code'">{{ $t('login.phoneLogin') }}</a>–>-->
+<!-- <a href="#" @click.stop="activeName='third'">{{ $t('login.thirdLogin') }}</a>-->
+<!-- <a :href="website.ssoUrl + website.redirectUri">{{ $t('login.ssoLogin') }}</a>-->
+<!-- </div>-->
</div>
</div>
diff --git a/src/page/login/userlogin.vue b/src/page/login/userlogin.vue
index a70c2c6..b8f1b03 100644
--- a/src/page/login/userlogin.vue
+++ b/src/page/login/userlogin.vue
@@ -5,15 +5,15 @@
ref="loginForm"
:model="loginForm"
label-width="0">
- <el-form-item v-if="tenantMode" prop="tenantId">
- <el-input size="small"
- @keyup.enter.native="handleLogin"
- v-model="loginForm.tenantId"
- auto-complete="off"
- :placeholder="$t('login.tenantId')">
- <i slot="prefix" class="icon-quanxian"/>
- </el-input>
- </el-form-item>
+<!-- <el-form-item v-if="tenantMode" prop="tenantId">-->
+<!-- <el-input size="small"-->
+<!-- @keyup.enter.native="handleLogin"-->
+<!-- v-model="loginForm.tenantId"-->
+<!-- auto-complete="off"-->
+<!-- :placeholder="$t('login.tenantId')">-->
+<!-- <i slot="prefix" class="icon-quanxian"/>-->
+<!-- </el-input>-->
+<!-- </el-form-item>-->
<el-form-item prop="username">
<el-input size="small"
@keyup.enter.native="handleLogin"
diff --git a/src/views/applicationCancel/applicationCancel.vue b/src/views/applicationCancel/applicationCancel.vue
deleted file mode 100644
index a8dc9aa..0000000
--- a/src/views/applicationCancel/applicationCancel.vue
+++ /dev/null
@@ -1,192 +0,0 @@
-<template>
- <basic-container>
- <avue-crud :option="option"
- :table-loading="loading"
- :data="data"
- :page.sync="page"
- :permission="permissionList"
- :before-open="beforeOpen"
- v-model="form"
- ref="crud"
- @row-update="rowUpdate"
- @row-save="rowSave"
- @row-del="rowDel"
- @search-change="searchChange"
- @search-reset="searchReset"
- @selection-change="selectionChange"
- @current-change="currentChange"
- @size-change="sizeChange"
- @refresh-change="refreshChange"
- @on-load="onLoad">
- <template slot="menuLeft">
- <el-button type="danger"
- size="small"
- icon="el-icon-delete"
- plain
- v-if="permission.applicationCancel_delete"
- @click="handleDelete">删 除
- </el-button>
- </template>
- <template slot-scope="{type,size,row,index}" slot="menu">
- <el-button icon="el-icon-view" :size="size" :type="type" @click="$refs.crud.rowView(row,index)">查 看</el-button>
- <el-button icon="el-icon-edit" :size="size" :type="type" @click="$refs.crud.rowEdit(row,index)">处 理</el-button>
- </template>
- </avue-crud>
- </basic-container>
-</template>
-
-<script>
- import {getList, getDetail, add, update, remove} from "@/api/applicationCancel/applicationCancel";
- import option from "@/const/applicationCancel/applicationCancel";
- import {mapGetters} from "vuex";
-
- export default {
- data() {
- return {
- form: {},
- query: {},
- loading: true,
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- },
- selectionList: [],
- option: option,
- data: []
- };
- },
- computed: {
- ...mapGetters(["permission"]),
- permissionList() {
- return {
- addBtn: this.vaildData(this.permission.applicationCancel_add, true),
- viewBtn: this.vaildData(this.permission.applicationCancel_view, true),
- delBtn: this.vaildData(this.permission.applicationCancel_delete, true),
- editBtn: this.vaildData(this.permission.applicationCancel_edit, true)
- };
- },
- ids() {
- let ids = [];
- this.selectionList.forEach(ele => {
- ids.push(ele.id);
- });
- return ids.join(",");
- }
- },
- methods: {
- rowSave(row, done, loading) {
- add(row).then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- done();
- }, error => {
- loading();
- window.console.log(error);
- });
- },
- rowUpdate(row, index, done, loading) {
- update(row).then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- done();
- }, error => {
- loading();
- console.log(error);
- });
- },
- rowDel(row) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- return remove(row.id);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- });
- },
- handleDelete() {
- if (this.selectionList.length === 0) {
- this.$message.warning("请选择至少一条数据");
- return;
- }
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- return remove(this.ids);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- this.$refs.crud.toggleSelection();
- });
- },
- beforeOpen(done, type) {
- if (["edit", "view"].includes(type)) {
- getDetail(this.form.id).then(res => {
- this.form = res.data.data;
- });
- }
- done();
- },
- searchReset() {
- this.query = {};
- this.onLoad(this.page);
- },
- searchChange(params, done) {
- this.query = params;
- this.page.currentPage = 1;
- this.onLoad(this.page, params);
- done();
- },
- selectionChange(list) {
- this.selectionList = list;
- },
- selectionClear() {
- this.selectionList = [];
- this.$refs.crud.toggleSelection();
- },
- currentChange(currentPage){
- this.page.currentPage = currentPage;
- },
- sizeChange(pageSize){
- this.page.pageSize = pageSize;
- },
- refreshChange() {
- this.onLoad(this.page, this.query);
- },
- onLoad(page, params = {}) {
- this.loading = true;
- getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
- const data = res.data.data;
- this.page.total = data.total;
- this.data = data.records;
- this.loading = false;
- this.selectionClear();
- });
- }
- }
- };
-</script>
-
-<style>
-</style>
diff --git a/src/views/work/send.vue b/src/views/work/send.vue
index 4d6ed2b..57c78cf 100644
--- a/src/views/work/send.vue
+++ b/src/views/work/send.vue
@@ -23,6 +23,7 @@
<el-button type="text"
size="small"
icon="el-icon-delete"
+ :disabled="scope.row.processIsFinished === 'finished' || scope.row.processIsFinished ==='withdraw' "
@click.stop="handleCancel(scope.row)">撤 销
</el-button>
<el-button type="text"
@@ -38,7 +39,7 @@
</template>
<template slot-scope="{row}"
slot="processIsFinished">
- <el-tag>{{row.processIsFinished==='finished' ? '已完成' : '未完成'}}</el-tag>
+ <el-tag>{{row.processIsFinished==='finished' ? '已完成' : row.processIsFinished ==='withdraw'?'自行撤销':'未完成'}}</el-tag>
</template>
</avue-crud>
<flow-design is-dialog :is-display.sync="flowBox" :process-instance-id="processInstanceId"></flow-design>
@@ -189,9 +190,14 @@
});
},
handleCancel(row){
- console.log(row)
- withdrawTask(this.userInfo.user_id).then(res=>{
- this.$message(res.data.msg)
+ withdrawTask(row).then(res=>{
+ if (res.data.code == 200){
+ this.$message.success(res.data.msg)
+ }else {
+ this.$message.error(res.data.msg)
+ }
+
+ this.onLoad(this.page,this.query)
})
}
}
--
Gitblit v1.9.3