update

parent 2697d630
...@@ -256,8 +256,8 @@ ...@@ -256,8 +256,8 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<q-btn <q-btn
:loading="loading"
color="primary" color="primary"
no-caps
style="width: 7.14rem" style="width: 7.14rem"
label="Xuất File" label="Xuất File"
@click="exportFile" @click="exportFile"
...@@ -508,8 +508,33 @@ export default defineComponent({ ...@@ -508,8 +508,33 @@ export default defineComponent({
const costTo = ref(100000000); const costTo = ref(100000000);
// const level: Ref<string | null> = ref(null); // const level: Ref<string | null> = ref(null);
const upload = ref(null); const upload = ref(null);
const exportFile = () => { const loading = ref(false);
window.location.href = `${config.API_ENDPOINT}artist/exportExcel?pageIndex=${pageIndex.value}&pageSize=${totalRecords.value}&name=${fullNameKeyword.value}&fromMoney=${costFrom.value}&toMoney=${costTo.value}&channel=CMS`; const exportFile = async () => {
loading.value = true;
try {
const dataItem = (await api({
url: API_PATHS.exportExcel,
method: 'GET',
params: {
pageIndex: pageIndex.value,
pageSize: totalRecords.value,
name: fullNameKeyword.value,
field: fieldSelected.value?.id,
qualification: professionSelected.value?.id,
address: provinceSelected.value?.name,
musicTypeDto: musics.value?.id,
fromMoney: costFrom.value,
toMoney: costTo.value,
},
})) as AxiosResponse<BaseResponseBody<unknown>>;
if (dataItem.data.error.code === config.API_RES_CODE.OK.code) {
loading.value = false;
window.location.href = dataItem.data.data as string;
}
} catch (error) {}
}; };
const callApiUploadAvatar = async (file: File) => { const callApiUploadAvatar = async (file: File) => {
try { try {
...@@ -790,6 +815,7 @@ export default defineComponent({ ...@@ -790,6 +815,7 @@ export default defineComponent({
provinceOptions, provinceOptions,
costFrom, costFrom,
costTo, costTo,
loading,
// level, // level,
getProvinceOptions, getProvinceOptions,
getMusicTypeOptions, getMusicTypeOptions,
......
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