fix: form dialog & work name management dialog
This commit is contained in:
parent
5253bdc9fa
commit
f7fa614ffe
3 changed files with 159 additions and 129 deletions
|
|
@ -41,7 +41,7 @@ function confirmDelete(items: unknown[], index: number) {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="full-width column no-wrap" style="height: 50vh">
|
<div class="full-width column no-wrap full-height">
|
||||||
<div
|
<div
|
||||||
v-if="true"
|
v-if="true"
|
||||||
class="bordered rounded surface-1 flex col column justify-between"
|
class="bordered rounded surface-1 flex col column justify-between"
|
||||||
|
|
@ -52,37 +52,6 @@ function confirmDelete(items: unknown[], index: number) {
|
||||||
v-for="(i, index) in testName"
|
v-for="(i, index) in testName"
|
||||||
:key="index"
|
:key="index"
|
||||||
>
|
>
|
||||||
<q-btn
|
|
||||||
id="btn-delete-work-name"
|
|
||||||
icon="mdi-trash-can-outline"
|
|
||||||
dense
|
|
||||||
flat
|
|
||||||
round
|
|
||||||
color="negative"
|
|
||||||
@click="confirmDelete(testName, index)"
|
|
||||||
/>
|
|
||||||
<q-btn
|
|
||||||
v-if="!i.isEdit"
|
|
||||||
id="btn-edit-work-name"
|
|
||||||
icon="mdi-pencil-outline"
|
|
||||||
dense
|
|
||||||
flat
|
|
||||||
round
|
|
||||||
class="q-ml-md"
|
|
||||||
color="primary"
|
|
||||||
@click="i.isEdit = true"
|
|
||||||
/>
|
|
||||||
<q-btn
|
|
||||||
v-else
|
|
||||||
id="btn-edit-work-name"
|
|
||||||
icon="mdi-check"
|
|
||||||
dense
|
|
||||||
flat
|
|
||||||
round
|
|
||||||
class="q-ml-md"
|
|
||||||
color="primary"
|
|
||||||
@click="i.isEdit = false"
|
|
||||||
/>
|
|
||||||
<!-- outlined -->
|
<!-- outlined -->
|
||||||
<q-input
|
<q-input
|
||||||
ref="inputWorkName"
|
ref="inputWorkName"
|
||||||
|
|
@ -90,10 +59,60 @@ function confirmDelete(items: unknown[], index: number) {
|
||||||
:borderless="!i.isEdit"
|
:borderless="!i.isEdit"
|
||||||
:readonly="!i.isEdit"
|
:readonly="!i.isEdit"
|
||||||
:outlined="i.isEdit"
|
:outlined="i.isEdit"
|
||||||
class="q-ml-xl col"
|
class="col q-mr-md"
|
||||||
v-model="i.name"
|
v-model="i.name"
|
||||||
placeholder="ชื่องาน"
|
placeholder="ชื่องาน"
|
||||||
></q-input>
|
></q-input>
|
||||||
|
<q-btn
|
||||||
|
v-if="!i.isEdit"
|
||||||
|
id="btn-edit-work-name"
|
||||||
|
icon="mdi-pencil-outline"
|
||||||
|
dense
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
color="primary"
|
||||||
|
@click="i.isEdit = true"
|
||||||
|
>
|
||||||
|
<q-tooltip>Edit</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
|
<q-btn
|
||||||
|
v-else
|
||||||
|
id="btn-edit-work-name"
|
||||||
|
icon="mdi-check"
|
||||||
|
dense
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
color="primary"
|
||||||
|
@click="i.isEdit = false"
|
||||||
|
>
|
||||||
|
<q-tooltip>Save</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
|
<q-btn
|
||||||
|
v-if="!i.isEdit"
|
||||||
|
id="btn-delete-work-name"
|
||||||
|
icon="mdi-trash-can-outline"
|
||||||
|
dense
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
class="q-ml-md"
|
||||||
|
color="negative"
|
||||||
|
@click="confirmDelete(testName, index)"
|
||||||
|
>
|
||||||
|
<q-tooltip>Delete</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
|
<q-btn
|
||||||
|
v-else
|
||||||
|
id="btn-edit-work-name"
|
||||||
|
icon="mdi-undo"
|
||||||
|
dense
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
class="q-ml-md"
|
||||||
|
color="negative"
|
||||||
|
@click="i.isEdit = false"
|
||||||
|
>
|
||||||
|
<q-tooltip>Cancel</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
</q-item>
|
</q-item>
|
||||||
</q-list>
|
</q-list>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import AppBox from 'components/app/AppBox.vue';
|
// import AppBox from 'components/app/AppBox.vue';
|
||||||
import FormAddress from './02_personnel-management/FormAddress.vue';
|
import FormAddress from './02_personnel-management/FormAddress.vue';
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
|
|
@ -46,11 +46,17 @@ const tabsList = defineModel<{ name: string; label: string }[]>('tabsList');
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<q-dialog v-model="modal" @hide="close">
|
<q-dialog v-model="modal" @hide="close">
|
||||||
<AppBox
|
<div
|
||||||
style="padding: 0; border-radius: var(--radius-2); max-height: 100%"
|
class="surface-1"
|
||||||
:style="`max-width:${maxWidth ? maxWidth : '85%'}; width: ${width ? width : '85%'} `"
|
style="padding: 0; border-radius: var(--radius-2); height: 100%"
|
||||||
|
:style="`max-width:${maxWidth ? maxWidth : '85%'}; width: ${width ? width : '85%'}; height: ${height ? height : '85vh'} `"
|
||||||
>
|
>
|
||||||
<q-form greedy @submit.prevent @validation-success="submit">
|
<q-form
|
||||||
|
greedy
|
||||||
|
@submit.prevent
|
||||||
|
@validation-success="submit"
|
||||||
|
class="column full-height"
|
||||||
|
>
|
||||||
<!-- header -->
|
<!-- header -->
|
||||||
<div class="form-header q-py-sm q-px-lg">
|
<div class="form-header q-py-sm q-px-lg">
|
||||||
<div class="row items-center">
|
<div class="row items-center">
|
||||||
|
|
@ -141,117 +147,120 @@ const tabsList = defineModel<{ name: string; label: string }[]>('tabsList');
|
||||||
|
|
||||||
<!-- body -->
|
<!-- body -->
|
||||||
<div
|
<div
|
||||||
v-if="tabsList && tabsList.length > 0"
|
class="col full-height column"
|
||||||
class="row surface-2 q-px-md q-pt-md full-width"
|
|
||||||
style="border-bottom: 1px solid var(--brand-1)"
|
|
||||||
>
|
|
||||||
<q-tabs
|
|
||||||
dense
|
|
||||||
class="app-text-muted cancel-overflow"
|
|
||||||
v-model="currentTab"
|
|
||||||
active-class="active-tab"
|
|
||||||
indicator-color="transparent"
|
|
||||||
>
|
|
||||||
<q-tab
|
|
||||||
:id="`tab-${tab.label}`"
|
|
||||||
v-for="tab in tabsList"
|
|
||||||
v-bind:key="tab.name"
|
|
||||||
class="content-tab text-capitalize"
|
|
||||||
:name="tab.name"
|
|
||||||
:label="$t(tab.label)"
|
|
||||||
style="z-index: 999"
|
|
||||||
/>
|
|
||||||
</q-tabs>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="row q-pa-lg scroll"
|
|
||||||
:class="{
|
:class="{
|
||||||
dark: $q.dark.isActive,
|
dark: $q.dark.isActive,
|
||||||
'surface-2': !employee,
|
'surface-2': !employee,
|
||||||
'surface-tab': employee || tabsList,
|
'surface-tab': employee || tabsList,
|
||||||
}"
|
}"
|
||||||
:style="
|
|
||||||
$q.screen.gt.sm
|
|
||||||
? 'max-height: 75vh'
|
|
||||||
: 'overflow-y: auto; max-height: 75vh'
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<!-- prepend -->
|
|
||||||
<div
|
<div
|
||||||
class="column"
|
v-if="tabsList && tabsList.length > 0"
|
||||||
:class="$q.screen.gt.sm ? 'col-2 q-pr-lg' : 'col-12'"
|
class="row surface-2 q-px-md q-pt-md full-width"
|
||||||
v-if="$slots.prepend && !$slots.append"
|
style="border-bottom: 1px solid var(--brand-1)"
|
||||||
>
|
>
|
||||||
<slot name="prepend"></slot>
|
<q-tabs
|
||||||
|
dense
|
||||||
|
class="app-text-muted cancel-overflow"
|
||||||
|
v-model="currentTab"
|
||||||
|
active-class="active-tab"
|
||||||
|
indicator-color="transparent"
|
||||||
|
>
|
||||||
|
<q-tab
|
||||||
|
:id="`tab-${tab.label}`"
|
||||||
|
v-for="tab in tabsList"
|
||||||
|
v-bind:key="tab.name"
|
||||||
|
class="content-tab text-capitalize"
|
||||||
|
:name="tab.name"
|
||||||
|
:label="$t(tab.label)"
|
||||||
|
style="z-index: 999"
|
||||||
|
/>
|
||||||
|
</q-tabs>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row col-12" v-if="$slots.body">
|
<div
|
||||||
<slot name="body"></slot>
|
class="row q-pa-lg scroll col"
|
||||||
</div>
|
:class="{
|
||||||
|
dark: $q.dark.isActive,
|
||||||
<slot></slot>
|
'surface-2': !employee,
|
||||||
|
'surface-tab': employee || tabsList,
|
||||||
<!-- center -->
|
}"
|
||||||
<AppBox
|
|
||||||
v-if="!noAppBox"
|
|
||||||
bordered
|
|
||||||
:noPadding="noPaddingTab"
|
|
||||||
class="column full-height"
|
|
||||||
:class="`${$slots.prepend ? ($q.screen.gt.sm ? 'col-10' : 'col-12') : $slots.append ? 'col-6' : 'col-12'}`"
|
|
||||||
style="padding-right: 0; padding-bottom: 0"
|
|
||||||
>
|
>
|
||||||
|
<!-- prepend -->
|
||||||
<div
|
<div
|
||||||
class="row col-12 q-col-gutter-y-md q-mb-md items-start"
|
class="column"
|
||||||
:class="noPaddingTab ? '' : 'q-pr-md'"
|
:class="$q.screen.gt.sm ? 'col-2 q-pr-lg' : 'col-12'"
|
||||||
:style="
|
v-if="$slots.prepend && !$slots.append"
|
||||||
$q.screen.gt.sm
|
>
|
||||||
? noPaddingTab
|
<slot name="prepend"></slot>
|
||||||
? 'height: 60vh'
|
</div>
|
||||||
: 'overflow-y: auto; height: 60vh'
|
|
||||||
: ''
|
<div class="row col-12" v-if="$slots.body">
|
||||||
|
<slot name="body"></slot>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<slot></slot>
|
||||||
|
|
||||||
|
<!-- center -->
|
||||||
|
<div
|
||||||
|
v-if="!noAppBox"
|
||||||
|
bordered
|
||||||
|
:noPadding="noPaddingTab"
|
||||||
|
class="column full-height surface-1 bordered rounded q-pt-lg q-pl-lg scroll"
|
||||||
|
:class="`${$slots.prepend ? ($q.screen.gt.sm ? 'col-10' : 'col-12') : $slots.append ? 'col-6' : 'col-12'}`"
|
||||||
|
style="
|
||||||
|
padding-right: 0;
|
||||||
|
padding-bottom: 16px;
|
||||||
|
box-sizing: border-box;
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<slot name="information"></slot>
|
<div
|
||||||
<slot name="person"></slot>
|
class="row col-12 q-col-gutter-y-md q-mb-md items-start full-height"
|
||||||
<slot v-if="!noFooter" name="address">
|
:class="noPaddingTab ? '' : 'q-pr-md'"
|
||||||
<FormAddress
|
>
|
||||||
dense
|
<slot name="information"></slot>
|
||||||
outlined
|
<slot name="person"></slot>
|
||||||
:employee="employee"
|
<slot v-if="!noFooter" name="address">
|
||||||
:title="titleFormAddress"
|
<FormAddress
|
||||||
:separator="addressSeparator"
|
dense
|
||||||
:disabledRule="disabledRule"
|
outlined
|
||||||
v-model:address="address"
|
:employee="employee"
|
||||||
v-model:addressEN="addressEN"
|
:title="titleFormAddress"
|
||||||
v-model:provinceId="provinceId"
|
:separator="addressSeparator"
|
||||||
v-model:districtId="districtId"
|
:disabledRule="disabledRule"
|
||||||
v-model:subDistrictId="subDistrictId"
|
v-model:address="address"
|
||||||
v-model:zipCode="zipCode"
|
v-model:addressEN="addressEN"
|
||||||
v-model:same-with-employer="sameWithEmployer"
|
v-model:provinceId="provinceId"
|
||||||
:addressTitle="addressTitle || ''"
|
v-model:districtId="districtId"
|
||||||
:addressTitleEN="addressTitleEN || ''"
|
v-model:subDistrictId="subDistrictId"
|
||||||
v-if="!$slots.address && !noAddress"
|
v-model:zipCode="zipCode"
|
||||||
/>
|
v-model:same-with-employer="sameWithEmployer"
|
||||||
</slot>
|
:addressTitle="addressTitle || ''"
|
||||||
<slot name="qr-code"></slot>
|
:addressTitleEN="addressTitleEN || ''"
|
||||||
<slot name="location"></slot>
|
v-if="!$slots.address && !noAddress"
|
||||||
<slot name="by-type"></slot>
|
/>
|
||||||
|
</slot>
|
||||||
|
<slot name="qr-code"></slot>
|
||||||
|
<slot name="location"></slot>
|
||||||
|
<slot name="by-type"></slot>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</AppBox>
|
|
||||||
|
|
||||||
<!-- append -->
|
<!-- append -->
|
||||||
<q-item-section
|
<q-item-section
|
||||||
class="column col-6"
|
class="column col-6"
|
||||||
v-if="$slots.append && !$slots.prepend"
|
v-if="$slots.append && !$slots.prepend"
|
||||||
>
|
>
|
||||||
<slot name="append"></slot>
|
<slot name="append"></slot>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- footer -->
|
<!-- footer -->
|
||||||
<div
|
<div
|
||||||
v-if="!noFooter"
|
v-if="!noFooter"
|
||||||
class="form-footer q-py-sm row items-center full-width justify-between q-px-md"
|
class="form-footer row items-center full-width justify-between q-px-md q-py-md surface-1"
|
||||||
|
style="z-index: 3"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<slot name="footer"></slot>
|
<slot name="footer"></slot>
|
||||||
|
|
@ -279,7 +288,7 @@ const tabsList = defineModel<{ name: string; label: string }[]>('tabsList');
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-form>
|
</q-form>
|
||||||
</AppBox>
|
</div>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1454,6 +1454,7 @@ watch(currentStatus, async () => {
|
||||||
|
|
||||||
<!-- add service -->
|
<!-- add service -->
|
||||||
<FormDialog
|
<FormDialog
|
||||||
|
height="95vh"
|
||||||
no-address
|
no-address
|
||||||
:title="$t('addService')"
|
:title="$t('addService')"
|
||||||
v-model:modal="dialogService"
|
v-model:modal="dialogService"
|
||||||
|
|
@ -1554,6 +1555,7 @@ watch(currentStatus, async () => {
|
||||||
<FormDialog
|
<FormDialog
|
||||||
no-address
|
no-address
|
||||||
no-app-box
|
no-app-box
|
||||||
|
no-footer
|
||||||
width="65%"
|
width="65%"
|
||||||
title="จัดการ"
|
title="จัดการ"
|
||||||
v-model:modal="manageWorkNameDialog"
|
v-model:modal="manageWorkNameDialog"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue