| <template> | 
|     <view class="container"> | 
|         <view class="code"> | 
|             <uni-search-bar :focus="searchValueFocus" v-model="searchValue"  @input="searchValueInput2()" | 
|                 maxlength="500" ancel="cancel" @clear="clear" placeholder="输入 / 扫描 订单号"> | 
|             </uni-search-bar> | 
|             <view class="code-title"> | 
|                 <view></view> | 
|                 <view>单据列表</view> | 
|                 <view></view> | 
|                 <!-- <view @click="allChecked">{{allCheckBtnTitle}}</view> --> | 
|             </view> | 
|         </view> | 
|         <view class="list" v-for="(item,i) in dataList"> | 
|             <view class="list-left"> | 
|                 <view>单据编号:{{item.orderNo}}</view> | 
|                 <view>单据类型:{{item.docType$}}</view> | 
|                 <view>创建时间:{{item.createTime$}}</view> | 
|                 <!-- <view class="card-id">{{i + 1}}</view> --> | 
|                 <view class="card-status-1" v-if="item.settle == 1">{{item.settle$}}</view> | 
|                 <view class="card-status-2" v-if="item.settle == 2">{{item.settle$}}</view> | 
|                 <view class="card-status-4" v-if="item.settle == 4">{{item.settle$}}</view> | 
|             </view> | 
|             <!-- <view class="list-right" @click="checkboxChange(item)"> | 
|                 <label > | 
|                     <checkbox :value="item.orderNo" :checked="item.checked" color="#FFCC33" style="transform:scale(0.7)" /><text></text> | 
|                 </label> | 
|             </view> --> | 
|             <view class="list-right" @click="getOrderDetl(item)"> | 
|                 <uni-icons type="right" color="#c1c1c1"></uni-icons> | 
|             </view> | 
|         </view> | 
|         <view style="height: 100rpx;"></view> | 
|          | 
|         <view style="position: fixed;bottom: 40px;padding: 10rpx;border-radius: 50%; | 
|             left: 20px;background-color: #55aaff;box-shadow: 0px 0px 5px 5px #c8c8c8;"> | 
|             <uni-icons type="refreshempty" size="30" color="#FFF"  @click="reload()"/> | 
|         </view> | 
|     </view> | 
| </template> | 
|   | 
| <script> | 
|     export default { | 
|         data() { | 
|             return { | 
|                 baseUrl: '', | 
|                 token: '', | 
|                 searchValueFocus: true, | 
|                 searchValue: '', | 
|                 checck: true, | 
|                 dataList: [], | 
|                 oldDataList: [], | 
|                 newDataList: [], | 
|                 allCheck: false, | 
|                 allCheckBtnTitle: '全选', | 
|             } | 
|         }, | 
|         onShow() { | 
|             this.baseUrl = uni.getStorageSync('baseUrl'); | 
|             this.token = uni.getStorageSync('token'); | 
|             this.getOrderList() | 
|         }, | 
|          | 
|         methods: { | 
|             reload() { | 
|                 this.getOrderList() | 
|             }, | 
|             searchValueInput2() { | 
|                 let _this = this | 
|                 uni.request({ | 
|                     url: `${_this.baseUrl}/order/head/page/auth`, | 
|                     header: {'token': uni.getStorageSync('token')}, | 
|                     data: { | 
|                         curr: 1, | 
|                         limit: 999999, | 
|                         order_no: _this.searchValue | 
|                     }, | 
|                     method: 'GET', | 
|                     success(res) { | 
|                         res = res.data | 
|                         if (res.code === 200) { | 
|                             _this.dataList = res.data.records | 
|                         }  | 
|                     } | 
|                 }) | 
|             }, | 
|             searchValueInput() { | 
|                 let count = 0 | 
|                 let sign = 0 | 
|                 this.dataList = [...this.oldDataList] | 
|                 this.newDataList = [] | 
|                 for (let k in this.dataList) { | 
|                     if (!this.dataList[k].orderNo.includes(this.searchValue)) { | 
|                         count++; | 
|                     } else { | 
|                         this.newDataList.push(this.dataList[k]) | 
|                     } | 
|                 } | 
|                 this.dataList = this.newDataList | 
|             }, | 
|             checkboxChange(e) { | 
|                 let items = this.dataList, | 
|                 values = e.orderNo; | 
|                 if (e.checked) { | 
|                     this.$set(e,'checked',false) | 
|                 } else { | 
|                     this.$set(e,'checked',true) | 
|                 } | 
|             }, | 
|             allChecked() { | 
|                 if (this.allCheck) { | 
|                     this.allCheck = false | 
|                     this.allCheckBtnTitle = '全选' | 
|                 } else { | 
|                     this.allCheck = true | 
|                     this.allCheckBtnTitle = '取消' | 
|                 } | 
|                 for (let item of this.dataList) { | 
|                     if (this.allCheck) { | 
|                         this.$set(item,'checked',true) | 
|                     } else { | 
|                         this.$set(item,'checked',false) | 
|                     } | 
|                 } | 
|             }, | 
|             clear() { | 
|                 this.matnr = '' | 
|                 this.dataList = [...this.oldDataList] | 
|             }, | 
|             // 获取订单列表 | 
|             getOrderList() { | 
|                 let _this = this | 
|                 uni.request({ | 
|                     url: `${_this.baseUrl}/order/detls/in/page/auth`, | 
|                     header: {'token': uni.getStorageSync('token')}, | 
|                     data: { | 
|                         curr: 1, | 
|                         limit: 30, | 
|                     }, | 
|                     method: 'GET', | 
|                     success(res) { | 
|                         res = res.data | 
|                         if (res.code === 200) { | 
|                             _this.dataList = res.data.records | 
|                             _this.oldDataList = [..._this.dataList] | 
|                         }  | 
|                     } | 
|                 }) | 
|             }, | 
|             // 获取订单明细 | 
|             getOrderDetl(item) { | 
|                 let _this = this | 
|                 uni.navigateTo({ | 
|                     url: "./orderList", | 
|                     success: function(res) { | 
|                         // 通过eventChannel向被打开页面传送数据   向另外一个页面传递值的 | 
|                         res.eventChannel.emit('item', { | 
|                             item: item | 
|                         }) | 
|                     }, | 
|                     events: { | 
|                         // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据  另外一个页面传过来的 | 
|                         acceptDataFromOpenedPage: function(data) { | 
|                             // _this.matnr = data.data | 
|                             _this.input(_this.matnr) | 
|                         }, | 
|                     }, | 
|                  | 
|                  | 
|                 }); | 
|             } | 
|              | 
|         } | 
|     } | 
| </script> | 
|   | 
| <style> | 
|     @import url('../../../static/css/common/order.css'); | 
| </style> |