From c85c2ec66f7e66d7abaeecdf961ae10a24228fc7 Mon Sep 17 00:00:00 2001 From: MustangDeng <670124965@qq.com> Date: Sat, 7 May 2022 14:47:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/attendance.js | 6 ++ pc4mobx/hrmSalary/apis/welfareArchive.js | 40 ++++++++++++- .../components/importModal/modalStep2.js | 2 +- pc4mobx/hrmSalary/pages/calculate/index.js | 25 ++++++-- .../pages/dataAcquisition/attendance/index.js | 28 +++++---- .../pages/salaryItem/formalFormModal.js | 14 +++++ pc4mobx/hrmSalary/pages/salaryItem/index.js | 5 +- .../socialSecurityBenefits/archives/index.js | 60 ++++++++++++++++++- pc4mobx/hrmSalary/stores/archives.js | 51 ++++++++++++++++ pc4mobx/hrmSalary/stores/attendanceStore.js | 16 ++++- pc4mobx/hrmSalary/stores/ledger.js | 3 +- 11 files changed, 221 insertions(+), 29 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/attendance.js b/pc4mobx/hrmSalary/apis/attendance.js index bd61c9a3..710233df 100644 --- a/pc4mobx/hrmSalary/apis/attendance.js +++ b/pc4mobx/hrmSalary/apis/attendance.js @@ -228,3 +228,9 @@ export const viewAttendQuote = (ids) => { body: JSON.stringify(ids) }).then(res => res.json()) } + +// 根据所属月和账套获取周期 +export const getSalaryCycleAndAttendCycle = (params) => { + return WeaTools.callApi('/api/bs/hrmsalary/attendQuote/getSalaryCycleAndAttendCycle', 'get', params); + +} diff --git a/pc4mobx/hrmSalary/apis/welfareArchive.js b/pc4mobx/hrmSalary/apis/welfareArchive.js index 8d3d13f6..c8ba59f9 100644 --- a/pc4mobx/hrmSalary/apis/welfareArchive.js +++ b/pc4mobx/hrmSalary/apis/welfareArchive.js @@ -50,6 +50,40 @@ export const getImportDocumentParams = params => { }; // 导入档案- 导出现有数据 -export const exportCurData = params => { - return WeaTools.callApi('/api/bs/hrmsalary/exportTemplate', 'get', params); -}; \ No newline at end of file +export const exportCurData = ids => { + fetch('/api/bs/hrmsalary/scheme/template/export?ids=' + ids).then(res => res.blob().then(blob => { + var filename=`福利档案模板.xlsx` + var a = document.createElement('a'); + var url = window.URL.createObjectURL(blob); + a.href = url; + a.download = filename; + a.click(); + window.URL.revokeObjectURL(url); + })) +}; + +// 导入档案-预览 +export const previewCurData = (params) => { + return fetch('/api/bs/hrmsalary/scheme/preview', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }).then(res => res.json()) +} + +// 档案导入 +export const importBatch = (params) => { + return fetch('/api/bs/hrmsalary/scheme/importBatch', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }).then(res => res.json()) +} + + diff --git a/pc4mobx/hrmSalary/components/importModal/modalStep2.js b/pc4mobx/hrmSalary/components/importModal/modalStep2.js index dc3589f9..7fd80249 100644 --- a/pc4mobx/hrmSalary/components/importModal/modalStep2.js +++ b/pc4mobx/hrmSalary/components/importModal/modalStep2.js @@ -11,7 +11,7 @@ export default class ModalStep2 extends React.Component { const {dataSource, columns} = this.props; return (
-
+
diff --git a/pc4mobx/hrmSalary/pages/calculate/index.js b/pc4mobx/hrmSalary/pages/calculate/index.js index 39eab4e9..916f6417 100644 --- a/pc4mobx/hrmSalary/pages/calculate/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/index.js @@ -2,7 +2,7 @@ import React from 'react'; import { inject, observer } from 'mobx-react'; import { toJS } from 'mobx'; -import { Button, Table, DatePicker, Dropdown, Menu } from 'antd'; +import { Button, Table, DatePicker, Dropdown, Menu, Modal } from 'antd'; import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaTable, WeaDatePicker, WeaInputSearch } from 'ecCom'; @@ -26,6 +26,8 @@ export default class Calculate extends React.Component { value: "", selectedKey: "0", searchValue: "", + startDate: moment(new Date()).format("YYYY-MM"), + endDate: moment(new Date()).format("YYYY-MM"), columns: columns.map(item => { if(item.dataIndex == 'cz') { item.render = () => ( @@ -66,6 +68,10 @@ export default class Calculate extends React.Component { handleRangePickerChange(value) { let range = value.map(item => moment(item).format("YYYY-MM")) const { calculateStore: {getSalaryAcctList} } = this.props; + this.setState({ + startDate: range[0], + endDate: range[1] + }) getSalaryAcctList({ name: this.state.searchValue, startMonthStr: range[0], @@ -80,10 +86,18 @@ export default class Calculate extends React.Component { // 列表项删除回调 handleDeleteItem(record) { - const { calculateStore: {deleteSalaryacct}} = this.props; - deleteSalaryacct([record.id]).then(() => { - this.handleSearch(this.state.searchValue) - }) + Modal.confirm({ + title: '信息确认', + content: '确认删除', + onOk:() => { + const { calculateStore: {deleteSalaryacct}} = this.props; + deleteSalaryacct([record.id]).then(() => { + this.handleSearch(this.state.searchValue) + }) + }, + onCancel: () => { + }, + }); } // 列表项归档回调 @@ -229,7 +243,6 @@ export default class Calculate extends React.Component { /> - { this.state.baseFormVisible && { this.setState({modalParam: {...modalParam, salaryYearMonth: value}}) + this.handleLoadCycle(value, this.state.modalParam.salarySobId) }} /> @@ -283,6 +296,7 @@ export default class Attendance extends React.Component { this.handleFormChange({fundName: value})}> +