Browse Source

no message

linwenxin 8 tháng trước cách đây
mục cha
commit
afe952cf31

+ 9 - 3
src/packageWorkorder/pages/infoCollect/form.vue

@@ -2,13 +2,19 @@
 	<view>
 		<zj-page-layout :hasFooter="true" :isScroll="false">
 			<view class="top-container" v-if="detail">
-				<view class="row">
+				<view class="row" style="margin-bottom: 30rpx;">
 					<view class="label">产品小类:</view>
-					<view class="value">{{detail.smallName || ''}}</view>
+					<view class="value">
+            <!-- {{detail.smallName || ''}} -->
+            <u--input placeholder="请输入内机条码" style="height:30rpx" v-model="detail.smallName"></u--input>
+          </view>
 				</view>
 				<view class="row">
 					<view class="label">产品机型:</view>
-					<view class="value">{{detail.productName || ''}}</view>
+					<view class="value">
+            <!-- {{detail.productName || ''}} -->
+            <u--input placeholder="请输入内机条码"  style="height:30rpx" v-model="detail.productName"></u--input>
+          </view>
 				</view>
 				<view class="row">
 					<view class="label">大工师傅:</view>

+ 59 - 22
src/packageWorkorder/pages/orderDetail.vue

@@ -23,13 +23,13 @@
             <view class="top">
               <view class="type">
                 <view class="left">{{ detail.orderSmallTypeText ? detail.orderSmallTypeText.slice(0, 2) : '' }}</view>
-                <view v-if="detail && detail.orderStatus !== 'DQD'" class="right" @tap="copyData()">复制</view>
+                <view v-if="detail && orderStatus_v !== 'DQD'" class="right" @tap="copyData()">复制</view>
               </view>
               <view class="user">{{ detail.userName }} {{ detail.userMobile }}</view>
               <view class="address">
                 <view class="text">{{ detail.province }}{{ detail.city }}{{ detail.area }}{{ detail.street }}{{ detail.address || detail.gpsAddress }}
                 </view>
