From 15be1cdf63a5c531f218c7d66e3e28f85897cf07 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期五, 15 十二月 2023 11:31:07 +0800
Subject: [PATCH] 整合代码
---
Source/UBCS-WEB/src/views/wel/Statistic.vue | 38 ++++++++++++++++++--------------------
1 files changed, 18 insertions(+), 20 deletions(-)
diff --git a/Source/UBCS-WEB/src/views/wel/Statistic.vue b/Source/UBCS-WEB/src/views/wel/Statistic.vue
index 4022fd5..4b74518 100644
--- a/Source/UBCS-WEB/src/views/wel/Statistic.vue
+++ b/Source/UBCS-WEB/src/views/wel/Statistic.vue
@@ -53,7 +53,7 @@
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
- <el-button plain type="primary" @click="SaveHandler">淇濆瓨</el-button>
+ <el-button plain type="primary" @click="SaveHandler" v-loading="BtnLoading">淇濆瓨</el-button>
</div>
</el-dialog>
</div>
@@ -66,6 +66,7 @@
name: "Statistic",
data() {
return {
+ BtnLoading: false,
loading: true,
Crud: {
form: '',
@@ -109,7 +110,7 @@
info.style.fontSize = '16px';
});
items.forEach((item) => {
- item.style.border = '1px solid #E4E7ED';
+ item.style.border = '1px solid #DCDFE6';
});
this.loading = false;
}, 1000); // 寤惰繜1绉掓煡鎵緄nfo鍏冪礌
@@ -120,30 +121,27 @@
// console.log(row)
this.SelectRow = row;
},
- SaveHandler() {
+ async SaveHandler() {
if (this.SelectRow.length <= 0) {
- this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹紒')
- return
+ this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹紒');
+ return;
}
- let mdmNameList = [];
- mdmNameList = this.SelectRow.map(item => {
- return item.code
- })
- console.log(mdmNameList)
- save(this.userId, mdmNameList).then(res => {
- console.log(res)
- if (res.data.code === 200) {
- this.$message.success('淇濆瓨鎴愬姛锛�')
- //娓呴櫎宸叉湁鏁扮粍涓璸ush鏁版嵁
+ this.BtnLoading = true;
+ try {
+ const {data: {code}} = await save(this.userId, this.SelectRow.map(item => item.code));
+ if (code === 200) {
+ this.$message.success('淇濆瓨鎴愬姛锛�');
this.newData = [];
- this.option.data = []
- this.MasterGetList()
+ this.option.data = [];
+ this.MasterGetList();
this.dialogTableVisible = false;
- //瀛椾綋鍜岃竟妗嗛噸鏂板姞杞�
+ this.BtnLoading = false;
this.loading = true;
- this.FontInfo()
+ this.FontInfo();
}
- })
+ } catch {
+ this.BtnLoading = false;
+ }
},
MoreHandler() {
this.dialogTableVisible = true;
--
Gitblit v1.9.3