Merge branch 'hotfix/V2-0216' into develop
# Conflicts: # pc4mobx/hrmSalary/pages/mySalary/index.js
This commit is contained in:
commit
a665200b9c
|
|
@ -23,9 +23,7 @@ export default class CompareDetail extends React.Component {
|
|||
}
|
||||
|
||||
componentWillMount() {
|
||||
let id = getQueryString("id");
|
||||
this.id = id;
|
||||
|
||||
this.id = getQueryString("id");
|
||||
const { calculateStore: { fetchComparisonResultList } } = this.props;
|
||||
const { onlyDiffEmployee, onlyDiffSalaryItem } = this.state;
|
||||
let params = {
|
||||
|
|
@ -37,25 +35,31 @@ export default class CompareDetail extends React.Component {
|
|||
fetchComparisonResultList(params);
|
||||
}
|
||||
|
||||
getColumns(columns) {
|
||||
getColumns = (columns) => {
|
||||
let newColumns = [...columns];
|
||||
newColumns.map(item => {
|
||||
let n = Number(item.dataIndex);
|
||||
if (!isNaN(n)) { // 数字
|
||||
item.render = (text, record) => {
|
||||
const showDifference = record[`${item.dataIndex}_type`] === "number";
|
||||
const { acctResultValue, excelResultValue } = record[item.dataIndex];
|
||||
return (
|
||||
<div>
|
||||
<div>系统值:{record[item.dataIndex].acctResultValue}</div>
|
||||
<div>线下值:{record[item.dataIndex].excelResultValue}</div>
|
||||
<div
|
||||
style={{ color: "red" }}>差值:{calculateCompares(record[item.dataIndex].acctResultValue, record[item.dataIndex].excelResultValue)}</div>
|
||||
<div>系统值:{acctResultValue}</div>
|
||||
<div>线下值:{excelResultValue}</div>
|
||||
{
|
||||
showDifference &&
|
||||
<div style={{ color: "red" }}>
|
||||
差值:{calculateCompares(acctResultValue, excelResultValue)}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
}
|
||||
});
|
||||
return newColumns;
|
||||
}
|
||||
};
|
||||
|
||||
// 导入
|
||||
handleImportClick() {
|
||||
|
|
@ -218,7 +222,10 @@ export default class CompareDetail extends React.Component {
|
|||
loading={loading}
|
||||
dataSource={comparisonResultPageInfo.list ? comparisonResultPageInfo.list : []}
|
||||
columns={this.getColumns(comparisonResultColumns ? comparisonResultColumns : [])}
|
||||
scroll={{ x: this.getColumns(comparisonResultColumns ? comparisonResultColumns : []).length * 150, y: `calc(100vh - 199px)` }}
|
||||
scroll={{
|
||||
x: this.getColumns(comparisonResultColumns ? comparisonResultColumns : []).length * 150,
|
||||
y: `calc(100vh - 199px)`
|
||||
}}
|
||||
total={comparisonResultPageInfo.total}
|
||||
current={comparisonResultPageInfo.pageNum}
|
||||
pageSize={this.pageInfo.pageSize}
|
||||
|
|
@ -253,14 +260,8 @@ export default class CompareDetail extends React.Component {
|
|||
}
|
||||
|
||||
// 计算差值
|
||||
export const calculateCompares=(systemValue, excelValue)=> {
|
||||
if (systemValue == null || excelValue == null) {
|
||||
return "";
|
||||
}
|
||||
let systemNum = Number(systemValue);
|
||||
let excelNum = Number(excelValue);
|
||||
if (!isNaN(systemNum) || !isNaN(excelNum)) { // 数字
|
||||
return (systemNum - excelNum).toFixed(2);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
export const calculateCompares = (systemValue = 0, excelValue = 0) => {
|
||||
const systemNum = Number(systemValue);
|
||||
const excelNum = Number(excelValue);
|
||||
return (systemNum - excelNum).toFixed(2);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -20,10 +20,10 @@ export default class MySalary extends React.Component {
|
|||
this.state = {
|
||||
value: "",
|
||||
selectedKey: "0",
|
||||
salaryBillVisible: false
|
||||
salaryBillVisible: false,
|
||||
salaryInfoId: "",
|
||||
salaryRange: [moment().format("YYYY-MM"), moment().format("YYYY-MM")]
|
||||
};
|
||||
this.salaryInfoId = "";
|
||||
this.range = [];
|
||||
this.pageInfo = { current: 1, pageSize: 10 };
|
||||
this.historyPageInfo = { current: 1, pageSize: 10 };
|
||||
}
|
||||
|
|
@ -34,12 +34,12 @@ export default class MySalary extends React.Component {
|
|||
}
|
||||
|
||||
// 查看工资单
|
||||
handleView(record) {
|
||||
this.salaryInfoId = record.id;
|
||||
handleView = (record) => {
|
||||
this.setState({
|
||||
salaryBillVisible: true
|
||||
salaryBillVisible: true,
|
||||
salaryInfoId: record.id
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
getColumns() {
|
||||
const { mySalaryStore: { myBillTableStore } } = this.props;
|
||||
|
|
@ -71,34 +71,37 @@ export default class MySalary extends React.Component {
|
|||
}
|
||||
|
||||
// 区间改变事件
|
||||
handleSalaryRangePickerChange(range) {
|
||||
const { mySalaryStore: { mySalaryBillList } } = this.props;
|
||||
const isNull = _.every(range, it => !!it);
|
||||
if (!_.isEmpty(range) && isNull) {
|
||||
this.range = range.map(item => moment(item).format("YYYY-MM"));
|
||||
mySalaryBillList(this.range, this.pageInfo);
|
||||
} else {
|
||||
mySalaryBillList([], this.pageInfo);
|
||||
}
|
||||
}
|
||||
handleSalaryRangePickerChange = (range) => {
|
||||
this.setState({
|
||||
salaryRange: range.map(item => moment(item).format("YYYY-MM"))
|
||||
}, () => {
|
||||
const { mySalaryStore: { mySalaryBillList } } = this.props;
|
||||
const isNull = _.every(range, it => !!it);
|
||||
if (!_.isEmpty(range) && isNull) {
|
||||
mySalaryBillList(this.state.salaryRange, this.pageInfo);
|
||||
} else {
|
||||
mySalaryBillList([], this.pageInfo);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
handleTabChange(selectedKey) {
|
||||
handleTabChange=(selectedKey)=> {
|
||||
if (selectedKey === "2") {
|
||||
const { mySalaryStore: { getRecordList } } = this.props;
|
||||
getRecordList();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handlePageChange() {
|
||||
handlePageChange = () => {
|
||||
const { mySalaryStore: { mySalaryBillList } } = this.props;
|
||||
mySalaryBillList(this.range, this.pageInfo);
|
||||
}
|
||||
mySalaryBillList(this.state.salaryRange, this.pageInfo);
|
||||
};
|
||||
|
||||
handleHistoryPageChange() {
|
||||
handleHistoryPageChange = () => {
|
||||
const { mySalaryStore: { getRecordList } } = this.props;
|
||||
getRecordList(this.historyPageInfo);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { mySalaryStore } = this.props;
|
||||
|
|
@ -135,10 +138,10 @@ export default class MySalary extends React.Component {
|
|||
const renderSearchOperationItem = () => {
|
||||
if (this.state.selectedKey === "0") {
|
||||
return (<div><span className="tabSearchLabel">薪资所属月:</span>
|
||||
<RangePicker
|
||||
picker="month"
|
||||
format="yyyy-MM"
|
||||
onChange={(value) => this.handleSalaryRangePickerChange(value)}
|
||||
|
||||
<RangePicker picker="month" format="yyyy-MM"
|
||||
value={salaryRange}
|
||||
onChange={(value) => this.handleSalaryRangePickerChange(value)}
|
||||
/>
|
||||
</div>);
|
||||
} else {
|
||||
|
|
@ -208,9 +211,9 @@ export default class MySalary extends React.Component {
|
|||
{
|
||||
salaryBillVisible && <PayrollModal
|
||||
visible={salaryBillVisible}
|
||||
id={this.salaryInfoId}
|
||||
id={salaryInfoId}
|
||||
onCancel={() => {
|
||||
this.setState({ salaryBillVisible: false }, () => {
|
||||
this.setState({ salaryBillVisible: false, salaryInfoId: "" }, () => {
|
||||
setMySalaryBill({});
|
||||
});
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ export default class AccumulationFundForm extends React.Component {
|
|||
<WeaInputNumber
|
||||
min={0}
|
||||
precision={2}
|
||||
value={(paymentData && paymentData[item.domkey[0]]) ? Number(paymentData[item.domkey[0]]) : 0}
|
||||
value={(paymentData && paymentData[item.domkey[0]]) ? paymentData[item.domkey[0]] : 0}
|
||||
onChange={(value) => {
|
||||
this.handlePaymentChange({ [item.domkey[0]]: value ? String(value) : '0' });
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import {toJS} from 'mobx';
|
||||
import { Col, Row } from "antd";
|
||||
import { WeaCheckbox, WeaDatePicker, WeaInputNumber, WeaSelect } from "ecCom";
|
||||
import GroupCard from "../../../components/groupCard";
|
||||
|
|
@ -36,8 +35,8 @@ export default class OtherForm extends React.Component {
|
|||
let form = { ...otherForm };
|
||||
form.data = request;
|
||||
setOtherForm(form);
|
||||
Object.keys(params).length>1 &&
|
||||
onChangeRecordOtherSchemeId(params.otherSchemeId)
|
||||
Object.keys(params).length > 1 &&
|
||||
onChangeRecordOtherSchemeId(params.otherSchemeId);
|
||||
}
|
||||
|
||||
//基数变化
|
||||
|
|
@ -152,9 +151,9 @@ export default class OtherForm extends React.Component {
|
|||
<WeaInputNumber
|
||||
min={0}
|
||||
precision={2}
|
||||
value={(paymentData && paymentData[item.domkey[0]]) ? Number(paymentData[item.domkey[0]]) : 0}
|
||||
value={(paymentData && paymentData[item.domkey[0]]) ? paymentData[item.domkey[0]] : 0}
|
||||
onChange={(value) => {
|
||||
this.handlePaymentChange({ [item.domkey[0]]: value ? String(value) : '0' });
|
||||
this.handlePaymentChange({ [item.domkey[0]]: value ? String(value) : "0" });
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
|
|
|
|||
|
|
@ -167,9 +167,9 @@ export default class SocialSecurityForm extends React.Component {
|
|||
<WeaInputNumber
|
||||
min={0}
|
||||
precision={2}
|
||||
value={(paymentData && paymentData[item.domkey[0]]) ? Number(paymentData[item.domkey[0]]) : 0}
|
||||
value={(paymentData && paymentData[item.domkey[0]]) ? paymentData[item.domkey[0]] : 0}
|
||||
onChange={(value) => {
|
||||
this.handlePaymentChange({ [item.domkey[0]]: value ? String(value) : '0' });
|
||||
this.handlePaymentChange({ [item.domkey[0]]: value ? String(value) : "0" });
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
|
|
|
|||
|
|
@ -59,12 +59,13 @@ class StandingBookOfflineComparison extends Component {
|
|||
width: 150,
|
||||
fixed: idx < 2 ? "left" : false,
|
||||
render: (text, record) => {
|
||||
const { acctResultValue, excelResultValue } = record[it.dataIndex] || {};
|
||||
if (Object.prototype.toString.call(text) === "[object Object]") {
|
||||
return <React.Fragment>
|
||||
<div>系统值:{record[it.dataIndex].acctResultValue || 0}</div>
|
||||
<div>线下值:{record[it.dataIndex].excelResultValue || 0}</div>
|
||||
<div>系统值:{acctResultValue}</div>
|
||||
<div>线下值:{excelResultValue}</div>
|
||||
<div style={{ color: "red" }}>
|
||||
差值:{calculateCompares(record[it.dataIndex].acctResultValue, record[it.dataIndex].excelResultValue)}
|
||||
差值:{calculateCompares(acctResultValue, excelResultValue)}
|
||||
</div>
|
||||
</React.Fragment>;
|
||||
}
|
||||
|
|
@ -77,13 +78,13 @@ class StandingBookOfflineComparison extends Component {
|
|||
}
|
||||
});
|
||||
};
|
||||
handleExport= ()=> {
|
||||
handleExport = () => {
|
||||
const billMonth = getQueryString("billMonth");
|
||||
const paymentOrganization = getQueryString("paymentOrganization");
|
||||
const { onlyDiffEmployee } = this.state;
|
||||
let url= `/api/bs/hrmsalary/siaccount/comparisonresult/export?paymentStatus=0&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}&onlyDiffEmployee=${onlyDiffEmployee === "1"}`;
|
||||
window.open(`${window.location.origin}${url}`)
|
||||
}
|
||||
let url = `/api/bs/hrmsalary/siaccount/comparisonresult/export?paymentStatus=0&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}&onlyDiffEmployee=${onlyDiffEmployee === "1"}`;
|
||||
window.open(`${window.location.origin}${url}`);
|
||||
};
|
||||
|
||||
render() {
|
||||
const { onlyDiffEmployee, showSearchAd, pageInfo, dataSource, columns, loading, importVisible } = this.state;
|
||||
|
|
|
|||
Loading…
Reference in New Issue