|   | 
| <template> | 
|     <view class="overflow"  style="padding-bottom:100px"> | 
|         <!-- 顶部 --> | 
|         <cu-custom bgColor="bg-white" :isBack="true"> | 
|             <block slot="backText"></block> | 
|             <block slot="content"> | 
|                 <text v-if="totalPages"> ({{pageNow}}页/共{{totalPages}}页/{{totalTs}}条) </text>     | 
|                 越库 | 
|             </block> | 
|         </cu-custom> | 
|         <!-- 操作人 --> | 
|         <view class="flex justify-end align-center padding_right30rpx padding_top12rpx"> | 
|             <text class="fontSize12rpx" v-if="pramWl"> {{pramWl}} </text> | 
|         </view> | 
|         <!-- 遮挡层 --> | 
|         <modal-code ref="resmodal" :rescode='rescode' :resmessage='resmessage' /> | 
|         <!-- 越库 --> | 
|         <view class="" v-if="renameFocus"> | 
|             <u-form labelPosition="top" :model="warehouse" ref="warehouseRef"> | 
|                 <u-row class="border_bottom margin_top10rpx padding10" style="background-color: #fff;"> | 
|                     <u-col span="10"> | 
|                         <u-form-item label="物料编号:"  style="font-size: 16px;font-weight: bold;padding: 0 0 10rpx;"> | 
|                             <u-input v-model.trim="warehouse.WareMaterialCode" placeholder="请录入或扫码" | 
|                             class="width padding_left25rpx" | 
|                             @confirm="materialBlur(1,2)" > | 
|                             </u-input> | 
|                         </u-form-item> | 
|                     </u-col> | 
|                     <!-- <u-col span="2"> | 
|                         <u-icon class="iconfont icon-saoma fontSize60rpx" ></u-icon>  | 
|                     </u-col> --> | 
|                 </u-row> | 
|                  | 
|             </u-form> | 
|             <view style="margin-bottom: 180rpx;" v-show="singlist.length > 0"> | 
|                 <view v-for="(item, eindex) in singlist" :key="eindex" class="title-wrap"> | 
|                     <u-swipe-action :show="item.show" :index="eindex" @click="longpredel" @open="open" @close='close' :options="options"> | 
|                         <view class=" fontSize32rpx background_fff" :class="parseFloat(item.uncollectedQuantity) > 0 ? 'bg_item' : '' " style="width: 100vw;"> | 
|                             <u-row> | 
|                                 <u-col span="12" class="flex" style="align-items: flex-start;"> | 
|                                     <view style="background-color: #f18202;color: #fff;border-radius: 50%;width: 20px;height: 20px;line-height: 20px;text-align: center;"> | 
|                                         {{eindex+1}} | 
|                                     </view> | 
|                                     <view class="color_f18202 padding_left10rpx" style="flex: 1;word-break: break-all;"> | 
|                                         {{item.wareMaterialCode}}  | 
|                                         <!-- -- 是否检验:  <text style="color: #000;font-weight: bold;">{{item.isCheck ? '是' : '否'}}</text> --> | 
|                                     </view> | 
|                                     <view> | 
|                                         <text @click.prevent.stop="showDetail(item,eindex)" class="detail_btn">查看越库</text> | 
|                                     </view> | 
|                                 </u-col> | 
|                             </u-row> | 
|                             <u-row> | 
|                                 <u-col span="6"> | 
|                                     <view class="" style="padding: 5px 0 0px 10px;color: #808080;"> | 
|                                         是否可越库:{{item.isYueku}} | 
|                                     </view> | 
|                                 </u-col> | 
|                                 <u-col span="6"> | 
|                                     <view class="" style="padding: 5px 0 0px 10px;color: #808080;"> | 
|                                         数量:{{item.quantity}} | 
|                                     </view> | 
|                                     </u-col> | 
|                             </u-row> | 
|                             <u-row> | 
|                                 <u-col span="10"> | 
|                                     <view class="flex" style="padding: 5px 0 0px 10px;color: #808080;"> | 
|                                         <span style="width: 55px">批次:</span>     | 
|                                         <input | 
|                                             class="width text-left boxIput" | 
|                                             v-model="item.barNo"    :class="!item.isBatchMge?'':'border_bottom_f18202'"  :disabled="!item.isBatchMge" type="text" placeholder="请输入批次" />     | 
|                                     </view> | 
|                                 </u-col> | 
|                             </u-row> | 
|                         </view> | 
|                     </u-swipe-action> | 
|   | 
|                     <view class="background_fff qhd_wp"  v-show="item.childen" v-for="(itemIn, eindexIn) in item.SortingOrderDetailsList" :key="eindexIn"> | 
|                         <u-row> | 
|                             <u-col span="12"> | 
|                                 <view class="" style="padding: 5px 0 0px 10px;color: #808080;"> | 
|                                     取货波次号:{{ itemIn.orderNo }} | 
|                                 </view> | 
|                                 <view class="detailBtn" @click.stop="showdetailProp(item,itemIn)">打印详情</view> | 
|                             </u-col> | 
|                         <!--     <u-col span="12"> | 
|                                 <view class="" style="padding: 5px 0 0px 10px;color: #808080;"> | 
|                                     单号:{{ itemIn.deliveryNo }} | 
|                                 </view> | 
|                             </u-col> --> | 
|                         </u-row> | 
|                         <u-row> | 
|                             <u-col span="6"> | 
|                                 <view class="" style="padding: 5px 0 0px 10px;color: #808080;"> | 
|                                     单号:{{ itemIn.deliveryNo }} | 
|                                 </view> | 
|                             </u-col> | 
|                             <u-col span="6"> | 
|                                 <view class="text-right" style="padding: 5px 0 0px 10px;color: #808080;"> | 
|                                     批次号:{{ itemIn.batchNo }} | 
|                                 </view> | 
|                             </u-col> | 
|                         </u-row> | 
|                         <u-row> | 
|                             <u-col span="6"> | 
|                                 <view class="" style="padding: 5px 0 0px 10px;color: #808080;"> | 
|                                     工序:{{ itemIn.process }} | 
|                                 </view> | 
|                             </u-col> | 
|                             <u-col span="6"> | 
|                                 <view class="text-right" style="padding: 5px 0 0px 10px;color: #808080;"> | 
|                                     机床号:{{ itemIn.equipment }} | 
|                                 </view> | 
|                             </u-col> | 
|                         </u-row> | 
|                         <u-row> | 
|                             <u-col span="6"> | 
|                                 <view class="" style="padding: 5px 0 0px 10px;color: #808080;"> | 
|                                     缺料数量:{{ itemIn.quantity }} | 
|                                 </view> | 
|                             </u-col>     | 
|                             <u-col span="6"> | 
|                                 <input | 
|                                     class="border_bottom_f18202 width text-left fontSize32rpx padding_left10rpx" | 
|                                     v-model.trim="itemIn.uncollectedQuantity" type="number" | 
|                                     @blur="changeNumIn(itemIn,item)"  placeholder="请输入越库数量" /> | 
|                             </u-col> | 
|                         </u-row> | 
|                     </view> | 
|                 </view> | 
|   | 
|                 <view v-if="singlist.length <= 0" style="text-align: center">---无数据---</view> | 
|   | 
|             </view> | 
|             <u-popup v-model="detailshow" border-radius="14" @close="detailshow=false" mode="bottom"> | 
|                 <!-- <view class="pop "> --> | 
|                 <h2 class="text_align_center padding_bottom18 padding15">物料信息</h2> | 
|                 <!-- <view class="line flex justify-between"> | 
|                     <text class="text-gray">打印张数</text> | 
|                     <text> | 
|                         <u-input v-model.trim="contLabel"   placeholder="请输入打印张数" | 
|                                  class="width" | 
|                                  @focus="contLabel=''" | 
|                                 style="font-size: 36rpx;text-align: right;"> | 
|                             </u-input> | 
|                     </text> | 
|                 </view> | 
|                 <view class="line flex justify-between"> | 
|                     <text class="text-gray">打印越库数量</text> | 
|                     <text> | 
|                         <u-input v-model.trim="ermNum"   placeholder="请输入打印越库数量" | 
|                                  class="width" | 
|                                  @focus="ermNum=''" | 
|                                 style="font-size: 36rpx;text-align: right;"> | 
|                             </u-input> | 
|                     </text> | 
|                 </view> --> | 
|                 <view class="line flex justify-between"> | 
|                     <text class="text-gray">本次越库数量</text> | 
|                     <text>{{materlist.uncollectedQuantity}}</text> | 
|                 </view> | 
|                 <view class="line flex justify-between"> | 
|                     <text class="text-gray">物料编号</text> | 
|                     <text>{{materlist.wareMaterialCode}}</text> | 
|                 </view> | 
|                 <view class="line flex justify-between"> | 
|                     <text class="text-gray">发货单号</text> | 
|                     <text>{{materlist.deliveryNo}}</text> | 
|                 </view> | 
|                 <view class="line flex justify-between"> | 
|                     <text class="text-gray">批次</text> | 
|                     <text>{{materlist.barNo}}</text> | 
|                 </view> | 
|                 <view class="line flex justify-between"> | 
|                     <text class="text-gray">行号</text> | 
|                     <text>{{materlist.lineNumber}}</text> | 
|                 </view> | 
|   | 
|                 <view class="margin_top140rpx"> | 
|                     <button-modal :cleaningShow='true' allTitle='蓝牙打印' cleaningTitle='斑马打印' @allsubmit="init(1)" @submit='init(2)'/> | 
|                 </view> | 
|             </u-popup> | 
|             <button-modal :empTytowerShow='true' cleaningTitle="重置" garmenTitle='下一步' @submit='next' @reset='rest' /> | 
|         </view> | 
|   | 
|         <view v-if="totalPages&&pageNow==totalPages&&renameFocus" style="text-align: center">---已经到底了---</view> | 
|   | 
|         <!-- 确认越库 --> | 
|         <view v-if="!renameFocus"> | 
|             <scroll-view scroll-y="true" style="height: calc(100vh - 200px);"> | 
|                 <view v-if="current==0" v-for="(item,eindex) in lastlist" :key="eindex" style="background-color: #fff;margin-top: 6rpx;" class="title-wrap"> | 
|                     <u-row class="padding15" v-if="item.total>0"> | 
|                         <u-col span="12" class="flex" style="align-items: flex-start;"> | 
|                             <view style="background-color: #f18202;color: #fff;border-radius: 50%;width: 20px;height: 20px;line-height: 20px;text-align: center;"> | 
|                                 {{eindex+1}} | 
|                             </view> | 
|                             <view class="color_f18202 padding_left10rpx" style="flex: 1;word-break: break-all;"> | 
|                                 {{item.wareMaterialCode}}  -- {{item.barNo}}  | 
|                             </view> | 
|                         </u-col> | 
|                     </u-row> | 
|                     <!-- 取货单列表 --> | 
|                     <view class="background_fff qhd_wp"  v-show="item.SortingOrderDetailsList.length>0&&itemIn.uncollectedQuantity>0" v-for="(itemIn, eindexIn) in item.SortingOrderDetailsList" :key="eindexIn"> | 
|                         <u-row> | 
|                             <u-col span="12"> | 
|                                 <view class="color_80"> | 
|                                     取货波次号:{{ itemIn.orderNo }} | 
|                                 </view> | 
|                             </u-col> | 
|                         </u-row> | 
|                         <u-row> | 
|                             <u-col span="12"> | 
|                                 <view class="color_80"> | 
|                                     单号:{{ itemIn.deliveryNo }} | 
|                                 </view> | 
|                             </u-col>     | 
|                         </u-row> | 
|                         <u-row> | 
|                             <u-col span="6"> | 
|                                 <view class="color_80" > | 
|                                     工序:{{ itemIn.process }} | 
|                                 </view> | 
|                             </u-col>     | 
|                             <u-col span="6" class="color_80 text-right" > | 
|                                 机床号:{{ itemIn.equipment }} | 
|                             </u-col> | 
|                         </u-row> | 
|                         <u-row> | 
|                             <u-col span="6"> | 
|                                 <view class="color_80"> | 
|                                     缺料数量:{{ itemIn.quantity }} | 
|                                 </view> | 
|                             </u-col>     | 
|                             <u-col span="6" class="color_f18202 text-right"> | 
|                                 本次越库数量:{{itemIn.uncollectedQuantity  }} | 
|                             </u-col> | 
|                         </u-row> | 
|                     </view> | 
|   | 
|                 </view> | 
|      | 
|                 <!-- </view> --> | 
|             </scroll-view> | 
|             <view class="fontSize32rpx "> | 
|                 <u-row class='padding15 background_fff' style='margin-bottom: 6rpx;'> | 
|                     <u-col span="12" class="font_weight_bold color_f18202" style="text-align: right;"> | 
|                         本次越库数: {{uncollectedTotal}} | 
|                     </u-col> | 
|                 </u-row> | 
|             </view> | 
|             <button-modal :empTytowerShow='true' cleaningTitle="上一步" garmenTitle='越库完成' @submit='submit' | 
|                 @reset='reset(1)' /> | 
|         </view> | 
|         <u-action-sheet :list="wolist2" v-model="modalshow2" @click="confirm2"></u-action-sheet> | 
|     </view> | 
| </template> | 
|   | 
| <script> | 
|     import ButtonModal from '@/components/buttonModal.vue' | 
|     import ModalCode from '@/components/ModalCode.vue' | 
|     import tkiBarcode from '@/components/tki-barcode/tki-barcode' | 
|     import bluet from '@/components/blue.vue' | 
|     import {getMoveWarehouseGroup,addconfirmMove,getMoveOrderDetail,getSapSelect} from '@/api/takeMaterial/orderpiece.js' | 
|     import {translateapp} from '@/utils/compress.js' | 
|     import {deletePicture} from '@/api/deliver.js' | 
|     import printComp from '@/mixins/printLabelSingle.js' | 
|     import printShengChanComp from '@/mixins/printShengChanLabel.js' | 
|     import printBanma from '@/mixins/printBanma.js' | 
|     import {getAttrValue} from '../../utils/tool.js' | 
|   | 
|     export default { | 
|         mixins: [printComp,printBanma,printShengChanComp], | 
|         data() { | 
|             return { | 
|                 materialCode: '', //物料编号 | 
|                 renameFocus: true, | 
|                 detailshow: false, | 
|                 rescode: 0, | 
|                 autoFoucs:true, | 
|                 resmessage: "", | 
|                 current: 0, //滑块默认值 | 
|                 fileList: [], | 
|                 lastlist: [], | 
|                 overlist: [], //越库列表 | 
|                 lacklist: [], //缺料列表 | 
|                 image: '', //当前显示的图片地址 | 
|                 action: this.$myHOST + '/sysFileInfo/uploadImages', | 
|                 singlist: [ | 
|                  | 
|                 ], //物料详情 | 
|                 lists: [{ | 
|                     name: '越库(0)' | 
|                 }, { | 
|                     name: '缺料' | 
|                 }], | 
|                 list: [], | 
|                 arr: [], | 
|                 materlist: {}, //物料详情数据 | 
|                 warehouse: { | 
|                     PurchaseNo: '', | 
|                     WareMaterialCode:'',//物料编码 | 
|                     PageSize: 10000, | 
|                     PageNo: 1 | 
|                 }, | 
|                 warehouseRules: { | 
|                     PurchaseNo: [{ | 
|                         required: true, | 
|                         message: '单号不能为空', | 
|                         trigger: 'blur' | 
|                     }] | 
|                 }, | 
|                 options: [ | 
|                     // { | 
|                     //     text: '详情', | 
|                     //     style: { | 
|                     //         backgroundColor: '#fc9f35' | 
|                     //     } | 
|                     // }, | 
|                     { | 
|                         text: '删除', | 
|                         style: { | 
|                             backgroundColor: '#fc4b4b' | 
|                         } | 
|                     } | 
|                 ], | 
|                 operator: '', | 
|                 QuantityTotal: 0, //送货总数 | 
|                 collectedTotal: 0, //已越库数 | 
|                 uncollectedTotal: 0, //越库总数 | 
|                 lackTotal: 0, //缺货总数 | 
|                 code: '', | 
|                 addForm: { //打印记录 | 
|                     code: '', | 
|                     name: '', | 
|                     batchNo: '', | 
|                     specificationModel: '' | 
|                 }, | 
|                 lotNo: '', | 
|                 contLabel:1, //打印张数 | 
|                 ermNum:'', | 
|                 detailshow: false, | 
|                 timer:null, | 
|                 printflag:false, | 
|                 sapLocate:'', | 
|                 modalshow2: false, | 
|                 wolist2: [], | 
|   | 
|                 currentPage: 1, //页数 | 
|                 pageNow:'', //接口返回的页数 | 
|                 totalPages: '', //页数 | 
|                 totalTs:'', //接口返回的总条数 | 
|                 pramWl:'' | 
|             }; | 
|         }, | 
|         components: { | 
|             ButtonModal, | 
|             ModalCode, | 
|             tkiBarcode, | 
|             bluet | 
|         }, | 
|         onLoad(option) { | 
|             // this.lotNo =  "WH" + new Date(this.getCurrentDate().formate).getTime(); | 
|             if(option.ids) { | 
|                 this.pramWl = option.ids | 
|                 this.currentPage = 1 | 
|             } | 
|             this.materialBlur(1) | 
|         }, | 
|         onReady() { | 
|             // this.$refs.warehouseRef.setRules(this.warehouseRules) | 
|         }, | 
|         mounted() { | 
|             this.operator = JSON.parse(uni.getStorageSync('userInfo')).name | 
|             // this.getVehicleType2() //SAP下拉 | 
|         }, | 
|         onPullDownRefresh() { | 
|             this.$nextTick(function () { | 
|                 uni.stopPullDownRefresh(); //停止当前页面下拉刷新 | 
|             }); | 
|         }, | 
|         //上拉加载 | 
|         onReachBottom() { | 
|             let _self = this; | 
|             if (this.totalPages && this.pageNow >= this.totalPages) { //无数据 不再请求 | 
|                 console.log("到底了") | 
|                 return | 
|             } | 
|             uni.showNavigationBarLoading(); | 
|             this.$nextTick(function () { | 
|                 _self.currentPage++; | 
|                 _self.materialBlur(); | 
|                 uni.hideNavigationBarLoading(); | 
|             }); | 
|         }, | 
|         methods: { | 
|             showDetail(item,eindex){ | 
|              | 
|                 // if(item.WareMaterialCode==''){ | 
|                 //     return | 
|                 // } | 
|                 item.childen = !item.childen | 
|                 if(item.childen){ | 
|                     item.uncollectedQuantity = 1 | 
|                 }else{ | 
|                     item.uncollectedQuantity = 0 | 
|                 } | 
|                 if(this.singlist[eindex].SortingOrderDetailsList.length>0){ | 
|                     return | 
|                 } | 
|                 getMoveOrderDetail({ | 
|                 'WareMaterialCode':item.wareMaterialCode | 
|                 }).then((res) => { | 
|                     if(res.code==200){ | 
|                         if (Array.isArray(res.data) && res.data.length >= 0) { | 
|                             if (res.data.length == 0) { | 
|                                 uni.showToast({ | 
|                                     title:'暂无取货数据', | 
|                                     icon:'none', | 
|                                     duration: 2000 | 
|                                 }) | 
|                                 return | 
|                             } | 
|                             res.data.map(item => { | 
|                                 item.uncollectedQuantity = 0; | 
|                                 return item; | 
|                             }) | 
|                             this.singlist[eindex].SortingOrderDetailsList = res.data | 
|                         } | 
|                     } | 
|                 }) | 
|             }, | 
|             //获取print date print time | 
|             getCurrentDate() { | 
|                 let date = new Date(); | 
|                 let year = date.getFullYear(); //年 | 
|                 let month = date.getMonth() + 1; //月 | 
|                 month = month >= 10 ? month : '0' + month; | 
|                 let day = date.getDate(); //日 | 
|                 day = day >= 10 ? day : '0' + day; | 
|                 let hour = date.getHours() //时 | 
|                 hour = hour >= 10 ? hour : '0' + hour; | 
|                 let min = date.getMinutes(); //分 | 
|                 min = min >= 10 ? min : '0' + min; | 
|                 let second = date.getSeconds(); //秒 | 
|                 second = second >= 10 ? second : '0' + second; | 
|                 return { | 
|                     date: `${day}.${month}.${year}`, | 
|                     time: `${hour}:${min}:${second}`, | 
|                     formate:`${year}/${month}/${day}` | 
|                 } | 
|                  | 
|             }, | 
|             //打印 | 
|             init(param) { | 
|                 const arr = ['wareMaterialCode','barNo','uncollectedQuantity']; | 
|                 const arrzw = ['物料编号','批次','实际越库数'] | 
|                 let isAllow = '' | 
|                 Object.keys(this.materlist).forEach(item => { | 
|                     if(arr.includes(item)) { | 
|                         if(!this.materlist[item]) { | 
|                             isAllow =  arr.indexOf(item) | 
|                             return  | 
|                         } | 
|                     } | 
|                 }) | 
|                 if(isAllow!=''){ | 
|                     this.detailshow = false | 
|                     this.rescode = 400 | 
|                     this.resmessage = `${arrzw[isAllow]}为空,不能继续打印` | 
|                     this.$refs.resmodal.show = true | 
|                     return | 
|                 } | 
|                 // if(!this.contLabel || !this.ermNum){ | 
|                 //     uni.showToast({ | 
|                 //         title: '数量不能为空且大于0', | 
|                 //         icon: 'none' | 
|                 //     }) | 
|                 //     return | 
|                 // } | 
|                 this.ermNum = this.materlist.uncollectedQuantity; | 
|                 this.materlist.quantity = this.materlist.uncollectedQuantity; | 
|                 this.materlist.quantityLable = this.materlist.uncollectedQuantity; | 
|                 this.contLabel = 1; | 
|                 this.materlist.batchNo = this.materlist.barNo; | 
|                 if(param==1){ //蓝牙 | 
|                     if(this.materlist.orderType == 15){ //生产订单 | 
|                         this.arrPt = [this.materlist] | 
|                         this.printShengChanComp('','DO') | 
|                     }else{ | 
|                         this.printComp('','DO') | 
|                     } | 
|                 }else{ //斑马 | 
|                     if(this.materlist.orderType == 15){ //生产订单 | 
|                         this.printBanma('',2) | 
|                     }else{ | 
|                         this.printBanma('',3) | 
|                     } | 
|                 } | 
|             }, | 
|             //物料查询 | 
|             materialBlur(isFirstPage,enterType) { | 
|                 // this.$refs.warehouseRef.validate(valid => { | 
|                     // if (valid) { | 
|   | 
|                         if(enterType ==2 && this.warehouse.WareMaterialCode!='' && this.warehouse.WareMaterialCode.length>50){ | 
|                             this.warehouse.WareMaterialCode = getAttrValue(this.warehouse.WareMaterialCode, 'PARTSNUMBER') | 
|                         } | 
|   | 
|                         let params = { | 
|                             PageNo: this.currentPage, | 
|                             PageSize:10, | 
|                             WareMaterialCode: this.warehouse.WareMaterialCode, | 
|                         } | 
|                         if (isFirstPage) { | 
|                             params.PageNo = 1; | 
|                             params.PageSize = 10; | 
|                             this.currentPage = 1; | 
|                             this.singlist = []; | 
|                         } | 
|                         // 带参数 | 
|                         if(this.pramWl){ | 
|                             params.WareMaterialCode = this.pramWl | 
|                         } | 
|                         console.log("查询") | 
|                         if (this.totalPages && params.PageNo > this.totalPages) { // 无数据 不再请求 | 
|                             console.log("无数据 不再请求") | 
|                             return | 
|                         } | 
|                         getMoveWarehouseGroup(params).then((res) => { | 
|                             if(res.code==200){ | 
|                                 if (Array.isArray(res.data.rows) && res.data.rows.length >= 1) { | 
|                                     res.data.rows.map(item => { | 
|                                         item.uncollectedQuantity = ''; | 
|                                         item.children = false; | 
|                                         item.SortingOrderDetailsList=[]; | 
|                                         return item; | 
|                                     }) | 
|   | 
|                                     if (this.currentPage != 1) { | 
|                                         this.singlist = this.singlist.concat(res.data.rows); | 
|                                     } else { | 
|                                         this.singlist = res.data.rows; | 
|                                     } | 
|                                     this.totalPages = res.data.totalPage | 
|                                     this.pageNow = res.data.pageNo | 
|                                     this.totalTs = res.data.totalRows | 
|   | 
|                                 } else { | 
|                                     // this.resmessage = '暂无数据' | 
|                                     // this.rescode = 400 | 
|                                     // this.$refs.resmodal.show = true | 
|                                     // this.totalPages = 0 | 
|                                 } | 
|                             } | 
|                         }) | 
|                     // } | 
|                 // }) | 
|             }, | 
|             //删除详情 | 
|             longpredel(index, eindex) { | 
|                 if (eindex == 0) { | 
|                     this.singlist.splice(index, 1) | 
|                 } else { | 
|                     this.materlist = this.singlist[index] | 
|                     this.detailshow = true | 
|                 } | 
|             }, | 
|             showdetailProp(item,itemIn){ | 
|                 this.detailshow = true | 
|                 this.materlist = { | 
|                     ...item, | 
|                     ...itemIn | 
|                 } | 
|             }, | 
|             //卡片选中 | 
|             click(e) { | 
|                 e.cardNum = true | 
|                 this.$forceUpdate() | 
|             }, | 
|             // 如果打开一个的时候,不需要关闭其他,则无需实现本方法 | 
|             open(index) { | 
|                 // 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制, | 
|                 // 原本为'false',再次设置为'false'会无效 | 
|                 this.singlist[index].cardNum = true; | 
|                 this.singlist[index].show = true; | 
|                 this.singlist.map((val, idx) => { | 
|                     if (index != idx) this.singlist[idx].show = false; | 
|                 }) | 
|                 this.$forceUpdate() | 
|             }, | 
|             close(index) { | 
|                 this.singlist[index].show = false; | 
|                 this.singlist[index].cardNum = false; | 
|                 this.$forceUpdate() | 
|             }, | 
|             // tabs通知swiper切换 | 
|             tabsChange(index) { | 
|                 this.current = index; | 
|             }, | 
|             //改变越库数量 | 
|             changeNum(val) { | 
|                 // val.cardNum = false | 
|                 // if(!val.uncollectedQuantity) { | 
|                 //     this.rescode = 400 | 
|                 //     this.resmessage = '越库数量不能为空且大于0' | 
|                 //     this.$refs.resmodal.show = true | 
|                 // } | 
|                 // // val.uncollectedQuantity  = Number(val.uncollectedQuantity.toString().match(/^\d+(?:\.\d{0,2})?/)) //保留2位小数 | 
|                 // let num1 = Number(Number(val.deliveryQuantity) -  Number(val.goodsQuantity)).toFixed(3) //必须保留3位小数 -否则会造成剩余物料是小数的时候,无法越库 | 
|                 // if (Number(val.uncollectedQuantity).toFixed(3) > Number(num1) ) { | 
|                 //     val.uncollectedQuantity = 0; | 
|                 //     this.rescode = 400 | 
|                 //     this.resmessage = '越库数'+val.uncollectedQuantity+'不能大于采购总数'+val.deliveryQuantity+'减已越库数'+val.goodsQuantity; | 
|                 //     this.$refs.resmodal.show = true | 
|                 // } | 
|   | 
|                 // if (val.uncollectedQuantity && val.uncollectedQuantity >= 0) { | 
|                 //     val.edit = true | 
|                 //     this.$forceUpdate() | 
|                 // } | 
|   | 
|             }, | 
|              | 
|             changeNumIn(val,valParent) { | 
|                 // if(val.uncollectedQuantity==='' || val.uncollectedQuantity<0) { | 
|                 //     this.rescode = 400 | 
|                 //     this.resmessage = '越库数量不能为空' | 
|                 //     this.$refs.resmodal.show = true | 
|                 // } | 
|                 val.uncollectedQuantity  = Number(val.uncollectedQuantity.toString().match(/^\d+(?:\.\d{0,3})?/)) //保留2位小数 | 
|   | 
|                 if (val.uncollectedQuantity > val.quantity) { | 
|                     val.uncollectedQuantity = 0; | 
|                     this.rescode = 400 | 
|                     this.resmessage = '不能大于缺料数' | 
|                     this.$refs.resmodal.show = true | 
|                     return | 
|                 } | 
|                 // valParent.uncollectedQuantity = val.uncollectedQuantity | 
|                 // if(val.uncollectedQuantity > valParent.uncollectedQuantity){ | 
|                 //     val.uncollectedQuantity = 0; | 
|                 //     this.rescode = 400 | 
|                 //     this.resmessage = '不能大于越库数' | 
|                 //     this.$refs.resmodal.show = true | 
|                 // } | 
|             }, | 
|             upload() { | 
|                 this.fileList = [] | 
|                 uni.chooseImage({ | 
|                     sourceType: ["camera", "album"], | 
|                     sizeType: "original", | 
|                     count: 1, | 
|                     success: (res) => { | 
|                         this.image = res.tempFilePaths[0] | 
|                         console.log(res.tempFilePaths) | 
|                         translateapp(res.tempFilePaths[0], 80, imgUrl => { | 
|                             //打印压缩后返回的图片url | 
|                                 console.log(imgUrl);     | 
|                             //  res.tempFilePaths.forEach(item => this.fileList.push({ | 
|                             //     uri: item | 
|                             // }))     | 
|                             let imgArr = [imgUrl] | 
|                             imgArr.forEach(item => this.fileList.push({ | 
|                                 uri: item | 
|                             }))     | 
|                             console.log(this.fileList) | 
|                             uni.uploadFile({ | 
|                                 url: this.action, | 
|                                 files: this.fileList, | 
|                                 fileType: 'image', | 
|                                 success: (res) => { | 
|                                     if(res.statusCode==200){ | 
|                                         const result = JSON.parse(res.data) | 
|                                         console.log(result.data); | 
|                                         this.fileList.push(result.data) | 
|                                     }else{ | 
|                                         this.$u.toast('图片上传失败') | 
|                                         this.fileList = [] | 
|                                         this.image = '' | 
|                                     } | 
|                                 } | 
|                             }) | 
|                         }) | 
|                     } | 
|                 }) | 
|             }, | 
|             delimage() { | 
|                 if(this.fileList.length<=0){ | 
|                     return | 
|                 } | 
|                 console.log( this.fileList[1]) | 
|                 deletePicture({ | 
|                     'filepath':this.fileList[1] | 
|                 }).then(res => { | 
|                     if(res.code == 200) { | 
|                         this.image = '' | 
|                         this.$u.toast('移除图片成功') | 
|                         this.fileList = [] | 
|                     }else { | 
|                         this.rescode = 400 | 
|                         this.resmessage = `删除图片失败` | 
|                         this.$refs.resmodal.show = true | 
|                     } | 
|                 }) | 
|             }, | 
|             imgClick(url) { | 
|                 if(this.image!==''){ | 
|                     var imgArr = []; | 
|                     imgArr.push(url) | 
|                     //预览图片 | 
|                     uni.previewImage({ | 
|                         urls: imgArr, | 
|                         current: imgArr[0] | 
|                     }); | 
|                 } | 
|             }, | 
|             //监听原生返回键 | 
|             onBackPress(e) { | 
|                 this.delimage() | 
|             }, | 
|             //下一步 | 
|             next() { | 
|                 // const index = this.singlist.findIndex(item => item.uncollectedQuantity == '' || parseFloat(item.uncollectedQuantity) <= 0 || item.uncollectedQuantity == undefined); | 
|                 // if(index > -1) { | 
|                 //     uni.showModal({ | 
|                 //         title: '提示', | 
|                 //         content: `${this.singlist[index].wareMaterialCode}未填写越库数量`, | 
|                 //         showCancel: false | 
|                 //     }) | 
|                 //     return | 
|                 // } | 
|                 // 过滤为 0  | 
|   | 
|   | 
|                 // isBatchMge为true: 批次管理的物料 必须输入 | 
|                 // let arrMge = this.singlist.filter((v)=>(v.isBatchMge == 1 && v.barNo==''|| v.isBatchMge == 1 && v.barNo==null)).filter((v2)=>(v2.uncollectedQuantity>0)) | 
|                 // if(arrMge.length>0){ | 
|                 //     uni.showToast({ | 
|                 //         title: `${arrMge[0].wareMaterialCode}请填写空的批次`, | 
|                 //         icon:'none' | 
|                 //     })         | 
|                 //     return | 
|                 // } | 
|   | 
|   | 
|              | 
|   | 
|   | 
|                 // this.lacklist = this.singlist.reduce((curr,item) => { | 
|                 //     if(item.deliveryQuantity - item.uncollectedQuantity - item.goodsQuantity > 0) { | 
|                 //         curr.push(item) | 
|                 //     } | 
|                 //     return curr; | 
|                 // },[]) | 
|                  | 
|                 this.renameFocus = false | 
|                 // this.QuantityTotal = this.singlist.reduce((prev, next) => { | 
|                 //     let num  = Number(prev) + Number(next.deliveryQuantity) | 
|                 //     return Number(num).toFixed(3) | 
|                 // }, 0) | 
|                  | 
|                 // this.collectedTotal = this.singlist.reduce((prev,next) => { | 
|                 //     let num = Number(prev) + Number(next.goodsQuantity); | 
|                 //     return  Number(num).toFixed(3) | 
|                 // },0) | 
|   | 
|   | 
|                 this.uncollectedTotal = 0 | 
|                 this.singlist.forEach((item,index) => { | 
|                     item.total = 0 | 
|                     if(item.SortingOrderDetailsList.length>0){ | 
|                         item.SortingOrderDetailsList.forEach((item2,index2) => { | 
|                             if(item2.uncollectedQuantity>0){ | 
|                                 item.total += item2.uncollectedQuantity; | 
|                                 this.uncollectedTotal += item2.uncollectedQuantity; | 
|                             } | 
|                         }) | 
|                     } | 
|                 }) | 
|   | 
|                 this.lastlist =  this.singlist.filter(v=>v.total>0); | 
|   | 
|                 this.uncollectedTotal = Number(this.uncollectedTotal).toFixed(3) | 
|   | 
|                 // this.lackTotal = this.singlist.reduce((prev, next) => { | 
|                 //     let num = Number(prev) +Number(next.quantity) - Number(next | 
|                 //         .uncollectedQuantity) | 
|                 //     return Number(num).toFixed(3) | 
|                 // }, 0) | 
|                 this.lists[0].name = `越库(${this.lastlist.length})` | 
|                 this.lists[1].name = `缺料(${this.lacklist.length})` | 
|             }, | 
|             //确认越库 | 
|             submit() { | 
|                 if(this.uncollectedTotal<=0){ | 
|                     uni.showToast({ | 
|                         title:'越库总数大于0', | 
|                         icon:'none', | 
|                         duration: 2000 | 
|                     }) | 
|                     return | 
|                 } | 
|                 let SortingOrderDetailsList = [] | 
|                  this.lastlist.forEach((item,index) => { | 
|                     item.SortingOrderDetailsList.forEach((itemIN,indexIN) => { | 
|                         let {quantity,uncollectedQuantity,batchNo,...rest} = itemIN | 
|                         if(Number(uncollectedQuantity ) >0){ | 
|                             SortingOrderDetailsList.push({ | 
|                                 'quantity':uncollectedQuantity, | 
|                                 'batchNo':item.barNo || item.batchNo, | 
|                                 ...rest | 
|                             }) | 
|                         } | 
|                     }) | 
|                 }) | 
|                 uni.showModal({ | 
|                     title: '提示', | 
|                     content: '是否确认越库?', | 
|                     showCancel: true, | 
|                     cancelColor: '#333333', | 
|                     success: (res => { | 
|                         if (res.confirm) { | 
|                             addconfirmMove(SortingOrderDetailsList).then((res) => { | 
|                                 this.rescode = res.code | 
|                                 this.resmessage = res.message | 
|                                 this.$refs.resmodal.show = true | 
|                                 if (res.code == 200) { | 
|                                     this.renameFocus = true | 
|                                     this.rest() | 
|                                 } | 
|                             }) | 
|   | 
|                         } else if (res.cancel) { | 
|                         } | 
|                     }) | 
|                 }); | 
|                  | 
|             }, | 
|             //清楚选中 | 
|             rest(parm) { | 
|                 this.warehouse.WareMaterialCode = ''; | 
|                 this.singlist = []; | 
|                 this.pramWl ='' | 
|                 this.materialBlur(1) | 
|             }, | 
|             reset(back) { | 
|                 if(back){ | 
|                     this.autoFoucs = false | 
|                 } | 
|                 this.renameFocus = true | 
|             }, | 
|             //打印 | 
|             onPrint() { | 
|                 let _this = this | 
|                 if (!uni.getStorageSync("deviceId")) { | 
|                     uni.showToast({ | 
|                         title: '请连接打印机', | 
|                         icon: 'error', | 
|                         duration: 2000 | 
|                     }) | 
|                     return | 
|                 } | 
|                 this.writeBLECharacteristicValue() | 
|             }, | 
|             beforeDestroy() { | 
|                 // 销毁定时器 | 
|                 if(this.timer){ | 
|                     clearTimeout(this.timer) | 
|                     this.timer = null | 
|                 } | 
|                  | 
|             }, | 
|             //类型聚焦事件 | 
|             containerFocus2() { | 
|                 uni.hideKeyboard() | 
|                 this.modalshow2 = true | 
|             }, | 
|             getVehicleType2() { | 
|                 getSapSelect().then((res) => { | 
|                     if(res.code==200){ | 
|                         const dataT = res.data | 
|                         if (dataT && dataT.length == 0) { | 
|                             this.wolist2 = [] | 
|                             return | 
|                         } | 
|                         let dataDst = [] | 
|                         dataT.forEach(item => { | 
|                             dataDst.push({ | 
|                                 'text':item, | 
|                                 'id':item | 
|                             }) | 
|                         }) | 
|                         this.wolist2 = dataDst; | 
|                     } | 
|                 }) | 
|             }, | 
|             //类型选择 | 
|             confirm2(index) { | 
|                 // this.warehouse.containerCode = this.wolist2[index].text; | 
|                 // this.warehouse.containerCode = this.wolist2[index].id; | 
|                 console.log( this.wolist2[index].text); | 
|                 this.sapLocate = this.wolist2[index].text; | 
|                 this.singlist.forEach((item)=>{ | 
|                     item.sap_Location =  this.wolist2[index].text; | 
|                 }) | 
|                 console.log(this.singlist); | 
|                 this.$forceUpdate(); | 
|   | 
|             } | 
|         } | 
|     } | 
| </script> | 
|   | 
| <style lang="scss"> | 
| .title-wrap{ | 
|     margin-bottom: 15rpx; | 
|     border-bottom: 1px solid #f18202; | 
|     border-top: 1px solid #f18202; | 
|     padding: 3px; | 
| } | 
| .bg_item { | 
|     background: #FFEBCD !important; | 
| } | 
| .qhd_wp{ | 
|     border-top: 1px solid #f18202; | 
|     position: relative; | 
| } | 
| .detail_btn{ | 
|     text-align: right; | 
|     padding: 10px; | 
| } | 
| .detailBtn{ | 
|     position: absolute; | 
|     right: 15rpx; | 
|     top: 15rpx; | 
| } | 
| </style> |