Explorar o código

feat:訂單模塊

storeBelieveInLight hai 1 ano
pai
achega
e027ac2ed4

+ 23 - 0
commit/order.js

@@ -168,4 +168,27 @@ export function refundorderDetailApi(id) {
168 168
         method: 'GET',
169 169
         apiType
170 170
     })
171
+}
172
+
173
+/**
174
+ * @description 退款订单
175
+ */
176
+export function confirmRefundOrderApi(id, data) {
177
+     return myRequest({
178
+         url: `${pre}mer/store/refundorder/status/${id}`,
179
+         data,
180
+         method: 'POST',
181
+         apiType
182
+     })
183
+}
184
+/**
185
+ * @description 退款订单 -- 确认收货
186
+ */
187
+export function confirmReceiptApi(id, data) {
188
+     return myRequest({
189
+         url: `${pre}mer/store/refundorder/refund/${id}`,
190
+         data,
191
+         method: 'POST',
192
+         apiType
193
+     })
171 194
 }

+ 3 - 3
shop/afterSalesManagement/afterCardListInfo.vue

@@ -1,11 +1,11 @@
1 1
 <template>
2 2
   <view class="details-xiangqing">
3 3
     <view class="details-xiangqing-top">
4
-      <view class="details-xiangqing-top-let" v-if="detailItem.order">
4
+      <view class="details-xiangqing-top-let" v-if="detailItem.order&&detailItem.order.mer_avatar">
5 5
         <image :src="detailItem.order.mer_avatar" mode="widthFix" v-if="detailItem.order.mer_avatar"></image>
6 6
       </view>
7 7
       <view class="details-xiangqing-top-in" v-if="detailItem.order">
8
-        {{ detailItem.order.order_sn }}
8
+        {{ detailItem.refund_order_sn }}
9 9
       </view>
10 10
       <view class="details-xiangqing-top-rigt">
11 11
         <uni-icons
@@ -48,7 +48,7 @@
48 48
       </view>
49 49
 
50 50
       <view class="brn-ligd">
51
-        <view class="btn-cls" @click="viewWuLiu(detailItem)"> 查看物流 </view>
51
+        <view class="btn-cls" @click="viewWuLiu(detailItem)" v-if="detailItem&&detailItem.delivery_id"> 查看物流 </view>
52 52
         <view class="btn-cls" @click="viewDetail(detailItem)"> 查看详情 </view>
53 53
       </view>
54 54
 

+ 271 - 17
shop/afterSalesManagement/afterSalesDetail.vue

@@ -64,8 +64,8 @@
64 64
       <!-- 物流信息卡片  1、退货退款成功   2、退货退款失败 3、退货中 -->
65 65
       <view
66 66
         class="afterdetails-back mb-26"
67
-        @click="handleWUliu"
68
-        v-if="!storeRefundOrder && storeRefundOrder.delivery_id"
67
+        @click="handleWUliu(storeRefundOrder)"
68
+        v-if="storeRefundOrder && storeRefundOrder.delivery_id"
69 69
       >
70 70
         <view class="back-tile">买家退货物流</view>
71 71
         <view class="back-bttom">
@@ -157,11 +157,104 @@
157 157
           ></uni-icons>
158 158
         </view>
159 159
         <view class="popup_data__content">
160
-          <uni-easyinput type="textarea" autoHeight  placeholder="请输入拒绝原因,500字以内" v-model="refundData.fail_message" ></uni-easyinput>
161
-           </view>
162
-        <button type="primary" class="send-goods" @click="handleConfirm">
163
-          提交
164
-        </button>
160
+          <!-- 1.同意 -1.拒绝 2.部分退款 -->
161
+          <!-- 拒绝只用输入框  -1.拒绝-->
162
+          <uni-section
163
+            title="拒绝原因:"
164
+            type="line"
165
+            padding
166
+            v-if="refundData.status == -1"
167
+          >
168
+            <uni-easyinput
169
+              type="textarea"
170
+              autoHeight
171
+              :focus="true"
172
+              :maxlength="500"
173
+              placeholder="请输入拒绝原因,500字以内"
174
+              v-model="refundData.fail_message"
175
+            ></uni-easyinput>
176
+          </uni-section>
177
+
178
+          <!-- 1.同意 -->
179
+          <!-- refundData.status == 1 &&storeRefundOrder.refund_type == 2 &&storeRefundOrder.status == 0  -->
180
+          <template
181
+            v-if="
182
+              refundData.status == 1 &&
183
+              storeRefundOrder.refund_type == 2 &&
184
+              storeRefundOrder.status == 0
185
+            "
186
+          >
187
+            <!-- 收货人姓名 -->
188
+            <uni-section title="收货人姓名:" type="line" padding>
189
+              <uni-easyinput
190
+                v-model="refundData.mer_refund_user"
191
+                placeholder="请输入收货人姓名"
192
+              ></uni-easyinput>
193
+            </uni-section>
194
+            <!-- 收货人地址 -->
195
+            <uni-section title="收货人地址:" type="line" padding>
196
+              <uni-easyinput
197
+                v-model="refundData.mer_refund_address"
198
+                placeholder="请输入收货人地址"
199
+              ></uni-easyinput>
200
+            </uni-section>
201
+            <!-- 收货人电话 -->
202
+            <uni-section title="收货人电话:" type="line" padding>
203
+              <uni-easyinput
204
+                v-model="refundData.set_phone"
205
+                placeholder="请输入收货人电话"
206
+              ></uni-easyinput>
207
+            </uni-section>
208
+          </template>
209
+          <!-- 2.部分退款 -->
210
+          <!--退款金额 refundData.part_refund_price  refundData.status == 2   小于等于订单支付金额   tips:请确保已跟用户协商同意!-->
211
+          <!-- 商家备注 refundData.status == 2  refundData.part_refund_message   -->
212
+          <template v-if="refundData.status == 2">
213
+            <uni-section
214
+              title="退款金额:"
215
+              type="line"
216
+              padding
217
+              subTitle="请确保已跟用户协商同意!"
218
+            >
219
+              <uni-easyinput
220
+                errorMessage
221
+                v-model="refundData.part_refund_price"
222
+                focus
223
+                placeholder="小于等于订单支付金额"
224
+                type="digit"
225
+              ></uni-easyinput>
226
+            </uni-section>
227
+            <uni-section title="商家备注:" type="line" padding>
228
+              <uni-easyinput
229
+                type="textarea"
230
+                autoHeight
231
+                :focus="true"
232
+                :maxlength="500"
233
+                placeholder="请输入备注,500字以内"
234
+                v-model="refundData.part_refund_message"
235
+              ></uni-easyinput>
236
+            </uni-section>
237
+          </template>
238
+        </view>
239
+
240
+        <view class="btn-lixt">
241
+          <button
242
+            v-if="storeRefundOrder.status == 0 && douhuomall != 1"
243
+            type="primary"
244
+            class="send-goods"
245
+            @click="handleConfirm"
246
+          >
247
+            确 定
248
+          </button>
249
+          <button
250
+            v-if="storeRefundOrder.status == 2 && douhuomall != 1"
251
+            type="primary"
252
+            class="send-goods"
253
+            @click="handleconfirmReceipt(storeRefundOrder.refund_order_id)"
254
+          >
255
+            确 定
256
+          </button>
257
+        </view>
165 258
       </view>
166 259
     </uni-popup>
167 260
   </view>
@@ -171,7 +264,12 @@
171 264
 import headersVue from "../components/headers/headers.vue";
172 265
 import afterCardDetail from "./afterCardDetail.vue";
173 266
 import { toQueryString } from "@/utils/index.js";
174
-import { orderDetailApi, refundorderDetailApi } from "@/commit/order.js";
267
+import {
268
+  orderDetailApi,
269
+  refundorderDetailApi,
270
+  confirmRefundOrderApi,
271
+  confirmReceiptApi,
272
+} from "@/commit/order.js";
175 273
 import {
176 274
   orderRefundFilterText,
177 275
   orderRefundText,
@@ -212,6 +310,12 @@ export default {
212 310
     }
213 311
   },
214 312
   methods: {
313
+    async initData() {
314
+      await this.getRefundOrderDetails();
315
+      if (this.refund_order_id) {
316
+        await this.getAfterSaleListData(this.refund_order_id);
317
+      }
318
+    },
215 319
     open(type = "bottom") {
216 320
       this.$refs.popup.open(type);
217 321
     },
@@ -219,20 +323,151 @@ export default {
219 323
       this.close();
220 324
     },
221 325
     close() {
326
+      const data = this.storeRefundOrder.mer || {};
222 327
       this.refundData = {
223 328
         status: 1, // 1.同意 -1.拒绝 2.部分退款
224 329
         fail_message: "",
225 330
         part_refund_price: "",
226 331
         part_refund_message: "",
227
-        mer_refund_user: "",
228
-        mer_refund_address: "",
229
-        set_phone: "",
332
+        mer_refund_user: data.mer_refund_user,
333
+        mer_refund_address: data.mer_refund_address,
334
+        set_phone: data.set_phone,
230 335
       };
336
+
231 337
       this.popUpTitle = "";
232 338
       this.$refs.popup.close();
233 339
     },
234 340
     //提交
235
-    handleConfirm() {},
341
+    async handleConfirm() {
342
+      const type = this.auditType;
343
+      if (
344
+        this.refundData.part_refund_price.length == 0 &&
345
+        this.refundData.status == 2
346
+      ) {
347
+        uni.showToast({
348
+          title: "请输入金额",
349
+          icon: "none",
350
+        });
351
+        return;
352
+      }
353
+
354
+      if (
355
+        this.refundData.part_refund_message.length == 0 &&
356
+        this.refundData.status == 2
357
+      ) {
358
+        uni.showToast({
359
+          title: "请输入备注",
360
+          icon: "none",
361
+        });
362
+        return;
363
+      }
364
+      if (!this.refundData.fail_message && this.refundData.status == -1) {
365
+        uni.showToast({
366
+          title: "请输入拒绝原因",
367
+          icon: "none",
368
+        });
369
+        return;
370
+      }
371
+      uni.showLoading({
372
+        title: "提交中...",
373
+        mask: true,
374
+      });
375
+      try {
376
+        const res = await confirmRefundOrderApi(
377
+          this.storeRefundOrder.refund_order_id,
378
+          this.refundData
379
+        );
380
+        if (res.data.status == 200) {
381
+          uni.showToast({
382
+            title: res.message || res.data.message || "",
383
+            icon: "none",
384
+          });
385
+          this.handleClose();
386
+          await this.initData();
387
+        } else {
388
+          uni.showToast({
389
+            title: res.message || res.data.message || "",
390
+            icon: "none",
391
+          });
392
+        }
393
+      } catch (error) {
394
+        uni.showToast({
395
+          title: error.message || error.data.message || "",
396
+          icon: "none",
397
+        });
398
+      } finally {
399
+        uni.hideLoading();
400
+      }
401
+    },
402
+    handleconfirmReceipt(refund_order_id) {
403
+      //确定
404
+      if (
405
+        this.refundData.part_refund_price.length == 0 &&
406
+        this.refundData.status == 2
407
+      ) {
408
+        uni.showToast({
409
+          title: "请输入金额",
410
+          icon: "none",
411
+        });
412
+        return;
413
+      }
414
+
415
+      if (
416
+        this.refundData.part_refund_message.length == 0 &&
417
+        this.refundData.status == 2
418
+      ) {
419
+        uni.showToast({
420
+          title: "请输入备注",
421
+          icon: "none",
422
+        });
423
+        return;
424
+      }
425
+      if (!this.refundData.fail_message && this.refundData.status == -1) {
426
+        uni.showToast({
427
+          title: "请输入拒绝原因",
428
+          icon: "none",
429
+        });
430
+        return;
431
+      }
432
+      const _this = this;
433
+      console.log(this.refundData.part_refund_message);
434
+      uni.showModal({
435
+        title: "温馨提示",
436
+        content: "是否确认收货?",
437
+        success(res) {
438
+          if (res.confirm) {
439
+            _this.confirmReceiptData(refund_order_id);
440
+          } else if (res.cancel) {
441
+            uni.showToast({
442
+              title: "用户已取消",
443
+              icon: "none",
444
+            });
445
+          }
446
+        },
447
+      });
448
+    },
449
+    async confirmReceiptData(id) {
450
+      uni.showLoading({
451
+        title: "提交中...",
452
+        mask: true,
453
+      });
454
+      try {
455
+        const res = await confirmReceiptApi(id, this.refundData);
456
+        uni.showToast({
457
+          title: res.message || res.data.message || "",
458
+          icon: "none",
459
+        });
460
+        this.handleClose();
461
+        await this.initData();
462
+      } catch (error) {
463
+        uni.showToast({
464
+          title: error.message || error.data.message || "",
465
+          icon: "none",
466
+        });
467
+      } finally {
468
+        uni.hideLoading();
469
+      }
470
+    },
236 471
     formatDataValue(type) {
237 472
       const data = this.storeRefundOrder || {};
238 473
       return orderRefundFilterText(data[type]) || "";
@@ -273,6 +508,15 @@ export default {
273 508
         if (res.data.status == 200) {
274 509
           const productData = res.data.data || {};
275 510
           this.storeRefundOrder = productData;
511
+          this.refundData = {
512
+            status: 1, // 1.同意 -1.拒绝 2.部分退款
513
+            fail_message: "",
514
+            part_refund_price: "",
515
+            part_refund_message: "",
516
+            mer_refund_user: productData.mer.mer_refund_user,
517
+            mer_refund_address: productData.mer.mer_refund_address,
518
+            set_phone: productData.mer.set_phone,
519
+          };
276 520
         }
277 521
       } catch (error) {
278 522
       } finally {
@@ -303,7 +547,8 @@ export default {
303 547
         indexs: this.indexs,
304 548
         formType: "shouhouDetail",
305 549
         order_id: this.order_id,
306
-        refund_order_id: item.refund_order_id,
550
+        shouhou:0,
551
+        refund_order_id: item.refund_order_id || this.storeRefundOrder.refund_order_id || "",
307 552
       };
308 553
 
309 554
       const urlParams = toQueryString(params);
@@ -314,6 +559,8 @@ export default {
314 559
     },
315 560
     onHandleclick(item, type) {
316 561
       this.auditType = type;
562
+      console.log(this.refundorderDetail);
563
+      this.douhuomall = this.refundorderDetail.douhuomall;
317 564
       // 1.同意 -1.拒绝 2.部分退款
318 565
       this.open();
319 566
       if (type == "reject") {
@@ -530,8 +777,8 @@ page {
530 777
 }
531 778
 .popup_data {
532 779
   padding: 26rpx 30rpx;
533
-  min-height: 700rpx;
534
-  max-height: 750rpx;
780
+  min-height: 850rpx;
781
+  max-height: 900rpx;
535 782
   box-sizing: border-box;
536 783
   overflow: hidden;
537 784
   background: linear-gradient(180deg, #e5edff 0%, #ffffff 100%);
@@ -559,8 +806,15 @@ page {
559 806
     }
560 807
   }
561 808
   &__content {
562
-    max-height: 620rpx;
809
+    max-height: 500rpx;
810
+    padding-bottom: 50rpx;
563 811
     overflow-y: auto;
812
+    /deep/.uni-easyinput__placeholder-class {
813
+      font-size: 20rpx;
814
+    }
815
+  }
816
+  .btn-lixt {
817
+    height: 120rpx;
564 818
   }
565 819
 }
566 820
 .send-goods {
@@ -572,6 +826,6 @@ page {
572 826
   display: flex;
573 827
   justify-content: center;
574 828
   align-items: center;
575
-  margin-top: 32rpx;
829
+  margin-top: 20rpx;
576 830
 }
577 831
 </style>

+ 8 - 1
shop/afterSalesManagement/components/search/search.vue

@@ -11,6 +11,7 @@
11 11
         v-model="searchValue"
12 12
         type="text"
13 13
         :placeholder="placeholder"
14
+        @input="haandleSearchInput"
14 15
       />
15 16
       <button class="search__btn" @click="haandleSearch">搜索</button>
16 17
     </view>
@@ -31,8 +32,14 @@ export default {
31 32
     };
32 33
   },
33 34
   methods: {
34
-    haandleSearch() {
35
+    haandleSearch(val) {
36
+
35 37
       this.$emit("search", this.searchValue);
38
+    },
39
+    haandleSearchInput(val){
40
+      if(val.detail.value==""){
41
+        this.$emit("search", this.searchValue);
42
+      }
36 43
     }
37 44
   }
38 45
 };

+ 27 - 26
shop/afterSalesManagement/index.vue

@@ -140,9 +140,9 @@ export default {
140 140
     headerJump() {
141 141
       uni.switchTab({ url: "/pages/ordermanagement/index" });
142 142
     },
143
-  async  search(val) {
143
+    async search(val) {
144 144
       this.order_sn = val;
145
-        await this.orderList();
145
+      await this.getAfterSaleListData();
146 146
     },
147 147
 
148 148
     async getAfterSaleListData() {
@@ -155,9 +155,9 @@ export default {
155 155
         order_sn: this.order_sn,
156 156
         refund_type: this.refund_type,
157 157
       };
158
-       uni.showLoading({
159
-      title: "加载中",
160
-    });
158
+      uni.showLoading({
159
+        title: "加载中",
160
+      });
161 161
       try {
162 162
         const res = await getAfterSaleList(params);
163 163
         uni.stopPullDownRefresh();
@@ -195,8 +195,9 @@ export default {
195 195
         status: 0,
196 196
         indexs: this.currentActive,
197 197
         formType: "shouhou",
198
+        shouhou: 0,
198 199
         order_id: item.order_id || "",
199
-           refund_order_id:item .refund_order_id,
200
+        refund_order_id: item.refund_order_id,
200 201
       };
201 202
       const urlParams = toQueryString(params);
202 203
       uni.redirectTo({
@@ -207,8 +208,8 @@ export default {
207 208
       // console.log(item)
208 209
       const params = {
209 210
         indexs: this.currentActive,
210
-        order_id: item.order_id ,
211
-        refund_order_id:item .refund_order_id,
211
+        order_id: item.order_id,
212
+        refund_order_id: item.refund_order_id,
212 213
       };
213 214
       // console.log(params,"paramsparamsparamsparamsparamsparams")
214 215
       const urlParams = toQueryString(params);
@@ -216,26 +217,26 @@ export default {
216 217
         url: `./afterSalesDetail?${urlParams}`,
217 218
       });
218 219
     },
219
-  async  tabsHandleClick(obj) {
220
+    async tabsHandleClick(obj) {
220 221
       this.currentActive = obj.index;
221 222
       // console.log(obj, "tabsHandleClick");
222
-       // 0全部  1审核中  2处理中  3已完成
223
-    if (this.currentActive == 0) {
224
-      //全部
225
-      this.status = "";
226
-    } else if (this.currentActive == 1) {
227
-      //审核中 0
228
-      this.status = 0;
229
-    } else if (this.currentActive == 2) {
230
-      //2处理中 2
231
-      this.status = 2;
232
-    } else if (this.currentActive == 3) {
233
-      //3已完成
234
-      this.status = 3;
235
-    } else {
236
-      this.status = "";
237
-    }
238
-    await this.getAfterSaleListData();
223
+      // 0全部  1审核中  2处理中  3已完成
224
+      if (this.currentActive == 0) {
225
+        //全部
226
+        this.status = "";
227
+      } else if (this.currentActive == 1) {
228
+        //审核中 0
229
+        this.status = 0;
230
+      } else if (this.currentActive == 2) {
231
+        //2处理中 2
232
+        this.status = 2;
233
+      } else if (this.currentActive == 3) {
234
+        //3已完成
235
+        this.status = 3;
236
+      } else {
237
+        this.status = "";
238
+      }
239
+      await this.getAfterSaleListData();
239 240
     },
240 241
   },
241 242
 };

+ 51 - 1
shop/commodity/components/changeDetailInfo/ItemsInsidePackage.vue

@@ -19,7 +19,49 @@
19 19
       <view class="popup_data__package__content">
20 20
         <view class="detail-send-order-product">
21 21
           <view class="detail-send-order-product__wrapper">
22
-            <view
22
+            <template v-if="isShouHou">
23
+               <view
24
+              class="detail-send-order-content"
25
+              v-for="(items, indexs) in orderProduct"
26
+              :key="indexs"
27
+            >
28
+              <view class="detail-send-order-content-left">
29
+                <view
30
+                  class="detail-send-order-content-left-img"
31
+                  v-if="items.product"
32
+                >
33
+                  <image
34
+                    v-if="items.product.cart_info.product.image"
35
+                    :src="items.product.cart_info.product.image"
36
+                    mode="widthFix"
37
+                  ></image>
38
+                  <text v-else>暂无照片</text>
39
+                </view>
40
+              </view>
41
+              <view class="detail-send-order-content-middle">
42
+                <view
43
+                  class="detail-send-order-content-middle-top"
44
+                  v-if="items.product"
45
+                >
46
+                  {{ items.product.cart_info.product.store_name }}
47
+                </view>
48
+                <view
49
+                  class="detail-send-order-content-middle-top-bot"
50
+                  v-if="items.product.cart_info"
51
+                >
52
+                  {{ items.product.cart_info.productAttr.sku || "" }}
53
+                </view>
54
+              </view>
55
+              <view class="detail-send-order-content-right">
56
+                <view class="detail-send-order-yi-in-neibu-right-in">
57
+                  ×{{ items.product.product_num || 0 }}
58
+                </view>
59
+              </view>
60
+            </view>
61
+            </template>
62
+           
63
+           <template v-else>
64
+             <view
23 65
               class="detail-send-order-content"
24 66
               v-for="(items, indexs) in orderProduct"
25 67
               :key="indexs"
@@ -57,6 +99,10 @@
57 99
                 </view>
58 100
               </view>
59 101
             </view>
102
+           </template>
103
+         
104
+         
105
+         
60 106
           </view>
61 107
         </view>
62 108
       </view>
@@ -85,6 +131,10 @@ export default {
85 131
         };
86 132
       },
87 133
     },
134
+    isShouHou:{
135
+      type:Boolean,
136
+      default:false
137
+    },
88 138
     orderProduct: {
89 139
       type: Array,
90 140
       default: () => {

+ 7 - 2
shop/commodity/components/search/search.vue

@@ -6,7 +6,7 @@
6 6
 		          referrerpolicy="no-referrer"
7 7
 		          src="/static/images/new_ui/search_icon_blod.png"
8 8
 		        />
9
-				<input class="search__input" v-model="searchValue" type="text" placeholder="请输入订单号/收货人/联系方式/提货码" />
9
+				<input class="search__input" v-model="searchValue" @input="haandleSearchInput" type="text" placeholder="请输入订单号/收货人/联系方式/提货码" />
10 10
 		        <button class="search__btn" @click="haandleSearch">
11 11
 		          搜索
12 12
 		        </button>
@@ -24,7 +24,12 @@
24 24
 		methods:{
25 25
 			haandleSearch(){
26 26
 				this.$emit("search",this.searchValue)
27
-			}
27
+			},
28
+			    haandleSearchInput(val){
29
+      if(val.detail.value==""){
30
+        this.$emit("search", this.searchValue);
31
+      }
32
+    }
28 33
 		}
29 34
 	}
30 35
 </script>

+ 135 - 51
shop/commodity/logisticsInformationDetail.vue

@@ -6,14 +6,34 @@
6 6
         <view class="image-list">
7 7
           <view class="image-scroll_box">
8 8
             <view class="image-scroll_box__image">
9
-              <view
10
-                v-for="(item, index) in procductList"
11
-                :key="item.cart_id + '_index_' + index"
12
-                class="cmsd-ocm"
13
-              >
14
-                <image :src="item.cart_info.product.image" v-if="item.cart_info"/>
15
-                <view class="tip-num">{{ item.product_num || 0 }}件</view>
16
-              </view>
9
+              <template v-if="isShouHou">
10
+                <view
11
+                  v-for="(item, index) in procductList"
12
+                  :key="item.cart_id + '_index_' + index"
13
+                  class="cmsd-ocm"
14
+                >
15
+                  <image
16
+                    :src="item.product.cart_info.product.image"
17
+                    v-if="item.product"
18
+                  />
19
+                  <view class="tip-num"
20
+                    >{{ item.product.product_num || 0 }}件</view
21
+                  >
22
+                </view>
23
+              </template>
24
+              <template v-else>
25
+                <view
26
+                  v-for="(item, index) in procductList"
27
+                  :key="item.cart_id + '_index_' + index"
28
+                  class="cmsd-ocm"
29
+                >
30
+                  <image
31
+                    :src="item.cart_info.product.image"
32
+                    v-if="item.cart_info"
33
+                  />
34
+                  <view class="tip-num">{{ item.product_num || 0 }}件</view>
35
+                </view>
36
+              </template>
17 37
             </view>
18 38
           </view>
19 39
         </view>
@@ -22,20 +42,26 @@
22 42
         </view>
23 43
       </view>
24 44
       <view class="logistics-info-card-headers__logicistics">
25
-        <view class="image-company__image"   v-if="orderData.delivery_image">
26
-          <image
27
-            :src="orderData.delivery_image"
28
-          />
45
+        <view class="image-company__image" v-if="orderData.delivery_image">
46
+          <image :src="orderData.delivery_image" />
29 47
         </view>
30 48
         <view class="image-company__content">
31 49
           <view class="image-company__content-title">
32
-            <text>{{orderData.delivery_name}}: </text>
33
-            <text>{{orderData.delivery_id}}</text>
50
+            <text>{{ orderData.delivery_name }}: </text>
51
+            <text>{{ orderData.delivery_id }}</text>
34 52
           </view>
35 53
         </view>
36 54
         <view class="image-company__btn">
37
-          <view class="copy-btn btn" @click="handleGiop('copy',orderData.delivery_id)">复制</view>
38
-          <view class="tel-btn btn" @click="handleGiop('tel',orderData.delivery_phone)">电话</view>
55
+          <view
56
+            class="copy-btn btn"
57
+            @click="handleGiop('copy', orderData.delivery_id)"
58
+            >复制</view
59
+          >
60
+          <view
61
+            class="tel-btn btn"
62
+            @click="handleGiop('tel', orderData.delivery_phone)"
63
+            >电话</view
64
+          >
39 65
         </view>
40 66
       </view>
41 67
     </view>
@@ -49,16 +75,14 @@
49 75
               </view>
50 76
               <view class="order-list-yi-bot-xadasrfe">
51 77
                 <view class="order-list-yi-bot-xadasrfe-top">
52
-                  <view
53
-                    >{{orderData.user_address}}</view
54
-                  >
55
-                  <text> {{orderData.real_name}}</text>
56
-                 <text> {{formatData(orderData,"user_phone")}}</text>
78
+                  <view>{{ orderData.user_address }}</view>
79
+                  <text> {{ orderData.real_name }}</text>
80
+                  <text> {{ formatData(orderData, "user_phone") }}</text>
57 81
                 </view>
58 82
               </view>
59 83
             </view>
60 84
           </view>
61
-          <view class="logicistis" v-if="logisticsData.length>0">
85
+          <view class="logicistis" v-if="logisticsData.length > 0">
62 86
             <view
63 87
               class="logicistis-bot-xiangxi"
64 88
               v-for="(items, index) in logisticsData"
@@ -79,27 +103,36 @@
79 103
             </view>
80 104
           </view>
81 105
           <template v-else>
82
-            <emptyData title="暂无物流信息" style="top:45%;left:25%;width:auto"></emptyData>
106
+            <emptyData
107
+              title="暂无物流信息"
108
+              style="top: 45%; left: 25%; width: auto"
109
+            ></emptyData>
83 110
           </template>
84 111
         </view>
85 112
       </view>
86 113
     </template>
87 114
     <emptyData v-else></emptyData>
88
-    <ItemsInsidePackageVue ref="refsPackage" :orderProduct="procductList"/>
115
+    <ItemsInsidePackageVue
116
+      ref="refsPackage"
117
+      :orderProduct="procductList"
118
+      :isShouHou="isShouHou"
119
+    />
89 120
   </view>
90 121
 </template>
91 122
 
92 123
 <script>
93 124
 import headersVue from "../components/headers/headers.vue";
94
-import { toQueryString, copy,MaskRules  } from "@/utils/index.js";
125
+import { toQueryString, copy, MaskRules } from "@/utils/index.js";
95 126
 import ItemsInsidePackageVue from "./components/changeDetailInfo/ItemsInsidePackage.vue";
96 127
 import { mockDataLogistics } from "./mockData.js";
97 128
 import emptyData from "../components/emptyData/emptyData.vue";
98 129
 import {
99
-
100 130
   getExpress,
101 131
   getOrderListProduct,
102
-  orderDetailApi
132
+  orderDetailApi,
133
+  // 退单
134
+  refundorderExpressApi,
135
+  refundorderDetailApi,
103 136
 } from "@/commit/order.js";
104 137
 export default {
105 138
   components: { headersVue, ItemsInsidePackageVue, emptyData },
@@ -120,37 +153,78 @@ export default {
120 153
     this.indexs = e.indexs;
121 154
     this.status = e.status;
122 155
     this.formType = e.formType || "";
123
-    this.isShouHou = e.shouhou==0?true:false;
124
-    await this.getOrderDetails();
156
+    this.isShouHou = e.shouhou == 0 ? true : false;
157
+    this.refund_order_id = e.refund_order_id;
158
+    if (e.shouhou == 0 || ["shouehuoDetail", "shouhou"].includes(e.formType)) {
159
+      await this.getRefundorderDetailData();
160
+      await this.getOrderDetails(false);
161
+    } else {
162
+      await this.getOrderDetails(true);
163
+    }
125 164
   },
126 165
   methods: {
127
-    handleGiop(type,value) {
166
+    handleGiop(type, value) {
128 167
       if (type === "copy") {
129 168
         copy(value);
130 169
       } else {
131
-        if(!value){
170
+        if (!value) {
132 171
           uni.showToast({
133 172
             title: "暂无电话",
134 173
             icon: "none",
135
-          })
136
-          return
174
+          });
175
+          return;
137 176
         }
138 177
         uni.makePhoneCall({
139 178
           phoneNumber: value,
140 179
         });
141 180
       }
142 181
     },
143
-    formatData(data,type){
144
-      if(type==='user_phone'){
145
-        if(!data[type]) return ""
182
+    formatData(data, type) {
183
+      if (type === "user_phone") {
184
+        if (!data[type]) return "";
146 185
         return MaskRules.mobile(data[type]);
147
-      }else{
186
+      } else {
148 187
         return data[type] || "--";
149 188
       }
150 189
     },
151 190
     handlePopup() {
152 191
       this.$refs.refsPackage.open();
153 192
     },
193
+    async getRefundorderDetailData() {
194
+      //
195
+      uni.showLoading({
196
+        title: "加载中...",
197
+        mask: true,
198
+      });
199
+      try {
200
+        const res = await refundorderDetailApi(this.refund_order_id);
201
+        if (res.data.status == 200) {
202
+          let data = res.data.data || {};
203
+          this.orderData = {
204
+            ...data,
205
+            delivery_name: data.delivery_type,
206
+          };
207
+          this.procductList = data.refundProduct || [];
208
+          if (this.orderData.delivery_id) {
209
+            await this.getRefundorderExpress(this.refund_order_id);
210
+          }
211
+        }
212
+      } catch (error) {
213
+      } finally {
214
+        uni.hideLoading();
215
+      }
216
+    },
217
+    async getRefundorderExpress(id) {
218
+      //
219
+      if (!id) return;
220
+      try {
221
+        const res = await refundorderExpressApi(id);
222
+        if (res.data.status == 200) {
223
+          const data = res.data.data || [];
224
+          this.logisticsData = data;
225
+        }
226
+      } catch (error) {}
227
+    },
154 228
     async getOrderListSigleData(order_sn) {
155 229
       try {
156 230
         const res = await getOrderListProduct(order_sn);
@@ -158,25 +232,35 @@ export default {
158 232
           let detailDa =
159 233
             (res.data.data.list[0] && res.data.data.list[0].orderProduct) || [];
160 234
           this.procductList = detailDa || [];
161
-          console.log(this.procductList,"this.procductList")
235
+          console.log(this.procductList, "this.procductList");
162 236
         }
163 237
       } catch (error) {}
164 238
     },
165
-    async getOrderDetails() {
166
-      uni.showLoading({
167
-        title: "加载中...",
168
-        mask: true,
169
-      });
239
+    async getOrderDetails(flag) {
240
+      if (flag) {
241
+        uni.showLoading({
242
+          title: "加载中...",
243
+          mask: true,
244
+        });
245
+      }
170 246
       try {
171 247
         const res = await orderDetailApi(this.order_id);
172 248
         if (res.data.status == 200) {
173
-          this.orderData = {
174
-            ...res.data.data,
175
-          };
176
-          if (this.orderData.delivery_id) {
177
-            await this.getLogisticData(this.order_id);
249
+          if (flag) {
250
+            this.orderData = {
251
+              ...res.data.data,
252
+            };
253
+            if (this.orderData.delivery_id) {
254
+              await this.getLogisticData(this.order_id);
255
+            }
256
+            this.getOrderListSigleData(this.orderData.order_sn);
257
+          }else {
258
+             this.orderData = {
259
+              
260
+              ...res.data.data,
261
+              ...this.orderData,
262
+            };
178 263
           }
179
-          this.getOrderListSigleData(this.orderData.order_sn);
180 264
         }
181 265
       } catch (error) {
182 266
       } finally {
@@ -205,7 +289,6 @@ export default {
205 289
           status: this.status,
206 290
           indexs: this.indexs,
207 291
           index: this.indexs,
208
-          
209 292
         };
210 293
       } else {
211 294
         obj = {
@@ -213,7 +296,8 @@ export default {
213 296
           indexs: this.indexs,
214 297
           formType: this.formType,
215 298
           order_id: this.order_id,
216
-           index: this.indexs,
299
+          index: this.indexs,
300
+          refund_order_id: this.refund_order_id,
217 301
         };
218 302
       }
219 303
       const params = toQueryString(obj);

+ 6 - 0
shop/productManagementModule/components/search/search.vue

@@ -11,6 +11,7 @@
11 11
         v-model="searchValue"
12 12
         type="text"
13 13
         placeholder="输入商品名称/商品ID"
14
+        @input="haandleSearchInput"
14 15
       />
15 16
       <button class="search__btn" @click="haandleSearch">搜索</button>
16 17
     </view>
@@ -27,6 +28,11 @@ export default {
27 28
   methods: {
28 29
     haandleSearch() {
29 30
       this.$emit("search", this.searchValue);
31
+    },
32
+        haandleSearchInput(val){
33
+      if(val.detail.value==""){
34
+        this.$emit("search", this.searchValue);
35
+      }
30 36
     }
31 37
   }
32 38
 };