소스 검색

【修改】 返利

howie 2 년 전
부모
커밋
d51e0c3e35
2개의 변경된 파일144개의 추가작업 그리고 410개의 파일을 삭제
  1. 91 124
      src/views/finance/change_apply.vue
  2. 53 286
      src/views/finance/rebate_form.vue

+ 91 - 124
src/views/finance/change_apply.vue

@@ -13,13 +13,7 @@
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="单据日期" prop="theTime">
-              <el-date-picker
-                disabled
-                class="dateStyle"
-                placeholder="系统自动生成"
-                type="datetime"
-                value-format="yyyy-MM-dd HH:mm:ss"
-              >
+              <el-date-picker disabled class="dateStyle" placeholder="系统自动生成" type="datetime" value-format="yyyy-MM-dd HH:mm:ss">
               </el-date-picker>
             </el-form-item>
           </el-col>
@@ -49,53 +43,28 @@
     <!-- 列表 -->
     <div class="mymain-container">
       <div class="table">
-        <el-table
-          v-loading="listLoading"
-          :data="dataList"
-          element-loading-text="Loading"
-          border
-          fit
-          highlight-current-row
-          stripe
-        >
+        <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
           <el-table-column label="序号" type="index" align="left" width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
               <div v-if="scope.$index == 0">{{ searchForm.customerNumber }}</div>
               <div v-if="scope.$index == 1">{{ scope.row.customerNumber }}</div>
+
             </template>
           </el-table-column>
           <el-table-column align="left" label="经销商名称" prop="customerName" min-width="260" show-overflow-tooltip>
             <template slot-scope="scope">
               <div v-if="scope.$index == 0">{{ searchForm.customerName }}</div>
-              <el-select
-                size="mini"
-                class="dateStyle"
-                @change="changeCustomerFn1($event, scope.$index, scope.row)"
-                v-if="scope.$index == 1"
-                filterable
-                v-model="scope.row.customerId"
-                placeholder="请选择"
-              >
-                <el-option v-for="item in customerData" :key="item.id" :label="item.name" :value="item.id"> </el-option>
+              <el-select size="mini" class='dateStyle' @change="changeCustomerFn1($event, scope.$index, scope.row)" v-if="scope.$index == 1" filterable v-model="scope.row.customerId" placeholder="请选择">
+                <el-option v-for="item in customerData" :key="item.id" :label="item.name" :value="item.id">
+                </el-option>
               </el-select>
             </template>
           </el-table-column>
           <el-table-column align="left" label="返利类型" prop="name" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-select
-                size="mini"
-                filterable
-                v-model="scope.row.name"
-                placeholder="请选择"
-                @click.native="changeCustomerFn(scope.row, scope.$index)"
-              >
-                <el-option
-                  v-for="item in scope.row.typeList"
-                  :key="item.customerWalletId"
-                  :label="item.name"
-                  :value="item.customerWalletId"
-                >
+              <el-select size="mini" filterable v-model="scope.row.name" placeholder="请选择" @click.native="changeCustomerFn(scope.row, scope.$index)">
+                <el-option v-for="item in scope.row.typeList" :key="item.customerWalletId" :label="item.name" :value="item.customerWalletId">
                 </el-option>
               </el-select>
             </template>
@@ -108,13 +77,8 @@
           <el-table-column align="left" label="折让金额" prop="" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
               <div v-if="scope.$index == 0"></div>
-              <el-input
-                v-if="scope.$index == 1"
-                size="mini"
-                type="number"
-                @mousewheel.native.prevent
-                v-model="scope.row.allowanceAmount"
-              ></el-input>
+              <el-input v-if="scope.$index == 1" size="mini" type="number" @mousewheel.native.prevent v-model="scope.row.allowanceAmount"></el-input>
+
             </template>
           </el-table-column>
           <el-table-column align="left" label="备注" prop="" min-width="160" show-overflow-tooltip>
@@ -137,14 +101,14 @@
 </template>
 
 <script>
-import { mapGetters } from 'vuex'
+import { mapGetters } from "vuex";
 import {
   getUserInfo,
   getWalletCustomerList,
   getTransferAdd,
   getTransferSubmit,
-  getCustomerGroupList
-} from '@/api/finance/change_apply'
+  getCustomerGroupList,
+} from "@/api/finance/change_apply";
 
 export default {
   data() {
@@ -152,29 +116,29 @@ export default {
       listLoading: false, // 列表加载loading
       dataList: [
         {
-          customerNumber: '',
-          customerId: '',
-          name: '',
-          money: '',
-          bz: ''
+          customerNumber: "",
+          customerId: "",
+          name: "",
+          money: "",
+          bz: "",
         },
         {
-          customerNumber: '',
-          customerId: '',
-          name: '',
-          money: '',
-          bz: '',
-          allowanceAmount: ''
-        }
+          customerNumber: "",
+          customerId: "",
+          name: "",
+          money: "",
+          bz: "",
+          allowanceAmount: "",
+        },
       ],
       searchForm: {
-        customerId: '',
-        customerName: '',
-        nickName: '',
-        customerNumber: ''
+        customerId: "",
+        customerName: "",
+        nickName: "",
+        customerNumber: "",
       },
       customerData: [], //经销商数据
-      typeList: [] //返利类型数据
+      typeList: [], //返利类型数据
       // rules: {
       //   theTime: [
       //     {
@@ -184,14 +148,14 @@ export default {
       //     },
       //   ],
       // },
-    }
+    };
   },
   computed: {
-    ...mapGetters(['userid'])
+    ...mapGetters(["userid"]),
   },
   created() {
-    this.getUserInfoFn()
-    this.getCustomerData()
+    this.getUserInfoFn();
+    this.getCustomerData();
   },
   methods: {
     //选择经销商名称事件
@@ -201,13 +165,13 @@ export default {
 
       const res = await getWalletCustomerList({
         customerId: v,
-        type: 'REBATE'
-      })
+        type: "REBATE",
+      });
       // console.log(res, 7878);
-      const res2 = this.customerData.filter(i => i.id == v)
+      const res2 = this.customerData.filter((i) => i.id == v);
       // console.log(res2, 8888);
 
-      this.$set(this.dataList[1], 'customerNumber', res2[0].number)
+      this.$set(this.dataList[1], "customerNumber", res2[0].number);
       // this.$set(this.dataList[index], "customerName", res2[0].name);
 
       // this.$set(this.dataList[index], "walletList", res.data);
@@ -227,28 +191,30 @@ export default {
     // },
 
     resetFn() {
-      this.searchForm.theTime = null
-      this.dataList.forEach(v => {
-        v.money = ''
-        v.bz = ''
-        v.name = ''
-      })
-      this.dataList[1].customerId = ''
+      // this.searchForm.theTime = null;
+      this.dataList.forEach((v) => {
+        v.money = "";
+        v.bz = "";
+        v.name = "";
+      });
+      this.dataList[1].customerId = "";
+      this.dataList[1].customerNumber = "";
+      this.dataList[1].allowanceAmount = "";
     },
 
     // //返利类型数据
     async changeCustomerFn(v, index) {
-      if (v.customerId == '') {
-        return
+      if (v.customerId == "") {
+        return;
       }
 
-      v.name = ''
+      v.name = "";
       let res = await getWalletCustomerList({
         customerId: v.customerId,
-        type: 'REBATE'
-      })
+        type: "REBATE",
+      });
 
-      this.$set(this.dataList[index], 'typeList', res.data)
+      this.$set(this.dataList[index], "typeList", res.data);
 
       // if (index == 1) {
       //   let aa = res.data.filter(
@@ -271,9 +237,9 @@ export default {
 
     //查询同个集团的经销商数据
     async getCustomerData() {
-      const res = await getCustomerGroupList()
+      const res = await getCustomerGroupList();
       // console.log(res, 123214);
-      this.customerData = res.data
+      this.customerData = res.data;
     },
 
     //保存
@@ -284,40 +250,41 @@ export default {
       // let receiverRemark;
       // let amount;
 
-      await this.$refs.searchForm.validate()
+      await this.$refs.searchForm.validate();
 
-      let aaa = this.dataList.find(v => {
-        if (v.money == '') {
-          this.$message.error('请输入返利金额')
-          return v
+      let aaa = this.dataList.find((v) => {
+        if (v.money == "") {
+          this.$message.error("请输入返利金额");
+          return v;
         }
-        if (v.customerId == '') {
-          this.$message.error('请选择经销商')
-          return v
+        if (v.customerId == "") {
+          this.$message.error("请选择经销商");
+          return v;
         }
-        if (v.name == '') {
-          this.$message.error('请选择返利类型')
-          return v
+        if (v.name == "") {
+          this.$message.error("请选择返利类型");
+          return v;
         }
-      })
+      });
 
       if (aaa != undefined) {
-        return
+        return;
       }
       if (this.dataList[0].money > 0) {
-        this.$message.error('转出金额必须为负数')
-        return
+        this.$message.error("转出金额必须为负数");
+        return;
       }
       if (this.dataList[1].money < 0 && this.dataList[1].allowanceAmount < 0) {
-        this.$message.error('转入金额必须为正数')
-        return
+        this.$message.error("转入金额必须为正数");
+        return;
       }
       if (
         Number(-this.dataList[0].money) !=
-        Number(this.dataList[1].money) + Number(this.dataList[1].allowanceAmount)
+        Number(this.dataList[1].money) +
+          Number(this.dataList[1].allowanceAmount)
       ) {
-        this.$message.error('转入转出金额不等,请重新输入')
-        return
+        this.$message.error("转入转出金额不等,请重新输入");
+        return;
       }
 
       // if (this.dataList[0].money > 0) {
@@ -341,21 +308,21 @@ export default {
         receiverWalletRebateId: this.dataList[1].name,
         allowanceAmount: this.dataList[1].allowanceAmount,
         initiatorRemark: this.dataList[0].bz,
-        receiverRemark: this.dataList[1].bz
-      }
-
-      await getTransferAdd(params)
+        receiverRemark: this.dataList[1].bz,
+      };
 
-      this.$router.push('/finance/rebate/change_list')
-      this.$message.success('申请成功')
+      await getTransferAdd(params);
+      this.resetFn();
+      this.$router.push("/finance/rebate/change_list");
+      this.$message.success("申请成功");
     },
     async getUserInfoFn() {
-      const res = await getUserInfo({ adminUserId: this.userid })
-      this.searchForm.customerNumber = res.data.customerNumber
-      this.dataList[0].customerId = res.data.customerId
-      this.searchForm.customerName = res.data.customerName
-      this.searchForm.customerNumber = res.data.customerNumber
-      this.searchForm.nickName = res.data.nickName
+      const res = await getUserInfo({ adminUserId: this.userid });
+      this.searchForm.customerNumber = res.data.customerNumber;
+      this.dataList[0].customerId = res.data.customerId;
+      this.searchForm.customerName = res.data.customerName;
+      this.searchForm.customerNumber = res.data.customerNumber;
+      this.searchForm.nickName = res.data.nickName;
       // const res2 = await getWalletCustomerList({
       //   customerId: res.data.customerId,
       //   type: "REBATE",
@@ -367,9 +334,9 @@ export default {
       // });
       // this.dataList = res2.data;
       // console.log(this.dataList);
-    }
-  }
-}
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>

+ 53 - 286
src/views/finance/rebate_form.vue

@@ -4,13 +4,7 @@
     <el-divider />
     <!-- 表头 -->
     <div>
-      <el-form
-        ref="searchForm"
-        :model="searchForm"
-        label-width="100px"
-        size="mini"
-        label-position="left"
-      >
+      <el-form ref="searchForm" :model="searchForm" label-width="100px" size="mini" label-position="left">
         <el-row :gutter="20">
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="返利单号" prop="">
@@ -19,15 +13,7 @@
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="返利日期" prop="">
-              <el-date-picker
-                v-model="searchForm.theTime"
-                disabled
-                class="selectStyle"
-                type="datetime"
-                placeholder="系统自动生成"
-                default-time="23:59:59"
-                value-format="yyyy-MM-dd HH:mm:ss"
-              />
+              <el-date-picker v-model="searchForm.theTime" disabled class="selectStyle" type="datetime" placeholder="系统自动生成" default-time="23:59:59" value-format="yyyy-MM-dd HH:mm:ss" />
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
@@ -37,11 +23,7 @@
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="制单人" prop="">
-              <el-input
-                v-model="searchForm.createBy"
-                disabled
-                placeholder="请输入"
-              />
+              <el-input v-model="searchForm.createBy" disabled placeholder="请输入" />
             </el-form-item>
           </el-col>
           <!-- <el-col :xs="24" :sm="12" :lg="6">
@@ -63,38 +45,18 @@
     <!-- 按钮 -->
     <div class="btn-group clearfix">
       <div class="fl">
-        <el-popconfirm
-          v-if="$checkBtnRole('del', $route.meta.roles)"
-          title="这是一段内容确定删除吗?"
-          @onConfirm="delSeletFn"
-        >
-          <el-button
-            slot="reference"
-            :disabled="selectList.length < 1"
-            type="danger"
-            size="mini"
-            class="textColor delStyle"
-            icon="el-icon-minus"
-            >批量删除</el-button
-          >
+        <el-popconfirm v-if="$checkBtnRole('del', $route.meta.roles)" title="这是一段内容确定删除吗?" @onConfirm="delSeletFn">
+          <el-button slot="reference" :disabled="selectList.length < 1" type="danger" size="mini" class="textColor delStyle" icon="el-icon-minus">批量删除</el-button>
         </el-popconfirm>
       </div>
       <div class="fr">
-        <el-button type="primary" size="mini" @click="downLoadFn"
-          >模板</el-button
-        >
+        <el-button type="primary" size="mini" @click="downLoadFn">模板</el-button>
         <!-- <a href="/rebate/order/download">下载文件</a> -->
         <!-- <el-button type="primary" size="mini" @click="importFn"
           >批量导入</el-button
         > -->
 
-        <el-upload
-          class="import-btn"
-          action=""
-          :http-request="handleImport"
-          :file-list="importFileList"
-          :show-file-list="false"
-        >
+        <el-upload class="import-btn" action="" :http-request="handleImport" :file-list="importFileList" :show-file-list="false">
           <el-button type="primary" size="mini">批量导入</el-button>
         </el-upload>
       </div>
@@ -102,281 +64,91 @@
     <!-- 列表 -->
     <div class="mymain-container">
       <div class="table">
-        <el-table
-          v-loading="listLoading"
-          :data="dataList"
-          element-loading-text="Loading"
-          border
-          fit
-          highlight-current-row
-          stripe
-          :row-class-name="rouClassNameFn"
-          show-summary
-          :summary-method="getSummaries"
-          @row-click="onRowClick"
-          @selection-change="selectionChange"
-        >
-          <el-table-column
-            align="center"
-            type="selection"
-            width="51"
-            show-overflow-tooltip
-          />
-          <el-table-column
-            align="left"
-            label="经销商编码"
-            prop="customerNumber"
-            min-width="160"
-            show-overflow-tooltip
-          >
+        <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe :row-class-name="rouClassNameFn" show-summary :summary-method="getSummaries" @row-click="onRowClick" @selection-change="selectionChange">
+          <el-table-column align="center" type="selection" width="51" show-overflow-tooltip />
+          <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input
-                v-model="scope.row.customerNumber"
-                style="width: 100%"
-                size="mini"
-                disabled
-              />
+              <el-input v-model="scope.row.customerNumber" style="width: 100%" size="mini" disabled />
             </template>
           </el-table-column>
-          <el-table-column
-            align="left"
-            label="经销商名称"
-            prop="customerName"
-            min-width="300"
-            show-overflow-tooltip
-          >
+          <el-table-column align="left" label="经销商名称" prop="customerName" min-width="300" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-select
-                v-model="scope.row.customerId"
-                style="width: 100%"
-                size="mini"
-                placeholder="请选择"
-                filterable
-                @change="changeCustomerFn($event, scope.$index, scope.row)"
-              >
-                <el-option
-                  v-for="item in customerData"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                />
+              <el-select v-model="scope.row.customerId" style="width: 100%" size="mini" placeholder="请选择" filterable @change="changeCustomerFn($event, scope.$index, scope.row)">
+                <el-option v-for="item in customerData" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </template>
           </el-table-column>
-          <el-table-column
-            align="left"
-            label="返利类型"
-            prop="customerWalletId"
-            min-width="160"
-            show-overflow-tooltip
-          >
+          <el-table-column align="left" label="返利类型" prop="customerWalletId" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-select
-                v-model="scope.row.customerWalletId"
-                style="width: 100%"
-                size="mini"
-                placeholder="请选择"
-                filterable
-              >
-                <el-option
-                  v-for="item in scope.row.walletList"
-                  :key="item.customerWalletId"
-                  :label="item.name"
-                  :value="item.customerWalletId"
-                />
+              <el-select v-model="scope.row.customerWalletId" style="width: 100%" size="mini" placeholder="请选择" filterable>
+                <el-option v-for="item in scope.row.walletList" :key="item.customerWalletId" :label="item.name" :value="item.customerWalletId" />
               </el-select>
             </template>
           </el-table-column>
-          <el-table-column
-            align="right"
-            label="返利总金额"
-            prop="amount"
-            min-width="160"
-            show-overflow-tooltip
-          >
+          <el-table-column align="right" label="返利总金额" prop="amount" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input
-                v-model="scope.row.amount"
-                size="mini"
-                style="width: 100%"
-                class="mountclass"
-                type="number"
-                @mousewheel.native.prevent
-              />
+              <el-input v-model="scope.row.amount" size="mini" style="width: 100%" class="mountclass" type="number" @mousewheel.native.prevent />
             </template>
           </el-table-column>
-          <el-table-column
-            align="right"
-            label="暂扣返利"
-            prop="withholdAmount"
-            min-width="160"
-            show-overflow-tooltip
-          >
+          <el-table-column align="right" label="暂扣返利" prop="withholdAmount" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input
-                v-model="scope.row.withholdAmount"
-                style="width: 100%"
-                size="mini"
-                class="mountclass"
-                type="number"
-                @mousewheel.native.prevent
-              />
+              <el-input v-model="scope.row.withholdAmount" style="width: 100%" size="mini" class="mountclass" type="number" @mousewheel.native.prevent />
             </template>
           </el-table-column>
-          <el-table-column
-            align="left"
-            label="政策文件流水号"
-            prop="policyFileNo"
-            min-width="160"
-            show-overflow-tooltip
-          >
+          <el-table-column align="left" label="政策文件流水号" prop="policyFileNo" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input
-                v-model="scope.row.policyFileNo"
-                style="width: 100%"
-                size="mini"
-              />
+              <el-input v-model="scope.row.policyFileNo" style="width: 100%" size="mini" />
             </template>
           </el-table-column>
-          <el-table-column
-            align="left"
-            label="政策文号"
-            prop="policyDocNo"
-            min-width="160"
-            show-overflow-tooltip
-          >
+          <el-table-column align="left" label="政策文号" prop="policyDocNo" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input
-                v-model="scope.row.policyDocNo"
-                style="width: 100%"
-                size="mini"
-              />
+              <el-input v-model="scope.row.policyDocNo" style="width: 100%" size="mini" />
             </template>
           </el-table-column>
-          <el-table-column
-            align="left"
-            label="政策年份"
-            prop="policyYear"
-            min-width="160"
-            show-overflow-tooltip
-          >
+          <el-table-column align="left" label="政策年份" prop="policyYear" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input
-                v-model="scope.row.policyYear"
-                style="width: 100%"
-                size="mini"
-              />
+              <el-input v-model="scope.row.policyYear" style="width: 100%" size="mini" />
             </template>
           </el-table-column>
-          <el-table-column
-            align="left"
-            label="政策月份"
-            prop="policyMonth"
-            min-width="160"
-            show-overflow-tooltip
-          >
+          <el-table-column align="left" label="政策月份" prop="policyMonth" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input
-                v-model="scope.row.policyMonth"
-                style="width: 100%"
-                size="mini"
-              />
+              <el-input v-model="scope.row.policyMonth" style="width: 100%" size="mini" />
             </template>
           </el-table-column>
-          <el-table-column
-            align="left"
-            label="政策归属部门"
-            prop="policyOrg"
-            min-width="160"
-            show-overflow-tooltip
-          >
+          <el-table-column align="left" label="政策归属部门" prop="policyOrg" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input
-                v-model="scope.row.policyOrg"
-                style="width: 100%"
-                size="mini"
-              />
+              <el-input v-model="scope.row.policyOrg" style="width: 100%" size="mini" />
             </template>
           </el-table-column>
-          <el-table-column
-            align="left"
-            label="客户区域"
-            prop="customerArea"
-            min-width="160"
-            show-overflow-tooltip
-          >
+          <el-table-column align="left" label="客户区域" prop="customerArea" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input
-                v-model="scope.row.customerArea"
-                style="width: 100%"
-                size="mini"
-              />
+              <el-input v-model="scope.row.customerArea" style="width: 100%" size="mini" />
             </template>
           </el-table-column>
-          <el-table-column
-            align="left"
-            label="客户属性"
-            prop="customerAttr"
-            min-width="160"
-            show-overflow-tooltip
-          >
+          <el-table-column align="left" label="客户属性" prop="customerAttr" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input
-                v-model="scope.row.customerAttr"
-                style="width: 100%"
-                size="mini"
-              />
+              <el-input v-model="scope.row.customerAttr" style="width: 100%" size="mini" />
             </template>
           </el-table-column>
-          <el-table-column
-            align="left"
-            label="建立实际归属客户"
-            prop="rewardActualCustomers"
-            min-width="160"
-            show-overflow-tooltip
-          >
+          <el-table-column align="left" label="建立实际归属客户" prop="rewardActualCustomers" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input
-                v-model="scope.row.rewardActualCustomers"
-                style="width: 100%"
-                size="mini"
-              />
+              <el-input v-model="scope.row.rewardActualCustomers" style="width: 100%" size="mini" />
             </template>
           </el-table-column>
-          <el-table-column
-            align="left"
-            label="备注1"
-            prop="remark1"
-            min-width="160"
-            show-overflow-tooltip
-          >
+          <el-table-column align="left" label="备注1" prop="remark1" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input
-                v-model="scope.row.remark1"
-                style="width: 100%"
-                size="mini"
-              />
+              <el-input v-model="scope.row.remark1" style="width: 100%" size="mini" />
             </template>
           </el-table-column>
-          <el-table-column
-            align="left"
-            label="备注2"
-            prop="remark2"
-            min-width="160"
-            show-overflow-tooltip
-          >
+          <el-table-column align="left" label="备注2" prop="remark2" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input
-                v-model="scope.row.remark2"
-                style="width: 100%"
-                size="mini"
-              />
+              <el-input v-model="scope.row.remark2" style="width: 100%" size="mini" />
             </template>
           </el-table-column>
         </el-table>
       </div>
     </div>
-    <br />
+    <br>
 
     <!-- 按钮 -->
     <div class="btn-group clearfix">
@@ -388,12 +160,8 @@
         <el-button type="primary" size="mini" @click="cancelFn">重置</el-button>
       </div>
       <div class="fr">
-        <el-button type="primary" size="mini" @click="addRowFn"
-          >添加行</el-button
-        >
-        <el-button type="primary" size="mini" @click="delRowFn"
-          >删除行</el-button
-        >
+        <el-button type="primary" size="mini" @click="addRowFn">添加行</el-button>
+        <el-button type="primary" size="mini" @click="delRowFn">删除行</el-button>
       </div>
     </div>
   </div>
@@ -446,10 +214,6 @@ export default {
     this.getCustomerData();
     this.searchForm.createBy = this.name;
   },
-  // activated() {
-  //   Object.assign(this.$data, this.$options.data());
-  //   this.getCustomerData();
-  // },
   methods: {
     // 合计
     getSummaries(param) {
@@ -564,12 +328,14 @@ export default {
     },
     // 重置
     cancelFn() {
-      this.searchForm = {
-        theTime: "",
-        createTime: "",
-        remark: "",
-        createBy: "",
-      };
+      // this.searchForm = {
+      //   theTime: '',
+      //   createTime: '',
+      //   remark: '',
+      //   createBy: ''
+      // }
+      this.searchForm.remark = "";
+      this.dataList = [];
     },
     rouClassNameFn({ row, rowIndex }) {
       // 把每一行的索引放进row
@@ -603,6 +369,7 @@ export default {
       });
       await getRebateOrderAdd({ ...this.searchForm, items: this.dataList });
       this.$message.success("保存成功");
+      this.cancelFn();
       this.$router.push("/finance/rebate/rebate_list");
     },
     // 选择经销商名称事件