From 72478c3fd894a68ff0d51820e8e6bcdf6a6f9651 Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Thu, 3 Nov 2022 17:52:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=93=E9=A1=B9=E9=99=84=E5=8A=A0=E6=89=A3?= =?UTF-8?q?=E9=99=A4=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/special.js | 63 +++++ pc4mobx/hrmSalary/index.js | 3 + .../components/inlineForm.js | 26 ++ .../specialAddDeduction/index.js | 242 ++++++++++++++++++ .../specialAddDeduction/index.less | 55 ++++ pc4mobx/hrmSalary/stores/index.js | 4 +- pc4mobx/hrmSalary/stores/specialAdd.js | 7 + pc4mobx/hrmSalary/util/options.js | 11 +- 8 files changed, 409 insertions(+), 2 deletions(-) create mode 100644 pc4mobx/hrmSalary/apis/special.js create mode 100644 pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/inlineForm.js create mode 100644 pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js create mode 100644 pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.less create mode 100644 pc4mobx/hrmSalary/stores/specialAdd.js diff --git a/pc4mobx/hrmSalary/apis/special.js b/pc4mobx/hrmSalary/apis/special.js new file mode 100644 index 00000000..2ae582db --- /dev/null +++ b/pc4mobx/hrmSalary/apis/special.js @@ -0,0 +1,63 @@ +import { WeaTools } from "ecCom"; +import { postFetch } from "../util/request"; + +//高级搜索条件 +export const getSearchCondition = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/specialAddDeduction/getSearchCondition", "GET", params); +}; +// 获取专项附加扣除列表 +export const specialAddDeductionList = (params) => { + return postFetch('/api/bs/hrmsalary/specialAddDeduction/list', params); +} +// 导入档案 +export const importSalaryArchive = (params) => { + return postFetch('/api/bs/hrmsalary/salaryArchive/importSalaryArchive', params); +} +// 薪资档案预览 +export const salaryArchivePreview = (params) => { + return postFetch('/api/bs/hrmsalary/salaryArchive/preview', params); +} +// 公共枚举接口 +export const commonEnumList = (params) => { + return WeaTools.callApi('/api/bs/hrmsalary/common/enum/list', 'GET', params); +} +// 获取导入类型 +export const getImportTypes = () => { + return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getImportTypes', 'GET', {}); +} +// 发起调薪地址 +export const salaryAdjustmentInfo = (params) => { + return WeaTools.callApi('/api/bs/hrmsalary/process/salaryAdjustmentInfo', 'GET', params); +} +// 一键全部设为定薪员工 +export const allGotoFixed = (params) => { + return postFetch('/api/bs/hrmsalary/salaryArchive/allGotoFixed', params); +} +// 设为定薪员工 +export const gotoFixed = (params) => { + return postFetch('/api/bs/hrmsalary/salaryArchive/gotoFixed', params); +} +// 停薪 +export const gotoStop = (params) => { + return postFetch('/api/bs/hrmsalary/salaryArchive/gotoStop', params); +} +//全部停薪 +export const allGotoStop = (params) => { + return postFetch('/api/bs/hrmsalary/salaryArchive/allGotoStop', params); +} +// 取消停薪 +export const cancelStop = (params) => { + return postFetch('/api/bs/hrmsalary/salaryArchive/cancelStop', params); +} +// 保存发薪设置 +export const savePaySet = (params) => { + return postFetch('/api/bs/hrmsalary/salaryArchive/savePaySet', params); +} +// 待定薪删除待办 +export const deletePendingTodo = (params) => { + return postFetch('/api/bs/hrmsalary/salaryArchive/deletePendingTodo', params); +} +// 待停薪删除待办 +export const deleteSuspendTodo = (params) => { + return postFetch('/api/bs/hrmsalary/salaryArchive/deleteSuspendTodo', params); +} diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index edea0f0a..10ffaca1 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -14,6 +14,7 @@ import CumDeduct from "./pages/dataAcquisition/cumDeduct"; import OtherDeduct from "./pages/dataAcquisition/otherDeduct"; import CumSituation from "./pages/dataAcquisition/cumSituation"; import Attendance from "./pages/dataAcquisition/attendance"; +import SpecialAddDeduction from './pages/dataAcquisition/specialAddDeduction'; import Ledger from "./pages/ledger"; import Calculate from "./pages/calculate"; import Payroll from "./pages/payroll"; @@ -61,6 +62,7 @@ const DataAcquisition = (props) => props.children; // otherDeduct 其他免税扣除 // cumSituation 往期累计情况 // attendance 考勤引用 +// specialAddDeduction 专项附件扣除 // ledger 薪资账套 // calculate 薪资核算 // calculateDetail 核算详情 @@ -111,6 +113,7 @@ const Routes = ( + diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/inlineForm.js b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/inlineForm.js new file mode 100644 index 00000000..bb2b89b5 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/inlineForm.js @@ -0,0 +1,26 @@ +import React, { Component } from "react"; +import { Form } from "antd"; +import { WeaSelect } from "ecCom"; +import { optionAddWhole } from "../../../../util/options"; + +class InlineForm extends Component { + + render() { + const { taxAgentOption = [], form, onChange } = this.props; + return ( +
+ + + +
+ ); + } +} + +export default Form.create()(InlineForm); diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js new file mode 100644 index 00000000..829d62d9 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js @@ -0,0 +1,242 @@ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { Button, Dropdown, Menu } from "antd"; +import { WeaSlideModal, WeaTab, WeaTable, WeaTop } from "ecCom"; +import InlineForm from "./components/inlineForm"; +import { getSearchs, renderLoading } from "../../../util"; +import * as API from "../../../apis/special"; +import SlideModalTitle from "../../../components/slideModalTitle"; +import "./index.less"; + +@inject("specialAddStore", "taxAgentStore") +@observer +class SpecialAddDeduction extends Component { + constructor(props) { + super(props); + this.state = { + loading: { + query: false + }, + advanceParams: { //高级搜索参数 + visible: false, + condition: [] + }, + drawerParams: { //抽屜弹框参数 + visible: false, title: '新建' + }, + dataSource: [], + columns: [], + selectedRowKeys: [], + pageInfo: { + current: 1, pageSize: 10, total: 0 + } + }; + this.inlineForm = null; + } + + componentDidMount() { + const { taxAgentStore: { getTaxAgentSelectListAsAdmin } } = this.props; + getTaxAgentSelectListAsAdmin(); + this.getSearchCondition(); + this.specialAddDeductionList(); + } + + getSearchCondition = () => { + const { specialAddStore: { advanceForm } } = this.props; + const { advanceParams } = this.state; + API.getSearchCondition().then(({ status, data }) => { + if (status) { + const { condition } = data; + this.setState({ + advanceParams: { + ...advanceParams, + condition: condition + } + }, () => advanceForm.initFormFields(this.state.advanceParams.condition) + ); + } + }); + }; + specialAddDeductionList = (params = {}) => { + const { loading, pageInfo } = this.state; + const { specialAddStore: { advanceForm } } = this.props; + const queryParams = advanceForm.getFormParams(); + const extraParams = this.inlineForm ? this.inlineForm.getFieldsValue() : {}; + const payload = { + ...pageInfo, + ...queryParams, + ...extraParams, + ...params + }; + console.log(queryParams, payload); + console.log(this.inlineForm); + this.setState({ loading: { ...loading, query: true } }); + API.specialAddDeductionList(payload).then(({ status, data }) => { + this.setState({ loading: { ...loading, query: false } }); + if (status) { + const { columns, dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + pageInfo: { ...pageInfo, current, pageSize, total }, + columns, dataSource + }); + } + }); + }; + getSearchsAdQuick = (isAd) => { + const { advanceParams } = this.state; + const { taxAgentStore: { taxAgentAdminOption }, specialAddStore: { advanceForm } } = this.props; + return isAd ? getSearchs(advanceForm, advanceParams.condition, 2) + : this.inlineForm = dom} + taxAgentOption={taxAgentAdminOption} + onChange={this.specialAddDeductionList} + />; + }; + + render() { + const { advanceParams, dataSource, columns, loading, selectedRowKeys, pageInfo, drawerParams } = this.state; + const { taxAgentStore, specialAddStore: { advanceForm } } = this.props; + const { showOperateBtn } = taxAgentStore; + const rowSelection = { + selectedRowKeys, + onChange: (selectedRowKeys) => this.setState({ selectedRowKeys }) + }; + const customBtns = [ + { + }} + overlay={ + { + }}> + 导出选中 + + } + type="primary" + > + 导出全部 + + ]; + const btns = [ + , + { + }} + overlay={ + { + }}> + 导出选中 + + } + type="ghost" + > + 导出全部 + , + , + { + }} + overlay={ + { + }}> + 删除所选 + + } + type="ghost" + > + 一键清空 + + ]; + const pagination = { + ...pageInfo, + showTotal: (total) => `共 ${total} 条`, + pageSizeOptions: ["10", "20", "50", "100"], + showSizeChanger: true, + onShowSizeChange: (current, pageSize) => { + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => { + this.specialAddDeductionList({ + current, + pageSize + }); + }); + }, + onChange: (current) => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => { + this.specialAddDeductionList({ + current + }); + }); + } + }; + //加载数据 + if (_.isEmpty(columns)) { + // 无权限处理 + return renderLoading(); + } + return ( +
+ } + iconBgcolor="#F14A2D" + buttons={showOperateBtn ? btns : []} + > +
+ advanceForm.updateFields({ username: v })} + onAdReset={() => advanceForm.reset()} + onSearch={() => this.specialAddDeductionList()} + searchsAdQuick={this.getSearchsAdQuick()} + searchsAd={this.getSearchsAdQuick(true)} + setShowSearchAd={bool => this.setState({ advanceParams: { ...advanceParams, visible: bool } })} + /> + + { + // this.state.currentOperate == "add" ? doSave() : doUpdate(); + }} + editable={false} + showOperateBtn={showOperateBtn} + customOperate={showOperateBtn ? customBtns : []} + /> + } + content={ +
123
+ } + onClose={() => this.setState({ drawerParams: { ...drawerParams, visible: false } })} + showMask={true} + closeMaskOnClick={() => this.setState({ drawerParams: { ...drawerParams, visible: false } })} + /> +
+
+
+ ); + } +} + +export default SpecialAddDeduction; + diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.less b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.less new file mode 100644 index 00000000..4a617f8d --- /dev/null +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.less @@ -0,0 +1,55 @@ +.specialAddWrapper { + height: 100%; + + .wea-new-top-wapper { + .specialAddContent { + height: 100%; + display: flex; + flex-direction: column; + + .wea-tab-search-ad-quick { + .wea-tab-left { + display: flex; + align-items: center; + } + + .wea-tab-right { + margin-top: 0; + } + + .wea-search-container-search-ad-quick { + top: 47px !important; + } + } + } + } +} + +.specialAddSlideWrapper{ + .wea-slide-modal-title{ + height: initial; + line-height: initial; + text-align: left; + } + .rodal-close{ + z-index: 99; + top: 10px!important; + } + +} + +@media (min-width: 1260px){ + .specialAddSlideWrapper{ + .reqTopWrapper .wea-new-top-req-title>div:first-child>div{ + max-width: 100%!important; + } + } +} +@media screen and (min-width: 1060px) and (max-width: 1260px) { + .specialAddSlideWrapper{ + .reqTopWrapper .wea-new-top-req-title>div:first-child>div{ + max-width: calc(100% - 96px)!important; + } + } +} + diff --git a/pc4mobx/hrmSalary/stores/index.js b/pc4mobx/hrmSalary/stores/index.js index e07529c7..6b7af8e1 100644 --- a/pc4mobx/hrmSalary/stores/index.js +++ b/pc4mobx/hrmSalary/stores/index.js @@ -16,7 +16,8 @@ import { payrollStore } from "./payroll"; import { calculateStore } from "./calculate"; import { DeclareStore } from "./declare"; import { StandingBookStore } from "./StandingBook"; -import {PayrollFilesStore} from './payrollFiles'; +import { PayrollFilesStore } from "./payrollFiles"; +import { SpecialAddStore } from "./specialAdd"; module.exports = { baseFormStore: new BaseFormStore(), @@ -38,4 +39,5 @@ module.exports = { declareStore: new DeclareStore(), standingBookStore: new StandingBookStore(), payrollFilesStore: new PayrollFilesStore(), + specialAddStore: new SpecialAddStore() }; diff --git a/pc4mobx/hrmSalary/stores/specialAdd.js b/pc4mobx/hrmSalary/stores/specialAdd.js new file mode 100644 index 00000000..6167156d --- /dev/null +++ b/pc4mobx/hrmSalary/stores/specialAdd.js @@ -0,0 +1,7 @@ +import { observable, action, toJS } from 'mobx'; +import { WeaForm } from 'comsMobx'; + +export class SpecialAddStore { + @observable advanceForm = new WeaForm(); + @observable addForm = new WeaForm(); +} diff --git a/pc4mobx/hrmSalary/util/options.js b/pc4mobx/hrmSalary/util/options.js index 670d5dee..13ef81e4 100644 --- a/pc4mobx/hrmSalary/util/options.js +++ b/pc4mobx/hrmSalary/util/options.js @@ -7,4 +7,13 @@ export const optionAddAll = (options) => { selected: false }) return results; -} \ No newline at end of file +} +export const optionAddWhole = (options) => { + let results = [...options]; + results.unshift({ + key: "", + showname: "全部", + selected: false + }) + return results; +}