Ver código fonte

Merge branch '250612_haikang'

# Conflicts:
#	src/api/haikang/index.ts
#	src/views/haikang/boxReturn/boxReturn/index.vue
#	src/views/inbound/takeDelivery/task/index.vue
#	src/views/index.vue
zhaohuanhuan 9 meses atrás
pai
commit
42268d5902

+ 13 - 0
src/api/haikang/index.ts

@@ -94,6 +94,19 @@ export function createHikBoxInboundTask(data:any) {
     data
   })
 }
+/**
+ * 海康-站点解绑
+ * @param data
+ */
+export function boxAndStationUnbindTask(params:any) {
+  return request({
+    url: '/api/wms/robot/task/boxAndStationUnbindTask',
+    method: 'post',
+    params
+  })
+}
+
+
 
 
 

+ 39 - 6
src/views/haikang/boxReturn/boxReturn/index.vue

@@ -2,7 +2,7 @@
 <template>
   <div class="box-return">
     <van-nav-bar
-      title="海康-入库" left-arrow fixed placeholder @click-left="goBack">
+      title="海康-入库/解绑" left-arrow fixed placeholder @click-left="goBack">
       <template #left>
         <van-icon name="arrow-left" size="25" />
         <div style="color: #fff">返回</div>
@@ -12,11 +12,15 @@
       <div class="content-tips">
         <div style="flex: 1"><van-notice-bar left-icon="volume-o">{{ tips }}</van-notice-bar></div>
       </div>
+      <van-tabs v-model:active="active"   type="card">
+        <van-tab title="料箱入库" name="1"></van-tab>
+        <van-tab title="解绑站点" name="2"  ></van-tab>
+      </van-tabs>
         <div class="content-code">
           <div class="barcode-input">
             <van-search
               ref="boxRef"
-              v-model="scanBox"
+              v-model.lazy="scanBox"
               placeholder="请扫描料箱编码"
               @search="_handlerScan(scanBox)"
               label="料箱编码:"
@@ -29,7 +33,7 @@
           </div>
           <div class="barcode-input">
             <van-search
-              v-model="scanStation"
+              v-model.lazy="scanStation"
               placeholder="请扫描工作站点"
               @search="_handlerScan(scanStation)"
               label="工作站点:"
@@ -50,7 +54,7 @@ import { getHeader, goBack, scanError, scanSuccess } from '@/utils/android'
 import { closeListener, openListener, scanInit } from '@/utils/keydownListener'
 import { barcodeToUpperCase } from '@/utils/dataType'
 import { showNotify } from 'vant'
-import { createHikBoxInboundTask } from '@/api/haikang'
+import { boxAndStationUnbindTask, createHikBoxInboundTask } from '@/api/haikang'
 import { useStore } from '@/store/modules/user'
 import { closeLoading, showLoading } from '@/utils/loading'
 const tips=ref('请扫描料箱')
@@ -69,6 +73,7 @@ onMounted(() => {
   scanInit(_handlerScan)
 
 })
+const active=ref('1')
 // 扫描条码监听
 const _handlerScan = (code) => {
   if (scanType.value == 1) {
@@ -89,8 +94,11 @@ const _handlerScan = (code) => {
     }
     if(code){
       scanStation.value = code
-      console.log('入库')
-      _createHikBoxInboundTask()
+      if(active.value==1){
+        _createHikBoxInboundTask()
+      }else {
+        _boxAndStationUnbindTask()
+      }
     }
   }
 }
@@ -120,6 +128,31 @@ const _createHikBoxInboundTask=()=>{
     closeLoading()
   })
 }
+const _boxAndStationUnbindTask=()=>{
+  const data={
+    warehouse,
+    boxCode:scanBox.value,
+    stationCode:scanStation.value
+  }
+  showLoading()
+  boxAndStationUnbindTask(data).then(res=>{
+    if(res.data){
+      tips.value='请继续扫描料箱编号'
+      scanType.value=1
+      scanBox.value=''
+      scanStation.value=''
+      showNotify({ type: 'success', duration: 3000, message:'料箱入库成功,请继续扫描需要入库料箱' })
+      scanSuccess()
+    }
+  }).catch(err=>{
+    tips.value='料箱解绑失败,请重新扫描工作站点'
+    scanStation.value=''
+    showNotify({ type: 'danger', duration: 3000, message:'料箱解绑失败,请重新扫描工作站点' })
+    scanError()
+  }).finally(()=>{
+    closeLoading()
+  })
+}
 onUnmounted(() => {
   closeListener()
 })

+ 0 - 1
src/views/inbound/takeDelivery/task/index.vue

@@ -670,7 +670,6 @@ const onConfirm = () => {
       scanSuccess()
       showNotify({ type: 'success', duration: 3000, message: `${searchBarcode.value}收货完成,请继续收货!`})
       setBarcode(taskNo.value, '2')
-      scanType.value=2
       closeLoading()
     }).catch(err => {
       if(err.message.includes('序列号已存在')){

+ 1 - 1
src/views/index.vue

@@ -10,7 +10,7 @@
     <div class="home" @click="onRouter('take-delivery')">收货</div>
     <div class="home" @click="onRouter('hik-putaway-allocation')">海康上架-调度</div>
     <div class="home" @click="onRouter('hik-putaway')">海康上架</div>
-    <div class="home" @click="onRouter('hik-box-return')">海康-入库</div>
+    <div class="home" @click="onRouter('hik-box-return')">海康-入库/解绑</div>
   </div>
 </template>
 <script setup>