feat:工段交接记录打印

This commit is contained in:
shijing 2024-10-24 17:20:42 +08:00
parent f02467a881
commit 4acdc9f4cd
1 changed files with 53 additions and 42 deletions

View File

@ -226,9 +226,13 @@
<el-button type="primary" @click="savePrinter">保存</el-button>
</el-footer>
</el-dialog>
<el-dialog v-model="printVisible" width="1200px">
<print :baseData="handoverItem" :tableData="handoverItem.handoverb" :type="'handover'" @closePrint="printVisible=false"/>
</el-dialog>
</template>
<script>
import saveDialog from "./handover_form.vue";
import print from "./../setting/print/A4.vue";
export default {
props: {
mgroupName: {
@ -238,7 +242,7 @@ export default {
},
name: "handover",
components: {
saveDialog,
saveDialog,print
},
data() {
return {
@ -272,7 +276,9 @@ export default {
processId: "",
processCate: "",
printer_name: "",
printVisible:false,
setNameVisible: false,
testCode: "mat:3689278065261125632",
};
},
mounted() {
@ -320,36 +326,39 @@ export default {
printSetting(){
this.setNameVisible = true;
},
handoverPrint() {
handoverPrint(row) {
let that = this;
let str = [
"SIZE 70 mm,90 mm",
"GAP 2 mm,0 mm",
"SIZE 60 mm,90 mm",
"GAP 0 mm,0 mm",
"CLS",
"WINTEXT 50,80,36,0,0,0,Simhei,光芯科技——交接单",
'BARCODE 50,140,"128",108,0,0,3,5,"' +
that.handoverItem.id +
'"',
"WINTEXT 50,280,36,0,0,0,Simhei," +
that.handoverItem.material_name,
"WINTEXT 50,340,36,0,0,0,Simhei,批次:" +
that.handoverItem.batch,
"WINTEXT 50,400,36,0,0,0,Simhei,数量:" +
that.handoverItem.count,
"WINTEXT 50,460,36,0,0,0,Simhei,日期:" +
that.handoverItem.send_date,
"WINTEXT 50,520,36,0,0,0,Simhei,送料:" +
that.handoverItem.send_mgroup_name +
"——" +
that.handoverItem.send_user_name,
"WINTEXT 50,580,36,0,0,0,Simhei,收料:" +
that.handoverItem.recive_mgroup_name +
"——" +
that.handoverItem.recive_user_name,
"PRINT 1",
'QRCODE 0,60,H,5,A,0,"' +that.testCode +'"',
"WINTEXT 0,200,36,0,0,0,Simhei," +row.material_name,
"WINTEXT 0,240,36,0,0,0,Simhei,批次:" +
row.batch,
];
// -
// -
if(row.wm_notok_sign!==null){
str.push("WINTEXT 0,280,36,0,0,0,Simhei,不合格原因:" +
row.wm_notok_sign,)
}
//----
// if(row.type==30||row.type==40){
// str.push("WINTEXT 50,460,36,0,0,0,Simhei," +
// row.supplier_name,)
// }
str.push("PRINT 1",)
// let str = [
// "SIZE 60 mm,90 mm",
// "GAP 0 mm,0 mm",
// "CLS",
// "WINTEXT 0,10,36,0,0,0,Simhei," +row.material_name,
// 'QRCODE 0,60,H,5,A,0,"' +that.testCode +'"',
// "WINTEXT 50,340,36,0,0,0,Simhei," +
// row.batch,
// "WINTEXT 50,400,36,0,0,0,Simhei," +
// row.wm_notok_sign,
// "PRINT 1",
// ];
let obj = {};
obj.printer_commands = str;
obj.printer_name = that.printer_name;
@ -432,20 +441,22 @@ export default {
});
},
table_print(row) {
//
let that = this;
if (
that.printer_name == null ||
that.printer_name == "" ||
that.printer_name == undefined
) {
this.setNameVisible = true;
} else {
that.$API.wpm.handover.item.req(row.id).then((res) => {
that.handoverItem = res;
that.handoverPrint();
});
}
that.handoverItem = row;
that.printVisible = true;
//
// if (
// that.printer_name == null ||
// that.printer_name == "" ||
// that.printer_name == undefined
// ) {
// this.setNameVisible = true;
// } else {
// that.$API.wpm.handover.item.req(row.id).then((res) => {
// that.handoverItem = res;
// that.handoverPrint(row);
// });
// }
},
savePrinter() {
let that = this;