Compare commits
4 Commits
64d9022248
...
72adc68307
| Author | SHA1 | Date |
|---|---|---|
|
|
72adc68307 | |
|
|
7aa1c7afc6 | |
|
|
372d9d53ee | |
|
|
9efeb109e9 |
|
|
@ -311,3 +311,7 @@ export const afterTaxAccounting = (params) => {
|
|||
export const getAfterTaxAccountingProgress = (id) => {
|
||||
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);
|
||||
};
|
||||
|
|
@ -15,7 +15,7 @@ import CalculateTablelist from "./components/calculateTablelist";
|
|||
import CalculateDialog from "./components/calculateDialog";
|
||||
import ProgressModal from "../../components/progressModal";
|
||||
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 { queryConditions } from "./config";
|
||||
import { postFetch } from "../../util/request";
|
||||
|
|
@ -40,7 +40,8 @@ class Calculate extends Component {
|
|||
]
|
||||
}, isRefresh: false, logDialogVisible: false, conditions: [],
|
||||
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.handleDebounce = null;
|
||||
|
|
@ -63,7 +64,7 @@ class Calculate extends Component {
|
|||
|
||||
renderCalculateOpts = () => {
|
||||
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");
|
||||
let calculateOpts = [
|
||||
<Button type="primary" onClick={() => this.setState({
|
||||
|
|
@ -72,13 +73,28 @@ class Calculate extends Component {
|
|||
title: getLabel(538780, "核算")
|
||||
}
|
||||
})}>{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 })}
|
||||
onChange={v => this.setState({
|
||||
isRefresh: _.keys(v)[0] === "name" ? isRefresh : !isRefresh,
|
||||
queryParams: { ...queryParams, ...v }
|
||||
})} 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) => {
|
||||
const { isRefresh, progressModule } = this.state, { id } = record;
|
||||
|
|
@ -213,7 +229,8 @@ class Calculate extends Component {
|
|||
|
||||
render() {
|
||||
const {
|
||||
queryParams, isRefresh, calcDaialog, progressModule, logDialogVisible, filterConditions, conditions, showAdvance
|
||||
queryParams, isRefresh, calcDaialog, progressModule, logDialogVisible, filterConditions, conditions, showAdvance,
|
||||
selectedRowKeys
|
||||
} = this.state;
|
||||
return (
|
||||
<WeaTop title={getLabel(538011, "薪资核算")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
||||
|
|
@ -237,7 +254,8 @@ class Calculate extends Component {
|
|||
</div>
|
||||
</div>
|
||||
<CalculateTablelist form={form} queryParams={queryParams} isRefresh={isRefresh}
|
||||
onCalcOpts={this.handleCalcOpts}/>
|
||||
onCalcOpts={this.handleCalcOpts} selectedRowKeys={selectedRowKeys}
|
||||
onSelectChange={v => this.setState({ selectedRowKeys: v })}/>
|
||||
<CalculateDialog {...calcDaialog}
|
||||
onCancel={(bool, id) => this.setState({
|
||||
calcDaialog: { ...calcDaialog, visible: false },
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ class Index extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { loading, dataSource, columns, pageInfo } = this.state;
|
||||
const { loading, dataSource, columns, pageInfo } = this.state, { selectedRowKeys, onSelectChange } = this.props;
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
|
||||
|
|
@ -148,11 +148,15 @@ class Index extends Component {
|
|||
}, () => this.getSalaryAcctList(this.props));
|
||||
}
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: onSelectChange
|
||||
};
|
||||
return (
|
||||
<WeaTable
|
||||
rowKey="id" scroll={{ y: "calc(100vh - 152px)" }}
|
||||
dataSource={dataSource} loading={loading}
|
||||
pagination={pagination} columns={columns}
|
||||
pagination={pagination} columns={columns} rowSelection={rowSelection}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,9 +13,8 @@ import Content from "../../components/pcTemplate/content";
|
|||
import { confirmSalaryBill, feedBackSalaryBill, payrollCheckType } from "../../apis/payroll";
|
||||
import CaptchaModal from "../../components/captchaModal";
|
||||
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 { getLabel } = WeaLocaleProvider;
|
||||
|
||||
|
|
@ -132,7 +131,7 @@ export const ConfirmBtns = (props) => {
|
|||
<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>
|
||||
}
|
||||
</div>;
|
||||
|
|
|
|||
Loading…
Reference in New Issue