chen.lin
2026-03-06 319080c3fcf38097717f483892ec8993882b3131
拣货过程中的出库库存匹配
1个文件已添加
64个文件已修改
4420 ■■■■ 已修改文件
checkOrder.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
common/format.js 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/AGV/AGVStaBind.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/AGV/BindAndInTask.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/AGV/StaUnBind.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/AGV/StartInTask.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/check/TempCheck.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/check/checkOrderItem.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/check/firstCheck.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspect/bad.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspect/check.vue 518 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/inspect/report.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/listing/disc.vue 574 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/listing/itemSelect.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/listing/labour.vue 406 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/listing/matnrPalletising.vue 267 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/listing/unPakin.vue 575 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/listing/untie.vue 458 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/listing/upper.vue 526 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/mat/matSelected.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/outbound/ModifyTaskBind.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/outbound/PickItemDetl.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/outbound/fastPicking.vue 154 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/outbound/wavePickItem.vue 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/AGV/AGVPakin.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/AGV/AGVPakin2.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/AGV/AGVPakin3.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/AGV/emptyOut.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/AGV/emptyPakin.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/backStock/backStocksOrder.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/bcp/bcpDbOrder.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/bcp/bcpDbOrderV2.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/bcp/bcpOrder.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/bcp/bcpOrder_xs.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/bcp/orderCar.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/bcp/orderCar_xs.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/checkLocDetl/locDetlList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/checkLocDetl/locDetlList2.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/comOrder/checkOut.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/comOrder/orderCar.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/comOrder/orderIn.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/inStock/inStock.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/mat/matSelected.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/order/orderCar.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/order/pakinOrderSelect.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/order/pakinOrderSelectV2.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/orderOut/orderCheck.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/orderOut/orderCheck_2.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/processOrder/orderCheck.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/processOrder/orderCheck2.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/processOrder/processList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/processOrder/processOrder.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/stationManage/confirmProcessed.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/stationManage/pickAgain.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/stationManage/stationDetl.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/stationManage/stationManage.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/waitOrder/waitOrderIn.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/waitOrder/waitOrderOut.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/wrkMast/DBList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/wrkMast/waitPakin.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/wrkMast/wrkDetl.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/phyz/wrkMast/wrkMast.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/rece/other.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/rece/standard.vue 678 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
checkOrder.vue
@@ -38,7 +38,7 @@
                </view>                
                <view class="cu-item">
                    <view class="content">
                        <text class="text-gray">库存数量:<text class="text-black ">{{item.anfme}}</text></text>
                        <text class="text-gray">库存数量:<text class="text-black ">{{ $formatQty(item.anfme) }}</text></text>
                    </view>    
                    <view class="content">
                        <text class="text-gray">盘点数量:<text class="text-black ">{{item.checkQty}}</text></text>
common/format.js
New file
@@ -0,0 +1,23 @@
/**
 * 前端数量显示:统一保留2位小数(仅展示,后端不变)
 * @param {*} value 数量
 * @returns {string} 格式化为两位小数的字符串
 */
export function formatQty(value) {
  if (value == null || value === '') return '0.00'
  const n = Number(value)
  if (Number.isNaN(n)) return '0.00'
  if (n < 0) return '0.00'
  return n.toFixed(2)
}
/**
 * 输入框失焦时用:将数量转为保留2位小数的数字(用于 v-model 绑定)
 */
export function formatQtyToNumber(value) {
  if (value == null || value === '') return 0
  const n = Number(value)
  if (Number.isNaN(n)) return 0
  if (n < 0) return 0
  return parseFloat(n.toFixed(2))
}
main.js
@@ -15,6 +15,11 @@
Vue.config.productionTip = false
import '@/common/bluetooth.js';
import { formatQty, formatQtyToNumber } from '@/common/format.js';
// 前端数量统一2位小数展示(仅展示,后端不变)
Vue.prototype.$formatQty = formatQty;
Vue.prototype.$formatQtyToNumber = formatQtyToNumber;
Vue.filter('qty', formatQty);
//全局数据状态管理 vuex
import store from '@/store/index.js';
Vue.prototype.$store = store;
@@ -63,10 +68,13 @@
// #ifdef VUE3
import { createSSRApp } from 'vue'
import { createI18n } from 'vue-i18n'
import { formatQty, formatQtyToNumber } from '@/common/format.js'
const i18n = createI18n(i18nConfig)
export function createApp() {
  const app = createSSRApp(App)
  app.use(i18n)
  app.config.globalProperties.$formatQty = formatQty
  app.config.globalProperties.$formatQtyToNumber = formatQtyToNumber
  return {
    app
  }
pages/AGV/AGVStaBind.vue
@@ -2,8 +2,8 @@
    <view class="has-foot">
        <form>
            <view class="cu-form-group margin-top">
                <view class="title">容器编号</view>
                <input placeholder="请扫容器编号" v-model="container"></input>
                <view class="title">料箱码</view>
                <input placeholder="请扫描料箱码" v-model="container"></input>
                <text class='cuIcon-search text-blue' @click="search"></text>
            </view>
@@ -171,7 +171,7 @@
            async confirm() {
                if(this.container === '' || this.container ===null){
                    uni.showToast({
                        title: "容器码不能为空",
                        title: "料箱码不能为空",
                        icon: "none",
                    })
                    return ;
pages/AGV/BindAndInTask.vue
@@ -7,8 +7,8 @@
                <text class='cuIcon-search text-blue' @click="search"></text>
            </view>
            <view class="cu-form-group ">
                <view class="title">容器码</view>
                <input placeholder="请扫描容器码" v-model="container" ></input>
                <view class="title">料箱码</view>
                <input placeholder="请扫描料箱码" v-model="container" ></input>
                <text class='cuIcon-search text-blue' @click="getList"></text>
            </view>
            <view class="cu-form-group">
@@ -205,7 +205,7 @@
                }
                if(this.container === '' || this.container ===null){
                    uni.showToast({
                        title: "容器码不能为空",
                        title: "料箱码不能为空",
                        icon: "none",
                    })
                    return ;
pages/AGV/StaUnBind.vue
@@ -8,7 +8,7 @@
            </view>            
        </form>
        <view class="flex solid-bottom padding-sm justify-between">
            <view class="text-blue">容器码:{{container}}</view>
            <view class="text-blue">料箱码:{{container}}</view>
            
        </view>
pages/AGV/StartInTask.vue
@@ -15,7 +15,7 @@
            </view>
        </form>
        <view class="flex solid-bottom padding-sm justify-between">
            <view class="text-blue">容器码:{{container}}</view>
            <view class="text-blue">料箱码:{{container}}</view>
            
        </view>
pages/check/TempCheck.vue
@@ -2,8 +2,8 @@
    <view class="has-foot">
        <form>            
            <view class="cu-form-group" v-show="!isconfirm">
                <view class="title">容器号</view>
                <input placeholder="请扫描容器号" v-model="barcode" focus></input>
                <view class="title">料箱码</view>
                <input placeholder="请扫描料箱码" v-model="barcode" focus></input>
                <text class='cuIcon-close text-gray margin-right-xs' v-show="barcode!==''" @click="clearCode"></text>
                <text class='cuIcon-search text-blue' @click="search"></text>
            </view>
@@ -53,7 +53,7 @@
                    </view>
                    <view class="cu-item" v-if="check.checkType === 0">
                        <view class="content">
                            <text class="text-gray">料箱库存数:<text class="text-black ">{{item.anfme}}</text></text>
                            <text class="text-gray">料箱库存数:<text class="text-black ">{{ $formatQty(item.anfme) }}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
@@ -62,7 +62,7 @@
                                <view class="title text-blue"><text class="text-red text-xl vertical-middle"></text>实盘数:
                                </view>
                                <uni-number-box style="width: 70%;" :max="max" v-model="item.checkQty"
                                    :step='0.000001'></uni-number-box>
                                    :step="1" :decimal="2"></uni-number-box>
                            </view>
                        </view>
                    </view>
@@ -112,7 +112,7 @@
                    </view>
                    <view class="cu-item" v-if="check.checkType === 0">
                        <view class="content">
                            <text class="text-gray">库存数:<text class="text-black ">{{item.anfme}}</text></text>
                            <text class="text-gray">库存数:<text class="text-black ">{{ $formatQty(item.anfme) }}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
@@ -137,7 +137,7 @@
                                <view class="title text-blue"><text class="text-red text-xl vertical-middle"></text>实盘数:
                                </view>
                                <uni-number-box style="width: 70%;" :max="max" v-model="item.checkQty"
                                    :step='0.000001'></uni-number-box>
                                    :step="1" :decimal="2"></uni-number-box>
                            </view>
                        </view>
                    </view>
@@ -338,7 +338,7 @@
                let that = this
                if (that.barcode === '' || that.barcode === null) {
                    uni.showToast({
                        title: "容器号为空",
                        title: "料箱码为空",
                        icon: "error",
                    })
                    return;
pages/check/checkOrderItem.vue
@@ -6,8 +6,8 @@
                <!-- <text class='cuIcon-add text-blue' @click="returnPage"></text> -->
            </view>
            <view class="cu-form-group" v-show="!isconfirm">
                <view class="title">容器号</view>
                <input placeholder="请扫描容器号" v-model="barcode" focus></input>
                <view class="title">料箱码</view>
                <input placeholder="请扫描料箱码" v-model="barcode" focus></input>
                <text class='cuIcon-close text-gray margin-right-xs' v-show="barcode!==''" @click="clearCode"></text>
                <text class='cuIcon-search text-blue' @click="search"></text>
            </view>
@@ -50,7 +50,7 @@
                    </view>
                    <view class="cu-item" v-if="check.checkType === 0">
                        <view class="content">
                            <text class="text-gray">料箱库存数:<text class="text-black ">{{item.anfme}}</text></text>
                            <text class="text-gray">料箱库存数:<text class="text-black ">{{ $formatQty(item.anfme) }}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
@@ -59,7 +59,7 @@
                                <view class="title text-blue"><text class="text-red text-xl vertical-middle"></text>实盘数:
                                </view>
                                <uni-number-box style="width: 70%;" :max="max" v-model="item.checkQty"
                                    :step='0.000001'></uni-number-box>
                                    :step="1" :decimal="2"></uni-number-box>
                            </view>
                        </view>
                    </view>
@@ -109,7 +109,7 @@
                    </view>
                    <view class="cu-item" v-if="check.checkType === 0">
                        <view class="content">
                            <text class="text-gray">库存数:<text class="text-black ">{{item.anfme}}</text></text>
                            <text class="text-gray">库存数:<text class="text-black ">{{ $formatQty(item.anfme) }}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
@@ -126,7 +126,7 @@
                                <view class="title text-blue"><text class="text-red text-xl vertical-middle"></text>实盘数:
                                </view>
                                <uni-number-box style="width: 70%;" :max="max" v-model="item.checkQty"
                                    :step='0.000001'></uni-number-box>
                                    :step="1" :decimal="2"></uni-number-box>
                            </view>
                        </view>
                    </view>
@@ -313,7 +313,7 @@
                let that = this
                if (that.barcode === '' || that.barcode === null) {
                    uni.showToast({
                        title: "容器号为空",
                        title: "料箱码为空",
                        icon: "error",
                    })
                    return;
pages/check/firstCheck.vue
@@ -2,8 +2,8 @@
    <view class="has-foot">
        <form>            
            <view class="cu-form-group" v-show="!isconfirm">
                <view class="title">容器号</view>
                <input placeholder="请扫描容器号" v-model="barcode" focus></input>
                <view class="title">料箱码</view>
                <input placeholder="请扫描料箱码" v-model="barcode" focus></input>
                <text class='cuIcon-close text-gray margin-right-xs' v-show="barcode!==''" @click="clearCode"></text>
                <text class='cuIcon-search text-blue' @click="search"></text>
            </view>
@@ -46,7 +46,7 @@
                    </view>
                    <view class="cu-item" v-if="check.checkType === 0">
                        <view class="content">
                            <text class="text-gray">料箱库存数:<text class="text-black ">{{item.anfme}}</text></text>
                            <text class="text-gray">料箱库存数:<text class="text-black ">{{ $formatQty(item.anfme) }}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
@@ -55,7 +55,7 @@
                                <view class="title text-blue"><text class="text-red text-xl vertical-middle"></text>实盘数:
                                </view>
                                <uni-number-box style="width: 70%;" :max="max" v-model="item.checkQty"
                                    :step='0.000001'></uni-number-box>
                                    :step="1" :decimal="2"></uni-number-box>
                            </view>
                        </view>
                    </view>
@@ -105,7 +105,7 @@
                    </view>
                    <view class="cu-item" v-if="check.checkType === 0">
                        <view class="content">
                            <text class="text-gray">库存数:<text class="text-black ">{{item.anfme}}</text></text>
                            <text class="text-gray">库存数:<text class="text-black ">{{ $formatQty(item.anfme) }}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
@@ -122,7 +122,7 @@
                                <view class="title text-blue"><text class="text-red text-xl vertical-middle"></text>实盘数:
                                </view>
                                <uni-number-box style="width: 70%;" :max="max" v-model="item.checkQty"
                                    :step='0.000001'></uni-number-box>
                                    :step="1" :decimal="2"></uni-number-box>
                            </view>
                        </view>
                    </view>
@@ -312,7 +312,7 @@
                let that = this
                if (that.barcode === '' || that.barcode === null) {
                    uni.showToast({
                        title: "容器号为空",
                        title: "料箱码为空",
                        icon: "error",
                    })
                    return;
pages/inspect/bad.vue
@@ -78,8 +78,8 @@
                    <view class="content">
                        <view class="cu-form-group padding-lr-0">
                            <view class="title text-blue">数量:</view>
                            <input class="text-right" type="number" placeholder="请输入数量" v-model="item.receiptQty"
                                focus></input>
                            <input class="text-right" type="number" step="1" placeholder="请输入数量" v-model="item.receiptQty"
                                @blur="item.receiptQty = $formatQtyToNumber(item.receiptQty)" focus></input>
                        </view>
                    </view>
                </view>
pages/inspect/check.vue
@@ -1,259 +1,261 @@
<template>
    <view class="has-foot">
        <form>
            <view class="cu-form-group margin-top">
                <view class="title">质检单</view>
                <input placeholder="请扫描质检单" v-model="isptCode" focus></input>
                <text class='cuIcon-search text-blue' @click="search"></text>
            </view>
            <view class="cu-form-group ">
                <view class="title">物料码</view>
                <input placeholder="请扫描物料码" v-model="barcode"></input>
                <text class='cuIcon-search text-blue' @click="scrollTo"></text>
            </view>
        </form>
        <view class="padding-lr margin-top-sm">
            <block v-for="(item, index) in list" :key="index">
                <view class="cu-list det menu sm-border margin-bottom-sm " :class="[item.matnrCode===barcode&&'act']"
                    :ref="item.matnrCode+'ref'">
                    <view class="cu-bar bg-white solid-bottom ">
                        <view class="action">
                            <view class="index">
                                {{index+1}}
                            </view>
                            <view class="text-blue">
                                {{`${item.maktx}`}}
                            </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">ASN:</text>
                        </view>
                        <view class="action">
                            <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.splrName}}</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 class="text-grey ">{{item.rcptQty}}</text></text>
                        </view>
                        <view class="content">
                            <text class="text-black">送货数量: <text class="text-grey ">{{item.dlyQty}}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <view class="cu-form-group padding-lr-0">
                                <view class="title text-blue">合格数量:</view>
                                <input type="number" placeholder="请输入合格数量" v-model="item.safeQty"></input>
                            </view>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <view class="cu-form-group padding-lr-0">
                                <view class="title text-blue">不合格数量:</view>
                                <input type="number" placeholder="请输入不合格数量" v-model="item.disQty"></input>
                            </view>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <view class="cu-form-group padding-lr-0">
                                <view class="title text-blue">质检结论:</view>
                                <uni-data-select placement='top' v-model="item.isptResult" :localdata="range"
                                    placeholder="请输入质检结论"></uni-data-select>
                            </view>
                        </view>
                    </view>
                    <view class="cu-form-group align-start">
                        <view class="title text-blue">备注</view>
                        <textarea v-model="item.memo" placeholder="请输入备注"></textarea>
                    </view>
                    <!--     <view class="cu-form-group">
                    <uni-file-picker limit="9" title="照片"></uni-file-picker>
                </view> -->
                </view>
            </block>
        </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>
        </view>
    </view>
</template>
<script>
    import {
        request
    } from '../../common/request.js'
    import {
        mapState,
        mapMutations,
        mapActions,
        mapGetters
    } from 'vuex';
    export default {
        data() {
            return {
                barcode: '',
                isptCode: '',
                list: [],
                range: [{
                    value: '1',
                    text: '合格'
                }, {
                    value: '2',
                    text: '不合格'
                }, {
                    value: '3',
                    text: '待定'
                }, {
                    value: '4',
                    text: '部分合格'
                }],
            }
        },
        computed: {
            ...mapState('user', ['dynamicFields']),
        },
        mounted() {},
        methods: {
            async search() {
                const {
                    code,
                    data,
                    msg
                } = await request('/inspect/query', {
                    isptCode: this.isptCode,
                })
                if (code === 200) {
                    this.list = data
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                        position: 'top'
                    })
                }
            },
            remove(index) {
                this.list.splice(index, 1);
            },
            clear() {
                this.list = []
                this.barcode = ''
            },
            scrollTo() {
                const ref = this.$refs[`${this.barcode}ref`][0];
                uni.pageScrollTo({
                    scrollTop: ref.$el.offsetTop,
                    duration: 300
                })
            },
            async confirm() {
                const {
                    code,
                    data,
                    msg
                } = await request('/inspect/check/update', this.list)
                if (code === 200) {
                    uni.showToast({
                        title: '质检成功'
                    })
                    this.list = []
                    this.barcode = ''
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                    })
                }
            },
        }
    }
</script>
<style>
    .index {
        border: 1px solid #e54d42;
        color: #e54d42;
        border-radius: 50%;
        display: block;
        width: 50rpx;
        height: 50rpx;
        line-height: 48rpx;
        text-align: center;
        margin-right: 20rpx;
        font-size: 30rpx;
    }
    .text-blue {
        color: #0081ff !important;
    }
    .act {
        border: 1px solid #e54d42;
    }
    .item {
        position: relative;
        display: flex;
        min-height: 80upx;
        align-items: center;
    }
    .uni-file-picker {
        width: 100%;
        margin-bottom: 10px;
    }
    .uni-select__selector {
        z-index: 999;
    }
<template>
    <view class="has-foot">
        <form>
            <view class="cu-form-group margin-top">
                <view class="title">质检单</view>
                <input placeholder="请扫描质检单" v-model="isptCode" focus></input>
                <text class='cuIcon-search text-blue' @click="search"></text>
            </view>
            <view class="cu-form-group ">
                <view class="title">物料码</view>
                <input placeholder="请扫描物料码" v-model="barcode"></input>
                <text class='cuIcon-search text-blue' @click="scrollTo"></text>
            </view>
        </form>
        <view class="padding-lr margin-top-sm">
            <block v-for="(item, index) in list" :key="index">
                <view class="cu-list det menu sm-border margin-bottom-sm " :class="[item.matnrCode===barcode&&'act']"
                    :ref="item.matnrCode+'ref'">
                    <view class="cu-bar bg-white solid-bottom ">
                        <view class="action">
                            <view class="index">
                                {{index+1}}
                            </view>
                            <view class="text-blue">
                                {{`${item.maktx}`}}
                            </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">ASN:</text>
                        </view>
                        <view class="action">
                            <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.splrName}}</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 class="text-grey ">{{item.rcptQty}}</text></text>
                        </view>
                        <view class="content">
                            <text class="text-black">送货数量: <text class="text-grey ">{{item.dlyQty}}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <view class="cu-form-group padding-lr-0">
                                <view class="title text-blue">合格数量:</view>
                                <input type="number" step="1" placeholder="请输入合格数量" v-model="item.safeQty"
                                    @blur="item.safeQty = $formatQtyToNumber(item.safeQty)"></input>
                            </view>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <view class="cu-form-group padding-lr-0">
                                <view class="title text-blue">不合格数量:</view>
                                <input type="number" step="1" placeholder="请输入不合格数量" v-model="item.disQty"
                                    @blur="item.disQty = $formatQtyToNumber(item.disQty)"></input>
                            </view>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <view class="cu-form-group padding-lr-0">
                                <view class="title text-blue">质检结论:</view>
                                <uni-data-select placement='top' v-model="item.isptResult" :localdata="range"
                                    placeholder="请输入质检结论"></uni-data-select>
                            </view>
                        </view>
                    </view>
                    <view class="cu-form-group align-start">
                        <view class="title text-blue">备注</view>
                        <textarea v-model="item.memo" placeholder="请输入备注"></textarea>
                    </view>
                    <!--     <view class="cu-form-group">
                    <uni-file-picker limit="9" title="照片"></uni-file-picker>
                </view> -->
                </view>
            </block>
        </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>
        </view>
    </view>
</template>
<script>
    import {
        request
    } from '../../common/request.js'
    import {
        mapState,
        mapMutations,
        mapActions,
        mapGetters
    } from 'vuex';
    export default {
        data() {
            return {
                barcode: '',
                isptCode: '',
                list: [],
                range: [{
                    value: '1',
                    text: '合格'
                }, {
                    value: '2',
                    text: '不合格'
                }, {
                    value: '3',
                    text: '待定'
                }, {
                    value: '4',
                    text: '部分合格'
                }],
            }
        },
        computed: {
            ...mapState('user', ['dynamicFields']),
        },
        mounted() {},
        methods: {
            async search() {
                const {
                    code,
                    data,
                    msg
                } = await request('/inspect/query', {
                    isptCode: this.isptCode,
                })
                if (code === 200) {
                    this.list = data
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                        position: 'top'
                    })
                }
            },
            remove(index) {
                this.list.splice(index, 1);
            },
            clear() {
                this.list = []
                this.barcode = ''
            },
            scrollTo() {
                const ref = this.$refs[`${this.barcode}ref`][0];
                uni.pageScrollTo({
                    scrollTop: ref.$el.offsetTop,
                    duration: 300
                })
            },
            async confirm() {
                const {
                    code,
                    data,
                    msg
                } = await request('/inspect/check/update', this.list)
                if (code === 200) {
                    uni.showToast({
                        title: '质检成功'
                    })
                    this.list = []
                    this.barcode = ''
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                    })
                }
            },
        }
    }
</script>
<style>
    .index {
        border: 1px solid #e54d42;
        color: #e54d42;
        border-radius: 50%;
        display: block;
        width: 50rpx;
        height: 50rpx;
        line-height: 48rpx;
        text-align: center;
        margin-right: 20rpx;
        font-size: 30rpx;
    }
    .text-blue {
        color: #0081ff !important;
    }
    .act {
        border: 1px solid #e54d42;
    }
    .item {
        position: relative;
        display: flex;
        min-height: 80upx;
        align-items: center;
    }
    .uni-file-picker {
        width: 100%;
        margin-bottom: 10px;
    }
    .uni-select__selector {
        z-index: 999;
    }
</style>
pages/inspect/report.vue
@@ -33,7 +33,7 @@
                        <text class="text-black">采购单位: <text class="text-grey ">{{item.purUnit}}</text></text>
                    </view>
                    <view class="content">
                        <text class="text-black">采购数量: <text class="text-grey ">{{item.purQty}}</text></text>
                        <text class="text-black">采购数量: <text class="text-grey ">{{ $formatQty(item.purQty) }}</text></text>
                    </view>
                </view>
pages/listing/disc.vue
@@ -1,153 +1,153 @@
<template>
    <view class="has-foot">
        <form>
            <view class="cu-form-group margin-top">
                <view class="title">容器号</view>
                <input placeholder="请扫描容器号" v-model="container" focus></input>
                <text class='cuIcon-search text-blue' @click="getList"></text>
            </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>
        </form>
        <view class="flex solid-bottom padding-sm justify-between">
            <view class="text-blue">物料总类:{{list.length}}</view>
            <view class="text-blue">组盘总数:{{allCount}}</view>
        </view>
        <view class="padding-lr margin-top-sm">
            <block v-for="(item, index) in list" :key="index">
                <view class="cu-list det menu sm-border margin-bottom-sm "
                    :ref="item.trackCode+'ref'">
                    <view class="cu-bar bg-white solid-bottom ">
                        <view class="action">
                            <view class="index">
                                {{index+1}}
                            </view>
                            <view class="text-blue">
                                {{`${item.maktx}`}}
                            </view>
                        </view>
                        <view class="action" v-if="!isconfirm">
                            <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">ASN:</text>
                        </view>
                        <view class="action">
                            <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.trackCode}}</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>
                        </view>
                        <view class="action">
                            <text class="text-grey ">{{item.batch}}</text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <text class="text-black">平台行号: <text class="text-grey ">{{item.platformId}}</text></text>
                        </view>
                        <view class="content">
                            <text class="text-black">质检结果: <text class="text-grey ">{{item.inspect}}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <text class="text-black">库存单位: <text class="text-grey ">{{item.stockUnit}}</text></text>
                        </view>
                        <view class="content">
                            <text class="text-black">收货数量: <text class="text-grey ">{{item.anfme}}</text></text>
                        </view>
                        <view class="content">
                            <text class="text-black">已上架数量: <text
                                    class="text-grey ">{{item.workQty + item.qty}}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <text class="text-black">可组盘数量: <text
                                    class="text-grey ">{{item.anfme - item.workQty}}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <view class="cu-form-group padding-lr-0">
                                <view class="title text-blue"><text
                                        class="text-red text-xl vertical-middle">*</text>组盘数量:
                                </view>
                                <uni-number-box style="width: 70%;" :max="max" v-model="item.receiptQty"
                                    :step='0.000001'></uni-number-box>
                            </view>
                        </view>
                    </view>
                </view>
            </block>
        </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" :disabled="repeatClick" @click="confirm">组盘</button>
        </view>
    </view>
</template>
<script>
    import {
        request
    } from '../../common/request.js'
    import {
        mapState,
        mapMutations,
        mapActions,
        mapGetters
    } from 'vuex';
    export default {
        data() {
            return {
                barcode: '',
                container: '',
                megreQty: '',
                list: [],
                range: [],
                repeatClick: false,
                isconfirm: false,
                max: 99999999,
            }
        },
        computed: {
            ...mapState('user', ['dynamicFields']),
            allCount() {
                return this.list.reduce((acc, row) => +row.anfme + acc, 0) || 0
            }
        },
        mounted() {},
        methods: {
            async search() {
<template>
    <view class="has-foot">
        <form>
            <view class="cu-form-group margin-top">
                <view class="title">料箱码</view>
                <input placeholder="请扫描料箱码" v-model="container" focus></input>
                <text class='cuIcon-search text-blue' @click="getList"></text>
            </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>
        </form>
        <view class="flex solid-bottom padding-sm justify-between">
            <view class="text-blue">物料总类:{{list.length}}</view>
            <view class="text-blue">组盘总数:{{allCount}}</view>
        </view>
        <view class="padding-lr margin-top-sm">
            <block v-for="(item, index) in list" :key="index">
                <view class="cu-list det menu sm-border margin-bottom-sm "
                    :ref="item.trackCode+'ref'">
                    <view class="cu-bar bg-white solid-bottom ">
                        <view class="action">
                            <view class="index">
                                {{index+1}}
                            </view>
                            <view class="text-blue">
                                {{`${item.maktx}`}}
                            </view>
                        </view>
                        <view class="action" v-if="!isconfirm">
                            <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">ASN:</text>
                        </view>
                        <view class="action">
                            <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.trackCode}}</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>
                        </view>
                        <view class="action">
                            <text class="text-grey ">{{item.batch}}</text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <text class="text-black">平台行号: <text class="text-grey ">{{item.platformId}}</text></text>
                        </view>
                        <view class="content">
                            <text class="text-black">质检结果: <text class="text-grey ">{{item.inspect}}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <text class="text-black">库存单位: <text class="text-grey ">{{item.stockUnit}}</text></text>
                        </view>
                        <view class="content">
                            <text class="text-black">收货数量: <text class="text-grey ">{{item.anfme}}</text></text>
                        </view>
                        <view class="content">
                            <text class="text-black">已上架数量: <text
                                    class="text-grey ">{{item.workQty + item.qty}}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <text class="text-black">可组盘数量: <text
                                    class="text-grey ">{{item.anfme - item.workQty}}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <view class="cu-form-group padding-lr-0">
                                <view class="title text-blue"><text
                                        class="text-red text-xl vertical-middle">*</text>组盘数量:
                                </view>
                                <uni-number-box style="width: 70%;" :max="max" v-model="item.receiptQty"
                                    :step="1" :decimal="2"></uni-number-box>
                            </view>
                        </view>
                    </view>
                </view>
            </block>
        </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" :disabled="repeatClick" @click="confirm">组盘</button>
        </view>
    </view>
</template>
<script>
    import {
        request
    } from '../../common/request.js'
    import {
        mapState,
        mapMutations,
        mapActions,
        mapGetters
    } from 'vuex';
    export default {
        data() {
            return {
                barcode: '',
                container: '',
                megreQty: '',
                list: [],
                range: [],
                repeatClick: false,
                isconfirm: false,
                max: 99999999,
            }
        },
        computed: {
            ...mapState('user', ['dynamicFields']),
            allCount() {
                return this.list.reduce((acc, row) => +row.anfme + acc, 0) || 0
            }
        },
        mounted() {},
        methods: {
            async search() {
                if (this.barcode == undefined || this.barcode == '') {
                    uni.showToast({
                        icon: "none",
@@ -155,147 +155,147 @@
                    })
                    return
                }
                this.getDet();
            },
            async getDet() {
                const {
                    code,
                    data,
                    msg
                } = await request('/asnOrderItem/trackCode', {
                    code: this.barcode,
                }, "post")
                if (code === 200) {
                    for (var i = 0; i < data.length; i++) {
                        data[i].receiptQty =1;
                        data[i].selected = false;
                    }
                    this.list = data
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                        position: 'top'
                    })
                }
            },
                this.getDet();
            },
            async getDet() {
                const {
                    code,
                    data,
                    msg
                } = await request('/asnOrderItem/trackCode', {
                    code: this.barcode,
                }, "post")
                if (code === 200) {
                    for (var i = 0; i < data.length; i++) {
                        data[i].receiptQty =1;
                        data[i].selected = false;
                    }
                    this.list = data
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                        position: 'top'
                    })
                }
            },
            async getList() {
                if (this.container == undefined || this.container == '') {
                    uni.showToast({
                        icon: "none",
                        title: '容器号不能为空!!'
                        title: '料箱码不能为空!!'
                    })
                    return
                }
                const {
                    code,
                    data,
                    msg
                } = await request('/asnOrderItem/container', {
                    barcode: this.container
                })
                if (code === 200) {
                    this.list = data
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                        position: 'top'
                    })
                }
            },
            scrollTo() {
                const ref = this.$refs[`${this.barcode}ref`][0];
                uni.pageScrollTo({
                    scrollTop: ref.$el.offsetTop,
                    duration: 300
                })
            },
            remove(index) {
                this.list.splice(index, 1);
            },
            clear() {
                this.list = []
                this.barcode = ''
            },
            next() {
                if (this.list.length) {
                    this.isconfirm = true
                } else {
                    uni.showToast({
                        icon: "none",
                        title: '未选物料标签'
                    })
                }
            },
            prev() {
                this.isconfirm = false
            },
            async confirm() {
                this.repeatClick = true
                const newArr = this.list.map(item => {
                    return {
                        ...item,
                        anfme: item.anfme === null ? 0 : +item.anfme,
                    };
                });
                const {
                    code,
                    data,
                    msg
                } = await request('/waitPakin/merge', {
                    items: newArr,
                    barcode: this.container,
                })
                if (code === 200) {
                    uni.showToast({
                        title: '组盘成功'
                    })
                    this.list = []
                    this.barcode = ''
                    this.container = ''
                    this.isconfirm = false
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                        position: 'top'
                    })
                }
                this.repeatClick = false
            },
        }
    }
</script>
<style>
    .index {
        border: 1px solid #e54d42;
        color: #e54d42;
        border-radius: 50%;
        display: block;
        width: 50rpx;
        height: 50rpx;
        line-height: 48rpx;
        text-align: center;
        margin-right: 20rpx;
        font-size: 30rpx;
    }
    .text-blue {
        color: #0081ff !important;
    }
    .act {
        border: 1px solid #e54d42;
    }
    .item {
        position: relative;
        display: flex;
        min-height: 80upx;
        align-items: center;
    }
                }
                const {
                    code,
                    data,
                    msg
                } = await request('/asnOrderItem/container', {
                    barcode: this.container
                })
                if (code === 200) {
                    this.list = data
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                        position: 'top'
                    })
                }
            },
            scrollTo() {
                const ref = this.$refs[`${this.barcode}ref`][0];
                uni.pageScrollTo({
                    scrollTop: ref.$el.offsetTop,
                    duration: 300
                })
            },
            remove(index) {
                this.list.splice(index, 1);
            },
            clear() {
                this.list = []
                this.barcode = ''
            },
            next() {
                if (this.list.length) {
                    this.isconfirm = true
                } else {
                    uni.showToast({
                        icon: "none",
                        title: '未选物料标签'
                    })
                }
            },
            prev() {
                this.isconfirm = false
            },
            async confirm() {
                this.repeatClick = true
                const newArr = this.list.map(item => {
                    return {
                        ...item,
                        anfme: item.anfme === null ? 0 : +item.anfme,
                    };
                });
                const {
                    code,
                    data,
                    msg
                } = await request('/waitPakin/merge', {
                    items: newArr,
                    barcode: this.container,
                })
                if (code === 200) {
                    uni.showToast({
                        title: '组盘成功'
                    })
                    this.list = []
                    this.barcode = ''
                    this.container = ''
                    this.isconfirm = false
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                        position: 'top'
                    })
                }
                this.repeatClick = false
            },
        }
    }
</script>
<style>
    .index {
        border: 1px solid #e54d42;
        color: #e54d42;
        border-radius: 50%;
        display: block;
        width: 50rpx;
        height: 50rpx;
        line-height: 48rpx;
        text-align: center;
        margin-right: 20rpx;
        font-size: 30rpx;
    }
    .text-blue {
        color: #0081ff !important;
    }
    .act {
        border: 1px solid #e54d42;
    }
    .item {
        position: relative;
        display: flex;
        min-height: 80upx;
        align-items: center;
    }
</style>
pages/listing/itemSelect.vue
@@ -39,6 +39,7 @@
                                <text class="text-grey ">{{item.splrBatch}}</text>
                            </view>
                        </view>
                        <!-- 现品票号已注释
                        <view class="cu-item">
                            <view class="content">
                                <text class="text-black">现品票号:</text>
@@ -47,6 +48,7 @@
                                <text class="text-grey ">{{item.extendFields.crushNo}}</text>
                            </view>
                        </view>
                        -->
                        <view class="cu-item">
                            <view class="content">
                                <text class="text-black">质检状态:</text>
pages/listing/labour.vue
@@ -1,204 +1,204 @@
<template>
    <view class="has-foot">
        <form>
            <view class="cu-form-group ">
                <view class="title">容器码</view>
                <input placeholder="请扫描容器码" v-model="container"></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">
            <block v-for="(item, index) in list" :key="index">
                <view class="cu-bar bg-white solid-bottom margin-top-sm">
                    <view class="action">
                        <view class="index">
                            {{index+1}}
                        </view>
                        <view class="text-blue">
                            编码:{{`${item.matnrCode}`}}
                        </view>
                    </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>
                    </view>
                    <view class="action">
                        <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.batch}}</text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-black">数量:</text>
                    </view>
                    <view class="action">
                        <text class="text-grey ">{{item.anfme}}</text>
                    </view>
                </view>
            </block>
        </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>
        </view>
    </view>
