mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-11 22:01:05 +03:30
update cssd
This commit is contained in:
@@ -130,9 +130,9 @@ export default {
|
||||
role: 'Admin'
|
||||
},
|
||||
{
|
||||
to: {name: 'AllPack'},
|
||||
to: {name: 'AllLabels'},
|
||||
icon: 'fas fa-inbox',
|
||||
text: 'Packs'
|
||||
text: 'Labels'
|
||||
},
|
||||
{
|
||||
to: {name: 'AllCycle'},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
<template>
|
||||
<v-container grid-list-xs>
|
||||
<material-card color="black" title="Show Package">
|
||||
<material-card color="black" id="printMe" title="Show Label">
|
||||
<v-layout align-left justify-left wrap class="px-5 my-3">
|
||||
<h3 class="ml-3">Info</h3>
|
||||
<v-flex xs12>
|
||||
@@ -53,6 +53,31 @@
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-layout>
|
||||
<v-layout id="printMe" align-left justify-left wrap class="px-5 my-3">
|
||||
<h3 class="ml-3">Barcode And QRCode Image</h3>
|
||||
<v-flex xs12>
|
||||
<hr class="v-divider theme--light">
|
||||
</v-flex>
|
||||
<v-layout row wrap class="ml-4">
|
||||
<v-flex xs12 md6 sm6 v-if="data.bar_code">
|
||||
<img :src="data.bar_code">
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row wrap class="ml-4">
|
||||
<v-flex xs12 md6 sm6 v-if="data.qr_code">
|
||||
<img :src="data.qr_code">
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-layout>
|
||||
<v-layout row wrap align-center justify-center>
|
||||
<v-flex class xs12 md2 sm2 @click="print" >
|
||||
<v-btn class="WM-CyanBlueGradient-BG" style="padding:10px 60px">
|
||||
<v-icon class="white--text mr-2 caption">fas fa-print</v-icon>
|
||||
<span class="white--text">Print</span>
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
</material-card>
|
||||
</v-container>
|
||||
</template>
|
||||
@@ -79,6 +104,39 @@ export default {
|
||||
this.setResultModal(result.data.data);
|
||||
this.closeModal();
|
||||
}
|
||||
},
|
||||
print() {
|
||||
const prtHtml = document.getElementById("printMe").innerHTML;
|
||||
|
||||
// Get all stylesheets HTML
|
||||
let stylesHtml = "";
|
||||
for (const node of [
|
||||
...document.querySelectorAll('link[rel="stylesheet"], style')
|
||||
]) {
|
||||
stylesHtml += node.outerHTML;
|
||||
}
|
||||
|
||||
// Open the print window
|
||||
const WinPrint = window.open(
|
||||
"",
|
||||
"",
|
||||
"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.close();
|
||||
WinPrint.focus();
|
||||
WinPrint.print();
|
||||
WinPrint.close();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
Vendored
+3
@@ -173,6 +173,9 @@ const urls = {
|
||||
},
|
||||
Barcode: function(code) {
|
||||
return `/BarCode/${code}`;
|
||||
},
|
||||
packageBarcode: function(code) {
|
||||
return `/Package/Barcode/${code}`;
|
||||
}
|
||||
};
|
||||
export { urls };
|
||||
|
||||
Vendored
+1
-1
@@ -32,7 +32,7 @@ require('./services/global/errorHandler.service');
|
||||
// If token exists set Authorizion header
|
||||
if (TokenService.getToken()) {
|
||||
ApiService.setAuthHeader();
|
||||
|
||||
|
||||
// If info exists set info in Store
|
||||
if(TokenService.getInfo()) {
|
||||
let info = TokenService.getInfo();
|
||||
|
||||
Vendored
+2
-2
@@ -165,8 +165,8 @@ export default [
|
||||
view: 'Pack/AddEdit'
|
||||
},
|
||||
{
|
||||
path: '/packs',
|
||||
name: 'AllPack',
|
||||
path: '/labels',
|
||||
name: 'AllLabels',
|
||||
view: 'Pack/List'
|
||||
},
|
||||
{
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
item-text="name"
|
||||
item-value="id"
|
||||
v-model="formData.packs"
|
||||
label="Select Packs For Cycle"
|
||||
label="Select Labels For Cycle"
|
||||
></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
@@ -109,6 +109,10 @@
|
||||
<v-icon class="white--text mr-2 caption">fas fa-times</v-icon>
|
||||
<span>Remove</span>
|
||||
</v-btn>
|
||||
<v-btn color="orange darken-1" @click="generateBarcode(item.unique_id)">
|
||||
<v-icon class="white--text mr-1 caption">fas fa-barcode</v-icon>
|
||||
<span>Generate Barcode</span>
|
||||
</v-btn>
|
||||
</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
@@ -204,6 +208,15 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
async generateBarcode(code) {
|
||||
const result = await ApiService.post(urls.Barcode(code));
|
||||
if (result && result.status == 200) {
|
||||
this.changeCurrentModal({
|
||||
modal: "modal-barcode-barcode",
|
||||
properties: { result }
|
||||
});
|
||||
}
|
||||
},
|
||||
async remove(testResultId) {
|
||||
const result = await ApiService.delete(
|
||||
urls.removeCycle(testResultId)
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
<v-flex xs12 md2 sm2 class="text-md-center text-sm-center text-xs-center">
|
||||
<router-link :to="{name: 'AllPack'}">
|
||||
<router-link :to="{name: 'AllLabels'}">
|
||||
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black">
|
||||
<v-icon class="black--text">keyboard_arrow_left</v-icon>
|
||||
<span class="black--text">Back</span>
|
||||
@@ -209,7 +209,7 @@ export default {
|
||||
}
|
||||
|
||||
if (result && result.status == 200) {
|
||||
this.$router.push({ name: "AllPack" });
|
||||
this.$router.push({ name: "AllLabels" });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ export default {
|
||||
}
|
||||
},
|
||||
async generateBarcode(code) {
|
||||
const result = await ApiService.post(urls.Barcode(code));
|
||||
const result = await ApiService.post(urls.packageBarcode(code));
|
||||
if (result && result.status == 200) {
|
||||
this.changeCurrentModal({
|
||||
modal: "modal-barcode-barcode",
|
||||
|
||||
Reference in New Issue
Block a user