YY 2 vuotta sitten
vanhempi
commit
f567047dcf

+ 7 - 6
src/views/platmanag/sales/detail.vue

@@ -72,7 +72,7 @@
           </el-col>
           <el-col :span="24" v-if="info.type == '1' || info.type == '2' || info.type == '4' || info.type == '5'">
             <el-col :span="6">退款金额</el-col>
-            <el-col :span="18" class="other">{{ info.money }}</el-col>
+            <el-col :span="18" class="other">{{ info.money || '' }}</el-col>
           </el-col>
           <el-col :span="24">
             <el-col :span="6">售后状态</el-col>
@@ -92,8 +92,8 @@
           </el-col>
         </el-col>
         <el-col :span="12" class="two">
-          <steps-1 v-if="info.type == '1'" @exam="exam" :active="active"></steps-1>
-          <steps-2 v-if="info.type == '2'" @exam="exam" :active="active" :customer="customer" :activit="activit"></steps-2>
+          <steps-1 v-if="info.type == '1'" @exam="exam" :active="active" :form="form" :info="info"></steps-1>
+          <steps-2 v-if="info.type == '2'" @exam="exam" :active="active" :customer="customer" :activit="activit" :form="form" :info="info"></steps-2>
           <steps-3
             v-if="info.type == '3'"
             @exam="exam"
@@ -238,7 +238,7 @@ export default {
                 let shopList = res.data.shop.list;
                 this.$set(this, `shopList`, shopList);
                 shopList[0].color = '#0bbd87';
-                if (res.data.shop.is_check == '已签收' && this.info.status == '3') this.$set(this, `active`, 4);
+                if (res.data.shop.is_check == '已签收' && this.info.status == '3') this.$set(this, `active`, 5);
               }
               this.$set(this, `activit`, res.data);
             }
@@ -247,7 +247,7 @@ export default {
         this.loading = false;
       }
     },
-    async exam(status) {
+    async exam(status, form) {
       let info = this.info;
       info.status = status;
       if (status == '-2' && info.transport) info.transport.shop_receive = true;
@@ -262,7 +262,9 @@ export default {
         transport.customer_receive = true;
         info.transport = transport;
       }
+      if (form != undefined && form.money != undefined && (status == '2' || status == '1')) info.money = form.money;
       let res;
+      console.log(info);
       this.$confirm('是否确认修改售后状态', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
@@ -296,7 +298,6 @@ export default {
         this.search();
       }
     },
-
     // 查询其他信息
     async searchOther() {
       let res;

+ 23 - 5
src/views/platmanag/sales/parts/steps-2.vue

@@ -11,12 +11,24 @@
         <el-col :span="24">
           <el-col v-if="active == 0"> 买家已申请退货 </el-col>
           <el-col v-if="active == 1" style="text-align: center; margin: 15px 0; font-size: 18px">
-            <el-button type="primary" @click="exam('2')">同意售后,处理退货</el-button>
-            <el-button type="primary" @click="exam('!2')">拒绝</el-button>
+            <el-form :model="form" ref="form" label-width="100px" class="demo-ruleForm">
+              <el-form-item label="退款金额" prop="money">
+                <el-input v-model="form.money" placeholder="请输入退款金额" size="small" type="Number" @input="toMoney"></el-input>
+                <p class="p1">
+                  用于部分退款,退款金额不得超过<span>{{ info.money || '退款最大金额' }}元</span>
+                </p>
+              </el-form-item>
+              <el-form-item>
+                <el-col>
+                  <el-button type="primary" @click="exam('2')">同意售后,处理退货</el-button>
+                  <el-button type="primary" @click="exam('!2')">拒绝</el-button>
+                </el-col>
+              </el-form-item>
+            </el-form>
           </el-col>
-          <el-col v-if="active == 2">
+          <el-col v-if="active == 2 || active == 3">
             <el-col :span="24" style="text-align: center; margin-top: 15px">
-              <el-button type="primary" style="margin: 10px 0" @click="exam('-2')">已退货</el-button>
+              <el-button type="primary" style="margin: 10px 0" @click="exam('-2')" v-if="active == 3">已退货</el-button>
             </el-col>
             <el-col :span="24" style="text-align: center; margin: 15px 0; font-size: 18px">买家{{ getCheck() || '暂无快递信息' }}</el-col>
             <el-col :span="24">
@@ -45,7 +57,7 @@ const _ = require('lodash');
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'steps-1',
-  props: { active: { type: Number }, customer: { type: Array }, activit: { type: Object } },
+  props: { active: { type: Number }, customer: { type: Array }, activit: { type: Object }, form: { type: Object }, info: { type: Object } },
   components: {},
   data: function () {
     return {
@@ -63,6 +75,12 @@ export default {
     getCheck() {
       return _.get(this.activit, 'customer.is_check');
     },
+    toMoney(val) {
+      if (val > this.info.money) {
+        this.$message.error('超过退款最大金额');
+        this.$set(this.form, `money`, '');
+      }
+    },
   },
   computed: {
     ...mapState(['user']),

+ 22 - 22
src/views/platmanag/sales/parts/steps-3.vue

@@ -27,30 +27,30 @@
           </el-col>
           <el-col v-if="active == 3">
             <el-col :span="24" style="text-align: center; margin: 15px 0; font-size: 18px">店铺{{ getCheck() || '暂无快递信息' }}</el-col>
-            <el-col>
-              <data-form :fields="infoFields" :rules="rules" v-model="form" labelWidth="150px" @save="onSubmit">
-                <template #shop_transport_type>
-                  <el-select
-                    v-model="form.shop_transport_type"
-                    filterable
-                    remote
-                    reserve-keyword
-                    placeholder="请选择快递类型,运单号,同时填入"
-                    :remote-method="querySearch"
-                    :loading="loading"
-                    @change="handleSelect"
-                    size="small"
-                    style="width: 100%"
-                  >
-                    <el-option v-for="item in shop_transport_typeList" :key="item.id" :label="item.label" :value="item.value"> </el-option>
-                  </el-select>
-                </template>
-              </data-form>
-            </el-col>
           </el-col>
-          <el-col v-if="active == 4">
+          <el-col v-if="active == 3 || active == 4">
+            <data-form :fields="infoFields" :rules="rules" v-model="form" labelWidth="150px" @save="onSubmit">
+              <template #shop_transport_type>
+                <el-select
+                  v-model="form.shop_transport_type"
+                  filterable
+                  remote
+                  reserve-keyword
+                  placeholder="请选择快递类型,运单号,同时填入"
+                  :remote-method="querySearch"
+                  :loading="loading"
+                  @change="handleSelect"
+                  size="small"
+                  style="width: 100%"
+                >
+                  <el-option v-for="item in shop_transport_typeList" :key="item.id" :label="item.label" :value="item.value"> </el-option>
+                </el-select>
+              </template>
+            </data-form>
+          </el-col>
+          <el-col v-if="active == 4 || active == 5">
             <el-col :span="24" style="text-align: center; margin-top: 15px">
-              <el-button type="primary" @click="exam('-3')" style="margin: 10px 0">已换货</el-button>
+              <el-button type="primary" @click="exam('-3')" style="margin: 10px 0" v-if="active == 5">已换货</el-button>
             </el-col>
             <el-col :span="24" style="text-align: center; margin: 15px 0; font-size: 18px" v-if="transport.customer_receive == true"
               >买家{{ getCheckOne() || '暂无快递信息' }}</el-col