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