From e243085a0d338c6291a5cd45da41ca37492e511c Mon Sep 17 00:00:00 2001 From: liyongshun <971387674@qq.com> Date: Thu, 4 Aug 2022 17:07:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=98=E5=B7=A5=E7=A6=8F=E5=88=A9=E6=A1=A3?= =?UTF-8?q?=E6=A1=88=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=8A=BD=E5=B1=89=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F=E9=87=8D?= =?UTF-8?q?=E6=9E=84=EF=BC=8C=E4=BB=A5=E5=8F=8A=E4=BF=AE=E6=94=B9=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=8F=82=E6=95=B0=E5=9B=9E=E8=B0=83=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/calculate/baseFormModal.js | 228 +++++----- pc4mobx/hrmSalary/pages/calculate/index.less | 8 + .../calculateDetail/placeOnFileDetail.js | 423 +++++++++--------- .../pages/salaryItem/formalFormModal.js | 8 +- pc4mobx/hrmSalary/pages/salaryItem/index.less | 25 +- .../pages/salaryItem/systemSalaryItemModal.js | 132 +++--- .../socialSecurityBenefits/archives/index.js | 8 +- .../archives/index.less | 4 + .../archives/socialSecurityForm.js | 3 +- 9 files changed, 441 insertions(+), 398 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/calculate/index.less diff --git a/pc4mobx/hrmSalary/pages/calculate/baseFormModal.js b/pc4mobx/hrmSalary/pages/calculate/baseFormModal.js index 77fb0dfe..3b85808c 100644 --- a/pc4mobx/hrmSalary/pages/calculate/baseFormModal.js +++ b/pc4mobx/hrmSalary/pages/calculate/baseFormModal.js @@ -1,121 +1,129 @@ -import React from 'react' -import { Modal, Row, Col, Select, message, Button } from 'antd' -import RequiredLabelTip from '../../components/requiredLabelTip' -import { inject, observer } from 'mobx-react'; -import { WeaDatePicker, WeaInput } from 'ecCom' -import { notNull } from '../../util/validate'; +import React from "react"; +import { Button, Col, message, Modal, Row, Select } from "antd"; +import RequiredLabelTip from "../../components/requiredLabelTip"; +import { inject, observer } from "mobx-react"; +import { WeaDatePicker, WeaInput } from "ecCom"; +import { notNull } from "../../util/validate"; +import "./index.less"; + const { Option } = Select; -@inject('calculateStore') +@inject("calculateStore") @observer export default class baseFormModal extends React.Component { - constructor(props) { - super(props) - this.state = { - salaryMonthStr: "", - inited: false, - selectOptions: [], - salarySob: '', - description: "" - } + constructor(props) { + super(props); + this.state = { + salaryMonthStr: "", + inited: false, + selectOptions: [], + salarySob: "", + description: "" + }; + } + + componentWillMount() { + const { calculateStore } = this.props; + const { salaryacctGetForm } = calculateStore; + salaryacctGetForm().then(data => { + this.setState({ + inited: true, + selectOptions: data.salarySobs + }); + }); + } + + handleSelectChange(value) { + this.setState({ + salarySob: value + }); + } + + // 保存回调 + handleSave() { + if (!this.validate()) { + return; } - componentWillMount() { - const { calculateStore } = this.props; - const { salaryacctGetForm } = calculateStore - salaryacctGetForm().then(data => { - this.setState({ - inited: true, - selectOptions: data.salarySobs - }) - }) + let params = { + salaryMonthStr: this.state.salaryMonthStr, + salarySobId: this.state.salarySob, + description: this.state.description + }; + const { calculateStore: { saveBasic } } = this.props; + + saveBasic(params).then((id) => { + this.props.onCancel(); + this.props.onRefresh(); + window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/calculateDetail?id=" + id); + }); + } + + validate() { + if (!notNull(this.state.salaryMonthStr)) { + message.warning("薪酬所属月不能为空"); + return false; + } else if (!notNull(this.state.salarySob)) { + message.warning("核算账套不能为空"); + return false; } + return true; + } - handleSelectChange(value) { - this.setState({ - salarySob: value - }) - } + render() { + const { salaryMonthStr, salarySobId, description } = this.state; + return ( + { + this.props.onCancel(); + }} + footer={} + > + + 薪酬所属月 + + { + this.setState({ + salaryMonthStr: value + }); + }} + /> + + - // 保存回调 - handleSave() { - if(!this.validate()) { - return - } + + 核算账套 + + { + this.state.inited && + } + + - let params = { - salaryMonthStr: this.state.salaryMonthStr, - salarySobId: this.state.salarySob, - description: this.state.description - } - const { calculateStore: { saveBasic }} = this.props; - - saveBasic(params).then((id) => { - this.props.onCancel() - this.props.onRefresh() - window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/calculateDetail?id=" + id) - }) - } - - validate() { - if(!notNull(this.state.salaryMonthStr)) { - message.warning("薪酬所属月不能为空") - return false; - } else if(!notNull(this.state.salarySob)) { - message.warning("核算账套不能为空") - return false; - } - return true; - } - - render() { - const { salaryMonthStr, salarySobId, description } = this.state; - return ( - { -this.props.onCancel() -}} - footer={} - > - - 薪酬所属月 - - { -this.setState({ - salaryMonthStr: value - }) -}} - /> - - - - - 核算账套 - - { - this.state.inited && - } - - - - - 备注 - - this.setState({description: value})}/> - - - - ) - } -} \ No newline at end of file + + 备注 + + this.setState({ description: value })}/> + + + + ); + } +} diff --git a/pc4mobx/hrmSalary/pages/calculate/index.less b/pc4mobx/hrmSalary/pages/calculate/index.less new file mode 100644 index 00000000..e6b54dd0 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/index.less @@ -0,0 +1,8 @@ +.dataList-wrapper { + .formItem { + .ant-select-selection { + height: 30px; + border-radius: 0; + } + } +} diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js index 55e619a7..93ba7890 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js @@ -1,174 +1,181 @@ -import React from 'react' -import CustomTab from '../../components/customTab' -import { Dropdown, Menu, Button, Table, message } from 'antd' -import { WeaHelpfulTip, WeaInputSearch, WeaSlideModal, WeaTable } from 'ecCom' -import { placeOnFileColumns, dataSource } from './columns' -import SlideModalTitle from "../../components/slideModalTitle" -import FileMergeDetail from './fileMergeDetail' +import React from "react"; +import CustomTab from "../../components/customTab"; +import { Dropdown, Menu, message } from "antd"; +import { WeaHelpfulTip, WeaInputSearch, WeaSlideModal } from "ecCom"; +import { placeOnFileColumns } from "./columns"; +import SlideModalTitle from "../../components/slideModalTitle"; +import FileMergeDetail from "./fileMergeDetail"; import { getQueryString } from "../../util/url"; -import { inject, observer } from 'mobx-react'; -import CustomPaginationTable from '../../components/customPaginationTable' +import { inject, observer } from "mobx-react"; +import CustomPaginationTable from "../../components/customPaginationTable"; -@inject('calculateStore') +@inject("calculateStore") @observer export default class PlaceOnFileDetail extends React.Component { - constructor(props) { - super(props); - placeOnFileColumns.map(item => { - if(item.dataIndex == "username") { - item.render = (text, record) => ( - { -this.onDetail() -}}>{text} - ) - } - }) - this.state = { - slideVisiable: false, - selectedRowKeys: [], - searchValue: "" - } - this.id = ""; - this.length = 0 - this.pageInfo = { - current: 1, - pageSize: 10 - } - } - - componentWillMount() { - let id = getQueryString("id"); - this.id = id; - const { calculateStore: { getSalarySobCycle, acctResultList } } = this.props; - getSalarySobCycle(id) - acctResultList(id) - } - - - // 获取列表的列 - getColumns() { - const { calculateStore: {acctResultListTableStore, acctResultListColumns }} = this.props; - let columns = acctResultListColumns ? acctResultListColumns : [] - columns = columns.filter(item => item.hide == "FALSE").map(item => { - let result = {...item} - result.title = item.text; - result.dataIndex = item.column - result.oldWidth = result.width; - result.width = null; - this.length = 0 - if(result.children) { - result.children.map(child => { - child.width = 150 - child.title = child.text - child.dataIndex = child.column - this.length ++ - }) - } else { - this.length ++ - result.width = 150 - } - return result; - }) - columns.push({ - title: '操作', - key: "cz", - render: (text, record) => { - return { -this.handleEdit(record) -}}>编辑 - } - }) - return columns; - } - - onDetail() { - this.setState({slideVisiable: true}) - } - - handleSearch(value){ - const { calculateStore: {acctResultList}} = this.props; - acctResultList(this.id, value, 1, this.pageInfo) - } - - // 分页 - handleDataPageChange(value) { - const { calculateStore: {acctResultList}} = this.props; - acctResultList(this.id, this.state.searchValue, value, this.pageInfo) - } - - handleShowSizeChange(pageInfo) { - const { calculateStore: {acctResultList}} = this.props; - acctResultList(this.id, this.state.searchValue, pageInfo.current, pageInfo ) - } - - handleMenuClick() { - const {calculateStore: {exportAll}} = this.props; - const { selectedRowKeys } = this.state; - if(selectedRowKeys.length == 0) { - message.warning("未选择条目") - return - } - exportAll(this.id, selectedRowKeys.join(",")) - } - - handleExportAll() { - const {calculateStore: {exportAll}} = this.props; - exportAll(this.id) - } - - onSelectChange = selectedRowKeys => { - this.setState({ selectedRowKeys }); - } - - - - render() { - - const { calculateStore } = this.props; - const { baseSalarySobCycle, acctResultListDateSource, acctResultListColumns, acctResultListPageInfo } = calculateStore - const { selectedRowKeys } = this.state; - - const rowSelection = { - selectedRowKeys, - onChange: this.onSelectChange, - }; - - const menu = ( - this.handleMenuClick(e)}> - 导出所选 - + constructor(props) { + super(props); + placeOnFileColumns.map(item => { + if (item.dataIndex == "username") { + item.render = (text, record) => ( + { + this.onDetail(); + }}>{text} ); + } + }); + this.state = { + slideVisiable: false, + selectedRowKeys: [], + searchValue: "" + }; + this.id = ""; + this.length = 0; + this.pageInfo = { + current: 1, + pageSize: 10 + }; + } - const renderRightOperation = () => { - return ( -
- { -this.handleExportAll() -}} overlay={menu}>导出全部 - { -this.setState({searchValue: value}) -}} value={this.state.searchValue} onSearch={(value) => { -this.handleSearch(value) -}}/> -
- ) - } + componentWillMount() { + let id = getQueryString("id"); + this.id = id; + const { calculateStore: { getSalarySobCycle, acctResultList } } = this.props; + getSalarySobCycle(id); + acctResultList({ salaryAcctRecordId: id }); + } - const { slideVisiable } = this.state - - return ( - -
- -
- 薪资所属月:{baseSalarySobCycle.salaryMonth} - item.hide == "FALSE").map(item => { + let result = { ...item }; + result.title = item.text; + result.dataIndex = item.column; + result.oldWidth = result.width; + result.width = null; + this.length = 0; + if (result.children) { + result.children.map(child => { + child.width = 150; + child.title = child.text; + child.dataIndex = child.column; + this.length++; + }); + } else { + this.length++; + result.width = 150; + } + return result; + }); + columns.push({ + title: "操作", + key: "cz", + render: (text, record) => { + return { + this.handleEdit(record); + }}>编辑; + } + }); + return columns; + } + + onDetail() { + this.setState({ slideVisiable: true }); + } + + handleSearch(employeeName) { + const { calculateStore: { acctResultList } } = this.props; + acctResultList({ salaryAcctRecordId: this.id, employeeName, ...this.pageInfo, current: 1 }); + } + + // 分页 + handleDataPageChange(current) { + const { calculateStore: { acctResultList } } = this.props; + acctResultList({ salaryAcctRecordId: this.id, employeeName: this.state.searchValue, ...this.pageInfo, current }); + } + + handleShowSizeChange(pageInfo) { + const { calculateStore: { acctResultList } } = this.props; + acctResultList({ + salaryAcctRecordId: this.id, + employeeName: this.state.searchValue, ...this.pageInfo, ...pageInfo + }); + } + + handleMenuClick() { + const { calculateStore: { exportAll } } = this.props; + const { selectedRowKeys } = this.state; + if (selectedRowKeys.length == 0) { + message.warning("未选择条目"); + return; + } + exportAll(this.id, selectedRowKeys.join(",")); + } + + handleExportAll() { + const { calculateStore: { exportAll } } = this.props; + exportAll(this.id); + } + + onSelectChange = selectedRowKeys => { + this.setState({ selectedRowKeys }); + }; + + + render() { + + const { calculateStore } = this.props; + const { + baseSalarySobCycle, + acctResultListDateSource, + acctResultListColumns, + acctResultListPageInfo + } = calculateStore; + const { selectedRowKeys } = this.state; + + const rowSelection = { + selectedRowKeys, + onChange: this.onSelectChange + }; + + const menu = ( + this.handleMenuClick(e)}> + 导出所选 + + ); + + const renderRightOperation = () => { + return ( +
+ { + this.handleExportAll(); + }} overlay={menu}>导出全部 + { + this.setState({ searchValue: value }); + }} value={this.state.searchValue} onSearch={(value) => { + this.handleSearch(value); + }}/> +
+ ); + }; + + const { slideVisiable } = this.state; + + return ( + +
+ +
+ 薪资所属月:{baseSalarySobCycle.salaryMonth} + -
-
- { - this.pageInfo.current = value - this.handleDataPageChange(value) - }} - onShowSizeChange={(current, pageSize) => { - this.pageInfo = {current, pageSize} - this.handleShowSizeChange(this.pageInfo) - }} - /> -
+ placement="topLeft" + /> +
+
+ { + this.pageInfo.current = value; + this.handleDataPageChange(value); + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = { current, pageSize }; + this.handleShowSizeChange(this.pageInfo); + }} + /> +
- { - slideVisiable && - } - content={()} - onClose={() => this.setState({slideVisiable: false})} - showMask={true} - closeMaskOnClick={() => this.setState({slideVisiable: false})} /> - } -
- ) - } -} \ No newline at end of file + { + slideVisiable && + } + content={()} + onClose={() => this.setState({ slideVisiable: false })} + showMask={true} + closeMaskOnClick={() => this.setState({ slideVisiable: false })}/> + } +
+ ); + } +} diff --git a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js index 3285bf32..bf3da908 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js @@ -1,6 +1,6 @@ import React from "react"; import { Button, Col, Icon, Modal, Row } from "antd"; -import { WeaFormItem, WeaInput, WeaSelect, WeaTextarea } from "ecCom"; +import { WeaFormItem, WeaInput, WeaSelect, WeaTextarea, WeaHelpfulTip } from "ecCom"; import { inject, observer } from "mobx-react"; import "./index.less"; @@ -224,6 +224,7 @@ export default class FormalFormModal extends React.Component { this.handleSave(); }}>保存 } + wrapClassName="formula-wrapper" onCancel={() => { this.props.onCancel(); }}> @@ -254,6 +255,11 @@ export default class FormalFormModal extends React.Component { this.setState({ extendParam: {...extendParam, datasource:{datasourceId}} }); }} /> + diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.less b/pc4mobx/hrmSalary/pages/salaryItem/index.less index cdeefa5c..7ab8549e 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.less +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.less @@ -6,14 +6,27 @@ } } +.formula-wrapper{ + .ant-modal-body{ + min-height: 200px; + max-height: 50vh; + overflow: auto; + } +} + .dataList-wrapper { - .wea-select { - width: 100%; - .ant-select{ + .wea-form-item-wrapper{ + display: flex!important; + align-items: center; + .wea-select { width: 100%; - .ant-select-selection{ - border-radius: 0; - height: 30px; + margin-right: 8px; + .ant-select{ + width: 100%; + .ant-select-selection{ + border-radius: 0; + height: 30px; + } } } } diff --git a/pc4mobx/hrmSalary/pages/salaryItem/systemSalaryItemModal.js b/pc4mobx/hrmSalary/pages/salaryItem/systemSalaryItemModal.js index 37bd7484..9c255013 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/systemSalaryItemModal.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/systemSalaryItemModal.js @@ -1,70 +1,74 @@ -import React from 'react' -import { systemItemColumns, dataSource } from './columns' -import { WeaInputSearch } from 'ecCom' -import { Modal, Button, Table } from 'antd' -import { inject, observer } from 'mobx-react'; -import { WeaTableNew } from "comsMobx" +import React from "react"; +import { WeaInputSearch } from "ecCom"; +import { Button, Modal } from "antd"; +import { inject, observer } from "mobx-react"; +import { WeaTableNew } from "comsMobx"; +import "./index.less"; + const WeaTable = WeaTableNew.WeaTable; -@inject('salaryItemStore') +@inject("salaryItemStore") @observer export default class SystemSalaryItemModal extends React.Component { - constructor(props) { - super(props); - this.state = { - searchValue: "" - } - } - - // 搜索改变事件 - handleSearchChange(value) { - this.setState({searchValue: value}) - } + constructor(props) { + super(props); + this.state = { + searchValue: "" + }; + } - // 搜索 - handleSearch(value) { - const { salaryItemStore } = this.props; - const { getSysItemList } = salaryItemStore - getSysItemList({name: value}) - } + // 搜索改变事件 + handleSearchChange(value) { + this.setState({ searchValue: value }); + } - render() { - const { salaryItemStore } = this.props; - const { sysListTableStore } = salaryItemStore - const { searchValue } = this.state; - - const handleAdd = () => { - const { salaryItemStore: { saveSysItem } } = this.props; - saveSysItem(); - } - - return ( - { -this.props.onCancel() -}} width={800}> -
- 添加系统薪资项目 -
- - { -this.handleSearchChange(value) -}} onSearch={(value) => { - this.handleSearch(value) - }}/> -
-
-
- -
-
- ) - } -} \ No newline at end of file + // 搜索 + handleSearch(value) { + const { salaryItemStore } = this.props; + const { getSysItemList } = salaryItemStore; + getSysItemList({ name: value }); + } + + render() { + const { salaryItemStore } = this.props; + const { sysListTableStore } = salaryItemStore; + const { searchValue } = this.state; + + const handleAdd = () => { + const { salaryItemStore: { saveSysItem } } = this.props; + saveSysItem(); + }; + + return ( + { + this.props.onCancel(); + }} width={800} + > +
+ 添加系统薪资项目 +
+ + { + this.handleSearchChange(value); + }} onSearch={(value) => { + this.handleSearch(value); + }}/> +
+
+ +
+ ); + } +} diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index 37873afd..504d0399 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -1,12 +1,8 @@ import React from "react"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; - -import { Button, DatePicker, Dropdown, Menu, message } from "antd"; - +import { Button, Dropdown, Menu, message } from "antd"; import { WeaRightMenu, WeaSlideModal, WeaTab, WeaTop } from "ecCom"; -// import { WeaTableNew } from "comsMobx" -// const WeaTable = WeaTableNew.WeaTable; import { getSearchs, renderNoright } from "../../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 import BaseForm from "./baseForm"; import SlideModalTitle from "../../../components/slideModalTitle"; @@ -16,8 +12,6 @@ import OtherForm from "./otherForm"; import CustomPaginationTable from "../../../components/customPaginationTable"; import ImportModal from "../../../components/importModal"; -const { MonthPicker } = DatePicker; - @inject("archivesStore", "taxAgentStore") @observer export default class Archives extends React.Component { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.less index 87c842ed..14a479df 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.less @@ -9,6 +9,10 @@ padding-right: 10px; border: 1px solid #e2e2e2; margin-bottom: 0 !important; + .ant-select-selection{ + height: 30px; + border-radius: 0; + } } .borderR-none { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js index faee97d2..5fdd1b34 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js @@ -111,8 +111,7 @@ export default class SocialSecurityForm extends React.Component { - 缴纳组织: - + 个税扣缴义务人: