订单页剩余接口对接
This commit is contained in:
parent
ca37ed420b
commit
2a9c5ee010
@ -7,10 +7,10 @@
|
|||||||
:refresher-enabled="(isPilot&¤t!==3)||(!isPilot&¤t!==1)"
|
:refresher-enabled="(isPilot&¤t!==3)||(!isPilot&¤t!==1)"
|
||||||
:refresher-triggered="triggered" @refresherpulling="onPulling" lower-threshold="60">
|
: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" :isPilot="isPilot" v-if="current===0" />
|
||||||
<Equipment ref="pageRef" :topLevel="topLevel" v-if="isPilot&¤t===1" />
|
<Equipment ref="pageRef" :topLevel="topLevel" v-if="isPilot&¤t===1" />
|
||||||
<Route ref="pageRef" :topLevel="topLevel" v-else-if="isPilot&¤t===2" />
|
<Route ref="pageRef" :topLevel="topLevel" v-else-if="isPilot&¤t===2" />
|
||||||
<My ref="pageRef" :topLevel="topLevel" :isLogin="isLogin" @userLogOut="isLogin=''" v-else-if="isPilot&¤t===3||current===1" />
|
<My ref="pageRef" :isPilot="isPilot" :isLogin="isLogin" @userLogOut="isLogin=''" v-else-if="isPilot&¤t===3||current===1" />
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifndef MP-WEIXIN -->
|
<!-- #ifndef MP-WEIXIN -->
|
||||||
<component ref="pageRef" :topLevel="topLevel" :is="refs[current]"
|
<component ref="pageRef" :topLevel="topLevel" :is="refs[current]"
|
||||||
@ -32,7 +32,7 @@
|
|||||||
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>
|
||||||
</view>
|
</view>
|
||||||
<Movable v-if="current === 0" :iconName="ordFileUrl+addIcon" />
|
<Movable v-if="current === 0 && isPilot" :iconName="ordFileUrl+addIcon" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<u-image width="100%" :src="fileUrl+topBg" mode="widthFix" />
|
<u-image width="100%" :src="fileUrl+topBg" mode="widthFix" />
|
||||||
<view class="my-identity">
|
<view class="my-identity">
|
||||||
<u-image class="my-avatar" width="120rpx" height="120rpx"
|
<u-image class="my-avatar" width="120rpx" height="120rpx"
|
||||||
src="/static/header.png" />
|
:src="ordFileUrl+(isPilot||!customer.gender?pilotIcon:(customer.gender === '男' ? boyIcon : girlIcon))" />
|
||||||
<view class="my-self">
|
<view class="my-self">
|
||||||
<text>{{ userMessage.nickName || userMessage.username || '用户' }}</text>
|
<text>{{ userMessage.nickName || userMessage.username || '用户' }}</text>
|
||||||
<text>欢迎来到爱尚云,愿您有个美好体验!</text>
|
<text>欢迎来到爱尚云,愿您有个美好体验!</text>
|
||||||
@ -36,9 +36,9 @@ export default {
|
|||||||
},
|
},
|
||||||
// #endif
|
// #endif
|
||||||
props: {
|
props: {
|
||||||
topLevel:{
|
isPilot: {
|
||||||
type: Number,
|
type: Boolean,
|
||||||
default: 0
|
default: true
|
||||||
},
|
},
|
||||||
isLogin: {
|
isLogin: {
|
||||||
type: String,
|
type: String,
|
||||||
@ -49,11 +49,20 @@ export default {
|
|||||||
return{
|
return{
|
||||||
//我的页图标基础路径
|
//我的页图标基础路径
|
||||||
fileUrl: configService.fileUrl + 'aerocraft/my/',
|
fileUrl: configService.fileUrl + 'aerocraft/my/',
|
||||||
|
ordFileUrl: configService.fileUrl + 'aerocraft/order/',//订单页图标基础路径
|
||||||
// 轮播图
|
// 轮播图
|
||||||
topBg: 'top-bg-a.png',
|
topBg: 'top-bg-a.png',
|
||||||
|
// 女生头像
|
||||||
|
girlIcon: 'girl.png',
|
||||||
|
// 男生头像
|
||||||
|
boyIcon: 'boy.png',
|
||||||
|
// 飞行员默认头像
|
||||||
|
pilotIcon: 'pilot-avatar.png',
|
||||||
// 用户信息
|
// 用户信息
|
||||||
// userMessage:{}
|
// userMessage:{}
|
||||||
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),
|
||||||
|
// 客户信息
|
||||||
|
customer: {},
|
||||||
// 功能列表
|
// 功能列表
|
||||||
functions: [{
|
functions: [{
|
||||||
name: '历史订单',
|
name: '历史订单',
|
||||||
@ -68,18 +77,17 @@ export default {
|
|||||||
icon: 'password.png',
|
icon: 'password.png',
|
||||||
url: '/aircraft/server/my/child_pages/reset-password'
|
url: '/aircraft/server/my/child_pages/reset-password'
|
||||||
}],
|
}],
|
||||||
isPilot: this.$store.state.user_type == 1,
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed:{
|
computed:{
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
// 初始化
|
// 初始化
|
||||||
init(){
|
async init(){
|
||||||
if(this.isLogin !== ''){
|
this.userMessage = this.isLogin === '' ? {} : JSON.parse(this.$store.state.user_message);
|
||||||
this.userMessage = JSON.parse(this.$store.state.user_message);
|
if(this.userMessage.id){
|
||||||
}else{
|
let res = await this.$api.bSelfDetail(this.userMessage.id);
|
||||||
this.userMessage = {};
|
this.customer = res === undefined ? {} : res;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 功能栏点击
|
// 功能栏点击
|
||||||
|
@ -56,17 +56,18 @@
|
|||||||
<u-form-item v-if="form.orderId" label="下单时间:" :border-bottom="false">
|
<u-form-item v-if="form.orderId" label="下单时间:" :border-bottom="false">
|
||||||
<u-input disabled class="field-ninput" placeholder="下单时间" v-model="form.orderCreateTime" />
|
<u-input disabled class="field-ninput" placeholder="下单时间" v-model="form.orderCreateTime" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item v-if="form.orderId" :label="`订单确认人${form.confirmStatus?
|
<u-form-item v-if="form.orderId" :label="`订单确认人${ ['未进行','已取消'].includes(form.mainOrderStatus)
|
||||||
(form.confirmStatus===1?'(待确认)':'(已确认)'):''}:`" :border-bottom="false">
|
?'':(form.mainOrderStatus==='已完成'?'(已确认)':'(待确认)')}:`" :border-bottom="false">
|
||||||
<u-input disabled class="field-ninput" placeholder="订单确认人" v-model="form.customerName" />
|
<u-input disabled class="field-ninput" placeholder="订单确认人" v-model="form.customerName" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<view class="field-btns" v-if="isPilot&&(!form.confirmStatus||form.confirmStatus===0)
|
<view class="field-btns" v-if="form.orderInitiatorId===userMessage.id&&
|
||||||
&&(!form.orderId||form.orderInitiatorId==userMessage.id)">
|
(!form.mainOrderStatus||form.mainOrderStatus!=='已完成'||form.mainOrderStatus!=='已取消')">
|
||||||
<u-button type="warning" :custom-style="customStyle" style="width: 100%;" v-if="!isDisable"
|
<u-button type="warning" :custom-style="customStyle" style="width: 100%;" v-if="!isDisable"
|
||||||
:hair-line="false" @click="saveOrder" :loading="saveLoading">保存</u-button>
|
:hair-line="false" @click="saveOrder" :loading="saveLoading">保存</u-button>
|
||||||
<u-button :style="{marginLeft: isDisable?'0rpx':'30rpx',width: '100%'}" type="warning"
|
<u-button :style="{marginLeft: isDisable?'0rpx':'30rpx',width: '100%'}" type="warning"
|
||||||
v-if="form.orderId" :custom-style="customStyle"
|
v-if="canFinish" :custom-style="customStyle" :hair-line="false" @click="finishOrder">
|
||||||
:hair-line="false" @click="finishOrder">完成订单</u-button>
|
完成订单
|
||||||
|
</u-button>
|
||||||
</view>
|
</view>
|
||||||
</u-form>
|
</u-form>
|
||||||
</view>
|
</view>
|
||||||
@ -139,8 +140,9 @@ export default {
|
|||||||
trigger: ['change','blur'],
|
trigger: ['change','blur'],
|
||||||
}],
|
}],
|
||||||
surchargeAmount: [{
|
surchargeAmount: [{
|
||||||
required: true,
|
validator: (rule, value, callback) => {
|
||||||
type: 'float',
|
return value&&/^-?\d*\.?\d+$/.test(value);;
|
||||||
|
},
|
||||||
message: '附加费格式不正确',
|
message: '附加费格式不正确',
|
||||||
trigger: ['change','blur']
|
trigger: ['change','blur']
|
||||||
}],
|
}],
|
||||||
@ -192,7 +194,7 @@ export default {
|
|||||||
// 当前景区/客户选择类型
|
// 当前景区/客户选择类型
|
||||||
scenOrCusType: '',
|
scenOrCusType: '',
|
||||||
// 订单状态
|
// 订单状态
|
||||||
orderStatus: ['进行中','已完成','已取消'],
|
orderStatus: ['进行中','已完成','已取消','待确认'],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onReady() {
|
onReady() {
|
||||||
@ -206,15 +208,32 @@ export default {
|
|||||||
const index = this.form[isScen?'attractionId':'customerId'];
|
const index = this.form[isScen?'attractionId':'customerId'];
|
||||||
return index?[arr.findIndex(item=>item.id === index)]:[0];
|
return index?[arr.findIndex(item=>item.id === index)]:[0];
|
||||||
},
|
},
|
||||||
|
// 判断是否可以完成订单
|
||||||
|
canFinish(){
|
||||||
|
/*
|
||||||
|
1.编辑
|
||||||
|
2.订单状态不处于已完成、已取消、未进行、飞行员-待确认
|
||||||
|
3.飞行员-订单发起人||客户-确认人
|
||||||
|
4.不存在飞行任务为未进行或进行中的状态
|
||||||
|
*/
|
||||||
|
const { orderId, mainOrderStatus, orderTaskDetailList, orderInitiatorId, customerId } = this.form;
|
||||||
|
return orderId&&(!mainOrderStatus||mainOrderStatus!=='未进行')&&
|
||||||
|
(this.isPilot&&orderInitiatorId==this.userMessage.id&&mainOrderStatus!=='待确认'||
|
||||||
|
!this.isPilot&&customerId==userMessage.id)&&(!orderTaskDetailList||
|
||||||
|
orderTaskDetailList.some(item=>item.orderItemStatus!=='未进行'||item.orderItemStatus!=='进行中'));
|
||||||
|
},
|
||||||
// 判断是否可以删除
|
// 判断是否可以删除
|
||||||
canDelete(){
|
canDelete(){
|
||||||
const { orderId, orderInitiatorId, confirmStatus, orderTaskDetailList } = this.form;
|
const { orderId, orderInitiatorId, mainOrderStatus, orderTaskDetailList } = this.form;
|
||||||
return orderId&&this.isPilot&&orderInitiatorId==this.userMessage.id
|
return orderId&&this.isPilot&&orderInitiatorId==this.userMessage.id
|
||||||
&&(!confirmStatus||confirmStatus===0)&&(!orderTaskDetailList||orderTaskDetailList.some(
|
&&(!mainOrderStatus||mainOrderStatus==='未进行')&&(!orderTaskDetailList||orderTaskDetailList.length===0);
|
||||||
item=>!this.orderStatus.includes(item.orderItemStatus)));
|
|
||||||
},
|
},
|
||||||
// 判断是否禁用保存
|
// 判断是否禁用保存
|
||||||
isDisable(){
|
isDisable(){
|
||||||
|
/*
|
||||||
|
1.订单状态不处于已完成、已取消
|
||||||
|
2.存在飞行任务为进行中、已完成、已取消、待确认状态
|
||||||
|
*/
|
||||||
const { orderTaskDetailList } = this.form;
|
const { orderTaskDetailList } = this.form;
|
||||||
return orderTaskDetailList&&orderTaskDetailList.length>0;
|
return orderTaskDetailList&&orderTaskDetailList.length>0;
|
||||||
}
|
}
|
||||||
@ -248,13 +267,21 @@ export default {
|
|||||||
}
|
}
|
||||||
// 获取订单详情
|
// 获取订单详情
|
||||||
if(this.form.orderId) this.getOrderDetail();
|
if(this.form.orderId) this.getOrderDetail();
|
||||||
|
else {
|
||||||
|
const userId = this.userMessage.id;
|
||||||
|
const op = this.operators.find(item=>item.id===userId);
|
||||||
|
if(op){
|
||||||
|
this.form.operatorIds.push(op);
|
||||||
|
this.operators = this.operators.filter(item=>item.id!==userId);
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 获取订单详情
|
// 获取订单详情
|
||||||
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,
|
const { id, customerName, phone, scenicName, surchargeAmount, cargoWeight,
|
||||||
orderNo, orderCreateTime, orderInitiator, confirmStatus, orderInitiatorId,
|
orderNo, orderCreateTime, orderInitiator, orderInitiatorId, mainOrderStatus,
|
||||||
customerId, attractionId, routeIds, operatorIds, orderTaskDetailList } = res;
|
customerId, attractionId, routeIds, operatorIds, orderTaskDetailList } = res;
|
||||||
this.form = {
|
this.form = {
|
||||||
orderId: id,
|
orderId: id,
|
||||||
@ -272,15 +299,16 @@ export default {
|
|||||||
routeIds: [],
|
routeIds: [],
|
||||||
orderInitiator: orderInitiator,
|
orderInitiator: orderInitiator,
|
||||||
orderCreateTime: orderCreateTime,
|
orderCreateTime: orderCreateTime,
|
||||||
confirmStatus: confirmStatus,
|
|
||||||
orderInitiatorId: orderInitiatorId,
|
orderInitiatorId: orderInitiatorId,
|
||||||
orderTaskDetailList: orderTaskDetailList,
|
orderTaskDetailList: orderTaskDetailList,
|
||||||
|
mainOrderStatus: mainOrderStatus
|
||||||
}
|
}
|
||||||
let resp = await this.$api.allRoutesByScenicId(attractionId);
|
let resp = await this.$api.allRoutesByScenicId(attractionId);
|
||||||
if(resp){
|
if(resp){
|
||||||
this.routes = resp || [];
|
this.routes = resp || [];
|
||||||
this.form.routeIds = resp.filter(item=> routeIds.includes(item.key));
|
this.form.routeIds = resp.filter(item=> routeIds.includes(item.key));
|
||||||
this.form.operatorIds = this.operators.filter(item=> operatorIds.includes(item.id));
|
this.form.operatorIds = this.operators.filter(item=> operatorIds.includes(item.id));
|
||||||
|
this.operators = this.operators.filter(item=>item.id!==orderInitiatorId);
|
||||||
} else {
|
} else {
|
||||||
this.$refs.uToast.show({type: 'error',title: "景区路线获取失败!"});
|
this.$refs.uToast.show({type: 'error',title: "景区路线获取失败!"});
|
||||||
}
|
}
|
||||||
@ -330,6 +358,7 @@ export default {
|
|||||||
let res = await this.$api.allRoutesByScenicId(val.id);
|
let res = await this.$api.allRoutesByScenicId(val.id);
|
||||||
if(res){
|
if(res){
|
||||||
this.routes = res || [];
|
this.routes = res || [];
|
||||||
|
this.form.routeIds = res.length>0?[res[0]]:[];
|
||||||
}else{
|
}else{
|
||||||
this.$refs.uToast.show({type: 'error',title: "景区路线获取失败!"});
|
this.$refs.uToast.show({type: 'error',title: "景区路线获取失败!"});
|
||||||
}
|
}
|
||||||
@ -380,6 +409,10 @@ export default {
|
|||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
try {
|
try {
|
||||||
let res = await that.$api.completeOrder(that.form.orderId);
|
let res = await that.$api.completeOrder(that.form.orderId);
|
||||||
|
if(res === undefined){
|
||||||
|
that.$refs.uToast.show({type: 'error',title: "订单完成操作失败!"});
|
||||||
|
return;
|
||||||
|
}
|
||||||
that.$refs.uToast.show({type: 'success', title: `订单完成操作成功!`});
|
that.$refs.uToast.show({type: 'success', title: `订单完成操作成功!`});
|
||||||
that.init();
|
that.init();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -7,7 +7,8 @@
|
|||||||
<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">{{ orderDetail.mainOrderStatus }}</view>
|
<view class="order-status">{{ orderDetail.mainOrderStatus }}</view>
|
||||||
<view class="order-tips">{{ orderDetail.mainOrderStatus === '已完成' ? '已完成飞行任务' : '请尽快执行任务'}}</view>
|
<view class="order-tips">{{ orderDetail.mainOrderStatus === '已完成' ? '已完成飞行任务' :
|
||||||
|
orderDetail.mainOrderStatus === '待确认'?'请尽快确认完成订单':'请尽快执行任务'}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-content">
|
<view class="order-content">
|
||||||
@ -47,17 +48,21 @@
|
|||||||
:src="fileUrl+textBg" />
|
:src="fileUrl+textBg" />
|
||||||
</view>
|
</view>
|
||||||
<view class="message-content">
|
<view class="message-content">
|
||||||
|
<view class="mc-lam" v-if="!isPilot">
|
||||||
|
<text class="lam-title">订单号</text>
|
||||||
|
<text class="lam-value">{{ orderDetail.orderNo }}</text>
|
||||||
|
</view>
|
||||||
<view class="mc-lam">
|
<view class="mc-lam">
|
||||||
<text class="lam-title">发起人</text>
|
<text class="lam-title">发起人</text>
|
||||||
<text class="lam-value">{{ orderDetail.orderInitiator }}</text>
|
<text class="lam-value">{{ orderDetail.orderInitiator }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="mc-lam">
|
<view class="mc-lam" v-if="isPilot">
|
||||||
<text class="lam-title">客户名称</text>
|
<text class="lam-title">客户名称</text>
|
||||||
<text class="lam-value">{{ orderDetail.customerName }}</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">{{ orderDetail.phone }}</text>
|
<text class="lam-value">{{ isPilot?orderDetail.phone:orderDetail.initiatorPhone }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="mc-lam">
|
<view class="mc-lam">
|
||||||
<text class="lam-title">操作员</text>
|
<text class="lam-title">操作员</text>
|
||||||
@ -67,6 +72,10 @@
|
|||||||
<text class="lam-title">下单时间</text>
|
<text class="lam-title">下单时间</text>
|
||||||
<text class="lam-value">{{ orderDetail.orderCreateTime }}</text>
|
<text class="lam-value">{{ orderDetail.orderCreateTime }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="mc-lam" v-if="!isPilot">
|
||||||
|
<text class="lam-title">订单确认人</text>
|
||||||
|
<text class="lam-value">{{ orderDetail.customerName }}</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="fly-message">
|
<view class="fly-message">
|
||||||
@ -88,7 +97,7 @@
|
|||||||
{{ item.orderItemStatus }}
|
{{ item.orderItemStatus }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="action-btns" v-if="orderDetail.mainOrderStatus!=='已完成'">
|
<view class="action-btns" v-if="isPilot&&!['已完成','待确认','已取消'].includes(orderDetail.mainOrderStatus)">
|
||||||
<u-button :custom-style="deleteCustomStyle" style="margin-left: auto;"
|
<u-button :custom-style="deleteCustomStyle" style="margin-left: auto;"
|
||||||
:hair-line="false" @click="handleDeleteAction(item)">删除</u-button>
|
:hair-line="false" @click="handleDeleteAction(item)">删除</u-button>
|
||||||
<u-button type="warning" :custom-style="customStyle" style="margin-left: 20rpx;margin-right: 30rpx;"
|
<u-button type="warning" :custom-style="customStyle" style="margin-left: 20rpx;margin-right: 30rpx;"
|
||||||
@ -104,10 +113,14 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-bottom" v-if="orderDetail.mainOrderStatus !== '已完成'">
|
<view class="order-bottom" v-if="!['已完成','已取消'].includes(orderDetail.mainOrderStatus)">
|
||||||
<view class="add-action" @click="showAddAction=true">
|
<view class="add-action" @click="addAction" v-if="isPilot&&orderDetail.mainOrderStatus!=='待确认'">
|
||||||
新增任务
|
新增任务
|
||||||
</view>
|
</view>
|
||||||
|
<view class="add-action" v-else-if="!isPilot&&orderDetail.mainOrderStatus==='待确认'"
|
||||||
|
@click="finishOrder">
|
||||||
|
完成订单
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<u-popup v-model="showAddAction" mode="bottom" border-radius="40" @close="closeAddAction">
|
<u-popup v-model="showAddAction" mode="bottom" border-radius="40" @close="closeAddAction">
|
||||||
<view class="action-popup">
|
<view class="action-popup">
|
||||||
@ -139,7 +152,7 @@
|
|||||||
<view class="action-lamx">
|
<view class="action-lamx">
|
||||||
<view class="lam-title">货物图片</view>
|
<view class="lam-title">货物图片</view>
|
||||||
<view class="lam-upload">
|
<view class="lam-upload">
|
||||||
<u-upload :action="uploadApi" max-count="1" :file-list="fileList"
|
<u-upload :action="uploadApi" max-count="1" :file-list="fileList" ref="uploadRef"
|
||||||
width="200" height="200" custom-btn :multiple="false" :header="uploadFileHeader"
|
width="200" height="200" custom-btn :multiple="false" :header="uploadFileHeader"
|
||||||
@on-success="uploadFile" @on-remove="removeFile" name="file">
|
@on-success="uploadFile" @on-remove="removeFile" name="file">
|
||||||
<view slot="addBtn" class="lam-upload-btn">
|
<view slot="addBtn" class="lam-upload-btn">
|
||||||
@ -339,6 +352,7 @@ export default {
|
|||||||
{ key: 2, value: '已完成' },
|
{ key: 2, value: '已完成' },
|
||||||
{ key: 3, value: '已取消' },
|
{ key: 3, value: '已取消' },
|
||||||
],
|
],
|
||||||
|
isPilot: this.$store.state.user_type == 1,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPageScroll(e) {
|
onPageScroll(e) {
|
||||||
@ -376,6 +390,10 @@ export default {
|
|||||||
this.clearForm();
|
this.clearForm();
|
||||||
this.showAddAction = false;
|
this.showAddAction = false;
|
||||||
},
|
},
|
||||||
|
// 打开新增任务弹窗
|
||||||
|
addAction(){
|
||||||
|
this.showAddAction = true;
|
||||||
|
},
|
||||||
// 获取订单详情
|
// 获取订单详情
|
||||||
async getOrderDetail(id){
|
async getOrderDetail(id){
|
||||||
let res = await this.$api.orderDetail(id);
|
let res = await this.$api.orderDetail(id);
|
||||||
@ -433,7 +451,8 @@ export default {
|
|||||||
this.dotLoading = true;
|
this.dotLoading = true;
|
||||||
let res = await this.$api.addOrderTask(data);
|
let res = await this.$api.addOrderTask(data);
|
||||||
if(res === undefined){
|
if(res === undefined){
|
||||||
this.$refs.uToast.show({type: 'error',title: '飞行任务新增失败(新增订单飞行任务: 同一个订单同一个飞行员,只能存在一个任务状态处于[未进行或进行中])!'});
|
this.dotLoading = false;
|
||||||
|
this.$refs.uToast.show({type: 'error',title: '当前无法新增飞行任务!'});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await this.clearForm();
|
await this.clearForm();
|
||||||
@ -443,7 +462,7 @@ export default {
|
|||||||
this.$refs.uToast.show({type: 'success',title: `飞行任务新增成功!`});
|
this.$refs.uToast.show({type: 'success',title: `飞行任务新增成功!`});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.dotLoading = false;
|
this.dotLoading = false;
|
||||||
this.$refs.uToast.show({type: 'error',title: '飞行任务新增失败!'});
|
this.$refs.uToast.show({type: 'error',title: '当前无法新增飞行任务!'});
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -456,7 +475,7 @@ export default {
|
|||||||
let res = await this.$api.editOrderStatus(orderTaskId, taskStatus);
|
let res = await this.$api.editOrderStatus(orderTaskId, taskStatus);
|
||||||
this.showChangeState = false;
|
this.showChangeState = false;
|
||||||
if(res === undefined){
|
if(res === undefined){
|
||||||
this.$refs.uToast.show({type: 'error',title: '飞行任务状态更改失败!'});
|
this.$refs.uToast.show({type: 'error',title: '无法更改该飞行任务状态!'});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.$refs.uToast.show({type: 'success',title: `飞行任务状态更改成功!`});
|
this.$refs.uToast.show({type: 'success',title: `飞行任务状态更改成功!`});
|
||||||
@ -468,13 +487,14 @@ export default {
|
|||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.showChangeState = false;
|
this.showChangeState = false;
|
||||||
this.$refs.uToast.show({type: 'error',title: '飞行任务状态更改失败!'});
|
this.$refs.uToast.show({type: 'error',title: '无法更改该飞行任务状态!'});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 清空表单
|
// 清空表单
|
||||||
clearForm(){
|
clearForm(){
|
||||||
this.current = 0;
|
this.current = 0;
|
||||||
this.fileList = [];
|
this.fileList = [];
|
||||||
|
this.$refs['uploadRef'].lists = [];
|
||||||
this.form = {
|
this.form = {
|
||||||
orderId: this.form.orderId,
|
orderId: this.form.orderId,
|
||||||
deviceName: '',
|
deviceName: '',
|
||||||
@ -498,14 +518,14 @@ export default {
|
|||||||
let res = await that.$api.deleteOrderTask(item.id);
|
let res = await that.$api.deleteOrderTask(item.id);
|
||||||
console.log(res);
|
console.log(res);
|
||||||
if(res === undefined){
|
if(res === undefined){
|
||||||
that.$refs.uToast.show({type: 'error',title: "您没有权限删除此订单任务!"});
|
that.$refs.uToast.show({type: 'error',title: "飞行任务无法删除!"});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
that.getOrderDetail(this.form.orderId);
|
that.getOrderDetail(this.form.orderId);
|
||||||
that.clearForm();
|
that.clearForm();
|
||||||
that.$refs.uToast.show({type: 'success',title: "飞行任务删除成功!"});
|
that.$refs.uToast.show({type: 'success',title: "飞行任务删除成功!"});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
that.$refs.uToast.show({type: 'error',title: "飞行任务删除失败!"});
|
that.$refs.uToast.show({type: 'error',title: "飞行任务无法删除!"});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -519,7 +539,31 @@ export default {
|
|||||||
taskStatus: this.stateList.find(item=>item.value===orderItemStatus).key
|
taskStatus: this.stateList.find(item=>item.value===orderItemStatus).key
|
||||||
};
|
};
|
||||||
this.showChangeState = true;
|
this.showChangeState = true;
|
||||||
}
|
},
|
||||||
|
// 完成订单
|
||||||
|
async finishOrder(){
|
||||||
|
let that = this;
|
||||||
|
uni.showModal({
|
||||||
|
title: '订单完成',
|
||||||
|
content: '是否确认完成该订单?',
|
||||||
|
confirmColor: '#f7c04d',
|
||||||
|
success: async(res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
try {
|
||||||
|
let res = await that.$api.completeOrder(that.orderDetail.id);
|
||||||
|
if(res === undefined){
|
||||||
|
that.$refs.uToast.show({type: 'error',title: "订单完成操作失败!"});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
that.getOrderDetail(that.form.orderId);
|
||||||
|
that.$refs.uToast.show({type: 'success', title: `订单完成操作成功!`});
|
||||||
|
} catch (error) {
|
||||||
|
that.$refs.uToast.show({type: 'error', title: `订单完成操作失败!`});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<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+(customers[item.customerId].gender === '男' ? boyIcon : girlIcon)" />
|
:src="fileUrl+(!isPilot?pilotIcon:(customers[item.customerId].gender === '男' ? boyIcon : girlIcon))" />
|
||||||
<view class="item-self">
|
<view class="item-self">
|
||||||
<text class="item-name">{{ customers[item.customerId].name }}</text>
|
<text class="item-name">{{ customers[item.customerId].name }}</text>
|
||||||
<text class="item-phone">{{ item.customerPhone }}</text>
|
<text class="item-phone">{{ item.customerPhone }}</text>
|
||||||
@ -26,7 +26,7 @@
|
|||||||
</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.stop="handleDoAction(item)">执行任务</u-button>
|
:hair-line="false" @click.stop="handleDoAction(item)">{{isPilot?'执行任务':'查看详情'}}</u-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -49,6 +49,12 @@ export default {
|
|||||||
styleIsolation: 'shared'
|
styleIsolation: 'shared'
|
||||||
},
|
},
|
||||||
// #endif
|
// #endif
|
||||||
|
props: {
|
||||||
|
isPilot:{
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
},
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
fileUrl: configService.fileUrl + 'aerocraft/order/',//订单页图标基础路径
|
fileUrl: configService.fileUrl + 'aerocraft/order/',//订单页图标基础路径
|
||||||
@ -58,12 +64,15 @@ export default {
|
|||||||
girlIcon: 'girl.png',
|
girlIcon: 'girl.png',
|
||||||
// 男生头像
|
// 男生头像
|
||||||
boyIcon: 'boy.png',
|
boyIcon: 'boy.png',
|
||||||
|
// 飞行员默认头像
|
||||||
|
pilotIcon: 'pilot-avatar.png',
|
||||||
// 订单状态
|
// 订单状态
|
||||||
orderStatus: {
|
orderStatus: {
|
||||||
0:'未进行',
|
0:'未进行',
|
||||||
1:'进行中',
|
1:'进行中',
|
||||||
2:'已完成',
|
2:'已完成',
|
||||||
3:'已取消'
|
3:'已取消',
|
||||||
|
4:'待确认',
|
||||||
},
|
},
|
||||||
// 订单类型
|
// 订单类型
|
||||||
orderTypes: {
|
orderTypes: {
|
||||||
@ -92,7 +101,7 @@ export default {
|
|||||||
size: 10,
|
size: 10,
|
||||||
// 是否结束——loadmore加载更多,loading加载中,nomore无更多
|
// 是否结束——loadmore加载更多,loading加载中,nomore无更多
|
||||||
isFinish: 'nomore',
|
isFinish: 'nomore',
|
||||||
mainOrderStatusList: '0,1,3',
|
mainOrderStatusList: '0,1',
|
||||||
},
|
},
|
||||||
// 用户列表
|
// 用户列表
|
||||||
customers: {},
|
customers: {},
|
||||||
@ -103,11 +112,11 @@ export default {
|
|||||||
methods:{
|
methods:{
|
||||||
// 初始化
|
// 初始化
|
||||||
async init(){
|
async init(){
|
||||||
this.form = {size: 10,current: 1,isFinish: 'nomore',mainOrderStatusList: '0,1,3'};
|
this.form = {size: 10,current: 1,isFinish: 'nomore',mainOrderStatusList: this.isPilot?'0,1':'0,1,4'};
|
||||||
// 查询订单列表
|
// 查询订单列表
|
||||||
await this.getOrderList();
|
await this.getOrderList();
|
||||||
// 查询全部客户
|
// 查询全部客户
|
||||||
let cusRes = await this.$api.allCustomers();
|
let cusRes = this.isPilot ? await this.$api.allCustomers() : await this.$api.allEmployees();
|
||||||
if(!cusRes){
|
if(!cusRes){
|
||||||
this.$refs.uToast.show({type: 'error',title: "客户获取失败!"});
|
this.$refs.uToast.show({type: 'error',title: "客户获取失败!"});
|
||||||
}else this.customers = await cusRes.reduce((obj, item) => ({...obj,[item.id]: item}), {})||{};
|
}else this.customers = await cusRes.reduce((obj, item) => ({...obj,[item.id]: item}), {})||{};
|
||||||
@ -145,6 +154,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 查看详情
|
// 查看详情
|
||||||
showDetail(item){
|
showDetail(item){
|
||||||
|
if(this.isPilot)
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/aircraft/server/order/add?id=${item.id}`
|
url: `/aircraft/server/order/add?id=${item.id}`
|
||||||
})
|
})
|
||||||
|
@ -11,6 +11,7 @@ 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.allEmployees = async (params = {}) => await vm.$u.get('/api/emEmployees/all',params);// 条件查询全部飞行员
|
vm.$api.allEmployees = async (params = {}) => await vm.$u.get('/api/emEmployees/all',params);// 条件查询全部飞行员
|
||||||
|
vm.$api.bSelfDetail = async (id) => await vm.$u.get(`/cnCustomer/${id}`);// 查询客户信息
|
||||||
|
|
||||||
// 区域/景区管理
|
// 区域/景区管理
|
||||||
vm.$api.allAreas = async () => await vm.$u.get('/emArea/all');// 获取全部区域
|
vm.$api.allAreas = async () => await vm.$u.get('/emArea/all');// 获取全部区域
|
||||||
|
Loading…
Reference in New Issue
Block a user