update

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