diff --git a/pc4mobx/hrmSalary/apis/sysconfig.js b/pc4mobx/hrmSalary/apis/sysconfig.js new file mode 100644 index 00000000..d98dc045 --- /dev/null +++ b/pc4mobx/hrmSalary/apis/sysconfig.js @@ -0,0 +1,10 @@ +export const getSysList = params => { + return fetch('/api/bs/hrmsalary/sys/list', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }).then(res => res.json()) +}; diff --git a/pc4mobx/hrmSalary/components/customForm/index.js b/pc4mobx/hrmSalary/components/customForm/index.js index 00c25613..d98bb96b 100644 --- a/pc4mobx/hrmSalary/components/customForm/index.js +++ b/pc4mobx/hrmSalary/components/customForm/index.js @@ -1,64 +1,63 @@ -import React from 'react' -import { Checkbox, Radio, Row, Col } from "antd" -import { WeaInput } from "ecCom" -import RequiredLabelTip from '../requiredLabelTip'; -const CheckboxGroup = Checkbox.Group; +import React from "react"; +import { Col, Row } from "antd"; +import { WeaInput, WeaSelect } from "ecCom"; + export default class CustomForm extends React.Component { - handleChange(params) { - let request = {...this.props.request, ...params} - this.props.onChange(request); - } + handleChange(params) { + let request = { ...this.props.request, ...params }; + this.props.onChange(request); + } - render() { - const { request, disable } = this.props; - return ( -
- { - this.props.condition.map(item => { - let disabledValue = disable && disable.indexOf(item.domkey[0]) >= 0 - return ( - - - {item.label} { - item.rules == "required" && - } : - - - { - item.conditionType == "INPUT" && - { -this.handleChange({[item.domkey[0]]: value}) -}}/> - } + render() { + const { request, disable } = this.props; + return ( +
+ { + this.props.condition.map(item => { + let disabledValue = disable && disable.indexOf(item.domkey[0]) >= 0; + return ( + + + {item.label}: + + + { + item.conditionType == "INPUT" && + { + this.handleChange({ [item.domkey[0]]: value }); + }}/> + } - { - item.conditionType == "RADIO" && item.options && - this.handleChange({[item.domkey[0]]: e.target.value})}> - { - item.options.map(o => ( - {o.showname} - )) - } - - } + { + item.conditionType == "RADIO" && item.options && + this.handleChange({ [item.domkey[0]]: value })} + options={item.options.map(o => ({ showname: o.showname, key: o.key }))} + /> + } - { - item.conditionType == "CHECKBOX" && - item.options && - ({label: o.showname, value: o.key}))} onChange={(value) => this.handleChange({[item.domkey[0]]: value}) }/> - } - - - ) - }) - } - -
- ) - } -} \ No newline at end of file + { + item.conditionType == "CHECKBOX" && + item.options && + ({ showname: o.showname, key: o.key }))} + onChange={(value) => this.handleChange({ [item.domkey[0]]: value })}/> + } + +
+ ); + }) + } +
+ ); + } +} diff --git a/pc4mobx/hrmSalary/components/importModal/index.less b/pc4mobx/hrmSalary/components/importModal/index.less index e55d83b8..d472ab37 100644 --- a/pc4mobx/hrmSalary/components/importModal/index.less +++ b/pc4mobx/hrmSalary/components/importModal/index.less @@ -1,7 +1,16 @@ -.importModalWrapper{ - .wea-dialog-body{ +.importModalWrapper { + .wea-dialog-body { height: 80vh; overflow: hidden auto; padding: 16px; } + + .wea-select, .ant-select, .ant-select-selection { + width: 100%; + } + + .ant-select-selection { + height: 30px; + border-radius: 0; + } } diff --git a/pc4mobx/hrmSalary/components/smallTab/index.js b/pc4mobx/hrmSalary/components/smallTab/index.js index 1555abe2..0616a34e 100644 --- a/pc4mobx/hrmSalary/components/smallTab/index.js +++ b/pc4mobx/hrmSalary/components/smallTab/index.js @@ -1,26 +1,27 @@ -import React from 'react' -import "./index.less" +import React from "react"; +import "./index.less"; export default class SmallTab extends React.Component { - constructor(props) { - super(props) - this.state = { - selectedItem: this.props.items[0] - } - } + constructor(props) { + super(props); + this.state = { + selectedItem: this.props.items[0] + }; + } - render() { - const { selectedItem } = this.state - return ( -
- { - this.props.items.map(item => ( - { -this.setState({selectedItem: item}); this.props.onChange(item) -}}>{item.title} - )) - } -
- ) - } -} \ No newline at end of file + render() { + const { selectedItem } = this.state; + return ( +
+ { + this.props.items.map(item => ( + { + this.setState({ selectedItem: item }); + this.props.onChange(item); + }}>{item.title} + )) + } +
+ ); + } +} diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js index d221d764..d583a401 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js @@ -1,262 +1,266 @@ -import React from 'react' -import { Button, Table } from "antd" -import { WeaInputSearch, WeaCheckbox, WeaTable } from 'ecCom' -import { mergeDetailColumns, dataSource } from './columns' -import { getQueryString } from '../../util/url' -import CustomTab from '../../components/customTab' -import { inject, observer } from 'mobx-react'; -import CompareDetailImportModal from './compareDetailImportModal' -import CustomTable from '../../components/customTable' -import CustomPaginationTable from '../../components/customPaginationTable' +import React from "react"; +import { Button } from "antd"; +import { WeaCheckbox, WeaInputSearch } from "ecCom"; +import { getQueryString } from "../../util/url"; +import CustomTab from "../../components/customTab"; +import { inject, observer } from "mobx-react"; +import CompareDetailImportModal from "./compareDetailImportModal"; +import CustomPaginationTable from "../../components/customPaginationTable"; -@inject('calculateStore') +@inject("calculateStore") @observer export default class CompareDetail extends React.Component { - constructor(props) { - super(props) - this.id = "" - this.state = { - onlyDiffEmployee: true, - onlyDiffSalaryItem: true, - importModalVisible: false, - searchValue: "" - } - this.pageInfo = {current: 1, pageSize: 10} + constructor(props) { + super(props); + this.id = ""; + this.state = { + onlyDiffEmployee: true, + onlyDiffSalaryItem: true, + importModalVisible: false, + searchValue: "" + }; + this.pageInfo = { current: 1, pageSize: 10 }; + } + + componentWillMount() { + let id = getQueryString("id"); + this.id = id; + + const { calculateStore: { fetchComparisonResultList } } = this.props; + const { onlyDiffEmployee, onlyDiffSalaryItem } = this.state; + let params = { + onlyDiffEmployee, + onlyDiffSalaryItem, + salaryAcctRecordId: this.id, + current: 1 + }; + fetchComparisonResultList(params); + } + + // 计算差值 + calculateCompares(systemValue, excelValue) { + if (systemValue == null || excelValue == null) { + return ""; } - - componentWillMount() { - let id = getQueryString("id"); - this.id = id; - - const { calculateStore: {fetchComparisonResultList}} = this.props; - const { onlyDiffEmployee, onlyDiffSalaryItem} = this.state; - let params = { - onlyDiffEmployee, - onlyDiffSalaryItem, - salaryAcctRecordId: this.id, - current: 1 - } - fetchComparisonResultList(params) + let systemNum = Number(systemValue); + let excelNum = Number(excelValue); + if (!isNaN(systemNum) || !isNaN(excelNum)) { // 数字 + return systemNum - excelNum; } + return ""; + } - // 计算差值 - calculateCompares(systemValue, excelValue) { - if(systemValue == null || excelValue == null) { - return "" - } - let systemNum = Number(systemValue) - let excelNum = Number(excelValue) - if (!isNaN(systemNum) || !isNaN(excelNum)) { // 数字 - return systemNum - excelNum - } - return "" - } - - getColumns(columns) { - let newColumns = [...columns] - newColumns.map(item => { - let n = Number(item.dataIndex) - if (!isNaN(n)) { // 数字 - item.render = (text, record) => { - return ( -
-
系统值:{record[item.dataIndex].acctResultValue}
-
线下值:{record[item.dataIndex].excelResultValue}
-
差值:{this.calculateCompares(record[item.dataIndex].acctResultValue, record[item.dataIndex].excelResultValue)}
-
- ) - } - } - }) - return newColumns - } - - // 导入 - handleImportClick() { - this.setState({ - importModalVisible: true - }) - } - - // 分页变化 - handleDataPageChange(value) { - const { calculateStore: {fetchComparisonResultList}} = this.props; - const { onlyDiffEmployee, onlyDiffSalaryItem} = this.state; - - let params = { - onlyDiffEmployee, - onlyDiffSalaryItem, - salaryAcctRecordId: this.id, - current: value, - ...this.pageInfo - } - fetchComparisonResultList(params) - } - - handleShowSizeChange(pageInfo) { - const { calculateStore: {fetchComparisonResultList}} = this.props; - const { onlyDiffEmployee, onlyDiffSalaryItem} = this.state; - let params = { - onlyDiffEmployee, - onlyDiffSalaryItem, - salaryAcctRecordId: this.id, - ...pageInfo - } - fetchComparisonResultList(params) - } - - // 只显示有差异的人员 变化 - onlyDiffEmployeeChange(value) { - let onlyDiffEmployee = value == 1 ? true : false - this.setState({onlyDiffEmployee}) - - const { calculateStore: {fetchComparisonResultList}} = this.props; - const { onlyDiffSalaryItem} = this.state; - - let params = { - onlyDiffEmployee, - onlyDiffSalaryItem, - salaryAcctRecordId: this.id, - employeeName: this.state.searchValue, - current: 1 - } - - fetchComparisonResultList(params) - } - - // 只显示有差异的薪资项目 变化 - onlyDiffSalaryItemChange(value) { - let onlyDiffSalaryItem = value == 1 ? true : false - this.setState({onlyDiffSalaryItem}) - const { calculateStore: {fetchComparisonResultList}} = this.props; - const { onlyDiffEmployee} = this.state; - let params = { - onlyDiffEmployee, - onlyDiffSalaryItem, - salaryAcctRecordId: this.id, - employeeName: this.state.searchValue, - current: 1 - } - fetchComparisonResultList(params) - } - - // 搜索 - handleSearch(value) { - const { calculateStore: {fetchComparisonResultList}} = this.props; - const { onlyDiffEmployee, onlyDiffSalaryItem } = this.state - let params = { - onlyDiffEmployee, - onlyDiffSalaryItem, - salaryAcctRecordId: this.id, - employeeName: value, - current: 1 - } - fetchComparisonResultList(params) - } - - // 导出 - handleExportClick() { - const { calculateStore: {exportComparisonResult}} = this.props; - exportComparisonResult(this.id) - } - - // 线下对比导入 - handleComparisonFinish() { - this.pageInfo.current = 1 - this.pageInfo.pageSize = 10 - this.handleSearch(this.state.searchValue) - } - - render() { - const { calculateStore: {comparisonResultPageInfo, comparisonResultTableStore, loading, comparisonResultColumns}} = this.props; - const { importModalVisible, searchValue } = this.state; - const renderRightOperation = () => { - return ( -
- - - { -this.setState({ - searchValue: value - }) -}} onSearch={(value) => { -this.handleSearch(value) -}}/> -
- ) - } - - const renderLeftOperation = () => { - return ( -
- { - this.onlyDiffEmployeeChange(value) - }} - /> - { - this.onlyDiffSalaryItemChange(value) - }} - /> -
- ) - } - return ( -
- -
-
- 公式= - 系统值;线下值;差值 -
-
- -
- { - this.pageInfo.current = value - this.handleDataPageChange(value) - }} - onShowSizeChange={(current, pageSize) => { - this.pageInfo = {current, pageSize} - this.handleShowSizeChange(this.pageInfo) - }} - /> -
- - { - importModalVisible && { - this.handleComparisonFinish() - }} - onCancel={() => { - this.setState({ - importModalVisible: false - }) - }} - /> - } - - - + getColumns(columns) { + let newColumns = [...columns]; + newColumns.map(item => { + let n = Number(item.dataIndex); + if (!isNaN(n)) { // 数字 + item.render = (text, record) => { + return ( +
+
系统值:{record[item.dataIndex].acctResultValue}
+
线下值:{record[item.dataIndex].excelResultValue}
+
差值:{this.calculateCompares(record[item.dataIndex].acctResultValue, record[item.dataIndex].excelResultValue)}
- ) - } -} \ No newline at end of file + ); + }; + } + }); + return newColumns; + } + + // 导入 + handleImportClick() { + this.setState({ + importModalVisible: true + }); + } + + // 分页变化 + handleDataPageChange(value) { + const { calculateStore: { fetchComparisonResultList } } = this.props; + const { onlyDiffEmployee, onlyDiffSalaryItem } = this.state; + + let params = { + onlyDiffEmployee, + onlyDiffSalaryItem, + salaryAcctRecordId: this.id, + current: value, + ...this.pageInfo + }; + fetchComparisonResultList(params); + } + + handleShowSizeChange(pageInfo) { + const { calculateStore: { fetchComparisonResultList } } = this.props; + const { onlyDiffEmployee, onlyDiffSalaryItem } = this.state; + let params = { + onlyDiffEmployee, + onlyDiffSalaryItem, + salaryAcctRecordId: this.id, + ...pageInfo + }; + fetchComparisonResultList(params); + } + + // 只显示有差异的人员 变化 + onlyDiffEmployeeChange(value) { + let onlyDiffEmployee = value == 1 ? true : false; + this.setState({ onlyDiffEmployee }); + + const { calculateStore: { fetchComparisonResultList } } = this.props; + const { onlyDiffSalaryItem } = this.state; + + let params = { + onlyDiffEmployee, + onlyDiffSalaryItem, + salaryAcctRecordId: this.id, + employeeName: this.state.searchValue, + current: 1 + }; + + fetchComparisonResultList(params); + } + + // 只显示有差异的薪资项目 变化 + onlyDiffSalaryItemChange(value) { + let onlyDiffSalaryItem = value == 1 ? true : false; + this.setState({ onlyDiffSalaryItem }); + const { calculateStore: { fetchComparisonResultList } } = this.props; + const { onlyDiffEmployee } = this.state; + let params = { + onlyDiffEmployee, + onlyDiffSalaryItem, + salaryAcctRecordId: this.id, + employeeName: this.state.searchValue, + current: 1 + }; + fetchComparisonResultList(params); + } + + // 搜索 + handleSearch(value) { + const { calculateStore: { fetchComparisonResultList } } = this.props; + const { onlyDiffEmployee, onlyDiffSalaryItem } = this.state; + let params = { + onlyDiffEmployee, + onlyDiffSalaryItem, + salaryAcctRecordId: this.id, + employeeName: value, + current: 1 + }; + fetchComparisonResultList(params); + } + + // 导出 + handleExportClick() { + window.open( + '/api/bs/hrmsalary/salaryacct/comparisonresult/export?salaryAcctRecordId=' + this.id + ); + } + + // 线下对比导入 + handleComparisonFinish() { + this.pageInfo.current = 1; + this.pageInfo.pageSize = 10; + this.handleSearch(this.state.searchValue); + } + + render() { + const { + calculateStore: { + comparisonResultPageInfo, + comparisonResultTableStore, + loading, + comparisonResultColumns + } + } = this.props; + const { importModalVisible, searchValue } = this.state; + const renderRightOperation = () => { + return ( +
+ + + { + this.setState({ + searchValue: value + }); + }} onSearch={(value) => { + this.handleSearch(value); + }}/> +
+ ); + }; + + const renderLeftOperation = () => { + return ( +
+ { + this.onlyDiffEmployeeChange(value); + }} + /> + { + this.onlyDiffSalaryItemChange(value); + }} + /> +
+ ); + }; + return ( +
+ +
+
+ 公式= + 系统值;线下值;差值 +
+
+ +
+ { + this.pageInfo.current = value; + this.handleDataPageChange(value); + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = { current, pageSize }; + this.handleShowSizeChange(this.pageInfo); + }} + /> +
+ + { + importModalVisible && { + this.handleComparisonFinish(); + }} + onCancel={() => { + this.setState({ + importModalVisible: false + }); + }} + /> + } +
+ ); + } +} diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/compareDetailImportModal.js b/pc4mobx/hrmSalary/pages/calculateDetail/compareDetailImportModal.js index db961055..1439fc20 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/compareDetailImportModal.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/compareDetailImportModal.js @@ -1,85 +1,98 @@ -import React from 'react' -import ImportModal from '../../components/importModal' -import { inject, observer } from 'mobx-react'; +import React from "react"; +import ImportModal from "../../components/importModal"; +import { inject, observer } from "mobx-react"; -@inject('calculateStore') +@inject("calculateStore") @observer export default class CompareDetailImportModal extends React.Component { - constructor(props) { - super(props) - this.state = { - step: 0, - modalParam: { - salaryAcctRecordId: "" - } + constructor(props) { + super(props); + this.state = { + step: 0, + modalParam: { + salaryAcctRecordId: "" + } + }; + } + + componentWillMount() { + const { id } = this.props; + let modalParam = { ...this.state.modalParam }; + modalParam.salaryAcctRecordId = id; + this.setState({ + modalParam + }); + } + + // 设置步骤 + setStep(step) { + this.setState({ step }); + } + + handleTemplateLink() { + window.open( + "/api/bs/hrmsalary/salaryacct/comparisonresult/importtemplate/export?salaryAcctRecordId=" + this.props.id + ); + } + + // 初始化导入参数 + handleInitImportModal() { + const { + calculateStore: { + setComparisonPreviewColumns, + setComparisonPreviewDataSource, + setComparisonImportAcctResult + } + } = this.props; + setComparisonPreviewColumns([]); + setComparisonPreviewDataSource([]); + setComparisonImportAcctResult({}); + } + + render() { + const { visiable } = this.props; + const { step, modalParam } = this.state; + const { calculateStore } = this.props; + const { + previewComparisonResult, + comparisonPreviewColumns, + comparisonPreviewDataSource, + importComparisonExcelAcctResult, + comparisonImportAcctResult + } = calculateStore; + return ( +
+ { + visiable && { + this.handleInitImportModal(); + }} + params={modalParam} + columns={comparisonPreviewColumns} + step={step} + setStep={this.setStep.bind(this)} + slideDataSource={comparisonPreviewDataSource} + importResult={comparisonImportAcctResult} + onFinish={() => { + this.props.onCancel(); + this.props.onFinish(); + }} + previewImport={(params) => { + previewComparisonResult(params); + }} + importFile={(params) => { + importComparisonExcelAcctResult(params); + }} + templateLink={() => { + this.handleTemplateLink(); + }} + visiable={visiable} + onCancel={() => { + this.props.onCancel(); + }} + /> } - } - - componentWillMount() { - const { id } = this.props; - let modalParam = { ...this.state.modalParam } - modalParam.salaryAcctRecordId = id - this.setState({ - modalParam - }) - } - - // 设置步骤 - setStep(step) { - this.setState({step}) - } - - handleTemplateLink() { - const { calculateStore: { exportImportTemplate }} = this.props; - exportImportTemplate(this.props.id) - } - - // 初始化导入参数 - handleInitImportModal() { - const { calculateStore: {setComparisonPreviewColumns, setComparisonPreviewDataSource, setComparisonImportAcctResult}} = this.props; - setComparisonPreviewColumns([]) - setComparisonPreviewDataSource([]) - setComparisonImportAcctResult({}) - } - - render() { - const { visiable } = this.props; - const { step, modalParam } = this.state; - const { calculateStore } = this.props - const { previewComparisonResult, comparisonPreviewColumns, comparisonPreviewDataSource, importComparisonExcelAcctResult, comparisonImportAcctResult } = calculateStore - return ( -
- { - visiable && { - this.handleInitImportModal() - }} - params={modalParam} - columns={comparisonPreviewColumns} - step={step} - setStep={this.setStep.bind(this)} - slideDataSource={comparisonPreviewDataSource} - importResult={comparisonImportAcctResult} - onFinish={() => { - this.props.onCancel(); - this.props.onFinish(); - }} - previewImport={(params) => { -previewComparisonResult(params) -}} - importFile={(params) => { -importComparisonExcelAcctResult(params) -}} - templateLink={ () => { - this.handleTemplateLink() -}} - visiable={visiable} - onCancel={() => { - this.props.onCancel() -}} - /> - } -
- ) - } -} \ No newline at end of file +
+ ); + } +} diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/editSalaryDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/editSalaryDetail.js index ccc8f6c9..385fa87b 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/editSalaryDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/editSalaryDetail.js @@ -1,132 +1,157 @@ -import React from 'react' -import { WeaHelpfulTip, WeaInput } from "ecCom" -import { Row, Col } from 'antd' -import { inject, observer } from 'mobx-react'; -import "./index.less" +import React from "react"; +import { WeaHelpfulTip, WeaInput } from "ecCom"; +import { Col, Row } from "antd"; +import { inject, observer } from "mobx-react"; +import cs from "classnames"; +import "./index.less"; -@inject('calculateStore') +@inject("calculateStore") @observer export default class EditSalaryDetail extends React.Component { - componentWillMount() { - const { calculateStore: {acctresultDetail}} = this.props; - acctresultDetail(this.props.id) - } + componentWillMount() { + const { calculateStore: { acctresultDetail } } = this.props; + acctresultDetail(this.props.id); + } - handleItemValueChange(field, value, isInput) { - const { calculateStore: { acctresultDetailForm, setAcctresultDetailForm }} = this.props; - let form = {...acctresultDetailForm} - if(isInput) { - form.inputItems = acctresultDetailForm.inputItems.map(item => { - item = {...item} - if(item.salaryItemName == field) { - item.resultValue = value - } - return item; - }) - } else { - form.formulaItems = acctresultDetailForm.formulaItems.map(item => { - item = {...item} - if(item.salaryItemName == field) { - item.resultValue = value - } - return item; - }) + handleItemValueChange(field, value, isInput) { + const { calculateStore: { acctresultDetailForm, setAcctresultDetailForm } } = this.props; + let form = { ...acctresultDetailForm }; + if (isInput) { + form.inputItems = acctresultDetailForm.inputItems.map(item => { + item = { ...item }; + if (item.salaryItemName == field) { + item.resultValue = value; } - setAcctresultDetailForm(form) + return item; + }); + } else { + form.formulaItems = acctresultDetailForm.formulaItems.map(item => { + item = { ...item }; + if (item.salaryItemName == field) { + item.resultValue = value; + } + return item; + }); } + setAcctresultDetailForm(form); + } + + renderTableTr = (data, isInput) => { + const tables = []; + const len = data.length; + const rowNum = 3; + const sumRows = len % rowNum; + const sumRowMod = len / rowNum; + const rows = (sumRows == 0 ? sumRowMod : sumRowMod + 1); + for (let j = 0; j < rows; j++) { + let iLen = (j + 1) * rowNum; + iLen = iLen > len ? len : iLen; + tables.push(""); + for (let i = j * rowNum; i < iLen; i++) { + if (!isInput) { + const label = data[i].fieldName; + const value = data[i].fieldValue || "-"; + tables.push("" + label + "" + "" + value + ""); + } + } + tables.push(""); + } + return tables; + }; - render() { - const { calculateStore: { acctresultDetailForm }} = this.props; - return ( -
-
-
- 基本信息 - -
+ render() { + const { calculateStore: { acctresultDetailForm } } = this.props; + return ( +
+
+
+ 基本信息 + +
-
- - { - acctresultDetailForm.employeeInfos && acctresultDetailForm.employeeInfos.map(item => { - return ( - - - {item.fieldName} - {item.fieldValue} - - - ) - }) - } +
+ { + !_.isEmpty(acctresultDetailForm.employeeInfos) && + + } + + + +
+
+ 输入项 +
+ + { + acctresultDetailForm.inputItems && acctresultDetailForm.inputItems.map((item, index) => { + const len = acctresultDetailForm.inputItems.length; + return ( +
+ + {item.salaryItemName} + { + this.handleItemValueChange(item.salaryItemName, value, true); + }}/> - - - -
-
- 输入项 -
- -
- - { - acctresultDetailForm.inputItems && acctresultDetailForm.inputItems.map(item => { - return ( -
- - {item.salaryItemName} - { - this.handleItemValueChange(item.salaryItemName, value, true) - }}/> - - - ) - }) - } - - - - - - -
-
- 公式项 - -
- -
- - { - acctresultDetailForm.formulaItems && acctresultDetailForm.formulaItems.map(item => { - return ( -
- - {item.salaryItemName} - { - this.handleItemValueChange(item.salaryItemName, value, false) - }}/> - - - ) - }) - } - - - + + ); + }) + } + - ) - } + + + + +
+
+ + 公式项 + + +
+ + { + acctresultDetailForm.formulaItems && acctresultDetailForm.formulaItems.map((item, index) => { + const len = acctresultDetailForm.formulaItems.length; + return ( +
+ + {item.salaryItemName} + { + this.handleItemValueChange(item.salaryItemName, value, false); + }}/> + + + ); + }) + } + + + + + + ); + } } diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/index.js b/pc4mobx/hrmSalary/pages/calculateDetail/index.js index cbe8bab7..de8d75f1 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/index.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/index.js @@ -197,8 +197,9 @@ export default class CalculateDetail extends React.Component { this.id ); } else if (e.key == "3") { - const { calculateStore: { exportAll } } = this.props; - exportAll(this.id); + window.open( + '/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=' + this.id +"&ids=" + ); } }; @@ -248,11 +249,10 @@ export default class CalculateDetail extends React.Component { return [ , - + 更多 ]; diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/index.less b/pc4mobx/hrmSalary/pages/calculateDetail/index.less index 83d4da63..8bb981ce 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/index.less +++ b/pc4mobx/hrmSalary/pages/calculateDetail/index.less @@ -16,9 +16,11 @@ display: flex; align-items: center; justify-content: space-between; - .wea-tab{ - border-bottom: none!important; + + .wea-tab { + border-bottom: none !important; } + .crumbsWrapper { display: inline-block; @@ -34,15 +36,19 @@ .crumbsOperateWrapper { flex: 1; - .wea-advanced-search{ - right: 0!important; + + .wea-advanced-search { + right: 0 !important; } - .wea-advanced-searchsAd{ - height: inherit!important; + + .wea-advanced-searchsAd { + height: inherit !important; } - .wea-search-tab{ + + .wea-search-tab { padding-right: 0; - .iconItem{ + + .iconItem { color: #2db7f5; cursor: pointer; } @@ -76,9 +82,9 @@ } } - .editSalaryDetail { padding: 20px; + padding-bottom: 40px; .detailItemWrapper { .itemTitle { @@ -89,6 +95,73 @@ .itemContent { margin-top: 10px; + + table { + table-layout: fixed; + border-collapse: collapse; + width: 100%; + border: 1px solid rgba(0, 0, 0, .06); + + .descriptions-row { + .descriptions-item-label { + background-color: #fafafa; + padding: 12px 6px; + color: #000000d9; + font-weight: 400; + font-size: 12px; + line-height: 1.5715; + text-align: start; + border: 1px solid rgba(0, 0, 0, .06); + min-width: 100px; + max-width: 100px; + } + + .descriptions-item-content { + padding: 12px 6px; + display: table-cell; + flex: 1; + color: #000000d9; + font-size: 12px; + line-height: 1.5715; + word-break: break-word; + overflow-wrap: break-word; + border-collapse: collapse; + border: 1px solid rgba(0, 0, 0, .06); + } + } + } + + & > .ant-row { + border: 1px solid rgba(0, 0, 0, .06); + } + + .itemLabel { + background-color: #fafafa; + padding: 12px 6px; + height: 45px; + display: flex; + align-items: center; + justify-content: flex-start; + border-right: 1px solid rgba(0, 0, 0, .06); + border-bottom: 1px solid rgba(0, 0, 0, .06); + } + + .borderB-none { + border-bottom: none !important; + } + + .borderR-none { + border-right: none !important; + } + + .itemValue { + padding: 12px 6px; + display: flex; + align-items: center; + height: 45px; + border-right: 1px solid rgba(0, 0, 0, .06); + border-bottom: 1px solid rgba(0, 0, 0, .06); + } } } @@ -98,13 +171,13 @@ } .placeOnFileDetail { - padding: 20px; height: 100%; - overflow-y: scroll; + overflow-y: auto; .tabWrapper { height: 47px; line-height: 47px; + padding-left: 16px; } .tableWrapper { @@ -145,9 +218,13 @@ } .compareDetail { - overflow-y: scroll; + overflow-y: auto; height: 100%; - padding: 20px; + + .tabWrapper { + align-items: center; + padding-left: 10px; + } .titleBarWrapper { height: 47px; @@ -156,9 +233,43 @@ .rightTitle { float: right; } + + .titleBar { + padding-right: 10px; + } } .tableWrapper { margin-top: 10px; } } + +.slideOuterWrapper { + .wea-slide-modal-title { + height: initial; + line-height: initial; + text-align: left; + } + + .rodal-close { + z-index: 99; + top: 10px !important; + } + +} + +@media (min-width: 1260px) { + .slideOuterWrapper { + .reqTopWrapper .wea-new-top-req-title > div:first-child > div { + max-width: 100% !important; + } + } +} + +@media screen and (min-width: 1060px) and (max-width: 1260px) { + .slideOuterWrapper { + .reqTopWrapper .wea-new-top-req-title > div:first-child > div { + max-width: calc(100% - 96px) !important; + } + } +} diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js index c0cd6fb1..e17ef734 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js @@ -1,12 +1,12 @@ import React from "react"; import { WeaHelpfulTip, WeaSlideModal } from "ecCom"; import WarningModal from "./warningModal"; -import "./index.less"; import EditSalaryDetail from "./editSalaryDetail"; import SlideModalTitle from "../../components/slideModalTitle"; import { getQueryString } from "../../util/url"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; +import "./index.less"; @inject("calculateStore", "taxAgentStore") @observer @@ -156,6 +156,7 @@ export default class SalaryDetail extends React.Component { { slideVisiable && {this.state.inited && - } + }}/>} { this.props.onCancel(); }} + initLoadCss + className="associatesWrapper" style={{ width: 600 }} title="关联人员" buttons={[ @@ -92,16 +94,12 @@ export default class AddUserModal extends React.Component { 重置 ]}> -
+
-
- 对象类型 - - + 对象类型:-
+
{ @@ -113,6 +111,7 @@ export default class AddUserModal extends React.Component { {this.state.selectedKey == "EMPLOYEE" && ( -
- 选择员工状态 - - + 选择员工状态:- this.onRadioChange(e)} - value={this.state.radioValue}> - 全部 - 在职 - 离职 - + value={this.state.radioValue} + options={ + [ + { key: "", showname: "" }, + { key: "ALL", showname: "全部" }, + { key: "NORMAL", showname: "在职" }, + { key: "UNAVAILABLE", showname: "离职" } + ] + } + /> diff --git a/pc4mobx/hrmSalary/pages/ledger/copyFormModal.js b/pc4mobx/hrmSalary/pages/ledger/copyFormModal.js index 4516f676..69e28d14 100644 --- a/pc4mobx/hrmSalary/pages/ledger/copyFormModal.js +++ b/pc4mobx/hrmSalary/pages/ledger/copyFormModal.js @@ -33,6 +33,11 @@ export default class CopyFormModal extends React.Component { ]} > -
+
-
薪资项目 + 薪资项目:{ initedSelect && @@ -125,7 +125,7 @@ export default class RuleEditModal extends React.Component { - 计薪规则 + 计薪规则:
{ item = { ...item }; if (item.dataIndex == "salaryItem") { - item.title = {item.title}; + item.title = {item.title}; item.render = (text, record) => { return ( - this.handleChange({ adjustReason: value })}> - { - salaryItemChangeForm.adjustReasonList && salaryItemChangeForm.adjustReasonList.map(item => ( - - )) + this.handleChange({ adjustReason: value })} + options={ + !_.isEmpty(salaryItemChangeForm.adjustReasonList) ? + [{ key: "", showname: "" }, ...salaryItemChangeForm.adjustReasonList] : [{ + key: "", + showname: "" + }] } - + /> @@ -287,7 +291,7 @@ export default class ChangeSalaryModal extends React.Component {
{ this.state.inited && - + }
diff --git a/pc4mobx/hrmSalary/pages/salaryFile/index.less b/pc4mobx/hrmSalary/pages/salaryFile/index.less index bb87e3e8..4cca6976 100644 --- a/pc4mobx/hrmSalary/pages/salaryFile/index.less +++ b/pc4mobx/hrmSalary/pages/salaryFile/index.less @@ -3,6 +3,17 @@ min-height: 50vh; max-height: 60vh; overflow-y: auto; + .wea-select{ + display: inline-block; + position: relative; + } + .wea-select,.ant-select,.ant-select-selection{ + width: 100%; + } + .ant-select-selection{ + border-radius: 0; + height: 30px; + } .changeSalaryModal { padding: 10px 20px; diff --git a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js index 619db8ac..40210edd 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js @@ -1,12 +1,8 @@ import React from "react"; -import { Row, Col, Switch, Radio } from "antd"; -import { WeaHelpfulTip, WeaSelect, WeaTextarea, WeaInput } from "ecCom"; +import { Col, Radio, Row, Switch } from "antd"; +import { WeaHelpfulTip, WeaInput, WeaSelect, WeaTextarea } from "ecCom"; import "./index.less"; -import { - roundingModeOptions, - patternOptions, - dataTypeOptions -} from "./options"; +import { dataTypeOptions, patternOptions, roundingModeOptions } from "./options"; import RequiredLabelTip from "../../components/requiredLabelTip"; import FormalFormModal from "./formalFormModal"; @@ -55,13 +51,11 @@ export default class CustomSalaryItemSlide extends React.Component {
-
- 名称 - + 名称 { @@ -119,13 +113,12 @@ export default class CustomSalaryItemSlide extends React.Component { - - 字段类型 - + 字段类型 { this.handleChange({ dataType: value }); @@ -139,13 +132,11 @@ export default class CustomSalaryItemSlide extends React.Component { - - 舍入规则 - + 舍入规则 - - 保留小数位 - + 保留小数位 { @@ -180,37 +169,31 @@ export default class CustomSalaryItemSlide extends React.Component { - - 取值方式 - + 取值方式- { + viewAttr={3} + detailtype={3} + options={[ + {key: "1", showname: "输入"}, + {key: "2", showname: "公式"}, + {key: "3", showname: "SQL"} + ]} + onChange={value => { this.handleChange({ - valueType: e.target.value, + valueType: value, formulaId: null, formulaContent: "" }); - }}> - - 输入 - - - 公式 - - - SQL - - + }}/> {(valueType == 2 || valueType == 3) && {valueType == 2 ? "公式" : "SQL"} - - 缴纳类型 + 缴纳类型 { let requestParams = { ...this.props.requestParams }; @@ -218,10 +223,12 @@ export default class DefaultSlideForm extends React.Component { - 方案名称 + 方案名称 { let requestParams = { ...this.props.requestParams }; @@ -250,10 +257,11 @@ export default class DefaultSlideForm extends React.Component { { this.props.requestParams.sharedType === "1" && - 可见性范围 + 可见性范围备注 { let requestParams = { ...this.props.requestParams }; @@ -296,12 +305,12 @@ export default class DefaultSlideForm extends React.Component {
{this.state.selectItem == "个人" - ?
- :
div:first-child>div{ - max-width: 100%!important; - } +@media (min-width: 1260px) { + .slideOuterWrapper { + .reqTopWrapper .wea-new-top-req-title > div:first-child > div { + max-width: 100% !important; } + } } + @media screen and (min-width: 1060px) and (max-width: 1260px) { - .slideOuterWrapper{ - .reqTopWrapper .wea-new-top-req-title>div:first-child>div{ - max-width: calc(100% - 96px)!important; - } + .slideOuterWrapper { + .reqTopWrapper .wea-new-top-req-title > div:first-child > div { + max-width: calc(100% - 96px) !important; } + } } diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/accountDialog.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/accountDialog.js index 9873fb89..f93b6684 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/accountDialog.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/accountDialog.js @@ -7,6 +7,7 @@ import React, { Component } from "react"; import { Button, Form, Input } from "antd"; import { WeaDatePicker, WeaDialog, WeaSelect } from "ecCom"; +import "./index.less"; const createForm = Form.create; const FormItem = Form.Item; @@ -27,6 +28,7 @@ class Accountdialog extends Component { onOk(values); }); }; + render() { const { getFieldProps } = this.props.form; const formItemLayout = { @@ -37,6 +39,8 @@ class Accountdialog extends Component { ]}>
- + , - iconBgcolor: "lightblue", - loading: false, - selectedKey: "main", - selectArray: [ - { key: 200, selected: true, showname: "200" }, - { key: 100, selected: false, showname: "100" } - ], - childComCont: "子组件内容" + scrollHeight: "", + dataSource: [], + columns: [], + pageInfo: { + current: 1, + pageSize: 10, + total: 10 + } }; } + componentDidMount() { + this.getSysList(); + } + + getSysList = () => { + const { pageInfo } = this.state; + const payload = { + ...pageInfo + }; + API.getSysList(payload).then(({ status, data }) => { + if (status && !_.isEmpty(data)) { + const { columns, list: dataSource, total, pageSize, pageNum: current } = data; + this.setState({ + columns, + dataSource, + pageInfo: { ...pageInfo, total, pageSize, current } + }); + } + }); + }; + render() { - const { - title, - icon, - iconBgcolor, - loading, - selectedKey, - selectArray, - childComCont, - visible - } = this.state; - const btns = [ - , - - ]; - const dropMenuDatas = [ - { - key: 1, - disabled: loading, - icon: , - content: "搜索" + const { dataSource, columns, pageInfo, scrollHeight } = this.state; + const pagination = { + total: pageInfo.total, + showTotal: total => `共 ${total} 条`, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + console.log(current, pageSize); + }, + onChange: current => { + console.log(current); } - ]; - const tabs = [ - { - key: "main", - title: "主页" - }, - { - key: "detail", - title: "详情" - }, - { - key: "detail1", - title: "详情1" - }, - { - key: "detail2", - title: "详情2" - }, - { - key: "detail3", - title: "详情3" - }, - { - key: "detail4", - title: "详情4" - }, - { - key: "detail5", - title: "详情5" - }, - { - key: "detail6", - title: "详情6" - }, - { - key: "detail7", - title: "详情7" - }, - { - key: "detail8", - title: "详情8" - } - ]; + }; return ( -
- - this.setState({ visible: false })} - visible={visible} - style={{ width: 800, height: 600 }} - hasScroll - > - { - this.setState({ - selectedKey: key, - childComCont: "你选择了 " + key + " tab页" - }); - }} - > -
{childComCont}
-
-
+
+
); } - - onDropMenuClick(key) { - console.log(`点击了下拉菜单的第${key}项`); - } - - dosubmit() { - console.log("点击了提交"); - } } diff --git a/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js b/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js index 5fddf07a..78b03a8e 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js @@ -10,9 +10,7 @@ import { inject, observer } from "mobx-react"; import SlideTaxagentUser from "./slideTaxagentUser"; import "./index.less"; -const personScopeWarrper = { - padding: "0 25px" -}; +const personScopeWarrper = {}; @inject("taxAgentStore", "ledgerStore") @observer diff --git a/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js b/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js index 6f570de2..5fa35cf0 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js @@ -1,6 +1,6 @@ import React from "react"; -import { Button, message, Table } from "antd"; -import { WeaInputSearch } from "ecCom"; +import { Button, message } from "antd"; +import { WeaInputSearch, WeaTable } from "ecCom"; import AddTaxAgentModal from "./addTaxAgentModal"; export default class SlideTaxagentUser extends React.Component { @@ -174,8 +174,8 @@ export default class SlideTaxagentUser extends React.Component { />
-
-
+ { const formParams = form.getFormParams(); let items = []; let group = []; - isFormInit && condition && + isFormInit && condition && condition.map(c =>{ c.items.map(fields => { items.push({ @@ -46,45 +46,6 @@ export const getCustomSearchs = (form, condition, col, isCenter) => { } } -// 渲染form表单: 一般对form的渲染都统一使用该方法 -// export const getSearchs = (form, condition, col, isCenter) => { -// const { isFormInit } = form; -// const formParams = form.getFormParams(); -// let group = []; -// isFormInit && condition && condition.map(c =>{ -// let items = []; -// c.items.map(fields => { -// items.push({ -// com:( -// -// -// ), -// colSpan:1, -// }) -// }); -// group.push( -// ) -// }); -// return group; -// } - // 渲染form表单: 一般对form的渲染都统一使用该方法 export const getSearchs = (form, condition, col, isCenter) => { const { isFormInit } = form; @@ -130,7 +91,7 @@ export const renderLoading = (loading) => ( ) - + // 无权限处理 export const renderNoright = () => ( @@ -147,4 +108,24 @@ export const renderNoData = () => ( 暂无数据 -) \ No newline at end of file +) + +//动态计算表格高度 +export function getTableScroll({ extraHeight, id }) { + if (typeof extraHeight == "undefined") { + // 默认底部分页64 + 边距10 + extraHeight = 64 + } + let tHeader = null + if (id) { + tHeader = document.getElementById(id) ? document.getElementById(id).getElementsByClassName("ant-table-thead")[0] : null + } else { + tHeader = document.getElementsByClassName("ant-table-thead")[0] + } + //表格内容距离顶部的距离 + let tHeaderBottom = 0 + if (tHeader) { + tHeaderBottom = tHeader.getBoundingClientRect().bottom + } + return `calc(100vh - ${tHeaderBottom + extraHeight}px)` +}