Browse Source

财务管理页面添加总和统计,充值审核增加待充值金额,用还管理实现资料编辑功能额

song 9 months ago
parent
commit
3e391b6239

+ 2 - 1
package.json

@@ -26,7 +26,7 @@
         "echarts": "^5.4.0",
         "element-ui": "^2.6.0",
         "html2canvas": "^1.0.0-alpha.12",
-        "iview": "^3.2.2",
+        "iview": "^3.5.4",
         "iview-area": "^1.5.17",
         "jquery": "^3.3.1",
         "js-cookie": "^2.2.1",
@@ -39,6 +39,7 @@
         "tinymce": "^4.8.5",
         "tree-table-vue": "^1.1.0",
         "v-org-tree": "^1.0.6",
+        "view-design": "^4.7.0",
         "vue": "^2.5.10",
         "vue-i18n": "^7.8.0",
         "vue-quill-editor": "^3.0.6",

+ 7 - 0
src/api/account.js

@@ -8,6 +8,13 @@ export function accountList (query) {
     data: query
   })
 }
+export function totalList (query) {
+  return request({
+    url: '/cms_api/account/total_list',
+    method: 'post',
+    data: query
+  })
+}
 
 // 代理用户列表
 export function proxyList (query) {

+ 18 - 6
src/view/menu/account/accountFinance/index.vue

@@ -236,12 +236,24 @@
           style="margin-top:15px"
           label-width="100px"
         >
-          <selectBlock
-            inlineBlock
+<!--          <selectBlock-->
+<!--            inlineBlock-->
+<!--            v-model="proxyId"-->
+<!--            prefix="代理级别:"-->
+<!--            :enumList="proxyEnumList"-->
+<!--          ></selectBlock>-->
+          <el-select
             v-model="proxyId"
-            prefix="代理级别:"
-            :enumList="proxyEnumList"
-          ></selectBlock>
+            placeholder="请选择"
+            clearable
+          >
+            <el-option
+              v-for="item in proxyEnumList"
+              :key="item.value"
+              :value="item.value"
+              :label="item.label"
+            />
+          </el-select>
         </el-form>
       </div>
       <span slot="footer" class="dialog-footer">
@@ -704,7 +716,7 @@ export default {
     proxyConfigAction(){
       let data = {
         byId: this.currentRow.id,
-        updateId: this.proxyId
+        updateId: this.proxyId || 0
       }
       let params = {
         data:data,

+ 1 - 1
src/view/menu/account/proxyAccount/index.vue

@@ -260,7 +260,7 @@ export default {
           align: 'center'
         },
         {
-          title: '代理推代理收益',
+          title: '感恩奖',
           key: 'gratitudeInterest',
           align: 'center'
         },

+ 27 - 6
src/view/menu/auditManage/rechargeManagement/index.vue

@@ -34,6 +34,14 @@
       show-elevator
       @on-page-size-change="changePageSize"
     />
+    <!-- 图片弹窗 -->
+    <el-dialog :visible.sync="imageDialogVisible" title="客户凭证" width="50%">
+      <el-image
+        style="width: 100%; height: auto;"
+        :src="currentImageUrl"
+        :preview-src-list="previewImageList"
+      ></el-image>
+    </el-dialog>
     <!-- 审核弹窗 -->
     <el-dialog :visible.sync="dialogVisible" title="审核">
       <div v-if="dialogType === 'pass'">
@@ -95,6 +103,8 @@ export default {
   },
   data () {
     return {
+      imageDialogVisible: false, // 图片弹窗显示控制
+      currentImageUrl: '', // 当前显示的图片URL
       detailsVisible: false,
       detailsData: {
         account:'',
@@ -139,6 +149,11 @@ export default {
           key: 'realName',
           align: 'center'
         },
+        {
+          title: '待充值金额',
+          key: 'pendingAmount',
+          align: 'center'
+        },
         {
           title: '充值金额',
           key: 'amount',
@@ -151,13 +166,19 @@ export default {
           render: (h, params) => {
             return h('div', [
               h('img', {
-                style: { width: '100px', height: '100px' },
+                style: { width: '100px', height: '100px', cursor: 'pointer' },
                 attrs: {
                   src: params.row.clientCertificate || '',
-                }
-              })
-            ])
-          }
+                },
+                on: {
+                  click: () => {
+                    this.currentImageUrl = params.row.clientCertificate;
+                    this.imageDialogVisible = true;
+                  },
+                },
+              }),
+            ]);
+          },
         },
         {
           title: '充值时间',
@@ -253,7 +274,7 @@ export default {
       this.id = row.id;
       this.dialogType = 'pass';
       this.reason = '';
-      this.amount = 0;
+      this.amount = row.pendingAmount;
       this.dialogVisible = true;
     },
     reject (row) {

+ 86 - 6
src/view/menu/financeManage/financialManagement/index.vue

@@ -14,6 +14,7 @@
 <!--    <Button type="primary" class="margin-right20" @click="addAccount">添加新用户</Button>-->
     <Table
       border
+      show-summary
       :columns="tableTitle"
       :data="tableContent"
       class="margin-bottom20 margin-top20"
@@ -359,7 +360,8 @@ import {
   shareholderOpen,
   updatePromotion,
   accountInfo,
-  updateAccountInfo, proxyTypeEnum, addAccountMethod, manualRecharge, manualWithdrawal
+  updateAccountInfo, proxyTypeEnum, addAccountMethod, manualRecharge, manualWithdrawal,
+  totalList
 } from "@/api/account";
 export default {
   name: 'financialManagement',
@@ -397,6 +399,16 @@ export default {
       certificateImages:[],
       certificate:'',
       currentRow:{},
+      totalLists:{
+        totalIncome:0,
+        totalOutIncome:0,
+        totalConsumption:0,
+        totalIntegralIncome:0,
+        totalBalance:0,
+        totalProfit:0,
+        totalGratitudeIncome:0,
+        generalProxyIncome:0,
+      },
       account:'',
       financeTitle:'人工充值',
       idNumber:'',
@@ -447,14 +459,19 @@ export default {
           align: 'center'
         },
         {
-          title: '总提现及转出',
-          key: 'totalOutIncome',
+          title: '代理总收入',
+          key: 'incomeTotal',
+          align: 'center',
+        },
+        {
+          title: '总代理抽成',
+          key: 'generalProxyAccount',
           align: 'center'
         },
         {
-          title: '代理总收入',
-          key: 'proxyInterest',
-          align: 'center',
+          title: '总提现及转出',
+          key: 'totalOutIncome',
+          align: 'center'
         },
         {
           title: '总消费',
@@ -531,9 +548,23 @@ export default {
     }
   },
   mounted () {
+    this.getTotalList(),
     this.getTableData()
   },
   methods: {
+    // 获取总计金额
+    getTotalList(){
+      let params = {
+        data:{
+          id:0
+        }
+      }
+      totalList(params).then(res => {
+        if (res.rspCode === 0) {
+          this.totalLists = res.data
+        }
+      })
+     },
     // 获取表格数据
     getTableData () {
       this.loading = false
@@ -550,6 +581,19 @@ export default {
         if (res.rspCode === 0) {
           this.tableContent = res.data
           this.total = res.total
+          this.tableContent.forEach(item => {
+            this.$set(item, 'incomeTotal', (item.gratitudeInterest + item.proxyInterest).toFixed(2))
+          })
+          this.tableContent.push({
+            id: '总计',
+            totalIncome: this.totalLists.totalIncome,
+            agileAmount: this.totalLists.totalBalance,
+            agileInterest: this.totalLists.totalIntegralIncome,
+            generalProxyAccount: this.totalLists.generalProxyIncome,
+            totalOutIncome: this.totalLists.totalOutIncome,
+            consumerInterest: this.totalLists.totalConsumption,
+            incomeTotal: (Number(this.totalLists.totalProfit)  +  Number(this.totalLists.totalGratitudeIncome)).toFixed(2)
+          })
         }
       })
     },
@@ -644,6 +688,42 @@ export default {
         }
       })
     },
+    //总计表格展示
+    handleSummary ({ columns, data }) {
+      const sums = {};
+      columns.forEach((column, index) => {
+        const key = column.key;
+        if (index === 0) {
+          sums[key] = {
+            key,
+            value: '总价'
+          };
+          return;
+        }
+        // const values = data.map(item => Number(item[key]));
+        // if (!values.every(value => isNaN(value))) {
+        //   const v = values.reduce((prev, curr) => {
+        //     const value = Number(curr);
+        //     if (!isNaN(value)) {
+        //       return prev + curr;
+        //     } else {
+        //       return prev;
+        //     }
+        //   }, 0);
+        //   sums[key] = {
+        //     key,
+        //     value: v + ' 元'
+        //   };
+        // } else {
+        //   sums[key] = {
+        //     key,
+        //     value: 'N/A'
+        //   };
+        // }
+      });
+
+      return sums;
+    },
     addAccountSubmit(){
       let params = {
         data:{