|  |  | 
 |  |  |       <view class="itemstyle"> | 
 |  |  |          <uni-forms label-width="180"> | 
 |  |  |             <uni-forms-item label="å¤ç®±ç :"> | 
 |  |  |                <uni-easyinput type="text" placeholder="è¯·æ«æå¤ç®±ç " ref='midInput' :focus="!focus" v-model="barcode" | 
 |  |  |                   @input="barcodeInput" /> | 
 |  |  |             </uni-forms-item> | 
 |  |  |             <uni-forms-item> | 
 |  |  |                <button @click="InEmpty" type="primary" size="default" style="margin-top: 2%;">åºè´§</button> | 
 |  |  |                <uni-easyinput type="text" placeholder="è¯·æ«æå¤ç®±ç " ref='midInput'  v-model="barcode" :focus="!focus" | 
 |  |  |                    class="search_box" :disabled="isDisable" @confirm="handleKeyPress"/> | 
 |  |  |             </uni-forms-item> | 
 |  |  |          </uni-forms> | 
 |  |  |       </view> | 
 |  |  |       <view style="padding: 0 14rpx 20rpx;"> | 
 |  |  |       <view style="padding: 0 0rpx 0rpx;"> | 
 |  |  |          <!-- å½ååºåºå¤å
å· --> | 
 |  |  |          <view v-for="(i,index) in listOutBags" :key="index" class="item_box"> | 
 |  |  |             <view style="line-height: 17px;color: #596671;font-size: 14px;text-align: left;font-weight: bold;">å¤å
å·ï¼{{i}} | 
 |  |  |             </view> | 
 |  |  |          <view class="item_boxItem"> | 
 |  |  |             <uni-list> | 
 |  |  |                <uni-list-item direction="column" v-for="(item,index) in listShow" :key="index"> | 
 |  |  |                   <template v-slot:body> | 
 |  |  |                      <view class="uni-list-box"> | 
 |  |  |                         <uni-icons type="trash" size="22" style="position: absolute;right: 5%;" | 
 |  |  |                            @click="deleteList(index)"> | 
 |  |  |                         </uni-icons> | 
 |  |  |                         <view class="uni-content"> | 
 |  |  |                            <view class="uni-title-sub uni-ellipsis-2">å¤å
