You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
246 lines
7.5 KiB
246 lines
7.5 KiB
<template>
|
|
<view>
|
|
<view class="search" style="position: fixed;top: 0;z-index: 99;">
|
|
<uni-datetime-picker style="margin-bottom:10px;" v-model="range" @change="searchList" type="daterange" />
|
|
<uni-search-bar class="uni-mt-10" radius="5" placeholder="输入客户名称/销售人员搜索" cancelButton="none"
|
|
@confirm="searchList" />
|
|
</view>
|
|
<!-- <u-alert description="点击列表可跳转至销售单" type="primary"></u-alert> -->
|
|
<view class="u-transition" style="display:flex;background: #ecf5ff;width: 100%;color: #5fd9ee;height: 80rpx;line-height: 80rpx;padding-left: 20rpx;">
|
|
<view>点击列表可跳转至销售单</view>
|
|
<!-- <view @tap.stop="printCodeBtn" class="dayin-text" v-if="btnStatus">打印商品码</view>
|
|
<view @tap.stop="printCodeBtn" class="dayin-text" v-else>取消操作</view> -->
|
|
</view>
|
|
<view class="ulList" v-if="inventoryList.length > 0" style="overflow: scroll;margin-top:300rpx;">
|
|
<ul :style="{'margin-bottom':btnStatus==false?'160rpx':''}">
|
|
<li v-for="item in inventoryList">
|
|
<checkbox-group @change="checkboxChange">
|
|
<label class="uni-list-cell uni-list-cell-pd" >
|
|
<checkbox v-if="btnStatus==false" :value="item" style="float: left;width: 60rpx;line-height: 300rpx;margin: 0 20rpx;" />
|
|
<view :style="{width:btnStatus==false?'95%':'100%'}" @tap="gotoDetail(item.id)">
|
|
<uni-card :title="item.userName == null ?'暂无':item.userName" :sub-title="item.createTime == null ?'暂无':item.createTime" :extra="'数量:'+(item.productCount == null ?'暂无':item.productCount)"
|
|
:thumbnail="item.saleDetailDTOList[0].productPicture">
|
|
<view class="uni-body"><text class="cardText">销售员:</text> {{item.createByName == null ?'暂无':item.createByName}}</view>
|
|
<view class="uni-body"> <text class="cardText"> 营业额:</text> <text class="priceText">
|
|
{{item.realAmount == null ?'暂无':item.realAmount}} </text> <text decode class="cardText">
|
|
{{' 欠款: '}} </text> <text class="priceText">{{item.noEarn == null ?'暂无':item.noEarn}}
|
|
</text></view>
|
|
<view class="uni-body"> <text class="cardText">
|
|
订单状态:</text>{{item.status == '0' ?'待抢单' :item.status == '1' ?'待取货':item.status == '2' ?'作废' :item.status == '3' ?'待送达' :item.status == '4' ?'已完成' :item.status == '5' ?'下游客户待退货' :item.status == '00' ?'退货待抢单' :item.status == '01' ?'退货待取货' :item.status == '03' ?'退货待送达' :item.status == '04' ?'待确认退货' :item.status == '6' ?'待配货' :'挂单'}}
|
|
</view>
|
|
<view class="floatRight" v-if="item.status == 6" @tap.stop="goSaleGoods(item)">去开单</view>
|
|
<view class="floatRight" style="color: red;width: 150rpx;" @tap.stop="delItemModal(item)" v-if="item.status == 6">删除订单</view>
|
|
</uni-card>
|
|
</view>
|
|
</label>
|
|
</checkbox-group>
|
|
</li>
|
|
<u-loadmore :status="status" />
|
|
</ul>
|
|
|
|
</view>
|
|
<u-empty v-else mode="order" margin-top="200"></u-empty>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
searchStr: '',
|
|
type: '',
|
|
inventoryList: [],
|
|
status: 'loadmore',
|
|
page: 1,
|
|
totalPages: 0,
|
|
// type:'',
|
|
range:[],
|
|
btnStatus:true
|
|
};
|
|
},
|
|
onLoad(options) {
|
|
this.type = options.type;
|
|
this.listStatus = options.listStatus
|
|
|
|
},
|
|
onShow(){
|
|
this.getOrderInfoList()
|
|
},
|
|
onReachBottom() {
|
|
if (this.page >= this.totalPages) return;
|
|
this.status = 'loading';
|
|
this.page = ++this.page;
|
|
this.getOrderInfoList();
|
|
},
|
|
methods: {
|
|
gotoDetail(id) {
|
|
this.page = 1
|
|
uni.navigateTo({
|
|
url: '/pages/index/orderDetail?id=' + id
|
|
})
|
|
},
|
|
searchList(res) {
|
|
this.searchStr = res.value
|
|
this.page = 1;
|
|
this.inventoryList = [];
|
|
this.getOrderInfoList()
|
|
},
|
|
// 订单查询
|
|
getOrderInfoList() {
|
|
this.status = 'loading';
|
|
this.tui.request("/app/sale/listPages", "POST", {
|
|
pageVo: {
|
|
pageSize: 10,
|
|
pageNumber: this.page
|
|
},
|
|
startTime:this.range[0],
|
|
endTime:this.range[1],
|
|
searchStr:this.searchStr,
|
|
status:this.listStatus
|
|
}, false, false).then((res) => {
|
|
this.status = 'nomore';
|
|
if (res.code == 200) {
|
|
if (this.page == 1) {
|
|
this.inventoryList = res.result.records
|
|
} else {
|
|
this.inventoryList = [...this.inventoryList, ...res.result.records]
|
|
}
|
|
this.totalPages = res.result.pages
|
|
} else {
|
|
this.tui.toast(res.message)
|
|
}
|
|
}).catch((res) => {})
|
|
},
|
|
//带参数跳转到开单页
|
|
goSaleGoods(item) {
|
|
let dataList = []
|
|
for (let i=0;i<item.saleDetailDTOList.length;i++) {
|
|
let obj = {}
|
|
obj.saleDetailQueryDTO = item.saleDetailDTOList[i].stockLogList1
|
|
obj.id = item.saleDetailDTOList[i].productId
|
|
obj.lsprice = item.saleDetailDTOList[i].price
|
|
obj.num = item.saleDetailDTOList[i].productCount
|
|
obj.price = item.saleDetailDTOList[i].discountAmount
|
|
obj.unitPrice = item.saleDetailDTOList[i].realPrice
|
|
obj.productName = item.saleDetailDTOList[i].productName
|
|
obj.productPicture = item.saleDetailDTOList[i].productPicture+'?time='+new Date().getTime()
|
|
obj.productSn = item.saleDetailDTOList[i].productSn
|
|
obj.wholesalePrice = item.saleDetailDTOList[i].wholesalePrice
|
|
obj.saleId = item.saleDetailDTOList[i].saleId
|
|
obj.remark = item.remark
|
|
obj.xsyId = item.createBy
|
|
obj.createByName = item.createByName
|
|
dataList.push(obj)
|
|
}
|
|
item.name = item.userName;
|
|
item.id = item.userId
|
|
uni.setStorageSync('khName',JSON.stringify(item))
|
|
uni.setStorageSync('carList1',JSON.stringify(dataList))
|
|
uni.switchTab({
|
|
url: '/pages/inventory/goodsList1'
|
|
})
|
|
},
|
|
//点击打印按钮
|
|
printCodeBtn(){
|
|
this.btnStatus = !this.btnStatus
|
|
},
|
|
// checkboxChange(e){
|
|
// console.log(JSON.parse(e.detail.value))
|
|
// },
|
|
delItemModal(item) {
|
|
|
|
let that = this;
|
|
uni.showModal({
|
|
title: "提示",
|
|
content: "确定删除此条待配货订单吗?",
|
|
success: function(res) {
|
|
if (res.confirm) {
|
|
that.tui.request("/app/sale/delById", "post", {
|
|
id: item.id,
|
|
}, false, true).then((res) => {
|
|
if (res.code == 200) {
|
|
that.getOrderInfoList();
|
|
uni.showToast({
|
|
title:"删除成功",
|
|
icon: 'none'
|
|
})
|
|
} else {
|
|
uni.showToast({
|
|
title:"删除失败",
|
|
icon: 'none'
|
|
})
|
|
}
|
|
}).catch((res) => {})
|
|
}
|
|
}
|
|
})
|
|
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.u-transition{
|
|
width: 100%;
|
|
position: fixed;
|
|
top: 226rpx;
|
|
z-index: 99;
|
|
}
|
|
.search {
|
|
padding: 20upx;
|
|
background-color: #fff;
|
|
width: 100%;
|
|
background-color: #fff;
|
|
}
|
|
.uni-searchbar{
|
|
padding: 20rpx 0 !important;
|
|
}
|
|
.dayin-text{
|
|
flex: 1;
|
|
text-align: right;
|
|
padding-right: 20rpx;
|
|
text-decoration: underline;
|
|
color: blue;
|
|
}
|
|
.ulList {
|
|
|
|
ul {
|
|
li {
|
|
font-size: 12px;
|
|
|
|
.floatRight {
|
|
float: right;
|
|
padding: 14rpx;
|
|
color: $u-primary;
|
|
font-size: 26upx;
|
|
}
|
|
|
|
.cardText {
|
|
font-size: 12px;
|
|
}
|
|
|
|
.priceText {
|
|
color: $u-primary;
|
|
font-size: 14px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.order-bottom{
|
|
background: #fff;
|
|
height: 120rpx;
|
|
width: 100%;
|
|
position: fixed;
|
|
bottom:0;
|
|
|
|
button{
|
|
width: 90%;
|
|
height: 80rpx;
|
|
margin: 0 auto;
|
|
background: #088FEB;
|
|
color: #fff;
|
|
margin-top: 20rpx;
|
|
}
|
|
}
|
|
</style>
|