Merge branch 'release/3.0.1.2504.01-合并业务线' into release/2.19.1.2503.01-业务线个税

This commit is contained in:
lys 2025-04-25 17:40:08 +08:00
commit ac43423f96
12 changed files with 197 additions and 117 deletions

View File

@ -202,8 +202,12 @@ export const salaryBillSendSum = (params) => {
return postFetch("/api/bs/hrmsalary/salaryBill/send/sum", params);
};
//工资单发放-发送短信验证码
export const sendMobileCode = (params) => {
return postFetch("/api/bs/hrmsalary/salaryBill/sendMobileCode", params);
export const sendMobileCode = (params, header = {}) => {
return postFetch("/api/bs/hrmsalary/salaryBill/sendMobileCode", params, header);
};
//工资单发放-发送短信验证码
export const checkMobileCode = (params, header = {}) => {
return postFetch("/api/bs/hrmsalary/salaryBill/checkMobileCode", params, header);
};
//工资单-验证方式
export const payrollCheckType = params => {

View File

@ -6,32 +6,33 @@
*/
import React, { Component } from "react";
import { WeaDialog, WeaError, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup } from "ecCom";
import { sendMobileCode } from "../../apis/payroll";
import { Button } from "antd";
import { WeaForm, WeaSwitch } from "comsMobx";
import { checkMobileCode, sendMobileCode } from "../../apis/payroll";
import { getQueryString } from "../../util/url";
import FormInfo from "../FormInfo";
import { captchaCondition } from "../../pages/mobilePayroll/pwdCondtion";
import MobileModal from "../../pages/mobilePayroll/mobileModal";
import { Button, message } from "antd";
import "./index.less";
const form = new WeaForm();
const { getLabel } = WeaLocaleProvider;
class Index extends Component {
constructor(props) {
super(props);
this.state = {
captcha: "",
time: 60
};
this.state = { captcha: "", time: 60 };
this.timeRef = null;
}
componentDidMount() {
form.initFormFields(captchaCondition);
}
componentWillUnmount() {
clearInterval(this.timeRef);
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && !nextProps.visible) {
clearInterval(this.timeRef);
this.setState({ captcha: "", time: 60 });
}
}
handleSendCaptcha = () => {
sendMobileCode({ id: this.props.id }).then(({ status, data }) => {
@ -48,18 +49,45 @@ class Index extends Component {
}
});
};
handleConfirm = () => {
if (!this.state.captcha) {
handleConfirm = async () => {
const type = getQueryString("type"), f = await form.validateForm();
if (!this.state.captcha && type !== "phone") {
this.refs.weaError.showError();
// return
return;
} else if (!f.isValid && type === "phone") {
f.showErrors();
return;
}
checkMobileCode({ id: this.props.id, mobileCode: this.state.captcha }).then(({ status, errormsg }) => {
if (status) {
this.props.onCancel();
this.props.onConfirm();
} else {
message.error(errormsg);
}
});
};
render() {
const { captcha, time } = this.state;
return (
const { captcha, time } = 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}>
{
time === 60 ? getLabel(111, "发送验证码") : `${time}S`
}
</Button>
</div>);
}
};
return (<React.Fragment>
{
type === "phone" ? <MobileModal title={getLabel(111, "验证码验证")} onConfirm={this.handleConfirm}>
<FormInfo center={false} itemRender={itemRender} form={form} formFields={captchaCondition}/>
</MobileModal> :
<WeaDialog
initLoadCss {...this.props} style={{ width: 550 }}
className="captchaWrapper" title={getLabel(111, "验证码验证")}
@ -73,7 +101,7 @@ class Index extends Component {
labelCol={{ span: 8 }}
wrapperCol={{ span: 16 }}
>
<WeaError tipPosition="bottom" ref="weaError" error={getLabel(826, "验证码未填写")}>
<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}>
@ -86,6 +114,8 @@ class Index extends Component {
</WeaFormItem>
</WeaSearchGroup>
</WeaDialog>
}
</React.Fragment>
);
}
}

View File

@ -5,6 +5,10 @@
.wea-form-item-wrapper {
.wea-error {
width: 100%;
}
}
}
}
.captchaInputBox {
display: flex;
@ -23,7 +27,3 @@
line-height: 15px;
}
}
}
}
}
}

View File

@ -166,7 +166,7 @@ class SalaryDetails extends Component {
this.postMessageToChild({
dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, tableScrollHeight: 154, sumRow,
columns: _.map(columns, (it, idx) => ({
dataIndex: it.column || it.dataIndex, title: it.text || it.title, calcDetail: true,
dataIndex: it.column || it.dataIndex, title: it.text || it.title, calcDetail: true, showSee: false,
width: (it.dataIndex === "taxAgent" || it.dataIndex === "salarySob") ? 176 : (it.width || it.oldWidth),
fixed: (idx === 1 || idx === 0 || idx === 2) ? "left" : "",
ellipsis: true

View File

@ -5,9 +5,9 @@
* Date: 2023/3/7
*/
import React, { Component } from "react";
import { WeaInputSearch, WeaLocaleProvider, WeaSlideModal, WeaTable, WeaTop } from "ecCom";
import { Button } from "antd";
import { WeaInputSearch, WeaLocaleProvider, WeaSlideModal, WeaTop } from "ecCom";
import { viewAttendQuote } from "../../../../apis/attendance";
import { Button, Spin } from "antd";
import "./index.less";
const { getLabel } = WeaLocaleProvider;
@ -16,11 +16,31 @@ class AttendanceDataViewSlide extends Component {
constructor(props) {
super(props);
this.state = {
loading: { query: false }, keyword: "", dataSource: [], columns: [],
pageInfo: { current: 1, pageSize: 10, total: 0 }
loading: { query: false }, keyword: "", dataSource: [], pageInfo: { current: 1, pageSize: 10, total: 0 }
};
}
componentDidMount() {
window.addEventListener("message", this.handleReceive, false);
}
componentWillUnmount() {
window.removeEventListener("message", this.handleReceive, false);
}
handleReceive = async ({ data }) => {
const { type, payload: { id, params } = {} } = data;
if (type === "turn") {
switch (id) {
case "PAGEINFO":
this.setState({ pageInfo: { ...this.state.pageInfo, ...params } }, () => this.viewAttendQuote());
break;
default:
break;
}
}
};
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) {
document.querySelector(".attendanceRefWrapper").classList.add("zIndex0-attendance");
@ -33,19 +53,29 @@ class AttendanceDataViewSlide extends Component {
viewAttendQuote = (extraPayload = {}, props) => {
const { loading, pageInfo, keyword } = this.state;
const { attendQuoteId } = props;
const { attendQuoteId } = props || this.props;
this.setState({ loading: { ...loading, query: true } });
viewAttendQuote({ ...pageInfo, attendQuoteId, keyword, ...extraPayload }).then(({ status, data }) => {
this.setState({ loading: { ...loading, query: false } });
if (status) {
const { columns, list: dataSource, pageNum: current, pageSize, total } = data.pageInfo;
this.setState({
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource,
columns: _.map(columns, (o, i) => ({ ...o, width: 150, fixed: i === 0 ? "left" : null }))
});
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource
}, () => this.postMessageToChild({
pageInfo: this.state.pageInfo, dataSource, showRowSelection: false, unitTableType: "attendanceView",
columns: _.map(columns, (o, i) => ({ ...o, width: 150, fixed: i === 0 ? "left" : false }))
}));
}
}).catch(() => this.setState({ loading: { ...loading, query: false } }));
};
postMessageToChild = (payload = {}) => {
const i18n = {
"操作": getLabel(30585, "操作"), "编辑": getLabel(111, "编辑"), "共": getLabel(18609, "共"),
"条": getLabel(18256, "条")
};
const childFrameObj = document.getElementById("attendanceViewTable");
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
};
handleExportAttendQuote = () => {
if (!this.handleDebounce) {
this.handleDebounce = _.debounce(() => {
@ -60,24 +90,7 @@ class AttendanceDataViewSlide extends Component {
render() {
const { showOperateBtn, salaryYearMonth, ...extra } = this.props;
const { columns, dataSource, loading, pageInfo, keyword } = this.state;
const pagination = {
...pageInfo,
showTotal: (total) => `${total}`,
pageSizeOptions: ["10", "20", "50", "100"],
showSizeChanger: true,
showQuickJumper: true,
onShowSizeChange: (current, pageSize) => {
this.setState({
pageInfo: { ...pageInfo, current, pageSize }
}, () => this.viewAttendQuote({}, this.props));
},
onChange: (current) => {
this.setState({
pageInfo: { ...pageInfo, current }
}, () => this.viewAttendQuote({}, this.props));
}
};
const { loading, keyword } = this.state;
const btns = [
<Button type="primary" onClick={this.handleExportAttendQuote}>{getLabel(81272, "导出全部")}</Button>,
<WeaInputSearch
@ -100,9 +113,16 @@ class AttendanceDataViewSlide extends Component {
<div>{getLabel(543376, "考勤周期")}{salaryYearMonth}</div>
<div></div>
</div>
<WeaTable
columns={columns} dataSource={dataSource} bordered pagination={pagination}
loading={loading.query} scroll={{ x: 1200, y: `calc(100vh - 240px)` }}/>
<div style={{ height: `calc(100% - 40px)` }}>
<Spin spinning={loading.query}>
<iframe
style={{ border: 0, width: "100%", height: "100%" }}
// src="http://localhost:7607/#/unitTable"
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/unitTable"
id="attendanceViewTable"
/>
</Spin>
</div>
</div>
}
/>

View File

@ -54,8 +54,8 @@
margin-bottom: 8px;
}
.wea-new-table {
background: #FFF;
.ant-spin-nested-loading, .ant-spin-container {
height: 100%;
}
}

View File

@ -73,9 +73,14 @@ class CustomTreeSelect extends Component {
const { itemName } = detail;
return (
<TreeSelect dropdownStyle={{ maxHeight: 320, overflow: "auto" }} defaultValue={itemName}
dropdownMatchSelectWidth className="custom_item_treeselect"
dropdownMatchSelectWidth className="custom_item_treeselect" showSearch
loadData={(node) => this.getSourceItem(node.props.value)}
onSelect={this.handleSelect}>
onSelect={this.handleSelect}
treeNodeFilterProp="title"
filterTreeNode={(inputValue, treeNode) => {
const title = treeNode.props.title.props ? treeNode.props.title.props.children[0].props.children : treeNode.props.title;
return title.toLowerCase().indexOf(inputValue.toLowerCase()) >= 0;
}}>
{
_.map(sourceList, o => (
<TreeNode title={o.value} key={o.key} value={o.key} isLeaf={o.isLeaf} selectable={false}>

View File

@ -37,16 +37,13 @@ export default class MobilePayroll extends React.Component {
this.id = getQueryString("id");
const { mySalaryStore: { init, setMySalaryBill } } = this.props;
setMySalaryBill({});
if (type !== "phone") {
const { data, status } = await payrollCheckType();
if (status && data === "PWD") {
init(false, () => this.getMySalaryBill(this.id));
type !== "phone" ? init(false, () => this.getMySalaryBill(this.id)) : await this.initMobile();
} else {
this.setState({ captchaVisible: true });
}
}
type === "phone" && await this.initMobile();
}
initMobile = async () => {
const { mySalaryStore: { setInitEmVerify } } = this.props;
@ -156,11 +153,17 @@ export default class MobilePayroll extends React.Component {
{pwdSetVisible && <SecondarypwdVerify {...this.props} salaryBillToken={this.state.salaryBillToken}
onSuccess={() => this.setState({ pwdSetVisible: false }, () => this.initMobile())}/>}
{/*发送验证码*/}
{
captchaVisible &&
<CaptchaModal
visible={captchaVisible} id={getQueryString("id")}
onCancel={() => this.setState({ captchaVisible: false })}
onConfirm={() => this.props.mySalaryStore.setInitEmVerify()}
onConfirm={() => {
setInitEmVerify();
this.getMySalaryBill(getQueryString("id"));
}}
/>
}
</React.Fragment>;
const {
salaryTemplate, salaryGroups, employeeInformation, sendTime, confirmStatus, showAck, showFeedback

View File

@ -1,6 +1,25 @@
import { WeaLocaleProvider } from "ecCom";
const { getLabel } = WeaLocaleProvider;
export const captchaCondition = [
{
items: [
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["mobileCode"],
fieldcol: 18,
label: getLabel(111, "验证码"),
labelcol: 6,
detailtype: 1,
rules: "required|string",
viewAttr: 3
}
],
title: "",
defaultshow: true
}
];
export const loginCondition = [
{
items: [

View File

@ -53,7 +53,7 @@ class Index extends Component {
} = payrollTempForm.getFormParams(),
{ ackFeedbackStatus, feedbackStatus, autoAckDays, ...extraFb } = payrollTempFeedbackForm.getFormParams(),
{ formData, smsSettingDialog } = this.tmpBaseSetRef.state;
if (autoSendStatus !== "1" && emailStatus !== "1" && msgStatus !== "1" && smsStatus !== 1) {
if (autoSendStatus !== "1" && emailStatus !== "1" && msgStatus !== "1" && smsStatus !== "1") {
message.warning(getLabel(111, "工资单模板至少开启一个发送通道"));
return;
}

View File

@ -59,7 +59,6 @@ class PersonalScopeModal extends Component {
...scopeSelectLinkageDatas[cur],
browserConditionParam: {
...scopeSelectLinkageDatas[cur].browserConditionParam,
isSingle: true,
replaceDatas: !_.isEmpty(record) ? [{
id: String(record.targetId),
name: record.targetName

View File

@ -16,12 +16,12 @@ export const formHeaderPost = (url, method, params, header) => {
body: formdata
}).then(res => res.json());
};
export const postFetch = (url, params) => {
export const postFetch = (url, params, header = {}) => {
if (typeof localStorage.access_token === "string" && localStorage.access_token !== "") {
params.access_token = localStorage.access_token;
}
url = server + url + "?__random__=" + (new Date()).valueOf();
return fetch(url, getFetchParams("POST", params)).then(res => res.json());
return fetch(url, getFetchParams("POST", params, header)).then(res => res.json());
};
export const headerRequestFetch = (url, method, params, header) => {
if (typeof localStorage.access_token === "string" && localStorage.access_token !== "") {