Compare commits
2 Commits
372d9d53ee
...
11ac14d440
| Author | SHA1 | Date |
|---|---|---|
|
|
11ac14d440 | |
|
|
4a3c9311bf |
|
|
@ -21,7 +21,7 @@ const { getLabel } = WeaLocaleProvider;
|
|||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = { captcha: "", time: 60 };
|
||||
this.state = { captcha: "", time: 60, loading: false };
|
||||
this.timeRef = null;
|
||||
}
|
||||
|
||||
|
|
@ -31,10 +31,11 @@ class Index extends Component {
|
|||
|
||||
componentWillUnmount() {
|
||||
clearInterval(this.timeRef);
|
||||
this.setState({ captcha: "", time: 60 });
|
||||
this.setState({ captcha: "", time: 60, loading: false });
|
||||
}
|
||||
|
||||
handleSendCaptcha = () => {
|
||||
this.setState({ loading: true });
|
||||
sendMobileCode({ id: this.props.id }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.timeRef = setInterval(() => {
|
||||
|
|
@ -42,12 +43,14 @@ class Index extends Component {
|
|||
this.setState({ time: time - 1 }, () => {
|
||||
if (this.state.time === -1) {
|
||||
clearInterval(this.timeRef);
|
||||
this.setState({ time: 60 });
|
||||
this.setState({ time: 60, loading: false });
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
} else {
|
||||
this.setState({ loading: false });
|
||||
}
|
||||
});
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
handleConfirm = async () => {
|
||||
const type = getQueryString("type"), f = await form.validateForm();
|
||||
|
|
@ -69,13 +72,13 @@ class Index extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { captcha, time } = this.state, type = getQueryString("type");
|
||||
const { captcha, time, loading } = this.state, type = getQueryString("type");
|
||||
const itemRender = {
|
||||
mobileCode: (field, textAreaProps, form, formParams) => {
|
||||
return (<div className="captchaInputBox">
|
||||
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }} form={form} formParams={formParams}
|
||||
onChange={() => this.setState({ captcha: form.getFormParams().mobileCode })}/>
|
||||
<Button type="primary" onClick={this.handleSendCaptcha} disabled={time !== 60}>
|
||||
<Button type="primary" onClick={this.handleSendCaptcha} disabled={loading}>
|
||||
{
|
||||
time === 60 ? getLabel(111, "发送验证码") : `${time}S`
|
||||
}
|
||||
|
|
@ -104,7 +107,7 @@ class Index extends Component {
|
|||
<WeaError tipPosition="bottom" ref="weaError" error={getLabel(111, "验证码未填写")}>
|
||||
<div className="captchaInputBox">
|
||||
<WeaInput value={captcha} onChange={captcha => this.setState({ captcha })}/>
|
||||
<Button type="primary" onClick={this.handleSendCaptcha} disabled={time !== 60}>
|
||||
<Button type="primary" onClick={this.handleSendCaptcha} disabled={loading}>
|
||||
{
|
||||
time === 60 ? getLabel(111, "发送验证码") : `${time}S`
|
||||
}
|
||||
|
|
@ -120,4 +123,4 @@ class Index extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
export default Index;
|
||||
|
|
@ -448,7 +448,9 @@ export const MonthRangePicker = (props) => {
|
|||
<WeaDatePicker
|
||||
value={startDate} disabled={disabled}
|
||||
disabledDate={(current) => {
|
||||
return current && endDate && current.getTime() > new Date(endDate).getTime();
|
||||
// 20251212前版本(问题时不能选到当月)
|
||||
// return current && endDate && current.getTime() > new Date(endDate).getTime();
|
||||
return current && endDate && moment(`${new Date(current.getTime()).getFullYear()}-${new Date(current.getTime()).getMonth() + 1}`).isAfter(moment(endDate));
|
||||
}}
|
||||
format="YYYY-MM"
|
||||
onChange={(val) => onChange([val, endDate])}
|
||||
|
|
@ -510,4 +512,4 @@ export const getSalaryMonthValue = (dateType) => {
|
|||
break;
|
||||
}
|
||||
return [start, end];
|
||||
};
|
||||
};
|
||||
|
|
@ -245,13 +245,19 @@ export default class NormalIndex extends Component {
|
|||
});
|
||||
};
|
||||
handleExport = () => {
|
||||
const { selectedKey } = this.props;
|
||||
const { selectedKey } = this.props, { formParams } = this.state;
|
||||
const { departmentIds, subCompanyIds } = formParams;
|
||||
const urlObj = {
|
||||
"1": "/api/bs/hrmsalary/welfare/common/export",
|
||||
"3": "/api/bs/hrmsalary/welfare/supplementary/export"
|
||||
};
|
||||
const extraParams = {
|
||||
...formParams,
|
||||
departmentIds: departmentIds.join(","),
|
||||
subCompanyIds: subCompanyIds.join(",")
|
||||
};
|
||||
const url = `${window.location
|
||||
.origin}${urlObj[selectedKey]}?${convertToUrlString(_.pick(this.props, ["billMonth", "paymentOrganization"]))}`;
|
||||
.origin}${urlObj[selectedKey]}?${convertToUrlString({ ..._.pick(this.props, ["billMonth", "paymentOrganization"]), ...extraParams })}`;
|
||||
window.open(url, "_blank");
|
||||
};
|
||||
handleEditNormalStandingBook = (record) => {
|
||||
|
|
@ -279,12 +285,12 @@ export default class NormalIndex extends Component {
|
|||
<Col span={12}><WeaFormItem label={getLabel(27511, "部门")} labelCol={{ span: 4 }} wrapperCol={{ span: 18 }}>
|
||||
<WeaBrowser
|
||||
isSingle={false} value={departmentIds.join(",")} type={57}
|
||||
onChange={v => this.setState({ formParams: { ...formParams, departmentIds: v.split(",") } })}/>
|
||||
onChange={v => this.setState({ formParams: { ...formParams, departmentIds: v ? v.split(",") : [] } })}/>
|
||||
</WeaFormItem></Col>
|
||||
<Col span={12}><WeaFormItem label={getLabel(33553, "分部")} labelCol={{ span: 4 }} wrapperCol={{ span: 18 }}>
|
||||
<WeaBrowser
|
||||
isSingle={false} value={subCompanyIds.join(",")} type={164}
|
||||
onChange={v => this.setState({ formParams: { ...formParams, subCompanyIds: v.split(",") } })}/>
|
||||
onChange={v => this.setState({ formParams: { ...formParams, subCompanyIds: v ? v.split(",") : [] } })}/>
|
||||
</WeaFormItem></Col>
|
||||
</Row>
|
||||
</WeaSearchGroup>;
|
||||
|
|
@ -402,4 +408,4 @@ export default class NormalIndex extends Component {
|
|||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -88,7 +88,13 @@ class Regression extends Component {
|
|||
});
|
||||
break;
|
||||
case "export":
|
||||
const url = `/api/bs/hrmsalary/welfare/recession/export?${convertToUrlString(_.pick(this.props, ["billMonth", "paymentOrganization", "creator"]))}`;
|
||||
const extraParams = {
|
||||
name,
|
||||
workcode,
|
||||
departmentIds: this.regTopRef.state.departmentIds,
|
||||
subCompanyIds: this.regTopRef.state.subCompanyIds
|
||||
};
|
||||
const url = `/api/bs/hrmsalary/welfare/recession/export?${convertToUrlString({ ..._.pick(this.props, ["billMonth", "paymentOrganization", "creator"]), ...extraParams })}`;
|
||||
window.open(url, "_blank");
|
||||
break;
|
||||
case "search":
|
||||
|
|
@ -152,4 +158,4 @@ class Regression extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
export default Regression;
|
||||
export default Regression;
|
||||
Loading…
Reference in New Issue