Merge branch 'nice_dev' into develop
This commit is contained in:
commit
90c640ab9f
2 changed files with 39 additions and 18 deletions
|
|
@ -73,6 +73,12 @@ export default {
|
|||
|
||||
salaryPeriodStatusEmp: (type: string, periodId: string, rootId: string) =>
|
||||
`${salaryPeriodEmp}/${type}/approve/${periodId}/${rootId}`,
|
||||
salaryPeriodStatusCommentEmp: (type: string, periodId: string, rootId: string) =>
|
||||
`${salaryPeriodEmp}/${type}/comment/${periodId}/${rootId}`,
|
||||
salaryPeriodStatusCommentEmp: (
|
||||
type: string,
|
||||
periodId: string,
|
||||
rootId: string
|
||||
) => `${salaryPeriodEmp}/${type}/comment/${periodId}/${rootId}`,
|
||||
|
||||
salaryUploadFile: (name: string, group: string, id: string, subId: string) =>
|
||||
`${salary}/file/${name}/${group}/${id}/${subId}`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ const props = defineProps({
|
|||
});
|
||||
|
||||
const sendStep = ref<number>(1);
|
||||
const fileUpload = ref<any>(null);
|
||||
const fileUpload = ref<any[]>([]);
|
||||
const document = ref<string>("");
|
||||
const type = ref<string>("");
|
||||
/**
|
||||
|
|
@ -29,27 +29,41 @@ const type = ref<string>("");
|
|||
* @param event file
|
||||
*/
|
||||
async function uploadFile(event: any) {
|
||||
console.log(event);
|
||||
const fileName = event.map((e: any) => ({ fileName: e.name }));
|
||||
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
const selectedFile = event;
|
||||
const formdata = new FormData();
|
||||
formdata.append("Document", selectedFile);
|
||||
// await http
|
||||
// .put(config.API.uploadfileOnlyInsignia(requestId.value), formdata)
|
||||
// .then(async () => {
|
||||
// await fecthInsigniaByOc(
|
||||
// round.value,
|
||||
// DataStore.agency,
|
||||
// "officer",
|
||||
// tab.value
|
||||
// );
|
||||
// success($q, "อัปโหลดไฟล์สำเร็จ");
|
||||
// fileUpload.value = null;
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// messageError($q, err);
|
||||
// }),
|
||||
http
|
||||
.post(
|
||||
config.API.salaryUploadFile(
|
||||
"ระบบเงินเดือน",
|
||||
"เลื่อนค่าจ้าง",
|
||||
props.periodId ? props.periodId : "",
|
||||
props.rootId ? props.rootId : ""
|
||||
),
|
||||
{
|
||||
replace: false, //อัพทับที่เดิมไหม
|
||||
fileList: fileName,
|
||||
}
|
||||
)
|
||||
.then(async () => {
|
||||
// await fecthInsigniaByOc(
|
||||
// round.value,
|
||||
// DataStore.agency,
|
||||
// "officer",
|
||||
// tab.value
|
||||
// );
|
||||
// success($q, "อัปโหลดไฟล์สำเร็จ");
|
||||
// fileUpload.value = null;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
},
|
||||
"ยืนยันการอัปโหลดไฟล์",
|
||||
"ต้องการยืนยันการอัปโหลดไฟล์นี้หรือไม่ ?"
|
||||
|
|
@ -141,6 +155,7 @@ function sendAndRecommend(title: string, typeOrder: string) {
|
|||
v-model="fileUpload"
|
||||
accept=".pdf"
|
||||
label="อัปโหลดไฟล์"
|
||||
multiple
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon color="light-blue" name="attach_file" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue