入库明细拆分
铁心库打码
This commit is contained in:
1 parent
fa7b5814ba
commit
d19f62e48b
21 files changed
+513
-93
No files matched your search
@@ -10,9 +10,16 @@
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-input v-model="lot"
|
||||
placeholder="型号">
|
||||
</el-input>
|
||||
<el-select v-model="lot" :popper-append-to-body="false" placeholder="型号"
|
||||
filterable
|
||||
allow-create
|
||||
default-first-option>
|
||||
<el-option v-for="item in lotList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-input v-model.number="num"
|
||||
@@ -56,7 +63,7 @@
|
||||
value: '5',
|
||||
label: 'C柱片'
|
||||
}
|
||||
],
|
||||
],lotList:[],
|
||||
printData:[],
|
||||
gendCode: '',
|
||||
px: '',
|
||||
@@ -66,6 +73,13 @@
|
||||
template: { "panels": [{ "index": 0, "height": 50, "width": 80, "paperHeader": 43.5, "paperFooter": 141.73228346456693, "printElements": [{ "options": { "left": 96, "top": 19.5, "height": 87, "width": 120, "field": "qrcode", "testData": "12312312312", "textType": "qrcode" }, "printElementType": { "type": "text" } }, { "options": { "left": 16.5, "top": 24, "height": 25.5, "width": 69, "field": "px", "testData": "123123", "textAlign": "center", "textContentVerticalAlign": "middle" }, "printElementType": { "type": "text" } }, { "options": { "left": 16.5, "top": 67.5, "height": 24, "width": 67.5, "field": "lot", "testData": "1231231", "textAlign": "center", "textContentVerticalAlign": "middle" }, "printElementType": { "type": "text" } }], "paperNumberLeft": 196.5, "paperNumberTop": 118.5, "paperNumberDisabled": true }] }
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
var t = window.localStorage.getItem("lot");
|
||||
if (t == undefined) {
|
||||
window.localStorage.setItem("lot", JSON.stringify(this.lotList));
|
||||
}
|
||||
this.lotList = JSON.parse(window.localStorage.getItem("lot"));
|
||||
},
|
||||
methods: {
|
||||
create() {
|
||||
var _this = this;
|
||||
@@ -162,6 +176,7 @@
|
||||
},
|
||||
genCode() {
|
||||
var _this = this;
|
||||
|
||||
if (_this.px == "") {
|
||||
_this.$message({
|
||||
message: "请选择片型!",
|
||||
@@ -178,17 +193,29 @@
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.lotList.push({
|
||||
value: _this.lot,
|
||||
label: _this.lot
|
||||
});
|
||||
|
||||
var ttt = []
|
||||
if (this.lotList.length > 20) {
|
||||
ttt = this.lotList.slice(2);
|
||||
} else {
|
||||
ttt = this.lotList;
|
||||
}
|
||||
var tt = Array.from(new Set(ttt.map(JSON.stringify))).map(JSON.parse);
|
||||
window.localStorage.setItem("lot", JSON.stringify(tt));
|
||||
this.lotList = JSON.parse(window.localStorage.getItem("lot"));
|
||||
|
||||
|
||||
_this.gendCode = _this.lot + '--' + _this.px;
|
||||
var pxName = "";
|
||||
_this.pxList.forEach(function (item) {
|
||||
if (item.value == _this.px)
|
||||
pxName = item.label;
|
||||
})
|
||||
_this.printData.push({
|
||||
px: pxName,
|
||||
lot: _this.lot,
|
||||
qrcode: _this.gendCode
|
||||
});
|
||||
|
||||
// 设置参数方式
|
||||
var qrcode = new QRCode(document.getElementById('qrcode'), {
|
||||
text: _this.gendCode,
|
||||
@@ -205,7 +232,21 @@
|
||||
},
|
||||
print() {
|
||||
var _this = this;
|
||||
// _this.gendCode = "";
|
||||
_this.printData = [];
|
||||
_this.pxList.forEach(function (item) {
|
||||
if (item.value == _this.px)
|
||||
pxName = item.label;
|
||||
})
|
||||
var n = _this.num;
|
||||
while (n > 0) {
|
||||
_this.printData.push({
|
||||
px: pxName,
|
||||
lot: _this.lot,
|
||||
qrcode: _this.lot + '--' + _this.px
|
||||
});
|
||||
n--;
|
||||
}
|
||||
|
||||
hiprint.init();
|
||||
var hiprintTemplate = new hiprint.PrintTemplate({
|
||||
template: this.template
|
||||
@@ -216,7 +257,7 @@
|
||||
//清空
|
||||
_this.qrcode = '';
|
||||
_this.num = 1;
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user