update

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