update

parent 739bb781
...@@ -83,6 +83,18 @@ export type QualificationType = { ...@@ -83,6 +83,18 @@ export type QualificationType = {
status: number; status: number;
numIndex: number; numIndex: number;
}; };
export type CardBankType = {
id: number;
name: string;
status: number;
numIndex: number;
};
export type TypeCardType = {
id: number;
name: string;
status: number;
numIndex: number;
};
export type WorkType = { export type WorkType = {
id: number; id: number;
name: string; name: string;
...@@ -171,30 +183,34 @@ export type ArtistDicitionary = { ...@@ -171,30 +183,34 @@ export type ArtistDicitionary = {
}; };
export type ArtistOwnerAdd = { export type ArtistOwnerAdd = {
code: string | undefined, code: string | undefined;
name: string | undefined, name: string | undefined;
representative: string | undefined, representative: string | undefined;
address: string | undefined, address: string | undefined;
email: string | undefined, email: string | undefined;
phoneNumber: string | undefined, phoneNumber: string | undefined;
status: number, status: number;
fields: Array<[ fields: Array<
[
{ {
id: number, id: number;
name: string, name: string;
status: number, status: number;
numIndex: number numIndex: number;
} }
]> ]
contracts: Array<[ >;
contracts: Array<
[
{ {
contractFrom: string, contractFrom: string;
contractTo: string, contractTo: string;
status: number, status: number;
artistId: number, artistId: number;
artistName: string, artistName: string;
artistFullName: string, artistFullName: string;
field: string field: string;
}, }
]> ]
>;
}; };
import { defineComponent } from 'vue'; import { defineComponent, PropType, Ref, ref } from 'vue';
import { i18n } from 'src/boot/i18n'; import { i18n } from 'src/boot/i18n';
import { BankAccountType } from 'src/assets/type';
import { Notify } from 'quasar';
export default defineComponent({ export default defineComponent({
props: { props: {
isOpenAddAccountBankDialog: { isOpenAddAccountBankDialog: {
type: Boolean, type: Boolean,
required: true, required: true,
}, },
bankAccounts: {
type: Array as PropType<BankAccountType[]>,
required: true,
},
accountNumber: { type: String, required: true }, accountNumber: { type: String, required: true },
cardNumber: { type: String, required: true }, cardNumber: { type: String, required: true },
bankName: { type: String, required: true }, bankName: { type: String, required: true },
cardType: { type: Number, required: true }, cardType: { type: Number, required: true },
isDefault: { type: Number, required: true }, isDefault: { type: Number, required: true },
}, },
setup() { setup(props, context) {
const accountNumberRules = [ const accountNumberRules = [
(val?: string) => (val?: string) =>
(val && val.trim().length) || (val && val.trim().length) ||
...@@ -36,12 +43,26 @@ export default defineComponent({ ...@@ -36,12 +43,26 @@ export default defineComponent({
val !== undefined || val !== undefined ||
i18n.global.t('artist.dialogLabel.validateMessages.requireCardType'), i18n.global.t('artist.dialogLabel.validateMessages.requireCardType'),
]; ];
const confirmAddAccBank = () => {
if (
props.isDefault === 1 &&
props.bankAccounts.filter((item) => item.isDefault === 1).length
) {
Notify.create({
type: 'negative',
message: i18n.global.t(
'artist.dialogLabel.validateMessages.errorIsDefault'
),
});
} else context.emit('addNewBankAccount');
};
return { return {
defaultStatus, defaultStatus,
bankNameRules, bankNameRules,
cardTypeRules, cardTypeRules,
accountNumberRules, accountNumberRules,
cardNumberRules, cardNumberRules,
confirmAddAccBank,
}; };
}, },
emits: [ emits: [
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
@update:model-value="$emit('update:isOpenAddAccountBankDialog', $event)" @update:model-value="$emit('update:isOpenAddAccountBankDialog', $event)"
> >
<q-card style="min-width: 500px" bordered> <q-card style="min-width: 500px" bordered>
<q-form greedy @submit.prevent="$emit('addNewBankAccount')"> <q-form greedy @submit.prevent="confirmAddAccBank">
<q-card-section> <q-card-section>
<q-item style="padding-top: 0; padding-bottom: 0"> <q-item style="padding-top: 0; padding-bottom: 0">
<q-item-section> <q-item-section>
......
...@@ -373,6 +373,7 @@ export default { ...@@ -373,6 +373,7 @@ export default {
requireCardNumber: 'Vui lòng nhập số ghi trên thẻ', requireCardNumber: 'Vui lòng nhập số ghi trên thẻ',
requireBankName: 'Vui lòng chọn ngân hàng', requireBankName: 'Vui lòng chọn ngân hàng',
requireCardType: 'Vui lòng chọn loại thẻ', requireCardType: 'Vui lòng chọn loại thẻ',
errorIsDefault: 'Nghệ sỹ đã có tài khoản mặc định',
}, },
}, },
confirmActionsTitle: { confirmActionsTitle: {
......
...@@ -96,6 +96,7 @@ ...@@ -96,6 +96,7 @@
v-model:bank-name="bankName" v-model:bank-name="bankName"
v-model:card-type="cardType" v-model:card-type="cardType"
v-model:is-default="isDefault" v-model:is-default="isDefault"
:bank-accounts="bankAccounts"
@addNewBankAccount="addAccBank" @addNewBankAccount="addAccBank"
@click:CloseBtn="isOpenAddAccountBankDialog = false" @click:CloseBtn="isOpenAddAccountBankDialog = false"
></AddNewBankAccountDialog> ></AddNewBankAccountDialog>
......
...@@ -26,6 +26,8 @@ import { ...@@ -26,6 +26,8 @@ import {
BannerType, BannerType,
StoriesType, StoriesType,
SchedulesType, SchedulesType,
CardBankType,
TypeCardType,
} from 'src/assets/type'; } from 'src/assets/type';
export default defineComponent({ export default defineComponent({
...@@ -36,7 +38,7 @@ export default defineComponent({ ...@@ -36,7 +38,7 @@ export default defineComponent({
HotProduct, HotProduct,
AddNewBankAccountDialog, AddNewBankAccountDialog,
UploadEmbedDialog, UploadEmbedDialog,
AddHotProductDialog AddHotProductDialog,
}, },
watch: { watch: {
tab(value) { tab(value) {
...@@ -64,6 +66,17 @@ export default defineComponent({ ...@@ -64,6 +66,17 @@ export default defineComponent({
const nationalityOptions: Ref<NationalityType[]> = ref([]); const nationalityOptions: Ref<NationalityType[]> = ref([]);
const professionOptions: Ref<QualificationType[]> = ref([]); const professionOptions: Ref<QualificationType[]> = ref([]);
const artistLevelOptions: Ref<ArtistLevelType[]> = ref([]); const artistLevelOptions: Ref<ArtistLevelType[]> = ref([]);
const cardBankOptions: Ref<CardBankType[]> = ref([
{ id: 1, name: 'TPBank', status: 1, numIndex: 1 },
{ id: 2, name: 'BIDV', status: 1, numIndex: 1 },
{ id: 3, name: 'VietinBank', status: 1, numIndex: 1 },
{ id: 4, name: 'VietcomBank', status: 1, numIndex: 1 },
]);
const typeBankOptions: Ref<TypeCardType[]> = ref([
{ id: 1, name: 'ATM', status: 1, numIndex: 1 },
{ id: 2, name: 'Visa', status: 1, numIndex: 1 },
{ id: 3, name: 'Credit', status: 1, numIndex: 1 },
]);
const workOptions: Ref<WorkType[]> = ref([]); const workOptions: Ref<WorkType[]> = ref([]);
const sexOptions = ref([ const sexOptions = ref([
{ id: 1, name: 'Nam' }, { id: 1, name: 'Nam' },
...@@ -77,21 +90,33 @@ export default defineComponent({ ...@@ -77,21 +90,33 @@ export default defineComponent({
const artistName: Ref<string | null | undefined> = ref(); const artistName: Ref<string | null | undefined> = ref();
const birthday: Ref<string | null | undefined> = ref('29/04/2021'); const birthday: Ref<string | null | undefined> = ref('29/04/2021');
const sex: Ref<number | undefined> = ref(); const sex: Ref<number | undefined> = ref();
const cardBank: Ref<CardBankType> = ref({
id: 0,
name: '',
status: 1,
numIndex: 1,
});
const typeCard: Ref<TypeCardType> = ref({
id: 0,
name: '',
status: 1,
numIndex: 1,
});
const nationality: Ref<NationalityType> = ref({ const nationality: Ref<NationalityType> = ref({
id: 0, id: 0,
name: 'VN', name: '',
status: 1, status: 1,
numIndex: 1, numIndex: 1,
}); });
const qualification: Ref<QualificationType> = ref({ const qualification: Ref<QualificationType> = ref({
id: 0, id: 0,
name: 'Chuyen nghiep', name: '',
status: 1, status: 1,
numIndex: 1, numIndex: 1,
}); });
const artistLevel: Ref<ArtistLevelType> = ref({ const artistLevel: Ref<ArtistLevelType> = ref({
id: 0, id: 0,
name: 'Hang 1', name: '',
status: 1, status: 1,
artistLevel: 1, artistLevel: 1,
description: '', description: '',
...@@ -231,6 +256,7 @@ export default defineComponent({ ...@@ -231,6 +256,7 @@ export default defineComponent({
cardType: cardType.value, cardType: cardType.value,
isDefault: isDefault.value, isDefault: isDefault.value,
}; };
bankAccounts.value.push(newAccount as BankAccountType); bankAccounts.value.push(newAccount as BankAccountType);
isOpenAddAccountBankDialog.value = false; isOpenAddAccountBankDialog.value = false;
}; };
...@@ -254,8 +280,8 @@ export default defineComponent({ ...@@ -254,8 +280,8 @@ export default defineComponent({
const openDialogAddHotProduct = () => { const openDialogAddHotProduct = () => {
console.log('object'); console.log('object');
// console.log(openAddHotProduct.value); // console.log(openAddHotProduct.value);
openAddHotProduct.value = true openAddHotProduct.value = true;
} };
const openDialogAddAccBank = () => { const openDialogAddAccBank = () => {
accountNumber.value = null; accountNumber.value = null;
cardNumber.value = null; cardNumber.value = null;
...@@ -338,8 +364,11 @@ export default defineComponent({ ...@@ -338,8 +364,11 @@ export default defineComponent({
isOpenDialogEmbed, isOpenDialogEmbed,
deleteAccBank, deleteAccBank,
openDialogAddAccBank, openDialogAddAccBank,
openDialogAddHotProduct openDialogAddHotProduct,
cardBankOptions,
typeBankOptions,
cardBank,
typeCard,
}; };
}, },
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment