tipDialog.vue
2.7 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<template>
<el-dialog
class="uploadHistoryDialog"
:visible.sync="dialogVisible"
width="35%"
:show-close="true"
:close-on-click-modal="false"
center
>
<template slot="title">
<div class="dialogTitle el-icon-warning"></div>
</template>
<div class="content">
<div class="content-Item" v-html="tipcontent"></div>
<div class="content-option">
<el-checkbox v-model="checked" @change="checkChange">
No more prompts in the future for the same situation
</el-checkbox>
</div>
</div>
<div align="center" style="margin-bottom: 20px">
<el-button
class="entrySaveButton entrySaveButton-background"
@click="confirm"
>
CONFIRM
</el-button>
<el-button class="entrySaveButton" @click="cancel">CANCEL</el-button>
</div>
</el-dialog>
</template>
<script>
import { uploadUserTipFlag } from "@/api/system/user.js";
export default {
props: {
dialogVisible: {
type: Boolean,
default: false,
},
tipcontent: {
type: String,
default: "",
},
typeStatus: {
type: Number,
default: 1,
},
},
data() {
return {
checked: false,
};
},
watch: {
dialogVisible(val) {
if (val) {
if (this.typeStatus == 1) {
this.checked =
this.$store.getters.userData.addflag1 == 1 ? false : true;
} else if (this.typeStatus == 2) {
this.checked =
this.$store.getters.userData.addflag2 == 1 ? false : true;
}
}
},
},
methods: {
checkChange(val) {
let obj = {
addFlag1: this.$store.getters.userData.addflag1,
addFlag2: this.$store.getters.userData.addflag1,
};
if (this.typeStatus == 1) {
obj.addFlag1 = val ? 2 : 1;
} else if (this.typeStatus == 2) {
obj.addFlag2 = val ? 2 : 1;
}
uploadUserTipFlag(obj)
.then((res) => {
if (res.code === 200) {
} else {
// this.alertWarningMsg(res.msg)
}
})
.catch((err) => {
console.log(err);
});
},
confirm() {
this.$emit("cancel", true);
},
cancel() {
this.$emit("cancel", false);
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/styles/variables.scss";
.dialogTitle {
font-size: 36px;
color: $fedexBottonColor;
}
.content {
text-align: center;
.content-Item {
font-size: 16px;
font-weight: 500;
color: #333;
line-height: 20px;
margin-bottom: 20px;
}
.content-option {
margin-bottom: 24px;
.el-checkbox {
.el-checkbox__label {
color: $fedexButton !important;
}
}
}
}
</style>