<template>
|
<el-dialog
|
width="40%"
|
title="标签信息"
|
top="3vh"
|
:visible.sync="innerVisible"
|
append-to-body
|
@close="$emit('update:currshowlist', false)"
|
:show="currshowlist"
|
:close-on-click-modal="false"
|
class="print-label-dialog"
|
>
|
<el-form :model="dataForm" ref="dataForm" label-width="80px" class="l-mes">
|
<el-row>
|
<el-col :span="24">
|
<el-form-item label="零件号" prop="partNo">
|
<el-input v-model="dataForm.partNo" disabled></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="24">
|
<el-form-item label="零件描述" prop="partName">
|
<el-input v-model="dataForm.partName" disabled></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="24">
|
<el-form-item label="SN号" prop="outBatchNo"
|
><el-input
|
v-model="dataForm.outBatchNo"
|
placeholder="SN号"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="24">
|
<el-form-item label="生产数量" prop="productQty">
|
<el-input
|
v-model="dataForm.productQty"
|
placeholder="生产数量"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="24">
|
<el-form-item label="备注" prop="remark"
|
><el-input v-model="dataForm.remark" placeholder="备注"></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</el-form>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="innerVisible = false">取消</el-button>
|
<el-button type="primary" v-thinclick="`beginSmalllPrint`"
|
>打印</el-button
|
>
|
</span>
|
</el-dialog>
|
</template>
|
<script>
|
import { mapGetters } from 'vuex'
|
import getLodop from '@/util/lodop'
|
export default {
|
props: {
|
currshowlist: {
|
type: Boolean,
|
default: false
|
},
|
printLabelInfo: {
|
type: Object,
|
default: () => {
|
return {}
|
}
|
}
|
},
|
data() {
|
return {
|
innerVisible: false,
|
dataForm: {}
|
}
|
},
|
watch: {
|
currshowlist() {
|
this.innerVisible = this.currshowlist
|
if (this.currshowlist) {
|
this.$nextTick(() => {
|
this.dataForm = {
|
partNo: this.printLabelInfo.partNo,
|
partName: this.printLabelInfo.partName,
|
outBatchNo: this.printLabelInfo.outBatchNo,
|
productQty: this.printLabelInfo.productQty,
|
lotTrackingIfs: this.printLabelInfo.lotTrackingIfs,
|
unit: this.printLabelInfo.unit,
|
customerOrderNo: this.printLabelInfo.customerOrderNo,
|
customerName: this.printLabelInfo.customerName,
|
operationName: this.printLabelInfo.operationName,
|
workstationName: this.printLabelInfo.workstationName,
|
grossWeight: this.printLabelInfo.grossWeight,
|
netWeight: this.printLabelInfo.netWeight,
|
theoryWeight: this.printLabelInfo.theoryWeight,
|
segmentDesc: this.printLabelInfo.segmentDesc,
|
reelNumber: this.printLabelInfo.reelNumber,
|
reelWeight: this.printLabelInfo.reelWeight,
|
nowTime: this.printLabelInfo.nowTime,
|
productionPerson: this.printLabelInfo.productionPerson,
|
remark: this.printLabelInfo.remark
|
}
|
console.log('this.dataForm', this.dataForm)
|
})
|
}
|
}
|
},
|
computed: {
|
...mapGetters(['userInfo'])
|
},
|
methods: {
|
beginSmalllPrint() {
|
this.LODOP = getLodop()
|
this.LODOP.SET_LICENSES(
|
'南通市鑫阳软件开发有限公司',
|
'60F8E5078AE17DEB340C94BC7E83CAFF',
|
'',
|
''
|
)
|
this.LODOP.PRINT_INITA(0, 0, 300, 100, '')
|
this.LODOP.SET_PRINT_PAGESIZE(0, 600, 200, '')
|
this.LODOP.SET_PRINT_MODE('PRINT_NOCOLLATE', 1)
|
this.LODOP.ADD_PRINT_BARCODE(
|
4,
|
30,
|
170,
|
18,
|
'Code39',
|
this.dataForm.outBatchNo
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'ShowBarText', 0)
|
this.LODOP.ADD_PRINT_TEXT(25, 25, 85, 20, 'SN号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 6)
|
this.LODOP.ADD_PRINT_TEXT(25, 65, 105, 20, this.dataForm.outBatchNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 6)
|
this.LODOP.ADD_PRINT_TEXT(26, 155, 126, 20, this.dataForm.productQty)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 7)
|
this.LODOP.ADD_PRINT_TEXT(37, 25, 85, 20, '零件名称:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 6)
|
this.LODOP.ADD_PRINT_TEXT(37, 75, 146, 35, this.dataForm.partName)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 6)
|
this.LODOP.ADD_PRINT_TEXT(58, 25, 85, 20, '备注:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 6)
|
this.LODOP.ADD_PRINT_TEXT(58, 65, 154, 31, this.dataForm.remark)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 6)
|
// this.LODOP.PREVIEW()
|
this.LODOP.PRINT()
|
}
|
}
|
}
|
</script>
|
<style scoped></style>
|