diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js new file mode 100644 index 00000000..3539ec72 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js @@ -0,0 +1,59 @@ +/* + * Author: 黎永顺 + * name: 薪资基本信息 + * Description: + * Date: 2023/9/25 + */ +import React, { Component } from "react"; +import { WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import cs from "classnames"; +import { Col, Row } from "antd"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class EditSalaryBaseInfo extends Component { + render() { + const { baseInfo } = this.props; + return ( + + {getLabel(82743, "基础信息")} + + + } + > + + { + _.map(baseInfo, (item, index) => { + const { fieldName, fieldValue } = item; + return ( + + + + {fieldName} + + + {fieldValue} + + + + ); + }) + } + + + ); + } +} + +export default EditSalaryBaseInfo; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js index 07b25888..05479c3f 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js @@ -10,6 +10,7 @@ import { message, Modal, Spin } from "antd"; import { inject, observer } from "mobx-react"; import { acctResultList, updateLockStatus } from "../../../../../apis/calculate"; import ProgressModal from "../../../../../components/progressModal"; +import EditSalaryCalcSlide from "./editSalaryCalcSlide"; const getLabel = WeaLocaleProvider.getLabel; @@ -20,7 +21,8 @@ class EditCalcTable extends Component { super(props); this.state = { loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, - selectedRowKeys: [], progressVisible: false, progress: 0 + selectedRowKeys: [], progressVisible: false, progress: 0, + salaryCalcSlide: { visible: false, id: "" } }; this.timerLock = null; } @@ -51,6 +53,12 @@ class EditCalcTable extends Component { const { salaryItemId, lockType: lockStatus } = params; this.updateLockStatus({ lockStatus, salaryItemId }); break; + case "EDIT": + const { id: salaryCalcId } = params; + this.setState({ + salaryCalcSlide: { visible: true, id: salaryCalcId } + }); + break; default: break; } @@ -152,7 +160,7 @@ class EditCalcTable extends Component { }; render() { - const { loading, progressVisible, progress } = this.state; + const { loading, progressVisible, progress, salaryCalcSlide } = this.state; return (
@@ -162,6 +170,13 @@ class EditCalcTable extends Component { // src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/calcTable" id="atdTable" /> + this.setState({ + salaryCalcSlide: { + visible: false, + id: "" + } + }, () => isFresh === "true" && this.queryCalcResultList())}/> { progressVisible && { + acctresultDetail({ id }).then(({ status, data }) => { + if (status) { + const { employeeInfos, issuedAndReissueItems, itemsByGroup } = data; + this.setState({ + baseInfo: employeeInfos, issuedAndReissueItems, itemsByGroup + }); + } + }); + }; + renderTitle = () => { + const { loading } = this.state; + return
+
+
+
{getLabel(543559, "编辑薪资")}
+
+
+ +
+
; + }; + handleItemValueChange = (field, value, isInput, groupId) => { + const { issuedAndReissueItems, itemsByGroup } = this.state; + if (isInput === "itemsByGroup") { + this.setState({ + itemsByGroup: itemsByGroup.map(item => { + if (item.salarySobItemGroupId === groupId) { + return { + ...item, + salaryItems: _.map(item.salaryItems, it => { + if (it.salaryItemId === field) { + return { ...it, resultValue: value }; + } + return { ...it }; + }) + }; + } + return { ...item }; + }) + }); + } else if (isInput === "issuedAndReissueItems") { + this.setState({ + issuedAndReissueItems: issuedAndReissueItems.map(item => { + item = { ...item }; + if (item.salaryItemName === field) { + item.resultValue = value; + } + return item; + }) + }); + } + }; + save = () => { + const { id: salaryAcctEmpId } = this.props; + const { issuedAndReissueItems, itemsByGroup } = this.state; + const payload = { + salaryAcctEmpId, + items: [ + ..._.reduce(itemsByGroup, (pre, cur) => { + return [ + ...pre, + ..._.map(cur.salaryItems, it => { + return { + salaryItemId: it.salaryItemId, + resultValue: (it.dataType === "number" && !!it.resultValue) ? toDecimal_n(it.resultValue, it.pattern || 2) : it.resultValue + }; + }) + ]; + }, []), + ...issuedAndReissueItems.map(item => ({ + salaryItemId: item.salaryItemId, + resultValue: (item.dataType === "number" && !!item.resultValue) ? toDecimal_n(item.resultValue, item.pattern || 2) : item.resultValue + })) + ] + }; + this.setState({ loading: true }); + saveAcctResult(payload).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(30700, "操作成功!")); + this.props.onClose("true"); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { baseInfo, selectedKey, itemsByGroup, issuedAndReissueItems } = this.state; + const topTab = [ + { title: getLabel(542704, "正常工资薪金所得"), viewcondition: "0" }, + { title: getLabel(542651, "已发补发"), viewcondition: "1" } + ]; + return ( + + + + this.setState({ selectedKey: v })} + datas={!_.isEmpty(issuedAndReissueItems) ? topTab : topTab.slice(0, 1)} + /> + { + selectedKey === "0" && _.map(itemsByGroup, item => { + return ; + }) + } + { + selectedKey === "1" && + + } +
} + /> + + ); + } +} + +export default EditSalaryCalcSlide; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less index 62b7cc07..c0bce5e7 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less @@ -54,3 +54,101 @@ } } } + +.salary-calculate-esf-layout { + + .titleDialog { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 46px 0 16px; + + .titleCol { + flex: 1; + display: flex; + align-items: center; + } + + .titleLeftBox { + .titleIcon { + color: #fff; + margin: 0; + width: 40px; + height: 40px; + line-height: 40px; + font-size: 22px; + display: flex; + align-items: center; + justify-content: center; + background: #F14A2D; + border-radius: 50%; + } + + .title { + font-size: 14px; + color: #333; + padding-left: 6px; + } + } + + .titleRightBox { + justify-content: flex-end; + } + } + + .wea-slide-modal-title { + border-bottom: 1px solid #e5e5e5 !important; + } + + .wea-slide-modal-content { + height: 100%; + + .salary-calculate-esf-area { + background: #f6f6f6; + height: 100%; + overflow-y: auto; + padding: 16px; + + .esf-base-info-form, .wea-title, .wea-content { + padding: 0; + } + + .esf-form-content { + background: #fff; + border: 1px solid #e5e5e5; + border-top: none; + border-bottom: none; + + .esf-form-item { + border-bottom: 1px solid #e5e5e5; + } + + .esf-form-last-item { + border-right: none !important; + } + + .esf-form-odd-item { + border-right: 1px solid #e5e5e5; + } + + .label { + color: #666; + } + + .label, .value { + display: inline-block; + line-height: 24px; + padding: 8px 16px; + } + } + + .wea-new-table { + background: #FFF; + } + + .wea-search-group { + padding: 0; + } + } + } +} diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.less index 3923efea..b64a4dad 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.less @@ -5,6 +5,10 @@ height: 100%; background: #f6f6f6; + .wea-new-top-req { + z-index: 0 !important; + } + .wea-new-top-req-wapper .wea-new-top-req-title > div:last-child { right: 16px; }