update

parent bfbb8e26
......@@ -14,6 +14,10 @@ export default defineComponent({
type: Array as PropType<BankAccountType[]>,
required: true,
},
rowBankAccIdx: {
type: Number,
required: true,
},
accountNumber: { type: String, required: true },
cardNumber: { type: String, required: true },
bankName: { type: String, required: true },
......@@ -44,9 +48,17 @@ export default defineComponent({
i18n.global.t('artist.dialogLabel.validateMessages.requireCardType'),
];
const confirmEditAccBank = () => {
let idx = 0;
for (let index = 0; index < props.bankAccounts.length; index++) {
const element = props.bankAccounts[index];
if ((element.isDefault = 1)) {
idx = index;
}
}
if (
props.isDefault === 1 &&
props.bankAccounts.filter((item) => item.isDefault === 1).length
props.bankAccounts.filter((item) => item.isDefault === 1).length &&
idx !== props.rowBankAccIdx
) {
Notify.create({
type: 'negative',
......@@ -58,7 +70,7 @@ export default defineComponent({
Notify.create({
type: 'positive',
message: i18n.global.t(
'artist.dialogLabel.validateMessages.addAccess'
'artist.dialogLabel.validateMessages.editAccess'
),
});
context.emit('editBankAccount');
......
......@@ -11,7 +11,7 @@
<q-item-section>
<q-item-label
><div class="text-h6 text-weight-regular" align="center">
{{ $t('artist.dialogLabel.title.addAccountBank') }}
{{ $t('artist.dialogLabel.title.editAccountBank') }}
</div></q-item-label
>
</q-item-section>
......
......@@ -359,6 +359,7 @@ export default {
addArtist: 'Thêm nghệ sỹ',
updateArtist: 'Cập nhật nghệ sỹ',
addAccountBank: 'Thêm tài khoản ngân hàng',
editAccountBank: 'Cập nhật tài khoản ngân hàng',
addHotProduct: 'Thêm sản phẩm nổi bật',
},
fieldLabels: {
......@@ -375,6 +376,8 @@ export default {
requireCardType: 'Vui lòng chọn loại thẻ',
errorIsDefault: 'Nghệ sỹ đã có tài khoản ngân hàng mặc định',
addAccess: 'Thêm tài khoản ngân hàng thành công',
editAccess: 'Cập nhật thông tin tài khoản ngân hàng thành công',
deleteAccess: 'Xoá tài khoản ngân hàng thành công',
},
},
confirmActionsTitle: {
......
......@@ -111,6 +111,7 @@
v-model:bank-name="bankName"
v-model:card-type="cardType"
v-model:is-default="isDefault"
:row-bank-acc-idx="rowBankAccIdx"
:bank-accounts="bankAccounts"
@editBankAccount="editAccBank"
@click:CloseBtn="isOpenEditAccountBankDialog = false"
......
......@@ -13,7 +13,7 @@ import { useRoute } from 'vue-router';
import { AxiosResponse } from 'axios';
import moment from 'moment';
import { i18n } from 'src/boot/i18n';
import { Dialog } from 'quasar';
import { Dialog, Notify } from 'quasar';
import {
ArtistInfoType,
......@@ -294,6 +294,12 @@ export default defineComponent({
isOpenAddAccountBankDialog.value = true;
};
const deleteAccBank = (index: number) => {
Notify.create({
type: 'positive',
message: i18n.global.t(
'artist.dialogLabel.validateMessages.deleteAccess'
),
});
bankAccounts.value.splice(index, 1);
};
const selectedFile = (value: BannerType) => {
......
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