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. 31
      src/views/plugin/workflow/mixins/ex-form.js
  5. 205
      src/views/plugin/workflow/process/components/button.vue
  6. 13
      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,

@ -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,8 +486,26 @@ 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;
if (index === 1) {
this.$confirm(
'<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.handleCloseTag("/plugin/workflow/process/workorder");
});
});
} else {
this.$confirm( this.$confirm(
'<p><span style="color: red;">撤销:</span>撤销终止此流程</p><p><span style="color: red;">撤回:</span>撤回到发起人重新提交,若当前流程不存在发起人节点,功能同撤销</p>', '<p><span style="color: red;">撤销:</span>撤销终止此流程</p><p><span style="color: red;">撤回:</span>撤回到发起人重新提交,若当前流程不存在发起人节点,功能同撤销</p>',
"请选择撤销/撤回操作", "请选择撤销/撤回操作",
@ -498,10 +518,12 @@ export default {
} }
) )
.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) => { .catch((action) => {
if (action == "cancel") { if (action == "cancel") {
@ -513,6 +535,7 @@ export default {
); );
} }
}); });
}
}, },
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
v-if="getButton('wf_pass')"
type="success" type="success"
size="medium" size="medium"
v-loading="loading" v-loading="loading"
@click="$emit('examine', true)"> @click="$emit('examine', true)"
<span v-if="['recall', 'reject'].includes(process.processIsFinished)">重新提交</span> >
<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
v-if="
getButton('wf_effect') &&
!['recall', 'reject'].includes(process.processIsFinished)
"
type="success" type="success"
size="medium" size="medium"
v-loading="loading" v-loading="loading"
@click="$emit('examine', true)"> @click="$emit('examine', true)"
<span >{{getButton('wf_effect').name}}</span> >
<span>{{ getButton("wf_effect").name }}</span>
</el-button> </el-button>
<el-button v-if="getButton('wf_reject')" <el-button
v-if="getButton('wf_reject') && backNodes.length > 1"
type="danger" type="danger"
size="medium" size="medium"
v-loading="loading" v-loading="loading"
@click="$emit('examine', false)"> @click="$emit('examine', false)"
<span v-if="backNodes.length > 1">{{getButton('wf_reject').name}}</span> >
<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
v-if="getButton('wf_reject') && backNodes.length == 1"
type="danger"
size="medium"
v-loading="loading"
@click="$emit('withdraw', 1)"
>
<span>取消申请</span>
</el-button>
<el-button
v-if="getButton('wf_transfer')"
type="primary" type="primary"
size="medium" size="medium"
v-loading="loading" v-loading="loading"
@click="$emit('user-select', {type: 'transfer', checkType: 'radio'})">{{getButton('wf_transfer').name}}</el-button> @click="
<el-button v-if="getButton('wf_delegate')" $emit('user-select', { type: 'transfer', checkType: 'radio' })
"
>{{ getButton("wf_transfer").name }}</el-button
>
<el-button
v-if="getButton('wf_delegate')"
type="warning" type="warning"
size="medium" size="medium"
v-loading="loading" v-loading="loading"
@click="$emit('user-select', {type: 'delegate', checkType: 'radio'})">{{getButton('wf_delegate').name}}</el-button> @click="
<el-button v-if="getButton('wf_rollback')" $emit('user-select', { type: 'delegate', checkType: 'radio' })
"
>{{ getButton("wf_delegate").name }}</el-button
>
<el-button
v-if="getButton('wf_rollback')"
type="success" type="success"
size="medium" size="medium"
v-loading="loading" v-loading="loading"
@click="handleRollback">{{getButton('wf_rollback').name}}</el-button> @click="handleRollback"
<el-button v-if="getButton('wf_terminate')" >{{ getButton("wf_rollback").name }}</el-button
>
<el-button
v-if="getButton('wf_terminate')"
type="danger" type="danger"
size="medium" size="medium"
v-loading="loading" v-loading="loading"
@click="$emit('terminate')">{{getButton('wf_terminate').name}}</el-button> @click="$emit('terminate')"
<el-button v-if="process.isMultiInstance && getButton('wf_add_instance')" >{{ getButton("wf_terminate").name }}</el-button
>
<el-button
v-if="process.isMultiInstance && getButton('wf_add_instance')"
type="primary" type="primary"
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: '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
v-if="
permission.wf_process_withdraw &&
process.isOwner &&
process.isReturnable &&
!['recall', 'reject'].includes(process.processIsFinished)
"
type="warning" type="warning"
size="medium" size="medium"
v-loading="loading" v-loading="loading"
@click="$emit('withdraw')">撤销</el-button> @click="$emit('withdraw')"
<el-button v-if="getButton('wf_print')" >撤销</el-button
>
<el-button
v-if="getButton('wf_print')"
type="info" type="info"
size="medium" size="medium"
v-loading="loading" v-loading="loading"
@click="$emit('print')">{{getButton('wf_print').name}}</el-button> @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"></avue-form> @submit="handleNodeSubmit"
></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",
type: "select",
props: { props: {
label: 'nodeName', label: "nodeName",
value: 'nodeId' value: "nodeId",
}, },
span: 24, span: 24,
rules: [{ required: true, message: '请选择回退节点', trigger: 'change' }] 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>

@ -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) => {
if (index !== 1) {
this.form.xitongmokuaishujubiao = ""; this.form.xitongmokuaishujubiao = "";
}
const xitongmokuaishujubiao = this.findObject( const xitongmokuaishujubiao = this.findObject(
this.option.column, this.option.column,
"xitongmokuaishujubiao" "xitongmokuaishujubiao"
@ -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