แก้ให้ file เป็นว่างได้
This commit is contained in:
parent
bf5b67ee36
commit
3ebc2714cc
1 changed files with 11 additions and 13 deletions
|
|
@ -88,20 +88,16 @@ const fileUploadDoc = async (file: any) => {
|
|||
|
||||
const saveResing = () => {
|
||||
$q.dialog({
|
||||
title: "ยืนยันการยื่นข้อมูลแบบสอบถาม",
|
||||
message: "ต้องการยื่นข้อมูลแบบสอบถามนี้ใช่หรือไม่?",
|
||||
title: "ยืนยันการยื่นข้อมูลลาออก",
|
||||
message: "ต้องการยื่นข้อมูลลาออกนี้ใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
if (files.value == undefined) {
|
||||
fails($q, "กรุณากรอกอัพโหลดเอกสารเพิ่มเติม")
|
||||
} else {
|
||||
createFormresign()
|
||||
}
|
||||
.onOk(() => {
|
||||
createFormresign()
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {})
|
||||
|
|
@ -147,15 +143,17 @@ const deleteResting = async (id: string) => {
|
|||
//บันทึกข้อมูล
|
||||
const createFormresign = async () => {
|
||||
const formData = new FormData()
|
||||
const blob = files.value.slice(0, files.value[0].size)
|
||||
const newFile = new File(blob, nameFile.value, {
|
||||
type: files.value[0].type,
|
||||
})
|
||||
|
||||
// const blob = files.value.slice(0, files.value[0].size)
|
||||
// const newFile = new File(blob, nameFile.value, {
|
||||
// type: files.value[0].type,
|
||||
// })
|
||||
|
||||
formData.append("Location", tranferOrg.value)
|
||||
formData.append("SendDate", dateToISO(dateCommand.value))
|
||||
formData.append("ActiveDate", dateToISO(dateLeave.value))
|
||||
formData.append("Reason", noteReason.value)
|
||||
formData.append("file", newFile)
|
||||
formData.append("file", files.value)
|
||||
await http
|
||||
.post(config.API.listResign(), formData)
|
||||
.then((res: any) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue