Browse Source

no message

linwenxin 1 year ago
parent
commit
ea81295a66
2 changed files with 122 additions and 79 deletions
  1. 1 1
      src/utils/select_data.js
  2. 121 78
      src/views/mallManagement/order/order_detail/index.vue

+ 1 - 1
src/utils/select_data.js

@@ -36,7 +36,7 @@ export const ORDER_CURRENT_STATUS = [
   { label: '已发货', value: 'YFH' },
   { label: '已完成', value: 'OVER' },
   { label: '已关闭', value: 'CLOSE' },
-  { label: '超时', value: 'TIMEOUT' },
+  { label: '支付超时', value: 'TIMEOUT' },
   { label: '售后', value: 'REFUND' },
 ]
 

+ 121 - 78
src/views/mallManagement/order/order_detail/index.vue

@@ -60,35 +60,36 @@
             <div class="title">订单信息</div>
             <div class="item">
               <div class="label">收货人信息:</div>
-              <div class="value">{{orderDetail.receUserName}} ({{orderDetail.recePhone}})</div>
+              <div class="value">{{ orderDetail.receUserName }} ({{ orderDetail.recePhone }})</div>
             </div>
             <div class="item">
               <div class="label">收货人地址:</div>
-              <div class="value">{{orderDetail.province + orderDetail.city + orderDetail.area + orderDetail.street + orderDetail.receAddress + orderDetail.houseNo}}</div>
+              <div class="value">{{ orderDetail.province + orderDetail.city + orderDetail.area + orderDetail.street +
+                orderDetail.receAddress + orderDetail.houseNo }}</div>
             </div>
             <div class="item">
               <div class="label">销售员信息:</div>
-              <div class="value">{{orderDetail.workerName}} ({{orderDetail.workerPhone}})</div>
+              <div class="value">{{ orderDetail.workerName }} ({{ orderDetail.workerPhone }})</div>
             </div>
             <div class="item">
               <div class="label">团长信息:</div>
-              <div class="value">{{orderDetail.promotionGroupUserName}} ({{orderDetail.promotionGroupMobile}})</div>
+              <div class="value">{{ orderDetail.promotionGroupUserName }} ({{ orderDetail.promotionGroupMobile }})</div>
             </div>
             <div class="item">
               <div class="label">下单渠道:</div>
-              <div class="value">{{orderDetail.source}}</div>
+              <div class="value">{{ orderDetail.source }}</div>
             </div>
             <div class="item">
               <div class="label">支付方式:</div>
-              <div class="value">{{orderDetail.payType}}</div>
+              <div class="value">{{ orderDetail.payType }}</div>
             </div>
             <div class="item">
               <div class="label">是否开票:</div>
-              <div class="value">{{orderDetail.tax ? '是':'否'}}</div>
+              <div class="value">{{ orderDetail.tax ? '是' : '否' }}</div>
             </div>
             <div class="item" v-if="orderDetail.dispatchType">
               <div class="label">工单派单方式:</div>
-              <div class="value">{{orderDetail.dispatchType}}</div>
+              <div class="value">{{ orderDetail.dispatchType }}</div>
             </div>
           </div>
         </el-col>
@@ -97,21 +98,21 @@
             <div class="title">物流信息</div>
             <div class="item">
               <div class="label">快递单号:</div>
-              <div class="value">{{orderDetail.logisticsNo}}</div>
+              <div class="value">{{ orderDetail.logisticsNo }}</div>
             </div>
             <div class="item">
               <div class="label">快递公司:</div>
-              <div class="value">{{orderDetail.companyName}}</div>
+              <div class="value">{{ orderDetail.companyName }}</div>
             </div>
             <div class="item">
               <div class="label">货件仓储:</div>
-              <div class="value">{{orderDetail.storageName}}</div>
+              <div class="value">{{ orderDetail.storageName }}</div>
             </div>
           </div>
         </el-col>
       </el-row>
-      
-      
+
+
     </div>
 
     <div class="order-detail" v-if="compensateList.length > 0" style="margin-bottom: 20px;">
@@ -168,8 +169,11 @@
         <el-table-column prop="refundAmount" label="退款金额" align="center"></el-table-column>
         <el-table-column label="操作" align="center" width="160" v-if="orderDetail.orderStatus != 'CLOSE'">
           <template slot-scope="scope">
-            <el-button size="mini" type="primary" @click="handleRefund(scope.row)" :disabled="!orderDetail.refundAble || scope.row.refundNum >= scope.row.num">退款</el-button>
-            <el-button size="mini" @click="handleCompensate(scope.row)">理赔</el-button>
+            <el-button v-if="!~['TIMEOUT', 'CLOSE'].indexOf(orderDetail.orderStatus)" size="mini" type="primary"
+              @click="handleRefund(scope.row)"
+              :disabled="!orderDetail.refundAble || scope.row.refundNum >= scope.row.num">退款</el-button>
+            <el-button v-if="!~['TIMEOUT'].indexOf(orderDetail.orderStatus)" size="mini"
+              @click="handleCompensate(scope.row)">理赔</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -177,26 +181,29 @@
 
       <div class="order-amount-info">
         <el-row>
-          <el-col :span="19"><div style="width: 1px;height: 1px;"></div></el-col>
+          <el-col :span="19">
+            <div style="width: 1px;height: 1px;"></div>
+          </el-col>
           <el-col :span="5">
             <div style="padding-bottom: 10px;">商品总价:¥ {{ orderDetail.totalAmount }}</div>
             <div style="padding-bottom: 10px;">运费:¥ {{ orderDetail.freight }}</div>
             <div style="padding-bottom: 10px;" v-if="orderDetail.discountAmount">
-              优惠:¥ {{ orderDetail.discountAmount }} 
+              优惠:¥ {{ orderDetail.discountAmount }}
               <span v-if="orderDetail.exchangeCode">(优惠码:{{ orderDetail.exchangeCode }})</span>
-              <span v-if="orderDetail.promotionDiscountRate">({{orderDetail.promotionDiscountRate * 10}}折)</span>
+              <span v-if="orderDetail.promotionDiscountRate">({{ orderDetail.promotionDiscountRate * 10 }}折)</span>
             </div>
             <div style="font-size: 14px;">
-              <span style="padding-right: 15px;">实际收款</span><span style="color: red;font-size: 18px;">¥ {{ orderDetail.payAmount }}</span>
+              <span style="padding-right: 15px;">实际收款</span><span style="color: red;font-size: 18px;">¥ {{
+                orderDetail.payAmount }}</span>
             </div>
           </el-col>
         </el-row>
       </div>
     </div>
-    
+
     <div class="order-evaluate-info" v-if="evaluateDetail">
       <div class="title">
-        <div class="left">评价信息<span>{{evaluateDetail.createTime}}</span></div>
+        <div class="left">评价信息<span>{{ evaluateDetail.createTime }}</span></div>
         <div class="right">
           <span>是否客户端展示</span>
           <el-switch v-model="evaluateDetail.isShow" @change="changeShow"></el-switch>
@@ -204,30 +211,31 @@
       </div>
       <div class="main">
         <div class="rate-list">
-          <div style="display: flex; align-items: center; margin-bottom: 5px;">商品质量:<el-rate :value="evaluateDetail.commentGoods" disabled disabled-void-color="#DDDDDD"></el-rate></div>
-          <div style="display: flex; align-items: center; margin-bottom: 5px;">服务质量:<el-rate :value="evaluateDetail.commentService" disabled disabled-void-color="#DDDDDD"></el-rate></div>
-          <div style="display: flex; align-items: center;">配送质量:<el-rate :value="evaluateDetail.commentExpress" disabled disabled-void-color="#DDDDDD"></el-rate></div>
+          <div style="display: flex; align-items: center; margin-bottom: 5px;">商品质量:<el-rate
+              :value="evaluateDetail.commentGoods" disabled disabled-void-color="#DDDDDD"></el-rate></div>
+          <div style="display: flex; align-items: center; margin-bottom: 5px;">服务质量:<el-rate
+              :value="evaluateDetail.commentService" disabled disabled-void-color="#DDDDDD"></el-rate></div>
+          <div style="display: flex; align-items: center;">配送质量:<el-rate :value="evaluateDetail.commentExpress" disabled
+              disabled-void-color="#DDDDDD"></el-rate></div>
         </div>
         <div class="tag-list" v-if="orderDetail.orderCommentTags && orderDetail.orderCommentTags.length > 0">
