-
- Credit Cards
-
-
-
-
-
-
-
-
-
- No Cards on File! Cash Customer till card added.
-
-
- {{ credit_cards_count }} credit card(s) on file.
-
-
-
-
-
-
-
-
- {{ card.type_of_card }}
-
-
- {{ card.name_on_card }}
-
-
- {{ card.card_number }}
-
-
- {{ card.expiration_month }}/ {{ card.expiration_year }}
-
-
- {{ card.zip_code }}
-
-
-
-
- Edit Card
-
-
- RemoveCard
-
+
+ {{ customer.customer_first_name }}
+ {{ customer.customer_last_name }}
+
+
+ {{ customer.customer_address }}
+
+ {{ customer.customer_apt }}
+
+
+
+ {{ customer.customer_town }},
+
+
+
+
Massachusetts
+
Rhode Island
+
New Hampshire
+
Maine
+
Vermont
+
Maine
+
New York
+
Unknown state
+
+
+ {{ customer.customer_zip }}
+
+
+
+
+ {{ customer.customer_apt }}
+
+
+
Residential
+
apartment
+
condo
+
commercial
+
business
+
construction
+
container
+
+
+ {{ customer.customer_phone_number }}
+
+
-
-
-
- {{ card.type_of_card }}
-
-
- {{ card.name_on_card }}
-
-
- {{ card.card_number }}
-
-
- {{ card.expiration_month }}/ {{ card.expiration_year }}
-
-
- {{ card.zip_code }}
-
-
+
+
+
Home Description
+
+ {{ customer_description.description }}
+
+
+
+
+
+
+
+
+
+ Stats
+
+
+
+ Total Calls: {{ customer_stats.total_calls }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Total Delivery Orders: {{ customer_stats.oil_deliveries }}
+
+
+ Total Gallons: {{ customer_stats.oil_total_gallons }}
+
+
+ Last Delivery: {{ customer_last_delivery }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Tank
+
+
+
+ Edit Tank
+
+
+
+
Last Tank Inspection
+
+ Not inspected
+
+
+ {{ customer_tank.last_tank_inspection }}
+
+
+
Tank Status
+
+ Needs Inspection / Bad Tank
+
+
+ Inspected
+
+
+
+
+
+
+
Fill Location
+
+ {{ customer_description.fill_location }}
+
+
Tank Size
+
+ {{ customer_tank.tank_size }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Credit Cards
+
+
+
+
+
+
+
+
+ No Cards on File! Cash Customer till card added.
+
+
+ {{ credit_cards_count }} credit card(s) on file.
+
+
+
+
+
+
+
+ {{ card.type_of_card }}
+
+
+ {{ card.name_on_card }}
+
+
+ {{ card.card_number }}
+
+
+ {{ card.expiration_month }}/ {{ card.expiration_year }}
+
+
+ {{ card.zip_code }}
+
+
+
+
+
+
+
+ {{ card.type_of_card }}
+
+
+ {{ card.name_on_card }}
+
+
+ {{ card.card_number }}
+
+
+ {{ card.expiration_month }}/ {{ card.expiration_year }}
+
+
+ {{ card.zip_code }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ comment.created }}
+
+
+
+
+
+
+
+
+
+
+ {{ comment.comment }}
+
+
+
+
+
+
+
+
-
@@ -332,7 +377,7 @@
Address |
Gallons |
Date |
-
+
|
@@ -354,8 +399,8 @@
{{ oil['customer_name'] }} |
{{ oil['customer_address'] }} |
-
- {{ oil['gallons_delivered'] }}
+
+ {{ oil['gallons_delivered'] }}
|
{{ oil['expected_delivery_date'] }} |
@@ -368,14 +413,18 @@
-
-
-
+
+
+
+
+
+
+
+
+
@@ -123,18 +178,18 @@
type="checkbox" />
@@ -161,97 +216,129 @@
+
-
-
{{ customer.account_number }}
-
- {{ customer.customer_first_name }}
- {{ customer.customer_last_name }}
+
+
+
Add a Credit Card
+
+
-
-
- {{ customer.customer_town }},
-
-
-
Massachusetts
-
Rhode Island
-
New Hampshire
-
Maine
-
Vermont
-
Maine
-
New York
-
Unknown state
-
-
- {{ customer.customer_zip }}
-
-
-
- {{ customer.customer_apt }}
-
-
-
Residential
-
apartment
-
condo
-
commercial
-
business
-
construction
-
container
-
-
- {{ customer.customer_phone_number }}
-
-
-
-
-
- | id |
- Date |
- Gallons |
- Status |
- Prime |
- Same Day |
-
-
-
-
-
- | {{ oil['id'] }} |
- {{ oil['expected_delivery_date'] }} |
-
- Fill
- {{ oil['gallons_ordered'] }}
- |
-
- Waiting
- delivered
- Out for Delivery
- Cancelled
- Partial Delivery
- Issue
- Finalized
-
- |
-
- No
- Yes
- |
-
- No
- Yes
- |
-
-
-
-
- |
-
-
-
-
+
+
+
Remind customer of tank Inspection
+
Ask how they heard about us
+
+
+
@@ -307,6 +394,18 @@ export default defineComponent({
driver_driver: '',
},
},
+ CreateCardForm: {
+ basicInfo: {
+ card_name: '',
+ expiration_month: '',
+ expiration_year: '',
+ type_of_card: '',
+ security_number: '',
+ card_number: '',
+ zip_code: '',
+ main_card: false,
+ },
+ },
deliveries: [],
customer: {
id: 0,
@@ -328,6 +427,17 @@ export default defineComponent({
},
validations() {
return {
+ CreateCardForm: {
+ basicInfo: {
+ card_name: { required, minLength: minLength(1) },
+ expiration_month: { required, minLength: minLength(1) },
+ expiration_year: { required, minLength: minLength(1) },
+ security_number: { required, minLength: minLength(1) },
+ type_of_card: { required, minLength: minLength(1) },
+ card_number: { required, minLength: minLength(1) },
+ },
+ },
+
CreateOilOrderForm: {
basicInfo: {
gallons_ordered: { required, minLength: minLength(1) },
@@ -350,7 +460,7 @@ export default defineComponent({
},
mounted() {
this.getCustomer(this.$route.params.id)
-
+
this.getPaymentCards(this.$route.params.id);
this.getCustomerDelivery(this.$route.params.id)
},
@@ -392,6 +502,9 @@ export default defineComponent({
});
});
},
+ test() {
+ this.CreateOilOrderForm.basicInfo.gallons_ordered = '100'
+ },
getCustomerDelivery(userid: any) {
let path = import.meta.env.VITE_BASE_URL + '/delivery/customer/' + userid + '/1';
axios({
@@ -412,12 +525,13 @@ export default defineComponent({
})
.then((response: any) => {
this.userCards = response.data;
+
})
.catch(() => {
});
},
getPromos() {
- let path = import.meta.env.VITE_BASE_URL + "/promo/all" ;
+ let path = import.meta.env.VITE_BASE_URL + "/promo/all";
axios({
method: "get",
url: path,
@@ -502,7 +616,7 @@ export default defineComponent({
text: "Did not add a driver",
type: "error",
});
- pass += 1;
+ pass += 1;
}
if (this.CreateOilOrderForm.basicInfo.cash === false && this.CreateOilOrderForm.basicInfo.credit === false && this.CreateOilOrderForm.basicInfo.check === false && this.CreateOilOrderForm.basicInfo.other === false) {
notify({
@@ -510,12 +624,59 @@ export default defineComponent({
text: "Did not select a payment method",
type: "error",
});
- pass += 1;
+ pass += 1;
}
if (pass == 0) {
this.CreateOilOrder(payload);
}
},
+
+
+
+ CreateCard(payload: {
+ card_name: string;
+ expiration_month: string;
+ expiration_year: string;
+ type_of_card: string;
+ security_number: string;
+ zip_code: string;
+ card_number: string;
+ main_card: boolean;
+ }) {
+ let path = import.meta.env.VITE_BASE_URL + "/payment/card/create/" + this.customer.id;
+ axios({
+ method: "post",
+ url: path,
+ data: payload,
+ withCredentials: true,
+ headers: authHeader(),
+ })
+ .then((response: any) => {
+ if (response.data.ok) {
+ this.getPaymentCards(this.$route.params.id)
+ }
+ if (response.data.error) {
+ notify({
+ title: "Error",
+ text: "Error adding card",
+ type: "error",
+ });
+ }
+ })
+ },
+ onSubmitCard() {
+ let payload = {
+ card_name: this.CreateCardForm.basicInfo.card_name,
+ card_number: this.CreateCardForm.basicInfo.card_number,
+ expiration_month: this.CreateCardForm.basicInfo.expiration_month,
+ expiration_year: this.CreateCardForm.basicInfo.expiration_year,
+ type_of_card: this.CreateCardForm.basicInfo.type_of_card,
+ security_number: this.CreateCardForm.basicInfo.security_number,
+ main_card: this.CreateCardForm.basicInfo.main_card,
+ zip_code: this.CreateCardForm.basicInfo.zip_code,
+ };
+ this.CreateCard(payload);
+ },
},
})
diff --git a/src/pages/delivery/edit.vue b/src/pages/delivery/edit.vue
index a2bc973..2f86c64 100755
--- a/src/pages/delivery/edit.vue
+++ b/src/pages/delivery/edit.vue
@@ -17,7 +17,8 @@