|
@@ -1,8 +1,12 @@
|
|
|
<template>
|
|
|
<div class="mianBox" v-if="status">
|
|
|
- <van-row class="headerBox" @click="fanhuiBtn">
|
|
|
- <van-icon name="arrow-left" class="arrow-left" />
|
|
|
- <van-col class="return">返回</van-col>
|
|
|
+ <van-row class="headerBox" >
|
|
|
+ <van-col class="returnWrap" @click="fanhuiBtn">
|
|
|
+ <van-image class="arrow-left"
|
|
|
+ :src="require('../../assets/image/left.png')"
|
|
|
+ />
|
|
|
+ <van-col class="return">返回</van-col>
|
|
|
+ </van-col>
|
|
|
<van-col class="title">{{title}}</van-col>
|
|
|
</van-row>
|
|
|
<van-row class="top">
|
|
@@ -15,8 +19,8 @@
|
|
|
<van-row class="bottom">
|
|
|
<van-row class="orderList" v-if="active==0">
|
|
|
<van-col span="24" v-for="(item,index) in order" :key="index" class="order" @click="orderOne(item)">
|
|
|
- <van-col span="12" class="dcrText">点餐人:</van-col>
|
|
|
- <van-col span="12" class="dcr">{{item.orderUserName}}</van-col>
|
|
|
+ <van-col span="12" class="dcrText" style="margin-top:0">点餐人:</van-col>
|
|
|
+ <van-col span="12" class="dcr" style="margin-top:0">{{item.orderUserName}}</van-col>
|
|
|
<van-col span="12" class="scAddressText">送餐地址:</van-col>
|
|
|
<van-col span="12" class="scAddress">{{item.address}}</van-col>
|
|
|
<van-col span="12" class="statusText">当前状态:</van-col>
|
|
@@ -33,10 +37,10 @@
|
|
|
</van-row>
|
|
|
<van-row class="orderList" v-if="active==1">
|
|
|
<van-col span="24" v-for="(item,index) in order" :key="index" class="order" @click="orderOne(item)">
|
|
|
- <van-col span="12" class="dcrText">点餐人:</van-col>
|
|
|
- <van-col span="12" class="dcr">{{item.orderUserName}}</van-col>
|
|
|
- <van-col span="12" class="scAddressText">送餐地址:</van-col>
|
|
|
- <van-col span="12" class="scAddress">{{item.address}}</van-col>
|
|
|
+ <van-col span="12" class="dcrText" style="margin-top:0">点餐人:</van-col>
|
|
|
+ <van-col span="12" class="dcr" style="margin-top:0">{{item.orderUserName}}</van-col>
|
|
|
+ <van-col span="12" class="scAddressText" >送餐地址:</van-col>
|
|
|
+ <van-col span="12" class="scAddress">{{item.address || "-"}}</van-col>
|
|
|
<van-col span="12" class="statusText">当前状态:</van-col>
|
|
|
<van-col span="12" :class="item.orderStatus == '3' ? 'status' : 'status1'">
|
|
|
{{item.orderStatus == "0" ? "待接单" : item.orderStatus == "1" ? "配餐中" : item.orderStatus == "2" ? "送餐中" : "已完成"}}
|
|
@@ -52,17 +56,17 @@
|
|
|
</van-row>
|
|
|
<van-dialog v-model="show" class="pcDialog">
|
|
|
<van-row class="orderDetails">
|
|
|
- <van-col class="order" >
|
|
|
- <van-col span="12" class="left">订餐人:</van-col>
|
|
|
- <van-col span="12" class="right">{{orderDetails.orderUserName || '-'}}</van-col>
|
|
|
- <van-col span="12" class="left">餐别:</van-col>
|
|
|
- <van-col span="12" class="right">{{orderDetails.mType || '-'}}</van-col>
|
|
|
- <van-col span="12" class="left">手机号:</van-col>
|
|
|
- <van-col span="12" class="right">{{orderDetails.phone || '-'}}</van-col>
|
|
|
- <van-col span="12" class="left">送餐地址:</van-col>
|
|
|
- <van-col span="12" class="right">{{orderDetails.address}}</van-col>
|
|
|
- <van-col span="12" class="left">备注:</van-col>
|
|
|
- <van-col span="12" class="right">{{orderDetails.remark || '-'}}</van-col>
|
|
|
+ <van-col class="order" span="24">
|
|
|
+ <van-col span="12" style="margin-top:0">订餐人:</van-col>
|
|
|
+ <van-col span="12" style="margin-top:0">{{orderDetails.orderUserName || '-'}}</van-col>
|
|
|
+ <van-col span="12">餐别:</van-col>
|
|
|
+ <van-col span="12">{{orderDetails.mType || '-'}}</van-col>
|
|
|
+ <van-col span="12">手机号:</van-col>
|
|
|
+ <van-col span="12">{{orderDetails.phone || '-'}}</van-col>
|
|
|
+ <van-col span="12">送餐地址:</van-col>
|
|
|
+ <van-col span="12">{{orderDetails.address || "-"}}</van-col>
|
|
|
+ <van-col span="12">备注:</van-col>
|
|
|
+ <van-col span="12">{{orderDetails.remark || '-'}}</van-col>
|
|
|
</van-col>
|
|
|
<van-col class="detailsText">配餐明细</van-col>
|
|
|
<van-col span="24" class="dishes">
|
|
@@ -72,13 +76,13 @@
|
|
|
</van-col>
|
|
|
</van-col>
|
|
|
<van-col class="statusSelect">
|
|
|
- <van-col class="select zt" v-if = "orderDetails.orderStatus == '0'" @click="statusChange(1)">
|
|
|
+ <van-col class="select" :class="orderDetails.orderStatus == '0' ? 'zt' : 'overTime'" @click="statusChange(orderDetails.orderStatus == '0' ? 1 : undefined)" >
|
|
|
接单
|
|
|
</van-col>
|
|
|
- <van-col class="select zt" v-if = "orderDetails.orderStatus == '1'" @click="statusChange(2)">
|
|
|
+ <van-col class="select" :class="orderDetails.orderStatus == '1' ? 'zt' : 'overTime'" @click="statusChange(orderDetails.orderStatus == '1' ? 2 : undefined)">
|
|
|
送餐
|
|
|
</van-col>
|
|
|
- <van-col class="select zt" v-if = "orderDetails.orderStatus == '2'" @click="statusChange(3)">
|
|
|
+ <van-col class="select" :class="orderDetails.orderStatus == '2' ? 'zt' : 'overTime'" @click="statusChange(orderDetails.orderStatus == '2' ? 3 : undefined)">
|
|
|
完成
|
|
|
</van-col>
|
|
|
<van-col class="select gb" @click="close">
|
|
@@ -91,8 +95,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import axios from "axios";
|
|
|
-import { Field, NumberKeyboard, Dialog, Toast,Step, Steps } from "vant";
|
|
|
+import { Toast } from "vant";
|
|
|
import Cookies from "js-cookie";
|
|
|
import { getNowTime } from "@/assets/js/dataFormate.js";
|
|
|
export default {
|
|
@@ -110,14 +113,7 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
components: {
|
|
|
- [Field.name]: Field,
|
|
|
- [NumberKeyboard.name]: NumberKeyboard,
|
|
|
- [Dialog.name]: Dialog,
|
|
|
[Toast.name]: Toast,
|
|
|
- },
|
|
|
- created() {
|
|
|
-
|
|
|
-
|
|
|
},
|
|
|
mounted(){
|
|
|
document.title = '中国东信智慧园区'
|
|
@@ -168,6 +164,9 @@ export default {
|
|
|
if(this.number == "0"){
|
|
|
this.number = undefined
|
|
|
}
|
|
|
+ if(data.length>99){
|
|
|
+ this.number = data.length
|
|
|
+ }
|
|
|
this.order = data
|
|
|
this.status = true
|
|
|
})
|
|
@@ -189,12 +188,13 @@ export default {
|
|
|
this.orderDetails = row
|
|
|
axios.get(`https://smartpark.caih.com/dxapi/system/config/configKey/dre_urgency_phone`).then(res => {
|
|
|
this.orderDetails.jjPhone = res.data.data
|
|
|
+ //订单详情
|
|
|
+ axios.get(`https://smartpark.caih.com/dxapi/dreOrderDetail/listByOrder?orderId=${row.id}`).then(res => {
|
|
|
+ const data = res.data.data
|
|
|
+ this.dishes = data
|
|
|
+ })
|
|
|
})
|
|
|
- //订单详情
|
|
|
- axios.get(`https://smartpark.caih.com/dxapi/dreOrderDetail/listByOrder?orderId=${row.id}`).then(res => {
|
|
|
- const data = res.data.data
|
|
|
- this.dishes = data
|
|
|
- })
|
|
|
+
|
|
|
},
|
|
|
//订单详情
|
|
|
orderOne(row){
|
|
@@ -211,55 +211,62 @@ export default {
|
|
|
},
|
|
|
//状态变更
|
|
|
statusChange(id){
|
|
|
- let time = getNowTime()
|
|
|
- let data = {
|
|
|
- id:this.orderDetails.id,
|
|
|
- orderStatus:id,
|
|
|
- receiveUserName:undefined,
|
|
|
- receiveUserId:undefined,
|
|
|
- receiveTime:undefined,
|
|
|
- sendUserName:undefined,
|
|
|
- sendUserId:undefined,
|
|
|
- sendTime:undefined,
|
|
|
- sendEndTime:undefined,
|
|
|
- }
|
|
|
- let sid = undefined
|
|
|
- axios.get("https://smartpark.caih.com/dxapi/dxtop/staff/one",{
|
|
|
- params:{
|
|
|
- id:Cookies.get("userId57")
|
|
|
- }
|
|
|
- }).then(res2 =>{
|
|
|
- sid = res2.data.data.sid
|
|
|
- if(id == "1"){
|
|
|
- data.receiveUserName = Cookies.get("nickName57")
|
|
|
- data.receiveUserId = sid
|
|
|
- data.receiveTime = time
|
|
|
- }
|
|
|
- if(id == "2"){
|
|
|
- data.sendUserName= Cookies.get("nickName57")
|
|
|
- data.sendUserId = sid
|
|
|
- data.sendTime = time
|
|
|
+ if(id){
|
|
|
+ let time = getNowTime()
|
|
|
+ let data = {
|
|
|
+ id:this.orderDetails.id,
|
|
|
+ orderStatus:id,
|
|
|
+ receiveUserName:undefined,
|
|
|
+ receiveUserId:undefined,
|
|
|
+ receiveTime:undefined,
|
|
|
+ sendUserName:undefined,
|
|
|
+ sendUserId:undefined,
|
|
|
+ sendTime:undefined,
|
|
|
+ sendEndTime:undefined,
|
|
|
}
|
|
|
- if(id == "3"){
|
|
|
- data.sendEndTime = time
|
|
|
+ let sid = undefined
|
|
|
+ axios.get("https://smartpark.caih.com/dxapi/dxtop/staff/one",{
|
|
|
+ params:{
|
|
|
+ id:Cookies.get("userId57")
|
|
|
}
|
|
|
- axios.put(`https://smartpark.caih.com/dxapi/dreOrder/`,data).then(res => {
|
|
|
- Toast("订单状态变更完成")
|
|
|
+ }).then(res2 =>{
|
|
|
+ sid = res2.data.data.sid
|
|
|
+ if(id == "1"){
|
|
|
+ data.receiveUserName = Cookies.get("nickName57")
|
|
|
+ data.receiveUserId = sid
|
|
|
+ data.receiveTime = time
|
|
|
+ }
|
|
|
+ if(id == "2"){
|
|
|
+ data.sendUserName= Cookies.get("nickName57")
|
|
|
+ data.sendUserId = sid
|
|
|
+ data.sendTime = time
|
|
|
+ }
|
|
|
if(id == "3"){
|
|
|
- this.active = 1
|
|
|
- this.number = this.number - 1
|
|
|
- if(this.number == "0"){
|
|
|
- this.number = undefined
|
|
|
- }
|
|
|
- this.orderStatus(3)
|
|
|
- }else{
|
|
|
- this.active = 0
|
|
|
- this.orderStatus()
|
|
|
+ data.sendEndTime = time
|
|
|
}
|
|
|
-
|
|
|
- this.show = false
|
|
|
+ axios.put(`https://smartpark.caih.com/dxapi/dreOrder/`,data).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ if(res.data.status == "SUCCESS"){
|
|
|
+ if(id == "3"){
|
|
|
+ this.active = 1
|
|
|
+ this.number = this.number - 1
|
|
|
+ if(this.number == "0"){
|
|
|
+ this.number = undefined
|
|
|
+ }
|
|
|
+ this.orderStatus(3)
|
|
|
+ }else{
|
|
|
+ this.active = 0
|
|
|
+ this.orderStatus()
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ Toast(res.data.msg)
|
|
|
+ this.orderStatus()
|
|
|
+ }
|
|
|
+ this.show = false
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
},
|
|
|
//关闭
|
|
@@ -273,27 +280,14 @@ export default {
|
|
|
.mianBox{
|
|
|
width:100%;
|
|
|
height:100%;
|
|
|
+ overflow: scroll;
|
|
|
background-color: #F9F9F9 !important;
|
|
|
- .headerBox{
|
|
|
- position: relative;
|
|
|
- .arrow-left{
|
|
|
- font-size: 24px;
|
|
|
- vertical-align: middle;
|
|
|
- margin-left:-6px;
|
|
|
- }
|
|
|
- .return{
|
|
|
- vertical-align: middle;
|
|
|
- font-size: 16px;
|
|
|
- line-height: 42px;
|
|
|
- }
|
|
|
- .title{
|
|
|
- position: absolute;
|
|
|
- width:calc(100vw - 30px);
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
- }
|
|
|
.top{
|
|
|
position: relative;
|
|
|
+ .pc{
|
|
|
+ height:48px;
|
|
|
+ line-height: 48px;
|
|
|
+ }
|
|
|
.lineP{
|
|
|
position: absolute;
|
|
|
top:12px;
|
|
@@ -308,34 +302,28 @@ export default {
|
|
|
margin-top:10px;
|
|
|
.orderList{
|
|
|
.order{
|
|
|
- padding:15px 15px 15px;
|
|
|
+ padding:15px;
|
|
|
.dcrText,.scAddressText,.statusText{
|
|
|
color:#999999;
|
|
|
- padding:5px 0;
|
|
|
-
|
|
|
}
|
|
|
.dcr,.scAddress,.status{
|
|
|
color:#333;
|
|
|
text-align: right;
|
|
|
- padding:5px 0;
|
|
|
}
|
|
|
div{
|
|
|
font-size: 14px;
|
|
|
- padding:5px 0;
|
|
|
+ margin-top:8px;
|
|
|
+ line-height: 20px;
|
|
|
}
|
|
|
- // div:nth-child(even){
|
|
|
- // text-align: right;
|
|
|
- // }
|
|
|
.status1{
|
|
|
color:#D7000F;
|
|
|
text-align: right;
|
|
|
- padding:5px 0;
|
|
|
}
|
|
|
.van-steps{
|
|
|
- width:100%;
|
|
|
background:transparent;
|
|
|
- height:50px;
|
|
|
-
|
|
|
+ height:40px;
|
|
|
+ padding-bottom:20px;
|
|
|
+ width:100%;
|
|
|
}
|
|
|
}
|
|
|
.order:nth-child(odd){
|
|
@@ -343,27 +331,27 @@ export default {
|
|
|
}
|
|
|
.order:nth-child(even){
|
|
|
background-color: #F9F9F9;
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
}
|
|
|
.noMore{
|
|
|
- background-color: #F9F9F9;
|
|
|
+ background-color: #F0F0F0;
|
|
|
color:#999999;
|
|
|
text-align: center;
|
|
|
padding:20px 0;
|
|
|
- font-size: 14px;
|
|
|
+ font-size: 12px;
|
|
|
}
|
|
|
}
|
|
|
.pcDialog{
|
|
|
- border-radius: 4px;
|
|
|
+ border-radius: 5px;
|
|
|
width:85%;
|
|
|
- padding-bottom:10px;
|
|
|
+ padding:20px 0;
|
|
|
.orderDetails{
|
|
|
.order{
|
|
|
- padding:16px;
|
|
|
+ padding:0px 16px 20px;
|
|
|
border-bottom:1px solid #F0F0F0;
|
|
|
div{
|
|
|
- padding:5px 0;
|
|
|
+ margin-top:8px;
|
|
|
+ line-height: 20px;
|
|
|
}
|
|
|
div:nth-child(odd){
|
|
|
text-align: left;
|
|
@@ -371,22 +359,25 @@ export default {
|
|
|
}
|
|
|
div:nth-child(even){
|
|
|
text-align: right;
|
|
|
- color:#333;
|
|
|
+ color:#333;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
.detailsText,.jjPhone{
|
|
|
- font-size: 18px;
|
|
|
- margin:10px 16px;
|
|
|
+ font-size: 15px;
|
|
|
+ margin:20px 16px 8px;
|
|
|
font-weight: 700;
|
|
|
}
|
|
|
+ .jjPhone{
|
|
|
+ margin:20px 16px 0;
|
|
|
+ }
|
|
|
.dishes{
|
|
|
max-height:calc(100vh - 550px);
|
|
|
overflow-y: scroll;
|
|
|
padding:0px 16px;
|
|
|
.list{
|
|
|
color:#333;
|
|
|
- font-size: 18px;
|
|
|
+ font-size: 15px;
|
|
|
height:40px;
|
|
|
line-height: 40px;
|
|
|
width:100%;
|
|
@@ -409,23 +400,19 @@ export default {
|
|
|
|
|
|
}
|
|
|
.statusSelect{
|
|
|
- padding:20px 16px 10px;
|
|
|
- position: relative;
|
|
|
- float:right;
|
|
|
+ margin:20px 16px 0;
|
|
|
.select{
|
|
|
- width:60px;
|
|
|
- height:40px;
|
|
|
- line-height: 40px;
|
|
|
- font-size: 16px;
|
|
|
+ width:65px;
|
|
|
+ height:44px;
|
|
|
+ line-height: 44px;
|
|
|
+ font-size: 17px;
|
|
|
text-align: center;
|
|
|
- border-radius: 4px;
|
|
|
- }
|
|
|
- .select:nth-child(1){
|
|
|
- margin-left:155px;
|
|
|
+ border-radius: 5px;
|
|
|
}
|
|
|
- .select:nth-child(2){
|
|
|
- margin-left:10px;
|
|
|
+ .select:nth-child(1),.select:nth-child(2),.select:nth-child(3){
|
|
|
+ margin-right:8.2px;
|
|
|
}
|
|
|
+
|
|
|
.zt{
|
|
|
color: #fff;
|
|
|
background:#D7000F;
|
|
@@ -435,6 +422,10 @@ export default {
|
|
|
background:#fff;
|
|
|
border:1px solid #D7000F;
|
|
|
}
|
|
|
+ .overTime{
|
|
|
+ background-color: #ccc;
|
|
|
+ color:#fff;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -446,6 +437,9 @@ export default {
|
|
|
.van-steps__items{
|
|
|
margin-top:-10px !important;
|
|
|
}
|
|
|
+.van-steps--horizontal{
|
|
|
+ padding:0;
|
|
|
+}
|
|
|
.van-step__title{
|
|
|
position: absolute !important;
|
|
|
top:40px;
|
|
@@ -458,22 +452,25 @@ export default {
|
|
|
}
|
|
|
|
|
|
.van-info{
|
|
|
- width:20px;
|
|
|
- height:20px;
|
|
|
- line-height: 20px;
|
|
|
- top:10px;
|
|
|
- left:20px;
|
|
|
+ width:18px;
|
|
|
+ height:18px;
|
|
|
+ line-height: 18px;
|
|
|
+ top:8px;
|
|
|
+ left:24px;
|
|
|
color:#fff;
|
|
|
margin-left:20px;
|
|
|
background-color: #D7000F;
|
|
|
+ font-size: 10px;
|
|
|
}
|
|
|
.pcDialog .van-dialog__footer{
|
|
|
display: none;
|
|
|
}
|
|
|
.pc .van-tab__text{
|
|
|
- font-size: 16px;
|
|
|
+ font-size: 15px;
|
|
|
}
|
|
|
.pc .van-tabs__line{
|
|
|
- width:55px;
|
|
|
+ width:45px !important;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
</style>
|