updated develop form
This commit is contained in:
parent
03c41dae6c
commit
bdffdc1abf
10 changed files with 1052 additions and 137 deletions
|
|
@ -25,6 +25,10 @@ const projectId = ref<string>(route.params.id.toLocaleString());
|
|||
const checkRoutePermission = ref<boolean>(
|
||||
route.name == "developmentDetailPage"
|
||||
);
|
||||
const props = defineProps({
|
||||
prevStep: { type: Function, required: true },
|
||||
});
|
||||
|
||||
const status = defineModel<string>("status", { required: true });
|
||||
const provinceOp = ref<DataOption[]>([]);
|
||||
const provinceOpMain = ref<DataOption[]>([]);
|
||||
|
|
@ -211,39 +215,40 @@ function onClickDeleteLocation(index: number) {
|
|||
|
||||
/** บันทึกข้อมูล */
|
||||
function onSubmit() {
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
formData.totalDate = Number(formData.totalDate);
|
||||
formData.accept =
|
||||
typeof formData.accept === "string"
|
||||
? Number(formData.accept.replace(/,/g, ""))
|
||||
: formData.accept;
|
||||
formData.receive =
|
||||
typeof formData.receive === "string"
|
||||
? Number(formData.receive.replace(/,/g, ""))
|
||||
: formData.receive;
|
||||
formData.approved =
|
||||
typeof formData.approved === "string"
|
||||
? Number(formData.approved.replace(/,/g, ""))
|
||||
: formData.approved;
|
||||
formData.budgetPay =
|
||||
typeof formData.budgetPay === "string"
|
||||
? Number(formData.budgetPay.replace(/,/g, ""))
|
||||
: formData.budgetPay;
|
||||
// dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
formData.totalDate = Number(formData.totalDate);
|
||||
formData.accept =
|
||||
typeof formData.accept === "string"
|
||||
? Number(formData.accept.replace(/,/g, ""))
|
||||
: formData.accept;
|
||||
formData.receive =
|
||||
typeof formData.receive === "string"
|
||||
? Number(formData.receive.replace(/,/g, ""))
|
||||
: formData.receive;
|
||||
formData.approved =
|
||||
typeof formData.approved === "string"
|
||||
? Number(formData.approved.replace(/,/g, ""))
|
||||
: formData.approved;
|
||||
formData.budgetPay =
|
||||
typeof formData.budgetPay === "string"
|
||||
? Number(formData.budgetPay.replace(/,/g, ""))
|
||||
: formData.budgetPay;
|
||||
|
||||
http
|
||||
.put(config.API.developmentMainTab("tab5", projectId.value), formData)
|
||||
.then(() => {
|
||||
fetchData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
http
|
||||
.put(config.API.developmentMainTab("tab5", projectId.value), formData)
|
||||
.then(() => {
|
||||
// fetchData();
|
||||
// success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
props.prevStep();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
// });
|
||||
}
|
||||
|
||||
/** ดึงข้อมูลเมื่อคอมโพเนนต์โหลดเสร็จสมบูรณ์ */
|
||||
|
|
@ -423,7 +428,7 @@ onMounted(() => {
|
|||
</div>
|
||||
<div class="col-4">
|
||||
<q-select
|
||||
:readonly="checkRoutePermission"
|
||||
:readonly="checkRoutePermission"
|
||||
outlined
|
||||
dense
|
||||
v-model="formData.budget"
|
||||
|
|
@ -534,7 +539,7 @@ onMounted(() => {
|
|||
</div>
|
||||
<div class="col-3">
|
||||
<q-select
|
||||
:readonly="checkRoutePermission"
|
||||
:readonly="checkRoutePermission"
|
||||
outlined
|
||||
dense
|
||||
class="inputgreen"
|
||||
|
|
@ -631,17 +636,30 @@ onMounted(() => {
|
|||
>
|
||||
</div>
|
||||
</div>
|
||||
<q-separator v-if="!checkRoutePermission"/>
|
||||
<div class="text-right q-pa-sm" v-if="!checkRoutePermission">
|
||||
<q-separator />
|
||||
<div class="text-center q-pa-sm" v-if="!checkRoutePermission">
|
||||
<q-btn
|
||||
unelevated
|
||||
label="บันทึก"
|
||||
rounded
|
||||
label="ก่อนหน้า"
|
||||
icon="mdi-chevron-left"
|
||||
id="onSubmit"
|
||||
type="submit"
|
||||
color="public"
|
||||
class="q-px-md"
|
||||
class="q-mr-xs"
|
||||
style="width: 120px"
|
||||
>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
disabled
|
||||
rounded
|
||||
label="ถัดไป"
|
||||
icon-right="mdi-chevron-right"
|
||||
id="onSubmit"
|
||||
type="submit"
|
||||
color="public"
|
||||
class="q-ml-xs"
|
||||
style="width: 120px"
|
||||
>
|
||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-form>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue