对接订单新增接口,调整主要页面顶部导航栏出现情况
This commit is contained in:
parent
fac1f705e4
commit
2768d24990
@ -1,5 +1,7 @@
|
||||
<template>
|
||||
<view class="mobile-index">
|
||||
<Topnav v-if="isPilot?aNavicationList[current].navTitle:bNavicationList[current].navTitle"
|
||||
:topLevel="topLevel" :title="isPilot?aNavicationList[current].navTitle:bNavicationList[current].navTitle" />
|
||||
<scroll-view :scroll-top="scrollTop" :scrollY="true" class="u-page upage"
|
||||
scroll-with-animation @scroll="scroll" @refresherrefresh="refresh"
|
||||
:refresher-enabled="(isPilot&¤t!==3)||(!isPilot&¤t!==1)"
|
||||
@ -39,21 +41,23 @@ import Equipment from '@/aircraft/server/equipment/equipment.vue';
|
||||
import Route from '@/aircraft/server/route/route.vue';
|
||||
import My from '@/aircraft/server/my/my.vue';
|
||||
import configService from '@/common/config.service.js';
|
||||
import Topnav from '@/components/topnav/index.vue';
|
||||
export default {
|
||||
components: {
|
||||
Order, Equipment, Route, My
|
||||
Order, Equipment, Route, My, Topnav
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
current: uni.getStorageSync('current')||0,// 当前页码下标
|
||||
loading: false,
|
||||
fileUrl: configService.fileUrl + 'aerocraft/navigation/',//导航栏图标基础路径
|
||||
// 导航栏按钮
|
||||
// a端导航栏按钮
|
||||
aNavicationList:[
|
||||
{
|
||||
name: '订单',
|
||||
icon: 'order.png',
|
||||
select: 'order-select.png'
|
||||
select: 'order-select.png',
|
||||
navTitle: '爱尚云'
|
||||
},
|
||||
{
|
||||
name: '设备',
|
||||
@ -71,11 +75,13 @@ export default {
|
||||
select: 'my-select.png'
|
||||
}
|
||||
],
|
||||
// b端导航栏按钮
|
||||
bNavicationList:[
|
||||
{
|
||||
name: '订单',
|
||||
icon: 'order.png',
|
||||
select: 'order-select.png'
|
||||
select: 'order-select.png',
|
||||
navTitle: '爱尚云'
|
||||
},
|
||||
{
|
||||
name: '我的',
|
||||
@ -98,6 +104,8 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
},
|
||||
onShow(){
|
||||
this._freshing = false;
|
||||
let index = uni.getStorageSync('current');
|
||||
// B端没有设备和路线
|
||||
@ -106,15 +114,6 @@ export default {
|
||||
this.isPilot = this.$store.state.user_type;
|
||||
this.changeCurrent(this.current);
|
||||
},
|
||||
onShow(){
|
||||
// // 小程序除我的页,其它不要刷新
|
||||
// let index = uni.getStorageSync('current');
|
||||
// this.current = index?index:0;
|
||||
// this.isLogin = this.$store.state.vuex_token;
|
||||
// if(this.current === 3){
|
||||
// this.changeCurrent(this.current);
|
||||
// }
|
||||
},
|
||||
methods:{
|
||||
// 切换页面
|
||||
changeCurrent(index){
|
||||
|
@ -46,7 +46,7 @@
|
||||
</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"
|
||||
:list="operators" valueName="name" keyName="id"
|
||||
placeholder="请选择操作员" width="100%" bgColor="#f8f9fb">
|
||||
</w-select>
|
||||
</u-form-item>
|
||||
@ -58,7 +58,7 @@
|
||||
</u-form-item>
|
||||
<view class="field-btns">
|
||||
<u-button type="warning" :custom-style="customStyle" style="width: 100%;"
|
||||
:hair-line="false" @click="saveOrder">保存</u-button>
|
||||
:hair-line="false" @click="saveOrder" :loading="saveLoading">保存</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>
|
||||
@ -76,7 +76,7 @@
|
||||
<script>
|
||||
import Topnav from '@/components/topnav/index.vue';
|
||||
import configService from '@/common/config.service.js';
|
||||
import WSelect from '@/components/w-select/w-select.vue'
|
||||
import WSelect from '@/components/w-select/w-select.vue';
|
||||
export default {
|
||||
// #ifdef MP
|
||||
options: {
|
||||
@ -177,6 +177,8 @@ export default {
|
||||
operators: [],
|
||||
// 路线列表
|
||||
routes: [],
|
||||
// 保存加载
|
||||
saveLoading: false,
|
||||
// 用户信息
|
||||
userMessage: this.$store.state.vuex_token === ''?{}:JSON.parse(this.$store.state.user_message),
|
||||
isPilot: this.$store.state.user_type == 1,
|
||||
@ -219,11 +221,12 @@ export default {
|
||||
}else{
|
||||
if(selfRes.areaId){
|
||||
let scenRes = await this.$api.allScenicsByAreaId({areaId: selfRes.areaId});
|
||||
// 获取操作员列表
|
||||
let opeRes = await this.$api.allEmployees({areaId: selfRes.areaId});
|
||||
this.scenics = scenRes || [];
|
||||
this.operators = opeRes || [];
|
||||
}
|
||||
}
|
||||
// 获取操作员列表
|
||||
// let opeRes = await this.$api.all
|
||||
// 获取订单详情
|
||||
if(this.form.orderId) this.getOrderDetail();
|
||||
},
|
||||
@ -231,7 +234,7 @@ export default {
|
||||
async getOrderDetail(){
|
||||
let res = await this.$api.orderDetail(this.form.orderId);
|
||||
if(res){
|
||||
const { id, customerName, phone, scenicName, surchargeAmount, cargoWeight, orderNo, orderCreateTime } = res;
|
||||
const { id, customerName, phone, scenicName, surchargeAmount, cargoWeight, orderNo, orderCreateTime, orderInitiator } = res;
|
||||
this.form = {
|
||||
orderId: id,
|
||||
orderNo: orderNo,
|
||||
@ -246,6 +249,7 @@ export default {
|
||||
cargoWeight: cargoWeight,
|
||||
operatorIds: [],
|
||||
routeIds: [],
|
||||
orderInitiator: orderInitiator,
|
||||
orderCreateTime: orderCreateTime,
|
||||
}
|
||||
} else
|
||||
@ -281,11 +285,29 @@ export default {
|
||||
},
|
||||
// 订单保存
|
||||
saveOrder(){
|
||||
this.$refs.uForm.validate(valid => {
|
||||
if (valid) {
|
||||
console.log('验证通过');
|
||||
}
|
||||
});
|
||||
try{
|
||||
let that = this;
|
||||
this.saveLoading = true;
|
||||
this.$refs.uForm.validate(async(valid) => {
|
||||
if (valid) {
|
||||
const data = {...that.form,operatorIds:that.form.operatorIds.map(item=>item.id),
|
||||
routeIds:that.form.routeIds.map(item=>item.key),
|
||||
orderCreateTime:that.$u.timeFormat(new Date().getTime(),'yyyy-mm-dd hh:MM:ss')}
|
||||
console.log('验证通过',that.form);
|
||||
let res = await that.$api.addOrder(data);
|
||||
that.saveLoading = false;
|
||||
uni.navigateBack({complete() {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '订单新增成功!'
|
||||
})
|
||||
}})
|
||||
}
|
||||
});
|
||||
}catch(e){
|
||||
this.saveLoading = false;
|
||||
this.$refs.uToast.show({type: 'error',title: "订单新增失败!"});
|
||||
}
|
||||
},
|
||||
// 完成订单
|
||||
async finishOrder(){
|
||||
|
@ -75,9 +75,8 @@
|
||||
<u-image class="text-bg" width="148" height="28"
|
||||
:src="fileUrl+textBg" />
|
||||
</view>
|
||||
<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="fly-message-content" :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">
|
||||
@ -97,7 +96,7 @@
|
||||
</view>
|
||||
<view class="action-btns" v-else />
|
||||
</view>
|
||||
<view class="message-empty" v-else>
|
||||
<view class="message-empty" v-if="!orderDetail.orderTaskDetailList||orderDetail.orderTaskDetailList.length===0">
|
||||
<u-image width="200rpx" height="130rpx" :src="fileUrl+empty" />
|
||||
<view class="empty-text">
|
||||
~暂无任务~
|
||||
@ -259,7 +258,7 @@ export default {
|
||||
// 订单页图标基础路径
|
||||
fileUrl: configService.fileUrl + 'aerocraft/order/',
|
||||
// 轮播图
|
||||
topBg: 'top-bg.png',
|
||||
topBg: 'top-bg-a.png',
|
||||
// 文字背景图
|
||||
textBg: 'text-bg.png',
|
||||
// 飞行任务空图标
|
||||
|
@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<view class="aircraft-order">
|
||||
<Topnav :topLevel="topLevel" title="爱尚云" />
|
||||
<u-image width="100%" :src="fileUrl+banner" mode="widthFix" />
|
||||
<view class="order-list">
|
||||
<view class="order-item" v-for="(item,index) in orders" :key="index" @click="showDetail(item)">
|
||||
@ -46,20 +45,13 @@
|
||||
<script>
|
||||
import configService from '@/common/config.service.js';
|
||||
import Movable from './components/movable.vue';
|
||||
import Topnav from '@/components/topnav/index.vue';
|
||||
export default {
|
||||
// #ifdef MP
|
||||
options: {
|
||||
styleIsolation: 'shared'
|
||||
},
|
||||
// #endif
|
||||
components: { Movable, Topnav },
|
||||
props: {
|
||||
topLevel:{
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
},
|
||||
components: { Movable },
|
||||
data(){
|
||||
return {
|
||||
fileUrl: configService.fileUrl + 'aerocraft/order/',//订单页图标基础路径
|
||||
@ -112,11 +104,6 @@ export default {
|
||||
scenics: {}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.$nextTick(()=>{
|
||||
this.init();
|
||||
})
|
||||
},
|
||||
methods:{
|
||||
// 初始化
|
||||
async init(){
|
||||
@ -140,7 +127,7 @@ export default {
|
||||
let ordRes = await this.$api.getOrders(this.form);
|
||||
if(ordRes){
|
||||
const { records, size, total, current } = ordRes;
|
||||
if(current === 1) this.orders = records || [];
|
||||
if(current == 1) this.orders = records || [];
|
||||
else this.orders.push(...records);
|
||||
this.form.isFinish = size*current >= total ? 'nomore' : 'loadmore';
|
||||
}else{
|
||||
|
@ -10,6 +10,7 @@ const install = (Vue, vm) => {
|
||||
vm.$api.aEditSelf = async (params = {}) => await vm.$u.put(`/api/emEmployees`,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.allEmployees = async (params = {}) => await vm.$u.get('/api/emEmployees/all',params);// 条件查询全部飞行员
|
||||
|
||||
// 区域/景区管理
|
||||
vm.$api.allAreas = async () => await vm.$u.get('/emArea/all');// 获取全部区域
|
||||
@ -22,6 +23,7 @@ const install = (Vue, vm) => {
|
||||
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.addOrder = async (params = {}) => await vm.$u.post(`/api/order/addOrder`,params);// 新增订单
|
||||
|
||||
// 客户管理
|
||||
vm.$api.allCustomers = async () => await vm.$u.get('/cnCustomer/all');// 获取全部客户
|
||||
|
Loading…
Reference in New Issue
Block a user