|
|
@ -33,8 +33,8 @@ |
|
|
|
<view class="line"> |
|
|
|
<view class="line"> |
|
|
|
<text class="name">订单内容:</text> |
|
|
|
<text class="name">订单内容:</text> |
|
|
|
<view class="val ell-wrap"> |
|
|
|
<view class="val ell-wrap"> |
|
|
|
<view :class="{ell: !item.toggle}">{{ item.orderContent }}</view> |
|
|
|
<view :class="{ell: !item.toggle}">{{ item.productName }}</view> |
|
|
|
<view v-if="item.orderContent.length > 14" class="toggle" @click.stop="toggle(item)">{{ item.toggle ? '收起' : '展开' }}</view> |
|
|
|
<view v-if="item.productName.length > 14" class="toggle" @click.stop="toggle(item)">{{ item.toggle ? '收起' : '展开' }}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="line"> |
|
|
|
<view class="line"> |
|
|
@ -50,6 +50,7 @@ |
|
|
|
</uni-swipe-action-item> |
|
|
|
</uni-swipe-action-item> |
|
|
|
</uni-swipe-action> |
|
|
|
</uni-swipe-action> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<uni-load-more :status="status" /> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<empty v-else></empty> |
|
|
|
<empty v-else></empty> |
|
|
|
|
|
|
|
|
|
|
@ -59,7 +60,7 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import { orderList, del } from '@/apis/modules/order.js' |
|
|
|
import { miniProgramOrderRecord, del } from '@/apis/modules/order.js' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
@ -86,13 +87,13 @@ |
|
|
|
], |
|
|
|
], |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
], |
|
|
|
|
|
|
|
reachBottom: 0, // 是否是上拉加载。0->否,1->是,-1->加载完所有数据 |
|
|
|
|
|
|
|
status: 'more', // 上拉加载状态 more|loading|noMore |
|
|
|
filterForm: {}, |
|
|
|
filterForm: {}, |
|
|
|
isFilter: 0, // 是否是在筛选。0->否,1->是 |
|
|
|
|
|
|
|
searchTimer: null, |
|
|
|
searchTimer: null, |
|
|
|
orderStatus: '', |
|
|
|
orderStatus: '', |
|
|
|
keyword: '', |
|
|
|
keyword: '', |
|
|
|
list: [], |
|
|
|
list: [], |
|
|
|
listAll: [], |
|
|
|
|
|
|
|
page: 1, |
|
|
|
page: 1, |
|
|
|
pageSize: 10, |
|
|
|
pageSize: 10, |
|
|
|
delOption: [{ |
|
|
|
delOption: [{ |
|
|
@ -107,10 +108,18 @@ |
|
|
|
keyword () { |
|
|
|
keyword () { |
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
this.filter() |
|
|
|
this.initList() |
|
|
|
}, 500) |
|
|
|
}, 500) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 上拉加载 |
|
|
|
|
|
|
|
onReachBottom() { |
|
|
|
|
|
|
|
if (this.reachBottom >= 0) { |
|
|
|
|
|
|
|
this.reachBottom = 1 |
|
|
|
|
|
|
|
this.status = 'loading' |
|
|
|
|
|
|
|
this.getList() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
// 下拉刷新 |
|
|
|
// 下拉刷新 |
|
|
|
onPullDownRefresh() { |
|
|
|
onPullDownRefresh() { |
|
|
|
this.getList() |
|
|
|
this.getList() |
|
|
@ -123,23 +132,42 @@ |
|
|
|
const { options } = pages[pages.length - 1] |
|
|
|
const { options } = pages[pages.length - 1] |
|
|
|
this.customerId = options.customerId |
|
|
|
this.customerId = options.customerId |
|
|
|
this.customerName = options.name |
|
|
|
this.customerName = options.name |
|
|
|
this.getList() |
|
|
|
// this.initList() |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
getList() { |
|
|
|
getList() { |
|
|
|
orderList({ |
|
|
|
uni.showLoading({ |
|
|
|
cityId: '', |
|
|
|
title: '加载中' |
|
|
|
customerName: this.customerName, |
|
|
|
}) |
|
|
|
|
|
|
|
const team = uni.getStorageSync('team') |
|
|
|
|
|
|
|
miniProgramOrderRecord({ |
|
|
|
|
|
|
|
businessManagerId: this.$util.getBmId(), |
|
|
|
|
|
|
|
teamId: team.id, |
|
|
|
|
|
|
|
customerId: this.customerId, |
|
|
|
orderStatus: this.orderStatus, |
|
|
|
orderStatus: this.orderStatus, |
|
|
|
orderType: '', |
|
|
|
isAdmin: +team.isTeam, // 是否是管理员(0否 1是) |
|
|
|
pageNo: 1, |
|
|
|
pageNum: this.page, |
|
|
|
pageSize: 10000, |
|
|
|
pageSize: this.pageSize, |
|
|
|
provinceId: '' |
|
|
|
keywords: this.keyword |
|
|
|
}).then(({ orderPage }) => { |
|
|
|
}).then(({ data }) => { |
|
|
|
const { orders } = orderPage |
|
|
|
const { records } = data |
|
|
|
this.list = orders |
|
|
|
records.map(e => { |
|
|
|
this.listAll = orders |
|
|
|
e.toggle = e.productName.length < 14 // 超过了14个字才需要显示展开按钮 |
|
|
|
}).catch(e => {}) |
|
|
|
}) |
|
|
|
|
|
|
|
this.list = this.reachBottom > 0 ? [...this.list, ...records] : records |
|
|
|
|
|
|
|
this.page++ // 每次获取了数据后page+1 |
|
|
|
|
|
|
|
const noMore = this.list.length === data.total // 是否加载完所有数据 |
|
|
|
|
|
|
|
this.status = noMore ? 'noMore' : 'more' // 加载完了则设置为noMore |
|
|
|
|
|
|
|
this.reachBottom = noMore ? -1 : 0 // 加载完了则设置为-1 |
|
|
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
|
|
}).catch(e => { |
|
|
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
initList() { |
|
|
|
|
|
|
|
this.page = 1 |
|
|
|
|
|
|
|
this.reachBottom = 0 |
|
|
|
|
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 展开 |
|
|
|
// 展开 |
|
|
|
toggle(item) { |
|
|
|
toggle(item) { |
|
|
@ -149,13 +177,7 @@ |
|
|
|
subFinsh(val) { |
|
|
|
subFinsh(val) { |
|
|
|
const { orderStatus } = val |
|
|
|
const { orderStatus } = val |
|
|
|
this.orderStatus = orderStatus.length ? orderStatus[0] : '' |
|
|
|
this.orderStatus = orderStatus.length ? orderStatus[0] : '' |
|
|
|
this.getList() |
|
|
|
this.initList() |
|
|
|
}, |
|
|
|
|
|
|
|
// 筛选 |
|
|
|
|
|
|
|
filter() { |
|
|
|
|
|
|
|
const list = this.listAll |
|
|
|
|
|
|
|
const { keyword } = this |
|
|
|
|
|
|
|
this.list = list.filter(e => e.orderNumber.includes(keyword) || e.orderContent.includes(keyword)) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// 跳转详情 |
|
|
|
// 跳转详情 |
|
|
|
toDetail(item) { |
|
|
|
toDetail(item) { |
|
|
|