浏览代码

no message

linwenxin 5 月之前
父节点
当前提交
2e7b4834dc
共有 3 个文件被更改,包括 186 次插入69 次删除
  1. 60 5
      src/components/selectionWorkers.vue
  2. 72 27
      src/packageWorkorder/pages/orderDetail.vue
  3. 54 37
      src/packageWorkorder/pages/orderList.vue

+ 60 - 5
src/components/selectionWorkers.vue

@@ -4,15 +4,15 @@
       <view class="title">接收确认</view>
       <view class="row">
         <view class="label">客户名称:</view>
-        <view class="value">¥111111</view>
+        <view class="value">{{ detail.userName }}</view>
       </view>
       <view class="row">
         <view class="label">客户电话:</view>
-        <view class="value">1111111</view>
+        <view class="value">{{ detail.userMobile }}</view>
       </view>
       <view class="row">
         <view class="label">客户地址:</view>
-        <view class="value">111111</view>
+        <view class="value">{{ detail.address }}</view>
       </view>
       <view class="row">
         <view class="label">选择小工:</view>
@@ -47,6 +47,10 @@ export default {
     type: {
       type: [String, Number],
       default: 0
+    },
+    callback: {
+      type: Function,
+      default: () => {}
     }
   },
   data() {
@@ -66,7 +70,7 @@ export default {
             orderBaseId: this?.detail?.id
           })
           .then(res => {
-            this.workerList = res.data.records
+            this.workerList = res.data
           })
       }
     },
@@ -74,7 +78,58 @@ export default {
       this.checkboxValues = v.target.value
     },
     querenss() {
-      console.log(this.checkboxValues)
+      if (this.type == 1) {
+        // 接单
+        this.$modal({
+          title: '接单确认',
+          content: '确认接单?'
+        })
+          .then(() => {
+            this.$api
+              .post('/pg/order/base/rece', {
+                orderBaseId: this.detail.id,
+                workerList: this.checkboxValues.join(',')
+              })
+              .then(res => {
+                this.callback?.()
+              })
+          })
+          .catch(() => {})
+      } else if (this.type == 2) {
+        // 抢单
+        this.$modal({
+          title: '抢单确认',
+          content: '确认抢单?'
+        })
+          .then(() => {
+            this.$api
+              .post('/pg/order/base/qd', {
+                orderBaseId: this.detail.id,
+                workerList: this.checkboxValues.join(',')
+              })
+              .then(res => {
+                this.callback?.()
+              })
+          })
+          .catch(() => {})
+      } else if (this.type == 3) {
+        // 更换
+        this.$modal({
+          title: '更换小工确认',
+          content: '确认更换?'
+        })
+          .then(() => {
+            this.$api
+              .post('/pg/order/base/change/slave/worker/team', {
+                orderBaseId: this.detail.id,
+                workerList: this.checkboxValues.join(',')
+              })
+              .then(res => {
+                this.callback?.()
+              })
+          })
+          .catch(() => {})
+      }
     }
   }
 }

+ 72 - 27
src/packageWorkorder/pages/orderDetail.vue

@@ -621,6 +621,7 @@
             </block>
             <!-- 服务中 -->
             <block v-if="orderStatus_v == 'FWZ' || orderStatus_v == 'YCD'">
+              <u-button plain type="primary" text="变更小工" @tap="biangengxiaogong()"></u-button>
               <u-button
                 plain
                 type="primary"
@@ -642,7 +643,7 @@
         </view>
       </template>
     </zj-page-layout>
-
+    <selectionWorkers v-if="item" :detail="item" :type="selectionWorkersType" :callback="callback" />
     <u-popup :show="isShowFeedback" @close="isShowFeedback = false" closeable round="10">
       <view class="feedback-dialog">
         <view class="title">服务路由</view>
@@ -657,11 +658,12 @@
 <script>
 import zjDialogPicker from '@/components/zj-dialog/zj-dialog-picker.vue'
 import Logistics from '@/components/logistics2/common-logistics.vue'
-
+import selectionWorkers from '@/components/selectionWorkers.vue'
 export default {
   components: {
     zjDialogPicker,
-    Logistics
+    Logistics,
+    selectionWorkers
   },
 
   filters: {
@@ -709,7 +711,10 @@ export default {
 
       isShowFeedback: false,
       feedbackList: [],
-      behavior: ''
+      behavior: '',
+      selectionWorkersType: '',
+      item: null,
+      callback: null
     }
   },
 
@@ -1004,16 +1009,75 @@ export default {
         .catch(() => {})
     },
 
+    // 变更小工
+    biangengxiaogong() {
+      this.selectionWorkersType = 3
+      this.item = { ...this.detail }
+      this.callback = () => {
+        this.$successToast()
+        this.getDetail()
+        this.crossPage.$emit('refreshWorkorderList', '')
+        this.$nextTick(() => {
+          this.item = null
+          this.selectionWorkersType = null
+          this.callback = null
+        })
+      }
+    },
+
     // 接单
     actionReceive() {
+      this.selectionWorkersType = 1
+      this.item = { ...this.detail }
+      this.callback = () => {
+        this.$successToast()
+        this.getDetail()
+        this.crossPage.$emit('refreshWorkorderList', '')
+        this.$nextTick(() => {
+          this.item = null
+          this.selectionWorkersType = null
+          this.callback = null
+        })
+      }
+      // this.$modal({
+      //   title: '接单确认',
+      //   content: '确认接单?'
+      // })
+      //   .then(() => {
+      //     this.$api
+      //       .post('/pg/order/base/rece', {
+      //         orderBaseId: this.id
+      //       })
+      //       .then(res => {
+      //         this.$successToast()
+      //         this.getDetail()
+      //         this.crossPage.$emit('refreshWorkorderList', '')
+      //       })
+      //   })
+      //   .catch(() => {})
+    },
+
+    qdOrder(item) {
+      // this.selectionWorkersType = 2
+      // this.item = { ...item }
+      // this.callback = () => {
+      //   this.$successToast()
+      //   this.getDetail()
+      //   this.crossPage.$emit('refreshWorkorderList', '')
+      //   this.$nextTick(() => {
+      //     this.item = null
+      //     this.selectionWorkersType = null
+      //     this.callback = null
+      //   })
+      // }
       this.$modal({
-        title: '接单确认',
-        content: '确认接单?'
+        title: '单确认',
+        content: '确认单?'
       })
         .then(() => {
           this.$api
-            .post('/pg/order/base/rece', {
-              orderBaseId: this.id
+            .post('/pg/order/base/qd', {
+              orderBaseId: item.id
             })
             .then(res => {
               this.$successToast()
@@ -1063,25 +1127,6 @@ export default {
       this.$navToPage({
         url: `/packageWorkorder/pages/overDetail?id=${this.id}`
       })
-    },
-
-    qdOrder(item) {
-      this.$modal({
-        title: '抢单确认',
-        content: '确认抢单?'
-      })
-        .then(() => {
-          this.$api
-            .post('/pg/order/base/qd', {
-              orderBaseId: item.id
-            })
-            .then(res => {
-              this.$successToast()
-              this.getDetail()
-              this.crossPage.$emit('refreshWorkorderList', '')
-            })
-        })
-        .catch(() => {})
     }
   }
 }

+ 54 - 37
src/packageWorkorder/pages/orderList.vue

@@ -148,16 +148,11 @@
                   @tap="actionUrgent(item.id, true)"
                   v-else-if="!item.isImportExcel"
                 ></u-button>
-                <u-button
-                  v-if="!item.isImportExcel"
-                  type="primary"
-                  text="接单"
-                  @tap="actionReceive(item.id)"
-                ></u-button>
+                <u-button v-if="!item.isImportExcel" type="primary" text="接单" @tap="actionReceive(item)"></u-button>
               </block>
               <!-- 服务中 -->
               <block v-if="orderStatus_v(item.orderStatus) == 'FWZ' || orderStatus_v(item.orderStatus) == 'YCD'">
-                <u-button plain type="primary" text="变更小工" @tap="biangengxiaogong(item.id)"></u-button>
+                <u-button plain type="primary" text="变更小工" @tap="biangengxiaogong(item)"></u-button>
                 <u-button
                   plain
                   type="primary"
@@ -193,7 +188,7 @@
     </zj-page-layout>
 
     <zj-dialog-dateRangePicker v-model="isShowDatePicker" @confirm="confirmDate"></zj-dialog-dateRangePicker>
-    <!-- <selectionWorkers /> -->
+    <selectionWorkers v-if="item" :detail="item" :type="selectionWorkersType" :callback="callback" />
   </view>
 </template>
 
@@ -244,7 +239,10 @@ export default {
       },
 
       isYb: false, // 是否延保单
-      isWb: false // 是否维保单
+      isWb: false, // 是否维保单
+      selectionWorkersType: '',
+      item: null,
+      callback: null
     }
   },
 
@@ -547,43 +545,49 @@ export default {
     },
 
     // 接单
-    actionReceive(id) {
-      this.$modal({
-        title: '接单确认',
-        content: '确认接单?'
-      })
-        .then(() => {
-          this.$api
-            .post('/pg/order/base/rece', {
-              orderBaseId: id
-            })
-            .then(res => {
-              this.$successToast()
-              this.refreshList()
-              this.toDetail(id)
-            })
+    actionReceive(item) {
+      this.selectionWorkersType = 1
+      this.item = { ...item }
+      this.callback = () => {
+        this.$successToast()
+        this.refreshList()
+        this.toDetail(item.id)
+        this.$nextTick(() => {
+          this.item = null
+          this.selectionWorkersType = null
+          this.callback = null
         })
-        .catch(() => {})
+      }
     },
 
-    // 去收费
-    toCharge(id, type) {
-      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}`
+    // 变更小工
+    biangengxiaogong(item) {
+      this.selectionWorkersType = 3
+      this.item = { ...item }
+      this.callback = () => {
+        this.$successToast()
+        this.refreshList()
+        this.toDetail(item.id)
+        this.$nextTick(() => {
+          this.item = null
+          this.selectionWorkersType = null
+          this.callback = null
         })
       }
     },
 
-    // 变更小工
-    biangengxiaogong() {},
-
     // 抢单
     qdOrder(item) {
+      // this.selectionWorkersType = 2
+      // this.item = { ...item }
+      // this.callback = () => {
+      //   this.$successToast()
+      //   this.refreshList()
+      //   this.toDetail(item.id)
+      //   this.item = null
+      //   this.selectionWorkersType = null
+      //   this.callback = null
+      // }
       this.$modal({
         title: '抢单确认',
         content: '确认抢单?'
@@ -602,6 +606,19 @@ export default {
         .catch(() => {})
     },
 
+    // 去收费
+    toCharge(id, type) {
+      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}`
+        })
+      }
+    },
+
     // 去配件申请
     toPartsApply(id) {
       this.$navToPage({