custom/钱智
This commit is contained in:
parent
19129e8b5c
commit
f0a536e0ff
|
|
@ -229,3 +229,15 @@ export const addSocialAcctEmp = (params) => {
|
||||||
export const deleteSocialAcctEmp = (params) => {
|
export const deleteSocialAcctEmp = (params) => {
|
||||||
return postFetch("/api/bs/hrmsalary/siaccount/deleteSocialAcctEmp", params);
|
return postFetch("/api/bs/hrmsalary/siaccount/deleteSocialAcctEmp", params);
|
||||||
};
|
};
|
||||||
|
// 钱智二开-社保报表导出
|
||||||
|
export const exportQZReport = params => {
|
||||||
|
return postExportFetch("/api/bs/hrmsalary/siaccount/exportQZReport", params);
|
||||||
|
};
|
||||||
|
// 钱智二开-封存
|
||||||
|
export const batFC = params => {
|
||||||
|
return postFetch("/api/bs/hrmsalary/siaccount/batFC", params);
|
||||||
|
};
|
||||||
|
// 钱智二开-封存权限
|
||||||
|
export const fcAuth = params => {
|
||||||
|
return postFetch("/api/bs/hrmsalary/siaccount/fcAuth", params);
|
||||||
|
};
|
||||||
|
|
@ -265,7 +265,7 @@ class EditCalcTable extends Component {
|
||||||
if (status) {
|
if (status) {
|
||||||
const { columns, pageInfo: list, msg } = data;
|
const { columns, pageInfo: list, msg } = data;
|
||||||
const { list: dataSource, pageNum: current, pageSize, total } = list;
|
const { list: dataSource, pageNum: current, pageSize, total } = list;
|
||||||
this.props.onSetFormInfo(msg);
|
this.props.onSetFormInfo && this.props.onSetFormInfo(msg);
|
||||||
this.setState({ pageInfo: { ...pageInfo, current, pageSize, total } }, () => {
|
this.setState({ pageInfo: { ...pageInfo, current, pageSize, total } }, () => {
|
||||||
const { pageInfo, selectedRowKeys } = this.state;
|
const { pageInfo, selectedRowKeys } = this.state;
|
||||||
const sumRowlistUrl = this.props.showTotalCell ? "/api/bs/hrmsalary/salaryacct/acctresult/sum" : "";
|
const sumRowlistUrl = this.props.showTotalCell ? "/api/bs/hrmsalary/salaryacct/acctresult/sum" : "";
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,10 @@ class WelfareRecordList extends Component {
|
||||||
case "PAGEINFO":
|
case "PAGEINFO":
|
||||||
this.setState({ pageInfo: { ...pageInfo, ...params } }, () => this.getWelfareRecordList());
|
this.setState({ pageInfo: { ...pageInfo, ...params } }, () => this.getWelfareRecordList());
|
||||||
break;
|
break;
|
||||||
|
case "CHECKBOX":
|
||||||
|
const { selectedRowKeys } = params;
|
||||||
|
this.props.onChangeSelectedRowKeys(selectedRowKeys);
|
||||||
|
break;
|
||||||
case "CALC":
|
case "CALC":
|
||||||
case "VIEW":
|
case "VIEW":
|
||||||
const payload = {
|
const payload = {
|
||||||
|
|
@ -105,6 +109,17 @@ class WelfareRecordList extends Component {
|
||||||
case "log":
|
case "log":
|
||||||
this.props.onFilterLog(id, params.id);
|
this.props.onFilterLog(id, params.id);
|
||||||
break;
|
break;
|
||||||
|
case "FC":
|
||||||
|
API.batFC({ ids: [params.id], fc: !params.fc ? "FC" : "JF" })
|
||||||
|
.then(({ status, data, errormsg }) => {
|
||||||
|
if (status) {
|
||||||
|
message.success(data || getLabel(111, "操作成功!"));
|
||||||
|
this.getWelfareRecordList();
|
||||||
|
} else {
|
||||||
|
message.error(errormsg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -123,7 +138,7 @@ class WelfareRecordList extends Component {
|
||||||
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
||||||
};
|
};
|
||||||
getWelfareRecordList = () => {
|
getWelfareRecordList = () => {
|
||||||
const { queryForm } = this.props;
|
const { queryForm, selectedRowKeys, fcAuth } = this.props;
|
||||||
const { pageInfo } = this.state;
|
const { pageInfo } = this.state;
|
||||||
const payload = { ...pageInfo, ...queryForm, taxAgents: queryForm.taxAgents ? queryForm.taxAgents.split(",") : [] };
|
const payload = { ...pageInfo, ...queryForm, taxAgents: queryForm.taxAgents ? queryForm.taxAgents.split(",") : [] };
|
||||||
this.setState({ loading: true });
|
this.setState({ loading: true });
|
||||||
|
|
@ -133,11 +148,18 @@ class WelfareRecordList extends Component {
|
||||||
const { pageInfo: result } = data;
|
const { pageInfo: result } = data;
|
||||||
let { columns, list: dataSource, pageNum: current, pageSize, total } = result;
|
let { columns, list: dataSource, pageNum: current, pageSize, total } = result;
|
||||||
columns = _.map(columns, o => ({ ...o, width: o.dataIndex === "paymentOrganization" ? 300 : o.width }));
|
columns = _.map(columns, o => ({ ...o, width: o.dataIndex === "paymentOrganization" ? 300 : o.width }));
|
||||||
|
dataSource = _.map(dataSource, o => {
|
||||||
|
if (o.billStatus === "1" && fcAuth) {
|
||||||
|
return { ...o, qzOpts: [{ key: "FC", label: !o.fc ? getLabel(111, "封存") : getLabel(111, "解封") }] };
|
||||||
|
}
|
||||||
|
return o;
|
||||||
|
});
|
||||||
this.setState({
|
this.setState({
|
||||||
pageInfo: { ...pageInfo, current, pageSize, total },
|
pageInfo: { ...pageInfo, current, pageSize, total },
|
||||||
dataSource, columns
|
dataSource, columns
|
||||||
}, () => this.postMessageToChild({
|
}, () => this.postMessageToChild({
|
||||||
scrollHeight: 108, dataSource, columns, pageInfo: this.state.pageInfo, unitTableType: "welfareRecord"
|
scrollHeight: 108, dataSource, columns, pageInfo: this.state.pageInfo, unitTableType: "welfareRecord",
|
||||||
|
selectedRowKeys
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}).catch(() => this.setState({ loading: false }));
|
}).catch(() => this.setState({ loading: false }));
|
||||||
|
|
@ -161,4 +183,4 @@ class WelfareRecordList extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default WelfareRecordList;
|
export default WelfareRecordList;
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
*/
|
*/
|
||||||
import React, { Component } from "react";
|
import React, { Component } from "react";
|
||||||
import { inject, observer } from "mobx-react";
|
import { inject, observer } from "mobx-react";
|
||||||
import { WeaLocaleProvider, WeaTop } from "ecCom";
|
import { WeaLoadingGlobal, WeaLocaleProvider, WeaTop } from "ecCom";
|
||||||
import { Button, message } from "antd";
|
import { Button, message } from "antd";
|
||||||
import * as API from "../../../apis/standingBook";
|
import * as API from "../../../apis/standingBook";
|
||||||
import { getCalculateProgress } from "../../../apis/calculate";
|
import { getCalculateProgress } from "../../../apis/calculate";
|
||||||
|
|
@ -32,7 +32,7 @@ class StandingBook extends Component {
|
||||||
startTime: moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"),
|
startTime: moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"),
|
||||||
endTime: moment(new Date()).endOf("year").format("YYYY-MM"),
|
endTime: moment(new Date()).endOf("year").format("YYYY-MM"),
|
||||||
taxAgents: ""
|
taxAgents: ""
|
||||||
}, progressVisible: false, progress: 0,
|
}, progressVisible: false, progress: 0, selectedRowKeys: [], fcAuth: false,
|
||||||
accountDialog: { visible: false, title: "", loading: false, options: [] },
|
accountDialog: { visible: false, title: "", loading: false, options: [] },
|
||||||
logDialogVisible: false, filterConditions: "[]"
|
logDialogVisible: false, filterConditions: "[]"
|
||||||
};
|
};
|
||||||
|
|
@ -40,6 +40,10 @@ class StandingBook extends Component {
|
||||||
this.timer = null;
|
this.timer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
API.fcAuth({}).then(({ data, status }) => this.setState({ fcAuth: status && data }));
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Author: 黎永顺
|
* Author: 黎永顺
|
||||||
* Description: 社保福利台账重构-核算
|
* Description: 社保福利台账重构-核算
|
||||||
|
|
@ -60,7 +64,10 @@ class StandingBook extends Component {
|
||||||
progressVisible: true
|
progressVisible: true
|
||||||
}, () => {
|
}, () => {
|
||||||
this.timer = setInterval(() => {
|
this.timer = setInterval(() => {
|
||||||
getCalculateProgress(moment(billMonth).format("YYYY-MM"), payload.paymentOrganization).then(({ status, data }) => {
|
getCalculateProgress(moment(billMonth).format("YYYY-MM"), payload.paymentOrganization).then(({
|
||||||
|
status,
|
||||||
|
data
|
||||||
|
}) => {
|
||||||
if (status) {
|
if (status) {
|
||||||
if (!data.status) {
|
if (!data.status) {
|
||||||
clearInterval(this.timer);
|
clearInterval(this.timer);
|
||||||
|
|
@ -112,18 +119,41 @@ class StandingBook extends Component {
|
||||||
filterConditions: targetid ? `[{\"connectCondition\":\"AND\",\"columIndex\":\"targetid\",\"type\":\"=\",\"value\":\"${targetid}\"}]` : "[]"
|
filterConditions: targetid ? `[{\"connectCondition\":\"AND\",\"columIndex\":\"targetid\",\"type\":\"=\",\"value\":\"${targetid}\"}]` : "[]"
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case "QZBatchExp":
|
||||||
|
WeaLoadingGlobal.start();
|
||||||
|
const promise = API.exportQZReport({ ids: this.state.selectedRowKeys });
|
||||||
|
break;
|
||||||
|
case "QZBatchFc":
|
||||||
|
API.batFC({ ids: this.state.selectedRowKeys, fc: targetid }).then(({ status, data, errormsg }) => {
|
||||||
|
if (status) {
|
||||||
|
message.success(data || getLabel(111, "操作成功!"));
|
||||||
|
this.wfListRef.getWelfareRecordList();
|
||||||
|
} else {
|
||||||
|
message.error(errormsg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { accountDialog, queryForm, logDialogVisible, filterConditions } = this.state;
|
const { accountDialog, queryForm, logDialogVisible, filterConditions, selectedRowKeys, fcAuth } = this.state;
|
||||||
const { taxAgentStore: { PageAndOptAuth } } = this.props;
|
const { taxAgentStore: { PageAndOptAuth } } = this.props;
|
||||||
const showOperateBtn = PageAndOptAuth.opts.includes("admin");
|
const showOperateBtn = PageAndOptAuth.opts.includes("admin");
|
||||||
const rightBtns = [<Button type="primary" onClick={() => this.setState({
|
const rightBtns = [
|
||||||
accountDialog: { ...accountDialog, visible: true, title: getLabel(538780, "核算") }
|
<Button type="primary" disabled={_.isEmpty(selectedRowKeys)}
|
||||||
})}>{getLabel(538780, "核算")}</Button>];
|
onClick={() => this.onDropMenuClick("QZBatchExp")}>{getLabel(111, "批量导出")}</Button>,
|
||||||
|
<Button type="primary" disabled={_.isEmpty(selectedRowKeys)}
|
||||||
|
onClick={() => this.onDropMenuClick("QZBatchFc", "FC")}>{getLabel(111, "批量封存")}</Button>,
|
||||||
|
<Button type="primary" disabled={_.isEmpty(selectedRowKeys)}
|
||||||
|
onClick={() => this.onDropMenuClick("QZBatchFc", "JF")}>{getLabel(111, "批量解封")}</Button>,
|
||||||
|
<Button type="primary" onClick={() => this.setState({
|
||||||
|
accountDialog: { ...accountDialog, visible: true, title: getLabel(538780, "核算") }
|
||||||
|
})}>{getLabel(538780, "核算")}</Button>
|
||||||
|
];
|
||||||
|
!fcAuth && rightBtns.splice(1, 2);
|
||||||
return (<WeaTop title={getLabel(538002, "社保福利台账")} icon={<i className="icon-coms-fa"/>}
|
return (<WeaTop title={getLabel(538002, "社保福利台账")} icon={<i className="icon-coms-fa"/>}
|
||||||
iconBgcolor="#F14A2D" buttons={showOperateBtn ? rightBtns : []} className="salary-welfare-record"
|
iconBgcolor="#F14A2D" buttons={showOperateBtn ? rightBtns : []} className="salary-welfare-record"
|
||||||
showDropIcon onDropMenuClick={this.onDropMenuClick}
|
showDropIcon onDropMenuClick={this.onDropMenuClick}
|
||||||
|
|
@ -143,7 +173,9 @@ class StandingBook extends Component {
|
||||||
onPutAccountOptions={options => this.setState({ accountDialog: { ...accountDialog, options } })}
|
onPutAccountOptions={options => this.setState({ accountDialog: { ...accountDialog, options } })}
|
||||||
/>
|
/>
|
||||||
<WelfareRecordList ref={dom => this.wfListRef = dom} queryForm={queryForm}
|
<WelfareRecordList ref={dom => this.wfListRef = dom} queryForm={queryForm}
|
||||||
onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}/>
|
onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}
|
||||||
|
selectedRowKeys={selectedRowKeys} fcAuth={fcAuth}
|
||||||
|
onChangeSelectedRowKeys={v => this.setState({ selectedRowKeys: v })}/>
|
||||||
</div>
|
</div>
|
||||||
<Accountdialog {...accountDialog}
|
<Accountdialog {...accountDialog}
|
||||||
onCancel={() => this.setState({
|
onCancel={() => this.setState({
|
||||||
|
|
@ -166,4 +198,4 @@ class StandingBook extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default StandingBook;
|
export default StandingBook;
|
||||||
Loading…
Reference in New Issue