|
@@ -1,14 +1,23 @@
|
|
<template>
|
|
<template>
|
|
<view>
|
|
<view>
|
|
- <zj-page-layout :hasFooter="false" :isScroll="true" :refresherTriggered="refresherTriggered"
|
|
|
|
- @refresherrefresh="refresherrefresh" @scrolltolower="scrolltolower">
|
|
|
|
|
|
+ <zj-page-layout
|
|
|
|
+ :hasFooter="false"
|
|
|
|
+ :isScroll="true"
|
|
|
|
+ :refresherTriggered="refresherTriggered"
|
|
|
|
+ @refresherrefresh="refresherrefresh"
|
|
|
|
+ @scrolltolower="scrolltolower"
|
|
|
|
+ >
|
|
<template slot="header">
|
|
<template slot="header">
|
|
<view class="top-container">
|
|
<view class="top-container">
|
|
<scroll-view class="tab-scroll-view" scroll-x scroll-with-animation :scroll-left="scrollLeft">
|
|
<scroll-view class="tab-scroll-view" scroll-x scroll-with-animation :scroll-left="scrollLeft">
|
|
<view class="left-nav">
|
|
<view class="left-nav">
|
|
- <view class="item" v-for="(item, index) in mainTabs" :key="index"
|
|
|
|
|
|
+ <view
|
|
|
|
+ class="item"
|
|
|
|
+ v-for="(item, index) in mainTabs"
|
|
|
|
+ :key="index"
|
|
:class="[curMainTab === item.value ? 'active' : '', 'tab-item-' + index]"
|
|
:class="[curMainTab === item.value ? 'active' : '', 'tab-item-' + index]"
|
|
- @tap="changeMainTab(item.value)">
|
|
|
|
|
|
+ @tap="changeMainTab(item.value)"
|
|
|
|
+ >
|
|
<view class="name">{{ item.name }}</view>
|
|
<view class="name">{{ item.name }}</view>
|
|
<view class="num">{{ item.num || '' }}</view>
|
|
<view class="num">{{ item.num || '' }}</view>
|
|
</view>
|
|
</view>
|
|
@@ -23,10 +32,16 @@
|
|
|
|
|
|
<view>
|
|
<view>
|
|
<view class="status-container">
|
|
<view class="status-container">
|
|
- <u-tabs :list="smallTabs" @change="changeSmallTab" :current="curSmallTabIndex" lineWidth="0" lineHeight="0"
|
|
|
|
|
|
+ <u-tabs
|
|
|
|
+ :list="smallTabs"
|
|
|
|
+ @change="changeSmallTab"
|
|
|
|
+ :current="curSmallTabIndex"
|
|
|
|
+ lineWidth="0"
|
|
|
|
+ lineHeight="0"
|
|
activeStyle="height: 68rpx; display: flex; align-items: center; justify-content: center; padding: 0 24rpx; border-radius: 24rpx; background: #E7EFFF; color: #3D8FFD; border: 1px solid #3D8FFD; box-sizing: border-box;"
|
|
activeStyle="height: 68rpx; display: flex; align-items: center; justify-content: center; padding: 0 24rpx; border-radius: 24rpx; background: #E7EFFF; color: #3D8FFD; border: 1px solid #3D8FFD; box-sizing: border-box;"
|
|
inactiveStyle="height: 68rpx; display: flex; align-items: center; justify-content: center; padding: 0 24rpx; border-radius: 24rpx; border: 1px solid #eaeaea; box-sizing: border-box;"
|
|
inactiveStyle="height: 68rpx; display: flex; align-items: center; justify-content: center; padding: 0 24rpx; border-radius: 24rpx; border: 1px solid #eaeaea; box-sizing: border-box;"
|
|
- itemStyle="padding: 0; border-radius: 24rpx; color: #999999; margin-right: 16rpx; font-size: 28rpx;">
|
|
|
|
|
|
+ itemStyle="padding: 0; border-radius: 24rpx; color: #999999; margin-right: 16rpx; font-size: 28rpx;"
|
|
|
|
+ >
|
|
</u-tabs>
|
|
</u-tabs>
|
|
|
|
|
|
<view class="date" :class="startDate ? 'active' : ''" @tap="isShowDatePicker = true">
|
|
<view class="date" :class="startDate ? 'active' : ''" @tap="isShowDatePicker = true">
|
|
@@ -64,7 +79,9 @@
|
|
<view class="row">
|
|
<view class="row">
|
|
<view class="label">服务项目</view>
|
|
<view class="label">服务项目</view>
|
|
<view class="value">
|
|
<view class="value">
|
|
- <view class="val">{{item.pgOrderProducts.map(o => `${o.mainName || ''}${item.orderSmallTypeText}x${o.num}`).join(',')}}</view>
|
|
|
|
|
|
+ <view class="val">{{
|
|
|
|
+ item.pgOrderProducts.map(o => `${o.mainName || ''}${item.orderSmallTypeText}x${o.num}`).join(',')
|
|
|
|
+ }}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="row">
|
|
<view class="row">
|
|
@@ -72,8 +89,14 @@
|
|
<view class="value">
|
|
<view class="value">
|
|
<view class="val">{{ item.userName }} {{ item.userMobile }}</view>
|
|
<view class="val">{{ item.userName }} {{ item.userMobile }}</view>
|
|
<view class="num" v-if="item.customerTotalNum > 0">
|
|
<view class="num" v-if="item.customerTotalNum > 0">
|
|
- (共<text>{{ item.customerSortNum || 0 }}</text>/{{ item.customerTotalNum || 0 }}单)</view>
|
|
|
|
- <view class="fun" v-if="orderStatus_v(item.orderStatus) !== 'DQD'" @tap.stop="$callPhone(item.userMobile)">
|
|
|
|
|
|
+ (共<text>{{ item.customerSortNum || 0 }}</text
|
|
|
|
+ >/{{ item.customerTotalNum || 0 }}单)</view
|
|
|
|
+ >
|
|
|
|
+ <view
|
|
|
|
+ class="fun"
|
|
|
|
+ v-if="orderStatus_v(item.orderStatus) !== 'DQD'"
|
|
|
|
+ @tap.stop="$callPhone(item.userMobile)"
|
|
|
|
+ >
|
|
<text class="iconfont icon-call"></text>
|
|
<text class="iconfont icon-call"></text>
|
|
<view class="text">联系Ta</view>
|
|
<view class="text">联系Ta</view>
|
|
</view>
|
|
</view>
|
|
@@ -84,13 +107,17 @@
|
|
<view class="label">服务地址</view>
|
|
<view class="label">服务地址</view>
|
|
<view class="value">
|
|
<view class="value">
|
|
<view class="val address ellipsis-3">{{ item.address || item.gpsAddress }}</view>
|
|
<view class="val address ellipsis-3">{{ item.address || item.gpsAddress }}</view>
|
|
- <view class="fun" v-if="orderStatus_v(item.orderStatus) !== 'DQD'" @tap.stop="
|
|
|
|
- $openLocation({
|
|
|
|
- lat: item.lat,
|
|
|
|
- lng: item.lng,
|
|
|
|
- address: item.address || item.gpsAddress,
|
|
|
|
- })
|
|
|
|
- ">
|
|
|
|
|
|
+ <view
|
|
|
|
+ class="fun"
|
|
|
|
+ v-if="orderStatus_v(item.orderStatus) !== 'DQD'"
|
|
|
|
+ @tap.stop="
|
|
|
|
+ $openLocation({
|
|
|
|
+ lat: item.lat,
|
|
|
|
+ lng: item.lng,
|
|
|
|
+ address: item.address || item.gpsAddress
|
|
|
|
+ })
|
|
|
|
+ "
|
|
|
|
+ >
|
|
<text class="iconfont icon-daohang"></text>
|
|
<text class="iconfont icon-daohang"></text>
|
|
<view class="text">导航</view>
|
|
<view class="text">导航</view>
|
|
</view>
|
|
</view>
|
|
@@ -100,17 +127,40 @@
|
|
<view class="item-btn" @tap.stop>
|
|
<view class="item-btn" @tap.stop>
|
|
<!-- 待接单 -->
|
|
<!-- 待接单 -->
|
|
<block v-if="orderStatus_v(item.orderStatus) == 'DJD'">
|
|
<block v-if="orderStatus_v(item.orderStatus) == 'DJD'">
|
|
- <u-button plain type="primary" text="配件申请" @tap="" v-if="item.orderType != 'INSTALL'" @tap="toPartsApply(item.id)"></u-button>
|
|
|
|
- <u-button plain type="primary" text="取消加急" @tap="actionUrgent(item.id, false)"
|
|
|
|
- v-if="item.orderFlags && item.orderFlags.some((o) => o.tag == 'JIA_JI')"></u-button>
|
|
|
|
|
|
+ <u-button
|
|
|
|
+ plain
|
|
|
|
+ type="primary"
|
|
|
|
+ text="配件申请"
|
|
|
|
+ @tap=""
|
|
|
|
+ v-if="item.orderType != 'INSTALL'"
|
|
|
|
+ @tap="toPartsApply(item.id)"
|
|
|
|
+ ></u-button>
|
|
|
|
+ <u-button
|
|
|
|
+ plain
|
|
|
|
+ type="primary"
|
|
|
|
+ text="取消加急"
|
|
|
|
+ @tap="actionUrgent(item.id, false)"
|
|
|
|
+ v-if="item.orderFlags && item.orderFlags.some(o => o.tag == 'JIA_JI')"
|
|
|
|
+ ></u-button>
|
|
<u-button plain type="primary" text="加急" @tap="actionUrgent(item.id, true)" v-else></u-button>
|
|
<u-button plain type="primary" text="加急" @tap="actionUrgent(item.id, true)" v-else></u-button>
|
|
<u-button type="primary" text="接单" @tap="actionReceive(item.id)"></u-button>
|
|
<u-button type="primary" text="接单" @tap="actionReceive(item.id)"></u-button>
|
|
</block>
|
|
</block>
|
|
<!-- 服务中 -->
|
|
<!-- 服务中 -->
|
|
<block v-if="orderStatus_v(item.orderStatus) == 'FWZ' || orderStatus_v(item.orderStatus) == 'YCD'">
|
|
<block v-if="orderStatus_v(item.orderStatus) == 'FWZ' || orderStatus_v(item.orderStatus) == 'YCD'">
|
|
- <u-button plain type="primary" text="配件申请" v-if="item.orderType != 'INSTALL'" @tap="toPartsApply(item.id)"></u-button>
|
|
|
|
- <u-button plain type="primary" text="辅材收费" @tap="toCharge(item.id, 'M')"
|
|
|
|
- v-if="item.orderType == 'INSTALL'"></u-button>
|
|
|
|
|
|
+ <u-button
|
|
|
|
+ plain
|
|
|
|
+ type="primary"
|
|
|
|
+ text="配件申请"
|
|
|
|
+ v-if="item.orderType != 'INSTALL'"
|
|
|
|
+ @tap="toPartsApply(item.id)"
|
|
|
|
+ ></u-button>
|
|
|
|
+ <u-button
|
|
|
|
+ plain
|
|
|
|
+ type="primary"
|
|
|
|
+ text="辅材收费"
|
|
|
|
+ @tap="toCharge(item.id, 'M')"
|
|
|
|
+ v-if="item.orderType == 'INSTALL'"
|
|
|
|
+ ></u-button>
|
|
<u-button plain type="primary" text="配件收费" @tap="toCharge(item.id, 'P')" v-else></u-button>
|
|
<u-button plain type="primary" text="配件收费" @tap="toCharge(item.id, 'P')" v-else></u-button>
|
|
<u-button type="primary" text="过程反馈" @tap="toFeedback(item.id)"></u-button>
|
|
<u-button type="primary" text="过程反馈" @tap="toFeedback(item.id)"></u-button>
|
|
</block>
|
|
</block>
|
|
@@ -123,7 +173,6 @@
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<Loading :loadStatus="loadStatus" :dataList="dataList" />
|
|
<Loading :loadStatus="loadStatus" :dataList="dataList" />
|
|
-
|
|
|
|
</view>
|
|
</view>
|
|
</zj-page-layout>
|
|
</zj-page-layout>
|
|
|
|
|
|
@@ -132,11 +181,11 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import zjDialogDateRangePicker from '@/components/zj-dialog/zj-dialog-dateRangePicker.vue';
|
|
|
|
|
|
+import zjDialogDateRangePicker from '@/components/zj-dialog/zj-dialog-dateRangePicker.vue'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
- zjDialogDateRangePicker,
|
|
|
|
|
|
+ zjDialogDateRangePicker
|
|
},
|
|
},
|
|
|
|
|
|
data() {
|
|
data() {
|
|
@@ -147,7 +196,7 @@ export default {
|
|
{ name: '待接单', value: 'DJD', num: 0 },
|
|
{ name: '待接单', value: 'DJD', num: 0 },
|
|
{ name: '服务中', value: 'FWZ', num: 0 },
|
|
{ name: '服务中', value: 'FWZ', num: 0 },
|
|
{ name: '已完工', value: 'YWG', num: 0 },
|
|
{ name: '已完工', value: 'YWG', num: 0 },
|
|
- { name: '异常待处理', value: 'YCD', num: 0 },
|
|
|
|
|
|
+ { name: '异常待处理', value: 'YCD', num: 0 }
|
|
],
|
|
],
|
|
curMainTab: '',
|
|
curMainTab: '',
|
|
curSmallTab: 0,
|
|
curSmallTab: 0,
|
|
@@ -156,7 +205,7 @@ export default {
|
|
{ id: 0, name: '全部' },
|
|
{ id: 0, name: '全部' },
|
|
{ id: 1, name: '今天' },
|
|
{ id: 1, name: '今天' },
|
|
{ id: 2, name: '明天' },
|
|
{ id: 2, name: '明天' },
|
|
- { id: 3, name: '其他' },
|
|
|
|
|
|
+ { id: 3, name: '其他' }
|
|
],
|
|
],
|
|
curOrderType: '',
|
|
curOrderType: '',
|
|
|
|
|
|
@@ -172,273 +221,289 @@ export default {
|
|
scrollLeft: 0,
|
|
scrollLeft: 0,
|
|
scrollViewWidth: 0,
|
|
scrollViewWidth: 0,
|
|
tabsRect: {
|
|
tabsRect: {
|
|
- left: 0,
|
|
|
|
|
|
+ left: 0
|
|
},
|
|
},
|
|
|
|
|
|
isYb: false, // 是否延保单
|
|
isYb: false, // 是否延保单
|
|
- isWb: false, // 是否维保单
|
|
|
|
-
|
|
|
|
- };
|
|
|
|
|
|
+ isWb: false // 是否维保单
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
async onLoad({ tab, isYb, isWb }) {
|
|
async onLoad({ tab, isYb, isWb }) {
|
|
- this.crossPage.$on('refreshWorkorderList', (data) => {
|
|
|
|
- if(data && data.tab) {
|
|
|
|
- this.curMainTab = data.tab;
|
|
|
|
|
|
+ this.crossPage.$on('refreshWorkorderList', data => {
|
|
|
|
+ if (data && data.tab) {
|
|
|
|
+ this.curMainTab = data.tab
|
|
}
|
|
}
|
|
- this.refreshList();
|
|
|
|
- });
|
|
|
|
|
|
+ this.refreshList()
|
|
|
|
+ })
|
|
|
|
|
|
- if(isYb){
|
|
|
|
- this.isYb = true;
|
|
|
|
|
|
+ if (isYb) {
|
|
|
|
+ this.isYb = true
|
|
}
|
|
}
|
|
- if(isWb){
|
|
|
|
- this.isWb = true;
|
|
|
|
|
|
+ if (isWb) {
|
|
|
|
+ this.isWb = true
|
|
}
|
|
}
|
|
|
|
|
|
- this.getCount();
|
|
|
|
|
|
+ this.getCount()
|
|
|
|
|
|
- this.curMainTab = tab || '';
|
|
|
|
- this.refreshList();
|
|
|
|
|
|
+ this.curMainTab = tab || ''
|
|
|
|
+ this.refreshList()
|
|
|
|
|
|
- this.resize();
|
|
|
|
|
|
+ this.resize()
|
|
},
|
|
},
|
|
|
|
|
|
onUnload() {
|
|
onUnload() {
|
|
- this.crossPage.$off('refreshWorkorderList');
|
|
|
|
|
|
+ this.crossPage.$off('refreshWorkorderList')
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
- orderStatus_v(orderStatus){
|
|
|
|
- if (["DYY"].includes(orderStatus)) {
|
|
|
|
|
|
+ orderStatus_v(orderStatus) {
|
|
|
|
+ if (['DYY'].includes(orderStatus)) {
|
|
// 待预约
|
|
// 待预约
|
|
- return "DYY"
|
|
|
|
- } else if (["DQD"].includes(orderStatus)) {
|
|
|
|
|
|
+ return 'DYY'
|
|
|
|
+ } else if (['DQD'].includes(orderStatus)) {
|
|
// 待抢单
|
|
// 待抢单
|
|
- return "DQD"
|
|
|
|
- } else if (["DSHPG", "CJ", "YPD", "DXSPD", "DZBPG", "DWDSPGP", "DXSSPGP", "DTJXSSPGP", "DZBSPGP", "DFZXPD", "DFZXSPGP", 'XSBH', "TJXSBH", "ZBBH", "FZXBH", "FL"].includes(orderStatus)) {
|
|
|
|
|
|
+ return 'DQD'
|
|
|
|
+ } else if (
|
|
|
|
+ [
|
|
|
|
+ 'DSHPG',
|
|
|
|
+ 'CJ',
|
|
|
|
+ 'YPD',
|
|
|
|
+ 'DXSPD',
|
|
|
|
+ 'DZBPG',
|
|
|
|
+ 'DWDSPGP',
|
|
|
|
+ 'DXSSPGP',
|
|
|
|
+ 'DTJXSSPGP',
|
|
|
|
+ 'DZBSPGP',
|
|
|
|
+ 'DFZXPD',
|
|
|
|
+ 'DFZXSPGP',
|
|
|
|
+ 'XSBH',
|
|
|
|
+ 'TJXSBH',
|
|
|
|
+ 'ZBBH',
|
|
|
|
+ 'FZXBH',
|
|
|
|
+ 'FL'
|
|
|
|
+ ].includes(orderStatus)
|
|
|
|
+ ) {
|
|
// 待商户派工
|
|
// 待商户派工
|
|
- return "DSHPG"
|
|
|
|
- } else if (["DWDPG", "DWDPD", "WDBH"].includes(orderStatus)) {
|
|
|
|
|
|
+ return 'DSHPG'
|
|
|
|
+ } else if (['DWDPG', 'DWDPD', 'WDBH'].includes(orderStatus)) {
|
|
// 待网点派工
|
|
// 待网点派工
|
|
- return "DWDPG"
|
|
|
|
- } else if (["DJD", "DSM", "YZP"].includes(orderStatus)) {
|
|
|
|
|
|
+ return 'DWDPG'
|
|
|
|
+ } else if (['DJD', 'DSM', 'YZP'].includes(orderStatus)) {
|
|
// 待接单
|
|
// 待接单
|
|
- return "DJD"
|
|
|
|
- } else if (["FWZ", "GCSZT", "BFWG"].includes(orderStatus)) {
|
|
|
|
|
|
+ return 'DJD'
|
|
|
|
+ } else if (['FWZ', 'GCSZT', 'BFWG'].includes(orderStatus)) {
|
|
// 服务中
|
|
// 服务中
|
|
- return "FWZ"
|
|
|
|
- } else if (["YCD"].includes(orderStatus)) {
|
|
|
|
|
|
+ return 'FWZ'
|
|
|
|
+ } else if (['YCD'].includes(orderStatus)) {
|
|
// 异常单
|
|
// 异常单
|
|
- return "YCD"
|
|
|
|
- } else if (["YWG", "GCSZX", "WDWG", "YWGO"].includes(orderStatus)) {
|
|
|
|
|
|
+ return 'YCD'
|
|
|
|
+ } else if (['YWG', 'GCSZX', 'WDWG', 'YWGO'].includes(orderStatus)) {
|
|
// 已完工待结算
|
|
// 已完工待结算
|
|
- return "YWG"
|
|
|
|
- } else if (["YJS", "LRCD"].includes(orderStatus)) {
|
|
|
|
|
|
+ return 'YWG'
|
|
|
|
+ } else if (['YJS', 'LRCD'].includes(orderStatus)) {
|
|
// 已结算
|
|
// 已结算
|
|
- return "YJS"
|
|
|
|
- } else if (["YQX", "FWZT", "YCGB", "FWQX"].includes(orderStatus)) {
|
|
|
|
|
|
+ return 'YJS'
|
|
|
|
+ } else if (['YQX', 'FWZT', 'YCGB', 'FWQX'].includes(orderStatus)) {
|
|
// 已取消
|
|
// 已取消
|
|
- return "YQX"
|
|
|
|
|
|
+ return 'YQX'
|
|
}
|
|
}
|
|
- return ""
|
|
|
|
|
|
+ return ''
|
|
},
|
|
},
|
|
// 触发下拉刷新
|
|
// 触发下拉刷新
|
|
async refresherrefresh(e) {
|
|
async refresherrefresh(e) {
|
|
- this.refresherTriggered = true;
|
|
|
|
|
|
+ this.refresherTriggered = true
|
|
|
|
|
|
- this.refreshList();
|
|
|
|
|
|
+ this.refreshList()
|
|
},
|
|
},
|
|
|
|
|
|
// 滚动到底部
|
|
// 滚动到底部
|
|
scrolltolower(e) {
|
|
scrolltolower(e) {
|
|
if (this.loadStatus === 0) {
|
|
if (this.loadStatus === 0) {
|
|
- this.pageNum++;
|
|
|
|
- this.getList();
|
|
|
|
|
|
+ this.pageNum++
|
|
|
|
+ this.getList()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
// 获取统计数量
|
|
// 获取统计数量
|
|
getCount() {
|
|
getCount() {
|
|
- this.$api.post('/pg/order/base/status/count', {
|
|
|
|
- isYb: this.isYb,
|
|
|
|
- isWb: this.isWb,
|
|
|
|
- }).then((res) => {
|
|
|
|
- if (!res.data) return false;
|
|
|
|
- const data = res.data;
|
|
|
|
- this.mainTabs[0].num = (data.dqd || 0) + (data.djd || 0) + (data.fwz || 0) + (data.ywg || 0) + (data.ycd || 0);
|
|
|
|
- this.mainTabs[1].num = data.dqd || 0;
|
|
|
|
- this.mainTabs[2].num = data.djd || 0;
|
|
|
|
- this.mainTabs[3].num = data.fwz || 0;
|
|
|
|
- this.mainTabs[4].num = data.ywg || 0;
|
|
|
|
- this.mainTabs[5].num = data.ycd || 0;
|
|
|
|
- });
|
|
|
|
|
|
+ this.$api
|
|
|
|
+ .post('/pg/order/base/status/count', {
|
|
|
|
+ isYb: this.isYb,
|
|
|
|
+ isWb: this.isWb
|
|
|
|
+ })
|
|
|
|
+ .then(res => {
|
|
|
|
+ if (!res.data) return false
|
|
|
|
+ const data = res.data
|
|
|
|
+ this.mainTabs[0].num = (data.dqd || 0) + (data.djd || 0) + (data.fwz || 0) + (data.ywg || 0) + (data.ycd || 0)
|
|
|
|
+ this.mainTabs[1].num = data.dqd || 0
|
|
|
|
+ this.mainTabs[2].num = data.djd || 0
|
|
|
|
+ this.mainTabs[3].num = data.fwz || 0
|
|
|
|
+ this.mainTabs[4].num = data.ywg || 0
|
|
|
|
+ this.mainTabs[5].num = data.ycd || 0
|
|
|
|
+ })
|
|
},
|
|
},
|
|
|
|
|
|
// 获取列表
|
|
// 获取列表
|
|
getList() {
|
|
getList() {
|
|
- this.loadStatus = 1;
|
|
|
|
- this.$api.post('/pg/order/base/list', {
|
|
|
|
- pageNum: this.pageNum,
|
|
|
|
- pageSize: 5,
|
|
|
|
- keyword: '',
|
|
|
|
- orderBaseStatus: this.curMainTab,
|
|
|
|
- byDay: this.curSmallTab || '',
|
|
|
|
- startTime: this.startDate ? this.startDate + ' 00:00:00' : '',
|
|
|
|
- endTime: this.endDate ? this.endDate + ' 23:59:59' : '',
|
|
|
|
- isYb: this.isYb,
|
|
|
|
- isWb: this.isWb,
|
|
|
|
- }).then((res) => {
|
|
|
|
- this.loadStatus = 0;
|
|
|
|
- let list = res.data.records;
|
|
|
|
|
|
+ this.loadStatus = 1
|
|
|
|
+ this.$api
|
|
|
|
+ .post('/pg/order/base/list', {
|
|
|
|
+ pageNum: this.pageNum,
|
|
|
|
+ pageSize: 5,
|
|
|
|
+ keyword: '',
|
|
|
|
+ orderBaseStatus: this.curMainTab,
|
|
|
|
+ byDay: this.curSmallTab || '',
|
|
|
|
+ startTime: this.startDate ? this.startDate + ' 00:00:00' : '',
|
|
|
|
+ endTime: this.endDate ? this.endDate + ' 23:59:59' : '',
|
|
|
|
+ isYb: this.isYb,
|
|
|
|
+ isWb: this.isWb
|
|
|
|
+ })
|
|
|
|
+ .then(res => {
|
|
|
|
+ this.loadStatus = 0
|
|
|
|
+ let list = res.data.records
|
|
if (list.length < 5) {
|
|
if (list.length < 5) {
|
|
- this.loadStatus = 2;
|
|
|
|
|
|
+ this.loadStatus = 2
|
|
}
|
|
}
|
|
|
|
|
|
- this.dataList = this.pageNum === 1 ? list : this.dataList.concat(list);
|
|
|
|
|
|
+ this.dataList = this.pageNum === 1 ? list : this.dataList.concat(list)
|
|
})
|
|
})
|
|
.catch(() => {
|
|
.catch(() => {
|
|
- this.loadStatus = 2;
|
|
|
|
|
|
+ this.loadStatus = 2
|
|
|
|
+ })
|
|
|
|
+ .finally(res => {
|
|
|
|
+ this.refresherTriggered = false
|
|
})
|
|
})
|
|
- .finally((res) => {
|
|
|
|
- this.refresherTriggered = false;
|
|
|
|
- });
|
|
|
|
},
|
|
},
|
|
|
|
|
|
findMainTabIndex(val) {
|
|
findMainTabIndex(val) {
|
|
for (var i = 0; i < this.mainTabs.length; i++) {
|
|
for (var i = 0; i < this.mainTabs.length; i++) {
|
|
if (this.mainTabs[i]['value'] == val) {
|
|
if (this.mainTabs[i]['value'] == val) {
|
|
- return i;
|
|
|
|
|
|
+ return i
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
setScrollLeft() {
|
|
setScrollLeft() {
|
|
// 当前活动tab的布局信息,有tab菜单的width和left(为元素左边界到父元素左边界的距离)等信息
|
|
// 当前活动tab的布局信息,有tab菜单的width和left(为元素左边界到父元素左边界的距离)等信息
|
|
- const tabRect = this.mainTabs[this.findMainTabIndex(this.curMainTab)];
|
|
|
|
|
|
+ const tabRect = this.mainTabs[this.findMainTabIndex(this.curMainTab)]
|
|
// 累加得到当前item到左边的距离
|
|
// 累加得到当前item到左边的距离
|
|
- const offsetLeft = this.mainTabs
|
|
|
|
- .slice(0, this.findMainTabIndex(this.curMainTab))
|
|
|
|
- .reduce((total, curr) => {
|
|
|
|
- return total + curr.rect.width;
|
|
|
|
- }, 0);
|
|
|
|
|
|
+ const offsetLeft = this.mainTabs.slice(0, this.findMainTabIndex(this.curMainTab)).reduce((total, curr) => {
|
|
|
|
+ return total + curr.rect.width
|
|
|
|
+ }, 0)
|
|
// 此处为屏幕宽度
|
|
// 此处为屏幕宽度
|
|
- const windowWidth = uni.$u.sys().windowWidth;
|
|
|
|
|
|
+ const windowWidth = uni.$u.sys().windowWidth
|
|
// 将活动的tabs-item移动到屏幕正中间,实际上是对scroll-view的移动
|
|
// 将活动的tabs-item移动到屏幕正中间,实际上是对scroll-view的移动
|
|
let scrollLeft =
|
|
let scrollLeft =
|
|
offsetLeft -
|
|
offsetLeft -
|
|
(this.tabsRect.width - tabRect.rect.width) / 2 -
|
|
(this.tabsRect.width - tabRect.rect.width) / 2 -
|
|
(windowWidth - this.tabsRect.right) / 2 +
|
|
(windowWidth - this.tabsRect.right) / 2 +
|
|
- this.tabsRect.left / 2;
|
|
|
|
|
|
+ this.tabsRect.left / 2
|
|
// 这里做一个限制,限制scrollLeft的最大值为整个scroll-view宽度减去tabs组件的宽度
|
|
// 这里做一个限制,限制scrollLeft的最大值为整个scroll-view宽度减去tabs组件的宽度
|
|
- scrollLeft = Math.min(scrollLeft, this.scrollViewWidth);
|
|
|
|
- this.scrollLeft = Math.max(0, scrollLeft);
|
|
|
|
|
|
+ scrollLeft = Math.min(scrollLeft, this.scrollViewWidth)
|
|
|
|
+ this.scrollLeft = Math.max(0, scrollLeft)
|
|
},
|
|
},
|
|
|
|
|
|
// 获取所有标签的尺寸
|
|
// 获取所有标签的尺寸
|
|
resize() {
|
|
resize() {
|
|
if (this.mainTabs.length === 0) {
|
|
if (this.mainTabs.length === 0) {
|
|
- return;
|
|
|
|
|
|
+ return
|
|
}
|
|
}
|
|
|
|
|
|
- Promise.all([this.getTabsRect(), this.getAllItemRect()]).then(
|
|
|
|
- ([tabsRect, itemRect = []]) => {
|
|
|
|
- this.tabsRect = tabsRect;
|
|
|
|
- this.scrollViewWidth = 0;
|
|
|
|
- itemRect.map((item, index) => {
|
|
|
|
- // 计算scroll-view的宽度,这里
|
|
|
|
- this.scrollViewWidth += item.width;
|
|
|
|
- // 另外计算每一个item的中心点X轴坐标
|
|
|
|
- this.mainTabs[index].rect = item;
|
|
|
|
- });
|
|
|
|
- // 获取了tabs的尺寸之后,设置滑块的位置
|
|
|
|
- this.setScrollLeft();
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
|
|
+ Promise.all([this.getTabsRect(), this.getAllItemRect()]).then(([tabsRect, itemRect = []]) => {
|
|
|
|
+ this.tabsRect = tabsRect
|
|
|
|
+ this.scrollViewWidth = 0
|
|
|
|
+ itemRect.map((item, index) => {
|
|
|
|
+ // 计算scroll-view的宽度,这里
|
|
|
|
+ this.scrollViewWidth += item.width
|
|
|
|
+ // 另外计算每一个item的中心点X轴坐标
|
|
|
|
+ this.mainTabs[index].rect = item
|
|
|
|
+ })
|
|
|
|
+ // 获取了tabs的尺寸之后,设置滑块的位置
|
|
|
|
+ this.setScrollLeft()
|
|
|
|
+ })
|
|
},
|
|
},
|
|
|
|
|
|
// 获取导航菜单的尺寸
|
|
// 获取导航菜单的尺寸
|
|
getTabsRect() {
|
|
getTabsRect() {
|
|
- return new Promise((resolve) => {
|
|
|
|
- this.queryRect('tab-scroll-view').then((size) => resolve(size));
|
|
|
|
- });
|
|
|
|
|
|
+ return new Promise(resolve => {
|
|
|
|
+ this.queryRect('tab-scroll-view').then(size => resolve(size))
|
|
|
|
+ })
|
|
},
|
|
},
|
|
|
|
|
|
// 获取所有标签的尺寸
|
|
// 获取所有标签的尺寸
|
|
getAllItemRect() {
|
|
getAllItemRect() {
|
|
- return new Promise((resolve) => {
|
|
|
|
- const promiseAllArr = this.mainTabs.map((item, index) =>
|
|
|
|
- this.queryRect(`tab-item-${index}`, true)
|
|
|
|
- );
|
|
|
|
- Promise.all(promiseAllArr).then((sizes) => resolve(sizes));
|
|
|
|
- });
|
|
|
|
|
|
+ return new Promise(resolve => {
|
|
|
|
+ const promiseAllArr = this.mainTabs.map((item, index) => this.queryRect(`tab-item-${index}`, true))
|
|
|
|
+ Promise.all(promiseAllArr).then(sizes => resolve(sizes))
|
|
|
|
+ })
|
|
},
|
|
},
|
|
|
|
|
|
// 获取各个标签的尺寸
|
|
// 获取各个标签的尺寸
|
|
queryRect(el, item) {
|
|
queryRect(el, item) {
|
|
- return new Promise((resolve) => {
|
|
|
|
- this.$uGetRect(`.${el}`).then((size) => {
|
|
|
|
- resolve(size);
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
|
|
+ return new Promise(resolve => {
|
|
|
|
+ this.$uGetRect(`.${el}`).then(size => {
|
|
|
|
+ resolve(size)
|
|
|
|
+ })
|
|
|
|
+ })
|
|
},
|
|
},
|
|
|
|
|
|
// 切换大状态
|
|
// 切换大状态
|
|
changeMainTab(val) {
|
|
changeMainTab(val) {
|
|
- this.curMainTab = val;
|
|
|
|
|
|
+ this.curMainTab = val
|
|
// this.curMainTab = val.value;
|
|
// this.curMainTab = val.value;
|
|
if (this.startDate == '' || this.endDate == '') {
|
|
if (this.startDate == '' || this.endDate == '') {
|
|
- this.curSmallTab = 0;
|
|
|
|
- this.curSmallTabIndex = 0;
|
|
|
|
|
|
+ this.curSmallTab = 0
|
|
|
|
+ this.curSmallTabIndex = 0
|
|
} else {
|
|
} else {
|
|
- this.curSmallTab = '';
|
|
|
|
- this.curSmallTabIndex = '';
|
|
|
|
|
|
+ this.curSmallTab = ''
|
|
|
|
+ this.curSmallTabIndex = ''
|
|
}
|
|
}
|
|
|
|
|
|
- this.refreshList();
|
|
|
|
- this.resize();
|
|
|
|
|
|
+ this.refreshList()
|
|
|
|
+ this.resize()
|
|
},
|
|
},
|
|
|
|
|
|
// 切换小状态
|
|
// 切换小状态
|
|
changeSmallTab(item) {
|
|
changeSmallTab(item) {
|
|
- this.curSmallTab = item.id;
|
|
|
|
- this.curSmallTabIndex = item.index;
|
|
|
|
- this.startDate = '';
|
|
|
|
- this.endDate = '';
|
|
|
|
- this.refreshList();
|
|
|
|
|
|
+ this.curSmallTab = item.id
|
|
|
|
+ this.curSmallTabIndex = item.index
|
|
|
|
+ this.startDate = ''
|
|
|
|
+ this.endDate = ''
|
|
|
|
+ this.refreshList()
|
|
},
|
|
},
|
|
|
|
|
|
// 选择日期
|
|
// 选择日期
|
|
confirmDate(item) {
|
|
confirmDate(item) {
|
|
- let [start, end] = item;
|
|
|
|
|
|
+ let [start, end] = item
|
|
if (start == '' || end == '') {
|
|
if (start == '' || end == '') {
|
|
- this.curSmallTab = 0;
|
|
|
|
- this.curSmallTabIndex = 0;
|
|
|
|
- this.startDate = '';
|
|
|
|
- this.endDate = '';
|
|
|
|
- return;
|
|
|
|
|
|
+ this.curSmallTab = 0
|
|
|
|
+ this.curSmallTabIndex = 0
|
|
|
|
+ this.startDate = ''
|
|
|
|
+ this.endDate = ''
|
|
|
|
+ return
|
|
}
|
|
}
|
|
- this.curSmallTab = '';
|
|
|
|
- this.curSmallTabIndex = '';
|
|
|
|
- this.startDate = start;
|
|
|
|
- this.endDate = end;
|
|
|
|
|
|
+ this.curSmallTab = ''
|
|
|
|
+ this.curSmallTabIndex = ''
|
|
|
|
+ this.startDate = start
|
|
|
|
+ this.endDate = end
|
|
|
|
|
|
- this.refreshList();
|
|
|
|
|
|
+ this.refreshList()
|
|
},
|
|
},
|
|
|
|
|
|
// 刷新列表
|
|
// 刷新列表
|
|
refreshList() {
|
|
refreshList() {
|
|
- this.dataList = [];
|
|
|
|
- this.pageNum = 1;
|
|
|
|
- this.getList();
|
|
|
|
- this.getCount();
|
|
|
|
|
|
+ this.dataList = []
|
|
|
|
+ this.pageNum = 1
|
|
|
|
+ this.getList()
|
|
|
|
+ this.getCount()
|
|
},
|
|
},
|
|
|
|
|
|
// 去搜索页面
|
|
// 去搜索页面
|
|
toSearchPage() {
|
|
toSearchPage() {
|
|
this.$navToPage({
|
|
this.$navToPage({
|
|
url: '/packageWorkorder/pages/search'
|
|
url: '/packageWorkorder/pages/search'
|
|
- });
|
|
|
|
|
|
+ })
|
|
},
|
|
},
|
|
|
|
|
|
// 加急
|
|
// 加急
|
|
@@ -446,16 +511,20 @@ export default {
|
|
this.$modal({
|
|
this.$modal({
|
|
title: '加急操作',
|
|
title: '加急操作',
|
|
content: '加急操作,会消息通知所有订单相关人员,请谨慎操作。'
|
|
content: '加急操作,会消息通知所有订单相关人员,请谨慎操作。'
|
|
- }).then(() => {
|
|
|
|
- this.$api.post('/pg/order/base/flag', {
|
|
|
|
- orderBaseId: id,
|
|
|
|
- orderFlagEnum: 'JIA_JI',
|
|
|
|
- flag: flag,
|
|
|
|
- }).then(res => {
|
|
|
|
- this.$successToast();
|
|
|
|
- this.refreshList();
|
|
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.$api
|
|
|
|
+ .post('/pg/order/base/flag', {
|
|
|
|
+ orderBaseId: id,
|
|
|
|
+ orderFlagEnum: 'JIA_JI',
|
|
|
|
+ flag: flag
|
|
|
|
+ })
|
|
|
|
+ .then(res => {
|
|
|
|
+ this.$successToast()
|
|
|
|
+ this.refreshList()
|
|
|
|
+ })
|
|
})
|
|
})
|
|
- }).catch(() => { })
|
|
|
|
|
|
+ .catch(() => {})
|
|
},
|
|
},
|
|
|
|
|
|
// 接单
|
|
// 接单
|
|
@@ -463,22 +532,32 @@ export default {
|
|
this.$modal({
|
|
this.$modal({
|
|
title: '接单确认',
|
|
title: '接单确认',
|
|
content: '确认接单?'
|
|
content: '确认接单?'
|
|
- }).then(() => {
|
|
|
|
- this.$api.post('/pg/order/base/rece', {
|
|
|
|
- orderBaseId: id,
|
|
|
|
- }).then(res => {
|
|
|
|
- this.$successToast();
|
|
|
|
- this.refreshList();
|
|
|
|
- this.toDetail(id);
|
|
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.$api
|
|
|
|
+ .post('/pg/order/base/rece', {
|
|
|
|
+ orderBaseId: id
|
|
|
|
+ })
|
|
|
|
+ .then(res => {
|
|
|
|
+ this.$successToast()
|
|
|
|
+ this.refreshList()
|
|
|
|
+ this.toDetail(id)
|
|
|
|
+ })
|
|
})
|
|
})
|
|
- }).catch(() => { })
|
|
|
|
|
|
+ .catch(() => {})
|
|
},
|
|
},
|
|
|
|
|
|
// 去收费
|
|
// 去收费
|
|
toCharge(id, type) {
|
|
toCharge(id, type) {
|
|
- this.$navToPage({
|
|
|
|
- url: `/packageMaterial/pages/sale/index?type=${type}&oid=${id}`
|
|
|
|
- })
|
|
|
|
|
|
+ if (type == 'M') {
|
|
|
|
+ this.$navToPage({
|
|
|
|
+ url: `/packageMaterial/pages/sale/index?type=${type}&oid=${id}`
|
|
|
|
+ })
|
|
|
|
+ } else if (type == 'P') {
|
|
|
|
+ this.$navToPage({
|
|
|
|
+ url: `/packageMaterial/pages/newSale/index?type=${type}&oid=${id}`
|
|
|
|
+ })
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
// 去配件申请
|
|
// 去配件申请
|
|
@@ -501,23 +580,26 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
- qdOrder(item){
|
|
|
|
|
|
+ qdOrder(item) {
|
|
this.$modal({
|
|
this.$modal({
|
|
title: '抢单确认',
|
|
title: '抢单确认',
|
|
content: '确认抢单?'
|
|
content: '确认抢单?'
|
|
- }).then(() => {
|
|
|
|
- this.$api.post('/pg/order/base/qd', {
|
|
|
|
- orderBaseId: item.id,
|
|
|
|
- }).then(res => {
|
|
|
|
- this.$successToast();
|
|
|
|
- this.refreshList();
|
|
|
|
- this.toDetail(item.id);
|
|
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.$api
|
|
|
|
+ .post('/pg/order/base/qd', {
|
|
|
|
+ orderBaseId: item.id
|
|
|
|
+ })
|
|
|
|
+ .then(res => {
|
|
|
|
+ this.$successToast()
|
|
|
|
+ this.refreshList()
|
|
|
|
+ this.toDetail(item.id)
|
|
|
|
+ })
|
|
})
|
|
})
|
|
- }).catch(() => { })
|
|
|
|
|
|
+ .catch(() => {})
|
|
}
|
|
}
|
|
-
|
|
|
|
- },
|
|
|
|
-};
|
|
|
|
|
|
+ }
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scopeds>
|
|
<style lang="scss" scopeds>
|
|
@@ -628,15 +710,15 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
&.active {
|
|
&.active {
|
|
- background: #E7EFFF;
|
|
|
|
- border: 1px solid #3D8FFD;
|
|
|
|
|
|
+ background: #e7efff;
|
|
|
|
+ border: 1px solid #3d8ffd;
|
|
|
|
|
|
.text {
|
|
.text {
|
|
- color: #3D8FFD;
|
|
|
|
|
|
+ color: #3d8ffd;
|
|
}
|
|
}
|
|
|
|
|
|
.iconfont {
|
|
.iconfont {
|
|
- color: #3D8FFD;
|
|
|
|
|
|
+ color: #3d8ffd;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|