Browse Source

Merge branch 'zhaohuanhuan_无单据收货'

# Conflicts:
#	src/api/putaway/index.ts
#	src/types/putaway.ts
#	src/views/robot/putaway/index.vue
zhaohuanhuan 4 months ago
parent
commit
19fd417197

+ 10 - 0
.env.testing

@@ -0,0 +1,10 @@
+NODE_ENV=testing
+
+# just a flag
+ENV=testing
+
+PORT=80
+
+
+# base api
+VITE_APP_BASE_API=https://sit-api.baoshi56.com/

+ 1 - 0
package.json

@@ -9,6 +9,7 @@
     "dev": "vite",
     "build:prod": "vite build",
     "build:sit": "vite build --mode sit",
+    "build:testing": "vite build --mode testing",
     "preview": "vite preview"
   },
   "dependencies": {

+ 39 - 3
src/api/processing/index.ts

@@ -1,5 +1,7 @@
 // @ts-ignore
 import request from '@/utils/request'
+// @ts-ignore
+import { getProcessingListType } from '@/types/processing'
 
 /**
  * 加工-获取加工类型
@@ -11,7 +13,39 @@ export function getProcessingTypeList() {
     method: 'get',
   })
 }
+/**
+ * 获取加工任务
+ * @param params
+ */
+export function getProcessingList(data: getProcessingListType) {
+  return request({
+    url: 'api/device/check/processing/page',
+    method: 'post',
+    data,
+  })
+}
+/**
+ * 获取加工任务类型
+ * @param params
+ */
+export function operateOptions() {
+  return request({
+    url: '/api/device/check/processing/operate',
+    method: 'get'
+  })
+}
 
+/**
+ * 获取加工任务详情
+ * @param params
+ */
+export function getProcessingDetail(params:any) {
+  return request({
+    url: '/api/device/check/processing/get',
+    method: 'get',
+    params
+  })
+}
 /**
  * 加工-创建加工单
  * @param params
@@ -24,11 +58,13 @@ export function createProcessing(data: any) {
   })
 }
 
+
+
 /**
  * 加工单拍摄任务
  * @param params
  */
-export function getProcessingPhotoTask(params) {
+export function getProcessingPhotoTask(params:any) {
   return request({
     url: 'api/device/check/processing/photo-task',
     method: 'get',
@@ -40,7 +76,7 @@ export function getProcessingPhotoTask(params) {
  * 对应的拍摄图片
  * @param id {number} processing photo task id
  */
-export function processingPhotoTaskItems(id) {
+export function processingPhotoTaskItems(id:any) {
   return request({
     url: `api/device/check/processing/photo-task/${id}/photos`,
     method: 'get',
@@ -52,7 +88,7 @@ export function processingPhotoTaskItems(id) {
  * @param  id  processing photo task id
  * @param params  params
  */
-export function uploadPhoto(id, params) {
+export function uploadPhoto(id:any, params:any) {
   return request({
     url: `api/device/check/processing/photo-task/upload-photo/${id}`,
     method: 'put',

+ 16 - 1
src/api/putaway/index.ts

@@ -1,7 +1,7 @@
 // @ts-ignore
 import request from '@/utils/request'
 // @ts-ignore
-import { batchPutawayNewType, batchPutawayType, getWaitPutawayInfoNewType, getWaitPutawayInfoType,} from '@/types/putaway'
+import { batchPutawayNewType, batchPutawayType, getWaitPutawayInfoNewType, getWaitPutawayInfoType} from '@/types/putaway'
 
 /**
  * 批量上架
@@ -14,6 +14,19 @@ export function batchPutaway(data:batchPutawayType) {
     data
   })
 }
+/**
+ * 批量上架
+ * @param data
+ */
+export function batchPutawayNew(data:batchPutawayNewType) {
+  return request({
+    url: '/api/wms/app/inbound-self/shelf',
+    method: 'post',
+    data
+  })
+}
+
+
 
 /**
  * 获取待上架信息
@@ -61,3 +74,5 @@ export function setPutawayNew(data:batchPutawayNewType) {
   })
 }
 
+
+

+ 10 - 3
src/router/index.ts

@@ -59,7 +59,7 @@ const routes: RouteRecordRaw[] = [
     path: '/take-delivery',
     name: 'TakeDelivery',
     meta:{title:'宝时丰收'},
-    component: () => import('@/views/inbound/TakeDelivery/task/index.vue')
+    component: () => import('@/views/inbound/takeDelivery/task/index.vue')
   },
   {
     path: '/hik-putaway-allocation',
@@ -128,11 +128,17 @@ const routes: RouteRecordRaw[] = [
     component: () => import('@/views/returned/register/index.vue')
   },
   {
-    path: '/processing',
-    name: 'Processing',
+    path: '/processing-detail',
+    name: 'ProcessingDetail',
     meta:{title:'加工登记'},
     component: () => import('@/views/processing/register/index.vue')
   },
+  {
+    path: '/processing',
+    name: 'Processing',
+    meta:{title:'加工任务'},
+    component: () => import('@/views/processing/task/index.vue')
+  },
   {
     path: '/putaway',
     name: 'Putaway',
@@ -151,6 +157,7 @@ const routes: RouteRecordRaw[] = [
     meta:{title:'移库'},
     component: () => import('@/views/inventory/transfer/index.vue')
   },
+
   {
     path: '/processing-photo-task',
     name: 'ProcessingPhotoTask',

+ 1 - 1
src/types/haikang.ts

@@ -71,7 +71,7 @@ export interface setBindAllocateWallType {
   /**
    * asn单号
    */
-  asnNo: string;
+  asnCode: string;
   /**
    * 库位
    */

+ 8 - 0
src/types/processing.ts

@@ -0,0 +1,8 @@
+export interface getProcessingListType {
+  warehouse:string;
+  pageNum: number;
+  pageSize: number;
+  status?: number;
+  processCode?: string;
+  [property: string]: any;
+}

+ 10 - 10
src/types/putaway.ts

@@ -12,6 +12,16 @@ export interface batchPutawayType {
   [property: string]: any;
 }
 
+/**
+ * 批量上架
+ */
+export interface batchPutawayNewType {
+  seqId?: string;
+  locationId?: string;
+  qty?: number;
+  [property: string]: any;
+}
+
 /**
  * 上架任务列表
  */
@@ -27,13 +37,3 @@ export interface getWaitPutawayInfoNewType {
   containerId: string;
   warehouseId: string;
 }
-/**
- * 批量上架
- */
-export interface batchPutawayNewType {
-  seqId?: string;
-  locationId?: string;
-  qty?: number;
-  [property: string]: any;
-}
-

+ 31 - 0
src/utils/android.ts

@@ -103,3 +103,34 @@ export function scanError(){
 
   }
 }
+
+export function openCamera(){
+  try {
+    // @ts-ignore
+    const path = window.android.openCamera()
+    console.log(path)
+    return path
+  }catch (e){
+
+  }
+}
+
+export function openGallery(){
+  try {
+    // @ts-ignore
+    const header = window.android.openGallery()
+    console.log(header)
+  }catch (e){
+
+  }
+}
+
+export function openImageEditor(imagePath: string){
+  try {
+    // @ts-ignore
+    const header = window.android.openImageEditor(imagePath)
+    console.log(header)
+  }catch (e){
+
+  }
+}

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

@@ -135,14 +135,12 @@ const _createHikBoxInboundTask=()=>{
   }
   showLoading()
   createHikBoxInboundTask(data).then(res=>{
-    if(res.data){
-      tips.value='请继续扫描料箱编号'
-      scanType.value=1
-      scanBox.value=''
-      scanStation.value=''
-      showNotify({ type: 'success', duration: 3000, message:'料箱入库成功,请继续扫描需要入库料箱' })
-      scanSuccess()
-    }
+    tips.value='请继续扫描料箱编号'
+    scanType.value=1
+    scanBox.value=''
+    scanStation.value=''
+    showNotify({ type: 'success', duration: 3000, message:'料箱入库成功,请继续扫描需要入库料箱' })
+    scanSuccess()
   }).catch(err=>{
     tips.value=err.message
     scanStation.value=''

+ 25 - 9
src/views/haikang/putaway/dispatch/index.vue

@@ -119,6 +119,7 @@ import { useStore } from '@/store/modules/user'
 import { finishTask, getRecommendedLocation, getWaitPutawayList, setBindAllocateWall } from '@/api/haikang'
 import { barcodeToUpperCase } from '@/utils/dataType'
 import { closeLoading, showLoading } from '@/utils/loading'
+import { getWaitPutawayListNew } from '@/api/putaway'
 try {
   getHeader()
   androidFocus()
@@ -173,14 +174,32 @@ const setBarcode = (code) => {
     _handlerScan(code)
     return
   }
-  const params = { warehouse, container: code, page: 1, size: 1000, status: false }
-  getWaitPutawayList(params).then(res => {
-    if (res.data.records.length == 0) {
+  const params = { warehouseId:warehouse, containerId: code }
+  getWaitPutawayListNew(params).then(res => {
+    if (res.data.asnToShelfList.length==0 && res.data.noAsnToShelfList.length==0 ) {
       scanError()
       inputBarcodeRef.value?.show('', '请扫描收货容器号', '暂未查询到待上架任务,请切换容器')
     } else {
       scanSuccess()
-      dataMap.value = groupedData(res.data.records)
+      bin.value = ''
+      searchBarcode.value=''
+      wallNo.value=''
+      const noAsnToShelfList = res.data.noAsnToShelfList.map(item => {
+        return {
+          ...item,
+          lotNumber: item.lotNum,
+          lotAtt01: item.productDate,
+          lotAtt02: item.expireDate,
+          lotAtt04: item.productNum,
+          lotAtt08: item.quality,
+          quantity: item.remainShelfQty,
+          docNo: item.businessNo,
+          taskLineNo: item.id,
+          owner: item.customer,
+        }
+      })
+     const list = [...res.data.asnToShelfList, ...noAsnToShelfList]
+      dataMap.value = groupedData(list)
       scanType.value = 3
       containerNo.value = code
     }
@@ -294,7 +313,7 @@ const setLocation = (item) => {
       container: containerNo.value,
       barcode: barcodeActive.value.barcode,
       barcodeAS: barcodeActive.value.barcodeAs,
-      asnCode: barcodeActive.value.asnNo,
+      asnCode:barcodeActive.value.docNo,
       sku: barcodeActive.value.sku,
       location: locationActive.value[0].location,
       lotNum: barcodeActive.value.lotNumber,
@@ -320,10 +339,7 @@ const loadData = () => {
     inputBarcodeRef.value?.show('', '请扫描收货容器号', '')
     return
   } else {
-    const params = { warehouse, container: containerNo.value, page: 1, size: 1000, status: false }
-    getWaitPutawayList(params).then(res => {
-      dataMap.value = groupedData(res.data.records)
-    })
+    setBarcode(containerNo.value)
   }
 }
 //根据条码批次分组数据

+ 46 - 20
src/views/inbound/putaway/task/index.vue

@@ -161,7 +161,7 @@ import { closeLoading, showLoading } from '@/utils/loading'
 import { useStore } from '@/store/modules/user'
 import { showNotify, showToast } from 'vant'
 import { getCurrentTime } from '@/utils/date'
-import { batchPutaway, getWaitPutawayInfo } from '@/api/putaway/index'
+import { getWaitPutawayListNew, setPutawayNew } from '@/api/putaway/index'
 import { barcodeToUpperCase } from '@/utils/dataType.js'
 import { getRecommendedLocation } from '@/api/haikang/index'
 import { getOwnerList } from '@/hooks/basic/index'
@@ -201,7 +201,7 @@ const taskInfo = ref({})
 //开始时间
 const currentTime = ref('--')
 const scanType = ref(2)
-
+const putweayType=ref('def')
 const lotAttributes = {
   lotAtt01: { title: '生产日期' },
   lotAtt02: { title: '失效日期' },
@@ -265,8 +265,8 @@ const setBarcode = (code, type) => {
     formattedTime.value = '00:00:00'
     totalSeconds.value = 0
   }
-  const params = { warehouse, container: code }
-  getWaitPutawayInfo(params).then(res => {
+  const params = { warehouseId:warehouse, containerId: code }
+  getWaitPutawayListNew(params).then(res => {
     reset()
     scanType.value=2
     back.value = true
@@ -274,15 +274,33 @@ const setBarcode = (code, type) => {
       currentTime.value = getCurrentTime()
       startTimer()
     }
-    if (res.data.length > 0) {
-      taskInfo.value = res.data[0]
-      dataList.value = res.data
-      dataMap.value = groupedData(res.data)
+    if (res.data.asnToShelfList.length > 0 || res.data.noAsnToShelfList.length>0 ) {
+      const asnToShelfList = res.data.asnToShelfList.map(item => {
+        return {
+          ...item,
+          type:'asn'
+        }
+      })
+      const noAsnToShelfList = res.data.noAsnToShelfList.map(item => {
+        return {
+          ...item,
+          lotNumber: item.lotNum,
+          lotAtt01: item.productDate,
+          lotAtt02: item.expireDate,
+          lotAtt04: item.productNum,
+          lotAtt08: item.quality,
+          quantity: item.remainShelfQty,
+          taskLineNo: item.id,
+          owner:item.customer,
+          type:'noAsn'
+        }
+      })
+      dataList.value = [...asnToShelfList,...noAsnToShelfList]
+      dataMap.value = groupedData(dataList.value)
       containerNo.value = code
       scanSuccess()
     } else {
       reset()
-      taskInfo.value = {}
       dataMap.value = {}
       dataList.value = []
       inputBarcodeRef.value?.show('', '请扫描容器号', '暂无待上架信息')
@@ -290,7 +308,6 @@ const setBarcode = (code, type) => {
     }
   }).catch(err => {
     reset()
-    taskInfo.value = {}
     dataMap.value = {}
     dataList.value = []
     inputBarcodeRef.value?.show('', '请扫描容器号', err.message)
@@ -430,24 +447,33 @@ const isCheck = () => {
 const onConfirm = () => {
   if (isCheck()) {
     const quantity = searchCount.value
-    const data = []
+    const asnDoShelfList = []
+    const noAsnDoShelfList=[]
     const list = structuredClone(barcodeActiveList.value) // 深拷贝,保证原始数据不被修改
     let remainingQuantity = quantity
     for (let i = 0; i < list.length && remainingQuantity > 0; i++) {
       const { taskNo, taskLineNo, warehouse, quantity } = list[i]
       const takeQuantity = Math.min(quantity, remainingQuantity)
-      data.push({
-        taskNo,
-        taskLineNo,
-        warehouse,
-        container: '*',
-        targetCode: searchLocation.value,
-        quantity: takeQuantity, // 当前项扣除的数量
-      })
+      if(list[i].type=='asn'){
+        asnDoShelfList.push({
+          taskNo,
+          taskLineNo,
+          warehouse,
+          container: '*',
+          targetCode: searchLocation.value,
+          quantity: takeQuantity, // 当前项扣除的数量
+        })
+      }else {
+        noAsnDoShelfList.push({
+          id:taskLineNo,
+          location:searchLocation.value,
+          qty:takeQuantity
+        })
+      }
       remainingQuantity -= takeQuantity
     }
     showLoading()
-    batchPutaway(data).then(res => {
+    setPutawayNew({asnDoShelfList,noAsnDoShelfList}).then(res => {
       if (totalQuantity.value - Number(searchCount.value) == 0) {
         containerNo.value = ''
         dataMap.value = {}

+ 1 - 1
src/views/inbound/takeDelivery/components/LotDate.vue

@@ -24,7 +24,7 @@ const currentDate = ref([today.getFullYear(), today.getMonth() + 1, today.getDat
 // 最小日期为当前日期前三年
 const minDate = computed(() => {
   const date = new Date(today)
-  date.setFullYear(today.getFullYear() - 25) // 当前日期减去3年
+  date.setFullYear(today.getFullYear() - 20) // 当前日期减去3年
   return date
 })
 // 最大日期为当前日期后8年

+ 6 - 5
src/views/inbound/takeDelivery/task/index.vue

@@ -171,10 +171,10 @@ import {
 import { closeLoading, showLoading } from '@/utils/loading'
 import { useStore } from '@/store/modules/user'
 import { showNotify, showToast } from 'vant'
-import { isAttribute } from '@/views/inbound/TakeDelivery/task/hooks/attribute'
-import Attribute from '@/views/inbound/TakeDelivery/components/Attribute.vue'
-import LotDate from '@/views/inbound/TakeDelivery/components/LotDate.vue'
-import UniqueCodeInput from '@/views/inbound/TakeDelivery/components/UniqueCodeInput.vue'
+import { isAttribute } from '@/views/inbound/takeDelivery/task/hooks/attribute'
+import Attribute from '@/views/inbound/takeDelivery/components/Attribute.vue'
+import LotDate from '@/views/inbound/takeDelivery/components/LotDate.vue'
+import UniqueCodeInput from '@/views/inbound/takeDelivery/components/UniqueCodeInput.vue'
 import { barcodeToUpperCase, toMap } from '@/utils/dataType.js'
 import { getCurrentTime } from '@/utils/date'
 
@@ -683,13 +683,14 @@ const isCheck = () => {
 const onConfirm = () => {
   if(isCheck()){
     const lotMap = toMap(lotData.value, 'field', 'mapping')
-    const { asnLineNo, asnNo, warehouse } = asnInfo.value
+    const { asnLineNo, asnNo, warehouse,customerId } = asnInfo.value
     const data = {
       asnLineNo,
       asnNo,
       containerId: containerNo.value,
       quantity: searchCount.value,
       warehouse,
+      customerId,
       serialNos: uniqueCodeList.value.length > 0 ? uniqueCodeList.value : undefined,
       ...lotMap,
     }

+ 4 - 0
src/views/outbound/check/activity/index.vue

@@ -6,6 +6,9 @@
         <van-icon name="arrow-left" size="25" />
         <div style="color: #fff">返回</div>
       </template>
+      <!--      <template #right>-->
+      <!--        <div class="nav-right" @click="onClickRight">提交任务</div>-->
+      <!--      </template>-->
     </van-nav-bar>
     <div class="activity">
       <div class="wave-title">
@@ -24,6 +27,7 @@
             <div>KG</div>
           </template>
         </van-field>
+<!--        :class="[totalWeight>0?'success-input-barcode':'error-input-barcode']"-->
       </div>
       <div class="order-detail">
         <div class="picking-no">

+ 0 - 0
src/views/outbound/picking/components/lotAtt.vue → src/views/outbound/picking/components/LotAtt.vue


+ 8 - 1
src/views/processing/register/components/addRegisterType.vue

@@ -46,11 +46,17 @@ const props = defineProps({
   processingTypeList: Array
 })
 const typeList=ref([])
-const show = async (list) => {
+const show = async (list,item) => {
   typeTrueFalseBy.value = true
   type.value = []
   count.value = ''
   checkType.value = ''
+  if(item.expectAmount){
+    count.value=item.expectAmount
+    type.value=item.operate
+    const match=['PROFESSIONAL','DEEP','FINE'].find(items => item.operate.includes(items)) || ''
+    checkType.value=match
+  }
   typeList.value=list
 }
 //输入拣货容器号
@@ -99,6 +105,7 @@ const beforeClose = (action) => new Promise(async (resolve) => {
       data.operate.every(op => item.operate.includes(op))
     );
     if(isExist){
+      // data.expectAmount = isExist.expectAmount;
       showToast('选择的加工类型已存在,请检查')
       scanError()
       return resolve(false)

+ 73 - 31
src/views/processing/register/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="register">
     <van-nav-bar
-      title="加工建单" left-arrow fixed placeholder @click-left="goBack" @click-right="onConfirm()">
+      title="加工建单" left-arrow fixed placeholder @click-left="historyBack" @click-right="onConfirm()">
       <template #left>
         <van-icon name="arrow-left" size="25" />
         <div style="color: #fff">返回</div>
@@ -10,21 +10,26 @@
         <div style="color: #fff">提交</div>
       </template>
     </van-nav-bar>
-    <van-field v-model="date" type="text" label="登记日期" placeholder="请选择日期"
-               readonly is-link input-align="right" @click="dateTrueFalseBy=true" required
-    />
-    <van-field v-model="ownerCode" type="text" label="登记货主" placeholder="请选择货主" readonly
-               is-link @click="ownerRef.show(1)" input-align="right" required
+
+    <van-field v-model="taskDetail.code" type="text" label="任务号" placeholder="任务号"
+               readonly input-align="right" required
     />
-    <van-field v-model="code" type="textarea" label="单据信息" placeholder="请填写快递单号/收货任务号,多个用逗号/空格/换行符进行分割"
-               show-word-limit maxlength="500" rows="2" autosize required
+<!--    <van-field v-model="date" type="text" label="登记日期" placeholder="请选择日期"-->
+<!--               readonly is-link input-align="right" @click="dateTrueFalseBy=true" required-->
+<!--    />-->
+    <van-field v-model="taskDetail.owner" type="text" label="登记货主" placeholder="请选择货主" readonly
+               input-align="right" required
     />
+<!--  is-link @click="ownerRef.show(1)"   -->
+<!--    <van-field v-model="code" type="textarea" label="单据信息" placeholder="请填写快递单号/收货任务号,多个用逗号/空格/换行符进行分割"-->
+<!--               show-word-limit maxlength="500" rows="2" autosize required-->
+<!--    />-->
     <van-field v-model="note" type="textarea" label="&nbsp;&nbsp;备注信息" placeholder="请输入备注信息"
-               show-word-limit  maxlength="500" rows="1" autosize
+               show-word-limit  maxlength="500" rows="2" autosize
     />
     <div class="register-content">
       <div class="add-type">
-        <van-button type="primary" round size="small" @click="addType">添加类型</van-button>
+        <van-button type="primary" round size="small" @click="addType({})">添加类型</van-button>
       </div>
       <div class="type-box">
         <div class="type-title">类型表一览</div>
@@ -32,16 +37,19 @@
           <div class="type-item">
             <div class="type-item-item">类型</div>
             <div class="type-item-operate">数量</div>
-            <div class="type-item-operate">操作</div>
+            <div class="type-item-operate" >操作</div>
           </div>
           <div  class="type-item" v-for="(item,index) in typeList" v-if="typeList.length>0">
             <div  class="type-item-item">{{getOperate(item.operate)}}</div>
             <div class="type-item-operate">{{item.expectAmount}}</div>
-            <div class="type-item-delete" @click="del(item,index)" >删除</div>
+            <div style="display: flex" >
+<!--              <span class="type-item-update" @click="addType(item)" >修改</span>-->
+              <span class="type-item-delete" @click="del(item,index)" >删除</span>
+            </div>
           </div>
           <div v-else>
             <van-empty :image="<string>nodataUrl" image-size="140" >
-              <van-button round type="primary" class="bottom-button" size="small" @click="addType">添加</van-button>
+              <van-button round type="primary" class="bottom-button" size="small" @click="addType({})">添加</van-button>
             </van-empty>
           </div>
         </div>
@@ -62,11 +70,12 @@ import { useStore } from '@/store/modules/user'
 import { closeLoading, showLoading } from '@/utils/loading'
 import Owner from '@/components/Owner.vue'
 import { formatDate } from '@/utils/date'
-import { useRouter } from 'vue-router'
+import { useRoute, useRouter } from 'vue-router'
 import nodataUrl from '@/assets/nodata.png'
 import AddRegisterType from '@/views/processing/register/components/addRegisterType.vue'
-import { createProcessing, getProcessingTypeList } from '@/api/processing'
+import { createProcessing, getProcessingDetail, getProcessingTypeList } from '@/api/processing'
 import { toArray, toMap } from '@/utils/dataType'
+const route = useRoute()
 const router = useRouter()
 try {
   getHeader()
@@ -81,6 +90,7 @@ const ownerCode = ref('')
 const date = ref(formatDate(new Date()))
 const note = ref('')
 const code=ref('')
+const taskDetail=ref({}) //任务详情
 const processingTypeList=ref([])
 const processingTypeMap=ref({})
 //添加类型
@@ -97,23 +107,43 @@ const dateConfirm = (e) => {
   date.value = formatDate(e)
   dateTrueFalseBy.value = false
 }
+
+// 获取详情
+const getDetail=()=>{
+  showLoading()
+  getProcessingDetail({code:route.query.code}).then(res => {
+    taskDetail.value=res.data
+    ownerCode.value = res.data.ownerId
+    typeList.value=res.data.typeList
+    note.value=res.data.processNote
+  }).catch(err=>{
+    taskDetail.value={}
+    scanError()
+    showNotify({ type: 'warning', duration: 3000, message: '详情获取失败正在返回上一页' })
+    router.push({name:'Processing'})
+  })
+    .finally(() => {
+    closeLoading()
+  })
+}
+getDetail()
 //提交登记
 const onConfirm = () => {
-  if(!ownerCode.value){
-    showNotify({ type: 'warning', duration: 3000, message: '请选择货主' })
-    scanError()
-    return
-  }
+  // if(!ownerCode.value){
+  //   showNotify({ type: 'warning', duration: 3000, message: '请选择货主' })
+  //   scanError()
+  //   return
+  // }
   if(typeList.value.length==0){
     showNotify({ type: 'warning', duration: 3000, message: '请先添加单据类型' })
     scanError()
     return
   }
-  if(!code.value){
-    showNotify({ type: 'warning', duration: 3000, message: '请先添加单据信息' })
-    scanError()
-    return
-  }
+  // if(!code.value){
+  //   showNotify({ type: 'warning', duration: 3000, message: '请先添加单据信息' })
+  //   scanError()
+  //   return
+  // }
 
   showConfirmDialog({
     title: '温馨提示', message:'是否确认建单' })
@@ -123,20 +153,22 @@ const onConfirm = () => {
 }
 
 const _createProcessing=()=>{
-  const data={owner:ownerItem.value.id,ownerCode:ownerItem.value.code,note:note.value,warehouse,typeList:typeList.value,noList:toArray(code.value)}
+  const data={id:taskDetail.value.id,note:note.value,warehouse,typeList:typeList.value}
   showLoading()
   createProcessing(data).then(res=>{
     closeLoading()
     scanSuccess()
     showConfirmDialog({
-      title: '建单成功',
+      title: '提示',
       message:`加工单号为:${res.data}`,
       confirmButtonText:'复制'
     })
       .then(() => {
         copyText(res.data)
       })
-      .catch(() => {});
+      .catch(() => {
+        router.push({name:'Processing'})
+      });
     reset()
   }).catch(err=>{
     scanError()
@@ -152,6 +184,7 @@ const copyText=(txt) =>{
     const successful = document.execCommand('copy');
     if (successful) {
       showNotify({ type: 'success', duration: 3000, message: '已复制' })
+      router.push({name:'Processing'})
     } else {
       console.error('复制失败');
     }
@@ -161,6 +194,9 @@ const copyText=(txt) =>{
     document.body.removeChild(textarea);
   }
 }
+const historyBack=()=>{
+  history.back();
+}
 const reset=()=>{
   code.value=""
   typeList.value=[]
@@ -168,11 +204,12 @@ const reset=()=>{
   ownerCode.value=''
 }
 //添加类型
-const addType=()=>{
-  addRegisterTypeRef.value?.show(typeList.value)
+const addType=(item)=>{
+  console.log(item,"item")
+  addRegisterTypeRef.value?.show(typeList.value,item)
 }
 const setProcessingType=(data)=>{
-  typeList.value.push(data)
+    typeList.value.push(data);
 }
 //转换类型名称
 const getOperate=(operate)=>{
@@ -228,6 +265,11 @@ window.onRefresh = loadData
             text-align: center
             color: #ff4141
             text-decoration: underline
+          .type-item-update
+            width: 50px
+            text-align: center
+            color: #1861e0
+            text-decoration: underline
         .type-item:last-child
           border-bottom: none
 

+ 74 - 0
src/views/processing/task/components/processingTypeList.vue

@@ -0,0 +1,74 @@
+<template>
+  <div>
+    <table class="item-type-table">
+      <thead>
+      <tr>
+        <th width="30px">#</th>
+        <th width="40%">类型</th>
+        <th>预期数量</th>
+        <th>单价</th>
+      </tr>
+      </thead>
+      <tbody>
+      <tr v-for="(item, i) in visibleItems" :key="i">
+        <td>{{ i + 1 }}</td>
+        <td>
+          <div v-if="item.operate">
+            <span v-for="(type,index) in item.operate" :key="index">{{ operateMap[type] }}
+              <span v-if="index!==item.operate.length-1">、</span>
+            </span>
+          </div>
+        </td>
+        <td>{{ item.expectAmount }}</td>
+        <td>{{ item.unitPrice }}</td>
+      </tr>
+      </tbody>
+    </table>
+    <div v-if="props.typeList.length > 3" class="toggle-btn">
+      <van-button @click="toggleVisibility" type="primary" size="mini" plain> {{ isCollapsed ? '展开更多' : '收起' }}</van-button>
+    </div>
+  </div>
+</template>
+<script setup>
+import { ref, computed } from 'vue'
+// 接收父组件传递的数据
+const props = defineProps({
+  typeList: Array,
+  operateMap: Object,
+})
+// 控制折叠状态
+const isCollapsed = ref(true)
+// 计算属性:根据折叠状态返回可见的行
+const visibleItems = computed(() => {
+  return isCollapsed.value ? props.typeList.slice(0, 3) : props.typeList
+})
+// 切换折叠状态
+const toggleVisibility = () => {
+  isCollapsed.value = !isCollapsed.value
+}
+</script>
+
+<style scoped lang="sass">
+.item-type-table
+  width: 100%
+  border-collapse: collapse
+  border: 1px solid #f3f2f2
+  font-size: 13px
+
+.item-type-table th, .item-type-table td
+  text-align: center
+
+.item-type-table tr
+  border-bottom: 1px solid #f3f2f2
+
+.item-type-table th
+  background-color: #f9f9f9
+  font-weight: 400
+
+.item-type-table td
+  background-color: #fff
+
+.item-type-table tr:last-child
+  border-bottom: none
+
+</style>

+ 260 - 0
src/views/processing/task/index.vue

@@ -0,0 +1,260 @@
+<template>
+  <div class="processing-task">
+    <van-nav-bar
+      title="加工任务" left-arrow fixed placeholder @click-left="goBack" @click-right="onClickRight">
+      <template #left>
+        <van-icon name="arrow-left" size="25" />
+        <div style="color: #fff">返回</div>
+      </template>
+      <template #right>
+        <van-icon name="search" />
+        <div style="color: #fff">开始登记</div>
+      </template>
+    </van-nav-bar>
+    <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="min-height: 90vh;">
+      <van-list
+        v-model:loading="loading"
+        :finished="finished"
+        finished-text="没有更多了"
+        @load="onLoad"
+      >
+        <div class="card-list" v-if="list.length>0">
+          <div class="card-item" v-for="item in list" :key="item.code" :title="item.code">
+            <div class="item-title">
+              <div class="item-title-left">{{ item.owner }}
+                <span style="font-size: 10px;color: #999">({{item.createTime.split(' ')[1]}})</span>
+              </div>
+              <div class="item-title-right" @click="copy(item.code)" >{{ item.code }}<van-icon name="eye-o" /></div>
+            </div>
+            <div class="item-type-box"  >
+              <processing-type-list :operate-map="operateMap" :type-list="item.typeList" />
+            </div>
+            <div class="item-operate" >
+              <div class="item-operate-left" v-if="item.processNote">
+                <van-notice-bar scrollable :speed="40"  color="#1989fa" background="#ecf9ff" left-icon="comment-o">
+                  {{item.processNote}}
+                </van-notice-bar>
+              </div>
+              <div class="item-operate-right" @click="getDetail(item)">
+                <van-button type="primary" size="mini" >开始登记</van-button>
+              </div>
+            </div>
+          </div>
+        </div>
+        <div v-else>
+          <van-empty :image="nodataUrl" image-size="140" >
+            <van-button round type="primary" class="bottom-button" size="small" @click="onRefresh">刷新</van-button>
+          </van-empty>
+        </div>
+      </van-list>
+    </van-pull-refresh>
+    <input-barcode  ref="inputBarcodeRef" @setBarcode="setBarcode" />
+  </div>
+</template>
+
+<script setup>
+import { ref } from 'vue'
+import { getHeader, goBack, scanError, scanSuccess } from '@/utils/android'
+import { getProcessingList, operateOptions } from '@/api/processing/index'
+import { closeLoading, showLoading } from '@/utils/loading'
+import { useRouter } from 'vue-router'
+import { useStore } from '@/store/modules/user'
+import { toMap } from '@/utils/dataType'
+import processingTypeList from '@/views/processing/task/components/processingTypeList.vue'
+import { showConfirmDialog, showNotify } from 'vant'
+import nodataUrl from '@/assets/nodata.png'
+import InputBarcode from '@/views/outbound/picking/components/InputBarcode.vue'
+
+const router = useRouter()
+try {
+  getHeader()
+} catch (error) {
+  router.push('/login')
+}
+const store = useStore()
+const warehouse = store.warehouse
+const operateMap=ref({})
+const list = ref([])
+const loading = ref(false)
+const finished = ref(false)
+const refreshing = ref(false)
+const pageSize = ref(0)
+const total = ref(1)
+
+const getOperateMap=()=>{
+  operateOptions().then( res=> {
+    operateMap.value = toMap(res.data,'code', 'name')
+  })
+}
+getOperateMap()
+
+// 通用的加载逻辑函数
+const loadData = async (page = 1) => {
+  if (loading.value) return; // 如果正在加载中,则不重复请求
+      // 设置为加载中状态
+      loading.value = true
+  try {
+    // 请求数据
+    const data = { warehouse: warehouse, pageNum: page, pageSize: pageSize.value + 30,status:12 }
+    showLoading()
+    const res = await getProcessingList(data)
+    // 获取数据并赋值
+    const records = res.data.data.records || []
+    const totalData = res.data.data.total || 0
+    const size = res.data.data.size || 0
+
+    // 如果数据不相同再更新
+    if (records.length !== list.value.length) {
+      list.value = records
+    }
+    total.value = totalData
+    pageSize.value = size
+    // 判断是否已加载完所有数据
+    if (list.value.length >= total.value) {
+      finished.value = true
+    }
+  } catch (error) {
+    finished.value = true;  // 已经没有更多数据
+    list.value = [];  // 清空数据
+  } finally {
+    closeLoading()
+    refreshing.value = false;  // 停止刷新
+    loading.value = false  // 确保只设置一次
+  }
+}
+
+const onLoad = async () => {
+  loading.value=false
+  if (refreshing.value) {
+    refreshing.value = false
+  }
+  // 调用通用的加载数据函数
+  await loadData()
+}
+
+const onRefresh = () => {
+  // 清空列表数据
+  finished.value = false
+  pageSize.value = 0
+  // 调用通用的加载数据函数
+  onLoad()
+}
+const inputBarcodeRef=ref(null)
+const onClickRight=()=>{
+  inputBarcodeRef.value?.show('','请扫描加工任务号','')
+}
+
+const setBarcode=(code)=>{
+  console.log(code)
+  const data = { warehouse: warehouse, pageNum: 1, pageSize:10,status:12,processCode:code }
+  showLoading()
+  getProcessingList(data).then( res=> {
+    if(res.data.data.records.length > 0){
+      const item=res.data.data.records[0]
+      getDetail(item)
+    }else {
+      scanError()
+      showNotify({ type: 'warning', duration: 5000, message: `暂未查询到《${code}》待加工信息,请检查后重新输入` })
+      inputBarcodeRef.value?.show('','请扫描加工任务号',`暂未查询到《${code}》待加工信息,请检查后重新输入`)
+    }
+    closeLoading()
+  }).catch(err=>{
+    scanError()
+    closeLoading()
+  })
+}
+// 跳转详情
+const getDetail=(item)=>{
+  router.push({name:'ProcessingDetail',query: { code:item.code }})
+}
+const copy=(code)=>{
+  showConfirmDialog({
+    title: '提示',
+    message:`加工单号为:${code}`,
+    confirmButtonText:'复制'
+  })
+    .then(() => {
+      copyText(code)
+    })
+    .catch(() => {});
+}
+const copyText=(txt) =>{
+  const textarea = document.createElement('textarea');
+  textarea.value =txt;
+  document.body.appendChild(textarea);
+  textarea.select();
+  try {
+    const successful = document.execCommand('copy');
+    if (successful) {
+      showNotify({ type: 'success', duration: 3000, message: '已复制' })
+    } else {
+      console.error('复制失败');
+    }
+  } catch (err) {
+    showNotify({ type: 'danger', duration: 3000, message: '复制失败' })
+  } finally {
+    document.body.removeChild(textarea);
+  }
+}
+window.onRefresh=onLoad
+
+</script>
+
+<style scoped lang="sass">
+.processing-task
+  background: #f5f5f5
+  font-size: 14px
+
+  .show-type
+    position: fixed
+    top: 45px
+    left: 0
+    right: 0
+    display: flex
+    justify-content: flex-end
+    z-index: 1000
+    background: #f5f5f5
+
+    ::v-deep(.van-tabs__wrap)
+      height: 24px
+
+    ::v-deep(.van-tabs__nav--card)
+      margin: 0 10px
+      height: auto
+      font-size: 12px
+
+  ::v-deep(.van-pull-refresh)
+    //margin-top: 24px
+
+    .card-list
+      padding: 0 10px
+
+      .card-item
+        padding: 6px 10px
+        background: #ffffff
+        //background: linear-gradient(160deg, #e9f2ff 10%, white 30%, white 100%)
+        margin-bottom: 8px
+        display: flex
+        flex-direction: column
+
+        .item-title
+          display: flex
+          justify-content: space-between
+          padding: 5px 0
+
+          .item-title-left
+            font-weight: 500
+        .item-operate
+          display: flex
+          justify-content: right
+          align-items: center
+          gap: 10px
+          .item-operate-left
+            width: 80%
+          .item-operate-right
+            text-align: right
+            flex: 1
+
+
+
+</style>

+ 20 - 53
src/views/robot/putaway/index.vue

@@ -188,7 +188,22 @@ const setBarcode = (code) => {
       bin.value = ''
       searchBarcode.value=''
       wallNo.value=''
-      dataMap.value = processPutawayData(res.data)
+      const noAsnToShelfList = res.data.noAsnToShelfList.map(item => {
+        return {
+          ...item,
+          lotNumber: item.lotNum,
+          lotAtt01: item.productDate,
+          lotAtt02: item.expireDate,
+          lotAtt04: item.productNum,
+          lotAtt08: item.quality,
+          quantity: item.remainShelfQty,
+          docNo: item.businessNo,
+          taskLineNo: item.id,
+          owner: item.customer,
+        }
+      })
+      const list = [...res.data.asnToShelfList, ...noAsnToShelfList]
+      dataMap.value = groupedData(list)
       scanType.value = 3
       containerNo.value = code
       locationActive.value=[]
@@ -462,7 +477,7 @@ const executeReleaseWall = (storedData, hasCache) => {
         }
         saveBinStorageData(storedData)
       }
-
+      
       // 重置相关状态
       bin.value = ''
       searchBarcode.value = ''
@@ -492,7 +507,7 @@ const handleReleaseWall = () => {
   // 获取存储的数据并检查是否有该分拨墙的绑定数据
   const storedData = getBinStorageData()
   const containerList = []
-
+  
   for (const container in storedData) {
     if (storedData[container][wallNo.value] && Object.keys(storedData[container][wallNo.value]).length > 0) {
       containerList.push(container)
@@ -500,7 +515,7 @@ const handleReleaseWall = () => {
   }
 
   const hasCache = containerList.length > 0
-  const message = hasCache
+  const message = hasCache 
     ? `确定要释放分拨墙 ${wallNo.value} 吗?\n将会删除以下容器的分拨墙数据:\n${containerList.join(', ')}`
     : `确定要释放分拨墙 ${wallNo.value} 吗?`
 
@@ -519,18 +534,7 @@ const loadData = () => {
     inputBarcodeRef.value?.show('', '请扫描退货收货容器号', '')
     return
   } else {
-    const params = { warehouseId:warehouse, containerId: containerNo.value }
-    getWaitPutawayListNew(params).then(res => {
-      if (res.data.asnToShelfList.length==0 && res.data.noAsnToShelfList.length==0 ) {
-        scanError()
-        inputBarcodeRef.value?.show('', '请扫描收货容器号', '暂未查询到待上架任务,请切换容器')
-      } else {
-        dataMap.value = processPutawayData(res.data)
-      }
-    }).catch(err => {
-      scanError()
-      inputBarcodeRef.value?.show('', '请扫描退货收货容器号', err.message)
-    })
+   setBarcode(containerNo.value)
   }
 }
 //根据条码批次分组数据
@@ -546,26 +550,6 @@ const groupedData = (data) => {
   }, {})
 }
 
-// 处理待上架数据并分组
-const processPutawayData = (responseData) => {
-  const noAsnToShelfList = responseData.noAsnToShelfList.map(item => {
-    return {
-      ...item,
-      lotNumber: item.lotNum,
-      lotAtt01: item.productDate,
-      lotAtt02: item.expireDate,
-      lotAtt04: item.productNum,
-      lotAtt08: item.quality,
-      quantity: item.remainShelfQty,
-      docNo: item.businessNo,
-      taskLineNo: item.id,
-      owner: item.customer,
-    }
-  })
-  const list = [...responseData.asnToShelfList, ...noAsnToShelfList]
-  return groupedData(list)
-}
-
 onUnmounted(() => {
   closeListener()
 })
@@ -602,30 +586,13 @@ window.onRefresh = loadData
       .code-input
         ::v-deep(.van-search)
           padding: 0
-          height: 50px
-          display: flex
-          align-items: center
-
-        ::v-deep(.van-search__content)
-          height: 50px
-          display: flex
-          align-items: center
 
         ::v-deep(.van-search__label)
           font-size: 16px
-          line-height: 50px
 
         ::v-deep(.van-search__field)
           border-bottom: 2px solid #efefef
           font-size: 16px
-          height: 50px
-          display: flex
-          align-items: center
-
-        ::v-deep(.van-field__control)
-          font-size: 16px
-          height: 50px
-          line-height: 50px
 
         ::v-deep(.van-search__content)
           background: #fff