{
+ }} 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={