-          <el-tag v-for="(item, index) in orderDetail.orderCommentTags" :key="index">{{item}}</el-tag>
+          <el-tag v-for="(item, index) in orderDetail.orderCommentTags" :key="index">{{ item }}</el-tag>
         </div>
       </div>
-      <div class="content">{{evaluateDetail.content}}</div>
+      <div class="content">{{ evaluateDetail.content }}</div>
       <div class="img-list" v-if="orderDetail.orderCommentImgs && orderDetail.orderCommentImgs.length > 0">
-        <el-image v-for="(item, index) in orderDetail.orderCommentImgs" :key="index" :src="item" :preview-src-list="orderDetail.orderCommentImgs" fit="cover"></el-image>
+        <el-image v-for="(item, index) in orderDetail.orderCommentImgs" :key="index" :src="item"
+          :preview-src-list="orderDetail.orderCommentImgs" fit="cover"></el-image>
       </div>
     </div>
 
-    <el-dialog :title="dialogTitle" :visible.sync="remarkVisible" :show-close="false" :width="dialogWidth" :close-on-click-modal="false">
-      <el-form :model="orderForm" :rules="orderFormRules" ref="orderForm" v-if="curOpenDialogType !== 'query'" label-width="90px" label-position="left">
+    <el-dialog :title="dialogTitle" :visible.sync="remarkVisible" :show-close="false" :width="dialogWidth"
+      :close-on-click-modal="false">
+      <el-form :model="orderForm" :rules="orderFormRules" ref="orderForm" v-if="curOpenDialogType !== 'query'"
+        label-width="90px" label-position="left">
         <el-form-item prop="remark" v-if="curOpenDialogType === 'remark'">
-          <el-input
-            type="textarea"
-            :autosize="{ minRows: 8, maxRows: 16}"
-            placeholder="请输入备注内容"
-            v-model="remark"
-            maxlength="100"
-            show-word-limit>
+          <el-input type="textarea" :autosize="{ minRows: 8, maxRows: 16 }" placeholder="请输入备注内容" v-model="remark"
+            maxlength="100" show-word-limit>
           </el-input>
         </el-form-item>
         <el-form-item prop="payAmount" v-if="curOpenDialogType === 'price'">
@@ -247,12 +255,14 @@
         </el-form-item>
         <el-form-item label="物流公司" prop="companyCode" v-if="curOpenDialogType === 'send'">
           <el-select v-model="orderForm.companyCode" placeholder="请选择物流公司" style="width: 100%;">
-            <el-option :label="item.name" :value="item.code" v-for="(item, index) in companyList" :key="index"></el-option>
+            <el-option :label="item.name" :value="item.code" v-for="(item, index) in companyList"
+              :key="index"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="仓储" prop="storageId" v-if="curOpenDialogType === 'send'">
           <el-select v-model="orderForm.storageId" placeholder="请选择仓储" style="width: 100%;">
-            <el-option :label="item.storageName" :value="item.storageId" v-for="(item, index) in storageList" :key="index"></el-option>
+            <el-option :label="item.storageName" :value="item.storageId" v-for="(item, index) in storageList"
+              :key="index"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="是否派单" prop="workOrder" v-if="curOpenDialogType === 'send'">
@@ -262,7 +272,8 @@
           </el-radio-group>
         </el-form-item>
       </el-form>
-      <el-table v-loading="logisticsLoading" :data="logistics" style="width: 100%" size="mini" v-if="curOpenDialogType === 'query'">
+      <el-table v-loading="logisticsLoading" :data="logistics" style="width: 100%" size="mini"
+        v-if="curOpenDialogType === 'query'">
         <el-table-column prop="comName" label="物流公司" align="center"></el-table-column>
         <el-table-column prop="areaName" label="地区名称" align="center"></el-table-column>
         <el-table-column prop="time" label="物流时间" align="center"></el-table-column>
@@ -309,7 +320,7 @@ import {
   saveRemark, orderRefund, orderCompensate, getCompensateList,
   changeShow
 } from "@/api/order";
-import {getExpress, getCompanyList} from "@/api/common";
+import { getExpress, getCompanyList } from "@/api/common";
 import * as Storage from "@/api/storage";
 import { mapGetters } from 'vuex'
 
@@ -336,8 +347,9 @@ export default {
       },
       orderFormRules: {
         payAmount: [
-          { validator: (rule, value, callback) => {
-              if(this.curOpenDialogType !== 'price') {
+          {
+            validator: (rule, value, callback) => {
+              if (this.curOpenDialogType !== 'price') {
                 callback()
               } else {
                 if (!value) {
@@ -350,20 +362,22 @@ export default {
                   }
                 }
               }
-            }, trigger: 'blur' }
+            }, trigger: 'blur'
+          }
         ],
         receUserName: [
-          { require: true, message: '请输入收货人', trigger:'blur' }
+          { require: true, message: '请输入收货人', trigger: 'blur' }
         ],
         recePhone: [
-          { require: true, message: '请输入收货电话', trigger:'blur' }
+          { require: true, message: '请输入收货电话', trigger: 'blur' }
         ],
         receAddress: [
-          { require: true, message: '请输入收货地址', trigger:'blur' }
+          { require: true, message: '请输入收货地址', trigger: 'blur' }
         ],
         logisticsNo: [
-          { validator: (rule, value, callback) => {
-              if(this.curOpenDialogType !== 'send') {
+          {
+            validator: (rule, value, callback) => {
+              if (this.curOpenDialogType !== 'send') {
                 callback()
               } else {
                 if (!value) {
@@ -372,11 +386,13 @@ export default {
                   callback()
                 }
               }
-            }, trigger: 'blur' }
+            }, trigger: 'blur'
+          }
         ],
         storageId: [
-          { validator: (rule, value, callback) => {
-              if(this.curOpenDialogType !== 'send') {
+          {
+            validator: (rule, value, callback) => {
+              if (this.curOpenDialogType !== 'send') {
                 callback()
               } else {
                 if (!value) {
@@ -385,11 +401,13 @@ export default {
                   callback()
                 }
               }
-            }, trigger: 'change' }
+            }, trigger: 'change'
+          }
         ],
         companyCode: [
-          { validator: (rule, value, callback) => {
-              if(this.curOpenDialogType !== 'send') {
+          {
+            validator: (rule, value, callback) => {
+              if (this.curOpenDialogType !== 'send') {
                 callback()
               } else {
                 if (!value) {
@@ -398,7 +416,8 @@ export default {
                   callback()
                 }
               }
-            }, trigger: 'change' }
+            }, trigger: 'change'
+          }
         ]
       },
       curOpenDialogType: 'order',
@@ -418,13 +437,15 @@ export default {
       compensateFormRules: {
         num: [
           { required: true, message: '请输入理赔数量', trigger: 'blur' },
-          { validator: (rule, value, callback) => {
-            if(value > (this.compensateItem.num - this.compensateItem.refundNum)) {
-              callback(new Error('最多还可以理赔' + (this.compensateItem.num - this.compensateItem.refundNum) + '件商品'));
-            } else {
-              callback();
-            }
-          }, trigger: 'blur' }
+          {
+            validator: (rule, value, callback) => {
+              if (value > (this.compensateItem.num - this.compensateItem.refundNum)) {
+                callback(new Error('最多还可以理赔' + (this.compensateItem.num - this.compensateItem.refundNum) + '件商品'));
+              } else {
+                callback();
+              }
+            }, trigger: 'blur'
+          }
         ],
         amount: [
           { required: true, message: '请输入理赔金额', trigger: 'blur' },
@@ -473,7 +494,7 @@ export default {
       } else if (type === 'query') {
         this.logisticsLoading = true
         this.dialogTitle = '物流信息'
-        getExpress({ 
+        getExpress({
           logisticsNo: this.orderDetail.logisticsNo,
           companyCode: this.orderDetail.companyCode
         }).then(res => {
@@ -587,29 +608,29 @@ export default {
     // 退款
     handleRefund(row) {
       console.log(row);
-      if(row.num == 1) {
+      if (row.num == 1) {
         this.$confirm('此操作将退款此商品, 是否继续?', '退款', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
         }).then(() => {
           this.orderRefund(1, row.orderDetailId);
-        }).catch(() => {});
+        }).catch(() => { });
       }
       else {
         this.$prompt('请输入退款数量', '退款', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
-          inputValidator: function(value) {
-            if(!value) return '请输入退款数量';
-            if(value == 0) return '退款数量不能小于1';
-            if(value > (row.num - row.refundNum)) {
+          inputValidator: function (value) {
+            if (!value) return '请输入退款数量';
+            if (value == 0) return '退款数量不能小于1';
+            if (value > (row.num - row.refundNum)) {
               return '最多还可以退款' + (row.num - row.refundNum) + '件商品'
             }
           },
         }).then(({ value }) => {
           this.orderRefund(value, row.orderDetailId);
-        }).catch(() => {});
+        }).catch(() => { });
       }
     },
 
@@ -633,7 +654,7 @@ export default {
     },
 
     // 取消 理赔
-    cancelCompensateForm(){
+    cancelCompensateForm() {
       this.compensateFormVisible = false;
       this.compensateForm = {
         id: null,
@@ -662,12 +683,12 @@ export default {
           })
         }
       });
-      
+
     },
 
     // 获取理赔列表
     getCompensateList() {
-      getCompensateList({orderId: this.orderId}).then(res => {
+      getCompensateList({ orderId: this.orderId }).then(res => {
         this.compensateList = res.data;
       })
     },
@@ -686,7 +707,7 @@ export default {
   },
   computed: {
     ...mapGetters([
-      'userid', 
+      'userid',
       'name'
     ]),
     curOrderStatus() {
@@ -708,7 +729,7 @@ export default {
       }
     },
     totalAmountCompute() {
-      if(!this.orderDetail.totalAmount) {
+      if (!this.orderDetail.totalAmount) {
         return 0
       }
       const totalAmount = parseFloat(this.orderDetail.totalAmount)
@@ -723,42 +744,51 @@ export default {
 .order-main {
   margin-top: 15px;
   border: 1px solid #e5e5e5;
+
   .order-main-title {
     font-size: 14px;
   }
+
   .order-main-title span {
     margin-right: 15px;
   }
+
   .order-main-status {
     padding: 15px 0;
     font-size: 24px;
     color: #409EFF;
   }
+
   .order-main-opt-btn {
     padding: 15px 0;
   }
 }
+
 .order-receive-info {
   margin: 15px 0;
   padding: 15px;
   background: #f5f7fa;
+
   :first-child div span {
     padding-right: 15px;
   }
-  .el-row{
+
+  .el-row {
     padding-top: 15px;
   }
 }
 
 .order-detail {
   background: #f5f7fa;
+
   .order-amount-info {
     padding: 15px 0;
     font-size: 12px;
     font-weight: bold;
   }
 
-  ::v-deep .el-table tr, ::v-deep .el-table th {
+  ::v-deep .el-table tr,
+  ::v-deep .el-table th {
     background-color: #f5f7fa;
   }
 }
@@ -769,11 +799,13 @@ export default {
     font-weight: 700;
     margin-bottom: 20px;
   }
+
   .item {
     display: flex;
     font-size: 14px;
     color: #666;
     padding-bottom: 12px;
+
     .label {
       white-space: nowrap;
     }
@@ -784,13 +816,16 @@ export default {
   margin: 15px 0;
   padding: 30px 15px;
   background: #f5f7fa;
+
   .title {
     display: flex;
     justify-content: space-between;
     align-items: center;
+
     .left {
       font-size: 16px;
       font-weight: 700;
+
       span {
         font-weight: normal;
         margin-left: 20px;
@@ -798,30 +833,37 @@ export default {
         color: #666;
       }
     }
+
     .right {
       display: flex;
       align-items: center;
       font-size: 14px;
+
       span {
         margin-right: 10px;
       }
     }
   }
+
   .main {
     margin-top: 20px;
     display: flex;
+
     .rate-list {
       font-size: 14px;
       flex-shrink: 0;
     }
+
     .tag-list {
       margin-left: 30px;
+
       ::v-deep .el-tag {
         margin-right: 10px;
         margin-bottom: 10px;
       }
     }
   }
+
   .content {
     width: 400px;
     line-height: 20px;
@@ -829,11 +871,13 @@ export default {
     color: #333;
     margin-top: 10px;
   }
+
   .img-list {
     display: flex;
     flex-wrap: wrap;
     margin-top: 10px;
     width: 400px;
+
     ::v-deep .el-image {
       width: 100px;
       height: 100px;
@@ -843,5 +887,4 @@ export default {
     }
   }
 }
-
 </style>