<template>
|
<el-dialog
|
v-diadrag
|
:title="!dataForm.id ? '新增' : '修改'"
|
:close-on-click-modal="false"
|
:visible.sync="visible"
|
class="certificate-form-dialog"
|
>
|
<div slot="title">
|
<div style="display:flex;">
|
<div>新增</div>
|
<div style="margin-left:30px;">
|
<span style="color:red;">打印份数:</span
|
><el-input-number
|
v-model="certificateLabelNum"
|
:min="1"
|
:max="20"
|
label="描述文字"
|
></el-input-number>
|
</div>
|
</div>
|
</div>
|
<div style="display:flex;justify-content:space-around;">
|
<div class="feeder-main-info">
|
<el-form
|
:model="dataForm"
|
:rules="dataRule"
|
ref="dataForm"
|
label-width="120px"
|
class="l-mes"
|
>
|
<el-row>
|
<el-col :span="24">
|
<el-form-item label="SN号" prop="sn">
|
<el-input
|
v-model="dataForm.sn"
|
ref="sn_input"
|
placeholder="SN号"
|
clearable
|
@keyup.enter.native="scanSn()"
|
>
|
</el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="24">
|
<el-form-item label="生产零件号" prop="partNo">
|
<span
|
style="display:block;border-bottom:1px solid #ddd;height: 30px;"
|
>{{ dataForm.partNo }}</span
|
>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="24">
|
<el-form-item label="入库零件号" prop="partNoAfter">
|
<span
|
style="display:block;border-bottom:1px solid #ddd;height: 30px;"
|
>{{ dataForm.partNoAfter }}</span
|
>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="24">
|
<el-form-item label="规格" prop="specs">
|
<span
|
style="display:block;border-bottom:1px solid #ddd;height: 30px;"
|
>{{ dataForm.specs }}</span
|
>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="24">
|
<el-form-item label="生产长度" prop="stockQuantity">
|
<span
|
style="display:block;border-bottom:1px solid #ddd;height: 30px;"
|
>{{ dataForm.stockQuantity }}</span
|
>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="24">
|
<el-form-item label="入库长度" prop="stockQuantityAfter">
|
<el-input v-model="dataForm.stockQuantityAfter" />
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="24">
|
<el-form-item label="日期" prop="date">
|
<el-input v-model="dataForm.date" />
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="24">
|
<el-form-item label="改后检验员" prop="examinerAfter">
|
<el-select
|
v-model="dataForm.examinerAfter"
|
placeholder=""
|
style="width: 100%;"
|
clearable
|
>
|
<el-option
|
v-for="(item, index) in examinerOptions"
|
:key="index"
|
:label="item.label"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="24">
|
<el-form-item label="默认检验员" prop="examiner">
|
<!--<el-select
|
v-model="dataForm.examiner"
|
placeholder="请选择"
|
@change="changeExaminerHandle"
|
style="width: 100%;"
|
>
|
<el-option
|
v-for="(item, index) in examinerOptions"
|
:key="index"
|
:label="item.label"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>-->
|
<span
|
style="display:block;border-bottom:1px solid #ddd;height: 30px;"
|
>{{ dataForm.examiner }}</span
|
>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</el-form>
|
</div>
|
<div class="feeder-sn-info">
|
<div class="feeder-sn-similar">
|
<span style="width:65px;line-height:32px;">同类SN号</span>
|
<el-input
|
v-model="currSimilarSn"
|
clearable
|
@keyup.enter.native="scanSimilarSn()"
|
/>
|
</div>
|
<div class="feeder-sn-similars">
|
<div
|
v-for="(item, index) in similarSns"
|
:key="index"
|
class="feeder-sn-similars-item-div"
|
>
|
<div style="width:20px;">{{ index + 1 }}</div>
|
<div style="width:80%;">{{ item.sn }}</div>
|
<div class="feeder-sn-similars-item-btn">
|
<i class="el-icon-delete" @click="delsimilarSn(index)"></i>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="visible = false">取消</el-button>
|
<el-button
|
type="primary"
|
:disabled="isSubmit"
|
v-thinclick="`dataFormSubmitAndNew`"
|
>保存并新建</el-button
|
>
|
<el-button
|
type="primary"
|
:disabled="isSubmit"
|
v-thinclick="`dataFormSubmitAndPrintAndNew`"
|
ref="submit_btn"
|
>保存并新建并打印</el-button
|
>
|
</span>
|
<secretFormDialog
|
:currshowlist.sync="showSecretForm"
|
:formPageType="formPageType"
|
@goOnPrint="goOnPrint"
|
/>
|
</el-dialog>
|
</template>
|
<script>
|
import {
|
addObj,
|
changeExaminer,
|
getBySn,
|
getExaminer,
|
updatePrintNum
|
} from '@/api/certificate/feedercertificate'
|
import { remote } from '@/api/admin/dict'
|
import getLodop from '@/util/lodop'
|
import { getYearAndMonth } from '@/util/date'
|
import { judgeLabelMark } from '@/api/warehouse/check'
|
import secretFormDialog from './secret-form.vue'
|
|
export default {
|
components: { secretFormDialog },
|
data() {
|
return {
|
formPageType: '1',
|
showSecretForm: false,
|
visible: false,
|
showPart: false,
|
dataForm: {
|
id: 0,
|
sn: null,
|
partNo: null,
|
partName: null,
|
specs: null,
|
stockQuantity: null,
|
stockQuantityAfter: null,
|
date: null,
|
examiner: null,
|
ifsBatchNo: null,
|
partModel: null,
|
examinerBefore: null,
|
partNoBefore: null,
|
partNoAfter: null,
|
examinerAfter: null,
|
cusMaterialCode: null,
|
prodName: null,
|
partFamilyNo: null
|
},
|
dataRule: {
|
sn: [{ required: true, message: 'SN号不能为空', trigger: 'blur' }],
|
stockQuantityAfter: [
|
{
|
validator: (rule, value, callback) => {
|
if (value) {
|
const reg = /(^[1-9]([0-9]+)?(\.[0-9]{1,6})?$)|(^(0){1}$)|(^[0-9]\.[0-9]{1,6}$)/
|
if (!reg.test(value)) {
|
callback(new Error('请输入数字,最多六位小数'))
|
} else {
|
if (value > this.dataForm.stockQuantity) {
|
callback(new Error('入库长度不能比生产长度大'))
|
} else {
|
callback()
|
}
|
}
|
} else {
|
callback()
|
}
|
},
|
trigger: 'blur'
|
}
|
]
|
},
|
currSimilarSn: null,
|
isSubmit: false,
|
examinerOptions: [],
|
similarSns: [],
|
audioObj: null,
|
certificateLabelNum: 1,
|
oriStockQuantityAfter: null
|
}
|
},
|
watch: {
|
'dataForm.partNo'(newValue, oldValue) {
|
if (newValue) {
|
this.examinerOptions = []
|
changeExaminer({ partNo: newValue }).then((response) => {
|
const resData = response.data
|
this.examinerOptions = []
|
if (resData.data != null) {
|
resData.data.forEach((item) => {
|
this.examinerOptions.push({
|
value: item,
|
label: item
|
})
|
})
|
}
|
})
|
}
|
}
|
},
|
methods: {
|
init(id) {
|
this.dataForm.id = id || 0
|
this.visible = true
|
this.certificateLabelNum = 1
|
this.$nextTick(() => {
|
this.initData()
|
this.similarSns = []
|
this.$refs.sn_input.focus()
|
})
|
},
|
scanSn() {
|
if (this.dataForm.sn != null && this.dataForm.sn != '') {
|
getBySn({ sn: this.dataForm.sn })
|
.then((response) => {
|
const resData = response.data
|
if (resData.code == 0) {
|
const snInfo = resData.data
|
if (snInfo != null) {
|
this.dataForm.sn = snInfo.sn
|
this.dataForm.partNo = snInfo.partNo
|
this.dataForm.partName = snInfo.partName
|
this.dataForm.specs = snInfo.specs
|
this.dataForm.partModel = snInfo.partModel
|
this.dataForm.stockQuantity = snInfo.stockQuantity
|
this.dataForm.stockQuantityAfter = snInfo.stockQuantity
|
this.dataForm.date = snInfo.date
|
this.dataForm.examiner = snInfo.examiner
|
this.dataForm.ifsBatchNo = snInfo.ifsBatchNo
|
this.dataForm.examinerBefore = null
|
this.dataForm.partNoBefore = null
|
this.dataForm.partNoAfter = snInfo.partNoAfter
|
this.dataForm.examinerAfter = snInfo.examinerAfter
|
this.dataForm.cusMaterialCode = snInfo.cusMaterialCode
|
this.dataForm.prodName = snInfo.prodName
|
this.dataForm.partFamilyNo = snInfo.partFamilyNo
|
this.oriStockQuantityAfter = snInfo.stockQuantity
|
this.$refs.submit_btn.$el.focus()
|
} else {
|
this.initData()
|
}
|
} else {
|
this.audioObj.play()
|
}
|
})
|
.catch(() => {
|
this.audioObj.play()
|
this.initData()
|
})
|
} else {
|
this.audioObj.play()
|
}
|
},
|
initData() {
|
this.dataForm.sn = null
|
this.dataForm.partNo = null
|
this.dataForm.partName = null
|
this.dataForm.specs = null
|
this.dataForm.partModel = null
|
this.dataForm.stockQuantity = null
|
this.dataForm.stockQuantityAfter = null
|
this.dataForm.date = null
|
this.dataForm.examiner = null
|
this.dataForm.ifsBatchNo = null
|
this.dataForm.examinerBefore = null
|
this.dataForm.partNoBefore = null
|
this.dataForm.partNoAfter = null
|
this.dataForm.examinerAfter = null
|
this.dataForm.cusMaterialCode = null
|
this.dataForm.prodName = null
|
},
|
changeExaminerHandle() {
|
if (this.dataForm.examiner != null && this.dataForm.examiner != '') {
|
changeExaminer({
|
partNo: this.dataForm.partNo,
|
examiner: this.dataForm.examiner
|
}).then((response) => {
|
const resData = response.data
|
if (resData.code == 0) {
|
const partInfo = resData.data
|
if (partInfo != null) {
|
this.dataForm.partNo = partInfo.partNoAfter
|
this.dataForm.partName = partInfo.partName
|
this.dataForm.specs = partInfo.specs
|
this.dataForm.partModel = partInfo.partModel
|
this.dataForm.examinerBefore = partInfo.examiner
|
this.dataForm.partNoBefore = partInfo.partNo
|
this.dataForm.cusMaterialCode = partInfo.cusMaterialCode
|
} else {
|
this.dataForm.partNo = null
|
this.dataForm.partName = null
|
this.dataForm.specs = null
|
this.dataForm.partModel = null
|
this.dataForm.examinerBefore = null
|
this.dataForm.partNoBefore = null
|
this.dataForm.cusMaterialCode = null
|
}
|
}
|
})
|
}
|
},
|
scanSimilarSn() {
|
if (this.currSimilarSn != null && this.currSimilarSn != '') {
|
if (this.currSimilarSn == this.dataForm.sn) {
|
this.audioObj.play()
|
this.$message.error('不可重复扫入SN号')
|
return
|
}
|
if (this.similarSns.length > 0) {
|
if (
|
this.similarSns.findIndex(
|
(item) => item.sn === this.currSimilarSn
|
) >= 0
|
) {
|
this.audioObj.play()
|
this.$message.error('不可重复扫入SN号')
|
return
|
}
|
}
|
getBySn({ sn: this.dataForm.sn, commonSn: this.currSimilarSn })
|
.then((response) => {
|
const resData = response.data
|
if (resData.code == 0) {
|
const snInfo = resData.data
|
if (snInfo != null) {
|
const similarSnInfo = {
|
sn: snInfo.sn,
|
ifsBatchNo: snInfo.ifsBatchNo
|
}
|
this.similarSns.push(similarSnInfo)
|
this.currSimilarSn = null
|
}
|
} else {
|
this.audioObj.play()
|
}
|
})
|
.catch(() => {
|
this.audioObj.play()
|
})
|
} else {
|
this.audioObj.play()
|
}
|
},
|
delsimilarSn(index) {
|
this.similarSns.splice(index, 1)
|
},
|
dataFormSubmitAndNew() {
|
// 校验入库长度是否修改
|
if (this.oriStockQuantityAfter == this.dataForm.stockQuantityAfter) {
|
this.dataFormSubmit()
|
} else {
|
this.$confirm('入库长度已修改, 是否继续保存?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
})
|
.then(() => {
|
this.dataFormSubmit()
|
})
|
.catch(() => {
|
this.$message({
|
type: 'info',
|
message: '已取消保存'
|
})
|
})
|
}
|
},
|
// 表单提交
|
dataFormSubmit() {
|
this.$refs.sn_input.focus()
|
this.isSubmit = true
|
this.$refs.dataForm.validate((valid) => {
|
if (valid) {
|
const submitData = []
|
submitData.push({
|
sn: this.dataForm.sn,
|
partNo: this.dataForm.partNo,
|
partName: this.dataForm.partName,
|
specs: this.dataForm.specs,
|
partModel: this.dataForm.partModel,
|
stockQuantity: this.dataForm.stockQuantity,
|
stockQuantityAfter: this.dataForm.stockQuantityAfter,
|
date: this.dataForm.date,
|
examiner: this.dataForm.examiner,
|
ifsBatchNo: this.dataForm.ifsBatchNo,
|
examinerBefore: this.dataForm.examinerBefore,
|
partNoBefore: this.dataForm.partNoBefore,
|
partNoAfter: this.dataForm.partNoAfter,
|
examinerAfter: this.dataForm.examinerAfter,
|
prodName: this.dataForm.prodName,
|
partFamilyNo: this.dataForm.partFamilyNo
|
})
|
if (this.similarSns.length > 0) {
|
this.similarSns.forEach((item) => {
|
submitData.push({
|
sn: item.sn,
|
partNo: this.dataForm.partNo,
|
partName: this.dataForm.partName,
|
specs: this.dataForm.specs,
|
partModel: this.dataForm.partModel,
|
stockQuantity: this.dataForm.stockQuantity,
|
stockQuantityAfter: this.dataForm.stockQuantityAfter,
|
date: this.dataForm.date,
|
examiner: this.dataForm.examiner,
|
ifsBatchNo: item.ifsBatchNo,
|
examinerBefore: this.dataForm.examinerBefore,
|
partNoBefore: this.dataForm.partNoBefore,
|
partNoAfter: this.dataForm.partNoAfter,
|
examinerAfter: this.dataForm.examinerAfter,
|
prodName: this.dataForm.prodName,
|
partFamilyNo: this.dataForm.partFamilyNo
|
})
|
})
|
}
|
addObj(submitData)
|
.then((data) => {
|
this.$message.success('保存成功')
|
this.initData()
|
this.similarSns = []
|
this.isSubmit = false
|
this.$emit('refreshDataList')
|
})
|
.catch(() => {
|
this.isSubmit = false
|
})
|
} else {
|
this.isSubmit = false
|
}
|
})
|
},
|
goOnPrint(result) {
|
if (result) {
|
this.checkStockQuantityAfter()
|
} else {
|
this.$message.error('密码错误')
|
}
|
},
|
dataFormSubmitAndPrintAndNew() {
|
if (this.certificateLabelNum > 1) {
|
// 需输入密码
|
this.showSecretForm = true
|
} else {
|
this.checkStockQuantityAfter()
|
}
|
},
|
checkStockQuantityAfter() {
|
// 校验入库长度是否修改
|
if (this.oriStockQuantityAfter == this.dataForm.stockQuantityAfter) {
|
this.dataFormSubmitAndPrint()
|
} else {
|
this.$confirm('入库长度已修改, 是否继续保存?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
})
|
.then(() => {
|
this.dataFormSubmitAndPrint()
|
})
|
.catch(() => {
|
this.$message({
|
type: 'info',
|
message: '已取消保存'
|
})
|
})
|
}
|
},
|
dataFormSubmitAndPrint() {
|
this.$refs.sn_input.focus()
|
this.isSubmit = true
|
this.$refs.dataForm.validate((valid) => {
|
if (valid) {
|
const submitData = []
|
submitData.push({
|
sn: this.dataForm.sn,
|
partNo: this.dataForm.partNo,
|
partName: this.dataForm.partName,
|
specs: this.dataForm.specs,
|
partModel: this.dataForm.partModel,
|
stockQuantity: this.dataForm.stockQuantity,
|
stockQuantityAfter: this.dataForm.stockQuantityAfter,
|
date: this.dataForm.date,
|
examiner: this.dataForm.examiner,
|
ifsBatchNo: this.dataForm.ifsBatchNo,
|
examinerBefore: this.dataForm.examinerBefore,
|
partNoBefore: this.dataForm.partNoBefore,
|
partNoAfter: this.dataForm.partNoAfter,
|
examinerAfter: this.dataForm.examinerAfter,
|
cusMaterialCode: this.dataForm.cusMaterialCode,
|
prodName: this.dataForm.prodName,
|
partFamilyNo: this.dataForm.partFamilyNo
|
})
|
if (this.similarSns.length > 0) {
|
this.similarSns.forEach((item) => {
|
submitData.push({
|
sn: item.sn,
|
partNo: this.dataForm.partNo,
|
partName: this.dataForm.partName,
|
specs: this.dataForm.specs,
|
partModel: this.dataForm.partModel,
|
stockQuantity: this.dataForm.stockQuantity,
|
stockQuantityAfter: this.dataForm.stockQuantityAfter,
|
date: this.dataForm.date,
|
examiner: this.dataForm.examiner,
|
ifsBatchNo: item.ifsBatchNo,
|
examinerBefore: this.dataForm.examinerBefore,
|
partNoBefore: this.dataForm.partNoBefore,
|
partNoAfter: this.dataForm.partNoAfter,
|
examinerAfter: this.dataForm.examinerAfter,
|
cusMaterialCode: this.dataForm.cusMaterialCode,
|
prodName: this.dataForm.prodName,
|
partFamilyNo: this.dataForm.partFamilyNo
|
})
|
})
|
}
|
addObj(submitData)
|
.then((data) => {
|
this.$message.success('保存成功')
|
this.printLabel(submitData, data.data.data)
|
this.initData()
|
this.similarSns = []
|
this.isSubmit = false
|
this.$emit('refreshDataList')
|
})
|
.catch(() => {
|
this.isSubmit = false
|
})
|
} else {
|
this.isSubmit = false
|
}
|
})
|
},
|
printLabel(dataList, returnIds) {
|
if (dataList.length > 0) {
|
const currYearAndMonth = getYearAndMonth()
|
this.LODOP = getLodop()
|
// 找出所有要打印的SN的list
|
const snList = []
|
dataList.forEach((ele) => {
|
snList.push(ele.sn)
|
})
|
// 查询是否正在盘点
|
judgeLabelMark(snList).then((resp) => {
|
const respData = resp.data
|
const markArr = respData.data
|
let data
|
let markFlag = true
|
for (let i = 0; i < dataList.length; i++) {
|
for (let j = 0; j < this.certificateLabelNum; j++) {
|
data = dataList[i]
|
markFlag = markArr.includes(data.sn)
|
if (markFlag) {
|
const printExaminer =
|
data.examinerAfter == null
|
? data.examiner
|
: data.examinerAfter
|
const qr = {
|
part_no: data.partNoAfter,
|
lot_batch_no: data.ifsBatchNo,
|
qty_arrived: data.stockQuantityAfter,
|
wdr: printExaminer,
|
material_code:
|
data.cusMaterialCode == null ? '' : data.cusMaterialCode,
|
sn_no: data.sn
|
}
|
const qrStr = JSON.stringify(qr)
|
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(102, 5, 87, 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(102, 80, 355, 17, data.prodName)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(118, 5, 87, 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(118, 80, 180, 17, data.partModel)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_BARCODE(9, 270, 115, 160, 'QRCode', qrStr)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'QRCodeVersion', 7)
|
this.LODOP.SET_PRINT_STYLEA(0, 'QRCodeErrorLevel', 'L')
|
|
this.LODOP.ADD_PRINT_TEXT(134, 17, 87, 20, '零件号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(134, 80, 180, 17, data.partNoAfter)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
|
this.LODOP.ADD_PRINT_TEXT(150, 17, 53, 20, 'SN号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(150, 50, 180, 20, data.sn)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(150, 145, 180, 20, data.partFamilyNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(118, 241, 53, 20, '日期:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(118, 288, 80, 20, data.date)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(134, 241, 64, 20, '检验员:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(134, 290, 80, 20, printExaminer)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 12)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(150, 241, 53, 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(
|
150,
|
288,
|
80,
|
16,
|
data.stockQuantityAfter != null &&
|
data.stockQuantityAfter != ''
|
? Number(data.stockQuantityAfter) * 1000 + 'm'
|
: ''
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 12)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_BARCODE(
|
167,
|
20,
|
368,
|
29,
|
'Code39',
|
data.sn
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 8)
|
this.LODOP.SET_PRINT_STYLEA(0, 'ShowBarText', 0)
|
this.LODOP.ADD_PRINT_LINE(205, 20, 205, 180, 0, 2)
|
this.LODOP.ADD_PRINT_LINE(205, 214, 205, 374, 0, 2)
|
this.LODOP.ADD_PRINT_TEXT(198, 180, 34, 15, currYearAndMonth)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
|
this.LODOP.ADD_PRINT_LINE(213, 20, 213, 374, 0, 2)
|
this.LODOP.ADD_PRINT_TEXT(28, 133, 100, 20, '产品合格证')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 13)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(
|
56,
|
102,
|
177,
|
20,
|
'中天射频电缆有限公司'
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_IMAGE(
|
9,
|
0,
|
105,
|
41,
|
'<img src="/img/certificatelogo.png"/>'
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Stretch', 2)
|
if (
|
data.stockQuantityAfter != null &&
|
data.stockQuantityAfter != '' &&
|
Number(data.stockQuantityAfter) * 1000 == 200
|
) {
|
} else {
|
this.LODOP.ADD_PRINT_RECT(0, 0, 370, 223, 0, 7)
|
}
|
this.LODOP.PRINT()
|
// this.LODOP.PREVIEW()
|
} else {
|
const printExaminer =
|
data.examinerAfter == null
|
? data.examiner
|
: data.examinerAfter
|
const qr = {
|
part_no: data.partNoAfter,
|
lot_batch_no: data.ifsBatchNo,
|
qty_arrived: data.stockQuantityAfter,
|
wdr: printExaminer,
|
material_code:
|
data.cusMaterialCode == null ? '' : data.cusMaterialCode,
|
sn_no: data.sn
|
}
|
const qrStr = JSON.stringify(qr)
|
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(106, 5, 87, 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(106, 80, 355, 17, data.prodName)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(126, 5, 87, 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(126, 80, 180, 17, data.partModel)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_BARCODE(9, 270, 115, 160, 'QRCode', qrStr)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'QRCodeVersion', 7)
|
this.LODOP.SET_PRINT_STYLEA(0, 'QRCodeErrorLevel', 'L')
|
|
this.LODOP.ADD_PRINT_TEXT(146, 17, 87, 20, '零件号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(146, 80, 180, 17, data.partNoAfter)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 10)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
|
this.LODOP.ADD_PRINT_TEXT(166, 17, 53, 20, 'SN号:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(166, 50, 180, 20, data.sn)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(166, 145, 180, 20, data.partFamilyNo)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(126, 241, 53, 20, '日期:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(126, 288, 80, 20, data.date)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(146, 241, 64, 20, '检验员:')
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(146, 290, 80, 20, printExaminer)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 12)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(166, 241, 53, 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(
|
166,
|
288,
|
80,
|
16,
|
data.stockQuantityAfter != null &&
|
data.stockQuantityAfter != ''
|
? Number(data.stockQuantityAfter) * 1000 + 'm'
|
: ''
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 12)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_BARCODE(
|
194,
|
20,
|
368,
|
29,
|
'Code39',
|
data.sn
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 8)
|
this.LODOP.SET_PRINT_STYLEA(0, 'ShowBarText', 0)
|
this.LODOP.ADD_PRINT_TEXT(28, 133, 100, 20, '产品合格证')
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 13)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_TEXT(
|
56,
|
102,
|
177,
|
20,
|
'中天射频电缆有限公司'
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'FontSize', 11)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
|
this.LODOP.ADD_PRINT_IMAGE(
|
9,
|
0,
|
105,
|
41,
|
'<img src="/img/certificatelogo.png"/>'
|
)
|
this.LODOP.SET_PRINT_STYLEA(0, 'Stretch', 2)
|
if (
|
data.stockQuantityAfter != null &&
|
data.stockQuantityAfter != '' &&
|
Number(data.stockQuantityAfter) * 1000 == 200
|
) {
|
} else {
|
this.LODOP.ADD_PRINT_RECT(0, 0, 370, 223, 0, 7)
|
}
|
this.LODOP.PRINT()
|
// this.LODOP.PREVIEW()
|
}
|
}
|
}
|
// 记录打印次数
|
const ids = []
|
returnIds.forEach((item) => {
|
ids.push(item)
|
})
|
|
if (ids.length > 0) {
|
updatePrintNum({
|
ids: ids,
|
copies: this.certificateLabelNum
|
}).then((repsonse) => {})
|
}
|
})
|
} else {
|
this.$message.warning('无SN可打印')
|
}
|
},
|
getExaminerDict() {
|
remote('examiner_type').then((response) => {
|
if (response.data.code === 0) {
|
this.examinerOptions = response.data.data
|
} else {
|
this.examinerOptions = []
|
}
|
})
|
}
|
},
|
mounted() {
|
// this.getExaminerDict()
|
this.audioObj = new Audio(require('@/assets/audio/alert.mp3'))
|
}
|
}
|
</script>
|
<style lang="scss" scoped>
|
.feeder-main-info {
|
width: 60%;
|
}
|
.feeder-sn-info {
|
width: 35%;
|
}
|
.feeder-sn-similar {
|
display: flex;
|
}
|
.feeder-sn-similar .el-input {
|
width: calc(100% - 65px);
|
}
|
.feeder-sn-similar .el-input >>> .el-input__inner {
|
border-top: 0px solid #ddd;
|
border-left: 0px solid #ddd;
|
border-right: 0px solid #ddd;
|
border-radius: 0px;
|
}
|
.feeder-sn-similars {
|
padding-top: 5px;
|
height: calc(330px - 32px);
|
overflow: auto;
|
}
|
.feeder-sn-similars-item-div {
|
display: flex;
|
height: 28px;
|
line-height: 28px;
|
color: forestgreen;
|
}
|
.feeder-sn-similars-item-btn >>> i {
|
color: red;
|
cursor: pointer;
|
}
|
.certificate-form-dialog >>> .el-dialog__body {
|
padding-top: 8px;
|
}
|
</style>
|