订单列表,飞行任务接口对接
This commit is contained in:
parent
45e22fdddc
commit
ba75524ecd
@ -1,7 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="mobile-index">
|
<view class="mobile-index">
|
||||||
<scroll-view :scroll-top="scrollTop" :scrollY="true" class="u-page upage"
|
<scroll-view :scroll-top="scrollTop" :scrollY="true" class="u-page upage"
|
||||||
scroll-with-animation @scroll="scroll" @refresherrefresh="refresh">
|
scroll-with-animation @scroll="scroll" @refresherrefresh="refresh"
|
||||||
|
:refresher-enabled="(isPilot&¤t!==3)||(!isPilot&¤t!==1)"
|
||||||
|
:refresher-triggered="triggered" @refresherpulling="onPulling" lower-threshold="60">
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<Order ref="pageRef" :topLevel="topLevel" v-if="current===0" />
|
<Order ref="pageRef" :topLevel="topLevel" v-if="current===0" />
|
||||||
<Equipment ref="pageRef" :topLevel="topLevel" v-if="isPilot&¤t===1" />
|
<Equipment ref="pageRef" :topLevel="topLevel" v-if="isPilot&¤t===1" />
|
||||||
@ -90,9 +92,13 @@ export default {
|
|||||||
// 登录状态
|
// 登录状态
|
||||||
isLogin: this.$store.state.vuex_token,
|
isLogin: this.$store.state.vuex_token,
|
||||||
isPilot: this.$store.state.user_type == 1,
|
isPilot: this.$store.state.user_type == 1,
|
||||||
|
// 下拉刷新触发
|
||||||
|
triggered: false,
|
||||||
|
_freshing: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
|
this._freshing = false;
|
||||||
let index = uni.getStorageSync('current');
|
let index = uni.getStorageSync('current');
|
||||||
// B端没有设备和路线
|
// B端没有设备和路线
|
||||||
this.current = (!index||(!this.isPilot&&(index===2||index===3)))?0:index;
|
this.current = (!index||(!this.isPilot&&(index===2||index===3)))?0:index;
|
||||||
@ -141,9 +147,20 @@ export default {
|
|||||||
this.oldScrollTop = e.detail.scrollTop;
|
this.oldScrollTop = e.detail.scrollTop;
|
||||||
},
|
},
|
||||||
// 上拉刷新
|
// 上拉刷新
|
||||||
refresh(){
|
async refresh(){
|
||||||
this.changeCurrent(this.current);
|
if (this._freshing) return;
|
||||||
|
this._freshing = true;
|
||||||
|
await this.changeCurrent(this.current);
|
||||||
|
this.triggered = false;
|
||||||
|
this._freshing = false;
|
||||||
},
|
},
|
||||||
|
// 拉动高度
|
||||||
|
onPulling(e) {
|
||||||
|
if (e.detail.deltaY < 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.triggered = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -8,18 +8,19 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import configService from '@/common/config.service.js';
|
import configService from '@/common/config.service.js';
|
||||||
|
import Topnav from '@/components/topnav/index.vue';
|
||||||
export default {
|
export default {
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
options: {
|
options: {
|
||||||
styleIsolation: 'shared'
|
styleIsolation: 'shared'
|
||||||
},
|
},
|
||||||
// #endif
|
// #endif
|
||||||
|
components: { Topnav },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
// 微信小程序自定义导航栏参数
|
// 微信小程序自定义导航栏参数
|
||||||
StatusBar: this.StatusBar || 0,
|
CustomBar: this.CustomBar || 0,
|
||||||
CustomBarHeight: this.Custom.height+(this.Custom.top-this.StatusBar)*2 || 0,
|
|
||||||
// #endif
|
// #endif
|
||||||
loading: true, // 加载
|
loading: true, // 加载
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="order-add">
|
<view class="order-add">
|
||||||
<Topnav :topLevel="1" title="新增订单" defaultBackColor="#333333"
|
<Topnav :topLevel="1" :title="`${form.orderId?'编辑':'新增'}订单`" defaultBackColor="#333333"
|
||||||
defaultNavTextColor="#333333" showBack :fixed="false" />
|
defaultNavTextColor="#333333" showBack :fixed="false" />
|
||||||
<view class="order-form">
|
<view class="order-form">
|
||||||
<view class="order-field">
|
<view class="order-field">
|
||||||
<u-form ref="uForm" :model="form" label-position="top"
|
<u-form ref="uForm" :model="form" label-position="top"
|
||||||
:label-style="{fontFamily: 'PingFang SC, PingFang SC',
|
:label-style="{fontFamily: 'PingFang SC, PingFang SC',
|
||||||
fontWeight: 'bold',fontSize: '32rpx',color: '#000000'}">
|
fontWeight: 'bold',fontSize: '32rpx',color: '#000000'}">
|
||||||
|
<u-form-item v-if="form.orderId" label="订单号:" :border-bottom="false">
|
||||||
|
<u-input disabled class="field-ninput" placeholder="订单号" v-model="form.orderNo" />
|
||||||
|
</u-form-item>
|
||||||
<u-form-item label="订单类型:" :border-bottom="false">
|
<u-form-item label="订单类型:" :border-bottom="false">
|
||||||
<u-input class="field-input" placeholder="请选择订单类型" v-model="form.orderTypeName" type="select" disabled/>
|
<u-input style="opacity: 0.8;" class="field-input" placeholder="请选择订单类型" v-model="form.orderTypeName" type="select" disabled/>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item v-if="form.orderId" label="订单发起人:" :border-bottom="false">
|
||||||
|
<u-input disabled class="field-ninput" placeholder="订单发起人" v-model="form.orderInitiator" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item prop="customerName" required label="客户名称:" :border-bottom="false">
|
<u-form-item prop="customerName" required label="客户名称:" :border-bottom="false">
|
||||||
<u-input class="field-input" placeholder="请选择客户" v-model="form.customerName"
|
<u-input class="field-input" placeholder="请选择客户" v-model="form.customerName"
|
||||||
@ -26,7 +32,7 @@
|
|||||||
<!-- <u-input class="field-input" placeholder="请选择路线" v-model="form.routeIds"
|
<!-- <u-input class="field-input" placeholder="请选择路线" v-model="form.routeIds"
|
||||||
type="select"/> -->
|
type="select"/> -->
|
||||||
<w-select class="field-w-select" v-model="form.routeIds" multiple
|
<w-select class="field-w-select" v-model="form.routeIds" multiple
|
||||||
:list="routes" valueName="content" keyName="id" @change="changeRoute"
|
:list="routes" valueName="value" keyName="key" @change="changeRoute"
|
||||||
placeholder="请选择路线" width="100%" bgColor="#f8f9fb">
|
placeholder="请选择路线" width="100%" bgColor="#f8f9fb">
|
||||||
</w-select>
|
</w-select>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
@ -38,6 +44,25 @@
|
|||||||
<u-input type="number" class="field-ninput" placeholder="请输入附加费(最多保留两位小数)" v-model.number="form.surchargeAmount" />
|
<u-input type="number" class="field-ninput" placeholder="请输入附加费(最多保留两位小数)" v-model.number="form.surchargeAmount" />
|
||||||
<view slot="right" class="field-input-right">元</view>
|
<view slot="right" class="field-input-right">元</view>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
<u-form-item prop="operatorIds" label="操作员:" required :border-bottom="false">
|
||||||
|
<w-select class="field-w-select" v-model="form.operatorIds" multiple
|
||||||
|
:list="operators" valueName="content" keyName="id"
|
||||||
|
placeholder="请选择操作员" width="100%" bgColor="#f8f9fb">
|
||||||
|
</w-select>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item v-if="form.orderId" label="下单时间:" :border-bottom="false">
|
||||||
|
<u-input disabled class="field-ninput" placeholder="下单时间" v-model="form.orderCreateTime" />
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item v-if="form.orderId" label="订单确认人:" :border-bottom="false">
|
||||||
|
<u-input disabled class="field-ninput" placeholder="订单确认人" v-model="form.orderCreateTime" />
|
||||||
|
</u-form-item>
|
||||||
|
<view class="field-btns">
|
||||||
|
<u-button type="warning" :custom-style="customStyle" style="width: 100%;"
|
||||||
|
:hair-line="false" @click="saveOrder">保存</u-button>
|
||||||
|
<u-button style="margin-left: 30rpx;width: 100%;" type="warning" v-if="form.orderId"
|
||||||
|
:custom-style="customStyle"
|
||||||
|
:hair-line="false" @click="finishOrder">完成订单</u-button>
|
||||||
|
</view>
|
||||||
</u-form>
|
</u-form>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -67,6 +92,7 @@ export default {
|
|||||||
// #endif
|
// #endif
|
||||||
// 订单类型
|
// 订单类型
|
||||||
form:{
|
form:{
|
||||||
|
orderId: '',
|
||||||
orderType: 1,
|
orderType: 1,
|
||||||
orderTypeName: '载物订单',
|
orderTypeName: '载物订单',
|
||||||
customerName: '',
|
customerName: '',
|
||||||
@ -76,7 +102,7 @@ export default {
|
|||||||
attractionId: '',
|
attractionId: '',
|
||||||
surchargeAmount:'',
|
surchargeAmount:'',
|
||||||
cargoWeight: '',
|
cargoWeight: '',
|
||||||
operatorIds: '',
|
operatorIds: [],
|
||||||
routeIds: []
|
routeIds: []
|
||||||
},
|
},
|
||||||
// 订单类型
|
// 订单类型
|
||||||
@ -126,27 +152,61 @@ export default {
|
|||||||
// 触发器可以同时用blur和change
|
// 触发器可以同时用blur和change
|
||||||
trigger: ['change','blur'],
|
trigger: ['change','blur'],
|
||||||
}],
|
}],
|
||||||
|
routeIds: [{
|
||||||
|
require: true,
|
||||||
|
message: '请至少选择一条路线',
|
||||||
|
trigger: ['change','blur']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// 自定义验证函数,见上说明
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
return value&&value.length>0;
|
||||||
|
},
|
||||||
|
message: '请至少选择一条路线',
|
||||||
|
// 触发器可以同时用blur和change
|
||||||
|
trigger: ['change','blur'],
|
||||||
|
}],
|
||||||
|
operatorIds: [{
|
||||||
|
require: true,
|
||||||
|
message: '请至少选择一位操作员',
|
||||||
|
trigger: ['change','blur']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// 自定义验证函数,见上说明
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
return value&&value.length>0;
|
||||||
|
},
|
||||||
|
message: '请至少选择一位操作员',
|
||||||
|
// 触发器可以同时用blur和change
|
||||||
|
trigger: ['change','blur'],
|
||||||
|
}],
|
||||||
|
},
|
||||||
|
// 执行任务按钮样式
|
||||||
|
customStyle: {
|
||||||
|
backgroundColor: '#FEE547',
|
||||||
|
color: '#333333',
|
||||||
|
fontSize: '30rpx',
|
||||||
|
fontWeight: 'bold',
|
||||||
|
fontFamily: 'Source Han Sans SC',
|
||||||
|
padding: '20rpx 0',
|
||||||
|
borderRadius: '12rpx',
|
||||||
|
border: 'none'
|
||||||
},
|
},
|
||||||
// 景区列表
|
// 景区列表
|
||||||
scenics: [],
|
scenics: [],
|
||||||
// 客户列表
|
// 客户列表
|
||||||
customers: [],
|
customers: [],
|
||||||
|
// 操作员列表
|
||||||
|
operators: [],
|
||||||
// 路线列表
|
// 路线列表
|
||||||
routes: [{
|
routes: [],
|
||||||
id: 1,
|
|
||||||
content: "张三",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
content: "李四",
|
|
||||||
},],
|
|
||||||
// 用户信息
|
// 用户信息
|
||||||
userMessage: this.$store.state.vuex_token === ''?{}:JSON.parse(this.$store.state.user_message),
|
userMessage: this.$store.state.vuex_token === ''?{}:JSON.parse(this.$store.state.user_message),
|
||||||
isPilot: this.$store.state.user_type == 1,
|
isPilot: this.$store.state.user_type == 1,
|
||||||
// 景区/客户选择弹窗
|
// 景区/客户选择弹窗
|
||||||
showScenOrCus: false,
|
showScenOrCus: false,
|
||||||
// 当前景区/客户选择类型
|
// 当前景区/客户选择类型
|
||||||
scenOrCusType: ''
|
scenOrCusType: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onReady() {
|
onReady() {
|
||||||
@ -161,6 +221,9 @@ export default {
|
|||||||
return index?[arr.findIndex(item=>item.id === index)]:[0];
|
return index?[arr.findIndex(item=>item.id === index)]:[0];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onLoad(e) {
|
||||||
|
this.form.orderId = e.id || '';
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
this.init();
|
this.init();
|
||||||
@ -169,25 +232,25 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
// 初始化
|
// 初始化
|
||||||
async init(){
|
async init(){
|
||||||
let res = await this.$api.allCustomers();
|
let cusRes = await this.$api.allCustomers();
|
||||||
let resp = await this.$api.aSelfDetail(this.userMessage.id);
|
// let opeRes = await this.$api.all
|
||||||
if(!res){
|
let selfRes = await this.$api.aSelfDetail(this.userMessage.id);
|
||||||
|
if(!cusRes){
|
||||||
this.$refs.uToast.show({type: 'error',title: "客户获取失败!"});
|
this.$refs.uToast.show({type: 'error',title: "客户获取失败!"});
|
||||||
}else{
|
}else{
|
||||||
this.customers = res || [];
|
this.customers = cusRes || [];
|
||||||
}
|
}
|
||||||
if(!resp){
|
if(!selfRes){
|
||||||
this.$refs.uToast.show({type: 'error',title: "个人信息获取失败!"});
|
this.$refs.uToast.show({type: 'error',title: "个人信息获取失败!"});
|
||||||
}else{
|
}else{
|
||||||
if(resp.areaId){
|
if(selfRes.areaId){
|
||||||
let resx = await this.$api.allScenicsByAreaId({areaId: resp.areaId});
|
let scenRes = await this.$api.allScenicsByAreaId({areaId: selfRes.areaId});
|
||||||
this.scenics = resx || [];
|
this.scenics = scenRes || [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 选择路线
|
// 选择路线
|
||||||
changeRoute(e){
|
changeRoute(e){
|
||||||
console.log(this.form.routeIds);
|
|
||||||
},
|
},
|
||||||
// 点击打开景区/客户选择弹窗
|
// 点击打开景区/客户选择弹窗
|
||||||
handleSelectScenOrCus(type){
|
handleSelectScenOrCus(type){
|
||||||
@ -195,18 +258,49 @@ export default {
|
|||||||
this.showScenOrCus = true;
|
this.showScenOrCus = true;
|
||||||
},
|
},
|
||||||
// 选择景区
|
// 选择景区
|
||||||
handleConfirmScenOrCus(index){
|
async handleConfirmScenOrCus(index){
|
||||||
if(this.scenOrCusType === '景区'){
|
if(this.scenOrCusType === '景区'){
|
||||||
const val = this.scenics[index[0]];
|
const val = this.scenics[index[0]];
|
||||||
this.form.attractionName = val.name;
|
this.form.attractionName = val.name;
|
||||||
this.form.attractionId = val.id;
|
this.form.attractionId = val.id;
|
||||||
|
this.form.routeIds = [];
|
||||||
|
let res = await this.$api.allRoutesByScenicId(val.id);
|
||||||
|
if(res){
|
||||||
|
this.routes = res || [];
|
||||||
|
}else{
|
||||||
|
this.$refs.uToast.show({type: 'error',title: "景区路线获取失败!"});
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
const val = this.customers[index[0]];
|
const val = this.customers[index[0]];
|
||||||
this.form.customerId = val.id;
|
this.form.customerId = val.id;
|
||||||
this.form.customerName = val.name;
|
this.form.customerName = val.name;
|
||||||
this.form.phone = val.phone;
|
this.form.phone = val.phone;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
// 订单保存
|
||||||
|
saveOrder(){
|
||||||
|
this.$refs.uForm.validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
console.log('验证通过');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 完成订单
|
||||||
|
async finishOrder(){
|
||||||
|
let that = this;
|
||||||
|
uni.showModal({
|
||||||
|
title: '订单完成',
|
||||||
|
content: '是否确认完成该订单?',
|
||||||
|
confirmColor: '#f7c04d',
|
||||||
|
success: async(res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
let res = await that.$api.completeOrder(that.form.orderId);
|
||||||
|
that.$refs.uToast.show({type: res?'success':'error',
|
||||||
|
title: `订单完成操作${res?'成功':'失败'}!`});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -275,6 +369,14 @@ export default {
|
|||||||
margin-left: -80rpx;
|
margin-left: -80rpx;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
.field-btns{
|
||||||
|
width: 100%;
|
||||||
|
margin-top: auto;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
padding-top: 30rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<view class="order-top">
|
<view class="order-top">
|
||||||
<u-image width="100%" :src="myFileUrl+topBg" mode="widthFix" />
|
<u-image width="100%" :src="myFileUrl+topBg" mode="widthFix" />
|
||||||
<view class="top-abs" :style="{top: CustomBar+'px'}">
|
<view class="top-abs" :style="{top: CustomBar+'px'}">
|
||||||
<view class="order-status">待接单</view>
|
<view class="order-status">{{ orderDetail.mainOrderStatus }}</view>
|
||||||
<view class="order-tips">请尽快执行任务</view>
|
<view class="order-tips">{{ orderDetail.mainOrderStatus === '已完成' ? '已完成飞行任务' : '请尽快执行任务'}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-content">
|
<view class="order-content">
|
||||||
@ -20,23 +20,23 @@
|
|||||||
<view class="message-content">
|
<view class="message-content">
|
||||||
<view class="mc-lam">
|
<view class="mc-lam">
|
||||||
<text class="lam-title">订单类型</text>
|
<text class="lam-title">订单类型</text>
|
||||||
<text class="lam-value">载人</text>
|
<text class="lam-value">{{ orderDetail.orderType.slice(0, 2) }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="mc-lam">
|
<view class="mc-lam">
|
||||||
<text class="lam-title">景区</text>
|
<text class="lam-title">景区</text>
|
||||||
<text class="lam-value">白云山</text>
|
<text class="lam-value">{{ orderDetail.scenicName }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="mc-lam">
|
<view class="mc-lam">
|
||||||
<text class="lam-title">路线</text>
|
<text class="lam-title">路线</text>
|
||||||
<text class="lam-value">南门→山顶广场</text>
|
<text class="lam-value">{{ orderDetail.routeName }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="mc-lam">
|
<view class="mc-lam">
|
||||||
<text class="lam-title">货物重量</text>
|
<text class="lam-title">货物重量</text>
|
||||||
<text class="lam-value">56 KG</text>
|
<text class="lam-value">{{ orderDetail.cargoWeight }} KG</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="mc-lam">
|
<view class="mc-lam">
|
||||||
<text class="lam-title">附加费</text>
|
<text class="lam-title">附加费</text>
|
||||||
<text class="lam-value"><text>100</text>元</text>
|
<text class="lam-value"><text>{{ orderDetail.surchargeAmount }}</text>元</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -49,23 +49,23 @@
|
|||||||
<view class="message-content">
|
<view class="message-content">
|
||||||
<view class="mc-lam">
|
<view class="mc-lam">
|
||||||
<text class="lam-title">发起人</text>
|
<text class="lam-title">发起人</text>
|
||||||
<text class="lam-value">李晓霞</text>
|
<text class="lam-value">{{ orderDetail.orderInitiator }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="mc-lam">
|
<view class="mc-lam">
|
||||||
<text class="lam-title">客户名称</text>
|
<text class="lam-title">客户名称</text>
|
||||||
<text class="lam-value">李晓霞</text>
|
<text class="lam-value">{{ orderDetail.customerName }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="mc-lam">
|
<view class="mc-lam">
|
||||||
<text class="lam-title">手机号</text>
|
<text class="lam-title">手机号</text>
|
||||||
<text class="lam-value">13624566325</text>
|
<text class="lam-value">{{ orderDetail.phone }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="mc-lam">
|
<view class="mc-lam">
|
||||||
<text class="lam-title">操作员</text>
|
<text class="lam-title">操作员</text>
|
||||||
<text class="lam-value">陈新生</text>
|
<text class="lam-value">{{ orderDetail.operatorName }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="mc-lam">
|
<view class="mc-lam">
|
||||||
<text class="lam-title">下单时间</text>
|
<text class="lam-title">下单时间</text>
|
||||||
<text class="lam-value">2025-07-06 14:02:08</text>
|
<text class="lam-value">{{ orderDetail.orderCreateTime }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -75,7 +75,29 @@
|
|||||||
<u-image class="text-bg" width="148" height="28"
|
<u-image class="text-bg" width="148" height="28"
|
||||||
:src="fileUrl+textBg" />
|
:src="fileUrl+textBg" />
|
||||||
</view>
|
</view>
|
||||||
<view class="message-empty">
|
<view class="fly-message-content" v-if="orderDetail.orderTaskDetailList&&orderDetail.orderTaskDetailList.length>0"
|
||||||
|
:style="{backgroundImage: `url(${fileUrl+mask})`}" v-for="(item, index) in orderDetail.orderTaskDetailList"
|
||||||
|
:key="index">
|
||||||
|
<view class="action-detail">
|
||||||
|
<u-image border-radius="20" width="140" height="140" :src="orderDetail.attachmentMaterialList[0].fileFullPath||(fileUrl+defaultIcon)" class="action-detail-photo" />
|
||||||
|
<view class="action-detail-content">
|
||||||
|
<view class="action-device">{{ item.deviceName }}</view>
|
||||||
|
<view>重量: {{ item.cargoWeight }}KG</view>
|
||||||
|
<view class="action-operator">操作员: {{ item.operatorName }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="action-detail-status" :style="{color: item.orderItemStatus==='未进行'?'#F8B500':'#666666'}">
|
||||||
|
{{ item.orderItemStatus }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="action-btns" v-if="orderDetail.mainOrderStatus!=='已完成'">
|
||||||
|
<u-button :custom-style="deleteCustomStyle" style="margin-left: auto;"
|
||||||
|
:hair-line="false" @click="handleDeleteAction(item)">删除</u-button>
|
||||||
|
<u-button type="warning" :custom-style="customStyle" style="margin-left: 20rpx;margin-right: 30rpx;"
|
||||||
|
:hair-line="false" @click="handleChangeAction(item)">更改状态</u-button>
|
||||||
|
</view>
|
||||||
|
<view class="action-btns" v-else />
|
||||||
|
</view>
|
||||||
|
<view class="message-empty" v-else>
|
||||||
<u-image width="200rpx" height="130rpx" :src="fileUrl+empty" />
|
<u-image width="200rpx" height="130rpx" :src="fileUrl+empty" />
|
||||||
<view class="empty-text">
|
<view class="empty-text">
|
||||||
~暂无任务~
|
~暂无任务~
|
||||||
@ -83,7 +105,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-bottom">
|
<view class="order-bottom" v-if="orderDetail.mainOrderStatus !== '已完成'">
|
||||||
<view class="add-action" @click="showAddAction=true">
|
<view class="add-action" @click="showAddAction=true">
|
||||||
新增任务
|
新增任务
|
||||||
</view>
|
</view>
|
||||||
@ -174,6 +196,7 @@
|
|||||||
:iconStyle="{ color: '#fff' }" :customStyle="{background: 'linear-gradient(180deg, #f8b500 0%, #fceabb 100%)',
|
:iconStyle="{ color: '#fff' }" :customStyle="{background: 'linear-gradient(180deg, #f8b500 0%, #fceabb 100%)',
|
||||||
boxShadow: '0rpx 0rpx 12rpx rgba(202,202,182,0.5)',
|
boxShadow: '0rpx 0rpx 12rpx rgba(202,202,182,0.5)',
|
||||||
filter: 'opacity(0.96)'}"></u-back-top>
|
filter: 'opacity(0.96)'}"></u-back-top>
|
||||||
|
<u-toast ref="uToast"></u-toast>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -206,6 +229,29 @@ export default {
|
|||||||
uploadFileHeader: {
|
uploadFileHeader: {
|
||||||
'Authorization':this.$store.state.vuex_token,
|
'Authorization':this.$store.state.vuex_token,
|
||||||
},
|
},
|
||||||
|
// 执行任务按钮样式
|
||||||
|
customStyle: {
|
||||||
|
backgroundColor: '#FEE547',
|
||||||
|
color: '#333333',
|
||||||
|
fontSize: '30rpx',
|
||||||
|
fontWeight: 'bold',
|
||||||
|
fontFamily: 'Source Han Sans SC',
|
||||||
|
width: '160rpx',
|
||||||
|
height: '72rpx',
|
||||||
|
borderRadius: '12rpx',
|
||||||
|
border: 'none'
|
||||||
|
},
|
||||||
|
deleteCustomStyle:{
|
||||||
|
backgroundColor: '#FFFFFF',
|
||||||
|
color: '#333333',
|
||||||
|
fontSize: '30rpx',
|
||||||
|
fontWeight: 'bold',
|
||||||
|
fontFamily: 'Source Han Sans SC',
|
||||||
|
width: '160rpx',
|
||||||
|
height: '70rpx',
|
||||||
|
borderRadius: '10rpx',
|
||||||
|
border: '2rpx solid #999999'
|
||||||
|
},
|
||||||
// 上传文件
|
// 上传文件
|
||||||
fileList: [],
|
fileList: [],
|
||||||
//我的页图标基础路径
|
//我的页图标基础路径
|
||||||
@ -224,6 +270,10 @@ export default {
|
|||||||
closeIcon: 'close.png',
|
closeIcon: 'close.png',
|
||||||
// 上传图片图标
|
// 上传图片图标
|
||||||
uploadIcon: 'upload.png',
|
uploadIcon: 'upload.png',
|
||||||
|
// 蒙层
|
||||||
|
mask: 'mask.png',
|
||||||
|
// 飞行任务默认图片
|
||||||
|
defaultIcon: 'default.png',
|
||||||
// 页面是否滚动到顶
|
// 页面是否滚动到顶
|
||||||
topLevel: 0,
|
topLevel: 0,
|
||||||
// 滚动顶部
|
// 滚动顶部
|
||||||
@ -241,8 +291,10 @@ export default {
|
|||||||
weight: '',
|
weight: '',
|
||||||
photo: ''
|
photo: ''
|
||||||
},
|
},
|
||||||
|
// 订单详情
|
||||||
|
orderDetail: {},
|
||||||
// 当前页
|
// 当前页
|
||||||
current: 0
|
current: 0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPageScroll(e) {
|
onPageScroll(e) {
|
||||||
@ -251,7 +303,17 @@ export default {
|
|||||||
else this.topLevel = 1;
|
else this.topLevel = 1;
|
||||||
this.scrollTop = e.scrollTop;
|
this.scrollTop = e.scrollTop;
|
||||||
},
|
},
|
||||||
|
onLoad(e) {
|
||||||
|
this.init(e.id);
|
||||||
|
},
|
||||||
methods:{
|
methods:{
|
||||||
|
// 初始化
|
||||||
|
async init(id){
|
||||||
|
if(!id) return;
|
||||||
|
let res = await this.$api.orderDetail(id);
|
||||||
|
if(res) this.orderDetail = res;
|
||||||
|
else this.$refs.uToast.show({type: 'error',title: "订单详情获取失败!"});
|
||||||
|
},
|
||||||
// 设备选择
|
// 设备选择
|
||||||
handleClickPick(){
|
handleClickPick(){
|
||||||
this.showEquipment = true;
|
this.showEquipment = true;
|
||||||
@ -277,6 +339,14 @@ export default {
|
|||||||
this.current = 0;
|
this.current = 0;
|
||||||
}
|
}
|
||||||
this.current += 1;
|
this.current += 1;
|
||||||
|
},
|
||||||
|
// 删除任务
|
||||||
|
handleDeleteAction(item){
|
||||||
|
|
||||||
|
},
|
||||||
|
// 更改任务状态
|
||||||
|
handleChangeAction(item){
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -339,6 +409,54 @@ export default {
|
|||||||
margin-top: 24rpx;
|
margin-top: 24rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&-content{
|
||||||
|
background-size: contain;
|
||||||
|
margin-top: 16rpx;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
// background: linear-gradient(0deg, #FFF6BD, #FFFDF1);
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
box-shadow: 0rpx 6rpx 10rpx 0rpx rgba(200,199,193,0.3);
|
||||||
|
border-radius: 16rpx;
|
||||||
|
margin-bottom: 26rpx;
|
||||||
|
.action-detail{
|
||||||
|
margin: 40rpx 20rpx 0;
|
||||||
|
display: flex;
|
||||||
|
&-photo{
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
&-content{
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
font-family: Source Han Sans SC;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #666666;
|
||||||
|
.action-device{
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333333;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
}
|
||||||
|
.action-operator{
|
||||||
|
margin-top: 12rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-status{
|
||||||
|
font-family: Source Han Sans SC;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #F8B500;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.action-btns{
|
||||||
|
margin-top: 18rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
.message-empty{
|
.message-empty{
|
||||||
margin-top: 16rpx;
|
margin-top: 16rpx;
|
||||||
padding: 90rpx 30rpx;
|
padding: 90rpx 30rpx;
|
||||||
|
@ -3,14 +3,14 @@
|
|||||||
<Topnav :topLevel="topLevel" title="爱尚云" />
|
<Topnav :topLevel="topLevel" title="爱尚云" />
|
||||||
<u-image width="100%" :src="fileUrl+banner" mode="widthFix" />
|
<u-image width="100%" :src="fileUrl+banner" mode="widthFix" />
|
||||||
<view class="order-list">
|
<view class="order-list">
|
||||||
<view class="order-item" v-for="(item,index) in orders" :key="index">
|
<view class="order-item" v-for="(item,index) in orders" :key="index" @click="showDetail(item)">
|
||||||
<view class="item-first">
|
<view class="item-first">
|
||||||
<view class="item-status">{{ item.mainOrderStatus }}</view>
|
<view class="item-status">{{ orderStatus[item.mainOrderStatus] }}</view>
|
||||||
<view class="item-type">订单类型:<text>{{ item.orderType }}</text></view>
|
<view class="item-type">订单类型:<text>{{ orderTypes[item.orderType] }}</text></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item-second">
|
<view class="item-second">
|
||||||
<view class="item-spot">
|
<view class="item-spot">
|
||||||
<view class="item-dot"/>景区:{{ item.attractionId }}
|
<view class="item-dot"/>景区:{{ scenics[item.attractionId] }}
|
||||||
</view>
|
</view>
|
||||||
<view class="item-route">
|
<view class="item-route">
|
||||||
<view class="item-dot"/>路线:{{ item.routeName }}
|
<view class="item-dot"/>路线:{{ item.routeName }}
|
||||||
@ -19,19 +19,20 @@
|
|||||||
<view class="item-third">
|
<view class="item-third">
|
||||||
<view class="item-identity">
|
<view class="item-identity">
|
||||||
<u-image class="item-avatar" width="80rpx" height="80rpx"
|
<u-image class="item-avatar" width="80rpx" height="80rpx"
|
||||||
:src="fileUrl+(item.gender === 0 ? boyIcon : girlIcon)" />
|
:src="fileUrl+(customers[item.customerId].gender === '男' ? boyIcon : girlIcon)" />
|
||||||
<view class="item-self">
|
<view class="item-self">
|
||||||
<text class="item-name">{{ item.customerName }}</text>
|
<text class="item-name">{{ customers[item.customerId].name }}</text>
|
||||||
<text class="item-phone">{{ item.customerPhone }}</text>
|
<text class="item-phone">{{ item.customerPhone }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item-active">
|
<view class="item-active">
|
||||||
<u-button type="warning" :custom-style="customStyle"
|
<u-button type="warning" :custom-style="customStyle"
|
||||||
:hair-line="false" @click="handleDoAction(item)">执行任务</u-button>
|
:hair-line="false" @click.stop="handleDoAction(item)">执行任务</u-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-empty" v-if="orders.length===0">
|
<u-loadmore v-if="orders.length>0" @loadmore="getMore" :status="form.isFinish" color="#333333" marginTop="30" marginBottom="20" />
|
||||||
|
<view class="order-empty" v-else>
|
||||||
<u-empty text="订单为空" mode="list"
|
<u-empty text="订单为空" mode="list"
|
||||||
src="/static/empty.png" icon-size="300" font-size="40"
|
src="/static/empty.png" icon-size="300" font-size="40"
|
||||||
margin-top="250"></u-empty>
|
margin-top="250"></u-empty>
|
||||||
@ -70,44 +71,20 @@ export default {
|
|||||||
girlIcon: 'girl.png',
|
girlIcon: 'girl.png',
|
||||||
// 男生头像
|
// 男生头像
|
||||||
boyIcon: 'boy.png',
|
boyIcon: 'boy.png',
|
||||||
|
// 订单状态
|
||||||
|
orderStatus: {
|
||||||
|
0:'未进行',
|
||||||
|
1:'进行中',
|
||||||
|
2:'已完成',
|
||||||
|
3:'已取消'
|
||||||
|
},
|
||||||
|
// 订单类型
|
||||||
|
orderTypes: {
|
||||||
|
1: '载物',
|
||||||
|
2: '载人'
|
||||||
|
},
|
||||||
// 订单列表
|
// 订单列表
|
||||||
orders: [{
|
orders: [],
|
||||||
id: 1,
|
|
||||||
mainOrderStatus: '待接单',
|
|
||||||
orderType: '载物',
|
|
||||||
attractionId: '白云山',
|
|
||||||
customerPhone: '13624566325',
|
|
||||||
routeName: '南门→山顶广场',
|
|
||||||
gender: 1,
|
|
||||||
customerName: '李晓霞'
|
|
||||||
},{
|
|
||||||
id: 2,
|
|
||||||
mainOrderStatus: '待接单',
|
|
||||||
orderType: '载人',
|
|
||||||
attractionId: '白云山',
|
|
||||||
customerPhone: '13624566325',
|
|
||||||
routeName: '南门→山顶广场',
|
|
||||||
gender: 0,
|
|
||||||
customerName: '李道明'
|
|
||||||
},{
|
|
||||||
id: 3,
|
|
||||||
mainOrderStatus: '待接单',
|
|
||||||
orderType: '载物',
|
|
||||||
attractionId: '白云山',
|
|
||||||
customerPhone: '13624566325',
|
|
||||||
routeName: '南门→山顶广场',
|
|
||||||
gender: 1,
|
|
||||||
customerName: '李晓霞'
|
|
||||||
},{
|
|
||||||
id: 4,
|
|
||||||
mainOrderStatus: '待接单',
|
|
||||||
orderType: '载物',
|
|
||||||
attractionId: '白云山',
|
|
||||||
customerPhone: '13624566325',
|
|
||||||
routeName: '南门→山顶广场',
|
|
||||||
gender: 1,
|
|
||||||
customerName: '李晓霞'
|
|
||||||
}],
|
|
||||||
// 执行任务按钮样式
|
// 执行任务按钮样式
|
||||||
customStyle: {
|
customStyle: {
|
||||||
backgroundColor: '#FEE547',
|
backgroundColor: '#FEE547',
|
||||||
@ -119,20 +96,76 @@ export default {
|
|||||||
height: '72rpx',
|
height: '72rpx',
|
||||||
borderRadius: '12rpx',
|
borderRadius: '12rpx',
|
||||||
border: 'none'
|
border: 'none'
|
||||||
}
|
},
|
||||||
|
// 用户信息
|
||||||
|
userMessage: this.$store.state.vuex_token === ''?{}:JSON.parse(this.$store.state.user_message),
|
||||||
|
// 翻页参数
|
||||||
|
form:{
|
||||||
|
current: 1,
|
||||||
|
size: 10,
|
||||||
|
// 是否结束——loadmore加载更多,loading加载中,nomore无更多
|
||||||
|
isFinish: 'nomore',
|
||||||
|
},
|
||||||
|
// 用户列表
|
||||||
|
customers: {},
|
||||||
|
// 景区列表
|
||||||
|
scenics: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
this.init();
|
||||||
|
})
|
||||||
|
},
|
||||||
methods:{
|
methods:{
|
||||||
// 初始化
|
// 初始化
|
||||||
async init(){
|
async init(){
|
||||||
|
this.form = {size: 10,current: 1,isFinish: 'nomore'};
|
||||||
|
// 查询订单列表
|
||||||
|
await this.getOrderList();
|
||||||
|
// 查询全部客户
|
||||||
|
let cusRes = await this.$api.allCustomers();
|
||||||
|
if(!cusRes){
|
||||||
|
this.$refs.uToast.show({type: 'error',title: "客户获取失败!"});
|
||||||
|
}else this.customers = await cusRes.reduce((obj, item) => ({...obj,[item.id]: item}), {})||{};
|
||||||
|
// 查询全部景区
|
||||||
|
let scenRes = await this.$api.allScenic();
|
||||||
|
if(!scenRes)
|
||||||
|
this.$refs.uToast.show({type: 'error',title: "景区列表获取失败!"});
|
||||||
|
else this.scenics = await scenRes.reduce((obj, item) => ({...obj,[item.id]: item.name}), {})||{};
|
||||||
|
},
|
||||||
|
// 查询订单列表
|
||||||
|
async getOrderList(){
|
||||||
|
this.form.isFinish = 'loading';
|
||||||
|
let ordRes = await this.$api.getOrders(this.form);
|
||||||
|
if(ordRes){
|
||||||
|
const { records, size, total, current } = ordRes;
|
||||||
|
if(current === 1) this.orders = records || [];
|
||||||
|
else this.orders.push(...records);
|
||||||
|
this.form.isFinish = size*current >= total ? 'nomore' : 'loadmore';
|
||||||
|
}else{
|
||||||
|
this.$refs.uToast.show({type:'error',title: "订单列表获取失败!"});
|
||||||
|
this.form.isFinish = 'loadmore';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 加载更多
|
||||||
|
getMore(){
|
||||||
|
if(this.form.isFinish === 'nomore') return;
|
||||||
|
this.form.current++;
|
||||||
|
this.getOrderList();
|
||||||
},
|
},
|
||||||
// 执行任务
|
// 执行任务
|
||||||
handleDoAction(item){
|
handleDoAction(item){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/aircraft/server/order/detail?id=${item.id}`
|
url: `/aircraft/server/order/detail?id=${item.id}`
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
|
// 查看详情
|
||||||
|
showDetail(item){
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/aircraft/server/order/add?id=${item.id}`
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -11,10 +11,18 @@ const install = (Vue, vm) => {
|
|||||||
vm.$api.aUpdatePass = async (params = {}) => await vm.$u.post(`/api/emEmployees/updatePass`,params);// 修改飞行员密码
|
vm.$api.aUpdatePass = async (params = {}) => await vm.$u.post(`/api/emEmployees/updatePass`,params);// 修改飞行员密码
|
||||||
vm.$api.bUpdatePass = async (params = {}) => await vm.$u.post(`/cnCustomer/updatePass`,params);// 修改客户密码
|
vm.$api.bUpdatePass = async (params = {}) => await vm.$u.post(`/cnCustomer/updatePass`,params);// 修改客户密码
|
||||||
|
|
||||||
// 区域管理
|
// 区域/景区管理
|
||||||
vm.$api.allAreas = async () => await vm.$u.get('/emArea/all');// 获取全部区域
|
vm.$api.allAreas = async () => await vm.$u.get('/emArea/all');// 获取全部区域
|
||||||
vm.$api.allScenicsByAreaId = async (params = {}) => await vm.$u.get('/emScenic/all',params);// 获取区域下全部景区
|
vm.$api.allScenicsByAreaId = async (params = {}) => await vm.$u.get('/emScenic/all',params);// 获取区域下全部景区
|
||||||
|
vm.$api.allRoutesByScenicId = async (scenicId) => await vm.$u.get(`/api/dataDropdown/obtainRouteListByScenicId/${scenicId}`);// 根据景区获取对应的线路
|
||||||
|
vm.$api.allScenic = async () => await vm.$u.get('/emScenic/all');// 获取全部景区
|
||||||
|
vm.$api.singleScenic = async (id) => await vm.$u.get(`/emScenic/${id}`);// 查询单个景区
|
||||||
|
|
||||||
|
// 订单管理
|
||||||
|
vm.$api.completeOrder = async (orderId) => await vm.$u.get(`/api/order/completeOrder/${orderId}`);// 完成订单
|
||||||
|
vm.$api.getOrders = async (params = {}) => await vm.$u.get('/api/order/allOrder',params);// 获取订单列表
|
||||||
|
vm.$api.orderDetail = async (id) => await vm.$u.get(`/api/order/queryOrderDetail/${id}`);// 查询单个订单
|
||||||
|
|
||||||
// 客户管理
|
// 客户管理
|
||||||
vm.$api.allCustomers = async () => await vm.$u.get('/cnCustomer/all');// 获取全部客户
|
vm.$api.allCustomers = async () => await vm.$u.get('/cnCustomer/all');// 获取全部客户
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user