Explorar el Código

个人中心退款调整

natasha hace 1 mes
padre
commit
59fcc42830
Se han modificado 1 ficheros con 25 adiciones y 9 borrados
  1. 25 9
      src/views/personalCenter/components/OrderList.vue

+ 25 - 9
src/views/personalCenter/components/OrderList.vue

@@ -144,7 +144,7 @@
       </el-table-column>
       <el-table-column prop="status" label="操作" width="100" fixed="right">
         <template slot-scope="scope">
-          <template v-if="scope.row.is_can_submit_refund_apply === 'true'">
+          <template v-if="scope.row.is_use_discount_code == 'false'">
             <a class="apply" @click="handleApply(scope.row, scope.$index)"
               >申请退款</a
             >
@@ -396,24 +396,40 @@ export default {
     },
     // 申请退款
     handleApply(obj, index) {
-      let updataData = JSON.parse(JSON.stringify(obj));
       this.$confirm("确定申请退款吗?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
       })
         .then(() => {
-          let Mname = "/ShopServer/Client/OrderManager/SubmitOrderRefundApply";
           let data = {
             order_id: obj.id,
           };
-          getLogin(Mname, data).then((res) => {
+          getLogin(
+            "/ShopServer/Client/OrderManager/CheckOrderIsCanSubmitRefundApply",
+            data
+          ).then((res) => {
             if (res.status === 1) {
-              this.$message({
-                type: "success",
-                message: "申请成功!",
-              });
-              this.getList();
+              if (res.is_can_submit_refund_apply === "true") {
+                let Mname =
+                  "/ShopServer/Client/OrderManager/SubmitOrderRefundApply";
+
+                getLogin(Mname, data).then((res) => {
+                  if (res.status === 1) {
+                    this.$message({
+                      type: "success",
+                      message: "申请成功!",
+                    });
+                    this.getList();
+                  }
+                });
+              } else {
+                this.$confirm(res.cannot_submit_reason, "不可退款原因", {
+                  confirmButtonText: "确定",
+                  showCancelButton: false,
+                  type: "warning",
+                });
+              }
             }
           });
         })