Commit e336f266 authored by 沈翠玲's avatar 沈翠玲

生产工单->打印工单

parent 551d8a00
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
"js-cookie": "3.0.1", "js-cookie": "3.0.1",
"jsencrypt": "3.0.0-rc.1", "jsencrypt": "3.0.0-rc.1",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"qrcodejs2": "^0.0.2",
"quill": "1.3.7", "quill": "1.3.7",
"screenfull": "5.0.2", "screenfull": "5.0.2",
"sortablejs": "1.10.2", "sortablejs": "1.10.2",
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
<div class="titles">生产单</div> <div class="titles">生产单</div>
<div class="titles GOM">GOM</div> <div class="titles GOM">GOM</div>
<div v-if="pageHeader.arrangeCode" class="barcode"> <div v-if="pageHeader.arrangeCode" class="barcode">
<vue-barcode <div id="qrCode" ref="qrCodeDiv"></div>
<!-- <vue-barcode
:value="pageHeader.arrangeCode" :value="pageHeader.arrangeCode"
margin-right="5" margin-right="5"
:display-value="pageHeader.arrangeCode" :display-value="pageHeader.arrangeCode"
...@@ -22,7 +23,7 @@ ...@@ -22,7 +23,7 @@
margin-bottom="10" margin-bottom="10"
text-align="right" text-align="right"
font-size="13" font-size="13"
font-weight="600">不支持vue-barcode</vue-barcode> font-weight="600">不支持vue-barcode</vue-barcode> -->
</div> </div>
<div> <div>
产品类别:{{ pageHeader.itemTypeName }} 产品类别:{{ pageHeader.itemTypeName }}
...@@ -230,9 +231,9 @@ ...@@ -230,9 +231,9 @@
<script> <script>
import dayjs from 'dayjs' import dayjs from 'dayjs'
import VueBarcode from 'vue-barcode' import QRCode from 'qrcodejs2';
export default { export default {
components: { VueBarcode }, // components: { VueBarcode },
props: ['workOrderTable'], props: ['workOrderTable'],
data() { data() {
return { return {
...@@ -360,6 +361,22 @@ export default { ...@@ -360,6 +361,22 @@ export default {
// }, // },
} }
}, },
mounted() {
if (this.$refs.qrCodeDiv) {
this.$refs.qrCodeDiv.innerHTML = '';
}
if(this.pageHeader.arrangeCode) {
new QRCode(this.$refs.qrCodeDiv, {
text: this.pageHeader.arrangeCode, // 需要转换为二维码的内容
width: 70, //宽度
height: 70, //高度
colorDark: '#000000', //二维码方块颜色
colorLight: '#ffffff', //背景颜色
correctLevel: QRCode.CorrectLevel.Q, //容错率:L M Q H 依次递减
});
}
},
computed: { computed: {
workOrderInfo (){ workOrderInfo (){
return this.workOrderTable.body.workOrderInfo return this.workOrderTable.body.workOrderInfo
...@@ -423,8 +440,8 @@ export default { ...@@ -423,8 +440,8 @@ export default {
} }
.barcode{ .barcode{
position: absolute; position: absolute;
top: 0; top: 10px;
right: -10px; right: -5px;
width: 300px; width: 300px;
height: 80px; height: 80px;
display: flex; display: flex;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment