社保福利档案小数点问题
This commit is contained in:
parent
84791cc69f
commit
f39f70de25
|
|
@ -1,6 +1,6 @@
|
|||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { Button, DatePicker } from "antd";
|
||||
import { DatePicker } from "antd";
|
||||
import { WeaTop } from "ecCom";
|
||||
import { renderNoright } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
|
||||
import CustomTab from "../../components/customTab";
|
||||
|
|
@ -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,45 +71,41 @@ 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;
|
||||
const {
|
||||
loading,
|
||||
hasRight,
|
||||
form,
|
||||
setMySalaryBill,
|
||||
doSearch,
|
||||
setShowSearchAd
|
||||
} = mySalaryStore;
|
||||
const { loading, hasRight, setMySalaryBill } = mySalaryStore;
|
||||
const {
|
||||
myBillDataSource,
|
||||
recordListColumns,
|
||||
|
|
@ -117,41 +113,13 @@ export default class MySalary extends React.Component {
|
|||
recordListPageInfo,
|
||||
myBillPageInfo
|
||||
} = mySalaryStore;
|
||||
const { salaryBillVisible } = this.state;
|
||||
if (!hasRight && !loading) { // 无权限处理
|
||||
return renderNoright();
|
||||
}
|
||||
|
||||
const rightMenu = [// 右键菜单
|
||||
// {
|
||||
// key: 'BTN_COLUMN',
|
||||
// icon: <i className='icon-coms-Custom' />,
|
||||
// content: '显示列定制',
|
||||
// onClick: this.showColumn
|
||||
// },
|
||||
];
|
||||
const collectParams = { // 收藏功能配置
|
||||
favname: "我的薪资福利",
|
||||
favouritetype: 1,
|
||||
objid: 0,
|
||||
link: "wui/index.html#/ns_demo03/index",
|
||||
importantlevel: 1
|
||||
};
|
||||
const adBtn = [ // 高级搜索内部按钮
|
||||
<Button type="primary" onClick={doSearch}>搜索</Button>,
|
||||
<Button type="ghost" onClick={() => form.resetForm()}>重置</Button>,
|
||||
<Button type="ghost" onClick={() => setShowSearchAd(false)}>取消</Button>
|
||||
];
|
||||
|
||||
const { salaryBillVisible, salaryRange, salaryInfoId } = this.state;
|
||||
if (!hasRight && !loading) return renderNoright();
|
||||
const topTab = [
|
||||
{
|
||||
title: "工资单",
|
||||
viewcondition: "0"
|
||||
},
|
||||
// {
|
||||
// title: "社保福利",
|
||||
// viewcondition: "1"
|
||||
// },
|
||||
{
|
||||
title: "调薪记录",
|
||||
viewcondition: "2"
|
||||
|
|
@ -163,23 +131,10 @@ export default class MySalary extends React.Component {
|
|||
return (<div><span className="tabSearchLabel">薪资所属月:</span>
|
||||
|
||||
<RangePicker picker="month" format="yyyy-MM"
|
||||
value={salaryRange}
|
||||
onChange={(value) => this.handleSalaryRangePickerChange(value)}
|
||||
/>
|
||||
</div>);
|
||||
} else if (this.state.selectedKey == "1") {
|
||||
return (<div><span className="tabSearchLabel">缴纳月份:</span>
|
||||
<div className="weaRangePickerWrapper">
|
||||
<div className="monthPickerWrapper">
|
||||
<MonthPicker/>
|
||||
</div>
|
||||
<span className="betweenLable">
|
||||
至
|
||||
</span>
|
||||
<div className="monthPickerWrapper">
|
||||
<MonthPicker/>
|
||||
</div>
|
||||
</div>
|
||||
</div>);
|
||||
} else {
|
||||
return (<div></div>);
|
||||
}
|
||||
|
|
@ -194,8 +149,6 @@ export default class MySalary extends React.Component {
|
|||
icon={<i className="icon-coms-fa"/>} // 左侧图标
|
||||
iconBgcolor="#F14A2D" // 左侧图标背景色
|
||||
showDropIcon={false} // 是否显示下拉按钮
|
||||
dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
|
||||
dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能
|
||||
>
|
||||
<CustomTab topTab={topTab}
|
||||
searchOperationItem={
|
||||
|
|
@ -254,9 +207,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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue