This commit is contained in:
2026-08-06 18:00:04 +08:00
parent b30cc47184
commit e60b172b39
10 changed files with 317 additions and 285 deletions
+37 -2
View File
@@ -81,7 +81,38 @@
deep: true,
},
},
methods: {
methods: {
compare(item) {
// console.log("compare:", item);
axios
.post(HTTP_HOST + 'api/activity/ComparePreAndOrder', {num:item.num})
.then(response => {
if (response.data.result == "N") {
this.message_dialog.message = response.data.message;
this.message_dialog.show = true;
} else if (response.data.result == "Y") {
const link = document.createElement('a');
link.href = HTTP_HOST + "/" + response.data.filename;
link.target = "_blank";
// 5. Specify the filename for the download
//link.setAttribute('download', 'my-downloaded-file.pdf');
// 6. Append link to the body, click it, and remove it immediately
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
// 7. Free up memory by revoking the object URL
//window.URL.revokeObjectURL(blobUrl);
//window.open(HTTP_HOST +"/" +response.data.filename, "_blank");
}
this.isdisabled = false;
this.isloading = false;
})
.catch(error => console.log(error))
},
getDefault(clearpage = false) {
const { sortBy, sortDesc, page, itemsPerPage } = this.options
const params = {
@@ -208,7 +239,11 @@
<template #item.slot_btn="{ item }">
<a :href="'reg.aspx?num='+item.num" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-pencil-box-outline"></i>編輯</a>
<a @click="copyItem(item)" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-pencil-box-outline"></i>複製</a>
<a @click="deleteItem(item)" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-trash-can"></i>刪除</a>
<a @click="deleteItem(item)" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-trash-can"></i>刪除</a>
<% if (IsPreOrder == "true")
{ %>
<a @click="compare(item)" class="btn btn-outline-secondary btn-sm"><i class="mdi mdi-trash-can"></i>比對</a>
<% } %>
</template>
</v-data-table>
<v-container>