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