Commit 68a80dbf authored by Tình Trương's avatar Tình Trương

update

parent 0c261995
......@@ -80,4 +80,6 @@ export enum API_PATHS {
deleteCategoryPost = 'postCategory/delete',
detailCategoryPost = 'postCategory/detail',
updateCategoryPost = 'postCategory/update',
getListBooking = 'booking',
getBookingDetail = 'booking/detail',
}
......@@ -37,9 +37,10 @@ export enum BannerStatus {
export enum BookingStatus {
active = 1,
inactive = 2,
waitBooking = 0,
}
export enum ActiveStatus {
active = 1,
inactive = 1,
inactive = 0,
}
......@@ -398,3 +398,17 @@ export type MenuType = {
updateBy: string | null;
updateTime: string | null;
};
export type ListBooking = {
id: number;
bookingCode: number;
artistName: string;
userName: string;
content: string;
address: string;
fromTime: string;
toTime: string;
status: number;
activeStatus: number;
fee: string;
};
import { defineComponent, Ref, ref, watch } from 'vue';
import { i18n } from 'src/boot/i18n';
// import { isEmail } from '../../../boot/functions';
// import { isMobilePhone } from '../../../boot/functions';
import UploadImage from '../../upload-image/index.vue';
export default defineComponent({
......@@ -18,6 +16,7 @@ export default defineComponent({
setup(props, context) {
const file: Ref<File | string> = ref('');
const name: Ref<string> = ref('');
const code: Ref<string> = ref('');
const embeddedUrl: Ref<string> = ref('');
const urlFileLocal: Ref<string> = ref('');
......@@ -37,6 +36,7 @@ export default defineComponent({
const ResetData = () => {
file.value = '';
code.value = '';
name.value = '';
embeddedUrl.value = '';
urlFileLocal.value = '';
status.value = 2;
......@@ -45,12 +45,22 @@ export default defineComponent({
context.emit('click:CloseBtnAddHotProduct');
context.emit('insertData', {
file: file.value,
name: name.value,
code: code.value,
status: status.value,
embeddedUrl: embeddedUrl.value,
imageUrl: urlFileLocal.value,
});
};
const product_name = [
(val?: string) =>
(val && val.trim().length) ||
i18n.global.t(
'artist.artistInformation.validateMessages.requireProducName'
),
];
const product_code = [
(val?: string) =>
(val && val.trim().length) ||
......@@ -71,10 +81,12 @@ export default defineComponent({
SubmitData,
urlFileLocal,
file,
name,
code,
embeddedUrl,
status,
ResetData,
product_name,
product_code,
url_embed,
};
......
......@@ -31,6 +31,18 @@
:isBtn="true"
@selectedFile="uploadAvatar"
></UploadImage>
<q-input
v-model="name"
label="
Tên sản phẩm
"
:rules="product_name"
type="text"
class="q-my-sm"
outlined
hide-bottom-space
clearable
></q-input>
<q-input
v-model="code"
label="
......
......@@ -34,6 +34,18 @@
:isBtn="true"
@selectedFile="uploadAvatar"
></UploadImage>
<q-input
v-model="name"
label="
Tên sản phẩm
"
:rules="product_name"
type="text"
class="q-my-sm"
outlined
hide-bottom-space
clearable
></q-input>
<q-input
v-model="code"
label="
......
......@@ -24,6 +24,7 @@ export default defineComponent({
setup(props, context) {
const configImg = config;
const file: Ref<File | string> = ref('');
const name: Ref<string> = ref('');
const code: Ref<string> = ref('');
const embeddedUrl: Ref<string> = ref('');
const urlFileLocal: Ref<string> = ref('');
......@@ -41,6 +42,7 @@ export default defineComponent({
(value) => {
if (value) {
id.value = props.dataUpdate?.id as number;
name.value = props.dataUpdate?.name as string;
code.value = props.dataUpdate?.code as string;
embeddedUrl.value = props.dataUpdate?.embeddedUrl as string;
status.value = props.dataUpdate?.status as number;
......@@ -54,6 +56,7 @@ export default defineComponent({
);
const ResetData = () => {
file.value = '';
name.value = '';
code.value = '';
embeddedUrl.value = '';
urlFileLocal.value = '';
......@@ -63,6 +66,7 @@ export default defineComponent({
context.emit('click:CloseBtnUpdateHotProduct');
context.emit('UpdateData', {
file: file.value,
name: name.value,
code: code.value,
status: status.value,
embeddedUrl: embeddedUrl.value,
......@@ -70,6 +74,13 @@ export default defineComponent({
id: id.value,
});
};
const product_name = [
(val?: string) =>
(val && val.trim().length) ||
i18n.global.t(
'artist.artistInformation.validateMessages.requireProducName'
),
];
const product_code = [
(val?: string) =>
(val && val.trim().length) ||
......@@ -90,15 +101,16 @@ export default defineComponent({
SubbmitDataUpdate,
urlFileLocal,
file,
name,
code,
embeddedUrl,
status,
ResetData,
product_name,
product_code,
url_embed,
id,
configImg,
imageAPI,
};
},
......
......@@ -33,6 +33,15 @@
:isBtn="true"
></UploadImage>
<q-input
label="Tiêu đề"
hide-bottom-space
type="text"
class="q-my-sm"
outlined
clearable
></q-input>
<q-input
v-model="content"
label="Nội dung"
......
......@@ -208,7 +208,9 @@
<div
@click="$emit('openDialogUploadEmbed')"
class="flex flex-center"
:style="socialEmbedded !== null ? 'height: 85%;' : 'height: 85%'"
:style="
socialEmbedded !== null ? 'height: 580px;' : 'height: 580px'
"
>
<iframe
v-if="socialEmbedded !== null"
......@@ -256,7 +258,7 @@
</div>
<div
class="flex flex-center"
:style="stories.length ? 'height: 85%' : 'height: 85%;'"
:style="stories.length ? 'height: 580px' : 'height: 580px;'"
bordered
v-if="!stories.length"
>
......@@ -315,9 +317,11 @@
@click="deleteStory(storyIdx)"
></q-icon>
</div>
<q-input outlined type="text" class="q-py-sm" readonly></q-input>
<q-input
outlined
type="textarea"
class="q-px-sm"
class="q-py-sm"
:model-value="story.content"
@update:model-value="$emit('update:content', $event)"
readonly
......@@ -329,7 +333,7 @@
<div class="col-4">
<div class="text-h6 text-weight-regular q-py-md">Lịch</div>
<q-date
style="width: 100%; height: 85%"
style="width: 100%; height: 580px"
:model-value="formatSchedules"
@update:model-value="$emit('update:formatSchedules', $event)"
multiple
......
......@@ -22,6 +22,14 @@ export default defineComponent({
align: 'center',
sortable: false,
},
{
name: 'name',
field: 'name',
required: true,
label: i18n.global.t('artist.hotProduct.tableColumnsProduct.name'),
align: 'center',
sortable: false,
},
{
name: 'code',
field: 'code',
......
......@@ -166,6 +166,7 @@ export default defineComponent({
i18n.global.t('customer.validateMessages.requiredPosition'),
];
return {
isPwd: ref(true),
userNameRules,
customerNameRules,
businessNameRules,
......
......@@ -33,11 +33,20 @@
v-model="password"
:label="$t('customer.dialogLabel.fieldLabels.password')"
:rules="passwordRules"
hide-bottom-space
type="password"
class="q-my-sm"
outlined
></q-input>
:type="isPwd ? 'password' : 'text'"
class="q-my-sm"
autocomplete="new-password"
hide-bottom-space
>
<template v-slot:append>
<q-icon
:name="isPwd ? 'visibility_off' : 'visibility'"
class="cursor-pointer"
@click="isPwd = !isPwd"
/>
</template>
</q-input>
<q-input
v-model="code"
:label="$t('customer.dialogLabel.fieldLabels.code')"
......
......@@ -148,6 +148,7 @@ export default defineComponent({
i18n.global.t('customer.validateMessages.requiredPosition'),
];
return {
isPwd: ref(true),
userNameRules,
customerNameRules,
businessNameRules,
......
......@@ -34,11 +34,18 @@
v-model="password"
:label="$t('customer.dialogLabel.fieldLabels.password')"
:rules="passwordRules"
hide-bottom-space
type="password"
class="q-my-sm"
outlined
readonly
:type="isPwd ? 'password' : 'text'"
class="q-my-sm"
autocomplete="new-password"
hide-bottom-space
>
<template v-slot:append>
<q-icon
:name="isPwd ? 'visibility_off' : 'visibility'"
class="cursor-pointer"
@click="isPwd = !isPwd"
/> </template
></q-input>
<q-input
v-model="code"
......
<template>
<q-dialog
persistent
:model-value="showDialog"
@update:model-value="$emit('update:showDialog', $event)"
>
<q-card style="min-width: 56rem" bordered>
<q-form greedy>
<q-card-section>
<q-item>
<q-item-section>
<q-item-label class="text-h6 text-weight-regular">{{
$t('listBooking.dialogLabel.title')
}}</q-item-label>
</q-item-section>
</q-item>
</q-card-section>
<q-separator />
<q-card-section>
<div class="col-12 q-px-xl">
<div class="row q-col-gutter-sm">
<div class="col-4 fs-14 color">
{{ $t('listBooking.titleColumnsTable.bookingCode') }}:
</div>
<div class="col-8 fs-14">{{ detailInfoBooking.bookingCode }}</div>
<div class="col-4 fs-14 color">
{{ $t('listBooking.titleColumnsTable.artistName') }}:
</div>
<div class="col-8 fs-14">{{ detailInfoBooking.artistName }}</div>
<div class="col-4 fs-14 color">
{{ $t('listBooking.titleColumnsTable.userName') }}:
</div>
<div class="col-8 fs-14">{{ detailInfoBooking.userName }}</div>
<div class="col-4 fs-14 color">
{{ $t('listBooking.titleColumnsTable.address') }}:
</div>
<div class="col-8 fs-14">{{ detailInfoBooking.address }}</div>
<div class="col-4 fs-14 color">
{{ $t('listBooking.titleColumnsTable.content') }}:
</div>
<div class="col-8 fs-14">{{ detailInfoBooking.content }}</div>
<div class="col-4 fs-14 color">
{{ $t('listBooking.titleColumnsTable.fromTime') }}:
</div>
<div class="col-8 fs-14">{{ detailInfoBooking.fromTime }}</div>
<div class="col-4 fs-14 color">
{{ $t('listBooking.titleColumnsTable.toTime') }}:
</div>
<div class="col-8 fs-14">{{ detailInfoBooking.toTime }}</div>
<div class="col-4 fs-14 color">
{{ $t('listBooking.titleColumnsTable.fee') }}:
</div>
<div class="col-8 fs-14">{{ detailInfoBooking.fee }}</div>
<!-- <div class="col-4 fs-14 color">
{{ $t('listBooking.titleColumnsTable.like') }}:
</div>
<div class="col-8 fs-14">{{ detailInfoBooking.like }}</div> -->
<div class="col-4 fs-14 color">
{{ $t('listBooking.titleColumnsTable.status') }}:
</div>
<div class="col-8 fs-14">{{ detailInfoBooking.status }}</div>
<div class="col-4 fs-14 color">
{{ $t('listBooking.titleColumnsTable.activeStatus') }}:
</div>
<div class="col-8 fs-14">
{{ detailInfoBooking.activeStatus }}
</div>
</div>
</div>
</q-card-section>
<q-card-actions align="right">
<q-btn
color="grey"
no-caps
style="width: 90px"
:label="$t('listBooking.crudActions.cancel')"
@click="$emit('click:CloseBtn')"
/>
</q-card-actions>
</q-form>
</q-card>
</q-dialog>
</template>
<script lang="ts">
import { defineComponent, PropType, watch } from 'vue';
import { ListBooking } from 'src/assets/type';
export default defineComponent({
props: {
showDialog: {
type: Boolean,
required: true,
},
detailInfoBooking: {
type: Object as PropType<ListBooking>,
required: true,
},
},
setup(props) {
watch(
() => props.showDialog,
(value) => {
if (value) {
}
}
);
return {};
},
emits: ['update:showDialog', 'click:CloseBtn'],
});
</script>
<style scoped>
.fs-14 {
font-size: 14px;
}
.color {
color: #5d319e;
}
</style>
......@@ -168,7 +168,7 @@
icon="mdi-delete-outline"
@click="deleteContract(item.rowIndex)"
>
<q-tooltip :offset="[20, 10]">{{
<q-tooltip :offset="[10, 10]">{{
$t('managingUnitAdd.toolTipMessage.delete')
}}</q-tooltip>
</q-btn>
......@@ -179,7 +179,7 @@
icon="mdi-account-edit-outline"
@click="openUpdateArtistDialog(item.row, item.rowIndex)"
>
<q-tooltip :offset="[20, 10]">{{
<q-tooltip :offset="[10, 10]">{{
$t('managingUnitAdd.toolTipMessage.updateInfo')
}}</q-tooltip>
</q-btn>
......@@ -213,9 +213,17 @@
</q-td>
</template>
</q-table>
<div v-if="check_artistList">Không được để trống</div>
{{ check_artistList }}
<div
v-if="check_artistList"
style="color: #c10015; font-size: 12px"
>
Không được để trống
</div>
</div>
<div></div>
<!-- ngân hàng -->
<div class="row q-pt-lg">
<div class="col-auto text-h6 text-weight-regular flex q-ml-md">
......@@ -246,7 +254,7 @@
<template v-slot:body-cell-action="">
<q-td style="padding: 0" class="flex flex-center">
<q-btn flat round color="primary" icon="mdi-delete-outline">
<q-tooltip :offset="[20, 10]">{{
<q-tooltip :offset="[10, 10]">{{
$t('managingUnitAdd.toolTipMessage.deleteBankAccount')
}}</q-tooltip>
</q-btn>
......@@ -256,7 +264,7 @@
color="primary"
icon="mdi-account-edit-outline"
>
<q-tooltip :offset="[20, 10]">{{
<q-tooltip :offset="[10, 10]">{{
$t('managingUnitAdd.toolTipMessage.updateBankAccount')
}}</q-tooltip>
</q-btn>
......
......@@ -490,6 +490,7 @@ export default {
requireEmailAdminister: 'Vui lòng nhập Email người quản lý',
requirePhoneNumberAdminister:
'Vui lòng nhập Số điện thoại người quản lý',
requireProducName: 'Vui lòng nhập Tên sản phẩm',
requireProducCode: 'Vui lòng nhập Mã sản phẩm',
requireUrlembed: 'Vui lòng nhập Url Embed',
requireArtistCode: 'Vui lòng nhập Mã nghệ sỹ',
......@@ -529,6 +530,7 @@ export default {
},
hotProduct: {
tableColumnsProduct: {
name: 'Tên sản phẩm',
productCode: 'Mã sản phẩm',
urlEmbed: 'Url embed',
productImage: 'Ảnh sản phẩm',
......@@ -918,25 +920,31 @@ export default {
title: 'Danh sách booking',
titleColumnsTable: {
stt: 'STT',
customerName: 'Khách hàng',
bookingCode: 'Mã',
userName: 'Khách hàng',
artistName: 'Nghệ sỹ',
description: 'Nội dung',
place: 'Địa điểm',
startTime: 'Thời gian bắt đầu',
endTime: 'Thời gian kết thúc',
statusBooking: 'Trạng thái Booking',
statusActive: 'Trạng thái hoạt động',
createTime: 'Thời gian tạo',
createBy: 'Người tạo',
updateBy: 'Người cập nhật',
updateTime: 'Thời gian cập nhật',
content: 'Nội dung',
address: 'Địa điểm',
fromTime: 'Thời gian bắt đầu',
toTime: 'Thời gian kết thúc',
fee: 'Giá',
like: 'Số lượt thích',
status: 'T.T Booking',
activeStatus: 'T.T Thực hiện',
action: 'Chức năng',
},
dialogLabel: {
title: 'Thông tin Booking',
},
crudActions: {
cancel: 'Đóng',
},
statusLabel: {
activeBooking: 'Đã xác nhận',
inactiveBooking: 'Không xác nhận',
activeEvent: 'Active',
inactiveEvent: 'Xoá',
waitBooking: 'Chờ nhận',
activeBooking: 'Đã nhận',
inactiveBooking: 'Từ chối',
activeEvent: 'Đã diễn',
inactiveEvent: 'Chưa diễn',
},
},
work: {
......
......@@ -14,13 +14,6 @@
name="information"
:label="$t('artist.artistInformation.tabLabel.personalInformation')"
>
<!-- <template v-slot:default>
<q-icon
style="position: absolute; top: 5px; right: -16px"
name="mdi-alert"
color="red"
></q-icon>
</template> -->
</q-tab>
<q-tab
name="vabAccount"
......
......@@ -36,9 +36,6 @@ import {
TypeCardType,
FileUploadType,
} from 'src/assets/type';
// import { isEmail } from '../../boot/functions';
// import { isMobilePhone } from '../../boot/functions';
export type AvatarType = {
file?: File;
url?: string | null;
......@@ -690,14 +687,6 @@ export default defineComponent({
'artist.artistInformation.validateMessages.requirePhoneNumber'
);
}
// if (!isMobilePhone(phoneNumber.value as string)) {
// hasError = true;
// phoneNumberRules.value = true;
// errorMessPhoneNumber.value = i18n.global.t(
// 'artist.artistInformation.validateMessages.isPhone'
// );
// }
if (!email.value || !email.value?.trim().length) {
hasError = true;
emailRules.value = true;
......@@ -705,30 +694,24 @@ export default defineComponent({
'artist.artistInformation.validateMessages.requireEmail'
);
}
// if (!isEmail(email.value as string)) {
// if (
// !phoneNumberAdminister.value ||
// !phoneNumberAdminister.value?.trim().length
// ) {
// hasError = true;
// emailRules.value = true;
// errorMessEmail.value = i18n.global.t(
// 'artist.artistInformation.validateMessages.isEmail'
// phoneNumberAdministerRules.value = true;
// errorMessPhoneNumberAdminister.value = i18n.global.t(
// 'artist.artistInformation.validateMessages.requirePhoneNumberAdminister'
// );
// }
// if (!emailAdminister.value || !emailAdminister.value?.trim().length) {
// hasError = true;
// emailAdministerRules.value = true;
// errorMessEmailAdminister.value = i18n.global.t(
// 'artist.artistInformation.validateMessages.requireEmailAdminister'
// );
// }
if (
!phoneNumberAdminister.value ||
!phoneNumberAdminister.value?.trim().length
) {
hasError = true;
phoneNumberAdministerRules.value = true;
errorMessPhoneNumberAdminister.value = i18n.global.t(
'artist.artistInformation.validateMessages.requirePhoneNumberAdminister'
);
}
if (!emailAdminister.value || !emailAdminister.value?.trim().length) {
hasError = true;
emailAdministerRules.value = true;
errorMessEmailAdminister.value = i18n.global.t(
'artist.artistInformation.validateMessages.requireEmailAdminister'
);
}
if (artistLevel.value === null) {
hasError = true;
......@@ -805,7 +788,6 @@ export default defineComponent({
instagram: instagram.value,
whatsapp: whatsapp.value,
fullName: fullName.value,
// "workStatus": 1,
shortDescription: null,
account: null,
socialEmbedded: socialEmbedded.value,
......@@ -856,7 +838,6 @@ export default defineComponent({
void getNationalityOptions();
void getArtistLevelOptions();
void getQualificationOptions();
void getBankOptions();
void getTypeCardOptions();
});
......
import { i18n } from 'src/boot/i18n';
import { defineComponent, onMounted, Ref, ref } from 'vue';
import Pagination from 'components/pagination/index.vue';
import { BookingStatus } from 'src/assets/enums';
import { ActiveStatus } from 'src/assets/enums';
export default defineComponent({
components: {
Pagination,
},
setup() {
const tableColumns = [
{
name: 'stt',
field: 'stt',
required: true,
label: i18n.global.t('listBooking.titleColumnsTable.stt'),
align: 'center',
sortable: false,
},
{
name: 'artistName',
field: 'artistName',
required: true,
label: i18n.global.t('listBooking.titleColumnsTable.artistName'),
align: 'center',
headerStyle: 'text-align: center !important;',
sortable: false,
},
{
name: 'customerName',
field: 'customerName',
required: true,
label: i18n.global.t('listBooking.titleColumnsTable.customerName'),
headerStyle: 'text-align: center !important;',
align: 'left',
sortable: false,
},
{
name: 'description',
field: 'description',
required: true,
label: i18n.global.t('listBooking.titleColumnsTable.description'),
headerStyle: 'text-align: center !important;',
align: 'left',
sortable: false,
},
{
name: 'place',
field: 'place',
required: true,
label: i18n.global.t('listBooking.titleColumnsTable.place'),
headerStyle: 'text-align: center !important;',
align: 'left',
sortable: false,
},
{
name: 'startTime',
field: 'startTime',
required: true,
label: i18n.global.t('listBooking.titleColumnsTable.startTime'),
headerStyle: 'text-align: center !important;',
align: 'center',
sortable: false,
},
{
name: 'endTime',
field: 'endTime',
required: true,
label: i18n.global.t('listBooking.titleColumnsTable.endTime'),
headerStyle: 'text-align: center !important;',
align: 'center',
sortable: false,
},
{
name: 'statusBooking',
field: 'statusBooking',
required: true,
label: i18n.global.t('listBooking.titleColumnsTable.statusBooking'),
headerStyle: 'text-align: center !important;',
align: 'left',
sortable: false,
},
{
name: 'statusActive',
field: 'statusActive',
required: true,
label: i18n.global.t('listBooking.titleColumnsTable.statusActive'),
headerStyle: 'text-align: center !important;',
align: 'left',
sortable: false,
},
{
name: 'action',
field: 'action',
required: true,
label: i18n.global.t('listBooking.titleColumnsTable.action'),
align: 'center',
sortable: false,
},
];
const listBooking = ref([
{
stt: 1,
artistName: 'Sơn Tùng MTP',
customerName: 'Nguyễn Văn A',
description: 'Đại nhạc hội',
place: 'Cầu Giấy - Hà Nội',
startTime: '18:00:00 - 30/4/2021',
endTime: '21:00:00 - 30/4/2021',
statusBooking: 1,
statusActive: 2,
},
]);
const pageIndex = ref(1);
const pageSize = ref(20);
const totalPage = ref(10);
const keywordSearch: Ref<string | null> = ref(null);
const changePageSize = () => {
pageIndex.value = 1;
void getListBooking();
};
const getListBooking = () => {
// console.log('API List Menu');
};
onMounted(() => {
void getListBooking();
});
return {
keywordSearch,
status,
listBooking,
tableColumns,
pageIndex,
pageSize,
totalPage,
changePageSize,
getListBooking,
BookingStatus,
ActiveStatus,
};
},
});
......@@ -7,17 +7,28 @@
<q-space></q-space>
<div class="col-2">
<q-input
v-model="keywordSearch"
v-model="sreachArtist"
dense
outlined
:label="$t('listBooking.titleColumnsTable.artistName')"
clearable
></q-input>
</div>
<div class="col-2">
<q-input
v-model="sreachUserName"
dense
outlined
:label="$t('listBooking.titleColumnsTable.userName')"
clearable
></q-input>
</div>
<div class="col-auto">
<q-btn
class="q-mr-sm"
color="primary"
no-caps
@click="getListBooking"
:label="$t('crudActions.search')"
style="width: 100px"
>
......@@ -31,30 +42,66 @@
:no-data-label="$t('emptyData')"
row-key="name"
separator="cell"
:pagination="{ rowsPerPage: pageSize }"
:rows-per-page-label="$t('recordPerPage')"
:pagination="{
rowsPerPage: 0,
}"
wrap-cells
hide-pagination
class="sticky-header-table"
>
<template v-slot:body-cell-statusBooking="rowData">
<q-td>
<div align="center">
<template v-slot:body-cell-action="rowData">
<q-td style="padding: 0; text-align: center">
<q-btn
flat
round
color="primary"
icon="mdi-information-outline"
@click="detail(rowData.row.id)"
>
<q-tooltip :offset="[10, 10]">{{
$t('listBooking.toolTipMessage')
}}</q-tooltip>
</q-btn>
</q-td>
</template>
<template v-slot:body-cell-stt="item">
<q-td :item="item" style="text-align: center">
{{ 1 + item.rowIndex + pageSize * (pageIndex - 1) }}
</q-td>
</template>
<template v-slot:body-cell-status="item">
<q-td align="center">
<template v-for="(data, idx) in BookingStatus">
<q-chip
:color="
rowData.value === BookingStatus.active ? 'positive' : 'orange'
"
text-color="white"
v-if="item.row.status === data.value"
:key="`status-${idx}-${item}`"
size="sm"
label
:color="data.color"
>{{ data.text }}</q-chip
>
{{
rowData.value === BookingStatus.active
? $t('listBooking.statusLabel.activeBooking')
: $t('listBooking.statusLabel.inactiveBooking')
}}
</q-chip>
</div>
</template>
</q-td>
</template>
<template v-slot:body-cell-activeStatus="item">
<q-td align="center">
<template v-for="(data, idx) in Status">
<q-chip
v-if="item.row.activeStatus === data.value"
:key="`activeStatus-${idx}-${item}`"
size="sm"
label
:color="data.color"
>{{ data.text }}</q-chip
>
</template>
</q-td>
</template>
<template v-slot:body-cell-statusActive="rowData">
<!-- <template v-slot:body-cell-activeStatus="rowData">
<q-td>
<div align="center">
<q-chip
......@@ -72,19 +119,258 @@
</q-chip>
</div>
</q-td>
</template>
<template v-slot:body-cell-action>
<q-td style="padding: 0" class="flex flex-center">
<q-btn flat round color="primary" icon="mdi-information-outline">
<q-tooltip :offset="[20, 10]">{{
$t('listBooking.toolTipMessage')
</template> -->
<template v-slot:body-cell-content="item">
<td>
<div class="ellipsis-3-lines">
{{ !item.row.content ? '' : item.row.content }}
<q-tooltip :offset="[10, 10]" max-width="35%">{{
!item.row.content ? '' : item.row.content
}}</q-tooltip>
</q-btn>
</q-td>
</div>
</td>
</template>
</q-table>
</div>
<div class="col-12 q-mt-sm">
<Pagination
v-model:currentPage="pageIndex"
v-model:pageSize="pageSize"
:totalPage="totalPage"
@update:pageSize="changePageSize"
@update:currentPage="getListBooking"
/>
<detailBooking
v-model:show-dialog="showDialog"
:detail-info-booking="detailInfoBooking"
@click:CloseBtn="showDialog = false"
></detailBooking>
</div>
</div>
</template>
<script lang="ts" src="./ListBooking.ts"></script>
<script lang="ts">
import { api, BaseResponseBody } from 'src/boot/axios';
import { config, API_PATHS } from 'src/assets/configurations';
import { AxiosResponse } from 'axios';
import { i18n } from 'src/boot/i18n';
import { defineComponent, onMounted, Ref, ref } from 'vue';
import Pagination from 'components/pagination/index.vue';
import { PaginationResponse, ListBooking } from 'src/assets/type';
import detailBooking from '../../components/detailBooking/index.vue';
export default defineComponent({
components: {
detailBooking,
Pagination,
},
setup() {
const tableColumns = [
{
name: 'stt',
field: 'stt',
required: true,
label: i18n.global.t('listBooking.titleColumnsTable.stt'),
headerStyle: 'text-align: center !important; width: 4%',
align: 'center',
sortable: false,
},
{
name: 'bookingCode',
field: 'bookingCode',
required: true,
label: i18n.global.t('listBooking.titleColumnsTable.bookingCode'),
headerStyle: 'text-align: center !important; width: 4%',
align: 'center',
sortable: false,
},
{
name: 'artistName',
field: 'artistName',
required: true,
label: i18n.global.t('listBooking.titleColumnsTable.artistName'),
align: 'left',
headerStyle: 'text-align: center !important; width: 9%',
sortable: false,
},
{
name: 'userName',
field: 'userName',
required: true,
label: i18n.global.t('listBooking.titleColumnsTable.userName'),
headerStyle: 'text-align: center !important; width: 9%',
align: 'left',
sortable: false,
},
{
name: 'address',
field: 'address',
required: true,
label: i18n.global.t('listBooking.titleColumnsTable.address'),
headerStyle: 'text-align: center !important; width: 13%',
align: 'left',
sortable: false,
},
// {
// name: 'content',
// field: 'content',
// required: true,
// label: i18n.global.t('listBooking.titleColumnsTable.content'),
// headerStyle: 'text-align: center !important; width: 13%',
// align: 'left',
// sortable: false,
// },
{
name: 'fromTime',
field: 'fromTime',
required: true,
label: i18n.global.t('listBooking.titleColumnsTable.fromTime'),
headerStyle: 'text-align: center !important; width: 9%',
align: 'left',
sortable: false,
},
{
name: 'toTime',
field: 'toTime',
required: true,
label: i18n.global.t('listBooking.titleColumnsTable.toTime'),
headerStyle: 'text-align: center !important; width: 9%',
align: 'left',
sortable: false,
},
{
name: 'fee',
field: 'fee',
required: true,
label: i18n.global.t('listBooking.titleColumnsTable.fee'),
headerStyle: 'text-align: center !important; width: 9%',
align: 'left',
sortable: false,
},
{
name: 'like',
field: 'like',
required: true,
label: i18n.global.t('listBooking.titleColumnsTable.like'),
headerStyle: 'text-align: center !important; width: 9%',
align: 'left',
sortable: false,
},
{
name: 'status',
field: 'status',
required: true,
label: i18n.global.t('listBooking.titleColumnsTable.status'),
headerStyle: 'text-align: center !important; width: 7%',
align: 'center',
sortable: false,
},
{
name: 'activeStatus',
field: 'activeStatus',
required: true,
label: i18n.global.t('listBooking.titleColumnsTable.activeStatus'),
headerStyle: 'text-align: center !important; width: 7%',
align: 'center',
sortable: false,
},
{
name: 'action',
field: 'action',
required: true,
label: i18n.global.t('listBooking.titleColumnsTable.action'),
headerStyle: 'text-align: center !important; width: 7%',
align: 'center',
sortable: false,
},
];
const BookingStatus = ref([
{ value: 0, text: 'Chờ nhận', color: 'secondary' },
{ value: 1, text: 'Đã nhận', color: 'info' },
{ value: 2, text: 'Từ chối', color: 'warning' },
]);
const Status = ref([
{ value: 0, text: 'Chờ nhận', color: 'secondary' },
{ value: 1, text: 'Đã thực hiện', color: 'info' },
{ value: 2, text: 'Chưa thực hiện', color: 'warning' },
{ value: 3, text: 'Hoãn lịch', color: 'secondary' },
{ value: 4, text: 'Hủy lịch', color: 'info' },
{ value: 5, text: 'Thay đổi lịch', color: 'warning' },
]);
const detailInfoBooking: Ref<ListBooking | null> = ref(null);
const showDialog = ref(false);
const listBooking: Ref<unknown[]> = ref([]);
const pageIndex = ref(1);
const pageSize = ref(20);
const totalPage = ref(1);
const sreachArtist: Ref<string | null> = ref(null);
const sreachUserName: Ref<string | null> = ref(null);
const changePageSize = () => {
pageIndex.value = 1;
void getListBooking();
};
const getListBooking = async () => {
try {
const response = (await api({
url: API_PATHS.getListBooking,
method: 'GET',
params: {
pageIndex: pageIndex.value,
pageSize: pageSize.value,
artistName: sreachArtist.value,
userName: sreachUserName.value,
},
})) as AxiosResponse<BaseResponseBody<PaginationResponse<ListBooking>>>;
if (response.data.error.code === config.API_RES_CODE.OK.code) {
listBooking.value = response.data.data.data;
totalPage.value = response.data.data.totalPages;
}
} catch (error) {}
};
const getDetail = async (id: number) => {
try {
const response = (await api({
url: API_PATHS.getBookingDetail,
method: 'GET',
params: {
id: id,
},
})) as AxiosResponse<BaseResponseBody<ListBooking>>;
if (response.data.error.code === config.API_RES_CODE.OK.code) {
detailInfoBooking.value = response.data.data;
showDialog.value = true;
}
} catch (error) {}
};
const detail = (id: number) => {
void getDetail(id);
};
onMounted(() => {
void getListBooking();
});
return {
detailInfoBooking,
showDialog,
detail,
sreachArtist,
sreachUserName,
listBooking,
tableColumns,
pageIndex,
pageSize,
totalPage,
changePageSize,
getListBooking,
BookingStatus,
Status,
};
},
});
</script>
import { i18n } from 'src/boot/i18n';
import { defineComponent, onMounted, Ref, ref } from 'vue';
import Pagination from 'components/pagination/index.vue';
import AddNewCustomerDialogComponent from '../../components/customer/add-new-customer-dialog/index.vue';
import UpdateNewCustomerDialogComponent from '../../components/customer/update-new-customer-dialog/index.vue';
import { API_PATHS, config } from 'src/assets/configurations';
import { AxiosResponse } from 'axios';
import { api, BaseResponseBody } from 'src/boot/axios';
import {
CustomerType,
PaginationResponse,
CustomerLevelType,
} from 'src/assets/type';
import { Dialog, Notify } from 'quasar';
export default defineComponent({
components: {
AddNewCustomerDialogComponent,
UpdateNewCustomerDialogComponent,
Pagination,
},
setup() {
const dataTest = ref([]);
const userTableColumnsCustomer = [
{
name: 'stt',
field: 'stt',
required: true,
label: i18n.global.t('customer.tableColumnsCustomer.stt'),
align: 'center',
sortable: false,
},
{
name: 'code',
field: 'code',
required: true,
label: i18n.global.t('customer.tableColumnsCustomer.customerCode'),
align: 'center',
headerStyle: 'text-align: center !important;',
sortable: false,
},
{
name: 'userName',
field: 'userName',
required: true,
label: i18n.global.t('customer.tableColumnsCustomer.userName'),
headerStyle: 'text-align: center !important;',
align: 'left',
sortable: false,
},
{
name: 'fullName',
field: 'fullName',
required: true,
label: i18n.global.t('customer.tableColumnsCustomer.fullName'),
headerStyle: 'text-align: center !important;',
align: 'left',
sortable: false,
},
{
name: 'companyName',
field: 'companyName',
required: true,
label: i18n.global.t('customer.tableColumnsCustomer.businessName'),
headerStyle: 'text-align: center !important;',
align: 'left',
sortable: false,
},
{
name: 'taxCode',
field: 'taxCode',
required: true,
label: i18n.global.t('customer.tableColumnsCustomer.taxCode'),
headerStyle: 'text-align: center !important;',
align: 'left',
sortable: false,
},
{
name: 'email',
field: 'email',
required: true,
label: i18n.global.t('customer.tableColumnsCustomer.email'),
headerStyle: 'text-align: center !important;',
align: 'left',
sortable: false,
},
{
name: 'level',
field: 'level',
required: true,
label: i18n.global.t('customer.tableColumnsCustomer.ratings'),
headerStyle: 'text-align: center !important;',
align: 'left',
sortable: false,
},
{
name: 'status',
field: 'status',
required: true,
label: i18n.global.t('customer.tableColumnsCustomer.status'),
align: 'center',
sortable: false,
},
{
name: 'action',
field: 'action',
required: true,
label: i18n.global.t('customer.tableColumnsCustomer.action'),
align: 'center',
sortable: false,
},
];
const userTableRowsCustomer: Ref<CustomerType[]> = ref([]);
const customerInfo: Ref<CustomerType | null> = ref(null);
const showDialog = ref(false);
const showDialogUpdate = ref(false);
const pageIndex = ref(1);
const pageSize = ref(20);
const totalPage = ref(0);
const companyNameSelected: Ref<string | null> = ref(null);
const taxCodeSelected: Ref<string | null> = ref(null);
const levelSelected: Ref<CustomerLevelType | null> = ref(null);
const id: Ref<number | undefined> = ref(undefined);
const code: Ref<string | null> = ref(null);
const userName: Ref<string | null> = ref(null);
const fullName: Ref<string | null> = ref(null);
const companyName: Ref<string | null> = ref(null);
const taxCode: Ref<string | null> = ref(null);
const email: Ref<string | null> = ref(null);
const status: Ref<number | null> = ref(2);
const phone: Ref<string | null> = ref(null);
const password: Ref<string | null> = ref(null);
const address: Ref<string | null> = ref(null);
const type: Ref<string | null> = ref(null);
const representative: Ref<string | null> = ref(null);
const position: Ref<string | null> = ref(null);
const level: Ref<CustomerLevelType | null> = ref(null);
const levelOptions: Ref<CustomerLevelType[] | null> = ref([]);
const getListCustomers = async () => {
try {
const response = (await api({
url: API_PATHS.listCustomers,
method: 'GET',
params: {
pageIndex: pageIndex.value,
pageSize: pageSize.value,
customerLevel: levelSelected.value?.id,
},
})) as AxiosResponse<
BaseResponseBody<PaginationResponse<CustomerType>>
>;
if (response.data.error.code === config.API_RES_CODE.OK.code) {
userTableRowsCustomer.value = response.data.data.data;
totalPage.value = response.data.data.totalPages;
}
} catch (error) {}
};
const getCustomerLevelOptions = async () => {
const response = (await api({
url: API_PATHS.listCustomerLevel,
method: 'GET',
params: {},
})) as AxiosResponse<BaseResponseBody<CustomerLevelType[]>>;
if (response.data.error.code === config.API_RES_CODE.OK.code) {
levelOptions.value = response.data.data;
}
};
const confirmDeleteCustomer = (id: number) => {
Dialog.create({
title: i18n.global.t(
'customer.confirmActionsTitle.confirmDeleteUserTitle'
),
message: i18n.global.t(
'customer.confirmActionsTitle.confirmDeleteUserContent'
),
cancel: i18n.global.t(
'customer.confirmActionsTitle.confirmDeleteUserCancelBtnLabel'
),
color: 'negative',
}).onOk(() => {
void deleteCustomer(id);
});
};
const deleteCustomer = async (id: number) => {
try {
const deleteResult = (await api({
url: API_PATHS.deleteCustomer,
method: 'GET',
params: {
id: id,
},
})) as AxiosResponse<BaseResponseBody<unknown>>;
if (deleteResult.data.error.code === config.API_RES_CODE.OK.code) {
Notify.create({
type: 'positive',
message: i18n.global.t('customer.actionMessages.deleteUserAccess'),
});
void getListCustomers();
}
} catch (error) {}
};
const addCustomer = async (item: CustomerType) => {
try {
const response = (await api({
url: API_PATHS.addCustomer,
method: 'POST',
data: {
code: item.code,
userName: item.userName,
fullName: item.fullName,
companyName: item.companyName,
taxCode: item.taxCode,
email: item.email,
status: item.status,
phone: item.phone,
password: item.password,
address: item.address,
type: item.type,
representative: item.representative,
position: item.position,
level: item.level,
},
})) as AxiosResponse<BaseResponseBody<unknown>>;
if (response.data.error.code === config.API_RES_CODE.OK.code) {
Notify.create({
type: 'positive',
message: i18n.global.t('customer.actionMessages.addNewUserAccess'),
});
void getListCustomers();
showDialog.value = false;
}
} catch (error) {}
};
const changePageSize = () => {
pageIndex.value = 1;
void getListCustomers();
};
const openAddCustomerDialog = () => {
showDialog.value = true;
userName.value = null;
fullName.value = null;
companyName.value = null;
taxCode.value = null;
email.value = null;
level.value = null;
address.value = null;
type.value = null;
representative.value = null;
position.value = null;
phone.value = null;
status.value = 2;
};
const getDetailCustomer = async (id: number) => {
try {
const response = (await api({
url: API_PATHS.detailCustomer,
method: 'GET',
params: {
id: id,
},
})) as AxiosResponse<BaseResponseBody<CustomerType>>;
if (response.data.error.code === config.API_RES_CODE.OK.code) {
customerInfo.value = response.data.data;
showDialogUpdate.value = true;
}
} catch (error) {}
};
const openUpdateCustomerDialog = (id: number) => {
void getDetailCustomer(id);
};
//Bấm nút lưu ở dialog update thì gọi api cập nhật trong hàm updateCustomer
const updateCustomer = async (item: CustomerType) => {
try {
const response = (await api({
url: API_PATHS.updateCustomer,
method: 'POST',
data: {
id: item.id,
code: item.code,
userName: item.userName,
fullName: item.fullName,
companyName: item.companyName,
taxCode: item.taxCode,
email: item.email,
status: item.status,
phone: item.phone,
password: item.password,
address: item.address,
type: item.type,
representative: item.representative,
position: item.position,
level: item.level,
},
})) as AxiosResponse<BaseResponseBody<unknown>>;
if (response.data.error.code === config.API_RES_CODE.OK.code) {
Notify.create({
type: 'positive',
message: i18n.global.t('customer.actionMessages.updateUserAccess'),
});
void getListCustomers();
showDialogUpdate.value = false;
}
} catch (error) {}
};
onMounted(() => {
void getListCustomers();
void getCustomerLevelOptions();
});
return {
openUpdateCustomerDialog,
updateCustomer,
openAddCustomerDialog,
addCustomer,
showDialogUpdate,
showDialog,
id,
userName,
fullName,
companyName,
taxCode,
code,
password,
type,
email,
level,
levelOptions,
address,
representative,
position,
levelSelected,
phone,
companyNameSelected,
taxCodeSelected,
status,
userTableColumnsCustomer,
userTableRowsCustomer,
getListCustomers,
pageIndex,
pageSize,
dataTest,
totalPage,
changePageSize,
getCustomerLevelOptions,
confirmDeleteCustomer,
customerInfo,
};
},
});
......@@ -149,4 +149,359 @@
</div>
</template>
<script lang="ts" src="./customer.ts"></script>
<script lang="ts">
import { i18n } from 'src/boot/i18n';
import { defineComponent, onMounted, Ref, ref } from 'vue';
import Pagination from 'components/pagination/index.vue';
import AddNewCustomerDialogComponent from '../../components/customer/add-new-customer-dialog/index.vue';
import UpdateNewCustomerDialogComponent from '../../components/customer/update-new-customer-dialog/index.vue';
import { API_PATHS, config } from 'src/assets/configurations';
import { AxiosResponse } from 'axios';
import { api, BaseResponseBody } from 'src/boot/axios';
import {
CustomerType,
PaginationResponse,
CustomerLevelType,
} from 'src/assets/type';
import { Dialog, Notify } from 'quasar';
export default defineComponent({
components: {
AddNewCustomerDialogComponent,
UpdateNewCustomerDialogComponent,
Pagination,
},
setup() {
const dataTest = ref([]);
const userTableColumnsCustomer = [
{
name: 'stt',
field: 'stt',
required: true,
label: i18n.global.t('customer.tableColumnsCustomer.stt'),
align: 'center',
sortable: false,
},
{
name: 'code',
field: 'code',
required: true,
label: i18n.global.t('customer.tableColumnsCustomer.customerCode'),
align: 'center',
headerStyle: 'text-align: center !important;',
sortable: false,
},
{
name: 'userName',
field: 'userName',
required: true,
label: i18n.global.t('customer.tableColumnsCustomer.userName'),
headerStyle: 'text-align: center !important;',
align: 'left',
sortable: false,
},
{
name: 'fullName',
field: 'fullName',
required: true,
label: i18n.global.t('customer.tableColumnsCustomer.fullName'),
headerStyle: 'text-align: center !important;',
align: 'left',
sortable: false,
},
{
name: 'companyName',
field: 'companyName',
required: true,
label: i18n.global.t('customer.tableColumnsCustomer.businessName'),
headerStyle: 'text-align: center !important;',
align: 'left',
sortable: false,
},
{
name: 'taxCode',
field: 'taxCode',
required: true,
label: i18n.global.t('customer.tableColumnsCustomer.taxCode'),
headerStyle: 'text-align: center !important;',
align: 'left',
sortable: false,
},
{
name: 'email',
field: 'email',
required: true,
label: i18n.global.t('customer.tableColumnsCustomer.email'),
headerStyle: 'text-align: center !important;',
align: 'left',
sortable: false,
},
{
name: 'level',
field: 'level',
required: true,
label: i18n.global.t('customer.tableColumnsCustomer.ratings'),
headerStyle: 'text-align: center !important;',
align: 'left',
sortable: false,
},
{
name: 'status',
field: 'status',
required: true,
label: i18n.global.t('customer.tableColumnsCustomer.status'),
align: 'center',
sortable: false,
},
{
name: 'action',
field: 'action',
required: true,
label: i18n.global.t('customer.tableColumnsCustomer.action'),
align: 'center',
sortable: false,
},
];
const userTableRowsCustomer: Ref<CustomerType[]> = ref([]);
const customerInfo: Ref<CustomerType | null> = ref(null);
const showDialog = ref(false);
const showDialogUpdate = ref(false);
const pageIndex = ref(1);
const pageSize = ref(20);
const totalPage = ref(0);
const companyNameSelected: Ref<string | null> = ref(null);
const taxCodeSelected: Ref<string | null> = ref(null);
const levelSelected: Ref<CustomerLevelType | null> = ref(null);
const id: Ref<number | undefined> = ref(undefined);
const code: Ref<string | null> = ref(null);
const userName: Ref<string | null> = ref(null);
const fullName: Ref<string | null> = ref(null);
const companyName: Ref<string | null> = ref(null);
const taxCode: Ref<string | null> = ref(null);
const email: Ref<string | null> = ref(null);
const status: Ref<number | null> = ref(2);
const phone: Ref<string | null> = ref(null);
const password: Ref<string | null> = ref(null);
const address: Ref<string | null> = ref(null);
const type: Ref<string | null> = ref(null);
const representative: Ref<string | null> = ref(null);
const position: Ref<string | null> = ref(null);
const level: Ref<CustomerLevelType | null> = ref(null);
const levelOptions: Ref<CustomerLevelType[] | null> = ref([]);
const getListCustomers = async () => {
try {
const response = (await api({
url: API_PATHS.listCustomers,
method: 'GET',
params: {
pageIndex: pageIndex.value,
pageSize: pageSize.value,
customerLevel: levelSelected.value?.id,
},
})) as AxiosResponse<
BaseResponseBody<PaginationResponse<CustomerType>>
>;
if (response.data.error.code === config.API_RES_CODE.OK.code) {
userTableRowsCustomer.value = response.data.data.data;
totalPage.value = response.data.data.totalPages;
}
} catch (error) {}
};
const getCustomerLevelOptions = async () => {
const response = (await api({
url: API_PATHS.listCustomerLevel,
method: 'GET',
params: {},
})) as AxiosResponse<BaseResponseBody<CustomerLevelType[]>>;
if (response.data.error.code === config.API_RES_CODE.OK.code) {
levelOptions.value = response.data.data;
}
};
const confirmDeleteCustomer = (id: number) => {
Dialog.create({
title: i18n.global.t(
'customer.confirmActionsTitle.confirmDeleteUserTitle'
),
message: i18n.global.t(
'customer.confirmActionsTitle.confirmDeleteUserContent'
),
cancel: i18n.global.t(
'customer.confirmActionsTitle.confirmDeleteUserCancelBtnLabel'
),
color: 'negative',
}).onOk(() => {
void deleteCustomer(id);
});
};
const deleteCustomer = async (id: number) => {
try {
const deleteResult = (await api({
url: API_PATHS.deleteCustomer,
method: 'GET',
params: {
id: id,
},
})) as AxiosResponse<BaseResponseBody<unknown>>;
if (deleteResult.data.error.code === config.API_RES_CODE.OK.code) {
Notify.create({
type: 'positive',
message: i18n.global.t('customer.actionMessages.deleteUserAccess'),
});
void getListCustomers();
}
} catch (error) {}
};
const addCustomer = async (item: CustomerType) => {
try {
const response = (await api({
url: API_PATHS.addCustomer,
method: 'POST',
data: {
code: item.code,
userName: item.userName,
fullName: item.fullName,
companyName: item.companyName,
taxCode: item.taxCode,
email: item.email,
status: item.status,
phone: item.phone,
password: item.password,
address: item.address,
type: item.type,
representative: item.representative,
position: item.position,
level: item.level,
},
})) as AxiosResponse<BaseResponseBody<unknown>>;
if (response.data.error.code === config.API_RES_CODE.OK.code) {
Notify.create({
type: 'positive',
message: i18n.global.t('customer.actionMessages.addNewUserAccess'),
});
void getListCustomers();
showDialog.value = false;
}
} catch (error) {}
};
const changePageSize = () => {
pageIndex.value = 1;
void getListCustomers();
};
const openAddCustomerDialog = () => {
showDialog.value = true;
userName.value = null;
fullName.value = null;
companyName.value = null;
taxCode.value = null;
email.value = null;
level.value = null;
address.value = null;
type.value = null;
representative.value = null;
position.value = null;
phone.value = null;
status.value = 2;
};
const getDetailCustomer = async (id: number) => {
try {
const response = (await api({
url: API_PATHS.detailCustomer,
method: 'GET',
params: {
id: id,
},
})) as AxiosResponse<BaseResponseBody<CustomerType>>;
if (response.data.error.code === config.API_RES_CODE.OK.code) {
customerInfo.value = response.data.data;
showDialogUpdate.value = true;
}
} catch (error) {}
};
const openUpdateCustomerDialog = (id: number) => {
void getDetailCustomer(id);
};
//Bấm nút lưu ở dialog update thì gọi api cập nhật trong hàm updateCustomer
const updateCustomer = async (item: CustomerType) => {
try {
const response = (await api({
url: API_PATHS.updateCustomer,
method: 'POST',
data: {
id: item.id,
code: item.code,
userName: item.userName,
fullName: item.fullName,
companyName: item.companyName,
taxCode: item.taxCode,
email: item.email,
status: item.status,
phone: item.phone,
password: item.password,
address: item.address,
type: item.type,
representative: item.representative,
position: item.position,
level: item.level,
},
})) as AxiosResponse<BaseResponseBody<unknown>>;
if (response.data.error.code === config.API_RES_CODE.OK.code) {
Notify.create({
type: 'positive',
message: i18n.global.t('customer.actionMessages.updateUserAccess'),
});
void getListCustomers();
showDialogUpdate.value = false;
}
} catch (error) {}
};
onMounted(() => {
void getListCustomers();
void getCustomerLevelOptions();
});
return {
openUpdateCustomerDialog,
updateCustomer,
openAddCustomerDialog,
addCustomer,
showDialogUpdate,
showDialog,
id,
userName,
fullName,
companyName,
taxCode,
code,
password,
type,
email,
level,
levelOptions,
address,
representative,
position,
levelSelected,
phone,
companyNameSelected,
taxCodeSelected,
status,
userTableColumnsCustomer,
userTableRowsCustomer,
getListCustomers,
pageIndex,
pageSize,
dataTest,
totalPage,
changePageSize,
getCustomerLevelOptions,
confirmDeleteCustomer,
customerInfo,
};
},
});
</script>
......@@ -55,7 +55,7 @@
icon="mdi-account-edit-outline"
@click="openUpdateFieldDialog(item.row.id)"
>
<q-tooltip :offset="[20, 10]">{{
<q-tooltip :offset="[10, 10]">{{
$t('field.toolTipMessage.updateField')
}}</q-tooltip>
</q-btn>
......@@ -66,7 +66,7 @@
icon="mdi-delete-outline"
@click="confirmDeleteField(item.row.id)"
>
<q-tooltip :offset="[20, 10]">{{
<q-tooltip :offset="[10, 10]">{{
$t('field.toolTipMessage.deleteField')
}}</q-tooltip>
</q-btn>
......@@ -76,7 +76,7 @@
<td>
<div class="ellipsis-3-lines">
{{ !item.row.description ? '' : item.row.description }}
<q-tooltip :offset="[20, 10]" max-width="35%">{{
<q-tooltip :offset="[10, 10]" max-width="35%">{{
!item.row.description ? '' : item.row.description
}}</q-tooltip>
</div>
......@@ -141,14 +141,6 @@ export default defineComponent({
},
setup() {
const fieldTableColumns = [
// {
// name: 'index',
// field: 'index',
// required: true,
// label: 'STT',
// align: 'center',
// sortable: false,
// },
{
name: 'name',
field: 'name',
......
......@@ -648,23 +648,24 @@ export default defineComponent({
// 'artist.artistInformation.validateMessages.isEmail'
// );
// }
if (
!phoneNumberAdminister.value ||
!phoneNumberAdminister.value?.trim().length
) {
hasError = true;
phoneNumberAdministerRules.value = true;
errorMessPhoneNumberAdminister.value = i18n.global.t(
'artist.artistInformation.validateMessages.requirePhoneNumberAdminister'
);
}
if (!emailAdminister.value || !emailAdminister.value?.trim().length) {
hasError = true;
emailAdministerRules.value = true;
errorMessEmailAdminister.value = i18n.global.t(
'artist.artistInformation.validateMessages.requireEmailAdminister'
);
}
// if (
// !phoneNumberAdminister.value ||
// !phoneNumberAdminister.value?.trim().length
// ) {
// hasError = true;
// phoneNumberAdministerRules.value = true;
// errorMessPhoneNumberAdminister.value = i18n.global.t(
// 'artist.artistInformation.validateMessages.requirePhoneNumberAdminister'
// );
// }
// if (!emailAdminister.value || !emailAdminister.value?.trim().length) {
// hasError = true;
// emailAdministerRules.value = true;
// errorMessEmailAdminister.value = i18n.global.t(
// 'artist.artistInformation.validateMessages.requireEmailAdminister'
// );
// }
if (artistLevel.value === null) {
hasError = true;
......
......@@ -14,13 +14,6 @@
name="information"
:label="$t('artist.artistInformation.tabLabel.personalInformation')"
>
<!-- <template v-slot:default>
<q-icon
style="position: absolute; top: 5px; right: -16px"
name="mdi-alert"
color="red"
></q-icon>
</template> -->
</q-tab>
<q-tab
name="vabAccount"
......
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