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

@ -3,8 +3,6 @@ import { ref, watchEffect } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import type { QTableProps } from "quasar";
import type { ResponseRow } from "@/modules/05_placement/interface/response/Receive";
@ -12,19 +10,14 @@ import type { ResponseRow } from "@/modules/05_placement/interface/response/Rece
import { useTransferDataStore } from "@/modules/05_placement/store";
import DialogHeader from "@/components/DialogHeader.vue";
import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue";
const transferStore = useTransferDataStore();
const { statusText } = transferStore;
const $q = useQuasar();
const selected = ref<ResponseRow[]>([]);
const mixin = useCounterMixin();
const {
showLoader,
success,
messageError,
dialogConfirm,
hideLoader,
date2Thai,
} = mixin;
const { dialogConfirm, date2Thai } = mixin;
/**
* props
@ -128,54 +121,33 @@ const visibleColumns2 = ref<string[]>([
"status",
]);
/**
* งกนยนยนการสงออกคำส
*/
const modalCommand = ref<boolean>(false); ///
/** ฟังก์ชันยืนยันการส่งออกคำสั่ง*/
function saveOrder() {
dialogConfirm(
$q,
async () => {
const id = selected.value.map((r: ResponseRow) => r.id);
const body = {
id,
};
showLoader();
await http
.post(config.API.receiveReport, body)
.then(async () => {
await props.fecthlistRecevice?.();
success($q, "ส่งไปออกคำสั่งรับโอนสำเร็จ");
props.clickClose?.();
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
});
props?.clickClose?.();
modalCommand.value = true;
},
"ยืนยันส่งไปออกคำสั่ง",
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
);
}
/**
* งกนอปเดทคาในชองคนหา
*/
function updateInput(value: any) {
/** ฟังก์ชันอัปเดทค่าในช่องค้นหา*/
function updateInput(value: string) {
emit("update:filterKeyword2", value);
}
/**
* งกนรเซตคาในชองคนหา
*/
/** ฟังก์ชันรีเซ็ตค่าในช่องค้นหา*/
function onReset() {
emit("update:filterKeyword2", "");
}
/**
* เม props.modal เป true
*
* กำหนดให selected เปนคาวาง
*/
watchEffect(() => {
@ -334,4 +306,10 @@ watchEffect(() => {
</q-card-actions>
</q-card>
</q-dialog>
<DialogCreateCommand
v-model:modal="modalCommand"
:command-type-code="'C-PM-14'"
:persons-id="selected.map((r) => r.id)"
/>
</template>