| <template> | 
|     <view><uni-segmented-control :current="current" :values="items" @clickItem="onClickItem"> | 
|         </uni-segmented-control> | 
|         <view class="content"> | 
|             <view v-if="current === 0" class="headerstyle"> | 
|                 <u-sticky> | 
|                     <view style="background-color: #ffffff;"> | 
|                         <!-- <uni-search-bar @confirm="search" v-model="searchValue"></uni-search-bar> --> | 
|                     </view> | 
|                 </u-sticky> | 
|                 <uni-list-item direction="column" v-for="(item) in orderDetail" :key="item.id"> | 
|                     <template v-slot:body> | 
|                         <view class="uni-list-box"> | 
|                             <checkbox @click="click(item)" style="margin-right: 20px;"></checkbox> | 
|                             <view class="uni-content"> | 
|                                 <view style="font-size: 18px;">单据编号:{{orderNo}}</view> | 
|                                 <view style="font-size: 18px;">物料编码:{{item.materielCode}}</view> | 
|                                 <view style="font-size: 18px;">物料名称:{{item.materielName}}</view> | 
|                                 <view style="font-size: 18px;">单据数量:{{item.orderQuantity}}</view> | 
|                                 <view style="font-size: 18px;">出库数量:{{item.overOutQuantity}}</view> | 
|                                 <view style="font-size: 18px;">锁定数量:{{item.lockQuantity}}</view> | 
|                             </view> | 
|                         </view> | 
|                     </template> | 
|                 </uni-list-item> | 
|                 <button @click="OutBound" type="primary" size="default" style="margin-top: 2%;">出库</button> | 
|                 <u-toast ref="uToast" /> | 
|             </view> | 
|             <view v-if="current === 1" class="headerstyle"> | 
|                 <u-sticky> | 
|                     <view style="background-color: #ffffff;"> | 
|                         <!-- <uni-search-bar @confirm="search" v-model="searchValue"></uni-search-bar> --> | 
|                     </view> | 
|                 </u-sticky> | 
|                 <uni-list :border="true"> | 
|                     <uni-list-item direction="column" clickable @click="groupClick(item.materielCode,item.id)" link | 
|                 :to="page+materielCode+'&id='+item.id" v-for="item in orderDetail" :key="item.materielCode"> | 
|                         <template v-slot:body> | 
|                             <uni-group margin-top="20"> | 
|                                 <view style="font-size: 18px;">单据编号:{{orderNo}}</view> | 
|                                 <view style="font-size: 18px;">物料编码:{{item.materielCode}}</view> | 
|                                 <view style="font-size: 18px;">物料名称:{{item.materielName}}</view> | 
|                                 <view style="font-size: 18px;">单据数量:{{item.orderQuantity}}</view> | 
|                                 <view style="font-size: 18px;">出库数量:{{item.overOutQuantity}}</view> | 
|                                 <view style="font-size: 18px;">锁定数量:{{item.lockQuantity}}</view> | 
|                             </uni-group> | 
|                         </template> | 
|                     </uni-list-item> | 
|                 </uni-list> | 
|                 <u-toast ref="uToast" /> | 
|             </view> | 
|         </view> | 
|     </view> | 
| </template> | 
|   | 
| <script> | 
|     const innerAudioContext = uni.createInnerAudioContext(); | 
|     export default { | 
|         data() { | 
|             return { | 
|                 page: "/pages/materielGroup/OutOrderDetail?materielCode=", | 
|                 items: ['直接出库', '指定出库'], | 
|                 current: 0, | 
|                 orderNo: "", | 
|                 label: "", | 
|                 orderDetail: [], | 
|                 focus: false, | 
|                 orderDetailId: [], | 
|                 key:[], | 
|                 materielCode:"", | 
|             } | 
|         }, | 
|         onShow() {}, | 
|         onLoad(res) { | 
|             this.focus = false; | 
|             this.addressFocus = false; | 
|             this.orderNo = res.orderNo; | 
|             this.label = "单据编号:" + this.orderNo; | 
|             this.getData(); | 
|         }, | 
|         methods: { | 
|             groupClick(materielCode,id){ | 
|                 window.location="/pages/materielGroup/OutOrderDetail?materielCode="+materielCode+"&id="+id; | 
|                 console.log(materielCode,id) | 
|             }, | 
|             getData() { | 
|                 var postData = this.orderNo | 
|                 this.$u.post('/api/OutboundOrder/GetOutboundOrderDetail', postData).then((res) => { | 
|                     if (res.status) { | 
|                         this.orderDetail = res.data; | 
|                         if (this.orderDetail.length > 3) { | 
|                             this.loadVisible = true; | 
|                         } | 
|                     } | 
|                 }) | 
|             }, | 
|             onClickItem(e) { | 
|                 this.focus = false; | 
|                 this.addressFocus = false; | 
|                 if (this.current !== e.currentIndex) { | 
|                     this.current = e.currentIndex; | 
|                     if (this.current == 2) { | 
|                         this.getData(); | 
|                     } | 
|                 } | 
|             }, | 
|             OutBound() { | 
|                 var postData = this.key; | 
|                 this.$u.post('/api/Task/GenerateOutboundTasks', postData).then(res => { | 
|                     if (res.status) { | 
|                         this.items = []; | 
|                         uni.$showMsg(res.message); | 
|                         setTimeout(() => { | 
|                             this.addressFocus = false; | 
|                         }, 200); | 
|                     } else { | 
|                         this.$refs.uToast.show({ | 
|                             title: res.message, | 
|                             type: "error" | 
|                         }) | 
|                     } | 
|                 }).catch(err => { | 
|                     this.$refs.uToast.show({ | 
|                         title: err.message, | 
|                         type: "error" | 
|                     }) | 
|                 }) | 
|             }, | 
|             click(e) { | 
|                 if (this.key.find(x => x.id == e.id)) { | 
|                     this.key.map((item, index) => { | 
|                         if (item.id == e.id) { | 
|                             this.key.splice(index, 1); | 
|                         } | 
|                     }) | 
|                 } else { | 
|                     this.key.push(e.id); | 
|                 } | 
|             } | 
|         } | 
|     } | 
| </script> | 
|   | 
| <style lang="scss"> | 
|     @import '@/common/uni-ui.scss'; | 
|   | 
|     .content { | 
|         display: flex; | 
|         height: 150px; | 
|     } | 
|   | 
|     .content-text { | 
|         font-size: 14px; | 
|         color: #666; | 
|     } | 
|   | 
|     .itemstyle { | 
|         margin-top: 30px; | 
|         margin-left: 5%; | 
|     } | 
|   | 
|     .headerstyle { | 
|         width: 90%; | 
|     } | 
| </style> |