updated portfolio

This commit is contained in:
Warunee Tamkoo 2024-06-27 18:15:20 +07:00
parent cad424140e
commit 080ef0b4e8
5 changed files with 63 additions and 50 deletions

View file

@ -18,7 +18,7 @@ const { success, messageError, showLoader, hideLoader, dialogConfirm } = mixin;
const route = useRoute();
const files = ref<any>();
const name = ref("");
const description = ref("");
const detail = ref("");
const id = ref<string>("");
const nameFile = ref<string>("");
const routeName = router.currentRoute.value.name;
@ -49,22 +49,22 @@ const saveData = async () => {
*/
const createTransfer = async () => {
showLoader();
const formData = new FormData();
formData.append("Organization", name.value);
formData.append("Reason", description.value);
formData.append("file", files.value);
// await http
// .post(config.API.listtransfer(), formData)
// .then((res: any) => {
// success($q, "");
// router.push(`/transfer`);
// })
// .catch((e: any) => {
// messageError($q, e);
// })
// .finally(() => {
// hideLoader();
// });
// const formData = new FormData();
// formData.append("name", name.value);
// formData.append("detail", detail.value);
// formData.append("file", files.value);
await http
.post(config.API.portfolio, { name: name.value, detail: detail.value })
.then((res: any) => {
success($q, "บันทึกข้อมูลสำเร็จ");
router.push(`/portfolio`);
})
.catch((e: any) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
};
/**
@ -72,21 +72,21 @@ const createTransfer = async () => {
* @param id ไอดของขอม
*/
const fecthData = async (id: string) => {
// showLoader();
// await http
// .get(config.API.transferByid(id))
// .then((res: any) => {
// let data = res.data.result;
// name.value = data.organization;
// description.value = data.reason;
// files.value = data.docs;
// })
// .catch((e: any) => {
// messageError($q, e);
// })
// .finally(() => {
// hideLoader();
// });
showLoader();
await http
.get(config.API.portfolioId(id))
.then((res: any) => {
let data = res.data.result;
name.value = data.organization;
detail.value = data.reason;
files.value = data.docs;
})
.catch((e: any) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
};
/**
@ -153,7 +153,7 @@ function fileOpen(url: string) {
"
dense
outlined
v-model="description"
v-model="detail"
label="รายละเอียดเอกสาร/ผลงาน"
hide-bottom-space
type="textarea"