|
@@ -3,61 +3,62 @@
|
|
|
:isScroll="true"
|
|
|
:refresherTriggered="refresherTriggered"
|
|
|
@refresherrefresh="refresherrefresh"
|
|
|
- @scrolltolower="scrolltolower">
|
|
|
+ @scrolltolower="scrolltolower"
|
|
|
+ >
|
|
|
<template slot="header">
|
|
|
<view class="tab-container">
|
|
|
- <u-tabs
|
|
|
- :scrollable="false"
|
|
|
- :list="tabList"
|
|
|
- :current="curTab"
|
|
|
- @click="changeTab"
|
|
|
- lineColor="#3D8FFD"
|
|
|
- :activeStyle="{
|
|
|
- color: '#3D8FFD'
|
|
|
- }"
|
|
|
- :inactiveStyle="{
|
|
|
- color: '#666666'
|
|
|
- }"
|
|
|
- itemStyle="height: 88rpx;">
|
|
|
- </u-tabs>
|
|
|
+ <u-tabs
|
|
|
+ :scrollable="false"
|
|
|
+ :list="tabList"
|
|
|
+ :current="curTab"
|
|
|
+ @click="changeTab"
|
|
|
+ lineColor="#3D8FFD"
|
|
|
+ :activeStyle="{
|
|
|
+ color: '#3D8FFD'
|
|
|
+ }"
|
|
|
+ :inactiveStyle="{
|
|
|
+ color: '#666666'
|
|
|
+ }"
|
|
|
+ itemStyle="height: 88rpx;"
|
|
|
+ >
|
|
|
+ </u-tabs>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<view class="list-container">
|
|
|
<view class="item" v-for="(item, index) in dataList" :key="index" @tap="toDetail(item)">
|
|
|
-
|
|
|
<view class="top">
|
|
|
<view class="orderid">
|
|
|
<view class="row" v-if="item.saleOrderId">
|
|
|
- <view class="ellipsis">订单号<text>{{item.saleOrderId}}</text></view>
|
|
|
+ <view class="ellipsis"
|
|
|
+ >订单号<text>{{ item.saleOrderId }}</text></view
|
|
|
+ >
|
|
|
<view class="copy" @tap.stop="$copy(item.saleOrderId)">复制</view>
|
|
|
</view>
|
|
|
<view class="row">
|
|
|
- <view class="ellipsis">工单号<text>{{item.id}}</text></view>
|
|
|
+ <view class="ellipsis"
|
|
|
+ >工单号<text>{{ item.id }}</text></view
|
|
|
+ >
|
|
|
<view class="copy" @tap.stop="$copy(item.id)">复制</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="right">{{getStatus(item)}}</view>
|
|
|
+ <view class="right">{{ getStatus(item) }}</view>
|
|
|
</view>
|
|
|
|
|
|
- <view
|
|
|
- class="goods"
|
|
|
- :class="'goods'+idx"
|
|
|
- v-for="(it, idx) in item.pgOrderProducts"
|
|
|
- :key="idx">
|
|
|
+ <view class="goods" :class="'goods' + idx" v-for="(it, idx) in item.pgOrderProducts" :key="idx">
|
|
|
<image :src="it.imgUrl" mode="aspectFill"></image>
|
|
|
<view class="main">
|
|
|
- <view class="name ellipsis-2">{{it.smallName}}</view>
|
|
|
+ <view class="name ellipsis-2">{{ it.smallName }}</view>
|
|
|
<!-- <view class="des">{{it.small_name}}</view> -->
|
|
|
<view class="tags">
|
|
|
- <view class="tag1" v-if="it.brandName">{{it.brandName}}</view>
|
|
|
- <view class="tag2">{{it.mainName}}</view>
|
|
|
+ <view class="tag1" v-if="it.brandName">{{ it.brandName }}</view>
|
|
|
+ <view class="tag2">{{ it.mainName }}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="info" v-if="item.appointmentTime">
|
|
|
<view class="label">预约时间</view>
|
|
|
- <view class="value">{{item.appointmentTime.slice(0, 10)}}</view>
|
|
|
+ <view class="value">{{ item.appointmentTime.slice(0, 10) }}</view>
|
|
|
</view>
|
|
|
|
|
|
<!-- 按钮:待预约 -->
|
|
@@ -69,13 +70,19 @@
|
|
|
<div class="button red" @tap.stop="toBook(item.id, 2)">改约</div>
|
|
|
</view>
|
|
|
<!-- 按钮:待评价 -->
|
|
|
- <view class="btn-group" v-else-if="orderStatus_v(item.orderStatus) === 'YWG' || orderStatus_v(item.orderStatus) === 'YJS'">
|
|
|
+ <view
|
|
|
+ class="btn-group"
|
|
|
+ v-else-if="orderStatus_v(item.orderStatus) === 'YWG' || orderStatus_v(item.orderStatus) === 'YJS'"
|
|
|
+ >
|
|
|
<!-- <div class="button gray" v-if="item.pay_confirm_path" @tap.stop="$navPage(`/pages/mine/workOrder/receipt?imgurl=${item.pay_confirm_path}`)">查看收据</div> -->
|
|
|
<div class="button white" @tap.stop="toAppraise(item.id)" v-if="item.appraiseStatus == 'N'">评价</div>
|
|
|
<div class="button gray">查看详情</div>
|
|
|
</view>
|
|
|
<!-- 按钮:已完成 -->
|
|
|
- <view class="btn-group" v-else-if="orderStatus_v(item.orderStatus) === 'YWG' || orderStatus_v(item.orderStatus) === 'YJS'">
|
|
|
+ <view
|
|
|
+ class="btn-group"
|
|
|
+ v-else-if="orderStatus_v(item.orderStatus) === 'YWG' || orderStatus_v(item.orderStatus) === 'YJS'"
|
|
|
+ >
|
|
|
<!-- <div class="button gray" v-if="item.pay_confirm_path" @tap.stop="$navPage(`/pages/mine/workOrder/receipt?imgurl=${item.pay_confirm_path}`)">查看收据</div> -->
|
|
|
<div class="button white" @tap.stop="toAppraise(item.id)" v-if="item.appraiseStatus == 'N'">评价</div>
|
|
|
<div class="button gray">查看详情</div>
|
|
@@ -84,196 +91,217 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <Loading
|
|
|
- :type="2"
|
|
|
- :loadStatus="loadStatus"
|
|
|
- :dataList="dataList"
|
|
|
- />
|
|
|
+ <Loading :type="2" :loadStatus="loadStatus" :dataList="dataList" />
|
|
|
</zj-page-layout>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- refresherTriggered: false,
|
|
|
- dataList: [], // 订单列表
|
|
|
- pageNum: 1,
|
|
|
- loadStatus: 0,
|
|
|
- tabList: [
|
|
|
- {key: '', name: '全部'},
|
|
|
- {key: 1, name: '待预约'},
|
|
|
- {key: 2, name: '服务中'},
|
|
|
- {key: 3, name: '待评价'},
|
|
|
- {key: 4, name: '已完成'},
|
|
|
- ],
|
|
|
- tabCurrent: '',
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ refresherTriggered: false,
|
|
|
+ dataList: [], // 订单列表
|
|
|
+ pageNum: 1,
|
|
|
+ loadStatus: 0,
|
|
|
+ tabList: [
|
|
|
+ { key: '', name: '全部' },
|
|
|
+ { key: 1, name: '待预约' },
|
|
|
+ { key: 2, name: '服务中' },
|
|
|
+ { key: 3, name: '待评价' },
|
|
|
+ { key: 4, name: '已完成' }
|
|
|
+ ],
|
|
|
+ tabCurrent: '',
|
|
|
|
|
|
- pgIncreOrderId: '' ,//延保订单id
|
|
|
- isWb: false,
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- computed:{
|
|
|
- curTab() {
|
|
|
- return this.tabList.map(item => item.key).indexOf(this.tabCurrent) || 0;
|
|
|
- }
|
|
|
- },
|
|
|
+ pgIncreOrderId: '', //延保订单id
|
|
|
+ isWb: false
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- onLoad({tab, pgIncreOrderId, isWb}) {
|
|
|
- this.tabCurrent = tab ? Number(tab) : '';
|
|
|
- this.isWb = isWb == 1 ? true : false;
|
|
|
- if(pgIncreOrderId){
|
|
|
- this.pgIncreOrderId = pgIncreOrderId
|
|
|
- }
|
|
|
- this.refreshList();
|
|
|
+ computed: {
|
|
|
+ curTab() {
|
|
|
+ return this.tabList.map(item => item.key).indexOf(this.tabCurrent) || 0
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- this.crossPage.$on('refreshUserWorkorderList', data => {
|
|
|
- this.refreshList();
|
|
|
- })
|
|
|
- },
|
|
|
+ onLoad({ tab, pgIncreOrderId, isWb }) {
|
|
|
+ this.tabCurrent = tab ? Number(tab) : ''
|
|
|
+ this.isWb = isWb == 1 ? true : false
|
|
|
+ if (pgIncreOrderId) {
|
|
|
+ this.pgIncreOrderId = pgIncreOrderId
|
|
|
+ }
|
|
|
+ this.refreshList()
|
|
|
|
|
|
- onUnload() {
|
|
|
- this.crossPage.$off('refreshUserWorkorderList');
|
|
|
- },
|
|
|
+ this.crossPage.$on('refreshUserWorkorderList', data => {
|
|
|
+ this.refreshList()
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
- methods: {
|
|
|
+ onUnload() {
|
|
|
+ this.crossPage.$off('refreshUserWorkorderList')
|
|
|
+ },
|
|
|
|
|
|
- orderStatus_v(orderStatus){
|
|
|
- if (["DYY"].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 "DSHPG"
|
|
|
- } else if (["DWDPG", "DWDPD", "WDBH"].includes(orderStatus)) {
|
|
|
- // 待网点派工
|
|
|
- return "DWDPG"
|
|
|
- } else if (["DJD", "DSM", "YZP"].includes(orderStatus)) {
|
|
|
- // 待接单
|
|
|
- return "DJD"
|
|
|
- } else if (["FWZ", "GCSZT", "BFWG"].includes(orderStatus)) {
|
|
|
- // 服务中
|
|
|
- return "FWZ"
|
|
|
- } else if (["YCD"].includes(orderStatus)) {
|
|
|
- // 异常单
|
|
|
- return "YCD"
|
|
|
- } else if (["YWG", "GCSZX", "WDWG", "YWGO"].includes(orderStatus)) {
|
|
|
- // 已完工待结算
|
|
|
- return "YWG"
|
|
|
- } else if (["YJS", "LRCD"].includes(orderStatus)) {
|
|
|
- // 已结算
|
|
|
- return "YJS"
|
|
|
- } else if (["YQX", "FWZT", "YCGB", "FWQX"].includes(orderStatus)) {
|
|
|
- // 已取消
|
|
|
- return "YQX"
|
|
|
- }
|
|
|
- return ""
|
|
|
- },
|
|
|
+ methods: {
|
|
|
+ orderStatus_v(orderStatus) {
|
|
|
+ if (['DYY'].includes(orderStatus)) {
|
|
|
+ // 待预约
|
|
|
+ return 'DYY'
|
|
|
+ } else if (['DQD'].includes(orderStatus)) {
|
|
|
+ // 待抢单
|
|
|
+ return 'DQD'
|
|
|
+ } else if (
|
|
|
+ [
|
|
|
+ 'DSHPG',
|
|
|
+ 'CJ',
|
|
|
+ 'YPD',
|
|
|
+ 'DXSPD',
|
|
|
+ 'DZBPG',
|
|
|
+ 'DWDSPGP',
|
|
|
+ 'DXSSPGP',
|
|
|
+ 'DTJXSSPGP',
|
|
|
+ 'DZBSPGP',
|
|
|
+ 'DFZXPD',
|
|
|
+ 'DFZXSPGP',
|
|
|
+ 'FL'
|
|
|
+ ].includes(orderStatus)
|
|
|
+ ) {
|
|
|
+ // 待商户派工
|
|
|
+ return 'DSHPG'
|
|
|
+ } else if (['DWDPG', 'DWDPD'].includes(orderStatus)) {
|
|
|
+ // 待网点派工
|
|
|
+ return 'DWDPG'
|
|
|
+ } else if (['DJD'].includes(orderStatus)) {
|
|
|
+ // 待接单
|
|
|
+ return 'DJD'
|
|
|
+ } else if (
|
|
|
+ ['FWZ', 'GCSZT', 'BFWG', 'DSM', 'YZP', 'WDBH', 'XSBH', 'TJXSBH', 'ZBBH', 'FZXBH'].includes(orderStatus)
|
|
|
+ ) {
|
|
|
+ // 服务中
|
|
|
+ return 'FWZ'
|
|
|
+ } else if (['YCD'].includes(orderStatus)) {
|
|
|
+ // 异常单
|
|
|
+ return 'YCD'
|
|
|
+ } else if (['YWG', 'GCSZX', 'WDWG', 'YWGO'].includes(orderStatus)) {
|
|
|
+ // 已完工待结算
|
|
|
+ return 'YWG'
|
|
|
+ } else if (['YJS', 'LRCD'].includes(orderStatus)) {
|
|
|
+ // 已结算
|
|
|
+ return 'YJS'
|
|
|
+ } else if (['YQX', 'FWZT', 'YCGB', 'FWQX'].includes(orderStatus)) {
|
|
|
+ // 已取消
|
|
|
+ return 'YQX'
|
|
|
+ }
|
|
|
+ return ''
|
|
|
+ },
|
|
|
|
|
|
- async getList() {
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- this.$api.post('/pg/order/base/list2', {
|
|
|
+ async getList() {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ this.$api
|
|
|
+ .post('/pg/order/base/list2', {
|
|
|
pageNum: this.pageNum,
|
|
|
pageSize: 10,
|
|
|
flag: this.tabCurrent,
|
|
|
pgIncreOrderId: this.pgIncreOrderId || '',
|
|
|
isWb: this.isWb
|
|
|
- }).then(res => {
|
|
|
- this.loadStatus = 0;
|
|
|
- let list = res.data.records;
|
|
|
- if (list.length < 10) {
|
|
|
- this.loadStatus = 2;
|
|
|
- }
|
|
|
- this.dataList = this.dataList.concat(list);
|
|
|
- }).catch(() => {
|
|
|
- this.loadStatus = 2;
|
|
|
- }).finally(res => {
|
|
|
- resolve(1);
|
|
|
})
|
|
|
- })
|
|
|
- },
|
|
|
+ .then(res => {
|
|
|
+ this.loadStatus = 0
|
|
|
+ let list = res.data.records
|
|
|
+ if (list.length < 10) {
|
|
|
+ this.loadStatus = 2
|
|
|
+ }
|
|
|
+ this.dataList = this.dataList.concat(list)
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.loadStatus = 2
|
|
|
+ })
|
|
|
+ .finally(res => {
|
|
|
+ resolve(1)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
- async refreshList() {
|
|
|
- this.dataList = [];
|
|
|
- this.pageNum = 1;
|
|
|
- await this.getList();
|
|
|
- },
|
|
|
+ async refreshList() {
|
|
|
+ this.dataList = []
|
|
|
+ this.pageNum = 1
|
|
|
+ await this.getList()
|
|
|
+ },
|
|
|
|
|
|
- // 下拉刷新
|
|
|
- async refresherrefresh() {
|
|
|
- this.refresherTriggered = true;
|
|
|
- await this.refreshList();
|
|
|
- this.refresherTriggered = false;
|
|
|
- },
|
|
|
+ // 下拉刷新
|
|
|
+ async refresherrefresh() {
|
|
|
+ this.refresherTriggered = true
|
|
|
+ await this.refreshList()
|
|
|
+ this.refresherTriggered = false
|
|
|
+ },
|
|
|
|
|
|
- // 触底加载
|
|
|
- scrolltolower() {
|
|
|
- if (this.loadStatus === 0) {
|
|
|
- this.pageNum++;
|
|
|
- this.getList();
|
|
|
- }
|
|
|
- },
|
|
|
+ // 触底加载
|
|
|
+ scrolltolower() {
|
|
|
+ if (this.loadStatus === 0) {
|
|
|
+ this.pageNum++
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- getStatus(item) {
|
|
|
- if(this.orderStatus_v(item.orderStatus) == 'DYY') {
|
|
|
- return '待预约'
|
|
|
- }else if(this.orderStatus_v(item.orderStatus) == 'FWZ') {
|
|
|
- return '服务中'
|
|
|
- }else if((this.orderStatus_v(item.orderStatus) == 'YWG' || this.orderStatus_v(item.orderStatus) == 'YJS') && item.appraiseStatus == 'N') {
|
|
|
- return '待评价'
|
|
|
- }else if((this.orderStatus_v(item.orderStatus) == 'YWG' || this.orderStatus_v(item.orderStatus) == 'YJS') && item.appraiseStatus != 'N') {
|
|
|
- return '已完成'
|
|
|
- }
|
|
|
- },
|
|
|
+ getStatus(item) {
|
|
|
+ if (this.orderStatus_v(item.orderStatus) == 'DYY') {
|
|
|
+ return '待预约'
|
|
|
+ } else if (this.orderStatus_v(item.orderStatus) == 'FWZ') {
|
|
|
+ return '服务中'
|
|
|
+ } else if (
|
|
|
+ (this.orderStatus_v(item.orderStatus) == 'YWG' || this.orderStatus_v(item.orderStatus) == 'YJS') &&
|
|
|
+ item.appraiseStatus == 'N'
|
|
|
+ ) {
|
|
|
+ return '待评价'
|
|
|
+ } else if (
|
|
|
+ (this.orderStatus_v(item.orderStatus) == 'YWG' || this.orderStatus_v(item.orderStatus) == 'YJS') &&
|
|
|
+ item.appraiseStatus != 'N'
|
|
|
+ ) {
|
|
|
+ return '已完成'
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- // 去评价
|
|
|
- toAppraise(id) {
|
|
|
- this.navToPage(`/packageWorkorder/pages/appraise?id=${id}`);
|
|
|
- },
|
|
|
+ // 去评价
|
|
|
+ toAppraise(id) {
|
|
|
+ this.navToPage(`/packageWorkorder/pages/appraise?id=${id}`)
|
|
|
+ },
|
|
|
|
|
|
- // 去预约改约
|
|
|
- toBook(id, type) {
|
|
|
- this.navToPage(`/packageWorkorder/pages/bookTime?id=${id}&type=${type}`);
|
|
|
- },
|
|
|
+ // 去预约改约
|
|
|
+ toBook(id, type) {
|
|
|
+ this.navToPage(`/packageWorkorder/pages/bookTime?id=${id}&type=${type}`)
|
|
|
+ },
|
|
|
|
|
|
- // 切换类型
|
|
|
- changeTab(item) {
|
|
|
- this.tabCurrent = item.key;
|
|
|
- this.refreshList();
|
|
|
- },
|
|
|
+ // 切换类型
|
|
|
+ changeTab(item) {
|
|
|
+ this.tabCurrent = item.key
|
|
|
+ this.refreshList()
|
|
|
+ },
|
|
|
|
|
|
- toDetail(item) {
|
|
|
- this.navToPage(`/packageWorkorder/pages/userWorkorderDetail?id=${item.id}`);
|
|
|
- },
|
|
|
+ toDetail(item) {
|
|
|
+ this.navToPage(`/packageWorkorder/pages/userWorkorderDetail?id=${item.id}`)
|
|
|
+ },
|
|
|
|
|
|
- searchData() {
|
|
|
- this.navToPage(`/packageWorkorder/pages/search?keyword=${this.keyword}`)
|
|
|
- },
|
|
|
+ searchData() {
|
|
|
+ this.navToPage(`/packageWorkorder/pages/search?keyword=${this.keyword}`)
|
|
|
+ },
|
|
|
|
|
|
- navToPage(url) {
|
|
|
- this.$navToPage({
|
|
|
- url
|
|
|
- })
|
|
|
- },
|
|
|
+ navToPage(url) {
|
|
|
+ this.$navToPage({
|
|
|
+ url
|
|
|
+ })
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.tab-container {
|
|
|
- background: #FFFFFF;
|
|
|
+ background: #ffffff;
|
|
|
}
|
|
|
|
|
|
.list-container {
|
|
|
padding: 1rpx 20rpx 40rpx;
|
|
|
.item {
|
|
|
margin-top: 20rpx;
|
|
|
- background: #FFFFFF;
|
|
|
+ background: #ffffff;
|
|
|
border-radius: 20rpx;
|
|
|
padding: 0 20rpx;
|
|
|
.top {
|
|
@@ -372,7 +400,6 @@
|
|
|
width: 128rpx;
|
|
|
}
|
|
|
.value {
|
|
|
-
|
|
|
}
|
|
|
.iconfont {
|
|
|
margin-left: 16rpx;
|
|
@@ -418,7 +445,7 @@
|
|
|
border: 1px solid $theme-color;
|
|
|
}
|
|
|
&.red {
|
|
|
- color: #FFFFFF;
|
|
|
+ color: #ffffff;
|
|
|
border: 1px solid $theme-color;
|
|
|
background: $theme-color;
|
|
|
}
|