Bladeren bron

no message

linwenxin 5 maanden geleden
bovenliggende
commit
b3dc977b8f

+ 71 - 2
src/packageWorkorder/pages/orderDetail.vue

@@ -892,6 +892,9 @@ export default {
       return getStorage('user')
     },
     orderStatus_v() {
+      if (this?.detail?.isImportExcel && this?.detail?.isMeet === false) {
+        return 'DJD'
+      }
       if (['DYY'].includes(this?.detail?.orderStatus)) {
         // 待预约
         return 'DYY'
@@ -923,10 +926,10 @@ export default {
       } else if (['DWDPG', 'DWDPD', 'WDBH'].includes(this?.detail?.orderStatus)) {
         // 待网点派工
         return 'DWDPG'
-      } else if (['DJD', 'DSM', 'YZP'].includes(this?.detail?.orderStatus)) {
+      } else if (['DJD'].includes(this?.detail?.orderStatus)) {
         // 待接单
         return 'DJD'
-      } else if (['FWZ', 'GCSZT', 'BFWG'].includes(this?.detail?.orderStatus)) {
+      } else if (['FWZ', 'GCSZT', 'BFWG', 'DSM', 'YZP'].includes(this?.detail?.orderStatus)) {
         // 服务中
         return 'FWZ'
       } else if (['YCD'].includes(this?.detail?.orderStatus)) {
@@ -1087,6 +1090,72 @@ export default {
           })
           .then(res => {
             this.detail = res.data
+            console.log(res.data)
+            console.log(
+              `
+工程师编号号: ${this.userInfo.workerNumber}
+网点属性(attr):  ${res.data.attr}
+工单类型(orderType):  ${res.data.orderType}
+是否4.0(isImportExcel):  ${res.data.isImportExcel}
+4.0是否已经接单(isMeet):  ${res.data.isMeet}
+原工单状态(orderStatus):  ${res.data.orderStatus}   ==>   复合状态对应:${(orderStatus => {
+                if (res.data?.isImportExcel && res.data?.isMeet === false) {
+                  return 'DJD'
+                }
+                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'].includes(orderStatus)) {
+                  // 待接单
+                  return 'DJD'
+                } else if (['FWZ', 'GCSZT', 'BFWG', 'DSM', 'YZP'].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 ''
+              })(res.data.orderStatus)}
+`
+            )
             if (
               this.behavior === 'lqdd' &&
               !['DQD'].includes(res.data.orderStatus) &&

+ 35 - 30
src/packageWorkorder/pages/orderList.vue

@@ -104,7 +104,7 @@
                   >
                   <view
                     class="fun"
-                    v-if="orderStatus_v(item.orderStatus) !== 'DQD'"
+                    v-if="orderStatus_v(item.orderStatus, item) !== 'DQD'"
                     @tap.stop="$callPhone(item.userMobile)"
                   >
                     <text class="iconfont icon-call"></text>
@@ -119,7 +119,7 @@
                   <view class="val address ellipsis-3">{{ item.address || item.gpsAddress }}</view>
                   <view
                     class="fun"
-                    v-if="orderStatus_v(item.orderStatus) !== 'DQD'"
+                    v-if="orderStatus_v(item.orderStatus, item) !== 'DQD'"
                     @tap.stop="
                       $openLocation({
                         lat: item.lat,
@@ -148,13 +148,13 @@
                   // ---------------
                   (!item.isImportExcel &&
                     item.attr == 'SELF' &&
-                    ['DYY', 'DJD'].includes(orderStatus_v(item.orderStatus)) &&
+                    ['DYY', 'DJD'].includes(orderStatus_v(item.orderStatus, item)) &&
                     (item.orderType == 'INSTALL' ? !!userInfo.workerNumber : true)) ||
                   // ---------------
                   (!item.isImportExcel &&
                     item.attr != 'SELF' &&
-                    (['DYY'].includes(orderStatus_v(item.orderStatus)) ||
-                      (['DJD'].includes(orderStatus_v(item.orderStatus))
+                    (['DYY'].includes(orderStatus_v(item.orderStatus, item)) ||
+                      (['DJD'].includes(orderStatus_v(item.orderStatus, item))
                         ? item.orderType == 'INSTALL'
                           ? !!userInfo.workerNumber
                           : true
@@ -171,10 +171,12 @@
                   // ---------------
                   (!item.isImportExcel &&
                     item.attr == 'SELF' &&
-                    ['DQD'].includes(orderStatus_v(item.orderStatus)) &&
+                    ['DQD'].includes(orderStatus_v(item.orderStatus, item)) &&
                     (item.orderType == 'INSTALL' ? !!userInfo.workerNumber : true)) ||
                   // ---------------
-                  (!item.isImportExcel && item.attr != 'SELF' && ['DQD'].includes(orderStatus_v(item.orderStatus)))
+                  (!item.isImportExcel &&
+                    item.attr != 'SELF' &&
+                    ['DQD'].includes(orderStatus_v(item.orderStatus, item)))
                 "
                 type="primary"
                 text="抢单"
@@ -187,16 +189,16 @@
                   // ---------------
                   ((item.isImportExcel &&
                     item.orderType != 'INSTALL' &&
-                    (['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus)) ||
-                      (['DQD', 'DJD', 'DSHPG', 'DWDPG'].includes(orderStatus_v(item.orderStatus)) &&
+                    (['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus, item)) ||
+                      (['DQD', 'DJD', 'DSHPG', 'DWDPG'].includes(orderStatus_v(item.orderStatus, item)) &&
                         !userInfo.workerNumber))) ||
                     // ---------------
                     (item.isImportExcel &&
                       item.orderType != 'INSTALL' &&
-                      ['YWG'].includes(orderStatus_v(item.orderStatus)) &&
+                      ['YWG'].includes(orderStatus_v(item.orderStatus, item)) &&
                       isTodayOrYesterday(item.overTime)) ||
                     // ---------------
-                    (!item.isImportExcel && ['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus)))) &&
+                    (!item.isImportExcel && ['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus, item)))) &&
                   (item.isImportExcel ? item.isMeet : true)
                 "
                 plain
@@ -210,16 +212,16 @@
                 v-if="
                   // ---------------
                   ((item.isImportExcel &&
-                    ['DYY', 'FWZ', 'YWG'].includes(orderStatus_v(item.orderStatus)) &&
+                    ['DYY', 'FWZ', 'YWG'].includes(orderStatus_v(item.orderStatus, item)) &&
                     (item.orderType == 'INSTALL' ? !!userInfo.workerNumber : true)) ||
                     // ---------------
                     (item.isImportExcel &&
-                      ['DQD', 'DJD', 'DSHPG', 'DWDPG'].includes(orderStatus_v(item.orderStatus)) &&
+                      ['DQD', 'DJD', 'DSHPG', 'DWDPG'].includes(orderStatus_v(item.orderStatus, item)) &&
                       item.orderType != 'INSTALL' &&
                       !userInfo.workerNumber) ||
                     // ---------------
                     (!item.isImportExcel &&
-                      ['DYY', 'FWZ', 'YWG'].includes(orderStatus_v(item.orderStatus)) &&
+                      ['DYY', 'FWZ', 'YWG'].includes(orderStatus_v(item.orderStatus, item)) &&
                       (item.orderType == 'INSTALL' ? !!userInfo.workerNumber : true))) &&
                   (item.isImportExcel ? item.isMeet : true)
                 "
@@ -237,23 +239,23 @@
                 @tap="toCharge(item.id, 'M')"
                 v-if="
                   ((item.isImportExcel &&
-                    ['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus)) &&
+                    ['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus, item)) &&
                     (item.orderType == 'INSTALL' ? !!userInfo.workerNumber : true)) ||
                     //----------
                     (item.isImportExcel &&
-                      ['DQD', 'DJD', 'DSHPG', 'DWDPG'].includes(orderStatus_v(item.orderStatus)) &&
+                      ['DQD', 'DJD', 'DSHPG', 'DWDPG'].includes(orderStatus_v(item.orderStatus, item)) &&
                       item.orderType != 'INSTALL' &&
                       !userInfo.workerNumber) ||
                     //----------
                     (!item.isImportExcel &&
-                      ['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus)) &&
+                      ['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus, item)) &&
                       !!userInfo.workerNumber) ||
                     //----------
                     (((item.isImportExcel &&
-                      ['YWG'].includes(orderStatus_v(item.orderStatus)) &&
+                      ['YWG'].includes(orderStatus_v(item.orderStatus, item)) &&
                       (item.orderType == 'INSTALL' ? !!userInfo.workerNumber : true)) ||
                       (!item.isImportExcel &&
-                        ['YWG'].includes(orderStatus_v(item.orderStatus)) &&
+                        ['YWG'].includes(orderStatus_v(item.orderStatus, item)) &&
                         !!userInfo.workerNumber)) &&
                       isTodayOrYesterday(item.overTime))) &&
                   (item.isImportExcel ? item.isMeet : true)
@@ -265,21 +267,21 @@
                 v-if="
                   ((item.isImportExcel &&
                     item.orderType != 'INSTALL' &&
-                    (['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus)) ||
-                      (['DQD', 'DJD', 'DSHPG', 'DWDPG'].includes(orderStatus_v(item.orderStatus)) &&
+                    (['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus, item)) ||
+                      (['DQD', 'DJD', 'DSHPG', 'DWDPG'].includes(orderStatus_v(item.orderStatus, item)) &&
                         !userInfo.workerNumber))) ||
                     //----------
                     (!item.isImportExcel &&
                       item.orderType != 'INSTALL' &&
-                      ['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus)) &&
+                      ['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus, item)) &&
                       !!userInfo.workerNumber) ||
                     //----------
                     (((item.isImportExcel &&
                       item.orderType != 'INSTALL' &&
-                      ['YWG'].includes(orderStatus_v(item.orderStatus))) ||
+                      ['YWG'].includes(orderStatus_v(item.orderStatus, item))) ||
                       (!item.isImportExcel &&
                         item.orderType != 'INSTALL' &&
-                        ['YWG'].includes(orderStatus_v(item.orderStatus)) &&
+                        ['YWG'].includes(orderStatus_v(item.orderStatus, item)) &&
                         !!userInfo.workerNumber)) &&
                       isTodayOrYesterday(item.overTime))) &&
                   (item.isImportExcel ? item.isMeet : true)
@@ -293,11 +295,11 @@
               <!-- 过程反馈 -->
               <u-button
                 v-if="
-                  (['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus)) ||
+                  (['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus, item)) ||
                     (item.isImportExcel &&
                       item.orderType != 'INSTALL' &&
                       !userInfo.workerNumber &&
-                      ['DQD', 'DJD', 'DSHPG', 'DWDPG'].includes(orderStatus_v(item.orderStatus)))) &&
+                      ['DQD', 'DJD', 'DSHPG', 'DWDPG'].includes(orderStatus_v(item.orderStatus, item)))) &&
                   (item.isImportExcel ? item.isMeet : true)
                 "
                 type="primary"
@@ -307,7 +309,7 @@
 
               <!-- ------------------------------------ -->
 
-              <!-- <block v-if="orderStatus_v(item.orderStatus) == 'DJD'">
+              <!-- <block v-if="orderStatus_v(item.orderStatus,item) == 'DJD'">
                 <u-button
                   plain
                   type="primary"
@@ -451,7 +453,10 @@ export default {
         inputDate.getDate() === today.getDate()
       )
     },
-    orderStatus_v(orderStatus) {
+    orderStatus_v(orderStatus, item) {
+      if (item?.isImportExcel && item?.isMeet === false) {
+        return 'DJD'
+      }
       if (['DYY'].includes(orderStatus)) {
         // 待预约
         return 'DYY'
@@ -483,10 +488,10 @@ export default {
       } else if (['DWDPG', 'DWDPD', 'WDBH'].includes(orderStatus)) {
         // 待网点派工
         return 'DWDPG'
-      } else if (['DJD', 'DSM', 'YZP'].includes(orderStatus)) {
+      } else if (['DJD'].includes(orderStatus)) {
         // 待接单
         return 'DJD'
-      } else if (['FWZ', 'GCSZT', 'BFWG'].includes(orderStatus)) {
+      } else if (['FWZ', 'GCSZT', 'BFWG', 'DSM', 'YZP'].includes(orderStatus)) {
         // 服务中
         return 'FWZ'
       } else if (['YCD'].includes(orderStatus)) {

+ 175 - 24
src/packageWorkorder/pages/search.vue

@@ -91,30 +91,175 @@
           </view>
         </view>
         <view class="item-btn" @tap.stop>
-          <!-- 待接单 -->
-          <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="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>
-          </block>
+          <!-- 接单 ok-->
+          <u-button
+            v-if="
+              // ---------------
+              (item.isImportExcel &&
+                !item.isMeet &&
+                item.attr == 'SELF' &&
+                (item.orderType == 'INSTALL' ? !!userInfo.workerNumber : true)) ||
+              // ---------------
+              (item.isImportExcel && !item.isMeet && item.attr != 'SELF') ||
+              // ---------------
+              (!item.isImportExcel &&
+                item.attr == 'SELF' &&
+                ['DYY', 'DJD'].includes(orderStatus_v(item.orderStatus, item)) &&
+                (item.orderType == 'INSTALL' ? !!userInfo.workerNumber : true)) ||
+              // ---------------
+              (!item.isImportExcel &&
+                item.attr != 'SELF' &&
+                (['DYY'].includes(orderStatus_v(item.orderStatus, item)) ||
+                  (['DJD'].includes(orderStatus_v(item.orderStatus, item))
+                    ? item.orderType == 'INSTALL'
+                      ? !!userInfo.workerNumber
+                      : true
+                    : false)))
+            "
+            type="primary"
+            text="接单"
+            @tap="actionReceive(item)"
+          ></u-button>
+
+          <!-- 待抢单 ok-->
+          <u-button
+            v-if="
+              // ---------------
+              (!item.isImportExcel &&
+                item.attr == 'SELF' &&
+                ['DQD'].includes(orderStatus_v(item.orderStatus, item)) &&
+                (item.orderType == 'INSTALL' ? !!userInfo.workerNumber : true)) ||
+              // ---------------
+              (!item.isImportExcel && item.attr != 'SELF' && ['DQD'].includes(orderStatus_v(item.orderStatus, item)))
+            "
+            type="primary"
+            text="抢单"
+            @tap="qdOrder(item)"
+          ></u-button>
+
+          <!-- 配件申请 -->
+          <u-button
+            v-if="
+              // ---------------
+              ((item.isImportExcel &&
+                item.orderType != 'INSTALL' &&
+                (['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus, item)) ||
+                  (['DQD', 'DJD', 'DSHPG', 'DWDPG'].includes(orderStatus_v(item.orderStatus, item)) &&
+                    !userInfo.workerNumber))) ||
+                // ---------------
+                (item.isImportExcel &&
+                  item.orderType != 'INSTALL' &&
+                  ['YWG'].includes(orderStatus_v(item.orderStatus, item)) &&
+                  isTodayOrYesterday(item.overTime)) ||
+                // ---------------
+                (!item.isImportExcel && ['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus, item)))) &&
+              (item.isImportExcel ? item.isMeet : true)
+            "
+            plain
+            type="primary"
+            text="配件申请"
+            @tap="toPartsApply(item.id)"
+          ></u-button>
+
+          <!-- 变更小工 -->
+          <u-button
+            v-if="
+              // ---------------
+              ((item.isImportExcel &&
+                ['DYY', 'FWZ', 'YWG'].includes(orderStatus_v(item.orderStatus, item)) &&
+                (item.orderType == 'INSTALL' ? !!userInfo.workerNumber : true)) ||
+                // ---------------
+                (item.isImportExcel &&
+                  ['DQD', 'DJD', 'DSHPG', 'DWDPG'].includes(orderStatus_v(item.orderStatus, item)) &&
+                  item.orderType != 'INSTALL' &&
+                  !userInfo.workerNumber) ||
+                // ---------------
+                (!item.isImportExcel &&
+                  ['DYY', 'FWZ', 'YWG'].includes(orderStatus_v(item.orderStatus, item)) &&
+                  (item.orderType == 'INSTALL' ? !!userInfo.workerNumber : true))) &&
+              (item.isImportExcel ? item.isMeet : true)
+            "
+            plain
+            type="primary"
+            text="变更小工"
+            @tap="biangengxiaogong(item)"
+          ></u-button>
+
+          <!-- 辅材收费 ok-->
+          <u-button
+            plain
+            type="primary"
+            text="辅材收费"
+            @tap="toCharge(item.id, 'M')"
+            v-if="
+              ((item.isImportExcel &&
+                ['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus, item)) &&
+                (item.orderType == 'INSTALL' ? !!userInfo.workerNumber : true)) ||
+                //----------
+                (item.isImportExcel &&
+                  ['DQD', 'DJD', 'DSHPG', 'DWDPG'].includes(orderStatus_v(item.orderStatus, item)) &&
+                  item.orderType != 'INSTALL' &&
+                  !userInfo.workerNumber) ||
+                //----------
+                (!item.isImportExcel &&
+                  ['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus, item)) &&
+                  !!userInfo.workerNumber) ||
+                //----------
+                (((item.isImportExcel &&
+                  ['YWG'].includes(orderStatus_v(item.orderStatus, item)) &&
+                  (item.orderType == 'INSTALL' ? !!userInfo.workerNumber : true)) ||
+                  (!item.isImportExcel &&
+                    ['YWG'].includes(orderStatus_v(item.orderStatus, item)) &&
+                    !!userInfo.workerNumber)) &&
+                  isTodayOrYesterday(item.overTime))) &&
+              (item.isImportExcel ? item.isMeet : true)
+            "
+          ></u-button>
+
+          <!-- 配件收费 -->
+          <u-button
+            v-if="
+              ((item.isImportExcel &&
+                item.orderType != 'INSTALL' &&
+                (['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus, item)) ||
+                  (['DQD', 'DJD', 'DSHPG', 'DWDPG'].includes(orderStatus_v(item.orderStatus, item)) &&
+                    !userInfo.workerNumber))) ||
+                //----------
+                (!item.isImportExcel &&
+                  item.orderType != 'INSTALL' &&
+                  ['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus, item)) &&
+                  !!userInfo.workerNumber) ||
+                //----------
+                (((item.isImportExcel &&
+                  item.orderType != 'INSTALL' &&
+                  ['YWG'].includes(orderStatus_v(item.orderStatus, item))) ||
+                  (!item.isImportExcel &&
+                    item.orderType != 'INSTALL' &&
+                    ['YWG'].includes(orderStatus_v(item.orderStatus, item)) &&
+                    !!userInfo.workerNumber)) &&
+                  isTodayOrYesterday(item.overTime))) &&
+              (item.isImportExcel ? item.isMeet : true)
+            "
+            plain
+            type="primary"
+            text="配件收费"
+            @tap="toCharge(item.id, 'P')"
+          ></u-button>
+
+          <!-- 过程反馈 -->
+          <u-button
+            v-if="
+              (['DYY', 'FWZ'].includes(orderStatus_v(item.orderStatus, item)) ||
+                (item.isImportExcel &&
+                  item.orderType != 'INSTALL' &&
+                  !userInfo.workerNumber &&
+                  ['DQD', 'DJD', 'DSHPG', 'DWDPG'].includes(orderStatus_v(item.orderStatus, item)))) &&
+              (item.isImportExcel ? item.isMeet : true)
+            "
+            type="primary"
+            text="过程反馈"
+            @tap="toFeedback(item.id)"
+          ></u-button>
         </view>
       </view>
     </view>
@@ -152,6 +297,12 @@ export default {
 	// this.getList();
   },
 
+  computed: {
+    userInfo() {
+      return getStorage('user')
+    }
+  },
+
   methods: {
 
     orderStatus_v(orderStatus){