Commit 23acdc01 authored by Tình Trương's avatar Tình Trương

update fix-bug

parent 24aff151
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
@update:model-value="$emit('update:level', $event)" @update:model-value="$emit('update:level', $event)"
:label="$t('customerRank.dialogLabel.fieldLabels.level')" :label="$t('customerRank.dialogLabel.fieldLabels.level')"
:rules="levelRules" :rules="levelRules"
type="number" mask="#"
class="q-my-sm" class="q-my-sm"
outlined outlined
></q-input> ></q-input>
......
...@@ -50,11 +50,19 @@ export default defineComponent({ ...@@ -50,11 +50,19 @@ export default defineComponent({
i18n.global.t( i18n.global.t(
'artist.dialogLabel.validateMessages.requireAccountNumber' 'artist.dialogLabel.validateMessages.requireAccountNumber'
), ),
(val?: string) =>
(val && val.trim().length >= 8) ||
i18n.global.t(
'artist.dialogLabel.validateMessages.requireAccountNumber1'
),
]; ];
const cardNumberRules = [ const cardNumberRules = [
(val?: string) => (val?: string) =>
(val && val.trim().length) || (val && val.trim().length) ||
i18n.global.t('artist.dialogLabel.validateMessages.requireCardNumber'), i18n.global.t('artist.dialogLabel.validateMessages.requireCardNumber'),
(val?: string) =>
(val && val.trim().length === 16) ||
i18n.global.t('artist.dialogLabel.validateMessages.requireCardNumber1'),
]; ];
const bankNameRules = [ const bankNameRules = [
(val: number | null) => (val: number | null) =>
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
:label="$t('artist.dialogLabel.fieldLabels.accountNumber')" :label="$t('artist.dialogLabel.fieldLabels.accountNumber')"
:rules="accountNumberRules" :rules="accountNumberRules"
hide-bottom-space hide-bottom-space
type="number" mask="###############"
class="q-my-sm" class="q-my-sm"
outlined outlined
></q-input> ></q-input>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
:label="$t('artist.dialogLabel.fieldLabels.cardNumber')" :label="$t('artist.dialogLabel.fieldLabels.cardNumber')"
:rules="cardNumberRules" :rules="cardNumberRules"
hide-bottom-space hide-bottom-space
type="text" mask="################"
class="q-my-sm" class="q-my-sm"
outlined outlined
></q-input> ></q-input>
......
...@@ -313,7 +313,7 @@ ...@@ -313,7 +313,7 @@
@update:model-value="$emit('update:phoneNumber', $event)" @update:model-value="$emit('update:phoneNumber', $event)"
:error="phoneNumberRules" :error="phoneNumberRules"
:error-message="errorMessPhoneNumber" :error-message="errorMessPhoneNumber"
type="number" mask="##########"
outlined outlined
dense dense
hide-bottom-space hide-bottom-space
......
...@@ -44,61 +44,6 @@ export default defineComponent({ ...@@ -44,61 +44,6 @@ export default defineComponent({
const level: Ref<CustomerLevelType | null> = ref(null); const level: Ref<CustomerLevelType | null> = ref(null);
const confirmAddCustomer = () => { const confirmAddCustomer = () => {
// let hasError = false;
// if (
// props.listCustomers.filter((customer) => customer.code === code.value)
// .length
// ) {
// hasError = true;
// Notify.create({
// type: 'negative',
// message: i18n.global.t('customer.validateMessages.codeExists'),
// });
// }
// if (
// props.listCustomers.filter(
// (customer) => customer.userName === userName.value
// ).length
// ) {
// hasError = true;
// Notify.create({
// type: 'negative',
// message: i18n.global.t('customer.validateMessages.userNameExists'),
// });
// }
// if (
// props.listCustomers.filter(
// (customer) => customer.taxCode === taxCode.value
// ).length
// ) {
// hasError = true;
// Notify.create({
// type: 'negative',
// message: i18n.global.t('customer.validateMessages.taxCodeExists'),
// });
// }
// if (
// props.listCustomers.filter((customer) => customer.email === email.value)
// .length
// ) {
// hasError = true;
// Notify.create({
// type: 'negative',
// message: i18n.global.t('customer.validateMessages.emailExists'),
// });
// }
// if (
// props.listCustomers.filter((customer) => customer.phone === phone.value)
// .length
// ) {
// hasError = true;
// Notify.create({
// type: 'negative',
// message: i18n.global.t('customer.validateMessages.phoneExists'),
// });
// }
// if (!hasError) {
context.emit('addNewCustomer', { context.emit('addNewCustomer', {
code: code.value, code: code.value,
userName: userName.value, userName: userName.value,
......
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
v-model="phone" v-model="phone"
:label="$t('customer.dialogLabel.fieldLabels.phone')" :label="$t('customer.dialogLabel.fieldLabels.phone')"
:rules="phoneRules" :rules="phoneRules"
type="number" mask="##########"
class="q-my-sm" class="q-my-sm"
outlined outlined
hide-bottom-space hide-bottom-space
......
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
v-model="phone" v-model="phone"
:label="$t('customer.dialogLabel.fieldLabels.phone')" :label="$t('customer.dialogLabel.fieldLabels.phone')"
class="q-my-sm" class="q-my-sm"
type="number" mask="##########"
:rules="phoneRules" :rules="phoneRules"
outlined outlined
hide-bottom-space hide-bottom-space
......
...@@ -425,8 +425,10 @@ export default { ...@@ -425,8 +425,10 @@ export default {
validateMessages: { validateMessages: {
requireAccountOwner: 'Vui lòng nhập Chủ tài khoản', requireAccountOwner: 'Vui lòng nhập Chủ tài khoản',
requireAccountNumber: 'Vui lòng nhập Số tài khoản', requireAccountNumber: 'Vui lòng nhập Số tài khoản',
requireAccountNumber1: 'Số tài khoản không hợp lệ',
accountNumberExits: 'Số tài khoản đã tồn tại', accountNumberExits: 'Số tài khoản đã tồn tại',
requireCardNumber: 'Vui lòng nhập Số ghi trên thẻ', requireCardNumber: 'Vui lòng nhập Số ghi trên thẻ',
requireCardNumber1: 'Số ghi trên thẻ không hợp lệ',
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 ngân hàng mặc định', errorIsDefault: 'Nghệ sỹ đã có tài khoản ngân hàng mặc định',
......
...@@ -81,6 +81,7 @@ export default defineComponent({ ...@@ -81,6 +81,7 @@ export default defineComponent({
const typeBankOptions: Ref<TypeCardType[]> = ref([]); const typeBankOptions: Ref<TypeCardType[]> = ref([]);
const workOptions: Ref<WorkType[]> = ref([]); const workOptions: Ref<WorkType[]> = ref([]);
const sexOptions = ref([ const sexOptions = ref([
{ id: 0, name: 'Khác' },
{ id: 1, name: 'Nam' }, { id: 1, name: 'Nam' },
{ id: 2, name: 'Nữ' }, { id: 2, name: 'Nữ' },
]); ]);
......
...@@ -115,7 +115,7 @@ export default defineComponent({ ...@@ -115,7 +115,7 @@ export default defineComponent({
const showDialogUpdate = ref(false); const showDialogUpdate = ref(false);
const pageIndex = ref(1); const pageIndex = ref(1);
const pageSize = ref(20); const pageSize = ref(20);
const totalPage = ref(10); const totalPage = ref(0);
const companyNameSelected: Ref<string | null> = ref(null); const companyNameSelected: Ref<string | null> = ref(null);
const taxCodeSelected: Ref<string | null> = ref(null); const taxCodeSelected: Ref<string | null> = ref(null);
const levelSelected: Ref<CustomerLevelType | null> = ref(null); const levelSelected: Ref<CustomerLevelType | null> = ref(null);
......
...@@ -63,15 +63,17 @@ ...@@ -63,15 +63,17 @@
:no-data-label="$t('emptyData')" :no-data-label="$t('emptyData')"
row-key="name" row-key="name"
separator="cell" separator="cell"
:pagination="{ rowsPerPage: pageSize }" :rows-per-page-label="$t('recordPerPage')"
:pagination="{
rowsPerPage: 0,
}"
wrap-cells
hide-pagination hide-pagination
class="sticky-header-table" class="sticky-header-table"
> >
<template v-slot:body-cell-stt="item"> <template v-slot:body-cell-stt="item">
<q-td style="padding: 0; height: 100%"> <q-td :item="item">
<div align="center"> {{ 1 + item.rowIndex + pageSize * (pageIndex - 1) }}
{{ item.rowIndex + 1 }}
</div>
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-action="rowData"> <template v-slot:body-cell-action="rowData">
......
...@@ -118,6 +118,7 @@ export default defineComponent({ ...@@ -118,6 +118,7 @@ export default defineComponent({
const totalPage = ref(0); const totalPage = ref(0);
const fullNameKeyword = ref(''); const fullNameKeyword = ref('');
const sexOptions = ref([ const sexOptions = ref([
{ id: 0, name: 'Khác' },
{ id: 1, name: 'Nam' }, { id: 1, name: 'Nam' },
{ id: 2, name: 'Nữ' }, { id: 2, name: 'Nữ' },
]); ]);
......
...@@ -290,6 +290,7 @@ export default defineComponent({ ...@@ -290,6 +290,7 @@ export default defineComponent({
const totalPage = ref(0); const totalPage = ref(0);
const fullNameKeyword = ref(''); const fullNameKeyword = ref('');
const sexOptions = ref([ const sexOptions = ref([
{ id: 0, name: 'Khác' },
{ id: 1, name: 'Nam' }, { id: 1, name: 'Nam' },
{ id: 2, name: 'Nữ' }, { id: 2, name: 'Nữ' },
]); ]);
......
...@@ -103,6 +103,7 @@ export default defineComponent({ ...@@ -103,6 +103,7 @@ export default defineComponent({
const mobileNumber = ref(''); const mobileNumber = ref('');
const sex: Ref<number | undefined> = ref(); const sex: Ref<number | undefined> = ref();
const sexOptions = ref([ const sexOptions = ref([
{ id: 0, text: 'Khác' },
{ id: 1, text: 'Nam' }, { id: 1, text: 'Nam' },
{ id: 2, text: 'Nữ' }, { id: 2, text: 'Nữ' },
]); ]);
......
...@@ -81,6 +81,7 @@ export default defineComponent({ ...@@ -81,6 +81,7 @@ export default defineComponent({
const typeBankOptions: Ref<TypeCardType[]> = ref([]); const typeBankOptions: Ref<TypeCardType[]> = ref([]);
const workOptions: Ref<WorkType[]> = ref([]); const workOptions: Ref<WorkType[]> = ref([]);
const sexOptions = ref([ const sexOptions = ref([
{ id: 0, name: 'Khác' },
{ id: 1, name: 'Nam' }, { id: 1, name: 'Nam' },
{ id: 2, name: 'Nữ' }, { id: 2, name: 'Nữ' },
]); ]);
......
...@@ -62,9 +62,19 @@ ...@@ -62,9 +62,19 @@
row-key="customerRankCode" row-key="customerRankCode"
separator="cell" separator="cell"
:no-data-label="$t('emptyData')" :no-data-label="$t('emptyData')"
:rows-per-page-label="$t('recordPerPage')"
:pagination="{
rowsPerPage: 0,
}"
wrap-cells
hide-pagination hide-pagination
class="sticky-header-table" class="sticky-header-table"
> >
<template v-slot:body-cell-stt="item">
<q-td :item="item">
{{ 1 + item.rowIndex + pageSize * (pageIndex - 1) }}
</q-td>
</template>
<template v-slot:body-cell-action="item"> <template v-slot:body-cell-action="item">
<q-td style="padding: 0" class="flex flex-center"> <q-td style="padding: 0" class="flex flex-center">
<q-btn <q-btn
...@@ -159,14 +169,14 @@ export default defineComponent({ ...@@ -159,14 +169,14 @@ export default defineComponent({
}, },
setup() { setup() {
const customerRankTableColumns = [ const customerRankTableColumns = [
// { {
// name: 'index', name: 'stt',
// field: 'index', field: 'stt',
// required: true, required: true,
// label: 'STT', label: 'STT',
// align: 'center', align: 'center',
// sortable: false, sortable: false,
// }, },
{ {
name: 'code', name: 'code',
field: 'code', field: 'code',
...@@ -219,13 +229,19 @@ export default defineComponent({ ...@@ -219,13 +229,19 @@ export default defineComponent({
const updateCustomerRankDialogIsOpened = ref(false); const updateCustomerRankDialogIsOpened = ref(false);
const code = ref(''); const code = ref('');
const name = ref(''); const name = ref('');
const pageIndex = ref(1);
const pageSize = ref(20);
const totalPage = ref(0);
const level: Ref<number | undefined> = ref(undefined); const level: Ref<number | undefined> = ref(undefined);
const status: Ref<number> = ref(CustomerRankStatus.active); const status: Ref<number> = ref(CustomerRankStatus.active);
const customerRankId: Ref<number | undefined> = ref(undefined); const customerRankId: Ref<number | undefined> = ref(undefined);
const nameCustomerRank = ref(''); const nameCustomerRank = ref('');
const levelCustomerRank: Ref<number | undefined> = ref(undefined); const levelCustomerRank: Ref<number | undefined> = ref(undefined);
const codeCustomerRank = ref(''); const codeCustomerRank = ref('');
const changePageSize = () => {
pageIndex.value = 1;
void getListCustomerRank();
};
//gọi api ds //gọi api ds
const getListCustomerRank = async () => { const getListCustomerRank = async () => {
const response = (await api({ const response = (await api({
...@@ -372,6 +388,10 @@ export default defineComponent({ ...@@ -372,6 +388,10 @@ export default defineComponent({
void getListCustomerRank(); void getListCustomerRank();
}); });
return { return {
pageSize,
totalPage,
changePageSize,
pageIndex,
addCustomerRankDialogIsOpened, addCustomerRankDialogIsOpened,
updateCustomerRankDialogIsOpened, updateCustomerRankDialogIsOpened,
customerRankTableColumns, customerRankTableColumns,
......
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