From 19f183795cd7e007448e273ff3c0fbce06fe33b1 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, 9 Oct 2023 09:41:48 +0800 Subject: [PATCH 01/17] =?UTF-8?q?feature/2.9.42309.01-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=94=B9=E9=80=A0=EF=BC=88=E9=A1=B5=E9=9D=A2=E7=BC=96?= =?UTF-8?q?=E8=BE=91=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/calculate/index.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculate/index.js b/pc4mobx/hrmSalary/pages/calculate/index.js index bef234ff..d9a3699a 100644 --- a/pc4mobx/hrmSalary/pages/calculate/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/index.js @@ -71,13 +71,9 @@ export default class Calculate extends React.Component { // 列表项核算回调 handleAccount(record) { window.open( - "/spa/hrmSalary/static/index.html#/main/hrmSalary/calculate/" + + "/spa/hrmSalary/static/index.html#/main/hrmSalary/calculateDetail?id=" + record.id ); - // window.open( - // "/spa/hrmSalary/static/index.html#/main/hrmSalary/calculateDetail?id=" + - // record.id - // ); } // 列表项删除回调 From 321275d406df18f1969de15903a8b8dfdaf849ac 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, 9 Oct 2023 13:17:54 +0800 Subject: [PATCH 02/17] =?UTF-8?q?feature/2.9.42310.01-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E9=A1=B5=E9=9D=A2=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/index.js | 3 +- .../hrmSalary/pages/calculate/calculate.js | 59 ++++++++++ pc4mobx/hrmSalary/pages/calculate/columns.js | 56 --------- .../components/calculateQuery/index.js | 34 ++++++ .../components/calculateTablelist/index.js | 110 ++++++++++++++++++ pc4mobx/hrmSalary/pages/calculate/index.less | 36 ++++++ 6 files changed, 241 insertions(+), 57 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/calculate/calculate.js delete mode 100644 pc4mobx/hrmSalary/pages/calculate/columns.js create mode 100644 pc4mobx/hrmSalary/pages/calculate/components/calculateQuery/index.js create mode 100644 pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index cbaf1ff0..ca8f7464 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -15,7 +15,8 @@ import CumSituation from "./pages/dataAcquisition/cumSituation"; import Attendance from "./pages/dataAcquisition/attendance"; import SpecialAddDeduction from "./pages/dataAcquisition/specialAddDeduction"; import Ledger from "./pages/ledgerPage"; -import Calculate from "./pages/calculate"; +// import Calculate from "./pages/calculate"; +import Calculate from "./pages/calculate/calculate"; //重构的薪资核算页面 import Payroll from "./pages/payroll"; import PayrollGrant from "./pages/payroll/payrollGrant"; import PayrollDetail from "./pages/payroll/payrollDetail"; diff --git a/pc4mobx/hrmSalary/pages/calculate/calculate.js b/pc4mobx/hrmSalary/pages/calculate/calculate.js new file mode 100644 index 00000000..901f0ea0 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/calculate.js @@ -0,0 +1,59 @@ +/* + * Author: 黎永顺 + * name: 薪资核算-重构页面 + * Description: + * Date: 2023/10/9 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaLocaleProvider, WeaTop } from "ecCom"; +import { Button } from "antd"; +import moment from "moment"; +import CalculateQuery from "./components/calculateQuery"; +import CalculateTablelist from "./components/calculateTablelist"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("calculateStore", "taxAgentStore") +@observer +class Calculate extends Component { + constructor(props) { + super(props); + this.state = { + queryParams: { + name: "", + dateRange: [ + moment(new Date()).startOf("year").format("YYYY-MM"), + moment(new Date()).startOf("month").format("YYYY-MM") + ] + } + }; + } + + renderCalculateOpts = () => { + const { taxAgentStore: { showOperateBtn } } = this.props; + const { queryParams } = this.state; + let calculateOpts = [ + , + { + }} onChange={v => this.setState({ queryParams: { ...queryParams, ...v } })}/> + ]; + return !showOperateBtn ? calculateOpts.slice(1) : calculateOpts; + }; + + render() { + const { queryParams } = this.state; + return ( + } iconBgcolor="#F14A2D" + buttons={this.renderCalculateOpts()} + > +
+ +
+
+ ); + } +} + +export default Calculate; diff --git a/pc4mobx/hrmSalary/pages/calculate/columns.js b/pc4mobx/hrmSalary/pages/calculate/columns.js deleted file mode 100644 index 17c4adc3..00000000 --- a/pc4mobx/hrmSalary/pages/calculate/columns.js +++ /dev/null @@ -1,56 +0,0 @@ -export const columns = [ - { - title: "薪资所属月", - dataIndex: 'title', - key: 'title', - }, - { - title: "薪资账套", - dataIndex: 'title', - key: 'title', - }, - { - title: "状态", - dataIndex: 'title', - key: 'title', - }, - { - title: "税款所属期", - dataIndex: 'title', - key: 'title', - }, - { - title: "核算人数", - dataIndex: 'title', - key: 'title', - }, - { - title: "核算人", - dataIndex: 'title', - key: 'title', - }, - { - title: "最后操作时间", - dataIndex: 'title', - key: 'title', - }, - { - title: "备注", - dataIndex: 'title', - key: 'title', - }, - { - title: "操作", - dataIndex: 'cz', - key: 'cz', - } -] - -export const dataSource = [{ - title: "测试" -}]; - - - - - diff --git a/pc4mobx/hrmSalary/pages/calculate/components/calculateQuery/index.js b/pc4mobx/hrmSalary/pages/calculate/components/calculateQuery/index.js new file mode 100644 index 00000000..00cd202d --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/components/calculateQuery/index.js @@ -0,0 +1,34 @@ +/* + * Author: 黎永顺 + * name: 薪资核算-查询 + * Description: + * Date: 2023/10/9 + */ +import React, { Component } from "react"; +import { WeaInputSearch, WeaLocaleProvider } from "ecCom"; +import { MonthRangePicker } from "../../../reportView/components/statisticalMicroSettingsSlide"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + render() { + const { queryParams } = this.props; + const { dateRange, name } = queryParams; + return ( +
+
+ {getLabel(543549, "薪资所属月:")} + this.props.onChange({ dateRange: v })}/> +
+ this.props.onChange({ name: v })} + onSearch={this.props.onSearch} + /> +
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js b/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js new file mode 100644 index 00000000..2848af2e --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js @@ -0,0 +1,110 @@ +/* + * Author: 黎永顺 + * name: 薪资核算-列表 + * Description: + * Date: 2023/10/9 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; +import { getSalaryAcctList } from "../../../../apis/calculate"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, columns: [], dataSource: [], + pageInfo: { current: 1, pageSize: 10, total: 0 } + }; + } + + componentDidMount() { + const { queryParams } = this.props; + const { dateRange, ...extra } = queryParams; + const [startMonthStr, endMonthStr] = dateRange || []; + const params = { startMonthStr, endMonthStr, ...extra }; + this.getSalaryAcctList(params); + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.queryParams !== this.props.queryParams) { + const { queryParams } = nextProps; + const { dateRange, ...extra } = queryParams; + const [startMonthStr, endMonthStr] = dateRange || []; + const params = { startMonthStr, endMonthStr, ...extra }; + this.getSalaryAcctList(params); + } + } + + getSalaryAcctList = (params) => { + const { pageInfo } = this.state; + const payload = { ...pageInfo, ...params }; + this.setState({ loading: true }); + getSalaryAcctList(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource, pageNum, pageSize, total } = data; + this.setState({ + dataSource, pageInfo: { ...pageInfo, pageNum, pageSize, total }, + columns: _.map(_.filter(columns, it => (it.dataIndex !== "backCalcStatus" && it.dataIndex !== "acctTimes")), + o => { + const { dataIndex } = o; + let width = ""; + switch (dataIndex) { + case "status": + case "employeeSize": + width = "5%"; + break; + case "salarySobName": + width = "20%"; + break; + case "taxCycle": + case "description": + width = "15%"; + break; + default: + width = "10%"; + break; + } + if (dataIndex === "operate") { + } + return { ...o, width }; + }) + }); + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { loading, dataSource, 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 } + }, () => { + }); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => { + }); + } + }; + return ( + + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/calculate/index.less b/pc4mobx/hrmSalary/pages/calculate/index.less index 2a274b60..03f4218d 100644 --- a/pc4mobx/hrmSalary/pages/calculate/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/index.less @@ -43,3 +43,39 @@ } } } + +//重构薪资核算页 +.salary-btn-flex { + display: flex; + align-items: center; + + .mounth-range { + display: flex; + align-items: center; + margin-right: 10px; + + .label { + color: #999; + } + } + + .wea-input-focus { + margin-top: -4px; + } +} + +.calculate-body { + background: #f6f6f6; + height: 100%; + width: 100%; + padding: 16px; + + .ant-table-tbody { + td { + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } +} From 3fdef5ba855832237ec5ff8dbf452e4223aea1fc 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, 9 Oct 2023 15:15:59 +0800 Subject: [PATCH 03/17] =?UTF-8?q?feature/2.9.42310.01-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E9=A1=B5=E9=9D=A2=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/pages/calculate/calculate.js | 2 +- .../components/calculateQuery/index.js | 1 - .../components/calculateTablelist/index.js | 80 ++++++++++++++----- pc4mobx/hrmSalary/pages/calculate/index.less | 36 ++++++--- 4 files changed, 87 insertions(+), 32 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculate/calculate.js b/pc4mobx/hrmSalary/pages/calculate/calculate.js index 901f0ea0..960a04d9 100644 --- a/pc4mobx/hrmSalary/pages/calculate/calculate.js +++ b/pc4mobx/hrmSalary/pages/calculate/calculate.js @@ -46,7 +46,7 @@ class Calculate extends Component { const { queryParams } = this.state; return ( } iconBgcolor="#F14A2D" - buttons={this.renderCalculateOpts()} + buttons={this.renderCalculateOpts()} className="calculate-main-layout" >
diff --git a/pc4mobx/hrmSalary/pages/calculate/components/calculateQuery/index.js b/pc4mobx/hrmSalary/pages/calculate/components/calculateQuery/index.js index 00cd202d..4c2a4337 100644 --- a/pc4mobx/hrmSalary/pages/calculate/components/calculateQuery/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/components/calculateQuery/index.js @@ -24,7 +24,6 @@ class Index extends Component { this.props.onChange({ name: v })} - onSearch={this.props.onSearch} />
); diff --git a/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js b/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js index 2848af2e..da32f150 100644 --- a/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js @@ -5,7 +5,8 @@ * Date: 2023/10/9 */ import React, { Component } from "react"; -import { WeaLocaleProvider, WeaTable } from "ecCom"; +import { WeaHelpfulTip, WeaLocaleProvider, WeaTable } from "ecCom"; +import { Dropdown, Menu, Tag } from "antd"; import { getSalaryAcctList } from "../../../../apis/calculate"; const getLabel = WeaLocaleProvider.getLabel; @@ -20,25 +21,19 @@ class Index extends Component { } componentDidMount() { - const { queryParams } = this.props; - const { dateRange, ...extra } = queryParams; - const [startMonthStr, endMonthStr] = dateRange || []; - const params = { startMonthStr, endMonthStr, ...extra }; - this.getSalaryAcctList(params); + this.getSalaryAcctList(this.props); } componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.queryParams !== this.props.queryParams) { - const { queryParams } = nextProps; - const { dateRange, ...extra } = queryParams; - const [startMonthStr, endMonthStr] = dateRange || []; - const params = { startMonthStr, endMonthStr, ...extra }; - this.getSalaryAcctList(params); - } + if (nextProps.queryParams !== this.props.queryParams) this.getSalaryAcctList(nextProps); } - getSalaryAcctList = (params) => { + getSalaryAcctList = (props) => { const { pageInfo } = this.state; + const { queryParams } = props; + const { dateRange, ...extra } = queryParams; + const [startMonthStr, endMonthStr] = dateRange || []; + const params = { startMonthStr, endMonthStr, ...extra }; const payload = { ...pageInfo, ...params }; this.setState({ loading: true }); getSalaryAcctList(payload).then(({ status, data }) => { @@ -59,7 +54,6 @@ class Index extends Component { case "salarySobName": width = "20%"; break; - case "taxCycle": case "description": width = "15%"; break; @@ -68,6 +62,56 @@ class Index extends Component { break; } if (dataIndex === "operate") { + return { + ...o, width: 170, + title: + {getLabel(30585, "操作")} + + , + render: (__, record) => { + const { operate = [] } = record; + return + { + _.map(operate.slice(0, 2), f => ( + {f.text} + )) + } + { + !_.isEmpty(operate.slice(2)) && + + { + _.map(operate.slice(2), g => ({g.text})) + } + + } + > + + + } + ; + } + }; + } else if (dataIndex === "salarySobName") { + return { + ...o, width, + render: (text, record) => { + const { acctTimes, backCalcStatus } = record; + return
+ {text} +
+ { + backCalcStatus === 1 && + + } + {`${getLabel(15323, "第")}${acctTimes}${getLabel(18929, "次")}`} +
+
; + } + }; } return { ...o, width }; }) @@ -87,14 +131,12 @@ class Index extends Component { onShowSizeChange: (current, pageSize) => { this.setState({ pageInfo: { ...pageInfo, current, pageSize } - }, () => { - }); + }, () => this.getSalaryAcctList(this.props)); }, onChange: current => { this.setState({ pageInfo: { ...pageInfo, current } - }, () => { - }); + }, () => this.getSalaryAcctList(this.props)); } }; return ( diff --git a/pc4mobx/hrmSalary/pages/calculate/index.less b/pc4mobx/hrmSalary/pages/calculate/index.less index 03f4218d..332729cf 100644 --- a/pc4mobx/hrmSalary/pages/calculate/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/index.less @@ -30,6 +30,9 @@ & > span { flex: 1; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } .salarySobNameTagWrapper { @@ -64,18 +67,29 @@ } } -.calculate-body { - background: #f6f6f6; - height: 100%; - width: 100%; - padding: 16px; +.calculate-main-layout { + .wea-new-top-content { + overflow-y: hidden; + } - .ant-table-tbody { - td { - width: 100%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; + .calculate-body { + height: 100%; + width: 100%; + padding: 16px; + overflow-y: auto; + + .wea-new-table { + background: #fff; } + + .ant-table-tbody { + td { + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } + } } From d00e46442dd7ceec9d7bc8a5858f2f67b0606030 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, 9 Oct 2023 15:33:19 +0800 Subject: [PATCH 04/17] hotfix/2.9.42310.01 --- pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index 78c77a40..8ac0a3cd 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -37,7 +37,7 @@ class Index extends Component { super(props); this.state = { year: moment(new Date()).format("YYYY"), - declareMonth: moment(new Date()).month() + 1 > 10 ? (moment(new Date()).month() + 1) + "" : "0" + (moment(new Date()).month() + 1), + declareMonth: moment(new Date()).month() + 1 >= 10 ? (moment(new Date()).month() + 1) + "" : "0" + (moment(new Date()).month() + 1), taxAgentId: "", innerWidth: window.innerWidth, addAllLoading: false, From 3fe4ede88772687912c2872358810fafcf290bf9 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, 9 Oct 2023 17:48:45 +0800 Subject: [PATCH 05/17] =?UTF-8?q?feature/2.9.42310.01-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E9=A1=B5=E9=9D=A2=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/pages/calculate/calculate.js | 30 ++++-- .../components/calculateDialog/condition.js | 43 +++++++++ .../components/calculateDialog/index.js | 92 +++++++++++++++++++ .../components/calculateQuery/index.js | 1 + .../components/calculateTablelist/index.js | 2 +- pc4mobx/hrmSalary/pages/calculate/index.less | 36 ++++++++ pc4mobx/hrmSalary/stores/calculate.js | 4 + 7 files changed, 200 insertions(+), 8 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/calculate/components/calculateDialog/condition.js create mode 100644 pc4mobx/hrmSalary/pages/calculate/components/calculateDialog/index.js diff --git a/pc4mobx/hrmSalary/pages/calculate/calculate.js b/pc4mobx/hrmSalary/pages/calculate/calculate.js index 960a04d9..f289d080 100644 --- a/pc4mobx/hrmSalary/pages/calculate/calculate.js +++ b/pc4mobx/hrmSalary/pages/calculate/calculate.js @@ -11,6 +11,7 @@ import { Button } from "antd"; import moment from "moment"; import CalculateQuery from "./components/calculateQuery"; import CalculateTablelist from "./components/calculateTablelist"; +import CalculateDialog from "./components/calculateDialog"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; @@ -27,29 +28,44 @@ class Calculate extends Component { moment(new Date()).startOf("year").format("YYYY-MM"), moment(new Date()).startOf("month").format("YYYY-MM") ] - } + }, + isRefresh: false, + calcDaialog: { visible: false, title: "" } }; } renderCalculateOpts = () => { const { taxAgentStore: { showOperateBtn } } = this.props; - const { queryParams } = this.state; + const { queryParams, isRefresh } = this.state; let calculateOpts = [ - , - { - }} onChange={v => this.setState({ queryParams: { ...queryParams, ...v } })}/> + , + this.setState({ + isRefresh: _.keys(v)[0] === "name" ? isRefresh : !isRefresh, + queryParams: { ...queryParams, ...v } + })} onSearch={() => this.setState({ isRefresh: !isRefresh })}/> ]; return !showOperateBtn ? calculateOpts.slice(1) : calculateOpts; }; render() { - const { queryParams } = this.state; + const { queryParams, isRefresh, calcDaialog } = this.state; return ( } iconBgcolor="#F14A2D" buttons={this.renderCalculateOpts()} className="calculate-main-layout" >
- + + this.setState({ + calcDaialog: { ...calcDaialog, visible: false }, + isRefresh: bool === "refresh" ? !isRefresh : isRefresh + }, () => bool === "refresh" && window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/calculate/${id}`))} + />
); diff --git a/pc4mobx/hrmSalary/pages/calculate/components/calculateDialog/condition.js b/pc4mobx/hrmSalary/pages/calculate/components/calculateDialog/condition.js new file mode 100644 index 00000000..3274d070 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/components/calculateDialog/condition.js @@ -0,0 +1,43 @@ +export const calculateConditions = [ + { + items: [ + { + colSpan: 1, + conditionType: "MONTHPICKER", + domkey: ["salaryMonthStr"], + fieldcol: 14, + label: "薪资所属月", + lanId: 542604, + labelcol: 6, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + colSpan: 1, + conditionType: "SELECT", + domkey: ["salarySobId"], + fieldcol: 14, + label: "核算账套", + lanId: 519146, + labelcol: 6, + options: [], + rules: "required|string", + viewAttr: 3 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["description"], + fieldcol: 14, + label: "备注", + lanId: 536726, + labelcol: 6, + value: "", + viewAttr: 2 + } + ], + defaultshow: true, + title: "" + } +]; diff --git a/pc4mobx/hrmSalary/pages/calculate/components/calculateDialog/index.js b/pc4mobx/hrmSalary/pages/calculate/components/calculateDialog/index.js new file mode 100644 index 00000000..db89f81b --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/components/calculateDialog/index.js @@ -0,0 +1,92 @@ +/* + * Author: 黎永顺 + * name: 薪资核算重构-核算弹框 + * Description: + * Date: 2023/10/9 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; +import { Button, message } from "antd"; +import { getSearchs } from "../../../../util"; +import { salaryacctGetForm, saveBasic } from "../../../../apis/calculate"; +import { calculateConditions } from "./condition"; + +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; + +@inject("calculateStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + conditions: [], loading: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.salaryacctGetForm(nextProps); + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.calculateStore.initCalcForm(); + } + + salaryacctGetForm = (props) => { + const { calculateStore: { calculateForm } } = props; + salaryacctGetForm().then(({ status, data }) => { + if (status) { + const { salarySobs } = data; + this.setState({ + conditions: _.map(calculateConditions, item => ({ + ...item, + items: _.map(item.items, o => { + if (getKey(o) === "salarySobId") { + return { + ...o, + options: _.map(salarySobs, g => ({ key: g.id.toString(), showname: g.name })) + }; + } + return { ...o }; + }) + })) + }, () => calculateForm.initFormFields(this.state.conditions)); + } + }); + }; + save = () => { + const { calculateStore: { calculateForm } } = this.props; + calculateForm.validateForm().then(f => { + if (f.isValid) { + const payload = calculateForm.getFormParams(); + this.setState({ loading: true }); + saveBasic({ ...payload }).then(({ status, data, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(30700, "操作成功")); + this.props.onCancel("refresh", data); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: false })); + } else { + f.showErrors(); + } + }); + }; + + render() { + const { conditions, loading } = this.state; + const { calculateStore: { calculateForm } } = this.props; + return ( + {getLabel(543233, "保存并进入核算")} + ]} + > +
{getSearchs(calculateForm, conditions, 1, false)}
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/calculate/components/calculateQuery/index.js b/pc4mobx/hrmSalary/pages/calculate/components/calculateQuery/index.js index 4c2a4337..00cd202d 100644 --- a/pc4mobx/hrmSalary/pages/calculate/components/calculateQuery/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/components/calculateQuery/index.js @@ -24,6 +24,7 @@ class Index extends Component { this.props.onChange({ name: v })} + onSearch={this.props.onSearch} /> ); diff --git a/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js b/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js index da32f150..d13b6e1e 100644 --- a/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js @@ -25,7 +25,7 @@ class Index extends Component { } componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.queryParams !== this.props.queryParams) this.getSalaryAcctList(nextProps); + if (nextProps.isRefresh !== this.props.isRefresh) this.getSalaryAcctList(nextProps); } getSalaryAcctList = (props) => { diff --git a/pc4mobx/hrmSalary/pages/calculate/index.less b/pc4mobx/hrmSalary/pages/calculate/index.less index 332729cf..013d6d00 100644 --- a/pc4mobx/hrmSalary/pages/calculate/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/index.less @@ -93,3 +93,39 @@ } } + +.calculate-dialog-layout { + background: #f6f6f6; + + .wea-search-group { + padding: 16px; + } + + .wea-select, .ant-select-selection, .ant-select { + width: 100%; + } + + .wea-select { + display: inline-block; + position: relative; + } + + .ant-select-selection { + height: 30px; + border-radius: 0; + } + + .wea-content { + padding: 0; + + .wea-form-cell-wrapper { + background: #FFF; + border: 1px solid #e5e5e5; + border-bottom: none; + + .wea-form-cell { + border-bottom: 1px solid #e5e5e5; + } + } + } +} diff --git a/pc4mobx/hrmSalary/stores/calculate.js b/pc4mobx/hrmSalary/stores/calculate.js index 2bb4e253..71f64ab6 100644 --- a/pc4mobx/hrmSalary/stores/calculate.js +++ b/pc4mobx/hrmSalary/stores/calculate.js @@ -11,6 +11,7 @@ export class calculateStore { @observable PCSearchForm = new WeaForm(); //人员确认-form @observable ECSearchForm = new WeaForm(); //薪资核算-form @observable otherConditions = []; //薪资核算-其他查询条件 + @observable calculateForm = new WeaForm(); //薪资核算重构-核算form @observable tableStore = new TableStore(); // new table @@ -71,6 +72,9 @@ export class calculateStore { // ** 薪资核算-其他条件查询 ** @action setOtherConditions = (otherConditions) => this.otherConditions = otherConditions; + // ** 薪资核算重构-初始化核算form ** + @action + initCalcForm = () => this.calculateForm = new WeaForm(); // ** 设置导入参数 ** @action From 93d996c79f2e7095c01d1d47f5a25fdc7a51467b 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, 10 Oct 2023 17:49:45 +0800 Subject: [PATCH 06/17] =?UTF-8?q?feature/2.9.42310.01-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E9=A1=B5=E9=9D=A2=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/pages/calculate/calculate.js | 144 +++++++++++++++++- .../components/calculateTablelist/index.js | 5 +- 2 files changed, 142 insertions(+), 7 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculate/calculate.js b/pc4mobx/hrmSalary/pages/calculate/calculate.js index f289d080..ae98e007 100644 --- a/pc4mobx/hrmSalary/pages/calculate/calculate.js +++ b/pc4mobx/hrmSalary/pages/calculate/calculate.js @@ -7,12 +7,14 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaLocaleProvider, WeaTop } from "ecCom"; -import { Button } from "antd"; +import { Button, message, Modal } from "antd"; import moment from "moment"; import CalculateQuery from "./components/calculateQuery"; import CalculateTablelist from "./components/calculateTablelist"; import CalculateDialog from "./components/calculateDialog"; +import { backCalculate, deleteSalaryacct, fileSalaryAcct, reAccounting } from "../../apis/calculate"; import "./index.less"; +import ProgressModal from "../../components/progressModal"; const getLabel = WeaLocaleProvider.getLabel; @@ -28,10 +30,12 @@ class Calculate extends Component { moment(new Date()).startOf("year").format("YYYY-MM"), moment(new Date()).startOf("month").format("YYYY-MM") ] - }, - isRefresh: false, + }, isRefresh: false, + progressModule: { visible: false, progress: 0, title: getLabel(111, "正在归档中请稍后") }, calcDaialog: { visible: false, title: "" } }; + this.timer = null; + this.handleDebounce = null; } renderCalculateOpts = () => { @@ -51,21 +55,151 @@ class Calculate extends Component { ]; return !showOperateBtn ? calculateOpts.slice(1) : calculateOpts; }; + handleCalcOpts = ({ key }, record) => { + const { isRefresh, progressModule } = this.state, { id } = record; + switch (key) { + case "0": + //核算 + window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/calculate/${id}`); + break; + case "1": + //删除 + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(543231, "确认删除本条数据吗?"), + onOk: () => { + deleteSalaryacct([id]).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(502230, "删除成功!")); + this.setState({ isRefresh: !isRefresh }); + } else { + message.error(errormsg); + } + }); + } + }); + break; + case "2": + //归档 + if (!this.handleDebounce) { + this.handleDebounce = _.debounce(() => { + if (this.timer) clearInterval(this.timer); + this.setState({ progressModule: { ...progressModule, visible: true } }); + this.timer = setInterval(() => { + if (progressModule.progress === 100 && this.timer) { + clearInterval(this.timer); + this.timer = null; + this.setState({ + progressModule: { ...progressModule, visible: false, progress: 0 }, + isRefresh: !isRefresh + }); + } + this.setState({ + progressModule: { ...progressModule, progress: progressModule.progress + 1 } + }); + }, 800); + fileSalaryAcct({ id }).then(({ status, errormsg }) => { + if (status) { + clearInterval(this.timer); + this.timer = null; + this.setState({ + progressModule: { ...progressModule, visible: false, progress: 0 }, + isRefresh: !isRefresh + }); + message.success(getLabel(503690, "归档成功")); + } else { + clearInterval(this.timer); + this.timer = null; + this.setState({ + progressModule: { ...progressModule, visible: false, progress: 0 } + }); + message.error(errormsg); + } + }); + this.handleDebounce = null; + }, 500); + } + this.handleDebounce(); + break; + case "3": + //查看详情 + window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/placeOnFileDetail?id=${id}`); + break; + case "4": + //重新核算 + if (!this.handleDebounce) { + this.handleDebounce = _.debounce(() => { + reAccounting({ salaryAcctRecordId: id }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(30700, "操作成功!")); + this.setState({ isRefresh: !isRefresh }); + } else { + message.error(errormsg); + } + }); + this.handleDebounce = null; + }, 500); + } + this.handleDebounce(); + break; + case "5": + //回算 + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(543538, "确定回算吗?回算后,正常核算的数据会被覆盖,正常核算的工资单不能继续发放或撤回!"), + onOk: () => { + if (!this.handleDebounce) { + this.handleDebounce = _.debounce(() => { + backCalculate({ salaryAcctRecordId: id }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(544367, "回算成功!")); + this.setState({ isRefresh: !isRefresh }); + } else { + message.error(errormsg); + } + }); + this.handleDebounce = null; + }, 500); + } + this.handleDebounce(); + } + }); + break; + default: + break; + } + }; render() { - const { queryParams, isRefresh, calcDaialog } = this.state; + const { queryParams, isRefresh, calcDaialog, progressModule } = this.state; return ( } iconBgcolor="#F14A2D" buttons={this.renderCalculateOpts()} className="calculate-main-layout" >
- + this.setState({ calcDaialog: { ...calcDaialog, visible: false }, isRefresh: bool === "refresh" ? !isRefresh : isRefresh }, () => bool === "refresh" && window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/calculate/${id}`))} /> + {/* 归档进度条*/} + { + progressModule.visible && + { + this.setState({ + progressModule: { + ...progressModule, + visible: false, + progress: 0 + } + }, () => clearInterval(this.timer)); + }} + /> + }
); diff --git a/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js b/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js index d13b6e1e..7fc9df9a 100644 --- a/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js @@ -76,13 +76,14 @@ class Index extends Component { return { _.map(operate.slice(0, 2), f => ( - {f.text} + this.props.onCalcOpts({ key: f.index }, record)}>{f.text} )) } { !_.isEmpty(operate.slice(2)) && + overlay={ this.props.onCalcOpts(e, record)}> { _.map(operate.slice(2), g => ({g.text})) } From 54b4ebe83a55f257c211958d13f6b2a0b35256ae 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, 11 Oct 2023 13:55:10 +0800 Subject: [PATCH 07/17] =?UTF-8?q?=E8=96=AA=E8=B5=84=E6=A0=B8=E7=AE=97?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=AF=BC=E5=85=A5=E8=96=AA=E8=B5=84=E9=A1=B9?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../customCalcExportDialog/index.js | 3 ++- .../customCalcExportDialog/index.less | 16 ++++++++++++++ .../importModal/addHeaderFieldsModal.js | 21 +++++++++++++++++-- .../acctResult/importModal/index.less | 5 +++++ 4 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.less diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js index 9d76e00f..c3e1f838 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js @@ -11,6 +11,7 @@ import { inject, observer } from "mobx-react"; import { WeaCheckbox, WeaDialog, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; import { customCacheExportField } from "../../../../../apis/calculate"; import { convertToUrlString } from "../../../../../util/url"; +import "./index.less"; const { getLabel } = WeaLocaleProvider; @@ -85,7 +86,7 @@ class Index extends Component { } return ( { + if (checked === "1") { + this.setState({ + itemsCheckeds: _.reduce(this.props.itemsByGroup, (pre, cur) => { + return [...pre, ..._.map(cur.salaryItems, it => it.salaryItemId)]; + }, []) + }); + } else { + this.setState({ itemsCheckeds: [] }); + } + }; render() { const { showOnlyChecked, itemsCheckeds } = this.state; @@ -72,8 +83,14 @@ class AddHeaderFieldsModal extends Component { , ]} - bottomLeft={} + bottomLeft={ + + + + + } > { _.map(dataSource, item => { diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/index.less b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/index.less index 1de6458c..1afe4e6c 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/index.less +++ b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/index.less @@ -2,6 +2,11 @@ .wea-search-group { .wea-title { padding-left: 0 !important; + font-weight: 700 !important; + } + + .ant-col-8 { + padding: 0 8px !important; } .wea-content { From 5e51f78ff61bcb17d495fee035317407c97bc9b6 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, 11 Oct 2023 15:05:24 +0800 Subject: [PATCH 08/17] =?UTF-8?q?feature/2.9.42310.01-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E9=A1=B5=E9=9D=A2=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/single.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pc4mobx/hrmSalary/single.js b/pc4mobx/hrmSalary/single.js index 329e1bea..863c0a8a 100644 --- a/pc4mobx/hrmSalary/single.js +++ b/pc4mobx/hrmSalary/single.js @@ -29,6 +29,13 @@ const Home = props => props.children; class Root extends React.Component { componentWillMount() { + const src = "/spa/hrmSalary/hrmSalaryCalculateDetail/css/iconfont/iconfont.css" + const link = document.createElement("link") + link.setAttribute('rel','stylesheet'); + link.setAttribute('type','text/css'); + link.setAttribute('href',src); + let header = document.getElementById("container") + header.appendChild(link) top.$(".ant-message").remove(); window.location.hash.indexOf("mobilepayroll") === -1 && allStore.taxAgentStore.getPermission(); if (window.location.hash.indexOf("payroll") !== -1) { From dd9d429a81d220fed8d6b95de25eec3c88d3d865 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, 11 Oct 2023 16:23:55 +0800 Subject: [PATCH 09/17] =?UTF-8?q?hotfix/2.9.42310.01=20=E5=B7=A5=E8=B5=84?= =?UTF-8?q?=E5=8D=95=E6=9F=A5=E7=9C=8B=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/mySalaryBenefits.js | 26 ++++--- pc4mobx/hrmSalary/apis/payroll.js | 9 ++- .../hrmSalary/pages/mobilePayroll/index.js | 70 +++++++++++-------- pc4mobx/hrmSalary/util/request.js | 54 +++++++------- 4 files changed, 93 insertions(+), 66 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/mySalaryBenefits.js b/pc4mobx/hrmSalary/apis/mySalaryBenefits.js index e985ac5a..d28d7ed7 100644 --- a/pc4mobx/hrmSalary/apis/mySalaryBenefits.js +++ b/pc4mobx/hrmSalary/apis/mySalaryBenefits.js @@ -1,4 +1,5 @@ import { WeaTools } from "ecCom"; +import { formHeaderPost } from "../util/request"; import { convertToUrlString } from "../util/url"; // 工资单列表 @@ -26,23 +27,25 @@ export const recordList = params => { // 工资查看详情 export const mySalaryBill = params => { - return fetch(`/api/bs/hrmsalary/salaryBill/mySalaryBill?${convertToUrlString(params)}`, { + const { header, ...payload } = params; + return fetch(`/api/bs/hrmsalary/salaryBill/mySalaryBill?${convertToUrlString(payload)}`, { method: "GET", mode: "cors", - headers: { - "Content-Type": "application/json" - } + headers: { "Content-Type": "application/json", ...header } }).then(res => res.json()); }; -export const isNeedSecondPwdVerify = params => { - return WeaTools.callApi("/api/encrypt/secondauthsetting/isNeedSecondAuth", "POST", params); +export const isNeedSecondPwdVerify = (params, headers) => { + return formHeaderPost("/api/encrypt/secondauthsetting/isNeedSecondAuth", "POST", params, headers); + // return WeaTools.callApi("/api/encrypt/secondauthsetting/isNeedSecondAuth", "POST", params); }; -export const getSecondAuthForm = params => { - return WeaTools.callApi("/api/encrypt/secondauthsetting/getSecondAuthForm", "POST", params); +export const getSecondAuthForm = (params, headers) => { + return formHeaderPost("/api/encrypt/secondauthsetting/getSecondAuthForm", "POST", params, headers); + // return WeaTools.callApi("/api/encrypt/secondauthsetting/getSecondAuthForm", "POST", params); }; -export const doSecondAuth = params => { - return WeaTools.callApi("/api/encrypt/secondauthsetting/doSecondAuth", "POST", params); +export const doSecondAuth = (params, headers) => { + return formHeaderPost("/api/encrypt/secondauthsetting/doSecondAuth", "POST", params, headers); + // return WeaTools.callApi("/api/encrypt/secondauthsetting/doSecondAuth", "POST", params); }; export const checkPassword = params => { return WeaTools.callApi("/api/hrm/secondarypwd/checkPassword", "POST", params); @@ -50,3 +53,6 @@ export const checkPassword = params => { export const saveSecondaryPwd = params => { return WeaTools.callApi("/api/hrm/secondarypwd/saveSecondaryPwd", "POST", params); }; +export const salaryBillGetToken = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/getToken", "GET", params); +}; diff --git a/pc4mobx/hrmSalary/apis/payroll.js b/pc4mobx/hrmSalary/apis/payroll.js index 14c949d5..890c7069 100644 --- a/pc4mobx/hrmSalary/apis/payroll.js +++ b/pc4mobx/hrmSalary/apis/payroll.js @@ -1,5 +1,6 @@ import { WeaTools } from "ecCom"; import { postFetch } from "../util/request"; +import { convertToUrlString } from "../util/url"; //工资单-工资单发放列表 export const getPayrollList = params => { @@ -377,7 +378,13 @@ export const payrollCheckType = params => { }; //工资单-反馈验证 export const feedBackSalaryBill = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/feedBackSalaryBill", "GET", params); + const { header, ...payload } = params; + return fetch(`/api/bs/hrmsalary/salaryBill/feedBackSalaryBill?${convertToUrlString(payload)}`, { + method: "GET", + mode: "cors", + headers: { "Content-Type": "application/json", ...header } + }).then(res => res.json()); + // return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/feedBackSalaryBill", "GET", params); }; //工资单-确认 export const confirmSalaryBill = params => { diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js index dc72e97c..9cfc0a52 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js @@ -8,6 +8,7 @@ import ComputerTemplate from "../payroll/templatePreview/computerTemplate"; import PhoneTemplate from "../payroll/templatePreview/phoneTemplate"; import "../payroll/templatePreview/index.less"; import * as API from "../../apis/mySalaryBenefits"; +import { salaryBillGetToken } from "../../apis/mySalaryBenefits"; import { confirmSalaryBill, feedBackSalaryBill, payrollCheckType } from "../../apis/payroll"; import CaptchaModal from "../../components/captchaModal"; import PassSetDialog from "./passSetDialog"; @@ -30,7 +31,8 @@ export default class MobilePayroll extends React.Component { mySalaryBillData: { employeeInformation: {}, salaryTemplate: [] - } + }, + salaryBillToken: {} }; this.id = ""; } @@ -39,37 +41,40 @@ export default class MobilePayroll extends React.Component { const type = getQueryString("type"); this.id = getQueryString("id"); const { mySalaryStore: { init } } = this.props; - const { data, status } = await payrollCheckType(); if (type !== "phone") { + const { data, status } = await payrollCheckType(); if (status && data === "PWD") { init(false, () => this.getMySalaryBill(this.id)); } else { this.setState({ captchaVisible: true }); } } - type === "phone" && this.initMobile(); + type === "phone" && await this.initMobile(); } - initMobile = () => { + initMobile = async () => { const { mySalaryStore: { setInitEmVerify } } = this.props; - // if (window.em) { - API.isNeedSecondPwdVerify({ mouldCode: "HRM", itemCode: "SALARY" }).then(({ status, isNeedSecondAuth }) => { - if (status && isNeedSecondAuth) { - this.setState({ visible: true }, () => { - API.getSecondAuthForm({ mouldCode: "HRM", itemCode: "SALARY" }).then(({ status, notSetting }) => { - this.setState({ notSetting }); - }); + const params = this.getUrlkey(); + const { data } = await salaryBillGetToken({ uid: _.pick(params, ["recipient"]).recipient }); + this.setState({ salaryBillToken: data }, () => { + API.isNeedSecondPwdVerify({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken) + .then(({ status, isNeedSecondAuth }) => { + if (status && isNeedSecondAuth) { + this.setState({ visible: true }, () => { + API.getSecondAuthForm({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken) + .then(({ status, notSetting }) => { + this.setState({ notSetting }); + }); + }); + } else { + this.getMySalaryBill(getQueryString("id")); + setInitEmVerify(); + } }); - } else { - this.getMySalaryBill(getQueryString("id")); - setInitEmVerify(); - } }); - // } else { - // setInitEmVerify(); - // } }; doSecondAuth = () => { + const { salaryBillToken } = this.state; const { mySalaryStore: { setInitEmVerify } } = this.props; if (!this.state.authCode) { this.refs.weaError.showError(); @@ -77,7 +82,7 @@ export default class MobilePayroll extends React.Component { } API.doSecondAuth({ authCode: this.state.authCode, mouldCode: "HRM", itemCode: "SALARY" - }).then(({ status, checkStatus, checkMsg }) => { + }, salaryBillToken).then(({ status, checkStatus, checkMsg }) => { if (status && checkStatus === "1") { message.success(checkMsg); setInitEmVerify(); @@ -89,10 +94,11 @@ export default class MobilePayroll extends React.Component { }); }; getMySalaryBill = (salaryInfoId) => { + const { salaryBillToken } = this.state; const { mySalaryStore: { getMySalaryBill } } = this.props; const params = this.getUrlkey(); const payload = { - salaryInfoId, + salaryInfoId, header: salaryBillToken, ..._.pick(params, ["recipient"]) }; getMySalaryBill(payload).then(result => { @@ -129,17 +135,19 @@ export default class MobilePayroll extends React.Component { title: getLabel(131329, "信息确认"), content: getLabel(111, "请确认薪资信息是有误,进行反馈并发起反馈流程。"), onOk: () => { - feedBackSalaryBill({ salaryInfoId: getQueryString("id") }).then(({ status, errorMsg }) => { - if (status) { - const { mySalaryBillData } = this.state; - const { salaryTemplate } = mySalaryBillData; - const { feedbackUrl } = salaryTemplate; - this.getMySalaryBill(getQueryString("id")); - window.open(`${window.ecologyContentPath || ""}${feedbackUrl}`); - } else { - message.error(errorMsg); - } - }); + const { salaryBillToken } = this.state; + feedBackSalaryBill({ salaryInfoId: getQueryString("id"), header: salaryBillToken }) + .then(({ status, errorMsg }) => { + if (status) { + const { mySalaryBillData } = this.state; + const { salaryTemplate } = mySalaryBillData; + const { feedbackUrl } = salaryTemplate; + this.getMySalaryBill(getQueryString("id")); + window.open(`${window.ecologyContentPath || ""}${feedbackUrl}`); + } else { + message.error(errorMsg); + } + }); } }); }; diff --git a/pc4mobx/hrmSalary/util/request.js b/pc4mobx/hrmSalary/util/request.js index a1140138..3c7ecf02 100644 --- a/pc4mobx/hrmSalary/util/request.js +++ b/pc4mobx/hrmSalary/util/request.js @@ -1,26 +1,32 @@ -export const formPost = (url, params) => { - url = url + "?__random__=" + (new Date()).valueOf(); - let formdata = new URLSearchParams(); - Object.keys(params).map(key => { - formdata.append(key, params[key]) - }) - return fetch(url, { - method:"POST", - headers:{ - "Content-Type":'application/x-www-form-urlencoded' - }, - body:formdata - }).then(res => res.json()) -} +export const formHeaderPost = (url, method, params, header) => { + url = url + "?__random__=" + (new Date()).valueOf(); + let formdata = new URLSearchParams(); + Object.keys(params).map(key => { + formdata.append(key, params[key]); + }); + return fetch(url, { + method, mode: "cors", + headers: { "Content-Type": "application/x-www-form-urlencoded", ...header }, + body: formdata + }).then(res => res.json()); +}; export const postFetch = (url, params) => { - url = url + "?__random__=" + (new Date()).valueOf(); - return fetch(url, { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} \ No newline at end of file + url = url + "?__random__=" + (new Date()).valueOf(); + return fetch(url, { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; +export const headerRequestFetch = (url, method, params, header) => { + url = url + "?__random__=" + (new Date()).valueOf(); + return fetch(url, { + method, mode: "cors", + headers: { "Content-Type": "application/json", ...header }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; From d67b8bc6ab5e176346da338737383cb7405d5d29 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, 11 Oct 2023 18:23:19 +0800 Subject: [PATCH 10/17] hotfix/2.9.42310.01 --- pc4mobx/hrmSalary/pages/mobilePayroll/index.js | 3 ++- pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js index 9cfc0a52..bd152a29 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js @@ -143,7 +143,8 @@ export default class MobilePayroll extends React.Component { const { salaryTemplate } = mySalaryBillData; const { feedbackUrl } = salaryTemplate; this.getMySalaryBill(getQueryString("id")); - window.open(`${window.ecologyContentPath || ""}${feedbackUrl}`); + window.location.href=`${window.ecologyContentPath || ""}${feedbackUrl}` + // window.open(`${window.ecologyContentPath || ""}${feedbackUrl}`); } else { message.error(errorMsg); } diff --git a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js index 98c706fc..fcfbf8a7 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js @@ -312,7 +312,7 @@ export default class FormalFormModal extends React.Component { // validateType: this.props.dataType || this.state.returnType, // extendParam: JSON.stringify(this.state.extendParam), // formula: this.state.value, - parameters: this.parameters, + parameters: _.map(this.parameters, o => ({ ...o, content: o.content || "" })), id: this.props.formulaId // referenceType: this.referenceType == "" ? this.props.valueType == "2" ? "formula" : this.props.valueType == "3" ? "sql" : "" : this.referenceType }; From f2027627f4bc7be765c8a3c6a7fe66b6c1662f75 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, 12 Oct 2023 14:08:48 +0800 Subject: [PATCH 11/17] hotfix/2.9.42310.01 --- .../hrmSalary/pages/mobilePayroll/index.js | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js index bd152a29..69329ae3 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js @@ -54,9 +54,7 @@ export default class MobilePayroll extends React.Component { initMobile = async () => { const { mySalaryStore: { setInitEmVerify } } = this.props; - const params = this.getUrlkey(); - const { data } = await salaryBillGetToken({ uid: _.pick(params, ["recipient"]).recipient }); - this.setState({ salaryBillToken: data }, () => { + if (window.em) { API.isNeedSecondPwdVerify({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken) .then(({ status, isNeedSecondAuth }) => { if (status && isNeedSecondAuth) { @@ -71,7 +69,26 @@ export default class MobilePayroll extends React.Component { setInitEmVerify(); } }); - }); + } else { + const params = this.getUrlkey(); + const { data } = await salaryBillGetToken({ uid: _.pick(params, ["recipient"]).recipient }); + this.setState({ salaryBillToken: data }, () => { + API.isNeedSecondPwdVerify({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken) + .then(({ status, isNeedSecondAuth }) => { + if (status && isNeedSecondAuth) { + this.setState({ visible: true }, () => { + API.getSecondAuthForm({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken) + .then(({ status, notSetting }) => { + this.setState({ notSetting }); + }); + }); + } else { + this.getMySalaryBill(getQueryString("id")); + setInitEmVerify(); + } + }); + }); + } }; doSecondAuth = () => { const { salaryBillToken } = this.state; @@ -143,7 +160,7 @@ export default class MobilePayroll extends React.Component { const { salaryTemplate } = mySalaryBillData; const { feedbackUrl } = salaryTemplate; this.getMySalaryBill(getQueryString("id")); - window.location.href=`${window.ecologyContentPath || ""}${feedbackUrl}` + window.location.href = `${window.ecologyContentPath || ""}${feedbackUrl}`; // window.open(`${window.ecologyContentPath || ""}${feedbackUrl}`); } else { message.error(errorMsg); @@ -174,7 +191,8 @@ export default class MobilePayroll extends React.Component { ]} > - this.setState({ authCode })}/> + this.setState({ authCode })}/> { notSetting && From b260a41c7e58de7e8592b6ea272c22a75c6310a5 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, 12 Oct 2023 15:52:15 +0800 Subject: [PATCH 12/17] =?UTF-8?q?feature/2.9.42310.01-=E7=A4=BE=E4=BF=9D?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8F=B0=E8=B4=A6=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=E5=AF=BC=E5=85=A5=E4=B8=8B=E8=BD=BD=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E6=8E=A5=E5=8F=A3=E6=9B=B4=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/benefitsProgramme.js | 0 pc4mobx/hrmSalary/apis/standingBook.js | 14 ++++++++++- .../importModal/acctResultImportModal.js | 23 ++++++++++++++++--- pc4mobx/hrmSalary/util/request.js | 22 ++++++++++++++++++ 4 files changed, 55 insertions(+), 4 deletions(-) delete mode 100644 pc4mobx/hrmSalary/apis/benefitsProgramme.js diff --git a/pc4mobx/hrmSalary/apis/benefitsProgramme.js b/pc4mobx/hrmSalary/apis/benefitsProgramme.js deleted file mode 100644 index e69de29b..00000000 diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index 28235f77..cef1aa55 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -1,5 +1,5 @@ import { WeaTools } from "ecCom"; -import { postFetch } from "../util/request"; +import { postExportFetch, postFetch } from "../util/request"; //社会福利台账-获取正常缴纳列表 export const getCommonList = (params) => { @@ -339,3 +339,15 @@ export const compensationConfigSave = (params) => { export const compensationBack = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/compensationBack", params); }; + +export const exportSiaccountWelfareImporttemplate = params => { + return postExportFetch("/api/bs/hrmsalary/siaccount/welfare/importtemplate/export", params); +}; + +export const exportSiaccountWelfaresupplyimporttemplatetemplate = params => { + return postExportFetch("/api/bs/hrmsalary/siaccount/welfare/supplyimporttemplate/export", params); +}; + +export const exportSiaccountWelfarebalanceimporttemplatetetemplate = params => { + return postExportFetch("/api/bs/hrmsalary/siaccount/welfare/balanceimporttemplate/export", params); +}; diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js index b7bc7c27..23d5a034 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js @@ -6,6 +6,11 @@ import SelectFieldModal from "./selectFieldModal"; import { getQueryString } from "../../../../util/url"; import AddHeaderFieldsModal from "./addHeaderFieldsModal"; import { cacheImportField } from "../../../../apis/calculate"; +import { + exportSiaccountWelfarebalanceimporttemplatetetemplate, + exportSiaccountWelfareImporttemplate, + exportSiaccountWelfaresupplyimporttemplatetemplate +} from "../../../../apis/standingBook"; @inject("calculateStore", "standingBookStore") @observer @@ -76,11 +81,23 @@ export default class AcctResultImportModal extends React.Component { const billMonth = getQueryString("billMonth"); const paymentOrganization = getQueryString("paymentOrganization"); if (standingBookTabKey === "1") { - url = `${window.location.origin}/api/bs/hrmsalary/siaccount/welfare/importtemplate/export?welfareNames=${this.state.modalParam.salaryItemIds}&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`; + const promise = exportSiaccountWelfareImporttemplate({ + billMonth, + welfareNames: this.state.modalParam.salaryItemIds.split(","), + paymentOrganization: Number(paymentOrganization) + }); } else if (standingBookTabKey === "3") { - url = `${window.location.origin}/api/bs/hrmsalary/siaccount/welfare/supplyimporttemplate/export?welfareNames=${this.state.modalParam.salaryItemIds}&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`; + const promise = exportSiaccountWelfaresupplyimporttemplatetemplate({ + billMonth, + welfareNames: this.state.modalParam.salaryItemIds.split(","), + paymentOrganization: Number(paymentOrganization) + }); } else if (standingBookType === "difference") { - url = `${window.location.origin}/api/bs/hrmsalary/siaccount/welfare/balanceimporttemplate/export?welfareNames=${this.state.modalParam.salaryItemIds}&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`; + const promise = exportSiaccountWelfarebalanceimporttemplatetetemplate({ + billMonth, + welfareNames: this.state.modalParam.salaryItemIds.split(","), + paymentOrganization: Number(paymentOrganization) + }); } } window.open(url, "_self"); diff --git a/pc4mobx/hrmSalary/util/request.js b/pc4mobx/hrmSalary/util/request.js index 3c7ecf02..a7a1c7f2 100644 --- a/pc4mobx/hrmSalary/util/request.js +++ b/pc4mobx/hrmSalary/util/request.js @@ -30,3 +30,25 @@ export const headerRequestFetch = (url, method, params, header) => { body: JSON.stringify(params) }).then(res => res.json()); }; +export const postExportFetch = (url, params) => { + url = url + "?__random__=" + (new Date()).valueOf(); + return fetch(url, { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => { + const filename = res.headers.get("Content-Disposition").split("filename=")[1]; + res.blob().then(blob => { + const url = window.URL.createObjectURL(blob); + const a = document.createElement("a"); + a.href = url; + a.download = decodeURI(filename); + a.click(); + window.URL.revokeObjectURL(url); + }); + }); +}; + From 7b79fe5dc5b8953803f0b357893804116d749f60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 13 Oct 2023 09:51:50 +0800 Subject: [PATCH 13/17] =?UTF-8?q?feature/2.9.42310.01-=E8=B0=83=E8=96=AA?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/adjustManage.js | 6 ++ pc4mobx/hrmSalary/index.js | 3 + .../pages/adjustSalaryManage/index.js | 88 +++++++++++++++++++ .../pages/adjustSalaryManage/index.less | 0 4 files changed, 97 insertions(+) create mode 100644 pc4mobx/hrmSalary/apis/adjustManage.js create mode 100644 pc4mobx/hrmSalary/pages/adjustSalaryManage/index.js create mode 100644 pc4mobx/hrmSalary/pages/adjustSalaryManage/index.less diff --git a/pc4mobx/hrmSalary/apis/adjustManage.js b/pc4mobx/hrmSalary/apis/adjustManage.js new file mode 100644 index 00000000..0ccce814 --- /dev/null +++ b/pc4mobx/hrmSalary/apis/adjustManage.js @@ -0,0 +1,6 @@ +import { postFetch } from "../util/request"; + +// 薪资项目调整记录列表 +export const adjustRecordItemList = (params) => { + return postFetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/adjustRecordItemList", params); +}; diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index bd2d3c12..c2e84f5e 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -38,6 +38,7 @@ import ReportView from "./pages/reportView"; import MySalaryView from "./pages/mySalary/mySalaryView"; import WatermarkPreview from "./pages/payroll/watermarkPreview"; import ExternalPersonManage from "./pages/externalPersonManage"; +import AdjustSalaryManage from "./pages/adjustSalaryManage"; import stores from "./stores"; import "./style/index"; @@ -88,6 +89,7 @@ const DataAcquisition = (props) => props.children; // analysisOfSalaryStatistics 薪酬统计分析 // reportView 薪酬报表查看 // externalPersonManage 非系统人员管理 +// adjustSalaryManage 档案管理 const Routes = ( + { + const { pageInfo } = this.state; + const payload = { ...pageInfo }; + this.setState({ loading: true }); + adjustRecordItemList(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource, pageNum, pageSize, total } = data; + this.setState({ + dataSource, pageInfo: { ...pageInfo, pageNum, pageSize, total }, + columns: _.map(columns, o => { + const { dataIndex } = o; + let width = ""; + return { ...o, width }; + }) + }); + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { loading, dataSource, 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 } + }, () => { + }); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => { + }); + } + }; + return ( + } iconBgcolor="#F14A2D" + buttons={[ + + ]} + > + + + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/adjustSalaryManage/index.less b/pc4mobx/hrmSalary/pages/adjustSalaryManage/index.less new file mode 100644 index 00000000..e69de29b From 9a03c6ad8b021130c9c24a003dbbb2039a48032b 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, 16 Oct 2023 15:27:29 +0800 Subject: [PATCH 14/17] =?UTF-8?q?feature/2.9.42310.01-=E8=B0=83=E8=96=AA?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/adjustManage.js | 2 +- .../adjustAdvanceSearchPannel/index.js | 101 ++++++++++ .../components/advanceInputBtn/index.js | 27 +++ .../components/advanceInputBtn/index.less | 28 +++ .../components/conditions.js | 176 ++++++++++++++++++ .../pages/adjustSalaryManage/index.js | 75 ++++++-- .../pages/adjustSalaryManage/index.less | 47 +++++ pc4mobx/hrmSalary/stores/payrollFiles.js | 4 +- 8 files changed, 445 insertions(+), 15 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/adjustSalaryManage/components/adjustAdvanceSearchPannel/index.js create mode 100644 pc4mobx/hrmSalary/pages/adjustSalaryManage/components/advanceInputBtn/index.js create mode 100644 pc4mobx/hrmSalary/pages/adjustSalaryManage/components/advanceInputBtn/index.less create mode 100644 pc4mobx/hrmSalary/pages/adjustSalaryManage/components/conditions.js diff --git a/pc4mobx/hrmSalary/apis/adjustManage.js b/pc4mobx/hrmSalary/apis/adjustManage.js index 0ccce814..8eda378d 100644 --- a/pc4mobx/hrmSalary/apis/adjustManage.js +++ b/pc4mobx/hrmSalary/apis/adjustManage.js @@ -2,5 +2,5 @@ import { postFetch } from "../util/request"; // 薪资项目调整记录列表 export const adjustRecordItemList = (params) => { - return postFetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/adjustRecordItemList", params); + return postFetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/salaryItemList", params); }; diff --git a/pc4mobx/hrmSalary/pages/adjustSalaryManage/components/adjustAdvanceSearchPannel/index.js b/pc4mobx/hrmSalary/pages/adjustSalaryManage/components/adjustAdvanceSearchPannel/index.js new file mode 100644 index 00000000..fc98193a --- /dev/null +++ b/pc4mobx/hrmSalary/pages/adjustSalaryManage/components/adjustAdvanceSearchPannel/index.js @@ -0,0 +1,101 @@ +/* + * Author: 黎永顺 + * name: 调薪记录-查看面板 + * Description: + * Date: 2023/10/16 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTools } from "ecCom"; +import { Button } from "antd"; +import { inject, observer } from "mobx-react"; +import { adjustSearchConditions } from "../conditions"; +import { getSearchs } from "../../../../util"; +import { commonEnumList } from "../../../../apis/ruleconfig"; + +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; + +@inject("payrollFilesStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + searchConditions: [] + }; + } + + componentDidMount() { + commonEnumList({ enumClass: "com.engine.salary.enums.salaryarchive.SalaryArchiveItemAdjustReasonEnum" }) + .then(({ status, data }) => { + if (status) { + this.setState({ + searchConditions: _.map(adjustSearchConditions, item => { + return { + ...item, + items: _.map(item.items, o => { + if (getKey(o) === "userStatus") { + return { + ...o, + options: [ + { key: "0", showname: getLabel(18883, "试用") }, { + key: "1", + showname: getLabel(15711, "正式") + }, + { key: "2", showname: getLabel(480, "临时") }, { + key: "3", + showname: getLabel(15844, "试用延期") + }, + { key: "4", showname: getLabel(542707, "解雇") }, { + key: "5", + showname: getLabel(6091, "离职") + }, + { key: "6", showname: getLabel(6092, "退休") } + ] + }; + } else if (getKey(o) === "adjustReason") { + return { + ...o, + options: _.map(data, item => ({ + key: item.value, + showname: item.defaultLabel + })) + }; + } + return { ...o }; + }), + title: getLabel(32905, "常用条件") + }; + }) + }, () => { + const { payrollFilesStore: { adjustForm } } = this.props; + adjustForm.initFormFields(this.state.searchConditions); + }); + } + }); + } + + render() { + const { searchConditions } = this.state; + const { payrollFilesStore: { adjustForm } } = this.props; + return ( + +
+ {getSearchs(adjustForm, searchConditions, 2, false)} +
+
+
+ + + +
+
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/adjustSalaryManage/components/advanceInputBtn/index.js b/pc4mobx/hrmSalary/pages/adjustSalaryManage/components/advanceInputBtn/index.js new file mode 100644 index 00000000..847db526 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/adjustSalaryManage/components/advanceInputBtn/index.js @@ -0,0 +1,27 @@ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { Button } from "antd"; +import { WeaInputSearch, WeaLocaleProvider } from "ecCom"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("payrollFilesStore") +@observer +class Index extends Component { + render() { + const { payrollFilesStore: { adjustForm } } = this.props; + return ( +
+ adjustForm.updateFields({ username: v })} + onSearch={this.props.onAdvanceSearch} + /> + +
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/adjustSalaryManage/components/advanceInputBtn/index.less b/pc4mobx/hrmSalary/pages/adjustSalaryManage/components/advanceInputBtn/index.less new file mode 100644 index 00000000..1a3d7283 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/adjustSalaryManage/components/advanceInputBtn/index.less @@ -0,0 +1,28 @@ +.advance-search { + display: flex; + align-items: center; + position: relative; + top: -2.5px; + + .wea-advanced-search { + top: 2px; + left: -1px; + height: 28px; + line-height: 1; + border-radius: 0; + position: relative; + color: #474747; + padding: 4px 15px; + } + + .wea-advanced-search:hover { + border: 1px solid #dadada; + color: #474747; + } + + .text-elli { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } +} diff --git a/pc4mobx/hrmSalary/pages/adjustSalaryManage/components/conditions.js b/pc4mobx/hrmSalary/pages/adjustSalaryManage/components/conditions.js new file mode 100644 index 00000000..22674611 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/adjustSalaryManage/components/conditions.js @@ -0,0 +1,176 @@ +export const adjustSearchConditions = [ + { + items: [ + { + colSpan: 2, + conditionType: "INPUT", + domkey: ["username"], + fieldcol: 12, + label: "姓名", + lanId: 25034, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "57", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["departmentIds"], + fieldcol: 12, + label: "部门", + lanId: 27511, + labelcol: 6, + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "24", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["positionIds"], + fieldcol: 12, + label: "岗位", + lanId: 6086, + labelcol: 6, + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "SELECT", + domkey: ["userStatus"], + fieldcol: 12, + label: "状态", + lanId: 535101, + labelcol: 6, + options: [], + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "INPUT", + domkey: ["adjustItem"], + fieldcol: 12, + label: "项目名称", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "SELECT", + domkey: ["adjustReason"], + fieldcol: 12, + label: "调整原因", + lanId: 1897, + labelcol: 6, + options: [], + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "RANGEPICKER", + domkey: ["effectiveTime1", "effectiveTime2"], + fieldcol: 12, + label: "生效日期", + lanId: 19548, + labelcol: 6, + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "RANGEPICKER", + domkey: ["operateTime1", "operateTime2"], + fieldcol: 12, + label: "操作日期", + lanId: 111, + labelcol: 6, + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "17", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["operatorIds"], + fieldcol: 12, + label: "操作人", + lanId: 111, + labelcol: 6, + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "INPUT", + domkey: ["description"], + fieldcol: 12, + label: "备注", + lanId: 536726, + labelcol: 6, + value: "", + viewAttr: 2 + }, + ], + defaultshow: true, + title: "common" + } +]; diff --git a/pc4mobx/hrmSalary/pages/adjustSalaryManage/index.js b/pc4mobx/hrmSalary/pages/adjustSalaryManage/index.js index 40b5a61a..e57ffa58 100644 --- a/pc4mobx/hrmSalary/pages/adjustSalaryManage/index.js +++ b/pc4mobx/hrmSalary/pages/adjustSalaryManage/index.js @@ -5,19 +5,26 @@ * Date: 2023/10/13 */ import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; import { WeaLocaleProvider, WeaTable, WeaTop } from "ecCom"; import { adjustRecordItemList } from "../../apis/adjustManage"; +import AdvanceInputBtn from "./components/advanceInputBtn"; +import AdjustAdvanceSearchPannel from "./components/adjustAdvanceSearchPannel"; +import cs from "classnames"; import { Button } from "antd"; import "./index.less"; +import { convertToUrlString } from "../../util/url"; const getLabel = WeaLocaleProvider.getLabel; +@inject("payrollFilesStore") +@observer class Index extends Component { constructor(props) { super(props); this.state = { - loading: false, columns: [], dataSource: [], + loading: false, columns: [], dataSource: [], showSearchAd: false, pageInfo: { current: 1, pageSize: 10, total: 0 } }; } @@ -27,8 +34,22 @@ class Index extends Component { } adjustRecordItemList = () => { + const { payrollFilesStore: { adjustForm } } = this.props; + const { + departmentIds, positionIds, operatorIds, + effectiveTime1 = "", effectiveTime2 = "", + operateTime1 = "", operateTime2 = "", + ...extra + } = adjustForm.getFormParams(); const { pageInfo } = this.state; - const payload = { ...pageInfo }; + const payload = { + ...pageInfo, ...extra, + departmentIds: departmentIds ? departmentIds.split(",") : [], + positionIds: departmentIds ? departmentIds.split(",") : [], + operatorIds: departmentIds ? departmentIds.split(",") : [], + effectiveTime: effectiveTime1 ? [effectiveTime1, effectiveTime2] : [], + operateTime: operateTime1 ? [operateTime1, operateTime2] : [] + }; this.setState({ loading: true }); adjustRecordItemList(payload).then(({ status, data }) => { this.setState({ loading: false }); @@ -37,17 +58,39 @@ class Index extends Component { this.setState({ dataSource, pageInfo: { ...pageInfo, pageNum, pageSize, total }, columns: _.map(columns, o => { - const { dataIndex } = o; - let width = ""; - return { ...o, width }; + if (o.dataIndex === "username") { + return { ...o, width: 150, fixed: "left" }; + } + return { ...o, width: 150 }; }) }); } }).catch(() => this.setState({ loading: false })); }; + openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd }); + adjustExport = () => { + if (!this.handleDebounce) { + this.handleDebounce = _.debounce(() => { + const { payrollFilesStore: { adjustForm } } = this.props; + const { + effectiveTime1 = "", effectiveTime2 = "", + operateTime1 = "", operateTime2 = "", + ...extra + } = adjustForm.getFormParams(); + const payload = { + ...extra, + effectiveTime: effectiveTime1 ? `${effectiveTime1},${effectiveTime2}` : "", + operateTime: operateTime1 ? `${operateTime1},${operateTime2}` : "" + }; + window.open(`${window.location.origin}/api/bs/hrmsalary/salaryArchive/adjustRecord/exportSalaryItemList?${convertToUrlString(payload)}`, "_target"); + this.handleDebounce = null; + }, 500); + } + this.handleDebounce(); + }; render() { - const { loading, dataSource, columns, pageInfo } = this.state; + const { loading, dataSource, columns, pageInfo, showSearchAd } = this.state; const pagination = { ...pageInfo, showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, @@ -57,26 +100,32 @@ class Index extends Component { onShowSizeChange: (current, pageSize) => { this.setState({ pageInfo: { ...pageInfo, current, pageSize } - }, () => { - }); + }, () => this.adjustRecordItemList()); }, onChange: current => { this.setState({ pageInfo: { ...pageInfo, current } - }, () => { - }); + }, () => this.adjustRecordItemList()); } }; return ( } iconBgcolor="#F14A2D" buttons={[ - + , + this.openAdvanceSearch()} + onAdvanceSearch={this.adjustRecordItemList}/> ]} > +
+ +
diff --git a/pc4mobx/hrmSalary/pages/adjustSalaryManage/index.less b/pc4mobx/hrmSalary/pages/adjustSalaryManage/index.less index e69de29b..f7648ef8 100644 --- a/pc4mobx/hrmSalary/pages/adjustSalaryManage/index.less +++ b/pc4mobx/hrmSalary/pages/adjustSalaryManage/index.less @@ -0,0 +1,47 @@ +.adjustManageLayout { + + .searchAdvanced-condition-hide { + display: none; + } + + .searchAdvanced-condition-container { + background: #FFF; + margin-bottom: 10px; + border: 1px solid #e5e5e5; + + .wea-search-buttons { + border-top: 1px solid #dadada; + padding: 15px 0; + } + + .wea-advanced-searchsAd { + height: 320px; + overflow: hidden auto; + + .formItem-delete { + position: absolute; + top: 0; + right: -40px; + } + + .searchAdvanced-commonSelect { + border-top: 1px solid #ebebeb; + margin: 0 25px; + padding: 10px 0; + } + + .custom-advance-largeSpacing { + padding-left: 26px; + + .link { + border: none; + border-radius: 0; + padding: 12px 10px 12px 26px; + color: #2db7f5 + } + } + + } + } +} + diff --git a/pc4mobx/hrmSalary/stores/payrollFiles.js b/pc4mobx/hrmSalary/stores/payrollFiles.js index 70088da8..529bde71 100644 --- a/pc4mobx/hrmSalary/stores/payrollFiles.js +++ b/pc4mobx/hrmSalary/stores/payrollFiles.js @@ -1,5 +1,5 @@ import { action, observable } from "mobx"; -import { WeaTableNew } from "comsMobx"; +import { WeaForm, WeaTableNew } from "comsMobx"; import * as API from "../apis/payrollFiles"; import { getDataPerspective, statisticsEmployeeDetailList } from "../apis/statistics"; @@ -10,6 +10,8 @@ export class PayrollFilesStore { @observable tableStore = new TableStore(); @observable employeeTableStore = new TableStore(); @observable pivotTableStore = new TableStore(); + @observable adjustForm = new WeaForm(); //调薪记录-核算form + @action initAdjustForm = () => this.adjustForm = new WeaForm();//调薪记录-初始化核算form @action("薪资档案-列表查询") queryList = (payload = {}, searchItemsValue = {}, url = "") => { From db166275c47ec8a16b3cc1160216bf5dacc2cfe8 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, 18 Oct 2023 10:24:13 +0800 Subject: [PATCH 15/17] =?UTF-8?q?hotfix/2.9.42310.01-=E7=A4=BE=E4=BF=9D?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=E9=9D=9E=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E4=BA=BA=E5=91=98tab=E6=98=BE=E7=A4=BA=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../socialSecurityBenefits/archives/index.js | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index 4caa10dc..66ce8099 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -18,6 +18,7 @@ import { convertToUrlString, getURLParameters } from "../../../util/url"; import { salaryArchiveDelete } from "../../../apis/payrollFiles"; import ImportDialog from "../../../components/importDialog"; import "./index.less"; +import { sysinfo } from "../../../apis/ruleconfig"; const getLabel = WeaLocaleProvider.getLabel; const APILIST = { @@ -64,7 +65,8 @@ export default class Archives extends React.Component { visible: false, title: "", nextloading: false, link: "", importResult: {}, imageId: "", previewUrl: "/api/bs/hrmsalary/scheme/preview" - } + }, + extEmpsWitch: "1" //非系统人员开关, 1: 开启, 0:关闭 }; this.record = {}; } @@ -73,9 +75,21 @@ export default class Archives extends React.Component { const { archivesStore: { doInit } } = this.props; doInit(); this.salaryArchiveDelete(); + this.getSysinfo(); this.queryList({ runStatuses: ["1"] }); } + /* + * Author: 黎永顺 + * Description: 非系统人员开关查询 + * Params: + * Date: 2023/7/14 + */ + getSysinfo = () => { + sysinfo().then(({ status, data }) => { + if (status) this.setState({ extEmpsWitch: data.extEmpsWitch }); + }); + }; queryInsuranceTabTotal = () => { API.queryInsuranceTabTotal().then(({ data = {}, status }) => { if (status) { @@ -612,7 +626,8 @@ export default class Archives extends React.Component { pageInfo, tabCount, loading, - importDialog + importDialog, + extEmpsWitch } = this.state; const { form, condition, showSearchAd, setShowSearchAd, @@ -805,7 +820,7 @@ export default class Archives extends React.Component { showDropIcon={false} // 是否显示下拉按钮 > Date: Wed, 18 Oct 2023 17:18:44 +0800 Subject: [PATCH 16/17] =?UTF-8?q?hotfix/2.9.42310.01=20=E5=85=AC=E5=BC=8F?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=BB=93=E6=9E=9C=E6=98=BE=E7=A4=BA=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js index fcfbf8a7..bb93a200 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js @@ -320,7 +320,7 @@ export default class FormalFormModal extends React.Component { if (status) { message.success("测试结果已更新"); this.setState({ - showTestVal: data + showTestVal: !_.isNil(data) ? data.toString() : data }); } else { message.error(errormsg || ""); From 8838566b058c87a6ad36813d7a77aa58e7ad7809 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, 19 Oct 2023 13:38:00 +0800 Subject: [PATCH 17/17] hotfix/2.9.42310.01 --- pc4mobx/hrmSalary/pages/salaryItem/columns.js | 2 +- pc4mobx/hrmSalary/pages/salaryItem/index.js | 2 +- pc4mobx/hrmSalary/pages/salaryItem/index.less | 22 ++++++++++++++++++- .../syncToSalaryAccountSetDialog.js | 2 +- pc4mobx/hrmSalary/stores/salaryItem.js | 2 +- 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/columns.js b/pc4mobx/hrmSalary/pages/salaryItem/columns.js index 47abe5b1..04581655 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/columns.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/columns.js @@ -163,7 +163,7 @@ export const salarySetConditions = [ checkboxValue: false, conditionType: "SELECT", domkey: ["salarySobIds"], - fieldcol: 18, + fieldcol: 14, label: "薪资账套", lanId: 538010, labelcol: 6, diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.js b/pc4mobx/hrmSalary/pages/salaryItem/index.js index a4ffcd0a..77dcae48 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.js @@ -323,7 +323,7 @@ export default class SalaryItem extends React.Component { })} >{getLabel(111, "同步到薪资账套")}, ]; } diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.less b/pc4mobx/hrmSalary/pages/salaryItem/index.less index b0063821..90870f6c 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.less +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.less @@ -105,6 +105,26 @@ .salarySetDialog { .salarySetDialogContent { + background: #f6f6f6; + + .wea-search-group { + padding: 16px; + } + + .wea-content { + padding: 0; + + .wea-form-cell-wrapper { + background: #FFF; + border: 1px solid #e5e5e5; + border-bottom: none; + + .wea-form-cell { + border-bottom: 1px solid #e5e5e5; + } + } + } + .wea-select, .ant-select, .ant-select-selection { width: 100%; } @@ -125,7 +145,7 @@ height: 30px; white-space: nowrap; min-width: 100px; - max-width: 345px; + max-width: 237px; width: 100%; display: inline-block; padding: 4px 17px 4px 4px; diff --git a/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js b/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js index e8ca847b..797a6466 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js @@ -80,7 +80,7 @@ class SyncToSalaryAccountSetDialog extends Component { return ( {getLabel(537558, "确定")}]} > diff --git a/pc4mobx/hrmSalary/stores/salaryItem.js b/pc4mobx/hrmSalary/stores/salaryItem.js index 7e7925bc..54a84562 100644 --- a/pc4mobx/hrmSalary/stores/salaryItem.js +++ b/pc4mobx/hrmSalary/stores/salaryItem.js @@ -309,7 +309,7 @@ export class SalaryItemStore { if (!continueFlag) { this.editSlideVisible = false; } - this.initRequest(); + ((!params.id && continueFlag) || !continueFlag) && this.initRequest(); message.success("保存成功"); resolve(); } else {