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

新增订单界面

parent f47e6d5d
......@@ -3,12 +3,19 @@ import uploadFile from "./uploadFile";
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) {
return Request(
`/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自动登录
export function authLogin(loginAction, loginCode, data) {
return Request(
......@@ -41,6 +48,23 @@ export function downloadImg(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) {
return Request(
......@@ -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) {
......
......@@ -2,31 +2,43 @@
<view class="shipmentItem box_shadow_card">
<view class="shipment-header flex_sb" style="padding: 28rpx 24rpx 0;">
<view class="consumer_code flex_center">
<text selectable> 订单号:{{propData['massOrder.orderNo'] || ''}}</text>
</view>
<view class="consumer_code flex_center">
<text selectable>
剩余货量:{{propData['massOrder.splitMode'] === 'Weight'? propData.weight : propData.qty || '0'}}{{['massOrder.splitMode'] === 'Weight'? "kg": '件'}}</text>
<text selectable> 基础订单号:{{propData['order_base_no'] || ''}}</text>
</view>
</view>
<u-line color="#E5E5E5" margin="20rpx 0" />
<view style="padding: 0 24rpx 32rpx;">
<view class="stations">
<view class="start-station flex_center">
<view class="t-icon-start-sddress t-icon" style="margin-right: 8rpx;"></view>
{{propData['massOrder.originalAddress.name'] || ''}}
<view style="padding: 0 24rpx 32rpx;" @click="toOrderDetail">
<view class=" flex_sb">
<view style="width: 50%;float: left;">
<bs-customCell label="起运港 :" :value="propData.port_of_source_location_name" labelCol="4" wrapCol="6" />
</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 class="end-station flex_center">
<view class="t-icon-end-sddress t-icon" style="margin-right: 8rpx;"></view>
{{propData['massOrder.destinationAddress.name'] || ''}}
</view>
<view class=" flex_sb">
<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>
<bs-customCell label="接单日期 :" :value="orderDate" labelCol="3" wrapCol="6" />
<bs-customCell label="承运商 :" :value="propData.carrier" labelCol="2" wrapCol="6" />
</view>
<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('multi')">分配多辆车</button>
<button class="flex_cen flex_center" style="margin-top: 24rpx;" @click="onAllotCar('record')">分配记录</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" style="margin-top: 24rpx;" @click="onAllotCar('record')">修改船期</button>
<button class="flex_cen flex_center" @click="onAllotCar('multi')">异常上报</button>
</view>
</view>
</template>
......@@ -43,6 +55,13 @@
},
},
methods: {
//点击数据跳转详情界面
toOrderDetail(){
getApp().globalData.orderDetail = this.propData
uni.navigateTo({
url: `/subpkg/orderDetail/orderDetail`,
})
},
onAllotCar(allotType) {
const orderNo = this.propData['massOrder.orderNo']
const orderId = this.propData['id']
......@@ -52,8 +71,11 @@
},
},
computed: {
orderDate() {
return formatGMT(this.propData['massOrder.orderDate'], 'D') || ''
requireEtd() {
return formatGMT(this.propData['require_etd'], 'D') || ''
},
requireEta() {
return formatGMT(this.propData['require_eta'], 'D') || ''
}
}
}
......
......@@ -7,7 +7,7 @@ module.exports = {
getWxToken() {
uni.login({
success: (res) => {
this.login(res.code);
// this.login(res.code);
},
});
},
......@@ -92,7 +92,7 @@ module.exports = {
}); //可跳转至任意页面
} else {
uni.switchTab({
url: "/pages/index/index",
url: "/pages/order/order",
});
}
// #ifdef MP
......
......@@ -13,6 +13,12 @@
"enablePullDownRefresh": false,
"disableScroll": true
}
}, {
"path": "pages/order/order",
"style": {
"enablePullDownRefresh": false
}
}, {
"path": "pages/index/index",
"style": {
......@@ -25,8 +31,8 @@
"enablePullDownRefresh": false,
"disableScroll": true
}
}, {
"path": "pages/order/order",
},{
"path": "pages/order_pod/order_pod",
"style": {
"enablePullDownRefresh": false
}
......@@ -40,7 +46,7 @@
"navigationBarTitleText": "修改密码",
"enablePullDownRefresh": false
}
}, {
}, {
"path": "shipmentDetail/shipmentDetail",
"style": {
"navigationBarTitleText": "运单详情",
......@@ -163,16 +169,23 @@
"color": "#999999",
"selectedColor": "#2E75E6",
"backgroundColor": "#fff",
"list": [{
"pagePath": "pages/index/index",
"text": "运单",
"iconPath": "static/img/tabbar/shipment.png",
"selectedIconPath": "static/img/tabbar/shipment-active.png"
}, {
"list": [
{
"pagePath": "pages/order/order",
"text": "订单",
"iconPath": "static/img/tabbar/order.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",
......
......@@ -41,7 +41,7 @@
<script>
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')
export default {
......@@ -153,7 +153,7 @@
submitForm() {
const { userName, password, phone, telPassword } = this.formData
if(!this.onSubmitBeforeRule(userName, password, phone, telPassword)) return //规则校验
let {projectMini} = getApp().globalData
let {projectMini} = getApp().globalData;
let loginAction = 'loginByUserInfo'
let reqData = { entryName: projectMini }
if (this.isVerifLogin) {
......@@ -161,7 +161,7 @@
loginAction = 'loginByCustomAuth'
} else {
const encryptedPassword = this.encryptedText(password)
reqData = {...reqData, userName, password: encryptedPassword}
reqData = {...reqData, params: {userName, password}}
}
//#ifdef MP
......@@ -180,9 +180,9 @@
try {
reqData.code = res.code
let pagePath = getApp().globalData.backPagePath //获取回退页面
uni.setStorageSync(`${TokenPrefix}_XSRFToken`, '') //清除 XSRFToken
userLogin(loginAction, res.code, reqData).then(res => {
uni.setStorageSync(`${TokenPrefix}_XSRFToken`, '') //清除 XSRFToken
if(!this.isVerifLogin){
userCarrierLogin(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]
......@@ -201,17 +201,51 @@
})
setTimeout(() => {
uni.switchTab({
url: "/pages/index/index",
url: "/pages/order/order",
})
}, 1500)
}
}).catch(err => {
}).catch(err => {
uni.showToast({
title: err.message || err,
icon: 'none',
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) {
console.log(e)
}
......@@ -245,7 +279,7 @@
})
setTimeout(() => {
uni.switchTab({
url: "/pages/index/index",
url: "/pages/order/order",
})
}, 1500)
}
......
<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"/>
</view>
<!-- 空状态 -->
<view class="emptyImg flex_col" v-if="!orderList.length">
<image mode="aspectFit" src="../../static/img/empty/shipmentEmpty.png" />
......@@ -10,7 +17,8 @@
</template>
<script>
import { getMassOrderList} from '../../api/apiList.js'
import { getOrderBaseList,} from '../../api/apiList.js'
import { formatGMT } from '../../utils/util'
export default {
data() {
return {
......@@ -18,6 +26,7 @@
pageSize: 10, //每页条数
orderList: [],
loadMore: true, //加载更多
searchValue: "", //搜索值
};
},
onLoad() {
......@@ -39,25 +48,62 @@
methods:{
initData(){
const { pageNum, pageSize } = this
let data = {
let reqData = {
"args": { pageNum, pageSize }
}
getMassOrderList(data).then(res=>{
uni.stopPullDownRefresh()
const data = res.data.data.datas
if (data.length > 0) {
this.orderList = this.orderList.concat(data)
if(this.searchValue){
reqData.args.restrictions = [{
"field": 'order_base_no',
"type": "like", //EQ精准匹配,LK模糊匹配
"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.loadMore = true
}
})
}
},
// 搜索功能
onSearch() {
this.pageNum = 1
this.orderList = []
this.initData()
},
}
}
</script>
<style lang="scss">
.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 {
position: absolute;
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>
This diff is collapsed.
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