diff --git a/pc4mobx/hrmSalary/apis/datapush.js b/pc4mobx/hrmSalary/apis/datapush.js index 3b2adc5c..27d73608 100644 --- a/pc4mobx/hrmSalary/apis/datapush.js +++ b/pc4mobx/hrmSalary/apis/datapush.js @@ -24,3 +24,11 @@ export const savePushItemList = (params) => { export const deletePushItemList = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/push/item/delete", "GET", params); }; +// 推送记录列表 +export const getPushRecordList = (params) => { + return postFetch("/api/bs/hrmsalary/push/record/list", params); +}; +// 推送记录详细列表 +export const getPushRecordDetail = (params) => { + return postFetch("/api/bs/hrmsalary/push/record/detail", params); +}; diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index 5182ea00..9d0f9f46 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -15,10 +15,18 @@ export const getTabList = (params) => { export const getNormalList = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/detail/common/list", params); }; +//社会福利台账-获取正常缴纳列表合计行 +export const getNormalListSum = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/detail/common/list/sum", params); +}; //社会福利台账-获取补缴列表 export const getSupplementaryList = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/detail/supplementary/list", params); }; +//社会福利台账-获取补缴列表合计 +export const getSupplementaryListSum = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/detail/supplementary/list/sum", params); +}; //社会福利台账-获取总览列表 export const getOverViewList = (params) => { @@ -122,10 +130,18 @@ export const saveRecession = (params) => { export const recessionList = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/detail/recession/list", params); }; +//查询退差列表合计行 +export const recessionListSum = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/detail/recession/list/sum", params); +}; //查询补差列表 export const balanceList = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/detail/balance/list", params); }; +//查询补差列表合计行 +export const balanceListSum = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/detail/balance/list/sum", params); +}; //删除退差数据 export const delRecession = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/delRecession", params); @@ -205,3 +221,11 @@ export const cacheWelfareListField = (params) => { export const cacheBalanceWelfareList = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/cacheBalanceWelfareList", params); }; +// 社保福利台账正常缴纳-增加人员并核算 +export const addSocialAcctEmp = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/addSocialAcctEmp", params); +}; +// 社保福利台账正常缴纳-增加人员并核算 +export const deleteSocialAcctEmp = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/deleteSocialAcctEmp", params); +}; diff --git a/pc4mobx/hrmSalary/components/PersonalScopeTable/index.js b/pc4mobx/hrmSalary/components/PersonalScopeTable/index.js index d8824c8b..a053cfa7 100644 --- a/pc4mobx/hrmSalary/components/PersonalScopeTable/index.js +++ b/pc4mobx/hrmSalary/components/PersonalScopeTable/index.js @@ -95,7 +95,7 @@ class PersonalScopeTable extends Component { render() { const { dataSource, columns, pageInfo, loading, selectedRowKeys } = this.state; - const { onChangeSelectKey } = this.props; + const { onChangeSelectKey, showOperateBtn } = this.props; const pagination = { ...pageInfo, showTotal: total => `共 ${total} 条`, @@ -128,7 +128,7 @@ class PersonalScopeTable extends Component { return ( !!o), "pc"); return (
-
+
{theme || ""}
diff --git a/pc4mobx/hrmSalary/components/pcTemplate/index.less b/pc4mobx/hrmSalary/components/pcTemplate/index.less index 4f834426..6ea7eaa5 100644 --- a/pc4mobx/hrmSalary/components/pcTemplate/index.less +++ b/pc4mobx/hrmSalary/components/pcTemplate/index.less @@ -155,13 +155,14 @@ .item-count { //flex-basis: 328px; flex: 1; - padding-left: 16px; + padding: 12px 16px; height: 100%; - line-height: 40px; background: #fff; font-size: 12px; color: #5F5F5F; word-break: break-all; + display: flex; + align-items: center; } } } diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js index 63108170..80f7e4dd 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js @@ -153,6 +153,36 @@ export const salaryDetailSearchConditions = [ multiple: true, viewAttr: 2 }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "17", + viewAttr: 2 + }, + colSpan: 1, + conditionType: "BROWSER", + domkey: ["employeeIds"], + fieldcol: 16, + label: getLabel(111, "人员"), + labelcol: 8, + viewAttr: 2 + }, { browserConditionParam: { completeParams: {}, diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js index e791e76e..1893e77e 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js @@ -109,12 +109,13 @@ class SalaryDetails extends Component { getSalaryList = (props) => { const { attendanceStore: { salaryDetailSearchForm, tableStore }, dateRange } = props || this.props; const [startDateStr, endDateStr] = dateRange; - const { taxAgentIds, subcompanyIds, departmentIds, ...extra } = salaryDetailSearchForm.getFormParams(); + const { taxAgentIds, subcompanyIds, departmentIds, employeeIds, ...extra } = salaryDetailSearchForm.getFormParams(); const { pageInfo, transferDialog, updateSum } = this.state; const payload = { taxAgentIds: taxAgentIds ? taxAgentIds.split(",") : [], departmentIds: departmentIds ? departmentIds.split(",") : [], subcompanyIds: subcompanyIds ? subcompanyIds.split(",") : [], + employeeIds: employeeIds ? employeeIds.split(",") : [], ...extra, ...pageInfo, startDateStr, endDateStr }; this.setState({ loading: true }); diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less index 7d481333..1b5c5dc5 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less @@ -182,7 +182,7 @@ } .wea-advanced-searchsAd { - height: 155px; + height: 200px; overflow: hidden auto; .formItem-delete { diff --git a/pc4mobx/hrmSalary/pages/appConfig/index.js b/pc4mobx/hrmSalary/pages/appConfig/index.js index aee9eb68..e13000eb 100644 --- a/pc4mobx/hrmSalary/pages/appConfig/index.js +++ b/pc4mobx/hrmSalary/pages/appConfig/index.js @@ -94,8 +94,8 @@ class AppConfig extends Component { } = this.state; const btns = [ , - // , - // + , + ]; const items = [ { diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js index 9da20706..5deeaecd 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js @@ -91,7 +91,7 @@ class EditSalaryCalcSlide extends Component { save = () => { const { id: salaryAcctEmpId } = this.props; const { issuedAndReissueItems, itemsByGroup, baseInfo } = this.state; - if (_.every(baseInfo, it => !it.canEdit || (it.canEdit && !it.fieldValue))) { + if (!_.every(baseInfo, (item) => (!item.canEdit || !!item.fieldValue))) { Modal.warning({ title: getLabel(131329, "信息确认"), content: getLabel(518702, "必要信息不完整,红色*为必填项!") diff --git a/pc4mobx/hrmSalary/pages/datapush/components/pushRecord/index.js b/pc4mobx/hrmSalary/pages/datapush/components/pushRecord/index.js new file mode 100644 index 00000000..f73e220b --- /dev/null +++ b/pc4mobx/hrmSalary/pages/datapush/components/pushRecord/index.js @@ -0,0 +1,86 @@ +/* + * 数据推送 + * 推送记录 + * @Author: 黎永顺 + * @Date: 2025/4/1 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; +import * as API from "../../../../apis/datapush"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + columns: [], dataSource: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, + selectedRowKeys: [] + }; + } + + componentDidMount() { + this.getPushRecordList(); + } + + componentWillUnmount() { + this.setState({ selectedRowKeys: [] }); + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.isQuery !== this.props.isQuery) this.setState({ + pageInfo: { ...this.state.pageInfo, current: 1 } + }, () => this.getPushRecordList(nextProps)); + } + + getPushRecordList = (props) => { + const { pageInfo } = this.state, { query } = props || this.props; + const payload = { ...pageInfo, ...query }; + this.setState({ loading: true }); + API.getPushRecordList(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + pageInfo: { ...pageInfo, current, pageSize, total }, dataSource, + columns: [...columns, { + title: getLabel(111, "操作"), dataIndex: "opts", width: 120, render: (__, record) => ( + this.props.onChange("push", record)}>{getLabel(111, "推送")} + this.props.onChange("view", record)}>{getLabel(111, "查看详情")} + ) + }] + }); + } + }); + }; + + render() { + const { columns, dataSource, loading, pageInfo, selectedRowKeys } = this.state; + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.getPushRecordList()); + }, + onChange: current => { + this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getPushRecordList()); + } + }; + const rowSelection = { + selectedRowKeys, + onChange: v => this.setState({ selectedRowKeys: v }) + }; + return (); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/datapush/components/pushRecord/pushDetailDialog.js b/pc4mobx/hrmSalary/pages/datapush/components/pushRecord/pushDetailDialog.js new file mode 100644 index 00000000..554cfc70 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/datapush/components/pushRecord/pushDetailDialog.js @@ -0,0 +1,77 @@ +/* + * 推送记录 + * 查看详情 + * @Author: 黎永顺 + * @Date: 2025/4/2 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaInputSearch, WeaLocaleProvider, WeaSlideModal, WeaTable, WeaTop } from "ecCom"; +import { getPushRecordDetail } from "../../../../apis/datapush"; + +const getLabel = WeaLocaleProvider.getLabel; + +class PushDetailDialog extends Component { + constructor(props) { + super(props); + this.state = { + query: { name: "" }, dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getPushRecordDetail(nextProps); + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ + query: { name: "" }, pageInfo: { current: 1, pageSize: 10, total: 0 } + }); + } + + getPushRecordDetail = (props) => { + const { recordId } = props || this.props, { pageInfo, query } = this.state; + const payload = { ...query, ...pageInfo, recordId }; + this.setState({ loading: true }); + getPushRecordDetail(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ columns, dataSource, pageInfo: { current, pageSize, total } }); + } + }); + }; + + render() { + const { query, loading, dataSource, columns, pageInfo } = this.state; + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.getPushRecordDetail()); + }, + onChange: current => { + this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getPushRecordDetail()); + } + }; + return (} iconBgcolor="#F14A2D" + buttons={[ this.setState({ + pageInfo: { ...pageInfo, current: 1 } + }, () => this.getPushRecordDetail())} + onChange={v => this.setState({ query: { ...query, name: v } })}/>]}/> + } + direction="right" top={0} width={800} height={100} + measureT="%" measureX="px" measureY="%" + content={
+ +
} + />); + } +} + +export default PushDetailDialog; diff --git a/pc4mobx/hrmSalary/pages/datapush/index.js b/pc4mobx/hrmSalary/pages/datapush/index.js index 1bbf5add..bdabd479 100644 --- a/pc4mobx/hrmSalary/pages/datapush/index.js +++ b/pc4mobx/hrmSalary/pages/datapush/index.js @@ -12,8 +12,11 @@ import { inject, observer } from "mobx-react"; import { WeaInputSearch, WeaLocaleProvider, WeaReqTop } from "ecCom"; import * as API from "../../apis/datapush"; import DatapushList from "./components/datapushList"; +import PushRecord from "./components/pushRecord"; import DatapushDialog from "./components/DPDialog"; +import PushDetailDialog from "./components/pushRecord/pushDetailDialog"; import { Button, message, Modal } from "antd"; +import cs from "classnames"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; @@ -25,7 +28,8 @@ class Index extends Component { super(props); this.state = { selectedKey: "datapush", isQuery: false, query: { name: "" }, - DPDialog: { visible: false, title: "", detail: {} } //数据推送弹框 + DPDialog: { visible: false, title: "", detail: {} }, //数据推送弹框 + pushDetailDialog: { visible: false, recordId: "" } //数据推送记录查看推送详情弹框 }; } @@ -53,13 +57,16 @@ class Index extends Component { } }); break; + case "view": + this.setState({ pushDetailDialog: { visible: true, recordId: detail.id } }); + break; default: break; } }; render() { - const { selectedKey, DPDialog, isQuery, query } = this.state; + const { selectedKey, DPDialog, isQuery, query, pushDetailDialog } = this.state; const { taxAgentStore: { PageAndOptAuth } } = this.props; const showOperateBtn = PageAndOptAuth.opts.includes("admin"); const tabs = [ @@ -72,14 +79,28 @@ class Index extends Component { ] : [ this.setState({ query: { ...query, name: v } })}/>], children: + }, + { + title: getLabel(111, "推送记录"), key: "pushRecord", showDropIcon: false, dropMenuDatas: [], + buttons: showOperateBtn ? [ + , + this.setState({ query: { ...query, name: v } })}/> + ] : [ this.setState({ query: { ...query, name: v } })}/>], + children: } ]; return ( } selectedKey={selectedKey} - iconBgcolor="#F14A2D" tabDatas={tabs} className="datapush_wrapper" buttonSpace={10} - buttons={_.find(tabs, o => selectedKey === o.key).buttons} - onChange={selectedKey => this.setState({ selectedKey })} + iconBgcolor="#F14A2D" tabDatas={tabs} + className={cs("datapush_wrapper", { "reqZindex0": pushDetailDialog.visible })} + buttonSpace={10} buttons={_.find(tabs, o => selectedKey === o.key).buttons} + onChange={selectedKey => this.setState({ + selectedKey, pushDetailDialog: { ...pushDetailDialog, visible: false }, + DPDialog: { ...DPDialog, visible: false } + })} showDropIcon={_.find(tabs, o => selectedKey === o.key).showDropIcon} onDropMenuClick={this.handleOperate} dropMenuDatas={_.find(tabs, o => selectedKey === o.key).dropMenuDatas} > @@ -87,6 +108,10 @@ class Index extends Component { {/*数据推送框*/} this.setState({ DPDialog: { ...DPDialog, visible: false } })} onSearch={this.handleAdvanceSearch}/> + {/*推送记录查看详情*/} + this.setState({ + pushDetailDialog: { ...pushDetailDialog, visible: false } + })}/> ); } diff --git a/pc4mobx/hrmSalary/pages/datapush/index.less b/pc4mobx/hrmSalary/pages/datapush/index.less index 57ea36c8..316932b9 100644 --- a/pc4mobx/hrmSalary/pages/datapush/index.less +++ b/pc4mobx/hrmSalary/pages/datapush/index.less @@ -77,6 +77,42 @@ } } } + + .pushDetailDialog { + .wea-slide-modal-content { + height: 100%; + + .wea-new-table { + background: #FFF; + } + + .pushDetail_content { + height: 100%; + background: #F6F6F6; + padding: 8px 16px; + } + } + + .wea-slide-modal-title { + background: #FFF; + text-align: left; + height: 44px; + } + + .wea-new-top { + background: #FFF; + + .ant-col-10 { + padding-right: 50px !important; + } + } + } +} + +.reqZindex0 { + .wea-new-top-req { + z-index: 0 !important; + } } .custom_item_treeselect { @@ -131,4 +167,3 @@ } } } - diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/copyLedgerModal.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/copyLedgerModal.js index 916efbc2..80884056 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/copyLedgerModal.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/copyLedgerModal.js @@ -39,7 +39,7 @@ class CopyLedgerModal extends Component { getTaxAgentSelectListAsAdmin = () => { const { ledgerStore } = this.props; const { copyForm: form } = ledgerStore; - postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }) + postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" }) .then(({ status, data }) => { if (status) { const conditions = _.map(copyConditions, it => { diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less b/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less index 5ed5c65c..9e704e4c 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less @@ -41,6 +41,10 @@ .baseSettingWrapper { padding: 12px 12px 12px 20px; + .wea-form-item-wrapper { + display: inline-block !important; + } + .baseSettingLeft { border: 1px solid #ebedf0; padding: 0 !important; @@ -147,6 +151,10 @@ display: flex; align-items: center; + .wea-ignore-node i { + display: none; + } + .wea-sortable-grid-item { display: inline-block; border: none; diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRule.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRule.js index 1a19b304..3cdb2983 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRule.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRule.js @@ -61,10 +61,11 @@ class LedgerAccountApprRule extends Component { } renderForm = (form, conditions) => { - const { saveSalarySobId, editId } = this.props; + const { saveSalarySobId, editId, record } = this.props; const { approvalItemGroup } = this.state; const { isFormInit } = form; const formParams = form.getFormParams(); + const showOperateBtn = editId ? record.opts.includes("admin") : true; let group = []; isFormInit && conditions && conditions.map(c => { let items = []; @@ -76,8 +77,8 @@ class LedgerAccountApprRule extends Component { wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)} tipPosition="bottom" > - + ), hide: fields.hide }); @@ -89,6 +90,7 @@ class LedgerAccountApprRule extends Component { tipPosition="bottom" > this.setState({ approvalItemGroup: _.map(approvalItemGroup, o => ({ ...o, diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountSalaryItemsSet.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountSalaryItemsSet.js index 1f53c37b..7a4ee3cc 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountSalaryItemsSet.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountSalaryItemsSet.js @@ -55,26 +55,29 @@ class LedgerAccountSalaryItemsSet extends Component { render() { const { editDialog, salaryItemDialog } = this.state; - const { datas } = this.props; + const { datas, showOperateBtn = true } = this.props; return (
- this.setState({ - editDialog: { visible: true, title: getLabel(111, "添加分类") } - })}/> - + { + showOperateBtn && this.setState({ + editDialog: { visible: true, title: getLabel(111, "添加分类") } + })}/> + }
({ ...o, filter: !showOperateBtn }))} onChange={list => this.props.onChange(list)} renderNodeItem={(item) => { return
{item.groupName} - + { + showOperateBtn && + this.setState({ editDialog: { visible: true, groupName: item.groupName, groupId: item.id, title: getLabel(111, "分类名称编辑") @@ -82,14 +85,17 @@ class LedgerAccountSalaryItemsSet extends Component { })}/> this.handleDeleteClick(item)}/> + } - this.handleAddSalaryItems(item)}/> + { + showOperateBtn && this.handleAddSalaryItems(item)}/> + }
{ !_.isEmpty(item.approvalItems) ? ({ ...o, filter: !showOperateBtn }))} onChange={(items) => this.props.onChange( _.map(datas, child => { if (child.id === item.id) { @@ -102,7 +108,10 @@ class LedgerAccountSalaryItemsSet extends Component { return
{filed.salaryItemName}
- this.handleDeleteClick(item, filed)}/> + { + showOperateBtn && + this.handleDeleteClick(item, filed)}/> + }
; }} diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js index d0651065..dea5364c 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js @@ -106,7 +106,7 @@ class LedgerBaseSetting extends Component { }); }; getTaxAgentSelectListAsAdmin = () => { - postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }) + postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" }) .then(({ status, data }) => { if (status) { this.setState({ diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js index cef3b2e6..a192c791 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js @@ -46,22 +46,22 @@ class LedgerSalaryItemBaseInfo extends Component { }; handleDeleteEmplist = (item) => { const { dataSource, onChangeSortableList } = this.props; - onChangeSortableList(_.xorWith(dataSource, [item], _.isEqual)); + onChangeSortableList(_.filter(dataSource, o => o.id !== item.id)); }; render() { const { dataSource, onChangeSortableList, onPreview, editId, record } = this.props; + const admin = editId ? record.opts.includes("admin") : true; const { empFieldListOptions } = this.state; const options = _.map(empFieldListOptions, o => ({ ...o, disabled: _.map(dataSource, g => g.fieldId).includes(o.key) })); if (_.isEmpty(dataSource) || _.isEmpty(options)) return null; - const admin = editId ? record.opts.includes("admin") : true; return ( }>
({ ...o, filter: !admin }))} draggableType="icon" onChange={onChangeSortableList} renderNodeItem={(item) => { diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js index c7dd907d..5e61b475 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js @@ -182,7 +182,8 @@ class LedgerSalaryItemNormal extends Component { > childItem.uuid === uuid).items} + showOperateBtn={showOperateBtn} + dataSource={_.find(dataSource, childItem => childItem.uuid === uuid).items} salarySobId={editId || saveSalarySobId} selectedRowKeys={field.selectedRowKeys || []} onDropCategoryItem={(data) => onDropCategoryItem(field, data)} diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js index 4f126ef9..76808a84 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js @@ -231,7 +231,7 @@ class LedgerSalaryItemTable extends Component { render() { const { salaryItemPayload, editFormulModal, originRecord } = this.state; - const { onHandleItemhide } = this.props; + const { onHandleItemhide, showOperateBtn } = this.props; const { tableData, dataSource, onDropCategoryItem, onChangeSelectedRowKeys, selectedRowKeys, onMoveTo @@ -315,16 +315,16 @@ class LedgerSalaryItemTable extends Component { record.id || record.key} - rowSelection={rowSelection} + rowSelection={showOperateBtn ? rowSelection : null} dataSource={tableData} - columns={columns} + columns={showOperateBtn ? columns : _.filter(columns, o => (o.dataIndex !== "operate" && o.dataIndex !== "itemHide"))} onRow={(record, index) => ({ index, moveRow: record })} pagination={false} onDrop={onDropCategoryItem} - draggable={dataSource.length === tableData.length} + draggable={dataSource.length === tableData.length && showOperateBtn} />
- this.setState({ wmcontSet: { ...wmcontSet, visible: true } })}/> + { + showOperateBtn && + this.setState({ wmcontSet: { ...wmcontSet, visible: true } })}/> + } { _.isEmpty(wmcontSet.textSet) ? : this.setState({ wmNoTransparent })} /> this.setState({ wmRotate })} /> -
- - -
+ { + showOperateBtn && +
+ + +
+ } {/* 水印内容设置弹框*/} this.setState({ diff --git a/pc4mobx/hrmSalary/pages/payroll/templateBaseSettings.js b/pc4mobx/hrmSalary/pages/payroll/templateBaseSettings.js index 7d2edc9c..55f518cd 100644 --- a/pc4mobx/hrmSalary/pages/payroll/templateBaseSettings.js +++ b/pc4mobx/hrmSalary/pages/payroll/templateBaseSettings.js @@ -104,6 +104,7 @@ class TemplateBaseSettings extends Component { }; render() { + const { showOperateBtn } = this.props; const { watermarkStatus, watermark, watermarkSet, ackFeedbackSetting, salaryBillViewingLimitSetting } = this.state; const { ackStatus, feedbackStatus, autoAckDays, feedBackUrl, mobileFeedbackUrl } = ackFeedbackSetting; const { monthType = "SALARY_DATE", limitMonth, burningAfterReadingMin } = salaryBillViewingLimitSetting; @@ -111,14 +112,14 @@ class TemplateBaseSettings extends Component { - this.setState({ watermarkStatus, watermark: "DEFAULT" })}/> { watermarkStatus === "1" && {getLabel(111, "水印设置")}
} - this.setState({ watermarkSet: { ...watermarkSet, visible: false } })} onChange={wmSetting => this.setState({ wmSetting })} /> @@ -143,7 +144,7 @@ class TemplateBaseSettings extends Component { - this.setState({ ackFeedbackSetting: { ...ackFeedbackSetting, ackStatus, autoAckDays: 7 @@ -155,7 +156,7 @@ class TemplateBaseSettings extends Component { this.setState({ ackFeedbackSetting: { @@ -170,7 +171,7 @@ class TemplateBaseSettings extends Component { } - this.setState({ ackFeedbackSetting: { ...ackFeedbackSetting, feedbackStatus @@ -182,7 +183,7 @@ class TemplateBaseSettings extends Component { this.setState({ ackFeedbackSetting: { ...ackFeedbackSetting, feedBackUrl @@ -191,7 +192,7 @@ class TemplateBaseSettings extends Component { this.setState({ ackFeedbackSetting: { ...ackFeedbackSetting, mobileFeedbackUrl @@ -207,12 +208,12 @@ class TemplateBaseSettings extends Component { this.setState({ salaryBillViewingLimitSetting: { ...salaryBillViewingLimitSetting, monthType } - })} + })} viewAttr={2} disabled={!showOperateBtn} options={[ { key: "SALARY_DATE", showname: getLabel(111, "薪资所属月"), selected: true }, { key: "SEND_DATE", showname: getLabel(111, "发放日期") } ]}/> - this.setState({ salaryBillViewingLimitSetting: { ...salaryBillViewingLimitSetting, limitMonth @@ -226,7 +227,7 @@ class TemplateBaseSettings extends Component {
{getLabel(111, "首次查看")} - this.setState({ salaryBillViewingLimitSetting: { ...salaryBillViewingLimitSetting, burningAfterReadingMin diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/grantTableList/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/grantTableList/index.js index fbe07cb7..4bdb7293 100644 --- a/pc4mobx/hrmSalary/pages/payrollRelease/components/grantTableList/index.js +++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/grantTableList/index.js @@ -140,7 +140,7 @@ class Index extends Component { >{getLabel(83110, "查看详情")} } { - sendNum === sendTotal && !showGrant && + (!record.opts.includes("admin") || (sendNum === sendTotal && !showGrant)) && this.handleOpts(e, record)}> {getLabel(545781, "操作日志")} @@ -151,7 +151,7 @@ class Index extends Component { } { - sendNum !== sendTotal && !showGrant && + sendNum !== sendTotal && !showGrant && record.opts.includes("admin") && this.handleOpts(e, record)}> {getLabel(543603, "更新模板")} diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/updatePayrollTemplateSlide/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/updatePayrollTemplateSlide/index.js index 1ebc0216..b4d7dd4e 100644 --- a/pc4mobx/hrmSalary/pages/payrollRelease/components/updatePayrollTemplateSlide/index.js +++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/updatePayrollTemplateSlide/index.js @@ -53,6 +53,10 @@ class Index extends Component { } = payrollTempForm.getFormParams(), { ackFeedbackStatus, feedbackStatus, autoAckDays, ...extraFb } = payrollTempFeedbackForm.getFormParams(), { formData, smsSettingDialog } = this.tmpBaseSetRef.state; + if (autoSendStatus !== "1" && emailStatus !== "1" && msgStatus !== "1" && smsStatus !== 1) { + message.warning(getLabel(111, "工资单模板至少开启一个发送通道")); + return; + } const payload = { ...toJS(tmplDataSource), ...extraFb, ...formData, ...extraBs, ackFeedbackStatus: ackFeedbackStatus === "1", diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/index.js index b601298a..cad4fc94 100644 --- a/pc4mobx/hrmSalary/pages/payrollRelease/index.js +++ b/pc4mobx/hrmSalary/pages/payrollRelease/index.js @@ -86,7 +86,9 @@ class Index extends Component { return reqBtns; }; renderContent = () => { + const { taxAgentStore: { PageAndOptAuth } } = this.props; const { selectedKey, queryParams, isRefresh } = this.state; + const showOperateBtn = PageAndOptAuth.opts.includes("admin"); let dom = null; switch (selectedKey) { case "grant": @@ -104,7 +106,7 @@ class Index extends Component { break; case "watermark": dom = this.baseSetRef = dom} + ref={dom => this.baseSetRef = dom} showOperateBtn={showOperateBtn} onChangeLoading={loading => this.setState({ baseSetSaveLoading: loading })} />; break; diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/index.less b/pc4mobx/hrmSalary/pages/payrollRelease/index.less index b9966438..50edacb5 100644 --- a/pc4mobx/hrmSalary/pages/payrollRelease/index.less +++ b/pc4mobx/hrmSalary/pages/payrollRelease/index.less @@ -21,7 +21,7 @@ } .wea-new-top-req { - z-index: 0 !important; + //z-index: 0 !important; } .wea-new-top-req-wapper .wea-new-top-req-title > div:last-child { diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js index a141d796..43fd37fa 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js @@ -197,6 +197,15 @@ export const conditions = [ lanId: 111, labelcol: 8, viewAttr: 2 + }, + { + conditionType: "SWITCH", + domkey: ["SALARY_ACCT_SYNC_TYPE"], + fieldcol: 10, + label: "是否采用线程池", + lanId: 111, + labelcol: 8, + viewAttr: 2 } ], title: "薪资核算", diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/form.js b/pc4mobx/hrmSalary/pages/ruleConfig/form.js index 09a946f8..29b4d01b 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/form.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/form.js @@ -25,8 +25,8 @@ export const renderRuleForm = (form, condition, onChange) => { tipPosition="bottom"> getKey(fields) !== "salaryAcctFixedColumns" && onChange(v)} - onBlur={(v) => getKey(fields) === "salaryAcctFixedColumns" && onChange({ salaryAcctFixedColumns: { value: v } })} + onChange={v => !["INPUT", "INPUTNUMBER", "TEXTAREA"].includes(fields.conditionType) && onChange(v)} + onBlur={v => ["INPUT", "INPUTNUMBER", "TEXTAREA"].includes(fields.conditionType) && onChange({ [getKey(fields)]: { value: v } })} /> ), colSpan: 1, diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js b/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js index 3131f9ac..2608bb44 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js @@ -104,7 +104,7 @@ class RuleConfig extends Component { form.updateFields({ [item]: { value: sysinfo[item] === "0" ? "0" : (sysinfo[item] || "0") } }); } else if (item === "taxAgentShowStatus" || item === "salaryShowStatus" || item === "adjustShowStatus") { form.updateFields({ [item]: { value: sysinfo[item] || "1" } }); - } else if (item === "OPEN_APPLICATION_ENCRYPT") { + } else if (item === "OPEN_APPLICATION_ENCRYPT" || item === "SALARY_ACCT_SYNC_TYPE") { form.updateFields({ [item]: { value: _.isNil(sysinfo[item]) ? "1" : (sysinfo[item] || "") } }); } else if ( item === "APPROVAL_CAN_MANUAL_FILE_STATUS" || item === "APPROVAL_CAN_RE_CALC_STATUS" || item === "APPROVAL_CAN_EDIT_RESULT_STATUS" @@ -163,6 +163,7 @@ class RuleConfig extends Component { case "ATTENDANCE_SERIAL_COLLECTION_BTN": case "TAX_DECLARATION_DATE_TYPE": case "SHOT_EMP_BTN": + case "SALARY_ACCT_SYNC_TYPE": if (!this.handleDebounce) { this.handleDebounce = _.debounce(() => { const confTitle = { @@ -183,6 +184,7 @@ class RuleConfig extends Component { ATTENDANCE_SERIAL_COLLECTION_BTN: getLabel(111, "考勤引用是否采集班次数据"), TAX_DECLARATION_DATE_TYPE: getLabel(111, "申报日期类型"), SHOT_EMP_BTN: getLabel(111, "启用组织快照"), + SALARY_ACCT_SYNC_TYPE: getLabel(111, "是否采用线程池") }; this.unifiedSettings(key, confTitle[key]); this.handleDebounce = null; diff --git a/pc4mobx/hrmSalary/pages/salary/components/constants.js b/pc4mobx/hrmSalary/pages/salary/components/constants.js index dc2422a0..7d6ad232 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/constants.js +++ b/pc4mobx/hrmSalary/pages/salary/components/constants.js @@ -297,7 +297,7 @@ export const personScopeConditions = [ { conditionType: "SELECT_LINKAGE", domkey: ["targetType"], - fieldcol: 18, + fieldcol: 16, label: "对象类型", lanId: 111, labelcol: 6, diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js index ce15691d..70a5c202 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScopeModal.js @@ -7,7 +7,7 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaSwitch } from "comsMobx"; -import { WeaCheckbox, WeaDialog, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; +import { WeaCheckbox, WeaDialog, WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; import { Button, message } from "antd"; import { getTaxAgentRangeForm, taxAgentRangeEdit, taxAgentRangeSave } from "../../../apis/taxAgent"; import { personScopeConditions, scopeSelectLinkageDatas } from "./constants"; @@ -129,6 +129,14 @@ class PersonalScopeModal extends Component { onChange={this.handleChangeAll}/> } + { + personScopeForm.getFormParams().targetType === "SQL" && getKey(fields) === "targetType" && + 1、sql需返回人员id
2、sql结尾不需要 ; go /等符号
使用例子:定义获取岗位是开发的人员
select id from hrmresource where JOBTITLE = 17") }}/> + }/> + } ), hide: fields.hide }); diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.less b/pc4mobx/hrmSalary/pages/salaryItem/index.less index cf539484..0e752b3f 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.less +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.less @@ -187,6 +187,7 @@ border: 1px solid #e5e5e5 !important; padding: 4px 8px !important; min-height: 70px !important; + word-wrap: break-word; } } } diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentDefaultSlide.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentDefaultSlide.js index 47542d39..ede4d7c9 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentDefaultSlide.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentDefaultSlide.js @@ -46,7 +46,7 @@ class AdjustmentDefaultSlide extends Component { }; render() { - const { visible, onCancel, taxAgentStore: { showOperateBtn }, dataSource } = this.props; + const { visible, onCancel, taxAgentStore: { PageAndOptAuth }, dataSource } = this.props; const { loading } = this.state; const columns = [ { @@ -82,6 +82,7 @@ class AdjustmentDefaultSlide extends Component { } } ]; + const showOperateBtn = PageAndOptAuth.opts.includes("admin"); return ( { const requireKeys = ["adjustTo", "adjustmentTotal", "categoryType", "companyTotal", "countryTotal", "target", "welfareType"]; + const { billMonth, paymentOrganization } = this.props; let { dataSource, targetOptions } = this.adjustTableRef.state; dataSource = _.filter(dataSource, it => (!it.id || !it.status)); - const billMonth = getQueryString("billMonth"); - const paymentOrganization = getQueryString("paymentOrganization"); let bool = true; _.map(dataSource, item => { bool = _.every(requireKeys, child => !!item[child]); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less index c7117046..919e4d78 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less @@ -13,7 +13,19 @@ } .wea-search-tab, .wea-input-focus { - background: #f1f1f1; + background: #F1F1F1; + padding-right: 0 !important; + + .wea-advanced-search { + background: #FFF + } + + i { + font-size: 20px; + cursor: pointer; + vertical-align: middle; + color: #55a1f8; + } } .normalWapper { @@ -23,6 +35,18 @@ overflow: hidden; padding: 0 16px; + .wea-tab .wea-search-container .wea-advanced-search { + right: -1px !important; + } + + .wea-tab .wea-search-tab { + padding-right: 0; + + .wea-advanced-search { + background: #FFF; + } + } + .tableWrapper { flex: 1; overflow: hidden; @@ -60,20 +84,14 @@ .tabOption { display: flex; align-items: center; - padding: 8px 20px; + padding: 8px 0; justify-content: flex-end; - i.icon-coms-Batch-delete, i.icon-coms-Add-to, button { + i { + font-size: 20px; cursor: pointer; - margin-right: 10px; - } - - .anticon-search { - margin-right: 0px; - } - - .wea-input-focus-btn { - margin-right: 0px; + vertical-align: middle; + color: #55a1f8; } } @@ -93,7 +111,7 @@ overflow: hidden; display: flex; flex-direction: column; - padding: 16px; + padding: 0 16px 16px 16px; .tableWrapper { flex: 1; @@ -132,26 +150,6 @@ } } } - - .wea-new-top { - .ant-btn { - border-radius: 0; - padding: 0; - background: transparent; - border: none; - font-size: 18px; - line-height: 18px; - } - - .ant-btn.ant-btn-primary[disabled] { - color: #d8d8d8; - background: transparent; - } - - .ant-btn.ant-btn-primary { - color: #2db7f5; - } - } } //补差添加人员弹框 diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js index d0085fd7..c5e05729 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js @@ -7,8 +7,6 @@ import React, { Component } from "react"; import RegTop from "./regTop"; import { message, Modal } from "antd"; -import { WeaNewScroll } from "ecCom"; -import { getQueryString } from "../../../../util/url"; import * as API from "../../../../apis/standingBook"; import { calcPageNo } from "../../../../util"; import RegList from "./regList"; @@ -16,6 +14,7 @@ import RegEditDetial from "./regEditDetial"; import AddCompensationPersonnelDialog from "./addCompensationPersonnelDialog"; import StandingBookCalcImportDialog from "./standingBookCalcImportDialog"; import "./index.less"; +import { convertToUrlString } from "../../../../util/url"; class MakeupDifference extends Component { constructor(props) { @@ -43,9 +42,7 @@ class MakeupDifference extends Component { delBalance = () => { const { selectKey: ids } = this.state; - const billMonth = getQueryString("billMonth"); - const paymentOrganization = getQueryString("paymentOrganization"); - const payload = { ids, billMonth, paymentOrganization }; + const payload = { ids, ..._.pick(this.props, ["billMonth", "paymentOrganization"]) }; API.delBalance(payload).then(({ status, errormsg }) => { if (status) { message.success("删除成功"); @@ -64,8 +61,6 @@ class MakeupDifference extends Component { const workcode = this.regTopRef.state.workcode; const departmentIds = this.regTopRef.state.departmentIds ? this.regTopRef.state.departmentIds.split(",") : []; const subCompanyIds = this.regTopRef.state.subCompanyIds ? this.regTopRef.state.subCompanyIds.split(",") : []; - const billMonth = getQueryString("billMonth"); - const paymentOrganization = getQueryString("paymentOrganization"); switch (key) { case "delete": Modal.confirm({ @@ -78,13 +73,13 @@ class MakeupDifference extends Component { this.setState({ importDiffModal: { ...importDiffModal, visible: true, - importparams: { billMonth: getQueryString("billMonth") } + importparams: { ..._.pick(this.props, ["billMonth"]) } } }); break; case "export": - const url = `${window.location.origin}/api/bs/hrmsalary/welfare/balance/export?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`; - window.open(url, "_self"); + const url = `/api/bs/hrmsalary/welfare/balance/export?${convertToUrlString(_.pick(this.props, ["billMonth", "paymentOrganization"]))}`; + window.open(url, "_blank"); break; case "search": this.diffListRef.recessionList({ userName: name, workcode, departmentIds, subCompanyIds, current: 1 }); @@ -92,7 +87,7 @@ class MakeupDifference extends Component { case "add": this.setState({ addPersonalDialog: { - ...addPersonalDialog, visible: true, paymentOrganization, billMonth + ...addPersonalDialog, ..._.pick(this.props, ["billMonth", "paymentOrganization"]), visible: true } }); break; @@ -117,42 +112,40 @@ class MakeupDifference extends Component { }; render() { - const billMonth = getQueryString("billMonth"); const { selectKey, importDiffModal, returnEditPersonSlide, addPersonalDialog } = this.state; return (
this.regTopRef = dom} - billMonth={billMonth} onChange={this.handleChangeOpt} selectKey={selectKey} />
- - this.diffListRef = dom} - onChangeRowkey={(selectKey) => this.setState({ selectKey })} - onEdit={this.handleEdit} - /> - {/*编辑弹框*/} - - {/*添加补差人员*/} - this.setState({ - addPersonalDialog: { - ...addPersonalDialog, - visible: false - } - }, () => isRefresh && this.diffListRef.recessionList())} - /> - {/*导入补差*/} - this.setState({ - importDiffModal: { ...importDiffModal, visible: false } - }, () => isInit && this.diffListRef.recessionList())}/> - + this.diffListRef = dom} + onChangeRowkey={(selectKey) => this.setState({ selectKey })} + onEdit={this.handleEdit} + /> + {/*编辑弹框*/} + + {/*添加补差人员*/} + this.setState({ + addPersonalDialog: { + ...addPersonalDialog, + visible: false + } + }, () => isRefresh && this.diffListRef.recessionList())} + /> + {/*导入补差*/} + this.setState({ + importDiffModal: { ...importDiffModal, visible: false } + }, () => isInit && this.diffListRef.recessionList())}/>
); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js index aa2ea15d..f6f6f010 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js @@ -6,95 +6,52 @@ */ import React, { Component } from "react"; import { Button, Col, Icon, message, Modal, Row, Spin, Tooltip } from "antd"; -import { inject, observer } from "mobx-react"; -import { WeaBrowser, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup, WeaTab } from "ecCom"; +import { WeaBrowser, WeaButtonIcon, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup, WeaTab } from "ecCom"; +import * as API from "../../../../apis/standingBook"; +import { getCalculateProgress } from "../../../../apis/calculate"; +import { sysConfCodeRule } from "../../../../apis/ruleconfig"; import { calcPageNo } from "../../../../util"; -import { getQueryString } from "../../../../util/url"; +import { convertToUrlString } from "../../../../util/url"; import ProgressModal from "../../../../components/progressModal"; import StandingBookCalcImportDialog from "./standingBookCalcImportDialog"; import AdjustmentSlide from "./adjustmentSlide"; -import { getCalculateProgress } from "../../../../apis/calculate"; import RegEditDetial from "./regEditDetial"; import SupplementarySlide from "./supplementarySlide"; -import _ from "lodash"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; -@inject("standingBookStore") -@observer + export default class NormalIndex extends Component { constructor(props) { super(props); this.state = { - date: "", - current: 1, - pageSize: 10, - selectedRowKeys: [], - addProps: { - title: "", - visible: false - }, - adjustSlide: { - title: "调差", - visible: false - }, - tableData: { - list: [], - columns: [], - total: 0 - }, - searchValue: "", - workcode: "", - departmentIds: "", - subCompanyIds: "", - progressVisible: false, - progress: 0, - fieldData: {}, //选中的表单头信息 - importParams: { //导入信息的弹框表示 + pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [], showSearchAd: false, loading: false, + formParams: { userName: "", workcode: "", departmentIds: [], subCompanyIds: [] }, + addProps: { title: "", visible: false }, adjustSlide: { title: "调差", visible: false }, + progressVisible: false, progress: 0, importParams: { //导入信息的弹框表示 visible: false, fieldUrl: "getWelfareList", tmpUrl: "exportSiaccountWelfareImporttemplate", cacheUrl: "cacheWelfareListField", importUrl: "importInsuranceAcctDetail", importparams: {} }, - returnEditPersonSlide: { - title: "", - editId: "", - visible: false - }, - showSum: false, - siaccountSum: {}, - showSearchAd: false + returnEditPersonSlide: { title: "", editId: "", visible: false }, + columns: [], dataSource: [], sumRow: {}, normalPayer: "" }; this.timer = null; this.timerDelete = null; } componentDidMount() { - const { selectedKey, location } = this.props; - const { current } = this.state; - const billMonth = location.query.billMonth; - const paymentOrganization = location.query.paymentOrganization; - selectedKey === "1" - ? this.getNormalList({ billMonth, current, paymentOrganization }) - : this.getSupplementaryList({ billMonth, current, paymentOrganization }); window.addEventListener("message", this.handleReceive, false); } - handleReceive = async ({ data }) => { - const { type, payload: { id, params } = {} } = data; + handleReceive = ({ data }) => { + const { type, payload: { id, params } = {} } = data, { selectedKey } = this.props; if (type === "init") { - this.postMessageToChild(); + selectedKey === "1" ? this.getNormalList() : this.getSupplementaryList(); } else if (type === "turn") { if (id === "PAGEINFO") { const { pageNum: current, size: pageSize } = params; - this.setState({ current, pageSize }, () => { - const { billMonth, paymentOrganization, selectedKey } = this.props; - const { current, pageSize } = this.state; - selectedKey === "1" ? - this.getNormalList({ - billMonth, current, pageSize, paymentOrganization - }) : - this.getSupplementaryList({ - billMonth, current, pageSize, paymentOrganization - }); + this.setState({ pageInfo: { ...this.state.pageInfo, current, pageSize } }, () => { + selectedKey === "1" ? this.getNormalList(true) : this.getSupplementaryList(true); }); } else if (id === "ROWSELECT") { const { selectedRowKeys } = params; @@ -106,267 +63,125 @@ export default class NormalIndex extends Component { }; componentWillUnmount() { - if (this.timer) { - clearInterval(this.timer); - } - if (this.timerDelete) { - clearInterval(this.timerDelete); - } + if (this.timer) clearInterval(this.timer); + if (this.timerDelete) clearInterval(this.timerDelete); window.removeEventListener("message", this.handleReceive, false); } componentWillReceiveProps(nextProps) { - if (nextProps.selectedKey != this.props.selectedKey) { - const { billMonth, paymentOrganization } = nextProps; + if (nextProps.selectedKey !== this.props.selectedKey) { this.setState({ - current: 1, selectedRowKeys: [] + pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [], dataSource: [], sumRow: {}, + addProps: { title: "", visible: false }, returnEditPersonSlide: { title: "", editId: "", visible: false } }, () => { - const { current } = this.state; - nextProps.selectedKey === "1" - ? this.getNormalList({ billMonth, current, paymentOrganization }) - : this.getSupplementaryList({ billMonth, current, paymentOrganization }); + nextProps.selectedKey === "1" ? this.getNormalList() : this.getSupplementaryList(); }); } } postMessageToChild = () => { - const billMonth = getQueryString("billMonth"); - const paymentOrganization = getQueryString("paymentOrganization"); const childFrameObj = document.getElementById("atdTable"); - const { current, pageSize, tableData, selectedRowKeys, showSum, siaccountSum, searchValue: userName } = this.state; - const { list: dataSource, total, columns } = tableData; - const pageInfo = { current, pageSize, total }; - childFrameObj.contentWindow.postMessage(JSON.stringify({ - dataSource, columns, pageInfo, - selectedRowKeys, selectedKey: this.props.selectedKey, - sumpayload: { billMonth, paymentOrganization, userName }, - showOperates: !getQueryString("type") + childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ + ..._.pick(this.state, ["dataSource", "columns", "pageInfo", "selectedRowKeys", "sumRow"]), + showOperates: !this.props.type }), "*"); }; - - handleSearch = () => { - const { billMonth, selectedKey, paymentOrganization } = this.props; - selectedKey === "1" - ? this.getNormalList({ - billMonth, - current: 1, - paymentOrganization, - userName: this.state.searchValue, - workcode: this.state.workcode, - departmentIds: this.state.departmentIds ? this.state.departmentIds.split(",") : [], - subCompanyIds: this.state.subCompanyIds ? this.state.subCompanyIds.split(",") : [] - }) - : this.getSupplementaryList({ - billMonth, - current: 1, - paymentOrganization, - userName: this.state.searchValue, - workcode: this.state.workcode, - departmentIds: this.state.departmentIds ? this.state.departmentIds.split(",") : [], - subCompanyIds: this.state.subCompanyIds ? this.state.subCompanyIds.split(",") : [] - }); - }; - - handleSave = () => { - const { - siaccountCommonSave, - siaccountSupplementarySave, - form - } = this.props.standingBookStore; - const { billMonth, selectedKey, paymentOrganization } = this.props; - if (selectedKey === "1") { - const { includes, excludes } = form.getFormParams(); - const payload = { - billMonth, - includes: includes.split(","), - excludes: _.isEmpty(excludes) ? excludes.split(",") : [] - }; - siaccountCommonSave(payload).then(() => { - message.success("添加成功"); - this.getNormalList({ - billMonth, - paymentOrganization, - current: this.state.current - }); - this.setState({ - addProps: { - ...this.state.addProps, - title: "", - visible: false - } - }); - }); - } else { - const paymentOrganization = getQueryString("paymentOrganization"); - form.validateForm().then(f => { - if (f.isValid) { - const { - includes, - billMonth: billMonthList, - excludes, - projects - } = form.getFormParams(); - const payload = { - billMonth, - billMonthList: billMonthList.split(","), - includes: includes.split(","), - // excludes: excludes.split(","), - projects: projects.split(","), - paymentOrganization - }; - siaccountSupplementarySave(payload).then(() => { - message.success("添加成功"); - this.getSupplementaryList({ - billMonth, - current: this.state.current, - paymentOrganization - }); - this.setState( - { - addProps: { - ...this.state.addProps, - title: "", - visible: false - } - }, - () => { - form.resetForm(); - } - ); - }); - } else { - f.showErrors(); - this.setState({ date: new Date() }); // 改变一个state的变量,强制页面刷新 - } - }); - } - }; - getNormalList = async (payload = {}) => { - const { getNormalList } = this.props.standingBookStore; - getNormalList({ ...payload, pageSize: this.state.pageSize }).then(({ list, columns = [], total }) => { - this.setState({ - tableData: { list, total, columns } - }, () => this.postMessageToChild()); + handleSearch = () => this.props.selectedKey === "1" ? this.getNormalList() : this.getSupplementaryList(); + getNormalList = (pageTurning = false) => { + const { pageInfo, formParams } = this.state; + const payload = { ..._.pick(this.props, ["billMonth", "paymentOrganization"]) }; + this.setState({ loading: true }); + API.getNormalList({ ...payload, ...pageInfo, ...formParams }).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { pageInfo: { columns, list: dataSource, pageNum: current, pageSize, total } } = data; + this.setState({ pageInfo: { current, pageSize, total }, columns, dataSource }, () => this.postMessageToChild()); + } }); - }; - getSupplementaryList = async (payload = {}) => { - const { getSupplementaryList } = this.props.standingBookStore; - getSupplementaryList({ - ...payload, pageSize: this.state.pageSize - }).then(({ list, columns = [], total }) => { - this.setState({ - tableData: { list, columns, total } - }, () => this.postMessageToChild()); - }); - }; - onSelectChange = selectedRowKeys => { - this.setState({ selectedRowKeys }); - }; - handleBatchDelete = () => { - const { siaccountCommonDelete } = this.props.standingBookStore; - const { list } = this.state.tableData; - const { selectedRowKeys } = this.state; - const { billMonth, selectedKey, paymentOrganization } = this.props; - if (_.isEmpty(selectedRowKeys)) { - message.warning("未勾选数据!"); - } else { - const includes = _.map( - _.filter(list, it => selectedRowKeys.includes(it.id)), - item => item.employeeId - ); - const ids = _.map( - _.filter(list, it => selectedRowKeys.includes(it.id)), - item => item.id - ); - Modal.confirm({ - title: "确认信息", - content: "确认删除勾选的数据吗?", - onOk: () => { - this.setState({ - progressVisible: true - }, () => { - this.timerDelete = setInterval(() => { - if (this.state.progress !== 100) { - this.setState({ - progress: this.state.progress + 10 - }); - } else { - clearInterval(this.timerDelete); - this.setState({ - progressVisible: false, - progress: 0 - }, () => { - message.success("删除成功"); - selectedKey === "1" - ? this.getNormalList({ - billMonth, - paymentOrganization, - current: calcPageNo(this.state.tableData.total, this.state.current, 10, includes.length) - }) - : this.getSupplementaryList({ - billMonth, - current: calcPageNo(this.state.tableData.total, this.state.current, 10, includes.length), - paymentOrganization - }); - }); - } - }, 800); + sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" }).then(({ status, data }) => { + if (status && data === "1" && !pageTurning) { + API.getNormalListSum({ ...payload, ...pageInfo, ...formParams }) + .then(({ status: sumStatus, data: sumData }) => { + if (sumStatus) this.setState({ sumRow: sumData.sumRow }, () => this.postMessageToChild()); }); - - siaccountCommonDelete({ - billMonth, - includes, - ids, - paymentOrganization - }).then(() => { - clearInterval(this.timerDelete); - message.success("删除成功"); - this.setState({ selectedRowKeys: [], progressVisible: false, progress: 0 }); - selectedKey === "1" - ? this.getNormalList({ - billMonth, - paymentOrganization, - current: calcPageNo(this.state.tableData.total, this.state.current, 10, includes.length) - }) - : this.getSupplementaryList({ - billMonth, - current: calcPageNo(this.state.tableData.total, this.state.current, 10, includes.length), - paymentOrganization - }); - }); - - }, - onCancel: () => { - } - }); - } - }; - handleAdd = () => { - this.setState({ - addProps: { - ...this.state.addProps, - title: "添加缴纳人员", - visible: true } }); }; - - handleCommonAccountClick = () => { + getSupplementaryList = (pageTurning = false) => { + const { pageInfo, formParams } = this.state; + const payload = { ..._.pick(this.props, ["billMonth", "paymentOrganization"]) }; + this.setState({ loading: true }); + API.getSupplementaryList({ ...payload, ...pageInfo, ...formParams }).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { pageInfo: { columns, list: dataSource, pageNum: current, pageSize, total } } = data; + this.setState({ pageInfo: { current, pageSize, total }, columns, dataSource }, () => this.postMessageToChild()); + } + }); + sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" }).then(({ status, data }) => { + if (status && data === "1" && !pageTurning) { + API.getSupplementaryListSum({ ...payload, ...pageInfo, ...formParams }) + .then(({ status: sumStatus, data: sumData }) => { + if (sumStatus) this.setState({ sumRow: sumData.sumRow }, () => this.postMessageToChild()); + }); + } + }); + }; + handleBatchDelete = () => { + const { selectedRowKeys, dataSource, pageInfo } = this.state; const { billMonth, selectedKey, paymentOrganization } = this.props; - const { commonAccount } = this.props.standingBookStore; - commonAccount({ billMonth, paymentOrganization, includes: [] }); - this.setState({ - progressVisible: true - }, () => { + const includes = _.map(_.filter(dataSource, it => selectedRowKeys.includes(it.id)), item => item.employeeId); + const ids = _.map(_.filter(dataSource, it => selectedRowKeys.includes(it.id)), item => item.id); + Modal.confirm({ + title: getLabel(111, "确认信息"), + content: getLabel(111, "确认删除勾选的数据吗?"), + onOk: () => { + this.setState({ progressVisible: true }, () => { + this.timerDelete = setInterval(() => { + if (this.state.progress !== 100) { + this.setState({ progress: this.state.progress + 10 }); + } else { + clearInterval(this.timerDelete); + this.setState({ + progressVisible: false, progress: 0, pageInfo: { + ...pageInfo, current: calcPageNo(pageInfo.total, pageInfo.current, 10, includes.length) + } + }, () => { + message.success(getLabel(111, "操作成功!")); + selectedKey === "1" ? this.getNormalList() : this.getSupplementaryList(); + }); + } + }, 800); + }); + API.siaccountCommonDelete({ billMonth, includes, ids, paymentOrganization }) + .then(() => { + clearInterval(this.timerDelete); + this.setState({ + selectedRowKeys: [], progressVisible: false, progress: 0, pageInfo: { + ...pageInfo, current: calcPageNo(pageInfo.total, pageInfo.current, 10, includes.length) + } + }, () => { + message.success(getLabel(111, "操作成功!")); + selectedKey === "1" ? this.getNormalList() : this.getSupplementaryList(); + }); + }); + + } + }); + }; + handleAdd = () => this.setState({ + addProps: { ...this.state.addProps, title: getLabel(111, "添加缴纳人员"), visible: true } + }); + handleCommonAccountClick = () => { + const { billMonth, paymentOrganization, selectedKey } = this.props; + const promise = API.commonAccount({ ..._.pick(this.props, ["billMonth", "paymentOrganization"]), includes: [] }); + this.setState({ progressVisible: true }, () => { this.timer = setInterval(() => { getCalculateProgress(billMonth, paymentOrganization).then(({ status, data }) => { if (status) { if (!data.status) { clearInterval(this.timer); - this.setState({ - progressVisible: false, - progress: 0 - }); + this.setState({ progressVisible: false, progress: 0 }); message.error(data.message); } if (this.state.progress !== 100) { @@ -376,50 +191,68 @@ export default class NormalIndex extends Component { } else { clearInterval(this.timer); this.setState({ - progressVisible: false, - progress: 0 + progressVisible: false, progress: 0 }, () => { - message.success("核算成功"); - selectedKey === "1" - ? this.getNormalList({ - billMonth, - paymentOrganization, - current: this.state.current - }) - : this.getSupplementaryList({ - billMonth, - paymentOrganization, - current: this.state.current - }); + message.success(getLabel(111, "操作成功!")); + this.getNormalList(); }); } } else { clearInterval(this.timer); - this.setState({ - progressVisible: false, - progress: 0 - }); + this.setState({ progressVisible: false, progress: 0 }); } }).catch(() => { clearInterval(this.timer); - this.setState({ - progressVisible: false, - progress: 0 - }); + this.setState({ progressVisible: false, progress: 0 }); }); }, 600); }); }; - + handleAddSocialAcctEmp = () => { + const { normalPayer, pageInfo } = this.state, { current, pageSize, total } = pageInfo; + API.addSocialAcctEmp({ + ..._.pick(this.props, ["billMonth", "paymentOrganization"]), includes: normalPayer.split(",") + }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "操作成功")); + this.setState({ + pageInfo: { ...pageInfo, current: calcPageNo(total, current, pageSize, normalPayer.split(",").length) } + }, () => this.getNormalList()); + } else { + message.error(errormsg); + } + }); + }; + handleDeleteNormalPayer = () => { + Modal.confirm({ + title: getLabel(111, "确认信息"), + content: getLabel(111, "确认删除勾选的数据吗?"), + onOk: () => { + const { selectedRowKeys: ids, pageInfo } = this.state, { current, pageSize, total } = pageInfo; + API.deleteSocialAcctEmp({ ..._.pick(this.props, ["billMonth", "paymentOrganization"]), ids }) + .then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "操作成功!")); + this.setState({ + selectedRowKeys: [], + pageInfo: { ...pageInfo, current: calcPageNo(total, current, pageSize, ids.length) } + }, () => this.getNormalList()); + } else { + message.error(errormsg); + } + }); + } + }); + }; handleExport = () => { - const { billMonth, selectedKey, paymentOrganization } = this.props; + const { selectedKey } = this.props; const urlObj = { "1": "/api/bs/hrmsalary/welfare/common/export", "3": "/api/bs/hrmsalary/welfare/supplementary/export" }; const url = `${window.location - .origin}${urlObj[selectedKey]}?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`; - window.open(url, "_self"); + .origin}${urlObj[selectedKey]}?${convertToUrlString(_.pick(this.props, ["billMonth", "paymentOrganization"]))}`; + window.open(url, "_blank"); }; handleEditNormalStandingBook = (record) => { const { userName, id: editId } = record; @@ -433,82 +266,76 @@ export default class NormalIndex extends Component { this.setState({ returnEditPersonSlide: { ...returnEditPersonSlide, visible: false, title: "", editId: "" } }, () => { - if (refreshList) { - const { current } = this.state; - const { billMonth, selectedKey, paymentOrganization } = this.props; - selectedKey === "1" - ? this.getNormalList({ - billMonth, - paymentOrganization, - current - }) - : this.getSupplementaryList({ - billMonth, - paymentOrganization, - current - }); - } + if (refreshList) this.props.selectedKey === "1" ? this.getNormalList() : this.getSupplementaryList(); }); }; getSearchs = () => { - return + const { formParams } = this.state, { workcode, departmentIds, subCompanyIds } = formParams; + return - - this.setState({ workcode: v })} - /> + + this.setState({ formParams: { ...formParams, workcode: v } })}/> this.setState({ departmentIds: v })}/> + isSingle={false} value={departmentIds.join(",")} type={57} + onChange={v => this.setState({ formParams: { ...formParams, departmentIds: v.split(",") } })}/> this.setState({ subCompanyIds: v })}/> + isSingle={false} value={subCompanyIds.join(",")} type={164} + onChange={v => this.setState({ formParams: { ...formParams, subCompanyIds: v.split(",") } })}/> ; }; render() { - const { remarks, billMonth, selectedKey, paymentOrganization, standingBookStore } = this.props; - const { addProps, adjustSlide, importParams, returnEditPersonSlide, showSearchAd } = this.state; - const { loading } = standingBookStore; + const { remarks, billMonth, selectedKey, paymentOrganization, type } = this.props; + const { + formParams, addProps, adjustSlide, importParams, returnEditPersonSlide, + showSearchAd, selectedRowKeys, loading + } = this.state; const btn1 = [ - , - + , + ]; const btn2 = [ - , - + , + this.setState({ normalPayer: ids }, () => this.handleAddSocialAcctEmp())}> + + , + , + ]; const btn3 = [ - + }} title={getLabel(111, "线下对比")}/> ]; const btn4 = [ - + this.setState({ + importParams: { + ...importParams, visible: true, + tmpUrl: selectedKey === "1" ? "exportSiaccountWelfareImporttemplate" : "exportSiaccountWelfaresupplyimporttemplatetemplate" + } + })} title={getLabel(111, "导入")}/> ]; const btn5 = [ - + ]; let btn = []; - (this.props.type !== "detail" && this.props.selectedKey == "3") && (btn = [...btn, ...btn1]); - (selectedKey === "1" && this.props.type !== "detail") && (btn = [...btn, ...btn2]); - selectedKey === "1" && (btn = [...btn, ...btn3]); - this.props.type !== "detail" && (btn = [...btn, ...btn4]); - btn = [...btn, ...btn5]; + (type !== "detail" && selectedKey === "3") && (btn = [...btn, ...btn1]); + (selectedKey === "1" && type !== "detail") && (btn = [...btn, ...btn2]); + btn = [...btn5, ...btn]; + type !== "detail" && (btn = [...btn4, ...btn]); + selectedKey === "1" && (btn = [...btn3, ...btn]); return (
{ @@ -516,20 +343,16 @@ export default class NormalIndex extends Component {
- 账单月份 - + {getLabel(111, "账单月份")} + - - {billMonth} - + {billMonth}
- 备注: - - {remarks} - + {getLabel(111, "备注:")} + {remarks}
} @@ -537,39 +360,26 @@ export default class NormalIndex extends Component { datas={[]} selectedKey="" advanceHeight={200} searchsAd={this.getSearchs()} searchType={["base", "advanced"]} showSearchAd={showSearchAd} setShowSearchAd={bool => this.setState({ showSearchAd: bool })} - onSearchChange={searchValue => this.setState({ searchValue })} + onSearchChange={userName => this.setState({ formParams: { ...formParams, userName } })} buttons={btn} onSearch={this.handleSearch} onAdSearch={this.handleSearch} - onAdReset={() => this.setState({ workcode: "" })} searchsBasePlaceHolder="请输入员工姓名" - /> - { - this.setState({ - addProps: { - ...addProps, - visible: false - } - }, () => { - isRefresh && this.getSupplementaryList({ - billMonth, - current: this.state.current, - paymentOrganization - }); - }); - }} - /> + onAdReset={() => this.setState({ + formParams: { userName: "", workcode: "", departmentIds: [], subCompanyIds: [] } + })}/> + {/*添加补缴弹框*/} + { + this.setState({ addProps: { ...addProps, visible: false } }, () => { + isRefresh && this.getSupplementaryList(); + }); + }}/> {/*核算进度条*/} { - this.setState({ progressVisible: false, progress: 0 }); - }} - progress={this.state.progress} - /> + onCancel={() => this.setState({ progressVisible: false, progress: 0 })} + progress={this.state.progress}/> {/*导入弹框*/} - this.setState({ importParams: { ...importParams, visible: false } }, () => isInit && this.handleSearch())}/> @@ -585,17 +395,9 @@ export default class NormalIndex extends Component { {/*编辑弹框*/} - { - this.setState({ - adjustSlide: { - ...adjustSlide, - visible: false - } - }); - }} - /> + {/*调差*/} + this.setState({ adjustSlide: { ...adjustSlide, visible: false } })}/>
); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js index 015156ac..acb72e00 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js @@ -5,107 +5,69 @@ * LastEditTime: 2022-05-09 15:07:56 */ import React, { Component } from "react"; -import { Button, Icon, Spin, Tooltip } from "antd"; -import { inject, observer } from "mobx-react"; -import { WeaNewScroll, WeaTable } from "ecCom"; +import { Icon, Spin, Tooltip } from "antd"; +import { WeaLocaleProvider, WeaNewScroll, WeaTable } from "ecCom"; +import { getOverViewList } from "../../../../apis/standingBook"; import "./index.less"; +import { convertToUrlString } from "../../../../util/url"; -@inject("standingBookStore") -@observer +const getLabel = WeaLocaleProvider.getLabel; export default class OverViewIndex extends Component { constructor(props) { super(props); this.state = { - selectedRowKeys: [], - current: 1, - pageSize: 10, - tableData: { - list: [], - columns: [], - total: 0 - } + dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false }; } componentDidMount() { - const { billMonth, paymentOrganization } = this.props; - this.getOverViewList({ billMonth, paymentOrganization }); + this.getOverViewList(); } - getOverViewList = (payload = {}) => { - const { getOverViewList } = this.props.standingBookStore; - getOverViewList({ ...payload, current: 1 }).then( - ({ list, columns = [], total }) => { - columns = _.map( - _.filter(columns, (it) => it.dataIndex !== "id"), - (it) => { - // if (it.dataIndex === "employeeId") { - // it = { - // ...it, - // width: 150, - // fixed: 'left' - // } - // } - return { - ...it, - title: ( + getOverViewList = () => { + const { pageInfo } = this.state; + this.setState({ loading: true }); + getOverViewList({ ..._.pick(this.props, ["billMonth", "paymentOrganization"]), ...pageInfo }) + .then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, pageInfo: { current, pageSize, total }, + columns: _.map(columns, (it) => ({ + ...it, title: ( ) - }; - } - ); - this.setState({ - tableData: { - list, - columns, - total - } - }); - } - ); + })) + }); + } + }); }; handleExport = () => { - const { billMonth, paymentOrganization } = this.props; - const url = `${window.location - .origin}/api/bs/hrmsalary/welfare/overView/export?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`; - window.open(url, "_self"); + const url = `/api/bs/hrmsalary/welfare/overView/export?${convertToUrlString(_.pick(this.props, ["billMonth", "paymentOrganization"]))}`; + window.open(url, "_blank"); }; render() { - const { remarks, billMonth, selectedKey, paymentOrganization } = this.props; - const { selectedRowKeys } = this.state; - const { loading } = this.props.standingBookStore; - let { list, columns, total } = this.state.tableData; + const { pageInfo, loading, dataSource, columns } = this.state, { billMonth } = this.props; const pagination = { - total, - showTotal: (total) => `共 ${total} 条`, - showSizeChanger: true, + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, showQuickJumper: true, + showSizeChanger: true, pageSizeOptions: ["10", "20", "50", "100"], onShowSizeChange: (current, pageSize) => { - this.setState({ current, pageSize }); - this.getOverViewList({ - billMonth, current, - pageSize, paymentOrganization - }); + this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.getOverViewList()); }, - onChange: (current) => { - this.setState({ current }); - this.getOverViewList({ - billMonth, current, - pageSize: this.state.pageSize, paymentOrganization - }); - } + onChange: current => this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getOverViewList()) }; return (
- 账单月份 - + {getLabel(111, "账单月份")} + @@ -113,20 +75,14 @@ export default class OverViewIndex extends Component {
- +
{/* table */}
- +
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js index c311d035..793b5acc 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js @@ -8,7 +8,6 @@ import React, { Component } from "react"; import { WeaDatePicker, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect } from "ecCom"; import { Button, Modal } from "antd"; import RegSelect from "./regSelect"; -import * as API from "../../../../apis/standingBook"; class RegAddEmployee extends Component { constructor(props) { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js index 979cccc9..c37db36c 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js @@ -5,10 +5,9 @@ * Date: 2022/11/23 */ import React, { Component } from "react"; -import { WeaInputNumber, WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTable } from "ecCom"; -import { message } from "antd"; +import { WeaInputNumber, WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTable, WeaTop } from "ecCom"; +import { Button, message } from "antd"; import * as API from "../../../../apis/standingBook"; -import SlideModalTitle from "../../../../components/slideModalTitle"; import { regColumns } from "../constant"; import { toDecimal_n } from "../../../../util"; @@ -20,37 +19,19 @@ class RegEditDetial extends Component { this.state = { loading: false, listMap: [ - { - key: "social", - label: "社保", - dataSource: [], - columns: [] - }, - { - key: "fund", - label: "公积金", - dataSource: [], - columns: [] - }, - { - key: "other", - label: "企业年金及其他福利", - dataSource: [], - columns: [] - } + { key: "social", label: getLabel(111, "社保"), dataSource: [], columns: [] }, + { key: "fund", label: getLabel(111, "公积金"), dataSource: [], columns: [] }, + { key: "other", label: getLabel(111, "企业年金及其他福利"), dataSource: [], columns: [] } ] }; } componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.editId !== this.props.editId && nextProps.editId) { - this.getPaymentById(nextProps.editId); - } + if (nextProps.editId !== this.props.editId && nextProps.editId) this.getPaymentById(nextProps.editId); } handleSave = () => { - const { editId, onCancel } = this.props; - const { listMap } = this.state; + const { editId, onCancel } = this.props, { listMap } = this.state; const [socialData, foundData, otherData] = listMap; let payload = { id: editId, @@ -100,8 +81,7 @@ class RegEditDetial extends Component { }); }; handleChange = (type, dataIndex, value, record) => { - const { listMap } = this.state; - const [socialData, foundData, otherData] = listMap; + const { listMap } = this.state, [socialData, foundData, otherData] = listMap; switch (type) { case "social": const sociallist = _.map(socialData.dataSource, item => { @@ -139,7 +119,6 @@ class RegEditDetial extends Component { default: break; } - }; getPaymentById = (id) => { const payload = { id }; @@ -257,39 +236,26 @@ class RegEditDetial extends Component { const { visible, title, onCancel } = this.props; const { listMap, loading } = this.state; return ( - - } - content={ -
- { - _.map(listMap, item => { - const { key, label, dataSource, columns } = item; - return - - ; - }) - } -
- } - onClose={() => onCancel()} - showMask={true} - /> - ); + } iconBgcolor="#F14A2D" + buttons={[]}/> + } + content={ + + { + _.map(listMap, item => { + const { key, label, dataSource, columns } = item; + return + + ; + }) + } + + } + onClose={() => onCancel()}/>); } } diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js index 849cb407..08f65301 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js @@ -6,36 +6,27 @@ */ import React, { Component } from "react"; import { Spin } from "antd"; -import { getQueryString } from "../../../../util/url"; +import { sysConfCodeRule } from "../../../../apis/ruleconfig"; import * as API from "../../../../apis/standingBook"; import "./index.less"; const APIFox = { "regression": API.recessionList, - "difference": API.balanceList + "regressionSum": API.recessionListSum, + "difference": API.balanceList, + "differenceSum": API.balanceListSum }; class RegList extends Component { constructor(props) { super(props); this.state = { - columns: [], - dataSource: [], - selectedRowKeys: [], - loading: { - query: false - }, - datalistPayload: {}, - pageInfo: { - current: 1, - pageSize: 10, - total: 0 - } + columns: [], dataSource: [], selectedRowKeys: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, + loading: false, sumRow: {} }; } componentDidMount() { - this.recessionList(); window.addEventListener("message", this.handleReceive, false); } @@ -43,11 +34,11 @@ class RegList extends Component { const { onEdit, onChangeRowkey } = this.props; const { type, payload: { id, params } = {} } = data; if (type === "init") { - this.postMessageToChild(); + this.recessionList(); } else if (type === "turn") { if (id === "PAGEINFO") { const { pageNum: current, size: pageSize } = params; - this.setState({ pageInfo: { ...this.state.pageInfo, current, pageSize } }, () => this.recessionList()); + this.setState({ pageInfo: { ...this.state.pageInfo, current, pageSize } }, () => this.recessionList({}, true)); } else if (id === "ROWSELECT") { const { selectedRowKeys } = params; this.setState({ selectedRowKeys }); @@ -58,24 +49,15 @@ class RegList extends Component { } }; postMessageToChild = () => { - const paymentStatus = this.props.type === "difference" ? "4" : "3"; - const creator = Number(getQueryString("creator")); - const billMonth = getQueryString("billMonth"); - const paymentOrganization = getQueryString("paymentOrganization"); const childFrameObj = document.getElementById("atdTable"); - const { pageInfo, dataSource, columns, selectedRowKeys, datalistPayload } = this.state; - childFrameObj.contentWindow.postMessage(JSON.stringify({ - dataSource, columns, pageInfo, - selectedRowKeys, selectedKey: this.props.type, - sumpayload: { billMonth, paymentOrganization, creator, paymentStatus, ...datalistPayload }, - showOperates: !getQueryString("type") + childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ + ..._.pick(this.state, ["dataSource", "columns", "pageInfo", "selectedRowKeys", "sumRow"]), + showOperates: !this.props.type }), "*"); }; componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.visible !== this.props.visible) { - this.recessionList(); - } + if (nextProps.visible !== this.props.visible) this.recessionList(); } componentWillUnmount() { @@ -85,41 +67,37 @@ class RegList extends Component { handleResetSelectRowKeys = (selectedRowKeys) => { this.setState({ selectedRowKeys }); }; - recessionList = (module) => { - const { type } = this.props; - const { loading, pageInfo } = this.state; - const billMonth = getQueryString("billMonth"); - const paymentOrganization = getQueryString("paymentOrganization"); - const creator = Number(getQueryString("creator")); - const paymentStatus = type === "difference" ? "4" : "3"; + recessionList = (module, pageTurning = false) => { + const { regType } = this.props, { pageInfo } = this.state; + const paymentStatus = regType === "difference" ? "4" : "3"; const payload = { - billMonth, paymentStatus, - creator, paymentOrganization, - ...pageInfo, - ...module + ...pageInfo, ...module, paymentStatus, + ..._.pick(this.props, ["billMonth", "paymentOrganization", "creator"]) }; - this.setState({ loading: { ...loading, query: true } }); - APIFox[type](payload).then(({ status, data }) => { - this.setState({ loading: { ...loading, query: false } }); + this.setState({ loading: true }); + APIFox[regType](payload).then(({ status, data }) => { + this.setState({ loading: false }); if (status) { const { pageInfo: list } = data; const { columns, list: dataSource, pageNum: current, pageSize, total } = list; this.setState({ - pageInfo: { ...pageInfo, current, pageSize, total }, - dataSource, - columns, - datalistPayload: module + pageInfo: { ...pageInfo, current, pageSize, total }, dataSource, columns }, () => this.postMessageToChild()); } - }).catch(() => { - this.setState({ loading: { ...loading, query: false } }); + }); + sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" }).then(({ status, data }) => { + if (status && data === "1" && !pageTurning) { + APIFox[`${regType}Sum`](payload).then(({ status: sumStatus, data: sumData }) => { + if (sumStatus) this.setState({ sumRow: sumData.sumRow }, () => this.postMessageToChild()); + }); + } }); }; render() { const { loading } = this.state; return ( - +