-
Notifications
You must be signed in to change notification settings - Fork 0
/
Conformation.vue
172 lines (171 loc) · 4.79 KB
/
Conformation.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
171
172
<template>
<div>
<v-dialog v-model="getDetails.show" persistent max-width="535px" 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">
Documents of The Applicant is Collected?
</div>
</v-card-text>
<br />
<v-form ref="form">
<v-row class="row-text">
<v-col cols="9" class="d-flex">
<span class="pl-16 text-title"> Application No. </span>
<v-spacer />
<span class="pr-11 text-value"> #BBKAS79 </span>
</v-col>
<br />
<v-col cols="9" class="d-flex">
<span class="pl-16 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-16 text-title">Contact No.</span>
<v-spacer />
<span class="pr-11 text-value">
<div>{{ getDetails.object.client_phone }}</div>
</span>
</v-col>
</v-row>
<br/>
</v-form>
<v-card-actions class="my-1 mx-1">
<v-row>
<v-col cols="6" class="d-flex">
<v-btn
class="mt-n1"
block
color="blue"
outlined
@click="getDetails.show = false"
>
Cancle</v-btn
>
</v-col>
<v-col cols="6" class="d-flex">
<v-btn
class="mt-n1"
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 rules from "../../../../common/fieldRules";
import { mapState, mapMutations } from "vuex";
export default {
name: "conformation",
data() {
return {
rules: rules,
loading: false,
};
},
computed: {
...mapState({
getDetails: (state) => state.modal.conformation,
}),
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_CONFORMATION",
}),
openModal() {},
closeModal() {
this.loading= false;
this.$refs.form.reset();
},
confirm() {
// console.log(this.type);
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.type;
// formData["service_list"]= this.service
// 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;
// formData["confirmation"] = this.confirm
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);
align-content: center;
}
.text-value {
font-weight: 500;
font-size: 14px;
line-height: 15px;
color: rgba(0, 0, 0, 0.8);
align-content: center;
}
.row.row-text {
margin: 0px !important;
}
</style>