เพิ่มเงื่อนไข questionnair

This commit is contained in:
AnandaTon 2023-08-25 12:09:22 +07:00
parent faae150483
commit 961a548c48

View file

@ -11,7 +11,7 @@ const route = useRoute()
const router = useRouter()
const $q = useQuasar()
const mixin = useCounterMixin()
const { date2Thai, dateToISO, success, messageError, showLoader, hideLoader } = mixin
const { date2Thai, dateToISO, success, messageError, showLoader, hideLoader, notifyError } = mixin
const leaveReason = ref("")
const id = ref<string>("")
const noteReason = ref("")
@ -105,20 +105,39 @@ const adjust_option = ref<any>([
{ label: "อื่น ๆ (ระบุ) ", value: 15 },
])
const saveForm = () => {
$q.dialog({
title: "ยืนยันข้อมูลแบบสอบถาม",
message: "ต้องการส่งข้อมูลแบบสอบถามนี้ใช่หรือไม่?",
cancel: {
flat: true,
color: "negative",
},
persistent: true,
})
.onOk(async () => {
createResult()
let hasError = false
if (
reasonWork.value === 0 ||
timeThink.value === 0 ||
exitFactor.value === 0 ||
adjust.value === 0 ||
realReason.value.length < 1 ||
notExitFactor.value.length < 1 ||
haveJob.value === null ||
suggestFriends.value === null ||
futureWork.value === null ||
suggestion.value.length < 1
) {
hasError = true
} else {
$q.dialog({
title: "ยืนยันข้อมูลแบบสอบถาม",
message: "ต้องการส่งข้อมูลแบบสอบถามนี้ใช่หรือไม่?",
cancel: {
flat: true,
color: "negative",
},
persistent: true,
})
.onCancel(() => {})
.onDismiss(() => {})
.onOk(async () => {
createResult()
})
.onCancel(() => {})
.onDismiss(() => {})
}
if (hasError === true) {
notifyError($q, "กรุณากรอกข้อมูลให้ครบ")
}
}
// const putData = () => {