diff --git a/pc4mobx/hrmSalary/components/FormInfo/index.js b/pc4mobx/hrmSalary/components/FormInfo/index.js new file mode 100644 index 00000000..5c14f828 --- /dev/null +++ b/pc4mobx/hrmSalary/components/FormInfo/index.js @@ -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 = { + field.checkboxValue = v === "1"; + onSelectedChangeHandle && onSelectedChangeHandle(field, v); + }}/>; + let coms; + if (customerRender == null) { + coms = ; + } 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: ({coms}), + col + }); + + if (childrenComponents && childrenComponents[field.domkey[0]]) { + childrenComponents[field.domkey[0]]().map(child => formItems.push(child)); + } + }); + + groupArr.push(); + }); + return groupArr; + }; + + render() { + const { formFields, className } = this.props; + if (formFields == null) return (
); + return ( +
+ {this.renderForm()} +
+ ); + } +} diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/index.less b/pc4mobx/hrmSalary/pages/dataAcquisition/index.less index 8b4093da..4d41fa25 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/index.less +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/index.less @@ -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 { diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js index 354ae423..c94c8d56 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js @@ -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: "数据采集", diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/detailSettingsDialog.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/detailSettingsDialog.js new file mode 100644 index 00000000..882a02b4 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/detailSettingsDialog.js @@ -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 ( + {getLabel(111, "确定")}, + + ]} + > +
+
+ ); + } +} + +export default DetailSettingsDialog; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js index 8f786982..424fa876 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js @@ -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) && + this.setState({ taxSetDialog: { visible: true, dataType: getKey(o), id: editId.id } })}> + + })) }; } @@ -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} /> + this.setState({ taxSetDialog: { ...taxSetDialog, visible: false } })}/> ); } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/taxSetDialog.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/taxSetDialog.js new file mode 100644 index 00000000..d6a51576 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/taxSetDialog.js @@ -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 ( + this.taxSetRef = dom} + title={getLabel(111, "数据采集明细")} + buttons={[ + , + + ]} + style={{ + width: "60vw", height: 600, minHeight: 200, minWidth: 380, + maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" + }}> +
+ +
+ this.setState({ + detailSettingsDialog: { ...detailSettingsDialog, visible: true } + })}/> + +
+ + this.setState({ + detailSettingsDialog: { ...detailSettingsDialog, visible: false } + })}/> +
+
+
+ ); + } +} + +export default TaxSetDialog; diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.less b/pc4mobx/hrmSalary/pages/salaryItem/index.less index cf539484..cdefaef7 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.less +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.less @@ -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; } } diff --git a/pc4mobx/hrmSalary/util/index.js b/pc4mobx/hrmSalary/util/index.js index 6cffca28..46b6ac16 100644 --- a/pc4mobx/hrmSalary/util/index.js +++ b/pc4mobx/hrmSalary/util/index.js @@ -44,6 +44,7 @@ export const getSearchs = (form, condition, col, isCenter, onChange = () => void className={(fields.domkey[0] === "subcompanyName" || fields.domkey[0] === "departmentName") ? "hideFormItem" : classnames} > + {fields.extraDom} { fields.helpfulTitle &&