mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-01-16 19:05:08 -05:00
Customer Module Updates
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"/js/customer.js": "/js/customer.js?id=79d881f2e0dbe9192413e869143f7ba7",
|
||||
"/js/customer.js": "/js/customer.js?id=87a33658c9639acb95dca85a5e88e3f7",
|
||||
"/css/customer.css": "/css/customer.css?id=2d4daea06e537e2022e37b0d7470eea5",
|
||||
"/css/base.css": "/css/base.css?id=655f0b4203b06a58243681a90bde50b1"
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ import TabView from 'primevue/tabview';
|
||||
import TabPanel from 'primevue/tabpanel';
|
||||
import InputSwitch from 'primevue/inputswitch';
|
||||
import Listbox from 'primevue/listbox';
|
||||
import Chips from 'primevue/chips';
|
||||
|
||||
import 'primevue/resources/primevue.min.css';
|
||||
import 'primeflex/primeflex.css'
|
||||
@@ -110,4 +111,5 @@ app.component('DataViewLayoutOptions', DataViewLayoutOptions);
|
||||
app.component('ProgressSpinner', ProgressSpinner);
|
||||
app.component('InputSwitch', InputSwitch);
|
||||
app.component('Listbox', Listbox);
|
||||
app.component('Chips', Chips);
|
||||
app.mount('#customers');
|
||||
|
||||
@@ -211,6 +211,20 @@
|
||||
</div>
|
||||
</div>
|
||||
</TabPanel>
|
||||
<!-- <TabPanel header="Additional Contacts">
|
||||
<div class="grid mt-2">
|
||||
<div class="col-12">
|
||||
<div class="label">Additional Email</div>
|
||||
<Chips v-model="form.additional_contacts" separator="," :allowDuplicate="false" :addOnBlur="true" :class="`p-inputtext-md w-100 ${ additional_contacts_error ? 'p-invalid' : ''}`"/>
|
||||
<small v-if="additional_contacts_error" class="text-danger">Additional Emails must be a valid email address.</small>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<Divider />
|
||||
<Button label="Save" @click="handleSaveAdditionalContacts" :loading="loading" icon="pi pi-save" class="w-auto text-end"></Button>
|
||||
</div>
|
||||
</div>
|
||||
</TabPanel> -->
|
||||
</TabView>
|
||||
</div>
|
||||
</div>
|
||||
@@ -287,6 +301,10 @@
|
||||
}
|
||||
|
||||
#profile-upload:hover .fa:after { height:100%; }
|
||||
|
||||
.p-chips .p-chips-multiple-container {
|
||||
width: 100%!important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
@@ -298,6 +316,7 @@
|
||||
return {
|
||||
active: 0,
|
||||
errors: false,
|
||||
additional_contacts_error: false,
|
||||
form: {
|
||||
avatar: null,
|
||||
first_name: null,
|
||||
@@ -342,7 +361,13 @@
|
||||
e.form.marketing_contact_email = e.customer.company?.marketing_contact_email;
|
||||
e.form.storefront = e.customer.company?.storefront;
|
||||
e.form.company_address = e.customer.company?.company_address;
|
||||
//e.form.additional_contacts = e.customer.additional_contacts;
|
||||
|
||||
var additional_contacts = [];
|
||||
for (var i = 0; i < e.customer.additional_contacts.length; i++) {
|
||||
additional_contacts.push(e.customer.additional_contacts[i].email);
|
||||
}
|
||||
|
||||
e.form.additional_contacts = additional_contacts;
|
||||
},
|
||||
methods: {
|
||||
previewImage(event) {
|
||||
@@ -408,11 +433,9 @@
|
||||
accounts_payable_name: form.accounts_payable_name,
|
||||
accounts_payable_email: form.accounts_payable_email,
|
||||
marketing_contact_name: form.marketing_contact_name,
|
||||
marketing_contact_email: form.marketing_contact_email,
|
||||
//additional_contacts: form.additional_contacts
|
||||
marketing_contact_email: form.marketing_contact_email
|
||||
}).then(response => {
|
||||
e.loading = false;
|
||||
//e.form.additional_contacts = response.data.additional_contacts;
|
||||
e.$toast.add({ severity: 'success', summary: 'Success', detail: response.data.message, life: 3000 });
|
||||
}).catch(error => {
|
||||
const { response } = error;
|
||||
@@ -491,19 +514,33 @@
|
||||
e.loading = false;
|
||||
});
|
||||
},
|
||||
handleAddAdditionalContact() {
|
||||
handleSaveAdditionalContacts() {
|
||||
const e = this;
|
||||
e.form.additional_contacts.push({
|
||||
name: null,
|
||||
email: null,
|
||||
position: null
|
||||
})
|
||||
|
||||
const { form, customer } = e;
|
||||
e.loading = true;
|
||||
e.additional_contacts_error = false;
|
||||
|
||||
axios.post(`/account/update-additional-contacts`, {
|
||||
additional_contacts: form.additional_contacts
|
||||
}).then(response => {
|
||||
e.loading = false;
|
||||
e.$toast.add({ severity: 'success', summary: 'Success', detail: response.data.message, life: 3000 });
|
||||
}).catch(error => {
|
||||
const { response } = error;
|
||||
const { status, data } = response;
|
||||
const { errors } = data;
|
||||
|
||||
if (status == 422) {
|
||||
e.additional_contacts_error = true;
|
||||
e.$toast.add({ severity: 'warn', summary: 'Warning', detail: 'Some data is missing.', life: 3000 });
|
||||
}
|
||||
else {
|
||||
e.$toast.add({ severity: 'error', summary: 'Error', detail: 'Unknown error occured. Please try again.', life: 3000 });
|
||||
}
|
||||
|
||||
e.loading = false;
|
||||
});
|
||||
},
|
||||
handleDeleteContact(contactIndex){
|
||||
const e = this;
|
||||
e.form.additional_contacts = e.form.additional_contacts.filter((item, index) => index !== contactIndex)
|
||||
},
|
||||
getDate(data) {
|
||||
const { created_at } = data;
|
||||
return moment(created_at).format('MMM D, YYYY h:mm A')
|
||||
|
||||
Reference in New Issue
Block a user