uu
This commit is contained in:
parent
98bff94c5f
commit
95be213f41
105
components/buns-post-detail-templates/bpd-send-site-tmp.vue
Normal file
105
components/buns-post-detail-templates/bpd-send-site-tmp.vue
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
<template>
|
||||||
|
<u-row justify="between">
|
||||||
|
<u-row @click="setClipboardData(modelInfo.billCode)">
|
||||||
|
<view>
|
||||||
|
<u-text v-if="modelInfo.billCode" :text="`运单号:${modelInfo.billCode}` " size="26"></u-text>
|
||||||
|
<u-text v-else :text="`订单号:${modelInfo.orderSn}` " size="26"></u-text>
|
||||||
|
</view>
|
||||||
|
<view class="pl-10">
|
||||||
|
<u-icon name="file-text" size="32" custom-style=""></u-icon>
|
||||||
|
</view>
|
||||||
|
</u-row>
|
||||||
|
<view>
|
||||||
|
<view v-if="showInfoBtn" @click="goto(`post/detail?billCode=${modelInfo.billCode}`)" class="com-tag-grey">
|
||||||
|
运单信息
|
||||||
|
</view>
|
||||||
|
<tpx-text-dic v-if="false" :value="modelInfo.orderStatus" :list="dicData.emis_order_status" ></tpx-text-dic>
|
||||||
|
</view>
|
||||||
|
</u-row>
|
||||||
|
|
||||||
|
<view >
|
||||||
|
<u-row custom-style="margin-top: 30rpx;" justify="center">
|
||||||
|
<u-col span="4">
|
||||||
|
<u-text :text="(modelInfo.sendSiteName)||'-'" size="30" :bold="true" align="center"></u-text>
|
||||||
|
</u-col>
|
||||||
|
<u-col span="4" justify="center" align="center" custom-style="text-align: center;">
|
||||||
|
<view>
|
||||||
|
<tpx-text-dic :value="modelInfo.waybillStatus" :list="dicData.emis_waybill_status" ></tpx-text-dic>
|
||||||
|
</view>
|
||||||
|
<image style="width: 70rpx;height: 14rpx;" :src="getCdnUrl('search/toline.png')">
|
||||||
|
</image>
|
||||||
|
<!-- getCdnUrl('post/toline-grey.png') -->
|
||||||
|
<view class="mt-10">
|
||||||
|
<text>{{modelInfo.productTypeName}}</text>
|
||||||
|
</view>
|
||||||
|
</u-col>
|
||||||
|
<u-col span="4">
|
||||||
|
<u-text :text="(modelInfo.dispatchUnderlingSiteName)||'-'" size="30" :bold="true" align="center"></u-text>
|
||||||
|
</u-col>
|
||||||
|
</u-row>
|
||||||
|
|
||||||
|
<u-text :text="`预计送达时间:${modelInfo.estimateDate || '-'}`" color="#999" size="24"
|
||||||
|
margin="30rpx 0 0 0"></u-text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
computed: {
|
||||||
|
modelInfo: {
|
||||||
|
get() {
|
||||||
|
return this.value
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sender() {
|
||||||
|
let obj = JSON.parse(JSON.stringify(this.value?.sender || this.value || {}))
|
||||||
|
obj.countryName = obj.sendCountryName || obj.countryName
|
||||||
|
obj.provinceName = obj.sendProvinceName || obj.provinceName
|
||||||
|
obj.name = obj.sendName || obj.name
|
||||||
|
return obj
|
||||||
|
},
|
||||||
|
reciever() {
|
||||||
|
let obj = JSON.parse(JSON.stringify(this.value?.reciever || this.value || {}))
|
||||||
|
obj.countryName = obj.receiveCountryName || obj.countryName
|
||||||
|
obj.provinceName = obj.receiveProvinceName || obj.provinceName
|
||||||
|
obj.name = obj.receiveName || obj.name
|
||||||
|
return obj
|
||||||
|
},
|
||||||
|
dicData() {
|
||||||
|
return this.$store.getters.dicData
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
value: {
|
||||||
|
default () {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showInfoBtn: {
|
||||||
|
default () {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
|
||||||
|
},
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
unmounted() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -8,13 +8,20 @@
|
|||||||
@change="handleScanValChange" iconPos="right"></tpx-scan-input>
|
@change="handleScanValChange" iconPos="right"></tpx-scan-input>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
|
<view v-if="historyList && historyList.length > 0" class="pgb-header mt-20" style="padding-bottom: 10rpx;">
|
||||||
|
<view class="com-jianju">
|
||||||
|
<tpx-tags :list="historyList" @onItemClick="handleHisItem"></tpx-tags>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<div v-if="modelInfo.billCode" style="min-height: 100%;display: flex;flex-direction: column;">
|
<div v-if="modelInfo.billCode" style="min-height: 100%;display: flex;flex-direction: column;">
|
||||||
<view style="position: relative;">
|
<view style="position: relative;">
|
||||||
|
|
||||||
<view class="mp-aside">
|
<view class="mp-aside">
|
||||||
<bpd-send-reciever-tmp :value="modelInfo" :showInfoBtn="false" :hideDetail="true"></bpd-send-reciever-tmp>
|
<bpd-send-site-tmp :value="modelInfo" :showInfoBtn="canViewImg" ></bpd-send-site-tmp>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="mp-aside">
|
<view class="mp-aside">
|
||||||
@ -78,9 +85,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import dayjs from "dayjs"
|
||||||
import { debounce } from "@/common/util"
|
import { debounce } from "@/common/util"
|
||||||
import * as apiService from "@/common/api"
|
import * as apiService from "@/common/api"
|
||||||
import BpdSendRecieverTmp from "@/components/buns-post-detail-templates/bpd-send-reciever-tmp"
|
import { setSessionSystemInfo, getSessionSystemInfo } from "@/session"
|
||||||
|
import BpdSendSiteTmp from "@/components/buns-post-detail-templates/bpd-send-site-tmp"
|
||||||
import BpdPicPreviewTmp from "@/components/buns-post-detail-templates/bpd-pic-preview-tmp"
|
import BpdPicPreviewTmp from "@/components/buns-post-detail-templates/bpd-pic-preview-tmp"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -94,7 +103,7 @@
|
|||||||
return this.$store.getters.dicData
|
return this.$store.getters.dicData
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
components: { BpdSendRecieverTmp, BpdPicPreviewTmp },
|
components: { BpdSendSiteTmp, BpdPicPreviewTmp, },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
canViewImg: false,
|
canViewImg: false,
|
||||||
@ -107,6 +116,7 @@
|
|||||||
danCheckModal: {
|
danCheckModal: {
|
||||||
show: false
|
show: false
|
||||||
},
|
},
|
||||||
|
historyList: getSessionSystemInfo()?.postQueryHistory || [],
|
||||||
searchParam: {
|
searchParam: {
|
||||||
billCode: ''
|
billCode: ''
|
||||||
}
|
}
|
||||||
@ -131,10 +141,26 @@
|
|||||||
handleScanValChange: debounce(function(val){
|
handleScanValChange: debounce(function(val){
|
||||||
val && (this.handleSearch(val))
|
val && (this.handleSearch(val))
|
||||||
}),
|
}),
|
||||||
async handleSearch(val) {
|
handleHisItem(item){
|
||||||
|
this.searchParam.billCode = item.val
|
||||||
|
this.handleSearch()
|
||||||
|
},
|
||||||
|
async handleSearch() {
|
||||||
let res = await apiService.getOrderDetail({...this.searchParam, _loading: true})
|
let res = await apiService.getOrderDetail({...this.searchParam, _loading: true})
|
||||||
|
let resData = res.data
|
||||||
|
let maxHisLen = 5 // 最多记录个数
|
||||||
|
if(resData.billCode && this.historyList?.filter?.(t=> t.val == resData.billCode)?.length == 0) {
|
||||||
|
this.historyList.unshift({ title: resData.billCode, val: resData.billCode })
|
||||||
|
this.historyList.length > maxHisLen && (this.historyList.length = maxHisLen);
|
||||||
|
}
|
||||||
|
// 更新缓存
|
||||||
|
setSessionSystemInfo({ postQueryHistory: this.historyList })
|
||||||
|
|
||||||
|
if(resData.estimateDate){
|
||||||
|
resData.estimateDate = dayjs(resData.estimateDate).format('YYYY-MM-DD')
|
||||||
|
}
|
||||||
// 通过对象合并才能修改父级 数据
|
// 通过对象合并才能修改父级 数据
|
||||||
Object.assign(this.modelInfo, res.data || {})
|
Object.assign(this.modelInfo, resData || {})
|
||||||
// 判断是否有权限查看图片
|
// 判断是否有权限查看图片
|
||||||
this.canViewImg = this.modelInfo.customerCode == this.$store.getters.userInfo.customerCode
|
this.canViewImg = this.modelInfo.customerCode == this.$store.getters.userInfo.customerCode
|
||||||
setTimeout(()=> {
|
setTimeout(()=> {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { XTOKEN_KEY, USERINFO_KEY, BLUETOOTH_KEY, LOGININFO_KEY } from "./key"
|
import { XTOKEN_KEY, USERINFO_KEY, BLUETOOTH_KEY, LOGININFO_KEY, SYSTEM_INFO_KEY } from "./key"
|
||||||
|
|
||||||
export const setSessionXToken = (val = '')=> {
|
export const setSessionXToken = (val = '')=> {
|
||||||
uni.setStorageSync(XTOKEN_KEY, val)
|
uni.setStorageSync(XTOKEN_KEY, val)
|
||||||
@ -34,3 +34,17 @@ export const getSessionLoginInfo = ()=> {
|
|||||||
remberPassport: []
|
remberPassport: []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const setSessionSystemInfo = (val = {})=> {
|
||||||
|
let oldVal = getSessionSystemInfo()
|
||||||
|
// {
|
||||||
|
// postQueryHistory: [], // 快递查询历史
|
||||||
|
// }
|
||||||
|
uni.setStorageSync(SYSTEM_INFO_KEY, { ...oldVal, ...val})
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getSessionSystemInfo = ()=> {
|
||||||
|
return uni.getStorageSync(SYSTEM_INFO_KEY) || {
|
||||||
|
postQueryHistory: []
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -2,3 +2,4 @@ export const XTOKEN_KEY = 'XTOKEN_KEY'
|
|||||||
export const USERINFO_KEY = 'USERINFO_KEY'
|
export const USERINFO_KEY = 'USERINFO_KEY'
|
||||||
export const BLUETOOTH_KEY = 'BLUETOOTH_KEY'
|
export const BLUETOOTH_KEY = 'BLUETOOTH_KEY'
|
||||||
export const LOGININFO_KEY = 'LOGININFO_KEY'
|
export const LOGININFO_KEY = 'LOGININFO_KEY'
|
||||||
|
export const SYSTEM_INFO_KEY = 'SYSTEM_INFO_KEY'
|
||||||
Loading…
Reference in New Issue
Block a user