-                <view v-if="detail && detail.orderStatus !== 'DQD'" class="ctrl" @tap.stop="
+                <view v-if="detail && orderStatus_v !== 'DQD'" class="ctrl" @tap.stop="
                   $openLocation({
                     lat: detail.lat,
                     lng: detail.lng,
@@ -38,7 +38,7 @@
                 "><text class="iconfont icon-daohang"></text>导航</view>
               </view>
             </view>
-            <view class="bottom" v-if="detail && detail.orderStatus !== 'DQD'">
+            <view class="bottom" v-if="detail && orderStatus_v !== 'DQD'">
               <view class="it" @tap="$callPhone(detail.userMobile)"><text class="iconfont icon-call"></text>联系电话1</view>
               <view class="it" @tap="$callPhone(detail.userMobile)"><text class="iconfont icon-call"></text>联系电话2</view>
             </view>
@@ -94,7 +94,7 @@
               <view class="row">
                 <view class="label">订单编号</view>
                 <view class="value">{{ detail.saleOrderId }}</view>
-                <view v-if="detail && detail.orderStatus !== 'DQD'" class="ctrl" @tap="$copy(detail.saleOrderId)">复制</view>
+                <view v-if="detail && orderStatus_v !== 'DQD'" class="ctrl" @tap="$copy(detail.saleOrderId)">复制</view>
               </view>
               <view class="row">
                 <view class="label">下单时间</view>
@@ -172,7 +172,7 @@
 		    <view class="row">
 		      <view class="label">订单编号</view>
 		      <view class="value">{{ increDetail.id }}</view>
-		      <view v-if="detail && detail.orderStatus !== 'DQD'" class="ctrl" @tap="$copy(increDetail.id)">复制</view>
+		      <view v-if="detail && orderStatus_v !== 'DQD'" class="ctrl" @tap="$copy(increDetail.id)">复制</view>
 		    </view>
 		    <view class="row">
 		      <view class="label">下单时间</view>
@@ -196,7 +196,7 @@
               <view class="row">
                 <view class="label">工单编号</view>
                 <view class="value">{{ detail.id }}</view>
-                <view v-if="detail && detail.orderStatus !== 'DQD'" class="ctrl" @tap="$copy(detail.id)">复制</view>
+                <view v-if="detail && orderStatus_v !== 'DQD'" class="ctrl" @tap="$copy(detail.id)">复制</view>
               </view>
               <view class="row">
                 <view class="label">下单时间</view>
@@ -209,12 +209,12 @@
               <view class="row">
                 <view class="label">主工程师</view>
                 <view class="value">{{ detail.workerName }} {{ detail.workerMobile }}</view>
-                <view v-if="detail && detail.orderStatus !== 'DQD'" class="ctrl" @tap="$callPhone(detail.workerMobile)"><text class="iconfont icon-call"></text></view>
+                <view v-if="detail && orderStatus_v !== 'DQD'" class="ctrl" @tap="$callPhone(detail.workerMobile)"><text class="iconfont icon-call"></text></view>
               </view>
               <view class="row" v-for="(item, index) in detail.pgOrderWorkers.filter(o => !o.isMaster)" :key="index">
                 <view class="label">辅工程师</view>
                 <view class="value">{{ item.workerName }} {{ item.workerMobile }}</view>
-                <view v-if="detail && detail.orderStatus !== 'DQD'" class="ctrl" @tap="$callPhone(item.workerMobile)"><text class="iconfont icon-call"></text></view>
+                <view v-if="detail && orderStatus_v !== 'DQD'" class="ctrl" @tap="$callPhone(item.workerMobile)"><text class="iconfont icon-call"></text></view>
               </view>
               <view class="row">
                 <view class="label">下单渠道</view>
@@ -250,7 +250,7 @@
           <view class="feedback-container card">
             <view class="common-title2">
               <view class="title">过程反馈</view>
-              <view v-if="detail && detail.orderStatus !== 'DQD'" class="right" @tap="toFeedbackList">查看全部<text class="iconfont icon-jinru"></text>
+              <view v-if="detail && orderStatus_v !== 'DQD'" class="right" @tap="toFeedbackList">查看全部<text class="iconfont icon-jinru"></text>
               </view>
             </view>
             <view class="list" v-if="detail.lastOperator">
@@ -282,10 +282,10 @@
           </view>
 
           <!-- 完工信息 -->
-          <view class="info-container card mt30" v-if="detail && (detail.orderStatus == 'YWG' || detail.orderStatus == 'YJS')">
+          <view class="info-container card mt30" v-if="detail && (orderStatus_v == 'YWG' || orderStatus_v == 'YJS')">
             <view class="common-title2">
               <view class="title">完工信息</view>
-              <view v-if="detail && detail.orderStatus !== 'DQD'" class="right" @tap="toOverDetail">查看更多<text class="iconfont icon-jinru"></text></view>
+              <view v-if="detail && orderStatus_v !== 'DQD'" class="right" @tap="toOverDetail">查看更多<text class="iconfont icon-jinru"></text></view>
             </view>
             <view>
               <view class="row">
@@ -413,7 +413,7 @@
             <block v-if="item.settleNormType !== 'OTHER'">
               <view class="common-title2">
                 <view class="title">服务费用{{ index + 1 }}</view>
-                <view class="right">{{detail.orderStatus == 'YJS' ? '已结算' : '结算中'}}</view>
+                <view class="right">{{orderStatus_v == 'YJS' ? '已结算' : '结算中'}}</view>
               </view>
               <view>
                 <view class="row">
@@ -438,7 +438,7 @@
                 </view>
                 <view class="row">
                   <view class="label">结算金额</view>
-                  <view class="value" v-if="detail.orderStatus == 'YJS'">¥{{ item.workerSettleAmount | priceFilter }}</view>
+                  <view class="value" v-if="orderStatus_v == 'YJS'">¥{{ item.workerSettleAmount | priceFilter }}</view>
                   <view class="value" v-else>-</view>
                 </view>
               </view>
@@ -446,7 +446,7 @@
             <block v-else>
               <view class="common-title2">
                 <view class="title">其他费用</view>
-                <view class="right">{{detail.orderStatus == 'YJS' ? '已结算' : '结算中'}}</view>
+                <view class="right">{{orderStatus_v == 'YJS' ? '已结算' : '结算中'}}</view>
               </view>
               <view>
                 <view class="row">
@@ -467,7 +467,7 @@
                 </view>
                 <view class="row">
                   <view class="label">结算金额</view>
-                  <view class="value" v-if="detail.orderStatus == 'YJS'">¥{{ item.workerSettleAmount | priceFilter }}</view>
+                  <view class="value" v-if="orderStatus_v == 'YJS'">¥{{ item.workerSettleAmount | priceFilter }}</view>
                   <view class="value" v-else>-</view>
                 </view>
               </view>
@@ -485,22 +485,22 @@
         <view class="bottom-container">
           <view class="left" style="width:100%" v-if="detail">
             <!-- 待抢单 -->
-            <block v-if="detail.orderStatus == 'DQD'">
+            <block v-if="orderStatus_v == 'DQD'">
               <u-button type="primary" text="抢单" @tap="qdOrder(detail)"></u-button>
             </block>
           </view>
           <view class="right" v-if="detail">
             <!-- 待接单 -->
-            <block v-if="detail.orderStatus == 'DJD'">
-              <u-button plain type="primary" text="配件申请" @tap="" v-if="detail.orderType != 'INSTALL'" @tap="toPartsApply()"></u-button>
+            <block v-if="orderStatus_v == 'DJD'">
+              <u-button plain type="primary" text="配件申请"  v-if="detail.orderType != 'INSTALL'" @tap="toPartsApply()"></u-button>
               <u-button plain type="primary" text="取消加急" @tap="actionUrgent(false)"
                 v-if="detail.pgOrderFlags && detail.pgOrderFlags.some((o) => o.tag == 'JIA_JI')"></u-button>
               <u-button plain type="primary" text="加急" @tap="actionUrgent(true)" v-else></u-button>
               <u-button type="primary" text="接单" @tap="actionReceive()"></u-button>
             </block>
             <!-- 服务中 -->
-            <block v-if="detail.orderStatus == 'FWZ' || detail.orderStatus == 'YCD'">
-              <u-button plain type="primary" text="配件申请" @tap="" v-if="detail.orderType != 'INSTALL'" @tap="toPartsApply()"></u-button>
+            <block v-if="orderStatus_v == 'FWZ' || orderStatus_v == 'YCD'">
+              <u-button plain type="primary" text="配件申请"  v-if="detail.orderType != 'INSTALL'" @tap="toPartsApply()"></u-button>
               <u-button plain type="primary" text="辅材收费" @tap="toCharge('M')"
                 v-if="detail.orderType == 'INSTALL'"></u-button>
               <u-button plain type="primary" text="配件收费" @tap="toCharge('P')" v-else></u-button>
@@ -581,6 +581,43 @@ export default {
     };
   },
 
+  computed:{
+    orderStatus_v(){
+      if (["DYY"].includes(this?.detail?.orderStatus)) {
+        // 待预约
+        return "DYY"
+      } else if (["DQD"].includes(this?.detail?.orderStatus)) {
+        // 待抢单
+        return "DQD"
+      } else if (["DSHPG", "CJ", "YPD", "DXSPD", "DZBPG", "DWDSPGP", "DXSSPGP", "DTJXSSPGP", "DZBSPGP", "DFZXPD", "DFZXSPGP", 'XSBH', "TJXSBH", "ZBBH", "FZXBH", "FL"].includes(this?.detail?.orderStatus)) {
+        // 待商户派工
+        return "DSHPG"
+      } else if (["DWDPG", "DWDPD", "WDBH"].includes(this?.detail?.orderStatus)) {
+        // 待网点派工
+        return "DWDPG"
+      } else if (["DJD", "DSM", "YZP"].includes(this?.detail?.orderStatus)) {
+        // 待接单
+        return "DJD"
+      } else if (["FWZ", "GCSZT", "BFWG"].includes(this?.detail?.orderStatus)) {
+        // 服务中
+        return "FWZ"
+      } else if (["YCD"].includes(this?.detail?.orderStatus)) {
+        // 异常单
+        return "YCD"
+      } else if (["YWG", "GCSZX", "WDWG", "YWGO"].includes(this?.detail?.orderStatus)) {
+        // 已完工待结算
+        return "YWG"
+      } else if (["YJS", "LRCD"].includes(this?.detail?.orderStatus)) {
+        // 已结算
+        return "YJS"
+      } else if (["YQX", "FWZT", "YCGB", "FWQX"].includes(this?.detail?.orderStatus)) {
+        // 已取消
+        return "YQX"
+      }
+      return ""
+    }
+  },
+
   async onLoad({ id, behavior }) {
     this.id = id;
     this.behavior = behavior
@@ -634,7 +671,7 @@ export default {
           orderBaseId: this.id,
         }).then((res) => {
           this.detail = res.data;
-          if(this.behavior === "lqdd" && res.data.orderStatus !== "DQD" && res.data.workerId !== this.$store.state.user.userId){
+          if(this.behavior === "lqdd" && !["DQD"].includes(res.data.orderStatus) && res.data.workerId !== this.$store.state.user.userId){
             this.$modal({
               title: '提示',
               content: '来晚啦,工单已经被抢走了~',
@@ -727,7 +764,7 @@ export default {
           orderId: this.id,
         }).then(res => {
           this.settleList = res.data;
-          if(this.settleList.length > 0 && this.detail.orderStatus == 'YJS') {
+          if(this.settleList.length > 0 && this.orderStatus_v == 'YJS') {
             this.tabList[3].name = `员工结算(${this.settleList.reduce((total, obj) => total + obj.workerSettleAmount, 0)})`
           }else {
             this.tabList[3].name = `员工结算`

+ 40 - 6
src/packageWorkorder/pages/orderList.vue

@@ -73,7 +73,7 @@
                   <view class="val">{{ item.userName }} {{ item.userMobile }}</view>
                   <view class="num" v-if="item.customerTotalNum > 0">
                     (共<text>{{ item.customerSortNum || 0 }}</text>/{{ item.customerTotalNum || 0 }}单)</view>
-                  <view class="fun" v-if="item.orderStatus !== 'DQD'" @tap.stop="$callPhone(item.userMobile)">
+                  <view class="fun" v-if="orderStatus_v(item.orderStatus) !== 'DQD'" @tap.stop="$callPhone(item.userMobile)">
                     <text class="iconfont icon-call"></text>
                     <view class="text">联系Ta</view>
                   </view>
@@ -84,7 +84,7 @@
                 <view class="label">服务地址</view>
                 <view class="value">
                   <view class="val address ellipsis-3">{{ item.address || item.gpsAddress }}</view>
-                  <view class="fun" v-if="item.orderStatus !== 'DQD'" @tap.stop="
+                  <view class="fun" v-if="orderStatus_v(item.orderStatus) !== 'DQD'" @tap.stop="
                     $openLocation({
                       lat: item.lat,
                       lng: item.lng,
@@ -99,7 +99,7 @@
             </view>
             <view class="item-btn" @tap.stop>
               <!-- 待接单 -->
-              <block v-if="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>
@@ -107,15 +107,15 @@
                 <u-button type="primary" text="接单" @tap="actionReceive(item.id)"></u-button>
               </block>
               <!-- 服务中 -->
-              <block v-if="item.orderStatus == 'FWZ' || item.orderStatus == 'YCD'">
-                <u-button plain type="primary" text="配件申请" @tap="" v-if="item.orderType != 'INSTALL'" @tap="toPartsApply(item.id)"></u-button>
+              <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="配件收费" @tap="toCharge(item.id, 'P')" v-else></u-button>
                 <u-button type="primary" text="过程反馈" @tap="toFeedback(item.id)"></u-button>
               </block>
               <!-- 待抢单 -->
-              <block v-if="item.orderStatus == 'DQD'">
+              <block v-if="orderStatus_v(item.orderStatus) == 'DQD'">
                 <u-button type="primary" text="抢单" @tap="qdOrder(item)"></u-button>
               </block>
             </view>
@@ -209,6 +209,40 @@ export default {
   },
 
   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", '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 ""
+    },
     // 触发下拉刷新
     async refresherrefresh(e) {
       this.refresherTriggered = true;

+ 38 - 2
src/packageWorkorder/pages/search.vue

@@ -85,13 +85,13 @@
         </view>
         <view class="item-btn" @tap.stop>
           <!-- 待接单 -->
-          <block v-if="item.orderStatus == 'DJD'">
+          <block v-if="orderStatus_v(item.orderStatus) == 'DJD'">
             <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 type="primary" text="接单" @tap="actionReceive(item.id)"></u-button>
           </block>
             <!-- 服务中 -->
-          <block v-if="item.orderStatus == 'FWZ' || item.orderStatus == 'YCD'">
+          <block v-if="orderStatus_v(item.orderStatus) == 'FWZ' || orderStatus_v(item.orderStatus) == 'YCD'">
             <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 type="primary" text="过程反馈" @tap="toFeedback(item.id)"></u-button>
@@ -132,6 +132,42 @@
     },
 
     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", '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 ""
+      },
+
       getList() {
       	this.loadStatus = 1;
       	this.$api.post('/pg/order/base/list', {

+ 37 - 3
src/packageWorkorder/pages/userWorkorderDetail.vue

@@ -16,7 +16,7 @@
 			<view class="detail-container">
 				<view class="top-container">
 					<view class="title">服务流程</view>
-					<u-steps :current="detail.serviceFlag" activeColor="#3D8FFD" v-if="detail.orderStatus !== 'YQX'">
+					<u-steps :current="detail.serviceFlag" activeColor="#3D8FFD" v-if="orderStatus_v(detail.orderStatus) !== 'YQX'">
 						<u-steps-item title="提单"></u-steps-item>
 						<u-steps-item title="派工"></u-steps-item>
 						<u-steps-item title="服务"></u-steps-item>
@@ -181,6 +181,40 @@
     },
 
 		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", '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 ""
+      },
 			// 获取详情
 			async getDetail() {
 				return new Promise((resolve, reject) => {
@@ -214,7 +248,7 @@
                 content: `预约时间:${data.appointmentTime.slice(0, 10)}`
               })
             }
-            if(data.orderStatus == 'YWG' || data.orderStatus == 'YJS') {
+            if(this.orderStatus_v(data.orderStatus)  == 'YWG' || this.orderStatus_v(data.orderStatus) == 'YJS') {
               list.unshift({
                 title: '服务完成',
                 time: data.overTime,
@@ -233,7 +267,7 @@
                 content: `评价结果:${MAP[data.appraiseStatus]}`
               })
             }
-            if(data.orderStatus == 'YQX') {
+            if(this.orderStatus_v(data.orderStatus) == 'YQX') {
               list.unshift({
                 title: '取消工单',
                 time: data.lastOperatorTime,

+ 44 - 8
src/packageWorkorder/pages/userWorkorderList.vue

@@ -61,21 +61,21 @@
         </view>
 
         <!-- 按钮:待预约 -->
-        <view class="btn-group" v-if="item.orderStatus === 'DYY'">
+        <view class="btn-group" v-if="orderStatus_v(item.orderStatus) === 'DYY'">
           <div class="button red" @tap.stop="toBook(item.id, 1)">立即预约</div>
         </view>
         <!-- 按钮:服务中 -->
-        <view class="btn-group" v-else-if="item.orderStatus === 'FWZ'">
+        <view class="btn-group" v-else-if="orderStatus_v(item.orderStatus) === 'FWZ'">
           <div class="button red" @tap.stop="toBook(item.id, 2)">改约</div>
         </view>
         <!-- 按钮:待评价 -->
-        <view class="btn-group" v-else-if="item.orderStatus === 'YWG' || 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="item.orderStatus === 'YWG' || 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>
@@ -138,6 +138,42 @@
     },
 
     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", '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 ""
+      },
+
       async getList() {
         return new Promise((resolve, reject) => {
           this.$api.post('/pg/order/base/list2', {
@@ -183,13 +219,13 @@
       },
 
       getStatus(item) {
-        if(item.orderStatus == 'DYY') {
+        if(this.orderStatus_v(item.orderStatus) == 'DYY') {
           return '待预约'
-        }else if(item.orderStatus == 'FWZ') {
+        }else if(this.orderStatus_v(item.orderStatus) == 'FWZ') {
           return '服务中'
-        }else if((item.orderStatus == 'YWG' || item.orderStatus == 'YJS') && item.appraiseStatus == 'N') {
+        }else if((this.orderStatus_v(item.orderStatus) == 'YWG' || this.orderStatus_v(item.orderStatus) == 'YJS') && item.appraiseStatus == 'N') {
           return '待评价'
-        }else if((item.orderStatus == 'YWG' || item.orderStatus == 'YJS') && item.appraiseStatus != 'N') {
+        }else if((this.orderStatus_v(item.orderStatus) == 'YWG' || this.orderStatus_v(item.orderStatus) == 'YJS') && item.appraiseStatus != 'N') {
           return '已完成'
         }
       },