diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index 2ffee227..b14015a7 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -568,3 +568,20 @@ export const cacheImportField = (params) => { export const salaryacctAcctresultCheckAuth = params => { return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/acctresult/checkAuth", "GET", params); }; + +//薪资核算-导出核算结果前生成可选的薪资项目 +export const getExportField = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/acctresult/exportField", "GET", params); +}; + +//薪资核算-导出薪资核算添加表头字段缓存 +export const customCacheExportField = (params) => { + return fetch("/api/bs/hrmsalary/salaryacct/acctresult/cacheExportField", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; diff --git a/pc4mobx/hrmSalary/apis/externalPersonManage.js b/pc4mobx/hrmSalary/apis/externalPersonManage.js new file mode 100644 index 00000000..91854ebb --- /dev/null +++ b/pc4mobx/hrmSalary/apis/externalPersonManage.js @@ -0,0 +1,27 @@ +import { postFetch } from "../util/request"; +import { WeaTools } from "ecCom"; + +//非系统人员-保存 +export const save = (params) => { + return postFetch("/api/bs/hrmsalary/extEmp/save", params); +}; + +//非系统人员-修改 +export const update = (params) => { + return postFetch("/api/bs/hrmsalary/extEmp/update", params); +}; + +//非系统人员-列表 +export const listPage = (params) => { + return postFetch("/api/bs/hrmsalary/extEmp/listPage", params); +}; + +//非系统人员-删除 +export const deleteExtEmp = (params) => { + return postFetch("/api/bs/hrmsalary/extEmp/delete", params); +}; + +//非系统人员-详情 +export const detail = params => { + return WeaTools.callApi("/api/bs/hrmsalary/extEmp/detail", "get", params); +}; diff --git a/pc4mobx/hrmSalary/apis/ledger.js b/pc4mobx/hrmSalary/apis/ledger.js index b04e881e..834a6c47 100644 --- a/pc4mobx/hrmSalary/apis/ledger.js +++ b/pc4mobx/hrmSalary/apis/ledger.js @@ -71,6 +71,17 @@ export const saveLedgerBasic = params => { }).then(res => res.json()); }; +//薪资帐套外部人员范围(包含)列表 +export const getLedgerPersonRangeExtList = params => { + return fetch("/api/bs/hrmsalary/salarysob/range/ext/list", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; //薪资帐套人员范围(包含)列表 export const getLedgerPersonRangeInclude = params => { return fetch("/api/bs/hrmsalary/salarysob/range/listInclude", { @@ -104,6 +115,28 @@ export const getLedgerPersonRangeForm = params => { ); }; +//保存薪资帐套外部人员范围 +export const saveLedgerPersonExtRange = params => { + return fetch("/api/bs/hrmsalary/salarysob/ext/save", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; +//删除薪资帐套外部人员范围 +export const deleteLedgerPersonExtRange = params => { + return fetch("/api/bs/hrmsalary/salarysob/range/ext/delete", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; //保存薪资帐套人员范围 export const saveLedgerPersonRange = params => { return fetch("/api/bs/hrmsalary/salarysob/range/save", { diff --git a/pc4mobx/hrmSalary/apis/mySalaryBenefits.js b/pc4mobx/hrmSalary/apis/mySalaryBenefits.js index a2f5be7a..c87cd3ab 100644 --- a/pc4mobx/hrmSalary/apis/mySalaryBenefits.js +++ b/pc4mobx/hrmSalary/apis/mySalaryBenefits.js @@ -31,6 +31,15 @@ export const mySalaryBill = params => { export const isNeedSecondPwdVerify = params => { return WeaTools.callApi("/api/encrypt/secondauthsetting/isNeedSecondAuth", "POST", params); }; +export const getSecondAuthForm = params => { + return WeaTools.callApi("/api/encrypt/secondauthsetting/getSecondAuthForm", "POST", params); +}; export const doSecondAuth = params => { return WeaTools.callApi("/api/encrypt/secondauthsetting/doSecondAuth", "POST", params); }; +export const checkPassword = params => { + return WeaTools.callApi("/api/hrm/secondarypwd/checkPassword", "POST", params); +}; +export const saveSecondaryPwd = params => { + return WeaTools.callApi("/api/hrm/secondarypwd/saveSecondaryPwd", "POST", params); +}; diff --git a/pc4mobx/hrmSalary/apis/payroll.js b/pc4mobx/hrmSalary/apis/payroll.js index 1f9b1d64..14c949d5 100644 --- a/pc4mobx/hrmSalary/apis/payroll.js +++ b/pc4mobx/hrmSalary/apis/payroll.js @@ -375,6 +375,14 @@ export const sendMobileCode = (params) => { export const payrollCheckType = params => { return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/payrollCheckType", "GET", params); }; +//工资单-反馈验证 +export const feedBackSalaryBill = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/feedBackSalaryBill", "GET", params); +}; +//工资单-确认 +export const confirmSalaryBill = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/confirmSalaryBill", "GET", params); +}; // 工资单基础设置-获取设置列表 export const getSalaryBillBaseSetForm = (id) => { diff --git a/pc4mobx/hrmSalary/apis/ruleconfig.js b/pc4mobx/hrmSalary/apis/ruleconfig.js index 2e3c0c4f..b5f4f87f 100644 --- a/pc4mobx/hrmSalary/apis/ruleconfig.js +++ b/pc4mobx/hrmSalary/apis/ruleconfig.js @@ -6,6 +6,10 @@ export const commonEnumList = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/common/enum/list", "GET", params); }; +export const sysinfo = params => { + return WeaTools.callApi("/api/bs/hrmsalary/sys/info", "GET", params); +}; + export const sysOrderRule = params => { return WeaTools.callApi("/api/bs/hrmsalary/sys/orderRule", "GET", params); }; @@ -47,6 +51,10 @@ export const operateTaxDeclarationFunction = (params) => { export const saveArchiveDelete = (params) => { return postFetch("/api/bs/hrmsalary/sys/saveArchiveDelete", params); }; +//保存系统规则开关 +export const saveSysOperate = (params) => { + return postFetch("/api/bs/hrmsalary/sys/operate", params); +}; //保存个税申报撤回规则 export const saveWithDrawTaxDeclaration = (params) => { return postFetch("/api/bs/hrmsalary/sys/saveWithDrawTaxDeclaration", params); @@ -63,3 +71,7 @@ export const reportStatisticsReportSave = (params) => { export const reportGetForm = params => { return WeaTools.callApi("/api/bs/hrmsalary/report/statistics/report/getForm", "GET", params); }; +//工资单反馈 +export const saveSalarySendFeedback = (params) => { + return postFetch("/api/bs/hrmsalary/sys/saveSalarySendFeedback", params); +}; diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index 5f2b86ee..25747f12 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -70,6 +70,18 @@ export const deleteTaxAgent = (params) => { export const taxAgentRangeSave = (params) => { return postFetch("/api/bs/hrmsalary/taxAgent/range/save", params); }; +//非系统人员范围查询 +export const taxAgentRangelistExt = (params) => { + return postFetch("/api/bs/hrmsalary/taxAgent/range/listExt", params); +}; +//非系统人员范围删除 +export const taxAgentRangeExtDelete = (params) => { + return postFetch("/api/bs/hrmsalary/taxAgent/range/ext/delete", params); +}; +//非系统人员范围保存 +export const taxAgentRangeExtSave = (params) => { + return postFetch("/api/bs/hrmsalary/taxAgent/range/ext/save", params); +}; //人员范围删除 export const taxAgentRangeDelete = (params) => { return postFetch("/api/bs/hrmsalary/taxAgent/range/delete", params); diff --git a/pc4mobx/hrmSalary/components/externalPersonModal/index.js b/pc4mobx/hrmSalary/components/externalPersonModal/index.js new file mode 100644 index 00000000..64f21fbf --- /dev/null +++ b/pc4mobx/hrmSalary/components/externalPersonModal/index.js @@ -0,0 +1,86 @@ +/* + * Author: 黎永顺 + * name: 外部人员添加弹框 + * Description: + * Date: 2023/3/14 + */ +import React, { Component } from "react"; +import { WeaBrowser, WeaDialog, WeaFormItem, WeaSearchGroup } from "ecCom"; +import { Button, Modal } from "antd"; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + targetIds: "", + targetNames: "" + }; + } + + handleExternalPersonSave = () => { + const { targetIds } = this.state; + const { onExternalPersonSave } = this.props; + if (!_.isEmpty(targetIds)) { + onExternalPersonSave({ targetIds: targetIds.split(",") }); + } else { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + } + }; + + render() { + const { targetIds, targetNames } = this.state; + const { onCancel, visible, loading } = this.props; + const buttons = [ + , + + ]; + return ( + + + + this.setState({ targetIds, targetNames })} + /> + + + + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 4cea8b6f..6b369e25 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -37,6 +37,7 @@ import EmployeeList from "./pages/employeeView"; import ReportView from "./pages/reportView"; import MySalaryView from "./pages/mySalary/mySalaryView"; import WatermarkPreview from "./pages/payroll/watermarkPreview"; +import ExternalPersonManage from "./pages/externalPersonManage"; import stores from "./stores"; import "./style/index"; @@ -86,6 +87,7 @@ const DataAcquisition = (props) => props.children; // fieldManagement 字段管理 // analysisOfSalaryStatistics 薪酬统计分析 // reportView 薪酬报表查看 +// externalPersonManage 非系统人员管理 const Routes = ( + ); diff --git a/pc4mobx/hrmSalary/pages/calculate/index.js b/pc4mobx/hrmSalary/pages/calculate/index.js index 033b9cd3..94ddb0f6 100644 --- a/pc4mobx/hrmSalary/pages/calculate/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/index.js @@ -202,7 +202,7 @@ export default class Calculate extends React.Component { style={{ display: "inline-block", marginRight: 8 }}> this.handleOperateClick(it.index, record)}> {it.text} diff --git a/pc4mobx/hrmSalary/pages/calculate/index.less b/pc4mobx/hrmSalary/pages/calculate/index.less index cec45959..2a274b60 100644 --- a/pc4mobx/hrmSalary/pages/calculate/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/index.less @@ -4,6 +4,12 @@ } .formItem { + display: flex; + + .ant-col-8 { + line-height: 30px; + } + .wea-select, .ant-select { width: 100%; } diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/customExportDialog.js b/pc4mobx/hrmSalary/pages/calculateDetail/customExportDialog.js new file mode 100644 index 00000000..601890a1 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculateDetail/customExportDialog.js @@ -0,0 +1,127 @@ +/* + * Author: 黎永顺 + * name: 薪资核算-自定义导出字段弹框 + * Description: + * Date: 2023/7/17 + */ +import React, { Component } from "react"; +import { Button, Col, message, Row } from "antd"; +import { WeaCheckbox, WeaDialog, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import { customCacheExportField } from "../../apis/calculate"; +import { convertToUrlString, getQueryString } from "../../util/url"; +import "./acctResult/importModal/index.less"; + + +const { getLabel } = WeaLocaleProvider; + +class CustomExportDialog extends Component { + constructor(props) { + super(props); + this.state = { + itemsCheckeds: [], + showOnlyChecked: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + this.setState({ + itemsCheckeds: !_.isEmpty(nextProps.checkItems) ? nextProps.checkItems : [] + }); + } + } + + customExportClick = () => { + const { searchItemsValue } = this.props; + const { itemsCheckeds } = this.state; + customCacheExportField({ salaryItems: _.map(itemsCheckeds, it => it.toString()) }).then(({ status, errorMsg }) => { + if (status) { + const { consolidatedTaxation, ...extra } = searchItemsValue; + const payload = { ...extra, consolidatedTaxation: consolidatedTaxation === "0" ? "" : consolidatedTaxation }; + window.open( + `/api/bs/hrmsalary/salaryacct/acctresult/exportWithCustomFields?salaryAcctRecordId=${getQueryString("id")}&ids=&${convertToUrlString(payload)}&salaryItemIds=${itemsCheckeds.join(",")}` + ); + } else { + message.error(errorMsg); + } + }); + }; + handleShowOnlyChecked = (showOnlyChecked) => this.setState({ showOnlyChecked: !!Number(showOnlyChecked) }); + handleSelectGroupAll = (groupId, checked) => { + const { itemsCheckeds } = this.state; + const { itemsByGroup } = this.props; + _.map(itemsByGroup, item => { + if (item.salarySobItemGroupId === groupId) { + if (!!Number(checked)) { + this.setState({ + itemsCheckeds: [...itemsCheckeds, ..._.map(item.salaryItems, child => child.salaryItemId)] + }); + } else { + this.setState({ + itemsCheckeds: _.differenceWith(itemsCheckeds, _.map(item.salaryItems, child => child.salaryItemId), _.isEqual) + }); + } + } + }); + }; + + render() { + const { showOnlyChecked, itemsCheckeds } = this.state; + const { itemsByGroup } = this.props; + let dataSource = _.map(itemsByGroup, item => { + return { + ...item, + salaryItems: _.map(item.salaryItems, child => { + return { ...child, checked: itemsCheckeds.includes(child.salaryItemId) }; + }) + }; + }); + if (showOnlyChecked) { + dataSource = _.map(dataSource, item => { + return { ...item, salaryItems: _.filter(item.salaryItems, it => !!it.checked) }; + }); + } + return ( + {getLabel(17416, "导出")}, + + ]} + bottomLeft={} + > + { + _.map(dataSource, item => { + const { salarySobItemGroupName, salaryItems, salarySobItemGroupId } = item; + const value = _.every(salaryItems, it => !!it.checked) ? "1" : "0"; + return this.handleSelectGroupAll(salarySobItemGroupId, val)}/>}> + + { + !_.isEmpty(salaryItems) ? + _.map(salaryItems, it => { + const { salaryItemId, salaryItemName, checked } = it; + return + this.setState({ itemsCheckeds: _.xorWith(itemsCheckeds, [salaryItemId], _.isEqual) })}/> + ; + }) : {getLabel(83553, "暂无数据")} + } + + ; + }) + } + + ); + } +} + +export default CustomExportDialog; diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/index.js b/pc4mobx/hrmSalary/pages/calculateDetail/index.js index 8e68aa1d..e2e49517 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/index.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/index.js @@ -17,12 +17,12 @@ import { import { convertToUrlString, getQueryString } from "../../util/url"; import AcctResultImportModal from "./acctResult/importModal/acctResultImportModal"; import ProgressModal from "../../components/progressModal"; -import { salaryacctAcctresultCheckAuth } from "../../apis/calculate"; +import { getExportField, salaryacctAcctresultCheckAuth } from "../../apis/calculate"; +import CustomExportDialog from "./customExportDialog"; import Authority from "../mySalary/authority"; - -const { ButtonSelect } = WeaDropdown; const getLabel = WeaLocaleProvider.getLabel; +const { ButtonSelect } = WeaDropdown; @inject("calculateStore", "salaryFileStore", "taxAgentStore") @observer export default class CalculateDetail extends React.Component { @@ -36,7 +36,7 @@ export default class CalculateDetail extends React.Component { departmentIds: "", positionIds: "", subcompanyIds: "", - status: "", + statuses: "", consolidatedTaxation: "0" }, selectedKey: "0", @@ -46,7 +46,10 @@ export default class CalculateDetail extends React.Component { progress: 0, accountIds: [], accountExceptInfo: "", - calculateAuth: false + calculateAuth: false, + customExportParams: { + visible: false, checkItems: [], itemsByGroup: [] + } }; this.id = ""; this.timer = null; @@ -125,7 +128,7 @@ export default class CalculateDetail extends React.Component { ); }; Select = (value, key) => { - const { status } = this.state.searchItemsValue; + const { statuses } = this.state.searchItemsValue; return ( this.setState({ searchItemsValue: { ...this.state.searchItemsValue, [key]: val } })}/> @@ -246,9 +252,26 @@ export default class CalculateDetail extends React.Component { window.open( `/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=${this.id}&ids=&${convertToUrlString(payload)}` ); + } else if (e.key === "4") { + // 自定义导出 + this.getExportField(); } }; + getExportField = () => { + getExportField({ salaryAcctRecordId: getQueryString("id") }).then(({ status, data }) => { + if (status) { + const { checkItems, itemsByGroup } = data; + this.setState({ + customExportParams: { + visible: true, + checkItems, itemsByGroup + } + }); + } + }); + }; + // 导入表单添加表头回调 handleAcctModalAdd(fieldData) { this.setState({ @@ -291,13 +314,21 @@ export default class CalculateDetail extends React.Component { }; render() { - const { selectedKey, acctResultImportVisiable, showSearchAd, calculateAuth } = this.state; + const { + selectedKey, + acctResultImportVisiable, + showSearchAd, + calculateAuth, + customExportParams, + searchItemsValue + } = this.state; const { taxAgentStore: { payrollPermission } } = this.props; const menu = ( {getLabel(32935, "导入")} {getLabel(543249, "线下对比")} {getLabel(81272, "导出全部")} + {getLabel(111, "自定义导出")} ); @@ -348,7 +379,7 @@ export default class CalculateDetail extends React.Component { workcode: "", departmentIds: "", positionIds: "", - status: "", + statuses: "", consolidatedTaxation: "0" } })}> @@ -366,7 +397,7 @@ export default class CalculateDetail extends React.Component { { com: this.Browser(getLabel(33553, "分部"), "subcompanyIds") }, { com: this.Browser(getLabel(27511, "部门"), "departmentIds") }, { com: this.Browser(getLabel(6086, "岗位"), "positionIds") }, - { com: this.Select(getLabel(535101, "状态"), "status") }, + { com: this.Select(getLabel(535101, "状态"), "statuses") }, { com: this.Checkbox(getLabel(542607, "合并计税"), "consolidatedTaxation") } ]; return ; @@ -401,7 +432,7 @@ export default class CalculateDetail extends React.Component { /> {selectedKey == 0 && } {selectedKey == 1 && this.setState({ accountIds: ids })} - employeeName={this.state.searchValue}/>} + employeeName={this.state.searchItemsValue}/>} {acctResultImportVisiable && } + { + this.setState({ + customExportParams: { + visible: false, checkItems: [], itemsByGroup: [] + } + }); + }} + /> ); diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js index a989ccfa..63adb8f8 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js @@ -96,7 +96,7 @@ export default class SalaryDetail extends React.Component { url: "/api/bs/hrmsalary/salaryacct/acctresult/list", queryParams: { salaryAcctRecordId, - employeeName: this.props.employeeName, + ...this.props.employeeName, current, pageSize } }; @@ -111,7 +111,7 @@ export default class SalaryDetail extends React.Component { url: "/api/bs/hrmsalary/salaryacct/acctresult/list", queryParams: { salaryAcctRecordId, - employeeName: this.props.employeeName + ...this.props.employeeName } }; type && childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); @@ -160,7 +160,7 @@ export default class SalaryDetail extends React.Component { url: "/api/bs/hrmsalary/salaryacct/acctresult/list", queryParams: { salaryAcctRecordId, - employeeName: this.props.employeeName + ...this.props.employeeName } }; childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); @@ -194,7 +194,7 @@ export default class SalaryDetail extends React.Component { url: "/api/bs/hrmsalary/salaryacct/acctresult/list", queryParams: { salaryAcctRecordId, - employeeName: this.props.employeeName + ...this.props.employeeName } }; childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js b/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js index 074e3279..958bd281 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js @@ -51,7 +51,7 @@ export default class UserSure extends React.Component { workcode: "", departmentIds: "", positionIds: "", - status: "" + statuses: "" }, selectedKey: "0", selectedRowKeys: [], // table 选中项 @@ -112,7 +112,7 @@ export default class UserSure extends React.Component { ); }; Select = (value, key) => { - const { status } = this.state.searchItemsValue; + const { statuses } = this.state.searchItemsValue; return ( this.setState({ searchItemsValue: { ...this.state.searchItemsValue, [key]: val } })}/> @@ -154,7 +154,7 @@ export default class UserSure extends React.Component { url: "/api/bs/hrmsalary/salaryacct/acctemployee/list", queryParams: { salaryAcctRecordId, - employeeName: this.state.userListSearchValue + ...this.state.searchItemsValue, } }; childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); //window.postMessage @@ -174,7 +174,7 @@ export default class UserSure extends React.Component { url: "/api/bs/hrmsalary/salaryacct/acctemployee/list", queryParams: { salaryAcctRecordId, - employeeName: this.state.userListSearchValue, + ...this.state.searchItemsValue, current, pageSize } @@ -187,7 +187,7 @@ export default class UserSure extends React.Component { url: this.state.selectedKey === "1" ? "/api/bs/hrmsalary/salaryacct/reducedemployee/list" : "/api/bs/hrmsalary/salaryacct/addedemployee/list", queryParams: { salaryAcctRecordId, - employeeName: this.state.userListSearchValue, + ...this.state.searchItemsValue, current, pageSize } }; @@ -214,7 +214,7 @@ export default class UserSure extends React.Component { url: "/api/bs/hrmsalary/salaryacct/acctemployee/list", queryParams: { salaryAcctRecordId, - employeeName: this.state.userListSearchValue, + ...this.state.searchItemsValue, ...this.pageInfo } }; @@ -261,7 +261,7 @@ export default class UserSure extends React.Component { url: "/api/bs/hrmsalary/salaryacct/acctemployee/list", queryParams: { salaryAcctRecordId, - employeeName: this.state.userListSearchValue, + ...this.state.searchItemsValue, ...this.pageInfo, current: 1 } @@ -292,7 +292,7 @@ export default class UserSure extends React.Component { url: "/api/bs/hrmsalary/salaryacct/acctemployee/list", queryParams: { salaryAcctRecordId, - employeeName: this.state.userListSearchValue, + ...this.state.searchItemsValue, ...this.pageInfo } }; @@ -318,7 +318,7 @@ export default class UserSure extends React.Component { url: "/api/bs/hrmsalary/salaryacct/acctemployee/list", queryParams: { salaryAcctRecordId, - employeeName: this.state.userListSearchValue, + ...this.state.searchItemsValue, ...this.pageInfo } }; @@ -379,7 +379,7 @@ export default class UserSure extends React.Component { employeeName: "", departmentIds: "", positionIds: "", - status: "" + statuses: "" } })}> {getLabel(2022, "重置")} @@ -395,7 +395,7 @@ export default class UserSure extends React.Component { { com: this.Input(getLabel(1933, "工号"), "workcode") }, { com: this.Browser(getLabel(27511, "部门"), "departmentIds") }, { com: this.Browser(getLabel(6086, "岗位"), "positionIds") }, - { com: this.Select(getLabel(535101, "状态"), "status") } + { com: this.Select(getLabel(535101, "状态"), "statuses") } ]; return ; }; @@ -464,7 +464,7 @@ export default class UserSure extends React.Component { url: "/api/bs/hrmsalary/salaryacct/acctemployee/list", queryParams: { salaryAcctRecordId, - employeeName: this.state.userListSearchValue + ...this.state.searchItemsValue, } }; childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); //window.postMessage @@ -494,7 +494,7 @@ export default class UserSure extends React.Component { url: "/api/bs/hrmsalary/salaryacct/reducedemployee/list", queryParams: { salaryAcctRecordId, - employeeName: this.state.userListSearchValue + ...this.state.searchItemsValue, } }; childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); @@ -524,7 +524,7 @@ export default class UserSure extends React.Component { url: "/api/bs/hrmsalary/salaryacct/addedemployee/list", queryParams: { salaryAcctRecordId, - employeeName: this.state.userListSearchValue + ...this.state.searchItemsValue, } }; childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); diff --git a/pc4mobx/hrmSalary/pages/externalPersonManage/components/externalPersonManageEditSlide.js b/pc4mobx/hrmSalary/pages/externalPersonManage/components/externalPersonManageEditSlide.js new file mode 100644 index 00000000..c564b29e --- /dev/null +++ b/pc4mobx/hrmSalary/pages/externalPersonManage/components/externalPersonManageEditSlide.js @@ -0,0 +1,133 @@ +/* + * Author: 黎永顺 + * name: 非系统人员管理表单项 + * Description: + * Date: 2023/3/13 + */ +import React, { Component } from "react"; +import { WeaSlideModal } from "ecCom"; +import { message } from "antd"; +import { getConditionDomkeys, getSearchs } from "../../../util"; +import SlideModalTitle from "../../../components/slideModalTitle"; +import { detail, save, update } from "../../../apis/externalPersonManage"; + +class ExternalPersonManageEditSlide extends Component { + constructor(props) { + super(props); + this.state = { + date: "", + loading: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible && nextProps.id) this.detail(nextProps); + } + + detail = (props) => { + const { form, id, condition } = props; + detail({ id }).then(({ status, data }) => { + if (status) { + form.updateFields({ + "departmentId": { + value: data["departmentId"], + valueSpan: data["departmentOrgName"], + valueObj: [{ id: data["departmentId"], name: data["departmentOrgName"] }] + } + }); + form.updateFields({ + "subcompanyId": { + value: data["subcompanyId"], + valueSpan: data["subcompanyOrgName"], + valueObj: [{ id: data["subcompanyId"], name: data["subcompanyOrgName"] }] + } + }); + // form.updateFields({ + // "jobtitleId": { + // value: jobtitleId, + // valueSpan: data["jobtitleOrgName"], + // valueObj: [{ id: jobtitleId, name: data["jobtitleOrgName"] }] + // } + // }); + _.map(_.without(getConditionDomkeys(condition), "departmentId", "subcompanyId"), item => { + form.updateFields({ [item]: { value: data[item] } }, false); + }); + } + }); + }; + + handleSubmit = () => { + const { form, id, onCancel, title } = this.props; + form.validateForm().then(f => { + if (f.isValid) { + const tmpV = _.reduce(_.keys(form.getFormDatas()), (pre, cur) => { + if (cur === "departmentId") { + return _.assign(pre, { + [cur]: form.getFormDatas()[cur].value, + departmentName: form.getFormDatas()["departmentId"].valueSpan + }); + } else if (cur === "subcompanyId") { + return _.assign(pre, { + [cur]: form.getFormDatas()[cur].value, + subcompanyName: form.getFormDatas()["subcompanyId"].valueSpan + }); + } + return _.assign(pre, { [cur]: form.getFormDatas()[cur].value }); + }, {}); + const payload = _.omitBy(form.getFormParams(), _.isNil); + this.setState({ loading: true }); + const APIFOX = !id ? save : update; + APIFOX(id ? { ...payload, id } : payload).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(`${title}成功`); + onCancel(true); + } else { + message.error(errormsg || `${title}失败`); + } + }).catch(() => this.setState({ loading: false })); + } else { + f.showErrors(); + this.setState({ date: new Date() }); + } + }); + }; + handleFormChange = (res) => { + const { form, id } = this.props; + if (_.keys(res)[0] === "departmentId" || _.keys(res)[0] === "subcompanyId") { + const key = _.replace(_.keys(res)[0], "Id", "Name"); + form.updateFields({ [key]: res[_.keys(res)[0]].valueSpan || "" }); + } + }; + + render() { + const { loading } = this.state; + const { visible, title, onCancel, showOperateBtn, form, condition } = this.props; + return ( + + } + content={getSearchs(form, condition, 1, false, this.handleFormChange)} + onClose={onCancel} + /> + ); + } +} + +export default ExternalPersonManageEditSlide; diff --git a/pc4mobx/hrmSalary/pages/externalPersonManage/conditions.js b/pc4mobx/hrmSalary/pages/externalPersonManage/conditions.js new file mode 100644 index 00000000..c208e585 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/externalPersonManage/conditions.js @@ -0,0 +1,208 @@ +export const searchCondition = [ + { + items: [ + { + colSpan: 2, + conditionType: "INPUT", + domkey: ["username"], + fieldcol: 16, + label: "姓名", + labelcol: 8, + value: "", + viewAttr: 2 + } + ], + defaultshow: true + } +]; +export const condition = [ + { + items: [ + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["username"], + rules: "required|string", + fieldcol: 18, + label: "姓名", + labelcol: 6, + value: "", + viewAttr: 3 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: true, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "部门", + type: "57", + viewAttr: 2 + }, + colSpan: 1, + conditionType: "BROWSER", + domkey: ["departmentId"], + fieldcol: 18, + label: "部门", + labelcol: 6, + viewAttr: 2 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["departmentName"], + fieldcol: 18, + label: "部门名称", + labelcol: 6, + value: "", + hasBorder: true, + viewAttr: 1 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: true, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "分部", + type: "164", + viewAttr: 2 + }, + colSpan: 1, + conditionType: "BROWSER", + domkey: ["subcompanyId"], + fieldcol: 18, + label: "分部", + labelcol: 6, + viewAttr: 2 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["subcompanyName"], + fieldcol: 18, + label: "分部名称", + labelcol: 6, + value: "", + hasBorder: true, + viewAttr: 1 + }, + // { + // browserConditionParam: { + // completeParams: {}, + // conditionDataParams: {}, + // dataParams: {}, + // destDataParams: {}, + // hasAddBtn: false, + // hasAdvanceSerach: false, + // idSeparator: ",", + // isAutoComplete: 1, + // isDetail: 0, + // isMultCheckbox: false, + // isSingle: true, + // icon: "icon-coms-hrm", + // linkUrl: "", + // pageSize: 10, + // quickSearchName: "", + // replaceDatas: [], + // title: "岗位", + // type: "24", + // viewAttr: 2, + // }, + // colSpan: 1, + // conditionType: "BROWSER", + // domkey: ["jobtitleId"], + // fieldcol: 18, + // label: "岗位", + // labelcol: 6, + // viewAttr: 2, + // }, + { + colSpan: 1, + conditionType: "DATEPICKER", + domkey: ["companystartdate"], + fieldcol: 18, + label: "入职日期", + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["mobile"], + fieldcol: 18, + label: "手机", + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["workcode"], + fieldcol: 18, + label: "工号", + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["idNo"], + fieldcol: 18, + label: "身份证号码", + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["bankCardNum"], + fieldcol: 18, + label: "本人开户的银行卡卡号", + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["bankName"], + fieldcol: 18, + label: "本人开户的银行卡开户支行全称", + labelcol: 6, + value: "", + viewAttr: 2 + } + ], + defaultshow: true, + title: "基本信息" + } +]; diff --git a/pc4mobx/hrmSalary/pages/externalPersonManage/index.js b/pc4mobx/hrmSalary/pages/externalPersonManage/index.js new file mode 100644 index 00000000..265f5e0b --- /dev/null +++ b/pc4mobx/hrmSalary/pages/externalPersonManage/index.js @@ -0,0 +1,177 @@ +/* + * Author: 黎永顺 + * name: 非系统人员管理 + * Description: + * Date: 2023/3/13 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaTab, WeaTable, WeaTop } from "ecCom"; +import ExternalPersonManageEditSlide from "./components/externalPersonManageEditSlide"; +import { Button, message, Modal } from "antd"; +import { getSearchs } from "../../util"; +import { condition, searchCondition } from "./conditions"; +import { deleteExtEmp, listPage } from "../../apis/externalPersonManage"; +import "./index.less"; + +@inject("externalPersonManageStore", "taxAgentStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, + selectedRowKeys: [], + pageInfo: { current: 1, pageSize: 10, total: 0 }, + showSearchAd: false, + externalPersonManagePayload: { + visible: false, title: "新建", id: "" + } + }; + } + + componentDidMount() { + const { externalPersonManageStore: { form, addForm } } = this.props; + form.initFormFields(searchCondition); + addForm.initFormFields(condition); + this.listPage(); + } + + listPage = () => { + const { pageInfo } = this.state; + const { externalPersonManageStore: { form } } = this.props; + const payload = { ...pageInfo, ...form.getFormParams() }; + listPage(payload).then(({ status, data }) => { + if (status) { + const { list: dataSource, columns, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, columns, + pageInfo: { ...pageInfo, current, pageSize, total } + }); + } + }); + }; + deleteExtEmp = (ids) => { + deleteExtEmp(ids).then(({ status, errormsg }) => { + if (status) { + message.success("删除成功"); + this.listPage(); + } else { + message.error(errormsg || "删除失败"); + } + }); + }; + handleDelete = (id) => { + Modal.confirm({ + title: "信息确认", + content: "确定删除吗", + onOk: () => this.deleteExtEmp([id]) + }); + }; + handleCancel = (isRefresh) => { + const { externalPersonManagePayload } = this.state; + const { externalPersonManageStore: { addForm } } = this.props; + addForm.resetForm(); + this.setState({ + externalPersonManagePayload: { + ...externalPersonManagePayload, + visible: false, title: "新建", id: "" + } + }, () => isRefresh && this.listPage()); + }; + handleAdd = (id = "") => { + const { externalPersonManagePayload } = this.state; + this.setState({ + externalPersonManagePayload: { + ...externalPersonManagePayload, + visible: true, id, title: id ? "编辑" : "新建" + } + }); + }; + getColumns = () => { + const { columns } = this.state; + return _.map(_.filter(columns, item => !!item.display), child => ({ + ...child, + render: (text) => { + return {text}; + } + })); + }; + + render() { + const { showSearchAd, externalPersonManagePayload, loading, pageInfo, selectedRowKeys, dataSource } = this.state; + const { externalPersonManageStore: { form, addForm }, taxAgentStore: { showOperateBtn } } = this.props; + const pagination = { + current: pageInfo.current, + pageSize: pageInfo.pageSize, + total: pageInfo.total, + showTotal: total => `共 ${total} 条`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.listPage()); + }, + onChange: current => { + this.setState({ pageInfo: { ...pageInfo, current } }, () => this.listPage()); + } + }; + const rowSelection = { + selectedRowKeys, + onChange: selectedRowKeys => this.setState({ selectedRowKeys }) + }; + return ( +
+ } + iconBgcolor="#F14A2D" showDropIcon={false} + > +
+ this.handleAdd()}>新建 + ] : []} + searchType={["base", "advanced"]} showSearchAd={showSearchAd} + setShowSearchAd={(showSearchAd) => this.setState({ showSearchAd })} + searchsAd={getSearchs(form, searchCondition, 2)} + searchsBasePlaceHolder="请输入姓名" onSearch={this.listPage} + onSearchChange={username => form.updateFields({ username })} + searchsBaseValue={form.getFormParams().username} + onAdSearch={() => this.setState({ showSearchAd: false }, () => this.listPage())} + onAdReset={() => form.resetForm()} onAdCancel={() => this.setState({ showSearchAd: false })} + /> + ( + + this.handleAdd(id)} + style={{ paddingRight: 8 }}>编辑 + {/* this.handleDelete(id)}>删除*/} + + ) + } + ] : []} + dataSource={dataSource} + pagination={pagination} + rowSelection={rowSelection} + xWidth={800} + /> + +
+
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/externalPersonManage/index.less b/pc4mobx/hrmSalary/pages/externalPersonManage/index.less new file mode 100644 index 00000000..8b13dd6f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/externalPersonManage/index.less @@ -0,0 +1,14 @@ +.externalPerWrapper { + width: 100%; + height: 100%; + + .externalPerCont { + height: 100%; + } +} + +.slideOuterWrapper { + .hideFormItem { + display: none !important; + } +} diff --git a/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js b/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js index e0544e50..354ee82c 100644 --- a/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js +++ b/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js @@ -6,7 +6,17 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaCheckbox, WeaFormItem, WeaHelpfulTip, WeaInput, WeaSelect, WeaSlideModal, WeaTextarea, WeaInputNumber, WeaLocaleProvider } from "ecCom"; +import { + WeaCheckbox, + WeaFormItem, + WeaHelpfulTip, + WeaInput, + WeaInputNumber, + WeaLocaleProvider, + WeaSelect, + WeaSlideModal, + WeaTextarea +} from "ecCom"; import { message, Modal } from "antd"; import SlideModalTitle from "../../../components/slideModalTitle"; import { getSalaryFieldForm, saveSalaryField } from "../../../apis/fieldManage"; @@ -55,6 +65,7 @@ class FieldSlide extends Component { const { name, useDefault, + hideDefault, useInEmployeeSalary, dataType, description, @@ -69,6 +80,7 @@ class FieldSlide extends Component { name, useInEmployeeSalary: useInEmployeeSalary ? useInEmployeeSalary.toString() : "0", useDefault: useDefault ? useDefault.toString() : "0", + hideDefault: hideDefault ? hideDefault.toString() : "0", dataType, description, sortedIndex, @@ -121,6 +133,7 @@ class FieldSlide extends Component { const { name, useDefault, + hideDefault, useInEmployeeSalary, dataType, description, @@ -134,6 +147,7 @@ class FieldSlide extends Component { name, useInEmployeeSalary: Number(useInEmployeeSalary), useDefault: Number(useDefault), + hideDefault: Number(hideDefault), dataType, description, sortedIndex, @@ -169,6 +183,7 @@ class FieldSlide extends Component { name: "", useInEmployeeSalary: "1", useDefault: "0", + hideDefault: "0", sharedType: "0", taxAgentIds: "", dataType: "number", @@ -192,6 +207,7 @@ class FieldSlide extends Component { name, useInEmployeeSalary, useDefault, + hideDefault, shareTypeList, sharedType, taxAgentIds, @@ -251,6 +267,17 @@ class FieldSlide extends Component { placement="topLeft" /> + + this.handleChangeFields("hideDefault", value)} + /> + + { const { dataIndex } = item; - if (dataIndex === "useDefault") { + if (dataIndex === "useDefault" || dataIndex === "hideDefault") { item.render = (text) => (); } else if (dataIndex === "operate") { item.width = 120; diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js index 3fd12c19..23d0a66e 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js @@ -11,19 +11,25 @@ import { WeaButtonIcon, WeaInputSearch, WeaLocaleProvider, WeaTab } from "ecCom" import PersonalScopeTable from "../../../components/PersonalScopeTable"; import PersonalScopeModal from "../../../components/PersonalScopeModal"; import { + deleteLedgerPersonExtRange, deleteLedgerPersonRange, getLedgerPersonRangeExclude, + getLedgerPersonRangeExtList, getLedgerPersonRangeInclude, salarysobRangeImportData, salarysobRangePreview, + saveLedgerPersonExtRange, saveLedgerPersonRange } from "../../../apis/ledger"; import ImportModal from "../../../components/importModal"; import { importEmployColumns } from "../../taxAgent/columns"; +import ExternalPersonModal from "../../../components/externalPersonModal"; +import { sysinfo } from "../../../apis/ruleconfig"; const APIFox = { listInclude: getLedgerPersonRangeInclude, - listExclude: getLedgerPersonRangeExclude + listExclude: getLedgerPersonRangeExclude, + externalList: getLedgerPersonRangeExtList }; const APISaveFox = { save: saveLedgerPersonRange @@ -41,6 +47,8 @@ class LedgerAssociatedPersonnel extends Component { selectedKey: "listInclude", rowKeys: [], previewDataSource: [], + externalPersonModalVisible: false, + loading: false, importParams: { visible: false, step: 0, @@ -50,10 +58,45 @@ class LedgerAssociatedPersonnel extends Component { visible: false, title: getLabel(543467, "关联人员"), includeType: "" - } + }, + extEmpsWitch: "1" //非系统人员开关, 1: 开启, 0:关闭 }; } + componentDidMount() { + this.getSysinfo(); + } + + /* + * Author: 黎永顺 + * Description: 非系统人员开关查询 + * Params: + * Date: 2023/7/14 + */ + getSysinfo = () => { + sysinfo().then(({ status, data }) => { + if (status) this.setState({ extEmpsWitch: data.extEmpsWitch }); + }); + }; + /* + * Author: 黎永顺 + * Description:外部人员保存 + * Params: + * Date: 2023/3/14 + */ + handleSaveExternalPerson = (val) => { + const { editId: salarySobId, saveSalarySobId } = this.props; + saveLedgerPersonExtRange({ ...val, salarySobId: salarySobId || saveSalarySobId }).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success("保存成功"); + this.setState({ externalPersonModalVisible: false }); + this.personalScopeTableRef.getPersonalScopeList(); + } else { + message.error(errormsg || "保存失败"); + } + }).catch(() => this.setState({ loading: true })); + }; /* * Author: 黎永顺 * Description: 删除人员范围 @@ -61,23 +104,55 @@ class LedgerAssociatedPersonnel extends Component { * Date: 2022/11/30 */ taxAgentRangeDelete = () => { + const { selectedKey } = this.state; Modal.confirm({ title: getLabel(131329, "信息确认"), content: getLabel(388758, "确认要删除吗?"), onOk: () => { - deleteLedgerPersonRange(this.state.rowKeys).then(({ status, errormsg }) => { - if (status) { - message.success(getLabel(502230, "删除成功")); - this.setState({ rowKeys: [] }, () => { - this.personalScopeTableRef.clearRowkeys(); - }); - } else { - message.error(errormsg || getLabel(20462, "删除失败")); - } - }); + return new Promise((resolve, reject) => { + return selectedKey === "externalList" ? this.deleteLedgerPersonExtRange(resolve, reject) : this.deleteLedgerPersonRange(resolve, reject); + }).catch(() => console.log("出错!")); } }); }; + deleteLedgerPersonExtRange = (resolve, reject) => { + message.destroy(); + message.loading(getLabel(111, "正在删除中..."), 0); + deleteLedgerPersonExtRange(this.state.rowKeys).then(({ status, errormsg }) => { + message.destroy(); + resolve(); + if (status) { + message.success(getLabel(502230, "删除成功")); + this.setState({ rowKeys: [] }, () => { + this.personalScopeTableRef.clearRowkeys(); + }); + } else { + message.error(errormsg || getLabel(20462, "删除失败")); + } + }).catch(() => { + message.destroy(); + reject(); + }); + }; + deleteLedgerPersonRange = (resolve, reject) => { + message.destroy(); + message.loading(getLabel(111, "正在删除中..."), 0); + deleteLedgerPersonRange(this.state.rowKeys).then(({ status, errormsg }) => { + message.destroy(); + resolve(); + if (status) { + message.success(getLabel(502230, "删除成功")); + this.setState({ rowKeys: [] }, () => { + this.personalScopeTableRef.clearRowkeys(); + }); + } else { + message.error(errormsg || getLabel(20462, "删除失败")); + } + }).catch(() => { + message.destroy(); + reject(); + }); + }; /* * Author: 黎永顺 * Description:新增人员范围 @@ -86,13 +161,17 @@ class LedgerAssociatedPersonnel extends Component { */ handleAddPersonal = () => { const { personalAddModal, selectedKey } = this.state; - this.setState({ - personalAddModal: { - ...personalAddModal, - visible: true, - includeType: selectedKey === "listInclude" ? 1 : 0 - } - }); + if (selectedKey === "externalList") { + this.setState({ externalPersonModalVisible: true }); + } else { + this.setState({ + personalAddModal: { + ...personalAddModal, + visible: true, + includeType: selectedKey === "listInclude" ? 1 : 0 + } + }); + } }; /* * Author: 黎永顺 @@ -140,7 +219,9 @@ class LedgerAssociatedPersonnel extends Component { rowKeys, personalAddModal, importParams, - previewDataSource + previewDataSource, + externalPersonModalVisible, + loading, extEmpsWitch } = this.state; const { taxAgentStore: { showOperateBtn }, editId, saveSalarySobId } = this.props; const topTab = [ @@ -151,6 +232,10 @@ class LedgerAssociatedPersonnel extends Component { { title: getLabel(543489, "从范围中排除"), viewcondition: "listExclude" + }, + { + title: "非系统人员范围", + viewcondition: "externalList" } ]; const btns = showOperateBtn ? [ @@ -191,10 +276,10 @@ class LedgerAssociatedPersonnel extends Component { return (
this.setState({ selectedKey })} /> )} + {/*非系统人员添加*/} + this.setState({ externalPersonModalVisible: false })} + onExternalPersonSave={this.handleSaveExternalPerson} + /> {/*新增人员范围*/} ; + return ; default: return
; } @@ -97,6 +98,7 @@ export default class LedgerSalaryItemAddModal extends React.Component { if (item.id === key) { item.salaryItemId = item.id; item.key = item.id; + item.itemHide = item.hideDefault; item.sortedIndex = (!_.isEmpty(_.maxBy(arrItems, it => it.sortedIndex)) ? _.maxBy(arrItems, it => it.sortedIndex).sortedIndex : 0) + keyIdx + 1; selectItems.push(item); } diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js index 22d28efa..e8fdb2a7 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js @@ -2,15 +2,17 @@ import React from "react"; import { inject, observer } from "mobx-react"; import { getQueryString } from "../../util/url"; import { WeaDialog, WeaError, WeaInput, WeaLocaleProvider } from "ecCom"; -import { Button, message } from "antd"; +import { Button, message, Modal } from "antd"; import Authority from "../mySalary/authority"; import ComputerTemplate from "../payroll/templatePreview/computerTemplate"; import PhoneTemplate from "../payroll/templatePreview/phoneTemplate"; import "../payroll/templatePreview/index.less"; import * as API from "../../apis/mySalaryBenefits"; -import { payrollCheckType } from "../../apis/payroll"; -import "./index.less"; +import { confirmSalaryBill, feedBackSalaryBill, payrollCheckType } from "../../apis/payroll"; import CaptchaModal from "../../components/captchaModal"; +import PassSetDialog from "./passSetDialog"; +import { ConfirmBtns } from "../mySalary/mySalaryView"; +import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; @inject("mySalaryStore") @@ -19,9 +21,11 @@ export default class MobilePayroll extends React.Component { constructor(props) { super(props); this.state = { + pwdSetVisible: false, visible: false, captchaVisible: false, authCode: "", + notSetting: false, mySalaryBillData: { employeeInformation: {}, salaryTemplate: [] @@ -50,7 +54,11 @@ export default class MobilePayroll extends React.Component { // if (window.em) { API.isNeedSecondPwdVerify({ mouldCode: "HRM", itemCode: "SALARY" }).then(({ status, isNeedSecondAuth }) => { if (status && isNeedSecondAuth) { - this.setState({ visible: true }); + this.setState({ visible: true }, () => { + API.getSecondAuthForm({ mouldCode: "HRM", itemCode: "SALARY" }).then(({ status, notSetting }) => { + this.setState({ notSetting }); + }); + }); } else { this.getMySalaryBill(getQueryString("id")); setInitEmVerify(); @@ -105,10 +113,38 @@ export default class MobilePayroll extends React.Component { } return params; }; + confirmSalaryBill = () => { + confirmSalaryBill({ salaryInfoId: getQueryString("id") }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(30700, "操作成功")); + this.getMySalaryBill(getQueryString("id")); + } else { + message.error(errormsg || getLabel(30651, "操作失败")); + } + }); + }; + handleGoFeedback = () => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "请确认薪资信息是有误,进行反馈并发起反馈流程。"), + onOk: () => { + feedBackSalaryBill({ salaryInfoId: getQueryString("id") }).then(({ status, errorMsg }) => { + if (status) { + const { mySalaryBillData } = this.state; + const { salaryTemplate } = mySalaryBillData; + const { feedbackUrl } = salaryTemplate; + window.open(`${window.ecologyContentPath || ""}${feedbackUrl}`); + } else { + message.error(errorMsg); + } + }); + } + }); + }; render() { - const { mySalaryStore: { clearLoading } } = this.props; - const { mySalaryBillData, visible, captchaVisible } = this.state; + const { mySalaryStore: { clearLoading, pwdForm } } = this.props; + const { mySalaryBillData, visible, captchaVisible, notSetting, pwdSetVisible } = this.state; const type = getQueryString("type"); const employeeInformation = mySalaryBillData.employeeInformation ? mySalaryBillData.employeeInformation : {}; const salaryGroups = mySalaryBillData.salaryGroups ? mySalaryBillData.salaryGroups : []; @@ -127,9 +163,17 @@ export default class MobilePayroll extends React.Component { ]} > - this.setState({ authCode })}/> + this.setState({ authCode })}/> + { + notSetting && +
+ {getLabel("514970", "您还未设置二次验证密码,点击")} + this.setState({ pwdSetVisible: true })}>{getLabel("30747", "设置")} +
+ } + this.setState({ pwdSetVisible: false })}/> { type === "phone" ? + > + { + (_.isNil(mySalaryBillData.confirmStatus) || mySalaryBillData.confirmStatus === "0") && + + } +
@@ -153,7 +205,15 @@ export default class MobilePayroll extends React.Component { isPreview salaryTemplateShowSet={JSON.stringify(mySalaryBillData.salaryTemplate)} salaryItemSet={!_.isEmpty(salaryGroups) ? JSON.stringify([employeeInformation, ...salaryGroups]) : JSON.stringify([])} - /> + > + { + (_.isNil(mySalaryBillData.confirmStatus) || mySalaryBillData.confirmStatus === "0") && + + } + diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.less b/pc4mobx/hrmSalary/pages/mobilePayroll/index.less index c51890f3..923d3d82 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.less +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.less @@ -15,3 +15,27 @@ } } } + +.pwdSetWrapper { + .ant-modal-content { + width: 80vw !important; + + .wea-dialog-body, .wea-new-scroll { + height: 195px !important; + + .wea-search-group .wea-form-cell { + padding: 0 !important; + } + } + } + + .validatecodeWrapper { + display: flex; + align-items: center; + + .wea-input-normal { + width: 50% !important; + margin-right: 20px; + } + } +} diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/passSetDialog.js b/pc4mobx/hrmSalary/pages/mobilePayroll/passSetDialog.js new file mode 100644 index 00000000..f857ff41 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/passSetDialog.js @@ -0,0 +1,141 @@ +/* + * Author: 黎永顺 + * name: 二次验证密码设置 + * Description: + * Date: 2023/7/7 + */ +import React, { Component } from "react"; +import { WeaDialog, WeaFormItem, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import { WeaSwitch } from "comsMobx"; +import { condition, loginCondition } from "./pwdCondtion"; +import { Button, message } from "antd"; +import { RSAEcrypt } from "../../util/RSAUtil"; +import { checkPassword, saveSecondaryPwd } from "../../apis/mySalaryBenefits"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class PassSetDialog extends Component { + constructor(props) { + super(props); + this.state = { + src: (window.ecologyContentPath || "") + "/weaver/weaver.file.MakeValidateCode?notneedvalidate=1&isView=1&validatetype=0&validatenum=4", + num: 0, + isPassLoginPassword: false + }; + } + + componentDidMount() { + this.props.form.initFormFields(loginCondition); + this.props.form.initFormFields(condition); + } + + getSearchs = (form, condition) => { + const { isFormInit } = form, formParams = form.getFormParams(); + let group = []; + isFormInit && condition && condition.map(c => { + let items = []; + c.items.map(fields => { + items.push({ + com: ( + + { + fields.domkey[0] === "validatecode" ? +
+ + { + this.setState({ num: this.state.num + 1 }, () => { + this.setState({ src: `${window.ecologyContentPath || ""}/weaver/weaver.file.MakeValidateCode?notneedvalidate=1&isView=1&validatetype=0&validatenum=4&seriesnum_=${this.state.num}` }); + }); + }} + alt="" + /> +
+ : + } +
), + colSpan: 1 + }); + }); + group.push( + ); + }); + return group; + }; + saveSecondaryPassword = () => { + const { isPassLoginPassword } = this.state; + const { form } = this.props; + const { secondaryPwd1, secondaryPwd2, validatecode, password } = form.getFormParams(); + if (isPassLoginPassword) { + if (!validatecode || !secondaryPwd1 || !secondaryPwd2) { + message.error(getLabel(518702, "必要信息不完整,红色*为必填项!")); + return; + } + if (secondaryPwd1 !== secondaryPwd2) { + message.error(getLabel("504376", "密码确认不正确!")); + return; + } + } else { + if (!password) { + message.error(getLabel(518702, "必要信息不完整,红色*为必填项!")); + return; + } + } + const params = isPassLoginPassword ? { secondaryPwd1, secondaryPwd2 } : { password }; + RSAEcrypt("1", params).then(RSAParam => { + isPassLoginPassword ? + saveSecondaryPwd({ ...RSAParam, validatecode }).then(({ sign, message: msg }) => { + if (sign === "1") { + message.success(msg); + this.props.onCancel(); + form.resetForm(); + } else { + message.warning(msg); + this.setState({ num: this.state.num + 1 }, () => { + this.setState({ src: `${window.ecologyContentPath || ""}/weaver/weaver.file.MakeValidateCode?notneedvalidate=1&isView=1&validatetype=0&validatenum=4&seriesnum_=${this.state.num}` }); + }); + } + }) : + checkPassword({ ...RSAParam }).then(({ result }) => { + if (result) { + this.setState({ isPassLoginPassword: true }); + form.resetForm(); + } else { + message.error(getLabel(504343, "登录密码错误")); + } + }); + }); + }; + + render() { + const { isPassLoginPassword } = this.state; + return ( + {getLabel(537558, "保存")} + ]} + > + { + isPassLoginPassword ? + this.getSearchs(this.props.form, condition) : + this.getSearchs(this.props.form, loginCondition) + } + + ); + } +} + +export default PassSetDialog; diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/pwdCondtion.js b/pc4mobx/hrmSalary/pages/mobilePayroll/pwdCondtion.js new file mode 100644 index 00000000..e7c1fbbb --- /dev/null +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/pwdCondtion.js @@ -0,0 +1,69 @@ +import { WeaLocaleProvider } from "ecCom"; + +const { getLabel } = WeaLocaleProvider; +export const loginCondition = [ + { + items: [ + { + colSpan: 1, + checkbox: false, + checkboxValue: false, + conditionType: "INPUT", + domkey: ["password"], + fieldcol: 18, + label: getLabel(388431, "登录密码"), + labelcol: 6, + detailtype: 3, + rules: "required|string", + type: "password", + viewAttr: 3 + } + ], + title: "", + defaultshow: true + } +]; +export const condition = [ + { + items: [ + { + colSpan: 1, + checkbox: false, + checkboxValue: false, + conditionType: "INPUT", + domkey: ["secondaryPwd1"], + fieldcol: 18, + label: getLabel(409, "密码"), + labelcol: 6, + detailtype: 3, + rules: "required|string", + viewAttr: 3, + type: "password" + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["secondaryPwd2"], + fieldcol: 18, + label: getLabel(511112, "确认密码"), + labelcol: 6, + rules: "required|string", + viewAttr: 3, + type: "password" + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["validatecode"], + fieldcol: 18, + label: getLabel(511113, "验证码"), + labelcol: 6, + value: "", + rules: "required|string", + viewAttr: 3 + } + ], + title: "", + defaultshow: true + } +]; diff --git a/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js b/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js index bda458fb..24bf675e 100644 --- a/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js +++ b/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js @@ -6,12 +6,16 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; +import { Button, message, Modal } from "antd"; +import { WeaLocaleProvider } from "ecCom"; import Authority from "./authority"; import ComputerTemplate from "../payroll/templatePreview/computerTemplate"; -import { payrollCheckType } from "../../apis/payroll"; +import { confirmSalaryBill, feedBackSalaryBill, payrollCheckType } from "../../apis/payroll"; import CaptchaModal from "../../components/captchaModal"; import "../payroll/templatePreview/index.less"; +const { getLabel } = WeaLocaleProvider; + @inject("mySalaryStore") @observer class MySalaryView extends Component { @@ -37,6 +41,39 @@ class MySalaryView extends Component { } } + confirmSalaryBill = () => { + const { mySalaryStore: { getMySalaryBill }, params: { salaryInfoId } } = this.props; + confirmSalaryBill({ salaryInfoId }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(30700, "操作成功")); + getMySalaryBill(Number(salaryInfoId)).then(data => { + this.setState({ mySalaryStore: data }); + }); + } else { + message.error(errormsg || getLabel(30651, "操作失败")); + } + }); + }; + handleGoFeedback = () => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "请确认薪资信息是有误,进行反馈并发起反馈流程。"), + onOk: () => { + const { params: { salaryInfoId } } = this.props; + feedBackSalaryBill({ salaryInfoId }).then(({ status, errorMsg }) => { + if (status) { + const { mySalaryStore } = this.state; + const { salaryTemplate } = mySalaryStore; + const { feedbackUrl } = salaryTemplate; + window.open(`${window.ecologyContentPath || ""}${feedbackUrl}`); + } else { + message.error(errorMsg); + } + }); + } + }); + }; + render() { const { captchaVisible, mySalaryStore } = this.state; const { params: { salaryInfoId } } = this.props; @@ -56,7 +93,15 @@ class MySalaryView extends Component { isPreview isMsgPreview salaryTemplateShowSet={salaryTemplateShowSet ? JSON.stringify(salaryTemplateShowSet) : []} salaryItemSet={!_.isEmpty(salaryGroups) ? JSON.stringify([employeeInformation, ...salaryGroups]) : []} - /> + > + { + (_.isNil(mySalaryStore.confirmStatus) || mySalaryStore.confirmStatus === "0") && + + } + @@ -71,3 +116,10 @@ class MySalaryView extends Component { } export default MySalaryView; + +export const ConfirmBtns = (props) => { + return
+ + +
; +}; diff --git a/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js b/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js index 858d210b..d743943f 100644 --- a/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js +++ b/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js @@ -23,10 +23,7 @@ export default class SalarySendList extends React.Component { // 发放回调 handleGrant(record) { - window.open( - "/spa/hrmSalary/static/index.html#/main/hrmSalary/payrollGrant?id=" + - record.id - ); + window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/payrollGrant?id=${record.id}&ackFeedbackStatus=${record.ackFeedbackStatus}`); } // 查看详情 diff --git a/pc4mobx/hrmSalary/pages/payroll/index.js b/pc4mobx/hrmSalary/pages/payroll/index.js index 7e8fb025..86dcad04 100644 --- a/pc4mobx/hrmSalary/pages/payroll/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/index.js @@ -64,7 +64,12 @@ export default class Payroll extends React.Component { getReplenishForm = (isEdit = false, params = {}) => { const { payrollStore } = this.props; - const { templateBaseData, salaryTemplateShowSet, setReplenishSalaryTemplateSalaryItemSet } = payrollStore; + const { + templateBaseData, + salaryTemplateShowSet, + setReplenishSalaryTemplateSalaryItemSet, + setSalaryBillItemNameSet + } = payrollStore; if (!salaryTemplateShowSet.theme && !isEdit) { Modal.warning({ title: getLabel(131329, "信息确认"), @@ -77,10 +82,12 @@ export default class Payroll extends React.Component { if (!isEdit) { this.setState({ currentStep: this.state.currentStep + 1 }, () => { setReplenishSalaryTemplateSalaryItemSet(data.replenishSalaryTemplateSalaryItemSet); + setSalaryBillItemNameSet(data.salaryBillItemNameSet); window.localStorage.setItem("salary-showset", JSON.stringify(salaryTemplateShowSet)); }); } else { setReplenishSalaryTemplateSalaryItemSet(data.replenishSalaryTemplateSalaryItemSet); + setSalaryBillItemNameSet(data.salaryBillItemNameSet); window.localStorage.setItem("salary-showset", JSON.stringify(salaryTemplateShowSet)); } } @@ -261,7 +268,9 @@ export default class Payroll extends React.Component { setTemplateTableSelectedRowKeys, deletePayroll, templateBaseData, - setTemplateTablePageInfo + setTemplateTablePageInfo, + setSalaryBillItemNameSetting, + salaryBillItemNameSetting } = payrollStore; const { currentStep, selectedTab, templateSearchValue, templateSelect, startDate, endDate } = this.state; if (!hasRight && !loading) { // 无权限处理 @@ -316,7 +325,7 @@ export default class Payroll extends React.Component { { showOperateBtn && } { @@ -465,10 +474,16 @@ export default class Payroll extends React.Component { customOperate={ currentStep === 0 ? [ ] : currentStep === 1 ? [ , , @@ -477,6 +492,9 @@ export default class Payroll extends React.Component { }}>{getLabel(221, "预览")} ] : currentStep === 2 ? [ , @@ -506,7 +524,7 @@ export default class Payroll extends React.Component { className="slideOuterWrapper" visible={this.state.editSlideVisible} top={0} - width={50} + width={65} height={100} direction="right" measure="%" @@ -539,6 +557,9 @@ export default class Payroll extends React.Component { } subItemChange={(selectedTab) => { this.setState({ selectedTab: Number(selectedTab) }, () => { + setSalaryBillItemNameSetting(_.map(salaryBillItemNameSetting, it => { + return { ...it, salaryTemplateId: "", itemShowNameSetting: [] }; + })); if (this.state.selectedTab === 2) this.getReplenishForm(true, { id: this.state.templateCurrentId }); }); }} diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js index ba4cf77c..eb930f39 100644 --- a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js @@ -24,6 +24,7 @@ export default class PayrollGrant extends React.Component { selectedKey: "0", progressVisible: false, progress: 0, + showFeedbackColumn: false, payrollPartModalParams: { visible: false, title: getLabel(538012, "工资单发放"), @@ -38,7 +39,10 @@ export default class PayrollGrant extends React.Component { componentWillMount() { const { selectedKey } = this.state; let id = getQueryString("id"); - this.setState({ currentId: id }); + this.setState({ + currentId: id, + showFeedbackColumn: getQueryString("ackFeedbackStatus") === "1" + }); const { payrollStore: { getPayrollInfo, getInfoList, getPaySa } } = this.props; @@ -298,11 +302,12 @@ export default class PayrollGrant extends React.Component { }; getColumns = () => { + const { selectedKey, showFeedbackColumn } = this.state; const { payrollStore } = this.props; const { salaryGrantTableStore: columns, salarySendDetailBaseInfo } = payrollStore; const notShowGrantOrWithdraw = salarySendDetailBaseInfo.haveBackCalc === 1 && salarySendDetailBaseInfo.salaryAcctType === "0"; return _.map([ - ...toJS(columns), + ..._.filter(toJS(columns), it => ((selectedKey === "0" && it.dataIndex !== "billReadStatus" && it.dataIndex !== "billConfirmStatus") || (selectedKey === "1" && !showFeedbackColumn && it.dataIndex !== "billReadStatus" && it.dataIndex !== "billConfirmStatus") || (selectedKey === "1" && showFeedbackColumn))), { title: getLabel(30585, "操作"), key: "", @@ -601,6 +606,7 @@ export default class PayrollGrant extends React.Component { { this.state.progressVisible && { this.setState({ progressVisible: false, progress: 0 }); diff --git a/pc4mobx/hrmSalary/pages/payroll/stepForm/baseInformForm.js b/pc4mobx/hrmSalary/pages/payroll/stepForm/baseInformForm.js index c5333ca8..bd4c19ee 100644 --- a/pc4mobx/hrmSalary/pages/payroll/stepForm/baseInformForm.js +++ b/pc4mobx/hrmSalary/pages/payroll/stepForm/baseInformForm.js @@ -1,11 +1,23 @@ import React from "react"; -import { WeaCheckbox, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup, WeaSelect, WeaTimePicker } from "ecCom"; +import { + WeaCheckbox, + WeaFormItem, + WeaHelpfulTip, + WeaInput, + WeaInputNumber, + WeaLocaleProvider, + WeaSearchGroup, + WeaSelect, + WeaTimePicker +} from "ecCom"; import { inject, observer } from "mobx-react"; import { getReplenishRuleSetOptions } from "../../../apis/payroll"; +import { commonEnumList } from "../../../apis/payrollFiles"; import moment from "moment"; import { toJS } from "mobx"; import "./index.less"; + const getLabel = WeaLocaleProvider.getLabel; @inject("payrollStore") @observer @@ -16,6 +28,7 @@ export default class BaseInformForm extends React.Component { inited: false, options: [], replenishRuleOptions: [], + salaryMonthOptions: [], request: {} }; } @@ -24,6 +37,7 @@ export default class BaseInformForm extends React.Component { const { payrollStore } = this.props; const { getPayrollBaseForm } = payrollStore; const templateBaseData = window.localStorage.getItem("template-basedata") || "{}"; + this.commonEnumList(); getPayrollBaseForm(this.props.id).then(data => { this.setState( { @@ -37,7 +51,8 @@ export default class BaseInformForm extends React.Component { msgStatus: !this.props.id ? "1" : data.templateBaseData.msgStatus, reissueRule: data.templateBaseData.replenishRule ? "1" : "0", ...JSON.parse(templateBaseData), - sendEmail: "" + sendEmail: "", + autoSendStatus: !_.isNil(data.templateBaseData.autoSendStatus) ? data.templateBaseData.autoSendStatus : false } }, () => { this.props.onChange && this.props.onChange(this.state.request); @@ -50,7 +65,7 @@ export default class BaseInformForm extends React.Component { JSON.parse(templateBaseData).salarySob && this.getReplenishRuleSetOptions({ salarySobId: JSON.parse(templateBaseData).salarySob }); } - hanldeChange = (params) => { + handleChange = (params) => { let request = { ...this.state.request, ...params }; this.setState({ request @@ -72,23 +87,24 @@ export default class BaseInformForm extends React.Component { } }); }; + commonEnumList = () => { + commonEnumList({ enumClass: "com.engine.salary.enums.salarysend.SalaryAutoSendCycleTypeEnum" }) + .then(({ status, data }) => { + if (status && !_.isEmpty(data)) { + this.setState({ + salaryMonthOptions: _.map(data, it => ({ key: it.value.toString(), showname: it.defaultLabel })) + }); + } + }); + }; render() { - const { request, options, replenishRuleOptions } = this.state; + const { request, options, replenishRuleOptions, salaryMonthOptions } = this.state; const { - salarySob, - name, - description, - replenishName, - replenishRule, - reissueRule, - msgStatus, - emailStatus, - autoSendStatus, - autoSendDayOfMonth, - autoSendTimeOfDay + salarySob, name, description, replenishName, replenishRule, reissueRule, msgStatus, emailStatus, + ackFeedbackStatus, autoAckDays, feedbackUrl, autoSendStatus, autoSendDayOfMonth, autoSendTimeOfDay, + autoSendCycleType } = request; - return ( @@ -104,7 +120,7 @@ export default class BaseInformForm extends React.Component { options={options} value={salarySob ? salarySob : ""} style={{ width: 200 }} - onChange={value => this.hanldeChange({ salarySob: value })}/> + onChange={value => this.handleChange({ salarySob: value })}/> }
this.hanldeChange({ name: value })} + onChange={value => this.handleChange({ name: value })} /> this.hanldeChange({ replenishName: value })} + onChange={value => this.handleChange({ replenishName: value })} /> this.hanldeChange({ reissueRule: value })} + onChange={value => this.handleChange({ reissueRule: value })} /> { @@ -153,7 +169,7 @@ export default class BaseInformForm extends React.Component { options={replenishRuleOptions} value={replenishRule} viewAttr={3} - onChange={value => this.hanldeChange({ replenishRule: value })} + onChange={value => this.handleChange({ replenishRule: value })} /> } @@ -164,7 +180,7 @@ export default class BaseInformForm extends React.Component { > this.hanldeChange({ description: value })} + onChange={value => this.handleChange({ description: value })} />
@@ -172,47 +188,97 @@ export default class BaseInformForm extends React.Component { className="payrollBaseInfoWrapper"> this.hanldeChange({ msgStatus: value === "1" })}/> + onChange={value => this.handleChange({ msgStatus: value === "1" })}/> this.hanldeChange({ emailStatus: value === "1" })}/> + onChange={value => this.handleChange({ emailStatus: value === "1" })}/> this.hanldeChange({ autoSendStatus: value === "1" })}/> + onChange={value => { + this.handleChange({ + autoSendStatus: value === "1", + autoSendDayOfMonth: value === "1" ? "1" : null, + autoSendTimeOfDay: value === "1" ? "09:00" : null, + autoSendCycleType: value === "1" ? 1 : null + }); + }}/> + { autoSendStatus && }
+ + + this.handleChange({ + ackFeedbackStatus: value === "1", + autoAckDays: 7, + feedbackUrl: "/" + })}/> + + { + ackFeedbackStatus && + + + this.handleChange({ autoAckDays })} + /> + + + + this.handleChange({ feedbackUrl })} + /> + + + } + ); } } const SendTimeComp = (props) => { - const { value, onChange } = props; - const { autoSendDayOfMonth, autoSendTimeOfDay } = value; + const { value, onChange, salaryMonthOptions } = props; + const { autoSendDayOfMonth, autoSendTimeOfDay, autoSendCycleType } = value; const handleChangeSendtime = (key, val) => { - onChange({ autoSendDayOfMonth, autoSendTimeOfDay, [key]: val }); + onChange({ autoSendDayOfMonth, autoSendTimeOfDay, autoSendCycleType, [key]: val }); }; return
- {getLabel(111, "每月")} + {getLabel(542604, "薪资所属月")} + handleChangeSendtime("autoSendCycleType", Number(v))} + /> ({ key: item, showname: item }))} + options={_.map(getDay(autoSendCycleType), item => ({ key: item, showname: item }))} onChange={v => handleChangeSendtime("autoSendDayOfMonth", v)} /> {getLabel(16992, "号")} @@ -222,15 +288,14 @@ const SendTimeComp = (props) => {
; }; -const getDay = () => { +const getDay = (num = 1) => { let days = []; - let day = getDaysInMonth(moment().year(), moment().month() + 1); + let day = getDaysInMonth(moment().year(), moment().month() + num); for (let i = 1; i <= day; i++) { days.push(i); } return days; }; - const getDaysInMonth = (year, month) => { month = parseInt(month, 10); let d = new Date(year, month, 0); diff --git a/pc4mobx/hrmSalary/pages/payroll/stepForm/index.less b/pc4mobx/hrmSalary/pages/payroll/stepForm/index.less index f30d0063..ebcbbe4c 100644 --- a/pc4mobx/hrmSalary/pages/payroll/stepForm/index.less +++ b/pc4mobx/hrmSalary/pages/payroll/stepForm/index.less @@ -192,9 +192,11 @@ .salaryItemName { width: 100%; + min-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; + cursor: pointer; } i.anticon-cross { diff --git a/pc4mobx/hrmSalary/pages/payroll/stepForm/salaryItemSettings.js b/pc4mobx/hrmSalary/pages/payroll/stepForm/salaryItemSettings.js index d597de4f..bc589087 100644 --- a/pc4mobx/hrmSalary/pages/payroll/stepForm/salaryItemSettings.js +++ b/pc4mobx/hrmSalary/pages/payroll/stepForm/salaryItemSettings.js @@ -17,13 +17,16 @@ class SalaryItemSettings extends Component { super(props); this.state = { dataList: [], + itemShowNamesetting: [], //名称修改集合 checkedValue: "", modalPayload: { visible: false, title: "", groupId: "", groupName: "", - options: [] + options: [], + salaryItemName: "", + salaryItemId: "" } }; } @@ -99,7 +102,9 @@ class SalaryItemSettings extends Component { title: "", groupId: "", groupName: "", - options: [] + options: [], + salaryItemName: "", + salaryItemId: "" } }); }; @@ -212,9 +217,63 @@ class SalaryItemSettings extends Component { }); } }; + handleEditSalaryItemName = (item, field, viewAttr) => { + const { groupId } = item, { salaryItemId } = field, { dataList } = this.state; + if (groupId === "111111111111111111") return; + this.setState({ + dataList: _.map(dataList, item => { + if (item.groupId === groupId) { + return { + ...item, + items: _.map(item.items, child => { + if (child.salaryItemId === salaryItemId) { + return { + ...child, + viewAttr + }; + } + return { ...child, viewAttr: 1 }; + }) + }; + } + return { + ...item, + items: _.map(item.items, child => { + return { ...child, viewAttr: 1 }; + }) + }; + }) + }, () => document.getElementById("salaryItemInput") && document.getElementById("salaryItemInput").focus()); + }; + handleChangeSalaryItemShowName = (item, field, name) => { + const { groupId } = item, { salaryItemId, originName } = field, { dataList, itemShowNamesetting } = this.state; + this.setState({ + dataList: _.map(dataList, item => { + if (item.groupId === groupId) { + return { + ...item, + items: _.map(item.items, child => { + if (child.salaryItemId === salaryItemId) { + return { ...child, salaryItemShowName: name, name }; + } + return { ...child }; + }) + }; + } + return { ...item }; + }), + itemShowNamesetting: _.unionBy([{ + salaryItemId, + salaryItemShowName: originName === name ? "" : name + }], itemShowNamesetting, "salaryItemId") + }, () => { + this.props.onChangeSalaryItem(this.state.dataList); + this.props.onChangeSalaryItemShowNamesetting(this.state.itemShowNamesetting); + }); + }; render() { - const { onChangeSalaryItem } = this.props; + const { onChangeSalaryItem, salaryBillItemNameSet } = this.props; const { dataList, modalPayload, checkedValue } = this.state; return (
@@ -247,9 +306,36 @@ class SalaryItemSettings extends Component { }) )} renderNodeItem={(filed) => { + const salaryBillItemNameObj = salaryBillItemNameSet[filed.id] || {}; return
-
-
{filed.name}
+
+ { + filed.viewAttr === 2 ? + this.handleEditSalaryItemName(item, filed, 1)} + onChange={(val) => this.handleChangeSalaryItemShowName(item, filed, val)} + /> : +
this.handleEditSalaryItemName(item, filed, 2)}> + { + (item.groupId !== "111111111111111111" && (!_.isEmpty(salaryBillItemNameObj) || (filed.salaryItemShowName !== filed.originName))) ? + `${filed.salaryItemShowName}(${filed.originName})` : + filed.name + } +
+ } this.handleDeleteSalaryItem(item, filed)}/>
; diff --git a/pc4mobx/hrmSalary/pages/payroll/stepForm/showSettingForm.js b/pc4mobx/hrmSalary/pages/payroll/stepForm/showSettingForm.js index 41edaa1a..527f1269 100644 --- a/pc4mobx/hrmSalary/pages/payroll/stepForm/showSettingForm.js +++ b/pc4mobx/hrmSalary/pages/payroll/stepForm/showSettingForm.js @@ -40,12 +40,21 @@ export default class ShowSettingForm extends React.Component { const { payrollStore: { setSalaryItemSet } } = this.props; setSalaryItemSet(resultSet); }; + handleChangeSalaryItemShowNamesetting = (itemShowNamesetting) => { + const { payrollStore: { setSalaryBillItemNameSetting, salaryBillItemNameSetting } } = this.props; + setSalaryBillItemNameSetting(_.map(salaryBillItemNameSetting, it => { + if (it.salaryBillType === 0) { + return { ...it, salaryTemplateId: this.props.id, itemShowNameSetting: itemShowNamesetting }; + } + return { ...it, salaryTemplateId: this.props.id }; + })); + }; render() { const { payrollStore, id } = this.props; const salaryTemplateShowSetStorage = (id ? "{}" : window.localStorage.getItem("salary-showset") || "{}"); const { salaryTemplateShowSet } = payrollStore; - const { salaryItemSet, templateBaseData } = payrollStore; + const { salaryItemSet, templateBaseData, salaryBillItemNameSet } = payrollStore; const { theme, background, @@ -141,8 +150,9 @@ export default class ShowSettingForm extends React.Component { ref={dom => this.salaryItemSettingsRef = dom} dataSource={salaryItemSet} onChangeSalaryItem={this.handleChangeSalaryItem} + onChangeSalaryItemShowNamesetting={this.handleChangeSalaryItemShowNamesetting} salarySobId={toJS(templateBaseData).salarySob} - isReplenish={false} + isReplenish={false} salaryBillItemNameSet={salaryBillItemNameSet} />
diff --git a/pc4mobx/hrmSalary/pages/payroll/stepForm/tmplateSettingForm.js b/pc4mobx/hrmSalary/pages/payroll/stepForm/tmplateSettingForm.js index 2ad0d075..5e964c7b 100644 --- a/pc4mobx/hrmSalary/pages/payroll/stepForm/tmplateSettingForm.js +++ b/pc4mobx/hrmSalary/pages/payroll/stepForm/tmplateSettingForm.js @@ -14,9 +14,19 @@ export default class TemplateSettingForm extends React.Component { setReplenishSalaryTemplateSalaryItemSet(resultSet); }; + handleChangeSalaryItemShowNamesetting = (itemShowNamesetting) => { + const { payrollStore: { setSalaryBillItemNameSetting, salaryBillItemNameSetting } } = this.props; + setSalaryBillItemNameSetting(_.map(salaryBillItemNameSetting, it => { + if (it.salaryBillType === 1) { + return { ...it, salaryTemplateId: this.props.id, itemShowNameSetting: itemShowNamesetting }; + } + return { ...it, salaryTemplateId: this.props.id }; + })); + }; + render() { const { payrollStore } = this.props; - const { replenishSalaryTemplateSalaryItemSet, templateBaseData } = payrollStore; + const { replenishSalaryTemplateSalaryItemSet, templateBaseData, salaryBillItemNameSet } = payrollStore; return (
this.salaryItemSettingsRef = dom} dataSource={replenishSalaryTemplateSalaryItemSet} onChangeSalaryItem={this.handleChangeSalaryItem} + onChangeSalaryItemShowNamesetting={this.handleChangeSalaryItemShowNamesetting} salarySobId={toJS(templateBaseData).salarySob} - isReplenish={true} + isReplenish={true} salaryBillItemNameSet={salaryBillItemNameSet} />
diff --git a/pc4mobx/hrmSalary/pages/payroll/templateBaseSettings.js b/pc4mobx/hrmSalary/pages/payroll/templateBaseSettings.js index 8cb7e4fd..a2433be1 100644 --- a/pc4mobx/hrmSalary/pages/payroll/templateBaseSettings.js +++ b/pc4mobx/hrmSalary/pages/payroll/templateBaseSettings.js @@ -5,8 +5,17 @@ * Date: 2023/6/12 */ import React, { Component } from "react"; -import { WeaCheckbox, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaSelect } from "ecCom"; -import { message } from "antd"; +import { + WeaCheckbox, + WeaFormItem, + WeaHelpfulTip, + WeaInput, + WeaInputNumber, + WeaLocaleProvider, + WeaSearchGroup, + WeaSelect +} from "ecCom"; +import { message, Modal } from "antd"; import { getSalaryBillBaseSetForm, salaryBillBaseSetSave } from "../../apis/payroll"; import WaterMarkSetModal from "./components/waterMarkSetModal"; import "./index.less"; @@ -22,6 +31,11 @@ class TemplateBaseSettings extends Component { wmSetting: null, watermarkSet: { visible: false, watermarkSetting: null + }, + ackFeedbackSetting: { + ackStatus: "0", + autoAckDays: 7, + feedBackUrl: "" } }; } @@ -34,9 +48,10 @@ class TemplateBaseSettings extends Component { const { watermarkSet } = this.state; getSalaryBillBaseSetForm().then(({ status, data }) => { if (status) { - const { watermarkStatus, watermark = "DEFAULT", watermarkSetting } = data; + const { watermarkStatus, watermark = "DEFAULT", watermarkSetting, ackFeedbackSetting } = data; this.setState({ - watermark, watermarkStatus: watermarkStatus ? "1" : "0", + watermark, watermarkStatus: watermarkStatus ? "1" : "0", ackFeedbackSetting, + wmSetting: { wmSetting: watermarkSetting }, watermarkSet: { ...watermarkSet, watermarkSetting @@ -46,8 +61,16 @@ class TemplateBaseSettings extends Component { }); }; salaryBillBaseSetSave = () => { - const { watermark, watermarkStatus, wmSetting } = this.state; - let payload = { watermarkStatus: watermarkStatus === "1" }; + const { watermark, watermarkStatus, wmSetting, ackFeedbackSetting } = this.state; + const { feedBackUrl } = ackFeedbackSetting; + if (!feedBackUrl) { + Modal.warning({ + title: getLabel(111, "信息确认"), + content: getLabel(111, "必要信息不完整,红色*为必填项!") + }); + return; + } + let payload = { watermarkStatus: watermarkStatus === "1", ackFeedbackSetting: { ...ackFeedbackSetting } }; if (watermarkStatus === "1") payload = { ...payload, watermark }; if (!_.isNil(wmSetting)) payload = { ...payload, watermark, ...wmSetting }; this.props.onChangeLoading(true); @@ -63,40 +86,81 @@ class TemplateBaseSettings extends Component { }; render() { - const { watermarkStatus, watermark, watermarkSet } = this.state; + const { watermarkStatus, watermark, watermarkSet, ackFeedbackSetting } = this.state; + const { ackStatus, autoAckDays, feedBackUrl } = ackFeedbackSetting; return ( - - - this.setState({ watermarkStatus, watermark: "DEFAULT" })}/> - - { - watermarkStatus === "1" && - - this.setState({ watermark })} - /> - { - watermark === "CUSTOM" && - this.setState({ - watermarkSet: { - ...watermarkSet, - visible: true - } - })}>{getLabel(538702, "水印设置")} - } - this.setState({ watermarkSet: { ...watermarkSet, visible: false } })} - onChange={wmSetting => this.setState({ wmSetting })} - /> + + + + this.setState({ watermarkStatus, watermark: "DEFAULT" })}/> - } - + { + watermarkStatus === "1" && + + this.setState({ watermark })} + /> + { + watermark === "CUSTOM" && + this.setState({ + watermarkSet: { + ...watermarkSet, + visible: true + } + })}>{getLabel(538702, "水印设置")} + } + this.setState({ watermarkSet: { ...watermarkSet, visible: false } })} + onChange={wmSetting => this.setState({ wmSetting })} + /> + + } + + + + this.setState({ + ackFeedbackSetting: { + ...ackFeedbackSetting, ackStatus, autoAckDays: 7 + } + })}/> + + { + ackStatus === "1" && + + + this.setState({ + ackFeedbackSetting: { + ...ackFeedbackSetting, autoAckDays + } + })}/> + + + + this.setState({ + ackFeedbackSetting: { + ...ackFeedbackSetting, feedBackUrl + } + })}/> + + + } + + ); } } diff --git a/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/index.js b/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/index.js index 6f2e68c2..8bcb6aa8 100644 --- a/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/templatePreview/computerTemplate/index.js @@ -49,7 +49,7 @@ export default class ComputerTemplate extends React.Component { } - renderTableTr = (data) => { + renderTableTr = (data, groupId) => { const tables = []; const len = data.length; const rowNum = 3; @@ -61,8 +61,9 @@ export default class ComputerTemplate extends React.Component { iLen = iLen > len ? len : iLen; tables.push(""); for (let i = j * rowNum; i < iLen; i++) { + const key = (!this.props.isPreview && groupId !== "111111111111111111") ? data[i].salaryItemShowName : data[i].name; const value = data[i].salaryItemValue || "-"; - tables.push("" + data[i].name + "" + "" + value + ""); + tables.push("" + key + "" + "" + value + ""); } tables.push(""); } @@ -98,7 +99,7 @@ export default class ComputerTemplate extends React.Component {
{group.groupName}
+ dangerouslySetInnerHTML={{ __html: this.renderTableTr(group.items, group.groupId).join(",").replace(/,/g, "") }}/> ; }) @@ -109,6 +110,7 @@ export default class ComputerTemplate extends React.Component { salaryTemplateShowSet.textContentPosition == 2 && salaryTemplateShowSet.textContent } + {this.props.children} ); } diff --git a/pc4mobx/hrmSalary/pages/payroll/templatePreview/index.less b/pc4mobx/hrmSalary/pages/payroll/templatePreview/index.less index 52517511..0d2d5dda 100644 --- a/pc4mobx/hrmSalary/pages/payroll/templatePreview/index.less +++ b/pc4mobx/hrmSalary/pages/payroll/templatePreview/index.less @@ -85,7 +85,8 @@ margin: 10px; background-color: #FFF; padding: 10px; - .descript-title{ + + .descript-title { display: flex; align-items: center; margin-bottom: 10px; @@ -100,15 +101,18 @@ border: 1px solid #fafafa; border-bottom: none; } - .descriptions-view{ + + .descriptions-view { width: 100%; - table{ + + table { table-layout: fixed; border-collapse: collapse; width: 100%; - border: 1px solid rgba(0,0,0,.06); - .descriptions-row{ - .descriptions-item-label{ + border: 1px solid rgba(0, 0, 0, .06); + + .descriptions-row { + .descriptions-item-label { background-color: #fafafa; padding: 16px 24px; color: #000000d9; @@ -116,11 +120,12 @@ font-size: 12px; line-height: 1.5715; text-align: start; - border: 1px solid rgba(0,0,0,.06); + border: 1px solid rgba(0, 0, 0, .06); min-width: 100px; max-width: 100px; } - .descriptions-item-content{ + + .descriptions-item-content { padding: 16px 24px; display: table-cell; flex: 1; @@ -130,10 +135,20 @@ word-break: break-word; overflow-wrap: break-word; border-collapse: collapse; - border: 1px solid rgba(0,0,0,.06); + border: 1px solid rgba(0, 0, 0, .06); } } } } } + + .space { + display: flex; + align-items: center; + justify-content: flex-end; + + .ant-btn { + margin-right: 10px; + } + } } diff --git a/pc4mobx/hrmSalary/pages/payroll/templatePreview/phoneTemplate/index.js b/pc4mobx/hrmSalary/pages/payroll/templatePreview/phoneTemplate/index.js index 0f85d51d..01730ef7 100644 --- a/pc4mobx/hrmSalary/pages/payroll/templatePreview/phoneTemplate/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/templatePreview/phoneTemplate/index.js @@ -83,7 +83,8 @@ export default class PhoneTemplate extends React.Component { { _.map(group.items, item => { return - + ; }) @@ -100,6 +101,7 @@ export default class PhoneTemplate extends React.Component { salaryTemplateShowSet.textContentPosition == 2 && salaryTemplateShowSet.textContent } + {this.props.children} ); } diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js index bf2e7a1c..fba508eb 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/importMenu.js @@ -95,6 +95,7 @@ class ImportMenu extends Component { }; // 导入档案 handleImportFile = (params) => { + const { isExtEmp = false } = this.props; if (this.state.importParams.importType === "init" || this.state.importParams.importType === "salaryItemAdjust") { params.importType = this.state.importParams.importType; params.listType = "FIXED"; @@ -102,7 +103,7 @@ class ImportMenu extends Component { params.importType = ""; params.listType = this.state.importParams.importType; } - API.importSalaryArchive(params).then(({ status, data }) => { + API.importSalaryArchive({ ...params, isExtEmp }).then(({ status, data }) => { if (status) { data.errorData = data.errorNotice; this.setState({ @@ -116,7 +117,7 @@ class ImportMenu extends Component { }; render() { - const { importType, refreshList } = this.props; + const { importType, refreshList, isExtEmp } = this.props; const { importParams, previewColumns, previewDataSource } = this.state; let params = ""; if (importParams.importType === "init" || importParams.importType === "salaryItemAdjust") { @@ -124,6 +125,7 @@ class ImportMenu extends Component { } else { params = "" + "&listType=" + importParams.importType; } + if (isExtEmp) params = params + "&extSalaryArchiveList=true"; return ( diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/config/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/config/index.js index 5440dcd5..22a80218 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/config/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/config/index.js @@ -26,5 +26,12 @@ export const tabCondition = [ showcount: true, title: "停薪员工", viewcondition: "stop" + }, + { + color: "#000000", + groupid: "EXT", + showcount: true, + title: "非系统人员", + viewcondition: "ext" } ]; diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/index.js index 59b9fb37..06887746 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/index.js @@ -31,6 +31,7 @@ import BatchSuspendsPay from "./components/batchSuspendsPay"; import SlideModalTitle from "../../components/slideModalTitle"; import SalaryFileViewSlide from "../salaryFile/saralyFileViewSlide"; import ChangeSalaryModal from "../salaryFile/changeSalaryModal"; +import { sysinfo } from "../../apis/ruleconfig"; import { i18n } from "../calculateDetail/userSure"; import "./index.less"; @@ -71,7 +72,7 @@ class Index extends Component { workcode: "", departmentIds: "", positionIds: "", - userstatus: "", + statuses: "", // archiveStatus: "EFFICIENT", taxAgentId: "", subcompanyIds: "" @@ -87,7 +88,8 @@ class Index extends Component { payStartDate: "", payEndDate: "" }, - salaryArchiveDelete: "" //待定薪、停薪员工 是否允许删除薪资档案 0: 否, 1: 是 + salaryArchiveDelete: "", //待定薪、停薪员工 是否允许删除薪资档案 0: 否, 1: 是, + extEmpsWitch: "1" //非系统人员开关, 1: 开启, 0:关闭 }; } @@ -129,9 +131,9 @@ class Index extends Component { }; Select = (value, key) => { const { taxAgentStore } = this.props; - const { userstatus, archiveStatus, taxAgentId } = this.state.searchItemsValue; + const { statuses, archiveStatus, taxAgentId } = this.state.searchItemsValue; const { archiveStatusList, userStatusList } = this.state; - const { taxAgentAdminOption } = taxAgentStore; + const { taxAgentOption } = taxAgentStore; return ( this.setState({ searchItemsValue: { ...this.state.searchItemsValue, [key]: val } })}/> ); @@ -151,10 +154,11 @@ class Index extends Component { componentDidMount() { const { taxAgentStore } = this.props; - const { getTaxAgentSelectListAsAdmin } = taxAgentStore; - getTaxAgentSelectListAsAdmin(); + const { fetchTaxAgentOption } = taxAgentStore; + fetchTaxAgentOption(); this.queryTabTotal(); this.queryList("/api/bs/hrmsalary/salaryArchive/pendingList"); + this.getSysinfo(); const init = this.init(); window.addEventListener("message", this.handleReceive, false); } @@ -163,6 +167,18 @@ class Index extends Component { window.removeEventListener("message", this.handleReceive, false); } + /* + * Author: 黎永顺 + * Description: 非系统人员开关查询 + * Params: + * Date: 2023/7/14 + */ + getSysinfo = () => { + sysinfo().then(({ status, data }) => { + if (status) this.setState({ extEmpsWitch: data.extEmpsWitch }); + }); + }; + handleReceive = ({ data }) => { const { payrollFilesStore: { tableStore }, taxAgentStore: { showOperateBtn } } = this.props; const columns = _.map(_.filter(toJS(tableStore.columns), (item) => item.display === "true"), (it, idx) => ({ @@ -219,10 +235,7 @@ class Index extends Component { key: String(it.value), showname: it.defaultLabel }))], - userStatusList: [{ - key: "", - showname: "" - }, ..._.map(userStatusList, it => ({ + userStatusList: [..._.map(userStatusList, it => ({ key: String(it.value), showname: it.defaultLabel }))], @@ -502,6 +515,27 @@ class Index extends Component { }}/> ]; + } else if (selectedKey === "ext" && showOperateBtn) { + return [ + } + placement="topLeft" + />, + { + this.query(); + this.setState({ selectedRowKeys: [] }); + }}/> + }> + + + ]; } return []; }; @@ -588,7 +622,7 @@ class Index extends Component { window.open(`${linkUrl}&salaryArchiveId=${id}`); }}>发起调薪); } - if (showOperateBtn && selectedKey === "fixed") { + if (showOperateBtn && (selectedKey === "fixed" || selectedKey === "ext")) { arrList.push(); @@ -636,7 +670,7 @@ class Index extends Component { salaryItemId: it.id, adjustValue: String(it.value || "") })), - status: _.upperCase(selectedKey) + status: selectedKey === "ext" ? "FIXED" : _.upperCase(selectedKey) }; API.savePaySet(payload).then(({ status, errormsg }) => { if (status) { @@ -669,9 +703,12 @@ class Index extends Component { case "suspend": this.queryList("/api/bs/hrmsalary/salaryArchive/suspendList"); break; - default: + case "stop": this.queryList("/api/bs/hrmsalary/salaryArchive/stopList"); break; + default: + this.queryList("/api/bs/hrmsalary/salaryArchive/extList"); + break; } }; @@ -684,7 +721,8 @@ class Index extends Component { showSearchAd, slideParams, changeSalaryVisible, - paysetParams + paysetParams, + extEmpsWitch } = this.state; const { payrollFilesStore: { tableStore } } = this.props; const renderSearch = () => { @@ -693,7 +731,7 @@ class Index extends Component { { com: this.Browser(getLabel(33553, "分部"), "subcompanyIds") }, { com: this.Browser(getLabel(27511, "部门"), "departmentIds") }, { com: this.Browser(getLabel(6086, "岗位"), "positionIds") }, - { com: this.Select(getLabel(382300, "人员状态"), "userstatus") }, + { com: this.Select(getLabel(382300, "人员状态"), "statuses") }, // { com: this.Select(getLabel(543311, "档案状态"), "archiveStatus") }, { com: this.Select(getLabel(537996, "个税扣缴义务人"), "taxAgentId") }, { com: this.Input(getLabel(1933, "工号"), "workcode") } @@ -718,7 +756,7 @@ class Index extends Component { workcode: "", departmentIds: "", positionIds: "", - userstatus: "", + statuses: "", archiveStatus: "" } })}> {getLabel(2022, "重置")} , @@ -743,7 +781,7 @@ class Index extends Component { dropMenuDatas={rightMenu} > ({ + tooltip: { + trigger: "axis", + axisPointer: { + type: "shadow" + }, + backgroundColor: "#FFF", + borderColor: "#FFF", + borderWidth: "1", + borderRadius: "5", + textStyle: { + color: "#333" + }, + formatter: function (params) { + let str = params[0].axisValue + "
"; + for (let item of params) { + str += `
${item.marker}${item.seriesName}${format_with_regex(item.value)}
`; + } + return str; + } + }, + legend: { + type: "scroll", + icon: "rect", + top: "0%", + right: "center", + itemGap: 10, + textStyle: { + fontSize: 12,//字体大小 + color: "#B8B8B8"//字体颜色 + } + }, + grid: { + top: "10%", + right: "0%", + left: "5%", + bottom: "0%", + containLabel: true + }, + xAxis: params.xAxis.map((item, index) => { + const data = Array(params.xAxis.length).fill(""); + data[index] = item; + return { + type: "category", + position: "bottom", + data: data, + axisTick: { + alignWithLabel: true, + show: false + }, + axisLabel: { + interval: 0, + margin: 10, + textStyle: { + fontSize: 11 + } + } + }; + }), + yAxis: { + name: params.name, + type: "value", + axisLabel: { + padding: [3, 0, 0, 0], + formatter: "{value}", + color: "#666", + textStyle: { + fontSize: 11 + } + }, + nameTextStyle: { + color: "#787E95", + fontSize: 12 + }, + axisLine: { + show: true, + lineStyle: { + color: "transparent" + } + }, + axisTick: { + show: false // 不显示坐标轴刻度线 + }, + splitLine: { + show: false, + lineStyle: { + color: "rgba(66, 192, 255, 0.1)" + } + } + }, + series: params.data.map(item => { + return [...dealBar(_.map(item.data, (it) => parseFloat(it.replace(/,/g, ""))), item.name)]; + }).reduce((acc, cur) => acc.concat(cur), []) +}); +export const mapLineOptions = (params) => ({ + tooltip: { + // 坐标轴指示器,坐标轴触发有效 + trigger: "axis", + axisPointer: { + // 默认为直线,可选为:'line' | 'shadow' + type: "line" + } + }, + legend: { + type: "scroll", + icon: "circle", + top: "0%", + right: "center", + itemGap: 20, + textStyle: { + fontSize: 12,//字体大小 + color: "#787E95"//字体颜色 + } + }, + grid: { + top: "10%", + left: "3%", + right: "2%", + bottom: "3%", + containLabel: true + }, + xAxis: [ + { + type: "category", + boundaryGap: false, + data: params.xAxis, + axisTick: { + alignWithLabel: true, + show: false + }, + // 修改坐标值样式 + axisLabel: { + color: "#B8B8B8", + fontSize: 12, + show: true + }, + axisLine: { + show: false + } + } + ], + yAxis: [ + { + type: "value", + // 修改坐标值样式 + axisLabel: { + color: "#787E95", + fontSize: 14 + }, + nameTextStyle: { + color: "#787E95", + fontSize: 16 + }, + // 修改坐标轴线样式 + axisLine: { + show: true, + lineStyle: { + color: "transparent" + } + }, + axisTick: { + show: false // 不显示坐标轴刻度线 + }, + splitLine: { + lineStyle: { + color: "rgba(93,126,158,1)" + } + } + } + ], + series: _.map(params.data, (item, index) => { + return { + name: item.name, + data: _.map(item.data, (it) => it.replace(/,/g, "")), + type: "line", + itemStyle: { + normal: { + color: function (params) { + return colorList[params.seriesIndex] || colorList[Math.floor((Math.random() * colorList.length))]; + }, + lineStyle: { + color: colorList[index] || colorList[Math.floor((Math.random() * colorList.length))] + } + } + } + }; + }) +}); +export const mapPieOptions = (params) => ({ + tooltip: { + show: true, + formatter: function (params) { + let str = params.seriesName + "
"; + str += params.marker + params.name + ":" + format_with_regex(params.value) + "(" + params.percent + "%" + ")" + "
"; + return str; + } + }, + legend: { + type: "scroll", + icon: "rect", + top: "0%", + left: "2%", + orient: "vertical", + itemGap: 10, + textStyle: { + fontSize: 12,//字体大小 + color: "#787E95"//字体颜色 + } + }, + series: _.map(params.data, item => { + return { + name: item.name, + data: _.map(item.data, (it) => ({ ...it, value: it.value.replace(/,/g, "") })), + type: "pie", + radius: "60%", + avoidLabelOverlap: true, + animation: false, + labelLine: { + show: true, + normal: { + length: 5, + align: "center" + } + }, + itemStyle: { + normal: { + color: function (colors) { + return colorList[colors.dataIndex] || colorList[Math.floor((Math.random() * colorList.length))]; + } + } + } + }; + }) +}); + +const dealBar = (arr, name) => { + const bar = []; + arr.forEach((item, index) => { + const data = []; + for (let i = 0; i < index; i++) { + data.push(""); + } + if (item) { + data.push(item); + bar.push({ + name, + type: "bar", + xAxisIndex: index, + barWidth: 32, + data, + itemStyle: { + normal: { + color: function (params) { + return colorList[params.seriesIndex] || colorList[Math.floor((Math.random() * colorList.length))]; + } + } + }, + label: { + show: true, + position: "insideBottom", + distance: 15, + align: "left", + verticalAlign: "middle", + rotate: "90", + formatter: function (params) { + if (parseInt(params.value) === 0) { + return ``; + } else { + return [ + `{a|${format_with_regex(params.value)}} {b|${params.seriesName}}` + ]; + } + }, + rich: { + a: { + fontWeight: "bold", + fontSize: 14, + color: "#333", + marginRight: 10 + }, + b: { + fontSize: 12, + color: "#333" + } + } + } + }); + } + }); + return bar; +}; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/condition.js b/pc4mobx/hrmSalary/pages/reportView/components/condition.js index 207e8f07..c98e082e 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/condition.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/condition.js @@ -176,6 +176,7 @@ export const mapBarOptions = (params) => ({ } }, legend: { + type: "scroll", icon: "rect", top: "0%", right: "center", @@ -188,8 +189,8 @@ export const mapBarOptions = (params) => ({ grid: { top: "10%", right: "0%", - left: "2%", - bottom: "0%", + left: "5%", + bottom: "10%", containLabel: true }, xAxis: { @@ -209,6 +210,7 @@ export const mapBarOptions = (params) => ({ }, yAxis: { name: params.name, + type: "value", axisLabel: { padding: [3, 0, 0, 0], formatter: "{value}", @@ -241,6 +243,7 @@ export const mapBarOptions = (params) => ({ return { name: item.name, barWidth: "32", + barGap: "0%", data: _.map(item.data, (it) => it.replace(/,/g, "")), type: "bar", itemStyle: { @@ -280,7 +283,18 @@ export const mapBarOptions = (params) => ({ } } }; - }) + }), + dataZoom: [ + { + type: "inside" + + }, + { + type: "slider", + show: true, + bottom: 20, + } + ] }); export const mapLineOptions = (params) => ({ tooltip: { @@ -360,7 +374,7 @@ export const mapLineOptions = (params) => ({ series: _.map(params.data, (item, index) => { return { name: item.name, - data: _.map(item.data, (it) => it.replace(/,/g, "")), + data: _.map(item.data, (it) => parseFloat(it.replace(/,/g, ""))), type: "line", itemStyle: { normal: { @@ -385,6 +399,7 @@ export const mapPieOptions = (params) => ({ } }, legend: { + type: "scroll", icon: "rect", top: "0%", left: "2%", diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/index.js b/pc4mobx/hrmSalary/pages/ruleConfig/index.js index 1faafe52..543793ab 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/index.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/index.js @@ -27,7 +27,8 @@ export default class Index extends Component { operateTaxDeclaration: "", matchRule: "", confValue: "0", - withDrawTaxDeclaration: "0" + withDrawTaxDeclaration: "0", + extEmpsWitch: "0" }, showEncryptOperationButton: "", progressVisible: false, @@ -39,36 +40,52 @@ export default class Index extends Component { const { saveParams } = this.state; const [ matchRuleEnum, orderRuleEnum, ascOrDescEnum, matchEmployeeModeEnum, - orderRules, codeRule, appSettings + // orderRules, codeRule, appSettings, + sysInfo ] = await Promise.all([ this.matchRuleEnum(), this.orderRuleEnum(), this.ascOrDescEnum(), this.matchEmployeeModeEnum(), - this.sysOrderRule(), this.sysConfCodeRule(), this.queryAppsetting() + // this.sysOrderRule(), this.sysConfCodeRule(), this.queryAppsetting(), + this.sysinfo() ]); const matchRuleOptions = _.map(matchRuleEnum.data, it => ({ key: it.value, showname: it.defaultLabel })); const orderOptions = _.map(orderRuleEnum.data, it => ({ key: it.value, showname: it.defaultLabel })); const ascOptions = _.map(ascOrDescEnum.data, it => ({ key: it.value, showname: it.defaultLabel })); const employeeOptions = _.map(matchEmployeeModeEnum.data, it => ({ key: it.value, showname: it.defaultLabel })); - const { data: { ascOrDesc, orderRule } } = orderRules; - const { data: rule } = codeRule; const { data: { - showEncryptOperationButton, - isOpenEncrypt: enctry, - isOpenTaxDeclaration: operateTaxDeclaration, - salaryAcctEmployeeRule: matchRule, - salaryArchiveDelete: confValue, withDrawTaxDeclaration + ascOrDesc = "", orderRule = "", showEncryptOperationButton, matchEmployeeMode: rule = "", + taxDeclarationFunction: operateTaxDeclaration = "0", salaryArchiveDelete: confValue, + salaryAcctEmployeeRule: matchRule, WITHDRAW_TAX_DECLARATION: withDrawTaxDeclaration = "0", + OPEN_APPLICATION_ENCRYPT: enctry = "0", extEmpsWitch = "0" } - } = appSettings; + } = sysInfo; + // const { data: { ascOrDesc, orderRule } } = orderRules; + // const { data: rule } = codeRule; + // const { + // data: { + // showEncryptOperationButton, + // isOpenEncrypt: enctry + // isOpenTaxDeclaration: operateTaxDeclaration, + // salaryAcctEmployeeRule: matchRule, + // salaryArchiveDelete: confValue, + // withDrawTaxDeclaration + // } + // } = appSettings; this.setState({ matchRuleOptions, orderOptions, ascOptions, employeeOptions, showEncryptOperationButton, saveParams: { ...saveParams, - ascOrDesc, orderRule, rule, enctry, operateTaxDeclaration, matchRule, confValue, withDrawTaxDeclaration + ascOrDesc, orderRule, rule, enctry, operateTaxDeclaration, matchRule, confValue, withDrawTaxDeclaration, + extEmpsWitch } }); } + sysinfo = () => { + return API.sysinfo(); + }; + sysOrderRule = () => { return API.sysOrderRule(); }; @@ -210,6 +227,16 @@ export default class Index extends Component { } }); }; + saveSysOperate = (payload) => { + API.saveSysOperate({ ...payload, confValue: this.state.saveParams.extEmpsWitch }) + .then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(22619, "保存成功!")); + } else { + message.error(errormsg || getLabel(22620, "保存失败!")); + } + }); + }; withDrawTaxDeclaration = () => { API.saveWithDrawTaxDeclaration({ confValue: _.pick(this.state.saveParams, ["withDrawTaxDeclaration"]).withDrawTaxDeclaration }) .then(({ status, errormsg }) => { @@ -225,7 +252,7 @@ export default class Index extends Component { const { saveParams } = this.state; Modal.confirm({ title: getLabel(131329, "信息确认"), - content: getLabel(543854, "确认要保存吗?"), + content: (key === "operateTaxDeclaration" && val === "0") ? getLabel(111, "关闭之后,将无法开启,确认要保存吗?") : getLabel(543854, "确认要保存吗?"), onOk: () => { this.setState({ saveParams: { @@ -256,6 +283,12 @@ export default class Index extends Component { case "withDrawTaxDeclaration": this.withDrawTaxDeclaration(); break; + case "extEmpsWitch": + this.saveSysOperate({ + title: getLabel(111, "开启非系统人员"), + module: "basic", confKey: key + }); + break; default: break; } @@ -289,7 +322,8 @@ export default class Index extends Component { operateTaxDeclaration, matchRule, confValue, - withDrawTaxDeclaration + withDrawTaxDeclaration, + extEmpsWitch } = saveParams; return (
@@ -328,29 +362,36 @@ export default class Index extends Component { } - - + + this.handleChange("operateTaxDeclaration", val)}/> - + this.handleChange("withDrawTaxDeclaration", val)}/> - + this.handleChange("confValue", val)}/> - - + + this.handleChange("matchRule", val)} /> + + + this.handleChange("extEmpsWitch", val)}/> + + { this.state.progressVisible && { this.onEditItem(record, false); }}>{text}; - case "useInEmployeeSalary": - return ; case "useDefault": + case "hideDefault": + case "useInEmployeeSalary": return ; default: return
; @@ -367,9 +367,23 @@ export default class SalaryItem extends React.Component { { - systemItemVisible && { - setSystemItemVisible(false); - }}/> + systemItemVisible && + { + setSystemItemVisible(false); + }} + onInitTableList={() => { + getTableDatas({ ...this.state.searchParams, name: this.state.searchValue }).then(res => { + this.setState({ + searchParams: { + ...this.state.searchParams, + total: res.total + } + }); + }); + }} + /> } { editSlideVisible && diff --git a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemForm.js b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemForm.js index 1f09d059..d28dd515 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemForm.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemForm.js @@ -5,7 +5,7 @@ * Date: 2023/2/9 */ import React, { Component } from "react"; -import { WeaCheckbox, WeaFormItem, WeaInput, WeaSearchGroup, WeaSelect, WeaTextarea, WeaInputNumber } from "ecCom"; +import { WeaCheckbox, WeaFormItem, WeaInput, WeaInputNumber, WeaSearchGroup, WeaSelect, WeaTextarea } from "ecCom"; import { salaryItemFields, valTakeOptions } from "./columns"; class SalaryItemForm extends Component { @@ -47,7 +47,7 @@ class SalaryItemForm extends Component { case "valueType": return { ...item, - viewAttr: isAdd ? 2 : 1 + // viewAttr: isAdd ? 2 : 1 }; case "formulaContent": return { @@ -86,7 +86,7 @@ class SalaryItemForm extends Component { if (key === "valueType") { onChangeFieldsItem({ formulaContent: "", formulaId: 0, valueType: v }); } else { - onChangeFieldsItem({ [key]: (key === "useDefault" || key === "useInEmployeeSalary") ? Number(v) : v }); + onChangeFieldsItem({ [key]: (key === "useDefault" || key === "useInEmployeeSalary" || key === "hideDefault") ? Number(v) : v }); } }); }; @@ -131,7 +131,7 @@ class SalaryItemForm extends Component { (type === "INPUTNUMBER" && display) ? this.handleChangeSalaryFiledItems(key, v)}/> + onChange={v => this.handleChangeSalaryFiledItems(key, v)}/> : null } ; diff --git a/pc4mobx/hrmSalary/pages/salaryItem/systemSalaryItemModal.js b/pc4mobx/hrmSalary/pages/salaryItem/systemSalaryItemModal.js index 7e20dc52..60dc767a 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/systemSalaryItemModal.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/systemSalaryItemModal.js @@ -60,7 +60,7 @@ export default class SystemSalaryItemModal extends React.Component { if (status) { message.success(getLabel(26712, "添加成功")); this.setState({ selectedRowKeys: [] }, () => { - this.getSysItemList(); + this.props.onInitTableList(); this.props.onCancel(); }); } else { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index 75e35bce..2ea97522 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -14,6 +14,7 @@ import * as API from "../../../apis/welfareArchive"; import ImportModal from "../../../components/importModal"; import TipLabel from "../../../components/TipLabel"; import UnifiedTable from "../../../components/UnifiedTable"; +import { convertToUrlString } from "../../../util/url"; import { salaryArchiveDelete } from "../../../apis/payrollFiles"; import "./index.less"; @@ -611,16 +612,16 @@ export default class Archives extends React.Component { let url = `${window.location.origin}/api/bs/hrmsalary/scheme/export?ids=`; switch (selectedKey) { case "pending": - url = `${url}&runStatuses=1`; + url = `${url}&runStatuses=1&${convertToUrlString(form.getFormParams())}`; break; case "fixed": - url = `${url}&runStatuses=2,3`; + url = `${url}&runStatuses=2,3&${convertToUrlString(form.getFormParams())}`; break; case "suspend": - url = `${url}&runStatuses=3`; + url = `${url}&runStatuses=3&${convertToUrlString(form.getFormParams())}`; break; default: - url = `${url}&runStatuses=4,5`; + url = `${url}&runStatuses=4,5&${convertToUrlString(form.getFormParams())}`; break; } window.open(url, "_self"); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js index 791fd0f3..bae92ade 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js @@ -16,7 +16,6 @@ import CopySchemaModal from "./copySchemaModal"; import CustomBenefitsTable from "./customBenefitsTable"; import "./index.less"; - const { getLabel } = WeaLocaleProvider; @inject("programmeStore", "taxAgentStore", "salaryFileStore") @observer diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js index 092ba9e1..07e9d5a1 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js @@ -149,7 +149,7 @@ export default class StandingBook extends React.Component { {billStatus === "0" && ( this.handleGoDetail(billMonth, "", r.paymentOrganizationId, creator)}> {getLabel(538780, "核算")} @@ -157,7 +157,7 @@ export default class StandingBook extends React.Component { {billStatus === "0" && ( this.handleOperate({ key: "archive", billMonth, @@ -170,7 +170,7 @@ export default class StandingBook extends React.Component { {billStatus === "1" && ( this.handleOperate({ key: "view", billMonth, @@ -499,7 +499,7 @@ export default class StandingBook extends React.Component { if (item.dataIndex !== "operate" && item.dataIndex !== "billStatus") { return { ...item, - width:150, + width: 150, render: (text) => { return {text}; } diff --git a/pc4mobx/hrmSalary/pages/taxAgent/editModal.js b/pc4mobx/hrmSalary/pages/taxAgent/editModal.js index 230fd78a..cc1477e6 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/editModal.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/editModal.js @@ -3,6 +3,7 @@ import { Button } from "antd"; import { WeaDialog, WeaFormItem, WeaSearchGroup, WeaSteps, WeaTab, WeaLocaleProvider } from "ecCom"; import { WeaSwitch } from "comsMobx"; import PersonalScope from "./personalScope"; +import "./index.less"; const titleOuter = { display: "flex", @@ -136,6 +137,7 @@ export default class EditModal extends React.Component {
} initLoadCss + className="taxagentModalWrapper" visible={visible} style={{ width: 800, height: 450 }} hasScroll> diff --git a/pc4mobx/hrmSalary/pages/taxAgent/index.less b/pc4mobx/hrmSalary/pages/taxAgent/index.less index 6bfafdb0..67902f49 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/index.less +++ b/pc4mobx/hrmSalary/pages/taxAgent/index.less @@ -113,3 +113,46 @@ } } } + +.taxagentModalWrapper { + .topMenuWrapper { + height: 47px; + line-height: 47px; + padding: 0 10px; + display: flex; + justify-content: space-between; + + .topMenuTabWrapper { + display: flex; + align-items: center; + + .menuTabItem { + height: 24px; + padding: 0 16px; + border-radius: 3px; + margin-right: 6px; + display: flex; + align-items: center; + -webkit-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + flex: 1 1 auto; + line-height: normal; + } + + .menuTabItem:hover { + color: #5d9cec; + background: #e9f7ff; + } + + .active { + color: #5d9cec; + background: #e9f7ff; + } + } + } +} diff --git a/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js b/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js index d9188215..67d32d18 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js @@ -19,6 +19,7 @@ export default class PersonalScope extends Component { constructor(props) { super(props); this.state = { + deleteLoading: false, queryLoading: false, submitLoading: false, targetTypeList: [], @@ -47,7 +48,6 @@ export default class PersonalScope extends Component { } }); }; - getTaxAgentRangeListInclude = (pageModule = {}) => { const { taxAgentId } = this.props; const { getTaxAgentRangeListInclude } = this.props.taxAgentStore; @@ -76,6 +76,35 @@ export default class PersonalScope extends Component { } ); }; + + taxAgentRangelistExt = (pageModule = {}) => { + const { taxAgentId } = this.props; + const { taxAgentRangelistExt } = this.props.taxAgentStore; + this.setState({ queryLoading: true }); + taxAgentRangelistExt({ ...pageModule, taxAgentId }).then( + ({ status, data }) => { + this.setState({ queryLoading: false }); + if (status && !_.isEmpty(data)) { + const { + columns, + list: dataSource, + pageNum: current, + pageSize, + total + } = data; + this.setState({ + columns, + dataSource, + pageObj: { + current, + pageSize, + total + } + }); + } + } + ); + }; getTaxAgentRangeListExclude = (pageModule = {}) => { const { taxAgentId } = this.props; const { getTaxAgentRangeListExclude } = this.props.taxAgentStore; @@ -106,17 +135,93 @@ export default class PersonalScope extends Component { }; taxAgentRangeDelete = ({ ids, tab }) => { - const { taxAgentRangeDelete } = this.props.taxAgentStore; - const { pageObj } = this.state; Modal.confirm({ title: getLabel(131329, "信息确认"), content: getLabel(543548, "确认删除吗?"), onOk: () => { - taxAgentRangeDelete(ids).then(({ status, errorMsg }) => { + return new Promise((resolve, reject) => { + return tab === "2" ? this.taxAgentExtRangeDeleteComfirm(resolve, reject, ids) : this.taxAgentRangeDeleteComfirm(resolve, reject, ids, tab); + }).catch(() => console.log("出错!")); + } + }); + }; + taxAgentExtRangeDeleteComfirm = (resolve, reject, ids) => { + const { taxAgentRangeExtDelete } = this.props.taxAgentStore; + const { pageObj } = this.state; + message.destroy(); + message.loading(getLabel(111, "正在删除中..."), 0); + taxAgentRangeExtDelete(ids).then(({ status, errormsg }) => { + message.destroy(); + resolve(); + if (status) { + this.tagAgentRef.onSelectChange([]); + message.success(getLabel(502230, "删除成功")); + this.taxAgentRangelistExt({ + current: pageObj.current, + pageSize: pageObj.pageSize + }); + } else { + message.error(errormsg || getLabel(20462, "删除失败")); + } + }).catch(() => { + message.destroy(); + reject(); + }); + }; + taxAgentRangeDeleteComfirm = (resolve, reject, ids, tab) => { + const { taxAgentRangeDelete } = this.props.taxAgentStore; + const { pageObj } = this.state; + message.destroy(); + message.loading(getLabel(111, "正在删除中..."), 0); + taxAgentRangeDelete(ids).then(({ status, errormsg }) => { + message.destroy(); + resolve(); + if (status) { + this.tagAgentRef.onSelectChange([]); + message.success(getLabel(502230, "删除成功")); + tab == "1" + ? this.getTaxAgentRangeListInclude({ + current: pageObj.current, + pageSize: pageObj.pageSize + }) + : this.getTaxAgentRangeListExclude({ + current: pageObj.current, + pageSize: pageObj.pageSize + }); + } else { + message.error(errormsg || getLabel(20462, "删除失败")); + } + }).catch(() => { + message.destroy(); + reject(); + }); + }; + + taxAgentRangeSave = (module) => { + const { taxAgentId } = this.props; + const { pageObj } = this.state; + const { includeType } = module; + const { taxAgentRangeSave, taxAgentRangeExtSave } = this.props.taxAgentStore; + this.setState({ submitLoading: true }); + if (includeType === "2") { + taxAgentRangeExtSave({ taxAgentId, ..._.pick(module, "targetIds") }).then(({ status, errormsg }) => { + this.setState({ submitLoading: false }); + if (status) { + this.tagAgentRef.closeModal(); + message.success(getLabel(528075, "新增成功")); + this.taxAgentRangelistExt({ current: pageObj.current, pageSize: pageObj.pageSize }); + } else { + message.error(errormsg || getLabel(543346, "新增失败")); + } + }); + } else { + taxAgentRangeSave({ ...module, taxAgentId }).then( + ({ status, errormsg }) => { + this.setState({ submitLoading: false }); if (status) { - this.tagAgentRef.onSelectChange([]); - message.success(getLabel(502230, "删除成功")); - tab == "1" + this.tagAgentRef.closeModal(); + message.success(getLabel(528075, "新增成功")); + includeType == "1" ? this.getTaxAgentRangeListInclude({ current: pageObj.current, pageSize: pageObj.pageSize @@ -126,41 +231,11 @@ export default class PersonalScope extends Component { pageSize: pageObj.pageSize }); } else { - message.error(errorMsg || getLabel(20462, "删除失败")); + message.error(errormsg || getLabel(543346, "新增失败")); } - }); - }, - onCancel() { - } - }); - }; - - taxAgentRangeSave = (module) => { - const { taxAgentId } = this.props; - const { pageObj } = this.state; - const { includeType } = module; - const { taxAgentRangeSave } = this.props.taxAgentStore; - this.setState({ submitLoading: true }); - taxAgentRangeSave({ ...module, taxAgentId }).then( - ({ status, errormsg }) => { - this.setState({ submitLoading: false }); - if (status) { - this.tagAgentRef.closeModal(); - message.success(getLabel(528075, "新增成功")); - includeType == "1" - ? this.getTaxAgentRangeListInclude({ - current: pageObj.current, - pageSize: pageObj.pageSize - }) - : this.getTaxAgentRangeListExclude({ - current: pageObj.current, - pageSize: pageObj.pageSize - }); - } else { - message.error(errormsg || getLabel(543346, "新增失败")); } - } - ); + ); + } }; render() { @@ -199,7 +274,8 @@ export default class PersonalScope extends Component { () => { tab == "1" ? this.getTaxAgentRangeListInclude({ ...pageObj, ...params }) - : this.getTaxAgentRangeListExclude({ ...pageObj, ...params }); + : tab == "0" ? this.getTaxAgentRangeListExclude({ ...pageObj, ...params }) : + this.taxAgentRangelistExt({ ...pageObj, ...params }); } ); }} @@ -210,12 +286,14 @@ export default class PersonalScope extends Component { onTaxAngetSearch={({ targetName, targetWorkcode, tab }) => { tab == "1" ? this.getTaxAgentRangeListInclude({ targetName, targetWorkcode }) - : this.getTaxAgentRangeListExclude({ targetName, targetWorkcode }); + : tab == "0" ? this.getTaxAgentRangeListExclude({ targetName, targetWorkcode }): + this.taxAgentRangelistExt({ targetName, targetWorkcode }); }} onChangeTab={(tab) => { + this.tagAgentRef.onSelectChange([]); tab == "1" ? this.getTaxAgentRangeListInclude() - : this.getTaxAgentRangeListExclude(); + : tab == "0" ? this.getTaxAgentRangeListExclude() : this.taxAgentRangelistExt(); }} />
diff --git a/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js b/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js index e8c68418..8ddc1050 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js @@ -4,14 +4,18 @@ import { WeaButtonIcon, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup import AddTaxAgentModal from "./addTaxAgentModal"; import ImportModal from "../../components/importModal"; import { taxAgentRangeImportData, taxAgentRangePreview } from "../../apis/taxAgent"; +import { sysinfo } from "../../apis/ruleconfig"; import { importEmployColumns } from "./columns"; +import ExternalPersonModal from "../../components/externalPersonModal"; const getLabel = WeaLocaleProvider.getLabel; + export default class SlideTaxagentUser extends React.Component { constructor(props) { super(props); this.state = { showSearchAd: false, + externalPersonModalVisible: false, //外部人员关联弹框 addTaxagentModalVisible: false, includeType: "1", selectedRowKeys: [], @@ -22,30 +26,34 @@ export default class SlideTaxagentUser extends React.Component { visible: false, step: 0, importResult: {} - } + }, + extEmpsWitch: "1" //非系统人员开关, 1: 开启, 0:关闭 }; } - - handleTabClick(includeType) { - const { onChangeTab } = this.props; - this.setState( - { - includeType - }, - () => { - onChangeTab && onChangeTab(includeType); - } - ); + componentDidMount() { + this.getSysinfo(); } + /* + * Author: 黎永顺 + * Description: 非系统人员开关查询 + * Params: + * Date: 2023/7/14 + */ + getSysinfo = () => { + sysinfo().then(({ status, data }) => { + if (status) this.setState({ extEmpsWitch: data.extEmpsWitch }); + }); + }; + onSelectChange = selectedRowKeys => { this.setState({ selectedRowKeys }); }; handleTabDelete = () => { const { onDeleteTaxAgent } = this.props; - const { includeType } = this.state; - if (this.state.selectedRowKeys.length == 0) { + const { includeType, selectedRowKeys } = this.state; + if (selectedRowKeys.length === 0) { message.warning(getLabel(543306, "未选择条目")); return; } @@ -64,9 +72,10 @@ export default class SlideTaxagentUser extends React.Component { closeModal = () => { this.setState({ - addTaxagentModalVisible: false + addTaxagentModalVisible: false, + externalPersonModalVisible: false }, () => { - this.addTaxRef.handleReset(); + this.addTaxRef && this.addTaxRef.handleReset(); }); }; handleInitModal = () => { @@ -120,9 +129,10 @@ export default class SlideTaxagentUser extends React.Component { selectedRowKeys, searchValue, addTaxagentModalVisible, + externalPersonModalVisible, importParams, previewDataSource, - showSearchAd + showSearchAd, extEmpsWitch } = this.state; const { submitLoading, @@ -146,6 +156,7 @@ export default class SlideTaxagentUser extends React.Component { onChange: this.onSelectChange }; const pagination = { + ...pageObj, total: pageObj.total, showTotal: total => `${getLabel(83698, "共")} ${total} ${getLabel(18256, "条")}`, pageSizeOptions: ["10", "20", "50", "100"], @@ -177,16 +188,30 @@ export default class SlideTaxagentUser extends React.Component { >, , - this.setState({ addTaxagentModalVisible: true })}/> + { + const key = includeType === "2" ? "externalPersonModalVisible" : "addTaxagentModalVisible"; + this.setState({ [key]: true }); + }} + /> ]; - includeType === "0" && btns.shift(); + (includeType === "0" || includeType === "2") && btns.shift(); return (
- + this.setState({ externalPersonModalVisible: false })} + onExternalPersonSave={val => onTaxAgentSave({ ...val, includeType: includeType })} + /> this.addTaxRef = ref} loading={submitLoading} diff --git a/pc4mobx/hrmSalary/stores/externalPersonManage.js b/pc4mobx/hrmSalary/stores/externalPersonManage.js new file mode 100644 index 00000000..7640bd04 --- /dev/null +++ b/pc4mobx/hrmSalary/stores/externalPersonManage.js @@ -0,0 +1,7 @@ +import { observable } from "mobx"; +import { WeaForm } from "comsMobx"; + +export class ExternalPersonManageStore { + @observable form = new WeaForm(); + @observable addForm = new WeaForm(); +} diff --git a/pc4mobx/hrmSalary/stores/index.js b/pc4mobx/hrmSalary/stores/index.js index 6b7af8e1..c9590ab3 100644 --- a/pc4mobx/hrmSalary/stores/index.js +++ b/pc4mobx/hrmSalary/stores/index.js @@ -18,6 +18,7 @@ import { DeclareStore } from "./declare"; import { StandingBookStore } from "./StandingBook"; import { PayrollFilesStore } from "./payrollFiles"; import { SpecialAddStore } from "./specialAdd"; +import { ExternalPersonManageStore } from "./externalPersonManage"; module.exports = { baseFormStore: new BaseFormStore(), @@ -39,5 +40,6 @@ module.exports = { declareStore: new DeclareStore(), standingBookStore: new StandingBookStore(), payrollFilesStore: new PayrollFilesStore(), - specialAddStore: new SpecialAddStore() + specialAddStore: new SpecialAddStore(), + externalPersonManageStore: new ExternalPersonManageStore() }; diff --git a/pc4mobx/hrmSalary/stores/mySalary.js b/pc4mobx/hrmSalary/stores/mySalary.js index 61988d5b..916c3be9 100644 --- a/pc4mobx/hrmSalary/stores/mySalary.js +++ b/pc4mobx/hrmSalary/stores/mySalary.js @@ -14,6 +14,7 @@ const { TableStore } = WeaTableNew; export class MySalaryStore { @observable tableStore = new TableStore(); // new table @observable form = new WeaForm(); // nrew 一个form + @observable pwdForm = new WeaForm(); // new 一个密码验证form @observable condition = []; // 存储后台得到的form数据 @observable hasRight = false; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据 @observable showSearchAd = false; // 高级搜索面板显示 diff --git a/pc4mobx/hrmSalary/stores/payroll.js b/pc4mobx/hrmSalary/stores/payroll.js index e42cdba0..6c2e7d34 100644 --- a/pc4mobx/hrmSalary/stores/payroll.js +++ b/pc4mobx/hrmSalary/stores/payroll.js @@ -26,6 +26,19 @@ export class payrollStore { @observable salaryTemplateShowSet = {}; // 显示设置基础表单 @observable replenishSalaryTemplateSalaryItemSet = []; // 补发工资单模版基础表单 @observable salaryItemSet = []; // 显示设置薪资项 + @observable salaryBillItemNameSetting = [ + { + salaryTemplateId: "", + salaryBillType: 0, + itemShowNameSetting: [] + }, + { + salaryTemplateId: "", + salaryBillType: 1, + itemShowNameSetting: [] + } + ]; // 工资单模板薪资项目名称修改列表 + @observable salaryBillItemNameSet = {}; // 工资单模板薪资项目名称修改列表 // **** 工资单页面 **** @observable salarySendTableStore = new TableStore(); // 工资单列表 @@ -87,6 +100,10 @@ export class payrollStore { @action setSalaryItemSet = salaryItemSet => (this.salaryItemSet = salaryItemSet); + @action + setSalaryBillItemNameSet = salaryBillItemNameSet => (this.salaryBillItemNameSet = salaryBillItemNameSet); + @action + setSalaryBillItemNameSetting = salaryBillItemNameSetting => (this.salaryBillItemNameSetting = salaryBillItemNameSetting); @action("工资单模板分页信息修改") setTemplateTablePageInfo = (pageInfo, callback) => { @@ -214,6 +231,7 @@ export class payrollStore { if (res.status) { if (id !== "") { this.salaryItemSet = res.data.salaryTemplateSalaryItemSet; + this.salaryBillItemNameSet = res.data.salaryBillItemNameSet; this.replenishSalaryTemplateSalaryItemSet = res.data.salaryTemplateSalaryItemSet; } this.salaryTemplateShowSet = { ...res.data.salaryTemplateShowSet.data, ...JSON.parse(salaryTemplateShowSetStorage) }; @@ -262,6 +280,7 @@ export class payrollStore { : false; params.salaryItemSetting = toJS(this.salaryItemSet); params.replenishSalaryItemSetting = toJS(this.replenishSalaryTemplateSalaryItemSet); + params.salaryBillItemNameSetting = toJS(this.salaryBillItemNameSetting); return params; }; @@ -274,6 +293,9 @@ export class payrollStore { if (res.status) { message.success("保存成功"); this.getPayrollTemplateList(); + this.setSalaryBillItemNameSetting(_.map(this.salaryBillItemNameSetting, it => { + return { ...it, salaryTemplateId: "", itemShowNameSetting: [] }; + })); resolve(); } else { message.error(res.errormsg || "保存失败"); diff --git a/pc4mobx/hrmSalary/stores/payrollFiles.js b/pc4mobx/hrmSalary/stores/payrollFiles.js index 7efc0dd2..70088da8 100644 --- a/pc4mobx/hrmSalary/stores/payrollFiles.js +++ b/pc4mobx/hrmSalary/stores/payrollFiles.js @@ -1,7 +1,7 @@ import { action, observable } from "mobx"; import { WeaTableNew } from "comsMobx"; import * as API from "../apis/payrollFiles"; -import { statisticsEmployeeDetailList, getDataPerspective } from "../apis/statistics"; +import { getDataPerspective, statisticsEmployeeDetailList } from "../apis/statistics"; const { TableStore } = WeaTableNew; @@ -14,11 +14,12 @@ export class PayrollFilesStore { @action("薪资档案-列表查询") queryList = (payload = {}, searchItemsValue = {}, url = "") => { return new Promise((resolve, reject) => { - const { departmentIds, positionIds, subcompanyIds, ...extra } = searchItemsValue; + const { departmentIds, positionIds, subcompanyIds, statuses, ...extra } = searchItemsValue; API.queryList({ departmentIds: departmentIds ? departmentIds.split(",") : [], positionIds: positionIds ? positionIds.split(",") : [], subcompanyIds: subcompanyIds ? subcompanyIds.split(",") : [], + statuses: statuses ? statuses.split(",") : [], ...payload, ...extra, url }).then(res => { const { data, status } = res; diff --git a/pc4mobx/hrmSalary/stores/salaryItem.js b/pc4mobx/hrmSalary/stores/salaryItem.js index 6eb365de..696fed61 100644 --- a/pc4mobx/hrmSalary/stores/salaryItem.js +++ b/pc4mobx/hrmSalary/stores/salaryItem.js @@ -23,6 +23,7 @@ export class SalaryItemStore { @observable request = { name: "", useDefault: 0, + hideDefault: 0, useInEmployeeSalary: 0, systemType: 0, roundingMode: "1", @@ -63,6 +64,7 @@ export class SalaryItemStore { initRequest = () => this.request = { name: "", useDefault: 0, + hideDefault: 0, useInEmployeeSalary: 0, systemType: 0, roundingMode: "1", diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index aff71ae6..2f555120 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -4,6 +4,7 @@ import { WeaForm, WeaTableNew } from "comsMobx"; import * as API from "../apis/taxAgent"; // 引入API接口文件 import { decentralizationConditions, editConditions } from "../pages/taxAgent/editConditions"; +import { taxAgentRangeExtDelete } from "../apis/taxAgent"; const { TableStore } = WeaTableNew; @@ -171,6 +172,21 @@ export class TaxAgentStore { getTaxAgentRangeForm = params => { return API.getTaxAgentRangeForm(params); }; + // 非系统人员范围保存 + @action + taxAgentRangeExtSave = params => { + return API.taxAgentRangeExtSave(params); + }; + // 非系统人员范围查询 + @action + taxAgentRangelistExt = params => { + return API.taxAgentRangelistExt(params); + }; + // 非系统人员范围删除 + @action + taxAgentRangeExtDelete = params => { + return API.taxAgentRangeExtDelete(params); + }; // 人员范围保存 @action taxAgentRangeSave = params => { diff --git a/pc4mobx/hrmSalary/util/RSAUtil.js b/pc4mobx/hrmSalary/util/RSAUtil.js new file mode 100644 index 00000000..97b76234 --- /dev/null +++ b/pc4mobx/hrmSalary/util/RSAUtil.js @@ -0,0 +1,32 @@ +import loadjs from "loadjs"; + +const RSAEcrypt = (openRSA, param) => { + return new Promise((resolve, reject) => { + //异步加载ras文件 + loadjs.isDefined("rsa") ? loadjs.ready("rsa", () => { + if (openRSA && openRSA == "1") { + Object.keys(param).forEach(key => { + param[key] = __RSAEcrypt__.rsa_data_encrypt(param[key]); + }); + } + resolve(param); + }) : loadjs(["/js/rsa/jsencrypt.js", "/js/rsa/rsa.js"], "rsa", { + async: false, + success: () => { + if (openRSA && openRSA == "1") { + const callback = () => { + Object.keys(param).forEach(key => { + param[key] = __RSAEcrypt__.rsa_data_encrypt(param[key]); + }); + resolve(param); + }; + __RSAEcrypt__.initRsaCode(callback); + } else { + resolve(param); + } + } + }); + }); +}; + +export { RSAEcrypt }; diff --git a/pc4mobx/hrmSalary/util/index.js b/pc4mobx/hrmSalary/util/index.js index de115ede..702a281b 100644 --- a/pc4mobx/hrmSalary/util/index.js +++ b/pc4mobx/hrmSalary/util/index.js @@ -32,6 +32,7 @@ export const getSearchs = (form, condition, col, isCenter, onChange = () => void wrapperCol={{ span: `${fields.fieldcol}` }} // 右侧控件占一行比例 error={form.getError(fields)} // 错误提示: 处理表单中有必填项,保存的校验 tipPosition="bottom" // 错误提示的显示位置: top/bottom + className={(fields.domkey[0] === "subcompanyName" || fields.domkey[0] === "departmentName") ? "hideFormItem" : ""} >
{item.name}{(!this.props.isPreview && group.groupId !== "111111111111111111") ? item.salaryItemShowName : item.name} {item.salaryItemValue || "-"}