feat(resign): add commandType C-PM-48
This commit is contained in:
parent
baadd296cb
commit
f6f2c18d0f
1 changed files with 60 additions and 2 deletions
|
|
@ -5,10 +5,12 @@ import { useQuasar } from "quasar";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRetirementDataStore } from "@/modules/06_retirement/store/Main";
|
||||
import { useRoleWorkflowDataStore } from "@/stores/roleWorkflow";
|
||||
import { useCommandMainStore } from "@/modules/18_command/store/Main";
|
||||
|
||||
import type { PropType } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
|
||||
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";
|
||||
|
|
@ -16,6 +18,7 @@ import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCom
|
|||
/** use */
|
||||
const $q = useQuasar();
|
||||
const stroe = useRetirementDataStore();
|
||||
const storeCommand = useCommandMainStore();
|
||||
const { fetchDataCheckIsoffice } = useRoleWorkflowDataStore();
|
||||
const { statusText } = stroe;
|
||||
const selected = ref<ResponseItems[]>([]);
|
||||
|
|
@ -47,6 +50,10 @@ const props = defineProps({
|
|||
cancel: { type: Boolean, default: false },
|
||||
});
|
||||
|
||||
const commandType = ref<string>("");
|
||||
const commandMainOp = ref<ListCommand[]>([]); //ข้อมูลรายการคำสั่ง
|
||||
const commandOp = ref<ListCommand[]>([]); //ตัวเลือกคำสั่ง
|
||||
|
||||
//Table
|
||||
const filterKeyword = defineModel<string>("filterKeyword", { required: true });
|
||||
const rowsData = ref<ResponseItems[]>([]);
|
||||
|
|
@ -169,6 +176,11 @@ const visibleColumns = ref<string[]>([
|
|||
]);
|
||||
|
||||
const modalCommand = ref<boolean>(false);
|
||||
const isDisable = computed(() => {
|
||||
return props.mainTabs === "1"
|
||||
? selected.value.length === 0 || commandType.value === ""
|
||||
: selected.value.length === 0;
|
||||
});
|
||||
|
||||
/** popup ยืนยันส่งัว */
|
||||
function saveOrder() {
|
||||
|
|
@ -210,6 +222,19 @@ async function fetchCheckOfficer() {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟิลเตอร์ คำสั่ง
|
||||
* @param val ค่าจาก Input
|
||||
* @param update Funtion quasar
|
||||
*/
|
||||
function filterSelector(val: string, update: Function) {
|
||||
update(() => {
|
||||
commandOp.value = commandMainOp.value.filter(
|
||||
(v: ListCommand) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.modal,
|
||||
async (val) => {
|
||||
|
|
@ -231,6 +256,11 @@ watch(
|
|||
|
||||
rowsData.value = data ? data : [];
|
||||
rowsDataMain.value = data ? data : [];
|
||||
commandType.value = "";
|
||||
const dataCommandTypes = await storeCommand.getCommandTypes();
|
||||
commandMainOp.value = dataCommandTypes.filter(
|
||||
(e: ListCommand) => e.code === "C-PM-17" || e.code === "C-PM-48"
|
||||
);
|
||||
} else {
|
||||
rowsData.value = [];
|
||||
rowsDataMain.value = [];
|
||||
|
|
@ -238,6 +268,7 @@ watch(
|
|||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<q-dialog v-model="props.modal" persistent>
|
||||
<q-card style="min-width: 85%">
|
||||
|
|
@ -249,6 +280,33 @@ watch(
|
|||
<q-card-section>
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<div class="col-12 row">
|
||||
<q-select
|
||||
v-if="props.mainTabs === '1'"
|
||||
v-model="commandType"
|
||||
dense
|
||||
outlined
|
||||
label="ประเภทคำสั่ง"
|
||||
:options="commandOp"
|
||||
option-label="name"
|
||||
option-value="code"
|
||||
emit-value
|
||||
map-options
|
||||
use-input
|
||||
hide-selected
|
||||
fill-input
|
||||
@update:model-value="onSearch"
|
||||
@filter="(inputValue:string,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn
|
||||
) "
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
<q-space />
|
||||
<q-input
|
||||
borderless
|
||||
|
|
@ -332,7 +390,7 @@ watch(
|
|||
<q-btn
|
||||
label="ส่งไปออกคำสั่ง"
|
||||
@click="saveOrder"
|
||||
:disable="selected.length === 0"
|
||||
:disable="isDisable"
|
||||
color="public"
|
||||
/>
|
||||
</q-card-actions>
|
||||
|
|
@ -341,7 +399,7 @@ watch(
|
|||
|
||||
<DialogCreateCommand
|
||||
v-model:modal="modalCommand"
|
||||
:command-type-code="props.mainTabs === '1' ? 'C-PM-17' : 'C-PM-41'"
|
||||
:command-type-code="props.mainTabs === '1' ? commandType : 'C-PM-41'"
|
||||
:persons="dataMapToSend"
|
||||
:fetch-data="props.fecthList"
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue