fix convertDate command
This commit is contained in:
parent
5450a034b7
commit
c91a08fc4d
4 changed files with 9 additions and 30 deletions
|
|
@ -28,6 +28,7 @@ const {
|
||||||
dialogConfirm,
|
dialogConfirm,
|
||||||
hideLoader,
|
hideLoader,
|
||||||
date2Thai,
|
date2Thai,
|
||||||
|
convertDateToAPI,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
const modal = defineModel<boolean>("modal", { required: true });
|
const modal = defineModel<boolean>("modal", { required: true });
|
||||||
|
|
@ -145,8 +146,8 @@ function onSubmit() {
|
||||||
showLoader();
|
showLoader();
|
||||||
const body = {
|
const body = {
|
||||||
commandTypeId: commandType.value,
|
commandTypeId: commandType.value,
|
||||||
commandAffectDate: commandAffectDate.value,
|
commandAffectDate: convertDateToAPI(commandAffectDate.value),
|
||||||
commandExcecuteDate: commandExcecuteDate.value,
|
commandExcecuteDate: convertDateToAPI(commandExcecuteDate.value),
|
||||||
commandYear: commandYear.value,
|
commandYear: commandYear.value,
|
||||||
commandNo: commandNo.value,
|
commandNo: commandNo.value,
|
||||||
persons: selected.value ? dataMapToSend.value : [],
|
persons: selected.value ? dataMapToSend.value : [],
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ const {
|
||||||
date2Thai,
|
date2Thai,
|
||||||
success,
|
success,
|
||||||
dialogConfirm,
|
dialogConfirm,
|
||||||
|
convertDateToAPI,
|
||||||
} = useCounterMixin();
|
} = useCounterMixin();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -70,7 +71,11 @@ async function onSubmit() {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.put(config.API.commandAction(commandId.value, "tab1"), formData)
|
.put(config.API.commandAction(commandId.value, "tab1"), {
|
||||||
|
...formData,
|
||||||
|
commandAffectDate: convertDateToAPI(formData.commandAffectDate),
|
||||||
|
commandExcecuteDate: convertDateToAPI(formData.commandExcecuteDate),
|
||||||
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await props.fetchDataCommandList();
|
await props.fetchDataCommandList();
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
|
|
||||||
|
|
@ -47,31 +47,6 @@ function checkCommandSysId() {
|
||||||
readonly.value = true;
|
readonly.value = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// const chechCommandCode = computed(() => {
|
|
||||||
// const listCommandCode = [
|
|
||||||
// "C-PM-01",
|
|
||||||
// "C-PM-02",
|
|
||||||
// "C-PM-03",
|
|
||||||
// "C-PM-04",
|
|
||||||
// "C-PM-05",
|
|
||||||
// "C-PM-07",
|
|
||||||
// "C-PM-08",
|
|
||||||
// "C-PM-09",
|
|
||||||
// "C-PM-21",
|
|
||||||
// "C-PM-22",
|
|
||||||
// "C-PM-24",
|
|
||||||
// "C-PM-29",
|
|
||||||
// "C-PM-38",
|
|
||||||
// "C-PM-39",
|
|
||||||
// ];
|
|
||||||
// if (listCommandCode.includes(props.commandCode)) {
|
|
||||||
// return true;
|
|
||||||
// } else {
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm($q, () => {
|
dialogConfirm($q, () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
|
||||||
|
|
@ -238,8 +238,6 @@ function onConfirmOrder() {
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await router.push(`/command/view/${commandId.value}`);
|
await router.push(`/command/view/${commandId.value}`);
|
||||||
// fetchData?.();
|
|
||||||
// isCheckAuthority.value = true;
|
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue