Merge branch 'nice_dev' into develop
This commit is contained in:
commit
e945bb6da5
5 changed files with 118 additions and 36 deletions
|
|
@ -22,6 +22,7 @@ export default {
|
||||||
orgPosType: `${orgPos}/type`,
|
orgPosType: `${orgPos}/type`,
|
||||||
orgPosLevel: `${orgPos}/level`,
|
orgPosLevel: `${orgPos}/level`,
|
||||||
orgPosMaster: `${orgPos}/master`,
|
orgPosMaster: `${orgPos}/master`,
|
||||||
|
orgPosMasterById: (id: string) => `${orgPos}/master/${id}`,
|
||||||
orgPosMasterList: `${orgPos}/master/list`,
|
orgPosMasterList: `${orgPos}/master/list`,
|
||||||
orgPosSort: `${orgPos}/sort`,
|
orgPosSort: `${orgPos}/sort`,
|
||||||
organizationShortName: `${organization}/sort`,
|
organizationShortName: `${organization}/sort`,
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import type {
|
||||||
OptionExecutive,
|
OptionExecutive,
|
||||||
DataPosition,
|
DataPosition,
|
||||||
} from "@/modules/02_organizationalNew/interface/response/organizational";
|
} from "@/modules/02_organizationalNew/interface/response/organizational";
|
||||||
|
import type { FilterMaster } from "@/modules/02_organizationalNew/interface/request/organizational";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
|
|
@ -28,8 +29,11 @@ const props = defineProps({
|
||||||
orgLevel: Number,
|
orgLevel: Number,
|
||||||
treeId: String,
|
treeId: String,
|
||||||
actionType: String,
|
actionType: String,
|
||||||
|
rowId: String,
|
||||||
|
fetchDataTable: Function,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const reqMaster = defineModel<FilterMaster>("reqMaster", { required: true });
|
||||||
const isReadonly = ref<boolean>(false); // อ่านได้อย่างเดียว
|
const isReadonly = ref<boolean>(false); // อ่านได้อย่างเดียว
|
||||||
const isDisValidate = ref<boolean>(false);
|
const isDisValidate = ref<boolean>(false);
|
||||||
|
|
||||||
|
|
@ -216,7 +220,11 @@ async function fetchPosition(id: string) {
|
||||||
await http
|
await http
|
||||||
.get(config.API.orgPosPositionById(id))
|
.get(config.API.orgPosPositionById(id))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log(res);
|
const data = res.data.result;
|
||||||
|
formData.prefixNo = data.posMasterNoPrefix;
|
||||||
|
formData.positionNo = data.posMasterNo;
|
||||||
|
formData.suffixNo = data.posMasterNoSuffix;
|
||||||
|
rows.value = data.positions;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -346,18 +354,42 @@ function onSubmit() {
|
||||||
positions: positionsData,
|
positions: positionsData,
|
||||||
};
|
};
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
props.actionType === "ADD"
|
||||||
.post(config.API.orgPosMaster, body)
|
? await http
|
||||||
.then((res) => {
|
.post(config.API.orgPosMaster, body)
|
||||||
success($q, "เพิ่มข้อมูลสำเร็จ");
|
.then(() => {
|
||||||
})
|
success($q, "เพิ่มข้อมูลสำเร็จ");
|
||||||
.catch((err) => {
|
props.fetchDataTable?.(
|
||||||
messageError($q, err);
|
reqMaster.value.id,
|
||||||
})
|
reqMaster.value.type,
|
||||||
.finally(() => {
|
false
|
||||||
props.close?.();
|
);
|
||||||
hideLoader();
|
})
|
||||||
});
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
props.close?.();
|
||||||
|
hideLoader();
|
||||||
|
})
|
||||||
|
: props.rowId &&
|
||||||
|
(await http
|
||||||
|
.put(config.API.orgPosMasterById(props.rowId), body)
|
||||||
|
.then(() => {
|
||||||
|
success($q, "แก้ไขข้อมูลสำเร็จ");
|
||||||
|
props.fetchDataTable?.(
|
||||||
|
reqMaster.value.id,
|
||||||
|
reqMaster.value.type,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
props.close?.();
|
||||||
|
hideLoader();
|
||||||
|
}));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/** ฟังชั่น บันทึก */
|
/** ฟังชั่น บันทึก */
|
||||||
|
|
@ -411,7 +443,6 @@ async function searchInput() {
|
||||||
`?keyword=${search.value}&type=${type.value}`
|
`?keyword=${search.value}&type=${type.value}`
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log(res);
|
|
||||||
rowsPositionSelect.value = res.data.result;
|
rowsPositionSelect.value = res.data.result;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -462,7 +493,7 @@ watch(
|
||||||
rows.value = [];
|
rows.value = [];
|
||||||
clearFormPositionSelect();
|
clearFormPositionSelect();
|
||||||
} else {
|
} else {
|
||||||
// props.treeId && fetchPosition(props.treeId);
|
props.rowId && fetchPosition(props.rowId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -487,7 +518,7 @@ function deletePos(id: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.delete(config.API.orgPosPositionById(id))
|
.delete(config.API.orgPosPositionById(id))
|
||||||
.then((res) => {
|
.then(() => {
|
||||||
success($q, "ลบข้อมูลสำเร็จ");
|
success($q, "ลบข้อมูลสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
|
||||||
|
|
@ -203,6 +203,7 @@ watch(
|
||||||
v-model:reqMaster="reqMaster"
|
v-model:reqMaster="reqMaster"
|
||||||
v-model:totalPage="totalPage"
|
v-model:totalPage="totalPage"
|
||||||
v-model:posMaster="posMaster"
|
v-model:posMaster="posMaster"
|
||||||
|
:fetchDataTable="fetchDataTable"
|
||||||
:filterKeyword="filterKeyword"
|
:filterKeyword="filterKeyword"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch } from "vue";
|
import { ref } from "vue";
|
||||||
|
import { useQuasar } from "quasar";
|
||||||
|
import config from "@/app.config";
|
||||||
|
import http from "@/plugins/http";
|
||||||
|
|
||||||
/** importType*/
|
/** importType*/
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
|
|
@ -14,11 +17,22 @@ import type { PosMaster2 } from "@/modules/02_organizationalNew/interface/respon
|
||||||
import DialogFormPosotion from "@/modules/02_organizationalNew/components/DialogFormPosition.vue";
|
import DialogFormPosotion from "@/modules/02_organizationalNew/components/DialogFormPosition.vue";
|
||||||
import DialogPositionDetail from "@/modules/02_organizationalNew/components/PositionDetail.vue";
|
import DialogPositionDetail from "@/modules/02_organizationalNew/components/PositionDetail.vue";
|
||||||
import DialogSort from "@/modules/02_organizationalNew/components/DialogSortPosition.vue";
|
import DialogSort from "@/modules/02_organizationalNew/components/DialogSortPosition.vue";
|
||||||
|
|
||||||
/** importStore*/
|
/** importStore*/
|
||||||
import { useOrganizational } from "@/modules/02_organizationalNew/store/organizational";
|
import { useOrganizational } from "@/modules/02_organizationalNew/store/organizational";
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
|
const { showLoader, hideLoader, messageError, success, dialogRemove } =
|
||||||
|
useCounterMixin();
|
||||||
|
const $q = useQuasar();
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
filterKeyword: { type: Function, require: true, default: () => {} },
|
filterKeyword: { type: Function, require: true, default: () => {} },
|
||||||
|
fetchDataTable: {
|
||||||
|
type: Function,
|
||||||
|
require: true,
|
||||||
|
default: () => {},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const dataSort = ref<Array<any>>([]);
|
const dataSort = ref<Array<any>>([]);
|
||||||
|
|
@ -35,18 +49,24 @@ const stroe = useOrganizational();
|
||||||
const filter = ref<string>("");
|
const filter = ref<string>("");
|
||||||
const actionType = ref<string>("");
|
const actionType = ref<string>("");
|
||||||
const listMenu = ref<ListMenu[]>([
|
const listMenu = ref<ListMenu[]>([
|
||||||
{
|
|
||||||
label: "ดูรายละเอียด",
|
|
||||||
icon: "mdi-eye",
|
|
||||||
type: "VIEWDETIAL",
|
|
||||||
color: "primary",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: "แก้ไข",
|
label: "แก้ไข",
|
||||||
icon: "edit",
|
icon: "edit",
|
||||||
type: "EDIT",
|
type: "EDIT",
|
||||||
color: "primary",
|
color: "primary",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: "ลบ",
|
||||||
|
icon: "delete",
|
||||||
|
type: "DEL",
|
||||||
|
color: "red",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "ดูรายละเอียด",
|
||||||
|
icon: "mdi-eye",
|
||||||
|
type: "VIEWDETIAL",
|
||||||
|
color: "blue",
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
const document = ref<any>([
|
const document = ref<any>([
|
||||||
{
|
{
|
||||||
|
|
@ -194,7 +214,9 @@ const columnsExpand = ref<QTableProps["columns"]>([
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const dialogPosition = ref<boolean>(false);
|
const dialogPosition = ref<boolean>(false);
|
||||||
function onClickPosition(type: string) {
|
const rowId = ref<string>("");
|
||||||
|
function onClickPosition(type: string, id: string) {
|
||||||
|
rowId.value = id;
|
||||||
actionType.value = type;
|
actionType.value = type;
|
||||||
dialogPosition.value = !dialogPosition.value;
|
dialogPosition.value = !dialogPosition.value;
|
||||||
}
|
}
|
||||||
|
|
@ -204,6 +226,24 @@ function onClickViewDetail() {
|
||||||
dialogDetail.value = !dialogDetail.value;
|
dialogDetail.value = !dialogDetail.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onClickDelete(id: string) {
|
||||||
|
dialogRemove($q, async () => {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.delete(config.API.orgPosMasterById(id))
|
||||||
|
.then(() => {
|
||||||
|
success($q, "ลบข้อมูลสำเร็จ");
|
||||||
|
props.fetchDataTable?.(reqMaster.value.id, reqMaster.value.type, false);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function onClickSort() {
|
function onClickSort() {
|
||||||
modalSort.value = true;
|
modalSort.value = true;
|
||||||
}
|
}
|
||||||
|
|
@ -223,7 +263,7 @@ function updatePagination(newPagination: NewPagination) {
|
||||||
dense
|
dense
|
||||||
color="primary"
|
color="primary"
|
||||||
icon="add"
|
icon="add"
|
||||||
@click="onClickPosition('ADD')"
|
@click="onClickPosition('ADD', '')"
|
||||||
>
|
>
|
||||||
<q-tooltip>เพิ่มตำแหน่ง</q-tooltip>
|
<q-tooltip>เพิ่มตำแหน่ง</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
@ -352,7 +392,9 @@ function updatePagination(newPagination: NewPagination) {
|
||||||
item.type === 'VIEWDETIAL'
|
item.type === 'VIEWDETIAL'
|
||||||
? onClickViewDetail()
|
? onClickViewDetail()
|
||||||
: item.type === 'EDIT'
|
: item.type === 'EDIT'
|
||||||
? onClickPosition('EDIT')
|
? onClickPosition('EDIT', props.row.id)
|
||||||
|
: item.type === 'DEL'
|
||||||
|
? onClickDelete(props.row.id)
|
||||||
: null
|
: null
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
|
@ -466,11 +508,14 @@ function updatePagination(newPagination: NewPagination) {
|
||||||
:orgLevel="orgLevel"
|
:orgLevel="orgLevel"
|
||||||
:treeId="treeId"
|
:treeId="treeId"
|
||||||
:actionType="actionType"
|
:actionType="actionType"
|
||||||
|
:rowId="rowId"
|
||||||
|
v-model:reqMaster="reqMaster"
|
||||||
|
:fetchDataTable="props.fetchDataTable"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- รายละเอียดตำแหน่ง -->
|
<!-- รายละเอียดตำแหน่ง -->
|
||||||
<DialogPositionDetail v-model:position-detail="dialogDetail" />
|
<DialogPositionDetail v-model:position-detail="dialogDetail" />
|
||||||
<DialogSort v-model:sort-position="modalSort"/>
|
<DialogSort v-model:sort-position="modalSort" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -246,9 +246,11 @@ onMounted(async () => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="row q-col-gutter-sm q-pa-sm">
|
<div class="row q-col-gutter-sm q-pa-sm">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-banner class="text-weight-bold text-red-14 bg-red-1 text-center rounded-borders">
|
<q-banner
|
||||||
|
class="text-weight-bold text-red-14 bg-red-1 text-center rounded-borders"
|
||||||
|
>
|
||||||
<div class="text-weight-bold">
|
<div class="text-weight-bold">
|
||||||
<q-icon name="info_outline" color="red-14" size="24px" />
|
<q-icon name="info_outline" color="red-14" size="24px" />
|
||||||
ประกาศเมื่อวันที่ {{ AnnouncementStartDate }} ถึงวันที่
|
ประกาศเมื่อวันที่ {{ AnnouncementStartDate }} ถึงวันที่
|
||||||
|
|
@ -272,7 +274,9 @@ onMounted(async () => {
|
||||||
separator
|
separator
|
||||||
>
|
>
|
||||||
<q-item clickable v-ripple>
|
<q-item clickable v-ripple>
|
||||||
<q-item-section class="text-grey-9">{{ file.fileName }}</q-item-section>
|
<q-item-section class="text-grey-9">{{
|
||||||
|
file.fileName
|
||||||
|
}}</q-item-section>
|
||||||
<q-item-section avatar>
|
<q-item-section avatar>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -294,7 +298,7 @@ onMounted(async () => {
|
||||||
icon="mdi-clipboard-outline"
|
icon="mdi-clipboard-outline"
|
||||||
@click="copyLink(file.pathName)"
|
@click="copyLink(file.pathName)"
|
||||||
>
|
>
|
||||||
<q-tooltip>คัดลอกลิ้งค์</q-tooltip>
|
<q-tooltip>คัดลอกลิ้งก์</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -305,7 +309,9 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-card bordered style="border: 1px solid #d6dee1">
|
<q-card bordered style="border: 1px solid #d6dee1">
|
||||||
<div class="text-weight-medium row col-12 bg-grey-1 q-py-sm q-px-md items-center">
|
<div
|
||||||
|
class="text-weight-medium row col-12 bg-grey-1 q-py-sm q-px-md items-center"
|
||||||
|
>
|
||||||
<div>บันทึกแจ้งผลการประกาศคัดเลือก</div>
|
<div>บันทึกแจ้งผลการประกาศคัดเลือก</div>
|
||||||
<q-space />
|
<q-space />
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -337,9 +343,7 @@ onMounted(async () => {
|
||||||
lazy-rules
|
lazy-rules
|
||||||
accept=".pdf"
|
accept=".pdf"
|
||||||
:rules="
|
:rules="
|
||||||
download10Url === ''
|
download10Url === '' ? [(val) => !!val || 'กรุณาเลือกไฟล์'] : []
|
||||||
? [(val) => !!val || 'กรุณาเลือกไฟล์']
|
|
||||||
: []
|
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
|
|
@ -361,7 +365,7 @@ onMounted(async () => {
|
||||||
</q-card>
|
</q-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12" v-if="store.currentStep == 5" >
|
<div class="col-12" v-if="store.currentStep == 5">
|
||||||
<div class="q-mr-sm" align="right">
|
<div class="q-mr-sm" align="right">
|
||||||
<q-btn
|
<q-btn
|
||||||
unelevated
|
unelevated
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue