ปรับแก้ไขตำแหน่ง
This commit is contained in:
parent
bd16728a36
commit
0305788655
1 changed files with 160 additions and 162 deletions
|
|
@ -588,11 +588,10 @@ function emitSearch(keyword: string, typeSelect: string) {
|
||||||
:close="close"
|
:close="close"
|
||||||
/>
|
/>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
|
<form @submit.prevent="validateForm">
|
||||||
<q-card-section class="q-pa-sm">
|
<q-card-section class="q-pa-sm">
|
||||||
<div class="row q-col-gutter-sm">
|
<div class="row q-col-gutter-sm">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<form @submit.prevent="validateForm">
|
|
||||||
<q-card bordered class="col-12" style="border: 1px solid #d6dee1">
|
<q-card bordered class="col-12" style="border: 1px solid #d6dee1">
|
||||||
<div
|
<div
|
||||||
class="col-12 text-weight-medium bg-grey-1 q-py-xs q-px-md"
|
class="col-12 text-weight-medium bg-grey-1 q-py-xs q-px-md"
|
||||||
|
|
@ -715,186 +714,185 @@ function emitSearch(keyword: string, typeSelect: string) {
|
||||||
: 'mdi-arrow-down-drop-circle'
|
: 'mdi-arrow-down-drop-circle'
|
||||||
"
|
"
|
||||||
flat
|
flat
|
||||||
round
|
|
||||||
color="teal"
|
color="teal"
|
||||||
class="q-ml-sm"
|
class="q-ml-sm"
|
||||||
|
label="เพิ่มตำแหน่ง"
|
||||||
@click="isPosition = !isPosition"
|
@click="isPosition = !isPosition"
|
||||||
><q-tooltip>{{
|
><q-tooltip>{{
|
||||||
!isPosition
|
!isPosition
|
||||||
? "เลือกตำแหน่งที่ต้องการเพิ่ม"
|
? "คลิกเพื่อแสดงส่วนของการเพิ่มตำแหน่ง"
|
||||||
: "ปิดหน้าต่าง"
|
: "ปิดหน้าต่างการเพิ่มตำแหน่ง"
|
||||||
}}</q-tooltip></q-btn
|
}}</q-tooltip></q-btn
|
||||||
>
|
>
|
||||||
|
<q-space />
|
||||||
<q-checkbox
|
<q-checkbox
|
||||||
keep-color
|
keep-color
|
||||||
v-model="succession"
|
v-model="succession"
|
||||||
label="สืบทอดตำแหน่ง"
|
label="สืบทอดตำแหน่ง"
|
||||||
color="primary"
|
color="primary"
|
||||||
>
|
>
|
||||||
<q-tooltip
|
<q-tooltip>สืบทอดตำแหน่ง</q-tooltip>
|
||||||
>สืบทอดตำแหน่ง</q-tooltip
|
|
||||||
>
|
|
||||||
</q-checkbox>
|
</q-checkbox>
|
||||||
<q-space />
|
|
||||||
<q-btn type="submit" :label="`บันทึก`" color="public" />
|
|
||||||
</q-card-actions>
|
</q-card-actions>
|
||||||
</q-card>
|
</q-card>
|
||||||
</form>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-if="isPosition" class="row q-col-gutter-sm q-mt-sm">
|
<div v-if="isPosition" class="row q-col-gutter-sm q-mt-sm">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-card bordered class="col-12" style="border: 1px solid #d6dee1">
|
<q-card bordered class="col-12" style="border: 1px solid #d6dee1">
|
||||||
<div class="col-12 text-weight-medium bg-grey-1 q-py-xs q-px-md">
|
<div
|
||||||
เลือกตำแหน่งที่ต้องการเพิ่ม
|
class="col-12 text-weight-medium bg-grey-1 q-py-xs q-px-md"
|
||||||
<q-btn
|
|
||||||
icon="mdi-plus"
|
|
||||||
flat
|
|
||||||
round
|
|
||||||
color="teal"
|
|
||||||
@click="() => (modalAdd = true)"
|
|
||||||
><q-tooltip>สร้างตำแหน่ง</q-tooltip></q-btn
|
|
||||||
>
|
>
|
||||||
</div>
|
เลือกตำแหน่งที่ต้องการเพิ่ม
|
||||||
<div class="col-12"><q-separator /></div>
|
<q-btn
|
||||||
<div class="q-pa-sm">
|
icon="mdi-plus"
|
||||||
<div class="row col-12 q-col-gutter-sm items-start">
|
|
||||||
<div class="col-12 col-sm-6 col-md-3">
|
|
||||||
<q-select
|
|
||||||
label="ค้นหาจาก"
|
|
||||||
v-model="type"
|
|
||||||
:options="optionFilter"
|
|
||||||
emit-value
|
|
||||||
dense
|
|
||||||
map-options
|
|
||||||
outlined
|
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-12 col-sm-6 col-md-6">
|
|
||||||
<q-input
|
|
||||||
ref="searchRef"
|
|
||||||
:class="inputEdit(isReadonly)"
|
|
||||||
v-model="search"
|
|
||||||
outlined
|
|
||||||
clearable
|
|
||||||
dense
|
|
||||||
lazy-rules
|
|
||||||
label="คำค้น"
|
|
||||||
hide-bottom-space
|
|
||||||
:rules="[(val) => !!val || `กรุณากรอกคำค้น`]"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-12 col-sm-6 col-md-3">
|
|
||||||
<q-btn
|
|
||||||
color="primary"
|
|
||||||
icon="search"
|
|
||||||
label="ค้นหา"
|
|
||||||
class="full-width q-pa-sm"
|
|
||||||
@click="searchInput()"
|
|
||||||
>
|
|
||||||
</q-btn>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="full-width q-mt-sm">
|
|
||||||
<d-table
|
|
||||||
ref="table"
|
|
||||||
:columns="columns"
|
|
||||||
:rows="rowsPositionSelect"
|
|
||||||
row-key="id"
|
|
||||||
flat
|
flat
|
||||||
bordered
|
round
|
||||||
:paging="true"
|
color="teal"
|
||||||
dense
|
@click="() => (modalAdd = true)"
|
||||||
class="custom-header-table"
|
><q-tooltip>สร้างตำแหน่ง</q-tooltip></q-btn
|
||||||
:visible-columns="visibleColumns"
|
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
|
||||||
<q-tr :props="props">
|
|
||||||
<q-th
|
|
||||||
v-for="col in props.cols"
|
|
||||||
:key="col.name"
|
|
||||||
:props="props"
|
|
||||||
style="color: #000000; font-weight: 500"
|
|
||||||
>
|
|
||||||
<span class="text-weight-medium">{{
|
|
||||||
col.label
|
|
||||||
}}</span>
|
|
||||||
</q-th>
|
|
||||||
<q-th auto-width></q-th>
|
|
||||||
</q-tr>
|
|
||||||
</template>
|
|
||||||
<template v-slot:body="props">
|
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
|
||||||
<q-td
|
|
||||||
v-for="col in props.cols"
|
|
||||||
:key="col.name"
|
|
||||||
:props="props"
|
|
||||||
@click="addPosition(props.row)"
|
|
||||||
>
|
|
||||||
<div v-if="col.name == 'no'">
|
|
||||||
{{ props.rowIndex + 1 }}
|
|
||||||
</div>
|
|
||||||
<div v-else>
|
|
||||||
{{ col.value }}
|
|
||||||
</div>
|
|
||||||
</q-td>
|
|
||||||
<q-td auto-width>
|
|
||||||
<q-btn
|
|
||||||
flat
|
|
||||||
dense
|
|
||||||
icon="mdi-dots-vertical"
|
|
||||||
class="q-pa-none q-ml-xs"
|
|
||||||
color="grey-13"
|
|
||||||
>
|
|
||||||
<q-menu anchor="bottom middle" self="top middle">
|
|
||||||
<q-list
|
|
||||||
dense
|
|
||||||
v-for="(item, index) in listMenu"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
<q-item
|
|
||||||
clickable
|
|
||||||
v-close-popup
|
|
||||||
@click="
|
|
||||||
item.type === 'copy'
|
|
||||||
? copyDetiail(props.row)
|
|
||||||
: deletePos(props.row.id)
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<q-item-section avatar>
|
|
||||||
<q-icon
|
|
||||||
:color="item.color"
|
|
||||||
:name="item.icon"
|
|
||||||
size="sm"
|
|
||||||
/>
|
|
||||||
</q-item-section>
|
|
||||||
<q-item-section>{{
|
|
||||||
item.label
|
|
||||||
}}</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
</q-list>
|
|
||||||
</q-menu>
|
|
||||||
</q-btn>
|
|
||||||
</q-td>
|
|
||||||
</q-tr>
|
|
||||||
</template>
|
|
||||||
</d-table>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="col-12"><q-separator /></div>
|
||||||
</q-card>
|
<div class="q-pa-sm">
|
||||||
|
<div class="row col-12 q-col-gutter-sm items-start">
|
||||||
|
<div class="col-12 col-sm-6 col-md-3">
|
||||||
|
<q-select
|
||||||
|
label="ค้นหาจาก"
|
||||||
|
v-model="type"
|
||||||
|
:options="optionFilter"
|
||||||
|
emit-value
|
||||||
|
dense
|
||||||
|
map-options
|
||||||
|
outlined
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-12 col-sm-6 col-md-6">
|
||||||
|
<q-input
|
||||||
|
ref="searchRef"
|
||||||
|
:class="inputEdit(isReadonly)"
|
||||||
|
v-model="search"
|
||||||
|
outlined
|
||||||
|
clearable
|
||||||
|
dense
|
||||||
|
lazy-rules
|
||||||
|
label="คำค้น"
|
||||||
|
hide-bottom-space
|
||||||
|
:rules="[(val) => !!val || `กรุณากรอกคำค้น`]"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-12 col-sm-6 col-md-3">
|
||||||
|
<q-btn
|
||||||
|
color="primary"
|
||||||
|
icon="search"
|
||||||
|
label="ค้นหา"
|
||||||
|
class="full-width q-pa-sm"
|
||||||
|
@click="searchInput()"
|
||||||
|
>
|
||||||
|
</q-btn>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="full-width q-mt-sm">
|
||||||
|
<d-table
|
||||||
|
ref="table"
|
||||||
|
:columns="columns"
|
||||||
|
:rows="rowsPositionSelect"
|
||||||
|
row-key="id"
|
||||||
|
flat
|
||||||
|
bordered
|
||||||
|
:paging="true"
|
||||||
|
dense
|
||||||
|
class="custom-header-table"
|
||||||
|
:visible-columns="visibleColumns"
|
||||||
|
>
|
||||||
|
<template v-slot:header="props">
|
||||||
|
<q-tr :props="props">
|
||||||
|
<q-th
|
||||||
|
v-for="col in props.cols"
|
||||||
|
:key="col.name"
|
||||||
|
:props="props"
|
||||||
|
style="color: #000000; font-weight: 500"
|
||||||
|
>
|
||||||
|
<span class="text-weight-medium">{{
|
||||||
|
col.label
|
||||||
|
}}</span>
|
||||||
|
</q-th>
|
||||||
|
<q-th auto-width></q-th>
|
||||||
|
</q-tr>
|
||||||
|
</template>
|
||||||
|
<template v-slot:body="props">
|
||||||
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
|
<q-td
|
||||||
|
v-for="col in props.cols"
|
||||||
|
:key="col.name"
|
||||||
|
:props="props"
|
||||||
|
@click="addPosition(props.row)"
|
||||||
|
>
|
||||||
|
<div v-if="col.name == 'no'">
|
||||||
|
{{ props.rowIndex + 1 }}
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
{{ col.value }}
|
||||||
|
</div>
|
||||||
|
</q-td>
|
||||||
|
<q-td auto-width>
|
||||||
|
<q-btn
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
icon="mdi-dots-vertical"
|
||||||
|
class="q-pa-none q-ml-xs"
|
||||||
|
color="grey-13"
|
||||||
|
>
|
||||||
|
<q-menu anchor="bottom middle" self="top middle">
|
||||||
|
<q-list
|
||||||
|
dense
|
||||||
|
v-for="(item, index) in listMenu"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<q-item
|
||||||
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
@click="
|
||||||
|
item.type === 'copy'
|
||||||
|
? copyDetiail(props.row)
|
||||||
|
: deletePos(props.row.id)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<q-item-section avatar>
|
||||||
|
<q-icon
|
||||||
|
:color="item.color"
|
||||||
|
:name="item.icon"
|
||||||
|
size="sm"
|
||||||
|
/>
|
||||||
|
</q-item-section>
|
||||||
|
<q-item-section>{{
|
||||||
|
item.label
|
||||||
|
}}</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</q-list>
|
||||||
|
</q-menu>
|
||||||
|
</q-btn>
|
||||||
|
</q-td>
|
||||||
|
</q-tr>
|
||||||
|
</template>
|
||||||
|
</d-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</q-card>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</q-card-section>
|
||||||
</q-card-section>
|
<q-separator />
|
||||||
<!-- <q-separator />
|
<q-card-actions align="right" class="bg-white text-teal">
|
||||||
<q-card-actions align="right" class="bg-white text-teal">
|
<q-btn type="submit" :label="`บันทึก`" color="public" />
|
||||||
<q-btn type="submit" :label="`บันทึก`" color="public" />
|
</q-card-actions>
|
||||||
</q-card-actions> -->
|
</form>
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
<DialogAddPosition v-model:modalAdd="modalAdd" :emitSearch="emitSearch" />
|
<DialogAddPosition v-model:modalAdd="modalAdd" :emitSearch="emitSearch" />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue