Explorar el Código

入库生成二维码

wsx hace 1 año
padre
commit
ffacda9f5c

+ 10 - 0
src/api/warehouseManagement/index.js

@@ -559,3 +559,13 @@ export default {
     return Promise.reject(new Error(res.data.message));
   }
 };
+
+export const getOutInRecordsPage = async (data) => {
+  const res = await request.get(`/wms/outInDetailRecordTwo/outInRecordsPage`, {
+    params: data
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+};

+ 25 - 0
src/components/seekPage.vue

@@ -47,6 +47,20 @@
               >
               </el-date-picker>
             </div>
+
+            <div v-if="item.type == 'year-month'">
+              <el-date-picker
+                v-model="defaultWhere[item.value]"
+                @blur="change"
+                type="month"
+                value-format="yyyy-MM"
+                :style="{
+                  width: item.width ? item.width + 'px' : '220px'
+                }"
+              >
+              </el-date-picker>
+            </div>
+
             <div v-if="item.type == 'DictSelection'">
               <DictSelection
                 v-model="defaultWhere[item.value]"
@@ -233,6 +247,17 @@
       },
       defaultWhere: {
         handler(val) {
+          for (const key in val) {
+            if (
+              Object.prototype.hasOwnProperty.call(val, key) &&
+              val[key] === null
+            ) {
+              val[key] = '';
+            }
+          }
+
+         
+
           if (this.keyValue) {
             sessionStorage[this.keyValue] = JSON.stringify(val);
             if (Object.keys(val).length === 0) {

+ 0 - 6
src/views/warehouseManagement/statisticalReports/transceiverSummary/components/searchTable.vue

@@ -18,12 +18,6 @@
             type: 'input',
             placeholder: ''
           },
-          {
-            label: '件号',
-            value: 'code',
-            type: 'input',
-            placeholder: ''
-          },
           {
             label: '件名',
             value: 'name',

+ 50 - 286
src/views/warehouseManagement/statisticalReports/transceiverSummary/index.vue

@@ -15,6 +15,8 @@
         full-height="calc(100vh - 116px)"
         tool-class="ele-toolbar-form"
         :needPage="false"
+        :cell-class-name="setCellClass"
+        :span-method="spanMethod"
       >
         <!-- <template v-slot:action="{ row }">
           <el-link
@@ -63,7 +65,12 @@
           prop: `dateList[${i}][dateTotalNum]`,
           label: `${month}/${i + 1}`,
           align: 'center',
-          showOverflowTooltip: true
+          showOverflowTooltip: true,
+          formatter(row) {
+            return row.dateList[i].dateTotalNum
+              ? row.dateList[i].dateTotalNum
+              : '';
+          }
         }));
 
         let arr = [
@@ -126,194 +133,6 @@
             label: '日期/数量',
             align: 'center',
             showOverflowTooltip: true,
-            // children: [
-            //   {
-            //     prop: 'dateList[0][dateTotalNum]',
-            //     label: month + '/1',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[1][dateTotalNum]',
-            //     label: month + '/2',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[2][dateTotalNum]',
-            //     label: month + '/3',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[3][dateTotalNum]',
-            //     label: month + '/4',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[4][dateTotalNum]',
-            //     label: month + '/5',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[5][dateTotalNum]',
-            //     label: month + '/6',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[6][dateTotalNum]',
-            //     label: month + '/7',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[7][dateTotalNum]',
-            //     label: month + '/8',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[8][dateTotalNum]',
-            //     label: month + '/9',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[9][dateTotalNum]',
-            //     label: month + '/10',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[10][dateTotalNum]',
-            //     label: month + '/11',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[11][dateTotalNum]',
-            //     label: month + '/12',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[12][dateTotalNum]',
-            //     label: month + '/13',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[13][dateTotalNum]',
-            //     label: month + '/14',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[14][dateTotalNum]',
-            //     label: month + '/15',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[15][dateTotalNum]',
-            //     label: month + '/16',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[16][dateTotalNum]',
-            //     label: month + '/17',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[17][dateTotalNum]',
-            //     label: month + '/18',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[18][dateTotalNum]',
-            //     label: month + '/19',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[19][dateTotalNum]',
-            //     label: month + '/20',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[20][dateTotalNum]',
-            //     label: month + '/21',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[21][dateTotalNum]',
-            //     label: month + '/22',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[22][dateTotalNum]',
-            //     label: month + '/23',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[23][dateTotalNum]',
-            //     label: month + '/24',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[24][dateTotalNum]',
-            //     label: month + '/25',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[25][dateTotalNum]',
-            //     label: month + '/26',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[26][dateTotalNum]',
-            //     label: month + '/27',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[27][dateTotalNum]',
-            //     label: month + '/28',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[28][dateTotalNum]',
-            //     label: month + '/29',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[29][dateTotalNum]',
-            //     label: month + '/30',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   },
-            //   {
-            //     prop: 'dateList[30][dateTotalNum]',
-            //     label: month + '/31',
-            //     align: 'center',
-            //     showOverflowTooltip: true
-            //   }
-            // ]
             children: dateColumns
           }
         ];
@@ -325,107 +144,47 @@
     data() {
       return {
         date: ''
-        // columns: [
-        //   {
-        //     type: 'index',
-        //     label: '序号',
-        //     width: 50,
-        //     align: 'center'
-        //   },
-        //   {
-        //     prop: 'code',
-        //     label: '客户',
-        //     align: 'center',
-        //     showOverflowTooltip: true
-        //   },
-        //   {
-        //     prop: 'name',
-        //     label: '件号',
-        //     align: 'center',
-        //     showOverflowTooltip: true
-        //   },
-        //   {
-        //     prop: 'createUserName',
-        //     label: '件名',
-        //     align: 'center',
-        //     showOverflowTooltip: true
-        //   },
-        //   {
-        //     prop: 'startTime',
-        //     label: '期初素材',
-        //     slot: 'startTime',
-        //     align: 'center',
-        //     showOverflowTooltip: true
-        //   },
-        //   {
-        //     prop: 'endTime',
-        //     label: '结存合计',
-        //     align: 'center',
-        //     showOverflowTooltip: true
-        //   },
-        //   {
-        //     prop: 'endTime',
-        //     label: '小计',
-        //     align: 'center',
-        //     showOverflowTooltip: true
-        //   },
-        //   {
-        //     prop: 'endTime',
-        //     label: '类别',
-        //     align: 'center',
-        //     showOverflowTooltip: true
-        //   },
-        //   {
-        //     prop: 'endTime',
-        //     label: '日期/数量',
-        //     align: 'center',
-        //     showOverflowTooltip: true,
-        //     children: [
-        //       {
-        //         prop: 'province',
-        //         label: '1',
-        //         align: 'center',
-        //         showOverflowTooltip: true
-        //       }
-        //     ]
-        //   }
-        // ]
       };
     },
     methods: {
-      //   downLoad(row) {
-      //     sendReceiveGatherExcel({
-      //       code: row.code,
-      //       name: row.name,
-      //       startTime: row.startTime,
-      //       endTime: row.endTime,
-      //       exportStatus: 1
-      //     }).then((data) => {
-      //       try {
-      //         let objectUrl1 = window.URL.createObjectURL(new Blob([data]));
-      //         let elink = document.createElement('a');
-      //         elink.setAttribute(
-      //           'download',
-      //           decodeURI(decodeURI('收发汇总表.xlsx'))
-      //         );
-      //         elink.style.display = 'none';
-      //         elink.href = objectUrl1;
-      //         document.body.appendChild(elink);
-      //         elink.click();
-      //         document.body.removeChild(elink);
-      //         window.URL.revokeObjectURL(elink.href);
-      //         this.search();
-      //       } catch (err) {
-      //         this.$message.error('导出失败,请联系管理员!');
-      //       }
-      //     });
-      //   },
+      setCellClass({ row, column }) {
+        // console.log(row, column, rowIndex, columnIndex);
+        let day = column.label.split('/')[1];
+        let num = row.dateList[day - 1];
+        if (!num) {
+          return '';
+        }
+        return num?.dateTotalNum ? 'content-num' : '';
+      },
+
+      spanMethod({ row, column, rowIndex, columnIndex }) {
+        if (
+          column.property === 'startNum' ||
+          column.property === 'endNum' ||
+          column.property === 'totalNum'
+        ) {
+          const groupStartIndex = Math.floor(rowIndex / 5) * 5;
+          if (rowIndex === groupStartIndex) {
+            // 每组的第一行,合并 5 行
+            return {
+              rowspan: 5,
+              colspan: 1
+            };
+          } else {
+            // 每组的非第一行,隐藏单元格
+            return {
+              rowspan: 0,
+              colspan: 0
+            };
+          }
+        }
+        // 其他列不进行合并
+        return {
+          rowspan: 1,
+          colspan: 1
+        };
+      },
 
-      //   add(isView, row) {
-      //     console.log('isView--', isView);
-      //     console.log('row-----', row);
-      //     this.$refs.addRef.open(isView, row);
-      //   },
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
         return sendReceiveGatherExcel({
@@ -486,4 +245,9 @@
   :deep(.ele-pro-table-header-ellipsis > .el-table th.el-table__cell > .cell) {
     white-space: pre;
   }
+
+  :deep(.content-num) {
+    color: #000;
+    background-color: #53c77f !important;
+  }
 </style>

+ 278 - 0
src/views/warehouseManagement/stockManagement/components/printQRCode.vue

@@ -0,0 +1,278 @@
+<template>
+  <ele-modal
+    title="入库物品"
+    :visible.sync="QRvisible"
+    v-if="QRvisible"
+    width="50%"
+    @close="close"
+  >
+    <div
+      id="printSection"
+      style="
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        flex-wrap: wrap;
+      "
+    >
+      <table
+        border
+        cellspacing="0"
+        style="
+          table-layout: auto;
+          word-break: break-all;
+          word-wrap: break-word;
+          font-size: 12px;
+          margin-bottom: 20px;
+        "
+        v-for="row in rowList"
+        :key="row.packageNo"
+      >
+        <tbody>
+          <tr align="center">
+            <template v-if="row.packageNo">
+              <td>编码</td>
+              <td colspan="3">{{ row?.packageNo ?? '' }}</td>
+            </template>
+            <template v-else>
+              <td>编码</td>
+              <td colspan="3">{{ row?.categoryCode ?? '' }}</td>
+            </template>
+          </tr>
+
+          <tr align="center">
+            <td>物料名称</td>
+            <td colspan="3">{{ row?.categoryName ?? '' }}</td>
+          </tr>
+
+          <tr align="center">
+            <td>批次号</td>
+            <td>{{ row?.batchNo ?? '' }}</td>
+            <td colspan="2" rowspan="4" class="qrcode">
+              <ele-qr-code-svg :value="setCode(row)" :size="120" />
+            </td>
+          </tr>
+
+          <tr align="center">
+            <td>规格</td>
+            <td>{{ row?.specification ?? '' }}</td>
+          </tr>
+
+          <tr align="center">
+            <td>单件数量</td>
+            <td
+              >{{ row?.measureQuantity ?? '' }}{{ row?.measureUnit ?? '' }}
+              /
+              {{ row?.packingQuantity ?? '' }}{{ row?.packingUnit ?? '' }}</td
+            >
+          </tr>
+
+          <tr align="center">
+            <td>重量</td>
+            <td>{{ row?.weight ? row?.weight + row?.weightUnit : '' }}</td>
+          </tr>
+
+          <tr align="center">
+            <td>生产日期</td>
+            <td>{{ row?.productionDate ?? '' }}</td>
+            <td>序号</td>
+            <td></td>
+          </tr>
+
+          <tr align="center">
+            <td>供应商</td>
+            <td colspan="3">{{ row?.supplierName ?? '' }}</td>
+          </tr>
+
+          <tr align="center">
+            <td>到货时间</td>
+            <td></td>
+            <td>制单人</td>
+            <td>{{ user?.info?.name ?? '' }}</td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+
+    <div slot="footer">
+      <el-button @click="print">打印预览</el-button>
+      <el-button @click="close">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { mapGetters } from 'vuex';
+  import EleQrCodeSvg from 'ele-admin/es/ele-qr-code-svg';
+  import { getOutInRecordsPage } from '@/api/warehouseManagement';
+  export default {
+    name: 'print',
+    components: {
+      EleQrCodeSvg
+    },
+    computed: {
+      ...mapGetters(['user']),
+      setCode() {
+        return (row) => {
+          //二维码类型是入库单in,入库单id,每个包装的编码,入库的物品类型
+          const params = new URLSearchParams({
+            inoutType: 'in',
+            inId: this.$route.query.id,
+            packageNo: row?.packageNo ?? '',
+            assetType: this._props.assetType,
+            batchNo: row?.batchNo ?? ''
+          });
+          return params.toString();
+        };
+      }
+    },
+    props: {
+      assetType: {
+        type: String,
+        default: ''
+      }
+    },
+    data() {
+      return {
+        QRvisible: false,
+        codeList: [],
+        formData: {},
+        rowList: [],
+        row: {},
+        text: '',
+        type: '',
+        inId: ''
+      };
+    },
+
+    methods: {
+      // 二维码有两种,可拆分包装层面的,不可拆分的
+      open(row, type) {
+        // row里有packageNo,则是包装的二维码,没有就是产品的二维码
+        console.log(row);
+        console.log(this.$route.query.id);
+        this.rowList.push(row);
+        // getSendSaleOrderrecordDetailSplit(id).then((data) => {
+        //   if (JSON.stringify(data) != '{}') {
+        //     this.formData = data;
+        //     this.formData['carName'] = data.carList
+        //       .map((item) => item.name)
+        //       .toString();
+        //     this.formData.projectName = data.saleOrderList?.[0]?.projectName;
+        //     this.formData.driverNames = data.logisticTrakListNoteVOList
+        //       .map((item) => item.driverName)
+        //       .join(','); // 承运人
+        //     this.codeList = data.productList;
+        //     this.formData.markerName = this.user.info.name;
+        //   }
+
+        // });
+        this.QRvisible = true;
+      },
+
+      async init(id) {
+        console.log(id);
+
+        const res = await getOutInRecordsPage({
+          pageNum: 1,
+          size: -1,
+          outInId: id
+        });
+
+        this.rowList = res.list;
+        this.QRvisible = true;
+      },
+
+      close() {
+        this.rowList = [];
+        this.QRvisible = false;
+      },
+      //获取当前日期函数
+      getNowFormatDate() {
+        let date = new Date(),
+          obj = {
+            year: date.getFullYear(), //获取完整的年份(4位)
+            month: date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
+            strDate: date.getDate(), // 获取当前日(1-31)
+            week: '星期' + '日一二三四五六'.charAt(date.getDay()), //获取当前星期几(0 ~ 6,0代表星期天)
+            hour: date.getHours(), //获取当前小时(0 ~ 23)
+            minute: date.getMinutes(), //获取当前分钟(0 ~ 59)
+            second: date.getSeconds() //获取当前秒数(0 ~ 59)
+          };
+        Object.keys(obj).forEach((key) => {
+          if (obj[key] < 10) obj[key] = `0${obj[key]}`;
+        });
+        // return `${obj.year}年${obj.month}月${obj.strDate}日 ${obj.hour}:${obj.minute}:${obj.second}`;
+        return `${obj.year}-${obj.month}-${obj.strDate}`;
+      },
+      print() {
+        const printSection = document.getElementById('printSection');
+        console.log(printSection);
+
+        // 创建打印任务
+        const printWindow = window.open('', '_blank');
+        printWindow.document.open();
+        printWindow.document.write('<html><head><title>打印预览</title>');
+        printWindow.document.write(
+          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
+        );
+        printWindow.document.write('</head><body>');
+        printWindow.document.write(printSection.innerHTML);
+        printWindow.document.write('</body></html>');
+        printWindow.document.close();
+        printWindow.onload = function () {
+          printWindow.print();
+        };
+      }
+    }
+  };
+</script>
+
+<style lang="scss">
+  #printSection {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    flex-direction: column;
+    .table_box {
+      width: 70%;
+      table-layout: auto;
+      word-break: break-all;
+      word-wrap: break-word;
+    }
+    th,
+    td {
+      padding: 4px;
+      vertical-align: bottom;
+      position: relative;
+    }
+    .barCode {
+      position: absolute;
+      right: 10px;
+      top: 50%;
+      transform: translateY(-50%);
+    }
+    .person {
+      width: 70%;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      margin-bottom: 10px;
+      > div {
+        flex: 1;
+      }
+    }
+  }
+</style>
+
+<style scoped lang="scss">
+  @media print {
+    .no-print {
+      display: none;
+    }
+  }
+
+  .qrcode {
+    padding: 8px !important;
+  }
+</style>

+ 56 - 4
src/views/warehouseManagement/stockManagement/details.vue

@@ -124,6 +124,19 @@
               prop="categoryName"
               :show-overflow-tooltip="true"
             ></el-table-column>
+
+            <el-table-column
+              label="二维码"
+              width="120"
+              :show-overflow-tooltip="true"
+            >
+              <template slot-scope="{ row }">
+                <el-link type="primary" @click="openQRCode(row, 2)">
+                  查看
+                </el-link>
+              </template>
+            </el-table-column>
+
             <el-table-column
               v-if="clientEnvironmentId == 4"
               label="级别"
@@ -216,8 +229,13 @@
               :show-overflow-tooltip="true"
             >
             </el-table-column>
-           
-            <el-table-column label="单价" prop="unitPrice" align="center"      v-if="isPrice == 1">
+
+            <el-table-column
+              label="单价"
+              prop="unitPrice"
+              align="center"
+              v-if="isPrice == 1"
+            >
               <template slot-scope="{ row }">
                 <template>
                   {{ row.unitPrice ? row.unitPrice + '/元' : '' }}
@@ -386,6 +404,19 @@
               width="120"
               :show-overflow-tooltip="true"
             ></el-table-column>
+
+            <el-table-column
+              label="二维码"
+              width="120"
+              :show-overflow-tooltip="true"
+            >
+              <template slot-scope="{ row }">
+                <el-link type="primary" @click="openQRCode(row, 3)">
+                  查看
+                </el-link>
+              </template>
+            </el-table-column>
+
             <el-table-column
               label="型号"
               prop="categoryModel"
@@ -580,6 +611,11 @@
       @refresh="getPackingList"
     ></mergeDetails>
     <splitDetails ref="splitDetailsRef"></splitDetails>
+
+    <printQRCode
+      ref="printQRCodeRef"
+      :assetType="extInfo.assetType"
+    ></printQRCode>
   </div>
 </template>
 
@@ -602,8 +638,16 @@
   import { mapGetters, mapActions } from 'vuex';
   import { parameterGetByCode } from '@/api/sys/index.js';
 
+  import printQRCode from './components/printQRCode.vue';
+
   export default {
-    components: { PageHeader, WareHouseDailog, mergeDetails, splitDetails },
+    components: {
+      PageHeader,
+      WareHouseDailog,
+      mergeDetails,
+      splitDetails,
+      printQRCode
+    },
     directives: {
       'el-table-infinite-scroll': elTableInfiniteScroll
     },
@@ -643,7 +687,7 @@
         active: 0,
         verifyStatus: '',
         rowData: {},
-        isPrice:1
+        isPrice: 1
       };
     },
     watch: {
@@ -1140,6 +1184,14 @@
             console.log(data.list, 'data.list');
             this.packingList = data.list;
           });
+      },
+      /**
+       *
+       *
+       * 以下二维码功能
+       */
+      openQRCode(row, type) {
+        this.$refs.printQRCodeRef.open(row, type);
       }
     }
   };

+ 33 - 1
src/views/warehouseManagement/stockManagement/index.vue

@@ -177,6 +177,10 @@
           <el-button icon="el-icon-receiving" type="primary" @click="outbound"
             >出库</el-button
           >
+
+          <el-button icon="el-icon-printer" type="primary" @click="print"
+            >打印</el-button
+          >
           <!-- <el-button
             icon="el-icon-plus"
             v-if="clientEnvironmentId == 4"
@@ -258,6 +262,9 @@
         </template>
       </ele-pro-table>
     </el-card>
+
+    <printQRCode ref="printQRCodeRef"></printQRCode>
+
     <!--  <priceMaintenanceDialog ref="priceMaintenanceDialogRef" /> -->
   </div>
 </template>
@@ -270,6 +277,8 @@
   import { parameterGetByCode } from '@/api/sys/index.js';
 
   ('@/view/warehouseManagement/stockManagement/components/priceMaintenanceDialog.vue');
+
+  import printQRCode from './components/printQRCode.vue';
   import {
     warehousingType,
     sceneState,
@@ -277,7 +286,7 @@
     useDict
   } from '@/utils/dict/index';
   export default {
-    components: {},
+    components: { printQRCode },
     data() {
       return {
         auditStatus,
@@ -637,6 +646,29 @@
       reset() {
         this.$refs.formName.resetFields();
         this.search();
+      },
+      print() {
+        if (!this.currentRow.id) {
+          return this.$message({
+            message: '请先选择单据',
+            type: 'warning',
+            duration: 2000
+          });
+        }
+
+        if (this.currentRow.verifyStatus !== 2) {
+          return this.$message({
+            message: '该单据未审核通过',
+            type: 'warning',
+            duration: 2000
+          });
+        }
+
+        console.log(this.currentRow);
+
+        this.$refs.printQRCodeRef.init(this.currentRow.id);
+
+        console.log('print');
       }
     }
   };