Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async mounted() {
await Vue.nextTick();
this.time = moment(this.value).format('HH:mm');
this.date = moment(this.value).format('YYYY-MM-DD');
(this.$refs.time as Vue).$emit('input', this.time);
(this.$refs.date as Vue).$emit('input', this.date);
}
}
async onResult() {
if (this.input === null) return;
await Vue.nextTick();
this.input.roomKind.id = this.data.roomKind.id;
this.$v.$touch();
}
}
async onResult() {
if (this.input === null) return;
await Vue.nextTick();
this.input.roomKind.id = this.data.roomKind.id;
this.$v.$touch();
}
}
async onResult({
data,
}: ApolloQueryResult) {
if (this.input === null) return;
await Vue.nextTick();
if ('roomKinds' in data) {
this.input.roomKind.id = this.data.room.roomKind.id;
} else if ('floors' in data) {
this.input.floor.id = this.data.floor.id;
}
this.$v.$touch();
}
}
async onResult({
data: { employee },
}: ApolloQueryResult) {
await Vue.nextTick();
this.employee = employee;
const {
id,
name,
identityCard,
phoneNumber,
address,
email,
birthdate,
gender,
startingDate,
position,
} = employee;
this.input = {
id,
name,
async onResult({
data,
}: ApolloQueryResult) {
if (this.input === null) return;
await Vue.nextTick();
if ('roomKinds' in data) {
if (data.roomKinds.length === 0) return;
this.input.roomKind.id = data.roomKinds[0].id;
} else if ('floors' in data) {
this.input.floor.id = this.data.floor.id;
}
this.$v.$touch();
}
}
async mounted() {
await Vue.nextTick();
if (this.$route !== undefined) {
if (this.$route.path.indexOf('/receptionist') === 0) {
this.showReceptionist = true;
} else if (this.$route.path.indexOf('/business') === 0) {
this.showBusiness = true;
} else if (this.$route.path.indexOf('/manage') === 0) {
this.showManage = true;
} else if (this.$route.path.indexOf('/personnel') === 0) {
this.showPersonnel = true;
}
}
}
}
async onResult({ data: { patron } }: ApolloQueryResult) {
await Vue.nextTick();
this.patron = patron;
const {
id,
identification,
name,
email,
gender,
nationality,
birthdate,
domicile,
residence,
company,
note,
phoneNumber,
patronKind,
} = patron;
async onResult() {
if (!this.data.booking) return;
if (this.input === null) return;
await Vue.nextTick();
this.input.room.id = this.data.booking.room.id;
this.$v.$touch();
}
}
public async open(data: TData): Promise {
const popup = this.$refs.popup as Vue & PopupMixin;
if (popup === undefined || typeof popup.open !== 'function') {
throw new Error(
'Không tìm thấy ref=`popup` hoặc hàm `popup.open` trong component',
);
}
this.data = data;
popup.open(data);
await this.onOpen();
await Vue.nextTick();
const autoFocus = this.$refs.autoFocus as Vue;
if (autoFocus !== undefined && autoFocus.$refs.input !== undefined) {
const input = (autoFocus.$refs.input as Vue).$el as HTMLElement;
if (typeof input.focus === 'function') input.focus();
}
}