Commit 8e475743 authored by 贺世双's avatar 贺世双

新增订单界面

parent f47e6d5d
...@@ -3,12 +3,19 @@ import uploadFile from "./uploadFile"; ...@@ -3,12 +3,19 @@ import uploadFile from "./uploadFile";
import downloadFile from "./downloadFile"; import downloadFile from "./downloadFile";
// 登录接口 // 登录接口
// mimi: 项目名:biz-carrier-wxapp LOGIN_ACTION: loginByUserInfo // mimi: 项目名:biz-carrier-wxapp LOGIN_ACTION: loginByUserInfo; miniAppDriverLogin/miniAppServLogin
export function userLogin(loginAction, loginCode, data) { export function userLogin(loginAction, loginCode, data) {
return Request( return Request(
`/api/auth/app-login/{mini}/miniAppDriverLogin?weixin_config_key={mini}&code=${loginCode}`,data `/api/auth/app-login/{mini}/miniAppDriverLogin?weixin_config_key={mini}&code=${loginCode}`,data
); );
} }
export function userCarrierLogin(loginAction, loginCode, data) {
return Request(
`/api/auth/app-login/{mini}/miniAppServLogin?weixin_config_key={mini}&code=${loginCode}`,data
);
}
//登录小程序初始化时,调用auth自动登录 //登录小程序初始化时,调用auth自动登录
export function authLogin(loginAction, loginCode, data) { export function authLogin(loginAction, loginCode, data) {
return Request( return Request(
...@@ -41,6 +48,23 @@ export function downloadImg(data) { ...@@ -41,6 +48,23 @@ export function downloadImg(data) {
return downloadFile("/api/doc/download", data); return downloadFile("/api/doc/download", data);
} }
//获取基础订单信息--订舱委托
export function getOrderBaseList(data) {
return Request(`/api/entry/{mini}/m-action/getBookingOrder`, data);
}
// 查询订舱委托订单明细
export function getOrderBaseDetail(data) {
return Request(`/api/entry/{mini}/m-action/getBookingOrderLine`, data);
}
// 查询订舱委托订单所有节点信息
export function getOrderBaseEvent(data) {
return Request(`/api/entry/{mini}/m-action/getBookingOrderBlEvent`, data);
}
//查询运单列表 //查询运单列表
export function findShipmentOrders(data) { export function findShipmentOrders(data) {
return Request( return Request(
...@@ -223,13 +247,7 @@ export function UpdateTruckInfo(data) { ...@@ -223,13 +247,7 @@ export function UpdateTruckInfo(data) {
); );
} }
//获取大宗订单
export function getMassOrderList(data) {
return Request(
`/api/entry/{mini}/m-action/biz.tm.MassOrderCarrier.tm_massordercarrier_m_search.paging`,
data
);
}
//获取大宗订单已分配车辆 //获取大宗订单已分配车辆
export function getMassOrderTruckList(data) { export function getMassOrderTruckList(data) {
......
...@@ -2,31 +2,43 @@ ...@@ -2,31 +2,43 @@
<view class="shipmentItem box_shadow_card"> <view class="shipmentItem box_shadow_card">
<view class="shipment-header flex_sb" style="padding: 28rpx 24rpx 0;"> <view class="shipment-header flex_sb" style="padding: 28rpx 24rpx 0;">
<view class="consumer_code flex_center"> <view class="consumer_code flex_center">
<text selectable> 订单号:{{propData['massOrder.orderNo'] || ''}}</text> <text selectable> 基础订单号:{{propData['order_base_no'] || ''}}</text>
</view>
<view class="consumer_code flex_center">
<text selectable>
剩余货量:{{propData['massOrder.splitMode'] === 'Weight'? propData.weight : propData.qty || '0'}}{{['massOrder.splitMode'] === 'Weight'? "kg": '件'}}</text>
</view> </view>
</view> </view>
<u-line color="#E5E5E5" margin="20rpx 0" /> <u-line color="#E5E5E5" margin="20rpx 0" />
<view style="padding: 0 24rpx 32rpx;"> <view style="padding: 0 24rpx 32rpx;" @click="toOrderDetail">
<view class="stations"> <view class=" flex_sb">
<view class="start-station flex_center"> <view style="width: 50%;float: left;">
<view class="t-icon-start-sddress t-icon" style="margin-right: 8rpx;"></view> <bs-customCell label="起运港 :" :value="propData.port_of_source_location_name" labelCol="4" wrapCol="6" />
{{propData['massOrder.originalAddress.name'] || ''}} </view>
<view style="width: 50%;float: left;">
<bs-customCell label="目的港 :" :value="propData.port_of_dest_location_name" labelCol="4" wrapCol="6" />
</view>
</view>
<view class=" flex_sb">
<view style="width: 50%;float: left;">
<bs-customCell label="订单状态 :" :value="propData.status_label" labelCol="5" wrapCol="6" />
</view>
<view style="width: 50%;float: left;">
<bs-customCell label="订舱状态 :" :value="propData.booking_status_label" labelCol="5" wrapCol="6" />
</view> </view>
<view class="end-station flex_center"> </view>
<view class="t-icon-end-sddress t-icon" style="margin-right: 8rpx;"></view> <view class=" flex_sb">
{{propData['massOrder.destinationAddress.name'] || ''}} <view style="width: 50%;float: left;">
<bs-customCell label="要求ETD :" :value="requireEtd" labelCol="5" wrapCol="6" />
</view>
<view style="width: 50%;float: left;">
<bs-customCell label="要求ETA :" :value="requireEta" labelCol="5" wrapCol="6" />
</view> </view>
</view> </view>
<bs-customCell label="接单日期 :" :value="orderDate" labelCol="3" wrapCol="6" /> <bs-customCell label="承运商 :" :value="propData.carrier" labelCol="2" wrapCol="6" />
</view> </view>
<view class="flex_cen flex_center orderItemButtonGroup"> <view class="flex_cen flex_center orderItemButtonGroup">
<button class="flex_cen flex_center" @click="onAllotCar('unMulti')">分配车辆</button> <button class="flex_cen flex_center" @click="onAllotCar('unMulti')">订舱确认</button>
<button class="flex_cen flex_center" @click="onAllotCar('multi')">分配多辆车</button> <button class="flex_cen flex_center" @click="onAllotCar('multi')">提单上传</button>
<button class="flex_cen flex_center" style="margin-top: 24rpx;" @click="onAllotCar('record')">分配记录</button> <button class="flex_cen flex_center" style="margin-top: 24rpx;" @click="onAllotCar('record')">修改船期</button>
<button class="flex_cen flex_center" @click="onAllotCar('multi')">异常上报</button>
</view> </view>
</view> </view>
</template> </template>
...@@ -43,6 +55,13 @@ ...@@ -43,6 +55,13 @@
}, },
}, },
methods: { methods: {
//点击数据跳转详情界面
toOrderDetail(){
getApp().globalData.orderDetail = this.propData
uni.navigateTo({
url: `/subpkg/orderDetail/orderDetail`,
})
},
onAllotCar(allotType) { onAllotCar(allotType) {
const orderNo = this.propData['massOrder.orderNo'] const orderNo = this.propData['massOrder.orderNo']
const orderId = this.propData['id'] const orderId = this.propData['id']
...@@ -52,8 +71,11 @@ ...@@ -52,8 +71,11 @@
}, },
}, },
computed: { computed: {
orderDate() { requireEtd() {
return formatGMT(this.propData['massOrder.orderDate'], 'D') || '' return formatGMT(this.propData['require_etd'], 'D') || ''
},
requireEta() {
return formatGMT(this.propData['require_eta'], 'D') || ''
} }
} }
} }
......
...@@ -7,7 +7,7 @@ module.exports = { ...@@ -7,7 +7,7 @@ module.exports = {
getWxToken() { getWxToken() {
uni.login({ uni.login({
success: (res) => { success: (res) => {
this.login(res.code); // this.login(res.code);
}, },
}); });
}, },
...@@ -92,7 +92,7 @@ module.exports = { ...@@ -92,7 +92,7 @@ module.exports = {
}); //可跳转至任意页面 }); //可跳转至任意页面
} else { } else {
uni.switchTab({ uni.switchTab({
url: "/pages/index/index", url: "/pages/order/order",
}); });
} }
// #ifdef MP // #ifdef MP
......
...@@ -13,6 +13,12 @@ ...@@ -13,6 +13,12 @@
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"disableScroll": true "disableScroll": true
} }
}, {
"path": "pages/order/order",
"style": {
"enablePullDownRefresh": false
}
}, { }, {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
...@@ -25,8 +31,8 @@ ...@@ -25,8 +31,8 @@
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"disableScroll": true "disableScroll": true
} }
}, { },{
"path": "pages/order/order", "path": "pages/order_pod/order_pod",
"style": { "style": {
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
...@@ -40,7 +46,7 @@ ...@@ -40,7 +46,7 @@
"navigationBarTitleText": "修改密码", "navigationBarTitleText": "修改密码",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, { }, {
"path": "shipmentDetail/shipmentDetail", "path": "shipmentDetail/shipmentDetail",
"style": { "style": {
"navigationBarTitleText": "运单详情", "navigationBarTitleText": "运单详情",
...@@ -163,16 +169,23 @@ ...@@ -163,16 +169,23 @@
"color": "#999999", "color": "#999999",
"selectedColor": "#2E75E6", "selectedColor": "#2E75E6",
"backgroundColor": "#fff", "backgroundColor": "#fff",
"list": [{ "list": [
"pagePath": "pages/index/index", {
"text": "运单",
"iconPath": "static/img/tabbar/shipment.png",
"selectedIconPath": "static/img/tabbar/shipment-active.png"
}, {
"pagePath": "pages/order/order", "pagePath": "pages/order/order",
"text": "订单", "text": "订单",
"iconPath": "static/img/tabbar/order.png", "iconPath": "static/img/tabbar/order.png",
"selectedIconPath": "static/img/tabbar/order-active.png" "selectedIconPath": "static/img/tabbar/order-active.png"
},{
"pagePath": "pages/index/index",
"text": "运单",
"iconPath": "static/img/tabbar/shipment.png",
"selectedIconPath": "static/img/tabbar/shipment-active.png"
},
{
"pagePath": "pages/order_pod/order_pod",
"text": "回单",
"iconPath": "static/img/tabbar/receivebill.png",
"selectedIconPath": "static/img/tabbar/receivebill-active.png"
}, },
{ {
"pagePath": "pages/user/user", "pagePath": "pages/user/user",
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<script> <script>
import { MINI, ENV_MODEL, TokenPrefix } from '../../publicConfig/config.js' import { MINI, ENV_MODEL, TokenPrefix } from '../../publicConfig/config.js'
import { userLogin, SendMessage } from '../../api/apiList.js' import { userLogin,userCarrierLogin, SendMessage } from '../../api/apiList.js'
const loginBehavior = require('../../mixins/loginBehavior.js') const loginBehavior = require('../../mixins/loginBehavior.js')
export default { export default {
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
submitForm() { submitForm() {
const { userName, password, phone, telPassword } = this.formData const { userName, password, phone, telPassword } = this.formData
if(!this.onSubmitBeforeRule(userName, password, phone, telPassword)) return //规则校验 if(!this.onSubmitBeforeRule(userName, password, phone, telPassword)) return //规则校验
let {projectMini} = getApp().globalData let {projectMini} = getApp().globalData;
let loginAction = 'loginByUserInfo' let loginAction = 'loginByUserInfo'
let reqData = { entryName: projectMini } let reqData = { entryName: projectMini }
if (this.isVerifLogin) { if (this.isVerifLogin) {
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
loginAction = 'loginByCustomAuth' loginAction = 'loginByCustomAuth'
} else { } else {
const encryptedPassword = this.encryptedText(password) const encryptedPassword = this.encryptedText(password)
reqData = {...reqData, userName, password: encryptedPassword} reqData = {...reqData, params: {userName, password}}
} }
//#ifdef MP //#ifdef MP
...@@ -180,9 +180,9 @@ ...@@ -180,9 +180,9 @@
try { try {
reqData.code = res.code reqData.code = res.code
let pagePath = getApp().globalData.backPagePath //获取回退页面 let pagePath = getApp().globalData.backPagePath //获取回退页面
uni.setStorageSync(`${TokenPrefix}_XSRFToken`, '') //清除 XSRFToken uni.setStorageSync(`${TokenPrefix}_XSRFToken`, '') //清除 XSRFToken
userLogin(loginAction, res.code, reqData).then(res => { if(!this.isVerifLogin){
userCarrierLogin(loginAction, res.code, reqData).then(res => {
let token = res.data.renewedToken let token = res.data.renewedToken
if (res.header['Set-Cookie']) { if (res.header['Set-Cookie']) {
const XSRFToken = res.header['Set-Cookie'].split(';')[0].split('=')[1] const XSRFToken = res.header['Set-Cookie'].split(';')[0].split('=')[1]
...@@ -201,17 +201,51 @@ ...@@ -201,17 +201,51 @@
}) })
setTimeout(() => { setTimeout(() => {
uni.switchTab({ uni.switchTab({
url: "/pages/index/index", url: "/pages/order/order",
}) })
}, 1500) }, 1500)
} }
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message || err, title: err.message || err,
icon: 'none', icon: 'none',
duration: 3000 duration: 3000
}) })
}) })
}else{
userLogin(loginAction, res.code, reqData).then(res => {
let token = res.data.renewedToken
if (res.header['Set-Cookie']) {
const XSRFToken = res.header['Set-Cookie'].split(';')[0].split('=')[1]
uni.setStorageSync(`${TokenPrefix}_XSRFToken`, XSRFToken);
}
uni.setStorageSync(`${TokenPrefix}_token`, token);
uni.setStorageSync('cookies', res.cookies)
if (pagePath) {
uni.reLaunch({
url: pagePath
}) //可跳转至任意页面
} else {
uni.showToast({
title: '登录成功!',
duration: 1000
})
setTimeout(() => {
uni.switchTab({
url: "/pages/order/order",
})
}, 1500)
}
}).catch(err => {
uni.showToast({
title: err.message || err,
icon: 'none',
duration: 3000
})
})
}
} catch (e) { } catch (e) {
console.log(e) console.log(e)
} }
...@@ -245,7 +279,7 @@ ...@@ -245,7 +279,7 @@
}) })
setTimeout(() => { setTimeout(() => {
uni.switchTab({ uni.switchTab({
url: "/pages/index/index", url: "/pages/order/order",
}) })
}, 1500) }, 1500)
} }
......
<template> <template>
<view class="orderList content_box"> <view class="orderList content_box">
<view class="search-input flex_center">
<u-search searchIconSize="50" searchIconColor="#FFFFFF" placeholderColor='#FFFFFF' color="#FFFFFF"
:showAction="false" :placeholder="'请输入订单号'" v-model="searchValue"
@clickIcon="onSearch" @search="onSearch" @clear="onSearch" />
</view>
<view class="select-options">
<orderItem v-for="( order, index ) in orderList" :propData="order" :key="index"/> <orderItem v-for="( order, index ) in orderList" :propData="order" :key="index"/>
</view>
<!-- 空状态 --> <!-- 空状态 -->
<view class="emptyImg flex_col" v-if="!orderList.length"> <view class="emptyImg flex_col" v-if="!orderList.length">
<image mode="aspectFit" src="../../static/img/empty/shipmentEmpty.png" /> <image mode="aspectFit" src="../../static/img/empty/shipmentEmpty.png" />
...@@ -10,7 +17,8 @@ ...@@ -10,7 +17,8 @@
</template> </template>
<script> <script>
import { getMassOrderList} from '../../api/apiList.js' import { getOrderBaseList,} from '../../api/apiList.js'
import { formatGMT } from '../../utils/util'
export default { export default {
data() { data() {
return { return {
...@@ -18,6 +26,7 @@ ...@@ -18,6 +26,7 @@
pageSize: 10, //每页条数 pageSize: 10, //每页条数
orderList: [], orderList: [],
loadMore: true, //加载更多 loadMore: true, //加载更多
searchValue: "", //搜索值
}; };
}, },
onLoad() { onLoad() {
...@@ -39,25 +48,62 @@ ...@@ -39,25 +48,62 @@
methods:{ methods:{
initData(){ initData(){
const { pageNum, pageSize } = this const { pageNum, pageSize } = this
let data = { let reqData = {
"args": { pageNum, pageSize } "args": { pageNum, pageSize }
} }
getMassOrderList(data).then(res=>{ if(this.searchValue){
uni.stopPullDownRefresh() reqData.args.restrictions = [{
const data = res.data.data.datas "field": 'order_base_no',
if (data.length > 0) { "type": "like", //EQ精准匹配,LK模糊匹配
this.orderList = this.orderList.concat(data) "value": this.searchValue
}]
}
getOrderBaseList(reqData).then(res=>{
uni.stopPullDownRefresh()
const data = res.data.data.datas
if (data.length > 0) {
this.orderList = this.orderList.concat(data);
this.pageNum += 1 this.pageNum += 1
this.loadMore = true this.loadMore = true
} }
}) })
} },
// 搜索功能
onSearch() {
this.pageNum = 1
this.orderList = []
this.initData()
},
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.orderList { .orderList {
.search-input {
width: 100%;
position: fixed;
top: 0;
z-index: 999;
height: 100rpx;
background: linear-gradient(to bottom, #005BB5 0%, #005BB5 50%);
/deep/.u-search__content {
height: 80rpx;
margin: 24rpx;
background-color: rgba(240, 240, 240, .5) !important;
.u-search__content__input {
width: 50rpx;
background-color: transparent !important;
}
}
}
/deep/.select-options {
margin-top: 50px
}
.emptyImg { .emptyImg {
position: absolute; position: absolute;
left: 50%; left: 50%;
......
<template>
<view class="orderList content_box">
<orderItem v-for="( order, index ) in orderList" :propData="order" :key="index"/>
<!-- 空状态 -->
<view class="emptyImg flex_col" v-if="!orderList.length">
<image mode="aspectFit" src="../../static/img/empty/shipmentEmpty.png" />
<text class="empty-text">暂时没有订单</text>
</view>
</view>
</template>
<script>
import { getOrderBaseList} from '../../api/apiList.js'
export default {
data() {
return {
pageNum: 1, //页码
pageSize: 10, //每页条数
orderList: [],
loadMore: true, //加载更多
};
},
onLoad() {
this.initData()
},
//下拉刷新
onPullDownRefresh() {
this.pageNum = 1
this.orderList = []
this.initData()
},
// 触底加载更多
onReachBottom() {
if (this.loadMore) {
this.initData()
this.loadMore = false
}
},
methods:{
initData(){
const { pageNum, pageSize } = this
let data = {
"args": { pageNum, pageSize }
}
getOrderBaseList(data).then(res=>{
uni.stopPullDownRefresh()
const data = res.list
if (data.length > 0) {
this.orderList = this.orderList.concat(data)
this.pageNum += 1
this.loadMore = true
}
})
}
}
}
</script>
<style lang="scss">
.orderList {
.emptyImg {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
.empty-text {
font-size: 28rpx;
text-align: center;
}
}
}
</style>
<template> <template>
<view class="orderDetail-list content_box"> <view class="orderDetail-list content_box">
<u-empty mode="data" textSize='32' iconSize="160" text="暂无订单详细数据" v-if="isEmpty" /> <!-- <u-empty mode="data" textSize='32' iconSize="160" text="暂无订单详细数据" v-if="isEmpty" /> -->
<!-- 基本信息 -->
<view class="module-title flex">
<!-- <view class="vertical-separate" /> -->
<text class="font_bolder">基本信息</text>
</view>
<view class="orderDetail-item"> <view class="orderDetail-item">
<view class="detail-title flex_center"> <bs-customCell label="基础订单号 :" :value="orderList.order_base_no" labelCol="3" wrapCol="6" />
<view class="t-icon t-icon-order" />
订单号: {{orderList.orderNo}} <view class=" flex_sb">
<view style="width: 55%;float: left;">
<bs-customCell label="状态 :" :value="orderList.status_label" labelCol="3" wrapCol="6" />
</view>
<view style="width: 45%;float: left;">
<bs-customCell label="订单类型 :" :value="orderList.order_type_label" labelCol="5.5" wrapCol="6" />
</view>
</view>
<view class=" flex_sb">
<view style="width: 55%;float: left;">
<bs-customCell label="销售类型 :" :value="orderList.channel" labelCol="4.5" wrapCol="6" />
</view>
<view style="width: 45%;float: left;">
<bs-customCell label="Region :" :value="orderList.region" labelCol="4.5" wrapCol="6" />
</view>
</view> </view>
<!-- 订单明细" --> <view class=" flex_sb">
<view style="height: 80rpx;padding-left: 4rpx;"> <view style="width: 55%;float: left;">
<bs-customCell label="货量" :value="`${orderList.qty}件/${orderList.weight}千克/${orderList.volume}方`" <bs-customCell label="贸易条款 :" :value="orderList.inco_term" labelCol="4.5" wrapCol="6" />
labelCol="3" wrapCol="7" /> </view>
<bs-customCell label="运输要求" :value="orderList.transportRequest" labelCol="3" wrapCol="9" /> <view style="width: 45%;float: left;">
<bs-customCell label="承运商 :" :value="orderList.carrier" labelCol="4.5" wrapCol="6" />
</view>
</view> </view>
<u-line color="#E5E5E5" margin="40rpx 2% 20rpx" /> <view class=" flex_sb">
<view style="height: 200rpx;padding-left: 4rpx;"> <view style="width: 55%;float: left;">
<bs-customCell label="发货地址" :value="orderList['originalAddress.name']" labelCol="3" wrapCol="9" /> <bs-customCell label="总功率 :" :value="orderList.power" labelCol="4" wrapCol="6" />
<bs-customCell label="发货人" :value="orderList['originalContact.name']" labelCol="3" wrapCol="9" /> </view>
<bs-customCell label="联系方式" :value="orderList['originalContact.tel']" labelCol="3" wrapCol="9" /> <view style="width: 45%;float: left;">
<!-- <bs-customCell label="发货人备注:" :value="orderList['originalContact.remark']" labelCol="3" /> --> <bs-customCell label="总片数 :" :value="orderList.qty" labelCol="4.5" wrapCol="6" />
<bs-customCell label="提货要求" :value="orderList['originalRequirement']" labelCol="3" wrapCol="9" /> </view>
</view> </view>
<u-line color="#E5E5E5" margin="40rpx 2% 20rpx" /> <view class=" flex_sb">
<view style="padding-left: 4rpx;"> <view style="width: 55%;float: left;">
<bs-customCell label="收货地址" :value="orderList['destinationAddress.name']" labelCol="3" wrapCol="9" /> <bs-customCell label="订舱状态 :" :value="orderList.booking_status_label" labelCol="4.5" wrapCol="6" />
<bs-customCell label="收货人" :value="orderList['destinationContact.name']" labelCol="3" wrapCol="9" /> </view>
<bs-customCell label="联系方式" :value="orderList['destinationContact.tel']" labelCol="3" wrapCol="9" /> <view style="width: 45%;float: left;">
<!-- <bs-customCell label="卸货人备注:" value="orderList['destinationContact.remark']" labelCol="3" /> --> <bs-customCell label="船公司 :" :value="orderList.shipowner" labelCol="4.5" wrapCol="6" />
<bs-customCell label="配送要求" :value="orderList['destinationRequirement']" labelCol="3" wrapCol="9" /> </view>
</view> </view>
<!-- 货物明细 --> <!-- 货物明细 -->
<uni-collapse v-model="activeNames" @change="onChange"> <uni-collapse v-model="activeNames" @change="onChange">
<view class="outer-frame"> <view class="outer-frame">
...@@ -35,7 +57,7 @@ ...@@ -35,7 +57,7 @@
<!-- 自定义标题栏 --> <!-- 自定义标题栏 -->
<template v-slot:title> <template v-slot:title>
<view class="foldPanel-title flex_center"> <view class="foldPanel-title flex_center">
<text style="flex-grow: 1">货物详情</text> <text style="flex-grow: 1">货物明细</text>
<!-- 自定义标题栏右侧图标 --> <!-- 自定义标题栏右侧图标 -->
<view :class="['foldPanel-right-icon', 't-icon', activeNames.includes(orderList.id) ? 't-icon-unfold-blue' :'t-icon-fold-blue']" /> <view :class="['foldPanel-right-icon', 't-icon', activeNames.includes(orderList.id) ? 't-icon-unfold-blue' :'t-icon-fold-blue']" />
</view> </view>
...@@ -44,30 +66,78 @@ ...@@ -44,30 +66,78 @@
<view class="cargo-detail-table"> <view class="cargo-detail-table">
<view class="detail-row-title"> <view class="detail-row-title">
<u-row> <u-row>
<u-col textAlign="center" span="4">名称</u-col> <u-col textAlign="center" span="2.5">库区</u-col>
<u-col textAlign="end" span="7">数量</u-col> <u-col textAlign="center" span="2.5">产品</u-col>
<u-col textAlign="center" span="2">功率</u-col>
<u-col textAlign="center" span="2.5">柜号</u-col>
<u-col textAlign="center" span="2">数量</u-col>
</u-row> </u-row>
</view> </view>
<u-empty mode="data" textSize='32' iconSize="160" text="暂无货物明细" <u-empty mode="data" textSize='32' iconSize="160" text="暂无货物明细"
v-if="!cargoDetails.length" /> v-if="!cargoDetails.length" />
<view class="detail-col-item" v-for="itm in cargoDetails" :key="itm.id"> <view class="detail-col-item" v-for="itm in cargoDetails" :key="itm.id">
<u-row> <u-row>
<u-col span="7" class="cargo-title"> <u-col span="2.5" class="cargo-title" textAlign="center">
<view class="cargo-title">{{itm['goods.name']}}</view> <view class="cargo-title">{{itm.reservoir_area}}</view>
</u-col> </u-col>
<u-col span="4" textAlign="end">{{itm.qty}}</u-col> <u-col span="2.5" textAlign="center">{{itm.product_name}}</u-col>
<u-col span="2" textAlign="center">{{itm.power}}</u-col>
<u-col span="2.5" textAlign="center">{{itm.lot_no}}</u-col>
<u-col span="2" textAlign="center">{{itm.qty}}</u-col>
</u-row> </u-row>
</view> </view>
</view> </view>
</uni-collapse-item> </uni-collapse-item>
</view> </view>
</uni-collapse> </uni-collapse>
<!-- 节点状态 -->
<uni-collapse v-model="activeNames" @change="onChange">
<view class="outer-frame">
<uni-collapse-item :show-arrow="false" title-border="none" :name="orderList.id">
<!-- 自定义标题栏 -->
<template v-slot:title>
<view class="foldPanel-title flex_center">
<text style="flex-grow: 1">节点状态</text>
<!-- 自定义标题栏右侧图标 -->
<view :class="['foldPanel-right-icon', 't-icon', activeNames.includes(orderList.id) ? 't-icon-unfold-blue' :'t-icon-fold-blue']" />
</view>
</template>
<!-- 节点状态 -->
<view class="cargo-detail-table">
<view class="detail-row-title">
<u-row>
<u-col textAlign="center" span="3">当前节点</u-col>
<u-col textAlign="center" span="3">起运港</u-col>
<u-col textAlign="center" span="3">目的港</u-col>
<u-col textAlign="center" span="3">船公司</u-col>
</u-row>
</view>
<u-empty mode="data" textSize='32' iconSize="160" text="暂无货物明细"
v-if="!cargoEvents.length" />
<view class="detail-col-item" v-for="itm in cargoEvents" :key="itm.id">
<u-row>
<u-col span="3" class="cargo-title" textAlign="center">
<view class="cargo-title">{{itm.bl_event_code_label}}</view>
</u-col>
<u-col span="3" textAlign="center">{{itm.port_of_source_location_name==null?"":itm.port_of_source_location_name}}</u-col>
<u-col span="3" textAlign="center">{{itm.port_of_dest_location_name==null?"":port_of_dest_location_name}}</u-col>
<u-col span="3" textAlign="center">{{itm.inspection_number==null?"":itm.inspection_number}}</u-col>
</u-row>
</view>
</view>
</uni-collapse-item>
</view>
</uni-collapse>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import { OMOrderDetail, OROrderDetail } from '../../api/apiList.js' import { getOrderBaseDetail, getOrderBaseEvent,
OMOrderDetail, OROrderDetail } from '../../api/apiList.js'
export default { export default {
name: 'orderDetail', name: 'orderDetail',
options: { styleIsolation: 'shared' }, options: { styleIsolation: 'shared' },
...@@ -75,18 +145,20 @@ ...@@ -75,18 +145,20 @@
return { return {
orderList: '', //订单列表,当默认为{}时,小程序会自动转结构 orderList: '', //订单列表,当默认为{}时,小程序会自动转结构
cargoDetails: [], //货量明细 cargoDetails: [], //货量明细
cargoEvents:[],//节点明细
isEmpty: true, //是否为空 isEmpty: true, //是否为空
activeNames: [], //当前展开面板 names => orderIds activeNames: [], //当前展开面板 names => orderIds
} }
}, },
onLoad(options) { onLoad(options) {
const data = JSON.parse(options.data) const data = getApp().globalData.orderDetail
const isEmpty = !Object.keys(data).length const isEmpty = !Object.keys(data).length
this.orderList = data this.orderList = data
this.isEmpty = isEmpty this.isEmpty = isEmpty
if (!isEmpty) { if (!isEmpty) {
this.activeNames = [data.id] this.activeNames = [data.id]
this.getOrderDetail(data.id) this.getOrderDetail(data.id);
this.getOrderEvents(data.id);
} }
}, },
methods: { methods: {
...@@ -97,50 +169,41 @@ ...@@ -97,50 +169,41 @@
//获取订单货物明细 //获取订单货物明细
getOrderDetail(orderId) { getOrderDetail(orderId) {
const { shipmentBizName } = getApp().globalData.shipmentInfo
let shipmentMode = ''
switch (shipmentBizName) { //根据shipmentBizName 判断运输模式
case 'tm.MovementShipment':
case 'tm.SectionShipment': //暂时走OM逻辑
shipmentMode = 'OM'
break
case 'tm.MassShipment':
shipmentMode = 'MS'; //大宗运输
break
default:
shipmentMode = 'OR';
}
if(shipmentMode !== 'MS'){ //大宗模式无需查询货物明细
const isShipmentOM = shipmentMode === 'OM' //判断是否为OM模式
const reqData = { const reqData = {
"args": { "args": {
"pageNum": 1, "pageNum": 1,
"pageSize": 100, "pageSize": 100,
"restrictions": [{ "orderId": orderId
"field": isShipmentOM ? 'orderMovement.id' : 'orderRelease.id',
"type": "EQ",
"value": orderId
}]
} }
} }
const requestFun = isShipmentOM ? OMOrderDetail : OROrderDetail getOrderBaseDetail(reqData).then(res => {
requestFun(reqData).then(res => {
const datas = res.data.data.datas const datas = res.data.data.datas
const newData = [] const newData = []
datas.map(item => { datas.map(item => {
if (isShipmentOM) { //自定义数据字段 转换为简洁的OR模式字段名 if(item.lot_no==null){
newData.push({ item.lot_no="";
'id': item.id, }
'goods.name': item['goods.name'], newData.push({ ...item })
'qty': item.shipQty,
})
} else {
newData.push({ ...item })
}
}) })
this.cargoDetails = [...newData] this.cargoDetails = [...newData]
}) })
} },
//获取订单所有节点
getOrderEvents(orderId) {
const reqData = {
"args": {
"pageNum": 1,
"pageSize": 100,
"orderId": orderId
}
}
getOrderBaseEvent(reqData).then(res => {
const datas = res.data.data.datas
if (datas.length > 0) {
this.cargoEvents = this.cargoEvents.concat(datas);
}
})
}, },
} }
} }
...@@ -148,7 +211,15 @@ ...@@ -148,7 +211,15 @@
<style lang="scss"> <style lang="scss">
.orderDetail-list { .orderDetail-list {
.module-title {
padding: 32rpx 32rpx 16rpx;
.vertical-separate {
height: 40rpx;
border-left: 7rpx solid #797979;
margin-right: 20rpx;
}
}
.orderDetail-item { .orderDetail-item {
padding: 32rpx; padding: 32rpx;
margin-bottom: 24rpx; margin-bottom: 24rpx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment