ออกคำสั่ง
This commit is contained in:
parent
73c41d9b01
commit
671c7103ab
7 changed files with 86 additions and 61 deletions
|
|
@ -15,7 +15,14 @@ import DialogPerview from "@/modules/18_command/components/Step/Dialog1_Perview.
|
|||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const store = useCommandDetail();
|
||||
const { showLoader, hideLoader, messageError, date2Thai } = useCounterMixin();
|
||||
const {
|
||||
showLoader,
|
||||
hideLoader,
|
||||
messageError,
|
||||
date2Thai,
|
||||
success,
|
||||
dialogConfirm,
|
||||
} = useCounterMixin();
|
||||
|
||||
/**
|
||||
* props
|
||||
|
|
@ -60,19 +67,22 @@ async function fetchCheckIdofficer() {
|
|||
* และกำหนด isChangeData เป็น false
|
||||
*/
|
||||
async function onSubmit() {
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.commandAction(commandId.value, "tab1"), formData)
|
||||
.then(() => {
|
||||
props.fetchDataCommandList();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
isChangeData.value = false;
|
||||
});
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.commandAction(commandId.value, "tab1"), formData)
|
||||
.then(async () => {
|
||||
await props.fetchDataCommandList();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
isChangeData.value = false;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -87,7 +97,9 @@ onMounted(() => {
|
|||
formData.issue = props.formCommandList.issue;
|
||||
formData.commandAffectDate = props.formCommandList.commandAffectDate;
|
||||
formData.commandExcecuteDate = props.formCommandList.commandExcecuteDate;
|
||||
formData.isBangkok = props.formCommandList.isBangkok;
|
||||
formData.isBangkok = !isIdofficer.value
|
||||
? null
|
||||
: props.formCommandList.isBangkok;
|
||||
fetchCheckIdofficer();
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue