update

parent 6924f609
...@@ -79,10 +79,10 @@ module.exports = configure(function (ctx) { ...@@ -79,10 +79,10 @@ module.exports = configure(function (ctx) {
// Full list of options: https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-devServer // Full list of options: https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-devServer
devServer: { devServer: {
host: '0.0.0.0',
https: false, https: false,
port: 10706, port: 10706,
public: 'http://0.0.0.0:10706',
open: true, // opens browser window automatically open: true, // opens browser window automatically
}, },
......
export const config = { export const config = {
// API_ENDPOINT: 'https://cms.vab.xteldev.com/api/', API_ENDPOINT: 'https://cms.vab.xteldev.com/api/', //test
API_ENDPOINT:'http://103.147.34.34:10700/api/', // API_ENDPOINT:'http://103.147.34.34:10700/api/' ,
API_IMAGE_ENDPOINT: 'http://103.147.34.34:10700/api/upload/', // API_IMAGE_ENDPOINT: 'http://103.147.34.34:10700/api/upload/' , // test
// API_IMAGE_ENDPOINT: 'https://cms.vab.xteldev.com/file/upload/', API_IMAGE_ENDPOINT: 'https://cms.vab.xteldev.com/file/upload/',
API_RES_CODE: { API_RES_CODE: {
OK: { OK: {
...@@ -62,6 +62,7 @@ export enum API_PATHS { ...@@ -62,6 +62,7 @@ export enum API_PATHS {
listCustomerLevel = 'customerLevel', listCustomerLevel = 'customerLevel',
addCustomer = 'customer/add', addCustomer = 'customer/add',
deleteCustomer = 'customer/delete', deleteCustomer = 'customer/delete',
browserCustomer = 'customer/accountBrowsing',
getListCustomersRank = 'customerLevel', getListCustomersRank = 'customerLevel',
deleteCustomerRank = 'customerLevel/delete', deleteCustomerRank = 'customerLevel/delete',
addCustomerRank = 'customerLevel/add', addCustomerRank = 'customerLevel/add',
......
...@@ -461,8 +461,8 @@ export default defineComponent({ ...@@ -461,8 +461,8 @@ export default defineComponent({
bodyFormData.append('file', file); bodyFormData.append('file', file);
const response = (await api({ const response = (await api({
headers: { 'Content-Type': 'multipart/form-data' }, headers: { 'Content-Type': 'multipart/form-data' },
// url: 'https://cms.vab.xteldev.com/file/upload/', url: 'https://cms.vab.xteldev.com/file/upload/', // test
url:'http://103.147.34.34:10700/api/upload/', // url:'http://103.147.34.34:10700/api/upload/', // pro
method: 'POST', method: 'POST',
data: bodyFormData, data: bodyFormData,
})) as AxiosResponse<BaseResponseBody<FileUploadType>>; })) as AxiosResponse<BaseResponseBody<FileUploadType>>;
......
...@@ -400,8 +400,8 @@ export default defineComponent({ ...@@ -400,8 +400,8 @@ export default defineComponent({
bodyFormData.append('file', file); bodyFormData.append('file', file);
const response = (await api({ const response = (await api({
headers: { 'Content-Type': 'multipart/form-data' }, headers: { 'Content-Type': 'multipart/form-data' },
// url: 'https://cms.vab.xteldev.com/file/upload/', url: 'https://cms.vab.xteldev.com/file/upload/', //test
url:'http://103.147.34.34:10700/api/upload/', // url:'http://103.147.34.34:10700/api/upload/', // pro
method: 'POST', method: 'POST',
data: bodyFormData, data: bodyFormData,
})) as AxiosResponse<BaseResponseBody<FileUploadType>>; })) as AxiosResponse<BaseResponseBody<FileUploadType>>;
......
...@@ -408,8 +408,8 @@ export default defineComponent({ ...@@ -408,8 +408,8 @@ export default defineComponent({
bodyFormData.append('file', file); bodyFormData.append('file', file);
const response = (await api({ const response = (await api({
headers: { 'Content-Type': 'multipart/form-data' }, headers: { 'Content-Type': 'multipart/form-data' },
// url: 'https://cms.vab.xteldev.com/file/upload/', url: 'https://cms.vab.xteldev.com/file/upload/', // test
url:'http://103.147.34.34:10700/api/upload/', // url:'http://103.147.34.34:10700/api/upload/', // pro
method: 'POST', method: 'POST',
data: bodyFormData, data: bodyFormData,
})) as AxiosResponse<BaseResponseBody<FileUploadType>>; })) as AxiosResponse<BaseResponseBody<FileUploadType>>;
......
...@@ -468,8 +468,8 @@ export default defineComponent({ ...@@ -468,8 +468,8 @@ export default defineComponent({
bodyFormData.append('file', file); bodyFormData.append('file', file);
const response = (await api({ const response = (await api({
headers: { 'Content-Type': 'multipart/form-data' }, headers: { 'Content-Type': 'multipart/form-data' },
// url: 'https://cms.vab.xteldev.com/file/upload/', url: 'https://cms.vab.xteldev.com/file/upload/', // test
url:'http://103.147.34.34:10700/api/upload/', // url:'http://103.147.34.34:10700/api/upload/', //pro
method: 'POST', method: 'POST',
data: bodyFormData, data: bodyFormData,
})) as AxiosResponse<BaseResponseBody<FileUploadType>>; })) as AxiosResponse<BaseResponseBody<FileUploadType>>;
......
...@@ -413,8 +413,8 @@ export default defineComponent({ ...@@ -413,8 +413,8 @@ export default defineComponent({
bodyFormData.append('file', file); bodyFormData.append('file', file);
const response = (await api({ const response = (await api({
headers: { 'Content-Type': 'multipart/form-data' }, headers: { 'Content-Type': 'multipart/form-data' },
// url: 'https://cms.vab.xteldev.com/file/upload/', url: 'https://cms.vab.xteldev.com/file/upload/', // test
url:'http://103.147.34.34:10700/api/upload/', // url:'http://103.147.34.34:10700/api/upload/', // pro
method: 'POST', method: 'POST',
data: bodyFormData, data: bodyFormData,
})) as AxiosResponse<BaseResponseBody<FileUploadType>>; })) as AxiosResponse<BaseResponseBody<FileUploadType>>;
......
...@@ -88,6 +88,15 @@ ...@@ -88,6 +88,15 @@
<q-tooltip :offset="[20, 10]">{{ <q-tooltip :offset="[20, 10]">{{
$t('customer.toolTipMessage.updateCustomerInfo') $t('customer.toolTipMessage.updateCustomerInfo')
}}</q-tooltip> }}</q-tooltip>
</q-btn>
<q-btn
flat
round
color="primary"
icon="mdi-check-circle-outline"
@click="confirmBrowserCustomer(rowData.row.id)"
>
<q-tooltip :offset="[20, 10]">Duyệt tài khoản</q-tooltip>
</q-btn> </q-btn>
<q-btn <q-btn
flat flat
...@@ -119,6 +128,24 @@ ...@@ -119,6 +128,24 @@
</div> </div>
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-approvalStatus="rowData">
<q-td>
<div align="center">
<q-chip
:color="rowData.value === 1 ? 'positive' : 'orange'"
text-color="white"
size="sm"
>
{{
rowData.value === 1
? 'Đã duyệt'
: 'Chờ duyệt'
}}
</q-chip>
</div>
</q-td>
</template>
</q-table> </q-table>
<div class="col-12 q-mt-sm"> <div class="col-12 q-mt-sm">
<Pagination <Pagination
...@@ -251,6 +278,14 @@ export default defineComponent({ ...@@ -251,6 +278,14 @@ export default defineComponent({
label: i18n.global.t('customer.tableColumnsCustomer.status'), label: i18n.global.t('customer.tableColumnsCustomer.status'),
align: 'center', align: 'center',
sortable: false, sortable: false,
},
{
name: 'approvalStatus',
field: 'approvalStatus',
required: true,
label: 'T.thái duyệt',
align: 'center',
sortable: false,
}, },
{ {
name: 'action', name: 'action',
...@@ -334,6 +369,50 @@ export default defineComponent({ ...@@ -334,6 +369,50 @@ export default defineComponent({
void deleteCustomer(id); void deleteCustomer(id);
}); });
}; };
const confirmBrowserCustomer = (id: number) => {
Dialog.create({
title: i18n.global.t(
'customer.confirmActionsTitle.confirmDeleteUserTitle'
),
message: 'Bạn có chắc muốn duyệt khách hàng này không?',
// i18n.global.t(
// 'customer.confirmActionsTitle.confirmDeleteUserContent'
// ),
cancel: i18n.global.t(
'customer.confirmActionsTitle.confirmDeleteUserCancelBtnLabel'
),
color: 'negative',
}).onOk(() => {
// void deleteCustomer(id);
void browserCustomer(id);
});
};
const browserCustomer =async (id:number) => {
try {
const browserResult = (await api({
url: API_PATHS.browserCustomer,
method: 'POST',
data: {
id: id,
isCustomer: 1,
approvalStatus:1
},
})) as AxiosResponse<BaseResponseBody<unknown>>;
if (browserResult.data.error.code === config.API_RES_CODE.OK.code) {
Notify.create({
type: 'positive',
message: 'Duyệt thành công',
actions: [{ icon: 'close', color: 'white' }],
});
void getListCustomers();
}
} catch (error) {
}
}
const deleteCustomer = async (id: number) => { const deleteCustomer = async (id: number) => {
try { try {
const deleteResult = (await api({ const deleteResult = (await api({
...@@ -503,6 +582,7 @@ export default defineComponent({ ...@@ -503,6 +582,7 @@ export default defineComponent({
changePageSize, changePageSize,
getCustomerLevelOptions, getCustomerLevelOptions,
confirmDeleteCustomer, confirmDeleteCustomer,
confirmBrowserCustomer,
customerInfo, customerInfo,
}; };
}, },
......
...@@ -284,8 +284,8 @@ export default defineComponent({ ...@@ -284,8 +284,8 @@ export default defineComponent({
bodyFormData.append('file', file); bodyFormData.append('file', file);
const response = (await api({ const response = (await api({
headers: { 'Content-Type': 'multipart/form-data' }, headers: { 'Content-Type': 'multipart/form-data' },
// url: 'https://cms.vab.xteldev.com/file/upload/', url: 'https://cms.vab.xteldev.com/file/upload/', // test
url:'http://103.147.34.34:10700/api/upload/', // url:'http://103.147.34.34:10700/api/upload/', // pro
method: 'POST', method: 'POST',
data: bodyFormData, data: bodyFormData,
})) as AxiosResponse<BaseResponseBody<FileUploadType>>; })) as AxiosResponse<BaseResponseBody<FileUploadType>>;
......
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