custom/西部信托0401
This commit is contained in:
parent
c773ffe6ed
commit
8c3c4ee520
|
|
@ -51,15 +51,17 @@ class Index extends Component {
|
|||
};
|
||||
handleConfirm = async () => {
|
||||
const type = getQueryString("type"), f = await form.validateForm();
|
||||
if (!this.state.captcha && type !== "phone") {
|
||||
if (!this.state.captcha && type !== "phone" && !this.props.isSalaryMobile) {
|
||||
this.refs.weaError.showError();
|
||||
return;
|
||||
} else if (!f.isValid && type === "phone") {
|
||||
} else if (!f.isValid && (type === "phone" || this.props.isSalaryMobile)) {
|
||||
f.showErrors();
|
||||
return;
|
||||
}
|
||||
checkMobileCode({ id: this.props.id, mobileCode: this.state.captcha }).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
clearInterval(this.timeRef);
|
||||
this.setState({ captcha: "", time: 60 });
|
||||
this.props.onCancel();
|
||||
this.props.onConfirm();
|
||||
} else {
|
||||
|
|
@ -69,7 +71,7 @@ class Index extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { captcha, time } = this.state, type = getQueryString("type");
|
||||
const { captcha, time } = this.state, { isSalaryMobile } = this.props, type = getQueryString("type");
|
||||
const itemRender = {
|
||||
mobileCode: (field, textAreaProps, form, formParams) => {
|
||||
return (<div className="captchaInputBox">
|
||||
|
|
@ -85,7 +87,9 @@ class Index extends Component {
|
|||
};
|
||||
return (<React.Fragment>
|
||||
{
|
||||
type === "phone" ? <MobileModal title={getLabel(111, "验证码验证")} onConfirm={this.handleConfirm}>
|
||||
(type === "phone" || isSalaryMobile) ?
|
||||
<MobileModal title={getLabel(111, "验证码验证")} isSalaryMobile
|
||||
onConfirm={this.handleConfirm} onCancel={this.props.onCancel}>
|
||||
<FormInfo center={false} itemRender={itemRender} form={form} formFields={captchaCondition}/>
|
||||
</MobileModal> :
|
||||
<WeaDialog
|
||||
|
|
|
|||
|
|
@ -56,6 +56,8 @@ import SupplementaryCalc from "./pages/supplementaryCalc";
|
|||
import VariableSalary from "./pages/variableSalary";
|
||||
import Datapush from "./pages/datapush";
|
||||
import Layout from "./layout";
|
||||
|
||||
import CustomRoutes from "./pages/custom-pages";
|
||||
import stores from "./stores";
|
||||
import "./style/index";
|
||||
// 读取系统多语言配置
|
||||
|
|
@ -123,10 +125,11 @@ const Routes = (
|
|||
<Route key="topologyView" path="topologyView/:salarySobId/:salaryItemId" component={TopologyMap}/>
|
||||
<Route key="supplementaryCalc" path="supplementaryCalc" component={SupplementaryCalc}/>
|
||||
<Route key="variableSalary" path="variableSalary" component={VariableSalary}/>
|
||||
{CustomRoutes}
|
||||
</Route>
|
||||
);
|
||||
|
||||
module.exports = {
|
||||
Route: Routes,
|
||||
store: stores
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
import React from "react";
|
||||
import Route from "react-router/lib/Route";
|
||||
import PersonalSalaryReport from "./xbxt/personalSalaryReport";
|
||||
|
||||
const CustomRoutes = [
|
||||
<Route key="personalSalaryReport_xbxt" path="personalSalaryReport_xbxt" component={PersonalSalaryReport}/>
|
||||
];
|
||||
|
||||
export default CustomRoutes;
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
.xbxt_report {
|
||||
.ant-spin-nested-loading, .ant-spin-container {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.wea-new-top-content {
|
||||
background: #f6f6f6;
|
||||
padding: 8px 16px 0 16px;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
/*
|
||||
* 西部信托
|
||||
* 个人薪资报表
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2025/11/11
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaTop } from "ecCom";
|
||||
import { MonthRangePicker } from "../../reportView/components/statisticalMicroSettingsSlide";
|
||||
import { postFetch } from "../../../util/request";
|
||||
import moment from "moment";
|
||||
import { Spin } from "antd";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class PersonalSalaryReport extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
dateRange: [
|
||||
moment(new Date()).subtract(12, "months").format("YYYY-MM"),
|
||||
moment(new Date()).format("YYYY-MM")
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
window.addEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
handleReceive = ({ data }) => {
|
||||
const { type, payload: { id, params } = {} } = data;
|
||||
const { pageInfo } = this.state;
|
||||
if (type === "init") {
|
||||
this.getSalaryReport();
|
||||
} else if (type === "turn") {
|
||||
if (id === "PAGEINFO") {
|
||||
const { pageNum: current, size: pageSize } = params;
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize }
|
||||
}, () => this.getSalaryReport());
|
||||
}
|
||||
}
|
||||
};
|
||||
postMessageToChild = (payload) => {
|
||||
const i18n = {
|
||||
"共": getLabel(18609, "共"), "条": getLabel(18256, "条"),
|
||||
"总计": getLabel(523, "总计")
|
||||
};
|
||||
const childFrameObj = document.getElementById("atdTable");
|
||||
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
||||
};
|
||||
getSalaryReport = () => {
|
||||
const { pageInfo, dateRange } = this.state, [startDateStr, endDateStr] = dateRange;
|
||||
const payload = { startDateStr, endDateStr, ...pageInfo };
|
||||
this.setState({ loading: true });
|
||||
postFetch("/api/bs/hrmsalary/report/statistics/employee/salaryReport", payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { columns, pageInfo: pageparams } = data;
|
||||
const { list: dataSource, pageNum: current, total, pageSize } = pageparams;
|
||||
this.setState({
|
||||
columns, dataSource, pageInfo: { ...pageInfo, current, total, pageSize }
|
||||
}, () => {
|
||||
const { columns, dataSource, pageInfo } = this.state;
|
||||
this.postMessageToChild({
|
||||
dataSource, pageInfo, showTotalCell: false, calcDetail: true, tableScrollHeight: 107,
|
||||
columns: _.map(columns, (it, idx) => ({
|
||||
dataIndex: it.column, title: it.text, calcDetail: true, showSee: false,
|
||||
width: (it.dataIndex === "taxAgent" || it.dataIndex === "salarySob") ? 176 : it.width,
|
||||
fixed: (idx === 1 || idx === 0 || idx === 2) ? "left" : "",
|
||||
ellipsis: true
|
||||
}))
|
||||
});
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
|
||||
|
||||
render() {
|
||||
const { dataSource, loading, dateRange } = this.state;
|
||||
const dom = document.querySelector(".wea-new-top-content");
|
||||
let height = 280;
|
||||
if (dataSource.length > 0 && dom) {
|
||||
const tableHeight = dataSource.length * 39 + 127;
|
||||
height = dom.offsetHeight > tableHeight ? tableHeight : dom.offsetHeight;
|
||||
}
|
||||
return (<WeaTop
|
||||
title={getLabel(111, "个人薪资报表")} buttonSpace={10} className="xbxt_report"
|
||||
icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
||||
buttons={[<MonthRangePicker dateRange={dateRange} viewAttr={2}
|
||||
onChange={v => this.setState({ dateRange: v }, () => this.getSalaryReport())}/>]}>
|
||||
<div style={{ height: height + "px" }}>
|
||||
<Spin spinning={loading}>
|
||||
<iframe
|
||||
style={{ border: 0, width: "100%", height: "100%" }}
|
||||
// src="http://localhost:7607/#/calcTable"
|
||||
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/calcTable"
|
||||
id="atdTable"
|
||||
/>
|
||||
</Spin>
|
||||
</div>
|
||||
</WeaTop>);
|
||||
}
|
||||
}
|
||||
|
||||
export default PersonalSalaryReport;
|
||||
|
|
@ -35,8 +35,13 @@ export default class MobilePayroll extends React.Component {
|
|||
async componentWillMount() {
|
||||
const type = getQueryString("type");
|
||||
this.id = getQueryString("id");
|
||||
const { mySalaryStore: { init, setMySalaryBill } } = this.props;
|
||||
const { mySalaryStore: { init, setMySalaryBill, setInitEmVerify } } = this.props;
|
||||
setMySalaryBill({});
|
||||
// 西部信托-改造
|
||||
setInitEmVerify();
|
||||
this.getMySalaryBill(getQueryString("id"));
|
||||
return
|
||||
// 结束
|
||||
const { data, status } = await payrollCheckType();
|
||||
if (status && data === "PWD") {
|
||||
type !== "phone" ? init(false, () => this.getMySalaryBill(this.id)) : await this.initMobile();
|
||||
|
|
@ -200,4 +205,4 @@ export default class MobilePayroll extends React.Component {
|
|||
</Authority>}
|
||||
</React.Fragment>);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -49,11 +49,12 @@ class LoginVerify extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const itemRender = {};
|
||||
return (<MobileModal title={getLabel(111, "请先输入登录密码")} onConfirm={this.save}>
|
||||
const itemRender = {}, { isSalaryMobile, onCancel } = this.props;
|
||||
return (<MobileModal title={getLabel(111, "请先输入登录密码")} onConfirm={this.save} isSalaryMobile={isSalaryMobile}
|
||||
onCancel={onCancel}>
|
||||
<FormInfo center={false} itemRender={itemRender} form={form} formFields={loginCondition}/>
|
||||
</MobileModal>);
|
||||
}
|
||||
}
|
||||
|
||||
export default LoginVerify;
|
||||
export default LoginVerify;
|
||||
|
|
@ -34,6 +34,7 @@ class MobileModal extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { isSalaryMobile, onCancel } = this.props;
|
||||
return (
|
||||
<div id="am-modal-container">
|
||||
<div>
|
||||
|
|
@ -48,7 +49,9 @@ class MobileModal extends Component {
|
|||
<div className="am-modal-footer">
|
||||
<div className="am-modal-button-group-h">
|
||||
<a href="javascript:void(0);" className="am-modal-button"
|
||||
onClick={() => removeElementById("am-modal-container")}>{getLabel(111, "取消")}</a>
|
||||
onClick={() => {
|
||||
isSalaryMobile ? onCancel() : removeElementById("am-modal-container");
|
||||
}}>{getLabel(111, "取消")}</a>
|
||||
<a href="javascript:void(0);" className="am-modal-button"
|
||||
onClick={this.props.onConfirm}>{getLabel(111, "确定")}</a>
|
||||
</div>
|
||||
|
|
@ -62,4 +65,4 @@ class MobileModal extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
export default MobileModal;
|
||||
export default MobileModal;
|
||||
|
|
@ -57,7 +57,7 @@ class SecondaryVerify extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { notSetting } = this.state;
|
||||
const { notSetting } = this.state, { isSalaryMobile, onCancel } = this.props;
|
||||
const itemRender = {
|
||||
authCode: (field, textAreaProps, form, formParams) => {
|
||||
return (<React.Fragment>
|
||||
|
|
@ -72,11 +72,13 @@ class SecondaryVerify extends Component {
|
|||
</React.Fragment>);
|
||||
}
|
||||
};
|
||||
return (<MobileModal title={getLabel(111, "身份验证")} onConfirm={this.doSecondAuth}>
|
||||
<FormInfo center={false} custLabelCol={9} itemRender={itemRender} form={form}
|
||||
formFields={secondaryVerifyConditions}/>
|
||||
</MobileModal>);
|
||||
return (
|
||||
<MobileModal title={getLabel(111, "身份验证")} onConfirm={this.doSecondAuth} isSalaryMobile={isSalaryMobile}
|
||||
onCancel={onCancel}>
|
||||
<FormInfo center={false} custLabelCol={9} itemRender={itemRender} form={form}
|
||||
formFields={secondaryVerifyConditions}/>
|
||||
</MobileModal>);
|
||||
}
|
||||
}
|
||||
|
||||
export default SecondaryVerify;
|
||||
export default SecondaryVerify;
|
||||
|
|
@ -66,6 +66,7 @@ class SecondarypwdVerify extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { isSalaryMobile, onCancel } = this.props;
|
||||
const itemRender = {
|
||||
validatecode: (field, textAreaProps, form, formParams) => {
|
||||
return (<React.Fragment>
|
||||
|
|
@ -81,11 +82,12 @@ class SecondarypwdVerify extends Component {
|
|||
</React.Fragment>);
|
||||
}
|
||||
};
|
||||
return (<MobileModal title={getLabel(111, "二次验证密码设置")} onConfirm={this.save}>
|
||||
return (<MobileModal title={getLabel(111, "二次验证密码设置")} onConfirm={this.save} isSalaryMobile={isSalaryMobile}
|
||||
onCancel={onCancel}>
|
||||
<FormInfo className="secondarypwd-form" center={false} itemRender={itemRender} form={form}
|
||||
formFields={secondarypwdCondition}/>
|
||||
</MobileModal>);
|
||||
}
|
||||
}
|
||||
|
||||
export default SecondarypwdVerify;
|
||||
export default SecondarypwdVerify;
|
||||
|
|
@ -13,7 +13,6 @@ import Content from "../../components/pcTemplate/content";
|
|||
import { confirmSalaryBill, feedBackSalaryBill, payrollCheckType } from "../../apis/payroll";
|
||||
import CaptchaModal from "../../components/captchaModal";
|
||||
import "./index.less";
|
||||
import { getQueryString } from "../../util/url";
|
||||
|
||||
const isIPhone = new RegExp("\\biPhone\\b|\\biPod\\b", "i").test(window.navigator.userAgent);
|
||||
const isEm = window.navigator.userAgent.indexOf("E-Mobile7") >= 0;
|
||||
|
|
@ -31,17 +30,19 @@ class MySalaryView extends Component {
|
|||
}
|
||||
|
||||
async componentDidMount() {
|
||||
// 西部信托取消权限验证
|
||||
|
||||
const { mySalaryStore: { init, getMySalaryBill }, params: { salaryInfoId } } = this.props;
|
||||
const { data, status } = await payrollCheckType();
|
||||
if (status && data === "PWD") {
|
||||
init(false, () => {
|
||||
// const { data, status } = await payrollCheckType();
|
||||
// if (status && data === "PWD") {
|
||||
// init(false, () => {
|
||||
getMySalaryBill(Number(salaryInfoId)).then(data => {
|
||||
this.setState({ mySalaryStore: data });
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.setState({ captchaVisible: true });
|
||||
}
|
||||
// });
|
||||
// } else {
|
||||
// this.setState({ captchaVisible: true });
|
||||
// }
|
||||
}
|
||||
|
||||
confirmSalaryBill = () => {
|
||||
|
|
@ -104,10 +105,11 @@ class MySalaryView extends Component {
|
|||
background: salaryTemplate.background, tipPosi: salaryTemplate.textContentPosition || "",
|
||||
itemTypeList: [employeeInformation, ...salaryGroups]
|
||||
};
|
||||
// this.props.mySalaryStore -西部信托取消验证
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Authority ecId={`${this && this.props && this.props.ecId || ""}_Authority@lulowc`}
|
||||
store={this.props.mySalaryStore}>
|
||||
store={{ loading: false, hasRight: true }}>
|
||||
<div className="weapp-salary-my-salary-view-payroll">
|
||||
<Content {...salaryProps}>
|
||||
<ConfirmBtns
|
||||
|
|
@ -136,4 +138,4 @@ export const ConfirmBtns = (props) => {
|
|||
<Button type="ghost" onClick={props.goFeedback}>{getLabel(111, "反馈")}</Button>
|
||||
}
|
||||
</div>;
|
||||
};
|
||||
};
|
||||
|
|
@ -5,27 +5,49 @@
|
|||
* Date: 2023/11/13
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLocaleProvider, WeaTable } from "ecCom";
|
||||
import { Dropdown, Menu } from "antd";
|
||||
import { mySalaryBillList, mySalaryBillList4Card } from "../../../../apis/mySalaryBenefits";
|
||||
import moment from "moment";
|
||||
import { payrollCheckType } from "../../../../apis/payroll";
|
||||
import Authority from "../../../mySalary/authority";
|
||||
import CaptchaModal from "../../../../components/captchaModal";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const API = {
|
||||
mySalaryBillList, mySalaryBillList4Card
|
||||
};
|
||||
|
||||
@inject("mySalaryStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
loading: false
|
||||
loading: false, store: { loading: true, hasRight: false }, captchaVisible: false
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.getMySalaryBillList(this.props);
|
||||
async componentDidMount() {
|
||||
const { data, status } = await payrollCheckType();
|
||||
if (status && data === "PWD") {
|
||||
if (window.doCheckSecondaryVerify4ec && !this.props.type) {
|
||||
window.doCheckSecondaryVerify4ec({ mouldCode: "HRM", itemCode: "SALARY" }, (data) => {
|
||||
const { status } = data;
|
||||
if (status === "1") {
|
||||
this.setState({ store: { loading: false, hasRight: true } });
|
||||
this.getMySalaryBillList(this.props);
|
||||
} else {
|
||||
this.setState({ store: { loading: false, hasRight: false } });
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.getMySalaryBillList(this.props);
|
||||
}
|
||||
} else {
|
||||
this.setState({ captchaVisible: true });
|
||||
}
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
|
|
@ -35,7 +57,7 @@ class Index extends Component {
|
|||
getMySalaryBillList = (props) => {
|
||||
this.setState({ loading: true });
|
||||
const { pageInfo } = this.state;
|
||||
const { salaryYearMonth, employeeId, type = "mySalaryBillList" } = props;
|
||||
const { salaryYearMonth, employeeId, type = "mySalaryBillList" } = props || this.props;
|
||||
API[type]({ salaryYearMonth, employeeId, ...pageInfo }).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
|
|
@ -59,7 +81,7 @@ class Index extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { dataSource, loading, columns, pageInfo } = this.state;
|
||||
const { dataSource, loading, columns, pageInfo, store, captchaVisible } = this.state;
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
|
||||
|
|
@ -77,7 +99,18 @@ class Index extends Component {
|
|||
}, () => this.getMySalaryBillList(this.props));
|
||||
}
|
||||
};
|
||||
return (
|
||||
{/*发送验证码*/
|
||||
}
|
||||
if (captchaVisible) {
|
||||
return <CaptchaModal
|
||||
visible={captchaVisible}
|
||||
onCancel={() => this.setState({ captchaVisible: false, store: { loading: false, hasRight: false } })}
|
||||
onConfirm={() => {
|
||||
this.setState({ store: { loading: false, hasRight: true } }, () => this.getMySalaryBillList(this.props));
|
||||
}}
|
||||
/>;
|
||||
}
|
||||
return (<Authority store={store}>
|
||||
<WeaTable rowKey="id" dataSource={dataSource} pagination={pagination}
|
||||
scroll={{ y: `calc(100vh - 166px)` }}
|
||||
loading={loading} columns={[...columns, {
|
||||
|
|
@ -102,8 +135,8 @@ class Index extends Component {
|
|||
</React.Fragment>)
|
||||
}]}
|
||||
/>
|
||||
);
|
||||
</Authority>);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
export default Index;
|
||||
|
|
@ -5,12 +5,18 @@
|
|||
* Date: 2023/11/10
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider, WeaTab } from "ecCom";
|
||||
import { WeaLocaleProvider, WeaTab, WeaTools } from "ecCom";
|
||||
import moment from "moment";
|
||||
import MobileDatePicker from "./components/mobileDatePicker";
|
||||
import PayrollList from "./components/payrollList";
|
||||
import { mySalaryBillList } from "../../apis/mySalaryBenefits";
|
||||
import { payrollCheckType } from "../../apis/payroll";
|
||||
import CaptchaModal from "../../components/captchaModal";
|
||||
import Authority from "../mySalary/authority";
|
||||
import "./index.less";
|
||||
import SecondaryVerify from "../mobilePayroll/secondaryVerify";
|
||||
import LoginVerify from "../mobilePayroll/loginVerify";
|
||||
import SecondarypwdVerify from "../mobilePayroll/secondarypwdVerify";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
|
|
@ -19,17 +25,32 @@ class Index extends Component {
|
|||
super(props);
|
||||
this.state = {
|
||||
dataSource: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
store: { loading: true, hasRight: false }, captchaVisible: false,
|
||||
visible: false, loginVisible: false, pwdSetVisible: false,
|
||||
salaryYearMonth: [
|
||||
moment(new Date()).subtract(1, 'year').startOf("year").format("YYYY-MM"),
|
||||
moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"),
|
||||
moment().endOf("year").format("YYYY-MM")],
|
||||
isMore: true //是否还有更多数据
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.getMySalaryBillList();
|
||||
async componentDidMount() {
|
||||
const { data, status } = await payrollCheckType();
|
||||
if (status && data === "PWD") {
|
||||
WeaTools.callApi("/api/encrypt/secondauthsetting/isNeedSecondAuth", "POST", {
|
||||
mouldCode: "HRM", itemCode: "SALARY"
|
||||
}).then(({ status, isNeedSecondAuth }) => {
|
||||
if (status && isNeedSecondAuth) {
|
||||
this.setState({ visible: true });
|
||||
} else {
|
||||
this.setState({ store: { loading: false, hasRight: true } }, () => this.getMySalaryBillList());
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.setState({ captchaVisible: true });
|
||||
}
|
||||
const mySalaryMobile = document.getElementById("mySalaryMobile");
|
||||
mySalaryMobile.addEventListener("scroll", this.handleScroll, true);
|
||||
mySalaryMobile && mySalaryMobile.addEventListener("scroll", this.handleScroll, true);
|
||||
}
|
||||
|
||||
handleScroll = () => {
|
||||
|
|
@ -78,9 +99,51 @@ class Index extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { salaryYearMonth, dataSource, isMore, loading } = this.state;
|
||||
const {
|
||||
salaryYearMonth, dataSource, isMore, loading, store, captchaVisible, visible, loginVisible, pwdSetVisible
|
||||
} = this.state;
|
||||
const [salaryStartYearMonth, salaryEndYearMonth] = salaryYearMonth;
|
||||
return (
|
||||
if (visible) {
|
||||
return (<SecondaryVerify isSalaryMobile
|
||||
onSetLogin={() => this.setState({ visible: false, loginVisible: true })}
|
||||
onCancel={() => this.setState({
|
||||
visible: false, store: { loading: false, hasRight: false }
|
||||
})}
|
||||
onSuccess={() => {
|
||||
this.setState({
|
||||
visible: false, store: { loading: false, hasRight: true }
|
||||
}, () => this.getMySalaryBillList());
|
||||
}}/>);
|
||||
}
|
||||
if (loginVisible) {
|
||||
return (<LoginVerify isSalaryMobile
|
||||
onCancel={() => this.setState({
|
||||
loginVisible: false, store: { loading: false, hasRight: false }
|
||||
})}
|
||||
onSetPwdSet={() => this.setState({ loginVisible: false, pwdSetVisible: true })}/>);
|
||||
}
|
||||
if (pwdSetVisible) {
|
||||
return (<SecondarypwdVerify isSalaryMobile
|
||||
onCancel={() => this.setState({
|
||||
pwdSetVisible: false, store: { loading: false, hasRight: false }
|
||||
})}
|
||||
onSuccess={() => this.setState({
|
||||
pwdSetVisible: false,
|
||||
store: { loading: false, hasRight: true }
|
||||
}, () => this.getMySalaryBillList())}/>);
|
||||
}
|
||||
{/*发送验证码*/
|
||||
}
|
||||
if (captchaVisible) {
|
||||
return <CaptchaModal
|
||||
visible={captchaVisible} isSalaryMobile
|
||||
onCancel={() => this.setState({ captchaVisible: false, store: { loading: false, hasRight: false } })}
|
||||
onConfirm={() => {
|
||||
this.setState({ store: { loading: false, hasRight: true } }, () => this.getMySalaryBillList());
|
||||
}}
|
||||
/>;
|
||||
}
|
||||
return (<Authority store={store}>
|
||||
<div id="mySalaryMobile" className="salary-mobile-list-wrapper">
|
||||
<div className="salary-mobile-list-tab">
|
||||
<WeaTab
|
||||
|
|
@ -96,8 +159,8 @@ class Index extends Component {
|
|||
</div>
|
||||
<PayrollList dataSource={dataSource} isMore={isMore} loading={loading}/>
|
||||
</div>
|
||||
);
|
||||
</Authority>);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
export default Index;
|
||||
Loading…
Reference in New Issue