แก้โค้ดตาม issue

This commit is contained in:
STW_TTTY\stwtt 2024-07-09 10:39:49 +07:00
parent 3968d2b1a0
commit bb6afbb98e
12 changed files with 323 additions and 252 deletions

View file

@ -15,6 +15,11 @@ import { useDevelopmentDataStore } from "@/modules/15_development/store/developm
import http from "@/plugins/http";
import config from "@/app.config";
const other1 = ref<boolean>(false);
const other2 = ref<boolean>(false);
const otherInput1 = ref<string>("");
const otherInput2 = ref<string>("");
const $q = useQuasar();
const store = useDevelopmentDataStore();
const route = useRoute();
@ -161,7 +166,9 @@ async function onSubmit() {
projectModal: formData.projectModal,
isBackPlanned: formData.isBackPlanned,
isHoldPlanned: formData.isHoldPlanned,
projectDayBackPlanned: formData.isBackPlanned ? formData.projectDayBackPlanned:null,
projectDayBackPlanned: formData.isBackPlanned
? formData.projectDayBackPlanned
: null,
projectDayHoldPlanned: formData.projectDayHoldPlanned,
projectNigthHoldPlanned: formData.projectNigthHoldPlanned,
developmentProjectTechniquePlanneds:
@ -206,6 +213,15 @@ function updateSelected(data: DataStrategic, type: string) {
}
}
function checkOther(type: number, val: boolean) {
if(val == false){
if(type == 1){
otherInput1.value = ''
}else if(type == 2){
otherInput2.value = ''
}
}
}
/** ดึงข้อมูลเมื่อคอมโพเนนต์โหลดเสร็จสมบูรณ์ */
onMounted(() => {
fetchData();
@ -232,7 +248,6 @@ onMounted(() => {
/>
</div>
<q-card bordered class="col-12 q-my-sm">
<div
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-3 q-py-xs q-px-md"
@ -285,7 +300,9 @@ onMounted(() => {
<q-item
clickable
@click.stop="updateSelected(prop.node, '1')"
:active="formData.strategyChildPlannedId == prop.node.id"
:active="
formData.strategyChildPlannedId == prop.node.id
"
active-class="my-list-link text-primary text-weight-medium"
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
>
@ -448,7 +465,29 @@ onMounted(() => {
type="checkbox"
/>
</div>
<div class="col-12 q-mb-lg">
<div class="row">
<div class="col-4 relative-position">
<div class="other_custom">
<q-checkbox
v-model="other1"
label="อื่นๆ"
size="sm"
color="primary"
keep-color
:disable="store.projectStatus === 'FINISH'"
@update:model-value="checkOther(1, other1)"
/>
</div>
</div>
<div class="col-8 relative-position">
<div class="other_custom_input" v-if="other1 == true">
<q-input v-model="otherInput1" dense outlined label="กรุณากรอก อื่นๆ"></q-input>
</div>
</div>
</div>
</div>
<div class="col-12 col-sm-6 col-md-4">
<q-input
:disable="store.projectStatus === 'FINISH'"
@ -534,6 +573,28 @@ onMounted(() => {
type="checkbox"
/>
</div>
<div class="col-12 q-mb-lg">
<div class="row">
<div class="col-4 relative-position">
<div class="other_custom">
<q-checkbox
v-model="other2"
label="อื่นๆ"
size="sm"
color="primary"
keep-color
@update:model-value="checkOther(2, other2)"
/>
</div>
</div>
<div class="col-8 relative-position">
<div class="other_custom_input" v-if="other2 == true">
<q-input v-model="otherInput2" dense outlined label="กรุณากรอก อื่นๆ"></q-input>
</div>
</div>
</div>
</div>
<div class="col-12 col-sm-6 col-md-4">
<q-input
dense
@ -573,4 +634,14 @@ onMounted(() => {
font-weight: 600;
border: 1px solid rgba(175, 185, 196, 0.217);
}
.other_custom {
position: absolute;
left: -7px;
top: -29px;
}
.other_custom_input {
position: absolute;
top: -25px;
width: 100%;
}
</style>