แก้ path

This commit is contained in:
STW_TTTY\stwtt 2024-09-25 13:35:46 +07:00
parent af491b19f9
commit acd79be9f9
2 changed files with 66 additions and 40 deletions

View file

@ -4,18 +4,22 @@ import { useQuasar } from "quasar";
import avatar from "@/assets/avatar_user.jpg";
import { useCounterMixin } from "@/stores/mixin";
import { useCommandMainStore } from "@/modules/18_command/store/Main";
// import http from "@/plugins/http";
// import config from "@/app.config";
import type { QTableProps } from "quasar";
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 DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue";
import { options } from "@fullcalendar/core/preact";
const $q = useQuasar();
const mixin = useCounterMixin();
const storeCommand = useCommandMainStore();
const {
showLoader,
success,
@ -36,6 +40,9 @@ const props = defineProps({
rows: Array,
});
const rows = ref<any[]>([]);
const commandType = ref<string>("");
const commandOp = ref<ListCommand[]>([]);
const modalCommand = ref<boolean>(false); //- modal
//Table
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
*
@ -165,9 +176,14 @@ function saveOrder() {
*/
watch(
() => modal.value,
() => {
async () => {
if (modal.value === true) {
rows.value = props.rows ? props.rows : [];
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" />
<q-separator />
<q-card-section>
<div class="row justify-end">
<div class="col-5">
<q-toolbar style="padding: 0">
<q-input
borderless
outlined
dense
debounce="300"
v-model="filter"
placeholder="ค้นหา"
style="width: 850px; max-width: auto"
>
<template v-slot:append>
<q-icon v-if="filter == ''" name="search" />
<q-icon
v-if="filter !== ''"
name="clear"
class="cursor-pointer"
@click="filter = ''"
/>
</template>
</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 class="row q-mb-sm" style="padding: 0">
<q-select
v-model="commandType"
dense
outlined
label="ประเภทคำสั่ง"
:options="commandOp"
option-label="name"
option-value="code"
emit-value
map-options
style="width: 200px; max-width: auto"
@update:model-value="filterSelectOrder"
></q-select>
<q-space />
<q-input
borderless
outlined
dense
debounce="300"
v-model="filter"
placeholder="ค้นหา"
style="width: 200px; max-width: auto"
>
<template v-slot:append>
<q-icon v-if="filter == ''" name="search" />
<q-icon
v-if="filter !== ''"
name="clear"
class="cursor-pointer"
@click="filter = ''"
/>
</q-toolbar>
</div>
</template>
</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>
<d-table

View file

@ -62,7 +62,7 @@ const Name = ref<string>();
const rowsAll = ref<any>([]);
const rows = ref<any[]>([]);
const rowsFilter = ref<any>([]);
const rowsOrder = ref<any>([]);
const rowsOrder = ref<any[]>([]);
const myForm = ref<any>();
const files = ref<any>(null);