Commit 8180ca3a authored by 陈会能's avatar 陈会能
Browse files

Merge branch 'feature/v1.20241001.1' into 'master'

Feature/v1.20241001.1

See merge request op/xinghuo-business/xinghuo-frontend/legacy-xh-boss-fe/legacy-xh-boss-web-fe!2055
parents 372e397a 233d8824
.finan_flow_voucher {
:global {
.TextLink {
padding: 0 5px;
border-bottom: none;
}
}
&::-webkit-scrollbar {
width: 6px;
height: 6px;
}
&::-webkit-scrollbar-track-piece{
background-color: transparent;
}
&::-webkit-scrollbar-thumb{
border-radius: 3px;
background-color: transparent;
}
}
\ No newline at end of file
import React from 'react';
import { Form, Row, Col, Radio } from 'antd';
import { connect } from 'dva';
import { Select, Button } from 'COMPONENT';
import { monthEnum } from '../store/constant';
import style from './index.less';
import { getDictValByText, getDictTextByVal } from 'UTIL/dict';
const { Item } = Form;
class SearchPage extends React.Component {
init = false;
componentDidMount() {
this.querySearch();
}
componentDidUpdate() {
this.querySearch();
}
querySearch = () => {
const { monthDict, yearDict } = this.props;
if (this.init) return;
if (monthDict.length > 0 || yearDict.length > 0) {
this.init = true;
this.handleSearch();
}
};
/**
* 查询事件
* @memberof SearchPage
*/
handleSearch = () => {
const {
form: { getFieldsValue },
onSearch,
yearDict,
monthDict,
} = this.props;
const values = getFieldsValue();
const { countDate, countMonth } = values;
const year = getDictTextByVal(yearDict, countDate);
const monthText = getDictTextByVal(monthDict, countMonth);
let monthKey = '01';
for (let i = 0, len = monthEnum.length; i < len; i += 1) {
const { text, key } = monthEnum[i];
if (text === monthText) {
monthKey = key;
break;
}
}
const params = {
...values,
queryLevelType: 'BRANCH',
countDate: `${year}-${monthKey}-01`,
countMonth: parseInt(`${year}${monthKey}`, 10),
};
onSearch(params);
};
/**
* 查询重置
* @memberof SearchPage
*/
handleReset = () => {
const {
form: { resetFields },
} = this.props;
resetFields();
};
/**
* 根据公司 获取 对应学习中心,分公司为空时返回所有学习中心
* @memberof SearchPage
*/
getCampusByBranch = () => {
const {
form: { getFieldValue },
campusDict,
} = this.props;
const branchId = getFieldValue('branchId');
if (!branchId) return campusDict;
const array = campusDict.filter((item) => item.val === branchId);
return array[0] ? array[0].options : [];
};
render() {
const {
branchDict,
yearDict,
form: { getFieldDecorator },
monthDict,
} = this.props;
const defaultYear = getDictValByText(yearDict, new Date().getFullYear() + '');
const defaultMonth = getDictValByText(monthDict, monthEnum[new Date().getMonth()].text);
return (
<Form layout="inline">
<Row className={style.voucher_search} gutter={16}>
<Col span={2}>
<Item>
{getFieldDecorator('countDate', { initialValue: defaultYear })(
<Select placeholder="请选择年份" dict={yearDict} allowClear={false} />,
)}
</Item>
</Col>
<Col span={2}>
<Item>
{getFieldDecorator('countMonth', { initialValue: defaultMonth })(
<Select placeholder="请选择月份" dict={monthDict} allowClear={false} />,
)}
</Item>
</Col>
<Col span={3}>
<Item>
{getFieldDecorator('branchId')(<Select placeholder="请选择分公司" dict={branchDict} showSearch={true} />)}
</Item>
</Col>
<Col span={4}>
<Item>
{getFieldDecorator('campusId')(
<Select placeholder="请选择学习中心" dict={this.getCampusByBranch()} showSearch={true} />,
)}
</Item>
</Col>
<Col span={3}>
<Item>
{getFieldDecorator('searchType', {
initialValue: '1',
})(
<Radio.Group>
<Radio value="1">学段</Radio>
<Radio value="2">年级</Radio>
</Radio.Group>,
)}
</Item>
</Col>
<Col className={style.search_button} span={6}>
<Button type="primary" onClick={this.handleSearch}>
查询
</Button>
<Button type="primary" onClick={this.handleReset}>
重置
</Button>
<Button onClick={this.props.onExport} loading={this.props.loading}>
导出excel
</Button>
</Col>
</Row>
</Form>
);
}
}
const mapStateToProps = (state) => {
const {
account: { btnAuths = [] },
dict: { year, month, branch = [], branchCampus = [] },
} = state;
return {
btnAuths,
yearDict: year || [],
monthDict: month || [],
branchDict: branch,
campusDict: branchCampus,
};
};
export default connect(mapStateToProps)(Form.create()(SearchPage));
.voucher_search {
:global {
.ant-form-item,
.ant-form-item-control-wrapper {
width: 100%;
}
}
.search_button {
button {
margin-right: 10px;
}
}
.text {
height: 36px;
line-height: 36px;
}
}
const monthEnum = [
{
key: '01',
text: '一月',
},
{
key: '02',
text: '二月',
},
{
key: '03',
text: '三月',
},
{
key: '04',
text: '四月',
},
{
key: '05',
text: '五月',
},
{
key: '06',
text: '六月',
},
{
key: '07',
text: '七月',
},
{
key: '08',
text: '八月',
},
{
key: '09',
text: '九月',
},
{
key: '10',
text: '十月',
},
{
key: '11',
text: '十一月',
},
{
key: '12',
text: '十二月',
},
];
export { monthEnum };
export function computedTotal(data = [], fields) {
if (data.length === 0) {
return [];
}
const numFields = [];
fields.forEach((field) => {
if (field.children) {
numFields.push(...field.children.map((item) => item.dataIndex || item.key));
} else {
numFields.push(field.dataIndex || field.key);
}
});
const totalRow = data.reduce(
(prev, row) => {
return numFields.reduce((totalRow, field) => {
if (totalRow[field] === undefined) {
totalRow[field] = 0;
}
totalRow[field] += row[field];
return totalRow;
}, prev);
},
{
id: -1,
campusName: '合计: ',
},
);
const newData = data.concat(totalRow);
return newData;
}
/**
* 计算百分比
*
* @param data {number}
* @return {string}
*/
export function calcPercentAndRound(data) {
if (Object.prototype.toString.call(data) === '[object Number]') {
return Math.round(data * 10000) / 100 + '%';
}
return '';
}
......@@ -29,6 +29,15 @@ export default [
});
},
},
{
path: 'cashFinancialVoucherGrade',
name: '营收凭证(学段年级)',
getComponent(nextState, cb) {
require.ensure([], (require) => {
cb(null, require('PAGE/reportCenter/financeReport/financialVoucherForGrade'));
});
},
},
{
path: 'techStatisticReport',
name: '科技主体收款统计',
......
......@@ -18,6 +18,28 @@ const config = {
url: 'ReportEvidenceAuditController/printReceiptMonthlyStatisticsStatistics.do',
dataType: 'json',
},
// 营收数据 - 按年级分页查询
getIncomeStatisticsByGrade: {
method: 'POST',
dataType: 'json',
url: 'boss-xinghuo-api/incomeStatistics/pageByGrade',
},
exportIncomeStatisticsByGrade: {
method: 'POST',
dataType: 'json',
url: 'boss-xinghuo-api/incomeStatistics/pageByGrade?isExport=pull',
},
// 营收数据 - 按年级学段分页查询
getIncomeStatisticsByGradeSegment: {
method: 'POST',
dataType: 'json',
url: 'boss-xinghuo-api/incomeStatistics/pageByGradeSegment',
},
exportIncomeStatisticsByGradeSegment: {
url: 'boss-xinghuo-api/incomeStatistics/pageByGradeSegment?isExport=pull',
method: 'POST',
dataType: 'json',
},
// 收款凭证 - 确认通过
auditPaymentReceiptCampusMonthlyStatistics: {
url: 'ReportEvidenceAuditController/auditPaymentReceiptCampusMonthlyStatistics.do',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment