|
|
|
@@ -6,23 +6,22 @@
|
|
|
|
<div v-if="customer && customer.id" class="bg-neutral rounded-lg p-4 sm:p-6 mt-6">
|
|
|
|
<div v-if="customer && customer.id" class="bg-neutral rounded-lg p-4 sm:p-6 mt-6">
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Current Plan Status Banner - Same as ServicePlanEdit.vue -->
|
|
|
|
<!-- Current Plan Status Banner - Same as ServicePlanEdit.vue -->
|
|
|
|
<div v-if="servicePlan && servicePlan.contract_plan > 0"
|
|
|
|
<div v-if="servicePlan && servicePlan.contract_plan > 0" class="alert alert-info mb-6"
|
|
|
|
class="alert alert-info mb-6"
|
|
|
|
|
|
|
|
:class="servicePlan.contract_plan === 2 ? 'border-4 border-yellow-400 bg-yellow-50' : ''">
|
|
|
|
:class="servicePlan.contract_plan === 2 ? 'border-4 border-yellow-400 bg-yellow-50' : ''">
|
|
|
|
<div class="flex items-center">
|
|
|
|
<div class="flex items-center">
|
|
|
|
<div class="flex-1">
|
|
|
|
<div class="flex-1">
|
|
|
|
<div class="flex items-center gap-3">
|
|
|
|
<div class="flex items-center gap-3">
|
|
|
|
<h3 class="font-bold">Current Plan: {{ getPlanName(servicePlan.contract_plan) }}</h3>
|
|
|
|
<h3 class="font-bold">Current Plan: {{ getPlanName(servicePlan.contract_plan) }}</h3>
|
|
|
|
<!-- Premium Star Icon -->
|
|
|
|
<!-- Premium Star Icon -->
|
|
|
|
<svg v-if="servicePlan.contract_plan === 2"
|
|
|
|
<svg v-if="servicePlan.contract_plan === 2" class="w-8 h-8 text-yellow-500 fill-current" fill="none"
|
|
|
|
class="w-8 h-8 text-yellow-500 fill-current"
|
|
|
|
stroke="currentColor" viewBox="0 0 24 24">
|
|
|
|
fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
|
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
|
|
d="M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"/>
|
|
|
|
d="M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z" />
|
|
|
|
</svg>
|
|
|
|
</svg>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<p>{{ servicePlan.contract_years }} Year{{ servicePlan.contract_years > 1 ? 's' : '' }} Contract</p>
|
|
|
|
<p>{{ servicePlan.contract_years }} Year{{ servicePlan.contract_years > 1 ? 's' : '' }} Contract</p>
|
|
|
|
<p class="text-sm">Expires: {{ formatEndDate(servicePlan.contract_start_date, servicePlan.contract_years) }}</p>
|
|
|
|
<p class="text-sm">Expires: {{ formatEndDate(servicePlan.contract_start_date, servicePlan.contract_years) }}
|
|
|
|
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="badge" :class="getStatusBadge(servicePlan.contract_start_date, servicePlan.contract_years)">
|
|
|
|
<div class="badge" :class="getStatusBadge(servicePlan.contract_start_date, servicePlan.contract_years)">
|
|
|
|
{{ getStatusText(servicePlan.contract_start_date, servicePlan.contract_years) }}
|
|
|
|
{{ getStatusText(servicePlan.contract_start_date, servicePlan.contract_years) }}
|
|
|
|
@@ -37,33 +36,20 @@
|
|
|
|
<div class="xl:col-span-8 space-y-6">
|
|
|
|
<div class="xl:col-span-8 space-y-6">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="grid grid-cols-1 xl:grid-cols-12 gap-6">
|
|
|
|
<div class="grid grid-cols-1 xl:grid-cols-12 gap-6">
|
|
|
|
<ProfileMap
|
|
|
|
<ProfileMap v-if="customer && customer.customer_latitude != null && customer.customer_longitude != null"
|
|
|
|
v-if="customer && customer.customer_latitude != null && customer.customer_longitude != null"
|
|
|
|
class="xl:col-span-7" :customer="customer" />
|
|
|
|
class="xl:col-span-7"
|
|
|
|
|
|
|
|
:customer="customer"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- You can add a placeholder for when the map isn't ready -->
|
|
|
|
<!-- You can add a placeholder for when the map isn't ready -->
|
|
|
|
<div v-else class="xl:col-span-7 bg-base-100 rounded-lg flex justify-center items-center">
|
|
|
|
<div v-else class="xl:col-span-7 bg-base-100 rounded-lg flex justify-center items-center">
|
|
|
|
<p class="text-gray-400">Location not available...</p>
|
|
|
|
<p class="text-gray-400">Location not available...</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<ProfileSummary
|
|
|
|
<ProfileSummary class="xl:col-span-5" :customer="customer" :automatic_status="automatic_status"
|
|
|
|
class="xl:col-span-5"
|
|
|
|
:customer_description="customer_description.description" @toggle-automatic="userAutomatic" />
|
|
|
|
:customer="customer"
|
|
|
|
|
|
|
|
:automatic_status="automatic_status"
|
|
|
|
|
|
|
|
:customer_description="customer_description.description"
|
|
|
|
|
|
|
|
@toggle-automatic="userAutomatic"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<HistoryTabs
|
|
|
|
<HistoryTabs :deliveries="deliveries" :autodeliveries="autodeliveries" :service-calls="serviceCalls"
|
|
|
|
:deliveries="deliveries"
|
|
|
|
:transactions="transactions" @open-service-modal="openEditModal" />
|
|
|
|
:autodeliveries="autodeliveries"
|
|
|
|
|
|
|
|
:service-calls="serviceCalls"
|
|
|
|
|
|
|
|
:transactions="transactions"
|
|
|
|
|
|
|
|
@open-service-modal="openEditModal"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -75,7 +61,8 @@
|
|
|
|
<div class="flex flex-col lg:flex-row lg:items-center lg:justify-between">
|
|
|
|
<div class="flex flex-col lg:flex-row lg:items-center lg:justify-between">
|
|
|
|
<div class="flex items-center gap-3 mb-3 md:mb-0">
|
|
|
|
<div class="flex items-center gap-3 mb-3 md:mb-0">
|
|
|
|
<svg class="w-5 h-5 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
|
|
<svg class="w-5 h-5 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v4a3 3 0 003 3z"/>
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
|
|
|
|
|
|
d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v4a3 3 0 003 3z" />
|
|
|
|
</svg>
|
|
|
|
</svg>
|
|
|
|
<span v-if="isLoadingAuthorize" class="text-sm font-medium">
|
|
|
|
<span v-if="isLoadingAuthorize" class="text-sm font-medium">
|
|
|
|
<span class="loading loading-dots loading-xs mr-2"></span>
|
|
|
|
<span class="loading loading-dots loading-xs mr-2"></span>
|
|
|
|
@@ -92,51 +79,31 @@
|
|
|
|
<!-- CREATE ACCOUNT SECTION - Only show when account doesn't exist -->
|
|
|
|
<!-- CREATE ACCOUNT SECTION - Only show when account doesn't exist -->
|
|
|
|
<div class="flex gap-2">
|
|
|
|
<div class="flex gap-2">
|
|
|
|
|
|
|
|
|
|
|
|
<button
|
|
|
|
<button @click="createAuthorizeAccount"
|
|
|
|
@click="createAuthorizeAccount"
|
|
|
|
|
|
|
|
:class="['btn btn-sm', credit_cards_count === 0 ? 'btn-disabled' : 'btn-primary']"
|
|
|
|
:class="['btn btn-sm', credit_cards_count === 0 ? 'btn-disabled' : 'btn-primary']"
|
|
|
|
:disabled="credit_cards_count === 0"
|
|
|
|
:disabled="credit_cards_count === 0" v-if="credit_cards_count > 0">
|
|
|
|
v-if="credit_cards_count > 0"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
Create Account
|
|
|
|
Create Account
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
<button
|
|
|
|
<button v-else @click="addCreditCard" class="btn btn-secondary btn-sm">
|
|
|
|
v-else
|
|
|
|
|
|
|
|
@click="addCreditCard"
|
|
|
|
|
|
|
|
class="btn btn-secondary btn-sm"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
Add Card First
|
|
|
|
Add Card First
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- DELETE ACCOUNT SECTION - Only show when account exists -->
|
|
|
|
<!-- DELETE ACCOUNT SECTION - Only show when account exists -->
|
|
|
|
<div v-if="authorizeCheck.valid_for_charging" class="mt-3 lg:mt-0 lg:flex lg:gap-2">
|
|
|
|
<div v-if="authorizeCheck.valid_for_charging" class="mt-3 lg:mt-0 lg:flex lg:gap-2">
|
|
|
|
<button
|
|
|
|
<button @click="showDeleteAccountModal" class="btn btn-error btn-sm lg:self-start">
|
|
|
|
@click="showDeleteAccountModal"
|
|
|
|
|
|
|
|
class="btn btn-error btn-sm lg:self-start"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
Delete Account
|
|
|
|
Delete Account
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<CustomerComments
|
|
|
|
<CustomerComments :comments="comments" @add-comment="onSubmitSocial" @delete-comment="deleteCustomerSocial" />
|
|
|
|
:comments="comments"
|
|
|
|
|
|
|
|
@add-comment="onSubmitSocial"
|
|
|
|
|
|
|
|
@delete-comment="deleteCustomerSocial"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<CustomerStats :stats="customer_stats" :last_delivery="customer_last_delivery" />
|
|
|
|
<CustomerStats :stats="customer_stats" :last_delivery="customer_last_delivery" />
|
|
|
|
<TankInfo :customer_id="customer.id" :tank="customer_tank" :description="customer_description" />
|
|
|
|
<TankInfo :customer_id="customer.id" :tank="customer_tank" :description="customer_description" />
|
|
|
|
<EquipmentParts :parts="currentParts" @open-parts-modal="openPartsModal" />
|
|
|
|
<EquipmentParts :parts="currentParts" @open-parts-modal="openPartsModal" />
|
|
|
|
<CreditCards
|
|
|
|
<CreditCards :cards="credit_cards" :count="credit_cards_count" :user_id="customer.id"
|
|
|
|
:cards="credit_cards"
|
|
|
|
:auth_net_profile_id="customer.auth_net_profile_id" @edit-card="editCard" @remove-card="removeCard" />
|
|
|
|
:count="credit_cards_count"
|
|
|
|
|
|
|
|
:user_id="customer.id"
|
|
|
|
|
|
|
|
:auth_net_profile_id="customer.auth_net_profile_id"
|
|
|
|
|
|
|
|
@edit-card="editCard"
|
|
|
|
|
|
|
|
@remove-card="removeCard"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Automatic Delivery Actions Box -->
|
|
|
|
<!-- Automatic Delivery Actions Box -->
|
|
|
|
<div v-if="automatic_status === 1 && autodeliveries.length > 0" class="bg-base-100 rounded-lg p-4 border">
|
|
|
|
<div v-if="automatic_status === 1 && autodeliveries.length > 0" class="bg-base-100 rounded-lg p-4 border">
|
|
|
|
@@ -174,26 +141,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Modals remain at the root of the template for proper display -->
|
|
|
|
<!-- Modals remain at the root of the template for proper display -->
|
|
|
|
<ServiceEditModal
|
|
|
|
<ServiceEditModal v-if="selectedServiceForEdit" :service="selectedServiceForEdit" @close-modal="closeEditModal"
|
|
|
|
v-if="selectedServiceForEdit"
|
|
|
|
@save-changes="handleSaveChanges" @delete-service="handleDeleteService" />
|
|
|
|
:service="selectedServiceForEdit"
|
|
|
|
<PartsEditModal v-if="isPartsModalOpen && currentParts" :customer-id="customer.id" :existing-parts="currentParts"
|
|
|
|
@close-modal="closeEditModal"
|
|
|
|
@close-modal="closePartsModal" @save-parts="handleSaveParts" />
|
|
|
|
@save-changes="handleSaveChanges"
|
|
|
|
|
|
|
|
@delete-service="handleDeleteService"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<PartsEditModal
|
|
|
|
|
|
|
|
v-if="isPartsModalOpen && currentParts"
|
|
|
|
|
|
|
|
:customer-id="customer.id"
|
|
|
|
|
|
|
|
:existing-parts="currentParts"
|
|
|
|
|
|
|
|
@close-modal="closePartsModal"
|
|
|
|
|
|
|
|
@save-parts="handleSaveParts"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Delete Account Confirmation Modal -->
|
|
|
|
<!-- Delete Account Confirmation Modal -->
|
|
|
|
<div class="modal" :class="{ 'modal-open': isDeleteAccountModalVisible }">
|
|
|
|
<div class="modal" :class="{ 'modal-open': isDeleteAccountModalVisible }">
|
|
|
|
<div class="modal-box">
|
|
|
|
<div class="modal-box">
|
|
|
|
<h3 class="font-bold text-lg">Confirm Account Deletion</h3>
|
|
|
|
<h3 class="font-bold text-lg">Confirm Account Deletion</h3>
|
|
|
|
<p class="py-4">This will permanently delete the Authorize.net account and remove all payment profiles. This action cannot be undone.</p>
|
|
|
|
<p class="py-4">This will permanently delete the Authorize.net account and remove all payment profiles. This
|
|
|
|
|
|
|
|
action cannot be undone.</p>
|
|
|
|
<div class="modal-action">
|
|
|
|
<div class="modal-action">
|
|
|
|
<button @click="deleteAccount" class="btn btn-error">Delete Account</button>
|
|
|
|
<button @click="deleteAccount" class="btn btn-error">Delete Account</button>
|
|
|
|
<button @click="isDeleteAccountModalVisible = false" class="btn">Cancel</button>
|
|
|
|
<button @click="isDeleteAccountModalVisible = false" class="btn">Cancel</button>
|
|
|
|
@@ -214,7 +172,9 @@
|
|
|
|
<div v-else class="text-center">
|
|
|
|
<div v-else class="text-center">
|
|
|
|
<div class="text-success mb-3">
|
|
|
|
<div class="text-success mb-3">
|
|
|
|
<svg class="w-12 h-12 mx-auto mb-2" fill="currentColor" viewBox="0 0 20 20">
|
|
|
|
<svg class="w-12 h-12 mx-auto mb-2" fill="currentColor" viewBox="0 0 20 20">
|
|
|
|
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
|
|
|
|
<path fill-rule="evenodd"
|
|
|
|
|
|
|
|
d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z"
|
|
|
|
|
|
|
|
clip-rule="evenodd" />
|
|
|
|
</svg>
|
|
|
|
</svg>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<p class="text-lg font-semibold mb-2">Account Created Successfully!</p>
|
|
|
|
<p class="text-lg font-semibold mb-2">Account Created Successfully!</p>
|
|
|
|
@@ -236,7 +196,7 @@
|
|
|
|
<div class="text-center">
|
|
|
|
<div class="text-center">
|
|
|
|
<svg class="w-16 h-16 mx-auto mb-4 text-warning" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
|
|
<svg class="w-16 h-16 mx-auto mb-4 text-warning" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
|
|
d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"/>
|
|
|
|
d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z" />
|
|
|
|
</svg>
|
|
|
|
</svg>
|
|
|
|
<p class="text-lg font-semibold">Duplicate Account in Authorize.net</p>
|
|
|
|
<p class="text-lg font-semibold">Duplicate Account in Authorize.net</p>
|
|
|
|
<p class="text-sm text-gray-600 mt-2">
|
|
|
|
<p class="text-sm text-gray-600 mt-2">
|
|
|
|
@@ -399,7 +359,7 @@ export default defineComponent({
|
|
|
|
user: null as { user_id: number; user_name: string; confirmed: string; } | null,
|
|
|
|
user: null as { user_id: number; user_name: string; confirmed: string; } | null,
|
|
|
|
automatic_status: 0,
|
|
|
|
automatic_status: 0,
|
|
|
|
customer_last_delivery: '',
|
|
|
|
customer_last_delivery: '',
|
|
|
|
comments: [ { id: 0, created: '', customer_id: 0, poster_employee_id: 0, comment: '' } ],
|
|
|
|
comments: [{ id: 0, created: '', customer_id: 0, poster_employee_id: 0, comment: '' }],
|
|
|
|
CreateSocialForm: { basicInfo: { comment: '' } },
|
|
|
|
CreateSocialForm: { basicInfo: { comment: '' } },
|
|
|
|
|
|
|
|
|
|
|
|
// --- UPDATE THESE LINES ---
|
|
|
|
// --- UPDATE THESE LINES ---
|
|
|
|
@@ -518,7 +478,7 @@ export default defineComponent({
|
|
|
|
headers: authHeader(),
|
|
|
|
headers: authHeader(),
|
|
|
|
}).then((response: any) => {
|
|
|
|
}).then((response: any) => {
|
|
|
|
this.automatic_status = response.data.status
|
|
|
|
this.automatic_status = response.data.status
|
|
|
|
if (this.automatic_status === 1){
|
|
|
|
if (this.automatic_status === 1) {
|
|
|
|
this.getCustomerAutoDelivery(this.customer.id)
|
|
|
|
this.getCustomerAutoDelivery(this.customer.id)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.checktotalOil(this.customer.id)
|
|
|
|
this.checktotalOil(this.customer.id)
|
|
|
|
@@ -623,14 +583,15 @@ export default defineComponent({
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
getCustomerAutoDelivery(userid: any) {
|
|
|
|
getCustomerAutoDelivery(userid: any) {
|
|
|
|
let path = import.meta.env.VITE_AUTO_URL + '/delivery/auto/customer/' + userid ;
|
|
|
|
let path = import.meta.env.VITE_AUTO_URL + '/delivery/all/profile/' + userid;
|
|
|
|
axios({
|
|
|
|
axios({
|
|
|
|
method: 'get',
|
|
|
|
method: 'get',
|
|
|
|
url: path,
|
|
|
|
url: path,
|
|
|
|
headers: authHeader(),
|
|
|
|
headers: authHeader(),
|
|
|
|
}).then((response: any) => {
|
|
|
|
}).then((response: any) => {
|
|
|
|
// Handle the case where response.data might be null (no auto delivery found)
|
|
|
|
// Handle the case where response.data might be null (no auto delivery found)
|
|
|
|
this.autodeliveries = response.data ? [response.data] : []
|
|
|
|
this.autodeliveries = response.data || []
|
|
|
|
|
|
|
|
console.log(this.autodeliveries)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
getCustomerDelivery(userid: any, delivery_page: any) {
|
|
|
|
getCustomerDelivery(userid: any, delivery_page: any) {
|
|
|
|
@@ -646,7 +607,7 @@ export default defineComponent({
|
|
|
|
editCard(card_id: any) {
|
|
|
|
editCard(card_id: any) {
|
|
|
|
this.$router.push({ name: "cardedit", params: { id: card_id } });
|
|
|
|
this.$router.push({ name: "cardedit", params: { id: card_id } });
|
|
|
|
},
|
|
|
|
},
|
|
|
|
removeCard(card_id: any) {
|
|
|
|
removeCard(card_id: any) {
|
|
|
|
let path = import.meta.env.VITE_BASE_URL + '/payment/card/remove/' + card_id;
|
|
|
|
let path = import.meta.env.VITE_BASE_URL + '/payment/card/remove/' + card_id;
|
|
|
|
axios({
|
|
|
|
axios({
|
|
|
|
method: 'delete',
|
|
|
|
method: 'delete',
|
|
|
|
@@ -669,7 +630,7 @@ removeCard(card_id: any) {
|
|
|
|
|
|
|
|
|
|
|
|
notify({ title: "Error", text: "Could not remove card.", type: "error" });
|
|
|
|
notify({ title: "Error", text: "Could not remove card.", type: "error" });
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
deleteCall(delivery_id: any) {
|
|
|
|
deleteCall(delivery_id: any) {
|
|
|
|
let path = import.meta.env.VITE_BASE_URL + '/delivery/delete/' + delivery_id;
|
|
|
|
let path = import.meta.env.VITE_BASE_URL + '/delivery/delete/' + delivery_id;
|
|
|
|
axios({
|
|
|
|
axios({
|
|
|
|
@@ -724,7 +685,7 @@ removeCard(card_id: any) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onSubmitSocial(commentText: string) {
|
|
|
|
onSubmitSocial(commentText: string) {
|
|
|
|
if (!this.user) {
|
|
|
|
if (!this.user) {
|
|
|
|
console.error("Cannot submit comment: user is not logged in.");
|
|
|
|
console.error("Cannot submit comment: user is not logged in.");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
@@ -732,7 +693,7 @@ onSubmitSocial(commentText: string) {
|
|
|
|
|
|
|
|
|
|
|
|
let payload = { comment: commentText, poster_employee_id: this.user.user_id };
|
|
|
|
let payload = { comment: commentText, poster_employee_id: this.user.user_id };
|
|
|
|
this.CreateSocialComment(payload);
|
|
|
|
this.CreateSocialComment(payload);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
getServiceCalls(customerId: number) {
|
|
|
|
getServiceCalls(customerId: number) {
|
|
|
|
let path = `${import.meta.env.VITE_BASE_URL}/service/for-customer/${customerId}`;
|
|
|
|
let path = `${import.meta.env.VITE_BASE_URL}/service/for-customer/${customerId}`;
|
|
|
|
axios({
|
|
|
|
axios({
|
|
|
|
@@ -780,7 +741,7 @@ onSubmitSocial(commentText: string) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const path = `${import.meta.env.VITE_BASE_URL}/service/delete/${serviceId}`;
|
|
|
|
const path = `${import.meta.env.VITE_BASE_URL}/service/delete/${serviceId}`;
|
|
|
|
const response = await axios.delete(path, { headers: authHeader(), withCredentials: true });
|
|
|
|
const response = await axios.delete(path, { headers: authHeader(), withCredentials: true });
|
|
|
|
if(response.data.ok) {
|
|
|
|
if (response.data.ok) {
|
|
|
|
this.getServiceCalls(this.customer.id);
|
|
|
|
this.getServiceCalls(this.customer.id);
|
|
|
|
this.closeEditModal();
|
|
|
|
this.closeEditModal();
|
|
|
|
notify({ title: "Success", text: "Service call deleted!", type: "success" });
|
|
|
|
notify({ title: "Success", text: "Service call deleted!", type: "success" });
|
|
|
|
@@ -813,7 +774,7 @@ onSubmitSocial(commentText: string) {
|
|
|
|
const path = `${import.meta.env.VITE_BASE_URL}/service/parts/update/${partsToSave.customer_id}`;
|
|
|
|
const path = `${import.meta.env.VITE_BASE_URL}/service/parts/update/${partsToSave.customer_id}`;
|
|
|
|
const response = await axios.post(path, partsToSave, { headers: authHeader() });
|
|
|
|
const response = await axios.post(path, partsToSave, { headers: authHeader() });
|
|
|
|
|
|
|
|
|
|
|
|
if(response.data.ok) {
|
|
|
|
if (response.data.ok) {
|
|
|
|
this.currentParts = partsToSave;
|
|
|
|
this.currentParts = partsToSave;
|
|
|
|
notify({ title: "Success", text: "Equipment parts saved successfully!", type: "success" });
|
|
|
|
notify({ title: "Success", text: "Equipment parts saved successfully!", type: "success" });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|