瀏覽代碼

feat: 改版返利互转列表

aXin-0810 2 年之前
父節點
當前提交
dec4f7e956
共有 2 個文件被更改,包括 28 次插入83 次删除
  1. 17 0
      src/api/finance/change_list_v2.js
  2. 11 83
      src/views/finance/change_list.vue

+ 17 - 0
src/api/finance/change_list_v2.js

@@ -0,0 +1,17 @@
+import request, { postBlob } from '@/utils/request'
+
+export function financeTransferList(data) {
+  return request({
+    url: `/finance/transfer/list/v2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function financeTransferListExport(data, name) {
+  return postBlob({
+    url: '/finance/transfer/list/listExport/v2',
+    data,
+    name
+  })
+}

+ 11 - 83
src/views/finance/change_list.vue

@@ -27,6 +27,7 @@
 <script>
 import TemplatePage from '@/components/template/template-page-1.vue'
 import { getChangeList, getChangeListDetail, getTransferSubmit, getTransferCancel } from '@/api/finance/change_list'
+import { financeTransferList, financeTransferListExport } from '@/api/finance/change_list_v2'
 import ChangeListDetail from './components/change_list-detail'
 import ChangeListExamine from './components/change_list-examine'
 import ChangeListReview from './components/change_list-review'
@@ -40,20 +41,7 @@ export default {
   data() {
     return {
       isCustomer: null,
-      currentPage: 1, // 当前页码
-      pageSize: 10, // 每页数量
-      listTotal: 0, // 列表总数
-      dataList: [], // 列表数据
-      searchForm: {
-        customerName: '',
-        startTime: '',
-        walletName: '',
-        id: ''
-      }, //搜索表单
-      listLoading: false, // 列表加载loading
-      category: '',
       showPage: 1,
-      isCollapse: true,
       detailList: {},
       optionsEvensGroup: [],
       // 表格属性
@@ -71,13 +59,12 @@ export default {
   created() {
     const res = JSON.parse(localStorage.getItem('supply_user'))
     this.isCustomer = res.isCustomer
-    this.getDataList()
   },
   methods: {
     // 列表请求函数
-    getList: getCreditList,
+    getList: financeTransferList,
     // 列表导出函数
-    exportList: getCreditListExport,
+    exportList: financeTransferListExport,
     // 表格列解析渲染数据更改
     columnParsing(item, defaultData) {
       return defaultData
@@ -90,7 +77,7 @@ export default {
       return (h, { row, index, column }) => {
         return (
           <div class="operation-btns">
-            {this.$checkBtnRole('apply', this.$route.meta.roles) && row.examineStatus == 'SAVE' ? (
+            {this.$checkBtnRole('apply', this.$route.meta.roles) && row.examineStatus == '保存' ? (
               <el-button
                 onClick={() => {
                   this.submitFn(row.id)
@@ -102,7 +89,7 @@ export default {
                 提审
               </el-button>
             ) : null}
-            {row.examineStatus == 'WAIT' &&
+            {row.examineStatus == '待审核' &&
             !this.isCustomer &&
             this.$checkBtnRole('examine', this.$route.meta.roles) ? (
               <el-button
@@ -116,7 +103,7 @@ export default {
                 审核
               </el-button>
             ) : null}
-            {(row.examineStatus == 'FAIL_ONE' || row.examineStatus == 'SAVE') &&
+            {(row.examineStatus == '初审不通过' || row.examineStatus == '保存') &&
             this.$checkBtnRole('edit', this.$route.meta.roles) ? (
               <el-button
                 type="text"
@@ -129,7 +116,6 @@ export default {
                 修改
               </el-button>
             ) : null}
-
             <el-button
               onClick={() => {
                 this.detailFn(row.id)
@@ -140,9 +126,8 @@ export default {
             >
               详情
             </el-button>
-            {row.examineStatus == 'WAIT' ? (
+            {row.examineStatus == '待审核' ? (
               <el-button
-                v-if="scope.row.examineStatus == 'WAIT'"
                 onClick={() => {
                   this.cancelFn(row.id)
                 }}
@@ -160,96 +145,39 @@ export default {
     //取消
     async cancelFn(id) {
       await getTransferCancel({ id })
-      this.getDataList()
+      this.refreshFn()
       this.$message.success('取消成功')
     },
-    //切换radio
-    changeRadioGroupFn(v) {
-      // console.log(v);
-      this.currentPage = 1
-
-      this.getDataList()
-    },
-    //撤回
-    withdrawFn() {},
     //刷新
     refreshFn() {
-      this.getDataList()
+      this.$refs.pageRef.refreshList()
     },
     //提审
     async submitFn(id) {
       await getTransferSubmit({ id })
       this.$message.success('提审成功')
-      this.getDataList()
-    },
-    //清空
-    clearFn() {
-      this.$refs.searchForm.resetFields()
-    },
-    //搜索
-    searchFn() {
-      this.currentPage = 1
-      this.getDataList()
-    },
-
-    //获取列表数据
-    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 = []
-        item.sums2 = ['amount', 'allowanceAmount']
-      })
-      this.dataList = res.data.records
-      this.listTotal = res.data.total
+      this.refreshFn()
     },
     //详情
     async detailFn(id) {
       const res = await getChangeListDetail({ id })
-      console.log(res)
       this.detailList = res.data
       this.showPage = 2
     },
     //修改
     async editFn(id) {
       const res = await getChangeListDetail({ id })
-
       this.detailList = res.data
       this.showPage = 4
     },
     //审核
     async examineFn(id) {
       const res = await getChangeListDetail({ id })
-
       this.detailList = res.data
       this.showPage = 3
-    },
-    // 更改每页数量
-    handleSizeChange(val) {
-      this.pageSize = val
-      this.currentPage = 1
-      this.getDataList()
-    },
-    // 更改当前页
-    handleCurrentChange(val) {
-      this.currentPage = val
-      this.getDataList()
     }
   }
 }
 </script>
 
-<style lang="scss" scoped>
-.dateStyle {
-  width: 100%;
-}
-</style>
+<style lang="scss" scoped></style>