<template>
|
<el-dialog
|
width="70%"
|
title="标签信息"
|
top="3vh"
|
:visible.sync="innerVisible"
|
append-to-body
|
@close="$emit('update:currshowlist', false)"
|
:show="currshowlist"
|
:close-on-click-modal="false"
|
class="warehousing-label-dialog"
|
>
|
<el-form :model="dataForm" ref="dataForm" label-width="90px" class="l-mes">
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="零件号" prop="partNo">
|
<el-input v-model="dataForm.partNo" disabled></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<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="12">
|
<el-form-item label="SN号" prop="outBatchNo"
|
><el-input
|
v-model="dataForm.outBatchNo"
|
placeholder="SN号"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="IFS批次号" prop="ifsBatchNo"
|
><el-input
|
v-model="dataForm.ifsBatchNo"
|
placeholder="IFS批次号"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="生产数量" prop="productQty">
|
<el-input
|
v-model="dataForm.productQty"
|
placeholder="生产数量"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="单位" prop="unit"
|
><el-input v-model="dataForm.unit" placeholder="单位"></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="分段描述" prop="segmentDesc"
|
><el-input
|
v-model="dataForm.segmentDesc"
|
placeholder="分段描述"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="规格型号" prop="specificationAndMode">
|
<el-input
|
v-model="dataForm.specificationAndMode"
|
placeholder="规格型号"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="客户物料编码" prop="cusMaterialCode">
|
<el-input
|
v-model="dataForm.cusMaterialCode"
|
placeholder="客户物料编码"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="生产日期" prop="productionTime">
|
<el-date-picker
|
v-model="dataForm.productionTime"
|
type="datetime"
|
format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd"
|
placeholder="选择生产日期"
|
style="width:100%"
|
>
|
</el-date-picker>
|
</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="`printData`">打印</el-button>
|
</span>
|
</el-dialog>
|
</template>
|
<script>
|
import { mapGetters } from 'vuex'
|
import { getObj } from '@/api/basic/part'
|
import getLodop from '@/util/lodop'
|
import { getYearAndMonth } from '@/util/date'
|
import { judgeLabelMark } from '@/api/warehouse/check'
|
export default {
|
props: {
|
currshowlist: {
|
type: Boolean,
|
default: false
|
},
|
printLabelInfo: {
|
type: Object,
|
default: () => {
|
return {}
|
}
|
}
|
},
|
data() {
|
return {
|
innerVisible: false,
|
dataForm: {},
|
partInfo: null
|
}
|
},
|
watch: {
|
currshowlist() {
|
this.innerVisible = this.currshowlist
|
if (this.currshowlist) {
|
this.$nextTick(() => {
|
getObj(this.printLabelInfo.partId).then((response) => {
|
const resData = response.data
|
this.partInfo = resData.data
|
})
|
this.dataForm = {
|
partNo: this.printLabelInfo.partNo,
|
partName: this.printLabelInfo.partName,
|
outBatchNo: this.printLabelInfo.outBatchNo,
|
ifsBatchNo: this.printLabelInfo.ifsBatchNo,
|
productQty: this.printLabelInfo.productQty,
|
lotTrackingIfs: this.printLabelInfo.lotTrackingIfs,
|
unit: this.printLabelInfo.unit,
|
segmentDesc: this.printLabelInfo.segmentDesc,
|
specificationAndMode: this.printLabelInfo.specificationAndMode,
|
cusMaterialCode: this.printLabelInfo.cusMaterialCode,
|
productionTime: this.printLabelInfo.productionTime
|
}
|
console.log('this.dataForm', this.dataForm)
|
})
|
}
|
}
|
},
|
computed: {
|
...mapGetters(['userInfo'])
|
},
|
methods: {
|
printData() {
|
// 找出所有要打印的SN的list
|
const snList = []
|
snList.push(this.dataForm.outBatchNo)
|
// 查询是否正在盘点
|
judgeLabelMark(snList).then((resp) => {
|
const respData = resp.data
|
const markArr = respData.data
|
let markFlag = true
|
markFlag = markArr.includes(this.dataForm.outBatchNo)
|
if (markFlag) {
|
this.beginPrint(true)
|
} else {
|
this.beginPrint(false)
|
}
|
})
|
},
|
beginPrint(isCheck) {
|
this.LODOP = getLodop()
|
this.dataForm.lotTrackingIfs = this.partInfo.lotTrackingIfs
|
console.log(this.dataForm)
|
const qr = {
|
part_no: this.dataForm.partNo,
|
lot_batch_no: this.dataForm.ifsBatchNo,
|
qty_arrived: this.dataForm.productQty,
|
wdr: this.dataForm.outBatchNo,
|
unit_meas: this.dataForm.unit,
|
material_code: this.dataForm.cusMaterialCode,
|
sn_no: this.dataForm.outBatchNo
|
}
|
const qrStr = JSON.stringify(qr)
|
if (isCheck) {
|
const currYearAndMonth = getYearAndMonth()
|
this.LODOP.SET_LICENSES(
|
'南通市鑫阳软件开发有限公司',
|
'60F8E5078AE17DEB340C94BC7E83CAFF',
|
'',
|
''
|
)
|
this.LODOP.PRINT_INITA(0, -1, 500, 300, '')
|
this.LODOP.SET_PRINT_PAGESIZE(0, 1000, 600, '')
|
this.LODOP.SET_PRINT_MODE('PRINT_NOCOLLATE', 1)
|
this.LODOP.ADD_PRINT_TEXT(60, 27, 63, 20, 'SN号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(60, 54, 140, 20, this.dataForm.outBatchNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(82, 10, 85, 20, '零件号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(82, 58, 161, 22, this.dataForm.partNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_BARCODE(53, 223, 148, 214, 'QRCode', qrStr)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'QRCodeVersion', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'QRCodeErrorLevel', 'L')
|
this.LODOP.ADD_PRINT_BARCODE(
|
10,
|
20,
|
368,
|
29,
|
this.dataForm.outBatchNo == '*' ? '93Extended' : 'Code39',
|
this.dataForm.outBatchNo
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'ShowBarText', 0)
|
this.LODOP.ADD_PRINT_TEXT(104, 13, 100, 20, '生产日期:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(
|
104,
|
79,
|
171,
|
20,
|
this.dataForm.productionTime == null
|
? ''
|
: this.dataForm.productionTime.substring(0, 10)
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(126, 40, 91, 20, '数量:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(
|
126,
|
79,
|
134,
|
20,
|
this.dataForm.productQty + ' ' + this.dataForm.unit
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(148, 13, 100, 20, '分段描述:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(148, 79, 160, 20, this.dataForm.segmentDesc)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(170, 13, 100, 20, '规格型号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(
|
170,
|
79,
|
310,
|
40,
|
this.dataForm.specificationAndMode
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_LINE(215, 20, 215, 163, 0, 2)
|
this.LODOP.ADD_PRINT_LINE(215, 197, 215, 360, 0, 2)
|
this.LODOP.ADD_PRINT_TEXT(208, 163, 34, 15, currYearAndMonth)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.ADD_PRINT_LINE(225, 20, 225, 360, 0, 2)
|
// this.LODOP.PREVIEW()
|
this.LODOP.PRINT()
|
} else {
|
this.LODOP.SET_LICENSES(
|
'南通市鑫阳软件开发有限公司',
|
'60F8E5078AE17DEB340C94BC7E83CAFF',
|
'',
|
''
|
)
|
this.LODOP.PRINT_INITA(0, -1, 500, 300, '')
|
this.LODOP.SET_PRINT_PAGESIZE(0, 1000, 600, '')
|
this.LODOP.SET_PRINT_MODE('PRINT_NOCOLLATE', 1)
|
this.LODOP.ADD_PRINT_TEXT(60, 27, 63, 20, 'SN号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(60, 54, 140, 20, this.dataForm.outBatchNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(82, 10, 85, 20, '零件号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(82, 58, 161, 22, this.dataForm.partNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_BARCODE(53, 223, 148, 214, 'QRCode', qrStr)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'QRCodeVersion', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'QRCodeErrorLevel', 'L')
|
this.LODOP.ADD_PRINT_BARCODE(
|
10,
|
20,
|
368,
|
29,
|
this.dataForm.outBatchNo == '*' ? '93Extended' : 'Code39',
|
this.dataForm.outBatchNo
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'ShowBarText', 0)
|
this.LODOP.ADD_PRINT_TEXT(104, 13, 100, 20, '生产日期:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(
|
104,
|
79,
|
171,
|
20,
|
this.dataForm.productionTime == null
|
? ''
|
: this.dataForm.productionTime.substring(0, 10)
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(126, 40, 91, 20, '数量:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(
|
126,
|
79,
|
134,
|
20,
|
this.dataForm.productQty + ' ' + this.dataForm.unit
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(148, 13, 100, 20, '分段描述:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(148, 79, 160, 20, this.dataForm.segmentDesc)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(170, 13, 100, 20, '规格型号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(
|
170,
|
79,
|
310,
|
40,
|
this.dataForm.specificationAndMode
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
// this.LODOP.PREVIEW()
|
this.LODOP.PRINT()
|
}
|
}
|
}
|
}
|
</script>
|
<style scoped></style>
|