lilei 3 năm trước cách đây
mục cha
commit
addaee68b0

+ 4 - 3
src/libs/JGPrint.js

@@ -3,7 +3,7 @@ import notification from 'ant-design-vue/es/notification'
 import { getLodop } from '@/libs/LodopFuncs'
 import moment from 'moment'
 // 打印页签,支持批量打印
-export const JGPrintTag = function(data){
+export const JGPrintTag = function(html,width,height,nums){
   const LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'))
   if (!LODOP) {
     confirm({
@@ -20,8 +20,9 @@ export const JGPrintTag = function(data){
   }
   LODOP.SET_SHOW_MODE('HIDE_PAPER_BOARD', 1) //  隐藏底图上有模拟走纸板的条纹线
   LODOP.SET_PRINT_MODE('POS_BASEON_PAPER', true) // 可使输出以纸张边缘为基点
-  LODOP.ADD_PRINT_HTM(0, 0, '100%', '100%', document.getElementById('print').innerHTML)
-  LODOP.SET_PRINT_PAGESIZE(1, '40mm', '30mm')
+  LODOP.SET_PRINT_COPIES(nums);//指定份数
+  LODOP.ADD_PRINT_HTM(0, 0, '100%', '100%', html)
+  LODOP.SET_PRINT_PAGESIZE(1, width, height)
   LODOP.PRINT()
 }
 // 打印控件

+ 38 - 41
src/views/numsGoodsShelves/replenishmentManagement/printStickerModal.vue

@@ -48,33 +48,14 @@
         <a-button id="replenishmentManagement-printSticker-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
       </div>
     </a-spin>
-
-    <div id="print">
-      <div class="print-pages" style="font-size: 9px;padding:3pt 0 3pt 6pt;">
-        <div class="storeName" style="text-align: center;font-weight: bold;margin: 2pt 0;">箭冠汽配西安大兴店</div>
-        <div style="overflow: hidden;display: flex;justify-content: space-between;">
-          <div style="padding-right: 3pt;">
-            <div class="shelfName" style="margin-bottom: 2pt;">
-              西安车领主常青二路数字货架
-            </div>
-            <div class="productCode" style="font-weight: bold;">JA-11070N</div>
-            <div class="productName">箭牌空气滤清器 07款丰田新皇冠2.5 / 3.0</div>
-            <div class="userName" style="margin-top: 2pt;font-size: 8px;"><span style="margin: 0 5pt 0 0;">2021-10-01  15:30</span> <span>王明</span></div>
-          </div>
-          <div>
-            <div class="productSno" style="font-size: 16pt;text-align: center;">A08</div>
-            <div class="qrcode" ref="qrCodeUrl" style="width: 40px;height: 40px;overflow: hidden;"></div>
-          </div>
-        </div>
-      </div>
-    </div>
   </a-modal>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import moment from 'moment'
 import QRCode from 'qrcodejs2'
-import { getLodop } from '@/libs/LodopFuncs'
+import { JGPrintTag } from '@/libs/JGPrint'
 import { STable, VSelect } from '@/components'
 import { shelfReplenishDetailList, shelfReplenishDetail, shelfReplenishPrintSign } from '@/api/shelfReplenish'
 export default {
@@ -131,21 +112,11 @@ export default {
   },
   computed: {
     modalTit () {
-      const hjName = this.nowData && this.nowData.shelfName ? this.nowData.shelfName : ''
+      const hjName = this.nowData && this.nowData.shelfInfo.shelfName ? this.nowData.shelfInfo.shelfName : ''
       return '补货单打印贴签——' + hjName
     }
   },
   methods: {
-    printTest () {
-      const qrcode = new QRCode(this.$refs.qrCodeUrl, {
-        text: 'dealerSn=1033242&shelfSn=342326735950757888&productCode=RPF2340&shelfPlaceCode=A01&shelfPlaceSn=123213', // 需要转换为二维码的内容
-        width: 40,
-        height: 40,
-        colorDark: '#000000',
-        colorLight: '#ffffff',
-        correctLevel: QRCode.CorrectLevel.H
-      })
-    },
     // 表格选中项
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
@@ -154,16 +125,42 @@ export default {
     handleSave () {
       if (!this.rowSelectionInfo || (this.rowSelectionInfo && this.rowSelectionInfo.selectedRows.length < 1)) {
         this.$message.warning('请至少选择一个产品')
-        return
-      }
-      this.spinning = true
-      shelfReplenishPrintSign({ replenishBillSn: this.nowData && this.nowData.replenishBillSn }).then(res => {
-        if (res.status == 200) {
-          this.$emit('ok')
-          this.isShow = false
+      } else {
+        // const qrcode = new QRCode(this.$refs.qrCodeUrl, {
+        //   text: 'dealerSn=1033242&shelfSn=342326735950757888&productCode=RPF2340&shelfPlaceCode=A01&shelfPlaceSn=123213', // 需要转换为二维码的内容
+        //   width: 40,
+        //   height: 40,
+        //   colorDark: '#000000',
+        //   colorLight: '#ffffff',
+        //   correctLevel: QRCode.CorrectLevel.H
+        // })
+        const nowData = this.nowData
+        const list = this.rowSelectionInfo.selectedRows
+        let htmlStr = ''
+        for (let i = 0; i < list.length; i++) {
+          htmlStr = htmlStr + '<div class="print-pages" style="font-size: 9px;padding:3pt 0 3pt 6pt;">'
+          htmlStr = htmlStr + '<div class="storeName" style="text-align: center;font-weight: bold;margin: 2pt 0;">' + nowData.outStockPersonName + '</div>'
+          htmlStr = htmlStr + '<div style="overflow: hidden;display: flex;justify-content: space-between;">'
+          htmlStr = htmlStr + '<div style="padding-right: 3pt;">'
+          htmlStr = htmlStr + '<div class="shelfName" style="margin-bottom: 2pt;">'
+          htmlStr = htmlStr + nowData.shelfInfo.shelfName
+          htmlStr = htmlStr + '</div>'
+          htmlStr = htmlStr + '<div class="productCode" style="font-weight: bold;">' + list[i].productCode + '</div>'
+          htmlStr = htmlStr + '<div class="productName">' + list[i].product.name + '</div>'
+          htmlStr = htmlStr + '<div class="userName" style="margin-top: 2pt;font-size: 8px;">'
+          htmlStr = htmlStr + '<span style="margin: 0 5pt 0 0;">' + moment().format('YYYY-MM-DD HH:mm') + '</span>'
+          htmlStr = htmlStr + '<span>王明</span>'
+          htmlStr = htmlStr + '</div>'
+          htmlStr = htmlStr + '</div>'
+          htmlStr = htmlStr + '<div>'
+          htmlStr = htmlStr + '<div class="productSno" style="font-size: 16pt;text-align: center;">A08</div>'
+          htmlStr = htmlStr + '<div class="qrcode" ref="qrCodeUrl" style="width: 40px;height: 40px;overflow: hidden;"></div>'
+          htmlStr = htmlStr + '</div>'
+          htmlStr = htmlStr + '</div>'
+          htmlStr = htmlStr + '</div>'
+          JGPrintTag(htmlStr, '40mm', '30mm', list[i].printQty)
         }
-        this.spinning = false
-      })
+      }
     },
     // 基本信息
     getDetail () {

+ 7 - 1
src/views/numsGoodsShelves/replenishmentManagement/putWarehousingModal.vue

@@ -135,7 +135,13 @@ export default {
           const arrInd = []
           _this.listData.map((item, index) => {
             if (item.putQty || item.putQty == 0) {
-              arr.push({ productSn: item.productSn, putQty: item.putQty, replenishBillDetailSn: item.replenishBillDetailSn })
+              arr.push({
+                productSn: item.productSn,
+                putQty: item.putQty,
+                replenishBillDetailSn: item.replenishBillDetailSn,
+                shelfPlaceSn: item.shelfPlaceSn,
+                shelfPlaceCode: item.shelfPlaceCode
+              })
             } else {
               arrInd.push(index + 1)
             }

+ 4 - 2
src/views/numsGoodsShelves/shelfMonitoring/list.vue

@@ -123,13 +123,15 @@
           bordered>
           <!-- 绑定产品状态 -->
           <template slot="state" slot-scope="text, record">
-            <a-tooltip placement="top">
+            <a-tooltip placement="left" v-if="record.recallBillData&&record.replenishBillData">
               <template slot="title">
-                <span>{{ record.productTypeName }}</span>
+                <div v-if="record.recallBillData">{{ record.recallBillData.join(',') }}</div>
+                <div v-if="record.replenishBillData">{{ record.replenishBillData.join(',') }}</div>
               </template>
               {{ record.stateDictValue }}
               <a-icon type="exclamation-circle" theme="filled" style="color: #39f;font-size: 16px;margin-left: 5px;vertical-align: middle;cursor: pointer;" />
             </a-tooltip>
+            <span v-else>{{ record.stateDictValue }}</span>
           </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">

+ 1 - 1
vue.config.js

@@ -108,7 +108,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://192.168.16.151:80/qpls-md',
+        target: 'http://192.168.16.188:8503/qpls-md',
         // target: 'http://192.168.16.107:7300/mock/61aad8ea5688cb3878d81e39/qpls-md',
         // ws: false,
         ws: true,