ปรับ ออกคำสั่ง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-09-01 11:15:18 +07:00
parent cf8bdb7ce0
commit 46f4173524
3 changed files with 111 additions and 34 deletions

View file

@ -247,10 +247,10 @@ const fecthTypeOption = async (actions: string) => {
messageError($q, e);
})
.finally(async () => {
await fecthCommand();
if (actions == "hasData") {
await fetchdetailOrder();
}
await fecthCommand();
hideLoader();
});
};
@ -260,6 +260,8 @@ const fetchdetailOrder = async () => {
await http
.get(config.API.detailOrder(orderIdString))
.then((res: any) => {
console.log(res);
const data = res.data.result;
console.log(data);
typeOrder.value = typeOrderOption.value.find(
@ -336,7 +338,7 @@ const fetchdetailOrder = async () => {
messageError($q, e);
})
.finally(async () => {
await fecthCommand();
// await fecthCommand();
hideLoader();
});
};
@ -344,6 +346,8 @@ const fecthCommand = async () => {
await http
.get(config.API.organizationsOrder())
.then((res: any) => {
console.log(res);
byOrderOption.value = res.data.result;
})
.catch((e: any) => {
@ -412,12 +416,15 @@ const fecthExamRoundOption = async (commandCode: string) => {
};
const submit = async () => {
console.log(nameCommand.value);
console.log(CommandOption.value);
let signBy = null;
if (!nameCommand.value.length) {
signBy = await nameCommand.value.name;
} else {
const name2 = await CommandOption.value.find(
(x: any) => x.id == nameCommand.value.id
(x: any) => x.name == nameCommand.value
);
signBy = await name2?.name;
console.log("signBy", signBy);
@ -437,7 +444,7 @@ const submit = async () => {
orderBy: byOrder.value,
orderByOrganizationName: orderByOrganizationName,
registerPosition: "",
signatoryBy: signBy,
signatoryBy: signBy === "" ? nameCommand.value : signBy,
signatoryPosition: positionCommand.value,
};
if (
@ -525,7 +532,7 @@ const submit = async () => {
});
}
console.log(formdata);
// console.log(formdata);
await myForm.value!.validate().then((result: boolean) => {
if (result) {
@ -564,6 +571,7 @@ const updateOrder = async (formData: Object, orderId: string, type: string) => {
.put(config.API.orderCPMUpdate(type, orderId), formData)
.then((res) => {
console.log(res);
next();
success($q, "บันทึกข้อมูลสำเร็จ");
})