UI => ส่งคนไประบบออกคำสั่ง
This commit is contained in:
parent
3ca0390b87
commit
fc75e315f5
19 changed files with 816 additions and 842 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue