UI => ส่งคนไประบบออกคำสั่ง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-09-27 15:59:13 +07:00
parent 3ca0390b87
commit fc75e315f5
19 changed files with 816 additions and 842 deletions

View file

@ -2,42 +2,23 @@
import { ref, computed, watch } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useTransferDataStore } from "@/modules/05_placement/store";
/**
* impportType
*/
/** impportType*/
import type { QTableProps } from "quasar";
import type { officerType } from "@/modules/05_placement/interface/response/officer";
/**
* importComponents
*/
/** importComponents*/
import DialogHeader from "@/components/DialogHeader.vue";
/**
* importStore
*/
import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue";
const $q = useQuasar();
const { statusText } = useTransferDataStore();
const mixin = useCounterMixin();
const {
showLoader,
success,
messageError,
dialogConfirm,
hideLoader,
findPosMasterNoOld,
date2Thai,
} = mixin;
const { dialogConfirm, findPosMasterNoOld, date2Thai } = mixin;
/**
* props
*/
/** props*/
const props = defineProps({
Modal: Boolean,
closeModal: Function,
@ -47,9 +28,7 @@ const props = defineProps({
});
const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
/**
* table
*/
//table
const selected = ref<officerType[]>([]);
const columns2 = ref<QTableProps["columns"]>([
{
@ -155,41 +134,22 @@ const visibleColumns2 = ref<string[]>([
"status",
]);
/**
* chech การเลอกรายชอสงตวกล
*/
const modalCommand = ref<boolean>(false); ///
/** chech การเลือกรายชื่อส่งตัวกลับ*/
const checkSelected = computed(() => {
if (selected.value.length === 0) {
return true;
}
});
/**
* นยนการสงออกคำสงสงตวกล
*/
/** ยืนยันการส่งออกคำสั่งส่งตัวกลับ*/
function saveOrder() {
dialogConfirm(
$q,
async () => {
const id = selected.value.map((item) => item.id);
const body = {
id,
};
showLoader();
await http
.post(config.API.repatriationMainReport(), body)
.then(async () => {
await props.getData?.();
await success($q, "ส่งไปออกคำสั่งส่งตัวกลับสำเร็จ");
props.closeModal?.();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
props.closeModal?.();
modalCommand.value = true;
},
"ยืนยันส่งไปออกคำสั่ง",
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
@ -204,9 +164,7 @@ function updateInput(value: string | number | null) {
emit("update:filterKeyword2", value);
}
/**
* เซตคาในชองคนหา
*/
/** รีเซ็ตค่าในช่องค้นหา*/
function Reset() {
emit("update:filterKeyword2", "");
}
@ -330,4 +288,10 @@ watch(
</q-card-actions>
</q-card>
</q-dialog>
<DialogCreateCommand
v-model:modal="modalCommand"
:command-type-code="'C-PM-16'"
:persons-id="selected.map((r) => r.id)"
/>
</template>