From 134653fac681e98b71c65245a6717d72e8af6a9a Mon Sep 17 00:00:00 2001 From: liyongshun <971387674@qq.com> Date: Thu, 21 Jul 2022 17:34:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=96=AA=E8=B5=84=E5=8F=91=E6=94=BE=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=B7=BB=E5=8A=A0=E8=BF=9B=E5=BA=A6=E6=9D=A1=E5=BC=B9?= =?UTF-8?q?=E6=A1=86=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/standingBook.js | 14 +- .../components/progressModal/index.js | 34 +- .../components/slideModalTitle/index.js | 6 +- pc4mobx/hrmSalary/pages/calculate/index.js | 117 ++-- .../pages/dataAcquisition/attendance/index.js | 301 ++++------ pc4mobx/hrmSalary/pages/declare/index.js | 131 ++-- .../hrmSalary/pages/ledger/copyFormModal.js | 18 +- pc4mobx/hrmSalary/pages/ledger/index.less | 21 + pc4mobx/hrmSalary/pages/payroll/index.js | 561 ++++++++++-------- .../socialSecurityBenefits/archives/index.js | 42 +- .../standingBook/index.js | 283 ++++----- .../standingBookDetail/components/normal.js | 89 ++- .../standingBookDetail/components/overView.js | 21 +- pc4mobx/hrmSalary/stores/StandingBook.js | 16 +- 14 files changed, 880 insertions(+), 774 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index 8909abfe..06d5f8bd 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -171,6 +171,18 @@ export const commonAccount = (params) => { }).then((res) => res.json()); }; +// 社保福利台账重新核算 +export const socialSecurityBenefitsRecalculate = (params) => { + return fetch("/api/bs/hrmsalary/siaccount/socialSecurityBenefitsRecalculate", { + method: "post", + mode: "cors", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(params), + }).then((res) => res.json()); +}; + // 获取当前管理员下的所有的个税扣缴义务人 export const getAdminTaxAgentList = () => { @@ -179,4 +191,4 @@ export const getAdminTaxAgentList = () => { "get", {} ); -} \ No newline at end of file +} diff --git a/pc4mobx/hrmSalary/components/progressModal/index.js b/pc4mobx/hrmSalary/components/progressModal/index.js index 818ce3fb..a0dffdf1 100644 --- a/pc4mobx/hrmSalary/components/progressModal/index.js +++ b/pc4mobx/hrmSalary/components/progressModal/index.js @@ -1,17 +1,21 @@ -import React from 'react' -import { Modal } from 'antd' -import { WeaProgress } from 'ecCom' +import React from "react"; +import { Modal } from "antd"; +import { WeaProgress } from "ecCom"; export default class ProgressModal extends React.Component { - render() { - return ( -
- {this.props.onCancel()}} footer={null}> -
- -
-
-
- ) - } -} \ No newline at end of file + render() { + return ( +
+ { + this.props.onCancel(); + }} footer={null}> +
+ +
+
+
+ ); + } +} diff --git a/pc4mobx/hrmSalary/components/slideModalTitle/index.js b/pc4mobx/hrmSalary/components/slideModalTitle/index.js index aca9a78e..a797cee8 100644 --- a/pc4mobx/hrmSalary/components/slideModalTitle/index.js +++ b/pc4mobx/hrmSalary/components/slideModalTitle/index.js @@ -38,11 +38,11 @@ export default class SlideModalTitle extends React.Component {
{this.props.btns} { - this.props.showOperateBtn && this.state.editable && + this.props.showOperateBtn && this.state.editable && this.props.selectedTab != 1 && } {this.props.customOperate}
- + } -} \ No newline at end of file +} diff --git a/pc4mobx/hrmSalary/pages/calculate/index.js b/pc4mobx/hrmSalary/pages/calculate/index.js index 21209ff5..31c5fdda 100644 --- a/pc4mobx/hrmSalary/pages/calculate/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/index.js @@ -1,38 +1,19 @@ 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, DatePicker, Dropdown, Menu, Modal } from "antd"; -import { - WeaTop, - WeaTab, - WeaRightMenu, - WeaRangePicker, - WeaTable, - WeaDatePicker, - WeaInputSearch -} from "ecCom"; +import { WeaInputSearch, WeaRightMenu, WeaTop } from "ecCom"; -import { renderNoright, getSearchs } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 +import { renderNoright } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 import CustomTab from "../../components/customTab"; -import ContentWrapper from "../../components/contentWrapper"; -import { columns, dataSource } from "./columns"; +import { columns } from "./columns"; import moment from "moment"; import BaseFormModal from "./baseFormModal"; -import CustomTable from "../../components/customTable"; import CustomPaginationTable from "../../components/customPaginationTable"; -const { RangePicker } = DatePicker; +const MonthPicker = DatePicker.MonthPicker; @inject("calculateStore", "taxAgentStore") @observer @@ -43,10 +24,7 @@ export default class Calculate extends React.Component { value: "", selectedKey: "0", searchValue: "", - startDate: moment(new Date()) - .subtract(5, "months") - .startOf("month") - .format("YYYY-MM"), + startDate: moment(new Date()).startOf("year").format("YYYY-MM"), endDate: moment(new Date()).startOf("month").format("YYYY-MM"), current: 1, columns: columns.map(item => { @@ -93,45 +71,25 @@ export default class Calculate extends React.Component { }); } - handleRangePickerChange(value) { - const isNil = _.every(value, it => !_.isNil(it)); - let range = isNil && value.map(item => moment(item).format("YYYY-MM")); + handleRangePickerChange(type, value) { const { calculateStore: { getSalaryAcctList } } = this.props; - if (isNil && !_.isEmpty(value)) { - this.setState( - { - startDate: range[0], - endDate: range[1] - }, - () => { - getSalaryAcctList({ - name: this.state.searchValue, - startMonthStr: range[0], - endMonthStr: range[1] - }); - } - ); - } else { - this.setState( - { - startDate: moment(new Date()) - .subtract(5, "months") - .startOf("month") - .format("YYYY-MM"), - endDate: moment(new Date()).startOf("month").format("YYYY-MM") - }, - () => { - message.error("目前可查询的最大时间范围为6个月 请重新选择"); - } - ); - } + this.setState({ + [type]: value ? moment(value).format("YYYY-MM") : moment().format("YYYY-MM") + }, () => { + const { startDate: startMonthStr, endDate: endMonthStr } = this.state; + getSalaryAcctList({ + name: this.state.searchValue, + startMonthStr, + endMonthStr + }); + }); } // 列表项核算回调 handleAccount(record) { window.open( "/spa/hrmSalary/static/index.html#/main/hrmSalary/calculateDetail?id=" + - record.id + record.id ); } @@ -146,7 +104,8 @@ export default class Calculate extends React.Component { this.handleSearch(this.state.searchValue); }); }, - onCancel: () => {} + onCancel: () => { + } }); } @@ -170,7 +129,7 @@ export default class Calculate extends React.Component { handleDetail(record) { window.open( "/spa/hrmSalary/static/index.html#/main/hrmSalary/placeOnFileDetail?id=" + - record.id + record.id ); } @@ -309,7 +268,7 @@ export default class Calculate extends React.Component { // 右键菜单 { key: "BTN_COLUMN", - icon: , + icon: , content: "显示列定制", onClick: this.showColumn } @@ -335,12 +294,6 @@ export default class Calculate extends React.Component { ]; - const topTab = []; - - const renderSearchOperationItem = () => { - return
; - }; - const renderRightOperation = () => { const { startDate, endDate } = this.state; return ( @@ -357,11 +310,22 @@ export default class Calculate extends React.Component { }
- this.handleRangePickerChange(value)} + { + return current && endDate && current.getTime() > new Date(endDate).getTime(); + }} + onChange={(val) => this.handleRangePickerChange("startDate", val)} + /> + + { + return current && startDate && current.getTime() < new Date(startDate).getTime(); + }} + onChange={(val) => this.handleRangePickerChange("endDate", val)} />
} // 左侧图标 + icon={} // 左侧图标 iconBgcolor="#F14A2D" // 左侧图标背景色 showDropIcon={true} // 是否显示下拉按钮 dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同) @@ -394,7 +358,8 @@ export default class Calculate extends React.Component { {/* 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 */} {}} + onChange={v => { + }} /> {} + onCancel: () => { + } }); }}> 删除 }> - + }
@@ -308,6 +284,14 @@ export default class Attendance extends React.Component { window.open(url, "_self"); }; + handleChangeMonth = (type, val) => { + const { attendanceStore: { getAttendanceList } } = this.props; + this.listSearch.salaryYearMonth[type] = val && moment(val).format("YYYY-MM"); + !this.listSearch.salaryYearMonth[0] && (this.listSearch.salaryYearMonth[0] = moment(new Date()).startOf("year").format("YYYY-MM")); + !this.listSearch.salaryYearMonth[1] && (this.listSearch.salaryYearMonth = this.listSearch.salaryYearMonth.filter(n => n)); + getAttendanceList(this.listSearch); + }; + render() { const { attendanceStore, taxAgentStore: { showOperateBtn } } = this.props; const { modalParam } = this.state; @@ -381,18 +365,6 @@ export default class Attendance extends React.Component { link: "wui/index.html#/ns_demo03/index", importantlevel: 1 }; - const adBtn = [ - // 高级搜索内部按钮 - , - , - - ]; const topTab = [ { @@ -409,42 +381,46 @@ export default class Attendance extends React.Component { const { taxAgentStore: { showOperateBtn } } = this.props; return showOperateBtn ?
- - -
+ + + : null; }; const renderLeftOperation = () => { - const { attendanceStore: { getAttendanceList } } = this.props; return ( -
- 薪资所属月:{" "} - { - this.listSearch = { - salaryYearMonth: range.map(item => - moment(item).format("YYYY-MM") - ) - }; - getAttendanceList(this.listSearch); +
+ 薪资所属月: + { + return current && this.listSearch.salaryYearMonth[1] && current.getTime() > new Date(this.listSearch.salaryYearMonth[1]).getTime(); }} + format="YYYY-MM" + onChange={(val) => this.handleChangeMonth("0", val)} + /> + + { + return current && this.listSearch.salaryYearMonth[0] && current.getTime() < new Date(this.listSearch.salaryYearMonth[0]).getTime(); + }} + format="YYYY-MM" + onChange={(val) => this.handleChangeMonth("1", val)} />
); @@ -537,7 +513,7 @@ export default class Attendance extends React.Component { - // 导出全部 + // 导出全部 } ); default: - return
; + return
; } }; return newColumn; @@ -750,102 +728,86 @@ export default class Attendance extends React.Component { collectParams={collectParams}> } // 左侧图标 + icon={} // 左侧图标 iconBgcolor="#F14A2D" // 左侧图标背景色 showDropIcon={true} // 是否显示下拉按钮 dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同) dropMenuProps={{ collectParams }}> {this.state.tabSelectedKey == 0 ?
- { - handleTabChange(v); - }} - /> - {}} - /> - {/* */} + { + handleTabChange(v); + }} + /> + { + }} + /> - { - this.pageInfo.current = value; - this.handleDataPageChange(value); - }} - onShowSizeChange={(current, pageSize) => { - this.pageInfo = { current, pageSize }; - this.handleDataShowSizeChange(this.pageInfo); - }} - /> -
+ { + this.pageInfo.current = value; + this.handleDataPageChange(value); + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = { current, pageSize }; + this.handleDataShowSizeChange(this.pageInfo); + }} + /> +
:
- { - this.setState({ - tabSelectedKey: v - }); - }} - /> - - - { - this.pageInfo.current = value; - this.handleFieldPageChange(value); - }} - onShowSizeChange={(current, pageSize) => { - this.pageInfo = { current, pageSize }; - this.handleFieldShowSizeChange(this.pageInfo); - }} - /> - } - rightContent={ - - } - /> -
} + { + this.setState({ + tabSelectedKey: v + }); + }} + /> + { + this.pageInfo.current = value; + this.handleFieldPageChange(value); + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = { current, pageSize }; + this.handleFieldShowSizeChange(this.pageInfo); + }} + /> + } + rightContent={ + + } + /> +
} - {/* {this.state.modalVisiable && */} { this.handleInitImportModal(); @@ -875,7 +837,6 @@ export default class Attendance extends React.Component { this.handleFinish(); }} /> - {/* } */} { diff --git a/pc4mobx/hrmSalary/pages/declare/index.js b/pc4mobx/hrmSalary/pages/declare/index.js index 8f9fb104..1c9ad083 100644 --- a/pc4mobx/hrmSalary/pages/declare/index.js +++ b/pc4mobx/hrmSalary/pages/declare/index.js @@ -1,29 +1,19 @@ import React from "react"; import { inject, observer } from "mobx-react"; -import { toJS } from "mobx"; -import { Button, Table, DatePicker } from "antd"; +import { Button, DatePicker } from "antd"; -import { - WeaTop, - WeaTab, - WeaRightMenu, - WeaRangePicker, - WeaTable, - WeaDatePicker, -} from "ecCom"; +import { WeaRightMenu, WeaTop } from "ecCom"; -import { renderNoright, getSearchs } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 +import { renderNoright } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 import CustomTab from "../../components/customTab"; -import ContentWrapper from "../../components/contentWrapper"; import CustomTable from "../../components/customTable"; -import CustomPaginationTable from "../../components/customPaginationTable"; -import { columns, dataSource } from "./columns"; +import { columns } from "./columns"; import GenerateModal from "./generateModal"; import moment from "moment"; -const { RangePicker } = DatePicker; +const { MonthPicker } = DatePicker; @inject("declareStore", "taxAgentStore") @observer @@ -34,13 +24,10 @@ export default class Declare extends React.Component { value: "", selectedKey: "0", declarationModalVisible: false, - startDate: moment(new Date()) - .subtract(5, "months") - .startOf("month") - .format("YYYY-MM"), + startDate: moment(new Date()).startOf("year").format("YYYY-MM"), endDate: moment(new Date()) .startOf("month") - .format("YYYY-MM"), + .format("YYYY-MM") }; this.searchParams = { current: 1 }; this.pageInfo = { current: 1, pageSize: 10 }; @@ -52,7 +39,7 @@ export default class Declare extends React.Component { onClick={() => { window.open( "/spa/hrmSalary/static/index.html#/main/hrmSalary/generateDeclarationDetail?id=" + - record.id + record.id ); }}> 查看 @@ -66,32 +53,32 @@ export default class Declare extends React.Component { componentWillMount() { const { taxAgentStore: { getTaxAgentSelectListAsAdmin }, - declareStore: { getDeclareList }, + declareStore: { getDeclareList } } = this.props; this.searchParams = { fromSalaryMonthStr: this.state.startDate, endSalaryMonthStr: this.state.endDate, - current: 1, + current: 1 }; getDeclareList(this.searchParams); getTaxAgentSelectListAsAdmin(); } // 日期区间改变事件 - handleRangePickerChange(value) { - let range = value.map((item) => moment(item).format("YYYY-MM")); + handleRangePickerChange(type, value) { const { - declareStore: { getDeclareList }, + declareStore: { getDeclareList } } = this.props; this.setState({ - startDate: range[0], - endDate: range[1], - }); - this.pageInfo.current = 1; - getDeclareList({ - fromSalaryMonthStr: range[0], - endSalaryMonthStr: range[1], - ...this.pageInfo, + [type]: value ? moment(value).format("YYYY-MM") : moment().format("YYYY-MM") + }, () => { + this.pageInfo.current = 1; + const { startDate: fromSalaryMonthStr, endDate: endSalaryMonthStr } = this.state; + getDeclareList({ + fromSalaryMonthStr, + endSalaryMonthStr, + ...this.pageInfo + }); }); } @@ -103,7 +90,7 @@ export default class Declare extends React.Component { this.searchParams = { fromSalaryMonthStr: this.state.startDate, endSalaryMonthStr: this.state.endDate, - current: 1, + current: 1 }; getDeclareList(this.searchParams); }); @@ -111,7 +98,7 @@ export default class Declare extends React.Component { getColumns() { const { - declareStore: { listColumns }, + declareStore: { listColumns } } = this.props; let columns = [...listColumns]; columns.push({ @@ -123,37 +110,37 @@ export default class Declare extends React.Component { onClick={() => { window.open( "/spa/hrmSalary/static/index.html#/main/hrmSalary/generateDeclarationDetail?id=" + - record.id + record.id ); }}> 查看 ); - }, + } }); return columns; } handleDataPageChange(value) { const { - declareStore: { getDeclareList }, + declareStore: { getDeclareList } } = this.props; this.searchParams = { fromSalaryMonthStr: this.state.startDate, endSalaryMonthStr: this.state.endDate, - current: value, + current: value }; getDeclareList(this.searchParams); } handleShowSizeChange(pageInfo) { const { - declareStore: { getDeclareList }, + declareStore: { getDeclareList } } = this.props; this.searchParams = { fromSalaryMonthStr: this.state.startDate, endSalaryMonthStr: this.state.endDate, - ...pageInfo, + ...pageInfo }; getDeclareList(this.searchParams); } @@ -172,7 +159,7 @@ export default class Declare extends React.Component { setShowSearchAd, listDataSource, listColumns, - pageInfo, + pageInfo } = declareStore; if (!hasRight && !loading) { @@ -182,12 +169,12 @@ export default class Declare extends React.Component { const rightMenu = [ // 右键菜单 - { - key: "BTN_COLUMN", - icon: , - content: "显示列定制", - onClick: this.showColumn, - }, + // { + // key: "BTN_COLUMN", + // icon: , + // content: "显示列定制", + // onClick: this.showColumn + // } ]; const collectParams = { // 收藏功能配置 @@ -195,37 +182,35 @@ export default class Declare extends React.Component { favouritetype: 1, objid: 0, link: "wui/index.html#/ns_demo03/index", - importantlevel: 1, + importantlevel: 1 }; - const adBtn = [ - // 高级搜索内部按钮 - , - , - , - ]; - - const topTab = []; const renderRightOperation = () => { + const { startDate, endDate } = this.state; return (
- this.handleRangePickerChange(value)} + { + return current && endDate && current.getTime() > new Date(endDate).getTime(); + }} + format="YYYY-MM" + onChange={(val) => this.handleRangePickerChange("startDate", val)} + /> + + { + return current && startDate && current.getTime() < new Date(startDate).getTime(); + }} + format="YYYY-MM" + onChange={(val) => this.handleRangePickerChange("endDate", val)} /> { showOperateBtn && , , - , + ]; - const topTab = [{ + const topTab = [{ title: "工资单发放", viewcondition: "0" }, - { + { title: "工资单模板设置", viewcondition: "1" - }]; + }]; const renderRightOperation = () => { - if(this.state.selectedKey == "0") { - return
+ if (this.state.selectedKey == "0") { + return
-
- this.handleRangePickerChange(value)} +
+ { + return current && endDate && current.getTime() > new Date(endDate).getTime(); + }} + format="YYYY-MM" + onChange={(val) => this.handleRangePickerChange("startDate", val)} + /> + + { + return current && startDate && current.getTime() < new Date(startDate).getTime(); + }} + format="YYYY-MM" + onChange={(val) => this.handleRangePickerChange("endDate", val)} />
-
- } else if(this.state.selectedKey == "1") { +
; + } else if (this.state.selectedKey == "1") { return ( -
+
{ - showOperateBtn && - + showOperateBtn && + } { - this.state.initSelected && {this.handleTemplateSelectChange(value)}}/> + this.state.initSelected && { + this.handleTemplateSelectChange(value); + }}/> } - - {this.setState({templateSearchValue: value})}} onSearch={(value) => {this.handleTemplateSearch(value)}}/> + + { + this.setState({ templateSearchValue: value }); + }} onSearch={(value) => { + this.handleTemplateSearch(value); + }}/>
- ) + ); } - } - + }; + const steps = [ "基础设置", "显示设置" - ] + ]; const validateStep1 = () => { - const { payrollStore: {templateBaseData}} = this.props; - if(!notNull(templateBaseData.name)) { - message.warning("工资单模板名称不能为空") - return false + const { payrollStore: { templateBaseData } } = this.props; + if (!notNull(templateBaseData.name)) { + message.warning("工资单模板名称不能为空"); + return false; } - if(!notNull(templateBaseData.salarySob)) { - message.warning("薪资账套不能为空") + if (!notNull(templateBaseData.salarySob)) { + message.warning("薪资账套不能为空"); return false; } return true; - } - const nextStep = () => { - if(!validateStep1()) { - return + }; + const nextStep = () => { + if (!validateStep1()) { + return; } this.setState({ currentStep: this.state.currentStep + 1 - }) - } + }); + }; // 上一步 const prevStep = () => { this.setState({ currentStep: this.state.currentStep - 1 - }) - } + }); + }; return (
@@ -334,137 +376,164 @@ export default class Payroll extends React.Component { > } // 左侧图标 - iconBgcolor='#F14A2D' // 左侧图标背景色 + icon={} // 左侧图标 + iconBgcolor="#F14A2D" // 左侧图标背景色 showDropIcon={true} // 是否显示下拉按钮 dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同) dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 > - { - this.setState({selectedKey: v}) + { + this.setState({ selectedKey: v }); + }} + /> + { + this.state.selectedKey == 0 && + { + this.handleTemplateListEdit(record); + }} + salaryYearMonth={this.salaryYearMonth} + handleListDataPageChange={(value, pageInfo) => { + this.handleListDataPageChange(value, pageInfo); + }} + handleListShowSizeChange={(pageInfo) => { + this.handleListShowSizeChange(pageInfo); }} /> - { - this.state.selectedKey == 0 && - { - this.handleTemplateListEdit(record) - }} - salaryYearMonth={this.salaryYearMonth} - handleListDataPageChange={(value, pageInfo) => { - this.handleListDataPageChange(value, pageInfo) - }} - handleListShowSizeChange={(pageInfo) => { - this.handleListShowSizeChange(pageInfo) - }} - /> - - // - } - { - this.state.selectedKey == 1 && - { - this.handleTemplateListEdit(record) - }} - onCopy={(record) => { - this.handleTemplateListCopy(record) - }} - showOperateBtn={showOperateBtn} - onDelete={(record)=> this.handleTemplateListDelete(record)} - /> - } + // + } + + { + this.state.selectedKey == 1 && + { + this.handleTemplateListEdit(record); + }} + onCopy={(record) => { + this.handleTemplateListCopy(record); + }} + showOperateBtn={showOperateBtn} + onDelete={(record) => this.handleTemplateListDelete(record)} + /> + } { - this.state.stepSlideVisible && {this.setState({stepSlideVisible: false})}} - customOperate = { -
+ this.state.stepSlideVisible && { + this.setState({ stepSlideVisible: false }); + }} + customOperate={ +
{ - currentStep == 0 && + currentStep == 0 && } { - currentStep == 1 &&
- - - -
+ currentStep == 1 &&
+ + + +
} -
- } - title="新建工资单模板" - content={ -
- { - currentStep == 0 && {this.handleBaseInfoChange(request)}}/> - } - { - currentStep == 1 && - } -
- - } - /> - } +
+ } + title="新建工资单模板" + content={ +
+ { + currentStep == 0 && { + this.handleBaseInfoChange(request); + }}/> + } + { + currentStep == 1 && + } +
- { - this.state.editSlideVisible && - + } + /> + } + + { + this.state.editSlideVisible && + { - selectedTab == 0 && + selectedTab == 0 && } - { - selectedTab == 1 && - - - + { + selectedTab == 1 && + + + - } + } } - subItemChange={ - (item) => {this.setState({selectedTab: item.key})} - } - /> - } - content={
- { - selectedTab == 0 && {this.handleBaseInfoChange(request)}}/> - } - { - selectedTab == 1 && - } -
} - onClose={() => this.setState({editSlideVisible: false})} - showMask={true} - closeMaskOnClick={() => this.setState({editSlideVisible: false})} /> - } - { - this.state.copyModalVisible && this.handleCopyModalSave(value)} visible={this.state.copyModalVisible} onCancel={() => {this.setState({copyModalVisible: false})}}/> - } + subItemChange={ + (item) => { + this.setState({ selectedTab: item.key }); + } + } + /> + } + content={
+ { + selectedTab == 0 && + { + this.handleBaseInfoChange(request); + }}/> + } + { + selectedTab == 1 && + } +
} + onClose={() => this.setState({ editSlideVisible: false })} + showMask={true} + closeMaskOnClick={() => this.setState({ editSlideVisible: false })}/> + } + { + this.state.copyModalVisible && + this.handleCopyModalSave(value)} visible={this.state.copyModalVisible} + onCancel={() => { + this.setState({ copyModalVisible: false }); + }}/> + }
- ) + ); } } diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index e6326c3f..7a282517 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -117,7 +117,7 @@ export default class Archives extends React.Component { handleImport(params) { const { archivesStore: {importBatch, initImportParams}} = this.props; importBatch(params) - + } // 导入完成 @@ -144,19 +144,19 @@ export default class Archives extends React.Component { // 关闭导入框 handleImportCancel() { const { archivesStore: {initImportParams, getTableDatas }} = this.props; - - initImportParams() + + initImportParams() if(this.state.step == 2) { getTableDatas() } - this.setState({importVisible: false, step: 0}); + this.setState({importVisible: false, step: 0}); } handleSearch() { const { archivesStore: {getTableDatas}} = this.props; getTableDatas({...this.pageInfo, current: 1}) } - + render() { const { archivesStore, taxAgentStore: { showOperateBtn } } = this.props; const { selectedTab, selectedRowKeys } = this.state; @@ -169,12 +169,12 @@ export default class Archives extends React.Component { } const rightMenu = [// 右键菜单 - { - key: 'BTN_COLUMN', - icon: , - content: '显示列定制', - onClick: this.showColumn - }, + // { + // key: 'BTN_COLUMN', + // icon: , + // content: '显示列定制', + // onClick: this.showColumn + // }, ]; const collectParams = { // 收藏功能配置 favname: '社保福利档案', @@ -246,7 +246,7 @@ export default class Archives extends React.Component { dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 buttons={showOperateBtn ? btns : []} > - + */} - { - this.state.editSlideVisible && + this.state.editSlideVisible && } - +
} onClose={() => this.setState({editSlideVisible: false})} showMask={true} closeMaskOnClick={() => this.setState({editSlideVisible: false})} /> } { - this.state.importVisible && { this.handleInitModal() }} @@ -347,11 +347,11 @@ export default class Archives extends React.Component { previewImport={(params) => {this.handlePreviewImport(params)}} importFile={(params) => {this.handleImport(params);}} templateLink={() => {this.handleTemplateLinkClick()}} - visiable={this.state.importVisible} + visiable={this.state.importVisible} onCancel={() => { this.handleImportCancel() - - }} + + }} /> }
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js index b798750e..7bb05678 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js @@ -1,23 +1,22 @@ import React from "react"; import { inject, observer } from "mobx-react"; -import { toJS } from "mobx"; -import { Button, Table, Dropdown, Menu, Modal, message, Spin } from "antd"; +import { Button, DatePicker, Dropdown, Menu, message, Modal } from "antd"; -import { WeaTop, WeaTab, WeaRightMenu, WeaDatePicker, WeaTable } from "ecCom"; +import { WeaRightMenu, WeaTop } from "ecCom"; -import { renderNoright, getSearchs } from "../../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 -import CustomTab from "../../../components/customTab"; -import ContentWrapper from "../../../components/contentWrapper"; +import { renderNoright } from "../../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 import Accountdialog from "./components/accountDialog"; import AbnormalDrawer from "./components/abnormalDrawer"; -import CustomPaginationTable from '../../../components/customPaginationTable' +import CustomPaginationTable from "../../../components/customPaginationTable"; import moment from "moment"; import _ from "lodash"; // import { columns, dataSource } from './columns'; import "./index.less"; +const MonthPicker = DatePicker.MonthPicker; + @inject("standingBookStore", "taxAgentStore") @observer export default class StandingBook extends React.Component { @@ -27,8 +26,8 @@ export default class StandingBook extends React.Component { value: "", selectedKey: "0", tableParams: { - startTime: moment(new Date()).subtract(5,'months').startOf('month').format('YYYY-MM'), - endTime: moment(new Date()).startOf('month').format('YYYY-MM') + startTime: moment(new Date()).startOf("year").format("YYYY-MM"), + endTime: moment(new Date()).startOf("month").format("YYYY-MM") }, current: 1, dialogProps: { @@ -39,64 +38,74 @@ export default class StandingBook extends React.Component { }, drawerProps: { title: "", - visible: false, + visible: false }, tableData: { list: [], columns: [], - total: 0, + total: 0 }, dbnormalTableData: { list: [], - total: 0, + total: 0 }, adminData: {} }; - this.payload = {} - this.pageInfo = {current: 1, pageSize: 10} + this.payload = {}; + this.pageInfo = { current: 1, pageSize: 10 }; } componentDidMount() { + this.init(); + } + + init = () => { const { current, dialogProps } = this.state; - - const { taxAgentStore: {getPermission, fetchTaxAgentOption}, standingBookStore: {getAdminTaxAgentList}} = this.props - getPermission().then(({status, data}) => { - if(status) { - this.setState({adminData : data}) - if(data.isOpenDevolution) { + const { + taxAgentStore: { getPermission, fetchTaxAgentOption }, + standingBookStore: { getAdminTaxAgentList } + } = this.props; + getPermission().then(({ status, data }) => { + if (status) { + this.setState({ adminData: data }); + if (data.isOpenDevolution) { getAdminTaxAgentList().then((data) => { let taxAgentList = data.map(item => { - let result = {} - result.showname = item.name - result.key = item.id + "" - result.selected = false - return result - }) - this.setState({dialogProps: { - ...dialogProps, - options: taxAgentList, - isAdmin: true - }}) - }) - }else{ - fetchTaxAgentOption().then(({data}) => { + let result = {}; + result.showname = item.name; + result.key = item.id + ""; + result.selected = false; + return result; + }); + this.setState({ + dialogProps: { + ...dialogProps, + options: taxAgentList, + isAdmin: true + } + }); + }); + } else { + fetchTaxAgentOption().then(({ data }) => { let taxAgentList = data.map(item => { - let result = {} - result.showname = item.content - result.key = item.id + "" - result.selected = false - return result - }) - this.setState({dialogProps: { - ...dialogProps, - options: taxAgentList, - }}) - }) + let result = {}; + result.showname = item.content; + result.key = item.id + ""; + result.selected = false; + return result; + }); + this.setState({ + dialogProps: { + ...dialogProps, + options: taxAgentList + } + }); + }); } this.getCommonList({ ...this.state.tableParams, current }); } - }) - } + }); + }; getCommonList = (payload = {}) => { const { getCommonList } = this.props.standingBookStore; @@ -115,7 +124,7 @@ export default class StandingBook extends React.Component { {text} ); - }, + } }; } return { ...it }; @@ -129,18 +138,25 @@ export default class StandingBook extends React.Component { title: "操作", dataIndex: "action", key: "action", - fixed: 'right', + fixed: "right", render: (text, r) => { const { billStatus, billMonth } = r; return ( {billStatus === "未归档" && ( this.handleGoDetail(billMonth, "", r.paymentOrganizationId)}> - {" "} - 核算{" "} + 核算 + + )} + {billStatus === "已归档" && ( + this.socialSecurityBenefitsRecalculate({ id: r.id })}> + 重新核算 )} {billStatus === "未归档" && ( @@ -156,7 +172,7 @@ export default class StandingBook extends React.Component { {/* 操作日志 */} }> - + )} {billStatus === "已归档" && ( @@ -164,56 +180,66 @@ export default class StandingBook extends React.Component { overlay={ - this.handleOperate({ key, billMonth, paymentOrganizationId: r.paymentOrganizationId}) + this.handleOperate({ key, billMonth, paymentOrganizationId: r.paymentOrganizationId }) }> 查看 {/* 操作日志 */} }> - + )} ); - }, - } : {}, + } + } : {} ], - total, + total }, - current: pageNum, + current: pageNum }); }); }; + socialSecurityBenefitsRecalculate = (params) => { + const { socialSecurityBenefitsRecalculate } = this.props.standingBookStore; + socialSecurityBenefitsRecalculate(params).then(() => { + message.success("重新核算成功"); + this.init(); + }).catch(err => { + message.error(err); + }); + }; + // 异常详情列表 inspectList = (payload) => { const { inspectList } = this.props.standingBookStore; this.payload = payload; - inspectList({ ...payload }).then(({list, total}) => { + inspectList({ ...payload }).then(({ list, total }) => { this.setState({ dbnormalTableData: { list, total } - }) + }); }); }; // 异常详情分页回调 handlePageChange(value) { - const { inspectList} = this.props.standingBookStore; - inspectList({ ...this.payload, current: value }).then(({list, total}) => { + const { inspectList } = this.props.standingBookStore; + inspectList({ ...this.payload, current: value }).then(({ list, total }) => { this.setState({ dbnormalTableData: { list, total } - }) + }); }); } handleGoDetail = (billMonth, detail, paymentOrganization) => { - if(detail) { + if (detail) { window.open( `/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?type=${detail}&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}` ); @@ -222,13 +248,13 @@ export default class StandingBook extends React.Component { `/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}` ); } - + setTimeout(() => { this.getCommonList({ ...this.state.tableParams, - current: this.state.current, + current: this.state.current }); - }, 3000) + }, 3000); }; handleOperate = (payload) => { const { siaccountFile, siaccountDelete, deleteLoading } = @@ -245,7 +271,8 @@ export default class StandingBook extends React.Component { this.getCommonList({ ...this.state.tableParams, current }); }); }, - onCancel: () => {}, + onCancel: () => { + } }); break; case "detail": @@ -254,8 +281,8 @@ export default class StandingBook extends React.Component { drawerProps: { ...this.state.drawerProps, title: "核算异常", - visible: true, - }, + visible: true + } }); break; case "delete": @@ -268,11 +295,12 @@ export default class StandingBook extends React.Component { message.success("删除成功"); this.getCommonList({ ...this.state.tableParams, - current: this.state.current, + current: this.state.current }); }); }, - onCancel: () => {}, + onCancel: () => { + } }); break; case "view": @@ -288,14 +316,14 @@ export default class StandingBook extends React.Component { console.log("extra:", extra); const payload = { billMonth: moment(billMonth).format("YYYY-MM"), - ...extra, + ...extra }; save(payload).then(() => { message.success("核算成功"); this.handleClose(); this.getCommonList({ ...this.state.tableParams, - current: this.state.current, + current: this.state.current }); this.handleGoDetail(moment(billMonth).format("YYYY-MM"), "", extra.paymentOrganization ? extra.paymentOrganization : ""); }); @@ -306,8 +334,8 @@ export default class StandingBook extends React.Component { dialogProps: { ...this.state.dialogProps, title: "", - visible: false, - }, + visible: false + } }); }; @@ -315,29 +343,29 @@ export default class StandingBook extends React.Component { this.setState({ tableParams: { ...this.state.tableParams, - [type]: val, - }, + [type]: val && moment(val).format("YYYY-MM") + } }); this.getCommonList({ ...this.state.tableParams, - [type]: val, - current: this.state.current, + [type]: val && moment(val).format("YYYY-MM"), + current: this.state.current }); }; handlePageChange(value) { - this.setState({current: value}) + this.setState({ current: value }); this.pageInfo.current = value; this.getCommonList({ ...this.state.tableParams, - ...this.pageInfo, + ...this.pageInfo }); } handleShowSizeChange(pageInfo) { this.getCommonList({ ...this.state.tableParams, - ...pageInfo, + ...pageInfo }); } @@ -353,7 +381,7 @@ export default class StandingBook extends React.Component { showSearchAd, getTableDatas, doSearch, - setShowSearchAd, + setShowSearchAd } = standingBookStore; const { list, columns, total } = this.state.tableData; const { startTime, endTime } = this.state.tableParams; @@ -376,8 +404,8 @@ export default class StandingBook extends React.Component { dialogProps: { ...this.state.dialogProps, title: "核算", - visible: true, - }, + visible: true + } }); }}> 核算 @@ -385,12 +413,12 @@ export default class StandingBook extends React.Component { ]; const rightMenu = [ // 右键菜单 - { - key: "BTN_COLUMN", - icon: , - content: "显示列定制", - onClick: this.showColumn, - }, + // { + // key: "BTN_COLUMN", + // icon: , + // content: "显示列定制", + // onClick: this.showColumn, + // }, ]; const collectParams = { // 收藏功能配置 @@ -398,38 +426,7 @@ export default class StandingBook extends React.Component { favouritetype: 1, objid: 0, link: "wui/index.html#/ns_demo03/index", - importantlevel: 1, - }; - const adBtn = [ - // 高级搜索内部按钮 - , - , - , - ]; - - const topTab = []; - - const renderSearchOperationItem = () => { - return
; - }; - - const pagination = { - total, - current: this.state.current, - showTotal: (total) => `共 ${total} 条`, - onChange: (current) => { - this.setState({ current }); - this.getCommonList({ - ...this.state.tableParams, - current, - }); - }, + importantlevel: 1 }; return ( @@ -440,7 +437,7 @@ export default class StandingBook extends React.Component { > } // 左侧图标 + icon={} // 左侧图标 iconBgcolor="#F14A2D" // 左侧图标背景色 buttons={showOperateBtn ? rightBtns : []} // showDropIcon={true} // 是否显示下拉按钮 @@ -449,37 +446,43 @@ export default class StandingBook extends React.Component { >
账单月份:
- { + return current && endTime && current.getTime() > new Date(endTime).getTime(); + }} onChange={(val) => this.handleChangeMonth("startTime", val)} /> - { + return current && startTime && current.getTime() < new Date(startTime).getTime(); + }} onChange={(val) => this.handleChangeMonth("endTime", val)} />
- it.dataIndex !== "id").map(item => { - item.width = "150px" - if(item.dataIndex ==='billMonth') item.fixed= 'left'; - return item + item.width = "150px"; + if (item.dataIndex === "billMonth") item.fixed = "left"; + return item; })} dataSource={list} total={total} current={this.state.current} pageSize={this.pageInfo.pageSize} onPageChange={(value) => { - this.handlePageChange(value) + this.handlePageChange(value); }} onShowSizeChange={(current, pageSize) => { - this.pageInfo = {current, pageSize} - this.handleShowSizeChange(this.pageInfo) + this.pageInfo = { current, pageSize }; + this.handleShowSizeChange(this.pageInfo); }} - scroll={{x: 2300}} + scroll={{ x: 2300 }} /> {dialogProps.visible && ( @@ -498,14 +501,16 @@ export default class StandingBook extends React.Component { drawerProps: { ...this.state.drawerProps, title: "", - visible: false, - }, + visible: false + } }); }} columns={abnormalColumns} dataSource={this.state.dbnormalTableData.list} total={this.state.dbnormalTableData.total} - onPageChange={(value) => {this.handlePageChange(value)}} + onPageChange={(value) => { + this.handlePageChange(value); + }} // onOk={this.handleOk} loading={inspectLoading} /> diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js index 88bb497b..630b7ac7 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js @@ -11,6 +11,7 @@ import { toJS } from "mobx"; import { WeaDialog, WeaInputSearch, WeaTable } from "ecCom"; import { getSearchs } from "../../../../util"; import { getQueryString } from "../../../../util/url"; +import ProgressModal from "../../../../components/progressModal"; import _ from "lodash"; import "./index.less"; @@ -22,6 +23,7 @@ export default class NormalIndex extends Component { this.state = { date: "", current: 1, + pageSize: 10, selectedRowKeys: [], addProps: { title: "", @@ -32,8 +34,11 @@ export default class NormalIndex extends Component { columns: [], total: 0 }, - searchValue: "" + searchValue: "", + progressVisible: false, + progress: 0 }; + this.timer = null; } componentDidMount() { @@ -44,6 +49,13 @@ export default class NormalIndex extends Component { : this.getSupplementaryList({ billMonth, current, paymentOrganization }); } + componentWillUnmount() { + // 清除轮询 + if (this.timer) { + clearInterval(this.timer); + } + } + componentWillReceiveProps(nextProps) { if (nextProps.selectedKey != this.props.selectedKey) { const { billMonth, paymentOrganization } = nextProps; @@ -290,25 +302,42 @@ export default class NormalIndex extends Component { // 核算按钮点击 handleCommonAccountClick() { - const { remarks, billMonth, selectedKey, paymentOrganization } = this.props; + const { billMonth, selectedKey, paymentOrganization } = this.props; const { commonAccount } = this.props.standingBookStore; commonAccount({ billMonth, paymentOrganization, includes: [] }).then(() => { - message.success("核算成功"); - selectedKey === "1" - ? this.getNormalList({ - billMonth, - paymentOrganization, - current: this.state.current - }) - : this.getSupplementaryList({ - billMonth, - paymentOrganization, - current: this.state.current - }); + this.setState({ + progressVisible: true + }, () => { + this.timer = setInterval(() => { + if (this.state.progress !== 100) { + this.setState({ + progress: this.state.progress + 20 + }); + } else { + clearInterval(this.timer); + message.success("核算成功"); + this.setState({ + progressVisible: false, + progress: 0 + }); + selectedKey === "1" + ? this.getNormalList({ + billMonth, + paymentOrganization, + current: this.state.current + }) + : this.getSupplementaryList({ + billMonth, + paymentOrganization, + current: this.state.current + }); + } + }, 800); + }); }); } @@ -341,13 +370,31 @@ export default class NormalIndex extends Component { total, current: this.state.current, showTotal: total => `共 ${total} 条`, - onChange: current => { - this.setState({ current }); + showSizeChanger: true, + showQuickJumper: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ current, pageSize }); selectedKey === "1" - ? this.getNormalList({ billMonth, current, paymentOrganization }) + ? this.getNormalList({ billMonth, current, pageSize, paymentOrganization }) : this.getSupplementaryList({ billMonth, current, + pageSize, + paymentOrganization + }); + }, + onChange: current => { + this.setState({ current }); + selectedKey === "1" + ? this.getNormalList({ + billMonth, current, + pageSize: this.state.pageSize, paymentOrganization + }) + : this.getSupplementaryList({ + billMonth, + current, + pageSize: this.state.pageSize, paymentOrganization }); } @@ -423,6 +470,14 @@ export default class NormalIndex extends Component { {selectedKey === "1" && this.props.type !== "detail" && } + {/*核算进度条*/} + { + this.setState({ progressVisible: false, progress: 0 }); + }} + progress={this.state.progress} + /> diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js index db56d265..657503f7 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js @@ -17,6 +17,8 @@ export default class OverViewIndex extends Component { super(props); this.state = { selectedRowKeys: [], + current: 1, + pageSize: 10, tableData: { list: [], columns: [], @@ -77,11 +79,22 @@ export default class OverViewIndex extends Component { const pagination = { total, showTotal: (total) => `共 ${total} 条`, - onShowSizeChange(current, pageSize) { - console.log("Current: ", current, "; PageSize: ", pageSize); + showSizeChanger: true, + showQuickJumper: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ current, pageSize }); + this.getOverViewList({ + billMonth, current, + pageSize, paymentOrganization + }); }, - onChange(current) { - console.log("Current: ", current); + onChange: (current) => { + this.setState({ current }); + this.getOverViewList({ + billMonth, current, + pageSize: this.state.pageSize, paymentOrganization + }); } }; return ( diff --git a/pc4mobx/hrmSalary/stores/StandingBook.js b/pc4mobx/hrmSalary/stores/StandingBook.js index 959874e9..0c836002 100644 --- a/pc4mobx/hrmSalary/stores/StandingBook.js +++ b/pc4mobx/hrmSalary/stores/StandingBook.js @@ -4,7 +4,7 @@ import { WeaForm, WeaTableNew } from "comsMobx"; import { removePropertyCondition } from "../util/response"; import _ from "lodash"; -import * as API from "../apis/standingBook"; // 引入API接口文件 +import * as API from "../apis/standingBook"; const { TableStore } = WeaTableNew; @@ -362,7 +362,19 @@ export class StandingBookStore { } }) }) - + } + + @action("社保福利台账重新核算") + socialSecurityBenefitsRecalculate = (params) => { + return new Promise((resolve, reject) => { + API.socialSecurityBenefitsRecalculate(params).then(res => { + if(res.status) { + resolve(); + } else { + reject(res.errormsg || "接口调用失败!"); + } + }) + }) } // 获取当前管理员下的所有个税扣缴义务人