แก้ เงื่อนไข fix bug
This commit is contained in:
parent
0bbf5cde0b
commit
855b4b6be8
3 changed files with 56 additions and 31 deletions
|
|
@ -40,6 +40,7 @@
|
||||||
label="เอกสารเพิ่มเติม"
|
label="เอกสารเพิ่มเติม"
|
||||||
type="file"
|
type="file"
|
||||||
@added="fileUploadDoc"
|
@added="fileUploadDoc"
|
||||||
|
@removed="filesNull"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -87,6 +88,10 @@ onMounted(() => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const filesNull = () => {
|
||||||
|
files.value = null
|
||||||
|
}
|
||||||
|
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
console.log(myform.value)
|
console.log(myform.value)
|
||||||
if (myform.value != null) {
|
if (myform.value != null) {
|
||||||
|
|
@ -109,12 +114,14 @@ const saveTransfer = () => {
|
||||||
persistent: true,
|
persistent: true,
|
||||||
})
|
})
|
||||||
.onOk(async () => {
|
.onOk(async () => {
|
||||||
createTransfer()
|
if (files.value == undefined) {
|
||||||
|
fails($q, "กรุณากรอกอัพโหลดเอกสารเพิ่มเติม")
|
||||||
|
} else {
|
||||||
|
createTransfer()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.onCancel(() => {})
|
.onCancel(() => {})
|
||||||
.onDismiss(() => {
|
.onDismiss(() => {})
|
||||||
fails($q, "กรุณากรอกอัพโหลดเอกสารเพิ่มเติม")
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const createTransfer = async () => {
|
const createTransfer = async () => {
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,7 @@
|
||||||
label="เอกสารเพิ่มเติม"
|
label="เอกสารเพิ่มเติม"
|
||||||
type="file"
|
type="file"
|
||||||
@added="fileUploadDoc"
|
@added="fileUploadDoc"
|
||||||
|
@removed="filesNull"
|
||||||
style="max-width: px"
|
style="max-width: px"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -155,6 +156,7 @@
|
||||||
{{ dataDetail.oligarchRejectDate !== null ? date2Thai(dataDetail.oligarchRejectDate) : "-" }}
|
{{ dataDetail.oligarchRejectDate !== null ? date2Thai(dataDetail.oligarchRejectDate) : "-" }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{ files }}
|
||||||
<div class="col-xs-12 row items-start">
|
<div class="col-xs-12 row items-start">
|
||||||
<div class="col-12 text-top">ความคิดเห็นและเหตุผล</div>
|
<div class="col-12 text-top">ความคิดเห็นและเหตุผล</div>
|
||||||
<div class="col-12 text-detail" v-if="dataDetail.oligarchReject == false">
|
<div class="col-12 text-detail" v-if="dataDetail.oligarchReject == false">
|
||||||
|
|
@ -240,6 +242,10 @@ const statusOrder = (val: boolean) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const filesNull = () => {
|
||||||
|
files.value = null
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (route.params.id !== undefined) {
|
if (route.params.id !== undefined) {
|
||||||
id.value = route.params.id.toString()
|
id.value = route.params.id.toString()
|
||||||
|
|
@ -258,6 +264,13 @@ const saveData = async () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const fileUploadDoc = async (file: any) => {
|
||||||
|
fileDocDataUpload.value.push(file)
|
||||||
|
nameFile.value = file[0].name
|
||||||
|
files.value = file
|
||||||
|
console.log(files.value)
|
||||||
|
}
|
||||||
|
|
||||||
const saveResing = () => {
|
const saveResing = () => {
|
||||||
$q.dialog({
|
$q.dialog({
|
||||||
title: "ยืนยันการยื่นข้อมูลแบบสอบถาม",
|
title: "ยืนยันการยื่นข้อมูลแบบสอบถาม",
|
||||||
|
|
@ -269,11 +282,18 @@ const saveResing = () => {
|
||||||
persistent: true,
|
persistent: true,
|
||||||
})
|
})
|
||||||
.onOk(async () => {
|
.onOk(async () => {
|
||||||
createFormresign()
|
console.log("ok")
|
||||||
|
if (files.value == undefined) {
|
||||||
|
fails($q, "กรุณากรอกอัพโหลดเอกสารเพิ่มเติม")
|
||||||
|
} else {
|
||||||
|
createFormresign()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.onCancel(() => {
|
||||||
|
console.log("test")
|
||||||
})
|
})
|
||||||
.onCancel(() => {})
|
|
||||||
.onDismiss(() => {
|
.onDismiss(() => {
|
||||||
fails($q, "กรุณากรอกอัพโหลดเอกสารเพิ่มเติม")
|
console.log("dis")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -361,10 +381,4 @@ const fectDataresign = async (id: string) => {
|
||||||
hideLoader()
|
hideLoader()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const fileUploadDoc = async (file: any) => {
|
|
||||||
fileDocDataUpload.value.push(file)
|
|
||||||
nameFile.value = file[0].name
|
|
||||||
files.value = file
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ const adjust = ref<any>([])
|
||||||
const timeThink = ref<any>([])
|
const timeThink = ref<any>([])
|
||||||
const realReason = ref<any>("")
|
const realReason = ref<any>("")
|
||||||
const notExitFactor = ref<any>("")
|
const notExitFactor = ref<any>("")
|
||||||
const haveJob = ref<any>("")
|
const haveJob = ref<any>([])
|
||||||
const suggestFriends = ref<any>([])
|
const suggestFriends = ref<any>([])
|
||||||
const futureWork = ref<any>([])
|
const futureWork = ref<any>([])
|
||||||
const suggestion = ref<any>("")
|
const suggestion = ref<any>("")
|
||||||
|
|
@ -105,24 +105,28 @@ const adjust_option = ref<any>([
|
||||||
{ label: "อื่น ๆ (ระบุ) ", value: 15 },
|
{ label: "อื่น ๆ (ระบุ) ", value: 15 },
|
||||||
])
|
])
|
||||||
const saveForm = () => {
|
const saveForm = () => {
|
||||||
|
console.log(reasonWork.value.filter((x: any) => x == 12))
|
||||||
|
console.log(reasonWork.value)
|
||||||
|
console.log(haveJob.value.length)
|
||||||
|
|
||||||
let hasError = false
|
let hasError = false
|
||||||
if (
|
if (
|
||||||
(reasonWork.value === 0 &&
|
reasonWork.value.length === 0 ||
|
||||||
reasonWorkOther.value.length < 1) ||
|
(reasonWork.value.filter((x: any) => x == 12).length > 0 && (reasonWorkOther.value == null || reasonWorkOther.value == "")) ||
|
||||||
timeThink.value === 0 ||
|
timeThink.value.length === 0 ||
|
||||||
(exitFactor.value === 0 &&
|
exitFactor.value.length === 0 ||
|
||||||
exitFactorOther.value.length < 1) ||
|
(exitFactor.value.filter((x: any) => x == 15).length > 0 && (exitFactorOther.value == null || exitFactorOther.value == "")) ||
|
||||||
(adjust.value === 0 &&
|
adjust.value.length === 0 ||
|
||||||
adjustOther.value.length < 1 ) ||
|
(adjust.value.filter((x: any) => x == 15).length > 0 && (adjustOther.value == null || adjustOther.value == "")) ||
|
||||||
realReason.value.length < 1 ||
|
realReason.value.length < 1 ||
|
||||||
notExitFactor.value.length < 1 ||
|
notExitFactor.value.length < 1 ||
|
||||||
(haveJob.value === null &&
|
haveJob.value.length === 0 ||
|
||||||
haveJobReason.value.length < 1 )||
|
(haveJob.value === 0 && (haveJobReason.value == null || haveJobReason.value == "")) ||
|
||||||
(suggestFriends.value === null &&
|
suggestFriends.value.length === 0 ||
|
||||||
suggestFriendsReason.value.length < 1) ||
|
(suggestFriends.value === 1 && (suggestFriendsReason.value == null || suggestFriendsReason.value == "")) ||
|
||||||
(futureWork.value === null &&
|
futureWork.value.length === 0 ||
|
||||||
futureWorkReason.value.length < 1 )||
|
(futureWork.value === 1 && (futureWorkReason.value == null || futureWorkReason.value == "")) ||
|
||||||
suggestion.value.length < 1
|
suggestion.value.length < 1
|
||||||
) {
|
) {
|
||||||
hasError = true
|
hasError = true
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -185,7 +189,7 @@ const createResult = async () => {
|
||||||
SuggestFriendsReason: suggestFriendsReason.value,
|
SuggestFriendsReason: suggestFriendsReason.value,
|
||||||
FutureWork: futureWork.value,
|
FutureWork: futureWork.value,
|
||||||
FutureWorkReason: futureWorkReason.value,
|
FutureWorkReason: futureWorkReason.value,
|
||||||
Suggestion:suggestion.value
|
Suggestion: suggestion.value,
|
||||||
}
|
}
|
||||||
await http
|
await http
|
||||||
.post(config.API.listquestionnaire(), data)
|
.post(config.API.listquestionnaire(), data)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue