แก้ questionnair
This commit is contained in:
parent
9be585065b
commit
b3edfb9d4f
2 changed files with 21 additions and 16 deletions
|
|
@ -38,7 +38,7 @@ export default [
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: "/leave/result",
|
path: "/leave/result/:id",
|
||||||
name: "resultLeave",
|
name: "resultLeave",
|
||||||
component: ResultQuestionair,
|
component: ResultQuestionair,
|
||||||
meta: {
|
meta: {
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,16 @@ import { useCounterMixin } from "@/stores/mixin"
|
||||||
import http from "@/plugins/http"
|
import http from "@/plugins/http"
|
||||||
import config from "@/app.config"
|
import config from "@/app.config"
|
||||||
|
|
||||||
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const $q = useQuasar()
|
const $q = useQuasar()
|
||||||
const mixin = useCounterMixin()
|
const mixin = useCounterMixin()
|
||||||
const { date2Thai, dateToISO, success, messageError, showLoader, hideLoader } = mixin
|
const { date2Thai, dateToISO, success, messageError, showLoader, hideLoader } = mixin
|
||||||
const leaveReason = ref("")
|
const leaveReason = ref("")
|
||||||
|
const id = ref<string>("")
|
||||||
const noteReason = ref("")
|
const noteReason = ref("")
|
||||||
const routeName = router.currentRoute.value.name
|
const routeName = router.currentRoute.value.name
|
||||||
|
const questionId = route.params.id.toString()
|
||||||
|
|
||||||
const saveForm = () => {
|
const saveForm = () => {
|
||||||
$q.dialog({
|
$q.dialog({
|
||||||
|
|
@ -32,21 +35,23 @@ const saveForm = () => {
|
||||||
.onDismiss(() => {})
|
.onDismiss(() => {})
|
||||||
}
|
}
|
||||||
|
|
||||||
const createResult = async () => {
|
const createResult = async (questionId: string) => {
|
||||||
// const formData = new FormData()
|
const formData = new FormData()
|
||||||
// // formData.append("Location", tranferOrg.value)
|
console.log(formData)
|
||||||
// // formData.append("SendDate", dateToISO(dateCommand.value))
|
|
||||||
// await http
|
formData.append("Location", leaveReason.value)
|
||||||
// .post(config.API.listResign(), formData)
|
formData.append("SendDate", noteReason.value)
|
||||||
// .then((res: any) => {
|
await http
|
||||||
// // console.log(res);
|
.post(config.API.questionnaireByid(questionId), formData)
|
||||||
// success($q, "บันทึกข้อมูลสำเร็จ")
|
.then((res: any) => {
|
||||||
// router.push(`/leave`)
|
// console.log(res);
|
||||||
// })
|
success($q, "บันทึกข้อมูลสำเร็จ")
|
||||||
// .catch((e: any) => {
|
router.push(`/leave`)
|
||||||
// messageError($q, e)
|
})
|
||||||
// console.log(e)
|
.catch((e: any) => {
|
||||||
// })
|
messageError($q, e)
|
||||||
|
console.log(e)
|
||||||
|
})
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ")
|
success($q, "บันทึกข้อมูลสำเร็จ")
|
||||||
router.push(`/leave`)
|
router.push(`/leave`)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue