订单发货相关调整

This commit is contained in:
@fawn-nine
2023-10-27 15:51:16 +08:00
parent cdc801e32f
commit 75b5c6ae0f
9 changed files with 23940 additions and 359 deletions

View File

@@ -2,33 +2,35 @@
<view class="">
<view class="header">
<!-- 顶部导航栏 -->
<z-nav-bar title="物流详情" bgColor="red"></z-nav-bar>
<z-nav-bar title="物流详情"></z-nav-bar>
</view>
<view v-if="deliverList.length > 0">
<u-tabs active-color="#2979ff" inactive-color="#606266" bar-height="6" bar-width="40"
name="name" :list="deliverList" :is-scroll="false" :current="current" @change="tabchange"></u-tabs>
<view v-if="deliverDetails.length > 0">
<!-- <u-tabs active-color="#2979ff" inactive-color="#606266" bar-height="6" bar-width="40"
name="name" :list="deliverList" :is-scroll="false" :current="current" @change="tabchange"></u-tabs> -->
<view class="deliverCntent">
<view class="" v-for="(list, index1) in deliverDetails" :key="index1">
<view v-show="index1 == current">
<view class="kuaidiItem">{{list.ShipperName}} {{list.LogisticCode}} <u-tag @click="copyData(list.LogisticCode)" class="copyCode" text="复制" plain type="success" /></view>
<view class="item" v-for="(item, index) in list.Traces">
<view class="">
<view class="kuaidiItem">{{expressCompanyName}} {{expressOrderSn}}
<u-tag @click="copyData(expressOrderSn)" class="copyCode" text="复制" plain type="success" /></view>
<view v-for="(item, index) in deliverDetails" :class="['item',index == 0 ? 'first':'' ]">
<view class="flexbox">
<view class="img_icon "></view>
<view class="wuliu">
<view class="time">{{item.AcceptTime}}</view>
<view class="content">{{item.AcceptStation}}</view>
<view class="time">{{item.acceptTime}}</view>
<view class="content">{{item.acceptStation}}</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="quesheng" v-else>
<image src="../../static/icon/kongbai.png" ></image>
<text>- 暂无物流信息 -</text>
</view>
<music-play :playData="playData"></music-play>
<public-module></public-module>
<!-- <u-loading color="red" :show="loading"></u-loading> -->
</view>
</template>
@@ -50,16 +52,30 @@
deliverDetails: [{
Traces: []
}],
express:{}, // 面单
consignee:{}, // 收件人信息
expressOrderSn:'', // 运单号
expressCompanyCode:'', //快递编码
expressCompanyName:'' ,// 快递公司
orderSn : '',
current: 0,
deliverList: [],
deliverDetailsLength: null
deliverDetailsLength: null,
orderContet:{},
sheetList:[]
}
},
onLoad(e) {
this.orderId = e.objId
this.expressOrderSn = e.expressOrderSn
this.expressCompanyCode = e.expressCompanyCode
this.expressCompanyName = e.expressCompanyName
//this.express = e.express
//this.consignee = e.consignee
console.log(e,'传入的参数')
this.orderSn = e.orderSn
},
onShow() {
this.getdeliverDetails()
this.getOrderList()
},
computed: {
...mapState(['userInfo']),
@@ -67,7 +83,60 @@
components:{
musicPlay
},
methods: {
methods: {
// 获取订单列表
getOrderList() {
console.log('this.orderType',this.orderType)
this.$http
// .get(`book/buyOrder/getOrderInfo?orderId=${this.orderID}`)
.get(`/book/buyOrder/orderDetail?orderSn=${this.orderSn}`)
.then(res => {
console.log('订单详情',res)
var seconds = res.result.timestamp + 30 * 60 + 2 // 过期时间
var nowSeconds = Math.floor(new Date().getTime() / 1000);
res.result.overTime = seconds - nowSeconds
this.orderContet = res.result
//this.userRecordid = res.userRecordid
this.productIDs = res.result.goodsList.map(item => {
return item.buyOrderProductId
})
// console.log(this.orderContet,'this.orderContet')
if (this.orderContet.orderStatus == 0) {
this.titleStat = '待支付'
} else if (this.orderContet.orderStatus == 1) {
this.titleStat = '待发货'
} else if (this.orderContet.orderStatus == 2) {
this.titleStat = '待收货'
} else if (this.orderContet.orderStatus == 3) {
this.titleStat = '已完成'
}
if(parseInt(this.orderContet.orderStatus) >= 2){
this.getdeliverDetails()
// 查询快递信息
// this.getSheetInfo()
}
console.log(this.orderContet,'订单详情')
})
},
// getSheetInfo(){
// console.log('查询快递信息')
// this.$http
// .get(`express/getPrintTemplateList?expressOrderSn=${this.orderSn}`)
// .then(res => {
// if(res.code == 0){
// this.sheetList = res.result.data
// console.log(res,'面单信息')
// this.getdeliverDetails()
// }
// }).catch(e => {
// console.log('e',e)
// })
// },
// 复制到剪切板
copyData(data){
uni.setClipboardData({
@@ -84,21 +153,30 @@
// 获取物流
getdeliverDetails() {
this.deliverList = []
var strLength = this.orderContet.consignee.consigneeMobile.length
var subMobile = this.orderContet.consignee.consigneeMobile.substring(strLength-4,strLength)
// this.expressOrderSn = 'SF1504651506851'
// this.expressCompanyCode = 'SF'
// subMobile = '9277'
uni.showLoading()
this.$http
.post(`/book/buyOrder/queryFMS?orderId=${this.orderId}`)
//.post(`/book/buyOrder/queryFMS?orderId=${this.orderId}`)
.get(`/book/buyOrder/queryExpress?expressOrderSn=${this.expressOrderSn}&expressCompanyCode=${this.expressCompanyCode}&customerName=${subMobile}`)
.then(res => {
console.log(res, '物流信息')
if (res && res.code === 0) {
uni.hideLoading()
this.deliverDetails = res.rntStr
// console.log(res.rntStr,'物流信息')
res.rntStr.forEach((item, index) => {
item.Traces = item.Traces.reverse()
//console.log(item)
this.deliverList.push({'name':item.ShipperName})
})
// this.deliverDetails = res.result.traces
console.log(res.result.traces,'物流信息')
// res.rntStr.forEach((item, index) => {
this.deliverDetails = res.result.traces.reverse()
// item.Traces = item.Traces.reverse()
// //console.log(item)
// this.deliverList.push({'name':item.ShipperName})
// })
}
}).catch(e => {
console.log(e,'e')
})
},
@@ -154,8 +232,7 @@
.item {
padding-left: 10px;
position: relative;
}
}
.item:before {
display: inline-block;
width: 10px;
@@ -173,18 +250,19 @@
font-size: 28rpx;
margin-bottom: 5px
}
.first{
color: #55aa7f;
}
.content {
padding-bottom: 14px;
}
}
.flexbox {
display: flex;
}
.img_icon {
padding-right: 5px;
padding-right: 30rpx;
}
.moreBtnF {