#
zjj
2025-05-12 c1f8b1a3d163e002bc4075aa5b2db4fda8d8cf67
pages/listing/labour.vue
@@ -1,20 +1,14 @@
<template>
   <view class="has-foot">
      <form>
         <view class="cu-form-group margin-top">
            <view class="title">ASN单</view>
            <input placeholder="请扫描ASN单" v-model="asnCode" focus></input>
         </view>
         <view class="cu-form-group ">
            <view class="title">托盘</view>
            <input placeholder="请扫描托盘" v-model="container"></input>
         </view>
         <view class="cu-form-group ">
            <view class="title">物料码</view>
            <input placeholder="请扫描物料码" v-model="barcode"></input>
            <text class='cuIcon-search text-blue' @click="search"></text>
         </view>
         <view class="cu-form-group">
            <view class="title">库位码</view>
            <input placeholder="请扫描库位码" v-model="locCode"></input>
         </view>
      </form>
      <view class="cu-list det menu sm-border  padding">
@@ -25,14 +19,18 @@
                     {{index+1}}
                  </view>
                  <view class="text-blue">
                     {{`${item.maktx}`}}
                     编码:{{`${item.matnrCode}`}}
                  </view>
               </view>
               <view class="action">
                  <text @click="remove(index)" class="cuIcon-close text-red" style="font-size: 24px;"></text>
               </view>
            </view>
            <view class="cu-item">
               <view class="content">
                  <text class="text-black">名称:</text>
                  <text class="text-grey ">{{item.maktx}}</text>
               </view>
            </view>
            <view class="cu-item">
               <view class="content">
                  <text class="text-black">ASN:</text>
@@ -41,26 +39,9 @@
                  <text class="text-grey ">{{item.asnCode}}</text>
               </view>
            </view>
            <view class="cu-item">
               <view class="content">
                  <text class="text-black">托盘:</text>
               </view>
               <view class="action">
                  <text class="text-grey ">{{item.barcode}}</text>
               </view>
            </view>
            <view class="cu-item">
               <view class="content">
                  <text class="text-black">供应商批次:</text>
               </view>
               <view class="action">
                  <text class="text-grey ">{{item.splrBatch}}</text>
               </view>
            </view>
            <view class="cu-item">
               <view class="content">
                  <text class="text-black">库存批次:</text>
                  <text class="text-black">批次:</text>
               </view>
               <view class="action">
                  <text class="text-grey ">{{item.batch}}</text>
@@ -68,7 +49,7 @@
            </view>
            <view class="cu-item">
               <view class="content">
                  <text class="text-black">收货数量:</text>
                  <text class="text-black">数量:</text>
               </view>
               <view class="action">
                  <text class="text-grey ">{{item.anfme}}</text>
@@ -78,10 +59,7 @@
         </block>
      </view>
      <view class="cu-form-group margin-bottom">
         <view class="title">库位码</view>
         <input placeholder="请扫描库位码" v-model="locCode"></input>
      </view>
      <view class="cu-bar btn-group foot">
         <button class="cu-btn text-blue line-blue shadow" @click="clear">清空</button>
         <button class="cu-btn bg-blue shadow-blur" @click="confirm">上架</button>
@@ -119,15 +97,13 @@
               code,
               data,
               msg
            } = await request('/stock/operate/list', {
               asnCode: this.asnCode,
               barcode: this.container,
               matnrCode: this.barcode
            } = await request('/stock/operate/list', {
               barcode: this.container,
            })
            if (code === 200) {
               // const find = this.list.find(el => el.id === data.id);
               // !find &&
                this.list.push(data)
                this.list = data
            } else {
               uni.showToast({
                  title: msg,
@@ -145,33 +121,44 @@
         },
         async confirm() {
            if (this.locCode !== '') {
               const {
                  code,
                  data,
                  msg
               } = await request('/stock/operate', {
                  itemList: this.list,
                  locCode: this.locCode
            if (this.locCode === '' || this.locCode === null) {
               uni.showToast({
                  title: '请输入库位',
                  icon: "none",
               })
               if (code === 200) {
                  uni.showToast({
                     title: '上架成功'
                  })
                  this.list = []
                  this.barcode = ''
               } else {
                  uni.showToast({
                     title: msg,
                     icon: "none",
                  })
               }
               return ;
            }
            if (this.container === '' || this.container === null) {
               uni.showToast({
                  title: '请输入托盘码',
                  icon: "none",
               })
               return ;
            }
            const {
               code,
               data,
               msg
            } = await request('/stock/operate', {
               itemList: this.list,
               locCode: this.locCode,
               barcode: this.container,
            })
            if (code === 200) {
               uni.showToast({
                  title: '上架成功'
               })
               this.list = []
               this.locCode = ''
               this.container = ''
            } else {
               uni.showToast({
                  title: '请选择库位',
                  title: msg,
                  icon: "none",
               })
            }
         },