auto kind of working

This commit is contained in:
2024-07-17 18:04:19 -04:00
parent 601c2e27ba
commit 74fcd282db
4 changed files with 49 additions and 32 deletions

View File

@@ -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',