Merge branch 'master' into feature/V2-非系统人员管理开发
This commit is contained in:
commit
6f79efe805
|
|
@ -509,3 +509,58 @@ export const updateLockStatus = (params) => {
|
|||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
// 社保福利台账合计接口
|
||||
export const siaccountDetailCommonListSum = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/siaccount/detail/common/list/sum", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
// 社保福利台账补缴合计接口
|
||||
export const siaccountDetailSupplementaryListSum = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/siaccount/detail/supplementary/list/sum", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
// 社保福利台账退差合计接口
|
||||
export const siaccountDetailRecessionListSum = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/siaccount/detail/recession/list/sum", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
// 社保福利台账补差合计接口
|
||||
export const siaccountDetailBalanceListSum = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/siaccount/detail/balance/list/sum", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
// 导入薪资核算添加表头字段缓存
|
||||
export const cacheImportField = (params) => {
|
||||
return fetch("/api/bs/hrmsalary/salaryacct/acctresult/cacheImportField", {
|
||||
method: "POST",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json());
|
||||
};
|
||||
|
|
|
|||
|
|
@ -359,3 +359,7 @@ export const getAvailableSalaryGroupSet = (params) => {
|
|||
export const getAvailableSalaryItemSet = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryBill/template/getAvailableSalaryItemSet", params);
|
||||
};
|
||||
//工资单发放-查看详情页面列表合计行数据
|
||||
export const salaryBillSendSum = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryBill/send/sum", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -97,7 +97,15 @@ class PersonalScopeTable extends Component {
|
|||
...pageInfo,
|
||||
showTotal: total => `共 ${total} 条`,
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize }
|
||||
}, () => {
|
||||
this.getPersonalScopeList();
|
||||
});
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current }
|
||||
|
|
|
|||
|
|
@ -23,11 +23,12 @@ export default class AcctResultImportModal extends React.Component {
|
|||
componentWillMount() {
|
||||
const { id } = this.props;
|
||||
if (id) {
|
||||
let modalParam = { ...this.state.modalParam };
|
||||
modalParam.salaryAcctRecordId = id;
|
||||
this.setState({
|
||||
modalParam
|
||||
});
|
||||
this.getImportField();
|
||||
// let modalParam = { ...this.state.modalParam };
|
||||
// modalParam.salaryAcctRecordId = id;
|
||||
// this.setState({
|
||||
// modalParam
|
||||
// });
|
||||
} else {
|
||||
this.setState({
|
||||
modalParam: { ...this.state.modalParam, salaryAcctRecordId: "123" }
|
||||
|
|
@ -35,6 +36,19 @@ export default class AcctResultImportModal extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
getImportField=()=>{
|
||||
const { calculateStore: { getImportField }, id } = this.props;
|
||||
getImportField(id).then(data => {
|
||||
this.setState({
|
||||
modalParam:{
|
||||
...this.state.modalParam,
|
||||
salaryAcctRecordId: id,
|
||||
salaryItemIds: data.checkItems.join(",")
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 获取模板
|
||||
handleAccResultTemplateLink() {
|
||||
const { isStandingBook, standingBookTabKey, standingBookType } = this.props;
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@ import React from "react";
|
|||
import { Button, Col, Row } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaCheckbox, WeaDialog } from "ecCom";
|
||||
|
||||
const APIFox = {};
|
||||
import { cacheImportField } from "../../../../apis/calculate";
|
||||
|
||||
@inject("calculateStore", "standingBookStore")
|
||||
@observer
|
||||
|
|
@ -39,13 +38,25 @@ export default class SelectFieldModal extends React.Component {
|
|||
if (this.props.fieldData.inputItems) {
|
||||
sqlItems = this.props.fieldData.sqlItems;
|
||||
}
|
||||
fieldData.formulaItems = formulaItems;
|
||||
fieldData.inputItems = inputItems;
|
||||
fieldData.sqlItems = sqlItems;
|
||||
|
||||
this.setState({
|
||||
fieldData
|
||||
fieldData.formulaItems = _.map(formulaItems, item => {
|
||||
if (data.checkItems.includes(item.salaryItemId)) {
|
||||
return { ...item, checked: true };
|
||||
}
|
||||
return { ...item };
|
||||
});
|
||||
fieldData.inputItems = _.map(inputItems, item => {
|
||||
if (data.checkItems.includes(item.salaryItemId)) {
|
||||
return { ...item, checked: true };
|
||||
}
|
||||
return { ...item };
|
||||
});
|
||||
fieldData.sqlItems = _.map(sqlItems, item => {
|
||||
if (data.checkItems.includes(item.salaryItemId)) {
|
||||
return { ...item, checked: true };
|
||||
}
|
||||
return { ...item };
|
||||
});
|
||||
this.setState({ fieldData });
|
||||
this.fieldData = fieldData;
|
||||
});
|
||||
} else {
|
||||
|
|
@ -97,10 +108,19 @@ export default class SelectFieldModal extends React.Component {
|
|||
}
|
||||
|
||||
// 添加按钮点击回调
|
||||
handleAddClick() {
|
||||
handleAddClick = async () => {
|
||||
//薪资核算详情页面的导入表单字段缓存功能
|
||||
if (window.location.hash.indexOf("calculateDetail") !== -1) {
|
||||
const { status } = await this.cacheImportField();
|
||||
}
|
||||
this.props.onAdd(this.fieldData);
|
||||
this.props.onCancel();
|
||||
}
|
||||
};
|
||||
cacheImportField = () => {
|
||||
const salaryItemList = _.reduce(_.keys(this.fieldData), (pre, cur) => ([...pre, ...this.fieldData[cur]]), []);
|
||||
const salaryItems = _.map(_.filter(salaryItemList, it => !!it.checked), item => item.salaryItemId);
|
||||
return cacheImportField({ salaryItems });
|
||||
};
|
||||
|
||||
// 标题checkbox点击
|
||||
handleTitleCheckboxChange(value, flag) {
|
||||
|
|
@ -160,9 +180,7 @@ export default class SelectFieldModal extends React.Component {
|
|||
this.props.onCancel();
|
||||
}}
|
||||
buttons={[
|
||||
<Button type="primary" onClick={() => {
|
||||
this.handleAddClick();
|
||||
}}>添加</Button>
|
||||
<Button type="primary" onClick={this.handleAddClick}>添加</Button>
|
||||
]}
|
||||
>
|
||||
<div style={{ minHeight: "20vh", maxHeight: "50vh", overflow: "hidden auto", padding: "16px 20px" }}>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { inject, observer } from "mobx-react";
|
|||
import SalaryDetail from "./salaryDetail";
|
||||
import { Button, Dropdown, Menu, message, Modal } from "antd";
|
||||
import { WeaBrowser, WeaCheckbox, WeaDropdown, WeaFormItem, WeaInput, WeaSearchGroup, WeaSelect, WeaTab } from "ecCom";
|
||||
import { getQueryString } from "../../util/url";
|
||||
import { convertToUrlString, getQueryString } from "../../util/url";
|
||||
import AcctResultImportModal from "./acctResult/importModal/acctResultImportModal";
|
||||
import ProgressModal from "../../components/progressModal";
|
||||
|
||||
|
|
@ -172,7 +172,7 @@ export default class CalculateDetail extends React.Component {
|
|||
url: "/api/bs/hrmsalary/salaryacct/acctresult/list",
|
||||
selectedRowKeys: [],
|
||||
queryParams: {
|
||||
salaryAcctRecordId,
|
||||
salaryAcctRecordId
|
||||
}
|
||||
};
|
||||
childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*");
|
||||
|
|
@ -209,7 +209,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=&${convertToUrlString(this.state.searchItemsValue)}`
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import ImportFormCom from "./components/importFormCom";
|
|||
import TableRecord from "../components/tableRecord";
|
||||
import { dataCollectCondition, modalColumns } from "./columns";
|
||||
import { removePropertyCondition } from "../../../util/response";
|
||||
import { convertToUrlString } from "../../../util/url";
|
||||
import Layout from "../layout";
|
||||
import moment from "moment";
|
||||
|
||||
|
|
@ -52,6 +53,7 @@ class Index extends Component {
|
|||
slideDataSource: []
|
||||
},
|
||||
exportPayloadUrl: "",
|
||||
exportPayloadType: false,
|
||||
advanceCondition: null
|
||||
};
|
||||
this.tableRef = null;
|
||||
|
|
@ -160,9 +162,11 @@ class Index extends Component {
|
|||
* Date: 2023/2/20
|
||||
*/
|
||||
handleExportAll = () => {
|
||||
const { declareMonth, taxAgentId } = this.state;
|
||||
const { cumDeductStore: { form } } = this.props;
|
||||
const { declareMonth, taxAgentId, exportPayloadType } = this.state;
|
||||
this.setState({
|
||||
exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/addUpDeduction/export?ids=&declareMonth=${declareMonth}&taxAgentId=${taxAgentId}`
|
||||
exportPayloadType: !exportPayloadType,
|
||||
exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/addUpDeduction/export?ids=&declareMonth=${declareMonth}&taxAgentId=${taxAgentId}&${convertToUrlString(form.getFormParams())}`
|
||||
});
|
||||
};
|
||||
/*
|
||||
|
|
@ -173,12 +177,13 @@ class Index extends Component {
|
|||
*/
|
||||
handleExportSelect = () => {
|
||||
const { selectedRowKeys: ids } = this.tableRef.state;
|
||||
const { declareMonth, taxAgentId } = this.state;
|
||||
const { declareMonth, taxAgentId, exportPayloadType } = this.state;
|
||||
if (ids.length === 0) {
|
||||
message.warning("请选择需要导出的数据");
|
||||
return;
|
||||
}
|
||||
this.setState({
|
||||
exportPayloadType: !exportPayloadType,
|
||||
exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/addUpDeduction/export?ids=${ids.join(",")}&declareMonth=${declareMonth}&taxAgentId=${taxAgentId}`
|
||||
});
|
||||
};
|
||||
|
|
@ -497,7 +502,7 @@ class Index extends Component {
|
|||
const { taxAgentStore: { showOperateBtn }, cumDeductStore: { form } } = this.props;
|
||||
const {
|
||||
declareMonth, taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition,
|
||||
importPayload
|
||||
importPayload, exportPayloadType
|
||||
} = this.state;
|
||||
const tablePayload = { declareMonth: [declareMonth], taxAgentId };
|
||||
return (
|
||||
|
|
@ -505,6 +510,7 @@ class Index extends Component {
|
|||
onResizeWindowInnerWidth={this.handleResize} slidePayload={slidePayload}
|
||||
onClose={this.handleCloseSlide} onSave={this.handleSaveData}
|
||||
slideLoading={saveLoading} exportPayloadUrl={exportPayloadUrl}
|
||||
exportPayloadType={exportPayloadType}
|
||||
form={form} condition={advanceCondition} onAdSearch={this.handleAdSearch}
|
||||
onImportSetStep={this.handleImportSetStep} onCancel={this.handleCloseImport}
|
||||
importPayload={importPayload} onImportFile={this.handleImportFile}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import { dataCollectCondition, taxOptions } from "./columns";
|
|||
import AddItems from "../addItems";
|
||||
import TableRecord from "../components/tableRecord";
|
||||
import { situationModalColumns } from "../cumDeduct/columns";
|
||||
import { convertToUrlString } from "../../../util/url";
|
||||
|
||||
@inject("taxAgentStore", "cumSituationStore")
|
||||
@observer
|
||||
|
|
@ -59,6 +60,7 @@ class Index extends Component {
|
|||
slideDataSource: []
|
||||
},
|
||||
exportPayloadUrl: "",
|
||||
exportPayloadType: false,
|
||||
advanceCondition: null
|
||||
};
|
||||
this.tableRef = null;
|
||||
|
|
@ -277,9 +279,11 @@ class Index extends Component {
|
|||
* Date: 2023/2/20
|
||||
*/
|
||||
handleExportAll = () => {
|
||||
const { declareMonth, taxAgentId, year } = this.state;
|
||||
const { cumSituationStore: { form } } = this.props;
|
||||
const { declareMonth, taxAgentId, year, exportPayloadType } = this.state;
|
||||
this.setState({
|
||||
exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/addUpSituation/export?ids=&year=${year}&taxYearMonth=${year}-${declareMonth}&taxAgentId=${taxAgentId}`
|
||||
exportPayloadType: !exportPayloadType,
|
||||
exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/addUpSituation/export?ids=&year=${year}&taxYearMonth=${year}-${declareMonth}&taxAgentId=${taxAgentId}&${convertToUrlString(form.getFormParams())}`
|
||||
});
|
||||
};
|
||||
/*
|
||||
|
|
@ -290,12 +294,13 @@ class Index extends Component {
|
|||
*/
|
||||
handleExportSelect = () => {
|
||||
const { selectedRowKeys: ids } = this.tableRef.state;
|
||||
const { declareMonth, taxAgentId, year } = this.state;
|
||||
const { declareMonth, taxAgentId, year, exportPayloadType } = this.state;
|
||||
if (ids.length === 0) {
|
||||
message.warning("请选择需要导出的数据");
|
||||
return;
|
||||
}
|
||||
this.setState({
|
||||
exportPayloadType: !exportPayloadType,
|
||||
exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/addUpSituation/export?ids=${ids.join(",")}&year=${year}&taxYearMonth=${year}-${declareMonth}&taxAgentId=${taxAgentId}`
|
||||
});
|
||||
};
|
||||
|
|
@ -511,7 +516,7 @@ class Index extends Component {
|
|||
const { taxAgentStore: { showOperateBtn }, cumSituationStore: { form } } = this.props;
|
||||
const {
|
||||
declareMonth, taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition,
|
||||
importPayload, year
|
||||
importPayload, year, exportPayloadType
|
||||
} = this.state;
|
||||
const tablePayload = { taxYearMonth: `${year}-${declareMonth}`, year, taxAgentId };
|
||||
return (
|
||||
|
|
@ -519,6 +524,7 @@ class Index extends Component {
|
|||
onResizeWindowInnerWidth={this.handleResize} slidePayload={slidePayload}
|
||||
onClose={this.handleCloseSlide} onSave={this.handleSaveData}
|
||||
slideLoading={saveLoading} exportPayloadUrl={exportPayloadUrl}
|
||||
exportPayloadType={exportPayloadType}
|
||||
form={form} condition={advanceCondition} onAdSearch={this.handleAdSearch}
|
||||
onImportSetStep={this.handleImportSetStep} onCancel={this.handleCloseImport}
|
||||
importPayload={{ ...importPayload, importOpts: { taxYearMonth: importPayload.importOpts.declareMonth } }}
|
||||
|
|
|
|||
|
|
@ -82,77 +82,79 @@ class DataTables extends Component {
|
|||
});
|
||||
}
|
||||
};
|
||||
const getColumns = _.map(columns, item => {
|
||||
const { dataIndex } = item;
|
||||
if (dataIndex === "username") {
|
||||
return {
|
||||
...item,
|
||||
render: (text, record) => {
|
||||
return <a
|
||||
className="ellipsis"
|
||||
href={`javaScript:openhrm(${record.employeeId});`}
|
||||
onClick={e => window.pointerXY(e)}
|
||||
title={text}
|
||||
>
|
||||
{text}
|
||||
</a>;
|
||||
}
|
||||
};
|
||||
} else if (dataIndex === "operate") {
|
||||
return {
|
||||
...item,
|
||||
render: (text, record) => (
|
||||
<div className="linkWapper">
|
||||
{
|
||||
!isSpecial &&
|
||||
<React.Fragment>
|
||||
<a href="javaScript:void(0);" onClick={() => onViewDetails(record)}>查看明细</a>
|
||||
{
|
||||
showOperateBtn &&
|
||||
<Popover
|
||||
overlayClassName="moreIconWrapper"
|
||||
placement="bottomRight"
|
||||
content={<Menu onClick={(e) => onTableOperate(e, record)}>
|
||||
<Menu.Item key="handleAddData">编辑</Menu.Item>
|
||||
<Menu.Item key="deleteSelectAddUpDeduction">删除</Menu.Item>
|
||||
</Menu>} title="">
|
||||
<i className="icon-coms-more"/>
|
||||
</Popover>
|
||||
}
|
||||
</React.Fragment>
|
||||
}
|
||||
{
|
||||
isSpecial &&
|
||||
<React.Fragment>
|
||||
{
|
||||
showOperateBtn &&
|
||||
<React.Fragment>
|
||||
<a href="javaScript:void(0);"
|
||||
onClick={() => onTableOperate({ key: "handleAddData" }, record)}>编辑</a>
|
||||
<a href="javaScript:void(0);"
|
||||
onClick={() => onTableOperate({ key: "deleteSelectAddUpDeduction" }, record)}>删除</a>
|
||||
</React.Fragment>
|
||||
}
|
||||
</React.Fragment>
|
||||
}
|
||||
</div>
|
||||
)
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
...item,
|
||||
render: (text) => {
|
||||
return <span className="ellipsis" title={text}> {text} </span>;
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
return <UnifiedTable
|
||||
rowKey="id"
|
||||
rowSelection={rowSelection}
|
||||
columns={_.map(columns, item => {
|
||||
const { dataIndex } = item;
|
||||
if (dataIndex === "username") {
|
||||
return {
|
||||
...item,
|
||||
render: (text, record) => {
|
||||
return <a
|
||||
className="ellipsis"
|
||||
href={`javaScript:openhrm(${record.employeeId});`}
|
||||
onClick={e => window.pointerXY(e)}
|
||||
title={text}
|
||||
>
|
||||
{text}
|
||||
</a>;
|
||||
}
|
||||
};
|
||||
} else if (dataIndex === "operate") {
|
||||
return {
|
||||
...item,
|
||||
render: (text, record) => (
|
||||
<div className="linkWapper">
|
||||
{
|
||||
!isSpecial &&
|
||||
<React.Fragment>
|
||||
<a href="javaScript:void(0);" onClick={() => onViewDetails(record)}>查看明细</a>
|
||||
{
|
||||
showOperateBtn &&
|
||||
<Popover
|
||||
overlayClassName="moreIconWrapper"
|
||||
placement="bottomRight"
|
||||
content={<Menu onClick={(e) => onTableOperate(e, record)}>
|
||||
<Menu.Item key="handleAddData">编辑</Menu.Item>
|
||||
<Menu.Item key="deleteSelectAddUpDeduction">删除</Menu.Item>
|
||||
</Menu>} title="">
|
||||
<i className="icon-coms-more"/>
|
||||
</Popover>
|
||||
}
|
||||
</React.Fragment>
|
||||
}
|
||||
{
|
||||
isSpecial &&
|
||||
<React.Fragment>
|
||||
{
|
||||
showOperateBtn &&
|
||||
<React.Fragment>
|
||||
<a href="javaScript:void(0);"
|
||||
onClick={() => onTableOperate({ key: "handleAddData" }, record)}>编辑</a>
|
||||
<a href="javaScript:void(0);"
|
||||
onClick={() => onTableOperate({ key: "deleteSelectAddUpDeduction" }, record)}>删除</a>
|
||||
</React.Fragment>
|
||||
}
|
||||
</React.Fragment>
|
||||
}
|
||||
</div>
|
||||
)
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
...item,
|
||||
render: (text) => {
|
||||
return <span className="ellipsis" title={text}> {text} </span>;
|
||||
}
|
||||
};
|
||||
}
|
||||
})}
|
||||
columns={getColumns}
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
loading={loading.query}
|
||||
xWidth={getColumns.length * 150}
|
||||
/>;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class Layout extends Component {
|
|||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.exportPayloadUrl !== this.props.exportPayloadUrl) {
|
||||
if (nextProps.exportPayloadType !== this.props.exportPayloadType) {
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description:导出数据采集数据
|
||||
|
|
|
|||
|
|
@ -103,6 +103,15 @@ export const dataCollectCondition = [
|
|||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["privatePension"],
|
||||
fieldcol: 14,
|
||||
label: "个人养老金",
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
}
|
||||
],
|
||||
title: "数据采集",
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import { dataCollectCondition } from "./columns";
|
|||
import AddItems from "../addItems";
|
||||
import TableRecord from "../components/tableRecord";
|
||||
import { otherModalColumns } from "../cumDeduct/columns";
|
||||
import { convertToUrlString } from "../../../util/url";
|
||||
|
||||
@inject("taxAgentStore", "otherDeductStore")
|
||||
@observer
|
||||
|
|
@ -59,6 +60,7 @@ class Index extends Component {
|
|||
slideDataSource: []
|
||||
},
|
||||
exportPayloadUrl: "",
|
||||
exportPayloadType: false,
|
||||
advanceCondition: null
|
||||
};
|
||||
this.tableRef = null;
|
||||
|
|
@ -250,9 +252,11 @@ class Index extends Component {
|
|||
* Date: 2023/2/20
|
||||
*/
|
||||
handleExportAll = () => {
|
||||
const { declareMonth, taxAgentId } = this.state;
|
||||
const { otherDeductStore: { form } } = this.props;
|
||||
const { declareMonth, taxAgentId, exportPayloadType } = this.state;
|
||||
this.setState({
|
||||
exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/otherDeduction/export?ids=&declareMonth=${declareMonth}&taxAgentId=${taxAgentId}`
|
||||
exportPayloadType: !exportPayloadType,
|
||||
exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/otherDeduction/export?ids=&declareMonth=${declareMonth}&taxAgentId=${taxAgentId}&${convertToUrlString(form.getFormParams())}`
|
||||
});
|
||||
};
|
||||
/*
|
||||
|
|
@ -263,12 +267,13 @@ class Index extends Component {
|
|||
*/
|
||||
handleExportSelect = () => {
|
||||
const { selectedRowKeys: ids } = this.tableRef.state;
|
||||
const { declareMonth, taxAgentId } = this.state;
|
||||
const { declareMonth, taxAgentId, exportPayloadType } = this.state;
|
||||
if (ids.length === 0) {
|
||||
message.warning("请选择需要导出的数据");
|
||||
return;
|
||||
}
|
||||
this.setState({
|
||||
exportPayloadType: !exportPayloadType,
|
||||
exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/otherDeduction/export?ids=${ids.join(",")}&declareMonth=${declareMonth}&taxAgentId=${taxAgentId}`
|
||||
});
|
||||
};
|
||||
|
|
@ -504,7 +509,7 @@ class Index extends Component {
|
|||
const { taxAgentStore: { showOperateBtn }, otherDeductStore: { form } } = this.props;
|
||||
const {
|
||||
declareMonth, taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition,
|
||||
importPayload
|
||||
importPayload, exportPayloadType
|
||||
} = this.state;
|
||||
const tablePayload = { declareMonth: [declareMonth], taxAgentId };
|
||||
return (
|
||||
|
|
@ -512,6 +517,7 @@ class Index extends Component {
|
|||
onResizeWindowInnerWidth={this.handleResize} slidePayload={slidePayload}
|
||||
onClose={this.handleCloseSlide} onSave={this.handleSaveData}
|
||||
slideLoading={saveLoading} exportPayloadUrl={exportPayloadUrl}
|
||||
exportPayloadType={exportPayloadType}
|
||||
form={form} condition={advanceCondition} onAdSearch={this.handleAdSearch}
|
||||
onImportSetStep={this.handleImportSetStep} onCancel={this.handleCloseImport}
|
||||
importPayload={importPayload} onImportFile={this.handleImportFile}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import { condition } from "./components/condition";
|
|||
import AddItems from "../addItems";
|
||||
import TableRecord from "../components/tableRecord";
|
||||
import { specialModalColumns } from "../cumDeduct/columns";
|
||||
import { convertToUrlString } from "../../../util/url";
|
||||
|
||||
@inject("taxAgentStore", "specialAddStore")
|
||||
@observer
|
||||
|
|
@ -49,6 +50,7 @@ class Index extends Component {
|
|||
slideDataSource: []
|
||||
},
|
||||
exportPayloadUrl: "",
|
||||
exportPayloadType: false,
|
||||
advanceCondition: null
|
||||
};
|
||||
this.tableRef = null;
|
||||
|
|
@ -207,9 +209,11 @@ class Index extends Component {
|
|||
* Date: 2023/2/20
|
||||
*/
|
||||
handleExportAll = () => {
|
||||
const { taxAgentId } = this.state;
|
||||
const { specialAddStore: { advanceForm } } = this.props;
|
||||
const { taxAgentId, exportPayloadType } = this.state;
|
||||
this.setState({
|
||||
exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/specialAddDeduction/export?ids=&taxAgentId=${taxAgentId}`
|
||||
exportPayloadType: !exportPayloadType,
|
||||
exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/specialAddDeduction/export?ids=&taxAgentId=${taxAgentId}&${convertToUrlString(advanceForm.getFormParams())}`
|
||||
});
|
||||
};
|
||||
/*
|
||||
|
|
@ -220,12 +224,13 @@ class Index extends Component {
|
|||
*/
|
||||
handleExportSelect = () => {
|
||||
const { selectedRowKeys: ids } = this.tableRef.state;
|
||||
const { taxAgentId } = this.state;
|
||||
const { taxAgentId, exportPayloadType } = this.state;
|
||||
if (ids.length === 0) {
|
||||
message.warning("请选择需要导出的数据");
|
||||
return;
|
||||
}
|
||||
this.setState({
|
||||
exportPayloadType: !exportPayloadType,
|
||||
exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/specialAddDeduction/export?ids=${ids.join(",")}&taxAgentId=${taxAgentId}`
|
||||
});
|
||||
};
|
||||
|
|
@ -414,7 +419,8 @@ class Index extends Component {
|
|||
render() {
|
||||
const { taxAgentStore: { showOperateBtn }, specialAddStore: { advanceForm } } = this.props;
|
||||
const {
|
||||
taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition, importPayload
|
||||
taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition, importPayload,
|
||||
exportPayloadType
|
||||
} = this.state;
|
||||
const tablePayload = { taxAgentId };
|
||||
return (
|
||||
|
|
@ -422,6 +428,7 @@ class Index extends Component {
|
|||
onResizeWindowInnerWidth={this.handleResize} slidePayload={slidePayload}
|
||||
onClose={this.handleCloseSlide} onSave={this.handleSaveData}
|
||||
slideLoading={saveLoading} exportPayloadUrl={exportPayloadUrl}
|
||||
exportPayloadType={exportPayloadType}
|
||||
form={advanceForm} condition={advanceCondition} onAdSearch={this.handleAdSearch}
|
||||
onImportSetStep={this.handleImportSetStep} onCancel={this.handleCloseImport}
|
||||
importPayload={importPayload} onImportFile={this.handleImportFile}
|
||||
|
|
|
|||
|
|
@ -1,72 +1,95 @@
|
|||
import React from "react";
|
||||
import CustomTab from "../../components/customTab";
|
||||
import { Button } from "antd";
|
||||
import "./index.less";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { getQueryString } from "../../util/url";
|
||||
import CustomPaginationTable from "../../components/customPaginationTable";
|
||||
import * as API from "../../apis/declare";
|
||||
import { Button } from "antd";
|
||||
import UnifiedTable from "../../components/UnifiedTable";
|
||||
import "./index.less";
|
||||
|
||||
@inject("declareStore")
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
export default class GenerateDeclarationDetail extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.id = getQueryString("id");
|
||||
this.pageInfo = { current: 1, pageSize: 10 };
|
||||
this.state = {
|
||||
loading: false,
|
||||
dataSource: [],
|
||||
columns: [],
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
declareInfo: {}
|
||||
};
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
const { declareStore: { getDetailList, getDeclareInfo } } = this.props;
|
||||
getDetailList(this.id);
|
||||
getDeclareInfo(this.id);
|
||||
this.getDetailList();
|
||||
this.getDeclareInfo();
|
||||
}
|
||||
|
||||
// 导出
|
||||
handleExport() {
|
||||
const url = `${window.location.origin}/api/bs/hrmsalary/taxdeclaration/export?taxDeclarationId=${this.id}`;
|
||||
window.open(url, "_self");
|
||||
}
|
||||
|
||||
getColumns() {
|
||||
const { declareStore: { datailColumns } } = this.props;
|
||||
let columns = [...datailColumns];
|
||||
return columns.map(item => {
|
||||
item = { ...item };
|
||||
item.width = "150px";
|
||||
if (item.dataIndex == "employeeName") {
|
||||
item.fixed = "left";
|
||||
getDetailList = () => {
|
||||
const { pageInfo } = this.state;
|
||||
const payload = {
|
||||
...pageInfo, taxDeclarationIdStr: getQueryString("id")
|
||||
};
|
||||
this.setState({ loading: true });
|
||||
API.getDetailList(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
dataSource,
|
||||
pageInfo: {
|
||||
...pageInfo,
|
||||
current, pageSize, total
|
||||
},
|
||||
columns: _.map(_.filter(columns, it => it.dataIndex !== "jobNum"), item => {
|
||||
if (item.dataIndex === "username") {
|
||||
return {
|
||||
...item,
|
||||
render: (text, record) => {
|
||||
return <a className="ellipsis"
|
||||
href={`javaScript:openhrm(${record.employeeId});`}
|
||||
onClick={e => window.pointerXY(e)}
|
||||
title={text}
|
||||
>
|
||||
{text}
|
||||
</a>;
|
||||
}
|
||||
};
|
||||
}
|
||||
return {
|
||||
...item,
|
||||
render: (text) => {
|
||||
return <span className="ellipsis" title={text}>{text}</span>;
|
||||
}
|
||||
};
|
||||
})
|
||||
});
|
||||
}
|
||||
return item;
|
||||
});
|
||||
}
|
||||
|
||||
handlePageChange() {
|
||||
const { declareStore: { getDetailList, getDeclareInfo } } = this.props;
|
||||
getDetailList(this.id, this.pageInfo);
|
||||
}
|
||||
|
||||
};
|
||||
getDeclareInfo = () => {
|
||||
API.getDeclareInfo({ taxDeclarationId: getQueryString("id") }).then(({ status, data: declareInfo }) => {
|
||||
if (status) this.setState({ declareInfo });
|
||||
});
|
||||
};
|
||||
// 导出
|
||||
handleExport = () => {
|
||||
const url = `${window.location.origin}/api/bs/hrmsalary/taxdeclaration/export?taxDeclarationId=${getQueryString("id")}`;
|
||||
window.open(url, "_self");
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
declareStore: {
|
||||
detailDataSource,
|
||||
detailTableStore,
|
||||
declareInfo,
|
||||
datailColumns,
|
||||
detailPageInfo
|
||||
}
|
||||
} = this.props;
|
||||
const { declareInfo, loading, pageInfo, columns, dataSource } = this.state;
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
|
||||
const renderRightOperation = () => {
|
||||
return (
|
||||
<div style={{ display: "inline-block" }}>
|
||||
<Button type="primary" onClick={() => {
|
||||
this.handleExport();
|
||||
}}>导出</Button>
|
||||
<Button type="primary" onClick={this.handleExport}>导出</Button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const renderLeftOperation = () => {
|
||||
return (
|
||||
<div style={{ display: "inline-block", lineHeight: "47px" }}>
|
||||
|
|
@ -75,32 +98,37 @@ export default class GenerateDeclarationDetail extends React.Component {
|
|||
</div>
|
||||
);
|
||||
};
|
||||
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.getDetailList());
|
||||
},
|
||||
onChange: (current) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current }
|
||||
}, () => this.getDetailList());
|
||||
}
|
||||
};
|
||||
return (
|
||||
<div className="generateDeclarationDetail">
|
||||
<CustomTab
|
||||
searchOperationItem={
|
||||
renderRightOperation()
|
||||
}
|
||||
leftOperation={
|
||||
renderLeftOperation()
|
||||
}
|
||||
searchOperationItem={showOperateBtn && renderRightOperation()}
|
||||
leftOperation={renderLeftOperation()}
|
||||
/>
|
||||
<div className="tableWrapper">
|
||||
<CustomPaginationTable
|
||||
dataSource={detailDataSource}
|
||||
columns={this.getColumns()}
|
||||
total={detailPageInfo.total}
|
||||
current={detailPageInfo.pageNum}
|
||||
pageSize={this.pageInfo.pageSize}
|
||||
scroll={{ x: 2300 }}
|
||||
onPageChange={(value) => {
|
||||
this.pageInfo.current = value;
|
||||
this.handlePageChange();
|
||||
}}
|
||||
onShowSizeChange={(current, pageSize) => {
|
||||
this.pageInfo = { current, pageSize };
|
||||
this.handlePageChange();
|
||||
}}
|
||||
<UnifiedTable
|
||||
rowKey="id"
|
||||
columns={columns}
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
loading={loading}
|
||||
xWidth={columns.length * 120}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -47,7 +47,11 @@ export default class Declare extends React.Component {
|
|||
if (status) {
|
||||
const { columns, list: dataSource, total, pageNum: current, pageSize } = data;
|
||||
this.setState({
|
||||
columns, dataSource, total, current, pageSize
|
||||
columns, dataSource,
|
||||
pageInfo: {
|
||||
...pageInfo,
|
||||
total, current, pageSize
|
||||
}
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
|
|
@ -67,9 +71,11 @@ export default class Declare extends React.Component {
|
|||
};
|
||||
handleDataPageChange = (current, pageSize = 10) => {
|
||||
this.setState({
|
||||
...this.state.pageInfo,
|
||||
current,
|
||||
pageSize
|
||||
pageInfo: {
|
||||
...this.state.pageInfo,
|
||||
current,
|
||||
pageSize
|
||||
}
|
||||
}, () => this.getDeclareList());
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ const initPeriodStr = (periodStrType, types, fromDay) => {
|
|||
str = `至上上月最后一天`;
|
||||
} else {
|
||||
tmpDate = moment(new Date(`${moment(tmpDate).format("YYYY-MM")}-0${fromDay}`))
|
||||
.add(is_31H ? 30 : 29, "days");
|
||||
.add(is_31H ? 30 : 27, "days");
|
||||
str = `至上月${moment(tmpDate).date()}号`;
|
||||
}
|
||||
break;
|
||||
|
|
@ -302,7 +302,7 @@ const initPeriodStr = (periodStrType, types, fromDay) => {
|
|||
str = `至上月最后一天`;
|
||||
} else {
|
||||
tmpDate = moment(new Date(`${moment(tmpDate).format("YYYY-MM")}-0${fromDay}`))
|
||||
.add(is_31 ? 30 : 29, "days");
|
||||
.add(is_31 ? 30 : 27, "days");
|
||||
str = `至本月${moment(tmpDate).date()}号`;
|
||||
}
|
||||
break;
|
||||
|
|
@ -314,7 +314,7 @@ const initPeriodStr = (periodStrType, types, fromDay) => {
|
|||
str = `至本月最后一天`;
|
||||
} else {
|
||||
tmpDate = moment(new Date(`${moment(tmpDate).format("YYYY-MM")}-0${fromDay}`))
|
||||
.add(is_31K ? 30 : 29, "days");
|
||||
.add(is_31K ? 30 : 27, "days");
|
||||
str = `至下月${moment(tmpDate).date()}号`;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -301,10 +301,10 @@ class LedgerSalaryItem extends Component {
|
|||
* Params:
|
||||
* Date: 2023/3/8
|
||||
*/
|
||||
handleMoveSalaryItem = (moveToItemId, items) => {
|
||||
handleMoveSalaryItem = (moveToItemId, items, titleName) => {
|
||||
const { itemGroups } = this.state;
|
||||
const { salaryItemGroupId: deleteItemId, id, key } = items;
|
||||
if (moveToItemId === deleteItemId) return;
|
||||
if (moveToItemId === deleteItemId || (deleteItemId === "0" && titleName === "未分类")) return;
|
||||
this.setState({
|
||||
itemGroups: _.map(itemGroups, it => {
|
||||
if (moveToItemId === it.uuid) {
|
||||
|
|
|
|||
|
|
@ -175,11 +175,11 @@ class LedgerSalaryItemNormal extends Component {
|
|||
});
|
||||
};
|
||||
handleSubmitMoveTo = () => {
|
||||
const { onMoveSalaryItem } = this.props;
|
||||
const { onMoveSalaryItem, dataSource } = this.props;
|
||||
const { moveModalPayload } = this.state;
|
||||
const { record, value } = moveModalPayload;
|
||||
this.handleCancelMove();
|
||||
onMoveSalaryItem(value, record);
|
||||
onMoveSalaryItem(value, record, _.find(dataSource, it => (it.id === value || it.uuid === value)).name);
|
||||
};
|
||||
|
||||
render() {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class LedgerSalaryItemTable extends Component {
|
|||
const { dataSource, onHandleItemhide } = this.props;
|
||||
onHandleItemhide(
|
||||
_.map([...dataSource], item => {
|
||||
if (id === item.id) {
|
||||
if (id === item.id || id === item.key) {
|
||||
return {
|
||||
...item,
|
||||
itemHide: String(value)
|
||||
|
|
@ -48,7 +48,14 @@ class LedgerSalaryItemTable extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { dataSource, onDropCategoryItem, onChangeSelectedRowKeys, onEditFormnul, selectedRowKeys, onMoveTo } = this.props;
|
||||
const {
|
||||
dataSource,
|
||||
onDropCategoryItem,
|
||||
onChangeSelectedRowKeys,
|
||||
onEditFormnul,
|
||||
selectedRowKeys,
|
||||
onMoveTo
|
||||
} = this.props;
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: (selectedRowKeys) => this.setState({ selectedRowKeys }, () => {
|
||||
|
|
@ -58,7 +65,7 @@ class LedgerSalaryItemTable extends Component {
|
|||
disabled: !record.canDelete
|
||||
})
|
||||
};
|
||||
const checkValue = _.every(dataSource, it => it.itemHide && it.itemHide === "1") ? "1" : "0";
|
||||
const checkValue = (!_.isEmpty(dataSource) && _.every(dataSource, it => it.itemHide && it.itemHide === "1")) ? "1" : "0";
|
||||
const columns = [
|
||||
{
|
||||
title: "名称",
|
||||
|
|
@ -102,7 +109,7 @@ class LedgerSalaryItemTable extends Component {
|
|||
width: 80,
|
||||
render: (text, record) => <WeaCheckbox
|
||||
value={text ? String(text) : !text ? "0" : "1"}
|
||||
onChange={value => this.handleChangeItem(value, record.id)}
|
||||
onChange={value => this.handleChangeItem(value, record.id || record.key)}
|
||||
/>
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -24,7 +24,8 @@ export default class MobilePayroll extends React.Component {
|
|||
const type = getQueryString("type");
|
||||
this.id = getQueryString("id");
|
||||
const { mySalaryStore: { init } } = this.props;
|
||||
type !== "phone" && init(false);
|
||||
// type !== "phone" && init(false);
|
||||
init(false);
|
||||
this.getMySalaryBill(this.id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
import { WeaHelpfulTip, WeaTab, WeaTop } from "ecCom";
|
||||
import { Button, Menu } from "antd";
|
||||
import "./index.less";
|
||||
import { WeaHelpfulTip, WeaTab } from "ecCom";
|
||||
import { Button, Spin } from "antd";
|
||||
import { getQueryString } from "../../../util/url";
|
||||
import { removePropertyCondition } from "../../../util/response";
|
||||
import { getSearchs } from "../../../util";
|
||||
import CustomPaginationTable from "../../../components/customPaginationTable";
|
||||
import { getPayrollDetailList, getPayrollDetailSa, getPayrollInfo, salaryBillSendSum } from "../../../apis/payroll";
|
||||
import { sysConfCodeRule } from "../../../apis/ruleconfig";
|
||||
import "./index.less";
|
||||
|
||||
@inject("payrollStore")
|
||||
@observer
|
||||
|
|
@ -14,226 +15,193 @@ export default class PayrollDetail extends React.Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
currentId: "",
|
||||
current: 1
|
||||
salarySendDetailBaseInfo: {}, loading: false,
|
||||
condition: [], dataSource: [], columns: [],
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
salaryBillSendSum: {}, showSum: false
|
||||
};
|
||||
this.pageInfo = { current: 1, pageSize: 10 };
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
let id = getQueryString("id");
|
||||
this.setState({ currentId: id });
|
||||
const { payrollStore: { getPayrollInfo, getPayrollDetailList, getPayrollDetailSa } } = this.props;
|
||||
getPayrollInfo(id);
|
||||
getPayrollDetailList({ salarySendId: id });
|
||||
getPayrollDetailSa();
|
||||
this.getPayrollDetailList();
|
||||
}
|
||||
|
||||
// 撤回
|
||||
handleWithdraw(record) {
|
||||
const { payrollStore } = this.props;
|
||||
const { withdrawPayroll, getInfoList } = payrollStore;
|
||||
withdrawPayroll({
|
||||
ids: [record.id],
|
||||
salarySendId: this.state.currentId
|
||||
}).then(() => {
|
||||
getInfoList({
|
||||
salarySendId: this.state.currentId
|
||||
});
|
||||
});
|
||||
componentDidMount() {
|
||||
this.getPayrollInfo();
|
||||
this.getPayrollDetailSa();
|
||||
window.addEventListener("message", this.handleReceiveMessage, false);
|
||||
}
|
||||
|
||||
// 发送
|
||||
handleGrant(record) {
|
||||
const { payrollStore } = this.props;
|
||||
const { grantPayroll, getInfoList } = payrollStore;
|
||||
grantPayroll({
|
||||
ids: [record.id],
|
||||
salarySendId: this.state.currentId
|
||||
}).then(() => {
|
||||
getInfoList({
|
||||
salarySendId: this.state.currentId
|
||||
});
|
||||
});
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener("message", this.handleReceiveMessage, false);
|
||||
}
|
||||
|
||||
getColumns() {
|
||||
const { payrollStore } = this.props;
|
||||
const { salarySendDetailTableStore } = payrollStore;
|
||||
const { columns } = salarySendDetailTableStore;
|
||||
if (!columns) {
|
||||
return [];
|
||||
}
|
||||
let result = columns.filter(item => item.hide == "false").map(item => {
|
||||
item = { ...item };
|
||||
if (item.dataIndex == "operation") {
|
||||
item.render = (text, record) => {
|
||||
if (text == "ALREADYSEND") {
|
||||
return (
|
||||
<a onClick={() => {
|
||||
this.handleWithdraw(record);
|
||||
}}>撤回</a>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<a onClick={() => {
|
||||
this.handleGrant(record);
|
||||
}}>发送</a>
|
||||
);
|
||||
handleReceiveMessage = async ({ data }) => {
|
||||
const { dataSource, columns, pageInfo } = this.state;
|
||||
const childFrameObj = document.getElementById("atdTable");
|
||||
const { type, payload } = data;
|
||||
if (type === "turn") {
|
||||
const { id, params: { size: pageSize, pageNum: current, total } } = payload;
|
||||
if (id && id === "PAGEINFO") {
|
||||
this.setState({
|
||||
pageInfo: {
|
||||
...pageInfo,
|
||||
current,
|
||||
pageSize,
|
||||
total
|
||||
}
|
||||
};
|
||||
}, () => this.getPayrollDetailList({ child: id }));
|
||||
}
|
||||
}
|
||||
if (type === "init") {
|
||||
const { status, data: sysData } = await this.sysConfCodeRule();
|
||||
const { data: { sumRow } } = await this.salaryBillSendSum();
|
||||
const salaryBillSendSum = _.reduce(_.keys(sumRow), (pre, cur) => (_.assign(pre, { [`${cur}_salaryItem`]: sumRow[cur] })), {});
|
||||
this.setState({ showSum: status && sysData === "1", salaryBillSendSum });
|
||||
childFrameObj.contentWindow.postMessage(JSON.stringify({
|
||||
dataSource,
|
||||
columns,
|
||||
pageInfo,
|
||||
showSum: status && sysData === "1",
|
||||
salaryBillSendSum
|
||||
}), "*");
|
||||
this.getPayrollDetailList({ child: type });
|
||||
}
|
||||
};
|
||||
getPayrollInfo = () => {
|
||||
const id = getQueryString("id");
|
||||
getPayrollInfo({ id }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
this.setState({ salarySendDetailBaseInfo: data });
|
||||
}
|
||||
return item;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
// 导出所选
|
||||
handleExportSelected() {
|
||||
|
||||
}
|
||||
|
||||
// 导出全部
|
||||
};
|
||||
getPayrollDetailSa = () => {
|
||||
const { payrollStore } = this.props;
|
||||
const { detailListConditionForm } = payrollStore;
|
||||
getPayrollDetailSa().then(({ status, data }) => {
|
||||
if (status) {
|
||||
const condition = removePropertyCondition(data.condition);
|
||||
this.setState({ condition }, () => {
|
||||
detailListConditionForm.initFormFields(this.state.condition);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
getPayrollDetailList = (extra = {}) => {
|
||||
const childFrameObj = document.getElementById("atdTable");
|
||||
const { pageInfo } = this.state;
|
||||
const { child, ...extraParams } = extra;
|
||||
const salarySendId = getQueryString("id");
|
||||
const { payrollStore } = this.props;
|
||||
const { detailListConditionForm: form } = payrollStore;
|
||||
const payload = { salarySendId, ...pageInfo, ...extraParams, ...form.getFormParams() };
|
||||
this.setState({ loading: true });
|
||||
getPayrollDetailList(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { columns, datas: dataSource, pageInfo: pages } = data;
|
||||
const { pageNum: current, pageSize, total } = pages;
|
||||
this.setState({
|
||||
dataSource,
|
||||
columns: _.map(columns, (item, index) => ({
|
||||
dataIndex: item.column, title: item.text, width: item.width,
|
||||
fixed: index <= 2 ? "left" : null
|
||||
})),
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }
|
||||
}, () => {
|
||||
const { pageInfo, dataSource, columns, salaryBillSendSum, showSum } = this.state;
|
||||
(child === "PAGEINFO" || child === "init") &&
|
||||
childFrameObj.contentWindow.postMessage(JSON.stringify({
|
||||
dataSource,
|
||||
columns,
|
||||
pageInfo, showSum,
|
||||
salaryBillSendSum
|
||||
}), "*");
|
||||
});
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
salaryBillSendSum = () => {
|
||||
const salarySendId = getQueryString("id");
|
||||
return salaryBillSendSum({ salarySendId });
|
||||
};
|
||||
sysConfCodeRule = () => {
|
||||
return sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" });
|
||||
};
|
||||
handleExportAll = () => {
|
||||
// const { payrollStore } = this.props;
|
||||
// const { exportDetailList } = payrollStore
|
||||
// exportDetailList({salarySendId: this.state.currentId})
|
||||
const url = `${window.location.origin}/api/bs/hrmsalary/salaryBill/send/exportDetailList?salarySendId=${this.state.currentId}`;
|
||||
const salarySendId = getQueryString("id");
|
||||
const url = `${window.location.origin}/api/bs/hrmsalary/salaryBill/send/exportDetailList?salarySendId=${salarySendId}`;
|
||||
window.open(url, "_self");
|
||||
};
|
||||
|
||||
getSearchsAdQuick() {
|
||||
const handleMenuClick = (e) => {
|
||||
switch (e.key) {
|
||||
case "1":
|
||||
this.handleExportSelected();
|
||||
break;
|
||||
}
|
||||
};
|
||||
const menu = (
|
||||
<Menu onClick={handleMenuClick}>
|
||||
<Menu.Item key="1">导出所选</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
return (
|
||||
// <Dropdown.Button type="primary" style={{marginRight: "10px"}} overlay={menu} onClick={() => {this.handleExportAll()}}>导出全部</Dropdown.Button>
|
||||
<Button type="primary" onClick={this.handleExportAll}>导出全部</Button>
|
||||
);
|
||||
// return (<div></div>)
|
||||
}
|
||||
|
||||
|
||||
// 分页
|
||||
handleDataPageChange(value) {
|
||||
const { payrollStore: { getPayrollInfo, getPayrollDetailList, getPayrollDetailSa } } = this.props;
|
||||
getPayrollDetailList({ salarySendId: this.state.currentId, ...this.pageInfo });
|
||||
}
|
||||
|
||||
|
||||
handleShowSizeChange(pageInfo) {
|
||||
const { payrollStore: { getPayrollInfo, getPayrollDetailList, getPayrollDetailSa } } = this.props;
|
||||
getPayrollDetailList({ salarySendId: this.state.currentId, ...pageInfo });
|
||||
}
|
||||
|
||||
handleSearch=()=> {
|
||||
const { payrollStore: { getPayrollDetailList, setDetailListShowSearchAd } } = this.props;
|
||||
setDetailListShowSearchAd(false);
|
||||
getPayrollDetailList({ salarySendId: this.state.currentId, ...this.pageInfo });
|
||||
}
|
||||
handleSearch = () => this.getPayrollDetailList({ child: "PAGEINFO", current: 1 });
|
||||
|
||||
render() {
|
||||
const { salarySendDetailBaseInfo, condition, loading } = this.state;
|
||||
const { payrollStore } = this.props;
|
||||
const {
|
||||
setDetailListShowSearchAd,
|
||||
detailListShowSearchAd,
|
||||
getPayrollDetailList,
|
||||
detailListCondition,
|
||||
detailListConditionForm,
|
||||
salarySendDetailBaseInfo,
|
||||
salarySendDetailTableStore,
|
||||
salarySendDetailDataSource,
|
||||
salarySendDetailPageInfo
|
||||
} = payrollStore;
|
||||
const { setDetailListShowSearchAd, detailListShowSearchAd, detailListConditionForm } = payrollStore;
|
||||
const { salaryMonth, template, sendNum, sendTotal } = salarySendDetailBaseInfo;
|
||||
const adBtn = [
|
||||
// 高级搜索内部按钮
|
||||
<Button type="primary" onClick={()=>this.handleSearch()}>
|
||||
搜索
|
||||
</Button>,
|
||||
<Button type="ghost" onClick={() => detailListConditionForm.resetForm()}>
|
||||
重置
|
||||
</Button>,
|
||||
<Button type="ghost" onClick={() => setDetailListShowSearchAd(false)}>
|
||||
取消
|
||||
</Button>
|
||||
<Button type="primary" onClick={this.handleSearch}>搜索</Button>,
|
||||
<Button type="ghost" onClick={() => detailListConditionForm.resetForm()}>重置</Button>,
|
||||
<Button type="ghost" onClick={() => setDetailListShowSearchAd(false)}>取消</Button>
|
||||
];
|
||||
return (
|
||||
<div className="payrollGrant">
|
||||
<WeaTop
|
||||
title="工资单发放" // 文字
|
||||
icon={<i className="icon-coms-fa"/>} // 左侧图标
|
||||
iconBgcolor="#F14A2D" // 左侧图标背景色
|
||||
showDropIcon={true} // 是否显示下拉按钮
|
||||
buttons={[this.getSearchsAdQuick()]}
|
||||
></WeaTop>
|
||||
<WeaTab
|
||||
searchType={["base", "advanced"]} // base:基础搜索框 advanced:显示高级搜索按钮
|
||||
searchsBasePlaceHolder="请输入姓名"
|
||||
showSearchAd={detailListShowSearchAd} // 是否展开高级搜索面板
|
||||
setShowSearchAd={bool => setDetailListShowSearchAd(bool)} //高级搜索面板受控
|
||||
searchsAd={getSearchs(detailListConditionForm, toJS(detailListCondition), 2)} // 高级搜索内部数据
|
||||
buttonsAd={adBtn} // 高级搜索内部按钮
|
||||
onSearch={() => {
|
||||
this.handleSearch();
|
||||
}} // 点搜索按钮时的回调
|
||||
// searchsAdQuick={this.getSearchsAdQuick()}
|
||||
onSearchChange={v => detailListConditionForm.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值
|
||||
searchsBaseValue={detailListConditionForm.getFormParams().username} // 外部input搜索值受控: 这里和高级搜索的requestname同步
|
||||
searchType={["base", "advanced"]} searchsBasePlaceHolder="请输入姓名"
|
||||
buttons={[<Button type="primary" onClick={this.handleExportAll}>导出全部</Button>]}
|
||||
showSearchAd={detailListShowSearchAd} setShowSearchAd={bool => setDetailListShowSearchAd(bool)}
|
||||
searchsAd={getSearchs(detailListConditionForm, condition, 2)}
|
||||
buttonsAd={adBtn} onSearch={this.handleSearch}
|
||||
onSearchChange={v => detailListConditionForm.updateFields({ username: v })}
|
||||
searchsBaseValue={detailListConditionForm.getFormParams().username}
|
||||
/>
|
||||
<div className="titleBar">
|
||||
<div className="titleBarLeft">
|
||||
<span>薪资所属月:{salarySendDetailBaseInfo.salaryMonth}</span>
|
||||
<span>薪资所属月:{salaryMonth}</span>
|
||||
<WeaHelpfulTip
|
||||
style={{ marginLeft: "10px", marginRight: "10px" }}
|
||||
width={200}
|
||||
title={`薪资周期\n
|
||||
${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle.fromDate}至 ${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle && salarySendDetailBaseInfo.salarySobCycle.salaryCycle.endDate}\n
|
||||
税款所属期\n
|
||||
${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.taxCycle}\n
|
||||
考勤取值周期\n
|
||||
${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle.fromDate}至${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle && salarySendDetailBaseInfo.salarySobCycle.attendCycle.endDate}\n
|
||||
福利台账月份\n
|
||||
引用${salarySendDetailBaseInfo.salarySobCycle && salarySendDetailBaseInfo.salarySobCycle.socialSecurityCycle}的福利台账数据`}
|
||||
title={<PayrollTips salarySendDetailBaseInfo={salarySendDetailBaseInfo}/>}
|
||||
placement="topLeft"
|
||||
/>
|
||||
<span>工资单模板:{salarySendDetailBaseInfo.template}</span>
|
||||
<span>工资单模板:{template}</span>
|
||||
</div>
|
||||
|
||||
<div className="titleBarRight">
|
||||
<span>已发放:{salarySendDetailBaseInfo.sendNum}/<span
|
||||
style={{ color: "red" }}>{salarySendDetailBaseInfo.sendTotal}</span></span>
|
||||
<span>已发放:{sendNum}/<span style={{ color: "red" }}>{sendTotal}</span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="tableWrapper">
|
||||
|
||||
<CustomPaginationTable
|
||||
dataSource={salarySendDetailDataSource}
|
||||
columns={this.getColumns()}
|
||||
scroll={{ x: this.getColumns().length * 150, y: `calc(100vh - 240px)` }}
|
||||
total={salarySendDetailPageInfo.total}
|
||||
current={salarySendDetailPageInfo.pageNum}
|
||||
pageSize={this.pageInfo.pageSize}
|
||||
onPageChange={(value) => {
|
||||
this.pageInfo.current = value;
|
||||
this.handleDataPageChange(value);
|
||||
}}
|
||||
onShowSizeChange={(current, pageSize) => {
|
||||
this.pageInfo = { current, pageSize };
|
||||
this.handleShowSizeChange(this.pageInfo);
|
||||
}}
|
||||
/>
|
||||
<Spin spinning={loading}>
|
||||
<iframe
|
||||
style={{ border: 0, width: "100%", height: "100%" }}
|
||||
// src="http://localhost:7607/#/previewTable"
|
||||
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/previewTable"
|
||||
id="atdTable"
|
||||
/>
|
||||
</Spin>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export const PayrollTips = (props) => {
|
||||
const { salarySendDetailBaseInfo = {} } = props;
|
||||
const { salarySobCycle: { salaryCycle, taxCycle, attendCycle, socialSecurityCycle } } = salarySendDetailBaseInfo;
|
||||
const { fromDate, endDate } = salaryCycle;
|
||||
const { fromDate: aFromDate, endDate: aEndDate } = attendCycle;
|
||||
return <div>
|
||||
<div>薪资周期</div>
|
||||
<div><span>{fromDate}</span><span>至</span><span>{endDate}</span></div>
|
||||
<div>税款所属期</div>
|
||||
<div>{taxCycle}</div>
|
||||
<div>考勤取值周期</div>
|
||||
<div><span>{aFromDate}</span><span>至</span><span>{aEndDate}</span></div>
|
||||
<div>福利台账月份</div>
|
||||
<div>{`引用的${socialSecurityCycle}福利台账数据`}</div>
|
||||
</div>;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
.payrollGrant {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
|
||||
.titleBar {
|
||||
height: 47px;
|
||||
line-height: 47px;
|
||||
|
|
@ -12,4 +16,12 @@
|
|||
float: right;
|
||||
}
|
||||
}
|
||||
|
||||
.tableWrapper {
|
||||
flex: 1;
|
||||
|
||||
.ant-spin-nested-loading, .ant-spin-container {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ export default class PayrollGrant extends React.Component {
|
|||
|
||||
getSearchsAdQuick() {
|
||||
const { payrollStore } = this.props;
|
||||
const { salarySendDetailBaseInfo } = payrollStore;
|
||||
const { salarySendDetailBaseInfo, btnLoading } = payrollStore;
|
||||
const notShowGrantOrWithdraw = salarySendDetailBaseInfo.haveBackCalc === 1 && salarySendDetailBaseInfo.salaryAcctType === "0";
|
||||
const { selectedKey } = this.state;
|
||||
const handleMenuClick = e => {
|
||||
|
|
@ -284,6 +284,7 @@ export default class PayrollGrant extends React.Component {
|
|||
{ key: "SELECT", show: "发放所选", selected: false },
|
||||
{ key: "PART", show: "部分发放", selected: false }
|
||||
]}
|
||||
btnProps={{loading: btnLoading}}
|
||||
btnOnClick={this.sendPayroll}
|
||||
menuOnClick={(key) => this.sendPayroll(key)}
|
||||
/>,
|
||||
|
|
@ -297,6 +298,7 @@ export default class PayrollGrant extends React.Component {
|
|||
{ key: "recallSelected", show: "撤回所选", selected: false },
|
||||
{ key: "partialWithdrawal", show: "部分撤回", selected: false }
|
||||
]}
|
||||
btnProps={{loading: btnLoading}}
|
||||
btnOnClick={this.withdrawalPayroll}
|
||||
menuOnClick={(key) => this.withdrawalPayroll(key)}
|
||||
/>,
|
||||
|
|
|
|||
|
|
@ -287,6 +287,7 @@ class Index extends Component {
|
|||
selectedRowKeys: []
|
||||
}, () => {
|
||||
this.query();
|
||||
this.queryTabTotal();
|
||||
});
|
||||
} else {
|
||||
message.error(errormsg || "操作失败!");
|
||||
|
|
@ -397,14 +398,14 @@ class Index extends Component {
|
|||
verticalAlign: "middle"
|
||||
}}/></Button>
|
||||
</Dropdown>,
|
||||
// <Button type="ghost" onClick={() => {
|
||||
// const { selectedRowKeys } = this.state;
|
||||
// if (selectedRowKeys.length === 0) {
|
||||
// message.warning("未选择条目");
|
||||
// return;
|
||||
// }
|
||||
// this.deleteSuspendTodo(selectedRowKeys);
|
||||
// }}>批量删除待办</Button>,
|
||||
<Button type="ghost" onClick={() => {
|
||||
const { selectedRowKeys } = this.state;
|
||||
if (selectedRowKeys.length === 0) {
|
||||
message.warning("未选择条目");
|
||||
return;
|
||||
}
|
||||
this.deleteSuspendTodo(selectedRowKeys);
|
||||
}}>批量删除待办</Button>,
|
||||
<Button type="primary" onClick={() => {
|
||||
this.importRef.handleMenuClick({ key: "SUSPEND" });
|
||||
}}>导入</Button>,
|
||||
|
|
@ -517,7 +518,7 @@ class Index extends Component {
|
|||
placement="bottomRight"
|
||||
content={<Menu onClick={(e) => this.handleMenuClick(e, record.id)}>
|
||||
<Menu.Item key="stopSalary">停薪</Menu.Item>
|
||||
{/*<Menu.Item key="deleteSuspendTodo">删除待办</Menu.Item>*/}
|
||||
<Menu.Item key="deleteSuspendTodo">删除待办</Menu.Item>
|
||||
</Menu>} title="">
|
||||
<i className="icon-coms-more"/>
|
||||
</Popover>
|
||||
|
|
@ -612,6 +613,7 @@ class Index extends Component {
|
|||
handleChangeTab = (selectedKey) => {
|
||||
const { slideParams, pageInfo } = this.state;
|
||||
this.setState({
|
||||
selectedRowKeys: [],
|
||||
slideParams: { ...slideParams, visible: false, id: "" },
|
||||
selectedKey,
|
||||
pageInfo: {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ export default class FormalFormModal extends React.Component {
|
|||
const { salaryItemStore } = this.props;
|
||||
const { salaryAcctImportTemplateParam, setSearchFields, detailFormual } = salaryItemStore;
|
||||
setSearchFields([]);
|
||||
if (this.props.formulaId) {
|
||||
if (!!this.props.formulaId && this.props.formulaId != 0) {
|
||||
detailFormual(this.props.formulaId).then(data => {
|
||||
this.setState({
|
||||
value: data.formula,
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ export default class AccumulationFundForm extends React.Component {
|
|||
<div className="socialFormWrapper">
|
||||
<WeaSearchGroup
|
||||
title="公积金基础信息"
|
||||
customComponent={<SocialTitle keyname="nonPayment" value={nonPayment.toString()}
|
||||
customComponent={<SocialTitle keyname="nonPayment" value={!_.isNil(nonPayment) ? nonPayment.toString() : "0"}
|
||||
onChange={this.handleFormChange}/>}
|
||||
items={foundItems} col={2} showGroup needTigger={false}/>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ export default class OtherForm extends React.Component {
|
|||
<div className="socialFormWrapper">
|
||||
<WeaSearchGroup
|
||||
title="其他福利基础信息"
|
||||
customComponent={<SocialTitle keyname="nonPayment" value={nonPayment.toString()}
|
||||
customComponent={<SocialTitle keyname="nonPayment" value={!_.isNil(nonPayment) ? nonPayment.toString() : "0"}
|
||||
onChange={this.handleFormChange}/>}
|
||||
items={otherItems} col={2} showGroup needTigger={false}/>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ export default class SocialSecurityForm extends React.Component {
|
|||
<div className="socialFormWrapper">
|
||||
<WeaSearchGroup
|
||||
title="社保基础信息"
|
||||
customComponent={<SocialTitle keyname="nonPayment" value={nonPayment.toString()}
|
||||
customComponent={<SocialTitle keyname="nonPayment" value={!_.isNil(nonPayment) ? nonPayment.toString() : "0" }
|
||||
onChange={this.handleFormChange}/>}
|
||||
items={socialItems} col={2} showGroup needTigger={false}/>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -61,6 +61,10 @@ class CustomBenefitsTable extends Component {
|
|||
onChange={value => this.handleCustomBenefitsSwitch(record, value)}
|
||||
/>
|
||||
);
|
||||
case "welfareType":
|
||||
return <span>{record.welfareTypeSpan}</span>;
|
||||
case "paymentScopt":
|
||||
return <span>{record.paymentScopeSpan}</span>;
|
||||
default:
|
||||
return <div dangerouslySetInnerHTML={{ __html: text }}/>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,10 @@
|
|||
.tableWrapper {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
|
||||
.ant-spin-nested-loading, .ant-spin-container {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.topContent {
|
||||
|
|
@ -73,6 +77,9 @@
|
|||
.tableWrapper {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
.ant-spin-nested-loading, .ant-spin-container {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.tdEllipsis {
|
||||
|
|
|
|||
|
|
@ -7,14 +7,18 @@
|
|||
import React, { Component } from "react";
|
||||
import { Button, Icon, message, Modal, Spin, Tooltip } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
import { WeaInputSearch, WeaNewScroll, WeaTable } from "ecCom";
|
||||
import { WeaInputSearch } from "ecCom";
|
||||
import { calcPageNo } from "../../../../util";
|
||||
import { getQueryString } from "../../../../util/url";
|
||||
import ProgressModal from "../../../../components/progressModal";
|
||||
import AcctResultImportModal from "../../../calculateDetail/acctResult/importModal/acctResultImportModal";
|
||||
import AdjustmentSlide from "./adjustmentSlide";
|
||||
import { getCalculateProgress } from "../../../../apis/calculate";
|
||||
import {
|
||||
getCalculateProgress,
|
||||
siaccountDetailCommonListSum,
|
||||
siaccountDetailSupplementaryListSum
|
||||
} from "../../../../apis/calculate";
|
||||
import { sysConfCodeRule } from "../../../../apis/ruleconfig";
|
||||
import RegEditDetial from "./regEditDetial";
|
||||
import SupplementarySlide from "./supplementarySlide";
|
||||
import _ from "lodash";
|
||||
|
|
@ -54,7 +58,9 @@ export default class NormalIndex extends Component {
|
|||
title: "",
|
||||
editId: "",
|
||||
visible: false
|
||||
}
|
||||
},
|
||||
showSum: false,
|
||||
siaccountSum: {}
|
||||
};
|
||||
this.timer = null;
|
||||
this.timerDelete = null;
|
||||
|
|
@ -68,36 +74,95 @@ export default class NormalIndex extends Component {
|
|||
selectedKey === "1"
|
||||
? this.getNormalList({ billMonth, current, paymentOrganization })
|
||||
: this.getSupplementaryList({ billMonth, current, paymentOrganization });
|
||||
window.addEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
handleReceive = async ({ data }) => {
|
||||
const { type, payload: { id, params } = {} } = data;
|
||||
if (type === "init") {
|
||||
const { selectedKey } = this.props;
|
||||
const { status, data: sysData } = await this.sysConfCodeRule();
|
||||
const { data: { sumRow: siaccountSum } } = selectedKey === "1" ?
|
||||
await this.siaccountDetailCommonListSum() :
|
||||
await this.siaccountDetailSupplementaryListSum();
|
||||
this.setState({
|
||||
showSum: status && sysData === "1",
|
||||
siaccountSum
|
||||
}, () => this.postMessageToChild());
|
||||
} else if (type === "turn") {
|
||||
if (id === "PAGEINFO") {
|
||||
const { pageNum: current, size: pageSize } = params;
|
||||
this.setState({ current, pageSize }, () => {
|
||||
const { billMonth, paymentOrganization, selectedKey } = this.props;
|
||||
const { current, pageSize } = this.state;
|
||||
selectedKey === "1" ?
|
||||
this.getNormalList({
|
||||
billMonth, current, pageSize, paymentOrganization
|
||||
}) :
|
||||
this.getSupplementaryList({
|
||||
billMonth, current, pageSize, paymentOrganization
|
||||
});
|
||||
});
|
||||
} else if (id === "ROWSELECT") {
|
||||
const { selectedRowKeys } = params;
|
||||
this.setState({ selectedRowKeys });
|
||||
} else if (id === "EDIT") {
|
||||
this.handleEditNormalStandingBook(params);
|
||||
}
|
||||
}
|
||||
};
|
||||
sysConfCodeRule = () => {
|
||||
return sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" });
|
||||
};
|
||||
siaccountDetailCommonListSum = () => {
|
||||
const { searchValue: userName } = this.state;
|
||||
const billMonth = getQueryString("billMonth");
|
||||
const paymentOrganization = getQueryString("paymentOrganization");
|
||||
return siaccountDetailCommonListSum({ billMonth, paymentOrganization, userName });
|
||||
};
|
||||
siaccountDetailSupplementaryListSum = () => {
|
||||
const { searchValue: userName } = this.state;
|
||||
const billMonth = getQueryString("billMonth");
|
||||
const paymentOrganization = getQueryString("paymentOrganization");
|
||||
return siaccountDetailSupplementaryListSum({ billMonth, paymentOrganization, userName });
|
||||
};
|
||||
|
||||
componentWillUnmount() {
|
||||
// 清除轮询
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
if (this.timerDelete) {
|
||||
clearInterval(this.timerDelete);
|
||||
}
|
||||
window.removeEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.selectedKey != this.props.selectedKey) {
|
||||
const { billMonth, paymentOrganization } = nextProps;
|
||||
this.setState({
|
||||
current: 1
|
||||
current: 1, selectedRowKeys: []
|
||||
}, () => {
|
||||
const { current } = this.state;
|
||||
nextProps.selectedKey === "1"
|
||||
? this.getNormalList({ billMonth, current, paymentOrganization })
|
||||
: this.getSupplementaryList({
|
||||
billMonth,
|
||||
current,
|
||||
paymentOrganization
|
||||
});
|
||||
: this.getSupplementaryList({ billMonth, current, paymentOrganization });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
postMessageToChild = () => {
|
||||
const childFrameObj = document.getElementById("atdTable");
|
||||
const { current, pageSize, tableData, selectedRowKeys, showSum, siaccountSum } = this.state;
|
||||
const { list: dataSource, total, columns } = tableData;
|
||||
const pageInfo = { current, pageSize, total };
|
||||
childFrameObj.contentWindow.postMessage(JSON.stringify({
|
||||
dataSource, columns, pageInfo,
|
||||
selectedRowKeys, showSum, siaccountSum,
|
||||
showOperates: !getQueryString("type")
|
||||
}), "*");
|
||||
};
|
||||
|
||||
handleSearch(value) {
|
||||
const { billMonth, selectedKey, paymentOrganization } = this.props;
|
||||
const { current } = this.state;
|
||||
|
|
@ -190,77 +255,30 @@ export default class NormalIndex extends Component {
|
|||
});
|
||||
}
|
||||
};
|
||||
|
||||
getNormalList = (payload = {}) => {
|
||||
getNormalList = async (payload = {}) => {
|
||||
const { status, data: sysData } = await this.sysConfCodeRule();
|
||||
const { data: { sumRow: siaccountSum } } = await this.siaccountDetailCommonListSum();
|
||||
const { getNormalList } = this.props.standingBookStore;
|
||||
getNormalList({ ...payload }).then(({ list, columns = [], total }) => {
|
||||
columns = _.map(_.filter(columns, it => it.dataIndex !== "id"), it => {
|
||||
if (it.dataIndex === "employeeId") {
|
||||
it = {
|
||||
...it,
|
||||
width: 150,
|
||||
fixed: "left",
|
||||
render: (text, r) => {
|
||||
const { userName, employeeId } = r;
|
||||
return (
|
||||
<span>
|
||||
{userName}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
};
|
||||
it.title = "姓名";
|
||||
}
|
||||
return {
|
||||
...it,
|
||||
title: <span dangerouslySetInnerHTML={{ __html: it.title }}/>,
|
||||
width: 150
|
||||
};
|
||||
});
|
||||
this.setState({
|
||||
tableData: {
|
||||
list,
|
||||
columns,
|
||||
total
|
||||
}
|
||||
});
|
||||
showSum: status && sysData === "1",
|
||||
siaccountSum,
|
||||
tableData: { list, total, columns }
|
||||
}, () => this.postMessageToChild());
|
||||
});
|
||||
};
|
||||
getSupplementaryList = (payload = {}) => {
|
||||
getSupplementaryList = async (payload = {}) => {
|
||||
const { status, data: sysData } = await this.sysConfCodeRule();
|
||||
const { data: { sumRow: siaccountSum } } = await this.siaccountDetailSupplementaryListSum();
|
||||
const { getSupplementaryList } = this.props.standingBookStore;
|
||||
getSupplementaryList({
|
||||
...payload
|
||||
}).then(({ list, columns = [], total }) => {
|
||||
columns = _.map(_.filter(columns, it => it.dataIndex !== "id"), it => {
|
||||
if (it.dataIndex === "employeeId") {
|
||||
it = {
|
||||
...it,
|
||||
width: 150,
|
||||
fixed: "left",
|
||||
render: (text, r) => {
|
||||
const { userName, employeeId } = r;
|
||||
return (
|
||||
<span>
|
||||
{userName}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
};
|
||||
it.title = "姓名";
|
||||
}
|
||||
return {
|
||||
...it,
|
||||
title: <span dangerouslySetInnerHTML={{ __html: it.title }}/>,
|
||||
width: 150
|
||||
};
|
||||
});
|
||||
this.setState({
|
||||
tableData: {
|
||||
list,
|
||||
columns,
|
||||
total
|
||||
}
|
||||
});
|
||||
showSum: status && sysData === "1",
|
||||
siaccountSum,
|
||||
tableData: { list, columns, total }
|
||||
}, () => this.postMessageToChild());
|
||||
});
|
||||
};
|
||||
onSelectChange = selectedRowKeys => {
|
||||
|
|
@ -355,7 +373,6 @@ export default class NormalIndex extends Component {
|
|||
});
|
||||
};
|
||||
|
||||
// 核算按钮点击
|
||||
handleCommonAccountClick() {
|
||||
const { billMonth, selectedKey, paymentOrganization } = this.props;
|
||||
const { commonAccount } = this.props.standingBookStore;
|
||||
|
|
@ -426,7 +443,6 @@ export default class NormalIndex extends Component {
|
|||
.origin}${urlObj[selectedKey]}?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`;
|
||||
window.open(url, "_self");
|
||||
};
|
||||
|
||||
handleEditNormalStandingBook = (record) => {
|
||||
const { userName, id: editId } = record;
|
||||
const { returnEditPersonSlide } = this.state;
|
||||
|
|
@ -459,85 +475,8 @@ export default class NormalIndex extends Component {
|
|||
|
||||
render() {
|
||||
const { remarks, billMonth, selectedKey, paymentOrganization, standingBookStore } = this.props;
|
||||
const { selectedRowKeys, addProps, adjustSlide, importParams, returnEditPersonSlide } = this.state;
|
||||
const { addProps, adjustSlide, importParams, returnEditPersonSlide } = this.state;
|
||||
const { loading } = standingBookStore;
|
||||
let { list, columns, total } = this.state.tableData;
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: this.onSelectChange
|
||||
};
|
||||
const pagination = {
|
||||
total,
|
||||
current: this.state.current,
|
||||
showTotal: total => `共 ${total} 条`,
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({ current, pageSize });
|
||||
selectedKey === "1"
|
||||
? this.getNormalList({ billMonth, current, pageSize, paymentOrganization })
|
||||
: this.getSupplementaryList({
|
||||
billMonth,
|
||||
current,
|
||||
pageSize,
|
||||
paymentOrganization
|
||||
});
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({ current });
|
||||
selectedKey === "1"
|
||||
? this.getNormalList({
|
||||
billMonth, current,
|
||||
pageSize: this.state.pageSize, paymentOrganization
|
||||
})
|
||||
: this.getSupplementaryList({
|
||||
billMonth,
|
||||
current,
|
||||
pageSize: this.state.pageSize,
|
||||
paymentOrganization
|
||||
});
|
||||
}
|
||||
};
|
||||
columns = _.map(toJS(columns), item => {
|
||||
if (item.dataIndex === "employeeId") {
|
||||
return { ...item };
|
||||
} else if (item.dataIndex === "costCenter") {
|
||||
return {
|
||||
...item,
|
||||
render: (text, record) => {
|
||||
const { costCenter } = record;
|
||||
return <a href={costCenter.url} className="tdEllipsis">{costCenter.name || ""}</a>;
|
||||
}
|
||||
};
|
||||
}
|
||||
return {
|
||||
...item,
|
||||
render: (text) => {
|
||||
return <span className="tdEllipsis" title={text}>{text}</span>;
|
||||
}
|
||||
};
|
||||
});
|
||||
!getQueryString("type") && (columns = [
|
||||
...columns,
|
||||
{
|
||||
title: "操作",
|
||||
dataIndex: "operate",
|
||||
fixed: "right",
|
||||
width: "120px",
|
||||
render: (text, record) => {
|
||||
return (
|
||||
<div className="optWrapper">
|
||||
<a
|
||||
href="javascript:void(0);"
|
||||
className="mr10"
|
||||
onClick={() => this.handleEditNormalStandingBook(record)}
|
||||
>编辑</a>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
]);
|
||||
return (
|
||||
<div className="normalWapper">
|
||||
{
|
||||
|
|
@ -683,19 +622,14 @@ export default class NormalIndex extends Component {
|
|||
</div>
|
||||
{/* table */}
|
||||
<div className="tableWrapper">
|
||||
<WeaNewScroll height="100%">
|
||||
<Spin spinning={loading}>
|
||||
<WeaTable
|
||||
rowKey="id"
|
||||
columns={columns}
|
||||
dataSource={list}
|
||||
loading={loading}
|
||||
pagination={pagination}
|
||||
rowSelection={rowSelection}
|
||||
scroll={{ x: 1200 }}
|
||||
/>
|
||||
</Spin>
|
||||
</WeaNewScroll>
|
||||
<Spin spinning={loading}>
|
||||
<iframe
|
||||
style={{ border: 0, width: "100%", height: "100%" }}
|
||||
// src="http://localhost:7607/#/standingbookTable"
|
||||
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/standingbookTable"
|
||||
id="atdTable"
|
||||
/>
|
||||
</Spin>
|
||||
{/*编辑弹框*/}
|
||||
<RegEditDetial {...returnEditPersonSlide} onCancel={this.handleCloseNormalStandingBookModal}/>
|
||||
<AdjustmentSlide
|
||||
|
|
|
|||
|
|
@ -5,9 +5,11 @@
|
|||
* Date: 2022/11/23
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaTable } from "ecCom";
|
||||
import { Spin } from "antd";
|
||||
import { getQueryString } from "../../../../util/url";
|
||||
import * as API from "../../../../apis/standingBook";
|
||||
import { sysConfCodeRule } from "../../../../apis/ruleconfig";
|
||||
import { siaccountDetailBalanceListSum, siaccountDetailRecessionListSum } from "../../../../apis/calculate";
|
||||
import "./index.less";
|
||||
|
||||
const APIFox = {
|
||||
|
|
@ -25,6 +27,8 @@ class RegList extends Component {
|
|||
loading: {
|
||||
query: false
|
||||
},
|
||||
showSum: false,
|
||||
siaccountSum: {},
|
||||
pageInfo: {
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
|
|
@ -35,19 +39,80 @@ class RegList extends Component {
|
|||
|
||||
componentDidMount() {
|
||||
this.recessionList();
|
||||
window.addEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
handleReceive = async ({ data }) => {
|
||||
const { type: listType, onEdit, onChangeRowkey } = this.props;
|
||||
const { type, payload: { id, params } = {} } = data;
|
||||
if (type === "init") {
|
||||
const { status, data: sysData } = await this.sysConfCodeRule();
|
||||
const { data: { sumRow: siaccountSum } } = listType === "regression" ?
|
||||
await this.siaccountDetailRecessionListSum() :
|
||||
await this.siaccountDetailBalanceListSum();
|
||||
this.setState({
|
||||
showSum: status && sysData === "1",
|
||||
siaccountSum
|
||||
}, () => this.postMessageToChild());
|
||||
} else if (type === "turn") {
|
||||
if (id === "PAGEINFO") {
|
||||
const { pageNum: current, size: pageSize } = params;
|
||||
this.setState({ pageInfo: { ...this.state.pageInfo, current, pageSize } }, () => this.recessionList());
|
||||
} else if (id === "ROWSELECT") {
|
||||
const { selectedRowKeys } = params;
|
||||
this.setState({ selectedRowKeys });
|
||||
onChangeRowkey(selectedRowKeys);
|
||||
} else if (id === "EDIT") {
|
||||
onEdit(params);
|
||||
}
|
||||
}
|
||||
};
|
||||
postMessageToChild = () => {
|
||||
const childFrameObj = document.getElementById("atdTable");
|
||||
const { pageInfo, dataSource, columns, selectedRowKeys, showSum, siaccountSum } = this.state;
|
||||
childFrameObj.contentWindow.postMessage(JSON.stringify({
|
||||
dataSource, columns, pageInfo,
|
||||
selectedRowKeys, showSum, siaccountSum,
|
||||
showOperates: !getQueryString("type")
|
||||
}), "*");
|
||||
};
|
||||
sysConfCodeRule = () => {
|
||||
return sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" });
|
||||
};
|
||||
siaccountDetailRecessionListSum = (module = {}) => {
|
||||
const paymentStatus = "3";
|
||||
const creator = Number(getQueryString("creator"));
|
||||
const billMonth = getQueryString("billMonth");
|
||||
const paymentOrganization = getQueryString("paymentOrganization");
|
||||
return siaccountDetailRecessionListSum({ creator, paymentStatus, billMonth, paymentOrganization, ...module });
|
||||
};
|
||||
siaccountDetailBalanceListSum = (module = {}) => {
|
||||
const paymentStatus = "3";
|
||||
const creator = Number(getQueryString("creator"));
|
||||
const billMonth = getQueryString("billMonth");
|
||||
const paymentOrganization = getQueryString("paymentOrganization");
|
||||
return siaccountDetailBalanceListSum({ creator, paymentStatus, billMonth, paymentOrganization, ...module });
|
||||
};
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible) {
|
||||
this.recessionList();
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
handleResetSelectRowKeys = (selectedRowKeys) => {
|
||||
this.setState({ selectedRowKeys });
|
||||
};
|
||||
recessionList = (module) => {
|
||||
recessionList = async (module) => {
|
||||
const { type } = this.props;
|
||||
const { status: sysStatus, data: sysData } = await this.sysConfCodeRule();
|
||||
const { data: { sumRow: siaccountSum } } = type === "regression" ?
|
||||
await this.siaccountDetailRecessionListSum({ ...module }) :
|
||||
await this.siaccountDetailBalanceListSum({ ...module });
|
||||
const { loading, pageInfo } = this.state;
|
||||
const billMonth = getQueryString("billMonth");
|
||||
const paymentOrganization = getQueryString("paymentOrganization");
|
||||
|
|
@ -68,105 +133,27 @@ class RegList extends Component {
|
|||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
dataSource,
|
||||
columns: _.map(_.filter(columns, it => it.dataIndex !== "id"), items => {
|
||||
if (items.dataIndex === "employeeId") {
|
||||
return {
|
||||
...items,
|
||||
width: 110,
|
||||
title: "姓名",
|
||||
render: (text, r) => {
|
||||
const { userName } = r;
|
||||
return (
|
||||
<span>{userName}</span>
|
||||
);
|
||||
}
|
||||
};
|
||||
} else if (items.dataIndex === "costCenter") {
|
||||
return {
|
||||
...items,
|
||||
width: 110,
|
||||
render: (text, r) => {
|
||||
const { costCenter } = r;
|
||||
return (
|
||||
<a href={costCenter.url} className="tdEllipsis">{costCenter.name || ""}</a>
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
return {
|
||||
...items,
|
||||
title: <span dangerouslySetInnerHTML={{ __html: items.title }}/>,
|
||||
width: 120,
|
||||
render: (text) => {
|
||||
return <span className="tdEllipsis" title={text}>{text}</span>;
|
||||
}
|
||||
};
|
||||
})
|
||||
});
|
||||
columns,
|
||||
showSum: sysStatus && sysData === "1",
|
||||
siaccountSum
|
||||
}, () => this.postMessageToChild());
|
||||
}
|
||||
}).catch(() => {
|
||||
this.setState({ loading: { ...loading, query: false } });
|
||||
});
|
||||
};
|
||||
handleChangeRow = (selectedRowKeys) => {
|
||||
const { onChangeRowkey } = this.props;
|
||||
this.setState({ selectedRowKeys });
|
||||
onChangeRowkey(selectedRowKeys);
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loading, pageInfo, selectedRowKeys, dataSource, columns } = this.state;
|
||||
const { onEdit } = this.props;
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: total => `共 ${total} 条`,
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => {
|
||||
this.recessionList();
|
||||
});
|
||||
},
|
||||
onChange: (current) => {
|
||||
this.setState({ pageInfo: { ...pageInfo, current } }, () => {
|
||||
this.recessionList();
|
||||
});
|
||||
}
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: this.handleChangeRow
|
||||
};
|
||||
const { loading } = this.state;
|
||||
return (
|
||||
<WeaTable
|
||||
rowKey="id"
|
||||
columns={!getQueryString("type") ? [
|
||||
...columns,
|
||||
{
|
||||
title: "操作",
|
||||
dataIndex: "operate",
|
||||
fixed: "right",
|
||||
width: "120px",
|
||||
render: (text, record) => {
|
||||
return (
|
||||
<div className="optWrapper">
|
||||
<a
|
||||
href="javascript:void(0);"
|
||||
className="mr10"
|
||||
onClick={() => onEdit(record)}
|
||||
>编辑</a>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
] : [...columns]}
|
||||
dataSource={dataSource}
|
||||
loading={loading.query}
|
||||
pagination={pagination}
|
||||
rowSelection={rowSelection}
|
||||
scroll={{ x: 900 }}
|
||||
/>
|
||||
<Spin spinning={loading.query}>
|
||||
<iframe
|
||||
style={{ border: 0, width: "100%", height: "100%" }}
|
||||
// src="http://localhost:7607/#/standingbookTable"
|
||||
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/standingbookTable"
|
||||
id="atdTable"
|
||||
/>
|
||||
</Spin>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ class Regression extends Component {
|
|||
selectKey={selectKey}
|
||||
/>
|
||||
<div className="tableWrapper">
|
||||
<WeaNewScroll height="100%">
|
||||
{/*<WeaNewScroll height="100%">*/}
|
||||
<RegList
|
||||
type="regression"
|
||||
ref={dom => this.regListRef = dom}
|
||||
|
|
@ -152,7 +152,7 @@ class Regression extends Component {
|
|||
onCancel={this.handleCloseModal}
|
||||
onSave={this.handleSave}
|
||||
/>
|
||||
</WeaNewScroll>
|
||||
{/*</WeaNewScroll>*/}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -138,6 +138,8 @@ export default class SlideTaxagentUser extends React.Component {
|
|||
...pageObj,
|
||||
total: pageObj.total,
|
||||
showTotal: total => `共 ${total} 条`,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
setPageObj &&
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { action, observable, toJS } from "mobx";
|
||||
import { message } from "antd";
|
||||
import { WeaLoadingGlobal } from "ecCom";
|
||||
import { WeaForm, WeaTableNew } from "comsMobx";
|
||||
|
||||
import * as API from "../apis/payroll"; // 引入API接口文件
|
||||
|
|
@ -14,6 +15,7 @@ export class payrollStore {
|
|||
@observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据
|
||||
@observable showSearchAd = false; // 高级搜索面板显示
|
||||
@observable loading = true; // 数据加载状态
|
||||
@observable btnLoading = false; // 数据加载状态
|
||||
|
||||
// **** 模板页面 ****
|
||||
@observable templateStore = new TableStore(); // 模板设置列表
|
||||
|
|
@ -506,7 +508,15 @@ export class payrollStore {
|
|||
@action
|
||||
grantPayroll = (params = {}) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
message.destroy();
|
||||
message.loading("正在发放中...", 0);
|
||||
this.btnLoading = true;
|
||||
WeaLoadingGlobal.start();
|
||||
API.grantPayroll(params).then(res => {
|
||||
this.btnLoading = false;
|
||||
WeaLoadingGlobal.end();
|
||||
WeaLoadingGlobal.destroy();
|
||||
message.destroy();
|
||||
if (res.status) {
|
||||
message.success("发送成功");
|
||||
resolve();
|
||||
|
|
@ -514,6 +524,10 @@ export class payrollStore {
|
|||
message.error(res.errormsg || "发送失败");
|
||||
reject();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.btnLoading = false
|
||||
WeaLoadingGlobal.end();
|
||||
WeaLoadingGlobal.destroy();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
@ -522,7 +536,15 @@ export class payrollStore {
|
|||
@action
|
||||
withdrawPayroll = (params = {}) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
message.destroy();
|
||||
message.loading("正在撤回中...", 0);
|
||||
this.btnLoading = true;
|
||||
WeaLoadingGlobal.start();
|
||||
API.withdrawPayroll(params).then(res => {
|
||||
this.btnLoading = false;
|
||||
WeaLoadingGlobal.end();
|
||||
WeaLoadingGlobal.destroy();
|
||||
message.destroy();
|
||||
if (res.status) {
|
||||
message.success("撤回成功");
|
||||
resolve();
|
||||
|
|
@ -530,6 +552,10 @@ export class payrollStore {
|
|||
message.error(res.errormsg || "撤回失败");
|
||||
reject();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.btnLoading = false
|
||||
WeaLoadingGlobal.end();
|
||||
WeaLoadingGlobal.destroy();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { observable, action, toJS } from 'mobx';
|
|||
import { message } from 'antd';
|
||||
import { WeaForm, WeaTableNew } from 'comsMobx';
|
||||
|
||||
import * as API from '../apis/taxRate'; // 引入API接口文件
|
||||
import * as API from '../apis/taxrate'; // 引入API接口文件
|
||||
|
||||
const { TableStore } = WeaTableNew;
|
||||
|
||||
|
|
@ -28,7 +28,7 @@ export class taxRateStore {
|
|||
@observable loading = true; // 数据加载状态
|
||||
@observable dataSource = [];
|
||||
@observable nameValue = "";
|
||||
@observable remarkValue = "";
|
||||
@observable remarkValue = "";
|
||||
@observable slideVisiable = false; // 侧边划入是否展示
|
||||
|
||||
currentId = ""; // 当前编辑的数据id
|
||||
|
|
@ -110,7 +110,7 @@ export class taxRateStore {
|
|||
this.setNameValue("");
|
||||
this.setRemarkValue("");
|
||||
}
|
||||
|
||||
|
||||
// 获取表单数据
|
||||
@action getItemInform = (id) => {
|
||||
this.currentId= id;
|
||||
|
|
@ -174,6 +174,6 @@ export class taxRateStore {
|
|||
}
|
||||
this.doDelete(toJS(this.tableStore.selectedRowKeys))
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,3 +22,18 @@ export const getQueryString = (variable) => {
|
|||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
export const convertToUrlString = (data) => {
|
||||
const _result = [];
|
||||
for (const key in data) {
|
||||
const value = data[key];
|
||||
if (value.constructor === Array) {
|
||||
value.forEach(function (_value) {
|
||||
_result.push(key + "=" + _value);
|
||||
});
|
||||
} else {
|
||||
_result.push(key + "=" + value);
|
||||
}
|
||||
}
|
||||
return _result.join("&");
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue