disableAccountDialog.vue
2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!-- 禁用账号弹窗 -->
<template>
<baseDialog :dialog-config="dialogConfig" :is-show.sync="visible" @handleClick="confirmDisable"
:config="baseDialogConfig">
<div class="disable-dialog-content">
<div style="background: #f8f8f8; padding: 15px; border-radius: 4px; margin-bottom: 20px;">
<div style="font-weight: bold; margin-bottom: 10px; color: #333; font-size: 14px;">基本信息</div>
<el-row style="font-size: 14px; line-height: 28px;">
<el-col :span="12">
<span style="color: #666;">员工姓名:</span><span style="color: #333;">{{ staffName }}</span>
</el-col>
<el-col :span="12">
<span style="color: #666;">适配业务:</span><span style="color: #333;">{{ formattedSceneLabel }}</span>
</el-col>
</el-row>
<el-row style="font-size: 14px; line-height: 28px;">
<el-col :span="24">
<span style="color: #666;">园区店:</span><span style="color: #333;">{{ merchantName }}</span>
</el-col>
</el-row>
</div>
<div style="display: flex; align-items: flex-start;">
<i class="el-icon-warning"
style="color: #ff9900; font-size: 24px; margin-right: 12px; margin-top: 2px;"></i>
<div>
<div style="font-size: 16px; font-weight: bold; color: #333; margin-bottom: 8px;">确认禁用该员工的门店账号?</div>
<div style="font-size: 14px; color: #999;">禁用后,该账号将无法登录业务端开展业务。</div>
</div>
</div>
</div>
</baseDialog>
</template>
<script>
import { disableAccountV2Api } from "@/api/resident";
export default {
name: "DisableAccountDialog",
props: {
disableDialogVisible: {
type: Boolean,
default: false,
},
currentRow: {
type: Object,
default: () => null,
},
staffName: {
type: String,
default: "",
},
formattedSceneLabel: {
type: String,
default: "",
}
},
data() {
return {
dialogConfig: {
title: "禁用账号",
width: "600px",
},
};
},
computed: {
visible: {
get() {
return this.disableDialogVisible;
},
set(newVal) {
this.$emit("dialogClose", { flag: newVal, attrName: "disableDialogVisible" });
},
},
baseDialogConfig() {
return {
showClose: true,
appendToBody: false, // 是否将自身插入至 body 元素,有嵌套的弹窗时一定要设置
isShowFooter: true,
cancel_name: "取 消",
confirm_name: "禁用",
}
},
merchantName() {
return this.currentRow ? this.currentRow.yqMerchantName : '';
}
},
methods: {
confirmDisable() {
if (!this.currentRow) return;
const row = this.currentRow;
disableAccountV2Api({ accountRecordId: row.accountRecordId }).then(() => {
this.$message.success('账号已禁用');
this.visible = false;
this.$emit("refreshDetail");
}).catch(() => {
this.visible = false;
this.$emit("disableFailed", row);
});
},
},
};
</script>
<style scoped>
.disable-dialog-content {
padding: 0 20px;
}
</style>