From bb1e328c9209e8cd19c786bd9cbe8d70b44a137a 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, 5 Sep 2023 16:49:26 +0800
Subject: [PATCH] =?UTF-8?q?feature=E7=A4=BE=E4=BF=9D=E7=A6=8F=E5=88=A9?=
=?UTF-8?q?=E6=A1=A3=E6=A1=88=E6=B7=BB=E5=8A=A0=E9=9D=9E=E7=B3=BB=E7=BB=9F?=
=?UTF-8?q?=E4=BA=BA=E5=91=98=E5=88=97=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../importDialog/components/impStep1.js | 3 +-
.../components/importDialog/index.js | 7 +--
.../socialSecurityBenefits/archives/index.js | 52 ++++++++++++++++---
pc4mobx/hrmSalary/util/url.js | 15 +++---
4 files changed, 59 insertions(+), 18 deletions(-)
diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js
index 9e24dbf5..e8a3f662 100644
--- a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js
+++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js
@@ -62,7 +62,8 @@ class ImpStep1 extends Component {
{`1. ${getLabel(30907, "第一步")},${getLabel(543205, "请选择导出的Excel文件或")}`}
{getLabel(543207, "点击这里下载模板")}
+ target="_blank">{getLabel(543207, "点击这里下载模板")}
+ {this.props.exportDataDom}
{`2. ${getLabel(543211, "第二步")},${getLabel(543212, "请一定要确定Excel文档中的格式是模板中的格式")},${getLabel(543213, "没有被修改掉")};`}
{`3. ${getLabel(543216, "第三步")},${getLabel(543215, "选择填写好的Excel文档")},${getLabel(543214, "点击“下一步”按钮进行数据预览")};`}
diff --git a/pc4mobx/hrmSalary/components/importDialog/index.js b/pc4mobx/hrmSalary/components/importDialog/index.js
index 49956e37..bfaf70cf 100644
--- a/pc4mobx/hrmSalary/components/importDialog/index.js
+++ b/pc4mobx/hrmSalary/components/importDialog/index.js
@@ -33,11 +33,12 @@ class Index extends Component {
renderChildren = () => {
const { current } = this.state;
- const { importParams, link, excludeKey, importResult } = this.props;
+ const { importParams, link, excludeKey, importResult, exportDataDom = null } = this.props;
let CurrentDom = null;
switch (current) {
case 0:
- CurrentDom = this.step1Ref = dom}/>;
+ CurrentDom = this.step1Ref = dom}/>;
break;
case 1:
CurrentDom = null;
@@ -74,7 +75,7 @@ class Index extends Component {
}
}
if (_.isEmpty(fileList)) {
- message.error(getLabel(111, "请先上传EXCEL文件"));
+ message.warning(getLabel(111, "请先上传EXCEL文件"));
return;
}
const [file] = fileList;
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js
index 329dc99e..864a555b 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js
@@ -2,7 +2,7 @@ import React from "react";
import { inject, observer } from "mobx-react";
import { toJS } from "mobx";
import { Button, Dropdown, Menu, message, Modal, Popover } from "antd";
-import { WeaHelpfulTip, WeaLocaleProvider, WeaNewScroll, WeaSlideModal, WeaTab, WeaTop } from "ecCom";
+import { WeaCheckbox, WeaHelpfulTip, WeaLocaleProvider, WeaNewScroll, WeaSlideModal, WeaTab, WeaTop } from "ecCom";
import { getSearchs, renderLoading } from "../../../util";
import BaseForm from "./baseForm";
import SlideModalTitle from "../../../components/slideModalTitle";
@@ -14,8 +14,9 @@ import * as API from "../../../apis/welfareArchive";
import ImportModal from "../../../components/importModal";
import TipLabel from "../../../components/TipLabel";
import UnifiedTable from "../../../components/UnifiedTable";
-import { convertToUrlString } from "../../../util/url";
+import { convertToUrlString, getURLParameters } from "../../../util/url";
import { salaryArchiveDelete } from "../../../apis/payrollFiles";
+import ImportDialog from "../../../components/importDialog";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
@@ -50,14 +51,19 @@ export default class Archives extends React.Component {
stayAdd: 0,
paying: 0,
stayDel: 0,
- stopPay: 0
+ stopPay: 0,
+ ext: 0
},
pageInfo: {
current: 1,
pageSize: 10,
total: 0
},
- salaryArchiveDelete: "" //待定薪、停薪员工 是否允许删除薪资档案 0: 否, 1: 是
+ salaryArchiveDelete: "", //待定薪、停薪员工 是否允许删除薪资档案 0: 否, 1: 是
+ importDialog: {
+ visible: false, title: "", nextloading: false,
+ link: ""
+ }
};
this.record = {};
}
@@ -593,7 +599,8 @@ export default class Archives extends React.Component {
dataSource: dataSourceActive,
pageInfo,
tabCount,
- loading
+ loading,
+ importDialog
} = this.state;
const {
form, condition, showSearchAd, setShowSearchAd,
@@ -742,7 +749,15 @@ export default class Archives extends React.Component {
} type="ghost">
导出全部
- ] : [];
+ ] : [
+ ];
const pagination = {
current: pageInfo.current,
@@ -887,6 +902,31 @@ export default class Archives extends React.Component {
this.setState({ selectedTab: "0" });
})}/>
}
+ this.setState(({
+ importDialog: {
+ visible: false, title: "", nextloading: false,
+ link: ""
+ }
+ }))}
+ exportDataDom={
+ {
+ const payload = { exportData: val === "1" };
+ this.setState(({
+ importDialog: {
+ ...importDialog,
+ link: `/api/bs/hrmsalary/scheme/template/export?extWelArchiveList=true&${convertToUrlString(payload)}`
+ }
+ }));
+ }}
+ />
+ }
+ nextCallback={()=>{}}
+ />
{
this.state.importVisible && {
diff --git a/pc4mobx/hrmSalary/util/url.js b/pc4mobx/hrmSalary/util/url.js
index a69b4f81..d2802383 100644
--- a/pc4mobx/hrmSalary/util/url.js
+++ b/pc4mobx/hrmSalary/util/url.js
@@ -1,11 +1,10 @@
-// export const getQueryString = (name) => {
-// let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
-// let r = window.location.hash.split("?")[1].match(reg);
-// if (r != null) {
-// return decodeURIComponent(r[2]);
-// };
-// return null;
-// }
+export const getURLParameters = (url) =>
+ (url.match(/([^?=&]+)(=([^&]*))/g) || []).reduce(
+ (a, v) => (
+ (a[v.slice(0, v.indexOf("="))] = v.slice(v.indexOf("=") + 1)), a
+ ),
+ {}
+ );
export const getQueryString = (variable) => {
let split = window.location.hash.split("?");