auto kind of working
This commit is contained in:
@@ -132,13 +132,17 @@
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="col-span-12 md:col-span-4 mb-5 md:mb-0">
|
||||
|
||||
|
||||
<div class="col-span-12 md:col-span-4 mb-5 md:mb-0 mt-5">
|
||||
<label class="block text-white text-sm font-bold mb-2">Automatic</label>
|
||||
<input v-model="CreateCustomerForm.basicInfo.customer_automatic" class="checkbox checkbox-xs" id="automatic"
|
||||
type="checkbox" />
|
||||
<input v-model="CreateCustomerForm.basicInfo.customer_automatic" class="checkbox" type="checkbox" />
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
|
||||
<button class="btn">
|
||||
<button class="btn btn-primary">
|
||||
Edit Customer
|
||||
</button>
|
||||
</div>
|
||||
@@ -197,7 +201,7 @@ export default defineComponent({
|
||||
customer_apt: "",
|
||||
customer_home_type: "",
|
||||
customer_zip: "",
|
||||
customer_automatic: "",
|
||||
customer_automatic: false,
|
||||
customer_email: "",
|
||||
customer_phone_number: "",
|
||||
customer_state: "",
|
||||
@@ -276,12 +280,22 @@ export default defineComponent({
|
||||
this.CreateCustomerForm.basicInfo.customer_town = response.data.customer_town;
|
||||
this.CreateCustomerForm.basicInfo.customer_state = response.data.customer_state;
|
||||
this.CreateCustomerForm.basicInfo.customer_zip = response.data.customer_zip;
|
||||
this.CreateCustomerForm.basicInfo.customer_automatic = response.data.customer_automatic;
|
||||
|
||||
this.CreateCustomerForm.basicInfo.customer_phone_number = response.data.customer_phone_number;
|
||||
this.CreateCustomerForm.basicInfo.customer_home_type = response.data.customer_home_type;
|
||||
this.CreateCustomerForm.basicInfo.customer_apt = response.data.customer_apt;
|
||||
this.CreateCustomerForm.basicInfo.customer_email = response.data.customer_email;
|
||||
this.CreateCustomerForm.basicInfo.customer_address = response.data.customer_address;
|
||||
if (response.data.customer_automatic === 1){
|
||||
this.CreateCustomerForm.basicInfo.customer_automatic = true
|
||||
console.log("poop")
|
||||
|
||||
}
|
||||
if (response.data.customer_automatic === 0){
|
||||
this.CreateCustomerForm.basicInfo.customer_automatic = false
|
||||
console.log("butt")
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -292,7 +306,7 @@ export default defineComponent({
|
||||
customer_zip: string;
|
||||
customer_email: string;
|
||||
customer_phone_number: string;
|
||||
customer_automatic: string;
|
||||
customer_automatic: boolean;
|
||||
customer_home_type: string,
|
||||
customer_state: string;
|
||||
customer_address: string;
|
||||
|
||||
@@ -38,18 +38,18 @@
|
||||
class="btn-sm btn btn-accent">
|
||||
Edit Customer
|
||||
</router-link>
|
||||
|
||||
|
||||
<div v-if="automatic_status === 0">
|
||||
<button :innerText="buttonText" v-on:click="userAutomatic(customer.id)" class="btn btn-accent btn-sm">
|
||||
</button>
|
||||
</div>
|
||||
<div v-else>
|
||||
<button :innerText="buttonText" v-on:click="userAutomatic(customer.id)" class="btn btn-accent btn-sm">
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<button :innerText="buttonText" v-on:click="userAutomatic(customer.id)" class="btn btn-accent btn-sm">
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-span-12 font-bold flex pb-5 text-lg" v-if="automatic_status === 1" :innerText="autoText">Automatic</div>
|
||||
<div class="col-span-12 font-bold flex pb-5 text-lg" v-if="automatic_status === 1" :innerText="autoText">Automatic </div>
|
||||
|
||||
<div class="col-span-12 font-bold flex pb-5 text-lg" :innerText="autoText" v-else>Will Call</div>
|
||||
|
||||
@@ -360,10 +360,10 @@ export default defineComponent({
|
||||
},
|
||||
computed: {
|
||||
buttonText() {
|
||||
return this.isTrue ? 'Become Automatic Customer' : 'Become Willcall Customer';
|
||||
return this.isTrue ? 'Become WillCall Customer' : 'Become Automatic Customer';
|
||||
},
|
||||
autoText() {
|
||||
return this.isTrue? 'Will Call' : 'Automatic ';
|
||||
return this.isTrue? 'Automatic' : 'Will Call';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -403,6 +403,7 @@ export default defineComponent({
|
||||
}).then((response: any) => {
|
||||
this.automatic_status = response.data.status
|
||||
console.log(this.automatic_status)
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
@@ -418,12 +419,14 @@ export default defineComponent({
|
||||
this.automatic_response = response.data.status
|
||||
|
||||
if (this.automatic_response == 1) {
|
||||
|
||||
this.$notify({
|
||||
title: "Automatic Status",
|
||||
text: 'Customer is now Automatic Customer',
|
||||
type: 'Success'
|
||||
})
|
||||
} else {
|
||||
|
||||
this.$notify({
|
||||
title: "Automatic Status",
|
||||
text: 'Customer is now will call',
|
||||
|
||||
Reference in New Issue
Block a user