模具 喷印
This commit is contained in:
parent
758c0b5a90
commit
d99665588e
|
|
@ -37,8 +37,13 @@
|
|||
<vxe-table border show-overflow keep-source ref="xTable" :height="table1Height" :data="detailsData"
|
||||
:row-config="{ height: 120 }" :column-config="{ resizable: true }">
|
||||
|
||||
|
||||
<vxe-column field="fileName" title="条码编号" width="180"></vxe-column>
|
||||
|
||||
<vxe-column field="sequance" title="条码编号" width="180"></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="print_statistics" title="打印次数" width="100"></vxe-column>
|
||||
<vxe-column title="获取打印统计" width="150">
|
||||
<template #default="{ row }">
|
||||
|
|
@ -87,7 +92,7 @@ export default {
|
|||
|
||||
actions: {
|
||||
get: `${BASE_URL.BASE_URL}/InkjetPrinter/v1/inkjet/printer/list`,
|
||||
getFiles: `http://36.133.149.247:9112/api/tp/getSqList`
|
||||
sequanceData: `http://36.133.149.247:9112/api/tp/getSqList`
|
||||
},
|
||||
searchKey: '',
|
||||
currentPrint: null,
|
||||
|
|
@ -128,7 +133,7 @@ export default {
|
|||
|
||||
created() {
|
||||
this.printInit();
|
||||
this.filesInit();
|
||||
this.sequanceDataInit();
|
||||
this.heightInit();
|
||||
},
|
||||
// 函数
|
||||
|
|
@ -136,23 +141,30 @@ export default {
|
|||
pageSetting(row) {
|
||||
this.$openPage("/InkjetPrinter/InkjetPrinterSetting/" + row.id); // 打开页面
|
||||
},
|
||||
filesInit() {
|
||||
sequanceDataInit() {
|
||||
this.$mk.post({
|
||||
url: this.actions.getFiles,
|
||||
url: this.actions.sequanceData,
|
||||
loading: "加载中...",
|
||||
data: {
|
||||
key: this.searchKey
|
||||
}
|
||||
}
|
||||
}).then(a => {
|
||||
|
||||
if (a.code == 200) {
|
||||
|
||||
let ds = [];
|
||||
let textList = a.textList || a.data.textList || [];
|
||||
|
||||
|
||||
textList.forEach(item => {
|
||||
ds.push({ fileName: item.sequance, x: 0, y: 0, direction: 0, fontName: 'Arial', fontSize: 100, fontSpacing: 10 })
|
||||
let o = this.getDefaultData(item);
|
||||
if(o.voucherdate){
|
||||
o.voucherdate = o.voucherdate.substr(0,10)
|
||||
}
|
||||
ds.push(o)
|
||||
});
|
||||
|
||||
ds= JSON.parse(JSON.stringify(ds))
|
||||
this.detailsData = ds;
|
||||
}
|
||||
});
|
||||
|
|
@ -163,10 +175,15 @@ export default {
|
|||
|
||||
|
||||
},
|
||||
|
||||
getDefaultData(item){
|
||||
return Object.assign(item, {x: 0, y: 0, direction: 0, fontName: 'Arial', fontSize: 100, fontSpacing: 10 });
|
||||
},
|
||||
|
||||
pageAdd() {
|
||||
|
||||
|
||||
this.detailsData = [...this.detailsData, { fileName: this.searchKey, x: 0, y: 0, direction: 0, fontName: 'Arial', fontSize: 100, fontSpacing: 10 }];
|
||||
this.detailsData = [...this.detailsData, this.getDefaultData({sequance:this.searchKey})];
|
||||
|
||||
},
|
||||
|
||||
|
|
@ -289,7 +306,14 @@ export default {
|
|||
delete sendData._X_ROW_KEY;
|
||||
delete sendData.print_statistics;
|
||||
sendData.id = this.$mk.toBigInt(this.currentPrint.id);
|
||||
sendData.contents = sendData.fileName;
|
||||
sendData.contents = sendData.sequance;
|
||||
sendData.fileName = "";
|
||||
delete sendData.sequance
|
||||
delete sendData.voucherdate
|
||||
delete sendData.vouchercode
|
||||
delete sendData.inventoryName
|
||||
delete sendData.quantity
|
||||
delete sendData.departmentName
|
||||
this.$mk.post({
|
||||
url: `${BASE_URL.BASE_URL}/InkjetPrinter/v1/send/print/file`,
|
||||
loading: "发送文件中...",
|
||||
|
|
|
|||
|
|
@ -431,6 +431,8 @@ export default {
|
|||
this.deletedDetailsData.push(this.$mk.toBigInt(row.id))
|
||||
}
|
||||
this.detailsData.splice($table.getRowSeq(row) - 1, 1);
|
||||
|
||||
this.postDataUpdate();
|
||||
},
|
||||
|
||||
|
||||
|
|
@ -457,6 +459,7 @@ export default {
|
|||
}
|
||||
this.detailsData2.splice($table.getRowSeq(row) - 1, 1);
|
||||
|
||||
this.postDataUpdate();
|
||||
},
|
||||
|
||||
postDataUpdate(){
|
||||
|
|
|
|||
|
|
@ -353,7 +353,7 @@ export default {
|
|||
|
||||
|
||||
this.setPageReadonly(this.pageStatus == 'approved');
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
|
@ -366,7 +366,7 @@ export default {
|
|||
this.addModeItems.forEach(item => {
|
||||
this.formOptions.items.push(item);
|
||||
})
|
||||
this.setPageReadonly(this.pageStatus == 'approved');
|
||||
this.setPageReadonly(this.pageStatus == 'approved');
|
||||
}
|
||||
|
||||
},
|
||||
|
|
@ -454,28 +454,23 @@ export default {
|
|||
let currentAddRows2 = [];
|
||||
currentAddRows1.push({
|
||||
component_id: row.id,
|
||||
component_num:1,
|
||||
component_num: 1,
|
||||
component_detail: { id: row.id, name: row.name },
|
||||
})
|
||||
mold_component_processes.forEach(pitem => {
|
||||
currentAddRows2.push({
|
||||
component_id: row.id,
|
||||
component_id: row.id,
|
||||
process_id: pitem.mes_processes_id,
|
||||
process_detail: { id: pitem.mes_processes_id, name: pitem.mes_processes.name },
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
let key = this.infos.length + '';
|
||||
let info = {
|
||||
key: key, data: {
|
||||
mold_production_order_component: currentAddRows1,
|
||||
mold_production_order_component_processes: currentAddRows2
|
||||
},
|
||||
this.addInfo({
|
||||
rows1: currentAddRows1,
|
||||
rows2: currentAddRows2,
|
||||
header: data.row1.name
|
||||
};
|
||||
this.collapseActiveKey = [...this.collapseActiveKey, key];
|
||||
this.infos = [...this.infos, info];
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
|
@ -486,6 +481,22 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
clearInfos() {
|
||||
this.collapseActiveKey = [];
|
||||
this.infos = [];
|
||||
},
|
||||
addInfo({ rows1, rows2, header }) {
|
||||
let key = this.infos.length + '';
|
||||
let info = {
|
||||
key: key, data: {
|
||||
mold_production_order_component: rows1,
|
||||
mold_production_order_component_processes: rows2
|
||||
},
|
||||
header: header
|
||||
};
|
||||
this.collapseActiveKey = [...this.collapseActiveKey, key];
|
||||
this.infos = [...this.infos, info];
|
||||
},
|
||||
pageSelectOrder() {
|
||||
let { width, height } = this.$mk.getWindowSize();
|
||||
this.$mk.dialog.open({
|
||||
|
|
@ -535,10 +546,63 @@ export default {
|
|||
|
||||
|
||||
this.formOptions.data = JSON.parse(JSON.stringify(this.formOptions.data))
|
||||
|
||||
|
||||
//this.loadMoleData(detail.mold_id);
|
||||
|
||||
|
||||
this.$forceUpdate()
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
loadMoleData(mold_id) {
|
||||
this.$mk.post({
|
||||
url: `${BASE_URL.BASE_URL}/MoldScheme/v1/mold/scheme/detail`,
|
||||
data: {
|
||||
id: this.$mk.toBigInt(mold_id)
|
||||
},
|
||||
useBigInt: true
|
||||
}).then((a) => { // 成功回调
|
||||
if (a.data && a.data.mold_scheme) {
|
||||
|
||||
|
||||
let row = a.data.mold_scheme;
|
||||
let mold_scheme_processes = row.mold_scheme_processes || [];
|
||||
let currentAddRows1 = [];
|
||||
let currentAddRows2 = [];
|
||||
|
||||
mold_scheme_processes.forEach(pitem => {
|
||||
|
||||
if (!currentAddRows1.filter(a => a.component_id == pitem.component_id.toString()).length) {
|
||||
currentAddRows1.push({
|
||||
component_id: pitem.component_id.toString(),
|
||||
component_num: 1,
|
||||
component_detail: { id: row.id, name: row.name },
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
currentAddRows2.push({
|
||||
component_id: pitem.component_id.toString(),
|
||||
process_id: pitem.mes_processes_id,
|
||||
process_detail: { id: pitem.mes_processes_id, name: pitem.mes_processes.name },
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
this.clearInfos();
|
||||
currentAddRows1.forEach(row => {
|
||||
this.addInfo({
|
||||
rows1: [row],
|
||||
rows2: currentAddRows2.filter(a => a.component_id == row.component_id),
|
||||
header: row.component_detail.name
|
||||
});
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
heightInit() {
|
||||
|
||||
this.$nextTick(() => {
|
||||
|
|
@ -651,7 +715,7 @@ export default {
|
|||
value: postdata.mold_production_order_component_processes
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 提交数据
|
||||
this.$mk.post({
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
</vxe-form>
|
||||
|
||||
|
||||
<vxe-table border show-overflow keep-source ref="xTable" :height="table1Height" :data="detailsData"
|
||||
<vxe-table border show-overflow keep-source ref="xTable" :data="detailsData"
|
||||
@pulldownSelected="onPulldownSelected" @popupSelected="onPopupSelected" :export-config="{}"
|
||||
@edit-closed="afterEditEvent" @edit-actived="beforeEditEvent"
|
||||
:edit-config="{ trigger: 'click', mode: 'cell', icon: 'vxe-icon-edit', showStatus: false, beforeEditMethod: beforeEditMethod }">
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
<a-button @click="pageLoadData()" style="margin: 5px;">加载部门工序</a-button>
|
||||
|
||||
<vxe-table border show-overflow keep-source ref="xTable2" :height="table1Height" :data="detailsData2"
|
||||
<vxe-table border show-overflow keep-source ref="xTable2" :data="detailsData2"
|
||||
@pulldownSelected="onPulldownSelected" @popupSelected="onPopupSelected" :export-config="{}"
|
||||
@edit-closed="afterEditEvent" @edit-actived="beforeEditEvent"
|
||||
:edit-config="{ trigger: 'click', mode: 'cell', icon: 'vxe-icon-edit', showStatus: false, beforeEditMethod: beforeEditMethod }">
|
||||
|
|
@ -313,10 +313,10 @@ export default {
|
|||
|
||||
},
|
||||
detailsDataInit() {
|
||||
for (let i = this.detailsData && this.detailsData.length; i < 10; i++) {
|
||||
for (let i = this.detailsData && this.detailsData.length; i < 1; i++) {
|
||||
this.detailsData.push({});
|
||||
}
|
||||
for (let i = this.detailsData2 && this.detailsData2.length; i < 10; i++) {
|
||||
for (let i = this.detailsData2 && this.detailsData2.length; i < 1; i++) {
|
||||
this.detailsData2.push({});
|
||||
}
|
||||
},
|
||||
|
|
@ -530,6 +530,10 @@ export default {
|
|||
}
|
||||
},
|
||||
pageDelete(row) {
|
||||
if (this.detailsData.length == 1) {
|
||||
this.$mk.success("至少保留一行");
|
||||
return;
|
||||
}
|
||||
const $table = this.$refs.xTable;
|
||||
if (row.id) {
|
||||
this.deletedDetailsData.push(this.$mk.toBigInt(row.id))
|
||||
|
|
@ -549,6 +553,10 @@ export default {
|
|||
}
|
||||
},
|
||||
pageDelete2(row) {
|
||||
if (this.detailsData2.length == 1) {
|
||||
this.$mk.success("至少保留一行");
|
||||
return;
|
||||
}
|
||||
const $table = this.$refs.xTable2;
|
||||
if (row.id) {
|
||||
this.deletedDetailsData2.push(this.$mk.toBigInt(row.id))
|
||||
|
|
|
|||
Loading…
Reference in New Issue