This commit is contained in:
2024-05-16 14:36:52 -04:00
parent 7164e41aa1
commit 52a02c7595
34 changed files with 771 additions and 2342 deletions

View File

@@ -23,8 +23,7 @@
<div class="grid grid-cols-1 rounded-md p-6 ">
<div class="text-[24px]">
Credit Card Customer: {{ customer }}
Credit Card Customer: {{ customer.customer_first_name }}
</div>
<div class="text-[20px]">
Card Id: {{card.id}}
@@ -44,7 +43,7 @@
<div class="mb-4">
<label class="block text-white text-sm font-bold mb-2">Name on Card</label>
<input v-model="CreateCardForm.basicInfo.card_name"
class="input input-bordered w-full max-w-xs"
class="input input-bordered input-sm w-full max-w-xs"
id="title" type="text" placeholder="Name on Card"/>
<span v-if="v$.CreateCardForm.basicInfo.card_name.$error"
class="text-red-600 text-center">
@@ -55,7 +54,7 @@
<div class="mb-4">
<label class="block text-white text-sm font-bold mb-2">Card Number</label>
<input v-model="CreateCardForm.basicInfo.card_number"
class="input input-bordered w-full max-w-xs"
class="input input-bordered input-sm w-full max-w-xs"
id="title" type="text" placeholder="Card Number"/>
<span v-if="v$.CreateCardForm.basicInfo.card_number.$error"
class="text-red-600 text-center">
@@ -67,18 +66,18 @@
<label class="block text-white text-sm font-bold mb-2">Expiration Month</label>
<select
v-model="CreateCardForm.basicInfo.expiration_month"
class="input input-bordered w-full max-w-xs"
class="input input-bordered input-sm w-full max-w-xs"
id="Month"
>
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
<option>05</option>
<option>06</option>
<option>07</option>
<option>08</option>
<option>09</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
@@ -89,7 +88,7 @@
<label class="block text-white text-sm font-bold mb-2">Expiration Year</label>
<select
v-model="CreateCardForm.basicInfo.expiration_year"
class="input input-bordered w-full max-w-xs"
class="input input-bordered input-sm w-full max-w-xs"
id="Month"
>
<option>2024</option>
@@ -100,7 +99,6 @@
<option>2029</option>
<option>2030</option>
</select>
<span v-if="v$.CreateCardForm.basicInfo.expiration_year.$error"
class="text-red-600 text-center">
{{ v$.CreateCardForm.basicInfo.expiration_year.$errors[0].$message }}
@@ -111,7 +109,7 @@
<label class="block text-white text-sm font-bold mb-2">Type of Card</label>
<select
v-model="CreateCardForm.basicInfo.type_of_card"
class="input input-bordered w-full max-w-xs"
class="input input-bordered input-sm w-full max-w-xs"
id="Month"
>
<option>Visa</option>
@@ -119,7 +117,6 @@
<option>Discover</option>
<option>American Express</option>
</select>
<span v-if="v$.CreateCardForm.basicInfo.type_of_card.$error"
class="text-red-600 text-center">
{{ v$.CreateCardForm.basicInfo.type_of_card.$errors[0].$message }}
@@ -129,7 +126,7 @@
<div class="mb-4">
<label class="block text-white text-sm font-bold mb-2">Security Number</label>
<input v-model="CreateCardForm.basicInfo.security_number"
class="input input-bordered w-full max-w-xs"
class="input input-bordered input-sm w-full max-w-xs"
id="title" type="text" placeholder="Back of card"/>
<span v-if="v$.CreateCardForm.basicInfo.security_number.$error"
class="text-red-600 text-center">
@@ -137,7 +134,6 @@
</span>
</div>
<div class="col-span-12 md:col-span-12 flex mt-5 mb-5">
<button class="btn">
Edit Card
@@ -155,7 +151,6 @@
<script lang="ts">
import {defineComponent} from 'vue'
import axios from 'axios'
import { notify } from "@kyvg/vue3-notification";
import authHeader from '../../services/auth.header'
import Header from '../../layouts/headers/headerauth.vue'
import SideBar from '../../layouts/sidebar/sidebar.vue'
@@ -180,20 +175,19 @@
id: '',
},
customer: {
id: 0,
customer_last_name: '',
customer_first_name: '',
customer_town: '',
customer_state: '',
customer_zip: '',
customer_first_call: '',
customer_email: '',
customer_automatic: '',
customer_phone_number: '',
customer_home_type: '',
customer_apt: '',
customer_address: '',
},
id: 0,
user_id: 0,
customer_first_name: '',
customer_last_name: '',
customer_town: '',
customer_address: '',
customer_state: 0,
customer_zip: '',
customer_apt: '',
customer_home_type: 0,
customer_phone_number: '',
account_number: '',
},
card: {
id: '',
card_name: '',
@@ -235,7 +229,6 @@
};
},
created() {
this.userStatus()
},
watch: {
@@ -265,41 +258,18 @@
this.user.id = '';
})
},
getCustomer(user_id: any) {
let path = import.meta.env.VITE_BASE_URL + "/customer/" + user_id;
getCustomer(userid: any) {
let path = import.meta.env.VITE_BASE_URL + '/customer/' + userid;
axios({
method: "get",
method: 'get',
url: path,
withCredentials: true,
})
.then((response: any) => {
this.customer_id = response.data.user_id;
this.customer.customer_last_name= response.data.customer_last_name;
this.customer.customer_first_name = response.data.customer_first_name;
this.customer.customer_town = response.data.customer_town;
this.customer.customer_state = response.data.customer_state;
this.customer.customer_zip = response.data.customer_zip;
this.customer.customer_first_call = response.data.customer_first_call;
this.customer.customer_email = response.data.customer_email;
this.customer.customer_automatic = response.data.customer_automatic;
this.customer.customer_phone_number = response.data.customer_phone_number;
this.customer.customer_home_type = response.data.customer_home_type;
this.customer.customer_apt = response.data.customer_last_name;
this.customer.customer_address = response.data.customer_last_name;
})
.catch(() => {
notify({
title: "Error",
text: "Could not find customer",
type: "error",
});
});
headers: authHeader(),
}).then((response: any) => {
this.customer = response.data
})
},
getCard (card_id:any) {
let path = import.meta.env.VITE_BASE_URL + "/payment/card/" + card_id ;
axios({
method: "get",
@@ -308,28 +278,19 @@
headers: authHeader(),
})
.then((response: any) => {
if (response.data.ok) {
this.CreateCardForm.basicInfo.card_name= response.data.card.card_name;
this.CreateCardForm.basicInfo.expiration_month= response.data.card.expiration_month;
this.CreateCardForm.basicInfo.expiration_year= response.data.card.expiration_year;
this.CreateCardForm.basicInfo.type_of_card= response.data.card.type_of_card;
this.CreateCardForm.basicInfo.security_number= response.data.card.security_number;
this.CreateCardForm.basicInfo.main_card= response.data.card.main_card;
this.CreateCardForm.basicInfo.card_number= response.data.card.card_number;
this.CreateCardForm.basicInfo.card_name= response.data.name_on_card;
this.CreateCardForm.basicInfo.expiration_month= response.data.expiration_month;
this.CreateCardForm.basicInfo.expiration_year= response.data.expiration_year;
this.CreateCardForm.basicInfo.type_of_card= response.data.type_of_card;
this.CreateCardForm.basicInfo.security_number= response.data.security_number;
this.CreateCardForm.basicInfo.main_card= response.data.main_card;
this.CreateCardForm.basicInfo.card_number= response.data.card_number;
this.user.id = response.data.card.user_id
this.card.id=response.data.card.id;
this.card.user_id=response.data.card.user_id;
this.card.card_name= response.data.card.card_name
this.card.expiration_month=response.data.card.expiration_month;
this.card.expiration_year=response.data.card.expiration_year;
this.card.type_of_card=response.data.card.type_of_card;
this.card.security_number=response.data.card.security_number;
this.card.main_card=response.data.card.main_card;
this.getCustomer(response.data.card.user_id)
}
this.user.id = response.data.user_id
this.card=response.data
this.getCustomer(response.data.user_id)
})
},
editCard(payload: {