订单列表相关接口对接

This commit is contained in:
donqi 2022-06-13 16:13:10 +08:00
parent b1e3cd79c0
commit a0c0652ca5
8 changed files with 364 additions and 113 deletions

View File

@ -4,7 +4,6 @@ export default {
VERTICAL_NAV_GET_ITEM: 'verticalNavGetItem',
VERTICAL_NAV_SEARCH: 'verticalNavSearch',
CHOOSE_ADDRESS: 'chooseAddress',
SHOW_ARRANGE_FAIL_TIME: 'showArrangeFailTime',
HIDE_MODAL: 'hideModal',
SUBMIT_FAIL_REASON: 'submitFailReason',
NEW_SERV_PRICE: 'newServPrice',

View File

@ -13,8 +13,8 @@ export default {
})
let userInfo = _this.getCurUserInfo();
// request 触发前拼接 url
args.url = 'https://www.opsoul.com' + args.url;
// args.url = 'http://127.0.0.1:80' + args.url;
// args.url = 'https://www.opsoul.com' + args.url;
args.url = 'http://127.0.0.1:80' + args.url;
// args.url = 'http://10.45.110.174:80' + args.url;
if (!args.data) {
args.data = {}
@ -365,5 +365,29 @@ export default {
}
})
return res[1].data;
},
async updateOrder(params = {}) {
let res = await uni.request({
url: '/order/master/editOrderMaster',
method: 'POST',
data: params
})
return res[1].data;
},
async getCanAssignList(params = {}) {
let res = await uni.request({
url: '/order/can/assign',
method: 'POST',
data: params
})
return res[1].data;
},
async assign(params = {}) {
let res = await uni.request({
url: '/order/assign',
method: 'POST',
data: params
})
return res[1].data;
}
}

View File

@ -1,6 +1,6 @@
<template>
<view>
<view class="margin-bottom-lg">
<view class="margin-bottom-lg margin-top-sm">
<view v-if="hasMoreData" class="text-center bg-main-color light padding-tb-sm">
<text class="margin-right-xs">查看更多</text>
<text class="text-bold cuIcon-unfold"></text>

View File

