From e329e381ea2b66016f820b374316b243c33242ff Mon Sep 17 00:00:00 2001 From: liyongshun <971387674@qq.com> Date: Fri, 29 Jul 2022 11:44:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=96=AA=E8=B5=84=E6=A0=B8=E7=AE=97=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E9=9D=A2=E5=AF=BC=E5=85=A5=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=9A=84bug=E5=A4=84=E7=90=86=E4=BB=A5=E5=8F=8A=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E5=88=97=E5=9B=BA=E5=AE=9A=E4=B9=8B=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E9=94=99=E4=BD=8D=E7=9A=84bug=E8=A7=A3?= =?UTF-8?q?=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/customTable/index.less | 38 ++ .../hrmSalary/components/importModal/index.js | 18 +- .../pages/calculateDetail/salaryDetail.js | 359 +++++++++--------- .../pages/salaryItem/customSalaryItemSlide.js | 2 +- 4 files changed, 234 insertions(+), 183 deletions(-) diff --git a/pc4mobx/hrmSalary/components/customTable/index.less b/pc4mobx/hrmSalary/components/customTable/index.less index ccf590a7..6348f5ed 100644 --- a/pc4mobx/hrmSalary/components/customTable/index.less +++ b/pc4mobx/hrmSalary/components/customTable/index.less @@ -1,4 +1,42 @@ .antd-wrap { + .ant-table-thead > tr > th { + border-width: 1px !important; + } + + .ant-table-bordered .ant-table-fixed-right { + top: 1px !important; + + thead { + tr > th { + border-top: 1px solid #e2e2e2 !important; + } + } + } + + .ant-table-bordered .ant-table-fixed-left { + top: 1px !important; + left: 0 !important; + + thead { + tr > th { + border-top: 1px solid #e2e2e2 !important; + } + + tr > th:first-child { + border-left: 1px solid #e2e2e2 !important; + } + } + + tbody { + tr > td:first-child { + border-left: 1px solid #e2e2e2 !important; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } + } + .ant-table-tbody { tr { td { diff --git a/pc4mobx/hrmSalary/components/importModal/index.js b/pc4mobx/hrmSalary/components/importModal/index.js index a018da95..2aab4702 100644 --- a/pc4mobx/hrmSalary/components/importModal/index.js +++ b/pc4mobx/hrmSalary/components/importModal/index.js @@ -20,7 +20,7 @@ export default class ImportModal extends React.Component { this.state = { fileId: "" } - + this.props.init && this.props.init() } @@ -45,27 +45,27 @@ export default class ImportModal extends React.Component { try { params && Object.keys(params).forEach((key) => { if(!params[key] || params[key] == "") { - message.warning("请选择税款所属期"); - throw new Error("请选择税款所属期") + message.warning("请完善导入选项"); + throw new Error("请完善导入选项") } }) } catch(e) { flag = false } - + return flag; } handleStep1Next() { if(!this.validateDate()) { - return + return } if(this.state.fileId) { this.props.setStep(1) } else { message.warning("请上传文件") } - + } handlePreviewDate() { @@ -102,7 +102,7 @@ export default class ImportModal extends React.Component { { - this.props.step == 0 && ( {this.props.onFinish()}}/>) } - + ) } -} \ No newline at end of file +} diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js index 6506701b..1e72f929 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js @@ -1,143 +1,152 @@ -import React from 'react' -import { salaryDetailColumns, dataSource } from './columns' -import { WeaHelpfulTip, WeaSlideModal, WeaTable } from 'ecCom' -import { Table } from 'antd' -import WarningModal from './warningModal' -import "./index.less" -import EditSalaryDetail from './editSalaryDetail' -import SlideModalTitle from "../../components/slideModalTitle" -import ImportModal from '../../components/importModal' -import { columns } from '../salaryItem/columns' -import { getQueryString } from '../../util/url' -import { inject, observer } from 'mobx-react'; -import CustomTable from '../../components/customTable' -import CustomPaginationTable from '../../components/customPaginationTable' +import React from "react"; +import { salaryDetailColumns } from "./columns"; +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 CustomPaginationTable from "../../components/customPaginationTable"; -@inject('calculateStore', 'taxAgentStore') +@inject("calculateStore", "taxAgentStore") @observer export default class SalaryDetail extends React.Component { - constructor(props) { - super(props) - this.state ={ - visible: false, - slideVisiable: false, - columns: salaryDetailColumns.map(item => { - if(item.dataIndex == "cz") { - item.render = () => { - return ( - {this.setState({slideVisiable: true})}}>编辑 - ) - } - } - }) + constructor(props) { + super(props); + this.state = { + visible: false, + slideVisiable: false, + columns: salaryDetailColumns.map(item => { + if (item.dataIndex == "cz") { + item.render = () => { + return ( + { + this.setState({ slideVisiable: true }); + }}>编辑 + ); + }; } - this.recordId = "" - this.id = "" - this.pageInfo = {current: 1, pageSize: 10} - } + }) + }; + this.recordId = ""; + this.id = ""; + this.pageInfo = { current: 1, pageSize: 10 }; + } - componentWillMount() { - let id = getQueryString("id") - this.id = id; - const { calculateStore: { acctResultList, getSalarySobCycle } } = this.props; - acctResultList(id) - getSalarySobCycle(id) - } + componentWillMount() { + let id = getQueryString("id"); + this.id = id; + const { calculateStore: { acctResultList, getSalarySobCycle } } = this.props; + acctResultList(id); + getSalarySobCycle(id); + } - headerSetCompoent() { - return ( -
- - + + -
- ) - } + placement="topLeft" + /> + + ); + } - // 获取列表的列 - getColumns() { - const { calculateStore: {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 = "150px"; - if(result.children) { - result.width = (result.children.length * 150) + "px"; - result.children.map(child => { - child.title = child.text - child.dataIndex = child.column - child.width = "150px"; - }) - } + // 获取列表的列 + getColumns() { + const { calculateStore: { 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 = "150px"; + if (result.children) { + result.width = (result.children.length * 150) + "px"; + result.children.map(child => { + child.title = child.text; + child.dataIndex = child.column; + child.width = "150px"; + }); + } - if(result.dataIndex === "taxAgentName" || result.dataIndex === "username" || result.dataIndex === "departmentName") { - result.fixed = "left" - } + if (result.dataIndex === "taxAgentName" || result.dataIndex === "username" || result.dataIndex === "departmentName") { + result.fixed = "left"; + result.render = (text) => { + return {text}; + }; + } - return result; - }) - columns.push({ - title: '操作', - key: "cz", - width: '100px', - fixed: 'right', - render: (text, record) => { - return {this.handleEdit(record)}}>编辑 - } - }) - return columns; - } + return result; + }); + columns.push({ + title: "操作", + key: "cz", + width: "100px", + fixed: "right", + render: (text, record) => { + return { + this.handleEdit(record); + }}>编辑; + } + }); + return columns; + } - // 编辑时间回调 - handleEdit(record) { - this.recordId = record.id; - this.setState({ - slideVisiable: true - }) - } + // 编辑时间回调 + handleEdit(record) { + this.recordId = record.id; + this.setState({ + slideVisiable: true + }); + } - // 侧边栏保存 - handleEditSlideSave() { - const {calculateStore } = this.props; - const { saveAcctResult, acctResultList, acctresultDetail } = calculateStore; - this.setState({ - slideVisiable: false - }) - saveAcctResult(this.recordId).then(() => { - acctResultList(this.id) - }) - } + // 侧边栏保存 + handleEditSlideSave() { + const { calculateStore } = this.props; + const { saveAcctResult, acctResultList, acctresultDetail } = calculateStore; + this.setState({ + slideVisiable: false + }); + saveAcctResult(this.recordId).then(() => { + acctResultList(this.id); + }); + } - // 分页 - handleDataPageChange(value) { - const { calculateStore: {acctResultList}} = this.props; - acctResultList(this.id, this.props.employeeName, value, this.pageInfo) - } + // 分页 + handleDataPageChange(value) { + const { calculateStore: { acctResultList } } = this.props; + acctResultList(this.id, this.props.employeeName, value, this.pageInfo); + } - handleShowSizeChange(pageInfo) { - const { calculateStore: {acctResultList}} = this.props; - acctResultList(this.id, this.props.employeeName, pageInfo.current, pageInfo) - } + handleShowSizeChange(pageInfo) { + const { calculateStore: { acctResultList } } = this.props; + acctResultList(this.id, this.props.employeeName, pageInfo.current, pageInfo); + } - render() { - const { slideVisiable } = this.state; - const { calculateStore, taxAgentStore: { showOperateBtn } } = this.props; - const { acctResultListDateSource, acctResultListColumns, baseSalarySobCycle, acctResultListPageInfo, loading } = calculateStore - return ( -
-
- 薪资所属月:{baseSalarySobCycle.salaryMonth} - +
+ 薪资所属月:{baseSalarySobCycle.salaryMonth} + - {this.setState({visible: true})}}>校验异常:0 -
-
- { - this.pageInfo.current = value - this.handleDataPageChange(value) - }} - isWeaTable={false} - scroll={{ x: 1500 }} - onShowSizeChange={(current, pageSize) => { - this.pageInfo = {current, pageSize} - this.handleShowSizeChange(this.pageInfo) - }} - /> -
- {this.setState({visible: false})}}/> - { - slideVisiable && this.handleEditSlideSave()} - /> - } - content={} - onClose={() => this.setState({slideVisiable: false})} - showMask={true} - closeMaskOnClick={() => this.setState({slideVisiable: false})} /> - } -
- ) - } + placement="topLeft" + /> + { + this.setState({ visible: true }); + }}>校验异常:0 +
+
+ { + this.pageInfo.current = value; + this.handleDataPageChange(value); + }} + isWeaTable={false} + scroll={{ x: 1500 }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = { current, pageSize }; + this.handleShowSizeChange(this.pageInfo); + }} + /> +
+ { + this.setState({ visible: false }); + }}/> + { + slideVisiable && this.handleEditSlideSave()} + /> + } + content={} + onClose={() => this.setState({ slideVisiable: false })} + showMask={true} + closeMaskOnClick={() => this.setState({ slideVisiable: false })}/> + } + + ); + } } diff --git a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js index 58ecc2eb..619db8ac 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js @@ -110,7 +110,7 @@ export default class CustomSalaryItemSlide extends React.Component {