| | |
| | | <template> |
| | | <view> |
| | | <scroll-view> |
| | | <view class="demo-tab"> |
| | | <checkbox-group @change="checkbox"> |
| | | <label v-for="(item,index) in data" :key="index" class="demo-list" :class="item.checked"> |
| | | <view class="demo-list-left"><checkbox :value="index+''" :checked="item.checked" /> |
| | | </view> |
| | | <view class="demo-list-right"> |
| | | <view><text style="width: 90rpx;">订单 | </text>{{item.orderNo}}<text>序号:{{index+1}}</text></view> |
| | | <view><text>商品编码:</text>{{item.matnr}}</view> |
| | | <view><text>应入数量:</text><view class="text-num">{{item.anfme}}</view><text>商品名称:</text>{{item.maktx}}</view> |
| | | <view><text>已入数量:</text><view class="text-num">{{item.inQty}}</view><text>订单状态:</text>{{item.state$}}</view> |
| | | </view> |
| | | </label> |
| | | </checkbox-group> |
| | | <!-- 搜索栏 --> |
| | | <view> |
| | | <view class="cu-bar bg-white search"> |
| | | <view class="search-form radius"> |
| | | <text class="cuIcon-search"></text> |
| | | <input v-model="orderNo" :adjust-position="false" type="text" placeholder="扫码 / 输入 (单据编号)" confirm-type="search" @input="search()"></input> |
| | | <text class="cuIcon-close" @click="reset()"></text> |
| | | </view> |
| | | <view class="action"> |
| | | <button class="cu-btn bg-yellow" style="color: #fff;">搜 索</button> |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | | <view class="foot flex justify-around"> |
| | | <button class="cu-btn bg-yellow lg">上架</button> |
| | | <button class="cu-btn bg-yellow lg">撤销上架</button> |
| | | </view> |
| | | <view class="margin-top"> |
| | | <uni-table border stripe type="selection" emptyText="没有更多数据"> |
| | | <!-- 表头 --> |
| | | <uni-tr > |
| | | <uni-th align="center" width="200">订单</uni-th> |
| | | <uni-th align="center">应入库量</uni-th> |
| | | <uni-th align="center">已入库量</uni-th> |
| | | <uni-th align="center" width="200">商品编码</uni-th> |
| | | <uni-th align="center">商品名称</uni-th> |
| | | <uni-th align="center">订单状态</uni-th> |
| | | <uni-th align="center"width="200">操作</uni-th> |
| | | </uni-tr> |
| | | <!-- 表体 --> |
| | | <uni-tr v-for="(item, index) in tabData" :key="index"> |
| | | <uni-td align="center">{{item.orderNo}}</uni-td> |
| | | <uni-td align="center">{{item.anfme}}</uni-td> |
| | | <uni-td align="center">{{item.inQty}}</uni-td> |
| | | <uni-td align="center">{{item.matnr}}</uni-td> |
| | | <uni-td align="center">{{item.maktx}}</uni-td> |
| | | <uni-td align="center">{{item.state$}}</uni-td> |
| | | <uni-td> |
| | | <view class="flex justify-around"> |
| | | <button class="cu-btn bg-orange sm">上 架</button> |
| | | <button class="cu-btn bg-red sm">撤销上架</button> |
| | | </view> |
| | | </uni-td> |
| | | </uni-tr> |
| | | </uni-table> |
| | | </view> |
| | | </view> |
| | | </template> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | data: [], |
| | | background:'unCheck', |
| | | color:'' |
| | | tabData: [], |
| | | searchData: {}, |
| | | orderNo: '', |
| | | needData:{}, |
| | | } |
| | | }, |
| | | mounted() { |
| | | mounted(){ |
| | | const UIP = uni.getStorageSync('UIP'); |
| | | this.baseIP = UIP; |
| | | const UPORT = uni.getStorageSync('UPORT'); |
| | | this.basePORT = UPORT; |
| | | this.render() |
| | | }, |
| | | onLoad() { |
| | | |
| | | }, |
| | | methods: { |
| | | // 搜索 |
| | | search() { |
| | | let that = this; |
| | | // that.tabData.forEach(function(e){ |
| | | // that.searchData = e.orderNo |
| | | // }) |
| | | this.render(that.orderNo) |
| | | }, |
| | | // 重置 |
| | | reset() { |
| | | let that = this; |
| | | that.orderNo = ''; |
| | | that.needData['order_no'] = ''; |
| | | that.getData(); |
| | | }, |
| | | // 获取表格数据 |
| | | getData() { |
| | | let that = this |
| | | uni.request({ |
| | | url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + "/receiveDetl/list/auth", |
| | | header:{'token':uni.getStorageSync('token')}, |
| | | data: that.needData, |
| | | success(res) { |
| | | var res = res.data |
| | | if (res.code === 200) { |
| | | that.tabData = res.data.records |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 表格加载 |
| | | render(param) { |
| | | let that = this; |
| | |
| | | that.getData(); |
| | | } |
| | | |
| | | }, |
| | | getData() { |
| | | let that = this |
| | | uni.request({ |
| | | url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + "/receiveDetl/list/auth", |
| | | header:{'token':uni.getStorageSync('token')}, |
| | | data: that.needData, |
| | | success(res) { |
| | | var res = res.data |
| | | if (res.code === 200) { |
| | | that.data = res.data.records |
| | | that.setCheck() |
| | | |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | setCheck() { |
| | | for (var i = 0; i < this.data.length; i++) { |
| | | var key = 'checked', |
| | | value = null |
| | | this.data[i][key] = value |
| | | } |
| | | }, |
| | | checkbox: function (e) { |
| | | var val = e.detail.value |
| | | for (var i = 0; i < val.length; i++) { |
| | | val[i] = parseInt(val[i]) |
| | | this.data[val[i]].checked = 'blue' |
| | | |
| | | } |
| | | |
| | | }, |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | .bg-false { |
| | | background-color: #FFFFFF; |
| | | } |
| | | .bg-true { |
| | | background-color: #55ffff; |
| | | } |
| | | .demo-tab { |
| | | } |
| | | .demo-list { |
| | | |
| | | border-bottom: 1px solid #d8d8d8; |
| | | height: 160rpx; |
| | | } |
| | | .demo-list:last-child { |
| | | margin-bottom: 99rpx; |
| | | } |
| | | label { |
| | | display: block; |
| | | } |
| | | .demo-list-left { |
| | | display: inline-block; |
| | | width: 100rpx; |
| | | text-align: center; |
| | | height: 150rpx; |
| | | line-height: 150rpx; |
| | | } |
| | | .demo-list-right { |
| | | display: inline-block; |
| | | width: 650rpx; |
| | | float: right; |
| | | } |
| | | |
| | | .demo-list-right text { |
| | | display: inline-block; |
| | | width: 150rpx; |
| | | } |
| | | .text-num { |
| | | display: inline-block; |
| | | width: 90rpx; |
| | | } |
| | | |
| | | .foot { |
| | | width: 100%; |
| | | height: 100rpx; |
| | | line-height: 100rpx; |
| | | background-color: #ffffff; |
| | | position: fixed; |
| | | bottom: 0; |
| | | border-top: 1rpx solid #d8d8d8; |
| | | } |
| | | checkbox { |
| | | /* transform:scale(0.7) */ |
| | | } |
| | | |
| | | </style> |