Commit f9c79059c2edec9efa82a04ff18c7527bcb0688f

Authored by chenwei
1 parent 5f530adf
Exists in master

feat:自定义资金日报复核

frontend/front/src/router/index.js
@@ -110,7 +110,6 @@ export const constantRoutes = [ @@ -110,7 +110,6 @@ export const constantRoutes = [
110 props: true, 110 props: true,
111 meta: { title: '应用内容' }, 111 meta: { title: '应用内容' },
112 }, 112 },
113 -  
114 { 113 {
115 path: '/templatePreview/:templateKey/:parameterqQuerys/:rkey', 114 path: '/templatePreview/:templateKey/:parameterqQuerys/:rkey',
116 name: 'templatePreview', 115 name: 'templatePreview',
@@ -120,6 +119,15 @@ export const constantRoutes = [ @@ -120,6 +119,15 @@ export const constantRoutes = [
120 props: true, 119 props: true,
121 meta: { title: '查询数据' }, 120 meta: { title: '查询数据' },
122 }, 121 },
  122 + {
  123 + path: '/reviewOfFinancialDailyReport',
  124 + name: 'reviewOfFinancialDailyReport',
  125 + component: () =>
  126 + import('@/views/pages/reviewOfFinancialDailyReport/index.vue'),
  127 + hidden: true,
  128 + props: true,
  129 + meta: { title: '资金日报复核' },
  130 + },
123 ], 131 ],
124 }, 132 },
125 133
frontend/front/src/views/pages/reviewOfFinancialDailyReport/index.vue 0 → 100644
@@ -0,0 +1,286 @@ @@ -0,0 +1,286 @@
  1 +<template>
  2 + <div class='container'>
  3 + <el-container>
  4 + <el-header>
  5 + <div class="title">
  6 + <span>资金复核日报</span>
  7 + <el-date-picker v-model="days" value-format="yyyy-MM-dd" type="date" placeholder="选择日期"
  8 + @change="handleChangeDate">
  9 + </el-date-picker>
  10 + <!-- {{ days }} -->
  11 + </div>
  12 + </el-header>
  13 + <el-main>
  14 + <el-table :data="tableData" border show-summary :default-sort="{ prop: 'wdailyfundsfdate', order: '' }"
  15 + :summary-method="getSummaries" :span-method="spanMethod" :cell-style="cellStyleMethod"
  16 + style="width: 100%; margin-top: 20px">
  17 + <!-- <el-table-column type="selection" width="55"></el-table-column> -->
  18 + <el-table-column prop="wdailyfundsforgtype" align="center" label="公司类型"></el-table-column>
  19 + <el-table-column prop="wdailyfundsfdate" align="center" sortable label="日期"></el-table-column>
  20 + <el-table-column prop="wdailyfundsforgname" align="center" label="公司"> </el-table-column>
  21 + <el-table-column prop="wdailyfundsfyesterdayaccountbalance" align="center" label="昨日余额">
  22 + </el-table-column>
  23 + <el-table-column prop="wdailyfundsftodayaccountbalance" align="center" label="今日余额"> </el-table-column>
  24 + <el-table-column prop="wdailyfundsfaccountbalancedifference" align="center" label="差额(今日-昨日)">
  25 + </el-table-column>
  26 + <el-table-column prop="wdailyfundsftodaynetcashflow" align="center" label="净现金流"> </el-table-column>
  27 + <el-table-column prop="wdailyfundsftodayfreezing" align="center" label="冻结金额"> </el-table-column>
  28 + <el-table-column prop="wdailyfundsftodayfreezeamount" align="center" label="冻结金额上限"> </el-table-column>
  29 + <el-table-column prop="wdailyfundsfinspstatusname" align="center" label="复核"> </el-table-column>
  30 + <el-table-column prop="" align="center" label="复核人"> </el-table-column>
  31 + <el-table-column prop="" align="center" label="填报人"> </el-table-column>
  32 + </el-table>
  33 + </el-main>
  34 + <el-footer>
  35 + <div class="" style="display: flex;justify-content: center;" v-if="tableData.length">
  36 + <el-button type="primary" style="width: 200px;" @click="handleReview">
  37 + 复核完成
  38 + </el-button>
  39 + </div>
  40 + </el-footer>
  41 + </el-container>
  42 + <!-- <el-table-column prop="amount3" label="备注"> </el-table-column> -->
  43 + <!-- <div slot="append" style="display:flex;">
  44 + <div class="sum_footer">
  45 + <div class="sum_footer_unit center" style="width:160px;">
  46 + 合计(大写)
  47 + </div>
  48 + <div class="sum_footer_unit" style="width:350px;">11111</div>
  49 + </div>
  50 + <div class="sum_footer">
  51 + <div class="sum_footer_unit center" style="width:120px;">
  52 + 合计(小写)
  53 + </div>
  54 + <div class="sum_footer_unit" style="flex-grow:3">2222</div>
  55 + </div>
  56 + </div> -->
  57 + </div>
  58 +</template>
  59 +
  60 +<script>
  61 +export default {
  62 + data() {
  63 + return {
  64 + tableData: [],
  65 + days: new Date(Date.now() - 86400000).toISOString().split('T')[0]
  66 + };
  67 + },
  68 + mounted() {
  69 + this.initData();
  70 + },
  71 + methods: {
  72 + async initData() {
  73 + let params = {
  74 + "templateId": "1810231230602571776",
  75 + "queryFilter": {
  76 + "pageBean": {
  77 + "page": 1,
  78 + "pageSize": 999,
  79 + "total": 1
  80 + },
  81 + "querys": [
  82 + {
  83 + "property": "t.F_date",
  84 + "value": this.days
  85 + },
  86 + ],
  87 + "sorter": [
  88 + {
  89 + "property": "t.F_date",
  90 + "direction": "DESC"
  91 + },
  92 + {
  93 + "property": "t.F_org_type",
  94 + "direction": "DESC"
  95 + },
  96 + {
  97 + "property": "t.F_org_name",
  98 + "direction": "DESC"
  99 + },
  100 + {
  101 + "property": "t.F_org_id",
  102 + "direction": "DESC"
  103 + },
  104 + {
  105 + "property": "t.F_insp_status_name",
  106 + "direction": "DESC"
  107 + }
  108 + ]
  109 + }
  110 + }
  111 + let data = await this.$requestConfig.getDataTemplateDataList(params);
  112 + this.tableData = data.rows;
  113 + // 添加小计行
  114 + this.tableData = this.tableData.reduce((acc, cur, index) => {
  115 + acc.push(cur);
  116 + // 判断是否需要添加小计行
  117 + if (cur.wdailyfundsforderno !== 'subtotal' && (index === this.tableData.length - 1 || this.tableData[index + 1].wdailyfundsforgtype !== cur.wdailyfundsforgtype)) {
  118 + const subtotalRow = {
  119 + wdailyfundsforderno: 'subtotal',
  120 + wdailyfundsforgtype: '小计',
  121 + wdailyfundsfyesterdayaccountbalance: 0,
  122 + wdailyfundsftodayaccountbalance: 0,
  123 + wdailyfundsfaccountbalancedifference: 0,
  124 + wdailyfundsftodaynetcashflow: 0,
  125 + wdailyfundsftodayfreezing: 0,
  126 + wdailyfundsftodayfreezeamount: 0,
  127 + };
  128 + // 计算小计值
  129 + this.tableData.forEach((item) => {
  130 + if (item.wdailyfundsforgtype === cur.wdailyfundsforgtype) {
  131 + subtotalRow.wdailyfundsfyesterdayaccountbalance += isNaN(item.wdailyfundsfyesterdayaccountbalance) ? 0 : item.wdailyfundsfyesterdayaccountbalance;
  132 + subtotalRow.wdailyfundsftodayaccountbalance += isNaN(item.wdailyfundsftodayaccountbalance) ? 0 : item.wdailyfundsftodayaccountbalance;
  133 + subtotalRow.wdailyfundsfaccountbalancedifference += isNaN(item.wdailyfundsfaccountbalancedifference) ? 0 : item.wdailyfundsfaccountbalancedifference;
  134 + subtotalRow.wdailyfundsftodaynetcashflow += isNaN(item.wdailyfundsftodaynetcashflow) ? 0 : item.wdailyfundsftodaynetcashflow;
  135 + subtotalRow.wdailyfundsftodayfreezing += isNaN(item.wdailyfundsftodayfreezing) ? 0 : item.wdailyfundsftodayfreezing;
  136 + subtotalRow.wdailyfundsftodayfreezeamount += isNaN(item.wdailyfundsftodayfreezeamount) ? 0 : item.wdailyfundsftodayfreezeamount;
  137 + }
  138 + });
  139 + subtotalRow.wdailyfundsfyesterdayaccountbalance = (subtotalRow.wdailyfundsfyesterdayaccountbalance.toFixed(2));
  140 + subtotalRow.wdailyfundsftodayaccountbalance = (subtotalRow.wdailyfundsftodayaccountbalance.toFixed(2));
  141 + subtotalRow.wdailyfundsfaccountbalancedifference = (subtotalRow.wdailyfundsfaccountbalancedifference.toFixed(2));
  142 + subtotalRow.wdailyfundsftodaynetcashflow = (subtotalRow.wdailyfundsftodaynetcashflow.toFixed(2));
  143 + subtotalRow.wdailyfundsftodayfreezing = (subtotalRow.wdailyfundsftodayfreezing.toFixed(2));
  144 + subtotalRow.wdailyfundsftodayfreezeamount = (subtotalRow.wdailyfundsftodayfreezeamount.toFixed(2));
  145 + acc.push(subtotalRow);
  146 + }
  147 + return acc;
  148 + }, []);
  149 + console.log('数据', JSON.parse(JSON.stringify(this.tableData)));
  150 + },
  151 + handleChangeDate() {
  152 + this.initData();
  153 + },
  154 + getSummaries(param) {
  155 + const { columns, data } = param;
  156 + console.log('data', JSON.parse(JSON.stringify(data)));
  157 + const sums = [];
  158 + columns.forEach((column, index) => {
  159 + if (index === 0) {
  160 + sums[index] = '汇总';
  161 + return;
  162 + }
  163 + const values = data.map(item => Number(item[column.property]));
  164 + if (!values.every(value => isNaN(value))) {
  165 + sums[index] = values.reduce((prev, curr) => {
  166 + const value = Number(curr);
  167 + if (!isNaN(value)) {
  168 + return prev + curr;
  169 + } else {
  170 + return prev;
  171 + }
  172 + }, 0);
  173 + sums[index] += ' .00';
  174 + } else {
  175 + sums[index] = 'N/A';
  176 + }
  177 + });
  178 + // 可直接调接口获取后修改sums。
  179 + // console.log("合计列",sums);
  180 + return sums;
  181 + },
  182 + getSummaries(param) {
  183 + const { columns, data } = param;
  184 + const sums = [];
  185 + columns.forEach((column, index) => {
  186 + if (index === 0) {
  187 + sums[index] = '汇总';
  188 + return;
  189 + }
  190 + const values = data
  191 + .filter(item => item.wdailyfundsforderno !== 'subtotal') // 过滤掉小计行
  192 + .map(item => Number(item[column.property]));
  193 + if (!values.every(value => isNaN(value))) {
  194 + sums[index] = values.reduce((prev, curr) => {
  195 + const value = Number(curr);
  196 + if (!isNaN(value)) {
  197 + return prev + curr;
  198 + } else {
  199 + return prev;
  200 + }
  201 + }, 0);
  202 + sums[index] = sums[index].toFixed(2);
  203 + } else {
  204 + sums[index] = 'N/A';
  205 + }
  206 + });
  207 + // 可直接调接口获取后修改sums。
  208 + // console.log("合计列",sums);
  209 + return sums;
  210 + },
  211 + spanMethod({ row, column, rowIndex, columnIndex }) {
  212 + // console.log('row',JSON.parse(JSON.stringify(row)));
  213 + // console.log('column',JSON.parse(JSON.stringify(column)));
  214 + if (columnIndex === 0) {
  215 + // 第一列合并单元格
  216 + if (row.wdailyfundsforderno === 'subtotal') {
  217 + // 小计行
  218 + return {
  219 + rowspan: 1,
  220 + colspan: 1,
  221 + content: '小计'
  222 + };
  223 + } else if (rowIndex > 0 && row.wdailyfundsforgtype === this.tableData[rowIndex - 1].wdailyfundsforgtype) {
  224 + return {
  225 + rowspan: 0,
  226 + colspan: 0
  227 + };
  228 + } else {
  229 + // 计算合并行数
  230 + let rowspan = 1;
  231 + for (let i = rowIndex + 1; i < this.tableData.length; i++) {
  232 + if (row.wdailyfundsforgtype === this.tableData[i].wdailyfundsforgtype) {
  233 + rowspan++;
  234 + } else {
  235 + break;
  236 + }
  237 + }
  238 + return {
  239 + rowspan,
  240 + colspan: 1,
  241 + content: row.wdailyfundsforgtype
  242 + };
  243 + }
  244 + }
  245 +
  246 + },
  247 + cellStyleMethod({ row, column, rowIndex, columnIndex }) {
  248 +
  249 + },
  250 + // 复核
  251 + handleReview() {
  252 + console.log('一键复核', JSON.parse(JSON.stringify(this.tableData)));
  253 + },
  254 + }
  255 +};
  256 +</script>
  257 +<style lang='scss' scoped>
  258 +.container {
  259 + background: #fff;
  260 +}
  261 +
  262 +.title {
  263 + font-size: 28px;
  264 + display: flex;
  265 + justify-content: center;
  266 + align-items: center;
  267 +}
  268 +
  269 +.el-input {
  270 + line-height: 0;
  271 +}
  272 +
  273 +::v-deep .el-input__inner {
  274 + border: none;
  275 + font-size: 28px;
  276 +}
  277 +
  278 +.el-header {
  279 + text-align: center;
  280 + line-height: 60px;
  281 +}
  282 +
  283 +.el-footer {
  284 + width: 100%;
  285 +}
  286 +</style>
0 \ No newline at end of file 287 \ No newline at end of file