|
|
@@ -23,6 +23,9 @@
|
|
|
<el-button type="success" @click="toEnd()">批量完结</el-button>
|
|
|
<!-- <el-button type="success" @click="handleCreate">创建工单</el-button> -->
|
|
|
<!-- <el-button type="success">工单操作控制</el-button> -->
|
|
|
+
|
|
|
+ <el-button type="success" @click="allPrinting()">批量打印二维码</el-button>
|
|
|
+
|
|
|
</template>
|
|
|
|
|
|
|
|
|
@@ -71,10 +74,9 @@
|
|
|
|
|
|
<ele-modal title="二维码" :visible.sync="QRvisible" width="450px">
|
|
|
|
|
|
- <div style="width: 400px ;text-align: center; display: flex; flex-direction: column; align-items: center;"
|
|
|
- id="printSection">
|
|
|
- <div id="qrCode" ref="qrCode"></div>
|
|
|
- <div style="width: 400px; font-size: 12px; margin-top: 16px; text-align: left;">{{ qrCode }}</div>
|
|
|
+ <div >
|
|
|
+
|
|
|
+
|
|
|
</div>
|
|
|
|
|
|
<div slot="footer">
|
|
|
@@ -94,13 +96,15 @@
|
|
|
import {
|
|
|
getPage,
|
|
|
batchCompletion,
|
|
|
- cancelCompletion
|
|
|
+ cancelCompletion,
|
|
|
+ queryPrint
|
|
|
} from '@/api/produceOrder/index.js';
|
|
|
import produceOrderSearch from './components/produceOrder-search.vue';
|
|
|
import createDialog from './components/createDialog.vue';
|
|
|
import unpackDialog from './components/unpackDialog.vue';
|
|
|
import pickingDialog from './components/pickingDialog.vue';
|
|
|
-import QRCode from 'qrcodejs2'
|
|
|
+
|
|
|
+
|
|
|
export default {
|
|
|
components: {
|
|
|
produceOrderSearch,
|
|
|
@@ -135,7 +139,7 @@ export default {
|
|
|
selection: [],
|
|
|
|
|
|
QRvisible: false,
|
|
|
- qrCode: null,
|
|
|
+
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -311,8 +315,8 @@ export default {
|
|
|
showOverflowTooltip: true,
|
|
|
},
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
{
|
|
|
@@ -497,29 +501,31 @@ export default {
|
|
|
this.QRvisible = true
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
- this.creatQrCode("qrCode", row.code);
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- // 生成二维码
|
|
|
- creatQrCode(refName, text) {
|
|
|
- if (document.getElementById(refName)) {
|
|
|
- document.getElementById(refName).innerHTML = ''; //防止重复生成二维码
|
|
|
- this.qrCode = null
|
|
|
- this.$nextTick(function () {
|
|
|
- this.qrCode = text
|
|
|
- new QRCode(document.getElementById(refName), {
|
|
|
- text: text, // 二维码内容
|
|
|
- width: 120,
|
|
|
- height: 120,
|
|
|
- colorDark: '#333333', // 二维码颜色
|
|
|
- colorLight: '#ffffff', // 二维码背景色
|
|
|
- correctLevel: QRCode.CorrectLevel.L,
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
+ allPrinting() {
|
|
|
+ console.log(this.selection)
|
|
|
+ let ids = this.findAllIds(this.selection);
|
|
|
+ console.log(ids)
|
|
|
},
|
|
|
|
|
|
+ findAllIds(nodes) {
|
|
|
+ let ids = [];
|
|
|
+ nodes.forEach(node => {
|
|
|
+ ids.push(node.id); // 添加当前节点的id
|
|
|
+ if (node.children && node.children.length > 0) {
|
|
|
+ // 递归调用自身来处理子节点
|
|
|
+ ids = ids.concat(this.findAllIds(node.children));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return ids;
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
print() {
|
|
|
const printSection = document.getElementById('printSection');
|
|
|
// 创建打印任务
|