1.ico 2.取消申请

main
赵培友 3 years ago
parent d81f8a8bcd
commit b89e99bac2
  1. BIN
      public/favicon.ico
  2. BIN
      public/favicon.png
  3. 2
      public/index.html
  4. 69
      src/views/plugin/workflow/mixins/ex-form.js
  5. 275
      src/views/plugin/workflow/process/components/button.vue
  6. 19
      src/views/plugin/workflow/process/components/form.vue

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

@ -18,7 +18,7 @@
<link rel="stylesheet" href="<%= BASE_URL %>cdn/avue/2.9.12/index.css"> <link rel="stylesheet" href="<%= BASE_URL %>cdn/avue/2.9.12/index.css">
<script src="<%= BASE_URL %>cdn/xlsx/FileSaver.min.js"></script> <script src="<%= BASE_URL %>cdn/xlsx/FileSaver.min.js"></script>
<script src="<%= BASE_URL %>cdn/xlsx/xlsx.full.min.js"></script> <script src="<%= BASE_URL %>cdn/xlsx/xlsx.full.min.js"></script>
<link rel="icon" href="<%= BASE_URL %>favicon.png"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>工单系统</title> <title>工单系统</title>
<style> <style>
html, html,

@ -242,7 +242,7 @@ export default {
if (typeof form.uploadrecord == "string") { if (typeof form.uploadrecord == "string") {
form.uploadrecord = form.uploadrecord.split(""); form.uploadrecord = form.uploadrecord.split("");
} }
startProcess({...form,forcestart: "0",isauto:"0"}) startProcess({ ...form, forcestart: "0", isauto: "0" })
.then((res) => { .then((res) => {
if (res.data.data === "类似任务已经发起过,是否要强制发起") { if (res.data.data === "类似任务已经发起过,是否要强制发起") {
this.$confirm(res.data.data + "?", "提示", { this.$confirm(res.data.data + "?", "提示", {
@ -252,7 +252,7 @@ export default {
}) })
.then(() => { .then(() => {
// 强制发起重复任务 // 强制发起重复任务
startProcess({ ...form, forcestart: "1",isauto:"0" }) startProcess({ ...form, forcestart: "1", isauto: "0" })
.then((res) => { .then((res) => {
if (isExForm === true) { if (isExForm === true) {
resolve(done); resolve(done);
@ -337,6 +337,7 @@ export default {
* @param pass 驳回/通过 * @param pass 驳回/通过
*/ */
handleCompleteTask(pass, variables) { handleCompleteTask(pass, variables) {
console.log(variables);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const { comment, copyUser, assignee, attachment } = const { comment, copyUser, assignee, attachment } =
this.$refs.examineForm.examineForm; this.$refs.examineForm.examineForm;
@ -350,6 +351,7 @@ export default {
return; return;
} }
} }
if (!pass && !comment) { if (!pass && !comment) {
this.$message.error("请填写意见"); this.$message.error("请填写意见");
this.submitLoading = false; this.submitLoading = false;
@ -484,35 +486,56 @@ export default {
} }
this.$refs["user-select"].visible = false; this.$refs["user-select"].visible = false;
}, },
handleWithdrawTask() { handleWithdrawTask(index) {
const { taskId } = this.process; const { taskId } = this.process;
this.$confirm( if (index === 1) {
'<p><span style="color: red;">撤销:</span>撤销终止此流程</p><p><span style="color: red;">撤回:</span>撤回到发起人重新提交,若当前流程不存在发起人节点,功能同撤销</p>', this.$confirm(
"请选择撤销/撤回操作", '<p><span style="color: red;">撤销:</span>撤销终止此流程</p>',
{ "确定要撤销终止此流程吗?",
type: "warning", {
distinguishCancelAndClose: true, type: "warning",
confirmButtonText: "撤销", distinguishCancelAndClose: true,
cancelButtonText: "撤回", confirmButtonText: "确定",
dangerouslyUseHTMLString: true, cancelButtonText: "取消",
} dangerouslyUseHTMLString: true,
) }
.then(() => { ).then(() => {
withdrawTask({ taskId, withdrawType: "wf_withdraw_end" }).then(() => { withdrawTask({ taskId, withdrawType: "wf_withdraw_end" }).then(() => {
this.$message.success("操作成功"); this.$message.success("操作成功");
this.handleCloseTag("/plugin/workflow/process/todo"); this.handleCloseTag("/plugin/workflow/process/workorder");
}); });
}) });
.catch((action) => { } else {
if (action == "cancel") { this.$confirm(
withdrawTask({ taskId, withdrawType: "wf_withdraw_start" }).then( '<p><span style="color: red;">撤销:</span>撤销终止此流程</p><p><span style="color: red;">撤回:</span>撤回到发起人重新提交,若当前流程不存在发起人节点,功能同撤销</p>',
"请选择撤销/撤回操作",
{
type: "warning",
distinguishCancelAndClose: true,
confirmButtonText: "撤销",
cancelButtonText: "撤回",
dangerouslyUseHTMLString: true,
}
)
.then(() => {
withdrawTask({ taskId, withdrawType: "wf_withdraw_end" }).then(
() => { () => {
this.$message.success("操作成功"); this.$message.success("操作成功");
this.handleCloseTag("/plugin/workflow/process/todo"); this.handleCloseTag("/plugin/workflow/process/workorder");
} }
); );
} })
}); .catch((action) => {
if (action == "cancel") {
withdrawTask({ taskId, withdrawType: "wf_withdraw_start" }).then(
() => {
this.$message.success("操作成功");
this.handleCloseTag("/plugin/workflow/process/todo");
}
);
}
});
}
}, },
handlePrint() { handlePrint() {
// 打印 // 打印

@ -1,156 +1,219 @@
<template> <template>
<div> <div>
<div style="height: 120px;"></div> <div style="height: 120px"></div>
<el-row class="foot-item avue-affix" <el-row
:style="{width: isCollapse? 'calc(100% - 80px)': 'calc(100% - 260px)' }" class="foot-item avue-affix"
id="avue-view"> :style="{
width: isCollapse ? 'calc(100% - 80px)' : 'calc(100% - 260px)',
}"
id="avue-view"
>
<template v-if="process.status == 'todo'"> <template v-if="process.status == 'todo'">
<el-button v-if="getButton('wf_pass')" <el-button
type="success" v-if="getButton('wf_pass')"
size="medium" type="success"
v-loading="loading" size="medium"
@click="$emit('examine', true)"> v-loading="loading"
<span v-if="['recall', 'reject'].includes(process.processIsFinished)">重新提交</span> @click="$emit('examine', true)"
<span v-else>{{getButton('wf_pass').name}}</span> >
<span v-if="['recall', 'reject'].includes(process.processIsFinished)"
>重新提交</span
>
<span v-else>{{ getButton("wf_pass").name }}</span>
</el-button> </el-button>
<el-button v-if="getButton('wf_effect') && !['recall', 'reject'].includes(process.processIsFinished)" <el-button
type="success" v-if="
size="medium" getButton('wf_effect') &&
v-loading="loading" !['recall', 'reject'].includes(process.processIsFinished)
@click="$emit('examine', true)"> "
<span >{{getButton('wf_effect').name}}</span> type="success"
size="medium"
v-loading="loading"
@click="$emit('examine', true)"
>
<span>{{ getButton("wf_effect").name }}</span>
</el-button> </el-button>
<el-button v-if="getButton('wf_reject')" <el-button
type="danger" v-if="getButton('wf_reject') && backNodes.length > 1"
size="medium" type="danger"
v-loading="loading" size="medium"
@click="$emit('examine', false)"> v-loading="loading"
<span v-if="backNodes.length > 1">{{getButton('wf_reject').name}}</span> @click="$emit('examine', false)"
<span v-else>取消申请</span> >
<span v-if="backNodes.length > 1">{{
getButton("wf_reject").name
}}</span>
</el-button> </el-button>
<el-button v-if="getButton('wf_transfer')" <el-button
type="primary" v-if="getButton('wf_reject') && backNodes.length == 1"
size="medium" type="danger"
v-loading="loading" size="medium"
@click="$emit('user-select', {type: 'transfer', checkType: 'radio'})">{{getButton('wf_transfer').name}}</el-button> v-loading="loading"
<el-button v-if="getButton('wf_delegate')" @click="$emit('withdraw', 1)"
type="warning" >
size="medium" <span>取消申请</span>
v-loading="loading" </el-button>
@click="$emit('user-select', {type: 'delegate', checkType: 'radio'})">{{getButton('wf_delegate').name}}</el-button> <el-button
<el-button v-if="getButton('wf_rollback')" v-if="getButton('wf_transfer')"
type="success" type="primary"
size="medium" size="medium"
v-loading="loading" v-loading="loading"
@click="handleRollback">{{getButton('wf_rollback').name}}</el-button> @click="
<el-button v-if="getButton('wf_terminate')" $emit('user-select', { type: 'transfer', checkType: 'radio' })
type="danger" "
size="medium" >{{ getButton("wf_transfer").name }}</el-button
v-loading="loading" >
@click="$emit('terminate')">{{getButton('wf_terminate').name}}</el-button> <el-button
<el-button v-if="process.isMultiInstance && getButton('wf_add_instance')" v-if="getButton('wf_delegate')"
type="primary" type="warning"
size="medium" size="medium"
v-loading="loading" v-loading="loading"
@click="$emit('user-select', {type: 'addInstance', checkType: 'checkbox'})">{{getButton('wf_add_instance').name}}</el-button> @click="
$emit('user-select', { type: 'delegate', checkType: 'radio' })
"
>{{ getButton("wf_delegate").name }}</el-button
>
<el-button
v-if="getButton('wf_rollback')"
type="success"
size="medium"
v-loading="loading"
@click="handleRollback"
>{{ getButton("wf_rollback").name }}</el-button
>
<el-button
v-if="getButton('wf_terminate')"
type="danger"
size="medium"
v-loading="loading"
@click="$emit('terminate')"
>{{ getButton("wf_terminate").name }}</el-button
>
<el-button
v-if="process.isMultiInstance && getButton('wf_add_instance')"
type="primary"
size="medium"
v-loading="loading"
@click="
$emit('user-select', { type: 'addInstance', checkType: 'checkbox' })
"
>{{ getButton("wf_add_instance").name }}</el-button
>
</template> </template>
<el-button v-if="permission.wf_process_withdraw && process.isOwner && process.isReturnable && !['recall', 'reject'].includes(process.processIsFinished)" <el-button
type="warning" v-if="
size="medium" permission.wf_process_withdraw &&
v-loading="loading" process.isOwner &&
@click="$emit('withdraw')">撤销</el-button> process.isReturnable &&
<el-button v-if="getButton('wf_print')" !['recall', 'reject'].includes(process.processIsFinished)
type="info" "
size="medium" type="warning"
v-loading="loading" size="medium"
@click="$emit('print')">{{getButton('wf_print').name}}</el-button> v-loading="loading"
@click="$emit('withdraw')"
>撤销</el-button
>
<el-button
v-if="getButton('wf_print')"
type="info"
size="medium"
v-loading="loading"
@click="$emit('print')"
>{{ getButton("wf_print").name }}</el-button
>
</el-row> </el-row>
<el-dialog :visible.sync="nodeVisible" <el-dialog :visible.sync="nodeVisible" append-to-body title="选择回退节点">
append-to-body <avue-form
title="选择回退节点"> v-if="nodeVisible"
<avue-form v-if="nodeVisible" v-model="nodeForm"
v-model="nodeForm" :option="nodeOption"
:option="nodeOption" @submit="handleNodeSubmit"
@submit="handleNodeSubmit"></avue-form> ></avue-form>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { backNodes } from '@/api/plugin/workflow/process' import { backNodes } from "@/api/plugin/workflow/process";
import { mapGetters } from 'vuex' import { mapGetters } from "vuex";
export default { export default {
name: 'wf-button', name: "wf-button",
computed: { computed: {
...mapGetters(['isCollapse', 'permission']), ...mapGetters(["isCollapse", "permission"]),
}, },
props: { props: {
loading: { loading: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
buttonList: { buttonList: {
type: Array, type: Array,
default: () => { default: () => {
return [] return [];
} },
}, },
process: Object, process: Object,
comment: String comment: String,
}, },
data() { data() {
return { return {
nodeVisible: false, nodeVisible: false,
nodeForm: {}, nodeForm: {},
nodeOption: { nodeOption: {
column: [{ column: [
label: '节点', {
prop: 'nodeId', label: "节点",
type: 'select', prop: "nodeId",
props: { type: "select",
label: 'nodeName', props: {
value: 'nodeId' label: "nodeName",
value: "nodeId",
},
span: 24,
rules: [
{ required: true, message: "请选择回退节点", trigger: "change" },
],
}, },
span: 24, ],
rules: [{ required: true, message: '请选择回退节点', trigger: 'change' }]
}]
}, },
backNodes: [] backNodes: [],
} };
}, },
watch: { watch: {
'process.taskId': { "process.taskId": {
handler(val) { handler(val) {
if (val) { if (val) {
backNodes({ taskId: val }).then(res => { backNodes({ taskId: val }).then((res) => {
const list = res.data.data const list = res.data.data;
this.backNodes = list this.backNodes = list;
this.findObject(this.nodeOption.column, 'nodeId').dicData = list this.findObject(this.nodeOption.column, "nodeId").dicData = list;
}) });
} }
}, },
immediate: true immediate: true,
} },
}, },
methods: { methods: {
handleRollback() { // 退 handleRollback() {
// 退
if (!this.comment) { if (!this.comment) {
this.$message.error("请填写批复意见") this.$message.error("请填写批复意见");
return return;
} }
this.nodeVisible = true this.nodeVisible = true;
}, },
handleNodeSubmit() { // 退 handleNodeSubmit() {
const { nodeId } = this.nodeForm // 退
this.$emit('rollback', nodeId) const { nodeId } = this.nodeForm;
this.$emit("rollback", nodeId);
}, },
getButton(key) { getButton(key) {
return this.buttonList.find(b => b.buttonKey == key) return this.buttonList.find((b) => b.buttonKey == key);
} },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -170,4 +233,4 @@ export default {
-webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); -webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
} }
</style> </style>

@ -268,12 +268,14 @@ export default {
renwuzhonglei.dicData = res.data.data; renwuzhonglei.dicData = res.data.data;
}); });
}, },
systemChange(id) { systemChange(id, index) {
let obj = this.taskAndDataBaseList.find(function (i) { let obj = this.taskAndDataBaseList.find(function (i) {
return i.id === id; return i.id === id;
}); });
getModuleAndDataTable({ id: obj.id, type: obj.type }).then((res) => { getModuleAndDataTable({ id: obj.id, type: obj.type }).then((res) => {
this.form.xitongmokuaishujubiao = ""; if (index !== 1) {
this.form.xitongmokuaishujubiao = "";
}
const xitongmokuaishujubiao = this.findObject( const xitongmokuaishujubiao = this.findObject(
this.option.column, this.option.column,
"xitongmokuaishujubiao" "xitongmokuaishujubiao"
@ -317,7 +319,7 @@ export default {
this.form.uploadrecord.splice(index, 1); this.form.uploadrecord.splice(index, 1);
}); });
}, },
getForm(processId, processDefKey) { getForm(processId, processDefKey) {
let param; let param;
let method; let method;
if (processId) { if (processId) {
@ -327,7 +329,7 @@ export default {
param = processDefKey; param = processDefKey;
method = "getStartFormByProcessDefKey"; method = "getStartFormByProcessDefKey";
} }
this[method](param).then(async(res) => { this[method](param).then(async (res) => {
let { process, form, startForm } = res; let { process, form, startForm } = res;
this.form.processId = process.id; this.form.processId = process.id;
if (form) { if (form) {
@ -348,14 +350,14 @@ export default {
option.group = groupArr; option.group = groupArr;
this.option = option; this.option = option;
// //
const companyData = await getCompany() const companyData = await getCompany();
this.companyList = companyData.data.data; this.companyList = companyData.data.data;
if (companyData.data.data.length > 0) { if (companyData.data.data.length > 0) {
const id = companyData.data.data[0].id; const id = companyData.data.data[0].id;
this.form.yunweigongsi = id; this.form.yunweigongsi = id;
this.companyChange(id); this.companyChange(id);
} }
const taskParentData = await getTaskParent() const taskParentData = await getTaskParent();
this.taskParentList = taskParentData.data.data; this.taskParentList = taskParentData.data.data;
if (this.$route.query.parent) { if (this.$route.query.parent) {
const id = this.$route.query.parent; const id = this.$route.query.parent;
@ -376,8 +378,9 @@ export default {
this.initDraft(process.id).then((data) => { this.initDraft(process.id).then((data) => {
this.$confirm("是否恢复之前保存的草稿?", "提示", {}) this.$confirm("是否恢复之前保存的草稿?", "提示", {})
.then(() => { .then(() => {
this.form = JSON.parse(data); const form = JSON.parse(data);
this.systemChange(this.form.xitongmingchengshujuku); this.systemChange(form.xitongmingchengshujuku, 1);
this.form = form
}) })
.catch(() => {}); .catch(() => {});
}); });

Loading…
Cancel
Save