对接订单新增接口,调整主要页面顶部导航栏出现情况

This commit is contained in:
Double-_-Z 2025-08-01 01:07:23 +08:00
parent fac1f705e4
commit 2768d24990
5 changed files with 53 additions and 44 deletions

View File

@ -1,5 +1,7 @@
<template> <template>
<view class="mobile-index"> <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-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&&current!==3)||(!isPilot&&current!==1)" :refresher-enabled="(isPilot&&current!==3)||(!isPilot&&current!==1)"
@ -39,21 +41,23 @@ import Equipment from '@/aircraft/server/equipment/equipment.vue';
import Route from '@/aircraft/server/route/route.vue'; import Route from '@/aircraft/server/route/route.vue';
import My from '@/aircraft/server/my/my.vue'; import My from '@/aircraft/server/my/my.vue';
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 {
components: { components: {
Order, Equipment, Route, My Order, Equipment, Route, My, Topnav
}, },
data() { data() {
return { return {
current: uni.getStorageSync('current')||0,// current: uni.getStorageSync('current')||0,//
loading: false, loading: false,
fileUrl: configService.fileUrl + 'aerocraft/navigation/',// fileUrl: configService.fileUrl + 'aerocraft/navigation/',//
// // a
aNavicationList:[ aNavicationList:[
{ {
name: '订单', name: '订单',
icon: 'order.png', icon: 'order.png',
select: 'order-select.png' select: 'order-select.png',
navTitle: '爱尚云'
}, },
{ {
name: '设备', name: '设备',
@ -71,11 +75,13 @@ export default {
select: 'my-select.png' select: 'my-select.png'
} }
], ],
// b
bNavicationList:[ bNavicationList:[
{ {
name: '订单', name: '订单',
icon: 'order.png', icon: 'order.png',
select: 'order-select.png' select: 'order-select.png',
navTitle: '爱尚云'
}, },
{ {
name: '我的', name: '我的',
@ -98,6 +104,8 @@ export default {
} }
}, },
mounted(){ mounted(){
},
onShow(){
this._freshing = false; this._freshing = false;
let index = uni.getStorageSync('current'); let index = uni.getStorageSync('current');
// B线 // B线
@ -106,15 +114,6 @@ export default {
this.isPilot = this.$store.state.user_type; this.isPilot = this.$store.state.user_type;
this.changeCurrent(this.current); 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:{ methods:{
// //
changeCurrent(index){ changeCurrent(index){

View File

@ -46,7 +46,7 @@
</u-form-item> </u-form-item>
<u-form-item prop="operatorIds" label="操作员:" required :border-bottom="false"> <u-form-item prop="operatorIds" label="操作员:" required :border-bottom="false">
<w-select class="field-w-select" v-model="form.operatorIds" multiple <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"> placeholder="请选择操作员" width="100%" bgColor="#f8f9fb">
</w-select> </w-select>
</u-form-item> </u-form-item>
@ -58,7 +58,7 @@
</u-form-item> </u-form-item>
<view class="field-btns"> <view class="field-btns">
<u-button type="warning" :custom-style="customStyle" style="width: 100%;" <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" <u-button style="margin-left: 30rpx;width: 100%;" type="warning" v-if="form.orderId"
:custom-style="customStyle" :custom-style="customStyle"
:hair-line="false" @click="finishOrder">完成订单</u-button> :hair-line="false" @click="finishOrder">完成订单</u-button>
@ -76,7 +76,7 @@
<script> <script>
import Topnav from '@/components/topnav/index.vue'; import Topnav from '@/components/topnav/index.vue';
import configService from '@/common/config.service.js'; 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 { export default {
// #ifdef MP // #ifdef MP
options: { options: {
@ -177,6 +177,8 @@ export default {
operators: [], operators: [],
// 线 // 线
routes: [], routes: [],
//
saveLoading: false,
// //
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,
@ -219,11 +221,12 @@ export default {
}else{ }else{
if(selfRes.areaId){ if(selfRes.areaId){
let scenRes = await this.$api.allScenicsByAreaId({areaId: selfRes.areaId}); let scenRes = await this.$api.allScenicsByAreaId({areaId: selfRes.areaId});
//
let opeRes = await this.$api.allEmployees({areaId: selfRes.areaId});
this.scenics = scenRes || []; this.scenics = scenRes || [];
this.operators = opeRes || [];
} }
} }
//
// let opeRes = await this.$api.all
// //
if(this.form.orderId) this.getOrderDetail(); if(this.form.orderId) this.getOrderDetail();
}, },
@ -231,7 +234,7 @@ export default {
async getOrderDetail(){ async getOrderDetail(){
let res = await this.$api.orderDetail(this.form.orderId); let res = await this.$api.orderDetail(this.form.orderId);
if(res){ 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 = { this.form = {
orderId: id, orderId: id,
orderNo: orderNo, orderNo: orderNo,
@ -246,6 +249,7 @@ export default {
cargoWeight: cargoWeight, cargoWeight: cargoWeight,
operatorIds: [], operatorIds: [],
routeIds: [], routeIds: [],
orderInitiator: orderInitiator,
orderCreateTime: orderCreateTime, orderCreateTime: orderCreateTime,
} }
} else } else
@ -281,11 +285,29 @@ export default {
}, },
// //
saveOrder(){ saveOrder(){
this.$refs.uForm.validate(valid => { try{
if (valid) { let that = this;
console.log('验证通过'); 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(){ async finishOrder(){

View File

@ -75,9 +75,8 @@
<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="fly-message-content" v-if="orderDetail.orderTaskDetailList&&orderDetail.orderTaskDetailList.length>0" <view class="fly-message-content" :style="{backgroundImage: `url(${fileUrl+mask})`}"
:style="{backgroundImage: `url(${fileUrl+mask})`}" v-for="(item, index) in orderDetail.orderTaskDetailList" v-for="(item, index) in orderDetail.orderTaskDetailList" :key="index">
:key="index">
<view class="action-detail"> <view class="action-detail">
<u-image border-radius="20" width="140" height="140" :src="orderDetail.attachmentMaterialList[0].fileFullPath||(fileUrl+defaultIcon)" class="action-detail-photo" /> <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-detail-content">
@ -97,7 +96,7 @@
</view> </view>
<view class="action-btns" v-else /> <view class="action-btns" v-else />
</view> </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" /> <u-image width="200rpx" height="130rpx" :src="fileUrl+empty" />
<view class="empty-text"> <view class="empty-text">
~暂无任务~ ~暂无任务~
@ -259,7 +258,7 @@ export default {
// //
fileUrl: configService.fileUrl + 'aerocraft/order/', fileUrl: configService.fileUrl + 'aerocraft/order/',
// //
topBg: 'top-bg.png', topBg: 'top-bg-a.png',
// //
textBg: 'text-bg.png', textBg: 'text-bg.png',
// //

View File

@ -1,6 +1,5 @@
<template> <template>
<view class="aircraft-order"> <view class="aircraft-order">
<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" @click="showDetail(item)"> <view class="order-item" v-for="(item,index) in orders" :key="index" @click="showDetail(item)">
@ -46,20 +45,13 @@
<script> <script>
import configService from '@/common/config.service.js'; import configService from '@/common/config.service.js';
import Movable from './components/movable.vue'; import Movable from './components/movable.vue';
import Topnav from '@/components/topnav/index.vue';
export default { export default {
// #ifdef MP // #ifdef MP
options: { options: {
styleIsolation: 'shared' styleIsolation: 'shared'
}, },
// #endif // #endif
components: { Movable, Topnav }, components: { Movable },
props: {
topLevel:{
type: Number,
default: 0
},
},
data(){ data(){
return { return {
fileUrl: configService.fileUrl + 'aerocraft/order/',// fileUrl: configService.fileUrl + 'aerocraft/order/',//
@ -112,11 +104,6 @@ export default {
scenics: {} scenics: {}
} }
}, },
onLoad() {
this.$nextTick(()=>{
this.init();
})
},
methods:{ methods:{
// //
async init(){ async init(){
@ -140,7 +127,7 @@ export default {
let ordRes = await this.$api.getOrders(this.form); let ordRes = await this.$api.getOrders(this.form);
if(ordRes){ if(ordRes){
const { records, size, total, current } = ordRes; const { records, size, total, current } = ordRes;
if(current === 1) this.orders = records || []; if(current == 1) this.orders = records || [];
else this.orders.push(...records); else this.orders.push(...records);
this.form.isFinish = size*current >= total ? 'nomore' : 'loadmore'; this.form.isFinish = size*current >= total ? 'nomore' : 'loadmore';
}else{ }else{

View File

@ -10,6 +10,7 @@ const install = (Vue, vm) => {
vm.$api.aEditSelf = async (params = {}) => await vm.$u.put(`/api/emEmployees`,params);// 修改飞行员信息 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.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.allEmployees = async (params = {}) => await vm.$u.get('/api/emEmployees/all',params);// 条件查询全部飞行员
// 区域/景区管理 // 区域/景区管理
vm.$api.allAreas = async () => await vm.$u.get('/emArea/all');// 获取全部区域 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.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.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.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');// 获取全部客户 vm.$api.allCustomers = async () => await vm.$u.get('/cnCustomer/all');// 获取全部客户