From 5e2aafeede13d337380f736567caf74f49713be7 Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Fri, 09 Aug 2024 14:38:32 +0800
Subject: [PATCH] 代码优化
---
src/views/work/process/maintenanceFundApply/handle.vue | 82 ++++++++++++++++++++++-------------------
1 files changed, 44 insertions(+), 38 deletions(-)
diff --git a/src/views/work/process/maintenanceFundApply/handle.vue b/src/views/work/process/maintenanceFundApply/handle.vue
index d911f4d..feb0938 100644
--- a/src/views/work/process/maintenanceFundApply/handle.vue
+++ b/src/views/work/process/maintenanceFundApply/handle.vue
@@ -1,11 +1,11 @@
<template>
<basic-container>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
- <el-row type="flex" class="row-bg" justify="end">
+ <!-- <el-row type="flex" class="row-bg" justify="end">
<el-form-item>
<el-button @click="handleCancel">关闭</el-button>
</el-form-item>
- </el-row>
+ </el-row> -->
<el-card shadow="hover">
<div slot="header">
@@ -22,10 +22,13 @@
<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>
+ <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>
@@ -62,7 +65,7 @@
import {
historyFlowList,
leaveDetail
- } from "@/api/work/process";
+ } from "@/api/work/process"
import {
getList,
@@ -70,10 +73,11 @@
update,
add,
getPropertyCapitalApply
- } from "@/api/property/propertyCapitalApply";
+ } from "@/api/property/propertyCapitalApply"
import {
completeTask
- } from "@/api/work/work";
+ } from "@/api/work/work"
+ import website from '@/config/website'
export default {
data() {
@@ -180,7 +184,7 @@
prop: "allocationWay",
labelWidth: 140,
value: '按建筑面积分摊',
- span: 14,
+ span: 12,
row: true,
disabled: true
},
@@ -289,6 +293,7 @@
label: '施工方案附件',
prop: 'constructionSchemeUrls',
type: 'upload',
+ listType: 'picture-img',
span: 24,
hide: true,
labelWidth: 140,
@@ -311,7 +316,7 @@
}
},
created() {
- this.init();
+ this.init()
},
beforeRouteUpdate(to, from, next) {
// 在当前路由改变,但是该组件被复用时调用
@@ -319,80 +324,81 @@
// 由于会渲染同样的 Foo 组件,因此组件实例会被复用。而这个钩子就会在这个情况下被调用
// 可以访问组件实例 `this`
if (to.fullPath !== from.fullPath) {
- next();
- this.init();
+ next()
+ this.init()
}
},
methods: {
init() {
- this.taskId = this.$route.params.taskId;
- this.processInstanceId = this.$route.params.processInstanceId;
- this.businessId = this.$route.params.businessId;
+ 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;
+ const data = res.data
if (data.success) {
- this.flowList = data.data;
+ this.flowList = data.data
}
})
getPropertyCapitalApply(this.businessId).then(res => {
- const data = res.data;
+ const data = res.data
if (data.success) {
- this.form = data.data;
+ data.data.constructionSchemeUrls = website.minioUrl + data.data.constructionSchemeUrls
+ this.form = data.data
}
})
},
handleAgree() {
if (!this.form.comment) {
- this.$message.warning('请先填写批复意见');
- return;
+ 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;
+ const data = res.data
if (data.success) {
- this.$message.success(data.msg);
- this.$router.$avueRouter.closeTag();
+ this.$message.success(data.msg)
+ this.$router.$avueRouter.closeTag()
this.$router.push({
path: `/work/todo`
- });
+ })
} else {
- this.$message.error(data.msg || '提交失败');
+ this.$message.error(data.msg || '提交失败')
}
})
},
handleDisagree() {
if (!this.form.comment) {
- this.$message.warning('请先填写批复意见');
- return;
+ this.$message.warning('请先填写批复意见')
+ return
}
const params = {
taskId: this.taskId,
processInstanceId: this.processInstanceId,
comment: this.form.comment,
- };
+ }
completeTask(params).then(res => {
- const data = res.data;
+ const data = res.data
if (data.success) {
- this.$message.success(data.msg);
- this.$router.$avueRouter.closeTag();
+ this.$message.success(data.msg)
+ this.$router.$avueRouter.closeTag()
this.$router.push({
path: `/work/todo`
- });
+ })
} else {
- this.$message.error(data.msg || '提交失败');
+ this.$message.error(data.msg || '提交失败')
}
})
},
handleCancel() {
- this.$router.$avueRouter.closeTag();
+ this.$router.$avueRouter.closeTag()
this.$router.push({
path: `/work/todo`
- });
+ })
}
}
}
--
Gitblit v1.9.3