refactor ออกคำสั่ง
This commit is contained in:
parent
8dfa5ca02e
commit
3802d5d5a2
8 changed files with 526 additions and 916 deletions
|
|
@ -187,7 +187,7 @@ const listModal = async (id: string) => {
|
|||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
// เช็คค่า orderid
|
||||
const conditionId = async () => {
|
||||
const id = route.params.orderid
|
||||
? route.params.orderid.toString()
|
||||
|
|
@ -198,7 +198,7 @@ const conditionId = async () => {
|
|||
await getData(id);
|
||||
}
|
||||
};
|
||||
|
||||
// เรียก้อมูลใน Table
|
||||
const getData = async (id: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -214,7 +214,6 @@ const getData = async (id: string) => {
|
|||
if (r.inboxChannel) {
|
||||
selectCopyOrder.push(2);
|
||||
}
|
||||
|
||||
list.push({
|
||||
personalId: r.personalId ?? "",
|
||||
name: r.name ?? "",
|
||||
|
|
@ -243,7 +242,7 @@ const getData = async (id: string) => {
|
|||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
// เลือกราชชื่อจากหน่วยงาน
|
||||
const saveData = async () => {
|
||||
const id = route.params.orderid
|
||||
? route.params.orderid.toString()
|
||||
|
|
@ -281,7 +280,7 @@ const getClass = (val: boolean) => {
|
|||
const clickClose = async () => {
|
||||
modal.value = false;
|
||||
};
|
||||
|
||||
// เปิด popup เพิ่มข้อมูล
|
||||
const clickAdd = async () => {
|
||||
await nodeTree();
|
||||
selected.value = "";
|
||||
|
|
@ -292,11 +291,11 @@ const clickAdd = async () => {
|
|||
myForm.value.reset();
|
||||
}
|
||||
};
|
||||
|
||||
// ยืนยันการลบข้อมูล
|
||||
const clickDelete = (id: string) => {
|
||||
dialogRemove($q, () => deleteData(id));
|
||||
};
|
||||
|
||||
// โหลดโครงสร้าง tree
|
||||
const nodeTree = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -315,11 +314,11 @@ const nodeTree = async () => {
|
|||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
// เลือกหน่วยงาน
|
||||
const onSelected = async (id: string) => {
|
||||
await listModal(id);
|
||||
};
|
||||
|
||||
// ลบข้อมูลราชชื่อ
|
||||
const deleteData = async (id: string) => {
|
||||
await http
|
||||
.delete(config.API.copyOrderId(id))
|
||||
|
|
@ -334,7 +333,7 @@ const deleteData = async (id: string) => {
|
|||
await conditionId();
|
||||
});
|
||||
};
|
||||
|
||||
// บันทึกข้อมูล step 3
|
||||
const saveDataCopyOrder = async () => {
|
||||
if (myForm.value !== null) {
|
||||
myForm.value.validate().then(async (result: boolean) => {
|
||||
|
|
@ -344,7 +343,7 @@ const saveDataCopyOrder = async () => {
|
|||
});
|
||||
}
|
||||
};
|
||||
|
||||
// บันทึกข้อมูล step 3 API
|
||||
const fetchSaveCopyOrder = async () => {
|
||||
let list: RequestCopyOrder[] = [];
|
||||
rows.value.map((r: DataCopyOrder) => {
|
||||
|
|
@ -522,12 +521,8 @@ const updateData = (row: DataCopyOrder) => {
|
|||
color="public"
|
||||
@click="saveDataCopyOrder"
|
||||
class="q-px-md"
|
||||
><!-- icon="mdi-content-save-outline"
|
||||
<q-tooltip>บันทึก</q-tooltip> -->
|
||||
>
|
||||
</q-btn>
|
||||
<!-- <q-btn flat round color="primary" icon="chevron_right" @click="next">
|
||||
<q-tooltip>ต่อไป</q-tooltip>
|
||||
</q-btn> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -626,20 +621,6 @@ const updateData = (row: DataCopyOrder) => {
|
|||
</template>
|
||||
|
||||
<template v-slot:body-selection="scope">
|
||||
<!-- <q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
:model-value="scope.selected"
|
||||
@update:model-value="
|
||||
(val, evt) => {
|
||||
Object.getOwnPropertyDescriptor(scope, 'selected').set(
|
||||
val,
|
||||
evt
|
||||
);
|
||||
}
|
||||
"
|
||||
/> -->
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
|
|
@ -665,15 +646,6 @@ const updateData = (row: DataCopyOrder) => {
|
|||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<!-- <q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
icon="mdi-content-save-outline"
|
||||
@click="clickClose"
|
||||
>
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
</q-btn> -->
|
||||
<q-btn
|
||||
dense
|
||||
unelevated
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue