update

parent 1c90e72f
...@@ -128,4 +128,6 @@ export enum API_PATHS { ...@@ -128,4 +128,6 @@ export enum API_PATHS {
getListRegister = 'artist/getListRegister', getListRegister = 'artist/getListRegister',
accountArtistBrowsing = 'customer/accountArtistBrowsing', accountArtistBrowsing = 'customer/accountArtistBrowsing',
detailRegisterArtist = 'artist/detailRegister', detailRegisterArtist = 'artist/detailRegister',
listBookingNotApproval = 'booking/notApproval',
bookingBrowsing = 'booking/bookingBrowsing'
} }
<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,
},
id: {
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.bookingBrowsing,
method: 'POST',
data: {
id: props.id,
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>
<template> <template>
<div>
<div>
<q-dialog <q-dialog
persistent persistent
:model-value="showDialogUpdate" :model-value="showDialogUpdate"
...@@ -11,7 +10,9 @@ ...@@ -11,7 +10,9 @@
<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">Duyệt thông tin khách hàng</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-section>
</q-item> </q-item>
</q-card-section> </q-card-section>
...@@ -47,7 +48,7 @@ ...@@ -47,7 +48,7 @@
@click="isPwd = !isPwd" @click="isPwd = !isPwd"
/> </template /> </template
></q-input> ></q-input>
<q-input <!-- <q-input
v-model="code" v-model="code"
label="Mã khách hàng" label="Mã khách hàng"
...@@ -56,8 +57,8 @@ ...@@ -56,8 +57,8 @@
class="q-my-sm" class="q-my-sm"
outlined outlined
readonly readonly
></q-input> ></q-input> -->
<q-input <!-- <q-input
v-model="fullName" v-model="fullName"
:label="$t('customer.dialogLabel.fieldLabels.customerName')" :label="$t('customer.dialogLabel.fieldLabels.customerName')"
type="text" type="text"
...@@ -65,7 +66,7 @@ ...@@ -65,7 +66,7 @@
outlined outlined
:rules="customerNameRules" :rules="customerNameRules"
hide-bottom-space hide-bottom-space
></q-input> ></q-input> -->
<q-input <q-input
v-model="companyName" v-model="companyName"
:label="$t('customer.dialogLabel.fieldLabels.businessName')" :label="$t('customer.dialogLabel.fieldLabels.businessName')"
...@@ -81,7 +82,6 @@ ...@@ -81,7 +82,6 @@
type="text" type="text"
class="q-my-sm" class="q-my-sm"
outlined outlined
hide-bottom-space hide-bottom-space
></q-input> ></q-input>
<q-input <q-input
...@@ -107,7 +107,6 @@ ...@@ -107,7 +107,6 @@
<q-input <q-input
v-model="type" v-model="type"
label="Loại doanh nghiệp" label="Loại doanh nghiệp"
emit-value emit-value
map-options map-options
option-value="id" option-value="id"
...@@ -162,7 +161,11 @@ ...@@ -162,7 +161,11 @@
<span class="text-body1">{{ <span class="text-body1">{{
$t('customer.dialogLabel.fieldLabels.status') $t('customer.dialogLabel.fieldLabels.status')
}}</span }}</span
><q-toggle :true-value="1" :false-value="2" v-model="status" /> ><q-toggle
:true-value="1"
:false-value="2"
v-model="status"
/>
</div> </div>
</div> </div>
</div> </div>
...@@ -186,11 +189,9 @@ ...@@ -186,11 +189,9 @@
</q-form> </q-form>
</q-card> </q-card>
</q-dialog> </q-dialog>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, PropType, Ref, ref, watch } from 'vue'; import { defineComponent, PropType, Ref, ref, watch } from 'vue';
import { i18n } from 'src/boot/i18n'; import { i18n } from 'src/boot/i18n';
...@@ -253,7 +254,6 @@ export default defineComponent({ ...@@ -253,7 +254,6 @@ export default defineComponent({
representative: representative.value, representative: representative.value,
position: position.value, position: position.value,
level: level.value, level: level.value,
}); });
}; };
const getData = () => { const getData = () => {
...@@ -376,5 +376,5 @@ export default defineComponent({ ...@@ -376,5 +376,5 @@ export default defineComponent({
id, id,
}; };
}, },
}) });
</script> </script>
...@@ -56,7 +56,7 @@ export default defineComponent({ ...@@ -56,7 +56,7 @@ export default defineComponent({
type: Boolean, type: Boolean,
required: true, required: true,
}, },
customerId: { id: {
type: Number, type: Number,
required: true, required: true,
}, },
...@@ -78,11 +78,11 @@ export default defineComponent({ ...@@ -78,11 +78,11 @@ export default defineComponent({
const confirmRefusedCustomer = async () => { const confirmRefusedCustomer = async () => {
try { try {
const browserResult = (await api({ const browserResult = (await api({
url: API_PATHS.customerNotBrowsing, url: API_PATHS.bookingBrowsing,
method: 'POST', method: 'POST',
data: { data: {
id: props.customerId, id: props.id,
isCustomer: 1,
approvalStatus: 2, approvalStatus: 2,
reason: content.value, reason: content.value,
}, },
......
This diff is collapsed.
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
icon="mdi-block-helper" icon="mdi-block-helper"
@click="confirmRefusedBrowserCustomer(rowData.row.id)" @click="confirmRefusedBrowserCustomer(rowData.row.id)"
> >
<q-tooltip >Từ chối</q-tooltip> <q-tooltip>Từ chối</q-tooltip>
</q-btn> </q-btn>
<!-- <q-btn <!-- <q-btn
flat flat
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
<div align="center"> <div align="center">
<q-chip <q-chip
v-if="rowData.value === 0" v-if="rowData.value === 0"
color='orange' color="orange"
text-color="white" text-color="white"
size="sm" size="sm"
> >
...@@ -196,7 +196,6 @@ ...@@ -196,7 +196,6 @@
@editReCustomer="getListCustomers" @editReCustomer="getListCustomers"
> >
</RefusedBrowserCustomer> </RefusedBrowserCustomer>
</div> </div>
</div> </div>
</div> </div>
...@@ -208,7 +207,7 @@ import { defineComponent, onMounted, Ref, ref } from 'vue'; ...@@ -208,7 +207,7 @@ import { defineComponent, onMounted, Ref, ref } from 'vue';
import Pagination from 'components/pagination/index.vue'; import Pagination from 'components/pagination/index.vue';
// import AddNewCustomerDialogComponent from '../../components/customer/add-new-customer-dialog/index.vue'; // import AddNewCustomerDialogComponent from '../../components/customer/add-new-customer-dialog/index.vue';
import UpdateNewCustomerDialogComponent from '../../components/customer/browser-new-customer-dialog.vue'; import UpdateNewCustomerDialogComponent from '../../components/customer/browser-new-customer-dialog.vue';
import RefusedBrowserCustomer from '../../components/customer/openDialogRefusedBrowser.vue' import RefusedBrowserCustomer from '../../components/customer/openDialogRefusedBrowser.vue';
import { API_PATHS, config } from 'src/assets/configurations.example'; 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';
...@@ -311,7 +310,7 @@ export default defineComponent({ ...@@ -311,7 +310,7 @@ export default defineComponent({
name: 'approvalStatus', name: 'approvalStatus',
field: 'approvalStatus', field: 'approvalStatus',
required: true, required: true,
label: 'T.thái duyệt', label: 'T.T Duyệt',
align: 'center', align: 'center',
sortable: false, sortable: false,
}, },
...@@ -399,11 +398,10 @@ export default defineComponent({ ...@@ -399,11 +398,10 @@ export default defineComponent({
// }); // });
// }; // };
const confirmRefusedBrowserCustomer = (id:number) => { const confirmRefusedBrowserCustomer = (id: number) => {
customerId.value = id customerId.value = id;
openDialogRefusedBrowser.value = true openDialogRefusedBrowser.value = true;
} };
// const deleteCustomer = async (id: number) => { // const deleteCustomer = async (id: number) => {
// try { // try {
...@@ -578,7 +576,7 @@ export default defineComponent({ ...@@ -578,7 +576,7 @@ export default defineComponent({
confirmBrowserCustomer, confirmBrowserCustomer,
customerInfo, customerInfo,
customerId, customerId,
confirmRefusedBrowserCustomer confirmRefusedBrowserCustomer,
}; };
}, },
}); });
......
...@@ -137,7 +137,20 @@ ...@@ -137,7 +137,20 @@
</div> </div>
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-approvalStatus="rowData">
<q-td>
<div align="center">
<q-chip
v-if="rowData.value === 1"
color="positive"
text-color="white"
size="sm"
>
Duyệt
</q-chip>
</div>
</q-td>
</template>
<!-- <template v-slot:body-cell-approvalStatus="rowData"> <!-- <template v-slot:body-cell-approvalStatus="rowData">
<q-td> <q-td>
<div align="center"> <div align="center">
...@@ -188,7 +201,6 @@ ...@@ -188,7 +201,6 @@
@editReCustomer="getListCustomers" @editReCustomer="getListCustomers"
> >
</RefusedBrowserCustomer> --> </RefusedBrowserCustomer> -->
</div> </div>
</div> </div>
</div> </div>
...@@ -410,11 +422,11 @@ export default defineComponent({ ...@@ -410,11 +422,11 @@ export default defineComponent({
void browserCustomer(id); void browserCustomer(id);
}); });
}; };
const confirmRefusedBrowserCustomer = (id:number) => { const confirmRefusedBrowserCustomer = (id: number) => {
customerId.value = id customerId.value = id;
openDialogRefusedBrowser.value = true openDialogRefusedBrowser.value = true;
} };
const browserCustomer = async (id:number) => { const browserCustomer = async (id: number) => {
try { try {
const browserResult = (await api({ const browserResult = (await api({
url: API_PATHS.browserCustomer, url: API_PATHS.browserCustomer,
...@@ -422,7 +434,7 @@ export default defineComponent({ ...@@ -422,7 +434,7 @@ export default defineComponent({
data: { data: {
id: id, id: id,
isCustomer: 1, isCustomer: 1,
approvalStatus:1 approvalStatus: 1,
}, },
})) as AxiosResponse<BaseResponseBody<unknown>>; })) as AxiosResponse<BaseResponseBody<unknown>>;
...@@ -434,10 +446,8 @@ export default defineComponent({ ...@@ -434,10 +446,8 @@ export default defineComponent({
}); });
void getListCustomers(); void getListCustomers();
} }
} catch (error) { } catch (error) {}
};
}
}
const deleteCustomer = async (id: number) => { const deleteCustomer = async (id: number) => {
try { try {
...@@ -612,7 +622,7 @@ export default defineComponent({ ...@@ -612,7 +622,7 @@ export default defineComponent({
confirmBrowserCustomer, confirmBrowserCustomer,
customerInfo, customerInfo,
customerId, customerId,
confirmRefusedBrowserCustomer confirmRefusedBrowserCustomer,
}; };
}, },
}); });
......
...@@ -374,7 +374,7 @@ export default defineComponent({ ...@@ -374,7 +374,7 @@ export default defineComponent({
name: 'approvalStatus', name: 'approvalStatus',
field: 'approvalStatus', field: 'approvalStatus',
required: true, required: true,
label: 'T.Thái chờ duyệt', label: 'T.T Duyệt',
headerStyle: 'text-align: center !important;', headerStyle: 'text-align: center !important;',
align: 'center', align: 'center',
sortable: false, sortable: false,
......
...@@ -22,6 +22,7 @@ export enum Pages { ...@@ -22,6 +22,7 @@ export enum Pages {
infoVAB = 'thong-tin-chung', infoVAB = 'thong-tin-chung',
menu = 'menu', menu = 'menu',
listBooking = 'danh-sach-booking', listBooking = 'danh-sach-booking',
listBookingBrowsing = 'danh-sach-booking-cho-duyet',
work = 'cong-viec', work = 'cong-viec',
configSystem = 'cau-hinh-trang-tinh', configSystem = 'cau-hinh-trang-tinh',
news = 'cau-hinh-tin-tuc', news = 'cau-hinh-tin-tuc',
...@@ -134,6 +135,11 @@ const routes: RouteRecordRaw[] = [ ...@@ -134,6 +135,11 @@ const routes: RouteRecordRaw[] = [
component: () => import('pages/danh-sach-booking/index.vue'), component: () => import('pages/danh-sach-booking/index.vue'),
name: Pages.listBooking, name: Pages.listBooking,
}, },
{
path: 'danh-sach-booking-cho-duyet',
component: () => import('pages/danh-sach-booking-cho-duyet/index.vue'),
name: Pages.listBookingBrowsing,
},
{ {
path: 'cong-viec', path: 'cong-viec',
component: () => import('pages/cong-viec/index.vue'), component: () => import('pages/cong-viec/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