From 6ea3bfef6ee8d717f49a2513083a5cd5b0cbc5ea Mon Sep 17 00:00:00 2001
From: MustangDeng <670124965@qq.com>
Date: Fri, 11 Mar 2022 16:13:36 +0800
Subject: [PATCH] =?UTF-8?q?import=20modal=20=E6=94=B9=E9=80=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pc4mobx/hrmSalary/apis/cumSituation.js | 26 ++++-
pc4mobx/hrmSalary/apis/otherDeduct.js | 36 +++++-
.../components/importModal/columns.js | 62 ----------
.../hrmSalary/components/importModal/index.js | 85 ++++----------
.../components/importModal/modalStep1.js | 2 +-
.../dataAcquisition/cumDeduct/columns.js | 64 ++++++++++
.../pages/dataAcquisition/cumDeduct/index.js | 63 ++++++++--
.../dataAcquisition/cumSituation/columns.js | 109 ++++++++++++++++++
.../dataAcquisition/cumSituation/index.js | 50 ++++++--
.../dataAcquisition/otherDeduct/columns.js | 58 ++++++++++
.../dataAcquisition/otherDeduct/index.js | 50 ++++++--
pc4mobx/hrmSalary/stores/cumSituation.js | 4 +-
pc4mobx/hrmSalary/stores/otherDeduct.js | 8 +-
13 files changed, 463 insertions(+), 154 deletions(-)
delete mode 100644 pc4mobx/hrmSalary/components/importModal/columns.js
diff --git a/pc4mobx/hrmSalary/apis/cumSituation.js b/pc4mobx/hrmSalary/apis/cumSituation.js
index 295cc91c..449b9724 100644
--- a/pc4mobx/hrmSalary/apis/cumSituation.js
+++ b/pc4mobx/hrmSalary/apis/cumSituation.js
@@ -48,7 +48,7 @@ export const getCumSituationDetailList = params => {
}
//数据采集-累计情况-导出明细
-export const exportCumSituationDetailList = params => {
+export const exportCumSituationDetailList = ids => {
fetch('/api/bs/hrmsalary/addUpSituation/exportDetail?ids=' + ids).then(res => res.blob().then(blob => {
var filename=`往期累计情况(工资、薪金).xlsx`
var a = document.createElement('a');
@@ -58,4 +58,28 @@ export const exportCumSituationDetailList = params => {
a.click();
window.URL.revokeObjectURL(url);
}))
+}
+
+// 数据采集-累计情况-导入
+export const importCumSituationParam = params => {
+ return fetch('/api/bs/hrmsalary/addUpSituation/importAddUpSituation', {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ }).then(res => res.json())
+}
+
+// 数据采集-累计情况-导入预览
+export const importCumSituationPreview = params => {
+ return fetch('/api/bs/hrmsalary/addUpSituation/addUpSituation', {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ }).then(res => res.json())
}
\ No newline at end of file
diff --git a/pc4mobx/hrmSalary/apis/otherDeduct.js b/pc4mobx/hrmSalary/apis/otherDeduct.js
index 6612bcee..0b82f652 100644
--- a/pc4mobx/hrmSalary/apis/otherDeduct.js
+++ b/pc4mobx/hrmSalary/apis/otherDeduct.js
@@ -39,7 +39,14 @@ export const exportOtherDeductList = (ids = "") => {
//数据采集-获取其他免税扣除记录
export const getOtherDeductDetailList = params => {
- return WeaTools.callApi('/api/bs/hrmsalary/otherDeduction/getDetailList', 'get', params);
+ return fetch('/api/bs/hrmsalary/otherDeduction/getDetailList', {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ }).then(res => res.json())
}
//数据采集-其他免税扣除-导出明细
@@ -53,4 +60,29 @@ export const exportOtherDeductDetailList = ids => {
a.click();
window.URL.revokeObjectURL(url);
}))
-}
\ No newline at end of file
+}
+
+// 数据采集-其他免税扣除-导入
+export const importOtherDeductionParam = params => {
+ return fetch('/api/bs/hrmsalary/otherDeduction/importData', {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ }).then(res => res.json())
+}
+
+
+// 数据采集-其他免税扣除-导入预览
+export const importOtherDeductionPreview = params => {
+ return fetch('/api/bs/hrmsalary/otherDeduction/preview', {
+ method: 'POST',
+ mode: 'cors',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(params)
+ }).then(res => res.json())
+}
diff --git a/pc4mobx/hrmSalary/components/importModal/columns.js b/pc4mobx/hrmSalary/components/importModal/columns.js
deleted file mode 100644
index 447fcf06..00000000
--- a/pc4mobx/hrmSalary/components/importModal/columns.js
+++ /dev/null
@@ -1,62 +0,0 @@
-export const columns = [
- {
- title: "姓名",
- dataIndex: 'username',
- key: 'username',
- },
- {
- title: "个税扣缴义务人",
- dataIndex: 'taxAgentName',
- key: 'taxAgentName',
- },
- {
- title: "部门",
- dataIndex: 'departmentName',
- key: 'departmentName',
- },
- {
- title: "手机号",
- dataIndex: 'mobile',
- key: 'mobile',
- },
- {
- title: "工号",
- dataIndex: 'jobNum',
- key: 'jobNum',
- },
- {
- title: "证件号码",
- dataIndex: 'idNo',
- key: 'idNo',
- },
- {
- title: "入职日期",
- dataIndex: 'hiredate',
- key: 'hiredate',
- },
- {
- title: "累计子女教育",
- dataIndex: 'addUpChildEducation',
- key: 'addUpChildEducation',
- },
- {
- title: "累计继续教育",
- dataIndex: 'addUpContinuingEducation',
- key: 'addUpContinuingEducation',
- },
- {
- title: "累计住房贷款利息",
- dataIndex: 'addUpHousingLoanInterest',
- key: 'addUpHousingLoanInterest',
- },
- {
- title: "累计住房租金",
- dataIndex: 'addUpHousingRent',
- key: 'addUpHousingRent',
- },
- {
- title: "累计赡养老人",
- dataIndex: 'addUpSupportElderly',
- key: 'addUpSupportElderly',
- }
-]
diff --git a/pc4mobx/hrmSalary/components/importModal/index.js b/pc4mobx/hrmSalary/components/importModal/index.js
index 4748b628..5d89a233 100644
--- a/pc4mobx/hrmSalary/components/importModal/index.js
+++ b/pc4mobx/hrmSalary/components/importModal/index.js
@@ -8,21 +8,16 @@ import ModalStep1 from './modalStep1'
import ModalStep2 from './modalStep2'
import ModalStep3 from './modalStep3'
-import { columns } from './columns'
-
const Dragger = Upload.Dragger;
const Step = WeaSteps.Step;
-@inject("taxAgentStore", "cumDeductStore")
+@inject("taxAgentStore")
@observer
export default class ImportModal extends React.Component {
constructor(props) {
super(props)
this.state = {
- currentStep: 0,
- datetime: "",
- taxAgentId: "",
fileId: ""
}
}
@@ -33,71 +28,40 @@ export default class ImportModal extends React.Component {
}
nextStep() {
- const { cumDeductStore: { step, setStep }} = this.props;
- setStep(step + 1)
+ const { step } = this.props;
+ this.props.setStep(step + 1)
}
preStep() {
- const { cumDeductStore: { step, setStep }} = this.props;
- setStep(step - 1);
+ const { step } = this.props;
+ this.props.setStep(step - 1);
}
- renderFormComponent() {
- const { datetime, taxAgentId } = this.state
- const { taxAgentStore: {taxAgentOption} } = this.props;
- return (
-
1. 第一步,请选择导出的Excel文件或 点击这里下载模板;
+1. 第一步,请选择导出的Excel文件或 点击这里下载模板;
2. 第二步,请一定要确定Excel文档中的格式是模板中的格式,没有被修改掉;
3. 第三步,选择填写好的Excel文档,点击“下一步”按钮进行数据预览;
4. 第四步,如果以上步骤和Excel文档正确的话,数据会被正确导入,导入成功会有提示。如果有问题,则会提示Excel文档的错误之处。
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js index 9d2ab7e0..30d36254 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js @@ -67,6 +67,70 @@ export const columns = [ ] +export const modalColumns = [ + { + title: "姓名", + dataIndex: 'username', + key: 'username', + }, + { + title: "个税扣缴义务人", + dataIndex: 'taxAgentName', + key: 'taxAgentName', + }, + { + title: "部门", + dataIndex: 'departmentName', + key: 'departmentName', + }, + { + title: "手机号", + dataIndex: 'mobile', + key: 'mobile', + }, + { + title: "工号", + dataIndex: 'jobNum', + key: 'jobNum', + }, + { + title: "证件号码", + dataIndex: 'idNo', + key: 'idNo', + }, + { + title: "入职日期", + dataIndex: 'hiredate', + key: 'hiredate', + }, + { + title: "累计子女教育", + dataIndex: 'addUpChildEducation', + key: 'addUpChildEducation', + }, + { + title: "累计继续教育", + dataIndex: 'addUpContinuingEducation', + key: 'addUpContinuingEducation', + }, + { + title: "累计住房贷款利息", + dataIndex: 'addUpHousingLoanInterest', + key: 'addUpHousingLoanInterest', + }, + { + title: "累计住房租金", + dataIndex: 'addUpHousingRent', + key: 'addUpHousingRent', + }, + { + title: "累计赡养老人", + dataIndex: 'addUpSupportElderly', + key: 'addUpSupportElderly', + } +] + + export const dataSource = []; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index 098b0e1f..04308038 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/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, Modal, message } from 'antd'; +import { Button, Table, DatePicker, Dropdown, Menu, Modal, message, Row, Col } from 'antd'; import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaDatePicker, WeaSelect, WeaHelpfulTip, WeaSlideModal } from 'ecCom'; import { WeaTableNew } from "comsMobx" @@ -14,7 +14,7 @@ import { renderNoright, getSearchs } from '../../../util'; // 渲染form数据 import CustomTab from '../../../components/customTab'; import ContentWrapper from '../../../components/contentWrapper'; import ImportModal from '../../../components/importModal' -import { columns, dataSource } from './columns'; +import { columns, dataSource, modalColumns } from './columns'; const { MonthPicker } = DatePicker; @@ -35,7 +35,12 @@ export default class CumDeduct extends React.Component { selectedKey: "0", visiable: false, monthValue: moment(new Date()).format("YYYY-MM"), - taxAgentId: "" + taxAgentId: "", + datetime: "", + modalParam: { + declareMonth: "", + taxAgentId: "" + } } } @@ -88,6 +93,35 @@ export default class CumDeduct extends React.Component { ) } + renderFormComponent() { + const { modalParam } = this.state + const { taxAgentStore: {taxAgentOption} } = this.props; + return ( +