From 7602a824e39e19260ae32bb45e799e6ce43300ac Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期五, 14 七月 2023 21:15:29 +0800
Subject: [PATCH] 参照配置组件修改
---
Source/UBCS-WEB/dist/src/views/work/process/leave/handle.vue | 169 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 169 insertions(+), 0 deletions(-)
diff --git a/Source/UBCS-WEB/dist/src/views/work/process/leave/handle.vue b/Source/UBCS-WEB/dist/src/views/work/process/leave/handle.vue
new file mode 100644
index 0000000..961bf88
--- /dev/null
+++ b/Source/UBCS-WEB/dist/src/views/work/process/leave/handle.vue
@@ -0,0 +1,169 @@
+<template>
+ <basic-container>
+ <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+ <el-row type="flex" class="row-bg" justify="end">
+ <el-form-item>
+ <el-button type="primary" @click="handleAgree">鍚屾剰</el-button>
+ <el-button type="danger" @click="handleDisagree">椹冲洖</el-button>
+ <el-button @click="handleCancel">鍏抽棴</el-button>
+ </el-form-item>
+ </el-row>
+ <el-card shadow="hover">
+ <div slot="header">
+ <span>瀹℃壒淇℃伅</span>
+ </div>
+ <el-form-item label="鐢宠浜�">
+ <el-input :disabled="true" v-model="form.flow.assigneeName"/>
+ </el-form-item>
+ <el-row>
+ <el-col :span="12">
+ <el-form-item label="寮�濮嬫椂闂�">
+ <el-input :disabled="true" v-model="form.startTime"/>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="缁撴潫鏃堕棿">
+ <el-input :disabled="true" v-model="form.endTime"/>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-form-item label="璇峰亣鐞嗙敱">
+ <el-input :disabled="true" type="textarea" v-model="form.reason"/>
+ </el-form-item>
+ <el-form-item label="鎵瑰鎰忚">
+ <el-input type="textarea" v-model="form.comment"/>
+ </el-form-item>
+ </el-card>
+ <el-card shadow="hover">
+ <div slot="header">
+ <span>娴佺▼淇℃伅</span>
+ </div>
+ <el-row type="flex" class="row-bg">
+ <el-timeline>
+ <el-timeline-item :key="flow.id" :timestamp="flow.createTime" v-for="flow in flowList" placement="top">
+ <el-card shadow="hover">
+ <p>{{flow.assigneeName}} 鍦� [{{flow.createTime}}] 寮�濮嬪鐞� [{{flow.historyActivityName}}] 鐜妭</p>
+ <p v-if="flow.historyActivityDurationTime!==''">浠诲姟鍘嗘椂 [{{flow.historyActivityDurationTime}}]</p>
+ <p v-if="flow.comment!==''">鎵瑰鎰忚: [{{flow.comment}}]</p>
+ <p v-if="flow.endTime!==''">缁撴潫鏃堕棿: [{{flow.endTime}}]</p>
+ </el-card>
+ </el-timeline-item>
+ </el-timeline>
+ </el-row>
+ </el-card>
+ <el-card shadow="hover">
+ <div slot="header">
+ <span>娴佺▼璺熻釜</span>
+ </div>
+ <el-row class="row-bg">
+ <flow-design :is-display="true" :process-instance-id="processInstanceId"></flow-design>
+ </el-row>
+ </el-card>
+ </el-form>
+ </basic-container>
+</template>
+
+<script>
+ import {historyFlowList, leaveDetail} from "@/api/work/process";
+ import {completeTask} from "@/api/work/work";
+
+ export default {
+ data() {
+ return {
+ taskId: '',
+ businessId: '',
+ processInstanceId: '',
+ src: '',
+ flowList: [],
+ form: {
+ flow: {
+ assigneeName: '',
+ },
+ startTime: '',
+ endTime: '',
+ reason: '',
+ comment: '',
+ },
+ }
+ },
+ created() {
+ this.init();
+ },
+ beforeRouteUpdate(to, from, next) {
+ // 鍦ㄥ綋鍓嶈矾鐢辨敼鍙橈紝浣嗘槸璇ョ粍浠惰澶嶇敤鏃惰皟鐢�
+ // 涓句緥鏉ヨ锛屽浜庝竴涓甫鏈夊姩鎬佸弬鏁扮殑璺緞 /foo/:id锛屽湪 /foo/1 鍜� /foo/2 涔嬮棿璺宠浆鐨勬椂鍊�
+ // 鐢变簬浼氭覆鏌撳悓鏍风殑 Foo 缁勪欢锛屽洜姝ょ粍浠跺疄渚嬩細琚鐢ㄣ�傝�岃繖涓挬瀛愬氨浼氬湪杩欎釜鎯呭喌涓嬭璋冪敤
+ // 鍙互璁块棶缁勪欢瀹炰緥 `this`
+ if (to.fullPath !== from.fullPath) {
+ next();
+ this.init();
+ }
+ },
+ methods: {
+ init() {
+ this.taskId = this.$route.params.taskId;
+ this.processInstanceId = this.$route.params.processInstanceId;
+ this.businessId = this.$route.params.businessId;
+ historyFlowList(this.processInstanceId).then(res => {
+ const data = res.data;
+ if (data.success) {
+ this.flowList = data.data;
+ }
+ })
+ leaveDetail(this.businessId).then(res => {
+ const data = res.data;
+ if (data.success) {
+ this.form = data.data;
+ }
+ })
+ },
+ handleAgree() {
+ if (!this.form.comment) {
+ this.$message.warning('璇峰厛濉啓鎵瑰鎰忚');
+ return;
+ }
+ const params = {
+ taskId: this.taskId,
+ processInstanceId: this.processInstanceId,
+ flag: 'ok',
+ comment: this.form.comment,
+ };
+ completeTask(params).then(res => {
+ const data = res.data;
+ if (data.success) {
+ this.$message.success(data.msg);
+ this.$router.$avueRouter.closeTag();
+ this.$router.push({path: `/work/start`});
+ } else {
+ this.$message.error(data.msg || '鎻愪氦澶辫触');
+ }
+ })
+ },
+ handleDisagree() {
+ if (!this.form.comment) {
+ this.$message.warning('璇峰厛濉啓鎵瑰鎰忚');
+ return;
+ }
+ const params = {
+ taskId: this.taskId,
+ processInstanceId: this.processInstanceId,
+ comment: this.form.comment,
+ };
+ completeTask(params).then(res => {
+ const data = res.data;
+ if (data.success) {
+ this.$message.success(data.msg);
+ this.$router.$avueRouter.closeTag();
+ this.$router.push({path: `/work/start`});
+ } else {
+ this.$message.error(data.msg || '鎻愪氦澶辫触');
+ }
+ })
+ },
+ handleCancel() {
+ this.$router.$avueRouter.closeTag();
+ this.$router.push({path: `/work/start`});
+ }
+ }
+ }
+</script>
--
Gitblit v1.9.3