From 85b39baa287a13c5e7241266960cd0c0a130b9d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 13 Nov 2023 16:42:47 +0800 Subject: [PATCH 1/7] =?UTF-8?q?custom/=E4=B8=8A=E6=B5=B7=E6=B8=AF=E6=B9=BE?= =?UTF-8?q?-=E5=B7=A5=E8=B5=84=E5=8D=95=E6=9F=A5=E7=9C=8B=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=A2=86=E5=AF=BC=E6=9F=A5=E8=AF=A2=E4=B8=8B=E5=B1=9E?= =?UTF-8?q?=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/index.js | 4 +- .../components/payrollTable/index.js | 25 ++++++++ .../hrmSalary/pages/mySalaryBenefits/index.js | 57 +++++++++++++++++++ 3 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js create mode 100644 pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index af5bbfb0..8e13a182 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -1,7 +1,8 @@ import React from "react"; import Route from "react-router/lib/Route"; import { WeaLocaleProvider } from "ecCom"; -import MySalary from "./pages/mySalary"; +// import MySalary from "./pages/mySalary"; +import MySalary from "./pages/mySalaryBenefits"; import Programme from "./pages/socialSecurityBenefits/programme"; import Archives from "./pages/socialSecurityBenefits/archives"; import StandingBook from "./pages/socialSecurityBenefits/standingBook"; @@ -103,6 +104,7 @@ const Routes = ( onEnter={getLocaleLabel} component={Home}> + {/**/} 左侧内容 宽度200} + > +
右侧内容
+ + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js b/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js new file mode 100644 index 00000000..dadc5372 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js @@ -0,0 +1,57 @@ +/* + * Author: 黎永顺 + * name: 我的薪资福利 + * Description: + * Date: 2023/11/13 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaReqTop } from "ecCom"; +import Payroll from "./components/payrollTable"; +import moment from "moment"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + selectedKey: "1", salaryYearMonth: [moment().startOf("year").format("YYYY-MM"), moment().format("YYYY-MM")] + }; + } + + renderChilidren = () => { + const { selectedKey } = this.state; + let Dom = null; + switch (selectedKey) { + case "1": + Dom = ; + break; + case "2": + Dom = null; + break; + default: + break; + } + return Dom; + }; + + render() { + const { selectedKey } = this.state; + const tabs = [ + { key: "1", title: getLabel(111, "工资单") }, + { key: "2", title: getLabel(543150, "调薪记录") } + ]; + return ( + } + iconBgcolor="#F14A2D" tabDatas={tabs} className="xc_tj_fx_wrapper" + buttons={[]} buttonSpace={10} selectedKey={selectedKey} + onChange={selectedKey => this.setState({ selectedKey })} + > + {this.renderChilidren()} + + ); + } +} + +export default Index; From 235d157f192e9eaa8aa4d74f71396fc1c1c773ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 14 Nov 2023 10:27:11 +0800 Subject: [PATCH 2/7] =?UTF-8?q?custom/=E4=B8=8A=E6=B5=B7=E6=B8=AF=E6=B9=BE?= =?UTF-8?q?-=E5=B7=A5=E8=B5=84=E5=8D=95=E6=9F=A5=E7=9C=8B=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=A2=86=E5=AF=BC=E6=9F=A5=E8=AF=A2=E4=B8=8B=E5=B1=9E?= =?UTF-8?q?=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/mySalaryBenefits.js | 3 + pc4mobx/hrmSalary/index.js | 4 +- .../SalaryAdjustmentRecords/index.js | 76 +++++++++++++++ .../components/payrollTable/index.js | 92 ++++++++++++++++++- .../hrmSalary/pages/mySalaryBenefits/index.js | 26 ++++-- .../pages/mySalaryBenefits/index.less | 19 ++++ pc4mobx/hrmSalary/stores/mySalary.js | 12 +-- 7 files changed, 212 insertions(+), 20 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/mySalaryBenefits/components/SalaryAdjustmentRecords/index.js create mode 100644 pc4mobx/hrmSalary/pages/mySalaryBenefits/index.less diff --git a/pc4mobx/hrmSalary/apis/mySalaryBenefits.js b/pc4mobx/hrmSalary/apis/mySalaryBenefits.js index d28d7ed7..6f99b8cb 100644 --- a/pc4mobx/hrmSalary/apis/mySalaryBenefits.js +++ b/pc4mobx/hrmSalary/apis/mySalaryBenefits.js @@ -56,3 +56,6 @@ export const saveSecondaryPwd = params => { export const salaryBillGetToken = params => { return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/getToken", "GET", params); }; +export const getMyJuniorMap = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/myJuniorMap", "GET", params); +}; diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 8e13a182..ed8d3073 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -1,7 +1,7 @@ import React from "react"; import Route from "react-router/lib/Route"; import { WeaLocaleProvider } from "ecCom"; -// import MySalary from "./pages/mySalary"; +import MySalaryDemo from "./pages/mySalary"; import MySalary from "./pages/mySalaryBenefits"; import Programme from "./pages/socialSecurityBenefits/programme"; import Archives from "./pages/socialSecurityBenefits/archives"; @@ -104,7 +104,7 @@ const Routes = ( onEnter={getLocaleLabel} component={Home}> - {/**/} + { + const { pageInfo } = this.state; + this.setState({ loading: true }); + recordList({ ...pageInfo }).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, + columns: _.map(columns, it => ({ ...it, width: 150 })) + }); + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { dataSource, loading, columns, pageInfo } = 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, pageSize } + }, () => this.getRecordList()); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.getRecordList()); + } + }; + return ( + + + + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js index f13d2587..df8e1e27 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js +++ b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js @@ -5,18 +5,102 @@ * Date: 2023/11/13 */ import React, { Component } from "react"; -import { WeaLeftRightLayout, WeaLocaleProvider } from "ecCom"; +import { WeaLeftRightLayout, WeaLocaleProvider, WeaTable, WeaTree } from "ecCom"; +import { getMyJuniorMap, mySalaryBillList } from "../../../../apis/mySalaryBenefits"; +import moment from "moment"; const getLabel = WeaLocaleProvider.getLabel; class Index extends Component { + constructor(props) { + super(props); + this.state = { + juniorMapList: [], dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, + loading: false, employeeId: "" + }; + } + + componentDidMount() { + this.getMyJuniorMap(); + this.getMySalaryBillList(this.props); + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.salaryYearMonth !== this.props.salaryYearMonth) this.getMySalaryBillList(nextProps); + } + + getMyJuniorMap = () => { + getMyJuniorMap().then(({ status, data }) => { + if (status) { + this.setState({ + juniorMapList: _.map(_.keys(data), o => ({ id: o, name: data[o] })) + }); + } + }); + }; + getMySalaryBillList = (props) => { + this.setState({ loading: true }); + const { pageInfo, employeeId } = this.state; + const { salaryYearMonth } = props; + mySalaryBillList({ salaryYearMonth, employeeId, ...pageInfo }).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, datas: dataSource, pageInfo: { pageNum: current, pageSize, total } } = data; + this.setState({ + dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, + columns: _.map(columns, it => { + if (it.column === "salaryYearMonth" || it.column === "sendTime") { + return { + dataIndex: it.column, title: it.text, width: it.width, + render: (__, record) => ({moment(record[it["column"]]).format("YYYY-MM")}) + }; + } + return { + dataIndex: it.column, title: it.text, width: it.width + }; + }) + }); + } + }).catch(() => this.setState({ loading: false })); + }; + render() { + const { juniorMapList, dataSource, loading, columns, pageInfo } = 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, pageSize } + }, () => this.getMySalaryBillList(this.props)); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.getMySalaryBillList(this.props)); + } + }; return ( 左侧内容 宽度200} + isNew={true} leftWidth={200} height="100%" checkedKeys={[]} + leftCom={ this.setState({ employeeId }, () => this.getMySalaryBillList(this.props))}/>} > -
右侧内容
+ ({getLabel(33564, "查看")}) + }]} + />
); } diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js b/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js index dadc5372..5f608921 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js +++ b/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js @@ -7,7 +7,10 @@ import React, { Component } from "react"; import { WeaLocaleProvider, WeaReqTop } from "ecCom"; import Payroll from "./components/payrollTable"; +import SalaryAdjustmentRecords from "./components/SalaryAdjustmentRecords"; +import { MonthRangePicker } from "../reportView/components/statisticalMicroSettingsSlide"; import moment from "moment"; +import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; @@ -19,15 +22,15 @@ class Index extends Component { }; } - renderChilidren = () => { - const { selectedKey } = this.state; + renderContent = () => { + const { selectedKey, salaryYearMonth } = this.state; let Dom = null; switch (selectedKey) { case "1": - Dom = ; + Dom = ; break; case "2": - Dom = null; + Dom = ; break; default: break; @@ -36,19 +39,26 @@ class Index extends Component { }; render() { - const { selectedKey } = this.state; + const { selectedKey, salaryYearMonth } = this.state; const tabs = [ { key: "1", title: getLabel(111, "工资单") }, { key: "2", title: getLabel(543150, "调薪记录") } ]; + const btns = [ +
+
{getLabel(542604, "薪资所属月")}
+ this.setState({ salaryYearMonth: v })}/> +
+ ]; return ( } - iconBgcolor="#F14A2D" tabDatas={tabs} className="xc_tj_fx_wrapper" - buttons={[]} buttonSpace={10} selectedKey={selectedKey} + iconBgcolor="#F14A2D" tabDatas={tabs} className="mySalary_wrapper" + buttons={selectedKey === "1" ? btns : []} buttonSpace={10} selectedKey={selectedKey} onChange={selectedKey => this.setState({ selectedKey })} > - {this.renderChilidren()} + {this.renderContent()} ); } diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.less b/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.less new file mode 100644 index 00000000..52e92374 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.less @@ -0,0 +1,19 @@ +.mySalary_wrapper { + .wea-transfer-list-wrapper { + border: none; + } + + .flex-salary { + display: flex; + align-items: center; + margin-right: 16px; + + .mysalary-search-title { + margin-right: 8px; + } + } + + .wea-new-table { + background: #fff; + } +} diff --git a/pc4mobx/hrmSalary/stores/mySalary.js b/pc4mobx/hrmSalary/stores/mySalary.js index 8a38f31e..eaad7374 100644 --- a/pc4mobx/hrmSalary/stores/mySalary.js +++ b/pc4mobx/hrmSalary/stores/mySalary.js @@ -218,28 +218,28 @@ export class MySalaryStore { }); }; - @action initRecordData = async (payload) => { + @action initRecordData = async (callback) => { this.clear(); //1.check is need second verify if (window.doCheckSecondaryVerify4ec) { window.doCheckSecondaryVerify4ec({ mouldCode: "HRM", itemCode: "SALARY" }, (data) => this.getRecordData({ - ...data, payload + ...data, callback })); } else { - //4.loaddata - this.getRecordData({ status: "1", token: "", payload }); + this.getRecordData({ status: "1", token: "", callback }); } }; @action getRecordData = async (params = {}) => { if (_.isEmpty(params)) return; - const { status, payload, token } = params; + const { status, callback, token } = params; if (status == "1") { // Object.assign(this._reqParams, { token }); // this.getFormData({ viewAttr: 1 }); this.hasRight = true; - this.getRecordList(payload); + !callback && this.getRecordList(); + callback && callback(); } else { this.hasRight = false; } From a97d7820989e0935e50d1d95fc73800515fa6b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 29 Nov 2023 15:03:49 +0800 Subject: [PATCH 3/7] =?UTF-8?q?custom/=E4=B8=8A=E6=B5=B7=E6=B8=AF=E6=B9=BE?= =?UTF-8?q?-=E5=B7=A5=E8=B5=84=E5=8D=95=E6=9F=A5=E7=9C=8B=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=A2=86=E5=AF=BC=E6=9F=A5=E8=AF=A2=E4=B8=8B=E5=B1=9E?= =?UTF-8?q?=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/mySalaryBenefits.js | 4 +-- .../components/payrollTable/index.js | 36 +++++++++++++++---- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/mySalaryBenefits.js b/pc4mobx/hrmSalary/apis/mySalaryBenefits.js index 6f99b8cb..9eb03209 100644 --- a/pc4mobx/hrmSalary/apis/mySalaryBenefits.js +++ b/pc4mobx/hrmSalary/apis/mySalaryBenefits.js @@ -56,6 +56,6 @@ export const saveSecondaryPwd = params => { export const salaryBillGetToken = params => { return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/getToken", "GET", params); }; -export const getMyJuniorMap = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/myJuniorMap", "GET", params); +export const myJuniorTree = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/myJuniorTree", "GET", params); }; diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js index df8e1e27..d6fbc200 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js +++ b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js @@ -6,7 +6,8 @@ */ import React, { Component } from "react"; import { WeaLeftRightLayout, WeaLocaleProvider, WeaTable, WeaTree } from "ecCom"; -import { getMyJuniorMap, mySalaryBillList } from "../../../../apis/mySalaryBenefits"; +import { message } from "antd"; +import { myJuniorTree, mySalaryBillList } from "../../../../apis/mySalaryBenefits"; import moment from "moment"; const getLabel = WeaLocaleProvider.getLabel; @@ -21,7 +22,7 @@ class Index extends Component { } componentDidMount() { - this.getMyJuniorMap(); + this.getMyJuniorTree(); this.getMySalaryBillList(this.props); } @@ -29,22 +30,38 @@ class Index extends Component { if (nextProps.salaryYearMonth !== this.props.salaryYearMonth) this.getMySalaryBillList(nextProps); } - getMyJuniorMap = () => { - getMyJuniorMap().then(({ status, data }) => { + getMyJuniorTree = () => { + myJuniorTree().then(({ status, data }) => { if (status) { this.setState({ - juniorMapList: _.map(_.keys(data), o => ({ id: o, name: data[o] })) + juniorMapList: this.convertToTreeDatas(data) }); } }); }; + convertToTreeDatas = (datas, pid = "0") => { + return _.map(datas, item => { + if (_.isEmpty(item.children)) { + return { + id: item.employeeId.toString(), name: item.username, + isParent: false, pid + }; + } else { + return { + id: item.employeeId.toString(), name: item.username, + isParent: true, pid, + subs: this.convertToTreeDatas(item.children, item.employeeId.toString()) + }; + } + }); + }; getMySalaryBillList = (props) => { this.setState({ loading: true }); const { pageInfo, employeeId } = this.state; const { salaryYearMonth } = props; - mySalaryBillList({ salaryYearMonth, employeeId, ...pageInfo }).then(({ status, data }) => { + mySalaryBillList({ salaryYearMonth, employeeId, ...pageInfo }).then(({ status, data, errormsg }) => { this.setState({ loading: false }); - if (status) { + if (status && !_.isEmpty(data)) { const { columns, datas: dataSource, pageInfo: { pageNum: current, pageSize, total } } = data; this.setState({ dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, @@ -60,6 +77,11 @@ class Index extends Component { }; }) }); + } else { + message.error(errormsg); + this.setState({ + dataSource: [], pageInfo: { ...pageInfo, total: 0 }, columns: [] + }); } }).catch(() => this.setState({ loading: false })); }; From 7eadce16ffa213246e2127e42c480e1f82ecaee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 30 Nov 2023 09:35:57 +0800 Subject: [PATCH 4/7] =?UTF-8?q?custom/=E4=B8=8A=E6=B5=B7=E6=B8=AF=E6=B9=BE?= =?UTF-8?q?-=E5=B7=A5=E8=B5=84=E5=8D=95=E6=9F=A5=E7=9C=8B=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=A2=86=E5=AF=BC=E6=9F=A5=E8=AF=A2=E4=B8=8B=E5=B1=9E?= =?UTF-8?q?=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mySalaryBenefits/components/payrollTable/index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js index d6fbc200..59aac762 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js +++ b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js @@ -108,9 +108,13 @@ class Index extends Component { return ( this.setState({ employeeId }, () => this.getMySalaryBillList(this.props))}/>} + leftCom={ +
+ this.setState({ employeeId }, () => this.getMySalaryBillList(this.props))}/> +
+ } > Date: Mon, 11 Dec 2023 15:46:01 +0800 Subject: [PATCH 5/7] =?UTF-8?q?custom/=E4=B8=8A=E6=B5=B7=E6=B8=AF=E6=B9=BE?= =?UTF-8?q?-=E5=B7=A5=E8=B5=84=E5=8D=95=E6=9F=A5=E7=9C=8B=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=A2=86=E5=AF=BC=E6=9F=A5=E8=AF=A2=E4=B8=8B=E5=B1=9E?= =?UTF-8?q?=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js b/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js index 5f608921..331b9eb9 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js +++ b/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js @@ -32,6 +32,9 @@ class Index extends Component { case "2": Dom = ; break; + case "3": + Dom = ; + break; default: break; } @@ -42,7 +45,8 @@ class Index extends Component { const { selectedKey, salaryYearMonth } = this.state; const tabs = [ { key: "1", title: getLabel(111, "工资单") }, - { key: "2", title: getLabel(543150, "调薪记录") } + { key: "2", title: getLabel(543150, "调薪记录") }, + { key: "3", title: getLabel(111, "下属工资单") } ]; const btns = [
@@ -53,9 +57,9 @@ class Index extends Component { ]; return ( } + title={getLabel(537998, "薪资福利")} icon={} iconBgcolor="#F14A2D" tabDatas={tabs} className="mySalary_wrapper" - buttons={selectedKey === "1" ? btns : []} buttonSpace={10} selectedKey={selectedKey} + buttons={selectedKey !== "2" ? btns : []} buttonSpace={10} selectedKey={selectedKey} onChange={selectedKey => this.setState({ selectedKey })} > {this.renderContent()} From 0f71f924389d0ee770ca03290b9a7142da353933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 11 Dec 2023 16:25:31 +0800 Subject: [PATCH 6/7] =?UTF-8?q?custom/=E4=B8=8A=E6=B5=B7=E6=B8=AF=E6=B9=BE?= =?UTF-8?q?-=E5=B7=A5=E8=B5=84=E5=8D=95=E6=9F=A5=E7=9C=8B=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=A2=86=E5=AF=BC=E6=9F=A5=E8=AF=A2=E4=B8=8B=E5=B1=9E?= =?UTF-8?q?=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/payrollTable/index.js | 10 +- .../components/subPayroll/index.js | 92 +++++++++++++++++++ .../hrmSalary/pages/mySalaryBenefits/index.js | 5 +- 3 files changed, 100 insertions(+), 7 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/mySalaryBenefits/components/subPayroll/index.js diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js index 59aac762..68a4a76a 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js +++ b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js @@ -23,7 +23,6 @@ class Index extends Component { componentDidMount() { this.getMyJuniorTree(); - this.getMySalaryBillList(this.props); } componentWillReceiveProps(nextProps, nextContext) { @@ -34,8 +33,9 @@ class Index extends Component { myJuniorTree().then(({ status, data }) => { if (status) { this.setState({ - juniorMapList: this.convertToTreeDatas(data) - }); + juniorMapList: this.convertToTreeDatas(data), + employeeId: !_.isNil(data) ? _.head(data).employeeId : "" + }, () => this.getMySalaryBillList(this.props)); } }); }; @@ -87,7 +87,7 @@ class Index extends Component { }; render() { - const { juniorMapList, dataSource, loading, columns, pageInfo } = this.state; + const { juniorMapList, dataSource, loading, columns, pageInfo, employeeId } = this.state; const pagination = { ...pageInfo, showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, @@ -111,7 +111,7 @@ class Index extends Component { leftCom={
this.setState({ employeeId }, () => this.getMySalaryBillList(this.props))}/>
} diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/subPayroll/index.js b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/subPayroll/index.js new file mode 100644 index 00000000..d5552072 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/subPayroll/index.js @@ -0,0 +1,92 @@ +/* + * Author: 黎永顺 + * name: 下属工资单 + * Description: + * Date: 2023/11/13 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; +import { mySalaryBillList } from "../../../../apis/mySalaryBenefits"; +import moment from "moment"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, + loading: false + }; + } + + componentDidMount() { + this.getMySalaryBillList(this.props); + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.salaryYearMonth !== this.props.salaryYearMonth) this.getMySalaryBillList(nextProps); + } + + getMySalaryBillList = (props) => { + this.setState({ loading: true }); + const { pageInfo } = this.state; + const { salaryYearMonth } = props; + mySalaryBillList({ salaryYearMonth, ...pageInfo }).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, datas: dataSource, pageInfo: { pageNum: current, pageSize, total } } = data; + this.setState({ + dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, + columns: _.map(columns, it => { + if (it.column === "salaryYearMonth" || it.column === "sendTime") { + return { + dataIndex: it.column, title: it.text, width: it.width, + render: (__, record) => ({moment(record[it["column"]]).format("YYYY-MM")}) + }; + } + return { + dataIndex: it.column, title: it.text, width: it.width + }; + }) + }); + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { dataSource, loading, columns, pageInfo } = 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, pageSize } + }, () => this.getMySalaryBillList(this.props)); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.getMySalaryBillList(this.props)); + } + }; + return ( + ({getLabel(33564, "查看")}) + }]} + /> + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js b/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js index 331b9eb9..0f68e632 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js +++ b/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js @@ -6,8 +6,9 @@ */ import React, { Component } from "react"; import { WeaLocaleProvider, WeaReqTop } from "ecCom"; -import Payroll from "./components/payrollTable"; +import SubPayroll from "./components/payrollTable"; import SalaryAdjustmentRecords from "./components/SalaryAdjustmentRecords"; +import Payroll from "./components/subPayroll"; import { MonthRangePicker } from "../reportView/components/statisticalMicroSettingsSlide"; import moment from "moment"; import "./index.less"; @@ -33,7 +34,7 @@ class Index extends Component { Dom = ; break; case "3": - Dom = ; + Dom = ; break; default: break; From 990dad63373a763847ee3ff3b3ae72827051f717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 12 Dec 2023 16:41:57 +0800 Subject: [PATCH 7/7] =?UTF-8?q?custom/=E4=B8=8A=E6=B5=B7=E6=B8=AF=E6=B9=BE?= =?UTF-8?q?-=E5=B7=A5=E8=B5=84=E5=8D=95=E6=9F=A5=E7=9C=8B=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=A2=86=E5=AF=BC=E6=9F=A5=E8=AF=A2=E4=B8=8B=E5=B1=9E?= =?UTF-8?q?=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/mySalaryBenefits/components/payrollTable/index.js | 2 +- .../pages/mySalaryBenefits/components/subPayroll/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js index 68a4a76a..01140f4f 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js +++ b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js @@ -117,7 +117,7 @@ class Index extends Component { } >