ออกคำสั่ง => คำสั้งปรับโครงสร้าง
This commit is contained in:
parent
dc079e31fd
commit
e9367dea5c
7 changed files with 94 additions and 30 deletions
|
|
@ -221,6 +221,7 @@ const fetchdetailOrder = async () => {
|
|||
const data = res.data.result;
|
||||
|
||||
const orderTypeCode = await data.orderTypeCode.toUpperCase();
|
||||
DataStore.typeOrder = orderTypeCode;
|
||||
await optionsData(orderTypeCode);
|
||||
|
||||
typeOrder.value = typeOrderOption.value.find(
|
||||
|
|
@ -378,6 +379,7 @@ const optionsData = async (commandCode: string) => {
|
|||
const selectCMP = async (selectOrder: OrederResult) => {
|
||||
if (selectOrder != null) {
|
||||
const orderTypeCode = await selectOrder.commandCode.toUpperCase();
|
||||
DataStore.typeOrder = orderTypeCode;
|
||||
optionsData(orderTypeCode);
|
||||
}
|
||||
//01-04
|
||||
|
|
@ -638,7 +640,7 @@ const createListOrder = async (formData: Object, type: string) => {
|
|||
showLoader();
|
||||
await http
|
||||
.post(config.API.orderCPM(type), formData)
|
||||
.then((res) => {
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
localStorage.setItem("orderId", data.id);
|
||||
|
||||
|
|
@ -646,17 +648,17 @@ const createListOrder = async (formData: Object, type: string) => {
|
|||
route.name == "disciplineOrderDatail" ||
|
||||
route.name == "disciplineOrderAdd"
|
||||
) {
|
||||
router.push(
|
||||
`/discipline-order/detail/${data.id}?step=${
|
||||
type == "C-PM-38" ? 3 : 2
|
||||
}`
|
||||
); // สร้างเสร็จแล้วให้ไป Step 2
|
||||
router.push(`/discipline-order/detail/${data.id}?step=${2}`); // สร้างเสร็จแล้วให้ไป Step 2
|
||||
} else {
|
||||
router.push(
|
||||
`/order/detail/${data.id}?step=${type == "C-PM-38" ? 3 : 2}`
|
||||
); // สร้างเสร็จแล้วให้ไป Step 2
|
||||
router.push(`/order/detail/${data.id}?step=${2}`); // สร้างเสร็จแล้วให้ไป Step 2
|
||||
}
|
||||
next();
|
||||
if (DataStore.typeOrder === "C-PM-38") {
|
||||
await next();
|
||||
await next();
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -671,7 +673,12 @@ const updateOrder = async (formData: Object, orderId: string, type: string) => {
|
|||
await http
|
||||
.put(config.API.orderCPMUpdate(type, orderId), formData)
|
||||
.then(() => {
|
||||
next(); // แก้ไขเสร็จแล้วให้ไป Step 2
|
||||
if (DataStore.typeOrder === "C-PM-38") {
|
||||
next();
|
||||
next();
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue