Merge branch 'develop' into devTee
This commit is contained in:
commit
fbe90fbdcc
8 changed files with 86 additions and 79 deletions
|
|
@ -226,6 +226,10 @@ watch(
|
|||
props?.dataNode?.orgLevel !== 0
|
||||
? props?.dataNode.orgTreeCode
|
||||
: undefined;
|
||||
formData.orgShortName =
|
||||
props?.dataNode?.orgLevel !== 0
|
||||
? props?.dataNode.orgTreeShortName
|
||||
: undefined;
|
||||
}
|
||||
|
||||
if (level.value === 0) {
|
||||
|
|
@ -340,6 +344,12 @@ function selectOrgLevele(val: string, status: boolean = true) {
|
|||
<div class="col-2">
|
||||
<q-input
|
||||
v-model="formData.orgShortName"
|
||||
:readonly="
|
||||
(actionType === 'ADD' &&
|
||||
props?.dataNode?.orgLevel !== 0 &&
|
||||
level !== 0) ||
|
||||
(actionType === 'EDIT' && props?.dataNode?.orgLevel > 1)
|
||||
"
|
||||
ref="orgShortNameRef"
|
||||
dense
|
||||
outlined
|
||||
|
|
|
|||
|
|
@ -282,7 +282,6 @@ const pagination = ref({
|
|||
<q-tree
|
||||
class="q-pa-md q-gutter-sm"
|
||||
dense
|
||||
default-expand-all
|
||||
selected-color="primary"
|
||||
:nodes="nodeTree"
|
||||
node-key="orgTreeId"
|
||||
|
|
|
|||
|
|
@ -79,13 +79,15 @@ function getData() {
|
|||
})
|
||||
.then((res) => {
|
||||
const dataList = res.data.result.data;
|
||||
console.log(dataList);
|
||||
|
||||
const dataMap = dataList.map((item: any) => ({
|
||||
id: item.id,
|
||||
name: `${item.orgShortname}${
|
||||
item.posMasterNoPrefix ? item.posMasterNoPrefix : ""
|
||||
}${item.posMasterNo ? item.posMasterNo : ""}${
|
||||
item.posMasterNoSuffix ? item.posMasterNoSuffix : ""
|
||||
}`,
|
||||
} ${item.fullNameNextHolder ? item.fullNameNextHolder : ""}`,
|
||||
posMasterNoPrefix: item.posMasterNoPrefix,
|
||||
posMasterNo: item.posMasterNo,
|
||||
posMasterNoSuffix: item.posMasterNoSuffix,
|
||||
|
|
|
|||
|
|
@ -1,16 +1,14 @@
|
|||
<script setup lang="ts">
|
||||
import { defineAsyncComponent, ref,onMounted } from "vue";
|
||||
import { defineAsyncComponent, ref, onMounted } from "vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const orderId_params = route.params.id;
|
||||
const orderId = ref<string>('')
|
||||
const orderId = ref<string>("");
|
||||
const step = ref<number>(0);
|
||||
const step01 = defineAsyncComponent(
|
||||
() => import("@/modules/13_salary/components/Command/step01.vue")
|
||||
|
|
@ -47,10 +45,9 @@ const previousStep = async () => {
|
|||
await http
|
||||
.put(config.API.prevStep(orderId.value))
|
||||
.then(() => {
|
||||
router.push(
|
||||
`/salary/command/detail/${orderId.value}?step=${step.value - 1}`
|
||||
);
|
||||
|
||||
router.push(
|
||||
`/salary/command/detail/${orderId.value}?step=${step.value - 1}`
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
|
|
@ -58,12 +55,12 @@ const previousStep = async () => {
|
|||
}
|
||||
};
|
||||
|
||||
function destroyLocalStorage(){
|
||||
function destroyLocalStorage() {
|
||||
localStorage.clear();
|
||||
};
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
destroyLocalStorage()
|
||||
destroyLocalStorage();
|
||||
if (route.query.step) {
|
||||
step.value = Number(route.query.step);
|
||||
localStorage.setItem("currentStep", step.value.toString());
|
||||
|
|
@ -155,4 +152,4 @@ onMounted(() => {
|
|||
.step .q-stepper__header--standard-labels .q-stepper__tab {
|
||||
min-height: 60px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -57,13 +57,13 @@ const salaryRoundOptionMain = ref<DataOption1[]>([]);
|
|||
const salaryRoundOption = ref<DataOption1[]>([]);
|
||||
|
||||
//Main
|
||||
const typeOrder = ref<any>([]);
|
||||
const typeOrder = ref<any>();
|
||||
const nameOrder = ref<any>("");
|
||||
const command = ref<number | "">();
|
||||
const dateYear = ref<number>(new Date().getFullYear());
|
||||
const dateCommand = ref<Date>(new Date());
|
||||
const dateYear = ref<number | null>(null);
|
||||
const dateCommand = ref<Date | null>(null);
|
||||
const byOrder = ref<string>("");
|
||||
const nameCommand = ref<any>([]);
|
||||
const nameCommand = ref<any>();
|
||||
const positionCommand = ref<string>("");
|
||||
const year = ref<number>(0);
|
||||
const SalaryRound = ref<string>("");
|
||||
|
|
@ -114,8 +114,6 @@ const commandCodes = ref<string[]>([
|
|||
]);
|
||||
// เรียกคำสั่ง
|
||||
const fecthTypeOption = async (actions: string) => {
|
||||
console.log(actions);
|
||||
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.typeOrder())
|
||||
|
|
@ -165,8 +163,6 @@ const fetchdetailOrder = async () => {
|
|||
.then(async (res: any) => {
|
||||
const data = res.data.result;
|
||||
|
||||
console.log(data);
|
||||
|
||||
const orderTypeCode = await data.orderTypeCode.toUpperCase();
|
||||
|
||||
typeOrder.value = typeOrderOption.value.find(
|
||||
|
|
@ -179,6 +175,7 @@ const fetchdetailOrder = async () => {
|
|||
byOrder.value = data.orderBy;
|
||||
nameCommand.value = data.signatoryBy;
|
||||
positionCommand.value = data.signatoryPosition;
|
||||
SalaryRound.value = data.salaryPeriodId;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -259,36 +256,36 @@ const submit = async () => {
|
|||
signatoryBy: signBy === "" ? nameCommand.value : signBy,
|
||||
signatoryPosition: positionCommand.value,
|
||||
year: year.value,
|
||||
period: SalaryRound.value,
|
||||
salaryPeriodId: SalaryRound.value,
|
||||
};
|
||||
if (
|
||||
typeOrder.value.commandCode == "C-PM-33" ||
|
||||
typeOrder.value.commandCode == "C-PM-34" ||
|
||||
typeOrder.value.commandCode == "C-PM-35"
|
||||
) {
|
||||
Object.assign(formdata, {
|
||||
// examRound: examRound.value,
|
||||
// conclusionRegisterNo: conclusionRegisterNo.value,
|
||||
// conclusionRegisterDate: conclusionRegisterDate.value,
|
||||
// conclusionResultNo: conclusionResultNo.value.toString(),
|
||||
// conclusionResultDate: conclusionResultDate.value,
|
||||
});
|
||||
}
|
||||
// if (
|
||||
// typeOrder.value.commandCode == "C-PM-33" ||
|
||||
// typeOrder.value.commandCode == "C-PM-34" ||
|
||||
// typeOrder.value.commandCode == "C-PM-35"
|
||||
// ) {
|
||||
// Object.assign(formdata, {
|
||||
// // examRound: examRound.value,
|
||||
// // conclusionRegisterNo: conclusionRegisterNo.value,
|
||||
// // conclusionRegisterDate: conclusionRegisterDate.value,
|
||||
// // conclusionResultNo: conclusionResultNo.value.toString(),
|
||||
// // conclusionResultDate: conclusionResultDate.value,
|
||||
// });
|
||||
// }
|
||||
|
||||
// เช็คค่าว่าง
|
||||
await myForm.value!.validate().then((result: boolean) => {
|
||||
if (result) {
|
||||
dialogConfirm($q, () => {
|
||||
// ถ้ามี orderId ให้ อัพเดท ไม่มีให้สร้าง
|
||||
if (!orderId) {
|
||||
createListOrder(formdata, typeOrder.value.commandCode);
|
||||
} else {
|
||||
let orderIdString = orderId.toString();
|
||||
updateOrder(formdata, orderIdString, typeOrder.value.commandCode);
|
||||
}
|
||||
});
|
||||
// await myForm.value!.validate().then((result: boolean) => {
|
||||
// if (result) {
|
||||
dialogConfirm($q, () => {
|
||||
// ถ้ามี orderId ให้ อัพเดท ไม่มีให้สร้าง
|
||||
if (!orderId) {
|
||||
createListOrder(formdata, typeOrder.value.commandCode);
|
||||
} else {
|
||||
let orderIdString = orderId.toString();
|
||||
updateOrder(formdata, orderIdString, typeOrder.value.commandCode);
|
||||
}
|
||||
});
|
||||
// }
|
||||
// });
|
||||
};
|
||||
|
||||
// สร้างคำสัง
|
||||
|
|
@ -370,8 +367,6 @@ function getClass(val: boolean) {
|
|||
};
|
||||
}
|
||||
|
||||
function updateYear() {}
|
||||
|
||||
/** ดึงข้อมูลเริ่มต้น */
|
||||
function fetchSalaryRound() {
|
||||
showLoader();
|
||||
|
|
@ -394,7 +389,6 @@ function fetchSalaryRound() {
|
|||
: "-",
|
||||
}));
|
||||
salaryRoundOptionMain.value = list;
|
||||
// salaryRoundOption.value = list;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -405,9 +399,9 @@ function fetchSalaryRound() {
|
|||
}
|
||||
</script>
|
||||
<template>
|
||||
<div style="max-height: 68vh; overflow-y: scroll">
|
||||
<!-- Main -->
|
||||
<q-form ref="myForm" class="q-pa-md">
|
||||
<q-form greedy @submit.prevent @validation-success="submit" class="q-pa-md">
|
||||
<div class="q-pa-md">
|
||||
<!-- Main -->
|
||||
<div class="row col-12 q-col-gutter-x-lg q-col-gutter-y-md">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<q-select
|
||||
|
|
@ -415,7 +409,7 @@ function fetchSalaryRound() {
|
|||
outlined
|
||||
dense
|
||||
v-model="typeOrder"
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกประเภทคำสั่ง'}`]"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกประเภทคำสั่ง'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ประเภทคำสั่ง'}`"
|
||||
map-options
|
||||
|
|
@ -424,6 +418,7 @@ function fetchSalaryRound() {
|
|||
option-value="id"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
lazy-rules
|
||||
@update:model-value="selectCMP(typeOrder)"
|
||||
@filter="(inputValue:any,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'typeOrderOption'
|
||||
|
|
@ -435,6 +430,7 @@ function fetchSalaryRound() {
|
|||
:class="getClass(true)"
|
||||
outlined
|
||||
autogrow
|
||||
lazy-rules
|
||||
dense
|
||||
v-model="nameOrder"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกคำสั่งเรื่อง'}`]"
|
||||
|
|
@ -448,9 +444,11 @@ function fetchSalaryRound() {
|
|||
:class="getClass(true)"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="command"
|
||||
hide-bottom-space
|
||||
:label="`${'คำสั่งเลขที่'}`"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกคำสั่งเลขที่'}`]"
|
||||
/>
|
||||
</div>
|
||||
<label class="col-1 flex justify-center items-center text-bold"
|
||||
|
|
@ -470,8 +468,9 @@ function fetchSalaryRound() {
|
|||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
lazy-rules
|
||||
class="inputgreen"
|
||||
:model-value="dateYear + 543"
|
||||
:model-value="dateYear !== null ? dateYear + 543 : null"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก พ.ศ.'}`]"
|
||||
:label="`${'พ.ศ.'}`"
|
||||
dense
|
||||
|
|
@ -502,6 +501,7 @@ function fetchSalaryRound() {
|
|||
<q-input
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
class="inputgreen"
|
||||
:model-value="
|
||||
dateCommand != null ? date2Thai(dateCommand) : null
|
||||
|
|
@ -536,6 +536,7 @@ function fetchSalaryRound() {
|
|||
:options="byOrderOption"
|
||||
option-value="id"
|
||||
use-input
|
||||
lazy-rules
|
||||
input-debounce="0"
|
||||
@update:model-value="(nameCommand = ''), (positionCommand = '')"
|
||||
@filter="(inputValue:any,
|
||||
|
|
@ -551,6 +552,7 @@ function fetchSalaryRound() {
|
|||
:class="getClass(true)"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="nameCommand"
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกผู้มีอำนาจลงนาม'}`]"
|
||||
hide-bottom-space
|
||||
|
|
@ -579,6 +581,7 @@ function fetchSalaryRound() {
|
|||
:class="getClass(true)"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="positionCommand"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งผู้มีอำนาจลงนาม'}`]"
|
||||
:label="`${'ตำแหน่งผู้มีอำนาจลงนาม'}`"
|
||||
|
|
@ -593,6 +596,7 @@ function fetchSalaryRound() {
|
|||
<q-input
|
||||
:class="getClass(true)"
|
||||
outlined
|
||||
lazy-rules
|
||||
dense
|
||||
v-model="nameCommand"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกผู้มีอำนาจลงนาม'}`]"
|
||||
|
|
@ -608,6 +612,7 @@ function fetchSalaryRound() {
|
|||
:class="getClass(true)"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="positionCommand"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งผู้มีอำนาจลงนาม'}`]"
|
||||
:label="`${'ตำแหน่งผู้มีอำนาจลงนาม'}`"
|
||||
|
|
@ -637,6 +642,7 @@ function fetchSalaryRound() {
|
|||
:model-value="year === 0 ? null : Number(year) + 543"
|
||||
:label="`${'ปีงบประมาณ'}`"
|
||||
class="inputgreen"
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกปีงบประมาณ'}`]"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
|
|
@ -665,22 +671,23 @@ function fetchSalaryRound() {
|
|||
option-value="id"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
map-value
|
||||
emit-value
|
||||
lazy-rules
|
||||
@filter="(inputValue:any,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'SalaryRound'
|
||||
) "
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</q-form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<q-separator />
|
||||
<div class="flex justify-end q-pa-sm q-gutter-sm">
|
||||
<q-btn unelevated label="บันทึก" color="public" @click="submit">
|
||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="flex justify-end q-pa-sm q-gutter-sm">
|
||||
<q-btn unelevated label="บันทึก" type="submit" color="public">
|
||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-form>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
|
|
|
|||
|
|
@ -5,25 +5,18 @@ import { useQuasar, type QTableProps } from "quasar";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import type {
|
||||
DataOption,
|
||||
DataOption1,
|
||||
} from "@/modules/10_order/interface/index/Main";
|
||||
|
||||
// import PopupHistory from "@/modules/10_order/components/PopupHistory.vue";
|
||||
import TableOrder from "@/modules/11_discipline/components/9_Order/TableOrder.vue";
|
||||
import type { DataOption1 } from "@/modules/10_order/interface/index/Main";
|
||||
|
||||
import { useOrderStore } from "@/modules/11_discipline/store/OrderStore";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useOrderPlacementDataStore } from "@/modules/10_order/store";
|
||||
|
||||
const rows = ref<any>([]);
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const mixin = useCounterMixin();
|
||||
const DataStore = useOrderPlacementDataStore();
|
||||
const stroe = useOrderStore();
|
||||
const { showLoader, hideLoader, messageError } = mixin;
|
||||
|
||||
/** pagination */
|
||||
const pagination = ref({
|
||||
descending: true,
|
||||
|
|
@ -159,8 +152,6 @@ async function fetchOrderlist() {
|
|||
);
|
||||
|
||||
stroe.fetchOrder(filterListOrder);
|
||||
|
||||
rows.value = stroe.mainData;
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -485,7 +476,7 @@ function redirectToPage(id: string, status: string) {
|
|||
for="table"
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:rows="stroe.rows"
|
||||
:filter="filterKeyword"
|
||||
row-key="subject"
|
||||
flat
|
||||
|
|
@ -508,7 +499,9 @@ function redirectToPage(id: string, status: string) {
|
|||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="redirectToPage(props.row.orderId, props.row.status)"
|
||||
@click="
|
||||
redirectToPage(props.row.orderId, props.row.orderStatusName)
|
||||
"
|
||||
>
|
||||
<div v-if="col.name === 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
|
|
|
|||
|
|
@ -278,7 +278,6 @@ watch(
|
|||
<q-tree
|
||||
class="q-pa-md q-gutter-sm"
|
||||
dense
|
||||
default-expand-all
|
||||
selected-color="primary"
|
||||
:nodes="nodeTree"
|
||||
node-key="orgTreeId"
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ function getData() {
|
|||
item.posMasterNoPrefix ? item.posMasterNoPrefix : ""
|
||||
}${item.posMasterNo ? item.posMasterNo : ""}${
|
||||
item.posMasterNoSuffix ? item.posMasterNoSuffix : ""
|
||||
}`,
|
||||
} ${item.fullNameNextHolder ? item.fullNameNextHolder : ""}`,
|
||||
posMasterNoPrefix: item.posMasterNoPrefix,
|
||||
posMasterNo: item.posMasterNo,
|
||||
posMasterNoSuffix: item.posMasterNoSuffix,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue