diff --git a/pc4mobx/hrmSalary/apis/welfareArchive.js b/pc4mobx/hrmSalary/apis/welfareArchive.js index a38f22ce..e86e909e 100644 --- a/pc4mobx/hrmSalary/apis/welfareArchive.js +++ b/pc4mobx/hrmSalary/apis/welfareArchive.js @@ -13,6 +13,10 @@ export const getCondition = params => { export const queryList = (params) => { return postFetch("/api/bs/hrmsalary/archives/getTable", params); }; +//社保福利档案_非系统人员列表 +export const getExtTable = (params) => { + return postFetch("/api/bs/hrmsalary/archives/getExtTable", params); +}; //社保福利档案列表 export const queryInsuranceTabTotal = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/archives/queryInsuranceTabTotal", params); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/config/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/config/index.js index de89e096..84bcb6ff 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/config/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/config/index.js @@ -26,5 +26,12 @@ export const tabCondition = [ showcount: true, title: "停缴员工", viewcondition: "stop" - } + }, + { + color: "#000000", + groupid: "ext", + showcount: true, + title: "非系统人员", + viewcondition: "ext" + }, ]; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index cab89a87..4caa10dc 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,11 +14,16 @@ 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; +const APILIST = { + runStatuses: API["queryList"], + extWelArchiveList: API["getExtTable"] +}; @inject("archivesStore", "taxAgentStore") @observer export default class Archives extends React.Component { @@ -46,14 +51,20 @@ 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: "", importResult: {}, imageId: "", + previewUrl: "/api/bs/hrmsalary/scheme/preview" + } }; this.record = {}; } @@ -78,7 +89,7 @@ export default class Archives extends React.Component { const formParams = form.getFormParams() || {}; const payload = { ...pageInfo }; this.setState({ loading: { ...loading, query: true } }); - API.queryList({ ...formParams, ...payload, ...params }).then(({ data, status }) => { + APILIST[_.keys(params)[0]]({ ...formParams, ...payload, ...params }).then(({ data, status }) => { this.setState({ loading: { ...loading, query: false } }); if (status) { const { pageInfo: paganition, columns, datas: dataSource } = data; @@ -309,8 +320,19 @@ export default class Archives extends React.Component { // 导入 handleImport = (params) => { const { archivesStore: { importBatch } } = this.props; - const { runStatus } = this.state; - importBatch({ ...params, runStatus }); + const { runStatus, importDialog } = this.state; + this.setState(({ + importDialog: { + ...importDialog, nextloading: true, ...params + } + })); + importBatch({ ...params, runStatus }).then(({ status, data }) => { + this.setState(({ + importDialog: { + ...importDialog, nextloading: false, importResult: data, ...params + } + })); + }); }; // 导入完成 @@ -375,9 +397,12 @@ export default class Archives extends React.Component { case "suspend": this.queryList({ runStatuses: ["3"] }); break; - default: + case "stop": this.queryList({ runStatuses: ["4", "5"] }); break; + default: + this.queryList({ extWelArchiveList: true }); + break; } }; handleMenuBtnClick = () => { @@ -564,13 +589,15 @@ export default class Archives extends React.Component { {/*
4、数据进入【待减员】规则的第四种情况下,若还需要在当前个税扣缴义务人下进行缴纳的话,当前该员工的【待减员】数据进行【删除待办】操作即可;若不在该个税扣缴义务人下继续缴纳,维护好最后缴纳月后进行【减员】操作,员工进入【停缴员工】;
*/} ; break; - default: + case "stop": dom =
1、不需要缴纳社保福利的员工,保存在【停缴员工】;
{/*
2、【停缴员工】点击取消停缴,数据会回退到上次的位置(从【待减员】减员到停缴员工的,点击停缴返回到【在缴员工】,不返回到【待减员】);
*/} {/*
3、若员工的社保福利从一个个税扣缴义务人下转到另一个个税扣缴义务人下去缴纳,则在转后的个税扣缴义务人的【待增员】中进行增员操作成功后,员工进入待【在缴员工】,而在原个税扣缴义务人下的【停缴员工】中,该员工数据将会被删除;是否开启分权员工的档案数据都只保存一份;
*/}
; break; + default: + break; } return dom; }; @@ -584,7 +611,8 @@ export default class Archives extends React.Component { dataSource: dataSourceActive, pageInfo, tabCount, - loading + loading, + importDialog } = this.state; const { form, condition, showSearchAd, setShowSearchAd, @@ -719,7 +747,7 @@ export default class Archives extends React.Component { } type="ghost"> 导出全部 - ] : [ + ] : selectedKey === "stop" ? [ } @@ -733,6 +761,15 @@ export default class Archives extends React.Component { } type="ghost"> 导出全部 + ] : [ ]; const pagination = { @@ -775,6 +812,7 @@ export default class Archives extends React.Component { keyParam="viewcondition" //主键 selectedKey={selectedKey} onChange={this.handleChangeTab} + autoCalculateWidth searchType={["base", "advanced"]} // base:基础搜索框 advanced:显示高级搜索按钮 showSearchAd={showSearchAd} // 是否展开高级搜索面板 setShowSearchAd={bool => setShowSearchAd(bool)} //高级搜索面板受控 @@ -807,7 +845,7 @@ export default class Archives extends React.Component { xWidth={this.getColumns().length * 120} /> { - !_.isEmpty(this.getColumns()) && + !_.isEmpty(this.getColumns()) && selectedKey !== "ext" && {this.getTipChildren()} } @@ -878,6 +916,36 @@ export default class Archives extends React.Component { this.setState({ selectedTab: "0" }); })}/> } + this.setState({ + importDialog: { + ...importDialog, + visible: false, title: "", nextloading: false, + link: "", importResult: {}, imageId: "" + } + }, () => isFresh && this.query())} + onResetImportResult={() => this.setState(({ + importDialog: { ...importDialog, importResult: {}, imageId: "" } + }))} + exportDataDom={ + { + const formParams = form.getFormParams() || {}; + const payload = { exportData: val === "1", ...formParams }; + this.setState(({ + importDialog: { + ...importDialog, + link: `/api/bs/hrmsalary/scheme/template/export?extWelArchiveList=true&${convertToUrlString(payload)}` + } + })); + }} + /> + } + nextCallback={imageId => this.handleImport({ imageId })} + /> { this.state.importVisible && { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less index 7bb28208..0481abfb 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less @@ -4,10 +4,6 @@ height: 100%; background: #f6f6f6; - .wea-new-top-req-wapper .wea-new-top-req-main { - background: #f6f6f6 !important; - } - .wea-new-top-req-wapper .wea-new-top-req { z-index: 0 !important; } diff --git a/pc4mobx/hrmSalary/stores/archives.js b/pc4mobx/hrmSalary/stores/archives.js index 56bd3b12..383e585d 100644 --- a/pc4mobx/hrmSalary/stores/archives.js +++ b/pc4mobx/hrmSalary/stores/archives.js @@ -336,7 +336,7 @@ export class ArchivesStore { API.importBatch(params).then(res => { if (res.status) { this.importResult = res.data; - resolve(); + resolve(res); } else { message.error(res.errormsg || "导入失败", 1); reject(); 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("?");