แก้ path
This commit is contained in:
parent
af491b19f9
commit
acd79be9f9
2 changed files with 66 additions and 40 deletions
|
|
@ -4,18 +4,22 @@ import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import avatar from "@/assets/avatar_user.jpg";
|
import avatar from "@/assets/avatar_user.jpg";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import { useCommandMainStore } from "@/modules/18_command/store/Main";
|
||||||
|
|
||||||
// import http from "@/plugins/http";
|
// import http from "@/plugins/http";
|
||||||
// import config from "@/app.config";
|
// import config from "@/app.config";
|
||||||
|
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import type { ResponseData } from "@/modules/05_placement/interface/response/Transfer";
|
import type { ResponseData } from "@/modules/05_placement/interface/response/Transfer";
|
||||||
|
import type { ListCommand } from "@/modules/18_command/interface/index/Main";
|
||||||
|
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue";
|
import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue";
|
||||||
|
import { options } from "@fullcalendar/core/preact";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
|
const storeCommand = useCommandMainStore();
|
||||||
const {
|
const {
|
||||||
showLoader,
|
showLoader,
|
||||||
success,
|
success,
|
||||||
|
|
@ -36,6 +40,9 @@ const props = defineProps({
|
||||||
rows: Array,
|
rows: Array,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const rows = ref<any[]>([]);
|
||||||
|
const commandType = ref<string>("");
|
||||||
|
const commandOp = ref<ListCommand[]>([]);
|
||||||
const modalCommand = ref<boolean>(false); //เปิด-ปิด modal สร้างคำสั่ง
|
const modalCommand = ref<boolean>(false); //เปิด-ปิด modal สร้างคำสั่ง
|
||||||
//Table
|
//Table
|
||||||
const selected = ref<ResponseData[]>([]); //รายชื่อที่เลือก
|
const selected = ref<ResponseData[]>([]); //รายชื่อที่เลือก
|
||||||
|
|
@ -158,6 +165,10 @@ function saveOrder() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function filterSelectOrder() {
|
||||||
|
const data = props.rows ? props.rows : [];
|
||||||
|
rows.value = data.filter((v: any) => v.code == commandType.value);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* เมื่อ props.modal เป็น true
|
* เมื่อ props.modal เป็น true
|
||||||
*
|
*
|
||||||
|
|
@ -165,9 +176,14 @@ function saveOrder() {
|
||||||
*/
|
*/
|
||||||
watch(
|
watch(
|
||||||
() => modal.value,
|
() => modal.value,
|
||||||
() => {
|
async () => {
|
||||||
if (modal.value === true) {
|
if (modal.value === true) {
|
||||||
|
rows.value = props.rows ? props.rows : [];
|
||||||
selected.value = [];
|
selected.value = [];
|
||||||
|
const data = await storeCommand.getCommandTypes();
|
||||||
|
commandOp.value = data.filter(
|
||||||
|
(v: any) => v.code == "C-PM-01" || v.code == "C-PM-02"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -178,45 +194,55 @@ watch(
|
||||||
<DialogHeader :tittle="'ส่งไปออกคำสั่ง'" :close="closeModal" />
|
<DialogHeader :tittle="'ส่งไปออกคำสั่ง'" :close="closeModal" />
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-card-section>
|
<q-card-section>
|
||||||
<div class="row justify-end">
|
<div class="row q-mb-sm" style="padding: 0">
|
||||||
<div class="col-5">
|
<q-select
|
||||||
<q-toolbar style="padding: 0">
|
v-model="commandType"
|
||||||
<q-input
|
dense
|
||||||
borderless
|
outlined
|
||||||
outlined
|
label="ประเภทคำสั่ง"
|
||||||
dense
|
:options="commandOp"
|
||||||
debounce="300"
|
option-label="name"
|
||||||
v-model="filter"
|
option-value="code"
|
||||||
placeholder="ค้นหา"
|
emit-value
|
||||||
style="width: 850px; max-width: auto"
|
map-options
|
||||||
>
|
style="width: 200px; max-width: auto"
|
||||||
<template v-slot:append>
|
@update:model-value="filterSelectOrder"
|
||||||
<q-icon v-if="filter == ''" name="search" />
|
></q-select>
|
||||||
<q-icon
|
<q-space />
|
||||||
v-if="filter !== ''"
|
<q-input
|
||||||
name="clear"
|
borderless
|
||||||
class="cursor-pointer"
|
outlined
|
||||||
@click="filter = ''"
|
dense
|
||||||
/>
|
debounce="300"
|
||||||
</template>
|
v-model="filter"
|
||||||
</q-input>
|
placeholder="ค้นหา"
|
||||||
<q-select
|
style="width: 200px; max-width: auto"
|
||||||
v-model="visibleColumns"
|
>
|
||||||
multiple
|
<template v-slot:append>
|
||||||
outlined
|
<q-icon v-if="filter == ''" name="search" />
|
||||||
dense
|
<q-icon
|
||||||
options-dense
|
v-if="filter !== ''"
|
||||||
:display-value="$q.lang.table.columns"
|
name="clear"
|
||||||
emit-value
|
class="cursor-pointer"
|
||||||
map-options
|
@click="filter = ''"
|
||||||
:options="columns"
|
|
||||||
option-value="name"
|
|
||||||
options-cover
|
|
||||||
style="min-width: 150px"
|
|
||||||
class="gt-xs q-ml-sm"
|
|
||||||
/>
|
/>
|
||||||
</q-toolbar>
|
</template>
|
||||||
</div>
|
</q-input>
|
||||||
|
<q-select
|
||||||
|
v-model="visibleColumns"
|
||||||
|
multiple
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
options-dense
|
||||||
|
:display-value="$q.lang.table.columns"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
:options="columns"
|
||||||
|
option-value="name"
|
||||||
|
options-cover
|
||||||
|
style="min-width: 150px"
|
||||||
|
class="gt-xs q-ml-sm"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<d-table
|
<d-table
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ const Name = ref<string>();
|
||||||
const rowsAll = ref<any>([]);
|
const rowsAll = ref<any>([]);
|
||||||
const rows = ref<any[]>([]);
|
const rows = ref<any[]>([]);
|
||||||
const rowsFilter = ref<any>([]);
|
const rowsFilter = ref<any>([]);
|
||||||
const rowsOrder = ref<any>([]);
|
const rowsOrder = ref<any[]>([]);
|
||||||
const myForm = ref<any>();
|
const myForm = ref<any>();
|
||||||
const files = ref<any>(null);
|
const files = ref<any>(null);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue