diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js
index 07629fd4..bee748ee 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js
@@ -204,8 +204,8 @@ export default class Programme extends React.Component {
insuranceName: record["insuranceName"],
id: record.id,
isUse: record.isUse,
- paymentScope: record["payment_scope"].split(",").map(item => paymentScopeEnum[item]).join(","),
- welfareType: welfareTypeEnum[record.welfare_type]
+ paymentScope: record["paymentScope"].split(",").map(item => paymentScopeEnum[item]).join(","),
+ welfareType: welfareTypeEnum[record.welfareType]
});
};
From 64375f681da340529a9d608ee20063b461781d46 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, 3 Mar 2023 17:33:11 +0800
Subject: [PATCH 11/18] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86-?=
=?UTF-8?q?=E8=80=83=E5=8B=A4=E5=BC=95=E7=94=A8=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
---
.../components/importModal/headerSet.js | 16 +++++++--------
.../components/attendanceDataComp.js | 20 ++++++++++++-------
2 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/pc4mobx/hrmSalary/components/importModal/headerSet.js b/pc4mobx/hrmSalary/components/importModal/headerSet.js
index e51047b1..94717e9f 100644
--- a/pc4mobx/hrmSalary/components/importModal/headerSet.js
+++ b/pc4mobx/hrmSalary/components/importModal/headerSet.js
@@ -7,14 +7,14 @@ export default class HeaderSet extends React.Component {
return (
-
-
+ {/**/}
+ {/**/}
)
}
-}
\ No newline at end of file
+}
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
index c143b92a..1ee0714f 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
@@ -11,7 +11,8 @@ import {
deleteAttendance,
getAttendanceList,
getLedgerList,
- getSalaryCycleAndAttendCycle
+ getSalaryCycleAndAttendCycle,
+ previewAttendQuote
} from "../../../../apis/attendance";
import ImportModal from "../../../../components/importModal";
import HeaderSet from "../../../../components/importModal/headerSet";
@@ -85,12 +86,14 @@ class AttendanceDataComp extends Component {
});
};
handleChangeImportPayload = (key, value) => {
- const { importFormPayload } = this.state;
+ const { importFormPayload, importData } = this.state;
+ const { params } = importData;
this.setState({
importFormPayload: {
...importFormPayload,
[key]: value
- }
+ },
+ importData: { ...importData, params: { ...params, [key]: value } }
}, () => {
if (this.state.importFormPayload.salaryYearMonth && this.state.importFormPayload.salarySobId) {
const payload = {
@@ -127,15 +130,19 @@ class AttendanceDataComp extends Component {
});
};
handleImportAttendanceData = (importData) => {
+ const { importFormPayload } = this.state;
+ const { salaryYearMonth, salarySobId } = importFormPayload;
this.getLedgerList();
- this.setState({ importData });
+ this.setState({ importData: { ...importData, params: { salaryYearMonth, salarySobId } } });
};
setStep = step => this.setState({ importData: { ...this.state.importData, step } });
handleFinish = () => {
console.log("finish");
};
handlePreviewImport = (params) => {
- console.log("handlePreviewImport", params);
+ previewAttendQuote(params).then(({status, data})=>{
+ console.log("handlePreviewImport", data);
+ })
};
handleImport = (params) => {
console.log("handleImport", params);
@@ -147,8 +154,7 @@ class AttendanceDataComp extends Component {
message.warning("请完善导入选项,再下载");
return;
}
- // const { attendanceStore: { downloadTemplate } } = this.props;
- // downloadTemplate(salaryYearMonth, salarySobId);
+ window.open(`/api/bs/hrmsalary/attendQuote/downloadTemplate?salaryYearMonth=${salaryYearMonth}&salarySobId=${salarySobId}`);
};
render() {
From 33e96c4437436a12acec4d98d366b9af5a4f2bd0 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, 6 Mar 2023 15:06:56 +0800
Subject: [PATCH 12/18] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86-?=
=?UTF-8?q?=E8=80=83=E5=8B=A4=E5=BC=95=E7=94=A8=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
---
.../components/importModal/headerSet.js | 34 ++--
.../components/selectItemsModal/index.js | 108 +++++--------
.../components/selectItemsModal/index.less | 67 ++++++++
.../components/selectItemsModal/index11.js | 93 +++++++++++
.../selectItemsModal/selectItemsWrapper.js | 116 ++++++--------
.../selectItemsWrappercopy.js | 78 +++++++++
.../components/attendanceDataComp.js | 150 +++++++++++++++---
7 files changed, 474 insertions(+), 172 deletions(-)
create mode 100644 pc4mobx/hrmSalary/components/selectItemsModal/index.less
create mode 100644 pc4mobx/hrmSalary/components/selectItemsModal/index11.js
create mode 100644 pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrappercopy.js
diff --git a/pc4mobx/hrmSalary/components/importModal/headerSet.js b/pc4mobx/hrmSalary/components/importModal/headerSet.js
index 94717e9f..41fe75a7 100644
--- a/pc4mobx/hrmSalary/components/importModal/headerSet.js
+++ b/pc4mobx/hrmSalary/components/importModal/headerSet.js
@@ -1,20 +1,20 @@
-import React from "react"
-import { Button } from "antd"
-import { WeaCheckbox, WeaHelpfulTip } from "ecCom";
+import React from "react";
+import { Button } from "antd";
export default class HeaderSet extends React.Component {
- render() {
- return (
-
-
- {/**/}
- {/**/}
-
- )
- }
+ render() {
+ return (
+
+
+ {/**/}
+ {/**/}
+
+ );
+ }
}
diff --git a/pc4mobx/hrmSalary/components/selectItemsModal/index.js b/pc4mobx/hrmSalary/components/selectItemsModal/index.js
index 27cc02a7..6bb7919d 100644
--- a/pc4mobx/hrmSalary/components/selectItemsModal/index.js
+++ b/pc4mobx/hrmSalary/components/selectItemsModal/index.js
@@ -5,24 +5,11 @@
* LastEditTime: 2022-06-29 10:06:13
*/
import React from "react";
-import { WeaCheckbox, WeaInputSearch, WeaDialog } from "ecCom";
-import { Button, Dropdown, Menu, Modal } from "antd";
-import "../../pages/dataAcquisition/attendance/index.less"
+import { WeaCheckbox, WeaDialog, WeaInputSearch } from "ecCom";
+import { Button } from "antd";
+import "./index.less";
-export const items = [
- {
- key: "1",
- title: "测试",
- checked: false
- },
- {
- key: "2",
- title: "测试2",
- checked: true
- }
-];
-
export default class SelectItemModal extends React.Component {
constructor(props) {
super(props);
@@ -31,62 +18,49 @@ export default class SelectItemModal extends React.Component {
};
}
- handleShowChecked(value) {
- value = value == 1 ? true : false;
- this.props.onShowChecked(value);
- }
-
- handleMenuClick(e) {
- if (e.key == "1") { //恢复默认设置
- this.props.onRestoreDefault();
- } else if (e.key == "2") {
- this.props.onSetDefault();
- } else if (e.key == "3") {
-
- }
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (
+ nextProps.visible !== this.props.visible &&
+ !nextProps.visible
+ ) this.setState({ searchValue: "" });
}
render() {
- const menu = (
-
- );
+ const { searchValue } = this.state;
+ const { title, onSearchItemSet, onShowOnlyChecked, comp: children, ...extra } = this.props;
+ const btns = [
];
+ const moreBtn = {
+ datas: [
+ {
+ key: "recovery",
+ content: "恢复默认设置",
+ icon:
,
+ onClick: key => alert(`点击事物处理函数接受的实参为 ${key}`)
+ },
+ {
+ key: "setting",
+ content: "设为默认设置",
+ icon:
,
+ onClick: key => alert(`点击事物处理函数接受的实参为 ${key}`)
+ }
+ ]
+ };
+ const titleComp =
+ {title}
+ this.setState({ searchValue })}
+ placeholder="请输入关键字" style={{ width: 200 }}
+ onSearch={onSearchItemSet}
+ />
+
;
+ const bottomLeft =
;
return (
- {
- this.props.onSave();
- }}>保存,
- 更多
- ]}
+
-
- {
- this.setState({ searchValue: value });
- }}
- onSearch={(value) => {
- this.props.onSearch(value);
- }}
- />
-
- {this.props.children}
-
- {
- this.handleShowChecked(value);
- }}/>
-
+ {children}
);
}
diff --git a/pc4mobx/hrmSalary/components/selectItemsModal/index.less b/pc4mobx/hrmSalary/components/selectItemsModal/index.less
new file mode 100644
index 00000000..6486a98c
--- /dev/null
+++ b/pc4mobx/hrmSalary/components/selectItemsModal/index.less
@@ -0,0 +1,67 @@
+.setWrapper {
+ .setHeaderWrapper, .setGroupWrapper {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ width: 100%;
+ }
+
+ .wea-title .ant-checkbox-wrapper > span:last-child, .setGroupWrapper > .checkedtitle {
+ color: #111;
+ font-weight: 600;
+ font-size: 12px;
+ padding-right: 8px;
+ }
+
+ .itemContUl {
+ display: flex;
+ align-items: center;
+ flex-wrap: wrap;
+
+ li {
+ width: 124px;
+ overflow: hidden;
+ padding: 4px 0;
+
+ .wea-checkbox {
+ width: 100%;
+ }
+
+ .ant-checkbox-wrapper {
+ display: flex;
+ align-items: center;
+ width: 100%;
+
+ span:last-child {
+ flex: 1;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+ }
+ }
+ }
+
+ .itemsWrapper {
+ height: 160px;
+ overflow: scroll;
+ border: 1px solid #e5e5e5;
+ border-radius: 4px;
+ padding: 16px;
+ width: 100%;
+
+ .empty {
+ line-height: 160px;
+ text-align: center;
+ font-size: 14px;
+ display: inline-block;
+ width: 100%;
+ }
+ }
+
+ .wea-more-button {
+ ul > li:last-child {
+ display: none !important;
+ }
+ }
+}
diff --git a/pc4mobx/hrmSalary/components/selectItemsModal/index11.js b/pc4mobx/hrmSalary/components/selectItemsModal/index11.js
new file mode 100644
index 00000000..27cc02a7
--- /dev/null
+++ b/pc4mobx/hrmSalary/components/selectItemsModal/index11.js
@@ -0,0 +1,93 @@
+/*
+ * Author: 黎永顺
+ * Description:
+ * Date: 2022-05-19 15:18:09
+ * LastEditTime: 2022-06-29 10:06:13
+ */
+import React from "react";
+import { WeaCheckbox, WeaInputSearch, WeaDialog } from "ecCom";
+import { Button, Dropdown, Menu, Modal } from "antd";
+import "../../pages/dataAcquisition/attendance/index.less"
+
+
+export const items = [
+ {
+ key: "1",
+ title: "测试",
+ checked: false
+ },
+ {
+ key: "2",
+ title: "测试2",
+ checked: true
+ }
+];
+
+export default class SelectItemModal extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ searchValue: ""
+ };
+ }
+
+ handleShowChecked(value) {
+ value = value == 1 ? true : false;
+ this.props.onShowChecked(value);
+ }
+
+ handleMenuClick(e) {
+ if (e.key == "1") { //恢复默认设置
+ this.props.onRestoreDefault();
+ } else if (e.key == "2") {
+ this.props.onSetDefault();
+ } else if (e.key == "3") {
+
+ }
+ }
+
+ render() {
+ const menu = (
+
+ );
+ return (
+ {
+ this.props.onSave();
+ }}>保存,
+ 更多
+ ]}
+ >
+
+ {
+ this.setState({ searchValue: value });
+ }}
+ onSearch={(value) => {
+ this.props.onSearch(value);
+ }}
+ />
+
+ {this.props.children}
+
+ {
+ this.handleShowChecked(value);
+ }}/>
+
+
+ );
+ }
+}
diff --git a/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js b/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js
index b29f38b8..e4d99a5e 100644
--- a/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js
+++ b/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js
@@ -1,78 +1,56 @@
-import React from "react";
-import { WeaCheckbox } from "ecCom";
-import { Col, Icon, Row } from "antd";
+/*
+ * Author: 黎永顺
+ * name: 设置项目
+ * Description:
+ * Date: 2023/3/6
+ */
+import React, { Component } from "react";
+import { WeaCheckbox, WeaSearchGroup } from "ecCom";
-export default class SelectItemsWrapper extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- showContent: true,
- checkStatus: false
- };
- }
-
- handleAllChecked(value) {
- value = value == 1 ? true : false;
- let items = [...this.props.items];
- items.map(item => {
- item.checked = value;
- });
- this.setState({
- checkStatus: value
- });
- this.props.onChange(items);
- }
-
- handleItemChange(value, record) {
- value = value == 1 ? true : false;
- let items = [...this.props.items];
- items.map(item => {
- if (item.id == record.id) {
- item.checked = value;
- }
- });
- this.props.onChange(items);
- }
+class SelectItemsWrapper extends Component {
+ renderTitle = (item) => {
+ const { groupName } = item;
+ return
+
+ 已选择0个字段
+
;
+ };
render() {
+ const { dataSource } = this.props;
return (
-
-
-
{this.props.title}} onChange={(value) => {
- this.handleAllChecked(value);
- }} value={this.state.checkStatus}/>
-
this.setState({
- showContent: !this.state.showContent
- })}>已选中{this.props.items ? this.props.items.filter(item => item.checked).length : 0}个字段
-
- {
- this.state.showContent ? :
- }
-
-
-
+
{
- this.state.showContent &&
-
- {
- this.props.items && this.props.items.map(item => (
- {
- this.handleItemChange(value, item);
- }}/>
- ))
- }
-
-
+ _.map(dataSource, item => {
+ const { items } = item;
+ return
+
+ {
+ _.isEmpty(items) ?
+
暂无数据 :
+
+ {
+ _.map(items, child => {
+ const { name, checked } = child;
+ return -
+ {
+ console.log(value);
+ }}
+ />
+
;
+ })
+ }
+
+ }
+
+ ;
+ })
}
-
-
+
);
}
}
+
+export default SelectItemsWrapper;
diff --git a/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrappercopy.js b/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrappercopy.js
new file mode 100644
index 00000000..b29f38b8
--- /dev/null
+++ b/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrappercopy.js
@@ -0,0 +1,78 @@
+import React from "react";
+import { WeaCheckbox } from "ecCom";
+import { Col, Icon, Row } from "antd";
+
+export default class SelectItemsWrapper extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ showContent: true,
+ checkStatus: false
+ };
+ }
+
+ handleAllChecked(value) {
+ value = value == 1 ? true : false;
+ let items = [...this.props.items];
+ items.map(item => {
+ item.checked = value;
+ });
+ this.setState({
+ checkStatus: value
+ });
+ this.props.onChange(items);
+ }
+
+ handleItemChange(value, record) {
+ value = value == 1 ? true : false;
+ let items = [...this.props.items];
+ items.map(item => {
+ if (item.id == record.id) {
+ item.checked = value;
+ }
+ });
+ this.props.onChange(items);
+ }
+
+ render() {
+ return (
+
+
+
{this.props.title}} onChange={(value) => {
+ this.handleAllChecked(value);
+ }} value={this.state.checkStatus}/>
+
this.setState({
+ showContent: !this.state.showContent
+ })}>已选中{this.props.items ? this.props.items.filter(item => item.checked).length : 0}个字段
+
+ {
+ this.state.showContent ? :
+ }
+
+
+
+ {
+ this.state.showContent &&
+
+ {
+ this.props.items && this.props.items.map(item => (
+ {
+ this.handleItemChange(value, item);
+ }}/>
+ ))
+ }
+
+
+ }
+
+
+ );
+ }
+}
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
index 1ee0714f..2eb99f7e 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
@@ -9,25 +9,31 @@ import { WeaTable } from "ecCom";
import { message, Modal } from "antd";
import {
deleteAttendance,
+ getAttendanceFieldSettingList,
getAttendanceList,
getLedgerList,
getSalaryCycleAndAttendCycle,
+ importAttendQuoteData,
previewAttendQuote
} from "../../../../apis/attendance";
import ImportModal from "../../../../components/importModal";
import HeaderSet from "../../../../components/importModal/headerSet";
import ImportFormOptions from "./importFormOptions";
+import SelectItemModal from "../../../../components/selectItemsModal";
import moment from "moment";
+import SelectItemsWrapper from "../../../../components/selectItemsModal/selectItemsWrapper";
class AttendanceDataComp extends Component {
constructor(props) {
super(props);
this.state = {
loading: {
- query: false
+ query: false,
+ headset: false
},
dataSource: [],
columns: [],
+ fieldSetList: [],
pageInfo: {
current: 1,
pageSize: 10,
@@ -40,7 +46,8 @@ class AttendanceDataComp extends Component {
importFormPayload: {
salaryYearMonth: moment().format("YYYY-MM"), salarySobList: [],
salarySobId: "", salaryCycle: "", attendCycle: ""
- }
+ },
+ fieldSetPayload: { visible: false, title: "", data: [] }
};
}
@@ -137,15 +144,47 @@ class AttendanceDataComp extends Component {
};
setStep = step => this.setState({ importData: { ...this.state.importData, step } });
handleFinish = () => {
- console.log("finish");
+ const { importData } = this.state;
+ const { step } = importData;
+ this.setState({
+ importData: {
+ ...importData, visiable: false, params: {}, step: 0,
+ columns: [], slideDataSource: [], importResult: []
+ }
+ });
+ step === 2 && this.getAttendanceList();
};
handlePreviewImport = (params) => {
- previewAttendQuote(params).then(({status, data})=>{
- console.log("handlePreviewImport", data);
- })
+ const { importData } = this.state;
+ previewAttendQuote(params).then(({ status, data }) => {
+ if (status) {
+ const { headers, list } = data;
+ this.setState({
+ importData: {
+ ...importData,
+ columns: _.map(headers, (it, dataIndex) => ({ title: it, dataIndex })),
+ slideDataSource: _.map(list, item => {
+ return _.reduce(item, (pre, cur, key) => (_.assign(pre, { [key]: cur })), {});
+ })
+ }
+ });
+ }
+ });
};
handleImport = (params) => {
- console.log("handleImport", params);
+ const { importData } = this.state;
+ const { step } = importData;
+ importAttendQuoteData(params).then(({ status, data }) => {
+ if (status) {
+ this.setState({
+ importData: {
+ ...importData,
+ step: step + 1,
+ importResult: data
+ }
+ });
+ }
+ });
};
handleTemplateLinkClick = () => {
const { importFormPayload } = this.state;
@@ -156,9 +195,81 @@ class AttendanceDataComp extends Component {
}
window.open(`/api/bs/hrmsalary/attendQuote/downloadTemplate?salaryYearMonth=${salaryYearMonth}&salarySobId=${salarySobId}`);
};
+ /*
+ * Author: 黎永顺
+ * Description: 表头设置
+ * Params:
+ * Date: 2023/3/6
+ */
+ handleHeaderSettings = (params) => {
+ const { fieldSetPayload, loading } = this.state;
+ this.setState({ loading: { ...loading, headset: true } });
+ getAttendanceFieldSettingList(params).then(({ status, data }) => {
+ this.setState({ loading: { ...loading, headset: false } });
+ if (status) {
+ this.setState({
+ fieldSetList: data,
+ fieldSetPayload: {
+ ...fieldSetPayload,
+ visible: true, title: "导入字段设置", data
+ }
+ });
+ }
+ }).catch(() => this.setState({ loading: { ...loading, headset: false } }));
+ };
+ handleCloseSettings = () => {
+ const { fieldSetPayload } = this.state;
+ this.setState({
+ fieldSetPayload: {
+ ...fieldSetPayload,
+ visible: false, title: "", data: []
+ }
+ });
+ };
+ handleSearchItemSet = (val) => {
+ const { fieldSetPayload, fieldSetList } = this.state;
+ this.setState({
+ fieldSetPayload: {
+ ...fieldSetPayload,
+ data: _.map(_.cloneDeep(fieldSetList), item => {
+ return {
+ ...item,
+ items: _.filter(item.items || [], child => {
+ return child.name.indexOf(val) !== -1;
+ })
+ };
+ })
+ }
+ });
+ };
+ handleShowOnlyChecked = (checked) => {
+ const { fieldSetPayload, fieldSetList } = this.state;
+ if (!!NUmber(checked)) {
+ this.setState({
+ fieldSetPayload: {
+ ...fieldSetPayload,
+ data: _.map(_.cloneDeep(fieldSetList), item => {
+ return {
+ ...item,
+ items: _.map(item.items || [], child => !!child.checked)
+ };
+ })
+ }
+ });
+ } else {
+ this.setState({
+ fieldSetPayload: {
+ ...fieldSetPayload,
+ data: _.cloneDeep(fieldSetList)
+ }
+ });
+ }
+ };
render() {
- const { dataSource, columns, pageInfo, loading, importData, importFormPayload } = this.state;
+ const {
+ dataSource, columns, pageInfo, loading, importData, importFormPayload, fieldSetPayload
+ } = this.state;
const { showOperateBtn, salaryYearMonth } = this.props;
const pagination = {
...pageInfo,
@@ -207,19 +318,20 @@ class AttendanceDataComp extends Component {
previewImport={this.handlePreviewImport} importFile={this.handleImport}
templateLink={this.handleTemplateLinkClick} onCancel={this.handleFinish}
headerSetCompoent={ {
- // getAttendanceFieldSettingList({ sourceType: "IMPORT" });
- // this.setState({
- // selectItemVisible: true
- // });
- }}
- />}
- renderFormComponent={
- () =>
+ loading={loading.headset}
+ onSetClick={() => this.handleHeaderSettings({ sourceType: "IMPORT" })}/>}
+ renderFormComponent={() =>
}
/>
+ {/* 表头设置 */}
+ }
+ onCancel={this.handleCloseSettings}
+ onSearchItemSet={this.handleSearchItemSet}
+ onShowOnlyChecked={this.handleShowOnlyChecked}
+ />
);
}
From 34dd145e00ab88fa58f55d758a4b4b45729c43b8 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, 6 Mar 2023 15:08:50 +0800
Subject: [PATCH 13/18] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86-?=
=?UTF-8?q?=E8=80=83=E5=8B=A4=E5=BC=95=E7=94=A8=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
---
.../dataAcquisition/attendance/components/attendanceDataComp.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
index 2eb99f7e..e70e6acd 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
@@ -244,7 +244,7 @@ class AttendanceDataComp extends Component {
};
handleShowOnlyChecked = (checked) => {
const { fieldSetPayload, fieldSetList } = this.state;
- if (!!NUmber(checked)) {
+ if (!!Number(checked)) {
this.setState({
fieldSetPayload: {
...fieldSetPayload,
From 1fc70a9978fa5989c9fa6a674378ccf1d943f3e6 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, 6 Mar 2023 17:13:08 +0800
Subject: [PATCH 14/18] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86-?=
=?UTF-8?q?=E8=80=83=E5=8B=A4=E5=BC=95=E7=94=A8=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
---
.../selectItemsModal/selectItemsWrapper.js | 13 ++--
.../components/attendanceDataComp.js | 78 ++++++++++++++++++-
2 files changed, 82 insertions(+), 9 deletions(-)
diff --git a/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js b/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js
index e4d99a5e..7a3ed519 100644
--- a/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js
+++ b/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js
@@ -9,15 +9,16 @@ import { WeaCheckbox, WeaSearchGroup } from "ecCom";
class SelectItemsWrapper extends Component {
renderTitle = (item) => {
- const { groupName } = item;
+ const { onSelectGroupAll } = this.props;
+ const { groupName, groupId } = item;
return
-
+ onSelectGroupAll(groupId, val)}/>
已选择0个字段
;
};
render() {
- const { dataSource } = this.props;
+ const { dataSource, onSelectItem } = this.props;
return (
{
@@ -31,13 +32,11 @@ class SelectItemsWrapper extends Component {
{
_.map(items, child => {
- const { name, checked } = child;
+ const { name, checked, id } = child;
return -
{
- console.log(value);
- }}
+ onChange={(val) => onSelectItem(id, val)}
/>
;
})
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
index e70e6acd..0a7b6c4d 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
@@ -229,6 +229,14 @@ class AttendanceDataComp extends Component {
handleSearchItemSet = (val) => {
const { fieldSetPayload, fieldSetList } = this.state;
this.setState({
+ fieldSetList: _.map(_.cloneDeep(fieldSetList), item => {
+ return {
+ ...item,
+ items: _.filter(item.items || [], child => {
+ return child.name.indexOf(val) !== -1;
+ })
+ };
+ }),
fieldSetPayload: {
...fieldSetPayload,
data: _.map(_.cloneDeep(fieldSetList), item => {
@@ -251,7 +259,7 @@ class AttendanceDataComp extends Component {
data: _.map(_.cloneDeep(fieldSetList), item => {
return {
...item,
- items: _.map(item.items || [], child => !!child.checked)
+ items: _.filter(item.items || [], child => !!child.checked)
};
})
}
@@ -265,6 +273,66 @@ class AttendanceDataComp extends Component {
});
}
};
+ handleSelectGroupAll = (groupId, checked) => {
+ const { fieldSetPayload, fieldSetList } = this.state;
+ this.setState({
+ fieldSetList: _.map(_.cloneDeep(fieldSetList), item => {
+ if (groupId === item.groupId) {
+ return {
+ ...item,
+ items: _.map(item.items || [], child => {
+ return { ...child, checked: !!Number(checked) };
+ })
+ };
+ }
+ return { ...item };
+ }),
+ fieldSetPayload: {
+ ...fieldSetPayload,
+ data: _.map(_.cloneDeep(fieldSetList), item => {
+ if (groupId === item.groupId) {
+ return {
+ ...item,
+ items: _.map(item.items || [], child => {
+ return { ...child, checked: !!Number(checked) };
+ })
+ };
+ }
+ return { ...item };
+ })
+ }
+ });
+ };
+ handleSelectItem = (id, checked) => {
+ const { fieldSetPayload, fieldSetList } = this.state;
+ this.setState({
+ fieldSetList: _.map(_.cloneDeep(fieldSetList), item => {
+ return {
+ ...item,
+ items: _.map(item.items || [], child => {
+ if (id === child.id) {
+ return { ...child, checked: !!Number(checked) };
+ }
+ return { ...child };
+ })
+ };
+ }),
+ fieldSetPayload: {
+ ...fieldSetPayload,
+ data: _.map(_.cloneDeep(fieldSetList), item => {
+ return {
+ ...item,
+ items: _.map(item.items || [], child => {
+ if (id === child.id) {
+ return { ...child, checked: !!Number(checked) };
+ }
+ return { ...child };
+ })
+ };
+ })
+ }
+ });
+ };
render() {
const {
@@ -327,7 +395,13 @@ class AttendanceDataComp extends Component {
/>
{/* 表头设置 */}
}
+ comp={
+
+ }
onCancel={this.handleCloseSettings}
onSearchItemSet={this.handleSearchItemSet}
onShowOnlyChecked={this.handleShowOnlyChecked}
From 6d5258daa5da2e5a1f9a864cc28811dfb732af9d 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, 7 Mar 2023 14:47:47 +0800
Subject: [PATCH 15/18] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86-?=
=?UTF-8?q?=E8=80=83=E5=8B=A4=E5=BC=95=E7=94=A8=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/apis/attendance.js | 4 +-
.../components/selectItemsModal/index.js | 2 +-
.../selectItemsModal/selectItemsWrapper.js | 81 +++++++-
.../dataAcquisition/attendance/columns.js | 42 +++++
.../components/attendanceDataComp.js | 178 ++++++------------
.../components/attendanceDataViewSlide.js | 143 ++++++++++++++
.../components/attendanceRefrenceDataModal.js | 114 +++++++++++
.../attendance/components/index.less | 34 ++++
.../pages/dataAcquisition/attendance/index.js | 7 +-
pc4mobx/hrmSalary/stores/attendanceStore.js | 1 +
10 files changed, 482 insertions(+), 124 deletions(-)
create mode 100644 pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataViewSlide.js
create mode 100644 pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceRefrenceDataModal.js
diff --git a/pc4mobx/hrmSalary/apis/attendance.js b/pc4mobx/hrmSalary/apis/attendance.js
index f528ce12..d4a2b304 100644
--- a/pc4mobx/hrmSalary/apis/attendance.js
+++ b/pc4mobx/hrmSalary/apis/attendance.js
@@ -273,14 +273,14 @@ export const importAttendQuoteData = (params) => {
};
// 查看考勤详情
-export const viewAttendQuote = (ids) => {
+export const viewAttendQuote = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/view", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
- body: JSON.stringify(ids),
+ body: JSON.stringify(params),
}).then((res) => res.json());
};
diff --git a/pc4mobx/hrmSalary/components/selectItemsModal/index.js b/pc4mobx/hrmSalary/components/selectItemsModal/index.js
index 6bb7919d..7b8ca17a 100644
--- a/pc4mobx/hrmSalary/components/selectItemsModal/index.js
+++ b/pc4mobx/hrmSalary/components/selectItemsModal/index.js
@@ -27,7 +27,7 @@ export default class SelectItemModal extends React.Component {
render() {
const { searchValue } = this.state;
- const { title, onSearchItemSet, onShowOnlyChecked, comp: children, ...extra } = this.props;
+ const { title, onSearchItemSet, onShowOnlyChecked, children, ...extra } = this.props;
const btns = [];
const moreBtn = {
datas: [
diff --git a/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js b/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js
index 7a3ed519..25c7e550 100644
--- a/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js
+++ b/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js
@@ -8,6 +8,81 @@ import React, { Component } from "react";
import { WeaCheckbox, WeaSearchGroup } from "ecCom";
class SelectItemsWrapper extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ list: [],
+ filterList: []
+ };
+ }
+
+ componentDidMount() {
+ this.setState({
+ list: this.props.dataSource
+ });
+ }
+
+ handleSearchItemSet = (val) => {
+ const { dataSource } = this.props;
+ this.setState({
+ filterList: _.map(dataSource, item => {
+ return {
+ ...item,
+ items: _.filter(item.items || [], child => child.name.indexOf(val) !== -1)
+ };
+ })
+ });
+ };
+ handleShowOnlyChecked = (checked) => {
+ const { dataSource } = this.props;
+ const { list } = this.state;
+ if (!!Number(checked)) {
+ this.setState({
+ list: _.map(list, item => {
+ return {
+ ...item,
+ items: _.filter(item.items || [], child => !!child.checked)
+ };
+ })
+ });
+ } else {
+ this.setState({ list: dataSource });
+ }
+ };
+ handleSelectGroupAll = (groupId, checked) => {
+ const { list, filterList } = this.state;
+ const key = !_.isEmpty(filterList) ? "filterList" : "list";
+ this.setState({
+ [key]: _.map(!_.isEmpty(filterList) ? filterList : list, item => {
+ if (groupId === item.groupId) {
+ return {
+ ...item,
+ items: _.map(item.items || [], child => {
+ return { ...child, checked: !!Number(checked) };
+ })
+ };
+ }
+ return { ...item };
+ })
+ });
+ };
+ handleSelectItem = (id, checked) => {
+ const { list, filterList } = this.state;
+ const key = !_.isEmpty(filterList) ? "filterList" : "list";
+ this.setState({
+ [key]: _.map(!_.isEmpty(filterList) ? filterList : list, item => {
+ return {
+ ...item,
+ items: _.map(item.items || [], child => {
+ if (id === child.id) {
+ return { ...child, checked: !!Number(checked) };
+ }
+ return { ...child };
+ })
+ };
+ })
+ });
+ };
renderTitle = (item) => {
const { onSelectGroupAll } = this.props;
const { groupName, groupId } = item;
@@ -18,11 +93,13 @@ class SelectItemsWrapper extends Component {
};
render() {
- const { dataSource, onSelectItem } = this.props;
+ const { list, filterList } = this.state;
+ const { onSelectItem } = this.props;
+ console.log("filterList", filterList);
return (
{
- _.map(dataSource, item => {
+ _.map(!_.isEmpty(filterList) ? filterList : list, item => {
const { items } = item;
return
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/columns.js
index 41094e98..dc082d76 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/columns.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/columns.js
@@ -141,6 +141,7 @@ export const conditions = [
showname: "文本"
}
],
+ rules: "required|string",
viewAttr: 3
},
{
@@ -167,5 +168,46 @@ export const conditions = [
defaultshow: true
}
];
+export const reFrenceConditions = [
+ {
+ items: [
+ {
+ colSpan: 1,
+ conditionType: "MONTHPICKER",
+ domkey: ["salaryYearMonth"],
+ fieldcol: 18,
+ rules: "required|string",
+ label: "薪资所属月",
+ labelcol: 6,
+ value: "",
+ viewAttr: 3
+ },
+ {
+ colSpan: 1,
+ conditionType: "SELECT",
+ domkey: ["salarySobId"],
+ fieldcol: 18,
+ isQuickSearch: false,
+ label: "薪资账套",
+ labelcol: 6,
+ valueList:[],
+ options: [],
+ rules: "required|string",
+ viewAttr: 3
+ },
+ {
+ colSpan: 1,
+ conditionType: "INPUT",
+ domkey: ["description"],
+ fieldcol: 18,
+ label: "备注",
+ labelcol: 6,
+ value: "",
+ viewAttr: 2
+ }
+ ],
+ defaultshow: true
+ }
+];
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
index 0a7b6c4d..8e2dbd78 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
@@ -22,6 +22,8 @@ import ImportFormOptions from "./importFormOptions";
import SelectItemModal from "../../../../components/selectItemsModal";
import moment from "moment";
import SelectItemsWrapper from "../../../../components/selectItemsModal/selectItemsWrapper";
+import AttendanceRefrenceDataModal from "./attendanceRefrenceDataModal";
+import AttendanceDataViewSlide from "./attendanceDataViewSlide";
class AttendanceDataComp extends Component {
constructor(props) {
@@ -33,7 +35,6 @@ class AttendanceDataComp extends Component {
},
dataSource: [],
columns: [],
- fieldSetList: [],
pageInfo: {
current: 1,
pageSize: 10,
@@ -47,7 +48,9 @@ class AttendanceDataComp extends Component {
salaryYearMonth: moment().format("YYYY-MM"), salarySobList: [],
salarySobId: "", salaryCycle: "", attendCycle: ""
},
- fieldSetPayload: { visible: false, title: "", data: [] }
+ fieldSetPayload: { visible: false, title: "", children: null },
+ attendanceReferencePayload: { visible: false, title: "" },
+ attendanceViewPayload: { visible: false, attendQuoteId: "", salaryYearMonth: "" }
};
}
@@ -136,6 +139,16 @@ class AttendanceDataComp extends Component {
}
});
};
+ handleViewAttendanceData = ({ id, salaryCycle }) => {
+ const { attendanceViewPayload } = this.state;
+ this.setState({
+ attendanceViewPayload: {
+ ...attendanceViewPayload,
+ visible: true, attendQuoteId: id,
+ salaryYearMonth: salaryCycle
+ }
+ });
+ };
handleImportAttendanceData = (importData) => {
const { importFormPayload } = this.state;
const { salaryYearMonth, salarySobId } = importFormPayload;
@@ -208,10 +221,15 @@ class AttendanceDataComp extends Component {
this.setState({ loading: { ...loading, headset: false } });
if (status) {
this.setState({
- fieldSetList: data,
fieldSetPayload: {
...fieldSetPayload,
- visible: true, title: "导入字段设置", data
+ visible: true, title: "导入字段设置",
+ children:
this.setItemRef = dom}
+ dataSource={data}
+ onSelectGroupAll={this.handleSelectGroupAll}
+ onSelectItem={this.handleSelectItem}
+ />
}
});
}
@@ -222,121 +240,35 @@ class AttendanceDataComp extends Component {
this.setState({
fieldSetPayload: {
...fieldSetPayload,
- visible: false, title: "", data: []
+ visible: false, title: "", children: null
}
});
};
- handleSearchItemSet = (val) => {
- const { fieldSetPayload, fieldSetList } = this.state;
- this.setState({
- fieldSetList: _.map(_.cloneDeep(fieldSetList), item => {
- return {
- ...item,
- items: _.filter(item.items || [], child => {
- return child.name.indexOf(val) !== -1;
- })
- };
- }),
- fieldSetPayload: {
- ...fieldSetPayload,
- data: _.map(_.cloneDeep(fieldSetList), item => {
- return {
- ...item,
- items: _.filter(item.items || [], child => {
- return child.name.indexOf(val) !== -1;
- })
- };
- })
- }
- });
+ handleSearchItemSet = (val) => this.setItemRef.handleSearchItemSet(val);
+ handleShowOnlyChecked = (checked) => this.setItemRef.handleShowOnlyChecked(checked);
+ handleSelectGroupAll = (groupId, checked) => this.setItemRef.handleSelectGroupAll(groupId, checked);
+ handleSelectItem = (id, checked) => this.setItemRef.handleSelectItem(id, checked);
+ /*
+ * Author: 黎永顺
+ * Description: 考勤数据引用
+ * Params:
+ * Date: 2023/3/7
+ */
+ handleQuoteAttendanceData = (payload) => {
+ const { attendanceReferencePayload } = this.state;
+ this.setState({ attendanceReferencePayload: { ...attendanceReferencePayload, ...payload } });
};
- handleShowOnlyChecked = (checked) => {
- const { fieldSetPayload, fieldSetList } = this.state;
- if (!!Number(checked)) {
- this.setState({
- fieldSetPayload: {
- ...fieldSetPayload,
- data: _.map(_.cloneDeep(fieldSetList), item => {
- return {
- ...item,
- items: _.filter(item.items || [], child => !!child.checked)
- };
- })
- }
- });
- } else {
- this.setState({
- fieldSetPayload: {
- ...fieldSetPayload,
- data: _.cloneDeep(fieldSetList)
- }
- });
- }
- };
- handleSelectGroupAll = (groupId, checked) => {
- const { fieldSetPayload, fieldSetList } = this.state;
- this.setState({
- fieldSetList: _.map(_.cloneDeep(fieldSetList), item => {
- if (groupId === item.groupId) {
- return {
- ...item,
- items: _.map(item.items || [], child => {
- return { ...child, checked: !!Number(checked) };
- })
- };
- }
- return { ...item };
- }),
- fieldSetPayload: {
- ...fieldSetPayload,
- data: _.map(_.cloneDeep(fieldSetList), item => {
- if (groupId === item.groupId) {
- return {
- ...item,
- items: _.map(item.items || [], child => {
- return { ...child, checked: !!Number(checked) };
- })
- };
- }
- return { ...item };
- })
- }
- });
- };
- handleSelectItem = (id, checked) => {
- const { fieldSetPayload, fieldSetList } = this.state;
- this.setState({
- fieldSetList: _.map(_.cloneDeep(fieldSetList), item => {
- return {
- ...item,
- items: _.map(item.items || [], child => {
- if (id === child.id) {
- return { ...child, checked: !!Number(checked) };
- }
- return { ...child };
- })
- };
- }),
- fieldSetPayload: {
- ...fieldSetPayload,
- data: _.map(_.cloneDeep(fieldSetList), item => {
- return {
- ...item,
- items: _.map(item.items || [], child => {
- if (id === child.id) {
- return { ...child, checked: !!Number(checked) };
- }
- return { ...child };
- })
- };
- })
- }
+ handleCloseQuoteModal = (isRefresh) => {
+ const { attendanceReferencePayload } = this.state;
+ this.setState({ attendanceReferencePayload: { ...attendanceReferencePayload, visible: false } }, () => {
+ isRefresh && this.getAttendanceList();
});
};
render() {
const {
- dataSource, columns, pageInfo, loading, importData, importFormPayload, fieldSetPayload
+ dataSource, columns, pageInfo, loading, importData, importFormPayload, fieldSetPayload,
+ attendanceReferencePayload, attendanceViewPayload
} = this.state;
const { showOperateBtn, salaryYearMonth } = this.props;
const pagination = {
@@ -368,7 +300,7 @@ class AttendanceDataComp extends Component {
render: (_, record) => {
return (
-
查看
+
this.handleViewAttendanceData(record)}>查看
{showOperateBtn &&
this.handleDeleteAttendanceData(record)}>删除
}
@@ -395,17 +327,27 @@ class AttendanceDataComp extends Component {
/>
{/* 表头设置 */}
- }
onCancel={this.handleCloseSettings}
onSearchItemSet={this.handleSearchItemSet}
onShowOnlyChecked={this.handleShowOnlyChecked}
/>
+ {/* 考勤数据引用 */}
+
+ {/* 考勤数据查看 */}
+
this.setState({
+ attendanceViewPayload: {
+ ...attendanceViewPayload,
+ visible: false,
+ attendQuoteId: ""
+ }
+ })}
+ />
);
}
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataViewSlide.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataViewSlide.js
new file mode 100644
index 00000000..b692e31e
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataViewSlide.js
@@ -0,0 +1,143 @@
+/*
+ * Author: 黎永顺
+ * name: 考勤引用数据查看
+ * Description:
+ * Date: 2023/3/7
+ */
+import React, { Component } from "react";
+import { WeaFormItem, WeaInput, WeaInputSearch, WeaSlideModal } from "ecCom";
+import { Button } from "antd";
+import SlideModalTitle from "../../../../components/slideModalTitle";
+import { viewAttendQuote } from "../../../../apis/attendance";
+import UnifiedTable from "../../../../components/UnifiedTable";
+import "./index.less";
+
+class AttendanceDataViewSlide extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ loading: {
+ query: false
+ },
+ keyword: "",
+ dataSource: [],
+ columns: [],
+ pageInfo: {
+ current: 1, pageSize: 10, total: 0
+ }
+ };
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visible && nextProps.visible) this.viewAttendQuote({}, nextProps);
+ }
+
+ viewAttendQuote = (extraPayload = {}, props) => {
+ const { loading, pageInfo, keyword } = this.state;
+ const { attendQuoteId } = props;
+ this.setState({ loading: { ...loading, query: true } });
+ viewAttendQuote({ ...pageInfo, attendQuoteId, keyword, ...extraPayload }).then(({ status, data }) => {
+ this.setState({ loading: { ...loading, query: false } });
+ if (status) {
+ const { columns, list: dataSource, pageNum: current, pageSize, total } = data.pageInfo;
+ this.setState({
+ pageInfo: { ...pageInfo, current, pageSize, total },
+ dataSource,
+ columns
+ });
+ }
+ }).catch(() => this.setState({ loading: { ...loading, query: false } }));
+ };
+ renderCustomOperate = () => {
+ const { keyword } = this.state;
+ const { showOperateBtn } = this.props;
+ return ([
+
+ {showOperateBtn && }
+ this.setState({ keyword })}
+ onSearch={() => this.viewAttendQuote({ current: 1 }, this.props)}
+ />
+
+ ]);
+ };
+ handleExportAttendQuote = () => {
+ if (!this.handleDebounce) {
+ this.handleDebounce = _.debounce(() => {
+ const { attendQuoteId } = this.props;
+ const url = `${window.location.origin}/api/bs/hrmsalary/attendQuote/export?attendQuoteId=${attendQuoteId}`;
+ window.open(url, "_self");
+ this.handleDebounce = null;
+ }, 500);
+ }
+ this.handleDebounce();
+ };
+
+ render() {
+ const { showOperateBtn, salaryYearMonth, ...extra } = this.props;
+ const { columns, dataSource, loading, pageInfo } = this.state;
+ const pagination = {
+ ...pageInfo,
+ showTotal: (total) => `共 ${total} 条`,
+ pageSizeOptions: ["10", "20", "50", "100"],
+ showSizeChanger: true,
+ showQuickJumper: true,
+ onShowSizeChange: (current, pageSize) => {
+ this.setState({
+ pageInfo: { ...pageInfo, current, pageSize }
+ }, () => this.viewAttendQuote({}, this.props));
+ },
+ onChange: (current) => {
+ this.setState({
+ pageInfo: { ...pageInfo, current }
+ }, () => this.viewAttendQuote({}, this.props));
+ }
+ };
+ return (
+
+ }
+ content={
+
+
+
+
+ ({
+ ...item,
+ render: (text) => {
+ return {text} ;
+ }
+ }))}
+ dataSource={dataSource}
+ pagination={pagination}
+ loading={loading.query}
+ xWidth={columns.length * 120}
+ />
+
+ }
+ />
+ );
+ }
+}
+
+export default AttendanceDataViewSlide;
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceRefrenceDataModal.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceRefrenceDataModal.js
new file mode 100644
index 00000000..3b96d14b
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceRefrenceDataModal.js
@@ -0,0 +1,114 @@
+/*
+ * Author: 黎永顺
+ * name: 考勤数据引用
+ * Description:
+ * Date: 2023/3/1
+ */
+import React, { Component } from "react";
+import { inject, observer } from "mobx-react";
+import { WeaDialog } from "ecCom";
+import { Button, message } from "antd";
+import { reFrenceConditions } from "../columns";
+import { getSearchs } from "../../../../util";
+import { checkOperation, getLedgerList, syncAttendanceRefer } from "../../../../apis/attendance";
+import "./index.less";
+
+@inject("attendanceStore")
+@observer
+class AttendanceRefrenceDataModal extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ loading: false,
+ condition: []
+ };
+ }
+
+ componentDidMount() {
+ this.getLedgerList();
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visible && nextProps.visible) this.handleResetForm();
+ }
+
+ getLedgerList = () => {
+ const { attendanceStore: { refenceform } } = this.props;
+ getLedgerList().then(({ status, data }) => {
+ if (status) {
+ this.setState({
+ condition: _.map(reFrenceConditions, (item) => {
+ const { items } = item;
+ return {
+ ...item,
+ items: _.map(items, child => {
+ const { domkey } = child;
+ if (domkey[0] === "salarySobId") {
+ return { ...child, options: _.map(data, it => ({ key: it.id, showname: it.content })) };
+ }
+ return { ...child };
+ })
+ };
+ })
+ }, () => refenceform.initFormFields(this.state.condition));
+ }
+ });
+ };
+ /*
+ * Author: 黎永顺
+ * Description: 同步考勤数据
+ * Params:
+ * Date: 2023/3/1
+ */
+ handleSubmitFields = () => {
+ const { attendanceStore: { refenceform }, onCancel } = this.props;
+ refenceform.validateForm().then(f => {
+ if (f.isValid) {
+ const payload = refenceform.getFormParams();
+ const checkPayload = { salaryYearMonthStr: payload.salaryYearMonth, salarySobId: payload.salarySobId };
+ this.setState({ loading: true });
+ checkOperation(checkPayload).then(({ status, errormsg: errormessage }) => {
+ if (status) {
+ syncAttendanceRefer(payload).then(({ status, errormsg }) => {
+ this.setState({ loading: false });
+ if (status) {
+ message.success("同步成功");
+ onCancel(true);
+ } else {
+ message.error(errormsg || "同步失败");
+ }
+ }).catch(() => this.setState({ loading: false }));
+ } else {
+ this.setState({ loading: false });
+ message.error(errormessage);
+ }
+ }).catch(() => this.setState({ loading: false }));
+ } else {
+ f.showErrors();
+ }
+ });
+ };
+ handleResetForm = () => {
+ const { attendanceStore: { refenceform } } = this.props;
+ refenceform.resetForm();
+ };
+
+ render() {
+ const { condition, loading } = this.state;
+ const { attendanceStore: { refenceform } } = this.props;
+ const buttons = [
+
+ ];
+ return (
+
+ {getSearchs(refenceform, condition, 1)}
+
+ );
+ }
+}
+
+export default AttendanceRefrenceDataModal;
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/index.less b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/index.less
index d5773f1b..6e340057 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/index.less
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/index.less
@@ -3,6 +3,10 @@
width: 100%;
}
+ .wea-date-picker {
+ width: 100%;
+ }
+
.wea-select {
display: inline-block;
position: relative;
@@ -17,3 +21,33 @@
.attendanceFormWrapper {
padding: 0;
}
+
+.attendanceSlideWrapper {
+ .wea-slide-modal-title {
+ height: initial;
+ line-height: initial;
+ text-align: left;
+ }
+
+ .rodal-close {
+ z-index: 99;
+ top: 10px !important;
+ }
+
+}
+
+@media (min-width: 1260px) {
+ .attendanceSlideWrapper {
+ .reqTopWrapper .wea-new-top-req-title > div:first-child > div {
+ max-width: 100% !important;
+ }
+ }
+}
+
+@media screen and (min-width: 1060px) and (max-width: 1260px) {
+ .attendanceSlideWrapper {
+ .reqTopWrapper .wea-new-top-req-title > div:first-child > div {
+ max-width: calc(100% - 96px) !important;
+ }
+ }
+}
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js
index 60d168b9..4e5d734f 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js
@@ -62,6 +62,11 @@ class Index extends Component {
columns: [], slideDataSource: [], importResult: []
});
}
+ handleQuoteAttendanceData= ()=>{
+ this.attendanceTableRef.handleQuoteAttendanceData({
+ visible: true, title: "引用考勤数据"
+ });
+ }
render() {
const { selectedKey, salaryMonth, fieldName } = this.state;
@@ -71,7 +76,7 @@ class Index extends Component {
{ title: "字段管理", viewcondition: "FIELD" }
];
const buttons = selectedKey === "DATA" ? [
- ,
+ ,
] : [];
return (
diff --git a/pc4mobx/hrmSalary/stores/attendanceStore.js b/pc4mobx/hrmSalary/stores/attendanceStore.js
index 8bc06c0e..3f3d2912 100644
--- a/pc4mobx/hrmSalary/stores/attendanceStore.js
+++ b/pc4mobx/hrmSalary/stores/attendanceStore.js
@@ -4,4 +4,5 @@ import { WeaForm } from "comsMobx";
export class AttendanceStore {
@observable form = new WeaForm();
+ @observable refenceform = new WeaForm();
}
From 72959ca0157e760ae85df5bd9936b4e1ff229fc6 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, 8 Mar 2023 13:54:27 +0800
Subject: [PATCH 16/18] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86-?=
=?UTF-8?q?=E8=80=83=E5=8B=A4=E5=BC=95=E7=94=A8=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
---
.../selectItemsModal/selectItemsWrapper.js | 114 ++++++++----------
1 file changed, 47 insertions(+), 67 deletions(-)
diff --git a/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js b/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js
index 25c7e550..9984ac9f 100644
--- a/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js
+++ b/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js
@@ -11,95 +11,75 @@ class SelectItemsWrapper extends Component {
constructor(props) {
super(props);
this.state = {
- list: [],
- filterList: []
+ searchVal: "",
+ selectItem: [],
+ groupItem: [],
+ showOnlyChecked: false
};
}
- componentDidMount() {
- this.setState({
- list: this.props.dataSource
- });
- }
-
- handleSearchItemSet = (val) => {
- const { dataSource } = this.props;
- this.setState({
- filterList: _.map(dataSource, item => {
- return {
- ...item,
- items: _.filter(item.items || [], child => child.name.indexOf(val) !== -1)
- };
- })
- });
- };
- handleShowOnlyChecked = (checked) => {
- const { dataSource } = this.props;
- const { list } = this.state;
- if (!!Number(checked)) {
- this.setState({
- list: _.map(list, item => {
- return {
- ...item,
- items: _.filter(item.items || [], child => !!child.checked)
- };
- })
- });
- } else {
- this.setState({ list: dataSource });
- }
- };
+ handleSearchItemSet = (searchVal) => this.setState({ searchVal });
+ handleShowOnlyChecked = (showOnlyChecked) => this.setState({ showOnlyChecked: !!Number(showOnlyChecked) });
handleSelectGroupAll = (groupId, checked) => {
- const { list, filterList } = this.state;
- const key = !_.isEmpty(filterList) ? "filterList" : "list";
- this.setState({
- [key]: _.map(!_.isEmpty(filterList) ? filterList : list, item => {
- if (groupId === item.groupId) {
- return {
- ...item,
- items: _.map(item.items || [], child => {
- return { ...child, checked: !!Number(checked) };
- })
- };
+ const { selectItem, groupItem } = this.state;
+ const { dataSource } = this.props;
+ _.map(dataSource, item => {
+ if (item.groupId === groupId) {
+ if (!!Number(checked)) {
+ this.setState({
+ groupItem: [...groupItem, ..._.map(item.items, child => child.id)]
+ }, () => this.setState({ selectItem: [...selectItem, ...this.state.groupItem] }));
+ } else {
+ this.setState({
+ groupItem: _.differenceWith(groupItem, _.map(item.items, child => child.id), _.isEqual)
+ }, () => this.setState({ selectItem: this.state.groupItem }));
}
- return { ...item };
- })
+ }
});
};
handleSelectItem = (id, checked) => {
- const { list, filterList } = this.state;
- const key = !_.isEmpty(filterList) ? "filterList" : "list";
+ const { selectItem } = this.state;
this.setState({
- [key]: _.map(!_.isEmpty(filterList) ? filterList : list, item => {
- return {
- ...item,
- items: _.map(item.items || [], child => {
- if (id === child.id) {
- return { ...child, checked: !!Number(checked) };
- }
- return { ...child };
- })
- };
- })
+ selectItem: !!Number(checked) ? [...selectItem, id] : _.xorWith(selectItem, [id], _.isEqual)
});
};
renderTitle = (item) => {
const { onSelectGroupAll } = this.props;
- const { groupName, groupId } = item;
+ const { groupName, groupId, items } = item;
+ const number = _.filter(items, it => !!it.checked).length;
return
onSelectGroupAll(groupId, val)}/>
- 已选择0个字段
+ 已选择{number}个字段
;
};
render() {
- const { list, filterList } = this.state;
- const { onSelectItem } = this.props;
- console.log("filterList", filterList);
+ const { searchVal, selectItem, showOnlyChecked } = this.state;
+ const { onSelectItem, dataSource } = this.props;
+ let setItemList = _.map(dataSource, item => {
+ return {
+ ...item,
+ items: _.filter(item.items || [], child => child.name.indexOf(searchVal) !== -1)
+ };
+ });
+ setItemList = _.map(setItemList, item => {
+ return {
+ ...item,
+ items: _.map(item.items, child => {
+ return { ...child, checked: selectItem.includes(child.id) };
+ })
+ };
+ });
+ if (showOnlyChecked) {
+ setItemList = _.map(setItemList, item => {
+ return { ...item, items: _.filter(item.items, it => !!it.checked) };
+ });
+ }
+ console.log(setItemList);
return (
{
- _.map(!_.isEmpty(filterList) ? filterList : list, item => {
+ _.map(setItemList, item => {
const { items } = item;
return
From 75008876604d10d2adb19a31a1693a4f1aafb7f5 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, 8 Mar 2023 15:03:08 +0800
Subject: [PATCH 17/18] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86-?=
=?UTF-8?q?=E8=80=83=E5=8B=A4=E5=BC=95=E7=94=A8=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
---
.../components/selectItemsModal/index.js | 11 ++--
.../selectItemsModal/selectItemsWrapper.js | 13 +++-
.../components/attendanceDataComp.js | 65 ++++++++++++++++++-
3 files changed, 82 insertions(+), 7 deletions(-)
diff --git a/pc4mobx/hrmSalary/components/selectItemsModal/index.js b/pc4mobx/hrmSalary/components/selectItemsModal/index.js
index 7b8ca17a..b7d01a5d 100644
--- a/pc4mobx/hrmSalary/components/selectItemsModal/index.js
+++ b/pc4mobx/hrmSalary/components/selectItemsModal/index.js
@@ -27,21 +27,24 @@ export default class SelectItemModal extends React.Component {
render() {
const { searchValue } = this.state;
- const { title, onSearchItemSet, onShowOnlyChecked, children, ...extra } = this.props;
- const btns = [
];
+ const {
+ title, onSearchItemSet, onShowOnlyChecked, children,
+ onMoreOpts, onSave, ...extra
+ } = this.props;
+ const btns = [
];
const moreBtn = {
datas: [
{
key: "recovery",
content: "恢复默认设置",
icon:
,
- onClick: key => alert(`点击事物处理函数接受的实参为 ${key}`)
+ onClick: key => onMoreOpts(key)
},
{
key: "setting",
content: "设为默认设置",
icon:
,
- onClick: key => alert(`点击事物处理函数接受的实参为 ${key}`)
+ onClick: key => onMoreOpts(key)
}
]
};
diff --git a/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js b/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js
index 9984ac9f..1a0d44d0 100644
--- a/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js
+++ b/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js
@@ -18,6 +18,15 @@ class SelectItemsWrapper extends Component {
};
}
+ componentDidMount() {
+ const { dataSource } = this.props
+ this.setState({
+ selectItem: _.map(_.filter(_.reduce(dataSource, (pre, cur) => {
+ return [...pre, ...cur.items];
+ }, []), item => !!item.checked), it => it.id)
+ });
+ }
+
handleSearchItemSet = (searchVal) => this.setState({ searchVal });
handleShowOnlyChecked = (showOnlyChecked) => this.setState({ showOnlyChecked: !!Number(showOnlyChecked) });
handleSelectGroupAll = (groupId, checked) => {
@@ -47,8 +56,9 @@ class SelectItemsWrapper extends Component {
const { onSelectGroupAll } = this.props;
const { groupName, groupId, items } = item;
const number = _.filter(items, it => !!it.checked).length;
+ const value = _.every(items, it => !!it.checked) ? "1" : "0";
return
- onSelectGroupAll(groupId, val)}/>
+ onSelectGroupAll(groupId, val)}/>
已选择{number}个字段
;
};
@@ -75,7 +85,6 @@ class SelectItemsWrapper extends Component {
return { ...item, items: _.filter(item.items, it => !!it.checked) };
});
}
- console.log(setItemList);
return (
{
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
index 8e2dbd78..6f58700a 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
@@ -14,7 +14,10 @@ import {
getLedgerList,
getSalaryCycleAndAttendCycle,
importAttendQuoteData,
- previewAttendQuote
+ previewAttendQuote,
+ returnToAttendanceFieldSettingDefault,
+ saveAttendanceFieldSetting,
+ saveAttendanceFieldSettingAsDefault
} from "../../../../apis/attendance";
import ImportModal from "../../../../components/importModal";
import HeaderSet from "../../../../components/importModal/headerSet";
@@ -248,6 +251,65 @@ class AttendanceDataComp extends Component {
handleShowOnlyChecked = (checked) => this.setItemRef.handleShowOnlyChecked(checked);
handleSelectGroupAll = (groupId, checked) => this.setItemRef.handleSelectGroupAll(groupId, checked);
handleSelectItem = (id, checked) => this.setItemRef.handleSelectItem(id, checked);
+ handleMoreOpts = (key) => {
+ switch (key) {
+ case "recovery":
+ returnToAttendanceFieldSettingDefault({ sourceType: "IMPORT" }).then(({ status, errormsg }) => {
+ if (status) {
+ message.success("操作成功");
+ this.handleHeaderSettings({ sourceType: "IMPORT" });
+ } else {
+ message.error(errormsg || "操作失败");
+ }
+ });
+ break;
+ case "setting":
+ const { state, props } = this.setItemRef;
+ let currentSettingFields = [];
+ const { selectItem } = state, { dataSource } = props;
+ _.forEach(dataSource, item => {
+ currentSettingFields = _.map([...currentSettingFields, ...item.items], child => {
+ return {
+ id: child.id,
+ checked: selectItem.includes(child.id)
+ };
+ });
+ });
+ const payload = { currentSettingFields, sourceType: "IMPORT" };
+ saveAttendanceFieldSettingAsDefault(payload).then(({ status, errormsg }) => {
+ if (status) {
+ message.success("操作成功");
+ } else {
+ message.error(errormsg || "操作失败");
+ }
+ });
+ break;
+ default:
+ break;
+ }
+ };
+ handleSave = () => {
+ const { state, props } = this.setItemRef;
+ let currentSettingFields = [];
+ const { selectItem } = state, { dataSource } = props;
+ _.forEach(dataSource, item => {
+ currentSettingFields = _.map([...currentSettingFields, ...item.items], child => {
+ return {
+ id: child.id,
+ checked: selectItem.includes(child.id)
+ };
+ });
+ });
+ const payload = { currentSettingFields, sourceType: "IMPORT" };
+ saveAttendanceFieldSetting(payload).then(({ status, errormsg }) => {
+ if (status) {
+ message.success("保存成功");
+ this.handleCloseSettings();
+ } else {
+ message.error(errormsg || "保存失败");
+ }
+ });
+ };
/*
* Author: 黎永顺
* Description: 考勤数据引用
@@ -330,6 +392,7 @@ class AttendanceDataComp extends Component {
onCancel={this.handleCloseSettings}
onSearchItemSet={this.handleSearchItemSet}
onShowOnlyChecked={this.handleShowOnlyChecked}
+ onMoreOpts={this.handleMoreOpts} onSave={this.handleSave}
/>
{/* 考勤数据引用 */}
Date: Wed, 8 Mar 2023 18:35:27 +0800
Subject: [PATCH 18/18] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86-?=
=?UTF-8?q?=E8=80=83=E5=8B=A4=E5=BC=95=E7=94=A8=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
---
.../components/selectItemsModal/index11.js | 93 --
.../selectItemsWrappercopy.js | 78 --
.../components/attendanceRefrenceDataModal.js | 124 ++-
.../attendance/editSlideContent.js | 103 --
.../attendance/editSlideContent.less | 26 -
.../attendance/headerSetModal.js | 14 -
.../dataAcquisition/attendance/indexcopy.js | 921 ------------------
.../attendance/itemMangeFormModal.js | 124 ---
.../attendance/refereAttendFormModal.js | 198 ----
9 files changed, 120 insertions(+), 1561 deletions(-)
delete mode 100644 pc4mobx/hrmSalary/components/selectItemsModal/index11.js
delete mode 100644 pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrappercopy.js
delete mode 100644 pc4mobx/hrmSalary/pages/dataAcquisition/attendance/editSlideContent.js
delete mode 100644 pc4mobx/hrmSalary/pages/dataAcquisition/attendance/editSlideContent.less
delete mode 100644 pc4mobx/hrmSalary/pages/dataAcquisition/attendance/headerSetModal.js
delete mode 100644 pc4mobx/hrmSalary/pages/dataAcquisition/attendance/indexcopy.js
delete mode 100644 pc4mobx/hrmSalary/pages/dataAcquisition/attendance/itemMangeFormModal.js
delete mode 100644 pc4mobx/hrmSalary/pages/dataAcquisition/attendance/refereAttendFormModal.js
diff --git a/pc4mobx/hrmSalary/components/selectItemsModal/index11.js b/pc4mobx/hrmSalary/components/selectItemsModal/index11.js
deleted file mode 100644
index 27cc02a7..00000000
--- a/pc4mobx/hrmSalary/components/selectItemsModal/index11.js
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Author: 黎永顺
- * Description:
- * Date: 2022-05-19 15:18:09
- * LastEditTime: 2022-06-29 10:06:13
- */
-import React from "react";
-import { WeaCheckbox, WeaInputSearch, WeaDialog } from "ecCom";
-import { Button, Dropdown, Menu, Modal } from "antd";
-import "../../pages/dataAcquisition/attendance/index.less"
-
-
-export const items = [
- {
- key: "1",
- title: "测试",
- checked: false
- },
- {
- key: "2",
- title: "测试2",
- checked: true
- }
-];
-
-export default class SelectItemModal extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- searchValue: ""
- };
- }
-
- handleShowChecked(value) {
- value = value == 1 ? true : false;
- this.props.onShowChecked(value);
- }
-
- handleMenuClick(e) {
- if (e.key == "1") { //恢复默认设置
- this.props.onRestoreDefault();
- } else if (e.key == "2") {
- this.props.onSetDefault();
- } else if (e.key == "3") {
-
- }
- }
-
- render() {
- const menu = (
-
- );
- return (
- {
- this.props.onSave();
- }}>保存,
- 更多
- ]}
- >
-
- {
- this.setState({ searchValue: value });
- }}
- onSearch={(value) => {
- this.props.onSearch(value);
- }}
- />
-
- {this.props.children}
-
- {
- this.handleShowChecked(value);
- }}/>
-
-
- );
- }
-}
diff --git a/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrappercopy.js b/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrappercopy.js
deleted file mode 100644
index b29f38b8..00000000
--- a/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrappercopy.js
+++ /dev/null
@@ -1,78 +0,0 @@
-import React from "react";
-import { WeaCheckbox } from "ecCom";
-import { Col, Icon, Row } from "antd";
-
-export default class SelectItemsWrapper extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- showContent: true,
- checkStatus: false
- };
- }
-
- handleAllChecked(value) {
- value = value == 1 ? true : false;
- let items = [...this.props.items];
- items.map(item => {
- item.checked = value;
- });
- this.setState({
- checkStatus: value
- });
- this.props.onChange(items);
- }
-
- handleItemChange(value, record) {
- value = value == 1 ? true : false;
- let items = [...this.props.items];
- items.map(item => {
- if (item.id == record.id) {
- item.checked = value;
- }
- });
- this.props.onChange(items);
- }
-
- render() {
- return (
-
-
-
{this.props.title}} onChange={(value) => {
- this.handleAllChecked(value);
- }} value={this.state.checkStatus}/>
-
this.setState({
- showContent: !this.state.showContent
- })}>已选中{this.props.items ? this.props.items.filter(item => item.checked).length : 0}个字段
-
- {
- this.state.showContent ? :
- }
-
-
-
- {
- this.state.showContent &&
-
- {
- this.props.items && this.props.items.map(item => (
- {
- this.handleItemChange(value, item);
- }}/>
- ))
- }
-
-
- }
-
-
- );
- }
-}
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceRefrenceDataModal.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceRefrenceDataModal.js
index 3b96d14b..2308b556 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceRefrenceDataModal.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceRefrenceDataModal.js
@@ -10,7 +10,14 @@ import { WeaDialog } from "ecCom";
import { Button, message } from "antd";
import { reFrenceConditions } from "../columns";
import { getSearchs } from "../../../../util";
-import { checkOperation, getLedgerList, syncAttendanceRefer } from "../../../../apis/attendance";
+import {
+ checkOperation,
+ getAttendanceFieldSettingList,
+ getLedgerList, returnToAttendanceFieldSettingDefault, saveAttendanceFieldSetting, saveAttendanceFieldSettingAsDefault,
+ syncAttendanceRefer
+} from "../../../../apis/attendance";
+import SelectItemModal from "../../../../components/selectItemsModal";
+import SelectItemsWrapper from "../../../../components/selectItemsModal/selectItemsWrapper";
import "./index.less";
@inject("attendanceStore")
@@ -20,7 +27,9 @@ class AttendanceRefrenceDataModal extends Component {
super(props);
this.state = {
loading: false,
- condition: []
+ headerSetLoading: false,
+ condition: [],
+ headerSetPayload: { visible: false, title: "", children: null }
};
}
@@ -92,12 +101,112 @@ class AttendanceRefrenceDataModal extends Component {
const { attendanceStore: { refenceform } } = this.props;
refenceform.resetForm();
};
+ /*
+ * Author: 黎永顺
+ * Description: 表头设置
+ * Params:
+ * Date: 2023/3/8
+ */
+ handleHeaderSetting = () => {
+ const { headerSetPayload } = this.state;
+ this.setState({ headerSetLoading: true });
+ getAttendanceFieldSettingList({ sourceType: "QUOTE" }).then(({ status, data }) => {
+ this.setState({ headerSetLoading: false });
+ if (status) {
+ this.setState({
+ headerSetPayload: {
+ ...headerSetPayload,
+ visible: true, title: "引用考勤字段设置",
+ children: this.setItemRef = dom}
+ dataSource={data}
+ onSelectGroupAll={this.handleSelectGroupAll}
+ onSelectItem={this.handleSelectItem}
+ />
+ }
+ });
+ }
+ }).catch(() => this.setState({ headerSetLoading: false }));
+ };
+ handleCloseSettings = () => {
+ const { headerSetPayload } = this.state;
+ this.setState({
+ headerSetPayload: {
+ ...headerSetPayload,
+ visible: false, title: "", children: null
+ }
+ });
+ };
+ handleSearchItemSet = (val) => this.setItemRef.handleSearchItemSet(val);
+ handleShowOnlyChecked = (checked) => this.setItemRef.handleShowOnlyChecked(checked);
+ handleSelectGroupAll = (groupId, checked) => this.setItemRef.handleSelectGroupAll(groupId, checked);
+ handleSelectItem = (id, checked) => this.setItemRef.handleSelectItem(id, checked);
+ handleMoreOpts = (key) => {
+ switch (key) {
+ case "recovery":
+ returnToAttendanceFieldSettingDefault({ sourceType: "QUOTE" }).then(({ status, errormsg }) => {
+ if (status) {
+ message.success("操作成功");
+ this.handleHeaderSetting({ sourceType: "QUOTE" });
+ } else {
+ message.error(errormsg || "操作失败");
+ }
+ });
+ break;
+ case "setting":
+ const { state, props } = this.setItemRef;
+ let currentSettingFields = [];
+ const { selectItem } = state, { dataSource } = props;
+ _.forEach(dataSource, item => {
+ currentSettingFields = _.map([...currentSettingFields, ...item.items], child => {
+ return {
+ id: child.id,
+ checked: selectItem.includes(child.id)
+ };
+ });
+ });
+ const payload = { currentSettingFields, sourceType: "QUOTE" };
+ saveAttendanceFieldSettingAsDefault(payload).then(({ status, errormsg }) => {
+ if (status) {
+ message.success("操作成功");
+ } else {
+ message.error(errormsg || "操作失败");
+ }
+ });
+ break;
+ default:
+ break;
+ }
+ };
+ handleSave = () => {
+ const { state, props } = this.setItemRef;
+ let currentSettingFields = [];
+ const { selectItem } = state, { dataSource } = props;
+ _.forEach(dataSource, item => {
+ currentSettingFields = _.map([...currentSettingFields, ...item.items], child => {
+ return {
+ id: child.id,
+ checked: selectItem.includes(child.id)
+ };
+ });
+ });
+ const payload = { currentSettingFields, sourceType: "QUOTE" };
+ saveAttendanceFieldSetting(payload).then(({ status, errormsg }) => {
+ if (status) {
+ message.success("保存成功");
+ this.handleCloseSettings();
+ } else {
+ message.error(errormsg || "保存失败");
+ }
+ });
+ };
render() {
- const { condition, loading } = this.state;
+ const { condition, loading, headerSetLoading, headerSetPayload } = this.state;
const { attendanceStore: { refenceform } } = this.props;
const buttons = [
-
+ ,
+
];
return (
{getSearchs(refenceform, condition, 1)}
+ {/* 表头设置 */}
+
);
}
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/editSlideContent.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/editSlideContent.js
deleted file mode 100644
index 76d7df05..00000000
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/editSlideContent.js
+++ /dev/null
@@ -1,103 +0,0 @@
-import React from "react";
-import { DatePicker } from "antd";
-import { inject, observer } from "mobx-react";
-import { WeaTable } from "ecCom";
-import "./editSlideContent.less";
-
-const { MonthPicker } = DatePicker;
-
-let emptyItem = {
- incomeLowerLimit: "0.00",
- incomeUpperLimit: "0.00",
- dutyFreeValue: "0.00",
- dutyFreeRate: "0.00",
- taxableIncomeLl: "0.00",
- taxableIncomeUl: "0.00",
- taxRate: "0.00",
- taxDeduction: "0.00"
-};
-
-@inject("attendanceStore")
-@observer
-export default class EditSlideContent extends React.Component {
- constructor(props) {
- super(props);
- }
-
- componentWillMount() {
- // 初始化渲染页面
- const { attendanceStore: { viewAttendQuote } } = this.props;
- viewAttendQuote({ attendQuoteId: this.props.id });
- }
-
- getColumns(columns) {
- let result = [...columns];
- return result.filter(item => item.hide == "false");
- }
-
- getScrollWidth() {
- const { attendanceStore } = this.props;
- const { attendQuoteDetailTableStore } = attendanceStore;
- return (
- this.getColumns(
- attendQuoteDetailTableStore.columns
- ? attendQuoteDetailTableStore.columns
- : []
- ).length * 150
- );
- }
-
- render() {
- const {
- attendanceStore,
- attendanceStore: { viewAttendQuote }
- } = this.props;
- const {
- attendQuoteDetailPageInfo,
- attendQuoteDetailTableStore
- } = attendanceStore;
-
- const pagination = {
- total: attendQuoteDetailPageInfo.total,
- showTotal: total => `共 ${total} 条`,
- showSizeChanger: true,
- pageSizeOptions: ["10", "20", "50", "100"],
- onShowSizeChange: (current, pageSize) => {
- viewAttendQuote({ attendQuoteId: this.props.id, current, pageSize });
- },
- onChange: current => {
- viewAttendQuote({
- attendQuoteId: this.props.id,
- current,
- pageSize: attendQuoteDetailPageInfo.pageSize
- });
- }
- };
- return (
-
-
- {this.props.salaryYearMonth != "" &&
-
- 考勤周期: {this.props.salaryYearMonth}
-
}
-
-
-
-
-
- );
- }
-}
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/editSlideContent.less b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/editSlideContent.less
deleted file mode 100644
index fd7858c8..00000000
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/editSlideContent.less
+++ /dev/null
@@ -1,26 +0,0 @@
-.attendSlide {
- .titleWrapper {
- height: 47px;
- line-height: 47px;
- overflow: hidden;
- padding-left: 10px;
- padding-right: 10px;
- .slideLeftTitle {
- float: left;
- }
- .rightTitle {
- float: right;
- }
- }
- .weaRangePickerWrapper {
- display: inline-block;
- .monthPickerWrapper {
- width: 100px;
- display: inline-block;
- }
- .betweenLable {
- margin-left: 10px;
- margin-right: 10px;
- }
- }
-}
\ No newline at end of file
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/headerSetModal.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/headerSetModal.js
deleted file mode 100644
index c8ee03f1..00000000
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/headerSetModal.js
+++ /dev/null
@@ -1,14 +0,0 @@
-import React from 'react'
-import { Modal } from 'antd'
-import SelectItemModal, { items } from '../../../components/selectItemsModal/selectItemsWrapper';
-
-
-export default class HeaderSetModal extends React.Component {
- render() {
- return (
-
-
-
- )
- }
-}
\ No newline at end of file
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/indexcopy.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/indexcopy.js
deleted file mode 100644
index 3b4727bd..00000000
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/indexcopy.js
+++ /dev/null
@@ -1,921 +0,0 @@
-import React from "react";
-import { inject, observer } from "mobx-react";
-import { Button, Col, DatePicker, Dropdown, Menu, message, Modal, Row, Switch } from "antd";
-import { WeaDatePicker, WeaInputSearch, WeaNewScroll, WeaSelect, WeaSlideModal, WeaTop } from "ecCom";
-import moment from "moment";
-import { renderNoright } from "../../../util";
-import CustomTab from "../../../components/customTab";
-import { columns } from "./columns";
-import ImportModal from "../../../components/importModal";
-import HeaderSet from "../../../components/importModal/headerSet";
-import SelectItemModal from "../../../components/selectItemsModal";
-import RefereAttendFormModal from "./refereAttendFormModal";
-import SelectItemsWrapper from "../../../components/selectItemsModal/selectItemsWrapper";
-import SlideModalTitle from "../../../components/slideModalTitle";
-import EditSlideContent from "./editSlideContent";
-import TwoColContent from "../../../components/twoColContent";
-import TipLabel from "../../../components/TipLabel";
-import ItemMangeFormModal from "./itemMangeFormModal";
-import CustomPaginationTable from "../../../components/customPaginationTable";
-import "../otherDeduct/index.less";
-
-const MonthPicker = DatePicker.MonthPicker;
-
-@inject("attendanceStore", "taxAgentStore")
-@observer
-export default class Attendance extends React.Component {
- constructor(props) {
- super(props);
- columns.map(item => {
- if (item.key == "cz") {
- item.render = (text, record) => {
- return (
-
- );
- };
- }
- });
- this.state = {
- value: "",
- selectedKey: "0",
- searchValue: "",
- modalParam: {
- salarySobId: "",
- salaryYearMonth: moment(new Date()).format("YYYY-MM") // 薪资所属月
- },
- modalVisiable: false,
- selectItemVisible: false,
- refereAttendFormVisible: false,
- tabSelectedKey: "0",
- itemMangeVisible: false,
- itemMangeValue: {},
- fieldName: "",
- fieldSettingSearchValue: "",
- fieldCurrent: 1,
- inited: false
- };
- this.fieldSearch = {};
- this.listSearch = {
- salaryYearMonth: [moment(new Date()).startOf("year").format("YYYY-MM"), moment(new Date()).startOf("month").format("YYYY-MM")],
- current: 1
- };
- this.recordId = ""; // 考勤数据列表查看选择项
- this.salaryYearMonth = ""; // 考勤数据查看,当前数据的薪资所属月
- this.pageInfo = { current: 1, pageSize: 10 };
- }
-
- componentWillMount() {
- const { attendanceStore: { doInit, getLedgerList } } = this.props;
- doInit(this.listSearch);
- getLedgerList().then(() => {
- this.setState({
- inited: true
- });
- });
- }
-
- onShowSlide() {
- const { attendanceStore: { setSlideVisiable } } = this.props;
- setSlideVisiable(true);
- }
-
- onItemEdit(record) {
- this.setState({
- itemMangeVisible: true
- });
-
- const {
- attendanceStore: { setCurrentItemOperate, setCurrentItem }
- } = this.props;
- setCurrentItemOperate("update");
- setCurrentItem(record);
- }
-
- // 字段列表分页
- handleFieldPageChange(value) {
- const { attendanceStore: { getAttendanceFieldList } } = this.props;
- this.fieldSearch.current = value;
- this.fieldSearch.pageSize = this.pageInfo.pageSize;
- getAttendanceFieldList(this.fieldSearch);
- }
-
- handleFieldShowSizeChange(pageInfo) {
- const { attendanceStore: { getAttendanceFieldList } } = this.props;
- this.fieldSearch.current = pageInfo;
- getAttendanceFieldList({ ...this.fieldSearch, ...pageInfo });
- }
-
- // 列表
- handleDataPageChange(value) {
- const { attendanceStore: { getAttendanceList } } = this.props;
- this.listSearch.current = value;
- getAttendanceList(this.listSearch);
- }
-
- handleDataShowSizeChange(pageInfo) {
- const { attendanceStore: { getAttendanceList } } = this.props;
- getAttendanceList({ ...this.listSearch, ...pageInfo });
- }
-
- // 下载导入模板链接点击
- handleTemplateLinkClick() {
- const { attendanceStore: { downloadTemplate } } = this.props;
- const { modalParam: { salarySobId, salaryYearMonth } } = this.state;
- if (!salaryYearMonth || salaryYearMonth == "") {
- message.warning("薪资所属月不能为空");
- return;
- }
-
- if (!salarySobId || salarySobId == "") {
- message.warning("薪资账套不能为空");
- return;
- }
- downloadTemplate(salaryYearMonth, salarySobId);
- }
-
- // 导入预览
- handlePreviewImport(params) {
- const { attendanceStore: { previewAttendQuote } } = this.props;
- previewAttendQuote(params);
- }
-
- // 考勤导入
- handleImport(params) {
- const { attendanceStore: { importAttendQuoteData } } = this.props;
- importAttendQuoteData(params);
- }
-
- // 导入完成
- handleFinish() {
- this.setState({ modalVisiable: false });
- const { attendanceStore: { getAttendanceList, step } } = this.props;
- if (step === 2) {
- getAttendanceList({ ...this.pageInfo });
- }
- }
-
- // 考情引用的列
- getColumns(columns) {
- const {
- attendanceStore: { deleteAttendance, doInit },
- taxAgentStore: { showOperateBtn }
- } = this.props;
- let result = [...columns];
- result.push({
- title: "操作",
- key: "operate",
- render: (text, record) => {
- return (
-
-
this.handleViewAttendance(record)}>查看
- {showOperateBtn &&
-
{
- Modal.confirm({
- title: "信息确认",
- content: "确认删除",
- onOk: () => {
- deleteAttendance([
- record.id
- ]).then(({ status, errormsg }) => {
- if (status) {
- message.success("删除成功");
- doInit(this.listSearch);
- } else {
- message.error(errormsg || "删除失败");
- }
- });
- },
- onCancel: () => {
- }
- });
- }}>
- 删除
-
- }>
-
-
-
- }
-
- );
- }
- });
- return result;
- }
-
- // 查看考勤详情
- handleViewAttendance(record) {
- const { attendanceStore: { setSlideVisiable } } = this.props;
- this.recordId = record.id;
- this.salaryYearMonth = record.attendCycle;
- setSlideVisiable(true);
- }
-
- // 引用同步Cancel事件
- handleRefereCancel() {
- this.setState({ refereAttendFormVisible: false });
- const { attendanceStore: { getAttendanceList } } = this.props;
- this.listSearch.current = 1;
- getAttendanceList(this.listSearch);
- }
-
- // 获取周期
- handleLoadCycle(month, sob) {
- if (!month || month == "") {
- return;
- }
- if (!sob || sob == "") {
- return;
- }
- const { attendanceStore: { getSalaryCycleAndAttendCycle } } = this.props;
- getSalaryCycleAndAttendCycle(month, sob);
- }
-
- // 初始导入参数
- handleInitImportModal() {
- const {
- attendanceStore: {
- setPreviewAttendQuoteColumns,
- setPreviewAttendQuoteDataSource,
- setImportResult
- }
- } = this.props;
- setPreviewAttendQuoteColumns([]);
- setPreviewAttendQuoteDataSource([]);
- setImportResult({});
- }
-
- // 引用详情列表搜索
- handleSearch(params) {
- const { attendanceStore: { viewAttendQuote } } = this.props;
- let request = { attendQuoteId: this.recordId, ...params };
- viewAttendQuote(request);
- }
-
- handleExportAttendQuote = () => {
- const url = `${window.location
- .origin}/api/bs/hrmsalary/attendQuote/export?attendQuoteId=${this
- .recordId}`;
- window.open(url, "_self");
- };
-
- handleChangeMonth = (type, val) => {
- const { attendanceStore: { getAttendanceList } } = this.props;
- this.listSearch.salaryYearMonth[type] = val && moment(val).format("YYYY-MM");
- !this.listSearch.salaryYearMonth[0] && (this.listSearch.salaryYearMonth[0] = moment(new Date()).startOf("year").format("YYYY-MM"));
- !this.listSearch.salaryYearMonth[1] && (this.listSearch.salaryYearMonth = this.listSearch.salaryYearMonth.filter(n => n));
- getAttendanceList(this.listSearch);
- };
-
- render() {
- const { attendanceStore, taxAgentStore: { showOperateBtn } } = this.props;
- const { modalParam } = this.state;
- const { loading, hasRight, tableStore } = attendanceStore;
- const {
- step, setStep, setSlideVisiable, slideVisiable, doBatchDelete, searchFieldSettingList,
- fieldSettingAttendList, fieldSettingCustomList, setFieldSettingAttendList, setFieldSettingCustomList
- } = attendanceStore;
- const {
- getAttendanceFieldSettingList, saveAttendanceFieldSetting, fieldDataSource,
- fieldTableStore, fieldPageInfo, attendanceDataSource, attendanceColumns,
- attendancePageInfo, importLedgerList, previewAttendQuoteColumns, previewAttendQuoteDataSource,
- importResult, cycle
- } = attendanceStore;
-
- if (!hasRight && !loading) {
- // 无权限处理
- return renderNoright();
- }
-
- const rightMenu = [
- // 右键菜单
- // {
- // key: 'BTN_DEL',
- // icon: ,
- // content : '批量删除',
- // disable: selectedRowKeys.length === 0, // 没有选中禁用
- // onClick : batchDelete,
- // }
- ];
- const collectParams = {
- // 收藏功能配置
- favname: "考勤引用",
- favouritetype: 1,
- objid: 0,
- link: "wui/index.html#/ns_demo03/index",
- importantlevel: 1
- };
-
- const topTab = [
- {
- title: "考勤数据",
- viewcondition: "0"
- },
- {
- title: "字段管理",
- viewcondition: "1"
- }
- ];
-
- const renderSearchOperationItem = () => {
- const { taxAgentStore: { showOperateBtn } } = this.props;
- return showOperateBtn
- ?
-
-
-
- : null;
- };
-
- const renderLeftOperation = () => {
- return (
-
- 薪资所属月:
- {
- return current && this.listSearch.salaryYearMonth[1] && current.getTime() > new Date(this.listSearch.salaryYearMonth[1]).getTime();
- }}
- format="YYYY-MM"
- onChange={(val) => this.handleChangeMonth("0", val)}
- />
- 至
- {
- return current && this.listSearch.salaryYearMonth[0] && current.getTime() < new Date(this.listSearch.salaryYearMonth[0]).getTime();
- }}
- format="YYYY-MM"
- onChange={(val) => this.handleChangeMonth("1", val)}
- />
-
- );
- };
-
- const renderHeaderSetCompoent = () => {
- return (
- {
- getAttendanceFieldSettingList({ sourceType: "IMPORT" });
- this.setState({
- selectItemVisible: true
- });
- }}
- />
- );
- };
-
- const renderFormComponent = () => {
- return (
-
-
-
- 薪资所属月:
-
- {
- this.setState({
- modalParam: { ...modalParam, salaryYearMonth: value }
- });
- this.handleLoadCycle(value, this.state.modalParam.salarySobId);
- }}
- />
-
-
-
- 薪资账套:
-
- {this.state.inited &&
- ({ key: it.id, showname: it.content }))] : [{
- key: "",
- showname: ""
- }]
- }
- onChange={value => {
- this.setState({
- modalParam: { ...modalParam, salarySobId: value }
- });
- this.handleLoadCycle(
- this.state.modalParam.salaryYearMonth,
- value
- );
- }}/>}
-
-
-
- 薪资周期:
-
- {cycle.salaryCycle}
-
-
-
- 考勤周期:
-
- {cycle.attendCycle}
-
-
- );
- };
-
- const renderCustomOperate = () => {
- return ([
-
- {showOperateBtn &&
-
- // 导出全部
- }
- {
- this.setState({ searchValue: v });
- }}
- onSearch={v => {
- this.handleSearch({ keyword: v });
- }}
- />
-
- ]);
- };
-
- const handleItemSearch = value => {
- const { attendanceStore: { getAttendanceFieldList } } = this.props;
- this.fieldSearch = { fieldName: value };
- getAttendanceFieldList(this.fieldSearch);
- };
-
- const handleNewClick = () => {
- const { attendanceStore: { setCurrentItemOperate } } = this.props;
- this.setState({ itemMangeVisible: true });
- setCurrentItemOperate("add");
- };
-
- const renderRightOperation = () => {
- return (
-
- {showOperateBtn &&
- }
- {
- this.setState({ fieldName: value });
- }}
- placeholder="请输入字段名称"
- onSearch={value => {
- this.setState({ fieldSettingSearchValue: value });
- handleItemSearch(value);
- }}
- />
-
- );
- };
-
- const menu = (
-
- );
-
- const handleTabChange = v => {
- const {
- attendanceStore: { getAttendanceFieldList, getAttendanceList }
- } = this.props;
- this.setState({
- tabSelectedKey: v
- });
-
- if (v == "1") {
- this.fieldSearch = { fieldName: this.state.fieldName };
- getAttendanceFieldList(this.fieldSearch);
- } else if (v == "0") {
- this.listSearch = {
- salaryYearMonth: []
- };
- getAttendanceList({});
- }
- };
-
- const handleSwitchItemChange = (record, value) => {
- const {
- attendanceStore: { updateAttendanceFieldStatus, getAttendanceFieldList }
- } = this.props;
- let request = {
- id: record.id,
- enableStatus: value
- };
- updateAttendanceFieldStatus(request).then(result => {
- this.fieldSearch = { fieldName: this.state.fieldName };
- getAttendanceFieldList(this.fieldSearch);
- });
- };
-
- // 字段Columns
- const getFieldColumns = columns => {
- let newColumns = columns.filter(item => item.hide == "false");
- newColumns = newColumns.map(column => {
- let newColumn = column;
- newColumn.render = (text, record, index) => {
- //前端元素转义
- let valueSpan =
- record[newColumn.dataIndex + "span"] !== undefined
- ? record[newColumn.dataIndex + "span"]
- : record[newColumn.dataIndex];
- switch (newColumn.dataIndex) {
- case "username":
- return (
- {
- this.onItemEdit(record);
- }}
- dangerouslySetInnerHTML={{ __html: valueSpan }}
- />
- );
- case "enableStatus":
- return (
- {
- handleSwitchItemChange(record, value);
- }}
- />
- );
- default:
- return ;
- }
- };
- return newColumn;
- });
- // 与e10保持一致,先去掉字段管理页面的操作列
- // newColumns.push({
- // title: "操作",
- // dataIndex: "operate",
- // render: (text, record) => {
- // return (
- // {this.onItemEdit(record)}}>查看明细
- // )
- // }
- // })
- return [
- // {
- // title: "序号",
- // dataIndex: "index",
- // width: 80,
- // render: (text, record, index) => {
- // const { current, pageSize } = this.pageInfo;
- // return (current - 1) * pageSize + index + 1;
- // }
- // },
- ...newColumns
- ];
- };
-
- // 保存回调
- const handleItemMangeSave = value => {
- const {
- attendanceStore: { saveAttendanceField, getAttendanceFieldList }
- } = this.props;
- value.fieldType = value.fieldType == "1" ? "NUMBER" : "TEXT";
- saveAttendanceField(value).then(() => {
- this.fieldSearch = { fieldName: this.state.fieldName };
- getAttendanceFieldList(this.fieldSearch);
- this.setState({ itemMangeVisible: false });
- });
- };
-
- const handleItemMangeUpdate = value => {
- const {
- attendanceStore: { updateAttendanceField, getAttendanceFieldList }
- } = this.props;
- value.fieldType = value.fieldType == "1" ? "NUMBER" : "TEXT";
- updateAttendanceField(value);
- this.fieldSearch = { fieldName: this.state.fieldName };
- getAttendanceFieldList(this.fieldSearch);
- this.setState({ itemMangeVisible: false });
- };
-
- const handleShowChecked = value => {
- const {
- attendanceStore: {
- fieldSettingAttendList,
- fieldSettingCustomList,
- setFieldSettingAttendList,
- setFieldSettingCustomList,
- searchFieldSettingList
- }
- } = this.props;
- if (value) {
- let attendList = [...fieldSettingAttendList];
- let customList = [...fieldSettingCustomList];
- setFieldSettingAttendList(
- attendList.filter(item => item.checked == value)
- );
- setFieldSettingCustomList(
- customList.filter(item => item.checked == value)
- );
- } else {
- searchFieldSettingList(this.state.fieldSettingSearchValue);
- }
- };
-
- const handleonRestoreDefault = (sourceType = "IMPORT") => {
- const {
- attendanceStore: { returnToAttendanceFieldSettingDefault }
- } = this.props;
- returnToAttendanceFieldSettingDefault(sourceType);
- };
-
- const handleSetDefault = (sourceType = "IMPORT") => {
- const {
- attendanceStore: { saveAttendanceFieldSettingAsDefault }
- } = this.props;
- saveAttendanceFieldSettingAsDefault(sourceType);
- };
-
- const handleRefereHeaderSet = () => {
- const { attendanceStore: { getAttendanceFieldSettingList } } = this.props;
- getAttendanceFieldSettingList({ sourceType: "QUOTE" });
- };
-
- return (
-
-
} // 左侧图标
- iconBgcolor="#F14A2D" // 左侧图标背景色
- showDropIcon={false} // 是否显示下拉按钮
- dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同)
- dropMenuProps={{ collectParams }}>
- {this.state.tabSelectedKey == 0
- ?
-
{
- this.pageInfo = { current: 1, pageSize: 10 };
- handleTabChange(v);
- }}
- />
- {
- }}
- />
-
-
- {
- this.pageInfo.current = value;
- this.handleDataPageChange(value);
- }}
- onShowSizeChange={(current, pageSize) => {
- this.pageInfo = { current, pageSize };
- this.handleDataShowSizeChange(this.pageInfo);
- }}
- />
-
-
-
- :
- {
- this.setState({
- tabSelectedKey: v
- }, () => {
- this.pageInfo = { current: 1, pageSize: 10 };
- });
- }}
- />
-
-
- {
- this.pageInfo.current = value;
- this.handleFieldPageChange(value);
- }}
- onShowSizeChange={(current, pageSize) => {
- this.pageInfo = { current, pageSize };
- this.handleFieldShowSizeChange(this.pageInfo);
- }}
- />
-
-
- }
- rightContent={
-
- }
- />
-
}
-
- {
- this.handleInitImportModal();
- }}
- params={this.state.modalParam}
- columns={previewAttendQuoteColumns}
- step={step}
- setStep={setStep}
- slideDataSource={previewAttendQuoteDataSource}
- importResult={importResult}
- onFinish={() => {
- this.handleFinish();
- }}
- previewImport={params => {
- this.handlePreviewImport(params);
- }}
- importFile={params => {
- this.handleImport(params);
- }}
- headerSetCompoent={renderHeaderSetCompoent()}
- templateLink={() => {
- this.handleTemplateLinkClick();
- }}
- renderFormComponent={() => renderFormComponent()}
- visiable={this.state.modalVisiable}
- onCancel={() => {
- this.handleFinish();
- }}
- />
-
- {
- handleonRestoreDefault();
- }}
- onSetDefault={() => {
- handleSetDefault();
- }}
- onSave={() => {
- saveAttendanceFieldSetting();
- }}
- onShowChecked={value => {
- handleShowChecked(value);
- }}
- onSearch={value => {
- searchFieldSettingList(value);
- }}
- visible={this.state.selectItemVisible}
- onCancel={() => this.setState({ selectItemVisible: false })}>
-
- {
- setFieldSettingAttendList(value);
- }}
- items={fieldSettingAttendList}
- title="考勤模块"
- />
- {
- setFieldSettingCustomList(value);
- }}
- items={fieldSettingCustomList}
- title={"自定义"}
- />
-
-
-
- {this.state.refereAttendFormVisible &&
- {
- saveAttendanceFieldSetting("QUOTE");
- }}
- onRestoreDefault={() => {
- handleonRestoreDefault("QUOTE");
- }}
- onSetDefault={() => {
- handleSetDefault("QUOTE");
- }}
- onShowChecked={value => {
- handleShowChecked(value);
- }}
- onSearch={value => {
- searchFieldSettingList(value);
- }}
- onChange={value => {
- setFieldSettingAttendList(value);
- }}
- items={fieldSettingAttendList}
- onHeaderSet={() => {
- handleRefereHeaderSet();
- }}
- visible={this.state.refereAttendFormVisible}
- onCancel={() => {
- this.handleRefereCancel();
- }}
- />}
- {this.state.itemMangeVisible &&
- {
- handleItemMangeUpdate(value);
- }}
- onSave={value => handleItemMangeSave(value)}
- onCancel={() => {
- this.setState({ itemMangeVisible: false });
- }}
- />}
- {slideVisiable &&
-
- }
- content={
-
- }
- onClose={() => setSlideVisiable(false)}
- showMask={true}
- closeMaskOnClick={() => setSlideVisiable(false)}
- />}
-
- );
- }
-}
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/itemMangeFormModal.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/itemMangeFormModal.js
deleted file mode 100644
index adf2d2ff..00000000
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/itemMangeFormModal.js
+++ /dev/null
@@ -1,124 +0,0 @@
-import React from "react";
-import { Button, Col, Row, Switch } from "antd";
-import { inject, observer } from "mobx-react";
-import { WeaDialog, WeaInput, WeaSelect } from "ecCom";
-import "./index.less";
-
-@inject("attendanceStore")
-@observer
-export default class ItemMangeFormModal extends React.Component {
- componentWillMount() {
- const { attendanceStore: { currentItem, currentItemOperate } } = this.props;
- if (currentItemOperate == "add") {
- this.state = {
- request: {
- fieldName: "",
- fieldType: "1",
- enableStatus: 0,
- description: ""
- }
- };
- } else {
- this.state = {
- request: currentItem
- };
- }
- }
-
- handleChange(params) {
- const { request } = this.state;
- let result = { ...request, ...params };
- this.setState({ request: result });
- }
-
- convertFieldType = (fileTypeStr) => {
- if (fileTypeStr == "数值") {
- return "1";
- } else if (fileTypeStr == "文本") {
- return "2";
- } else if (fileTypeStr == "1" || fileTypeStr == "2") {
- return fileTypeStr;
- }
- return "";
- };
-
- render() {
- const options = [
- {
- key: "1",
- selected: true,
- showname: "数值"
- },
- {
- key: "2",
- selected: false,
- showname: "文本"
- }
- ];
- const { request } = this.state;
- const { fieldName, fieldType, enableStatus, description } = request;
- let fileTypeKey = this.convertFieldType(fieldType);
- const { attendanceStore: { currentItemOperate } } = this.props;
- return (
- {
- currentItemOperate == "add" ? this.props.onSave(this.state.request) :
- this.props.onUpdate(this.state.request);
- }
- }>保存
- ]}>
-
-
-
- 字段名称
-
-
- {
- this.handleChange({ fieldName: v });
- }}/>
-
-
-
-
- 类型
-
-
- this.handleChange({ fieldType: v })}
- />
-
-
-
-
- 是否启用
-
-
- {
- let enableStatus = 0;
- if (value) {
- enableStatus = 1;
- }
- this.handleChange({ enableStatus });
- }}/>
-
-
-
-
- 备注
-
-
- {
- this.handleChange({ description: v });
- }}/>
-
-
-
-
-
- );
- }
-}
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/refereAttendFormModal.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/refereAttendFormModal.js
deleted file mode 100644
index 8b9ccee7..00000000
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/refereAttendFormModal.js
+++ /dev/null
@@ -1,198 +0,0 @@
-import React from "react";
-import { Button, Col, message, Row, Select } from "antd";
-import moment from "moment";
-import { WeaDatePicker, WeaDialog, WeaError, WeaInput, WeaSelect } from "ecCom";
-import SelectItemModal from "../../../components/selectItemsModal";
-import SelectItemsWrapper from "../../../components/selectItemsModal/selectItemsWrapper";
-import { inject, observer } from "mobx-react";
-import { notNull } from "../../../util/validate";
-
-const { Option } = Select;
-
-@inject("attendanceStore")
-@observer
-export default class RefereAttendFormModal extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- headerSetVisible: false,
- inited: false,
- request: {
- salarySobId: "",
- salaryYearMonth: moment(new Date()).format("YYYY-MM"),
- employeeIds: [],
- description: ""
- }
- };
- }
-
- handleHeaderSet() {
- this.setState({ headerSetVisible: true });
- this.props.onHeaderSet();
- }
-
- componentWillMount() {
- const { attendanceStore: { getLedgerList } } = this.props;
- getLedgerList().then(() => {
- this.setState({
- inited: true
- });
- });
- }
-
- // 请求参数改变事件
- handleRequestChange(params) {
- const { request } = this.state;
- let result = { ...request, ...params };
- this.setState({ request: result });
- }
-
- // 同步点击回调
- handleSync = () => {
- if (!this.handleAsync) {
- this.handleAsync = _.debounce(() => {
- const { attendanceStore: { syncAttendanceRefer, checkOperation } } = this.props;
- if (!this.validate()) {
- return;
- }
- const { salarySobId, salaryYearMonth: salaryYearMonthStr } = this.state.request;
- const payload = {
- salaryYearMonthStr,
- salarySobId
- };
- checkOperation(payload).then(({ status, data, errorMsg }) => {
- if (status && data) {
- syncAttendanceRefer(this.state.request).then(() => {
- this.props.onCancel();
- });
- } else {
- message.warning("已经核算过不可操作");
- }
- });
- this.handleAsync = null;
- }, 500);
- }
- this.handleAsync();
- };
-
- // 校验数据
- validate() {
- const { request } = this.state;
- if (!notNull(request.salarySobId) && !notNull(request.salaryYearMonth)) {
- this.refs.weaError.showError();
- this.refs.weaError1.showError();
- return false;
- }
- if (!notNull(request.salarySobId)) {
- this.refs.weaError1.showError();
- return false;
- }
- if (!notNull(request.salaryYearMonth)) {
- this.refs.weaError.showError();
- return false;
- }
- return true;
- }
-
-
- render() {
- const { attendanceStore: { importLedgerList } } = this.props;
- return (
- 同步,
-
- ]}
- visible={this.props.visible}
- onCancel={this.props.onCancel}>
-
- 薪资所属月:
-
-
- {
- if (value === "") this.refs.weaError.showError();
- this.handleRequestChange({ salaryYearMonth: value });
- }}
- />
-
-
-
-
- 薪资账套:
-
- {
- this.state.inited &&
-
- ({
- key: it.id,
- showname: it.content
- }))]
- }
- onChange={(value) => {
- if (value === "") this.refs.weaError1.showError();
- this.handleRequestChange({ salarySobId: value });
- }}/>
-
- }
-
-
-
- 备注
-
- {
- this.handleRequestChange({ description: value });
- }}/>
-
-
-
-
- {
- this.props.onShowChecked(value);
- }}
- onRestoreDefault={() => {
- this.props.onRestoreDefault();
- }}
- onSetDefault={() => {
- this.props.onSetDefault();
- }}
- onSearch={(value) => {
- this.props.onSearch(value);
- }}
- onSave={(value) => {
- this.props.onSave(value);
- }}
- visible={this.state.headerSetVisible} onCancel={() => this.setState({ headerSetVisible: false })}>
- {
- this.props.onChange(value);
- }}/>
-
-
- );
- }
-}