Compare commits

...

4 Commits

4 changed files with 39 additions and 14 deletions

View File

@ -311,3 +311,7 @@ export const afterTaxAccounting = (params) => {
export const getAfterTaxAccountingProgress = (id) => { export const getAfterTaxAccountingProgress = (id) => {
return WeaTools.callApi("/api/bs/hrmsalary/progress/getRate?cacheKey=AFTER_TAX_ACCT_PROGRESS_" + id, "get", {}); return WeaTools.callApi("/api/bs/hrmsalary/progress/getRate?cacheKey=AFTER_TAX_ACCT_PROGRESS_" + id, "get", {});
}; };
// 批量计算薪资-钱智
export const batAccounting = (params) => {
return postFetch("/api/bs/hrmsalary/salaryacct/batAccounting", params);
};

View File

@ -15,7 +15,7 @@ import CalculateTablelist from "./components/calculateTablelist";
import CalculateDialog from "./components/calculateDialog"; import CalculateDialog from "./components/calculateDialog";
import ProgressModal from "../../components/progressModal"; import ProgressModal from "../../components/progressModal";
import LogDialog from "../../components/logViewModal"; import LogDialog from "../../components/logViewModal";
import { backCalculate, deleteSalaryacct, fileSalaryAcct, reAccounting } from "../../apis/calculate"; import { backCalculate, batAccounting, deleteSalaryacct, fileSalaryAcct, reAccounting } from "../../apis/calculate";
import FormInfo from "../../components/FormInfo"; import FormInfo from "../../components/FormInfo";
import { queryConditions } from "./config"; import { queryConditions } from "./config";
import { postFetch } from "../../util/request"; import { postFetch } from "../../util/request";
@ -40,7 +40,8 @@ class Calculate extends Component {
] ]
}, isRefresh: false, logDialogVisible: false, conditions: [], }, isRefresh: false, logDialogVisible: false, conditions: [],
progressModule: { visible: false, progress: 0, title: getLabel(111, "正在归档中请稍后") }, progressModule: { visible: false, progress: 0, title: getLabel(111, "正在归档中请稍后") },
calcDaialog: { visible: false, title: "" }, showAdvance: false calcDaialog: { visible: false, title: "" }, showAdvance: false, selectedRowKeys: [],
loading: false
}; };
this.timer = null; this.timer = null;
this.handleDebounce = null; this.handleDebounce = null;
@ -63,7 +64,7 @@ class Calculate extends Component {
renderCalculateOpts = () => { renderCalculateOpts = () => {
const { taxAgentStore: { PageAndOptAuth } } = this.props; const { taxAgentStore: { PageAndOptAuth } } = this.props;
const { queryParams, isRefresh, showAdvance } = this.state; const { queryParams, isRefresh, showAdvance, loading, selectedRowKeys } = this.state;
const admin = PageAndOptAuth.opts.includes("admin"); const admin = PageAndOptAuth.opts.includes("admin");
let calculateOpts = [ let calculateOpts = [
<Button type="primary" onClick={() => this.setState({ <Button type="primary" onClick={() => this.setState({
@ -72,13 +73,28 @@ class Calculate extends Component {
title: getLabel(538780, "核算") title: getLabel(538780, "核算")
} }
})}>{getLabel(538780, "核算")}</Button>, })}>{getLabel(538780, "核算")}</Button>,
<Button type="ghost" loading={loading} disabled={_.isEmpty(selectedRowKeys)}
onClick={this.handleBatAccounting}>{getLabel(111, "批量计算薪资")}</Button>,
<CalculateQuery queryParams={queryParams} onAdvance={() => this.setState({ showAdvance: !showAdvance })} <CalculateQuery queryParams={queryParams} onAdvance={() => this.setState({ showAdvance: !showAdvance })}
onChange={v => this.setState({ onChange={v => this.setState({
isRefresh: _.keys(v)[0] === "name" ? isRefresh : !isRefresh, isRefresh: _.keys(v)[0] === "name" ? isRefresh : !isRefresh,
queryParams: { ...queryParams, ...v } queryParams: { ...queryParams, ...v }
})} onSearch={() => this.setState({ isRefresh: !isRefresh })}/> })} onSearch={() => this.setState({ isRefresh: !isRefresh })}/>
]; ];
return !admin ? calculateOpts.slice(1) : calculateOpts; return !admin ? calculateOpts.slice(2) : calculateOpts;
};
handleBatAccounting = () => {
const { selectedRowKeys: salaryAcctRecordIds, isRefresh } = this.state;
this.setState({ loading: true });
batAccounting({ salaryAcctRecordIds }).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(111, "操作成功!"));
this.setState({ isRefresh: !isRefresh });
} else {
message.error(errormsg);
}
});
}; };
handleCalcOpts = ({ key }, record) => { handleCalcOpts = ({ key }, record) => {
const { isRefresh, progressModule } = this.state, { id } = record; const { isRefresh, progressModule } = this.state, { id } = record;
@ -213,7 +229,8 @@ class Calculate extends Component {
render() { render() {
const { const {
queryParams, isRefresh, calcDaialog, progressModule, logDialogVisible, filterConditions, conditions, showAdvance queryParams, isRefresh, calcDaialog, progressModule, logDialogVisible, filterConditions, conditions, showAdvance,
selectedRowKeys
} = this.state; } = this.state;
return ( return (
<WeaTop title={getLabel(538011, "薪资核算")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D" <WeaTop title={getLabel(538011, "薪资核算")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
@ -237,7 +254,8 @@ class Calculate extends Component {
</div> </div>
</div> </div>
<CalculateTablelist form={form} queryParams={queryParams} isRefresh={isRefresh} <CalculateTablelist form={form} queryParams={queryParams} isRefresh={isRefresh}
onCalcOpts={this.handleCalcOpts}/> onCalcOpts={this.handleCalcOpts} selectedRowKeys={selectedRowKeys}
onSelectChange={v => this.setState({ selectedRowKeys: v })}/>
<CalculateDialog {...calcDaialog} <CalculateDialog {...calcDaialog}
onCancel={(bool, id) => this.setState({ onCancel={(bool, id) => this.setState({
calcDaialog: { ...calcDaialog, visible: false }, calcDaialog: { ...calcDaialog, visible: false },
@ -268,4 +286,4 @@ class Calculate extends Component {
} }
} }
export default Calculate; export default Calculate;

View File

@ -130,7 +130,7 @@ class Index extends Component {
}; };
render() { render() {
const { loading, dataSource, columns, pageInfo } = this.state; const { loading, dataSource, columns, pageInfo } = this.state, { selectedRowKeys, onSelectChange } = this.props;
const pagination = { const pagination = {
...pageInfo, ...pageInfo,
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
@ -148,14 +148,18 @@ class Index extends Component {
}, () => this.getSalaryAcctList(this.props)); }, () => this.getSalaryAcctList(this.props));
} }
}; };
const rowSelection = {
selectedRowKeys,
onChange: onSelectChange
};
return ( return (
<WeaTable <WeaTable
rowKey="id" scroll={{ y: "calc(100vh - 152px)" }} rowKey="id" scroll={{ y: "calc(100vh - 152px)" }}
dataSource={dataSource} loading={loading} dataSource={dataSource} loading={loading}
pagination={pagination} columns={columns} pagination={pagination} columns={columns} rowSelection={rowSelection}
/> />
); );
} }
} }
export default Index; export default Index;

View File

@ -13,9 +13,8 @@ import Content from "../../components/pcTemplate/content";
import { confirmSalaryBill, feedBackSalaryBill, payrollCheckType } from "../../apis/payroll"; import { confirmSalaryBill, feedBackSalaryBill, payrollCheckType } from "../../apis/payroll";
import CaptchaModal from "../../components/captchaModal"; import CaptchaModal from "../../components/captchaModal";
import "./index.less"; import "./index.less";
import { getQueryString } from "../../util/url";
const isIPhone = new RegExp("\\biPhone\\b|\\biPod\\b", "i").test(window.navigator.userAgent); const isPhone = /(iPhone|iPad|iPod|iOS|Android)/i.test(window.navigator.userAgent);
const isEm = window.navigator.userAgent.indexOf("E-Mobile7") >= 0; const isEm = window.navigator.userAgent.indexOf("E-Mobile7") >= 0;
const { getLabel } = WeaLocaleProvider; const { getLabel } = WeaLocaleProvider;
@ -132,8 +131,8 @@ export const ConfirmBtns = (props) => {
<Button type="primary" onClick={props.confirmSalaryBill}>{getLabel(111, "确认")}</Button> <Button type="primary" onClick={props.confirmSalaryBill}>{getLabel(111, "确认")}</Button>
} }
{ {
((props.showFeedback === "1" && !isIPhone) || (props.showFeedback === "1" && isIPhone && isEm)) && ((props.showFeedback === "1" && !isPhone) || (props.showFeedback === "1" && isEm)) &&
<Button type="ghost" onClick={props.goFeedback}>{getLabel(111, "反馈")}</Button> <Button type="ghost" onClick={props.goFeedback}>{getLabel(111, "反馈")}</Button>
} }
</div>; </div>;
}; };