-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfirm.vue
170 lines (166 loc) · 5.23 KB
/
Confirm.vue
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<template>
<div>
<v-dialog
persistent
max-width="535px"
v-model="getDetails.show"
scrollable
>
<v-card>
<v-card-title class="primary">
<div class="white--text">Confirmation</div>
<v-spacer />
</v-card-title>
<v-card-text class="pa-3 mt-2">
<div class="font-weight-bold fs-20 black--text text-center">Loan Application Of The Applicant is completed?</div>
</v-card-text>
<br />
<v-form ref="form" >
<v-row class="row-text">
<v-col cols="9" class="d-flex">
<span class=" pl-12 text-title" >Applicaton No.</span>
<v-spacer />
<span class="pr-12 text-value"> #BBKAS79 </span>
</v-col>
<v-col cols="9" class="d-flex">
<span class="pl-12 text-title" >Name.</span>
<v-spacer />
<span class="pr-15 text-value text-capitalize">
<div>{{ getDetails.object.client_name }}</div>
</span>
</v-col>
<br />
<v-col cols="9" class="d-flex">
<span class="pl-12 text-title">Contact No.</span>
<v-spacer />
<span class="pr-12 text-value">
<div>{{ getDetails.object.client_phone }}</div>
</span>
</v-col>
</v-row>
</v-form>
<br />
<v-card-actions class="my-3 mx-1 ">
<v-row>
<v-col cols="6" class="d-flex">
<v-btn
class="mt-n2"
block
color="blue"
outlined
@click="getDetails.show = false"
> Cancle</v-btn>
</v-col>
<v-col cols="6" class="d-flex">
<v-btn
class="mt-n2"
block
color="primary"
:loading="loading"
@click="confirm()"
> Confirm</v-btn>
</v-col>
</v-row>
</v-card-actions>
</v-card>
</v-dialog>
</div>
</template>
<script>
import { mapMutations, mapState } from "vuex";
import rules from "../../../../common/fieldRules";
export default{
name:"Confirm",
data() {
return{
rules: rules,
loading:false,
};
},
computed:{
...mapState({
getDetails:(state)=> state.modal.confirm,
}),
show:{
get() {
if (this.getDetails.show) return this.getDetails.show
else return null;
},
},
},
watch:{
show(v) {
if (v) this.openModal();
else this.closeModal();
},
},
methods:{
...mapMutations({
setDetails:"modal/SET_CONFIRM",
}),
openModal() {},
closeModal() {
this.loading= false;
// this.$refs.form.reset();
},
confirm() {
console.log(this.getDetails.object.id)
if (this.$refs.form.validate()) {
this.loading = true;
const successHandler = () => {
this.loading = false;
this.setDetails({ show: false });
this.$emit("reload-list");
};
const finallyHandler = () => {
this.loading = false;
};
// let formData = {};
// formData["inquiry_state"] = this.getDetails.show;
// return this.$request(
// this.$keys.GET,
// this.$urls.dashboard. get_service_list +
// this.getDetails.object.id +
// "/",
// {
// data: formData,
// onSuccess: successHandler,
// onFinally: finallyHandler,
// isTokenRequired: true,
// }
// );
let formData = {};
formData["inquiry_state"] = this.getDetails.type;
return this.$request(
this.$keys.PATCH,
this.$urls.dashboard.update_service_list +
this.getDetails.object.id + "/",
{
data: formData,
onSuccess: successHandler,
onFinally: finallyHandler,
isTokenRequired: true,
}
);
}
},
}
};
</script>
<style scoped>
.text-title{
font-weight: 400;
font-size: 14px;
line-height: 16px;
color:rgba(0, 0, 0, 0.7);
}
.text-value {
font-weight: 500;
font-size: 14px;
line-height: 15px;
color: rgba(0, 0, 0, 0.8);
}
.row.row-text {
margin: 0px !important;
}
</style>