</template>
<script>
    import {
        request
    } from '../../common/request.js'
    import {
        mapState,
        mapMutations,
        mapActions,
        mapGetters
    } from 'vuex';
    export default {
        data() {
            return {
                barcode: '',
                asnCode: '',
                locCode: '',
                container: '',
                list: [],
            }
        },
        computed: {
            ...mapState('user', ['dynamicFields']),
        },
        mounted() {},
        methods: {
            async search() {
                const {
                    code,
                    data,
                    msg
                } = await request('/stock/operate/list', {
                    barcode: this.container,
                })
                if (code === 200) {
                    // const find = this.list.find(el => el.id === data.id);
                    // !find &&
                     this.list = data
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                    })
                }
            },
            remove(index) {
                this.list.splice(index, 1);
            },
            clear() {
                this.list = []
                this.matnrCode = ''
                this.locCode = ''
            },
            async confirm() {
                if (this.locCode === '' || this.locCode === null) {
                    uni.showToast({
                        title: '请输入库位',
                        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: msg,
                        icon: "none",
                    })
                }
            },
        }
    }
</script>
<style>
    .index {
        border: 1px solid #e54d42;
        color: #e54d42;
        border-radius: 50%;
        display: block;
        width: 50rpx;
        height: 50rpx;
        line-height: 48rpx;
        text-align: center;
        margin-right: 20rpx;
        font-size: 30rpx;
    }
    .text-blue {
        color: #0081ff !important;
    }
    .item {
        position: relative;
        display: flex;
        min-height: 80upx;
        align-items: center;
    }
    .uni-file-picker {
        width: 100%;
        margin-bottom: 10px;
    }
    .uni-select__selector {
        z-index: 999;
    }
<template>
    <view class="has-foot">
        <form>
            <view class="cu-form-group ">
                <view class="title">料箱码</view>
                <input placeholder="请扫描料箱码" v-model="container"></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">
            <block v-for="(item, index) in list" :key="index">
                <view class="cu-bar bg-white solid-bottom margin-top-sm">
                    <view class="action">
                        <view class="index">
                            {{index+1}}
                        </view>
                        <view class="text-blue">
                            编码:{{`${item.matnrCode}`}}
                        </view>
                    </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>
                    </view>
                    <view class="action">
                        <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.batch}}</text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-black">数量:</text>
                    </view>
                    <view class="action">
                        <text class="text-grey ">{{ $formatQty(item.anfme) }}</text>
                    </view>
                </view>
            </block>
        </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>
        </view>
    </view>
</template>
<script>
    import {
        request
    } from '../../common/request.js'
    import {
        mapState,
        mapMutations,
        mapActions,
        mapGetters
    } from 'vuex';
    export default {
        data() {
            return {
                barcode: '',
                asnCode: '',
                locCode: '',
                container: '',
                list: [],
            }
        },
        computed: {
            ...mapState('user', ['dynamicFields']),
        },
        mounted() {},
        methods: {
            async search() {
                const {
                    code,
                    data,
                    msg
                } = await request('/stock/operate/list', {
                    barcode: this.container,
                })
                if (code === 200) {
                    // const find = this.list.find(el => el.id === data.id);
                    // !find &&
                     this.list = data
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                    })
                }
            },
            remove(index) {
                this.list.splice(index, 1);
            },
            clear() {
                this.list = []
                this.matnrCode = ''
                this.locCode = ''
            },
            async confirm() {
                if (this.locCode === '' || this.locCode === null) {
                    uni.showToast({
                        title: '请输入库位',
                        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: msg,
                        icon: "none",
                    })
                }
            },
        }
    }
</script>
<style>
    .index {
        border: 1px solid #e54d42;
        color: #e54d42;
        border-radius: 50%;
        display: block;
        width: 50rpx;
        height: 50rpx;
        line-height: 48rpx;
        text-align: center;
        margin-right: 20rpx;
        font-size: 30rpx;
    }
    .text-blue {
        color: #0081ff !important;
    }
    .item {
        position: relative;
        display: flex;
        min-height: 80upx;
        align-items: center;
    }
    .uni-file-picker {
        width: 100%;
        margin-bottom: 10px;
    }
    .uni-select__selector {
        z-index: 999;
    }
</style>
pages/listing/matnrPalletising.vue
@@ -3,8 +3,8 @@
        <view>
            <form>
                <view class="cu-form-group margin-top">
                    <view class="title">容器号</view>
                    <input placeholder="请扫描容器号" v-model="container" focus></input>
                    <view class="title">料箱码</view>
                    <input placeholder="请扫描料箱码" v-model="container" focus></input>
                    <text class='cuIcon-search text-blue' @click="getList"></text>
                </view>
                <view class="cu-form-group">
@@ -25,43 +25,42 @@
                </view>
            </form>
            <view class="flex solid-bottom padding-sm justify-between">
                <view class="text-blue">物料总类:{{list.length}}</view>
                <view class="text-blue">物料总类:{{listByMaterial.length}}</view>
                <!-- 半箱:等有需要时再启用
                <view class="content">
                    <uni-data-checkbox mode="button" multiple v-model="isHalf" :localdata="boxs"></uni-data-checkbox>
                </view>
                -->
                <view class="text-blue">组盘总数:{{allCount}}</view>
            </view>
        </view>
        <view class="padding-lr margin-top-sm">
            <block v-for="(item, index) in list" :key="index">
                <view class="cu-list det menu sm-border margin-bottom-sm " :class="[item.trackCode===barcode&&'act']"
                    :ref="item.trackCode+'ref'">
            <block v-for="(group, gIndex) in listByMaterial" :key="gIndex">
                <view class="cu-list det menu sm-border margin-bottom-sm "
                    :ref="(group[0] && group[0].trackCode)+'ref'">
                    <view class="cu-bar bg-white solid-bottom ">
                        <view class="action">
                            <view class="index">
                                {{index+1}}
                                {{gIndex+1}}
                            </view>
                            <view class="text-blue">
                                编码:
                                {{`${item.matnrCode}`}}
                                {{group[0] && group[0].matnrCode}}
                            </view>
                        </view>
                        <view class="action" v-if="!isconfirm">
                            <text @click="remove(index)" class="cuIcon-close text-red" style="font-size: 24px;"></text>
                            <text @click="removeGroup(group)" 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>
                            <text class="text-grey ">{{group[0] && group[0].maktx}}</text>
                        </view>
                    </view>
                    <view class="cu-item">
                    <view class="cu-item" v-for="(line, lIdx) in group" :key="'asn-'+lIdx">
                        <view class="content">
                            <text class="text-black">单号:</text>
                        </view>
                        <view class="action">
                            <text class="text-grey ">{{item.asnCode}}</text>
                            <text class="text-black">单号 :{{ line.asnCode }} ({{ $formatQty(line.availablePalletQty != null ? line.availablePalletQty : (line.anfme - line.workQty - line.qty)) }})</text>
                        </view>
                    </view>
                    <view class="cu-item">
@@ -69,40 +68,31 @@
                            <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 class="text-grey ">{{item.crushNo}}</text></text>-->
<!--                        </view>-->
<!--                    </view>-->
                    <view class="cu-item">
                        <view class="content">
                            <text class="text-black">库存单位: <text class="text-grey ">{{item.stockUnit}}</text></text>
                        </view>
                        <view class="content">
                            <text class="text-black">收货数量: <text class="text-grey ">{{item.anfme}}</text></text>
                            <text class="text-grey ">{{group[0] && group[0].splrBatch}}</text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content" v-if="item.asnCode">
                            <text class="text-black">可组盘数量:<text
                                    class="text-grey ">{{item.anfme - item.workQty - item.qty}}</text></text>
                        <view class="content">
                            <text class="text-black">库存单位: <text class="text-grey ">{{group[0] && group[0].stockUnit}}</text></text>
                        </view>
                        <view class="content">
                            <text class="text-black">已上架数量: <text
                                    class="text-grey ">{{item.workQty + item.qty}}</text></text>
                            <text class="text-black">收货数量: <text class="text-grey ">{{ $formatQty(groupSumAnfme(group)) }}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <text class="text-black">可组盘数量:<text class="text-grey ">{{ $formatQty(groupSumAvailable(group)) }}</text></text>
                        </view>
                        <view class="content">
                            <text class="text-black">已上架数量: <text class="text-grey ">{{ $formatQty(groupSumPutaway(group)) }}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <view class="cu-form-group padding-lr-0">
                                <view class="title text-blue"><text
                                        class="text-red text-xl vertical-middle">*</text>组盘数量:
                                </view>
                                <uni-number-box style="width: 70%;" :min="0" :max="max" :decimal="6" :step="1"
                                    v-model="item.receiptQty"></uni-number-box>
                                <view class="title text-blue"><text class="text-red text-xl vertical-middle">*</text>组盘数量:</view>
                                <uni-number-box style="width: 70%;" :min="0" :max="getGroupAvailableMax(group)" :decimal="2" :step="1"
                                    :value="groupSumReceiptQty(group)" @input="setGroupReceiptQty(group, $event)"></uni-number-box>
                            </view>
                        </view>
                    </view>
