release/2.18.2.2412.02-个税
This commit is contained in:
parent
1ece8f4ff2
commit
e0b387503b
|
|
@ -0,0 +1,96 @@
|
|||
import React, { Component } from "react";
|
||||
import { WeaCheckbox, WeaFormItem, WeaSearchGroup } from "ecCom";
|
||||
import { observer } from "mobx-react";
|
||||
import { WeaSwitch } from "comsMobx";
|
||||
|
||||
@observer
|
||||
export default class FormInfo extends Component {
|
||||
renderForm = () => {
|
||||
const {
|
||||
formFields, form, colCount, itemRender, onSelectedChangeHandle,
|
||||
showLabel, multiColumn, custLabelCol, childrenComponents
|
||||
} = this.props;
|
||||
|
||||
let groupArr = [];
|
||||
const formParams = form.getFormParams();
|
||||
const labelVisible = showLabel == null || showLabel == true;
|
||||
const col = colCount ? colCount : 1;
|
||||
const labelCol = labelVisible ? (custLabelCol || `${window.HrmEngineLabelCol}`) : 0;
|
||||
const itemProps = {
|
||||
ratio1to2: labelVisible && custLabelCol == null,
|
||||
style: { marginLeft: 0 },
|
||||
tipPosition: "bottom",
|
||||
labelCol: { span: labelCol },
|
||||
wrapperCol: { span: 24 - labelCol }
|
||||
};
|
||||
const textAreaProps = { minRows: 4, maxRows: 4 };
|
||||
|
||||
formFields.map((fields, i) => {
|
||||
let formItems = [];
|
||||
fields.items.map((field, j) => {
|
||||
const customerRender = itemRender != null ? itemRender[field.domkey[0]] : null;
|
||||
const showCheckbox = field.checkbox || false;
|
||||
let label = field.label;
|
||||
if (showCheckbox)
|
||||
label = <WeaCheckbox content={label} value={field.checkboxValue} onChange={(v) => {
|
||||
field.checkboxValue = v === "1";
|
||||
onSelectedChangeHandle && onSelectedChangeHandle(field, v);
|
||||
}}/>;
|
||||
let coms;
|
||||
if (customerRender == null) {
|
||||
coms = <WeaSwitch fieldConfig={{ ...field, ...textAreaProps, hasBorder: field.viewAttr === 1 }} form={form}
|
||||
formParams={formParams}/>;
|
||||
} else {
|
||||
coms = customerRender(field, textAreaProps, form, formParams);
|
||||
}
|
||||
Object.assign(itemProps, { label, error: form.getError(field) });
|
||||
let col = 1;
|
||||
if (multiColumn != null) {//检查有哪些字段需要一行显示多个
|
||||
const idx = _.findIndex(multiColumn, item => item.key === field.domkey[0]);
|
||||
if (idx > -1) {
|
||||
col = field.colSpan || 1;
|
||||
if (multiColumn[idx].labelCol != null)//检查字段是否有配置标题宽度
|
||||
Object.assign(itemProps, {
|
||||
labelCol: { span: multiColumn[idx].labelCol },
|
||||
wrapperCol: { span: 24 - multiColumn[idx].labelCol }
|
||||
});
|
||||
} else {
|
||||
Object.assign(itemProps, {
|
||||
labelCol: { span: labelCol },
|
||||
wrapperCol: { span: 24 - labelCol }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
coms != null && formItems.push({
|
||||
com: (<WeaFormItem {...itemProps}>{coms}</WeaFormItem>),
|
||||
col
|
||||
});
|
||||
|
||||
if (childrenComponents && childrenComponents[field.domkey[0]]) {
|
||||
childrenComponents[field.domkey[0]]().map(child => formItems.push(child));
|
||||
}
|
||||
});
|
||||
|
||||
groupArr.push(<WeaSearchGroup
|
||||
center={this.props.center != null ? this.props.center : true}
|
||||
needTigger={true}
|
||||
title={formFields.length < 2 ? null : fields.title}
|
||||
showGroup={true}
|
||||
items={formItems}
|
||||
col={col}
|
||||
fontSize={14}/>);
|
||||
});
|
||||
return groupArr;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { formFields, className } = this.props;
|
||||
if (formFields == null) return (<div></div>);
|
||||
return (
|
||||
<div className={className}>
|
||||
{this.renderForm()}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -35,6 +35,18 @@
|
|||
background: #FFF;
|
||||
margin: 0 16px;
|
||||
}
|
||||
|
||||
.extra_tax {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -8px;
|
||||
right: -20px;
|
||||
|
||||
i {
|
||||
color: #2db7f5;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.layoutWrapper {
|
||||
|
|
|
|||
|
|
@ -62,6 +62,17 @@ export const dataCollectCondition = [
|
|||
},
|
||||
{
|
||||
items: [
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["freeIncome"],
|
||||
fieldcol: 14,
|
||||
label: "免税收入",
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
precision: 2,
|
||||
viewAttr: 2,
|
||||
extraDom: null
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["businessHealthyInsurance"],
|
||||
|
|
@ -94,9 +105,9 @@ export const dataCollectCondition = [
|
|||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["privatePension"],
|
||||
domkey: ["derateDeduction"],
|
||||
fieldcol: 14,
|
||||
label: "个人养老金",
|
||||
label: "减免税额",
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
precision: 2,
|
||||
|
|
@ -111,6 +122,16 @@ export const dataCollectCondition = [
|
|||
value: "",
|
||||
precision: 2,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "INPUTNUMBER",
|
||||
domkey: ["privatePension"],
|
||||
fieldcol: 14,
|
||||
label: "个人养老金",
|
||||
labelcol: 8,
|
||||
value: "",
|
||||
precision: 2,
|
||||
viewAttr: 2
|
||||
}
|
||||
],
|
||||
title: "数据采集",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* 数据采集-其他免税扣除
|
||||
* 明细设置弹框
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/12/24
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaDialog, WeaLocaleProvider } from "ecCom";
|
||||
import { Button } from "antd";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class DetailSettingsDialog extends Component {
|
||||
render() {
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} style={{ width: 480, height: 174 }} initLoadCss
|
||||
buttons={[
|
||||
<Button type="primary">{getLabel(111, "确定")}</Button>,
|
||||
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(111, "取消")}</Button>
|
||||
]}
|
||||
>
|
||||
<div className="form-dialog-layout"></div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default DetailSettingsDialog;
|
||||
|
|
@ -30,6 +30,7 @@ import AddItems from "../addItems";
|
|||
import TableRecord from "../components/tableRecord";
|
||||
import { convertToUrlString } from "../../../util/url";
|
||||
import { getDomkes } from "../../../util";
|
||||
import TaxSetDialog from "./taxSetDialog";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
|
@ -64,7 +65,8 @@ class Index extends Component {
|
|||
exportPayloadUrl: "",
|
||||
exportPayloadType: false,
|
||||
advanceCondition: null,
|
||||
targetid: ""
|
||||
targetid: "",
|
||||
taxSetDialog: { visible: false, dataType: "", id: "" }
|
||||
};
|
||||
this.tableRef = null;
|
||||
this.addItemRef = null;
|
||||
|
|
@ -294,7 +296,12 @@ class Index extends Component {
|
|||
return {
|
||||
...it, title: getLabel(83871, "数据采集"),
|
||||
items: _.map(it.items, o => ({
|
||||
...o, label: getLabel(o.lanId, o.label)
|
||||
...o, label: getLabel(o.lanId, o.label),
|
||||
extraDom: !_.isEmpty(editId) &&
|
||||
<a href="javascript:void(0);" className="extra_tax" title={getLabel(111, "添加明细")}
|
||||
onClick={() => this.setState({ taxSetDialog: { visible: true, dataType: getKey(o), id: editId.id } })}>
|
||||
<i className="icon-coms-mulujibenxinxi"/>
|
||||
</a>
|
||||
}))
|
||||
};
|
||||
}
|
||||
|
|
@ -517,7 +524,7 @@ class Index extends Component {
|
|||
const { taxAgentStore: { showOperateBtn }, otherDeductStore: { form } } = this.props;
|
||||
const {
|
||||
declareMonth, taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition,
|
||||
importPayload, exportPayloadType, targetid
|
||||
importPayload, exportPayloadType, targetid, taxSetDialog
|
||||
} = this.state;
|
||||
const tablePayload = { declareMonth: [declareMonth], taxAgentId };
|
||||
return (
|
||||
|
|
@ -540,6 +547,8 @@ class Index extends Component {
|
|||
onViewDetails={(record) => this.handleAddData("其他免税扣除记录", record)}
|
||||
form={form}
|
||||
/>
|
||||
<TaxSetDialog {...taxSetDialog}
|
||||
onCancel={() => this.setState({ taxSetDialog: { ...taxSetDialog, visible: false } })}/>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,105 @@
|
|||
/*
|
||||
* 其他免税扣除设置
|
||||
*
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/12/24
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaButtonIcon, WeaDialog, WeaLocaleProvider, WeaTable } from "ecCom";
|
||||
import { Button, Spin } from "antd";
|
||||
import { postFetch } from "../../../util/request";
|
||||
import DetailSettingsDialog from "./detailSettingsDialog";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class TaxSetDialog extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
dataSource: [], columns: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
selectedRowKeys: [], detailSettingsDialog: { visible: false }
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
||||
this.getList(nextProps);
|
||||
} else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
|
||||
this.setState({
|
||||
dataSource: [], columns: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 },
|
||||
selectedRowKeys: [], detailSettingsDialog: { visible: false }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
getList = (props) => {
|
||||
const { id, dataType } = props || this.props, { pageInfo } = this.state;
|
||||
this.setState({ loading: true });
|
||||
postFetch(`/api/bs/hrmsalary/otherDeduction/${dataType}List`, { ...pageInfo, id }).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
columns,
|
||||
dataSource, pageInfo: { current, pageSize, total }
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { pageInfo, dataSource, loading, columns, selectedRowKeys, detailSettingsDialog } = 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: 1, pageSize } }, () => this.getList());
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getList());
|
||||
}
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys, onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
|
||||
};
|
||||
return (
|
||||
<WeaDialog {...this.props} initLoadCss className="sys-salary-wrapper" ref={dom => this.taxSetRef = dom}
|
||||
title={getLabel(111, "数据采集明细")}
|
||||
buttons={[
|
||||
<Button type="primary">{getLabel(111, "确定")}</Button>,
|
||||
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(111, "取消")}</Button>
|
||||
]}
|
||||
style={{
|
||||
width: "60vw", height: 600, minHeight: 200, minWidth: 380,
|
||||
maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
|
||||
}}>
|
||||
<div className="sys-item-table-box">
|
||||
<Spin spinning={loading && pageInfo.total === 0}>
|
||||
<div className="sys-item-table-opts">
|
||||
<WeaButtonIcon buttonType="add" type="primary" title={getLabel(111, "添加")}
|
||||
onClick={() => this.setState({
|
||||
detailSettingsDialog: { ...detailSettingsDialog, visible: true }
|
||||
})}/>
|
||||
<WeaButtonIcon buttonType="del" type="primary" title={getLabel(111, "删除")}
|
||||
disabled={_.isEmpty(selectedRowKeys)}/>
|
||||
</div>
|
||||
<WeaTable columns={columns} dataSource={dataSource} pagination={pagination} bordered
|
||||
rowSelection={rowSelection} loading={loading}
|
||||
scroll={{ y: this.taxSetRef ? this.taxSetRef.state.height - 112 : 600 }}/>
|
||||
<DetailSettingsDialog {...detailSettingsDialog} onCancel={() => this.setState({
|
||||
detailSettingsDialog: { ...detailSettingsDialog, visible: false }
|
||||
})}/>
|
||||
</Spin>
|
||||
</div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TaxSetDialog;
|
||||
|
|
@ -162,7 +162,20 @@
|
|||
background: #F6F6F6;
|
||||
padding: 8px 16px;
|
||||
|
||||
.wea-new-table {
|
||||
.sys-item-table-opts {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
padding: 12px 14px 11px 23px;
|
||||
background: #FFFFFF;
|
||||
|
||||
.wea-button-icon:first-child {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-new-table, .wea-table-edit {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ export const getSearchs = (form, condition, col, isCenter, onChange = () => void
|
|||
className={(fields.domkey[0] === "subcompanyName" || fields.domkey[0] === "departmentName") ? "hideFormItem" : classnames}
|
||||
>
|
||||
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams} onChange={onChange}/>
|
||||
{fields.extraDom}
|
||||
{
|
||||
fields.helpfulTitle &&
|
||||
<WeaHelpfulTip title={fields.helpfulTitle} style={{ position: "absolute", right: "-20px", top: "25%" }}/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue