ソースを参照

订单类型判断

xialei 1 年間 前
コミット
01667c18bd
共有2 個のファイルを変更した43 個の追加13 個の削除を含む
  1. 40 10
      src/views/order/index.vue
  2. 3 3
      src/views/order/orderDetail.vue

+ 40 - 10
src/views/order/index.vue

@@ -147,13 +147,20 @@
147 147
           </template>
148 148
         </el-table-column>
149 149
         <!-- <el-table-column prop="pay_price" label="实际支付" min-width="100" /> -->
150
-        <el-table-column label="支付类型" min-width="80">
150
+        <el-table-column label="支付类型" min-width="120">
151 151
           <template slot-scope="scope">
152
-            <span v-if="scope.row.paid == 1">
152
+            <!-- <span v-if="scope.row.paid == 1">
153 153
               {{ scope.row.pay_type == 0 ? "虚拟支付" :scope.row.pay_type == 1 ? "微信支付" : scope.row.pay_type == 2 ? '小程序支付' :scope.row.pay_type == 4 ? '支付宝支付' :scope.row.pay_type == 5 ? '红积分兑换' : '' }}
154 154
             </span>
155
-            <span v-else>--</span>
156
-
155
+            <span v-else>--</span> -->
156
+          
157
+              <div class="tabBox acea-row row-middle">
158
+                {{checkPayString(scope.row.fzone_paytype, scope.row.pay_type) || ''}}
159
+              </div>
160
+              <div class="tabBox acea-row row-middle">
161
+                {{scope.row.fzone_paytype && scope.row.fzone_paytype.price || ''}}  
162
+                <span v-if="scope.row.fzone_paytype && scope.row.fzone_paytype.other">+{{scope.row.fzone_paytype && scope.row.fzone_paytype.other || ''}}</span>
163
+              </div>
157 164
           </template>
158 165
         </el-table-column>
159 166
         <el-table-column label="支付状态" min-width="80">
@@ -422,6 +429,27 @@ export default {
422 429
     this.getHeaderList()
423 430
   },
424 431
   methods: {
432
+    checkPayString(fzone_paytype, pay_type) {
433
+      //支付方式 0余额 1微信 2小程序 4支付宝 5特殊商户积分
434
+      const pay_type_list = {
435
+        0: "余额",
436
+        1: "微信",
437
+        2: "小程序",
438
+        4: "支付宝",
439
+        5: "特殊商户积分",
440
+      };
441
+      const pay_type_name = pay_type_list[pay_type];
442
+      const characterToCheck = '现金'; // 你想检查的字符
443
+      if (fzone_paytype && fzone_paytype.note.includes(characterToCheck)) {
444
+        return pay_type_name + "  " + fzone_paytype.note;
445
+      }else{
446
+        if (fzone_paytype && fzone_paytype.note){
447
+           return fzone_paytype.note
448
+        }else{
449
+           return ''
450
+        }
451
+      }
452
+    },
425 453
     // 选择支付状态
426 454
     selectedPayStatus() {
427 455
       if (this.tableFrom.paid == 0) {
@@ -750,11 +778,11 @@ export default {
750 778
     },
751 779
     // 编辑
752 780
     edit(id) {
753
-      this.$modalForm(orderUpdateApi(id)).then(() => this.getList(''))
781
+      this.$modalForm(orderUpdateApi(id)).then(() => this.getList(1))
754 782
     },
755 783
     // 发货
756 784
     send(id) {
757
-      this.$modalForm(orderDeliveryApi(id)).then(() => this.getList(''))
785
+      this.$modalForm(orderDeliveryApi(id)).then(() => this.getList(1))
758 786
     },
759 787
     // 自提
760 788
     take(id) {
@@ -773,7 +801,7 @@ export default {
773 801
       takeProductApi(this.takeProductCode, { order_id: this.currentOrderId }).then(res => {
774 802
         this.$message.success('验证成功')
775 803
         this.showDialogTake = false
776
-        this.getList()
804
+        this.getList(1)
777 805
       }).catch(res => {
778 806
         this.$message.error(res.message)
779 807
       })
@@ -781,11 +809,13 @@ export default {
781 809
 
782 810
     // 列表
783 811
     getList(num) {
812
+      console.log();
784 813
       this.listLoading = true
785
-      this.tableFrom.page = num || this.tableFrom.page
814
+      // this.tableFrom.page = num || this.tableFrom.page
786 815
       orderListApi(this.tableFrom)
787 816
         .then((res) => {
788 817
           console.log(res, 'aaaaa')
818
+          this.tableData.data = [];
789 819
           this.tableData.data = res.data.list
790 820
           this.tableData.total = res.data.count
791 821
           this.cardLists = res.data.stat
@@ -799,11 +829,11 @@ export default {
799 829
     },
800 830
     pageChange(page) {
801 831
       this.tableFrom.page = page
802
-      this.getList('')
832
+      this.getList(1)
803 833
     },
804 834
     handleSizeChange(val) {
805 835
       this.tableFrom.limit = val
806
-      this.getList('')
836
+      this.getList(1)
807 837
     },
808 838
     headerList() {
809 839
       chartApi(this.tableFrom)

+ 3 - 3
src/views/order/orderDetail.vue

@@ -10,7 +10,7 @@
10 10
         <div v-if="orderDatalist" class="description">
11 11
           <div class="title">收货信息</div>
12 12
           <div class="acea-row">
13
-            <div class="description-term">用户昵称:{{orderDatalist.user.nickname}}</div>
13
+            <div class="description-term">用户昵称:{{orderDatalist.user && orderDatalist.user.nickname || ''}}</div>
14 14
             <div class="description-term">收货人:{{ orderDatalist.real_name }}</div>
15 15
             <div class="description-term">联系电话:{{ orderDatalist.user_phone }}</div>
16 16
             <div class="description-term">收货地址:{{ orderDatalist.user_address }}</div>
@@ -36,7 +36,7 @@
36 36
             <div class="description-term">订单金额:{{ orderDatalist.pay_price }}</div>
37 37
             <div class="description-term">创建时间:{{ orderDatalist.create_time }}</div>
38 38
 
39
-            <div class="description-term" v-if="orderDatalist.paid==1 && orderDatalist.pay_type==0">支付类型:虚拟支付</div>
39
+            <!-- <div class="description-term" v-if="orderDatalist.paid==1 && orderDatalist.pay_type==0">支付类型:虚拟支付</div>
40 40
             <div class="description-term" v-if="orderDatalist.paid==1 && orderDatalist.pay_type==1">支付类型:微信</div>
41 41
             <div class="description-term" v-if="orderDatalist.paid==1 && orderDatalist.pay_type==2">支付类型:小程序</div>
42 42
             <div class="description-term" v-if="orderDatalist.paid==1 && orderDatalist.pay_type==3">支付类型:银行卡</div>
@@ -49,7 +49,7 @@
49 49
             <div class="description-term" v-if="orderDatalist.paid==1 && orderDatalist.pay_type==2">支付方式:小程序</div>
50 50
             <div class="description-term" v-if="orderDatalist.paid==1 && orderDatalist.pay_type==3">支付方式:银行卡</div>
51 51
             <div class="description-term" v-if="orderDatalist.paid==1 && orderDatalist.pay_type==4">支付方式:支付宝</div>
52
-            <div class="description-term" v-if="orderDatalist.paid==1 && orderDatalist.pay_type==5">支付方式:红积分</div>
52
+            <div class="description-term" v-if="orderDatalist.paid==1 && orderDatalist.pay_type==5">支付方式:红积分</div> -->
53 53
 
54 54
 
55 55
             <div class="description-term">开通账号:{{ orderDatalist.exchange_phone }}</div>