@@ -150,12 +140,34 @@
        },
        computed: {
            ...mapState('user', ['dynamicFields']),
            // 组盘总数:多行时数量叠加(不同WMS单号、相同物料各占一行,此处为各行列的组盘数量之和)
            allCount() {
                return this.list.reduce((acc, row) => +(row.anfme + acc).toFixed(2), 0) || 0
                return this.list.reduce((acc, row) => +(+(row.receiptQty || 0) + acc).toFixed(2), 0) || 0
            },
            // 按物料合并:相同物料(编码+批次+名称)合并为一个模块,单号在模块内多行显示
            listByMaterial() {
                const key = (item) => [item.matnrCode, item.splrBatch || '', item.maktx || ''].join('\t')
                const map = new Map()
                this.list.forEach(item => {
                    const k = key(item)
                    if (!map.has(k)) map.set(k, [])
                    map.get(k).push(item)
                })
                return Array.from(map.values())
            }
        },
        mounted() {},
        methods: {
            // 单行可组盘上限:计划 - 已组托 - 已上架,不能超过该值(与后端一致)
            getItemAvailableMax(item) {
                if (!item) return this.max;
                const avail = item.availablePalletQty != null && item.availablePalletQty !== undefined
                    ? item.availablePalletQty
                    : (Number(item.anfme || 0) - Number(item.workQty || 0) - Number(item.qty || 0));
                const num = Number(avail);
                if (isNaN(num) || num < 0) return 0;
                return Math.min(num, this.max);
            },
            onMatnrCodeInput(e) {
                // 扫码输入时自动触发查询
                if (e.detail && e.detail.value && e.detail.value.trim() !== '') {
@@ -265,11 +277,15 @@
                        return;
                    }
                    for (var i = 0; i < data.length; i++) {
                        // 计算可组盘数量 = 总数量 - 已执行数量 - 已收货数量
                        let anfme = data[i].anfme || 0;
                        let workQty = data[i].workQty || 0;
                        let qty = data[i].qty || 0;
                        data[i].receiptQty = anfme - workQty - qty;
                        // 优先使用接口返回的可组盘数量(order/add 改数量后 = 计划 - 已组托 - 已上架),否则本地计算
                        if (data[i].availablePalletQty != null && data[i].availablePalletQty !== undefined) {
                            data[i].receiptQty = data[i].availablePalletQty;
                        } else {
                            let anfme = data[i].anfme || 0;
                            let workQty = data[i].workQty || 0;
                            let qty = data[i].qty || 0;
                            data[i].receiptQty = anfme - workQty - qty;
                        }
                        // 确保可组盘数量不为负数
                        if (data[i].receiptQty < 0) {
                            data[i].receiptQty = 0;
@@ -294,7 +310,7 @@
                let that = this
                if (this.container === '' || this.container === null) {
                    uni.showToast({
                        title: "容器码为空",
                        title: "料箱码为空",
                        icon: "none",
                        position: 'top'
                    })
@@ -325,66 +341,30 @@
                }
            },
            showBackData(data) {
                // 追加新物料到列表,根据物料编码和跟踪码组合去重
                let addedCount = 0;
                let skippedCount = 0;
                data.forEach(item => {
                    // 检查是否已存在相同的物料
                    const exists = this.list.some(existingItem => {
                        // 优先检查物料编码,如果物料编码不同,认为是不同物料,允许添加
                        if (existingItem.matnrCode && item.matnrCode) {
                            // 两个都有物料编码,如果不同则允许添加
                            if (existingItem.matnrCode !== item.matnrCode) {
                                return false; // 物料编码不同,不存在,允许添加
                            }
                            // 物料编码相同,继续检查其他字段
                        } else if (existingItem.matnrCode || item.matnrCode) {
                            // 一个有一个没有物料编码,认为是不同物料,允许添加
                            return false;
                        }
                        // 两个都没有物料编码,继续检查其他字段
                        // 如果两个都有id且相同,认为是同一物料
                        if (existingItem.id && item.id && existingItem.id === item.id) {
                            return true;
                        }
                        // 物料编码相同(或都为空),检查跟踪码(如果有跟踪码,跟踪码不同则允许添加)
                        if (existingItem.trackCode && item.trackCode) {
                            // 都有跟踪码,跟踪码相同则认为是同一物料
                            return existingItem.trackCode === item.trackCode;
                        }
                        // 物料编码相同,检查WMS单号(如果有单号,单号不同则允许添加)
                        if (existingItem.asnCode && item.asnCode) {
                            // 都有WMS单号,单号相同则认为是同一物料
                            return existingItem.asnCode === item.asnCode;
                        }
                        // 物料编码相同,但都没有跟踪码和WMS单号(都是从物料信息表获取的),认为是同一物料
                        if (existingItem.matnrCode === item.matnrCode &&
                            !existingItem.trackCode && !item.trackCode &&
                            !existingItem.asnCode && !item.asnCode) {
                            return true;
                        }
                        // 物料编码相同,但一个没有跟踪码/ASN,另一个有,认为是不同物料,允许添加
                        // 或者两个都没有物料编码且没有其他唯一标识,也允许添加(可能是不同物料)
                // 同一组托框内允许不同WMS单号、相同物料多行共存,数量叠加组托;单号按行显示;提交时仍按每条明细发送,后端参数不变
                // 判定为同一行(需替换):同一单号+同一明细(id 或 物料+跟踪码 一致)
                const isSameItem = (existingItem, item) => {
                    if (existingItem.matnrCode && item.matnrCode) {
                        if (existingItem.matnrCode !== item.matnrCode) return false;
                    } else if (existingItem.matnrCode || item.matnrCode) {
                        return false;
                    });
                    if (!exists) {
                        this.list.push(item);
                        addedCount++;
                    } else {
                        skippedCount++;
                    }
                    if (existingItem.id && item.id && existingItem.id === item.id) return true;
                    if (existingItem.trackCode && item.trackCode) return existingItem.trackCode === item.trackCode;
                    if (existingItem.asnCode && item.asnCode) return existingItem.asnCode === item.asnCode;
                    if (existingItem.matnrCode === item.matnrCode && !existingItem.trackCode && !item.trackCode && !existingItem.asnCode && !item.asnCode) return true;
                    return false;
                };
                let addedCount = 0;
                data.forEach(item => {
                    const existingIndex = this.list.findIndex(existingItem => isSameItem(existingItem, item));
                    if (existingIndex >= 0) {
                        this.list.splice(existingIndex, 1);
                    }
                    this.list.push(item);
                    addedCount++;
                });
                // 如果所有物料都已存在,提示用户
                if (addedCount === 0 && skippedCount > 0) {
                    uni.showToast({
                        title: "该物料已添加,请扫描其他物料",
                        icon: "none",
                        position: 'top',
                        duration: 1500
                    });
                } else if (addedCount > 0) {
                    // 成功添加物料后,延迟清空物料编码输入框,方便连续扫描不同物料
                    // 延迟300ms清空,让用户可以快速连续扫描不同的物料
                if (addedCount > 0) {
                    setTimeout(() => {
                        this.matnrCode = '';
                    }, 300);
@@ -411,6 +391,40 @@
            remove(index) {
                this.list.splice(index, 1);
            },
            removeGroup(group) {
                this.list = this.list.filter(x => !group.includes(x));
            },
            groupSumAnfme(group) {
                return group.reduce((acc, row) => acc + (Number(row.anfme) || 0), 0);
            },
            groupSumAvailable(group) {
                return group.reduce((acc, row) => {
                    const v = row.availablePalletQty != null ? row.availablePalletQty : (Number(row.anfme) || 0) - (Number(row.workQty) || 0) - (Number(row.qty) || 0);
                    return acc + v;
                }, 0);
            },
            groupSumPutaway(group) {
                return group.reduce((acc, row) => acc + (Number(row.workQty) || 0) + (Number(row.qty) || 0), 0);
            },
            groupSumReceiptQty(group) {
                return group.reduce((acc, row) => acc + (Number(row.receiptQty) || 0), 0);
            },
            getGroupAvailableMax(group) {
                return group.reduce((acc, row) => acc + this.getItemAvailableMax(row), 0);
            },
            // 将组盘总数量按可组盘上限分配到各单号行(先满足前一行,再往后)
            setGroupReceiptQty(group, total) {
                let val = total;
                if (val && typeof val === 'object' && val.detail != null && val.detail.value !== undefined) val = val.detail.value;
                let remaining = Number(val) || 0;
                if (remaining < 0) remaining = 0;
                group.forEach(line => {
                    const maxLine = this.getItemAvailableMax(line);
                    const assign = Math.min(maxLine, remaining);
                    this.$set(line, 'receiptQty', assign);
                    remaining -= assign;
                });
            },
            clear() {
                this.list = []
                this.barcode = ''
@@ -434,7 +448,7 @@
            async confirm() {
                if (this.container === '' || this.container === null) {
                    uni.showToast({
                        title: "容器码为空",
                        title: "料箱码为空",
                        icon: "none",
                        position: 'top'
                    })
@@ -448,27 +462,23 @@
                    })
                    return;
                }
                // 校验所有物料的组盘数量不能为空、不能为0
                for (let i = 0; i < this.list.length; i++) {
                    const item = this.list[i];
                    if (item.receiptQty === null || item.receiptQty === undefined || item.receiptQty === '' || item.receiptQty === 0) {
                        uni.showToast({
                            title: `第${i + 1}个物料(${item.matnrCode || item.maktx || '未知'})的组盘数量不能为空或0`,
                            icon: "none",
                            position: 'top',
                            duration: 3000
                        })
                        return;
                    }
                }
                this.repeatClick = true
                const newArr = this.list.map(item => {
                    return {
                // 组盘数量按“先满足前一单号”分配后,可能有的单号被分到 0;只提交数量>0 的明细,避免报错
                const newArr = this.list
                    .filter(item => (Number(item.receiptQty) || 0) > 0)
                    .map(item => ({
                        ...item,
                        anfme: item.anfme === null ? 0 : +item.anfme,
                    };
                });
                    }));
                if (newArr.length === 0) {
                    uni.showToast({
                        title: '组盘数量不能为空或0',
                        icon: "none",
                        position: 'top',
                        duration: 3000
                    })
                    return;
                }
                this.repeatClick = true
                const {
                    code,
                    data,
@@ -480,14 +490,17 @@
                })
                if (code === 200) {
                    uni.showToast({
                        title: '组盘成功'
                        title: this.isHalf ? '组盘成功,可继续扫同一料箱码追加' : '组盘成功'
                    })
                    this.list = []
                    this.barcode = ''
                    this.container = ''
                    this.asnCode = ''
                    this.matnrCode = ''
                    this.isconfirm = false
                    // 半箱时保留料箱码,便于继续扫同一箱码追加组托
                    if (!this.isHalf) {
                        this.container = ''
                        this.asnCode = ''
                        this.matnrCode = ''
                    }
                } else {
                    uni.showToast({
                        title: msg,
pages/listing/unPakin.vue
@@ -1,286 +1,293 @@
<template>
    <view class="has-foot">
        <view>
            <form>
                <view class="cu-form-group ">
                    <view class="title">容器号</view>
                    <input placeholder="请扫描容器号" v-model="container" focus></input>
                    <text class='cuIcon-search text-blue' @click="getList"></text>
                </view>
                <view class="cu-form-group">
                    <view class="title">编码</view>
                    <input placeholder="请扫描组托档编码" v-model="pkCode"></input>
                    <text class='cuIcon-search text-blue' @click="getList"></text>
                </view>
            </form>
            <view class="flex solid-bottom padding-sm justify-between">
                <view class="text-blue">物料总类:{{list.length}}</view>
                <view class="text-blue">组盘总数:{{allCount}}</view>
            </view>
        </view>
        <view class="padding-lr margin-top-sm">
            <block v-for="(item, index) in list" :key="index">
                <view class="cu-list det menu sm-border margin-bottom-sm " :class="[item.trackCode===barcode&&'act']"
                    :ref="item.trackCode+'ref'">
                    <view class="cu-bar bg-white solid-bottom ">
                        <view class="action">
                            <view class="index">
                                {{index+1}}
                            </view>
                            <view class="text-blue">
                                编码:
                                {{`${item.matnrCode}`}}
                            </view>
                        </view>
                        <view class="action" v-if="!isconfirm">
                            <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>
                            <text class="text-grey ">{{item.asnCode}}</text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <text class="text-black">批次:</text>
                            <text class="text-grey ">{{item.batch}}</text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <text class="text-black">质检状态:</text>
                            <text class="text-grey ">{{item.isptResult$}}</text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <text class="text-black">库存单位: <text class="text-grey ">{{item.stockUnit}}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <text class="text-black">已组托数: <text class="text-grey ">{{item.anfme}}</text></text>
                        </view>
                        <view class="content">
                            <text class="text-black">已执行数量: <text class="text-grey ">{{item.workQty}}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <text class="text-black">可解绑数量: <text
                                    class="text-grey ">{{item.anfme - item.workQty}}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <view class="cu-form-group padding-lr-0">
                                <view class="title text-blue"><text
                                        class="text-red text-xl vertical-middle">*</text>解绑数量:
                                </view>
                                <uni-number-box style="width: 70%;" :max="max" v-model="item.receiptQty"
                                    :step='0.000001'></uni-number-box>
                            </view>
                        </view>
                    </view>
                </view>
            </block>
        </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" :disabled="repeatClick" @click="confirm">解绑</button>
        </view>
    </view>
</template>
<script>
    import {
        request
    } from '../../common/request.js'
    import {
        mapState,
        mapMutations,
        mapActions,
        mapGetters
    } from 'vuex';
    export default {
        data() {
            return {
                barcode: '',
                container: '',
                megreQty: '',
                list: [],
                range: [],
                asnCode: '',
                repeatClick: false,
                isconfirm: false,
                matnrCode: '',
                max: 99999999,
                pkCode: '',
            }
        },
        computed: {
            ...mapState('user', ['dynamicFields']),
            allCount() {
                return this.list.reduce((acc, row) => +row.anfme + acc, 0) || 0
            }
        },
        mounted() {},
        methods: {
            async search() {
                const find = this.list.find(el => el.trackCode === this.barcode);
                find ? this.scrollTo() : this.getDet();
            },
            async getDet() {
                const {
                    code,
                    data,
                    msg
                } = await request('/asnOrderItem/trackCode', {
                    matnrCode: this.matnrCode,
                    asnCode: this.asnCode
                }, "post")
                if (code === 200) {
                    for (var i = 0; i < data.length; i++) {
                        data[i].receiptQty = 0;
                        data[i].selected = false;
                    }
                    this.list = data
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                        position: 'top'
                    })
                }
            },
            async getList() {
                const {
                    code,
                    data,
                    msg
                } = await request('/asnOrderItem/container', {
                    barcode: this.container,
                    code: this.pkCode,
                    type: 'unbind'
                })
                if (code === 200) {
                    for (var i = 0; i < data.length; i++) {
                        data[i].receiptQty = 0;
                    }
                    this.list = data
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                        position: 'top'
                    })
                }
            },
            scrollTo() {
                const ref = this.$refs[`${this.barcode}ref`][0];
                uni.pageScrollTo({
                    scrollTop: ref.$el.offsetTop,
                    duration: 300
                })
            },
            remove(index) {
                this.list.splice(index, 1);
            },
            clear() {
                this.list = []
                this.barcode = ''
            },
            next() {
                if (this.list.length) {
                    this.isconfirm = true
                } else {
                    uni.showToast({
                        icon: "none",
                        title: '未选物料标签'
                    })
                }
            },
            prev() {
                this.isconfirm = false
            },
            async confirm() {
                this.repeatClick = true
                const newArr = this.list.map(item => {
                    return {
<template>
    <view class="has-foot">
        <view>
            <form>
                <view class="cu-form-group ">
                    <view class="title">料箱码</view>
                    <input placeholder="请扫描料箱码" v-model="container" focus></input>
                    <text class='cuIcon-search text-blue' @click="getList"></text>
                </view>
                <view class="cu-form-group">
                    <view class="title">编码</view>
                    <input placeholder="请扫描组托档编码" v-model="pkCode"></input>
                    <text class='cuIcon-search text-blue' @click="getList"></text>
                </view>
            </form>
            <view class="flex solid-bottom padding-sm justify-between">
                <view class="text-blue">物料总类:{{list.length}}</view>
                <view class="text-blue">组盘总数:{{allCount}}</view>
            </view>
        </view>
        <view class="padding-lr margin-top-sm">
            <block v-for="(item, index) in list" :key="index">
                <view class="cu-list det menu sm-border margin-bottom-sm " :class="[item.trackCode===barcode&&'act']"
                    :ref="item.trackCode+'ref'">
                    <view class="cu-bar bg-white solid-bottom ">
                        <view class="action">
                            <view class="index">
                                {{index+1}}
                            </view>
                            <view class="text-blue">
                                编码:
                                {{`${item.matnrCode}`}}
                            </view>
                        </view>
                        <view class="action" v-if="!isconfirm">
                            <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>
                            <text class="text-grey ">{{item.asnCode}}</text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <text class="text-black">批次:</text>
                            <text class="text-grey ">{{item.batch}}</text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <text class="text-black">质检状态:</text>
                            <text class="text-grey ">{{item.isptResult$}}</text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <text class="text-black">库存单位: <text class="text-grey ">{{item.stockUnit}}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <text class="text-black">已组托数: <text class="text-grey ">{{item.anfme}}</text></text>
                        </view>
                        <view class="content">
                            <text class="text-black">已执行数量: <text class="text-grey ">{{item.workQty}}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <text class="text-black">可解绑数量: <text
                                    class="text-grey ">{{item.anfme - item.workQty}}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <view class="cu-form-group padding-lr-0">
                                <view class="title text-blue"><text
                                        class="text-red text-xl vertical-middle">*</text>解绑数量:
                                </view>
                                <uni-number-box style="width: 70%;" :max="unbindMax(item)" v-model="item.receiptQty"
                                    :step="1" :decimal="2"></uni-number-box>
                            </view>
                        </view>
                    </view>
                </view>
            </block>
        </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" :disabled="repeatClick" @click="confirm">解绑</button>
        </view>
    </view>
</template>
<script>
    import {
        request
    } from '../../common/request.js'
    import {
        mapState,
        mapMutations,
        mapActions,
        mapGetters
    } from 'vuex';
    export default {
        data() {
            return {
                barcode: '',
                container: '',
                megreQty: '',
                list: [],
                range: [],
                asnCode: '',
                repeatClick: false,
                isconfirm: false,
                matnrCode: '',
                pkCode: '',
            }
        },
        computed: {
            ...mapState('user', ['dynamicFields']),
            allCount() {
                return this.list.reduce((acc, row) => +row.anfme + acc, 0) || 0
            }
        },
        mounted() {},
        methods: {
            /** 单行解绑数量上限 = 已组托数 - 已执行数量(可解绑数量) */
            unbindMax(item) {
                const anfme = item.anfme != null ? Number(item.anfme) : 0;
                const workQty = item.workQty != null ? Number(item.workQty) : 0;
                return Math.max(0, anfme - workQty);
            },
            async search() {
                const find = this.list.find(el => el.trackCode === this.barcode);
                find ? this.scrollTo() : this.getDet();
            },
            async getDet() {
                const {
                    code,
                    data,
                    msg
                } = await request('/asnOrderItem/trackCode', {
                    matnrCode: this.matnrCode,
                    asnCode: this.asnCode
                }, "post")
                if (code === 200) {
                    for (var i = 0; i < data.length; i++) {
                        data[i].receiptQty = 0;
                        data[i].selected = false;
                    }
                    this.list = data
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                        position: 'top'
                    })
                }
            },
            async getList() {
                const {
                    code,
                    data,
                    msg
                } = await request('/asnOrderItem/container', {
                    barcode: this.container,
                    code: this.pkCode,
                    type: 'unbind'
                })
                if (code === 200) {
                    for (var i = 0; i < data.length; i++) {
                        data[i].receiptQty = 0;
                    }
                    this.list = data
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                        position: 'top'
                    })
                }
            },
            scrollTo() {
                const ref = this.$refs[`${this.barcode}ref`][0];
                uni.pageScrollTo({
                    scrollTop: ref.$el.offsetTop,
                    duration: 300
                })
            },
            remove(index) {
                this.list.splice(index, 1);
            },
            clear() {
                this.list = []
                this.barcode = ''
            },
            next() {
                if (this.list.length) {
                    this.isconfirm = true
                } else {
                    uni.showToast({
                        icon: "none",
                        title: '未选物料标签'
                    })
                }
            },
            prev() {
                this.isconfirm = false
            },
            async confirm() {
                this.repeatClick = true
                const newArr = this.list.map(item => {
                    const maxQty = this.unbindMax(item)
                    const receiptQty = Math.min(maxQty, (item.receiptQty != null ? Number(item.receiptQty) : 0))
                    return {
                        ...item,
                        extendFields: {},
                        anfme: item.anfme === null ? 0 : +item.anfme,
                    };
                });
                const {
                    code,
                    data,
                    msg
                } = await request('/waitPakin/unbind', {
                    items: newArr,
                    barcode: this.container,
                })
                if (code === 200) {
                    uni.showToast({
                        title: '解绑成功'
                    })
                    this.list = []
                    this.barcode = ''
                    this.container = ''
                    this.isconfirm = false
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                        position: 'top'
                    })
                }
                this.repeatClick = false
            },
        }
    }
</script>
<style>
    .index {
        border: 1px solid #e54d42;
        color: #e54d42;
        border-radius: 50%;
        display: block;
        width: 50rpx;
        height: 50rpx;
        line-height: 48rpx;
        text-align: center;
        margin-right: 20rpx;
        font-size: 30rpx;
    }
    .text-blue {
        color: #0081ff !important;
    }
    .act {
        border: 1px solid #e54d42;
    }
    .item {
        position: relative;
        display: flex;
        min-height: 80upx;
        align-items: center;
    }
                        extendFields: {},
                        anfme: item.anfme === null ? 0 : +item.anfme,
                        receiptQty: receiptQty <= 0 ? 0 : receiptQty,
                    };
                });
                const {
                    code,
                    data,
                    msg
                } = await request('/waitPakin/unbind', {
                    items: newArr,
                    barcode: this.container,
                })
                if (code === 200) {
                    uni.showToast({
                        title: '解绑成功'
                    })
                    this.list = []
                    this.barcode = ''
                    this.container = ''
                    this.isconfirm = false
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                        position: 'top'
                    })
                }
                this.repeatClick = false
            },
        }
    }
</script>
<style>
    .index {
        border: 1px solid #e54d42;
        color: #e54d42;
        border-radius: 50%;
        display: block;
        width: 50rpx;
        height: 50rpx;
        line-height: 48rpx;
        text-align: center;
        margin-right: 20rpx;
        font-size: 30rpx;
    }
    .text-blue {
        color: #0081ff !important;
    }
    .act {
        border: 1px solid #e54d42;
    }
    .item {
        position: relative;
        display: flex;
        min-height: 80upx;
        align-items: center;
    }
</style>
pages/listing/untie.vue
@@ -1,230 +1,230 @@
<template>
    <view class="has-foot">
        <form>
            <view class="cu-form-group margin-top">
                <view class="title">容器号</view>
                <input placeholder="请扫描容器号" v-model="container" focus></input>
                <text class='cuIcon-search text-blue' </text>
            </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>
        </form>
        <!--     <view class="flex solid-bottom padding-sm justify-between">
            <view class="text-blue">物料总类:{{list.length}}</view>
            <view class="text-blue">物料总数:{{allCount}}</view>
        </view> -->
        <view class="cu-list det menu sm-border  padding">
            <block v-for="(item, index) in list" :key="index">
                <view class="cu-bar bg-white solid-bottom margin-top-sm">
                    <view class="action">
                        <view class="index">
                            {{index+1}}
                        </view>
                        <view class="text-blue">
                            {{`${item.maktx}`}}
                        </view>
                    </view>
                    <view class="action" v-if="!isconfirm">
                        <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">ASN:</text>
                    </view>
                    <view class="action">
                        <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.splrBatch}}</text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-black">库存批次:</text>
                    </view>
                    <view class="action">
                        <text class="text-grey ">{{item.batch}}</text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-black">平台行号: <text class="text-grey ">{{item.platformId}}</text></text>
                    </view>
                    <view class="content">
                        <text class="text-black">质检结果: <text class="text-grey ">{{item.inspect}}</text></text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-black">库存单位: <text class="text-grey ">{{item.stockUnit}}</text></text>
                    </view>
                    <!--     <view class="content">
                        <view class="cu-form-group padding-lr-0">
                            <view class="title text-blue">收货数量:</view>
                            <input type="number" placeholder="请输入收货数量" v-model="item.receiptQty"></input>
                        </view>
                    </view> -->
                </view>
            </block>
        </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>
        </view>
    </view>
</template>
<script>
    import {
        request
    } from '../../common/request.js'
    import {
        mapState,
        mapMutations,
        mapActions,
        mapGetters
    } from 'vuex';
    export default {
        data() {
            return {
                barcode: '',
                container: '',
                list: [],
                range: [],
                isconfirm: false
            }
        },
        computed: {
            ...mapState('user', ['dynamicFields']),
            allCount() {
                return this.list.reduce((acc, row) => +row.qty + acc, 0) || 0
            }
        },
        mounted() {},
        methods: {
            async search() {
                const {
                    code,
                    data,
                    msg
                } = await request('/asnOrderItem/trackCode/' + this.barcode, {}, "get")
                if (code === 200) {
                    const find = this.list.find(el => el.id === data.id);
                    !find && this.list.push(data)
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                        position: 'top'
                    })
                }
            },
            scrollTo() {
                const ref = this.$refs[`${this.barcode}ref`][0];
                uni.pageScrollTo({
                    scrollTop: ref.$el.offsetTop,
                    duration: 300
                })
            },
            remove(index) {
                this.list.splice(index, 1);
            },
            clear() {
                this.list = []
                this.barcode = ''
            },
            next() {
                if (this.list.length) {
                    this.isconfirm = true
                } else {
                    uni.showToast({
                        icon: "none",
                        title: '未选物料标签'
                    })
                }
            },
            prev() {
                this.isconfirm = false
            },
            async confirm() {
                const {
                    code,
                    data,
                    msg
                } = await request('/waitPakin/unbind', {
                    items: this.list,
                    barcode: this.container
                })
                if (code === 200) {
                    uni.showToast({
                        title: '解绑成功'
                    })
                    this.list = []
                    this.barcode = ''
                    this.isconfirm = false
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                        position: 'top'
                    })
                }
            },
        }
    }
