Parcourir la source

手持-活动单复核默认打印机,调整打印位置

zhaohuanhuan il y a 8 mois
Parent
commit
217b1d8640

+ 41 - 25
src/views/outbound/check/activity/index.vue

@@ -40,6 +40,11 @@
         <div class="picking-container ">
           <div class="container-item"><span style="color:#666">拣货容器号:</span><div style="flex:1"> <van-notice-bar :background="'none'" color="#000" :speed="50" :text="orderDetail.pickingContainer||'--'" /></div></div>
           <div class="container-item"><span style="color:#666">返拣容器:</span>{{ reversePickingContainerNo || '--' }}</div>
+          <div style="display: flex;padding-top: 5px"  @click="setPrinter()">
+            <div>打印机:</div>
+            <div v-if="printer">{{printer.printer}}</div>
+            <div  style="text-decoration: underline;color: #0077ff">设置打印机<van-icon name="edit" color="#0077ff"/> </div>
+          </div>
           <div class="picking-order-count ">
             <div>待复核单:
               <span style="color: #333;font-weight: bold;font-size: 18px" v-if="orderMap.dataGroup">{{Object.keys(orderMap.dataGroup).length ||0}}</span>
@@ -56,8 +61,8 @@
           </div>
         </div>
         <div class="picking-button">
-          <div class="picking-button-item" @click="print('packing')">打印装箱清单</div>
-          <div class="picking-button-item" @click="print('express')">打印面单</div>
+          <div class="picking-button-item" @click="print('A3012_RF_WIFI_HDQD')">波次清单</div>
+          <div class="picking-button-item" @click="print('PRINT_WAYBILL')">打印面单</div>
           <div class="picking-button-item" @click="endCheck()" >结束复核</div>
           <van-popover :actions="actions" placement="bottom-end" @select="onSelect" theme="dark">
             <template #reference>
@@ -165,8 +170,8 @@ const orderList=ref([])
 const matchBarcodeList=ref([])
 const actions = [
   { text: '重新开始',value:'reset' },
-  { text: '打印波次商品',value:'goods' },
-  // { text: '打印装箱清单',value:'packing' },
+  // { text: '波次清单',value:'goods' },
+  { text: '装箱清单',value:'packing' },
   { text: '取消单列表',value:'cancel' },
   { text: '冻结单列表',value: 'freeze' },
 ];
@@ -243,29 +248,39 @@ const reset=()=>{
   showConfirmDialog({
     title: '温馨提示',
     message: '您正在进行重新开始操作,是否继续?',
-  }).then(() => {loadData()})
+  }).then(() => {
+    waveNo.value=''
+    scanBarcode.value=''
+    totalWeight.value=''
+    orderDetail.value={}
+    orderMap.value={}
+    orderList.value=[]
+    matchBarcodeList.value=[]
+    tips.value='请扫描商品条码'
+    inputBarcodeRef.value?.show('', '请扫描波次/容器号', '')
+  })
 }
-//打印面单
 const printerRef=ref(null)
-const printType=ref(null)
-const printTypeMap={
-  'express':{
-    templateCode: 'PRINT_WAYBILL'
-  },
-  'packing':{
-    templateCode: 'A3014_PACK_CARTON_PACKINGLIST',
-  },
-  'goods':{
-    templateCode: 'A3012_RF_WIFI_HDQD',
-  }
-}
-const print=(type)=>{
-  printType.value=type
+//设置打印机
+const setPrinter=()=>{
   printerRef.value?.show(warehouse)
 }
+const printer=ref(null)
+if(localStorage.getItem('check-print')){
+  printer.value=JSON.parse(localStorage.getItem('check-print'))
+}
 const onPrint=(code)=>{
-  const printTemplate=printTypeMap[printType.value]
-  const data = {warehouse,code:orderDetail.value.waveNo,printServer: code.server, printName:code.printer,...printTemplate }
+  printer.value=code
+  localStorage.setItem('check-print',JSON.stringify(code))
+}
+const print=(templateCode)=>{
+  if(!printer.value){
+    scanError()
+    showNotify({ type: 'warning', duration: 3000, message: '请先设置打印机' });
+    return
+  }
+  const data = {warehouse,code:orderDetail.value.waveNo,printServer: printer.value.server, printName:printer.value.printer,templateCode }
+  showLoading()
   fluxPrint(data)
     .then(res => {
       scanSuccess()
@@ -384,10 +399,11 @@ const onSelect=(item)=>{
     handleGroup('freezeGroup', '暂无冻结单');
   }else if(item.value=='reset'){
     reset()
-  }else if(item.value=='goods'){
-    print('goods')
+  }else if(item.value=='packing'){
+    print('A3014_PACK_CARTON_PACKINGLIST')
   }
 }
+
 // 设置波次号
 const inputBarcodeRef = ref(null)
 const setBarcode = (code) => {
@@ -477,7 +493,7 @@ onUnmounted(() => {
   closeListener()
 })
 
-// window.onRefresh = loadData
+window.onRefresh = loadData
 </script>
 
 <style scoped lang="sass">

+ 5 - 2
src/views/outbound/check/large/index.vue

@@ -425,7 +425,10 @@ const reset=()=>{
   showConfirmDialog({
     title: '温馨提示',
     message: '您正在进行重新开始操作,是否继续?',
-  }).then(() => {loadData()})
+  }).then(() => {
+    _reset()
+    inputBarcodeRef.value?.show('', '请扫描订单/快递单号','')
+  })
 }
 //打印清单
 const printerRef=ref(null)
@@ -640,7 +643,7 @@ onUnmounted(() => {
   closeListener()
 })
 
-// window.onRefresh = loadData
+window.onRefresh = loadData
 </script>
 
 <style scoped lang="sass">