ï¼{{item.code}}    æ°éï¼{{item.qty}}</view> | 
 |  |  |                         </view> | 
 |  |  |                      </view> | 
 |  |  |                   </template> | 
 |  |  |                </uni-list-item> | 
 |  |  |             </uni-list> | 
 |  |  |          </view> | 
 |  |  |       </view> | 
 |  |  |       <view style="padding: 0 14rpx 20rpx;"> | 
 |  |  |       <view style="padding: 0 14rpx 200rpx;"> | 
 |  |  |          <!-- æç» --> | 
 |  |  |          <view v-for="i in list" :key="i.id" class="item_box"> | 
 |  |  |             <view style="line-height: 17px;color: #596671;font-size: 14px;text-align: left;font-weight: bold;">订åæç»è¡å·ï¼{{i.rowId}} | 
 |  |  | 
 |  |  |             <view style="margin-top: 22rpx;height: 140rpx;display: flex;flex-direction: column;justify-content: space-around;"> | 
 |  |  |                <view style="color: #00070F;font-size: 12px;">客æ·ä»£å·ï¼{{i.customer}}</view> | 
 |  |  |                <view style="color: #00070F;font-size: 12px;">产åç¼å·ï¼{{i.pCode}}</view> | 
 |  |  |                <view style="color: #00070F;font-size: 12px;">è®¢åæ°éï¼{{i.qtyPcs}}</view> | 
 |  |  |                <view style="color: #00070F;font-size: 12px;">å·²åºæ°éï¼{{i.overQtyPcs}}</view> | 
 |  |  |                <view style="color: #00070F;font-size: 12px;">éå®è®¢åï¼{{i.saleOrder}}</view> | 
 |  |  |                <view style="color: #f56c6c;font-size: 12px;">è®¢åæ°éï¼{{i.qtyPcs}}</view> | 
 |  |  |                <view style="color: #67c23a;font-size: 12px;">å·²åºæ°éï¼{{i.overQtyPcs}}</view> | 
 |  |  |             </view> | 
 |  |  |             <view style="width: 100%;height: 1rpx;background-color: #00070F;margin-top: 28rpx;"> | 
 |  |  |             </view> | 
 |  |  |          </view> | 
 |  |  |       </view> | 
 |  |  |       <uni-load-more :status="status" v-if="loadVisible"></uni-load-more> | 
 |  |  |       <view style="padding:20rpx;position: fixed;bottom: 0;left: 0;background-color:lightgray;width: 100%;z-index: 999;display: flex;justify-content: space-between;"> | 
 |  |  |          <view style="margin-bottom: 22rpx;padding-left: 16rpx;line-height: 80rpx;"> | 
 |  |  |             <view style="font-size: 24rpx;font-weight: bold;color: #f56c6c;">è®¢åæ»æ°éï¼<text>{{orderQty}}</text></view> | 
 |  |  |             <view style="font-size: 24rpx;font-weight: bold;color: #67c23a;">å·²æ«æ»æ°éï¼<text>{{total}}</text></view> | 
 |  |  |          </view> | 
 |  |  |          <view style="display: flex;height: 110rpx;margin-top: 40rpx;"> | 
 |  |  |             <button @click="reset" type="default" size="default" style="margin-top: 2%;width: 160rpx;border: 1rpx solid #007aff;color: #007aff;margin-right: 30rpx;">éç½®</button> | 
 |  |  |             <button @click="InEmpty" type="primary" size="default" style="margin-top: 2%;width: 160rpx;">åºè´§</button> | 
 |  |  |          </view> | 
 |  |  |       </view> | 
 |  |  |       <u-toast ref="uToast" /> | 
 |  |  |    </view> | 
 |  |  | </template> | 
 |  |  | 
 |  |  |             proOutNo: "", | 
 |  |  |             id: null, | 
 |  |  |             list:[], | 
 |  |  |             listOutBags:[] | 
 |  |  |             listOutBags:[], | 
 |  |  |             listShow:[], | 
 |  |  |             total:0, | 
 |  |  |             orderQty:0, | 
 |  |  |             isDisable:false | 
 |  |  |          } | 
 |  |  |       }, | 
 |  |  |       onShow() {}, | 
 |  |  | 
 |  |  |          this.proOutNo=res.proOutNo; | 
 |  |  |          this.GetDetail(res.id); | 
 |  |  |          this.id=res.id; | 
 |  |  |          //å·²åºç®±å· | 
 |  |  |          uni.hideKeyboard(); //éè软é®ç | 
 |  |  |       }, | 
 |  |  |       methods: { | 
 |  |  |          handleKeyPress(e) { | 
 |  |  |             console.log(e); | 
 |  |  |                // å车符ï¼ASCII 13ï¼è¡¨ç¤ºæ«ç ç»æ | 
 |  |  |               this.isDisable=true; | 
 |  |  |               this.focus=true; | 
 |  |  |               this.$nextTick(function(x) { | 
 |  |  |                  var values= this.barcode.split(','); | 
 |  |  |                  if(values.length==5){ | 
 |  |  |                     // if (values.length != 5) { | 
 |  |  |                     //    this.$refs.uToast.show({ | 
 |  |  |                     //       title: "æ«ææ ¼å¼é误"+value, | 
 |  |  |                     //       type: 'error' | 
 |  |  |                     //    }) | 
 |  |  |                     //    this.barcode=""; | 
 |  |  |                     //    this.$refs.midInput.focus(); | 
 |  |  |                     //    return; | 
 |  |  |                     // } | 
 |  |  |                     this.$u.post('/api/ProOutOrder/CheckCode?code='+this.barcode,{}).then( | 
 |  |  |                        res => { | 
 |  |  |                           if (res.status) { | 
 |  |  |                              //夿æ¯å¦éå¤ | 
 |  |  |                              if (this.listShow.some(item => item.code === values[0])) { | 
 |  |  |                                 this.barcode=""; | 
 |  |  |                                 setTimeout(() => { | 
 |  |  |                                    this.isDisable=false; | 
 |  |  |                                    this.focus=false; | 
 |  |  |                                 },200); | 
 |  |  |                                 this.$refs.uToast.show({ | 
 |  |  |                                    title: "é夿«æ"+values[0]+"å·²åå¨", | 
 |  |  |                                    type: 'error' | 
 |  |  |                                 }) | 
 |  |  |                                 return; | 
 |  |  |                              } | 
 |  |  |                              if (this.list.some(item => item.pCode === values[1])) { | 
 |  |  |                                 var outCode=values[0]; | 
 |  |  |                                 var outQty=parseInt(values[4]); | 
 |  |  |                                 //夿outQty为æ°å | 
 |  |  |                                 if (isNaN(outQty)) { | 
 |  |  |                                       this.barcode=""; | 
 |  |  |                                       setTimeout(() => { | 
 |  |  |                                          this.isDisable=false; | 
 |  |  |                                          this.focus=false; | 
 |  |  |                                       },200); | 
 |  |  |                                       this.$refs.uToast.show({ | 
 |  |  |                                          title: "æ«ææ ¼å¼é误"+values[4], | 
 |  |  |                                          type: 'error' | 
 |  |  |                                       }) | 
 |  |  |                                       return; | 
 |  |  |                                    } | 
 |  |  |                                 //夿outQtyæ¯å¦å¤§äº0 | 
 |  |  |                                 if (outQty<=0) { | 
 |  |  |                                    this.barcode=""; | 
 |  |  |                                    setTimeout(() => { | 
 |  |  |                                       this.isDisable=false; | 
 |  |  |                                       this.focus=false; | 
 |  |  |                                    },200); | 
 |  |  |                                    this.$refs.uToast.show({ | 
 |  |  |                                       title: "æ ç¾æ°å¿
须大äº0", | 
 |  |  |                                       type: 'error' | 
 |  |  |                                    }) | 
 |  |  |                                    return; | 
 |  |  |                                 } | 
 |  |  |                                 this.total+=outQty; | 
 |  |  |                                 if(this.orderQty<this.total){ | 
 |  |  |                                    this.barcode=""; | 
 |  |  |                                    setTimeout(() => { | 
 |  |  |                                       this.isDisable=false; | 
 |  |  |                                       this.focus=false; | 
 |  |  |                                    },200); | 
 |  |  |                                    this.$refs.uToast.show({ | 
 |  |  |                                       title: "è®¢åæ°è¶
åº", | 
 |  |  |                                       type: 'error' | 
 |  |  |                                    }) | 
 |  |  |                                    return; | 
 |  |  |                                 } | 
 |  |  |                                 this.listShow.unshift({code:outCode,qty:outQty}); | 
 |  |  |                                 console.log(this.listShow); | 
 |  |  |                                 //å»é¤this.barcodeç空格 | 
 |  |  |                                 this.listOutBags.push(this.barcode.replace(/\s*/g, "")); | 
 |  |  |                                 this.barcode=""; | 
 |  |  |                                 setTimeout(() => { | 
 |  |  |                                    this.isDisable=false; | 
 |  |  |                                    this.focus=false; | 
 |  |  |                                 },200); | 
 |  |  | 				  						 | 
 |  |  |                              }else{ | 
 |  |  |                                 this.barcode=""; | 
 |  |  |                                 setTimeout(() => { | 
 |  |  |                                    this.isDisable=false; | 
 |  |  |                                    this.focus=false; | 
 |  |  |                                 },200); | 
 |  |  |                                 this.$refs.uToast.show({ | 
 |  |  |                                    title: "æ«æ"+values[1]+"æ¹å·ä¸å¨è®¢åä¸", | 
 |  |  |                                    type: 'error' | 
 |  |  |                                 }) | 
 |  |  |                                 return; | 
 |  |  |                              } | 
 |  |  |                           } | 
 |  |  |                        }) | 
 |  |  |                  } | 
 |  |  |               }) | 
 |  |  |              }, | 
 |  |  |          GetDetail(value) { | 
 |  |  |             this.$u.post('/api/ProOutOrder/GetOrderDetails?keyId='+value).then( | 
 |  |  |                res => { | 
 |  |  |                   if (res.status) { | 
 |  |  |                      this.list=res.data.proOutOrderDetails; | 
 |  |  |                      this.listOutBags=res.data.outBags; | 
 |  |  |                      this.orderQty=this.list.map(x=>{ | 
 |  |  |                         return x.qtyPcs | 
 |  |  |                      }).reduce((a,b)=>{ | 
 |  |  |                         return a+b | 
 |  |  |                      }); | 
 |  |  |                   } else { | 
 |  |  |                      this.$refs.uToast.show({ | 
 |  |  |                         title: res.message, | 
 |  |  | 
 |  |  |                   } | 
 |  |  |                }) | 
 |  |  |          }, | 
 |  |  |          voiceSpeech(src) { | 
 |  |  |             innerAudioContext.src = src; // '../../static/success.mp3'; | 
 |  |  |             innerAudioContext.play(); | 
 |  |  |          }, | 
 |  |  |          barcodeInput(value) { | 
 |  |  |             this.$nextTick(function(x) { | 
 |  |  |                if (this.barcode.length > 0) { | 
 |  |  |                   this.focus = true; | 
 |  |  |                   this.barcode=value.split(',')[0]; | 
 |  |  |          // voiceSpeech(src) { | 
 |  |  |          //    innerAudioContext.src = src; // '../../static/success.mp3'; | 
 |  |  |          //    innerAudioContext.play(); | 
 |  |  |          // }, | 
 |  |  |          // barcodeInput(value) { | 
 |  |  |          //    this.isDisable=true; | 
 |  |  |          //    this.focus=true; | 
 |  |  |          //    setTimeout(x=>{ | 
 |  |  |          //       this.$nextTick(function(x) { | 
 |  |  |          //          var values= this.barcode.split(','); | 
 |  |  |          //          if(values.length==5){ | 
 |  |  |          //             // if (values.length != 5) { | 
 |  |  |          //             //    this.$refs.uToast.show({ | 
 |  |  |          //             //       title: "æ«ææ ¼å¼é误"+value, | 
 |  |  |          //             //       type: 'error' | 
 |  |  |          //             //    }) | 
 |  |  |          //             //    this.barcode=""; | 
 |  |  |          //             //    this.$refs.midInput.focus(); | 
 |  |  |          //             //    return; | 
 |  |  |          //             // } | 
 |  |  |          //             this.$u.post('/api/ProOutOrder/CheckCode?code='+this.barcode,{}).then( | 
 |  |  |          //                res => { | 
 |  |  |          //                   if (res.status) { | 
 |  |  |          //                      //夿æ¯å¦éå¤ | 
 |  |  |          //                      if (this.listShow.some(item => item.code === values[0])) { | 
 |  |  |          //                         this.barcode=""; | 
 |  |  |          //                         setTimeout(() => { | 
 |  |  |          //                            this.isDisable=false; | 
 |  |  |          //                            this.focus=false; | 
 |  |  |          //                         },200); | 
 |  |  |          //                         this.$refs.uToast.show({ | 
 |  |  |          //                            title: "é夿«æ"+values[0]+"å·²åå¨", | 
 |  |  |          //                            type: 'error' | 
 |  |  |          //                         }) | 
 |  |  |          //                         return; | 
 |  |  |          //                      } | 
 |  |  |          //                      if (this.list.some(item => item.pCode === values[1])) { | 
 |  |  |          //                         var outCode=values[0]; | 
 |  |  |          //                         var outQty=parseInt(values[4]); | 
 |  |  |          //                         //夿outQty为æ°å | 
 |  |  |          //                         if (isNaN(outQty)) { | 
 |  |  |          //                               this.barcode=""; | 
 |  |  |          //                               setTimeout(() => { | 
 |  |  |          //                                  this.isDisable=false; | 
 |  |  |          //                                  this.focus=false; | 
 |  |  |          //                               },200); | 
 |  |  |          //                               this.$refs.uToast.show({ | 
 |  |  |          //                                  title: "æ«ææ ¼å¼é误"+values[4], | 
 |  |  |          //                                  type: 'error' | 
 |  |  |          //                               }) | 
 |  |  |          //                               return; | 
 |  |  |          //                            } | 
 |  |  |          //                         //夿outQtyæ¯å¦å¤§äº0 | 
 |  |  |          //                         if (outQty<=0) { | 
 |  |  |          //                            this.barcode=""; | 
 |  |  |          //                            setTimeout(() => { | 
 |  |  |          //                               this.isDisable=false; | 
 |  |  |          //                               this.focus=false; | 
 |  |  |          //                            },200); | 
 |  |  |          //                            this.$refs.uToast.show({ | 
 |  |  |          //                               title: "æ ç¾æ°å¿
须大äº0", | 
 |  |  |          //                               type: 'error' | 
 |  |  |          //                            }) | 
 |  |  |          //                            return; | 
 |  |  |          //                         } | 
 |  |  |          //                         this.total+=outQty; | 
 |  |  |          //                         if(this.orderQty<this.total){ | 
 |  |  |          //                            this.barcode=""; | 
 |  |  |          //                            setTimeout(() => { | 
 |  |  |          //                               this.isDisable=false; | 
 |  |  |          //                               this.focus=false; | 
 |  |  |          //                            },200); | 
 |  |  |          //                            this.$refs.uToast.show({ | 
 |  |  |          //                               title: "è®¢åæ°è¶
åº", | 
 |  |  |          //                               type: 'error' | 
 |  |  |          //                            }) | 
 |  |  |          //                            return; | 
 |  |  |          //                         } | 
 |  |  |          //                         this.listShow.unshift({code:outCode,qty:outQty}); | 
 |  |  |          //                         console.log(this.listShow); | 
 |  |  |          //                         //å»é¤this.barcodeç空格 | 
 |  |  |          //                         this.listOutBags.push(this.barcode.replace(/\s*/g, "")); | 
 |  |  |          //                         this.barcode=""; | 
 |  |  |          //                         setTimeout(() => { | 
 |  |  |          //                            this.isDisable=false; | 
 |  |  |          //                            this.focus=false; | 
 |  |  |          //                         },200); | 
 |  |  | 											 | 
 |  |  |          //                      }else{ | 
 |  |  |          //                         this.barcode=""; | 
 |  |  |          //                         setTimeout(() => { | 
 |  |  |          //                            this.isDisable=false; | 
 |  |  |          //                            this.focus=false; | 
 |  |  |          //                         },200); | 
 |  |  |          //                         this.$refs.uToast.show({ | 
 |  |  |          //                            title: "æ«æ"+values[1]+"æ¹å·ä¸å¨è®¢åä¸", | 
 |  |  |          //                            type: 'error' | 
 |  |  |          //                         }) | 
 |  |  |          //                         return; | 
 |  |  |          //                      } | 
 |  |  |          //                   } | 
 |  |  |          //                }) | 
 |  |  |          //          } | 
 |  |  |          //       }) | 
 |  |  |          //    },200) | 
 |  |  |          // }, | 
 |  |  |          deleteList(res) { | 
 |  |  |             let indexExist =-1; | 
 |  |  |             //æ¥è¯¢this.listOutBags䏿¯å¦æthis.listShow[res].code | 
 |  |  |             this.listOutBags.forEach((item,index) => { | 
 |  |  |                //itemæ¯å¦å
å« this.listShow[res].code | 
 |  |  |                if (item.includes(this.listShow[res].code)) { | 
 |  |  |                   indexExist=index; | 
 |  |  |                } | 
 |  |  |             }) | 
 |  |  |             }); | 
 |  |  |             console.log(indexExist); | 
 |  |  |             if (indexExist !=-1) { // å¦ææ¾å°äºç´¢å¼ï¼åæ§è¡å é¤æä½ | 
 |  |  |                this.total-=this.listShow[res].qty; | 
 |  |  |                this.listOutBags.splice(indexExist, 1); // ä»ç´¢å¼ä½ç½®å¼å§å é¤ä¸ä¸ªå
ç´  | 
 |  |  |                this.listShow.splice(res, 1); | 
 |  |  |             } | 
 |  |  |             setTimeout(() => { | 
 |  |  |                this.isDisable=false; | 
 |  |  |             },200); | 
 |  |  |             this.barcode=""; | 
 |  |  |          }, | 
 |  |  |          reset(){ | 
 |  |  |             this.listShow=[]; | 
 |  |  |             this.total=0; | 
 |  |  |             this.listOutBags=[]; | 
 |  |  |             this.focus=true; | 
 |  |  |             this.barcode=""; | 
 |  |  |             setTimeout(() => { | 
 |  |  |                this.barcode=""; | 
 |  |  |                this.isDisable=false; | 
 |  |  |                this.focus=false; | 
 |  |  |             }, 200); | 
 |  |  |          }, | 
 |  |  |          InEmpty() { | 
 |  |  |             if (this.barcode == "") { | 
 |  |  |                this.$refs.uToast.show({ | 
 |  |  |                   title: "è¯·æ«æå¤ç®±ç ", | 
 |  |  |                   type: 'error' | 
 |  |  |                }) | 
 |  |  |                return; | 
 |  |  |             // if (this.barcode == "") { | 
 |  |  |             //    this.$refs.uToast.show({ | 
 |  |  |             //       title: "è¯·æ«æå¤ç®±ç ", | 
 |  |  |             //       type: 'error' | 
 |  |  |             //    }) | 
 |  |  |             //    return; | 
 |  |  |             // } | 
 |  |  |             if(this.orderQty!==this.total){ | 
 |  |  |                   this.$refs.uToast.show({ | 
 |  |  |                      title: "è¯·æ«æ"+this.orderQty+"æ°é", | 
 |  |  |                      type: 'error' | 
 |  |  |                   }) | 
 |  |  |                   return; | 
 |  |  |             } | 
 |  |  |             var postData = { | 
 |  |  |                MainData: { | 
 |  |  | 						 | 
 |  |  |                   "outProOrderNo":this.proOutNo | 
 |  |  |                }, | 
 |  |  |                DelKeys:[this.barcode] | 
 |  |  |                DelKeys:this.listOutBags | 
 |  |  |             } | 
 |  |  |             this.$u.post('/api/ProOutOrder/OutProductPK?proOutNo='+this.proOutNo,postData).then( | 
 |  |  |             this.$u.post('/api/ProOutOrder/OutProScanCodeSync',postData).then( | 
 |  |  |                res => { | 
 |  |  |                   if (res.status) { | 
 |  |  |                      this.$refs.uToast.show({ | 
 |  |  |                         title: "æå", | 
 |  |  |                         type: "success" | 
 |  |  |                      }) | 
 |  |  |                      this.barcode = ""; | 
 |  |  |                      this.focus = false; | 
 |  |  |                      this.address = ""; | 
 |  |  |                      this.reset(); | 
 |  |  |                      this.GetDetail(this.id); | 
 |  |  |                   } else { | 
 |  |  |                      this.$refs.uToast.show({ | 
 |  |  | 
 |  |  |       line-height: 34rpx; | 
 |  |  |       margin-top: 20rpx; | 
 |  |  |    } | 
 |  |  |    .item_boxItem { | 
 |  |  |       background-color: white; | 
 |  |  |       padding: 40rpx 38rpx 28rpx 34rpx; | 
 |  |  |       // height: 344rpx; | 
 |  |  |       border-radius: 12rpx; | 
 |  |  |       font-size: 24rpx; | 
 |  |  |       line-height: 17rpx; | 
 |  |  |    } | 
 |  |  |    .headerstyle { | 
 |  |  |       width: 90%; | 
 |  |  |    } | 
 |  |  |    .search_box { | 
 |  |  |       padding: 10rpx 20rpx 20rpx; | 
 |  |  |       background-color: white; | 
 |  |  |    } | 
 |  |  | </style> |