custom-艾志工业-合并个税

This commit is contained in:
lys 2025-03-14 16:08:13 +08:00
parent b22933bd02
commit fcde0d5e8c
8 changed files with 259 additions and 48 deletions

View File

@ -79,33 +79,35 @@ class Index extends Component {
renderTabBtns = () => {
const { selectedKey, selectedRowKeys } = this.state;
const { calcDetail } = this.props;
const { calcDetail, taxAgentStore: { showOperateBtn } } = this.props;
let tabBtns = [];
switch (selectedKey) {
case "range":
tabBtns = [
<WeaButtonIcon buttonType="del" type="primary" title={getLabel(111, "批量删除")}
disabled={_.isEmpty(selectedRowKeys)}
onClick={() => this.handleDeletePCitem()}/>,
<WeaBrowser type={17} title={getLabel(383694, "添加人员")} isSingle={false} customized
onChange={ids => ids && this.handleUserBrowserChange(ids.split(","))}
>
<WeaButtonIcon buttonType="add" type="primary" title={getLabel(1421, "新增")}/>
</WeaBrowser>,
<span className="icon-refresh" onClick={this.handleRefresh}><i
className="icon-coms-Refresh"/></span>,
<Button type="primary" onClick={this.handleExport}>{getLabel(17416, "导出")}</Button>
];
calcDetail && tabBtns.splice(0, 2);
break;
case "add":
case "sub":
tabBtns = [
<Button type="primary" onClick={this.handleExport}>{getLabel(17416, "导出")}</Button>
];
break;
default:
break;
if (showOperateBtn) {
switch (selectedKey) {
case "range":
tabBtns = [
<WeaButtonIcon buttonType="del" type="primary" title={getLabel(111, "批量删除")}
disabled={_.isEmpty(selectedRowKeys)}
onClick={() => this.handleDeletePCitem()}/>,
<WeaBrowser type={17} title={getLabel(383694, "添加人员")} isSingle={false} customized
onChange={ids => ids && this.handleUserBrowserChange(ids.split(","))}
>
<WeaButtonIcon buttonType="add" type="primary" title={getLabel(1421, "新增")}/>
</WeaBrowser>,
<span className="icon-refresh" onClick={this.handleRefresh}><i
className="icon-coms-Refresh"/></span>,
<Button type="primary" onClick={this.handleExport}>{getLabel(17416, "导出")}</Button>
];
calcDetail && tabBtns.splice(0, 2);
break;
case "add":
case "sub":
tabBtns = [
<Button type="primary" onClick={this.handleExport}>{getLabel(17416, "导出")}</Button>
];
break;
default:
break;
}
}
return tabBtns;
};
@ -204,7 +206,7 @@ class Index extends Component {
};
render() {
const { calculateStore: { PCSearchForm }, calcDetail } = this.props;
const { calculateStore: { PCSearchForm }, taxAgentStore: { showOperateBtn }, calcDetail } = this.props;
const {
selectedKey, showSearchAd, searchConditions, pageInfo, loading, selectedRowKeys,
columns, dataSource
@ -282,7 +284,7 @@ class Index extends Component {
onAdReset={() => PCSearchForm.resetForm()} autoCalculateWidth
/>
<WeaTable
dataSource={dataSource} loading={loading} rowSelection={calcDetail ? null : rowSelection}
dataSource={dataSource} loading={loading} rowSelection={(calcDetail || !showOperateBtn) ? null : rowSelection}
pagination={pagination} scroll={{ y: `calc(100vh - 365px)` }} rowKey="id"
columns={[..._.map(columns, item => {
let width = "";
@ -303,8 +305,8 @@ class Index extends Component {
title: getLabel(30585, "操作"),
width: 120,
render: (_, record) => (<React.Fragment>
{calcDetail ? null : <a href="javascript:void(0);"
onClick={() => this.handleDeletePCitem([record.id])}>{getLabel(535052, "删除")}</a>}
{(calcDetail || !showOperateBtn) ? null : <a href="javascript:void(0);"
onClick={() => this.handleDeletePCitem([record.id])}>{getLabel(535052, "删除")}</a>}
</React.Fragment>
)
}

View File

@ -238,7 +238,7 @@ class EditCalcTable extends Component {
"总计": getLabel(523, "总计"), "批量解锁": getLabel(111, "批量解锁"),
"批量锁定": getLabel(111, "批量锁定"), "批量更新": getLabel(111, "批量更新"),
"查看拓扑图": getLabel(111, "查看拓扑图"), "锁定": getLabel(111, "锁定"),
"解锁": getLabel(111, "解锁")
"解锁": getLabel(111, "解锁"), "查看": getLabel(111, "查看")
};
this.setState({ originPayloadData: { ...payload, i18n } });
const childFrameObj = document.getElementById("atdTable");
@ -248,7 +248,7 @@ class EditCalcTable extends Component {
const { pageInfo } = this.state;
const {
calculateStore: { ECSearchForm, otherConditions }, routeParams: { salaryAcctRecordId },
calcDetail = false
taxAgentStore: { showOperateBtn }, calcDetail = false
} = this.props;
const { subcompanyIds, departmentIds, positionIds, statuses, ...extra } = ECSearchForm.getFormParams();
const payload = {
@ -269,11 +269,11 @@ class EditCalcTable extends Component {
const sumRowlistUrl = this.props.showTotalCell ? "/api/bs/hrmsalary/salaryacct/acctresult/sum" : "";
this.postMessageToChild({
dataSource, pageInfo, selectedRowKeys, showTotalCell: this.props.showTotalCell, sumRowlistUrl, payload,
calcDetail,
columns: _.every(traverse(columns, calcDetail), (it, idx) => !it.fixed) ? _.map(traverse(columns, calcDetail), (it, idx) => ({
calcDetail: (calcDetail || !showOperateBtn), showSee: !showOperateBtn,
columns: _.every(traverse(columns, (calcDetail || !showOperateBtn)), (it, idx) => !it.fixed) ? _.map(traverse(columns, (calcDetail || !showOperateBtn)), (it, idx) => ({
...it,
fixed: idx < 2 ? "left" : false
})) : traverse(columns, calcDetail)
})) : traverse(columns, (calcDetail || !showOperateBtn))
});
});
}

View File

@ -21,7 +21,7 @@ import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
@inject("calculateStore")
@inject("calculateStore", "taxAgentStore")
@observer
class Index extends Component {
constructor(props) {
@ -209,7 +209,7 @@ class Index extends Component {
});
};
renderReqBtns = () => {
const { routeParams: { salaryAcctRecordId } } = this.props;
const { routeParams: { salaryAcctRecordId }, taxAgentStore: { showOperateBtn } } = this.props;
const { selectedKey, accountExceptInfo, approvalInfo, loading } = this.state;
const { isOpenApproval, approvalWorkflowUrl, canEdit } = approvalInfo;
let reqBtns = [];
@ -246,6 +246,7 @@ class Index extends Component {
isOpenApproval && reqBtns.unshift(<Button type="ghost" onClick={() => {
window.open(`${approvalWorkflowUrl}&salaryAcctRecordId=${salaryAcctRecordId}`, "_blank");
}}>{getLabel(111, "发起审批")}</Button>);
!showOperateBtn && (reqBtns = reqBtns.slice(-1));
accountExceptInfo && reqBtns.unshift(<i className="iconfont icon-jinggao"
title={getLabel(111, "存在异常信息,点击下载!")}
onClick={() => this.downloadTxtfile(accountExceptInfo)}/>);

View File

@ -0,0 +1,133 @@
export const conditions = [
{
items: [
{
colSpan: 2,
conditionType: "INPUT",
domkey: ["username"],
fieldcol: 12,
label: "姓名",
lanId: 25034,
labelcol: 6,
value: "",
viewAttr: 2
},
{
browserConditionParam: {
completeParams: {},
conditionDataParams: {},
dataParams: {},
destDataParams: {},
hasAddBtn: false,
hasAdvanceSerach: false,
idSeparator: ",",
isAutoComplete: 1,
isDetail: 0,
isMultCheckbox: false,
isSingle: false,
icon: "icon-coms-hrm",
linkUrl: "",
pageSize: 10,
quickSearchName: "",
replaceDatas: [],
title: "",
type: "57",
viewAttr: 2
},
colSpan: 2,
conditionType: "BROWSER",
domkey: ["departmentIds"],
fieldcol: 12,
label: "部门",
lanId: 27511,
labelcol: 6,
viewAttr: 2
},
{
browserConditionParam: {
completeParams: {},
conditionDataParams: {},
dataParams: {},
destDataParams: {},
hasAddBtn: false,
hasAdvanceSerach: false,
idSeparator: ",",
isAutoComplete: 1,
isDetail: 0,
isMultCheckbox: false,
isSingle: false,
icon: "icon-coms-hrm",
linkUrl: "",
pageSize: 10,
quickSearchName: "",
replaceDatas: [],
title: "",
type: "24",
viewAttr: 2
},
colSpan: 2,
conditionType: "BROWSER",
domkey: ["positionIds"],
fieldcol: 12,
label: "岗位",
lanId: 6086,
labelcol: 6,
viewAttr: 2
},
{
colSpan: 2,
conditionType: "INPUT",
domkey: ["adjustItem"],
fieldcol: 12,
label: "项目名称",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 2
},
{
colSpan: 2,
conditionType: "RANGEPICKER",
domkey: ["operateTime1", "operateTime2"],
fieldcol: 12,
label: "操作日期",
lanId: 111,
labelcol: 6,
viewAttr: 2
},
{
browserConditionParam: {
completeParams: {},
conditionDataParams: {},
dataParams: {},
destDataParams: {},
hasAddBtn: false,
hasAdvanceSerach: false,
idSeparator: ",",
isAutoComplete: 1,
isDetail: 0,
isMultCheckbox: false,
isSingle: false,
icon: "icon-coms-hrm",
linkUrl: "",
pageSize: 10,
quickSearchName: "",
replaceDatas: [],
title: "",
type: "17",
viewAttr: 2
},
colSpan: 2,
conditionType: "BROWSER",
domkey: ["operatorIds"],
fieldcol: 12,
label: "操作人",
lanId: 111,
labelcol: 6,
viewAttr: 2
}
],
defaultshow: true,
title: ""
}
];

View File

@ -8,52 +8,100 @@
* @description:
*/
import React, { Component } from "react";
import { WeaLoadingGlobal, WeaLocaleProvider, WeaRangePicker, WeaTop } from "ecCom";
import { WeaForm } from "comsMobx";
import { WeaLoadingGlobal, WeaLocaleProvider, WeaRangePicker, WeaSearchGroup, WeaTable, WeaTop } from "ecCom";
import FormInfo from "../../../../components/FormInfo";
import * as API from "../../../../apis/custom-apis/azInterface";
import { Button } from "antd";
import { conditions } from "./config";
import moment from "moment";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
const form = new WeaForm();
class Index extends Component {
constructor(props) {
super(props);
this.state = {
dataSource: [], columns: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 },
effectiveTime: []
dataSource: [], columns: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, conditions: [],
effectiveTime: [moment().startOf("month").format("YYYY-MM-DD"), moment().endOf("month").format("YYYY-MM-DD")],
payload: {}
};
}
componentDidMount() {
this.setState({
conditions: _.map(conditions, item => ({
...item, items: _.map(item.items, o => ({ ...o, label: getLabel(o.lanId, o.label) }))
}))
}, () => form.initFormFields(this.state.conditions));
this.getAZAdjustList();
}
getAZAdjustList = () => {
const { departmentIds, positionIds, operatorIds, operateTime1, operateTime2 } = form.getFormParams();
const payload = {
...this.state.pageInfo, effectiveTime: this.state.effectiveTime
...form.getFormParams(), ...this.state.pageInfo, effectiveTime: this.state.effectiveTime,
departmentIds: departmentIds ? departmentIds.split(",") : [],
positionIds: positionIds ? positionIds.split(",") : [],
operatorIds: operatorIds ? operatorIds.split(",") : [],
operateTime: operateTime1 ? [operateTime1, operateTime2] : []
};
this.setState({ loading: true, payload });
API.getAZAdjustList(payload).then(({ status, data }) => {
this.setState({ loading: false });
if (status) {
console.log(data);
const { columns, pageInfo: { list: dataSource, pageNum: current, pageSize, total } } = data;
this.setState({
pageInfo: { current, pageSize, total }, dataSource,
columns: _.map(columns, o => ({ dataIndex: o.column, title: o.text, width: o.width }))
});
}
});
};
handleExport = () => {
WeaLoadingGlobal.start();
const payload = { effectiveTime: this.state.effectiveTime };
const promise = API.exportAzAdjustList(payload);
const promise = API.exportAzAdjustList(this.state.payload);
};
render() {
const { effectiveTime } = this.state;
const { effectiveTime, loading, pageInfo, columns, dataSource, conditions } = this.state;
const pagination = {
...pageInfo,
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
showQuickJumper: true,
showSizeChanger: true,
pageSizeOptions: ["10", "20", "50", "100"],
onShowSizeChange: (current, pageSize) => {
this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.getAZAdjustList());
},
onChange: current => {
this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getAZAdjustList());
}
};
return (
<WeaTop title={getLabel(111, "薪资档案报表")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
buttons={[
<WeaRangePicker dateGroup value={effectiveTime} onChange={v => this.setState({ effectiveTime: v })}/>,
<WeaRangePicker dateGroup value={effectiveTime}
onChange={v => this.setState({ effectiveTime: v }, () => this.getAZAdjustList())}/>,
<Button type="primary" onClick={this.handleExport}>{getLabel(111, "导出")}</Button>
]}>
<div className="azSalaryFileReports"></div>
</WeaTop>);
<div className="azSalaryFileReports">
<WeaSearchGroup className="advanceSearchGroup" needTigger title={getLabel(111, "高级搜索")}>
<FormInfo center={false} form={form} formFields={conditions} colCount={2}/>
<div className="advanceSearchGroupButtons">
<span style={{ marginLeft: 15 }}><Button type="primary"
onClick={this.getAZAdjustList}>{getLabel(388113, "搜索")}</Button></span>
<span style={{ marginLeft: 15 }}><Button type="ghost"
onClick={() => form.resetForm()}>{getLabel(2022, "重置")}</Button></span>
</div>
</WeaSearchGroup>
<WeaTable columns={columns} dataSource={dataSource} pagination={pagination} loading={loading}
scroll={{ y: `calc(100vh - 220px)` }}/>
</div>
</WeaTop>
);
}
}

View File

@ -2,4 +2,26 @@
height: 100%;
background: #f6f6f6;
padding: 8px 16px 0 16px;
.advanceSearchGroup {
padding: 0;
background: #FFF;
margin-bottom: 8px;
}
.hideContent .wea-content {
display: none;
}
.advanceSearchGroupButtons {
display: flex;
justify-content: center;
align-items: center;
padding: 8px 0;
border-top: 1px solid #dadada;
}
.wea-new-table {
background: #FFF;
}
}

View File

@ -0,0 +1,2 @@
export class AZStore {
}

View File

@ -1,2 +1,5 @@
import { AZStore } from "./az";
module.exports = {
AZStore: new AZStore() //艾志
};