</script>
<style>
    .index {
        border: 1px solid #e54d42;
        color: #e54d42;
        border-radius: 50%;
        display: block;
        width: 50rpx;
        height: 50rpx;
        line-height: 48rpx;
        text-align: center;
        margin-right: 20rpx;
        font-size: 30rpx;
    }
    .text-blue {
        color: #0081ff !important;
    }
    .item {
        position: relative;
        display: flex;
        min-height: 80upx;
        align-items: center;
    }
<template>
    <view class="has-foot">
        <form>
            <view class="cu-form-group margin-top">
                <view class="title">料箱码</view>
                <input placeholder="请扫描料箱码" v-model="container" focus></input>
                <text class='cuIcon-search text-blue' </text>
            </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>
        </form>
        <!--     <view class="flex solid-bottom padding-sm justify-between">
            <view class="text-blue">物料总类:{{list.length}}</view>
            <view class="text-blue">物料总数:{{allCount}}</view>
        </view> -->
        <view class="cu-list det menu sm-border  padding">
            <block v-for="(item, index) in list" :key="index">
                <view class="cu-bar bg-white solid-bottom margin-top-sm">
                    <view class="action">
                        <view class="index">
                            {{index+1}}
                        </view>
                        <view class="text-blue">
                            {{`${item.maktx}`}}
                        </view>
                    </view>
                    <view class="action" v-if="!isconfirm">
                        <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">ASN:</text>
                    </view>
                    <view class="action">
                        <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.splrBatch}}</text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-black">库存批次:</text>
                    </view>
                    <view class="action">
                        <text class="text-grey ">{{item.batch}}</text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-black">平台行号: <text class="text-grey ">{{item.platformId}}</text></text>
                    </view>
                    <view class="content">
                        <text class="text-black">质检结果: <text class="text-grey ">{{item.inspect}}</text></text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-black">库存单位: <text class="text-grey ">{{item.stockUnit}}</text></text>
                    </view>
                    <!--     <view class="content">
                        <view class="cu-form-group padding-lr-0">
                            <view class="title text-blue">收货数量:</view>
                            <input type="number" placeholder="请输入收货数量" v-model="item.receiptQty"></input>
                        </view>
                    </view> -->
                </view>
            </block>
        </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>
        </view>
    </view>
</template>
<script>
    import {
        request
    } from '../../common/request.js'
    import {
        mapState,
        mapMutations,
        mapActions,
        mapGetters
    } from 'vuex';
    export default {
        data() {
            return {
                barcode: '',
                container: '',
                list: [],
                range: [],
                isconfirm: false
            }
        },
        computed: {
            ...mapState('user', ['dynamicFields']),
            allCount() {
                return this.list.reduce((acc, row) => +row.qty + acc, 0) || 0
            }
        },
        mounted() {},
        methods: {
            async search() {
                const {
                    code,
                    data,
                    msg
                } = await request('/asnOrderItem/trackCode/' + this.barcode, {}, "get")
                if (code === 200) {
                    const find = this.list.find(el => el.id === data.id);
                    !find && this.list.push(data)
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                        position: 'top'
                    })
                }
            },
            scrollTo() {
                const ref = this.$refs[`${this.barcode}ref`][0];
                uni.pageScrollTo({
                    scrollTop: ref.$el.offsetTop,
                    duration: 300
                })
            },
            remove(index) {
                this.list.splice(index, 1);
            },
            clear() {
                this.list = []
                this.barcode = ''
            },
            next() {
                if (this.list.length) {
                    this.isconfirm = true
                } else {
                    uni.showToast({
                        icon: "none",
                        title: '未选物料标签'
                    })
                }
            },
            prev() {
                this.isconfirm = false
            },
            async confirm() {
                const {
                    code,
                    data,
                    msg
                } = await request('/waitPakin/unbind', {
                    items: this.list,
                    barcode: this.container
                })
                if (code === 200) {
                    uni.showToast({
                        title: '解绑成功'
                    })
                    this.list = []
                    this.barcode = ''
                    this.isconfirm = false
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                        position: 'top'
                    })
                }
            },
        }
    }
</script>
<style>
    .index {
        border: 1px solid #e54d42;
        color: #e54d42;
        border-radius: 50%;
        display: block;
        width: 50rpx;
        height: 50rpx;
        line-height: 48rpx;
        text-align: center;
        margin-right: 20rpx;
        font-size: 30rpx;
    }
    .text-blue {
        color: #0081ff !important;
    }
    .item {
        position: relative;
        display: flex;
        min-height: 80upx;
        align-items: center;
    }
</style>
pages/listing/upper.vue
@@ -1,264 +1,264 @@
<template>
    <view class="has-foot">
        <form>
            <view class="cu-form-group margin-top">
                <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="areaName" ></input>
            </view>
            <view class="cu-form-group ">
                <view class="title">目标库位</view>
                <input placeholder="请选择目标库位" v-model="curCode"></input>
                <text class='cu-btn  bg-red tj' @click="open">推荐</text>
            </view>
        </form>
        <view class="cu-list det menu sm-border  padding">
            <block v-for="(item, index) in list" :key="index">
                <view class="cu-bar bg-white solid-bottom margin-top-sm">
                    <view class="action">
                        <view class="index">
                            {{index+1}}
                        </view>
                        <view class="text-blue">
                            {{`${item.maktx}`}}
                        </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">ASN:</text>
                    </view>
                    <view class="action">
                        <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.splrBatch}}</text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-black">库存批次:</text>
                    </view>
                    <view class="action">
                        <text class="text-grey ">{{item.batch}}</text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-black">收货数量:</text>
                    </view>
                    <view class="action">
                        <text class="text-grey ">{{item.anfme}}</text>
                    </view>
                </view>
            </block>
        </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>
        </view>
        <uni-popup ref="popup" class="cu-popup">
            <view class="popup-content">
                <view class="head">
                    <text>推荐</text>
                    <text class='cuIcon-close text-red close' @click="close"></text>
                </view>
                <div class="body">
                    <view class="cu-list grid col-3 no-border">
                        <view class="item" v-for="el in range">
                            <view class="cu-btn round  sm" :class="[el===curCode?'bg-blue':'line-blue']"
                                @click="itemChange(el)">{{el}}</view>
                        </view>
                    </view>
                </div>
                <view class="cu-bar btn-group ">
                    <button class="cu-btn bg-blue shadow-blur" @click="popupSubmit">提交</button>
                </view>
            </view>
        </uni-popup>
    </view>
</template>
<script>
    import {
        request
    } from '../../common/request.js'
    import {
        mapState,
        mapMutations,
        mapActions,
        mapGetters
    } from 'vuex';
    export default {
        data() {
            return {
                barcode: '',
                areaName: '',
                locCode: '',
                container: '',
                list: [],
                range: [],
                curCode: ''
            }
        },
        computed: {
            ...mapState('user', ['dynamicFields']),
        },
        mounted() {},
        methods: {
            async search() {
                const {
                    code,
                    data,
                    msg
                } = await request(`/task/stock/${this.barcode}`)
                if (code === 200) {
                    this.list = data.taskItems;
                    this.range = data.locArea.locs.map(el => el.code)
                    this.curCode = this.range[0]
                    this.areaName = data.locArea.areaName
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                    })
                }
            },
            remove(index) {
                this.list.splice(index, 1);
            },
            clear() {
                this.list = []
                this.range = []
                this.curCode = ''
                this.areaName = ''
                this.barcode = ''
            },
            open() {
                this.$refs.popup.open()
            },
            close() {
                this.$refs.popup.close()
            },
            popupSubmit() {
                this.$refs.popup.close()
            },
            itemChange(el) {
                this.curCode = el
            },
            async confirm() {
                const {
                    code,
                    data,
                    msg
                } = await request(`/task/public/${this.barcode}`
                    // , {
                    //     curCode: this.curCode,
                    //     barcode: this.barcode
                    // },
                )
                if (code === 200) {
                    uni.showToast({
                        title: '上架成功'
                    })
                    this.clear()
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                    })
                }
            },
        }
    }
</script>
<style>
    .index {
        border: 1px solid #e54d42;
        color: #e54d42;
        border-radius: 50%;
        display: block;
        width: 50rpx;
        height: 50rpx;
        line-height: 48rpx;
        text-align: center;
        margin-right: 20rpx;
        font-size: 30rpx;
    }
    .text-blue {
        color: #0081ff !important;
    }
    .item {
        position: relative;
        display: flex;
        min-height: 80upx;
        align-items: center;
    }
    .uni-file-picker {
        width: 100%;
        margin-bottom: 10px;
    }
    .uni-select__selector {
        z-index: 999;
    }
    .tj {
        height: auto;
        padding: 6px 8px;
        display: inline-block;
        border-radius: 6px;
    }
    .item {
        display: flex;
        justify-content: center;
    }
    .item .cu-btn {
        font-size: 26upx;
    }
<template>
    <view class="has-foot">
        <form>
            <view class="cu-form-group margin-top">
                <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="areaName" ></input>
            </view>
            <view class="cu-form-group ">
                <view class="title">目标库位</view>
                <input placeholder="请选择目标库位" v-model="curCode"></input>
                <text class='cu-btn  bg-red tj' @click="open">推荐</text>
            </view>
        </form>
        <view class="cu-list det menu sm-border  padding">
            <block v-for="(item, index) in list" :key="index">
                <view class="cu-bar bg-white solid-bottom margin-top-sm">
                    <view class="action">
                        <view class="index">
                            {{index+1}}
                        </view>
                        <view class="text-blue">
                            {{`${item.maktx}`}}
                        </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">ASN:</text>
                    </view>
                    <view class="action">
                        <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.splrBatch}}</text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-black">库存批次:</text>
                    </view>
                    <view class="action">
                        <text class="text-grey ">{{item.batch}}</text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-black">收货数量:</text>
                    </view>
                    <view class="action">
                        <text class="text-grey ">{{item.anfme}}</text>
                    </view>
                </view>
            </block>
        </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>
        </view>
        <uni-popup ref="popup" class="cu-popup">
            <view class="popup-content">
                <view class="head">
                    <text>推荐</text>
                    <text class='cuIcon-close text-red close' @click="close"></text>
                </view>
                <div class="body">
                    <view class="cu-list grid col-3 no-border">
                        <view class="item" v-for="el in range">
                            <view class="cu-btn round  sm" :class="[el===curCode?'bg-blue':'line-blue']"
                                @click="itemChange(el)">{{el}}</view>
                        </view>
                    </view>
                </div>
                <view class="cu-bar btn-group ">
                    <button class="cu-btn bg-blue shadow-blur" @click="popupSubmit">提交</button>
                </view>
            </view>
        </uni-popup>
    </view>
</template>
<script>
    import {
        request
    } from '../../common/request.js'
    import {
        mapState,
        mapMutations,
        mapActions,
        mapGetters
    } from 'vuex';
    export default {
        data() {
            return {
                barcode: '',
                areaName: '',
                locCode: '',
                container: '',
                list: [],
                range: [],
                curCode: ''
            }
        },
        computed: {
            ...mapState('user', ['dynamicFields']),
        },
        mounted() {},
        methods: {
            async search() {
                const {
                    code,
                    data,
                    msg
                } = await request(`/task/stock/${this.barcode}`)
                if (code === 200) {
                    this.list = data.taskItems;
                    this.range = data.locArea.locs.map(el => el.code)
                    this.curCode = this.range[0]
                    this.areaName = data.locArea.areaName
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                    })
                }
            },
            remove(index) {
                this.list.splice(index, 1);
            },
            clear() {
                this.list = []
                this.range = []
                this.curCode = ''
                this.areaName = ''
                this.barcode = ''
            },
            open() {
                this.$refs.popup.open()
            },
            close() {
                this.$refs.popup.close()
            },
            popupSubmit() {
                this.$refs.popup.close()
            },
            itemChange(el) {
                this.curCode = el
            },
            async confirm() {
                const {
                    code,
                    data,
                    msg
                } = await request(`/task/public/${this.barcode}`
                    // , {
                    //     curCode: this.curCode,
                    //     barcode: this.barcode
                    // },
                )
                if (code === 200) {
                    uni.showToast({
                        title: '上架成功'
                    })
                    this.clear()
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                    })
                }
            },
        }
    }
</script>
<style>
    .index {
        border: 1px solid #e54d42;
        color: #e54d42;
        border-radius: 50%;
        display: block;
        width: 50rpx;
        height: 50rpx;
        line-height: 48rpx;
        text-align: center;
        margin-right: 20rpx;
        font-size: 30rpx;
    }
    .text-blue {
        color: #0081ff !important;
    }
    .item {
        position: relative;
        display: flex;
        min-height: 80upx;
        align-items: center;
    }
    .uni-file-picker {
        width: 100%;
        margin-bottom: 10px;
    }
    .uni-select__selector {
        z-index: 999;
    }
    .tj {
        height: auto;
        padding: 6px 8px;
        display: inline-block;
        border-radius: 6px;
    }
    .item {
        display: flex;
        justify-content: center;
    }
    .item .cu-btn {
        font-size: 26upx;
    }
</style>
pages/mat/matSelected.vue
@@ -24,7 +24,7 @@
            <view class="form-item">
                <view class="form-item-desc"><text>数量</text></view>
                <view class="form-item-content">
                    <uni-number-box :value="mat.anfme" :max="99999999" :step='0.000001' color="#747474" @change="changeValue" />
                    <uni-number-box :value="mat.anfme" :max="99999999" :step="1" :decimal="2" color="#747474" @change="changeValue" />
                </view>
            </view>
        </view>
pages/outbound/ModifyTaskBind.vue
@@ -25,7 +25,7 @@
                            <text class="text-gray">品种码:<text>{{item.matnrCode}}</text></text>
                        </view>
                        <view class="content">
                            <text class="text-gray">品类数量:<text>{{item.anfme}}</text></text>
                            <text class="text-gray">品类数量:<text>{{ $formatQty(item.anfme) }}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
pages/outbound/PickItemDetl.vue
@@ -3,12 +3,12 @@
        <view class="cu-list det menu sm-border">
            <view class="cu-item">
                <view class="content">
                    <text class="text-gray">订单号:<text class="text-black ">{{orderDetl.poCode}}</text></text>
                    <text class="text-gray">单据内码:<text class="text-black ">{{orderDetl.poCode}}</text></text>
                </view>
            </view>
            <view class="cu-item">
                <view class="content">
                    <text class="text-gray">容器号:<text class="text-black ">{{orderDetl.barcode}}</text></text>
                    <text class="text-gray">料箱码:<text class="text-black ">{{orderDetl.barcode}}</text></text>
                </view>
            </view>
            <form>
@@ -52,7 +52,7 @@
                            <view class="title text-blue"><text class="text-red text-xl vertical-middle">*</text>拣:
                            </view>
                            <uni-number-box style="width: 70%;" :max="max" v-model="item2.anfme"
                                :step='0.00001'></uni-number-box>
                                :step="1" :decimal="2"></uni-number-box>
                        </view>
                    </view>
                </view>
@@ -120,7 +120,7 @@
                let that = this
                if (that.barcode === '' || that.barcode === null) {
                    uni.showToast({
                        title: "容器号为空",
                        title: "料箱码为空",
                        icon: "error",
                    })
                    return;
@@ -222,7 +222,7 @@
                let that = this
                if (that.barcode === '' || that.barcode === null) {
                    uni.showToast({
                        title: "容器号为空",
                        title: "料箱码为空",
                        icon: "error",
                    })
                    return;
pages/outbound/fastPicking.vue
@@ -2,8 +2,8 @@
    <view class="has-foot">
        <form>
            <view class="cu-form-group" v-show="!isconfirm">
                <view class="title">容器码</view>
                <input placeholder="请扫描容器码" v-model="barcode"  focus @input="onBarcodeInput"></input>
                <view class="title">料箱码</view>
                <input placeholder="请扫描料箱码" v-model="barcode"  focus @input="onBarcodeInput"></input>
                <text class='cuIcon-close text-gray margin-right-xs' v-show="barcode!==''" @click="clearCode"></text>
            </view>
@@ -16,56 +16,57 @@
                
        <view class="cu-list det menu sm-border  padding">
            <block  v-for="(item, index) in list" :key="index">
                <view :style="clickItem === index ?itemStyle : {}" class="cu-list det menu  " >
                <view class="cu-bar bg-white solid-bottom margin-top-sm">
            <!-- 按出库单分模块:两个出库单同物料时显示两个模块 -->
            <block v-for="(module, mIndex) in list" :key="'m' + mIndex">
                <view class="cu-bar bg-blue solid-bottom margin-top-sm padding-sm">
                    <view class="action">
                        <view class="index">
                            {{index+1}}
                        <text class="text-white">出库单 {{ mIndex + 1 }}:{{ module.orderCode || '—' }}</text>
                    </view>
                </view>
                <block v-for="(item, index) in (module.items || [module])" :key="'i' + mIndex + '_' + index">
                    <view :style="clickItem === (mIndex + '_' + index) ? itemStyle : {}" class="cu-list det menu">
                        <view class="cu-bar bg-white solid-bottom margin-top-sm">
                            <view class="action">
                                <view class="index">{{ index + 1 }}</view>
                            </view>
                        </view>
                        <view class="cu-item">
                            <view class="content">
                                <text class="text-gray">编码:<text class="text-black ">{{ item.matnrCode }}</text></text>
                            </view>
                        </view>
                        <view class="cu-item">
                            <view class="content">
                                <text class="text-gray">出库单:<text class="text-black ">{{ item.sourceCode || module.orderCode }}</text></text>
                            </view>
                        </view>
                        <view class="cu-item">
                            <view class="content">
                                <text class="text-gray">批次:<text class="text-black ">{{ item.batch }}</text></text>
                            </view>
                        </view>
                        <view class="cu-item">
                            <view class="content">
                                <text class="text-gray">库存单位:<text class="text-black ">{{ item.unit }}</text></text>
                            </view>
                        </view>
                        <view class="cu-item">
                            <view class="content">
                                <text class="text-gray">计划分拣数量:<text class="text-black ">{{ $formatQty(item.anfme) }}</text></text>
                            </view>
                        </view>
                        <view class="cu-item">
                            <view class="content2">
                                <text class="text-gray">本次分拣数量:</text>
                                <input type="number" step="1" :value="$formatQty((item.qty != null && item.qty > 0) ? item.qty : (item.anfme != null ? item.anfme : 0))" disabled=""></input>
                            </view>
                        </view>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-gray">编码:<text class="text-black ">{{item.matnrCode}}</text></text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-gray">出库单:<text class="text-black ">{{item.sourceCode}}</text></text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-gray">批次:<text class="text-black ">{{item.batch}}</text></text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-gray">库存单位:<text class="text-black ">{{item.unit}}</text></text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-gray">计划分拣数量:<text class="text-black ">{{item.anfme}}</text></text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content2">
                        <text class="text-gray">本次分拣数量:</text>
                        <input type="number" v-model="item.anfme" disabled=""></input>
                    </view>
                </view>
                </view>
                </block>
            </block>
            <view v-if="list.length === 0 && allPickedDone" class="padding text-center text-gray">
                <text>全部拣货已完成,点击「提交确认」生成拣货入库单</text>
            </view>
        </view>
@@ -110,7 +111,8 @@
                },
                repeatClick: false,
                searchTimer: null, // 防抖定时器
                isClearing: false // 标记是否正在清空
                isClearing: false, // 标记是否正在清空
                allPickedDone: false // 全部拣完(仅显示“提交确认”生成拣货入库单)
            }
        },
        computed: {
@@ -120,7 +122,7 @@
            }
        },
        watch: {
            // 监听容器码变化,自动查询
            // 监听料箱码变化,自动查询
            barcode(newVal, oldVal) {
                // 如果正在清空,不触发查询
                if (this.isClearing) {
@@ -130,13 +132,13 @@
                if (this.searchTimer) {
                    clearTimeout(this.searchTimer);
                }
                // 如果容器码不为空,延迟300ms后自动查询(防抖处理)
                // 如果料箱码不为空,延迟300ms后自动查询(防抖处理)
                if (newVal && newVal.trim() !== '') {
                    this.searchTimer = setTimeout(() => {
                        this.search();
                    }, 300);
                } else {
                    // 容器码为空时,清空列表
                    // 料箱码为空时,清空列表
                    this.list = [];
                }
            }
@@ -162,25 +164,45 @@
            },
            async search() {
                this.list = []
                this.allPickedDone = false
                if(this.barcode === '' || this.barcode ===null || this.barcode.trim() === ''){
                    return ;
                }
                const {
                    code,
                    data,
                    msg
                } = await request('/outStockTaskItem/'+this.barcode,{}, 'get')
                if (code === 200) {
                    if (Object.keys(data).length === 0){
                const res = await request('/outStockTaskItem/'+this.barcode,{}, 'get')
                const code = res.code
                const msg = res.msg
                // 接口可能返回 data 包裹,也可能 taskItems/orders/list 在顶层
                const data = res.data != null ? res.data : res
                if (code === 200) {
                    // 同一箱码可能对应多个出库单:优先用 orders 分模块展示多条,否则用 list/taskItems 展平为一条模块
                    const orders = (data && data.orders) ? data.orders : null
                    const flatList = (data && data.list) ? data.list : (data && data.taskItems) ? data.taskItems : null
                    if (orders && orders.length > 0) {
                        this.list = orders
                    } else if (Array.isArray(data)) {
                        this.list = data.length ? [{ orderCode: '-', items: data }] : []
                    } else if (flatList && Array.isArray(flatList) && flatList.length > 0) {
                        this.list = [{ orderCode: '-', items: flatList }]
                    } else {
                        this.list = []
                    }
                    if (this.list.length === 0 && !(data && data.orders && data.orders.length === 0 && (data.msg === '全部拣货已完成' || res.msg === '全部拣货已完成'))) {
                        uni.showToast({
                            title: "该标签未查询到数据",
                            title: (data && data.msg) ? data.msg : (res.msg || "该标签未查询到数据"),
                            icon: "none",
                            position: 'top'
                        })
                    }
                    this.list.push(...data)
                    if (data && (data.msg === '全部拣货已完成' || res.msg === '全部拣货已完成' || (orders && orders.length === 0 && data.taskItems && data.taskItems.length > 0))) {
                        this.allPickedDone = true
                        uni.showToast({ title: '全部拣货已完成,可点击提交确认生成拣货入库单', icon: 'none', duration: 2500 })
                    } else {
                        this.allPickedDone = false
                    }
                    
                }else if(code == 401){
                    this.list = []
                    this.allPickedDone = false
                    setTimeout(() => {
                        uni.removeStorageSync('token');
                        uni.reLaunch({
@@ -188,8 +210,11 @@
                        });
                    }, 1000);
                }else {
                    // 未查询到待确认任务等错误时清空列表,避免已确认(200)的任务再次展示
                    this.list = []
                    this.allPickedDone = false
                    uni.showToast({
                        title: msg,
                        title: msg || '未查询到待确认任务,请等待新任务执行完成后再扫',
                        icon: "none",
                        position: 'top'
                    })
@@ -201,12 +226,12 @@
                let that = this
                if(that.barcode === '' || that.barcode === null){
                    uni.showToast({
                        title: "容器号为空",
                        title: "料箱码为空",
                        icon: "error",
                    })
                    return ;
                }
                if(that.list === [] || that.list.length === 0){
                if ((that.list === [] || that.list.length === 0) && !that.allPickedDone) {
                    uni.showToast({
                        title: "拣货明细为空",
                        icon: "error",
@@ -262,6 +287,7 @@
                this.isClearing = true;
                this.list = [];
                this.barcode = '';
                this.allPickedDone = false;
                // 清空后重置标记,允许下次扫描
                this.$nextTick(() => {
                    this.isClearing = false;
pages/outbound/wavePickItem.vue
@@ -6,8 +6,8 @@
                <text class="text-black ">{{wave.code}}</text>                
            </view> -->
            <view class="cu-form-group" v-show="!isconfirm">
                <view class="title">容器号</view>
                <input placeholder="请扫描容器号" v-model="barcode" focus></input>
                <view class="title">料箱码</view>
                <input placeholder="请扫描料箱码" v-model="barcode" focus></input>
                <text class='cuIcon-close text-gray margin-right-xs' v-show="barcode!==''" @click="clearCode"></text>
                <text class='cuIcon-search text-blue' @click="search"></text>
            </view>
@@ -21,30 +21,31 @@
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-gray">出库单号:<text class="text-black ">{{item2.orderCode}}</text></text>
                        <text class="text-gray">出库单号:<text class="text-black ">{{getOrderCode(item2)}}</text></text>
                        <text class="cu-tag sm bg-orange margin-left-sm" v-if="isAppendable(item2)">可追加</text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-gray">DO单号:<text class="text-black ">{{item2.poCode}}</text></text>
                        <text class="text-gray">单据内码:<text class="text-black ">{{getPoCode(item2)}}</text></text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-gray">品种号码:<text class="text-black ">{{item2.matnrCode}}</text></text>
                        <text class="text-gray">品种号码:<text class="text-black ">{{getMatnrCode(item2)}}</text></text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-gray">品种名称:<text class="text-black ">{{item2.maktx}}</text></text>
                        <text class="text-gray">品种名称:<text class="text-black ">{{getMaktx(item2)}}</text></text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-gray">需求数量:<text class="text-black ">{{item2.anfme}}</text></text>
                        <text class="text-gray">需求数量:<text class="text-black ">{{getAnfme(item2)}}</text></text>
                    </view>
                    <view class="content">
                        <text class="text-gray">已拣数量:<text class="text-black ">{{item2.qty}}</text></text>
                        <text class="text-gray">已拣数量:<text class="text-black ">{{getQty(item2)}}</text></text>
                    </view>
                </view>
            </view>
@@ -101,18 +102,24 @@
            this.search()
        },
        methods: {
            getOrderCode(item) { return item && item.orderItem ? item.orderItem.orderCode : (item && item.orderCode) || '-' },
            getPoCode(item) { return item && item.orderItem ? item.orderItem.poCode : (item && item.poCode) || '-' },
            getMatnrCode(item) { return item && item.orderItem ? item.orderItem.matnrCode : (item && item.matnrCode) || '-' },
            getMaktx(item) { return item && item.orderItem ? item.orderItem.maktx : (item && item.maktx) || '-' },
            getAnfme(item) { return item && item.orderItem ? item.orderItem.anfme : (item && item.anfme) != null ? item.anfme : '-' },
            getQty(item) { return item && item.orderItem ? item.orderItem.qty : (item && item.qty) != null ? item.qty : '-' },
            isAppendable(item) { return item && item.appendable === true },
            //点击事件
            clickTaskItem(index) {
                let that = this
                const row = that.list[index]
                const orderDetl = (row && row.orderItem) ? { ...row.orderItem, barcode: that.barcode } : { ...row, barcode: that.barcode }
                uni.navigateTo({
                    url: "./PickItemDetl",
                    // 通过eventChannel向被打开页面传送数据
                    success: function(res) {
                        res.eventChannel.emit('pickItemDetl', {
                            data: {
                                ...that.list[index],
                                barcode: that.barcode,
                            }
                            data: orderDetl
                        })
                    }
                });
@@ -139,14 +146,15 @@
                    barcode: this.barcode
                })
                if (code === 200) {
                    if (Object.keys(data).length === 0) {
                    const rawList = (data && data.list) ? data.list : (Array.isArray(data) ? data : [])
                    if (rawList.length === 0) {
                        uni.showToast({
                            title: "该标签未查询到数据",
                            icon: "none",
                            position: 'top'
                        })
                    }
                    that.list.push(...data)
                    that.list = rawList
                    console.log(that.list);
                } else if (code == 401) {
@@ -175,6 +183,7 @@
                    })
                    return;
                }
                const containerWaveDtos = that.list.map(i => (i && i.orderItem) ? i.orderItem : i)
                this.repeatClick = true
                const {
                    code,
@@ -182,7 +191,7 @@
                    msg
                } = await request('/saveWavePick', {
                    container: that.barcode,
                    containerWaveDtos: that.list
                    containerWaveDtos
                })
                if (code === 200) {
                    uni.showToast({
pages/phyz/AGV/AGVPakin.vue
@@ -75,7 +75,7 @@
                    </view> -->
                    <view class="list-left-item">
                        <view class="desc">数量:</view>
                        <view class="left-item">{{item.anfme}}</view>
                        <view class="left-item">{{ $formatQty(item.anfme) }}</view>
                    </view>
                </view>
                <view class="list-right">
@@ -117,7 +117,7 @@
                    <view class="popup-item">
                        <view class="popup-item-left">数量:</view>
                        <view class="popup-item-right" style="border: none;justify-content: center;">
                            <uni-number-box :value="count" :step='0.000001' :max="9999999" color="#747474" @change="changeValue" />
                            <uni-number-box :value="count" :step="1" :decimal="2" :max="9999999" color="#747474" @change="changeValue" />
                        </view>
                    </view>
                    <view class="btn">
pages/phyz/AGV/AGVPakin2.vue
@@ -75,7 +75,7 @@
                    </view> -->
                    <view class="list-left-item">
                        <view class="desc">数量:</view>
                        <view class="left-item">{{item.anfme}}</view>
                        <view class="left-item">{{ $formatQty(item.anfme) }}</view>
                    </view>
                </view>
                <view class="list-right">
@@ -117,7 +117,7 @@
                    <view class="popup-item">
                        <view class="popup-item-left">数量:</view>
                        <view class="popup-item-right" style="border: none;justify-content: center;">
                            <uni-number-box :value="count" :step='0.000001' :max="9999999" color="#747474" @change="changeValue" />
                            <uni-number-box :value="count" :step="1" :decimal="2" :max="9999999" color="#747474" @change="changeValue" />
                        </view>
                    </view>
                    <view class="btn">
pages/phyz/AGV/AGVPakin3.vue
@@ -68,7 +68,7 @@
                    </view>
                    <view class="list-left-item">
                        <view class="desc">数量:</view>
                        <view class="left-item">{{item.anfme}}</view>
                        <view class="left-item">{{ $formatQty(item.anfme) }}</view>
                    </view>
                </view>
                <view class="list-right">
@@ -105,7 +105,7 @@
                    <view class="popup-item">
                        <view class="popup-item-left">数量:</view>
                        <view class="popup-item-right" style="border: none;justify-content: center;">
                            <uni-number-box :value="count" :step='0.000001' :max="9999999" color="#747474" @change="changeValue" />
                            <uni-number-box :value="count" :step="1" :decimal="2" :max="9999999" color="#747474" @change="changeValue" />
                        </view>
                    </view>
                    <view class="btn">
pages/phyz/AGV/emptyOut.vue
@@ -84,7 +84,7 @@
                    <view class="popup-item">
                        <view class="popup-item-left">数量:</view>
                        <view class="popup-item-right" style="border: none;justify-content: center;">
                            <uni-number-box :value="count" :step='0.000001' :max="9999999" color="#747474" @change="changeValue" />
                            <uni-number-box :value="count" :step="1" :decimal="2" :max="9999999" color="#747474" @change="changeValue" />
                        </view>
                    </view>
                    <view class="btn">
pages/phyz/AGV/emptyPakin.vue
@@ -79,7 +79,7 @@
                    <view class="popup-item">
                        <view class="popup-item-left">数量:</view>
                        <view class="popup-item-right" style="border: none;justify-content: center;">
                            <uni-number-box :value="count" :step='0.000001' :max="9999999" color="#747474" @change="changeValue" />
                            <uni-number-box :value="count" :step="1" :decimal="2" :max="9999999" color="#747474" @change="changeValue" />
                        </view>
                    </view>
                    <view class="btn">
pages/phyz/backStock/backStocksOrder.vue
@@ -39,7 +39,7 @@
                    <!-- 标题 -->
                    <view class="title">入库数量</view>
                    <view class="popup-item">
                        <uni-number-box :value="count" :step='0.000001' :max="9999999" color="#747474" @change="changeValue" />
                        <uni-number-box :value="count" :step="1" :decimal="2" :max="9999999" color="#747474" @change="changeValue" />
                    </view>
                    <view class="btn">
                        <view class="btn-left" @click="addClose">取消</view>
pages/phyz/bcp/bcpDbOrder.vue
@@ -39,7 +39,7 @@
                    <!-- 标题 -->
                    <view class="title">入库数量</view>
                    <view class="popup-item">
                        <uni-number-box :value="count" :step='0.000001' :max="9999999" color="#747474" @change="changeValue" />
                        <uni-number-box :value="count" :step="1" :decimal="2" :max="9999999" color="#747474" @change="changeValue" />
                    </view>
                    <view class="btn">
                        <view class="btn-left" @click="addClose">取消</view>
pages/phyz/bcp/bcpDbOrderV2.vue
@@ -39,7 +39,7 @@
                    <!-- 标题 -->
                    <view class="title">入库数量</view>
                    <view class="popup-item">
                        <uni-number-box :value="count" :step='0.000001' :max="9999999" color="#747474" @change="changeValue" />
                        <uni-number-box :value="count" :step="1" :decimal="2" :max="9999999" color="#747474" @change="changeValue" />
                    </view>
                    <view class="btn">
                        <view class="btn-left" @click="addClose">取消</view>
pages/phyz/bcp/bcpOrder.vue
@@ -46,7 +46,7 @@
                    <!-- 标题 -->
                    <view class="title">入库数量</view>
                    <view class="popup-item">
                        <uni-number-box :value="count" :step='0.000001' :max="9999999" color="#747474" @change="changeValue" />
                        <uni-number-box :value="count" :step="1" :decimal="2" :max="9999999" color="#747474" @change="changeValue" />
                    </view>
                    <view class="btn">
                        <view class="btn-left" @click="addClose">取消</view>
pages/phyz/bcp/bcpOrder_xs.vue
@@ -46,7 +46,7 @@
                    <!-- 标题 -->
                    <view class="title">入库数量</view>
                    <view class="popup-item">
                        <uni-number-box :value="count" :step='0.000001' :max="9999999" color="#747474" @change="changeValue" />
                        <uni-number-box :value="count" :step="1" :decimal="2" :max="9999999" color="#747474" @change="changeValue" />
                    </view>
                    <view class="btn">
                        <view class="btn-left" @click="addClose">取消</view>
pages/phyz/bcp/orderCar.vue
@@ -28,7 +28,7 @@
                    <view class="title">入库数量</view>
                    <view class="popup-item">
                        <!-- <view class="popup-item-left">入库数量:</view> -->
                        <view class="popup-item-right" style="border: none;"><uni-number-box :value="count" :step='0.000001' :max="9999999" color="#747474" @change="changeValue" /></view>
                        <view class="popup-item-right" style="border: none;"><uni-number-box :value="count" :step="1" :decimal="2" :max="9999999" color="#747474" @change="changeValue" /></view>
                        
                    </view>
                    <!-- <view class="popup-item">
pages/phyz/bcp/orderCar_xs.vue
@@ -28,7 +28,7 @@
                    <view class="title">入库数量</view>
                    <view class="popup-item">
                        <!-- <view class="popup-item-left">入库数量:</view> -->
                        <view class="popup-item-right" style="border: none;"><uni-number-box :value="count" :step='0.000001' :max="9999999" color="#747474" @change="changeValue" /></view>
                        <view class="popup-item-right" style="border: none;"><uni-number-box :value="count" :step="1" :decimal="2" :max="9999999" color="#747474" @change="changeValue" /></view>
                        
                    </view>
                    <!-- <view class="popup-item">
pages/phyz/checkLocDetl/locDetlList.vue
@@ -41,7 +41,7 @@
                            <uni-combox style="height: 20px;" :candidates="processSts$List" placeholder="请选择工序" v-model="processSts$"></uni-combox>
                        </view>
                    <view class="popup-item">
                        <uni-number-box :value="count" :step='0.000001' :max="9999999" color="#747474" @change="changeValue" />
                        <uni-number-box :value="count" :step="1" :decimal="2" :max="9999999" color="#747474" @change="changeValue" />
                    </view>
                    <view class="btn">
                        <view class="btn-left" @click="remove()">移除</view>
pages/phyz/checkLocDetl/locDetlList2.vue
@@ -41,7 +41,7 @@
                            <uni-combox style="height: 20px;" :candidates="processSts$List" placeholder="请选择工序" v-model="processSts$"></uni-combox>
                        </view>
                    <view class="popup-item">
                        <uni-number-box :value="count" :step='0.000001' :max="9999999" color="#747474" @change="changeValue" />
                        <uni-number-box :value="count" :step="1" :decimal="2" :max="9999999" color="#747474" @change="changeValue" />
                    </view>
                    <view class="btn">
                        <view class="btn-left" @click="remove()">移除</view>
pages/phyz/comOrder/checkOut.vue
@@ -40,7 +40,7 @@
                    <view class="title">出库数量</view>
                    <view class="popup-item">
                        <view>
                            <uni-number-box :value="data.anfme" :step='0.000001' :min="0" :max="maxCount" color="#747474" @change="changeValue" />
                            <uni-number-box :value="data.anfme" :step="1" :decimal="2" :min="0" :max="maxCount" color="#747474" @change="changeValue" />
                        </view>
                        
                    </view>
pages/phyz/comOrder/orderCar.vue
@@ -26,7 +26,7 @@
                    <!-- 标题 -->
                    <view class="title">入库数量</view>
                    <view class="popup-item">
                        <uni-number-box :value="count" :step='0.000001' :max="9999999" color="#747474" @change="changeValue" />
                        <uni-number-box :value="count" :step="1" :decimal="2" :max="9999999" color="#747474" @change="changeValue" />
                    </view>
                    <view class="btn">
                        <view class="btn-left" @click="remove()">移除物料</view>
pages/phyz/comOrder/orderIn.vue
@@ -46,7 +46,7 @@
                    <!-- 标题 -->
                    <view class="title">入库数量</view>
                    <view class="popup-item">
                        <uni-number-box :value="count" :step='0.000001' :max="9999999" color="#747474" @change="changeValue" />
                        <uni-number-box :value="count" :step="1" :decimal="2" :max="9999999" color="#747474" @change="changeValue" />
                    </view>
                    <view class="btn">
                        <view class="btn-left" @click="addClose">取消</view>
pages/phyz/inStock/inStock.vue
@@ -2,8 +2,8 @@
    <view class="has-foot">
        <form>
            <view class="cu-form-group margin-top">
                <view class="title">容器编号</view>
                <input placeholder="请扫容器编号" v-model="barcode"></input>
                <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 margin-bottom">
pages/phyz/mat/matSelected.vue
@@ -32,7 +32,7 @@
            <view class="form-item">
                <view class="form-item-desc"><text>数量</text></view>
                <view class="form-item-content">
                    <uni-number-box :value="mat.count" :max="99999999" :step='0.000001' color="#747474" @change="changeValue" />
                    <uni-number-box :value="mat.count" :max="99999999" :step="1" :decimal="2" color="#747474" @change="changeValue" />
                </view>
            </view>
        </view>
pages/phyz/order/orderCar.vue
@@ -28,7 +28,7 @@
                    <view class="title">入库数量</view>
                    <view class="popup-item">
                        <!-- <view class="popup-item-left">入库数量:</view> -->
                        <view class="popup-item-right" style="border: none;"><uni-number-box :value="count" :step='0.000001' :max="9999999" color="#747474" @change="changeValue" /></view>
                        <view class="popup-item-right" style="border: none;"><uni-number-box :value="count" :step="1" :decimal="2" :max="9999999" color="#747474" @change="changeValue" /></view>
                        
                    </view>
                    <!-- <view class="popup-item">
pages/phyz/order/pakinOrderSelect.vue
@@ -48,7 +48,7 @@
                    <view class="title">入库数量</view>
                    <view class="popup-item">
                        <!-- <view class="popup-item-left">入库数量:</view> -->
                        <view class="popup-item-right" style="border: none;"><uni-number-box :value="count" :step='0.000001' :max="9999999" color="#747474" @change="changeValue" /></view>
                        <view class="popup-item-right" style="border: none;"><uni-number-box :value="count" :step="1" :decimal="2" :max="9999999" color="#747474" @change="changeValue" /></view>
                        
                    </view>
                    <!-- <view class="popup-item">
pages/phyz/order/pakinOrderSelectV2.vue
@@ -48,7 +48,7 @@
                    <view class="title">入库数量</view>
                    <view class="popup-item">
                        <!-- <view class="popup-item-left">入库数量:</view> -->
                        <view class="popup-item-right" style="border: none;"><uni-number-box :value="count" :step='0.000001' :max="9999999" color="#747474" @change="changeValue" /></view>
                        <view class="popup-item-right" style="border: none;"><uni-number-box :value="count" :step="1" :decimal="2" :max="9999999" color="#747474" @change="changeValue" /></view>
                        
                    </view>
                    <!-- <view class="popup-item">
pages/phyz/orderOut/orderCheck.vue
@@ -40,7 +40,7 @@
                    <view class="title">出库数量</view>
                    <view class="popup-item">
                        <view>
                            <uni-number-box :value="data.anfme" :step='0.000001' :min="0" :max="maxCount" color="#747474" @change="changeValue" />
                            <uni-number-box :value="data.anfme" :step="1" :decimal="2" :min="0" :max="maxCount" color="#747474" @change="changeValue" />
                        </view>
                        
                    </view>
pages/phyz/orderOut/orderCheck_2.vue
@@ -41,7 +41,7 @@
                    <view class="title">出库数量</view>
                    <view class="popup-item">
                        <view>
                            <uni-number-box :value="data.anfme" :step='0.000001' :min="0" :max="maxCount" color="#747474" @change="changeValue" />
                            <uni-number-box :value="data.anfme" :step="1" :decimal="2" :min="0" :max="maxCount" color="#747474" @change="changeValue" />
                        </view>
                        
                    </view>
pages/phyz/processOrder/orderCheck.vue
@@ -40,7 +40,7 @@
                    <view class="title">出库数量</view>
                    <view class="popup-item">
                        <view>
                            <uni-number-box :value="data.anfme" :step='0.000001' :min="0" :max="maxCount" color="#747474" @change="changeValue" />
                            <uni-number-box :value="data.anfme" :step="1" :decimal="2" :min="0" :max="maxCount" color="#747474" @change="changeValue" />
                        </view>
                        
                    </view>
pages/phyz/processOrder/orderCheck2.vue
@@ -12,7 +12,7 @@
                <view>工序:{{data.processSts$}}</view>
                <view>库存数量:{{count}}</view>
                <view class="detl-threeCode" style="display: flex;padding: 32rpx 0;align-items: center;font-size: 24px;">
                    <view>出库数量:{{data.anfme}}</view>
                    <view>出库数量:{{ $formatQty(data.anfme) }}</view>
                    <view style="margin-left: 50rpx;" @click="revise()">
                        <uni-icons type="compose" size="30" color="#fff"></uni-icons>
                    </view>
@@ -40,7 +40,7 @@
                    <view class="title">出库数量</view>
                    <view class="popup-item">
                        <view>
                            <uni-number-box :value="data.anfme" :step='0.000001' :min="0" :max="count" color="#747474" @change="changeValue" />
                            <uni-number-box :value="data.anfme" :step="1" :decimal="2" :min="0" :max="count" color="#747474" @change="changeValue" />
                        </view>
                        
                    </view>
pages/phyz/processOrder/processList.vue
@@ -16,7 +16,7 @@
                        <view>名称:{{orderDetl.maktx}}</view>
                        <view>库位状态:{{orderDetl.locSts$}}</view>
                        <view>工序:{{orderDetl.processSts$}}</view>
                        <view>库存数量:{{orderDetl.anfme}}</view>
                        <view>库存数量:{{ $formatQty(orderDetl.anfme) }}</view>
                    </view>
                    <view class="out-btn" @click="pakoutPrive(orderDetl)">
                        <view>出库</view>
pages/phyz/processOrder/processOrder.vue
@@ -18,9 +18,9 @@
                <view>编号:{{orderDetl.matnr}}</view>
                <view>名称:{{orderDetl.maktx}}</view>
                <view>类型:{{orderDetl.brand}}</view>
                <view>订单数量:{{orderDetl.anfme}}</view>
                <view>订单数量:{{ $formatQty(orderDetl.anfme) }}</view>
                <view>待加工:{{orderDetl.stock}}</view>
                <view>已加工:{{orderDetl.qty}}</view>
                <view>已加工:{{ $formatQty(orderDetl.qty) }}</view>
            </view>
            <view class="list-right" @click="goToLocDetl(orderDetl)">
                <uni-icons type="right" size="25"  color="#fff"></uni-icons>
pages/phyz/stationManage/confirmProcessed.vue
@@ -15,7 +15,7 @@
                        <!-- <view>库位状态:{{orderDetl.locSts$}}</view> -->
                        <view>源出库数量:{{orderDetl.maxCount}}</view>
                        <view class="detl-threeCode" style="display: flex;padding: 32rpx 0;align-items: center;font-size: 24px;">
                            <view>加工数量:{{orderDetl.anfme}}</view>
                            <view>加工数量:{{ $formatQty(orderDetl.anfme) }}</view>
                            <view style="margin-left: 50rpx;" @click="revise(orderDetl)">
                                <uni-icons type="compose" size="30" color="#fff"></uni-icons>
                            </view>
@@ -45,7 +45,7 @@
                    <view class="title">出库数量</view>
                    <view class="popup-item">
                        <view>
                            <uni-number-box :value="data.anfme" :step='0.000001' :min="0" :max="maxCount" color="#747474" @change="changeValue" />
                            <uni-number-box :value="data.anfme" :step="1" :decimal="2" :min="0" :max="maxCount" color="#747474" @change="changeValue" />
                        </view>
                        
                    </view>
pages/phyz/stationManage/pickAgain.vue
@@ -6,7 +6,7 @@
                <view>主单号:{{orderDetl.orderNo}}</view>
                <view>编号:{{orderDetl.matnr}}</view>
                <view>名称:{{orderDetl.maktx}}</view>
                <view>库存数量:{{orderDetl.anfme}}</view>
                <view>库存数量:{{ $formatQty(orderDetl.anfme) }}</view>
                <view>订单可出数量:{{orderDetl.stock}}</view>
                <view>已拣数量:{{orderDetl.pickedAnfme}}</view>
                <view>拣料数量:{{orderDetl.count}}</view>
@@ -25,7 +25,7 @@
                    <!-- 标题 -->
                    <view class="title">拣料数量</view>
                    <view class="popup-item">
                        <uni-number-box :value="count" :step='0.000001' :max="maxCount" color="#747474" @change="changeValue" />
                        <uni-number-box :value="count" :step="1" :decimal="2" :max="maxCount" color="#747474" @change="changeValue" />
                    </view>
                    <view class="btn">
                        <view class="btn-left" @click="addClose">取消</view>
pages/phyz/stationManage/stationDetl.vue
@@ -39,7 +39,7 @@
                <view>商品编码:{{wrkDetl.matnr}}</view>
                <view>销售订单号:{{wrkDetl.threeCode ? wrkDetl.threeCode : ' --'}}</view>
                <view>自由项:{{wrkDetl.deadTime ? wrkDetl.deadTime : ' --'}}</view>
                <view>作业数量:{{wrkDetl.anfme}}</view>
                <view>作业数量:{{ $formatQty(wrkDetl.anfme) }}</view>
            </view>
        </view>
        
@@ -54,7 +54,7 @@
                <view>销售订单号:{{waitPakin.threeCode ? waitPakin.threeCode : ' --'}}</view>
                <view>自由项:{{waitPakin.deadTime ? waitPakin.deadTime : ' --'}}</view>
                <view>状态:{{waitPakin.ioStatus$}}</view>
                <view>入库数量:{{waitPakin.anfme}}</view>
                <view>入库数量:{{ $formatQty(waitPakin.anfme) }}</view>
                
            </view>
        </view>
pages/phyz/stationManage/stationManage.vue
@@ -48,7 +48,7 @@
                <view>物料名称:{{wrkMast.maktx}}</view>
                <view>批号:{{wrkMast.batch}}</view>
                <view>规格:{{wrkMast.specs}}</view>
                <view>数量:{{wrkMast.anfme}}</view>
                <view>数量:{{ $formatQty(wrkMast.anfme) }}</view>
            </view>
        </view>
        
@@ -58,7 +58,7 @@
                <view>物料名称:{{wrkMast.maktx}}</view>
                <view>批号:{{wrkMast.batch}}</view>
                <view>规格:{{wrkMast.specs}}</view>
                <view>数量:{{wrkMast.anfme}}</view>
                <view>数量:{{ $formatQty(wrkMast.anfme) }}</view>
            </view>
        </view>
        
pages/phyz/waitOrder/waitOrderIn.vue
@@ -18,8 +18,8 @@
                <view>编号:{{orderDetl.matnr}}</view>
                <view>名称:{{orderDetl.maktx}}</view>
                <view>类型:{{orderDetl.brand}}</view>
                <view>总数量:{{orderDetl.anfme}}</view>
                <view>已入数量:{{orderDetl.qty}}</view>
                <view>总数量:{{ $formatQty(orderDetl.anfme) }}</view>
                <view>已入数量:{{ $formatQty(orderDetl.qty) }}</view>
            </view>
            <view class="list-right" @click="addItem(index)">
                <uni-icons type="folder-add" size="25"  color="#fff"></uni-icons>
@@ -46,7 +46,7 @@
                    <!-- 标题 -->
                    <view class="title">入库数量</view>
                    <view class="popup-item">
                        <uni-number-box :value="count" :step='0.000001' :max="9999999" color="#747474" @change="changeValue" />
                        <uni-number-box :value="count" :step="1" :decimal="2" :max="9999999" color="#747474" @change="changeValue" />
                    </view>
                    <view class="btn">
                        <view class="btn-left" @click="addClose">取消</view>
pages/phyz/waitOrder/waitOrderOut.vue
@@ -18,9 +18,9 @@
                <view>编号:{{orderDetl.matnr}}</view>
                <view>名称:{{orderDetl.maktx}}</view>
                <view>类型:{{orderDetl.brand}}</view>
                <view>订单数量:{{orderDetl.anfme}}</view>
                <view>订单数量:{{ $formatQty(orderDetl.anfme) }}</view>
                <view>库存数量:{{orderDetl.stock}}</view>
                <view>已出数量:{{orderDetl.qty}}</view>
                <view>已出数量:{{ $formatQty(orderDetl.qty) }}</view>
            </view>
            <view class="list-right" @click="goToLocDetl(orderDetl)">
                <uni-icons type="right" size="25"  color="#fff"></uni-icons>
pages/phyz/wrkMast/DBList.vue
@@ -39,7 +39,7 @@
                    <!-- 标题 -->
                    <view class="title">入库数量</view>
                    <view class="popup-item">
                        <uni-number-box :value="count" :step='0.000001' :max="9999999" color="#747474" @change="changeValue" />
                        <uni-number-box :value="count" :step="1" :decimal="2" :max="9999999" color="#747474" @change="changeValue" />
                    </view>
                    <view class="btn">
                        <view class="btn-left" @click="addClose">取消</view>
pages/phyz/wrkMast/waitPakin.vue
@@ -17,7 +17,7 @@
                <view>商品编码:{{item.matnr}}</view>
                <view>商品名称:{{item.maktx}}</view>
                <view>单据编号:{{item.orderNo}}</view>
                <view>数量:{{item.anfme}}</view>
                <view>数量:{{ $formatQty(item.anfme) }}</view>
                <!-- <view class="card-id">{{i + 1}}</view> -->
                <view class="card-status-1" v-if="item.ioStatus == 'N'">待入库</view>
                <view class="card-status-2" v-if="item.ioStatus == 'Y'">入库中</view>
pages/phyz/wrkMast/wrkDetl.vue
@@ -11,9 +11,9 @@
                <view>名称:{{item.maktx}}</view>
                <view>规格:{{item.specs}}</view>
                <view>批号:{{item.batch}}</view>
                <view class="list-anfme">数量:{{item.anfme}}</view>
                <view class="list-qty-1" v-if="item.anfme > item.qty">作业数量:{{item.qty}}</view>
                <view class="list-qty-2" v-if="item.anfme <= item.qty">作业数量:{{item.qty}}</view>
                <view class="list-anfme">数量:{{ $formatQty(item.anfme) }}</view>
                <view class="list-qty-1" v-if="item.anfme > item.qty">作业数量:{{ $formatQty(item.qty) }}</view>
                <view class="list-qty-2" v-if="item.anfme <= item.qty">作业数量:{{ $formatQty(item.qty) }}</view>
            </view>
        </view>
        <view style="height: 100rpx;"></view>
pages/phyz/wrkMast/wrkMast.vue
@@ -38,7 +38,7 @@
                    <!-- 标题 -->
                    <view class="title">入库数量</view>
                    <view class="popup-item">
                        <uni-number-box :value="count" :step='0.000001' :max="9999999" color="#747474" @change="changeValue" />
                        <uni-number-box :value="count" :step="1" :decimal="2" :max="9999999" color="#747474" @change="changeValue" />
                    </view>
                    <view class="btn">
                        <view class="btn-left" @click="addClose">取消</view>
pages/rece/other.vue
@@ -84,11 +84,11 @@
                    </view>
                    <view class="cu-item">
                        <view class="content">
                            <text class="black">计划收货数量:<text class="text-grey ">{{item.anfme}}</text></text>
                            <text class="black">计划收货数量:<text class="text-grey ">{{ $formatQty(item.anfme) }}</text></text>
                        </view>
                        <view class="content">
                            <text class="black">已收货数量:<text class="text-grey ">{{item.qty}}</text></text>
                            <text class="black">已收货数量:<text class="text-grey ">{{ $formatQty(item.qty) }}</text></text>
                        </view>
                    </view>
                    <view class="cu-item">
@@ -97,7 +97,7 @@
                                <view class="title text-blue"><text
                                        class="text-red text-xl vertical-middle">*</text>收货数量:</view>
                                <uni-number-box style="width: 70%;" :max="max" v-model="item.receiptQty"
                                    :step='1'></uni-number-box>
                                    :step="1" :decimal="2"></uni-number-box>
                            </view>
                        </view>
                        <view class="content" v-else>
pages/rece/standard.vue
@@ -1,340 +1,340 @@
<template>
    <view class="has-foot">
        <form>
            <view class="cu-form-group" v-show="!isconfirm">
                <view class="title">物料标签</view>
                <input placeholder="请扫描物料标签" v-model="barcode" @input="search()" focus></input>
                <text class='cuIcon-close text-gray margin-right-xs' v-show="barcode!==''" @click="clearCode"></text>
                <text class='cuIcon-search text-blue' @click="search"></text>
            </view>
        </form>
        <view class="cu-list det menu sm-border  padding">
            <block v-for="(item, index) in list" :key="index">
                <view class="cu-bar bg-white solid-bottom margin-top-sm">
                    <view class="action">
                        <view class="index">
                            {{index+1}}
                        </view>
                        <view class="text-blue">
                            {{`${item.maktx}`}}
                        </view>
                    </view>
                    <view class="action" v-if="!isconfirm">
                        <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">ASN:</text>
                    </view>
                    <view class="action">
                        <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.splrBatch}}</text>
                    </view>
                </view> -->
                <view class="cu-item">
                    <view class="content">
                        <text class="text-black">最大库存: <text class="text-grey ">{{item.maxQty}}</text></text>
                    </view>
                    <view class="content">
                        <text class="text-black">实时库存: <text class="text-grey ">{{item.stockQty}}</text></text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-black">平台行号: <text class="text-grey ">{{item.platformId}}</text></text>
                    </view>
                    <view class="content">
                        <text class="text-black">质检结果: <text class="text-grey ">{{item.inspect}}</text></text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-black">采购单位:<text class="text-grey ">{{item.purUnit}}</text></text>
                    </view>
                    <view class="content">
                        <text class="text-black">库存单位: <text class="text-grey ">{{item.stockUnit}}</text></text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-blue">计划收货数量:<text class="text-grey ">{{item.anfme}}</text></text>
                    </view>
                    <view class="content">
                        <text class="text-black">已收数量:<text class="text-grey ">{{item.qty}}</text></text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content" v-if="!isconfirm">
                        <view class="cu-form-group padding-lr-0">
                            <view class="title text-blue">收货数量:</view>
                            <uni-number-box style="width: 70%;" :max="max" v-model="item.receiptQty" :step='1'></uni-number-box>
                        </view>
                    </view>
                    <view class="content" v-else>
                        <text class="text-black">收货数量:<text class="text-grey ">{{item.receiptQty}}</text></text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content" v-if="!isconfirm">
                        <view class="cu-form-group padding-lr-0">
                            <view class="title text-blue">供应商批次:</view>
                            <input type="number" placeholder="请输入供应商批次" v-model="item.splrBatch"></input>
                        </view>
                    </view>
                    <view class="content" v-else>
                        <text class="text-black">供应商批次:<text class="text-grey ">{{item.splrBatch}}</text></text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content" v-if="!isconfirm">
                        <view class="cu-form-group padding-lr-0">
                            <view class="title text-blue">生产日期:</view>
                            <picker mode="date" v-model="item.prodTime" @change="DateChange($event,item)"
                                placeholder="请输入生产日期">
                                <view class="picker text-left">
                                    {{item.prodTime|| '请选择日期'}}
                                </view>
                            </picker>
                        </view>
                    </view>
                    <view class="content" v-else>
                        <text class="text-black">生产日期:<text class="text-grey ">{{item.prodTime}}</text></text>
                    </view>
                </view>
                <view class="cu-item grid  col-1" v-if="!isconfirm">
                    <view v-for="el in dynamicFields" :key="el.id">
                        <view class="cu-form-group padding-lr-0">
                            <view class="title text-blue">{{el.fieldsAlise}}:</view>
                            <input :placeholder='`请输入${el.fieldsAlise}`' v-model="item[el.fields]"></input>
                        </view>
                    </view>
                </view>
                <view class="cu-item grid  col-2" v-if="isconfirm">
                    <view class="item" v-for="el in dynamicFields" :key="el.id">
                        <text class="text-black">{{el.fieldsAlise}}:
                            <text class="text-grey ">{{item[el.fields]}}</text></text>
                    </view>
                </view>
            </block>
        </view>
        <view class="text-blue text-right padding-lr" v-show="isconfirm">
            本次收货总数量:{{allCount}}
        </view>
        <view class="cu-form-group " v-show="isconfirm">
            <view class="title">收货区</view>
            <uni-data-select v-model="whAreaId" :localdata="range" placement="top"
                @change="selChange"></uni-data-select>
        </view>
        <view class="cu-bar btn-group foot" v-show="!isconfirm">
            <button class="cu-btn text-blue line-blue shadow" @click="clear">清空</button>
            <button class="cu-btn bg-blue shadow-blur" @click="next">下一步</button>
        </view>
        <view class="cu-bar btn-group foot" v-show="isconfirm">
            <button class="cu-btn text-blue line-blue shadow" @click="prev">上一步</button>
            <button class="cu-btn bg-blue shadow-blur" :disabled="repeatClick" @click="confirm">提交收货</button>
        </view>
    </view>
</template>
<script>
    import {
        request
    } from '../../common/request.js'
    import {
        mapState,
        mapMutations,
        mapActions,
        mapGetters
    } from 'vuex';
    export default {
        data() {
            return {
                barcode: '',
                whAreaId: '',
                list: [],
                range: [],
                isconfirm: false,
                repeatClick: false,
                max: 99999999
            }
        },
        computed: {
            ...mapState('user', ['dynamicFields']),
            allCount() {
                return this.list.reduce((acc, row) => +row.receiptQty + acc, 0)
            }
        },
        mounted() {
            this.getRece()
        },
        methods: {
            async search() {
                const {
                    code,
                    data,
                    msg
                } = await request('/orders/' + this.barcode, {}, "get")
                if (code === 200) {
                    if (Object.keys(data).length === 0) {
                        uni.showToast({
                            title: "该标签未查询到数据",
                            icon: "none",
                            position: 'top'
                        })
                    }
                    this.list.push(...data)
                } else if (code == 401) {
                    setTimeout(() => {
                        uni.removeStorageSync('token');
                        uni.reLaunch({
                            url: "/pages/login/login"
                        });
                    }, 1000);
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                        position: 'top'
                    })
                }
            },
            clearCode() {
                this.barcode = ''
            },
            remove(index) {
                this.list.splice(index, 1);
            },
            clear() {
                this.list = []
                this.barcode = ''
            },
            next() {
                if (this.list.length) {
                    this.isconfirm = true
                } else {
                    uni.showToast({
                        icon: "none",
                        title: '未选物料标签'
                    })
                }
            },
            prev() {
                this.isconfirm = false
            },
            selChange(val) {
                uni.setStorageSync('whAreaId', val)
            },
            async confirm() {
                const newArr = this.list.map(item => {
                    return {
                        ...item,
                        receiptQty: item.receiptQty === null ? 0 : +item.receiptQty
                    };
                });
                if (this.whAreaId === '') {
                    uni.showToast({
                        icon: "none",
                        title: '请选择收货区'
                    })
                } else {
                    this.repeatClick = true
                    const {
                        code,
                        data,
                        msg
                    } = await request('/orders/confirm', {
                        receipts: newArr,
                        whAreaId: this.whAreaId
                    })
                    if (code === 200) {
                        uni.showToast({
                            title: '收货成功'
                        })
                        this.list = []
                        this.barcode = ''
                        this.isconfirm = false
                    } else {
                        uni.showToast({
                            title: msg,
                            icon: "none",
                            position: 'top'
                        })
                    }
                    this.repeatClick = false
                }
            },
            async getRece() {
                const {
                    code,
                    data,
                    msg
                } = await request('/areas/receipt', {}, 'get')
                if (code === 200) {
                    this.range = data.map(item => ({
                        value: item.id,
                        text: item.name
                    }));
                }
            },
            DateChange(e, item) {
                item.prodTime = e.detail.value
            }
        }
    }
</script>
<style>
    .index {
        border: 1px solid #e54d42;
        color: #e54d42;
        border-radius: 50%;
        display: block;
        width: 50rpx;
        height: 50rpx;
        line-height: 48rpx;
        text-align: center;
        margin-right: 20rpx;
        font-size: 30rpx;
    }
    .text-blue {
        color: #0081ff !important;
    }
    .item {
        position: relative;
        display: flex;
        min-height: 80upx;
        align-items: center;
    }
<template>
    <view class="has-foot">
        <form>
            <view class="cu-form-group" v-show="!isconfirm">
                <view class="title">物料标签</view>
                <input placeholder="请扫描物料标签" v-model="barcode" @input="search()" focus></input>
                <text class='cuIcon-close text-gray margin-right-xs' v-show="barcode!==''" @click="clearCode"></text>
                <text class='cuIcon-search text-blue' @click="search"></text>
            </view>
        </form>
        <view class="cu-list det menu sm-border  padding">
            <block v-for="(item, index) in list" :key="index">
                <view class="cu-bar bg-white solid-bottom margin-top-sm">
                    <view class="action">
                        <view class="index">
                            {{index+1}}
                        </view>
                        <view class="text-blue">
                            {{`${item.maktx}`}}
                        </view>
                    </view>
                    <view class="action" v-if="!isconfirm">
                        <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">ASN:</text>
                    </view>
                    <view class="action">
                        <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.splrBatch}}</text>
                    </view>
                </view> -->
                <view class="cu-item">
                    <view class="content">
                        <text class="text-black">最大库存: <text class="text-grey ">{{item.maxQty}}</text></text>
                    </view>
                    <view class="content">
                        <text class="text-black">实时库存: <text class="text-grey ">{{item.stockQty}}</text></text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-black">平台行号: <text class="text-grey ">{{item.platformId}}</text></text>
                    </view>
                    <view class="content">
                        <text class="text-black">质检结果: <text class="text-grey ">{{item.inspect}}</text></text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-black">采购单位:<text class="text-grey ">{{item.purUnit}}</text></text>
                    </view>
                    <view class="content">
                        <text class="text-black">库存单位: <text class="text-grey ">{{item.stockUnit}}</text></text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content">
                        <text class="text-blue">计划收货数量:<text class="text-grey ">{{item.anfme}}</text></text>
                    </view>
                    <view class="content">
                        <text class="text-black">已收数量:<text class="text-grey ">{{item.qty}}</text></text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content" v-if="!isconfirm">
                        <view class="cu-form-group padding-lr-0">
                            <view class="title text-blue">收货数量:</view>
                            <uni-number-box style="width: 70%;" :max="max" v-model="item.receiptQty" :step="1" :decimal="2"></uni-number-box>
                        </view>
                    </view>
                    <view class="content" v-else>
                        <text class="text-black">收货数量:<text class="text-grey ">{{item.receiptQty}}</text></text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content" v-if="!isconfirm">
                        <view class="cu-form-group padding-lr-0">
                            <view class="title text-blue">供应商批次:</view>
                            <input type="number" placeholder="请输入供应商批次" v-model="item.splrBatch"></input>
                        </view>
                    </view>
                    <view class="content" v-else>
                        <text class="text-black">供应商批次:<text class="text-grey ">{{item.splrBatch}}</text></text>
                    </view>
                </view>
                <view class="cu-item">
                    <view class="content" v-if="!isconfirm">
                        <view class="cu-form-group padding-lr-0">
                            <view class="title text-blue">生产日期:</view>
                            <picker mode="date" v-model="item.prodTime" @change="DateChange($event,item)"
                                placeholder="请输入生产日期">
                                <view class="picker text-left">
                                    {{item.prodTime|| '请选择日期'}}
                                </view>
                            </picker>
                        </view>
                    </view>
                    <view class="content" v-else>
                        <text class="text-black">生产日期:<text class="text-grey ">{{item.prodTime}}</text></text>
                    </view>
                </view>
                <view class="cu-item grid  col-1" v-if="!isconfirm">
                    <view v-for="el in dynamicFields" :key="el.id">
                        <view class="cu-form-group padding-lr-0">
                            <view class="title text-blue">{{el.fieldsAlise}}:</view>
                            <input :placeholder='`请输入${el.fieldsAlise}`' v-model="item[el.fields]"></input>
                        </view>
                    </view>
                </view>
                <view class="cu-item grid  col-2" v-if="isconfirm">
                    <view class="item" v-for="el in dynamicFields" :key="el.id">
                        <text class="text-black">{{el.fieldsAlise}}:
                            <text class="text-grey ">{{item[el.fields]}}</text></text>
                    </view>
                </view>
            </block>
        </view>
        <view class="text-blue text-right padding-lr" v-show="isconfirm">
            本次收货总数量:{{allCount}}
        </view>
        <view class="cu-form-group " v-show="isconfirm">
            <view class="title">收货区</view>
            <uni-data-select v-model="whAreaId" :localdata="range" placement="top"
                @change="selChange"></uni-data-select>
        </view>
        <view class="cu-bar btn-group foot" v-show="!isconfirm">
            <button class="cu-btn text-blue line-blue shadow" @click="clear">清空</button>
            <button class="cu-btn bg-blue shadow-blur" @click="next">下一步</button>
        </view>
        <view class="cu-bar btn-group foot" v-show="isconfirm">
            <button class="cu-btn text-blue line-blue shadow" @click="prev">上一步</button>
            <button class="cu-btn bg-blue shadow-blur" :disabled="repeatClick" @click="confirm">提交收货</button>
        </view>
    </view>
</template>
<script>
    import {
        request
    } from '../../common/request.js'
    import {
        mapState,
        mapMutations,
        mapActions,
        mapGetters
    } from 'vuex';
    export default {
        data() {
            return {
                barcode: '',
                whAreaId: '',
                list: [],
                range: [],
                isconfirm: false,
                repeatClick: false,
                max: 99999999
            }
        },
        computed: {
            ...mapState('user', ['dynamicFields']),
            allCount() {
                return this.list.reduce((acc, row) => +row.receiptQty + acc, 0)
            }
        },
        mounted() {
            this.getRece()
        },
        methods: {
            async search() {
                const {
                    code,
                    data,
                    msg
                } = await request('/orders/' + this.barcode, {}, "get")
                if (code === 200) {
                    if (Object.keys(data).length === 0) {
                        uni.showToast({
                            title: "该标签未查询到数据",
                            icon: "none",
                            position: 'top'
                        })
                    }
                    this.list.push(...data)
                } else if (code == 401) {
                    setTimeout(() => {
                        uni.removeStorageSync('token');
                        uni.reLaunch({
                            url: "/pages/login/login"
                        });
                    }, 1000);
                } else {
                    uni.showToast({
                        title: msg,
                        icon: "none",
                        position: 'top'
                    })
                }
            },
            clearCode() {
                this.barcode = ''
            },
            remove(index) {
                this.list.splice(index, 1);
            },
            clear() {
                this.list = []
                this.barcode = ''
            },
            next() {
                if (this.list.length) {
                    this.isconfirm = true
                } else {
                    uni.showToast({
                        icon: "none",
                        title: '未选物料标签'
                    })
                }
            },
            prev() {
                this.isconfirm = false
            },
            selChange(val) {
                uni.setStorageSync('whAreaId', val)
            },
            async confirm() {
                const newArr = this.list.map(item => {
                    return {
                        ...item,
                        receiptQty: item.receiptQty === null ? 0 : +item.receiptQty
                    };
                });
                if (this.whAreaId === '') {
                    uni.showToast({
                        icon: "none",
                        title: '请选择收货区'
                    })
                } else {
                    this.repeatClick = true
                    const {
                        code,
                        data,
                        msg
                    } = await request('/orders/confirm', {
                        receipts: newArr,
                        whAreaId: this.whAreaId
                    })
                    if (code === 200) {
                        uni.showToast({
                            title: '收货成功'
                        })
                        this.list = []
                        this.barcode = ''
                        this.isconfirm = false
                    } else {
                        uni.showToast({
                            title: msg,
                            icon: "none",
                            position: 'top'
                        })
                    }
                    this.repeatClick = false
                }
            },
            async getRece() {
                const {
                    code,
                    data,
                    msg
                } = await request('/areas/receipt', {}, 'get')
                if (code === 200) {
                    this.range = data.map(item => ({
                        value: item.id,
                        text: item.name
                    }));
                }
            },
            DateChange(e, item) {
                item.prodTime = e.detail.value
            }
        }
    }
</script>
<style>
    .index {
        border: 1px solid #e54d42;
        color: #e54d42;
        border-radius: 50%;
        display: block;
        width: 50rpx;
        height: 50rpx;
        line-height: 48rpx;
        text-align: center;
        margin-right: 20rpx;
        font-size: 30rpx;
    }
    .text-blue {
        color: #0081ff !important;
    }
    .item {
        position: relative;
        display: flex;
        min-height: 80upx;
        align-items: center;
    }
</style>