Commit 46512ec8 authored by Tình Trương's avatar Tình Trương

update

parent 89dbfc3b
......@@ -10,8 +10,8 @@ export enum UnitStatus {
}
export enum HotProductStatus {
active = 1,
inactive = 2,
active = 2,
inactive = 1,
}
export enum CustomerRankStatus {
......
......@@ -72,6 +72,7 @@ export type ArtistInfoType = {
mnFbmess: string | null;
mnIns: string | null;
mnWhatsapp: string | null;
favoriteScore: number;
};
export type FieldType = {
......
......@@ -21,6 +21,10 @@ export default defineComponent({
const embeddedUrl: Ref<string> = ref('');
const urlFileLocal: Ref<string> = ref('');
const status: Ref<number> = ref(2);
const statusOptions = ref([
{ id: 1, name: 'Sản phẩm khác' },
{ id: 2, name: 'Sản phẩm nổi bật' },
]);
const uploadAvatar = (value: FileList) => {
urlFileLocal.value = URL.createObjectURL(value[0]);
file.value = value[0];
......@@ -75,6 +79,13 @@ export default defineComponent({
'artist.artistInformation.validateMessages.requireUrlembed'
),
];
const statusRules = [
(val?: number) =>
val !== undefined ||
i18n.global.t(
'artist.artistInformation.validateMessages.requireStatus'
),
];
return {
uploadAvatar,
......@@ -89,6 +100,8 @@ export default defineComponent({
product_name,
product_code,
url_embed,
statusRules,
statusOptions,
};
},
......
......@@ -65,13 +65,26 @@
outlined
clearable
></q-input>
<q-select
v-model="status"
emit-value
label="Loại sản phẩm"
class="q-my-sm"
:options="statusOptions"
option-value="id"
option-label="name"
outlined
map-options
:rules="statusRules"
hide-bottom-space
></q-select>
</div>
<div style="padding-top: 13px; padding-left: 12px">
<!-- <div style="padding-top: 13px; padding-left: 12px">
<span class="text-body1">{{
$t('userPage.dialogLabel.fieldLabels.status')
}}</span>
<q-toggle v-model="status" :false-value="2" :true-value="1" />
</div>
</div> -->
</div>
</q-card-section>
<q-card-actions align="right">
......
......@@ -10,7 +10,7 @@
<q-item>
<q-item-section>
<q-item-label class="text-h6 text-weight-regular">{{
$t('artist.dialogLabel.title.addHotProduct')
$t('artist.dialogLabel.title.updateHotProduct')
}}</q-item-label>
</q-item-section>
</q-item>
......@@ -68,13 +68,26 @@
outlined
clearable
></q-input>
<q-select
v-model="status"
emit-value
label="Loại sản phẩm"
class="q-my-sm"
:options="statusOptions"
option-value="id"
option-label="name"
outlined
map-options
:rules="statusRules"
hide-bottom-space
></q-select>
</div>
<div style="padding-top: 13px; padding-left: 12px">
<!-- <div style="padding-top: 13px; padding-left: 12px">
<span class="text-body1">{{
$t('userPage.dialogLabel.fieldLabels.status')
}}</span>
<q-toggle v-model="status" :false-value="2" :true-value="1" />
</div>
</div> -->
</div>
</q-card-section>
<q-card-actions align="right">
......
......@@ -30,6 +30,10 @@ export default defineComponent({
const urlFileLocal: Ref<string> = ref('');
const imageAPI: Ref<string | null> = ref(null);
const status: Ref<number> = ref(2);
const statusOptions = ref([
{ id: 1, name: 'Sản phẩm khác' },
{ id: 2, name: 'Sản phẩm nổi bật' },
]);
const id: Ref<number | null> = ref(null);
const uploadAvatar = (value: FileList) => {
urlFileLocal.value = URL.createObjectURL(value[0]);
......@@ -95,6 +99,13 @@ export default defineComponent({
'artist.artistInformation.validateMessages.requireUrlembed'
),
];
const statusRules = [
(val?: number) =>
val !== undefined ||
i18n.global.t(
'artist.artistInformation.validateMessages.requireStatus'
),
];
return {
uploadAvatar,
......@@ -109,6 +120,8 @@ export default defineComponent({
product_name,
product_code,
url_embed,
statusRules,
statusOptions,
id,
configImg,
imageAPI,
......
......@@ -221,7 +221,7 @@
color="primary"
icon="mdi-pencil-circle-outline"
>
<q-tooltip>Chỉnh sửa Embed</q-tooltip></q-btn
<q-tooltip>Cập nhập Embed</q-tooltip></q-btn
>
<q-btn
class="q-py-md"
......
......@@ -185,6 +185,7 @@ export default defineComponent({
'update:fields',
'update:works',
'update:favoriteScore',
'update:check_infoBooking',
'update:qualification',
'update:artistLevel',
'update:hidden_img',
......
......@@ -496,7 +496,11 @@
{{ $t('artist.artistInformation.titleDataField.infoBooking') }}
</div>
<div class="col-8">
<q-checkbox v-model="check_infoBooking" class="q-my-sm"></q-checkbox>
<q-checkbox
v-model="check_infoBooking"
@update:model-value="$emit('update:check_infoBooking', $event)"
class="q-my-sm"
></q-checkbox>
</div>
</div>
<div class="row flex-center" v-if="check_infoBooking">
......
This diff is collapsed.
......@@ -61,6 +61,8 @@
v-model:mn-fbmess="mnFbmess"
v-model:mn-ins="mnIns"
v-model:mn-whatsapp="mnWhatsapp"
v-model:favorite-score="favoriteScore"
v-model:check_infoBooking="check_infoBooking"
:errorMessmnBookingPhone="errorMessmnBookingPhone"
:errorMessmnBookingEmail="errorMessmnBookingEmail"
:mnBookingEmailRules="mnBookingEmailRules"
......
......@@ -103,6 +103,7 @@ export default defineComponent({
numIndex: 1,
status: 1,
});
const favoriteScore: Ref<number | undefined> = ref(undefined);
const mnName: Ref<string | null> = ref(null);
const mnPhone: Ref<string | null> = ref(null);
const mnEmail: Ref<string | null> = ref(null);
......@@ -146,6 +147,7 @@ export default defineComponent({
const DataUpdateHotProduct: Ref<ProductType | null> = ref(null);
//sate error input thong-tin-ca-nhan
const check_infoBooking = ref(false);
const artistCodeRules = ref(false);
const fullNameRules = ref(false);
const artistNameRules = ref(false);
......@@ -355,6 +357,7 @@ export default defineComponent({
mnFbmess.value = ArtistInformation.mnFbmess;
mnIns.value = ArtistInformation.mnIns;
mnWhatsapp.value = ArtistInformation.mnWhatsapp;
favoriteScore.value = ArtistInformation.favoriteScore;
nationality.value = ArtistInformation.nationality;
qualification.value = ArtistInformation.qualification;
works.value = ArtistInformation.works;
......@@ -727,14 +730,20 @@ export default defineComponent({
);
}
if (!mnBookingPhone.value || !mnBookingPhone.value?.trim().length) {
if (
(!mnBookingPhone.value || !mnBookingPhone.value?.trim().length) &&
check_infoBooking.value
) {
hasError = true;
mnBookingPhoneRules.value = true;
errorMessmnBookingPhone.value = i18n.global.t(
'artist.artistInformation.validateMessages.requirePhoneNumberAdminister'
);
}
if (!mnBookingEmail.value || !mnBookingEmail.value?.trim().length) {
if (
(!mnBookingEmail.value || !mnBookingEmail.value?.trim().length) &&
check_infoBooking.value
) {
hasError = true;
mnBookingEmailRules.value = true;
errorMessmnBookingEmail.value = i18n.global.t(
......@@ -860,6 +869,7 @@ export default defineComponent({
mnFbmess: mnFbmess.value,
mnIns: mnIns.value,
mnWhatsapp: mnWhatsapp.value,
favoriteScore: favoriteScore.value,
},
})) as AxiosResponse<BaseResponseBody<unknown>>;
if (response.data.error.code === config.API_RES_CODE.OK.code) {
......@@ -1011,6 +1021,8 @@ export default defineComponent({
errorMessmnBookingPhone,
mnBookingEmailRules,
errorMessmnBookingEmail,
favoriteScore,
check_infoBooking,
};
},
});
......@@ -36,8 +36,6 @@ import {
TypeCardType,
FileUploadType,
} from 'src/assets/type';
// import { isEmail } from '../../boot/functions';
// import { isMobilePhone } from '../../boot/functions';
export type AvatarType = {
file?: File;
......@@ -106,7 +104,7 @@ export default defineComponent({
numIndex: 1,
status: 1,
});
const favoriteScore: Ref<number | undefined> = ref(undefined);
const mnName: Ref<string | null> = ref(null);
const mnPhone: Ref<string | null> = ref(null);
const mnEmail: Ref<string | null> = ref(null);
......@@ -149,6 +147,7 @@ export default defineComponent({
const DataUpdateHotProduct: Ref<ProductType | null> = ref(null);
//sate error input thong-tin-ca-nhan
const check_infoBooking = ref(false);
const artistCodeRules = ref(false);
const fullNameRules = ref(false);
const artistNameRules = ref(false);
......@@ -654,14 +653,20 @@ export default defineComponent({
);
}
if (!mnBookingPhone.value || !mnBookingPhone.value?.trim().length) {
if (
(!mnBookingPhone.value || !mnBookingPhone.value?.trim().length) &&
check_infoBooking.value
) {
hasError = true;
mnBookingPhoneRules.value = true;
errorMessmnBookingPhone.value = i18n.global.t(
'artist.artistInformation.validateMessages.requirePhoneNumberAdminister'
);
}
if (!mnBookingEmail.value || !mnBookingEmail.value?.trim().length) {
if (
(!mnBookingEmail.value || !mnBookingEmail.value?.trim().length) &&
check_infoBooking.value
) {
hasError = true;
mnBookingEmailRules.value = true;
errorMessmnBookingEmail.value = i18n.global.t(
......@@ -772,6 +777,7 @@ export default defineComponent({
mnFbmess: mnFbmess.value,
mnIns: mnIns.value,
mnWhatsapp: mnWhatsapp.value,
favoriteScore: favoriteScore.value,
},
})) as AxiosResponse<BaseResponseBody<unknown>>;
if (response.data.error.code === config.API_RES_CODE.OK.code) {
......@@ -919,6 +925,8 @@ export default defineComponent({
errorMessEmail,
errorMessPhoneNumber,
confirmChangeIsDefault,
favoriteScore,
check_infoBooking,
};
},
});
......@@ -61,6 +61,8 @@
v-model:mn-fbmess="mnFbmess"
v-model:mn-ins="mnIns"
v-model:mn-whatsapp="mnWhatsapp"
v-model:favorite-score="favoriteScore"
v-model:check_infoBooking="check_infoBooking"
:errorMessmnBookingPhone="errorMessmnBookingPhone"
:errorMessmnBookingEmail="errorMessmnBookingEmail"
:mnBookingEmailRules="mnBookingEmailRules"
......
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