<template>
|
<view class="container">
|
<uni-table ref="table" :loading="loading" border stripe type="selection" emptyText="暂无更多数据"
|
@selection-change="selectionChange">
|
<uni-tr>
|
<uni-th width="40" align="center">商品 </uni-th>
|
<uni-th width="50" align="center">单价</uni-th>
|
<uni-th width="50">数量</uni-th>
|
<uni-th width="20">已发包裹 </uni-th>
|
<uni-th width="20">小计 </uni-th>
|
</uni-tr>
|
<uni-tr v-for="(item, index) in tableData" :key="index">
|
<uni-td>{{ item.date }}</uni-td>
|
<uni-td>
|
<view class="name">{{ item.name }}</view>
|
</uni-td>
|
<uni-td align="center">{{ item.address }}</uni-td>
|
<uni-td>
|
<view class="uni-group">
|
<button class="uni-button" size="mini" type="primary">修改</button>
|
<button class="uni-button" size="mini" type="warn">删除</button>
|
</view>
|
</uni-td>
|
</uni-tr>
|
</uni-table>
|
</view>
|
</template>
|
|
<script>
|
import {
|
supplierOrderDetail
|
} from '@/api/supplier.js'
|
export default {
|
data() {
|
return {
|
tableData: [],
|
loading: false,
|
selectedIndexs: []
|
|
}
|
},
|
methods: {
|
methods: {
|
// 多选处理
|
selectedItems() {
|
if(this.tableData.length == 0) return
|
return this.selectedIndexs.map(i => this.tableData[i])
|
},
|
// 多选
|
selectionChange(e) {
|
console.log(e.detail.index)
|
this.selectedIndexs = e.detail.index
|
},
|
},
|
async onLoad(query) {
|
// const {
|
// order_sn
|
// } = query
|
const order_sn = 'O202507091942755596113694720'
|
const orderDetail = await supplierOrderDetail(order_sn);
|
this.tableData = orderDetail.data.result.orderItems
|
console.log('------------------------------>', JSON.stringify(this.tableData))
|
}
|
}
|
}
|
</script>
|
|
<style>
|
</style>
|