@ -1,10 +1,27 @@
<template>
<view>
<view v-if="!singleServ">
<view class="solid-bottom"><product-picked :product="product" :pickedList="pickedList" :columnTitleArr="columnTitleArr"></product-picked></view>
<view>
<view class="solid-bottom padding-bottom-sm">
<view v-if="columnTitleArr.length" class="flex justify-between margin-tb-sm">
<view class="basis-df">{{columnTitleArr[0]}}</view>
<view class="flex justify-end text-center basis-df">
<view v-for="(title, index) in columnTitleArr" v-if="index >= 1" class="basis-df">{{title}}</view>
</view>
</view>
<view class="flex justify-between margin-tb-xs align-center" v-for="(item,index) in pickedList" :key="index">
<view class='cu-tag padding basis-lg'>{{item.goodsName}}</view>
<view class="flex justify-end basis-df text-center align-center">
<view class="basis-df">{{item.goodsNum}}</view>
<view class="basis-df">
<uni-number-box :min="0" :max="item.goodsNum" v-model="item.toAssignNum" @change="changePiecesNum($event, item)">
</uni-number-box>
</view>
</view>
</view>
</view>
<view class="padding-tb-sm solid-bottom flex justify-between align-center">
<text class="margin-right-sm" style="width: 150rpx;">派单价格</text>
<input class="line-input radius-input" v-model="dispatchTotalPrice" placeholder="请输入派出总额"></input>
<input type="digit" class="line-input radius-input" v-model="dispatchTotalPrice" placeholder="请输入派出总额"></input>
</view>
</view>
<!-- 可指派成员 -->
@ -12,11 +29,11 @@
<view class="flex justify-between align-center">
<view class="flex justify-start align-center">
<view class="cu-avatar round"
:style="'background-image:url(' + member.avatarUrl + ');min-width: 80rpx;min-height: 80rpx'"></view>
<view class="text-lg margin-left-sm">{{member.name}}</view>
:style="'background-image:url(' + member.workerLogoUrl + ');min-width: 80rpx;min-height: 80rpx'"></view>
<view class="text-lg margin-left-sm">{{member.workerName}}</view>
</view>
<view>
<button class="cu-btn bg-main-color shadow-blur">指派</button>
<button class="cu-btn bg-main-color shadow-blur" @click="assignWork(member)">指派</button>
<text v-if="singleServ" class="padding-left text-lg text-gray text-bold" data-modal="showDispatchPriceModal" @click="showModal"><text class="cuIcon-right"></text></text>
</view>
</view>
@ -58,20 +75,12 @@
props: {
singleServ: {
type: Boolean,
default: true
default: false
},
product: {
type: Object,
default: {}
},
pickedList: {
type: Array,
default: []
},
columnTitleArr: {
type: Array,
default: {}
},
members: {
type: Array,
default: {}
@ -84,7 +93,10 @@
data() {
return {
dispatchTotalPrice: null,
showDispatchPriceModal: false
showDispatchPriceModal: false,
columnTitleArr: ['购买机型', '待派单', '派单量'],
curOrder: {},
pickedList: []
}
},
methods: {
@ -93,6 +105,49 @@
},
hideModal(e) {
this[e.currentTarget.dataset.modal] = false;
},
changePiecesNum(curNum, curItem) {
curItem.toAssignNum = curNum;
},
resetData() {
this.dispatchTotalPrice = null;
},
loadData(order) {
this.resetData();
this.getCanAssignList(order);
},
async getCanAssignList(order) {
let res = await this.$request.getCanAssignList({
orderMasterId: order.orderMasterId
});
let pickedList = res.data;
this.curOrder = order;
this.pickedList = pickedList;
},
assignWork(member) {
let goodsToAssign = [];
this.pickedList.forEach((item) => {
if (item.toAssignNum) {
goodsToAssign.push({
goodsStandardId: item.goodsStandardId,
num: item.toAssignNum
})
}
});
if (goodsToAssign.length > 0) {
let params = {
goodsList: goodsToAssign,
workerId: member.workerId,
totalPay: this.dispatchTotalPrice,
orderMasterId: this.curOrder.orderMasterId
}
this.$emit('assignWork', params);
} else {
uni.showToast({
title: '请至少选择一种规格',
icon: 'none'
})
}
}
},
}

View File

@ -10,7 +10,7 @@
<view class="flex justify-between align-center margin-bottom-xs padding-top">
<view>
<text class="text-xxl text-main-color"><text class="cuIcon-phone"></text></text>
<text class="text-bold text-lg margin-lr-xs">{{data.phoneNum}}</text>
<text class="text-bold text-lg margin-lr-xs">{{data.customerPhone}}</text>
</view>
<button class="cu-btn line-main-color">拨打</button>
</view>

View File

