diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js
index 3539ec72..129d9cb7 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js
@@ -40,10 +40,10 @@ class EditSalaryBaseInfo extends Component {
"esf-form-last-item": (index === baseInfo.length - 1 && (index + 1) % 2 === 1)
})}>
-
{fieldName}
+
{fieldName}
-
{fieldValue}
+
{fieldValue}
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less
index 831c2bd9..91797921 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less
@@ -168,6 +168,10 @@
display: inline-block;
line-height: 24px;
padding: 8px 16px;
+ width: 100%;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
}
}
From 373b0aad564213573f9e120e9bbdecb3fc1b7b97 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, 17 Nov 2023 13:33:56 +0800
Subject: [PATCH 18/21] hotfix/2.9.42311.02
---
pc4mobx/hrmSalary/pages/calculate/calcOc/index.js | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/pc4mobx/hrmSalary/pages/calculate/calcOc/index.js b/pc4mobx/hrmSalary/pages/calculate/calcOc/index.js
index 62e0a92d..0869e675 100644
--- a/pc4mobx/hrmSalary/pages/calculate/calcOc/index.js
+++ b/pc4mobx/hrmSalary/pages/calculate/calcOc/index.js
@@ -9,6 +9,7 @@ import { Button } from "antd";
import { WeaCheckbox, WeaInputSearch, WeaLocaleProvider } from "ecCom";
import SalaryCalcOcList from "./components/salaryCalcOcList";
import SalaryCalcOcImport from "./components/salaryCalcOcImport";
+import { convertToUrlString } from "../../../util/url";
import Layout from "../doCalc/layout";
import "./index.less";
@@ -34,8 +35,12 @@ class Index extends Component {
};
handleExportClick = () => {
+ const { form: { onlyDiffEmployee, onlyDiffSalaryItem } } = this.state;
const { routeParams: { salaryAcctRecordId } } = this.props;
- window.open(`/api/bs/hrmsalary/salaryacct/comparisonresult/export?salaryAcctRecordId=${salaryAcctRecordId}`, "_blank");
+ const payload = {
+ salaryAcctRecordId, onlyDiffEmployee, onlyDiffSalaryItem
+ };
+ window.open(`/api/bs/hrmsalary/salaryacct/comparisonresult/export?${convertToUrlString(payload)}`, "_blank");
};
handleImportClick = () => {
const { routeParams: { salaryAcctRecordId } } = this.props;
From 94b3f056f4f477f81e900d122286b6c3e3d516f8 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, 20 Nov 2023 17:48:44 +0800
Subject: [PATCH 19/21] =?UTF-8?q?hotfix/2.9.42311.02-=E6=88=91=E7=9A=84?=
=?UTF-8?q?=E8=96=AA=E8=B5=84=E7=A6=8F=E5=88=A9=E9=A1=B5=E9=9D=A2=E9=87=8D?=
=?UTF-8?q?=E6=9E=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pc4mobx/hrmSalary/index.js | 3 +-
.../SalaryAdjustmentRecords/index.js | 76 +++++++++++++++
.../components/payrollTable/index.js | 92 +++++++++++++++++++
.../hrmSalary/pages/mySalaryBenefits/index.js | 67 ++++++++++++++
.../pages/mySalaryBenefits/index.less | 19 ++++
pc4mobx/hrmSalary/stores/mySalary.js | 12 +--
6 files changed, 262 insertions(+), 7 deletions(-)
create mode 100644 pc4mobx/hrmSalary/pages/mySalaryBenefits/components/SalaryAdjustmentRecords/index.js
create mode 100644 pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js
create mode 100644 pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js
create mode 100644 pc4mobx/hrmSalary/pages/mySalaryBenefits/index.less
diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js
index af5bbfb0..9df5fcf5 100644
--- a/pc4mobx/hrmSalary/index.js
+++ b/pc4mobx/hrmSalary/index.js
@@ -1,7 +1,8 @@
import React from "react";
import Route from "react-router/lib/Route";
import { WeaLocaleProvider } from "ecCom";
-import MySalary from "./pages/mySalary";
+// import MySalary from "./pages/mySalary";
+import MySalary from "./pages/mySalaryBenefits";
import Programme from "./pages/socialSecurityBenefits/programme";
import Archives from "./pages/socialSecurityBenefits/archives";
import StandingBook from "./pages/socialSecurityBenefits/standingBook";
diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/SalaryAdjustmentRecords/index.js b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/SalaryAdjustmentRecords/index.js
new file mode 100644
index 00000000..ed75ad76
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/SalaryAdjustmentRecords/index.js
@@ -0,0 +1,76 @@
+/*
+ * Author: 黎永顺
+ * name: 调薪记录
+ * Description:
+ * Date: 2023/11/13
+ */
+import React, { Component } from "react";
+import { inject, observer } from "mobx-react";
+import { WeaLocaleProvider, WeaTable } from "ecCom";
+import Authority from "../../../mySalary/authority";
+import { recordList } from "../../../../apis/mySalaryBenefits";
+
+const getLabel = WeaLocaleProvider.getLabel;
+
+@inject("mySalaryStore")
+@observer
+class Index extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 },
+ loading: false
+ };
+ }
+
+ componentDidMount() {
+ const { mySalaryStore: { initRecordData } } = this.props;
+ initRecordData(this.getRecordList);
+ }
+
+ getRecordList = () => {
+ const { pageInfo } = this.state;
+ this.setState({ loading: true });
+ recordList({ ...pageInfo }).then(({ status, data }) => {
+ this.setState({ loading: false });
+ if (status) {
+ const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
+ this.setState({
+ dataSource, pageInfo: { ...pageInfo, current, pageSize, total },
+ columns: _.map(columns, it => ({ ...it, width: 150 }))
+ });
+ }
+ }).catch(() => this.setState({ loading: false }));
+ };
+
+ render() {
+ const { dataSource, loading, columns, pageInfo } = this.state;
+ const pagination = {
+ ...pageInfo,
+ showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
+ showQuickJumper: true,
+ showSizeChanger: true,
+ pageSizeOptions: ["10", "20", "50", "100"],
+ onShowSizeChange: (current, pageSize) => {
+ this.setState({
+ pageInfo: { ...pageInfo, current, pageSize }
+ }, () => this.getRecordList());
+ },
+ onChange: current => {
+ this.setState({
+ pageInfo: { ...pageInfo, current }
+ }, () => this.getRecordList());
+ }
+ };
+ return (
+
+
+
+ );
+ }
+}
+
+export default Index;
diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js
new file mode 100644
index 00000000..28fc0278
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js
@@ -0,0 +1,92 @@
+/*
+ * Author: 黎永顺
+ * name: 工资单
+ * Description:
+ * Date: 2023/11/13
+ */
+import React, { Component } from "react";
+import { WeaLocaleProvider, WeaTable } from "ecCom";
+import { mySalaryBillList } from "../../../../apis/mySalaryBenefits";
+import moment from "moment";
+
+const getLabel = WeaLocaleProvider.getLabel;
+
+class Index extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ juniorMapList: [], dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 },
+ loading: false, employeeId: ""
+ };
+ }
+
+ componentDidMount() {
+ this.getMySalaryBillList(this.props);
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.salaryYearMonth !== this.props.salaryYearMonth) this.getMySalaryBillList(nextProps);
+ }
+
+ getMySalaryBillList = (props) => {
+ this.setState({ loading: true });
+ const { pageInfo, employeeId } = this.state;
+ const { salaryYearMonth } = props;
+ mySalaryBillList({ salaryYearMonth, employeeId, ...pageInfo }).then(({ status, data }) => {
+ this.setState({ loading: false });
+ if (status) {
+ const { columns, datas: dataSource, pageInfo: { pageNum: current, pageSize, total } } = data;
+ this.setState({
+ dataSource, pageInfo: { ...pageInfo, current, pageSize, total },
+ columns: _.map(columns, it => {
+ if (it.column === "salaryYearMonth" || it.column === "sendTime") {
+ return {
+ dataIndex: it.column, title: it.text, width: it.width,
+ render: (__, record) => (
{moment(record[it["column"]]).format("YYYY-MM")})
+ };
+ }
+ return {
+ dataIndex: it.column, title: it.text, width: it.width
+ };
+ })
+ });
+ }
+ }).catch(() => this.setState({ loading: false }));
+ };
+
+ render() {
+ const { juniorMapList, dataSource, loading, columns, pageInfo } = this.state;
+ const pagination = {
+ ...pageInfo,
+ showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
+ showQuickJumper: true,
+ showSizeChanger: true,
+ pageSizeOptions: ["10", "20", "50", "100"],
+ onShowSizeChange: (current, pageSize) => {
+ this.setState({
+ pageInfo: { ...pageInfo, current, pageSize }
+ }, () => this.getMySalaryBillList(this.props));
+ },
+ onChange: current => {
+ this.setState({
+ pageInfo: { ...pageInfo, current }
+ }, () => this.getMySalaryBillList(this.props));
+ }
+ };
+ return (
+
({getLabel(33564, "查看")})
+ }]}
+ />
+ );
+ }
+}
+
+export default Index;
diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js b/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js
new file mode 100644
index 00000000..5f608921
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.js
@@ -0,0 +1,67 @@
+/*
+ * Author: 黎永顺
+ * name: 我的薪资福利
+ * Description:
+ * Date: 2023/11/13
+ */
+import React, { Component } from "react";
+import { WeaLocaleProvider, WeaReqTop } from "ecCom";
+import Payroll from "./components/payrollTable";
+import SalaryAdjustmentRecords from "./components/SalaryAdjustmentRecords";
+import { MonthRangePicker } from "../reportView/components/statisticalMicroSettingsSlide";
+import moment from "moment";
+import "./index.less";
+
+const getLabel = WeaLocaleProvider.getLabel;
+
+class Index extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ selectedKey: "1", salaryYearMonth: [moment().startOf("year").format("YYYY-MM"), moment().format("YYYY-MM")]
+ };
+ }
+
+ renderContent = () => {
+ const { selectedKey, salaryYearMonth } = this.state;
+ let Dom = null;
+ switch (selectedKey) {
+ case "1":
+ Dom = ;
+ break;
+ case "2":
+ Dom = ;
+ break;
+ default:
+ break;
+ }
+ return Dom;
+ };
+
+ render() {
+ const { selectedKey, salaryYearMonth } = this.state;
+ const tabs = [
+ { key: "1", title: getLabel(111, "工资单") },
+ { key: "2", title: getLabel(543150, "调薪记录") }
+ ];
+ const btns = [
+
+
{getLabel(542604, "薪资所属月")}
+
this.setState({ salaryYearMonth: v })}/>
+
+ ];
+ return (
+ }
+ iconBgcolor="#F14A2D" tabDatas={tabs} className="mySalary_wrapper"
+ buttons={selectedKey === "1" ? btns : []} buttonSpace={10} selectedKey={selectedKey}
+ onChange={selectedKey => this.setState({ selectedKey })}
+ >
+ {this.renderContent()}
+
+ );
+ }
+}
+
+export default Index;
diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.less b/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.less
new file mode 100644
index 00000000..52e92374
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/mySalaryBenefits/index.less
@@ -0,0 +1,19 @@
+.mySalary_wrapper {
+ .wea-transfer-list-wrapper {
+ border: none;
+ }
+
+ .flex-salary {
+ display: flex;
+ align-items: center;
+ margin-right: 16px;
+
+ .mysalary-search-title {
+ margin-right: 8px;
+ }
+ }
+
+ .wea-new-table {
+ background: #fff;
+ }
+}
diff --git a/pc4mobx/hrmSalary/stores/mySalary.js b/pc4mobx/hrmSalary/stores/mySalary.js
index 8a38f31e..eaad7374 100644
--- a/pc4mobx/hrmSalary/stores/mySalary.js
+++ b/pc4mobx/hrmSalary/stores/mySalary.js
@@ -218,28 +218,28 @@ export class MySalaryStore {
});
};
- @action initRecordData = async (payload) => {
+ @action initRecordData = async (callback) => {
this.clear();
//1.check is need second verify
if (window.doCheckSecondaryVerify4ec) {
window.doCheckSecondaryVerify4ec({ mouldCode: "HRM", itemCode: "SALARY" }, (data) => this.getRecordData({
- ...data, payload
+ ...data, callback
}));
} else {
- //4.loaddata
- this.getRecordData({ status: "1", token: "", payload });
+ this.getRecordData({ status: "1", token: "", callback });
}
};
@action
getRecordData = async (params = {}) => {
if (_.isEmpty(params)) return;
- const { status, payload, token } = params;
+ const { status, callback, token } = params;
if (status == "1") {
// Object.assign(this._reqParams, { token });
// this.getFormData({ viewAttr: 1 });
this.hasRight = true;
- this.getRecordList(payload);
+ !callback && this.getRecordList();
+ callback && callback();
} else {
this.hasRight = false;
}
From 6f9f24f7a8f21db730e720d0d526d909c1980b55 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, 23 Nov 2023 15:50:21 +0800
Subject: [PATCH 20/21] =?UTF-8?q?feature/2.9.42310.01-=E5=B7=A5=E8=B5=84?=
=?UTF-8?q?=E5=8D=95=E5=8F=91=E6=94=BE=E9=A1=B5=E9=9D=A2=E9=87=8D=E6=9E=84?=
=?UTF-8?q?-=E6=B7=BB=E5=8A=A0=E7=9F=AD=E4=BF=A1=E8=AE=BE=E7=BD=AE?=
=?UTF-8?q?=E7=9A=84=E5=8F=91=E9=80=81=E8=AE=BE=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pc4mobx/hrmSalary/apis/payroll.js | 4 +
.../payrollRelease/components/conditions.js | 22 +++
.../components/grantTableList/index.js | 8 +-
.../components/payrollTempBaseSet/index.js | 66 +++++++-
.../payrollTempBaseSet/smsSettingDialog.js | 150 ++++++++++++++++++
.../updatePayrollTemplateSlide/index.js | 10 +-
.../hrmSalary/pages/payrollRelease/form.js | 51 ++++++
.../hrmSalary/pages/payrollRelease/index.js | 6 +-
.../hrmSalary/pages/payrollRelease/index.less | 86 ++++++++++
9 files changed, 391 insertions(+), 12 deletions(-)
create mode 100644 pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/smsSettingDialog.js
create mode 100644 pc4mobx/hrmSalary/pages/payrollRelease/form.js
diff --git a/pc4mobx/hrmSalary/apis/payroll.js b/pc4mobx/hrmSalary/apis/payroll.js
index 890c7069..638ed318 100644
--- a/pc4mobx/hrmSalary/apis/payroll.js
+++ b/pc4mobx/hrmSalary/apis/payroll.js
@@ -403,3 +403,7 @@ export const salaryBillBaseSetSave = (params) => {
export const salaryBillBaseSetPreviewWaterMark = (params) => {
return postFetch("/api/bs/hrmsalary/salaryBill/baseSet/previewWaterMark", params);
};
+// 工资单基础设置-工资单变量
+export const getSmsSalaryItemSet = (params) => {
+ return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/template/getSmsSalaryItemSet", "GET", params);
+};
diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/conditions.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/conditions.js
index 93142796..21b05a8e 100644
--- a/pc4mobx/hrmSalary/pages/payrollRelease/components/conditions.js
+++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/conditions.js
@@ -124,6 +124,28 @@ export const tempBaseSetConditions = [
value: "0",
viewAttr: 2
},
+ {
+ colSpan: 1,
+ conditionType: "SWITCH",
+ domkey: ["smsStatus"],
+ fieldcol: 2,
+ label: "短信",
+ lanId: 111,
+ labelcol: 6,
+ value: "0",
+ viewAttr: 2
+ },
+ {
+ colSpan: 1,
+ conditionType: "TEXTAREA",
+ domkey: ["smsSetting"],
+ fieldcol: 14,
+ label: "短信设置",
+ lanId: 111,
+ labelcol: 6,
+ value: "",
+ hide: true
+ },
{
colSpan: 1,
conditionType: "SWITCH",
diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/grantTableList/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/grantTableList/index.js
index c173c4fa..bb821919 100644
--- a/pc4mobx/hrmSalary/pages/payrollRelease/components/grantTableList/index.js
+++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/grantTableList/index.js
@@ -7,7 +7,7 @@
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaLocaleProvider, WeaTable } from "ecCom";
-import { Dropdown, Menu, Tag } from "antd";
+import { Dropdown, Menu, message, Tag } from "antd";
import { getPayrollList } from "../../../../apis/payroll";
import moment from "moment";
@@ -84,7 +84,11 @@ class Index extends Component {
const { id, templateId } = record;
switch (key) {
case "template":
- console.log(templateId);
+ if (templateId) {
+ this.props.onUpdateTemp(templateId);
+ } else {
+ message.warning(getLabel(543602, "请设置默认模板"));
+ }
break;
default:
break;
diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js
index 74123d25..012bc64e 100644
--- a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js
+++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js
@@ -8,10 +8,11 @@ import React, { Component } from "react";
import { toJS } from "mobx";
import { WeaFormItem, WeaLocaleProvider, WeaTools } from "ecCom";
import { tempBaseSetConditions, tempBaseSetFbConditions } from "../conditions";
-import { getSearchs } from "../../../../util";
+import { payrollFormRender } from "../../form";
import { getPayrollBaseForm, getReplenishRuleSetOptions } from "../../../../apis/payroll";
import { commonEnumList } from "../../../../apis/archive";
import { SendTimeComp } from "../../../payroll/stepForm/baseInformForm";
+import SmsSettingDialog from "./smsSettingDialog";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@@ -25,7 +26,8 @@ class Index extends Component {
autoSendDayOfMonth: "1",
autoSendTimeOfDay: "09:00",
autoSendCycleType: "1"
- }
+ },
+ smsSettingDialog: { visible: false, content: "", salarySobId: "" }
};
}
@@ -60,7 +62,7 @@ class Index extends Component {
const { salaryTemplateBaseSet: { salarySobOptions, data: result } } = data;
const {
autoSendDayOfMonth = "1", autoSendTimeOfDay = "09:00", autoSendCycleType = "1",
- ...fieldsEchoData
+ smsSetting = "", ...fieldsEchoData
} = {
...result, ...toJS(tmplDataSource),
reissueRule: (
@@ -77,7 +79,8 @@ class Index extends Component {
items: _.map(it.items, o => {
if (getKey(o) === "salarySob") {
return {
- ...o, options: _.map(salarySobOptions, g => ({ key: g.id.toString(), showname: g.name }))
+ ...o, options: _.map(salarySobOptions, g => ({ key: g.id.toString(), showname: g.name })),
+ viewAttr: _.isNil(id) ? o.viewAttr : 1
};
} else if (getKey(o) === "reissueRule") {
return {
@@ -104,6 +107,11 @@ class Index extends Component {
...o,
helpfulTitle: getLabel(544272, "开启后,还需在计划任务中配置定时任务,执行工资单定时发送任务;")
};
+ } else if (getKey(o) === "smsSetting") {
+ return {
+ ...o,
+ hide: _.isNil(fieldsEchoData["smsStatus"]) || (!_.isNil(fieldsEchoData["smsStatus"]) && (fieldsEchoData["smsStatus"].toString() === "0"))
+ };
}
return { ...o };
})
@@ -148,7 +156,14 @@ class Index extends Component {
break;
case "emailStatus":
case "autoSendStatus":
+ case "smsStatus":
payrollTempForm.updateFields({ [it]: fieldsEchoData[it] ? "1" : "0" });
+ this.setState({
+ smsSettingDialog: {
+ ...this.state.smsSettingDialog,
+ content: (!_.isNil(smsSetting) && smsSetting.length > 0) ? JSON.parse(smsSetting).content : ""
+ }
+ });
break;
default:
payrollTempForm.updateFields({ [it]: fieldsEchoData[it] ? fieldsEchoData[it].toString() : "" });
@@ -232,10 +247,42 @@ class Index extends Component {
});
this.resetRequiredForm();
});
+ } else if (key === "smsStatus") {
+ this.setState({
+ conditions: _.map(this.state.conditions, it => {
+ if (it.title === getLabel(18905, "发送设置")) {
+ return {
+ ...it, items: _.map(it.items, o => {
+ if (getKey(o) === "smsSetting") {
+ return {
+ ...o, hide: params[key].value === "0"
+ // rules: (!_.isEmpty(replenishRuleOptions) && reissueRule === "1") ? "required|string" : "",
+ // viewAttr: (!_.isEmpty(replenishRuleOptions) && reissueRule === "1") ? 3 : 2,
+ };
+ }
+ return { ...o };
+ })
+ };
+ }
+ return { ...it };
+ })
+ }, () => {
+ payrollTempForm.initFormFields(this.state.conditions);
+ });
}
setHasBeenModify(true);
this.forceUpdate();
};
+ handleSmsSetting = () => {
+ const { payrollStore: { payrollTempForm } } = this.props;
+ const { smsSettingDialog } = this.state;
+ this.setState({
+ smsSettingDialog: {
+ ...smsSettingDialog, visible: true,
+ salarySobId: payrollTempForm.getFormParams().salarySob
+ }
+ });
+ };
resetRequiredForm = () => {
const { payrollStore: { payrollTempForm } } = this.props;
const reissueRule = payrollTempForm.getFormParams().reissueRule;
@@ -273,12 +320,12 @@ class Index extends Component {
};
render() {
- const { conditions, fbConditions, formData, salaryMonthOptions } = this.state;
+ const { conditions, fbConditions, formData, salaryMonthOptions, smsSettingDialog } = this.state;
const { payrollStore: { payrollTempForm, payrollTempFeedbackForm } } = this.props;
const autoSendStatus = payrollTempForm.getFormParams().autoSendStatus;
return (
- {!_.isEmpty(fbConditions) && getSearchs(payrollTempForm, conditions, 1, false, this.handleChange)}
+ {!_.isEmpty(fbConditions) && payrollFormRender(payrollTempForm, conditions, this.handleChange, this.handleSmsSetting, smsSettingDialog.content)}
{
autoSendStatus === "1" &&
}
- {!_.isEmpty(fbConditions) && getSearchs(payrollTempFeedbackForm, fbConditions, 1, false, this.handleFbChange)}
+ {!_.isEmpty(fbConditions) && payrollFormRender(payrollTempFeedbackForm, fbConditions, this.handleFbChange)}
+ this.setState({
+ smsSettingDialog: { ...smsSettingDialog, visible: false, content: smsContent || "" }
+ })}
+ />
);
}
diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/smsSettingDialog.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/smsSettingDialog.js
new file mode 100644
index 00000000..da308aee
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/smsSettingDialog.js
@@ -0,0 +1,150 @@
+/*
+ * Author: 黎永顺
+ * name: 短信设置弹框
+ * Description:
+ * Date: 2023/11/23
+ */
+import React, { Component } from "react";
+import { WeaDialog, WeaLocaleProvider } from "ecCom";
+import { Button, Col, Row, Tree } from "antd";
+import uuidV4 from "uuid/v4";
+import { getSmsSalaryItemSet } from "../../../../apis/payroll";
+import { Controlled as CodeMirror } from "react-codemirror2";
+import "codemirror/lib/codemirror.css";
+import "codemirror/lib/codemirror.js";
+import "codemirror/mode/javascript/javascript.js";
+
+const TreeNode = Tree.TreeNode;
+const getLabel = WeaLocaleProvider.getLabel;
+
+class SmsSettingDialog extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ variableExpandedKeys: [], variableList: [], smsContent: ""
+ };
+ this.editorRef = null;
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visible && nextProps.visible) this.getSmsSalaryItemSet(nextProps);
+ if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({
+ variableList: [], variableExpandedKeys: [], smsContent: ""
+ });
+ }
+
+ getSmsSalaryItemSet = (props) => {
+ this.setState({ smsContent: props.content });
+ getSmsSalaryItemSet({ salarySobId: props.salarySobId }).then(({ status, data }) => {
+ if (status) this.setState({
+ variableList: _.map(data, item => ({
+ key: item.groupId, value: item.groupName,
+ children: item.items
+ }))
+ });
+ });
+ };
+ insertText = text => {
+ const cursor = this.editorRef.getCursor();
+ this.editorRef.replaceRange(text, cursor);
+ this.editorRef.refresh();
+ this.editorRef.focus();
+ };
+ handleBackSpaceRedo = () => {
+ const { ch, line } = this.editorRef.getCursor();
+ const delStr = this.editorRef.getRange({ line, ch: ch - 1 }, { line, ch });
+ const codeValue = this.editorRef.getValue();
+ if (delStr === "}") {
+ if (codeValue.slice(0, ch).lastIndexOf("{") === -1) {
+ this.editorRef.replaceRange("", { line, ch: ch - 1 }, { line, ch });
+ } else {
+ this.editorRef.replaceRange("", { line, ch: codeValue.slice(0, ch).lastIndexOf("{") + 1 }, { line, ch });
+ }
+ }
+ this.editorRef.refresh();
+ this.editorRef.focus();
+ };
+ handleExpandVari = variableExpandedKeys => this.setState({ variableExpandedKeys });
+ handleVariNode = (__, { selectedNodes }) => {
+ const [selectedNode] = selectedNodes;
+ const { props } = selectedNode;
+ if (_.isNil(props.children)) this.insertText(`{${props.title}}`);
+ };
+
+ render() {
+ const { variableExpandedKeys, variableList, smsContent } = this.state;
+ return (
+ this.props.onCancel({ smsContent })}
+ buttons={[]}
+ style={{
+ width: 800,
+ height: 606.6,
+ minHeight: 200,
+ minWidth: 380,
+ maxHeight: "90%",
+ maxWidth: "90%",
+ overflow: "hidden",
+ transform: "translate(0px, 0px)"
+ }}
+ >
+
+
+
+ this.editorRef = editor}
+ value={smsContent}
+ onBeforeChange={(editor, data, value) => {
+ this.setState({ smsContent: value });
+ }}
+ onChange={editor => editor.getAllMarks().forEach(m => m.clear())}
+ options={{
+ lineNumbers: false,
+ mode: "javascript",
+ autofocus: false,
+ styleActiveLine: true,
+ lineWrapping: true,
+ matchBrackets: true,
+ lint: false,
+ indentUnit: 2,
+ cursorHeight: 0.85,
+ placeholder: "",
+ showCursorWhenSelecting: true
+ }}
+ onKeyDown={(_, { keyCode }) => keyCode === 8 && this.handleBackSpaceRedo()}
+ />
+
+
+
+
{getLabel(33748, "变量")}
+
+
+
+ {
+ _.map(variableList, item => {
+ const { key, value, children = [] } = item;
+ return
+ {
+ _.map(children, child => {
+ const { name, id } = child;
+ return ();
+ })
+ }
+ ;
+ })
+ }
+
+
+
+
+
+
+ );
+ }
+}
+
+export default SmsSettingDialog;
diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/updatePayrollTemplateSlide/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/updatePayrollTemplateSlide/index.js
index 73935ad6..ac2cb87c 100644
--- a/pc4mobx/hrmSalary/pages/payrollRelease/components/updatePayrollTemplateSlide/index.js
+++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/updatePayrollTemplateSlide/index.js
@@ -43,15 +43,21 @@ class Index extends Component {
} = this.props;
const [tempFormm, fbForm] = await Promise.all([payrollTempForm.validateForm(), payrollTempFeedbackForm.validateForm()]);
if (tempFormm.isValid && fbForm.isValid) {
- const { replenishRule, autoSendStatus, emailStatus, msgStatus, ...extraBs } = payrollTempForm.getFormParams(),
+ const {
+ replenishRule, autoSendStatus, emailStatus, msgStatus, smsStatus, ...extraBs
+ } = payrollTempForm.getFormParams(),
{ ackFeedbackStatus, autoAckDays, ...extraFb } = payrollTempFeedbackForm.getFormParams(),
- { formData } = this.tmpBaseSetRef.state;
+ { formData, smsSettingDialog } = this.tmpBaseSetRef.state;
const payload = {
...toJS(tmplDataSource), ...extraFb, ...formData, ...extraBs,
ackFeedbackStatus: ackFeedbackStatus === "1",
autoSendStatus: autoSendStatus === "1",
emailStatus: emailStatus === "1",
msgStatus: msgStatus === "1",
+ smsStatus: smsStatus === "1",
+ smsSetting: {
+ content: smsSettingDialog.content
+ },
autoAckDays: Number(autoAckDays),
replenishRule: (replenishRule === "0" || !replenishRule) ? "ALL" : replenishRule
};
diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/form.js b/pc4mobx/hrmSalary/pages/payrollRelease/form.js
new file mode 100644
index 00000000..7341b6fa
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/payrollRelease/form.js
@@ -0,0 +1,51 @@
+import { WeaSwitch } from "comsMobx";
+import { WeaFormItem, WeaHelpfulTip, WeaSearchGroup, WeaTextarea, WeaTools } from "ecCom";
+
+const getKey = WeaTools.getKey;
+//工资单模板表格渲染函数
+export const payrollFormRender = (form, condition, onChange = () => void (0), onFocus = () => void (0), smsVal) => {
+ const { isFormInit } = form;
+ const formParams = form.getFormParams();
+ let group = [];
+ isFormInit && condition && condition.map(c => {
+ let items = [];
+ c.items.map(fields => {
+ //自定义多行文本输入框
+ if (getKey(fields) === "smsSetting") {
+ items.push({
+ com: (
+
+
+ ),
+ colSpan: 1,
+ hide: fields.hide
+ });
+ } else {
+ items.push({
+ com: (
+
+
+ {
+ fields.helpfulTitle &&
+
+ }
+ ),
+ colSpan: 1,
+ hide: fields.hide
+ });
+ }
+ });
+ group.push(
+ );
+ });
+ return group;
+};
diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/index.js
index a6ae287d..fb49383c 100644
--- a/pc4mobx/hrmSalary/pages/payrollRelease/index.js
+++ b/pc4mobx/hrmSalary/pages/payrollRelease/index.js
@@ -88,7 +88,11 @@ class Index extends Component {
let dom = null;
switch (selectedKey) {
case "grant":
- dom = ;
+ dom = this.setState({ selectedKey: "template" }, () => {
+ this.templateRef.wrappedInstance.handleOpts({ key: "edit" }, { id });
+ })}
+ />;
break;
case "template":
dom = this.templateRef = dom} queryParams={queryParams}
diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/index.less b/pc4mobx/hrmSalary/pages/payrollRelease/index.less
index 73c92baa..2b3c079f 100644
--- a/pc4mobx/hrmSalary/pages/payrollRelease/index.less
+++ b/pc4mobx/hrmSalary/pages/payrollRelease/index.less
@@ -112,6 +112,17 @@
}
}
}
+
+ .customSm-wrapper {
+ position: relative;
+ z-index: 0;
+ background: transparent;
+
+ .wea-textarea-normal {
+ position: relative;
+ z-index: -1;
+ }
+ }
}
.sendTime-outer {
@@ -200,3 +211,78 @@
}
}
}
+
+.smsSettingDialog {
+ .smsSettingCont {
+ padding: 16px;
+ background: #f6f6f6;
+ height: 100%;
+ overflow-y: auto;
+
+ .ant-row {
+ background: #fff;
+ height: 100%;
+
+ & > div {
+ height: 100%;
+ }
+
+ & > div:first-child {
+
+ .react-codemirror2, .CodeMirror {
+ height: 100% !important;
+ }
+
+ span {
+ font-family: Liberation Mono, LiberationMonoRegular, Courier New, monospace;
+ }
+
+ .CodeMirror-code {
+ font-size: 16px;
+
+
+ }
+
+ .CodeMirror-scroll {
+ overflow-x: visible !important;
+ padding: 4px;
+ }
+
+ .CodeMirror-sizer {
+ margin-left: 0 !important;
+ }
+
+ .CodeMirror-gutters {
+ border-right: none;
+ background-color: #f7f7f7;
+ opacity: 0;
+ display: none;
+ }
+ }
+
+ & > div:last-child {
+ border-left: 1px solid #e5e5e5;
+ display: flex;
+ flex-direction: column;
+
+ .smsSetting-var-header {
+ display: flex;
+ padding: 10px 16px;
+ border-bottom: 1px solid #e5e5e5;
+
+ .smsSetting-var-header-title {
+ flex: 1;
+ font-weight: 600;
+ }
+ }
+
+ .smsSetting-var-header-content {
+ flex: 1;
+ overflow: hidden auto;
+ padding: 0 16px;
+ position: relative;
+ }
+ }
+ }
+ }
+}
From bbb9bce35a7a0e282209c003a7d6bc9fff535258 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, 24 Nov 2023 13:55:58 +0800
Subject: [PATCH 21/21] =?UTF-8?q?feature/2.9.42310.01-=E5=B7=A5=E8=B5=84?=
=?UTF-8?q?=E5=8D=95=E5=8F=91=E6=94=BE=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
---
.../pages/payrollRelease/components/payrollTempBaseSet/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js
index 012bc64e..4828795d 100644
--- a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js
+++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js
@@ -174,7 +174,7 @@ class Index extends Component {
if (it === "ackFeedbackStatus") {
payrollTempFeedbackForm.updateFields({ [it]: fieldsEchoData[it] ? "1" : "0" });
} else {
- payrollTempFeedbackForm.updateFields({ [it]: fieldsEchoData[it] ? fieldsEchoData[it].toString() : "" });
+ payrollTempFeedbackForm.updateFields({ [it]: !_.isNil(fieldsEchoData[it]) ? fieldsEchoData[it].toString() : "" });
}
});
this.setState({