fix : add detail btn in package show - add filter owner items-package

This commit is contained in:
zeinab.ashrafi
2025-05-04 14:08:00 +03:30
parent f6daaf333c
commit 9bcd49fb31
5 changed files with 56 additions and 19 deletions
+26 -9
View File
@@ -220,6 +220,27 @@ export default {
stylesHtml += node.outerHTML;
}
// Add custom styles for label printing
const labelStyles = `<style>
@page {
size: auto;
margin: 0;
}
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
#printMe {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
</style>`;
// Open the print window
const WinPrint = window.open(
"",
@@ -227,20 +248,16 @@ export default {
"left=0,top=0,width=800,height=900,toolbar=0,scrollbars=0,status=0"
);
WinPrint.document.write(`<!DOCTYPE html>
<html>
<head>
${stylesHtml}
</head>
<body>
${prtHtml}
</body>
</html>`);
WinPrint.document.write(`<!DOCTYPE html><html><head> ${stylesHtml} ${labelStyles} <title>Print Label</title> </head><body>${prtHtml}</body> </html> `);
WinPrint.document.close();
WinPrint.focus();
// Delay print to ensure content is loaded
setTimeout(() => {
WinPrint.print();
WinPrint.close();
}, 500);
}
},
created() {
+12 -2
View File
@@ -80,8 +80,17 @@
<v-flex xs12 sm6 md4>
<span class="sub-text">Item Name:</span>{{ item.name }}
</v-flex>
<v-flex xs12 sm6 md4>
<v-flex xs12 sm6 md4 class="WM-Align-R">
<span v-if="item.pivot">({{ item.pivot.count }})</span>
<v-spacer/>
<a :href="'https://www.cssd-doc.com/Show/Item/' + item.id + ''"
target="_blank">
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border mr-2 WM-Margin-BT-0 WM-Border-Black" @click.stop.native=""
style="padding: 10px 30px;">
<v-icon class="black--text mr-2 caption">fas fa-search</v-icon>
<span class="black--text">DETAILS</span>
</v-btn>
</a>
</v-flex>
</v-layout>
</v-layout>
@@ -105,7 +114,8 @@
</v-btn>
<v-spacer/>
<router-link :to="{ name: 'AddLabel' ,query: { packageId: data.id }}" v-if="!['pending','rejected'].includes(data.status)">
<router-link :to="{ name: 'AddLabel' ,query: { packageId: data.id }}"
v-if="!['pending','rejected'].includes(data.status)">
<v-btn class="WM-LightGray-BG mr-2" @click="closeModal" style="padding:10px 60px">
<v-icon class="black--text mr-2 caption">fas fa-edit</v-icon>
<span class="black--text">Add Label</span>
+7 -4
View File
@@ -39,14 +39,17 @@
<v-flex xs12 sm12 md12 lg12 xl3 class="WM-Align-R">
<v-tooltip bottom open-on-hover>
<template v-slot:activator="{ on, attrs }">
<v-btn v-bind="attrs" v-on="on" color="WM-Tooltip-Btn WM-Outline-Btn WM-Border WM-Margin-BT-0 WM-Border-Black mr-2" @click="load()">
<v-btn v-bind="attrs" v-on="on"
color="WM-Tooltip-Btn WM-Outline-Btn WM-Border WM-Margin-BT-0 WM-Border-Black mr-2"
@click="load()">
<v-icon class="black--text caption">fas fa-search</v-icon>
</v-btn>
</template>
<span>Filter</span>
</v-tooltip>
<v-btn class="WM-Outline-Btn WM-Border mr-2 WM-Margin-BT-0 WM-Border-Black" @click="download()" style="padding: 10px 30px;">
<v-btn class="WM-Outline-Btn WM-Border mr-2 WM-Margin-BT-0 WM-Border-Black" @click="download()"
style="padding: 10px 30px;">
<v-icon class="black--text mr-2 caption">fas fa-share-square</v-icon>
<span class="black--text">EXPORT</span>
</v-btn>
@@ -249,9 +252,9 @@ export default {
}
},
async download() {
const result = await ApiService.get(urls.exportCycles());
const result = await ApiService.get(urls.exportItems());
if (result && result.status == 200) {
window.open(result.download, '_blank');
window.open(result.data.data.url, '_blank');
}
},
},
+4 -1
View File
@@ -12,6 +12,10 @@
<v-icon class="fa fa-align-left mr-2 WM-Margin-B-8"/>
<v-text-field class="pt-3 pr-3" v-model="filter.name" label="Name" color="black"/>
</v-flex>
<v-flex xs12 sm4 md4 lg3 xl2 class="WM-FlexCenter">
<v-icon class="fa fa-align-left mr-2 WM-Margin-B-8"/>
<v-text-field class="pt-3 pr-3" v-model="filter.user_name" label="Owner" color="black"/>
</v-flex>
<v-flex xs12 sm4 md4 lg3 xl2 class="WM-FlexCenter" v-if="$hasRole('Admin')">
<v-icon class="fa fa-hospital-o mr-2 WM-Margin-B-8"/>
<v-autocomplete class="pt-3 pr-3" v-model="filter.medical_center_id" item-text="name"
@@ -255,7 +259,6 @@ export default {
async download() {
const result = await ApiService.get(urls.exportItems());
if (result && result.status == 200) {
console.log(result)
window.open(result.data.data.url, '_blank');
}
},
+4
View File
@@ -12,6 +12,10 @@
<v-icon class="fa fa-align-left mr-2 WM-Margin-B-8"/>
<v-text-field class="pt-3 pr-3" v-model="filter.name" label="Name" color="black"/>
</v-flex>
<v-flex xs12 sm6 md6 lg3 xl2 class="WM-FlexCenter">
<v-icon class="fa fa-align-left mr-2 WM-Margin-B-8"/>
<v-text-field class="pt-3 pr-3" v-model="filter.user_name" label="Owner" color="black"/>
</v-flex>
<v-flex xs12 sm6 md6 lg3 xl2 class="WM-FlexCenter" v-if="$hasRole('Admin')">
<v-icon class="fa fa-hospital-o mr-2 WM-Margin-B-8"/>
<v-autocomplete class="pt-3 pr-3" v-model="filter.medical_center_id" item-text="name"