From 0a3e2f8b02f33b64af74c82b219099a66088c29b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 9 Jan 2023 09:40:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=80=E6=9C=9F=E7=B4=AF=E8=AE=A1=E6=83=85?= =?UTF-8?q?=E5=86=B5=E9=A1=B5=E9=9D=A2=E6=9F=A5=E8=AF=A2=E4=B8=A2=E5=A4=B1?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E7=9A=84bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/dataAcquisition/attendance/index.js | 4 ++-- pc4mobx/hrmSalary/pages/payroll/SalarySendList.js | 4 ++-- pc4mobx/hrmSalary/pages/payroll/index.js | 12 +----------- pc4mobx/hrmSalary/stores/attendanceStore.js | 10 +++++----- 4 files changed, 10 insertions(+), 20 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js index 73eae942..1b76cb67 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js @@ -76,7 +76,7 @@ export default class Attendance extends React.Component { componentWillMount() { const { attendanceStore: { doInit, getLedgerList } } = this.props; - doInit(); + doInit(this.listSearch); getLedgerList().then(() => { this.setState({ inited: true @@ -192,7 +192,7 @@ export default class Attendance extends React.Component { ]).then(({ status, errormsg }) => { if (status) { message.success("删除成功"); - doInit({}); + doInit(this.listSearch); } else { message.error(errormsg || "删除失败"); } diff --git a/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js b/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js index b92a62c5..79752acc 100644 --- a/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js +++ b/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js @@ -14,9 +14,9 @@ export default class SalarySendList extends React.Component { this.pageInfo = { current: 1, pageSize: 10 }; } - componentWillMount() { + componentDidMount() { const { payrollStore: { getPayrollList } } = this.props; - getPayrollList(); + getPayrollList(this.searchParams); } // 发放回调 diff --git a/pc4mobx/hrmSalary/pages/payroll/index.js b/pc4mobx/hrmSalary/pages/payroll/index.js index 229c33d8..9b705f33 100644 --- a/pc4mobx/hrmSalary/pages/payroll/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/index.js @@ -41,20 +41,10 @@ export default class Payroll extends React.Component { endDate: moment(new Date()).startOf("month").format("YYYY-MM") }; this.recordId = ""; - this.salaryYearMonth = []; + this.salaryYearMonth = [moment(new Date()).startOf("year").format("YYYY-MM"), moment(new Date()).startOf("month").format("YYYY-MM")]; this.listPageInfo = { current: 1, pageSize: 10 }; } - // 更新模板 - handleUpdateTemplate(record) { - this.setState({ - selectedKey: "1", - editSlideVisible: true, - templateCurrentId: record.templateId - - }); - } - // 工资单模板-新建表单变化监听 handleBaseInfoChange = (request) => { const { payrollStore: { setTemplateBaseData } } = this.props; diff --git a/pc4mobx/hrmSalary/stores/attendanceStore.js b/pc4mobx/hrmSalary/stores/attendanceStore.js index 2b4e1691..61c86c7a 100644 --- a/pc4mobx/hrmSalary/stores/attendanceStore.js +++ b/pc4mobx/hrmSalary/stores/attendanceStore.js @@ -1,4 +1,4 @@ -import { observable, action, toJS } from "mobx"; +import { action, observable, toJS } from "mobx"; import { message } from "antd"; import { WeaForm, WeaTableNew } from "comsMobx"; @@ -125,10 +125,10 @@ export class AttendanceStore { // 初始化操作 @action - doInit = () => { + doInit = (params = {}) => { // this.getCondition(); // this.getTableDatas(); - this.getAttendanceList({}); + this.getAttendanceList(params); // this.getAttendanceFieldSettingList({sourceType:'IMPORT'}) }; @@ -196,7 +196,7 @@ export class AttendanceStore { @action saveAttendanceField = params => { - return new Promise((resolve,reject)=>{ + return new Promise((resolve, reject) => { API.saveAttendanceField(params).then(res => { if (res.status) { message.success("保存成功"); @@ -206,7 +206,7 @@ export class AttendanceStore { reject(); } }); - }) + }); }; @action