薪资核算添加核算人员的功能
This commit is contained in:
parent
f8169a9080
commit
32072512a9
|
|
@ -3,11 +3,13 @@ import UserSure from "./userSure";
|
|||
import { inject, observer } from "mobx-react";
|
||||
import SalaryDetail from "./salaryDetail";
|
||||
import { Button, Dropdown, Menu, message, Modal } from "antd";
|
||||
import { WeaBrowser, WeaCheckbox, WeaFormItem, WeaInput, WeaSearchGroup, WeaSelect, WeaTab } from "ecCom";
|
||||
import { WeaBrowser, WeaCheckbox, WeaDropdown, WeaFormItem, WeaInput, WeaSearchGroup, WeaSelect, WeaTab } from "ecCom";
|
||||
import { getQueryString } from "../../util/url";
|
||||
import AcctResultImportModal from "./acctResult/importModal/acctResultImportModal";
|
||||
import ProgressModal from "../../components/progressModal";
|
||||
|
||||
const { ButtonSelect } = WeaDropdown;
|
||||
|
||||
@inject("calculateStore", "salaryFileStore")
|
||||
@observer
|
||||
export default class CalculateDetail extends React.Component {
|
||||
|
|
@ -27,7 +29,8 @@ export default class CalculateDetail extends React.Component {
|
|||
fieldData: {},
|
||||
acctResultImportVisiable: false,
|
||||
progressVisible: false,
|
||||
progress: 0
|
||||
progress: 0,
|
||||
accountIds: []
|
||||
};
|
||||
this.id = "";
|
||||
this.timer;
|
||||
|
|
@ -100,8 +103,8 @@ export default class CalculateDetail extends React.Component {
|
|||
<WeaSelect
|
||||
value={status}
|
||||
options={[
|
||||
{ key: "", showname: "" }, {key: "ALL", showname: "全部"},
|
||||
{ key: "NORMAL", showname: "在职" }, {key: "UNAVAILABLE", showname: "离职"}
|
||||
{ key: "", showname: "" }, { key: "ALL", showname: "全部" },
|
||||
{ key: "NORMAL", showname: "在职" }, { key: "UNAVAILABLE", showname: "离职" }
|
||||
]}
|
||||
onChange={(val) => this.setState({ searchItemsValue: { ...this.state.searchItemsValue, [key]: val } })}/>
|
||||
</WeaFormItem>
|
||||
|
|
@ -126,19 +129,23 @@ export default class CalculateDetail extends React.Component {
|
|||
};
|
||||
|
||||
// 核算点击事件
|
||||
handleAccount() {
|
||||
handleAccount = (key) => {
|
||||
const { calculateStore } = this.props;
|
||||
const {
|
||||
acctresultAccounting,
|
||||
acctResultList,
|
||||
getCalculateProgress
|
||||
} = calculateStore;
|
||||
const { acctresultAccounting, getCalculateProgress } = calculateStore;
|
||||
if (key === "SELECT" && _.isEmpty(this.state.accountIds)) {
|
||||
message.warning("请先选择表格数据");
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: "点击核算,公式项将按照公式逻辑核算,核算结果将覆盖原数据",
|
||||
onOk: () => {
|
||||
this.setState({ progress: 0 });
|
||||
acctresultAccounting(this.id).then(() => {
|
||||
let payload = { salaryAcctRecordId: this.id };
|
||||
if (key === "SELECT") {
|
||||
payload = _.assign(payload, { employeeIds: this.state.accountIds });
|
||||
}
|
||||
acctresultAccounting(payload).then(() => {
|
||||
this.setState({
|
||||
progressVisible: true
|
||||
});
|
||||
|
|
@ -152,7 +159,8 @@ export default class CalculateDetail extends React.Component {
|
|||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
this.setState({
|
||||
progressVisible: false
|
||||
progressVisible: false,
|
||||
accountIds: []
|
||||
});
|
||||
message.success("核算完成");
|
||||
// acctResultList({ salaryAcctRecordId: this.id });
|
||||
|
|
@ -163,7 +171,7 @@ export default class CalculateDetail extends React.Component {
|
|||
listType: "",
|
||||
url: "/api/bs/hrmsalary/salaryacct/acctresult/list",
|
||||
queryParams: {
|
||||
salaryAcctRecordId,
|
||||
salaryAcctRecordId
|
||||
}
|
||||
};
|
||||
childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*");
|
||||
|
|
@ -171,7 +179,8 @@ export default class CalculateDetail extends React.Component {
|
|||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
this.setState({
|
||||
progressVisible: false
|
||||
progressVisible: false,
|
||||
accountIds: []
|
||||
});
|
||||
message.error(data.message);
|
||||
}
|
||||
|
|
@ -183,7 +192,7 @@ export default class CalculateDetail extends React.Component {
|
|||
onCancel() {
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 更多选项点击
|
||||
handleMenuClick = e => {
|
||||
|
|
@ -199,7 +208,7 @@ export default class CalculateDetail extends React.Component {
|
|||
);
|
||||
} else if (e.key == "3") {
|
||||
window.open(
|
||||
'/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=' + this.id +"&ids="
|
||||
"/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=" + this.id + "&ids="
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
@ -223,7 +232,7 @@ export default class CalculateDetail extends React.Component {
|
|||
url: "/api/bs/hrmsalary/salaryacct/acctresult/list",
|
||||
queryParams: {
|
||||
salaryAcctRecordId,
|
||||
...params,
|
||||
...params
|
||||
}
|
||||
};
|
||||
childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*");
|
||||
|
|
@ -248,11 +257,19 @@ export default class CalculateDetail extends React.Component {
|
|||
|
||||
const renderRightOperation = () => {
|
||||
return [
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => this.handleAccount()}>
|
||||
核算
|
||||
</Button>,
|
||||
<ButtonSelect
|
||||
datas={[
|
||||
{ key: "ALL", show: "核算所有人", selected: true },
|
||||
{ key: "SELECT", show: "核算所选人员", selected: false }
|
||||
]}
|
||||
btnOnClick={this.handleAccount}
|
||||
menuOnClick={(key) => this.handleAccount(key)}
|
||||
/>,
|
||||
// <Button
|
||||
// type="primary"
|
||||
// onClick={() => this.handleAccount()}>
|
||||
// 核算
|
||||
// </Button>,
|
||||
<Dropdown.Button overlay={menu}>
|
||||
更多
|
||||
</Dropdown.Button>
|
||||
|
|
@ -333,7 +350,8 @@ export default class CalculateDetail extends React.Component {
|
|||
searchsBaseValue={this.state.searchItemsValue.employeeName} // 外部input搜索值受控: 这里和高级搜索的requestname同步form.getFormParams().username
|
||||
/>
|
||||
{selectedKey == 0 && <UserSure/>}
|
||||
{selectedKey == 1 && <SalaryDetail employeeName={this.state.searchValue}/>}
|
||||
{selectedKey == 1 && <SalaryDetail onChangeAccountIds={(ids) => this.setState({ accountIds: ids })}
|
||||
employeeName={this.state.searchValue}/>}
|
||||
{acctResultImportVisiable &&
|
||||
<AcctResultImportModal
|
||||
visiable={acctResultImportVisiable}
|
||||
|
|
|
|||
|
|
@ -96,6 +96,8 @@ export default class SalaryDetail extends React.Component {
|
|||
}
|
||||
};
|
||||
childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*");
|
||||
} else if (id === "BATCHDELETE") {
|
||||
this.props.onChangeAccountIds(record);
|
||||
}
|
||||
} else {
|
||||
const payload = {
|
||||
|
|
@ -232,8 +234,8 @@ export default class SalaryDetail extends React.Component {
|
|||
<div className="tableWrapper">
|
||||
<iframe
|
||||
style={{ border: 0, width: "100%", height: "100%" }}
|
||||
// src="http://localhost:7607/#/atdTable"
|
||||
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/atdTable"
|
||||
src="http://localhost:7607/#/atdTable"
|
||||
// src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/atdTable"
|
||||
id="atdTable"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -332,7 +332,7 @@ export class calculateStore {
|
|||
delete params[key];
|
||||
}
|
||||
}
|
||||
return new Promise((resolve,reject) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
API.acctResultList({ ...params }).then(res => {
|
||||
if (res.status) {
|
||||
let list = res.data.pageInfo.list ? res.data.pageInfo.list : [];
|
||||
|
|
@ -366,11 +366,10 @@ export class calculateStore {
|
|||
|
||||
// 核算结果--薪资核算
|
||||
@action
|
||||
acctresultAccounting = (salaryAcctRecordId) => {
|
||||
acctresultAccounting = (params) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
API.acctresultAccounting({ salaryAcctRecordId }).then(res => {
|
||||
API.acctresultAccounting(params).then(res => {
|
||||
if (res.status) {
|
||||
// message.success("核算成功")
|
||||
resolve();
|
||||
} else {
|
||||
message.error(res.errormsg || "核算失败");
|
||||
|
|
@ -449,7 +448,7 @@ export class calculateStore {
|
|||
message.error(res.errormsg || "归档失败");
|
||||
reject(res);
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -662,6 +661,6 @@ export class calculateStore {
|
|||
|
||||
@action("更新薪资核算结果的锁定状态")
|
||||
updateLockStatus = (params) => {
|
||||
return API.updateLockStatus(params)
|
||||
return API.updateLockStatus(params);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue