update

parent 04ae26a1
export const config = {
// lấy động theo url web
API_ENDPOINT: '/api/',
API_IMAGE_ENDPOINT: '/file/upload/',
// pro
API_ENDPOINT: 'https://cms.vab.vn/api/',
API_IMAGE_ENDPOINT: 'https://cms.vab.vn/file/upload/',
// API_ENDPOINT: 'https://cms.vab.vn/api/',
// API_IMAGE_ENDPOINT: 'https://cms.vab.vn/file/upload/',
// dev
// API_ENDPOINT: 'http://103.147.34.20:10700/api/',
// API_IMAGE_ENDPOINT: 'http://103.147.34.20:10705/file/upload/',
......
......@@ -4,11 +4,27 @@
<q-form greedy @submit.prevent="handleConfirmAdd">
<q-card-section style="padding-bottom: 10px">
<q-item style="padding-left: 10px">
<q-item-section>
<q-item-label class="text-h6 text-weight-regular"
>Danh sách sản phẩm</q-item-label
>
<q-item-section
><q-item-label class="text-h6 text-weight-regular">
Danh sách sản phẩm
</q-item-label></q-item-section
>
<q-item-section style="padding-right: 10px">
<q-input
dense
clearable
outlined
v-model="keyWord"
label="Tìm kiếm"
/>
</q-item-section>
<q-btn
flat
rounded
@click="search"
color="primary"
icon="mdi-magnify"
/>
</q-item>
</q-card-section>
<div class="col-12 q-mt-sm">
......@@ -103,6 +119,7 @@ export default defineComponent({
(value) => {
if (value) {
selected.value = [];
keyWord.value = '';
void listProductNotActive();
}
}
......@@ -158,7 +175,9 @@ export default defineComponent({
];
const configImg = config;
const selected: Ref<listProductNotActives[]> = ref([]);
const keyWord = ref('');
const selected: Ref<listProductNotActives[]> = ref([]);
const getSelectedString = () => {
return selected.value.length === 0
? ''
......@@ -169,13 +188,15 @@ export default defineComponent({
pageIndex.value = 1;
void listProductNotActive();
};
const search = () => {
pageIndex.value = 1;
void listProductNotActive();
};
const handleConfirmAdd = async () => {
const data = [] as any[]
for (let i = 0; i < selected.value.length; i++) {
data.push(selected.value[i]?.id)
}
const data = [] as any[];
for (let i = 0; i < selected.value.length; i++) {
data.push(selected.value[i]?.id);
}
try {
const response = (await api({
url: API_PATHS.artistFeaturedProducts,
......@@ -194,7 +215,7 @@ export default defineComponent({
message: 'Thêm sản phẩm nổi bật thành công',
actions: [{ icon: 'close', color: 'white' }],
});
context.emit('saveBannerInfo')
context.emit('saveBannerInfo');
context.emit('update:isOpened', false);
}
} catch (error) {}
......@@ -218,6 +239,7 @@ export default defineComponent({
pageSize: pageSize.value,
name: '',
artistName: '',
keyWord: keyWord.value === '' ? '' : keyWord.value.trim(),
},
})) as AxiosResponse<
BaseResponseBody<
......@@ -239,6 +261,7 @@ export default defineComponent({
totalPage,
configImg,
selected,
keyWord,
changePageSize,
// hàm
// handleConfim,
......@@ -246,6 +269,7 @@ export default defineComponent({
getSelectedString,
handleConfirmAdd,
handleTogle,
search,
};
},
emits: ['update:isOpened', 'saveBannerInfo'],
......
......@@ -38,7 +38,7 @@
:label="$t('listBooking.titleColumnsTable.userName')"
clearable
@filter="filterFnCust"
use-input
use-input
behavior="menu"
></q-select>
</div>
......@@ -412,10 +412,7 @@ export default defineComponent({
void getListBooking();
};
const date = ref([
moment(new Date()).format('DD/MM/YYYY'),
moment(new Date()).add(7, 'days').format('DD/MM/YYYY'),
]);
const date = ref(['', '']);
const changeTime = () => {
const startTime = Number(
moment(date.value[0], 'DD/MM/YYYY').format('YYYYMMDD')
......@@ -429,9 +426,9 @@ export default defineComponent({
};
const artistOptions: Ref<ListArrayArtist[]> = ref([]);
const customerOptions: Ref<ListArrayCust[] > = ref([]);
const filteredOptions: Ref<ListArrayArtist[] > = ref([]);
const customerFiltereOption: Ref<ListArrayCust[] > = ref([]);
const customerOptions: Ref<ListArrayCust[]> = ref([]);
const filteredOptions: Ref<ListArrayArtist[]> = ref([]);
const customerFiltereOption: Ref<ListArrayCust[]> = ref([]);
const getArrayArtist = async () => {
const response = (await api({
......@@ -449,12 +446,12 @@ export default defineComponent({
filteredOptions.value = artistOptions.value;
});
}
update(() => {
const needle = val.toLowerCase()
filteredOptions.value = artistOptions?.value.filter(option => {
return option.artistName.toLowerCase().includes(needle)
})
})
update(() => {
const needle = val.toLowerCase();
filteredOptions.value = artistOptions?.value.filter((option) => {
return option.artistName.toLowerCase().includes(needle);
});
});
};
const getArrayCust = async () => {
const response = (await api({
......@@ -467,20 +464,21 @@ export default defineComponent({
}
};
const filterFnCust = (val: string, update: (fn: () => void) => void) => {
if (val === '') {
const filterFnCust = (val: string, update: (fn: () => void) => void) => {
if (val === '') {
update(() => {
customerFiltereOption.value = customerOptions.value;
});
}
update(() => {
const needle = val.toLowerCase()
customerFiltereOption.value = customerOptions?.value.filter(option => {
return option.fullName.toLowerCase().includes(needle)
})
})
}
update(() => {
const needle = val.toLowerCase();
customerFiltereOption.value = customerOptions?.value.filter(
(option) => {
return option.fullName.toLowerCase().includes(needle);
}
);
});
};
const getListBooking = async () => {
try {
......@@ -494,8 +492,15 @@ export default defineComponent({
custId: sreachUserName.value?.id,
status: sreachStatus.value?.id,
performStatus: sreachPerformStatus.value?.id,
fromTime: moment(date.value[0], 'DD/MM/YYYY').format('DD/MM/YYYY'),
toTime: moment(date.value[1], 'DD/MM/YYYY').format('DD/MM/YYYY'),
fromTime:
date.value[0] === ''
? ''
: moment(date.value[0], 'DD/MM/YYYY').format('DD/MM/YYYY'),
toTime:
date.value[1] === ''
? ''
: moment(date.value[1], 'DD/MM/YYYY').format('DD/MM/YYYY'),
},
})) as AxiosResponse<BaseResponseBody<PaginationResponse<ListBooking>>>;
if (response.data.error.code === config.API_RES_CODE.OK.code) {
......
......@@ -5,7 +5,7 @@
<q-separator vertical spaced />
</div>
<q-space></q-space>
<div class="col-2">
<!-- <div class="col-2">
<q-input
v-model="codeCustomerRank"
type="text"
......@@ -14,8 +14,8 @@
label="Mã xếp hạng"
clearable
></q-input>
</div>
<div class="col-2">
</div> -->
<!-- <div class="col-2">
<q-input
v-model="nameCustomerRank"
type="text"
......@@ -24,8 +24,8 @@
label="Tên xếp hạng"
clearable
></q-input>
</div>
<div class="col-2">
</div> -->
<!-- <div class="col-2">
<q-input
v-model="levelCustomerRank"
type="number"
......@@ -34,7 +34,7 @@
label="Loại xếp hạng"
clearable
></q-input>
</div>
</div> -->
<div class="col-auto">
<q-btn
color="primary"
......@@ -122,6 +122,10 @@
</div>
</q-td>
</template>
<!-- <template v-slot:body-cell-code="rowData">
<q-td> </q-td>
</template> -->
</q-table>
</div>
......@@ -178,32 +182,15 @@ export default defineComponent({
sortable: false,
},
{
name: 'code',
field: 'code',
name: '',
field: '',
required: true,
label: i18n.global.t('customerRank.tableColumnsCustomerRank.code'),
headerStyle: 'text-align: center !important;',
align: 'left',
sortable: false,
},
{
name: 'name',
field: 'name',
required: true,
label: i18n.global.t('customerRank.tableColumnsCustomerRank.name'),
headerStyle: 'text-align: center !important;',
align: 'left',
sortable: false,
},
{
name: 'level',
field: 'level',
required: true,
label: i18n.global.t('customerRank.tableColumnsCustomerRank.level'),
label: 'Đánh giá sao',
headerStyle: 'text-align: center !important;',
align: 'left',
sortable: false,
},
{
name: 'status',
field: 'status',
......
<template>
<div class="row q-col-gutter-sm flex-center q-mt-sm">
<div class="col-auto text-h6 text-weight-regular flex flex-center q-mr-md">
{{ $t('customerRank.title') }}
Xếp hạng nghệ sĩ
<q-separator vertical spaced />
</div>
<q-space></q-space>
<div class="col-2">
<!-- <div class="col-2">
<q-input
v-model="codeCustomerRank"
type="text"
......@@ -14,8 +14,8 @@
label="Mã xếp hạng"
clearable
></q-input>
</div>
<div class="col-2">
</div> -->
<!-- <div class="col-2">
<q-input
v-model="nameCustomerRank"
type="text"
......@@ -24,8 +24,8 @@
label="Tên xếp hạng"
clearable
></q-input>
</div>
<div class="col-2">
</div> -->
<!-- <div class="col-2">
<q-input
v-model="levelCustomerRank"
type="number"
......@@ -34,7 +34,7 @@
label="Loại xếp hạng"
clearable
></q-input>
</div>
</div> -->
<div class="col-auto">
<q-btn
color="primary"
......@@ -177,33 +177,17 @@ export default defineComponent({
align: 'center',
sortable: false,
},
{
name: 'code',
field: 'code',
required: true,
label: i18n.global.t('customerRank.tableColumnsCustomerRank.code'),
headerStyle: 'text-align: center !important;',
align: 'left',
sortable: false,
},
{
name: 'name',
field: 'name',
required: true,
label: i18n.global.t('customerRank.tableColumnsCustomerRank.name'),
headerStyle: 'text-align: center !important;',
align: 'left',
sortable: false,
},
{
name: 'level',
field: 'level',
name: '',
field: '',
required: true,
label: i18n.global.t('customerRank.tableColumnsCustomerRank.level'),
label: 'Đánh giá sao',
headerStyle: 'text-align: center !important;',
align: 'left',
sortable: false,
},
{
name: 'status',
field: 'status',
......
......@@ -95,7 +95,7 @@ const routes: RouteRecordRaw[] = [
},
{
path: '/xep-hang-nghe-sy',
component: () => import('pages/xep-hang-nghe-sy/index.vue'),
component: () => import('pages/nghe-sy/xep-hang-nghe-sy/index.vue'),
name: Pages.artistRank,
},
{
......@@ -110,7 +110,8 @@ const routes: RouteRecordRaw[] = [
},
{
path: 'xep-hang-khach-hang',
component: () => import('pages/xep-hang-khach-hang/index.vue'),
component: () =>
import('pages/khach-hang/xep-hang-khach-hang/index.vue'),
name: Pages.customerRank,
},
{
......
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