mirror of
https://git.meshkee.com/cssd/cssd-front.git
synced 2026-10-13 07:53:19 +03:30
feat :use barcode scaner in add package and cycle
This commit is contained in:
@@ -182,15 +182,7 @@ export default {
|
|||||||
"left=0,top=0,width=800,height=900,toolbar=0,scrollbars=0,status=0"
|
"left=0,top=0,width=800,height=900,toolbar=0,scrollbars=0,status=0"
|
||||||
);
|
);
|
||||||
|
|
||||||
WinPrint.document.write(`<!DOCTYPE html>
|
WinPrint.document.write(`<!DOCTYPE html><html><head>${stylesHtml}</head><body>${prtHtml}</body></html>`);
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
${stylesHtml}
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
${prtHtml}
|
|
||||||
</body>
|
|
||||||
</html>`);
|
|
||||||
|
|
||||||
WinPrint.document.close();
|
WinPrint.document.close();
|
||||||
WinPrint.focus();
|
WinPrint.focus();
|
||||||
@@ -198,6 +190,7 @@ export default {
|
|||||||
WinPrint.close();
|
WinPrint.close();
|
||||||
},
|
},
|
||||||
openLightbox(index) {
|
openLightbox(index) {
|
||||||
|
console.log(index, '00')
|
||||||
this.lightboxIndex = index;
|
this.lightboxIndex = index;
|
||||||
this.showLightbox = false;
|
this.showLightbox = false;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
|||||||
@@ -46,9 +46,9 @@
|
|||||||
<v-flex xs12 sm6 md4 class="WM-FlexCenter WM-DuplicateInput" style="position: relative"
|
<v-flex xs12 sm6 md4 class="WM-FlexCenter WM-DuplicateInput" style="position: relative"
|
||||||
v-for="(label, key) in formData.labels" :key="key">
|
v-for="(label, key) in formData.labels" :key="key">
|
||||||
<div class="Inner">
|
<div class="Inner">
|
||||||
<v-icon class="fa fa-check mr-2 WM-Margin-B-8"></v-icon>
|
<v-icon class="fa fa-check mr-2 WM-Margin-B-8"/>
|
||||||
<v-autocomplete
|
<v-autocomplete
|
||||||
@keydown.enter.native.prevent="duplicateForm(key)"
|
@keydown.enter.native.prevent="handleEnterScan(key)"
|
||||||
@change="duplicateForm(key)"
|
@change="duplicateForm(key)"
|
||||||
:ref="`selectItem-${key}`"
|
:ref="`selectItem-${key}`"
|
||||||
color="black"
|
color="black"
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import {ApiService} from "@/services";
|
import {ApiService} from "@/services";
|
||||||
import {urls} from "@/config/urls";
|
import {urls} from "@/config/urls";
|
||||||
import {mapMutations} from "vuex";
|
import toast from "@/services/global/toast.service";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
metaInfo() {
|
metaInfo() {
|
||||||
@@ -135,9 +135,15 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.loadLabels();
|
this.loadLabels();
|
||||||
console.log()
|
|
||||||
if (this.$route.params.cycle) {
|
if (this.$route.params.cycle) {
|
||||||
this.load(this.$route.params.cycle);
|
this.load(this.$route.params.cycle);
|
||||||
|
}else {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
const firstRef = this.$refs[`selectItem-0`];
|
||||||
|
if (firstRef && firstRef[0]) {
|
||||||
|
firstRef[0].focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -175,6 +181,29 @@ export default {
|
|||||||
this.$router.push({name: "AllCycle"});
|
this.$router.push({name: "AllCycle"});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
handleEnterScan(key) {
|
||||||
|
const inputRef = this.$refs[`selectItem-${key}`][0];
|
||||||
|
const searchText = inputRef.searchValue || inputRef.lazySearch;
|
||||||
|
const selectedItemId = this.formData.labels[key].id;
|
||||||
|
if (!selectedItemId) {
|
||||||
|
const foundItem = this.labels.find(i =>
|
||||||
|
i.udi === searchText ||
|
||||||
|
i.name === searchText ||
|
||||||
|
i.id == searchText
|
||||||
|
);
|
||||||
|
|
||||||
|
if (foundItem) {
|
||||||
|
this.formData.labels[key].id = foundItem.id;
|
||||||
|
if (inputRef.isMenuActive) {
|
||||||
|
console.log(inputRef.isMenuActive)
|
||||||
|
inputRef.isMenuActive = false;
|
||||||
|
}
|
||||||
|
this.duplicateForm(key);
|
||||||
|
} else {
|
||||||
|
toast.error('item is not in the list');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
duplicateForm() {
|
duplicateForm() {
|
||||||
this.formData.labels.push({name: "",});
|
this.formData.labels.push({name: "",});
|
||||||
this.$nextTick( () => {
|
this.$nextTick( () => {
|
||||||
|
|||||||
@@ -251,7 +251,6 @@ export default {
|
|||||||
async download() {
|
async download() {
|
||||||
const result = await ApiService.get(urls.exportCycles());
|
const result = await ApiService.get(urls.exportCycles());
|
||||||
if (result && result.status == 200) {
|
if (result && result.status == 200) {
|
||||||
console.log(result)
|
|
||||||
window.open(result.download, '_blank');
|
window.open(result.download, '_blank');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -76,7 +76,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import {ApiService} from "@/services";
|
import {ApiService} from "@/services";
|
||||||
import {urls} from "@/config/urls";
|
import {urls} from "@/config/urls";
|
||||||
import {mapMutations} from 'vuex';
|
|
||||||
import Dropzone from '@/components/core/Dropzone'
|
import Dropzone from '@/components/core/Dropzone'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
style="position: relative" v-for="(item, key) in formData.items" :key="key">
|
style="position: relative" v-for="(item, key) in formData.items" :key="key">
|
||||||
<div class="Inner">
|
<div class="Inner">
|
||||||
<v-autocomplete
|
<v-autocomplete
|
||||||
@keydown.enter.native.prevent="duplicateForm(key)"
|
@keydown.enter.native.prevent="handleEnterScan(key)"
|
||||||
@change="duplicateForm(key)"
|
@change="duplicateForm(key)"
|
||||||
:ref="`selectItem-${key}`"
|
:ref="`selectItem-${key}`"
|
||||||
class="py-3 pr-3"
|
class="py-3 pr-3"
|
||||||
@@ -115,7 +115,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import {ApiService} from "@/services";
|
import {ApiService} from "@/services";
|
||||||
import {urls} from "@/config/urls";
|
import {urls} from "@/config/urls";
|
||||||
import {mapMutations} from "vuex";
|
import toast from "@/services/global/toast.service";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
metaInfo() {
|
metaInfo() {
|
||||||
@@ -152,8 +152,14 @@ export default {
|
|||||||
this.loadItems();
|
this.loadItems();
|
||||||
if (this.$route.params.package) {
|
if (this.$route.params.package) {
|
||||||
this.load(this.$route.params.package);
|
this.load(this.$route.params.package);
|
||||||
|
}else {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
const firstRef = this.$refs[`selectItem-0`];
|
||||||
|
if (firstRef && firstRef[0]) {
|
||||||
|
firstRef[0].focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
customFilter(item, queryText) {
|
customFilter(item, queryText) {
|
||||||
@@ -198,10 +204,32 @@ export default {
|
|||||||
this.$router.push({name: "AllPackage"});
|
this.$router.push({name: "AllPackage"});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
handleEnterScan(key) {
|
||||||
|
const inputRef = this.$refs[`selectItem-${key}`][0];
|
||||||
|
const searchText = inputRef.searchValue || inputRef.lazySearch;
|
||||||
|
const selectedItemId = this.formData.items[key].id;
|
||||||
|
if (!selectedItemId) {
|
||||||
|
const foundItem = this.items.find(i =>
|
||||||
|
i.udi === searchText ||
|
||||||
|
i.name === searchText ||
|
||||||
|
i.id == searchText
|
||||||
|
);
|
||||||
|
|
||||||
|
if (foundItem) {
|
||||||
|
this.formData.items[key].id = foundItem.id;
|
||||||
|
if (inputRef.isMenuActive) {
|
||||||
|
console.log(inputRef.isMenuActive)
|
||||||
|
inputRef.isMenuActive = false;
|
||||||
|
}
|
||||||
|
this.duplicateForm(key);
|
||||||
|
} else {
|
||||||
|
toast.error('item is not in the list');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
duplicateForm() {
|
duplicateForm() {
|
||||||
this.formData.items.push({name: "",});
|
this.formData.items.push({name: "",});
|
||||||
this.$nextTick( () => {
|
this.$nextTick(() => {
|
||||||
const newIndex = this.formData.items.length - 1;
|
const newIndex = this.formData.items.length - 1;
|
||||||
const ref = this.$refs[`selectItem-${newIndex}`];
|
const ref = this.$refs[`selectItem-${newIndex}`];
|
||||||
if (ref && ref[0]) {
|
if (ref && ref[0]) {
|
||||||
|
|||||||
Reference in New Issue
Block a user