update

parent 6924f609
......@@ -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
devServer: {
host: '0.0.0.0',
https: false,
port: 10706,
public: 'http://0.0.0.0:10706',
open: true, // opens browser window automatically
},
......
export const config = {
// API_ENDPOINT: 'https://cms.vab.xteldev.com/api/',
API_ENDPOINT:'http://103.147.34.34:10700/api/',
API_IMAGE_ENDPOINT: 'http://103.147.34.34:10700/api/upload/',
// API_IMAGE_ENDPOINT: 'https://cms.vab.xteldev.com/file/upload/',
API_ENDPOINT: 'https://cms.vab.xteldev.com/api/', //test
// API_ENDPOINT:'http://103.147.34.34:10700/api/' ,
// API_IMAGE_ENDPOINT: 'http://103.147.34.34:10700/api/upload/' , // test
API_IMAGE_ENDPOINT: 'https://cms.vab.xteldev.com/file/upload/',
API_RES_CODE: {
OK: {
......@@ -62,6 +62,7 @@ export enum API_PATHS {
listCustomerLevel = 'customerLevel',
addCustomer = 'customer/add',
deleteCustomer = 'customer/delete',
browserCustomer = 'customer/accountBrowsing',
getListCustomersRank = 'customerLevel',
deleteCustomerRank = 'customerLevel/delete',
addCustomerRank = 'customerLevel/add',
......
......@@ -461,8 +461,8 @@ export default defineComponent({
bodyFormData.append('file', file);
const response = (await api({
headers: { 'Content-Type': 'multipart/form-data' },
// url: 'https://cms.vab.xteldev.com/file/upload/',
url:'http://103.147.34.34:10700/api/upload/',
url: 'https://cms.vab.xteldev.com/file/upload/', // test
// url:'http://103.147.34.34:10700/api/upload/', // pro
method: 'POST',
data: bodyFormData,
})) as AxiosResponse<BaseResponseBody<FileUploadType>>;
......
......@@ -400,8 +400,8 @@ export default defineComponent({
bodyFormData.append('file', file);
const response = (await api({
headers: { 'Content-Type': 'multipart/form-data' },
// url: 'https://cms.vab.xteldev.com/file/upload/',
url:'http://103.147.34.34:10700/api/upload/',
url: 'https://cms.vab.xteldev.com/file/upload/', //test
// url:'http://103.147.34.34:10700/api/upload/', // pro
method: 'POST',
data: bodyFormData,
})) as AxiosResponse<BaseResponseBody<FileUploadType>>;
......
......@@ -408,8 +408,8 @@ export default defineComponent({
bodyFormData.append('file', file);
const response = (await api({
headers: { 'Content-Type': 'multipart/form-data' },
// url: 'https://cms.vab.xteldev.com/file/upload/',
url:'http://103.147.34.34:10700/api/upload/',
url: 'https://cms.vab.xteldev.com/file/upload/', // test
// url:'http://103.147.34.34:10700/api/upload/', // pro
method: 'POST',
data: bodyFormData,
})) as AxiosResponse<BaseResponseBody<FileUploadType>>;
......
......@@ -468,8 +468,8 @@ export default defineComponent({
bodyFormData.append('file', file);
const response = (await api({
headers: { 'Content-Type': 'multipart/form-data' },
// url: 'https://cms.vab.xteldev.com/file/upload/',
url:'http://103.147.34.34:10700/api/upload/',
url: 'https://cms.vab.xteldev.com/file/upload/', // test
// url:'http://103.147.34.34:10700/api/upload/', //pro
method: 'POST',
data: bodyFormData,
})) as AxiosResponse<BaseResponseBody<FileUploadType>>;
......
......@@ -413,8 +413,8 @@ export default defineComponent({
bodyFormData.append('file', file);
const response = (await api({
headers: { 'Content-Type': 'multipart/form-data' },
// url: 'https://cms.vab.xteldev.com/file/upload/',
url:'http://103.147.34.34:10700/api/upload/',
url: 'https://cms.vab.xteldev.com/file/upload/', // test
// url:'http://103.147.34.34:10700/api/upload/', // pro
method: 'POST',
data: bodyFormData,
})) as AxiosResponse<BaseResponseBody<FileUploadType>>;
......
......@@ -88,6 +88,15 @@
<q-tooltip :offset="[20, 10]">{{
$t('customer.toolTipMessage.updateCustomerInfo')
}}</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
flat
......@@ -119,6 +128,24 @@
</div>
</q-td>
</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>
<div class="col-12 q-mt-sm">
<Pagination
......@@ -251,6 +278,14 @@ export default defineComponent({
label: i18n.global.t('customer.tableColumnsCustomer.status'),
align: 'center',
sortable: false,
},
{
name: 'approvalStatus',
field: 'approvalStatus',
required: true,
label: 'T.thái duyệt',
align: 'center',
sortable: false,
},
{
name: 'action',
......@@ -334,6 +369,50 @@ export default defineComponent({
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) => {
try {
const deleteResult = (await api({
......@@ -503,6 +582,7 @@ export default defineComponent({
changePageSize,
getCustomerLevelOptions,
confirmDeleteCustomer,
confirmBrowserCustomer,
customerInfo,
};
},
......
......@@ -284,8 +284,8 @@ export default defineComponent({
bodyFormData.append('file', file);
const response = (await api({
headers: { 'Content-Type': 'multipart/form-data' },
// url: 'https://cms.vab.xteldev.com/file/upload/',
url:'http://103.147.34.34:10700/api/upload/',
url: 'https://cms.vab.xteldev.com/file/upload/', // test
// url:'http://103.147.34.34:10700/api/upload/', // pro
method: 'POST',
data: bodyFormData,
})) 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