소스 검색

台账更改

chen 2 년 전
부모
커밋
c0b9513a9b
4개의 변경된 파일215개의 추가작업 그리고 140개의 파일을 삭제
  1. 8 0
      src/api/finance/change_list.js
  2. 8 0
      src/views/finance/change_list.vue
  3. 2 2
      src/views/finance/rebate_list.vue
  4. 197 138
      src/views/finance/standbook_list.vue

+ 8 - 0
src/api/finance/change_list.js

@@ -40,6 +40,14 @@ export function getTransferEdit(params) {
     params,
   });
 }
+//返利互转-取消
+export function getTransferCancel(params) {
+  return request({
+    url: "/finance/transfer/cancel",
+    method: "post",
+    params,
+  });
+}
 //取消审核
 export function getRebateOrderCancel(params) {
   return request({

+ 8 - 0
src/views/finance/change_list.vue

@@ -159,6 +159,7 @@
                     $checkBtnRole('edit', $route.meta.roles)
                   " type="text" class="textColor" slot="reference" @click="editFn(scope.row.id)">修改</el-button>
                 <el-button @click="detailFn(scope.row.id)" type="text" class="textColor" slot="reference">详情</el-button>
+                <el-button v-if="scope.row.examineStatus == 'WAIT'" @click="cancelFn(scope.row.id)" type="text" class="textColor" slot="reference">取消</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -181,6 +182,7 @@ import {
   getChangeList,
   getChangeListDetail,
   getTransferSubmit,
+  getTransferCancel,
 } from "@/api/finance/change_list";
 import ChangeListDetail from "./components/change_list-detail";
 import ChangeListExamine from "./components/change_list-examine";
@@ -215,6 +217,12 @@ export default {
     this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
   },
   methods: {
+    //取消
+    async cancelFn(id) {
+      await getTransferCancel({ id });
+      this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
+      this.$message.success("取消成功");
+    },
     //切换radio
     changeRadioGroupFn(v) {
       // console.log(v);

+ 2 - 2
src/views/finance/rebate_list.vue

@@ -90,8 +90,8 @@
             </el-table-column>
             <el-table-column v-if="isCustomer" align="left" label="是否确认" prop="customerIsConfirm" min-width="160" show-overflow-tooltip>
               <template slot-scope="scope">
-                <el-tag v-show="scope.row.customerIsConfirm == true">已确认</el-tag>
-                <el-tag v-show="scope.row.customerIsConfirm == false">未确认</el-tag>
+                <el-tag size="mini" v-show="scope.row.customerIsConfirm == true">已确认</el-tag>
+                <el-tag size="mini" v-show="scope.row.customerIsConfirm == false">未确认</el-tag>
               </template>
             </el-table-column>
             <el-table-column align="left" label="返利单号" prop="rebateOrderId" min-width="200" show-overflow-tooltip>

+ 197 - 138
src/views/finance/standbook_list.vue

@@ -2,6 +2,7 @@
   <div class="app-container">
     <div class="sty" v-if="isShow">
       <el-page-header @back="goBack"> </el-page-header>
+      <br><br>
     </div>
 
     <!-- <span v-else>台账</span>
@@ -34,7 +35,7 @@
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="钱包" prop="customerWalletId">
+            <el-form-item label="返利类型" prop="customerWalletId">
               <el-select class="selectStyle" v-model="searchForm.customerWalletId" placeholder="请选择" filterable>
                 <el-option v-for="(v, i) in walletList" :key="i" :label="v.customerWalletName" :value="v.customerWalletId">
                 </el-option>
@@ -434,9 +435,9 @@ export default {
   },
   beforeRouteEnter(to, from, next) {
     // console.log(to, from, next, 898);
-    next((vm) => {
+    next(async (vm) => {
       // 这个时候组件还没有创建,所以要通过vm来访问
-      console.log(vm);
+      // console.log(vm);
       vm.getCustomerDataList();
       if (
         from.path == "/finance/details/balance_sum" &&
@@ -448,14 +449,16 @@ export default {
         vm.isShow = true;
         vm.isDisabled = true;
         vm.searchForm.customerId = vm.$route.query.customerId;
+        vm.searchForm.customerNumber = vm.$route.query.customerNumber;
         vm.changeFn(vm.$route.query.customerId);
         vm.getDataList({
           pageSize: vm.pageSize,
           pageNum: vm.currentPage,
           type: vm.bill,
-          customerName: vm.$route.query.customerName,
+          // customerName: vm.$route.query.customerName,
           customerNumber: vm.$route.query.customerNumber,
         });
+
         vm.getAmountList({
           type: vm.bill,
           customerName: vm.$route.query.customerName,
@@ -466,25 +469,44 @@ export default {
         vm.isDisabled = true;
         vm.searchForm.customerId = vm.$store.state.user.customerId;
         vm.changeFn(vm.$store.state.user.customerId);
+        vm.searchForm.customerId = vm.isCustomerList.customerId;
+        vm.searchForm.customerNumber = vm.isCustomerList.customerNumber;
         vm.getDataList({
           pageSize: vm.pageSize,
           pageNum: vm.currentPage,
           type: vm.bill,
-          ...vm.isCustomerList,
+          customerId: vm.searchForm.customerId,
+          customerNumber: vm.searchForm.customerNumber,
         });
+
         vm.getAmountList({
           type: vm.bill,
           ...vm.isCustomerList,
         });
-      } else {
-        vm.isShow = false;
-        vm.searchForm.customerId = "";
-        vm.isDisabled = false;
+      } else if (vm.$route.query && vm.$route.query.status) {
+        vm.bill = vm.$route.query.status;
+        vm.isShow = true;
+        vm.isDisabled = true;
+        vm.searchForm.customerId = vm.$route.query.customerId;
+        vm.searchForm.customerNumber = vm.$route.query.customerNumber;
+        vm.changeFn(vm.$route.query.customerId);
         vm.getDataList({
           pageSize: vm.pageSize,
           pageNum: vm.currentPage,
           type: vm.bill,
+          // customerName: this.$route.query.customerName,
+          customerNumber: vm.$route.query.customerNumber,
         });
+        vm.getAmountList({
+          type: vm.bill,
+          customerName: vm.$route.query.customerName,
+          customerNumber: vm.$route.query.customerNumber,
+        });
+      } else {
+        vm.isShow = false;
+        vm.searchForm.customerId = "";
+        vm.isDisabled = false;
+        vm.getDataList();
         vm.getCustomerDataList();
         vm.getAmountList({
           type: vm.bill,
@@ -521,31 +543,30 @@ export default {
 
   // },
   created() {
-    if (this.$route.query && this.$route.query.status) {
-      this.bill = this.$route.query.status;
-      this.changeFn(this.bill);
-      //只有是从A进到B页面才执行
-      // 将要执行的逻辑
-      this.isShow = true;
-      this.isDisabled = true;
-      this.searchForm.customerId = this.$route.query.customerId;
-      this.changeFn(this.$route.query.customerId);
-      this.getDataList({
-        pageSize: this.pageSize,
-        pageNum: this.currentPage,
-        type: this.bill,
-        customerName: this.$route.query.customerName,
-        customerNumber: this.$route.query.customerNumber,
-      });
-      this.getAmountList({
-        type: this.bill,
-        customerName: this.$route.query.customerName,
-        customerNumber: this.$route.query.customerNumber,
-      });
-    }
-
+    // if (this.$route.query && this.$route.query.status) {
+    //   this.bill = this.$route.query.status;
+    //   this.changeFn(this.bill);
+    //   //只有是从A进到B页面才执行
+    //   // 将要执行的逻辑
+    //   this.isShow = true;
+    //   this.isDisabled = true;
+    //   this.searchForm.customerId = this.$route.query.customerId;
+    //   this.searchForm.customerNumber = this.$route.query.customerNumber;
+    //   this.changeFn(this.$route.query.customerId);
+    //   this.getDataList({
+    //     pageSize: this.pageSize,
+    //     pageNum: this.currentPage,
+    //     type: this.bill,
+    //     // customerName: this.$route.query.customerName,
+    //     customerNumber: this.$route.query.customerNumber,
+    //   });
+    //   this.getAmountList({
+    //     type: this.bill,
+    //     customerName: this.$route.query.customerName,
+    //     customerNumber: this.$route.query.customerNumber,
+    //   });
+    // }
     // console.log(
-
     //   this.customerId,
     //   this.$store.state.user.customerName,
     //   this.$store.state.user.customerNumber,
@@ -791,31 +812,34 @@ export default {
       //   pageSize: this.pageSize,
       // });
       if (this.$route.query.customerName && this.$route.query.customerNumber) {
-        this.getDataList({
-          ...this.searchForm,
-          pageSize: this.pageSize,
-          pageNum: this.currentPage,
-          type: this.bill,
-          customerName: this.$route.query.customerName,
-          customerNumber: this.$route.query.customerNumber,
-        });
+        // this.getDataList({
+        //   ...this.searchForm,
+        //   pageSize: this.pageSize,
+        //   pageNum: this.currentPage,
+        //   type: this.bill,
+        //   customerName: this.$route.query.customerName,
+        //   customerNumber: this.$route.query.customerNumber,
+        // });
+        this.getDataList();
       } else if (this.isCustomer) {
-        this.getDataList({
-          ...this.searchForm,
-          pageSize: this.pageSize,
-          pageNum: this.currentPage,
-          type: this.bill,
-          ...this.isCustomerList,
-        });
+        // this.getDataList({
+        //   ...this.searchForm,
+        //   pageSize: this.pageSize,
+        //   pageNum: this.currentPage,
+        //   type: this.bill,
+        //   ...this.isCustomerList,
+        // });
+        this.getDataList();
       } else {
-        this.getDataList({
-          ...this.searchForm,
-          pageSize: this.pageSize,
-          pageNum: this.currentPage,
-          type: this.bill,
-          customerName: this.customerName,
-          customerNumber: this.customerNumber,
-        });
+        // this.getDataList({
+        //   ...this.searchForm,
+        //   pageSize: this.pageSize,
+        //   pageNum: this.currentPage,
+        //   type: this.bill,
+        //   customerName: this.customerName,
+        //   customerNumber: this.customerNumber,
+        // });
+        this.getDataList();
       }
     },
     // 更改当前页
@@ -827,31 +851,34 @@ export default {
       //   pageSize: this.pageSize,
       // });
       if (this.$route.query.customerName && this.$route.query.customerNumber) {
-        this.getDataList({
-          ...this.searchForm,
-          pageSize: this.pageSize,
-          pageNum: this.currentPage,
-          type: this.bill,
-          customerName: this.$route.query.customerName,
-          customerNumber: this.$route.query.customerNumber,
-        });
+        // this.getDataList({
+        //   ...this.searchForm,
+        //   pageSize: this.pageSize,
+        //   pageNum: this.currentPage,
+        //   type: this.bill,
+        //   customerName: this.$route.query.customerName,
+        //   customerNumber: this.$route.query.customerNumber,
+        // });
+        this.getDataList();
       } else if (this.isCustomer) {
-        this.getDataList({
-          ...this.searchForm,
-          pageSize: this.pageSize,
-          pageNum: this.currentPage,
-          type: this.bill,
-          ...this.isCustomerList,
-        });
+        // this.getDataList({
+        //   ...this.searchForm,
+        //   pageSize: this.pageSize,
+        //   pageNum: this.currentPage,
+        //   type: this.bill,
+        //   ...this.isCustomerList,
+        // });
+        this.getDataList();
       } else {
-        this.getDataList({
-          ...this.searchForm,
-          pageSize: this.pageSize,
-          pageNum: this.currentPage,
-          type: this.bill,
-          customerName: this.customerName,
-          customerNumber: this.customerNumber,
-        });
+        // this.getDataList({
+        //   ...this.searchForm,
+        //   pageSize: this.pageSize,
+        //   pageNum: this.currentPage,
+        //   type: this.bill,
+        //   customerName: this.customerName,
+        //   customerNumber: this.customerNumber,
+        // });
+        this.getDataList();
       }
     },
     // //获取品类
@@ -887,56 +914,60 @@ export default {
       let res = this.customerList.filter((v) => {
         return v.id == this.searchForm.customerId;
       });
-      console.log(res);
+
       // return;
       if (res.length > 0) {
         this.customerName = res[0].name;
         this.customerNumber = res[0].number;
+        this.searchForm.customerNumber = res[0].number;
       }
 
       if (this.$route.query.customerName && this.$route.query.customerNumber) {
-        this.getDataList({
-          ...this.searchForm,
-          pageSize: this.pageSize,
-          pageNum: this.currentPage,
-          type: this.bill,
-          customerName: this.$route.query.customerName,
-          customerNumber:
-            this.$route.query.customerNumber || this.searchForm.customerNumber,
-        });
+        // this.getDataList({
+        //   ...this.searchForm,
+        //   pageSize: this.pageSize,
+        //   pageNum: this.currentPage,
+        //   type: this.bill,
+        //   // customerName: this.$route.query.customerName,
+        //   customerNumber:
+        //     this.$route.query.customerNumber || this.searchForm.customerNumber,
+        // });
+        this.getDataList();
         this.getAmountList({
           ...this.searchForm,
           type: this.bill,
-          customerName: this.$route.query.customerName,
+          // customerName: this.$route.query.customerName,
           customerNumber: this.$route.query.customerNumber,
         });
       } else if (this.isCustomer) {
-        this.getDataList({
-          ...this.searchForm,
-          pageSize: this.pageSize,
-          pageNum: this.currentPage,
-          type: this.bill,
-          ...this.isCustomerList,
-        });
+        // this.getDataList({
+        //   ...this.searchForm,
+        //   pageSize: this.pageSize,
+        //   pageNum: this.currentPage,
+        //   type: this.bill,
+        //   ...this.isCustomerList,
+        // });
+        this.getDataList();
         this.getAmountList({
           ...this.searchForm,
           type: this.bill,
           ...this.isCustomerList,
         });
       } else {
-        this.getDataList({
-          ...this.searchForm,
-          customerName: this.customerName,
-          customerNumber: this.customerNumber || this.searchForm.customerNumber,
+        // this.getDataList({
+        //   ...this.searchForm,
+        //   // customerName: this.customerName,
+        //   customerNumber: this.customerNumber || this.searchForm.customerNumber,
 
-          pageSize: this.pageSize,
-          pageNum: this.currentPage,
-          type: this.bill,
-        });
+        //   pageSize: this.pageSize,
+        //   pageNum: this.currentPage,
+        //   type: this.bill,
+        // });
+        this.getDataList();
         this.getAmountList({
           ...this.searchForm,
           type: this.bill,
-          customerName: this.customerName,
+          // customerName: this.customerName,
           customerNumber: this.customerNumber,
         });
       }
@@ -961,18 +992,20 @@ export default {
       this.resetFn();
       this.pageSize = 10;
       this.currentPage = 1;
+      this.bill = v;
       if (this.$route.query.customerName && this.$route.query.customerNumber) {
         this.changeFn(this.$route.query.customerId);
-        this.getDataList({
-          ...this.searchForm,
+        // this.getDataList({
+        //   ...this.searchForm,
 
-          pageSize: this.pageSize,
-          pageNum: this.currentPage,
-          type: v,
-          customerId: this.$route.query.customerId,
-          customerName: this.$route.query.customerName,
-          customerNumber: this.$route.query.customerNumber,
-        });
+        //   pageSize: this.pageSize,
+        //   pageNum: this.currentPage,
+        //   type: v,
+        //   customerId: this.$route.query.customerId,
+        //   customerName: this.$route.query.customerName,
+        //   customerNumber: this.$route.query.customerNumber,
+        // });
+        this.getDataList();
         this.getAmountList({
           ...this.searchForm,
           type: v,
@@ -982,28 +1015,33 @@ export default {
         });
       } else if (this.isCustomer) {
         this.changeFn(this.$store.state.user.customerId);
-        this.getDataList({
-          ...this.searchForm,
-          pageSize: this.pageSize,
-          pageNum: this.currentPage,
-          type: v,
-          ...this.isCustomerList,
-        });
+        // this.getDataList({
+        //   ...this.searchForm,
+        //   pageSize: this.pageSize,
+        //   pageNum: this.currentPage,
+        //   type: v,
+        //   ...this.isCustomerList,
+        // });
+        this.searchForm.customerId = this.isCustomerList.customerId;
+        this.searchForm.customerNumber = this.isCustomerList.customerNumber;
+
+        this.getDataList();
         this.getAmountList({
           ...this.searchForm,
           type: v,
           ...this.isCustomerList,
         });
       } else {
-        this.getDataList({
-          // ...this.searchForm,
+        // this.getDataList({
+        //   // ...this.searchForm,
 
-          // customerName: this.customerName,
-          // customerNumber: this.customerNumber,
-          pageSize: this.pageSize,
-          pageNum: this.currentPage,
-          type: v,
-        });
+        //   // customerName: this.customerName,
+        //   // customerNumber: this.customerNumber,
+        //   pageSize: this.pageSize,
+        //   pageNum: this.currentPage,
+        //   type: v,
+        // });
+        this.getDataList();
         this.getAmountList({
           type: v,
         });
@@ -1011,16 +1049,37 @@ export default {
       // this.getWalletList();
     },
     //
-    async getDataList(data) {
-      let res;
-      if (this.bill == "COMMONLY") {
-        res = await getStandbookList(data);
+    async getDataList(value) {
+      // let res;
+      // if (this.bill == "COMMONLY") {
+      //   res = await getStandbookList(data);
+      // } else {
+      //   res = await getStandbookList(data);
+      // }
+
+      if (value) {
+        let res = await getStandbookList(value);
+        this.dataList = res.data.records;
+        this.listTotal = res.data.total;
       } else {
-        res = await getStandbookList(data);
+        let params = {
+          billNo: this.searchForm.billNo,
+          billType: this.searchForm.billType,
+          customerId: this.searchForm.customerId,
+          customerName: "",
+          customerNumber: this.searchForm.customerNumber,
+          customerWalletId: this.searchForm.customerWalletId,
+          endTime: this.searchForm.endTime,
+          pageNum: this.currentPage,
+          pageSize: this.pageSize,
+          startTime: this.searchForm.startTime,
+          type: this.bill,
+          walletRebateId: "",
+        };
+        let res = await getStandbookList(params);
+        this.dataList = res.data.records;
+        this.listTotal = res.data.total;
       }
-
-      this.dataList = res.data.records;
-      this.listTotal = res.data.total;
     },
   },
 };