ออกคำสั่ง === fix filter
This commit is contained in:
parent
8ede2c6d09
commit
810115eb41
13 changed files with 227 additions and 2517 deletions
|
|
@ -5,7 +5,6 @@ import { useQuasar, type QTableProps } from "quasar";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useRoute } from "vue-router";
|
||||
import { usePosSalaryDataStore } from "@/modules/18_command/store/PosSalary";
|
||||
import { useCommandDetail } from "@/modules/18_command/store/DetailStore";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
|
|
@ -21,8 +20,6 @@ import DialogSalary from "@/modules/18_command/components/Step/Dialog2_Salary.vu
|
|||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const commandId = ref<string>(route.params.id.toString()); //ID คำสั่ง
|
||||
|
||||
const storePosSalary = usePosSalaryDataStore();
|
||||
const store = useCommandDetail();
|
||||
const {
|
||||
dialogConfirm,
|
||||
|
|
@ -42,6 +39,7 @@ const props = defineProps({
|
|||
});
|
||||
|
||||
const ListCommandSalary = ref<ListCommandSalaryType[]>([]);
|
||||
const ListCommandSalaryMain = ref<ListCommandSalaryType[]>([]);
|
||||
|
||||
let selectPersonData = reactive<PersonInfo>({
|
||||
id: "",
|
||||
|
|
@ -58,7 +56,6 @@ let selectPersonData = reactive<PersonInfo>({
|
|||
mouthSalaryAmount: 0,
|
||||
});
|
||||
const commandReciveId = ref<string>(""); //เก็บ id commandReciveId
|
||||
const posNoOptions = ref<DataOption[]>(storePosSalary.optionPos);
|
||||
const templatePos = ref<string>("");
|
||||
const position = ref<string>("");
|
||||
|
||||
|
|
@ -120,7 +117,7 @@ const modalPerson = ref<boolean>(false);
|
|||
* @param val
|
||||
*/
|
||||
function updatePos(val: string) {
|
||||
const data = ListCommandSalary.value.find(
|
||||
const data = ListCommandSalaryMain.value.find(
|
||||
(item: ListCommandSalaryType) => item.id === val
|
||||
);
|
||||
if (data) {
|
||||
|
|
@ -183,7 +180,7 @@ function filterSelector(val: string, update: Function, filtername: string) {
|
|||
switch (filtername) {
|
||||
case "pos":
|
||||
update(() => {
|
||||
posNoOptions.value = storePosSalary.optionPos.filter(
|
||||
ListCommandSalary.value = ListCommandSalaryMain.value.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
|
|
@ -222,6 +219,7 @@ async function getCommandSalaryList(type: string) {
|
|||
.get(config.API.commandSalaryList(type))
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
ListCommandSalaryMain.value = data;
|
||||
ListCommandSalary.value = data;
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -279,11 +277,13 @@ onMounted(async () => {
|
|||
option-value="id"
|
||||
hide-bottom-space
|
||||
use-input
|
||||
hide-selected
|
||||
fill-input
|
||||
emit-value
|
||||
map-options
|
||||
input-debounce="0"
|
||||
@update:modelValue="updatePos"
|
||||
@filter="(inputValue: any,
|
||||
@filter="(inputValue: string,
|
||||
doneFn: Function) => filterSelector(inputValue, doneFn, 'pos'
|
||||
)"
|
||||
/>
|
||||
|
|
@ -327,16 +327,9 @@ onMounted(async () => {
|
|||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filter == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filter !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="filter = ''"
|
||||
/>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
<!-- แสดงคอลัมน์ใน table -->
|
||||
|
|
|
|||
|
|
@ -219,17 +219,10 @@ onMounted(() => {
|
|||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
class="q-ml-sm"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filter == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filter !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click.prevent="filter = ''"
|
||||
/>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
<!-- แสดงคอลัมน์ใน table -->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue