Browse Source

返利互转搜索条件更改

chen 2 năm trước cách đây
mục cha
commit
b7c0b16690
1 tập tin đã thay đổi với 28 bổ sung29 xóa
  1. 28 29
      src/views/finance/change_list.vue

+ 28 - 29
src/views/finance/change_list.vue

@@ -21,6 +21,11 @@
                 <el-input v-model="searchForm.id" placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="经销商名称" prop="customerName">
+                <el-input v-model="searchForm.customerName" placeholder="请输入"></el-input>
+              </el-form-item>
+            </el-col>
 
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="返利类型" prop="walletName">
@@ -34,7 +39,7 @@
               </el-form-item>
             </el-col>
 
-            <el-col :xs="24" :sm="12" :lg="6">
+            <el-col :xs="24" :sm="12" :lg="24">
               <el-form-item label="" class="fr">
                 <el-button size="mini" @click="clearFn">清空</el-button>
                 <el-button size="mini" type="primary" @click="searchFn">搜索</el-button>
@@ -202,6 +207,7 @@ export default {
       listTotal: 0, // 列表总数
       dataList: [], // 列表数据
       searchForm: {
+        customerName: "",
         startTime: "",
         walletName: "",
         id: "",
@@ -215,55 +221,56 @@ export default {
   created() {
     const res = JSON.parse(localStorage.getItem("supply_user"));
     this.isCustomer = res.isCustomer;
-    this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
+    this.getDataList();
   },
   methods: {
     //取消
     async cancelFn(id) {
       await getTransferCancel({ id });
-      this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
+      this.getDataList();
       this.$message.success("取消成功");
     },
     //切换radio
     changeRadioGroupFn(v) {
       // console.log(v);
       this.currentPage = 1;
-      this.pageSize = 10;
-      this.getDataList({
-        pageSize: this.pageSize,
-        pageNum: this.currentPage,
-        examineStatus: v,
-      });
+
+      this.getDataList();
     },
     //撤回
     withdrawFn() {},
     //刷新
     refreshFn() {
-      this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
+      this.getDataList();
     },
     //提审
     async submitFn(id) {
       await getTransferSubmit({ id });
       this.$message.success("提审成功");
-      this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
+      this.getDataList();
     },
     //清空
     clearFn() {
-      console.log(this.$refs.searchForm);
       this.$refs.searchForm.resetFields();
     },
     //搜索
     searchFn() {
-      this.getDataList({
-        ...this.searchForm,
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-      });
+      this.currentPage = 1;
+      this.getDataList();
     },
 
     //获取列表数据
-    async getDataList(data) {
-      const res = await getChangeList(data);
+    async getDataList() {
+      let params = {
+        pageNum: this.currentPage,
+        pageSize: this.pageSize,
+        customerName: this.searchForm.customerName,
+        examineStatus: this.category,
+        id: this.searchForm.id,
+        startTime: this.searchForm.startTime,
+        walletName: this.searchForm.walletName,
+      };
+      const res = await getChangeList(params);
       // console.log(res);
       res.data.records.forEach((item) => {
         item.sums1 = [];
@@ -297,20 +304,12 @@ export default {
     handleSizeChange(val) {
       this.pageSize = val;
       this.currentPage = 1;
-      this.getDataList({
-        pageNum: 1,
-        pageSize: this.pageSize,
-        examineStatus: this.category,
-      });
+      this.getDataList();
     },
     // 更改当前页
     handleCurrentChange(val) {
       this.currentPage = val;
-      this.getDataList({
-        pageNum: val,
-        pageSize: 10,
-        examineStatus: this.category,
-      });
+      this.getDataList();
     },
   },
 };