| | |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-if="operation==='add'" |
| | | label="产品名称" |
| | | label="产品名称/编码" |
| | | prop="partcode" |
| | | > |
| | | <el-select |
| | |
| | | <el-option |
| | | v-for="item in partArr" |
| | | :key="item.partcode" |
| | | :label="item.partname" |
| | | :label="item.partname+'/'+item.partcode" |
| | | :value="item.partcode" |
| | | /> |
| | | </el-select> |
| | |
| | | </div> |
| | | <div |
| | | id="qrCode" |
| | | style="width: 22%;height:97px; |
| | | style="width: 22%;height:90px; |
| | | margin-top: 20px; |
| | | overflow-y: scroll;display: flex; |
| | | justify-content: center; |
| | | position: relative;" |
| | | > |
| | | <!-- <div id="qrCode0" ref="qrCodeDiv0" />--> |
| | | <div id="qrCode0" ref="qrCodeDiv0" /> |
| | | </div> |
| | | <div style="background-color: #fff;width: 20px;height:120px; position: absolute;right: 0" /> |
| | | <div |
| | |
| | | v-el-drag-dialog |
| | | title="预览" |
| | | :visible.sync="dialogVisible2" |
| | | width="1140" |
| | | width="1000" |
| | | top="10vh" |
| | | :close-on-click-modal="false" |
| | | @close="dialogVisible2Close" |
| | | > |
| | | <div style="height: 300px"> |
| | | <div style="height: 650px;overflow:auto;"> |
| | | <!-- 下拉框选择打印尺寸--> |
| | | <div style="display: flex;align-items: center;margin: 0 0 20px 0"> |
| | | <div v-if="!isLastPrint" style="display: flex;align-items: center;margin: 0 0 20px 0"> |
| | | <div>选择打印尺寸:</div> |
| | | <el-select |
| | | v-model="printSize" |
| | |
| | | </div> |
| | | <!-- 要打印的区域 --> |
| | | <!-- <div id="printMe2" :style="{paddingLeft:'10px',paddingTop: '5px'}">--> |
| | | <div v-if="!isLastPrint" id="printMe2" :style="printMe2StylePadding(printSize)"> |
| | | <div v-if="!isLastPrint" :style="printMe2StylePadding(printSize)"> |
| | | <!-- 80 * 50--> |
| | | <div |
| | | v-if="printSize===0" |
| | | style="display: flex;width: 280px;height: 160px;border: 1px solid #000;text-align: center;font-size: 10px;" |
| | |
| | | </div> |
| | | |
| | | </div> |
| | | <!-- 78 * 60 --> |
| | | <div |
| | | v-if="printSize===1" |
| | | style="display: flex;width: 280px;height: 160px;border: 1px solid #000;text-align: center;font-size: 10px;" |
| | |
| | | </div> |
| | | |
| | | </div> |
| | | <!-- 60 * 40 --> |
| | | <div |
| | | v-if="printSize===2" |
| | | style="display: flex;width: 220px;height: 130px;border: 1px solid #000;text-align: center;font-size: 12px" |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <div v-if="isLastPrint"> |
| | | 123 |
| | | <div v-if="isLastPrint" style="display: flex;flex-direction: column"> |
| | | |
| | | <div style="display: flex;font-weight: bold;font-size: 16px;margin-bottom: 20px;"> |
| | | <div style="width: 48%;"> |
| | | 请选择入库条码 |
| | | </div> |
| | | <div style="width: 48%;margin-left: 4%;"> |
| | | 已选中的入库条码 |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="display: flex;"> |
| | | <!-- 请选择入库条码--> |
| | | <div style="display: flex;flex-direction: column;height: 600px;overflow: auto;width: 48%;"> |
| | | <div |
| | | v-for="(item,index) in lastPrintArr" |
| | | :key="item.inbarcode" |
| | | :style="{marginTop:index===0?'':'15px'}" |
| | | style="display: flex;align-items: center;" |
| | | > |
| | | |
| | | <!-- v-if="printSize===0"--> |
| | | <div style="margin-right:40px"> |
| | | <el-checkbox |
| | | :key="item.inbarcode" |
| | | v-model="item.checked" |
| | | @change="val=>inbarcodeChange(val,item)" |
| | | /> |
| | | </div> |
| | | <div |
| | | style="display: flex;width: 280px;height: 160px;border: 1px solid #000;text-align: center;font-size: 10px;" |
| | | > |
| | | |
| | | <div style="width: 90px;display: flex;flex-direction: column;border-right: 1px solid #000"> |
| | | <div |
| | | style="display: flex;height: 96px;border-bottom:1px solid #000; |
| | | justify-content: center;align-items: center;position: relative" |
| | | > |
| | | <div |
| | | id="qrCode2" |
| | | ref="qrCodeDiv2" |
| | | style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" |
| | | /> |
| | | </div> |
| | | <div |
| | | style="display: flex;height: 32px;justify-content: flex-start;border-bottom:1px solid #000;align-items: center" |
| | | > |
| | | <div style="margin-left: 5px;width: 28px">数量:</div> |
| | | {{ item.good_qty }} |
| | | </div> |
| | | <div style="display: flex;height: 32px;justify-content: flex-start;align-items: center"> |
| | | <div style="margin-left: 5px;width: 42px">处理人:</div> |
| | | {{ item.username }} |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="width:190px;display: flex;flex-direction: column"> |
| | | <div |
| | | style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center;text-align: left" |
| | | > |
| | | <div style="width: 60px;margin-left: 5px;">工单编号:</div> |
| | | <div>{{ item.wo_code }}</div> |
| | | </div> |
| | | <div |
| | | style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center ;text-align: left" |
| | | > |
| | | <div style="width: 60px;margin-left: 5px;">产品编码:</div> |
| | | <div>{{ item.partcode }}</div> |
| | | </div> |
| | | <div |
| | | style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left" |
| | | > |
| | | <div style="width:60px;margin-left: 5px;">产品名称:</div> |
| | | <div>{{ item.partname }}</div> |
| | | </div> |
| | | <div |
| | | style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left" |
| | | > |
| | | <div style="width:60px;margin-left: 5px;">产品规格:</div> |
| | | <div>{{ item.partspec ? item.partspec : '/' }}</div> |
| | | </div> |
| | | <div |
| | | style="display: flex;height: 20%;justify-content: flex-start;align-items: center;text-align: left" |
| | | > |
| | | <div style="width: 60px;margin-left: 5px;">处理时间:</div> |
| | | <div>{{ item.lm_date }}</div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 已选中的入库条码--> |
| | | <div |
| | | style="display: flex;flex-direction: column;height: 600px;overflow: auto;width: 48%;margin-left: 50px;" |
| | | > |
| | | <div id="printMe2"> |
| | | <div |
| | | v-for="(item,index) in lastPrintArrSelected" |
| | | v-if="item.checked" |
| | | :key="item.inbarcode" |
| | | :style="{marginTop:index===0?'':'15px'}" |
| | | style="display: flex;align-items: center;" |
| | | > |
| | | <div |
| | | style="display: flex;width: 280px;height: 160px;border: 1px solid #000;text-align: center;font-size: 10px;" |
| | | > |
| | | |
| | | <div style="width: 90px;display: flex;flex-direction: column;border-right: 1px solid #000"> |
| | | <div |
| | | style="display: flex;height: 96px;border-bottom:1px solid #000; |
| | | justify-content: center;align-items: center;position: relative" |
| | | > |
| | | <div |
| | | id="qrCode3" |
| | | ref="qrCodeDiv3" |
| | | style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" |
| | | /> |
| | | </div> |
| | | <div |
| | | style="display: flex;height: 32px;justify-content: flex-start;border-bottom:1px solid #000;align-items: center" |
| | | > |
| | | <div style="margin-left: 5px;width: 28px">数量:</div> |
| | | {{ item.good_qty }} |
| | | </div> |
| | | <div style="display: flex;height: 32px;justify-content: flex-start;align-items: center"> |
| | | <div style="margin-left: 5px;width: 42px">处理人:</div> |
| | | {{ item.username }} |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="width:190px;display: flex;flex-direction: column"> |
| | | <div |
| | | style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center;text-align: left" |
| | | > |
| | | <div style="width: 60px;margin-left: 5px;">工单编号:</div> |
| | | <div>{{ item.wo_code }}</div> |
| | | </div> |
| | | <div |
| | | style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center ;text-align: left" |
| | | > |
| | | <div style="width: 60px;margin-left: 5px;">产品编码:</div> |
| | | <div>{{ item.partcode }}</div> |
| | | </div> |
| | | <div |
| | | style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left" |
| | | > |
| | | <div style="width:60px;margin-left: 5px;">产品名称:</div> |
| | | <div>{{ item.partname }}</div> |
| | | </div> |
| | | <div |
| | | style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left" |
| | | > |
| | | <div style="width:60px;margin-left: 5px;">产品规格:</div> |
| | | <div>{{ item.partspec ? item.partspec : '/' }}</div> |
| | | </div> |
| | | <div |
| | | style="display: flex;height: 20%;justify-content: flex-start;align-items: center;text-align: left" |
| | | > |
| | | <div style="width: 60px;margin-left: 5px;">处理时间:</div> |
| | | <div>{{ item.lm_date }}</div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="dialogVisible2 = false">取 消</el-button> |
| | | <el-button v-waves @click="dialogVisible2 = false;">取 消</el-button> |
| | | <el-button v-waves v-print="printObj2" type="primary">打 印</el-button> |
| | | </div> |
| | | </span> |
| | |
| | | }, |
| | | submitButtonIsDisabled: false, |
| | | |
| | | isLastPrint: false// 是否是末道打印 |
| | | isLastPrint: false, // 是否是末道打印 |
| | | lastPrintArr: [], // 末道打印的数组(所有) |
| | | lastPrintArrSelected: []// 末道打印的数组(选中) |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | res3.forEach(i => { |
| | | this.bindQRCode(i.seq, i.stepqrcode, 'small') |
| | | }) |
| | | // this.bindQRCode('0', this.formApprove.mesordercode, 'big') |
| | | this.bindQRCode('0', this.formApprove.mesordercode, 'big') |
| | | |
| | | const div = document.getElementById('qrCode') |
| | | // 这么多代码只需要这一句实现我们所需要的功能,定位div滚动条位置在底部,scrollHeight计算出div的高度,再scrollTop 设置滚动条的高度为多少 |
| | | // div.scrollTop = div.scrollHeight // 滚动条位于最底部 |
| | | div.scrollTop = 0 // 滚动条位于最顶部 |
| | | div.scrollTop = div.scrollHeight // 滚动条位于最底部 |
| | | // div.scrollTop = 0 // 滚动条位于最顶部 |
| | | }) |
| | | this.dialogVisibleApprove = true |
| | | } |
| | |
| | | console.log(this.qrForm, 1111) |
| | | }, |
| | | // 补打生产入库条码 |
| | | async getProductInHouseLabCode(ordercode) { |
| | | async getProductInHouseLabCode(ordercode) { |
| | | const res = await ProductInHouseLabCode({ ordercode }) |
| | | console.log(res) |
| | | this.isLastPrint = true |
| | | // 做一些打印多选的操作 |
| | | |
| | | this.lastPrintArr = res.data |
| | | |
| | | this.dialogVisible2 = true |
| | | |
| | | // 生产二维码 |
| | | this.$nextTick(() => { |
| | | this.lastPrintArr.forEach((i, index) => { |
| | | i.checked = false |
| | | new QRCode(this.$refs.qrCodeDiv2[index], { |
| | | text: i.inbarcode, |
| | | width: this.printSize !== 2 ? 60 : 55, |
| | | height: this.printSize !== 2 ? 60 : 55, |
| | | colorDark: '#000', // 二维码颜色 |
| | | colorLight: '#ffffff', // 二维码背景色 |
| | | correctLevel: QRCode.CorrectLevel.L// 容错率,L/M/H |
| | | }) |
| | | }) |
| | | }) |
| | | }, |
| | | dialogVisible2Close() { |
| | | this.qrForm.qrvalue = '' |
| | |
| | | this.qrForm.operatorTime = '' |
| | | // this.$refs.qrCodeDiv2 = '' |
| | | this.isLastPrint = false |
| | | this.lastPrintArr = [] |
| | | this.lastPrintArrSelected = [] |
| | | }, |
| | | // 生成二维码 工序标签二维码 |
| | | bindQRCode2(text) { |
| | |
| | | if (val === 5) { |
| | | return { paddingLeft: '15px', paddingTop: '7px' } |
| | | } |
| | | }, |
| | | |
| | | inbarcodeChange(val, item) { |
| | | // 当 lastPrintArrSelected中未有当前勾选的值是 走push item 否则走过滤掉item |
| | | if (val) { |
| | | this.lastPrintArrSelected.push(item) |
| | | } else { |
| | | this.lastPrintArrSelected = this.lastPrintArrSelected.filter(i => i.inbarcode !== item.inbarcode) |
| | | } |
| | | |
| | | // 生产二维码 |
| | | this.$nextTick(() => { |
| | | this.lastPrintArrSelected.forEach((i, index) => { |
| | | console.log(i.inbarcode, 'i.inbarcode') |
| | | new QRCode(this.$refs.qrCodeDiv3[index], { |
| | | text: i.inbarcode, |
| | | width: 60, |
| | | height: 60, |
| | | colorDark: '#000', // 二维码颜色 |
| | | colorLight: '#ffffff', // 二维码背景色 |
| | | correctLevel: QRCode.CorrectLevel.L// 容错率,L/M/H |
| | | }) |
| | | }) |
| | | |
| | | // const div = document.getElementById('qrCode3') |
| | | // div.scrollTop = 0 // 滚动条位于最底部 |
| | | |
| | | this.$forceUpdate() |
| | | }, 500) |
| | | } |
| | | } |
| | | } |