update

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