update

parent 8bf9d4eb
......@@ -124,6 +124,8 @@ export enum API_PATHS {
getLitCustomerWaiting = 'customer/listRegister',
detailCustomerWaiting = 'customer/detailRegister',
accountCustomerBrowsing = 'customer/accountCustomerBrowsing',
customerNotBrowsing = 'customer/customerNotBrowsing'
customerNotBrowsing = 'customer/customerNotBrowsing',
getListRegister = 'artist/getListRegister',
accountArtistBrowsing = 'customer/accountArtistBrowsing',
detailRegisterArtist = 'artist/detailRegister',
}
......@@ -257,6 +257,8 @@ export type DetailUnit = {
contracts: Array<Contract>;
};
export type CustomerType = {
id: number;
code: string | null;
......
<template>
<q-dialog persistent
:model-value="openDialogRefusedBrowser"
>
<q-card style="min-width: 900px" bordered>
<q-form greedy @submit.prevent="confirmRefusedCustomer">
<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">Lý do</q-item-label>
</q-item-section>
</q-item>
</q-card-section>
<q-card-section style="padding-top:0px">
<q-input outlined
hide-bottom-space
:rules="contentRules"
v-model="content"
label="Nội dung"
type="textarea" />
</q-card-section>
<q-card-actions align="right">
<q-btn
color="grey"
no-caps
style="width: 90px"
label="Hủy"
@click="$emit('click:CloseBtn')"
/>
<q-btn
type="submit"
color="primary"
no-caps
style="width: 90px"
label="Ok"
/>
</q-card-actions>
</q-form>
</q-card>
</q-dialog>
</template>
<script lang="ts">
import { defineComponent, PropType, Ref, ref, watch } from 'vue';
import { Dialog, Notify } from 'quasar';
import { API_PATHS, config } from 'src/assets/configurations.example';
import { AxiosResponse } from 'axios';
import { api, BaseResponseBody } from 'src/boot/axios';
import { emit } from 'cluster';
export default defineComponent ({
props: {
openDialogRefusedBrowser: {
type: Boolean,
required: true,
},
artistId: {
type: Number,
required: true
}
},
setup(props, context){
watch(
() => props.openDialogRefusedBrowser,
(value) => {
if (value) {
content.value = null
}
}
);
const content: Ref<string | null> = ref(null);
const contentRules = [
(val?: string) =>
(val && val.trim().length) ||
'Vui lòng nhập nội dung'
];
const confirmRefusedCustomer = async () => {
try {
const browserResult = (await api({
url: API_PATHS.customerNotBrowsing,
method: 'POST',
data: {
id: props.artistId,
isCustomer: 2,
approvalStatus: 2,
reason: content.value
},
})) as AxiosResponse<BaseResponseBody<unknown>>;
if (browserResult.data.error.code === config.API_RES_CODE.OK.code) {
Notify.create({
type: 'positive',
message: 'Từ chối duyệt thành công',
actions: [{ icon: 'close', color: 'white' }],
});
context.emit('editReCustomer' )
context.emit('click:CloseBtn')
}
} catch (error) {}
}
return {
contentRules,
content,
confirmRefusedCustomer
}
},
emits:['click:CloseBtn','editReCustomer']
})
</script>
\ No newline at end of file
......@@ -11,9 +11,7 @@
<q-card-section>
<q-item>
<q-item-section>
<q-item-label class="text-h6 text-weight-regular">{{
$t('customer.dialogLabel.title.editCustomer')
}}</q-item-label>
<q-item-label class="text-h6 text-weight-regular">Duyệt thông tin khách hàng</q-item-label>
</q-item-section>
</q-item>
</q-card-section>
......
<template>
<q-dialog persistent
:model-value="openDialogRefusedBrowser"
>
<q-card style="min-width: 900px" bordered>
<q-form greedy @submit.prevent="confirmRefusedCustomer">
<q-card-section style="padding-bottom:10px">
<q-dialog persistent :model-value="openDialogRefusedBrowser">
<q-card style="min-width: 900px" bordered>
<q-form greedy @submit.prevent="confirmRefusedCustomer">
<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">Lý do</q-item-label>
<q-item-label class="text-h6 text-weight-regular"
>Lý do</q-item-label
>
</q-item-section>
</q-item>
</q-card-section>
<q-card-section style="padding-top:0px">
<q-input outlined
hide-bottom-space
:rules="contentRules"
v-model="content"
label="Nội dung"
type="textarea" />
<q-card-section style="padding-top: 0px">
<q-input
outlined
hide-bottom-space
:rules="contentRules"
v-model="content"
label="Nội dung"
type="textarea"
/>
</q-card-section>
<q-card-actions align="right">
<q-btn
......@@ -28,8 +28,7 @@
no-caps
style="width: 90px"
label="Hủy"
@click="$emit('click:CloseBtn')"
@click="$emit('click:CloseBtn')"
/>
<q-btn
type="submit"
......@@ -37,12 +36,11 @@
no-caps
style="width: 90px"
label="Ok"
/>
</q-card-actions>
</q-form>
</q-card>
</q-dialog>
</q-form>
</q-card>
</q-dialog>
</template>
<script lang="ts">
......@@ -52,44 +50,41 @@ import { API_PATHS, config } from 'src/assets/configurations.example';
import { AxiosResponse } from 'axios';
import { api, BaseResponseBody } from 'src/boot/axios';
import { emit } from 'cluster';
export default defineComponent ({
props: {
export default defineComponent({
props: {
openDialogRefusedBrowser: {
type: Boolean,
required: true,
},
customerId: {
type: Number,
required: true
}
type: Number,
required: true,
},
},
setup(props, context){
setup(props, context) {
watch(
() => props.openDialogRefusedBrowser,
(value) => {
if (value) {
content.value = null
content.value = null;
}
}
);
const content: Ref<string | null> = ref(null);
const content: Ref<string | null> = ref(null);
const contentRules = [
(val?: string) =>
(val && val.trim().length) ||
'Vui lòng nhập nội dung'
(val?: string) => (val && val.trim().length) || 'Vui lòng nhập nội dung',
];
const confirmRefusedCustomer = async () => {
try {
const browserResult = (await api({
try {
const browserResult = (await api({
url: API_PATHS.customerNotBrowsing,
method: 'POST',
data: {
id: props.customerId,
isCustomer: 1,
approvalStatus: 0,
reason: content.value
approvalStatus: 2,
reason: content.value,
},
})) as AxiosResponse<BaseResponseBody<unknown>>;
if (browserResult.data.error.code === config.API_RES_CODE.OK.code) {
......@@ -99,23 +94,17 @@ const content: Ref<string | null> = ref(null);
actions: [{ icon: 'close', color: 'white' }],
});
context.emit('editReCustomer' )
context.emit('click:CloseBtn')
}
} catch (error) {}
}
context.emit('editReCustomer');
context.emit('click:CloseBtn');
}
} catch (error) {}
};
return {
contentRules,
content,
confirmRefusedCustomer
}
contentRules,
content,
confirmRefusedCustomer,
};
},
emits:['click:CloseBtn','editReCustomer']
})
</script>
\ No newline at end of file
emits: ['click:CloseBtn', 'editReCustomer'],
});
</script>
<template>
<q-list>
<MenuItemComponent
v-for="(menuItem, menuItemIdx) in $store.state.authentication.menuList"
:key="`menu-item-${menuItemIdx}-${menuItem.id}`"
......
......@@ -80,6 +80,9 @@ export default defineComponent({
const artistLevelOptions: Ref<ArtistLevelType[]> = ref([]);
const cardBankOptions: Ref<CardBankType[]> = ref([]);
const typeBankOptions: Ref<TypeCardType[]> = ref([]);
const workOptions: Ref<WorkType[]> = ref([]);
const musicOptions: Ref<MusicType[]> = ref([]);
const sexOptions = ref([
......
......@@ -525,7 +525,7 @@ export default defineComponent({
if (response.data.error.code === config.API_RES_CODE.OK.code) {
Notify.create({
type: 'positive',
message: 'Duyệt tài khaorn thành công',
message: 'Duyệt tài khoản thành công',
actions: [{ icon: 'close', color: 'white' }],
});
void getListCustomers();
......
This diff is collapsed.
......@@ -95,6 +95,7 @@ const updateGroupInfo = async ($store: Store<StateInterface>) => {
id: parsedPage.id || -1,
roles: parsedPage.roles,
});
console.log(acc,'12312')
return acc;
},
[]
......
......@@ -7,6 +7,7 @@ export enum Pages {
cmsUser = 'nguoi-dung',
managingUnit = 'don-vi-chu-quan',
artist = 'nghe-sy',
artistBrowsing = 'nghe-sy-cho-duyet',
informationArtist = 'cap-nhat-thong-tin-nghe-sy',
customer = 'khach-hang',
......@@ -63,6 +64,11 @@ const routes: RouteRecordRaw[] = [
component: () => import('pages/nghe-sy/index.vue'),
name: Pages.artist,
},
{
path: '/nghe-si-cho-duyet',
component: () => import('pages/nghe-si-cho-duyet/index.vue'),
name: Pages.artistBrowsing,
},
{
path: '/nghe-sy/cap-nhat-thong-tin-nghe-sy/:id',
component: () => import('pages/cap-nhat-thong-tin-nghe-sy/index.vue'),
......
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