@ -10,7 +10,7 @@
<view class="flex justify-between align-center margin-bottom-xs padding-top">
<view>
<text class="text-xxl text-main-color"><text class="cuIcon-phone"></text></text>
<text class="text-bold text-lg margin-lr-xs">{{data.phoneNum}}</text>
<text class="text-bold text-lg margin-lr-xs">{{data.customerPhone}}</text>
</view>
<button class="cu-btn line-main-color">拨打</button>
</view>
@ -22,27 +22,27 @@
<view class="margin-bottom-xs">
<view class="margin-bottom-xs">选择日期</view>
<picker mode="date" :value="date" :start="curDate" @change="dateChange">
<input class="radius-input" v-model="date"></input>
<input class="radius-input" v-model="date" disabled></input>
</picker>
</view>
<view>
<view class="margin-bottom-xs">选择时间</view>
<picker class="inline-input" mode="time" :value="'08:00'" :start="'08:00'" :end="'20:00'"
<picker mode="time" :value="'08:00'" :start="'08:00'" :end="'20:00'"
@change="timeChange">
<input class="radius-input" v-model="time"></input>
<input class="radius-input" v-model="time" disabled></input>
</picker>
<text class="margin-lr-xs"></text>
<!-- <text class="margin-lr-xs"></text>
<picker class="inline-input" mode="selector" :value="timeRangeIndex" :range="timeRangeList"
@change="timeRangeChange">
<input class="radius-input" v-model="timeRange"></input>
</picker>
<input class="radius-input" v-model="timeRange" disabled></input>
</picker> -->
</view>
</view>
</view>
<view class="cu-bar bg-white solid-top">
<view class="action margin-0 flex-sub text-black" @click="cannotArrangeTime">无法排单</view>
<view class="action margin-0 flex-sub text-black solid-left" data-modal="showTimeArrangeModal"
@click="arrangeTime">按原时间上门</view>
@click="hideModal">按原时间上门</view>
<view class="action margin-0 flex-sub text-main-color solid-left" data-modal="showTimeArrangeModal"
@click="arrangeTime">确认</view>
</view>
@ -53,6 +53,7 @@
<script>
export default {
name: 'time-arrange',
emits: ['showArrangeFailTime'],
props: {
show: {
type: Boolean,
@ -61,15 +62,18 @@
data: {
type: Object,
default: {}
},
curDate: {
type: String,
default: ''
}
},
data() {
return {
date: '',
curDate: '',
time: '',
date: null,
time: null,
timeRangeList: [],
timeRange: '',
timeRange: null,
timeRangeIndex: 0
}
},
@ -78,12 +82,13 @@
},
methods: {
async loadData() {
this.getCurDateAndTime();
this.timeRangeList = await this.$api.data('timeRangeList');
},
getCurDateAndTime() {
let date = new Date();
this.curDate = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + " 00:00:00";
resetData() {
this.date = null;
this.time = null;
this.timeRange = null;
this.timeRangeIndex = 0;
},
dateChange(e) {
this.date = e.detail.value
@ -99,9 +104,19 @@
uni.$emit(this.$globalFun.HIDE_MODAL, e);
},
cannotArrangeTime(e) {
uni.$emit(this.$globalFun.SHOW_ARRANGE_FAIL_TIME, e)
this.$emit('showArrangeFailTime', e)
},
arrangeTime(e) {
if (!(this.time || this.timeRange)) {
uni.showToast({
title: '请选择时间'
})
return;
}
let datetime = this.date + ' ' + (this.time || this.timeRange) + ':00';
console.log(this.data)
this.$emit('editServTime', this.data.orderMasterId, datetime);
this.resetData();
this.hideModal(e);
}
}

View File

@ -16,13 +16,13 @@
<my-uni-combox class="inline-combox" :candidates="subStateList" placeholder="请选择"
v-model="formData.subState"></my-uni-combox> -->
<!-- 区域筛选picker -->
<picker class="inline-combox margin-right-xs" :mode="'multiSelector'" @change="regionChange" :value="areaMultiIndex" :range-key="'name'" :range="areaList">
<input class="radius-input" :value="formData.area ? formData.area[0].name + '-' + formData.area[1].name + '-' + formData.area[2].name : ''"
<picker class="inline-combox margin-right-xs" :mode="'multiSelector'" @change="regionChange" @columnchange="regionColChange" :value="areaMultiIndex" :range-key="'areaName'" :range="areaList">
<input class="radius-input" disabled :value="formData.area ? formData.area[0].areaName + '-' + formData.area[1].areaName + '-' + formData.area[2].areaName : ''"
placeholder="请选择区域"></input>
</picker>
<!-- 品类筛选picker -->
<picker class="inline-combox" :mode="'multiSelector'" @change="categoryChange" :value="categoryMultiIndex" :range-key="'name'" :range="categoryList">
<input class="line-input radius-input" :value="formData.category ? formData.category[0].name + '-' + formData.category[1].name + '-' + formData.category[2].name : ''"
<picker class="inline-combox" :mode="'multiSelector'" @change="categoryChange" @columnchange="categoryColChange" :value="categoryMultiIndex" :range-key="'goodsCategoryName'" :range="categoryList">
<input class="line-input radius-input" disabled :value="formData.category ? formData.category[0].goodsCategoryName + '-' + formData.category[1].goodsCategoryName + '-' + formData.category[2].goodsCategoryName : ''"
placeholder="请选择品类"></input>
</picker>
</view>
@ -30,8 +30,8 @@
<input class="line-input radius-input margin-right-sm" v-model="formData.orderKeywords"
placeholder="请输入订单关键字"></input>
<view class="text-xl text-bold">
<text class="cuIcon-search margin-right-sm"></text>
<text class="cuIcon-refresh"></text>
<text class="cuIcon-search margin-right-sm" @click="searchOrder"></text>
<text class="cuIcon-refresh" @click="resetConditions"></text>
</view>
</view>
</view>
@ -69,7 +69,7 @@
<!-- tab content -->
<view class="padding bg-white margin-top-sm margin-lr-sm" v-for="(order, index) in orderList">
<view class="flex justify-between">
<view class="text-lg text-bold text-cut">{{order.orderGoods.goodsName}}</view>
<view class="text-lg text-bold text-cut">{{order.goodsName}}</view>
<!-- 不同状态订单使用不同角标 -->
<view v-if="order.orderStatus === 0" class="right-tag padding-lr-sm padding-tb-xs bg-cyan"></view>
<view v-else-if="order.orderStatus === 1" class="right-tag padding-lr-sm padding-tb-xs bg-main-color"></view>
@ -83,21 +83,21 @@
</view>
<view class="margin-top-sm">
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-people"></text></text>
<text>姓名{{order.name}}</text>
<text>姓名{{order.customerName}}</text>
</view>
<view class="margin-top-sm">
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-location"></text></text>
<text class="margin-right-xs">{{order.address}}</text>
<text class="text-lg" @tap="copyData(order.address)"><text class="cuIcon-copy"></text></text>
</view>
<view class="margin-top-sm">
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-time"></text></text>
<text>服务时间{{order.serverTime}}</text>
</view>
<view class="margin-top-sm" v-if="Boolean(order.doorTime)">
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-time"></text></text>
<text>上门时间{{order.doorTime}}</text>
</view>
<view class="margin-top-sm" v-else-if="Boolean(order.servTime)">
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-time"></text></text>
<text>服务时间{{order.servTime}}</text>
</view>
<view class="margin-top-sm flex justify-start align-center" v-if="order.orderStatus === 2">
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-repair"></text></text>
<text>距上门</text>
@ -120,35 +120,35 @@
</view>
<!-- 不同状态订单支持不同操作按钮 -->
<view v-if="order.orderStatus === 0">
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-popup="dispatchOrder" @tap="togglePopup($event, index)">派单</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-popup="dispatchOrder" @click="getCanAssignList(order)" @tap="togglePopup($event, order)">派单</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm">改价</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm">转发</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm">确认接单</button>
</view>
<view v-if="order.orderStatus === 1">
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-popup="dispatchOrder" @tap="togglePopup($event, index)">派单</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showTimeArrangeModal" @tap="showModal($event, index)">预约时间</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-popup="dispatchOrder" @click="getCanAssignList(order)" @tap="togglePopup($event, order)">派单</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showTimeArrangeModal" @tap="showModal($event, order)">预约时间</button>
</view>
<view v-if="order.orderStatus === 2">
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="showServOrderDetail('waitToServ')">查看</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @tap="makePhoneCall(order.phoneNum)">联系客户</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showEditTimeArrangeModal" @tap="showModal($event, index)">修改时间</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showEditTimeArrangeModal" @tap="showModal($event, order)">修改时间</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm">立即上门</button>
</view>
<view v-if="order.orderStatus === 3">
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="showServOrderDetail('waitServing')">查看</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showNewServPriceModal" @tap="showModal($event, index)">改价</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showNewServPriceModal" @tap="showModal($event, order)">改价</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @tap="makePhoneCall(order.phoneNum)">联系客户</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showEditTimeArrangeModal" @tap="showModal($event, index)">修改时间</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showEditTimeArrangeModal" @tap="showModal($event, order)">修改时间</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @tap="finishOrder(order)">拍照回单</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showPayQrcodeModal" @tap="makePayQrcode($event, index)">生成付款码</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showPayQrcodeModal" @tap="makePayQrcode($event, order)">生成付款码</button>
</view>
<view v-if="order.orderStatus === 4">
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="sendUrgentMsgModal" @tap="showModal($event, index)">师傅急报</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="sendUrgentMsgModal" @tap="showModal($event, order)">师傅急报</button>
</view>
<view v-if="order.orderStatus === 'afterSaleService'">
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @tap="makePhoneCall(order.phoneNum)">联系客户</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showEditTimeArrangeModal" @tap="showModal($event, index)">修改时间</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showEditTimeArrangeModal" @tap="showModal($event, order)">修改时间</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm">立即上门</button>
</view>
<view class="margin-top-sm solid-top padding-top-sm" v-if="order.afterSaleType === 'finished'">
@ -205,7 +205,7 @@
</view>
<load-status-bar ref="loadStatusBar"></load-status-bar>
<!-- 模态框 -->
<time-arrange :show="showTimeArrangeModal" :data="curOrder"></time-arrange>
<time-arrange :show="showTimeArrangeModal" :data="curOrder" :curDate="curDate" @showArrangeFailTime="showArrangeFailTime" @editServTime="editServTime"></time-arrange>
<time-arrange-fail :show="showArrangeFailTimeModal" :data="curOrder"></time-arrange-fail>
<new-serv-price :show="showNewServPriceModal" :data="curOrder"></new-serv-price>
<pay-qrcode ref="payQrcode" :show="showPayQrcodeModal" :data="curOrder"></pay-qrcode>
@ -216,9 +216,9 @@
<uni-popup ref="dispatchOrder" type="bottom" @change="changePopupState">
<view class="text-bold text-gray text-lg text-center left-top-sm-bar" data-popup="dispatchOrder" @click="togglePopup"><text
class="cuIcon-close"></text></view>
<view class="bg-white padding" style="padding-top: 74rpx;">
<dispatch-order :columnTitleArr="['购买机型', '待派单', '派单量']" :singleServ="curOrder && curOrder.product.pickedList.length === 1 ? true : false"
:product="curOrder.product" :pickedList="curOrder.product.pickedList" :members="myTeamMembers"></dispatch-order>
<view ref="dispatchOrderContent" class="bg-white padding" style="padding-top: 74rpx; min-height: 600rpx;">
<dispatch-order v-if="myTeamMembers && myTeamMembers.length > 0" @assignWork="assignWork" :members="myTeamMembers"></dispatch-order>
<view v-else class="align-center-view text-xl">无可指派的师傅</view>
</view>
<!-- 底部占位 -->
<view class="cu-bar bg-white fixed-bottom-bar"></view>
@ -290,10 +290,12 @@
}, {
code: 6,
name: '确认中'
}, {
code: '-',
name: '售后中'
}, {
},
// {
// code: '-',
// name: ''
// },
{
code: 4,
name: '已完成'
}],
@ -313,7 +315,8 @@
showEditTimeArrangeModal: false,
sendUrgentMsgModal: false,
ifShowPageMeta: false,
picModalImgList: []
picModalImgList: [],
curDate: ''
}
},
onLoad() {
@ -325,13 +328,14 @@
},
methods: {
async loadData() {
let myTeamInfo = await this.$api.data('myTeamInfo');
this.myTeamMembers = myTeamInfo.members;
// let myTeamInfo = await this.$api.data('myTeamInfo');
// this.myTeamMembers = myTeamInfo.members;
this.myOrders = await this.$api.data('myOrders');
// this.orderList = this.myOrders.orderList;
this.areaList = await this.$api.data('areaList');
this.categoryList = await this.$api.data('categoryList');
// this.areaList = await this.$api.data('areaList');
// this.categoryList = await this.$api.data('categoryList');
//
for(let i = 0; i < this.subStateList.length; i++) {
this.pageParams.push({
pageNum: 0
@ -341,6 +345,11 @@
this.loadMasterOrderPage({
orderStatus: this.subStateList[0].code
});
//
this.loadCategoryList();
this.loadRegionList();
//
this.loadTeamMembers();
},
reloadMasterOrderPage(params = {}) {
this.pageParams = [];
@ -351,20 +360,32 @@
}
this.orderList = [];
this.$refs.loadStatusBar.showLoadMore();
this.loadMasterOrderPage(params);
this.loadMasterOrderPage();
},
async loadMasterOrderPage(params = {}) {
params.pageNum = this.pageParams[this.tabCur].pageNum;
params.pageSize = this.$globalData.initPageSize;
params.orderStatus = this.subStateList[this.tabCur].code;
this.$refs.loadStatusBar.showLoading();
try {
let res = await this.$request.qryMasterOrderPage(params);
let res = null;
//
if (this.tabCur === 0) {
res = await this.$request.qryMasterOrderPage(params);
} else {
}
if (res && res.rows) {
let rowsLength = res.rows.length;
if (rowsLength > 0) {
if (rowsLength === 0) {
this.orderList = [];
} else if (rowsLength > 0) {
this.orderList = this.orderList.concat(res.rows);
this.pageParams[this.tabCur].pageNum++;
if (rowsLength === this.pageSize) {
this.$refs.loadStatusBar.showLoadMore();
return;
}
}
}
this.$refs.loadStatusBar.showLoadOver();
@ -373,16 +394,81 @@
this.$refs.loadStatusBar.showLoadErr();
}
},
async loadCategoryList(idArr) {
let typeList = await this.$request.listByStep();
typeList = typeList.data;
let col1Id = idArr ? idArr[0] : typeList[0].goodsCategoryId;
let subTypeList = await this.$request.listByStep({
goodsCategoryId: col1Id
});
subTypeList = subTypeList.data;
let col2Id = idArr ? idArr[1] : subTypeList[0].goodsCategoryId;
let subSubTypeList = await this.$request.listByStep({
goodsCategoryId: col2Id
});
subSubTypeList = subSubTypeList.data;
this.categoryList.push(typeList);
this.categoryList.push(subTypeList);
this.categoryList.push(subSubTypeList);
},
async loadRegionList() {
let regionList = await this.$request.areaListByStep();
regionList = regionList.data;
let subRegionList = [];
let subSubRegionList = [];
if (regionList && regionList.length > 0) {
subRegionList = await this.$request.areaListByStep({
parentCode: regionList[0].areaCode
});
subRegionList = subRegionList.data;
}
if (subRegionList && subRegionList.length > 0) {
subSubRegionList = await this.$request.areaListByStep({
parentCode: subRegionList[0].areaCode
});
subSubRegionList = subSubRegionList.data;
}
this.areaList.push(regionList);
this.areaList.push(subRegionList);
this.areaList.push(subSubRegionList);
},
async loadTeamMembers() {
let res = await this.$request.getTeamPage();
this.myTeamMembers = res.rows;
},
bindEvent() {
uni.$on(this.$globalFun.SHOW_ARRANGE_FAIL_TIME, this.showArrangeFailTime);
uni.$on(this.$globalFun.HIDE_MODAL, this.hideModal);
uni.$on(this.$globalFun.SUBMIT_FAIL_REASON, this.submitFailReason);
},
offBindEvent() {
uni.$off(this.$globalFun.SHOW_ARRANGE_FAIL_TIME);
uni.$off(this.$globalFun.HIDE_MODAL);
uni.$off(this.$globalFun.SUBMIT_FAIL_REASON);
},
async regionColChange(e) {
let colObj = e.detail;
if (colObj.column == 0) {
//
let subAreaList = await this.$request.areaListByStep({parentCode: this.areaList[0][colObj.value].areaCode});
subAreaList = subAreaList.data;
let subSubAreaList = [];
if (subAreaList.length) {
subSubAreaList = await this.$request.areaListByStep({parentCode: subAreaList[0].areaCode});
subSubAreaList = subSubAreaList.data;
}
this.areaList.pop();
this.areaList.pop();
this.areaList.push(subAreaList);
this.areaList.push(subSubAreaList);
this.areaMultiIndex = [colObj.value, 0, 0];
} else if (colObj.column == 1) {
//
let subAreaList = await this.$request.areaListByStep({parentCode: this.regionList[0][colObj.value].areaCode});
subAreaList = subAreaList.data;
this.areaList.pop();
this.areaList.push(subAreaList);
this.areaMultiIndex = [this.areaMultiIndex[0], colObj.value, 0];
}
},
regionChange(e) {
this.areaMultiIndex = e.detail.value;
let chosenArea = [];
@ -391,6 +477,34 @@
}
this.formData.area = chosenArea;
},
async categoryColChange(e) {
let colObj = e.detail;
if (colObj.column == 0) {
//
let subTypeList = await this.$request.listByStep({
goodsCategoryId: this.categoryList[0][colObj.value].goodsCategoryId
});
subTypeList = subTypeList.data;
let subSubTypeList = await this.$request.listByStep({
goodsCategoryId: subTypeList[0].goodsCategoryId
});
subSubTypeList = subSubTypeList.data;
this.categoryList.pop();
this.categoryList.pop();
this.categoryList.push(subTypeList);
this.categoryList.push(subSubTypeList);
this.categoryMultiIndex = [colObj.value, 0, 0];
} else if (colObj.column == 1) {
//
let subSubTypeList = await this.$request.listByStep({
goodsCategoryId: this.categoryList[1][colObj.value].goodsCategoryId
});
subSubTypeList = subSubTypeList.data;
this.categoryList.pop();
this.categoryList.push(subSubTypeList);
this.categoryMultiIndex = [this.categoryMultiIndex[0], colObj.value, 0];
}
},
categoryChange(e) {
this.categoryMultiIndex = e.detail.value;
let chosenCategory = [];
@ -399,28 +513,35 @@
}
this.formData.category = chosenCategory;
},
input(e) {
searchOrder(e) {
console.log(e)
console.log(this.formData)
},
resetConditions() {
this.formData = {
category: null,
area: null,
orderKeywords: ''
}
},
tabSelect(e) {
this.tabCur = e.currentTarget.dataset.id;
this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
// this.reloadMasterOrderPage(this.stateCur, this.subStateList[this.tabCur].code);
this.reloadMasterOrderPage({
orderStatus: this.subStateList[this.tabCur].code
});
this.reloadMasterOrderPage();
},
statusSelect(e) {
this.stateCur = e.currentTarget.dataset.id;
this.loadData(this.stateCur, this.subStateList[this.tabCur].code);
},
setCurOrder(orderIndex) {
this.curOrder = this.orderList[orderIndex];
getCurDateAndTime() {
let date = new Date();
this.curDate = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + " 00:00:00";
},
showModal(e, orderIndex) {
if (orderIndex != null && orderIndex != undefined) {
this.setCurOrder(orderIndex);
showModal(e, orderInfo) {
this.getCurDateAndTime();
if (orderInfo) {
this.curOrder = orderInfo;
}
this[e.currentTarget.dataset.modal] = true;
},
@ -436,6 +557,19 @@
data: data
});
},
async editServTime(id, datetime) {
let res = await this.$request.updateOrder({
id: id,
revTime: datetime
});
if (res.code === 0) {
this.reloadMasterOrderPage();
uni.showToast({
title: '修改成功',
icon: 'success'
})
}
},
showArrangeFailTime(e) {
this.showTimeArrangeModal = false;
this.showArrangeFailTimeModal = true;
@ -444,15 +578,15 @@
// TODO: modalcurOrdernull
this.hideModal(e);
},
togglePopup(e, orderIndex) {
togglePopup(e, orderInfo) {
if (this.ifShowPageMeta) {
this.$refs[e.currentTarget.dataset.popup].close();
let timeout = setTimeout(() => {
this.curOrder = null;
}, 100);
} else {
if (orderIndex != null && orderIndex != undefined) {
this.setCurOrder(orderIndex);
if (orderInfo) {
this.curOrder = orderInfo;
}
this.$refs[e.currentTarget.dataset.popup].open();
}
@ -465,9 +599,9 @@
phoneNumber: phoneNum
})
},
makePayQrcode(e, orderIndex) {
makePayQrcode(e, orderInfo) {
this.$refs.payQrcode.showQrcode('http://10.45.81.125:8081/portal/' + Math.random());
this.showModal(e, orderIndex);
this.showModal(e, orderInfo);
},
showServOrderDetail(process) {
uni.navigateTo({
@ -485,10 +619,24 @@
updateAfterSaleDealStatus(status, index) {
this.orderList[index].afterSaleDealStatus = status;
},
getCanAssignList(order) {
this.$refs.dispatchOrder.$children[0].loadData(order);
},
/* modalpopup确认或关闭后的回调 */
async showAfterSalePic() {
// TODO:
this.picModalImgList = await this.$api.data('picImgList');
console.log(this.picModalImgList)
},
async assignWork(params) {
let res = await this.$request.assign(params);
if (res.code === 0) {
this.getCanAssignList(this.curOrder);
uni.showToast({
title: '派单成功',
icon: 'success'
})
}
}
}
}

View File

@ -264,3 +264,13 @@
.float-clear {
clear: both;
}
.align-center-view {
position: fixed;
top: 50%;
left: 50%;
-webkit-transform: translateX(-50%) translateY(-50%);
-moz-transform: translateX(-50%) translateY(-50%);
-ms-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
}