From 7907fd5a838bf89feadee668f5b4cae9480600d1 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 16:29:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86-=E8=80=83?= =?UTF-8?q?=E5=8B=A4=E5=BC=95=E7=94=A8=E9=A1=B5=E9=9D=A2=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/components/importModal/index.js | 3 +- .../components/importModal/index.less | 4 +- .../dataAcquisition/attendance/columns.js | 39 ++++- .../components/attendanceDataComp.js | 147 +++++++++++++++--- .../attendance/components/fieldMangComp.js | 5 +- .../components/importFormOptions.js | 57 +++++++ .../attendance/components/index.less | 4 + .../pages/dataAcquisition/attendance/index.js | 8 +- .../socialSecurityBenefits/programme/index.js | 4 +- 9 files changed, 237 insertions(+), 34 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/importFormOptions.js diff --git a/pc4mobx/hrmSalary/components/importModal/index.js b/pc4mobx/hrmSalary/components/importModal/index.js index 8e47ef9a..012c113f 100644 --- a/pc4mobx/hrmSalary/components/importModal/index.js +++ b/pc4mobx/hrmSalary/components/importModal/index.js @@ -107,7 +107,8 @@ export default class ImportModal extends React.Component { localStorage.removeItem("fileList"); this.props.onCancel(); }} - style={{ width: 850 }} + style={{ width: 850, height: 600 }} + hasScroll className="importModalWrapper" initLoadCss buttons={ diff --git a/pc4mobx/hrmSalary/components/importModal/index.less b/pc4mobx/hrmSalary/components/importModal/index.less index d472ab37..64c95083 100644 --- a/pc4mobx/hrmSalary/components/importModal/index.less +++ b/pc4mobx/hrmSalary/components/importModal/index.less @@ -1,7 +1,5 @@ .importModalWrapper { - .wea-dialog-body { - height: 80vh; - overflow: hidden auto; + .ant-modal-body { padding: 16px; } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/columns.js index 2adb437b..41094e98 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/columns.js @@ -68,7 +68,44 @@ export const columns = [ } } ]; - +export const fieldsColumns = [ + { + title: "id", + dataIndex: "id", + key: "id", + display: true + }, + { + title: "字段名称", + dataIndex: "fieldName", + key: "fieldName", + display: true + }, + { + title: "来源", + dataIndex: "sourceType", + key: "sourceType", + display: true + }, + { + title: "类型", + dataIndex: "fieldType", + key: "fieldType", + display: true + }, + { + title: "是否启用", + dataIndex: "enableStatus", + key: "enableStatus", + display: true + }, + { + title: "备注", + dataIndex: "description", + key: "description", + display: true + } +]; export const conditions = [ { items: [ diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js index 9f3d4a43..c143b92a 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js @@ -7,7 +7,15 @@ import React, { Component } from "react"; import { WeaTable } from "ecCom"; import { message, Modal } from "antd"; -import { deleteAttendance, getAttendanceList } from "../../../../apis/attendance"; +import { + deleteAttendance, + getAttendanceList, + getLedgerList, + getSalaryCycleAndAttendCycle +} from "../../../../apis/attendance"; +import ImportModal from "../../../../components/importModal"; +import HeaderSet from "../../../../components/importModal/headerSet"; +import ImportFormOptions from "./importFormOptions"; import moment from "moment"; class AttendanceDataComp extends Component { @@ -23,6 +31,14 @@ class AttendanceDataComp extends Component { current: 1, pageSize: 10, total: 0 + }, + importData: { + visiable: false, params: {}, step: 0, + columns: [], slideDataSource: [], importResult: [] + }, + importFormPayload: { + salaryYearMonth: moment().format("YYYY-MM"), salarySobList: [], + salarySobId: "", salaryCycle: "", attendCycle: "" } }; } @@ -55,6 +71,45 @@ class AttendanceDataComp extends Component { } }).catch(() => this.setState({ loading: { ...loading, query: false } })); }; + getLedgerList = () => { + const { importFormPayload } = this.state; + getLedgerList().then(({ status, data }) => { + if (status) { + this.setState({ + importFormPayload: { + ...importFormPayload, + salarySobList: _.map(data, it => ({ key: it.id, showname: it.content })) + } + }); + } + }); + }; + handleChangeImportPayload = (key, value) => { + const { importFormPayload } = this.state; + this.setState({ + importFormPayload: { + ...importFormPayload, + [key]: value + } + }, () => { + if (this.state.importFormPayload.salaryYearMonth && this.state.importFormPayload.salarySobId) { + const payload = { + salaryYearMonthStr: this.state.importFormPayload.salaryYearMonth, + salarySobId: this.state.importFormPayload.salarySobId + }; + getSalaryCycleAndAttendCycle(payload).then(({ status, data }) => { + if (status) { + this.setState({ + importFormPayload: { + ...this.state.importFormPayload, + ...data + } + }); + } + }); + } + }); + }; handleDeleteAttendanceData = ({ id }) => { Modal.confirm({ title: "信息确认", @@ -71,9 +126,33 @@ class AttendanceDataComp extends Component { } }); }; + handleImportAttendanceData = (importData) => { + this.getLedgerList(); + this.setState({ importData }); + }; + setStep = step => this.setState({ importData: { ...this.state.importData, step } }); + handleFinish = () => { + console.log("finish"); + }; + handlePreviewImport = (params) => { + console.log("handlePreviewImport", params); + }; + handleImport = (params) => { + console.log("handleImport", params); + }; + handleTemplateLinkClick = () => { + const { importFormPayload } = this.state; + const { salarySobId, salaryYearMonth } = importFormPayload; + if (!salarySobId || !salaryYearMonth) { + message.warning("请完善导入选项,再下载"); + return; + } + // const { attendanceStore: { downloadTemplate } } = this.props; + // downloadTemplate(salaryYearMonth, salarySobId); + }; render() { - const { dataSource, columns, pageInfo, loading } = this.state; + const { dataSource, columns, pageInfo, loading, importData, importFormPayload } = this.state; const { showOperateBtn, salaryYearMonth } = this.props; const pagination = { ...pageInfo, @@ -93,29 +172,49 @@ class AttendanceDataComp extends Component { } }; return ( - { - return ( -
- 查看 - {showOperateBtn && - this.handleDeleteAttendanceData(record)}>删除 - } -
- ); + + { + return ( +
+ 查看 + {showOperateBtn && + this.handleDeleteAttendanceData(record)}>删除 + } +
+ ); + } } - } - ]} - dataSource={dataSource} - pagination={pagination} - loading={loading.query} - /> + ]} + dataSource={dataSource} + pagination={pagination} + loading={loading.query} + /> + {/* 考勤引用导入 */} + { + // getAttendanceFieldSettingList({ sourceType: "IMPORT" }); + // this.setState({ + // selectItemVisible: true + // }); + }} + />} + renderFormComponent={ + () => + } + /> +
); } } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/fieldMangComp.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/fieldMangComp.js index 9a1cb904..687c6482 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/fieldMangComp.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/fieldMangComp.js @@ -10,6 +10,7 @@ import { Col, message, Row } from "antd"; import AttendanceCustomFieldsModal from "./attendanceCustomFieldsModal"; import { getAttendanceFieldList, updateAttendanceFieldStatus } from "../../../../apis/attendance"; import TipLabel from "../../../../components/TipLabel"; +import { fieldsColumns } from "../columns"; class FieldMangComp extends Component { constructor(props) { @@ -18,8 +19,8 @@ class FieldMangComp extends Component { loading: { query: false }, - dataSource: [], - columns: [], + dataSource: [{}], + columns: fieldsColumns, pageInfo: { current: 1, pageSize: 10, diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/importFormOptions.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/importFormOptions.js new file mode 100644 index 00000000..f16d18f3 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/importFormOptions.js @@ -0,0 +1,57 @@ +/* + * Author: 黎永顺 + * name: 考情数据导入的,表单选项 + * Description: + * Date: 2023/3/3 + */ +import React, { Component } from "react"; +import { WeaFormItem, WeaInput, WeaSearchGroup } from "ecCom"; +import { DataCollectionDatePicker, DataCollectionSelect } from "../../cumDeduct"; +import "./index.less"; + +const Input = (label, value, labelCol = 8, wrapperCol = 16) => { + return ( + + + + ); +}; + +class ImportFormOptions extends Component { + screenChange = ({ key, value }) => { + const { onChangeImportForm } = this.props; + onChangeImportForm(key, value); + }; + + render() { + const { salarySobList = [], salaryYearMonth, salarySobId, salaryCycle, attendCycle } = this.props; + const items = [ + { + com: DataCollectionDatePicker({ + label: "薪资所属月", + value: salaryYearMonth, + onChange: this.screenChange, + key: "salaryYearMonth", + screen: false + }) + }, + { + com: DataCollectionSelect({ + label: "薪资账套", + value: salarySobId || "", + onChange: this.screenChange, + options: [{ key: "", showname: "" }, ...salarySobList], + key: "salarySobId" + }) + }, + { com: Input("薪资周期", salaryCycle) }, + { com: Input("考勤周期", attendCycle, 10, 14) } + ]; + return ( + + ); + } +} + +export default ImportFormOptions; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/index.less b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/index.less index cdc25296..d5773f1b 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/index.less +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/index.less @@ -13,3 +13,7 @@ border-radius: 0; } } + +.attendanceFormWrapper { + padding: 0; +} diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js index 8db3cff8..60d168b9 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js @@ -56,6 +56,12 @@ class Index extends Component { }; handleChangeSalaryMonth = (salaryMonth) => this.setState({ salaryMonth }, () => this.attendanceTableRef.getAttendanceList({ salaryYearMonth: _.compact(this.state.salaryMonth) })); handleAddAttendFileds = () => this.fieldMangRef.handleTriggerAttendFileds(); + handleImportAttendanceData= ()=>{ + this.attendanceTableRef.handleImportAttendanceData({ + visiable: true, params: {}, step: 0, + columns: [], slideDataSource: [], importResult: [] + }); + } render() { const { selectedKey, salaryMonth, fieldName } = this.state; @@ -66,7 +72,7 @@ class Index extends Component { ]; const buttons = selectedKey === "DATA" ? [ , - + ] : []; return (
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] }); };