喷码机

This commit is contained in:
xielue 2023-09-27 12:32:21 +08:00
parent 02c04b4ccb
commit 6cb8fdb20c
4 changed files with 116 additions and 28 deletions

View File

@ -78,7 +78,7 @@ export default {
pageSend() { pageSend() {
var sendData = JSON.parse(JSON.stringify(Object.assign({},this.pageOptions, this.formOptions.data))) var sendData = JSON.parse(JSON.stringify(Object.assign({},this.pageOptions, this.formOptions.data)))
//sendData.printerName = sendData.printerCode;
this.$mk.post({ this.$mk.post({
url: `http://36.133.149.247:9112/api/tp/sqInStock`, url: `http://36.133.149.247:9112/api/tp/sqInStock`,

View File

@ -45,6 +45,7 @@ export default {
formOptions: { formOptions: {
data: { data: {
id:'', id:'',
printerName:'',
x: 0, x: 0,
y: 0, y: 0,
direction: 0, direction: 0,
@ -60,7 +61,9 @@ export default {
}, },
items: [ items: [
{ field: 'id', title: '机器', span: 24, itemRender: { name: '$select', props: { options: [] } } }, //{ field: 'id', title: '', span: 24, itemRender: { name: '$select', props: { options: [] } } },
{ field: 'printerName', title: '机器', span: 24, itemRender: { name: 'MkFormInputShow', props: { } } },
{ field: 'x', title: 'X', span: 24, itemRender: { name: '$input', props: { type: 'number' } } }, { field: 'x', title: 'X', span: 24, itemRender: { name: '$input', props: { type: 'number' } } },
{ field: 'y', title: 'Y', span: 24, itemRender: { name: '$input', props: { type: 'number' } } }, { field: 'y', title: 'Y', span: 24, itemRender: { name: '$input', props: { type: 'number' } } },
{ field: 'direction', title: '角度', span: 24, itemRender: { name: '$input', props: { type: 'number' } } }, { field: 'direction', title: '角度', span: 24, itemRender: { name: '$input', props: { type: 'number' } } },
@ -107,9 +110,13 @@ export default {
}, },
created() { created() {
this.printInit(); //this.printInit();
setTimeout(()=>{
this.formOptions.data.printerName = this.pageOptions.printerName;
},100);
}, },
// //
@ -154,7 +161,7 @@ this.printInit();
var sendData = JSON.parse(JSON.stringify( this.formOptions.data)) var sendData = JSON.parse(JSON.stringify( this.formOptions.data))
sendData.id = this.$mk.toBigInt(sendData.id); sendData.id = this.$mk.toBigInt(this.pageOptions.printerId);
sendData.contents = this.pageOptions.sequance; sendData.contents = this.pageOptions.sequance;
sendData.fileName = ""; sendData.fileName = "";

View File

@ -13,7 +13,15 @@
</vxe-form> </vxe-form>
<vxe-table border show-overflow keep-source ref="xTable" :height="table1Height" :data="detailsData" <vxe-table border show-overflow keep-source ref="xTable" :height="table1Height" :data="detailsData"
:row-config="{ height: 120 }" :column-config="{ resizable: true }"> :span-method="rowspanMethod" :column-config="{ resizable: true }">
<vxe-column field="voucherdate" title="单据日期" width="110"></vxe-column>
<vxe-column field="vouchercode" title="单据号" width="140"></vxe-column>
<vxe-column field="departmentName" title="生产车间" width="120"></vxe-column>
<vxe-column field="inventoryName" title="存货名称" width="130"></vxe-column>
<vxe-column field="quantity" title="数量" width="80"></vxe-column>
<vxe-column field="sequance" title="批次号" width="170"></vxe-column>
<vxe-column field="printerName" title="机器" width="110"></vxe-column>
<vxe-column title="操作" width="230"> <vxe-column title="操作" width="230">
@ -23,13 +31,6 @@
<a-button type="primary" @click.stop="pageShowDone(row)" style="margin-left: 2px;">完工</a-button> <a-button type="primary" @click.stop="pageShowDone(row)" style="margin-left: 2px;">完工</a-button>
</template> </template>
</vxe-column> </vxe-column>
<vxe-column field="voucherdate" title="单据日期" width="110"></vxe-column>
<vxe-column field="vouchercode" title="单据号" width="140"></vxe-column>
<vxe-column field="departmentName" title="生产车间" width="120"></vxe-column>
<vxe-column field="inventoryName" title="存货名称" width="130"></vxe-column>
<vxe-column field="quantity" title="数量" width="80"></vxe-column>
<vxe-column field="sequance" title="批次号" width="170"></vxe-column>
</vxe-table> </vxe-table>
@ -181,13 +182,13 @@ export default {
for (let key in this.searchFormData) { for (let key in this.searchFormData) {
let value = this.searchFormData[key]; let value = this.searchFormData[key];
if (value) { if (value) {
let mode = findMode(key); let mode = findMode(key);
rules.push({ rules.push({
field: key, field: key,
op: mode, op: mode,
value: value value: value
}); });
} }
} }
if (this.start_time) { if (this.start_time) {
@ -226,11 +227,55 @@ export default {
ds.push(o) ds.push(o)
}); });
ds = JSON.parse(JSON.stringify(ds)) ds = JSON.parse(JSON.stringify(ds))
this.detailsData = ds;
let ds_full = [];
ds.forEach(item => {
this.InkjetPrinterData.forEach(pitem => {
let item1 = JSON.parse(JSON.stringify(item));
item1.sequance = item.sequance.substr(0, item.sequance.length - 1) + pitem.code + item.sequance.substr(item.sequance.length - 1);
item1.printerCode = pitem.code;
item1.printerId = pitem.id.toString();
item1.printerName = pitem.name;
ds_full.push(item1);
});
});
this.detailsData = ds_full;
} }
}); });
}, },
//
rowspanMethod({ row, _rowIndex, column, visibleData }) {
let fields = ['voucherdate','vouchercode','departmentName','inventoryName','quantity']
let rowField = 'bid';
let cellValue = row[rowField]
if (cellValue && fields.includes(column.property)) {
let prevRow = visibleData[_rowIndex - 1]
let nextRow = visibleData[_rowIndex + 1]
if (prevRow && prevRow[rowField] === cellValue) {
return { rowspan: 0, colspan: 0 }
} else {
let countRowspan = 1
while (nextRow && nextRow[rowField] === cellValue) {
nextRow = visibleData[++countRowspan + _rowIndex]
}
if (countRowspan > 1) {
return { rowspan: countRowspan, colspan: 1 }
}
}
}
},
sqDepartmentsInit() { sqDepartmentsInit() {
this.$mk.post({ this.$mk.post({
url: this.actions.getSqDepartments, url: this.actions.getSqDepartments,
@ -251,11 +296,48 @@ export default {
onSearch() { onSearch() {
this.sequanceDataInit();
this.printerInit(() => {
this.sequanceDataInit();
})
}, },
printerInit(callback) {
if (this.InkjetPrinterData.length) {
callback();
} else {
this.$mk.post({
url: this.actions.get,
loading: "加载中...",
data: {
"end_time": 0,
"page": 1,
"start_time": 0,
"limit": 999,
"order_bys": [
],
"search_rules": [
]
},
useBigInt: true
}).then(a => {
this.InkjetPrinterData = a.data.InkjetPrinter;
callback();
});
}
},
getDefaultData(item) { getDefaultData(item) {
return Object.assign(item, { x: 0, y: 0, direction: 0, fontName: 'Arial', fontSize: 100, fontSpacing: 10 }); return Object.assign(item, { x: 0, y: 0, direction: 0, fontName: 'Arial', fontSize: 100, fontSpacing: 10 });
}, },

View File

@ -32,10 +32,9 @@ var config = {
}] }]
}, },
printTagTemplate:{ "panels": [{ "index": 0, "name": 1, "height": 50, "width": 80, "paperHeader": 0, "paperFooter": 141.73228346456693, "printElements": [{ "options": { "left": 55.5, "top": 15, "height": 100, "width": 100, "field": "sequance", "fontSize": 12, "fontWeight": "400", "hideTitle": true, "title": "批次号", "coordinateSync": false, "widthHeightSync": false, "textType": "qrcode", "qrCodeLevel": 0, "right": 155.5, "bottom": 114.25, "vCenter": 105.5, "hCenter": 64.25 }, "printElementType": { "title": "批次号", "type": "text" } }], "paperNumberLeft": 196, "paperNumberTop": 119 }] } printTagTemplate:{"panels":[{"index":0,"name":1,"height":70,"width":60,"paperHeader":4.5,"paperFooter":190.5,"printElements":[{"options":{"left":10.5,"top":28.5,"height":17,"width":142.5,"field":"sequance","fontSize":21.75,"fontWeight":"400","textAlign":"center","hideTitle":true,"title":"批次号","coordinateSync":false,"widthHeightSync":false,"qrCodeLevel":0,"right":153,"bottom":45.5,"vCenter":81.75,"hCenter":37,"lineHeight":27},"printElementType":{"title":"批次号","type":"text"}}],"paperNumberLeft":142.5,"paperNumberTop":199.5,"paperNumberDisabled":true}]}
};
};
module.exports = config module.exports = config