From 72478c3fd894a68ff0d51820e8e6bcdf6a6f9651 Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Thu, 3 Nov 2022 17:52:02 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E4=B8=93=E9=A1=B9=E9=99=84=E5=8A=A0?= =?UTF-8?q?=E6=89=A3=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; +} From ca04e5405d154a3527b0ea910ffb7cf446fb4209 Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Fri, 4 Nov 2022 11:33:58 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E4=B8=93=E9=A1=B9=E9=99=84=E5=8A=A0?= =?UTF-8?q?=E6=89=A3=E9=99=A4=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/special.js | 16 ++ .../pages/dataAcquisition/addItems.js | 6 +- .../components/condition.js | 71 ++++++ .../components/inlineForm.js | 3 +- .../components/specialAddContent.js | 13 + .../specialAddDeduction/index.js | 226 ++++++++++++++++-- .../specialAddDeduction/index.less | 59 ++++- 7 files changed, 357 insertions(+), 37 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/condition.js create mode 100644 pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/specialAddContent.js diff --git a/pc4mobx/hrmSalary/apis/special.js b/pc4mobx/hrmSalary/apis/special.js index 2ae582db..0072c4e6 100644 --- a/pc4mobx/hrmSalary/apis/special.js +++ b/pc4mobx/hrmSalary/apis/special.js @@ -9,6 +9,22 @@ export const getSearchCondition = (params) => { export const specialAddDeductionList = (params) => { return postFetch('/api/bs/hrmsalary/specialAddDeduction/list', params); } +// 新增专项附加扣除 +export const specialAddDeductionCreateData = (params) => { + return postFetch('/api/bs/hrmsalary/specialAddDeduction/createData', params); +} +// 编辑专项附加扣除 +export const specialAddDeductionEditData = (params) => { + return postFetch('/api/bs/hrmsalary/specialAddDeduction/editData', params); +} +// 查看明细 +export const specialAddDeductionGetDetailList = (params) => { + return postFetch('/api/bs/hrmsalary/specialAddDeduction/getDetailList', params); +} +// 批量专项附加扣除 +export const specialAddDeductionDeleteSelectData = (params) => { + return postFetch('/api/bs/hrmsalary/specialAddDeduction/deleteSelectData', params); +} // 导入档案 export const importSalaryArchive = (params) => { return postFetch('/api/bs/hrmsalary/salaryArchive/importSalaryArchive', params); diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js b/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js index 836fb1a8..b57b8860 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js @@ -51,9 +51,9 @@ class AddItems extends Component { } render() { - const { taxAgentOption = [], form, condition = [], isCum, editId } = this.props; + const { taxAgentOption = [], form, condition = [], isCum, isSpecial, editId } = this.props; const { baseInfo } = this.state; - const items = [ + let items = [ { com: PickDate({ label: "税款所属期", @@ -161,7 +161,7 @@ class AddItems extends Component { }) } ]; - + isSpecial && items.shift(); return (
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/specialAddContent.js b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/specialAddContent.js new file mode 100644 index 00000000..7ac35116 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/specialAddContent.js @@ -0,0 +1,13 @@ +import React, { Component } from "react"; + +class SpecialAddContent extends Component { + render() { + return ( +
+ +
+ ); + } +} + +export default SpecialAddContent; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js index 829d62d9..bc564e65 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js @@ -1,11 +1,14 @@ 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 { Button, Dropdown, Menu, message, Modal, Popover } from "antd"; +import { WeaPopoverHrm, 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 AddItems from "../addItems"; +import SpecialAddContent from "./components/specialAddContent"; +import { condition } from "./components/condition"; import "./index.less"; @inject("specialAddStore", "taxAgentStore") @@ -22,7 +25,9 @@ class SpecialAddDeduction extends Component { condition: [] }, drawerParams: { //抽屜弹框参数 - visible: false, title: '新建' + visible: false, title: "新建", + loading: false, isView: true, + editId: {} }, dataSource: [], columns: [], @@ -32,10 +37,12 @@ class SpecialAddDeduction extends Component { } }; this.inlineForm = null; + this.addItemRef = null; } componentDidMount() { - const { taxAgentStore: { getTaxAgentSelectListAsAdmin } } = this.props; + const { taxAgentStore: { getTaxAgentSelectListAsAdmin }, specialAddStore: { addForm } } = this.props; + addForm.initFormFields(condition); getTaxAgentSelectListAsAdmin(); this.getSearchCondition(); this.specialAddDeductionList(); @@ -48,12 +55,11 @@ class SpecialAddDeduction extends Component { if (status) { const { condition } = data; this.setState({ - advanceParams: { - ...advanceParams, - condition: condition - } - }, () => advanceForm.initFormFields(this.state.advanceParams.condition) - ); + advanceParams: { + ...advanceParams, + condition: condition + } + }, () => advanceForm.initFormFields(this.state.advanceParams.condition)); } }); }; @@ -74,14 +80,145 @@ class SpecialAddDeduction extends Component { API.specialAddDeductionList(payload).then(({ status, data }) => { this.setState({ loading: { ...loading, query: false } }); if (status) { - const { columns, dataSource, pageNum: current, pageSize, total } = data; + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; this.setState({ pageInfo: { ...pageInfo, current, pageSize, total }, - columns, dataSource + dataSource, + columns: _.map(columns, item => { + const { dataIndex } = item; + if (dataIndex === "username") { + return { + ...item, + render: (text, record) => { + return window.pointerXY(e)} + title={text} + > + {text} + ; + } + }; + } else if (dataIndex === "operate") { + return { + ...item, + render: (text, record) => ( +
+ { + }}> + 查看明细 + + { + this.props.taxAgentStore.showOperateBtn && + this.handleOperate(e, record)}> + 编辑 + 删除 + } title=""> + + + } +
+ ) + }; + } else { + return { ...item }; + } + }) }); } }); }; + handleSaveSpecialList = (payload) => { + const { drawerParams } = this.state; + this.setState({ drawerParams: { ...drawerParams, loading: true } }); + if (!_.isEmpty(drawerParams.editId)) { + API.specialAddDeductionEditData({ ...payload, id: drawerParams.editId.id }).then(({ status, errormsg }) => { + this.setState({ drawerParams: { ...drawerParams, loading: false } }); + if (status) { + message.success("编辑成功"); + this.setState({ + drawerParams: { + ...drawerParams, + visible: false, + editId: {} + } + }, () => { + const { specialAddStore: { addForm } } = this.props; + this.specialAddDeductionList(); + addForm.resetForm(); + }); + } else { + message.error(errormsg || "编辑失败"); + } + }); + } else { + API.specialAddDeductionCreateData(payload).then(({ status, errormsg }) => { + this.setState({ drawerParams: { ...drawerParams, loading: false } }); + if (status) { + message.success("新增成功"); + this.setState({ + drawerParams: { + ...drawerParams, + visible: false, + editId: {} + } + }, () => { + const { specialAddStore: { addForm } } = this.props; + this.specialAddDeductionList(); + addForm.resetForm(); + }); + } else { + message.error(errormsg || "新增失败"); + } + }); + } + }; + handleOperate = ({ key }, row) => { + const { drawerParams } = this.state; + if (key === "edit") { + this.setState({ + drawerParams: { + ...drawerParams, + visible: true, + isView: false, + title: "编辑" + } + }, () => { + const { drawerParams: params } = this.state; + API.specialAddDeductionGetDetailList({ specialAddDeductionId: row.id }).then(({ status, data }) => { + if (status) { + this.setState({ + drawerParams: { + ...params, + editId: data + } + }); + } + }); + }); + } else if (key === "delete") { + const payload = { + ids: [row.id] + }; + Modal.confirm({ + title: "信息确认", + content: `确定删除${row.departmentName}${row.username}的专项附加扣除数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。`, + onOk: () => { + API.specialAddDeductionDeleteSelectData(payload).then(({ status, errormsg }) => { + if (status) { + message.success("删除成功"); + this.specialAddDeductionList(); + } else { + message.error(errormsg || "删除失败"); + } + }); + } + }); + } + }; getSearchsAdQuick = (isAd) => { const { advanceParams } = this.state; const { taxAgentStore: { taxAgentAdminOption }, specialAddStore: { advanceForm } } = this.props; @@ -95,8 +232,8 @@ class SpecialAddDeduction extends Component { render() { const { advanceParams, dataSource, columns, loading, selectedRowKeys, pageInfo, drawerParams } = this.state; - const { taxAgentStore, specialAddStore: { advanceForm } } = this.props; - const { showOperateBtn } = taxAgentStore; + const { taxAgentStore, specialAddStore: { advanceForm, addForm } } = this.props; + const { showOperateBtn, taxAgentAdminOption } = taxAgentStore; const rowSelection = { selectedRowKeys, onChange: (selectedRowKeys) => this.setState({ selectedRowKeys }) @@ -131,7 +268,14 @@ class SpecialAddDeduction extends Component { > 导出全部 , - , + , { }} @@ -192,6 +336,7 @@ class SpecialAddDeduction extends Component { searchsBaseValue={advanceForm.getFormParams().username} onSearchChange={(v) => advanceForm.updateFields({ username: v })} onAdReset={() => advanceForm.reset()} + onAdSearch={() => this.specialAddDeductionList()} onSearch={() => this.specialAddDeductionList()} searchsAdQuick={this.getSearchsAdQuick()} searchsAd={this.getSearchsAdQuick(true)} @@ -216,21 +361,60 @@ class SpecialAddDeduction extends Component { title={ { - // this.state.currentOperate == "add" ? doSave() : doUpdate(); + const { baseInfo } = this.addItemRef.state; + const bool = _.every(_.pick(baseInfo, ["taxAgentId", "employeeId"]), v => !_.isEmpty(v)); + if (!bool && _.isEmpty(drawerParams.editId)) { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + return; + } + const payload = { + ..._.pick(baseInfo, ["taxAgentId", "employeeId", "taxAgentName"]), + ...addForm.getFormParams() + }; + this.handleSaveSpecialList(payload); }} - editable={false} + editable={!drawerParams.isView} showOperateBtn={showOperateBtn} - customOperate={showOperateBtn ? customBtns : []} + customOperate={(showOperateBtn && !drawerParams.isView) ? customBtns : []} /> } content={ -
123
+ !drawerParams.isView ? + this.addItemRef = dom} + taxAgentOption={taxAgentAdminOption} + form={addForm} + isSpecial + editId={drawerParams.editId} + condition={condition} + /> : + } - onClose={() => this.setState({ drawerParams: { ...drawerParams, visible: false } })} + onClose={() => this.setState({ + drawerParams: { + ...drawerParams, + visible: false, + isView: true, + editId: {} + } + })} showMask={true} - closeMaskOnClick={() => this.setState({ drawerParams: { ...drawerParams, visible: false } })} + closeMaskOnClick={() => this.setState({ + drawerParams: { + ...drawerParams, + visible: false, + isView: true, + editId: {} + } + })} /> + {/*人员卡片*/} +
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.less b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.less index 4a617f8d..d816b67e 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.less +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.less @@ -23,32 +23,69 @@ } } } + + .linkWapper { + a { + color: #4d7ad8; + margin-right: 8px; + } + + i { + cursor: pointer; + } + + a:hover { + text-decoration: none; + } + } } -.specialAddSlideWrapper{ - .wea-slide-modal-title{ +.moreIconWrapper { + .ant-popover-inner { + min-width: 106px + } + + .ant-popover-inner-content { + padding: 0; + + .ant-menu { + .ant-menu-item { + border-right: none; + height: 30px; + line-height: 30px; + text-align: center; + padding: 0; + } + } + } +} + +.specialAddSlideWrapper { + .wea-slide-modal-title { height: initial; line-height: initial; text-align: left; } - .rodal-close{ + + .rodal-close { z-index: 99; - top: 10px!important; + top: 10px !important; } } -@media (min-width: 1260px){ - .specialAddSlideWrapper{ - .reqTopWrapper .wea-new-top-req-title>div:first-child>div{ - max-width: 100%!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; + .specialAddSlideWrapper { + .reqTopWrapper .wea-new-top-req-title > div:first-child > div { + max-width: calc(100% - 96px) !important; } } } From f8e59efbbe3e457f07fb2809f2a4018d89277ac0 Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Fri, 4 Nov 2022 14:08:19 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js index bc564e65..3a796cf4 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js @@ -295,6 +295,7 @@ class SpecialAddDeduction extends Component { showTotal: (total) => `共 ${total} 条`, pageSizeOptions: ["10", "20", "50", "100"], showSizeChanger: true, + showQuickJumper: true, onShowSizeChange: (current, pageSize) => { this.setState({ pageInfo: { ...pageInfo, current, pageSize } From fad63cc781ba789e900837eba1c65c567e872d68 Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Fri, 4 Nov 2022 16:31:24 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E4=B8=93=E9=A1=B9=E9=99=84=E5=8A=A0?= =?UTF-8?q?=E6=89=A3=E9=99=A4=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../specialAddDeduction/index.js | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js index 3a796cf4..59b9313d 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js @@ -75,7 +75,6 @@ class SpecialAddDeduction extends Component { ...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 } }); @@ -219,6 +218,33 @@ class SpecialAddDeduction extends Component { }); } }; + deleteSelectAddUpDeduction = () => { + const { selectedRowKeysKey } = this.state; + if (selectedRowKeysKey.length === 0) { + message.warning("未选择条目"); + return; + } + const payload = { + ids: selectedRowKeysKey + }; + Modal.confirm({ + title: "信息确认", + content: "确定删除所选数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。", + onOk: () => { + API.specialAddDeductionDeleteSelectData(payload).then(({ status, errormsg }) => { + if (status) { + message.success("删除成功"); + this.specialAddDeductionList(); + } else { + message.error(errormsg || "删除失败"); + } + }); + }, + onCancel: () => { + } + }); + + }; getSearchsAdQuick = (isAd) => { const { advanceParams } = this.state; const { taxAgentStore: { taxAgentAdminOption }, specialAddStore: { advanceForm } } = this.props; @@ -280,8 +306,7 @@ class SpecialAddDeduction extends Component { onClick={() => { }} overlay={ - { - }}> + 删除所选 } From cf315eb6085134d84101864dfdd39997ce3e0de4 Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Mon, 7 Nov 2022 13:57:22 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E4=B8=93=E9=A1=B9=E9=99=84=E5=8A=A0?= =?UTF-8?q?=E6=89=A3=E9=99=A4=E6=A8=A1=E5=9D=97=E9=A1=B5=E9=9D=A2=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=81=94=E8=B0=83=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/special.js | 60 +---- .../components/specialAddContent.js | 82 ++++++- .../specialAddDeduction/index.js | 206 ++++++++++++++++-- 3 files changed, 275 insertions(+), 73 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/special.js b/pc4mobx/hrmSalary/apis/special.js index 0072c4e6..da0b4869 100644 --- a/pc4mobx/hrmSalary/apis/special.js +++ b/pc4mobx/hrmSalary/apis/special.js @@ -25,55 +25,19 @@ export const specialAddDeductionGetDetailList = (params) => { export const specialAddDeductionDeleteSelectData = (params) => { return postFetch('/api/bs/hrmsalary/specialAddDeduction/deleteSelectData', params); } -// 导入档案 -export const importSalaryArchive = (params) => { - return postFetch('/api/bs/hrmsalary/salaryArchive/importSalaryArchive', params); +// 一键清空 +export const specialAddDeductionDeleteAllData = (params) => { + return postFetch('/api/bs/hrmsalary/specialAddDeduction/deleteAllData', params); } -// 薪资档案预览 -export const salaryArchivePreview = (params) => { - return postFetch('/api/bs/hrmsalary/salaryArchive/preview', params); +// 查看单条信息 +export const getSpecialAddDeduction = (params) => { + return postFetch('/api/bs/hrmsalary/specialAddDeduction/getSpecialAddDeduction', params); } -// 公共枚举接口 -export const commonEnumList = (params) => { - return WeaTools.callApi('/api/bs/hrmsalary/common/enum/list', 'GET', params); +// 导入预览 +export const specialAddDeductionPreview = (params) => { + return postFetch('/api/bs/hrmsalary/specialAddDeduction/preview', 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); +// 导入预览结果 +export const specialAddDeductionImportData = (params) => { + return postFetch('/api/bs/hrmsalary/specialAddDeduction/importData', params); } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/specialAddContent.js b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/specialAddContent.js index 7ac35116..cfdfff2c 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/specialAddContent.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/specialAddContent.js @@ -1,11 +1,85 @@ import React, { Component } from "react"; +import { WeaTable } from "ecCom"; +import * as API from "../../../../apis/special"; class SpecialAddContent extends Component { - render() { - return ( -
+ constructor(props) { + super(props); + this.state = { + dataSource: [], + columns: [], + loading: { + query: false + }, + selectedRowKeys: [], + pageInfo: { + current: 1, + pageSize: 10, + total: 0 + } + }; + } -
+ componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.specialId !== this.props.specialId) { + nextProps.specialId && this.specialAddDeductionGetDetailList({ specialAddDeductionId: nextProps.specialId }); + } + } + + specialAddDeductionGetDetailList = (payload) => { + this.setState({ loading: { ...this.state.loading, query: true } }); + API.specialAddDeductionGetDetailList(payload).then(({ status, data }) => { + this.setState({ loading: { ...this.state.loading, query: false } }); + if (status) { + const { columns, list: dataSource, pageSize, pageNum, total } = data; + this.setState({ + columns, dataSource, + pageInfo: { + ...this.pageInfo, + pageSize, pageNum, total + } + }); + } + }); + }; + + render() { + const { columns, dataSource, pageInfo, selectedRowKeys, loading } = this.state; + const { specialId } = this.props; + const pagination = { + ...pageInfo, + showTotal: (total) => `共 ${total} 条`, + pageSizeOptions: ["10", "20", "50", "100"], + showSizeChanger: true, + showQuickJumper: true, + onShowSizeChange: (current, pageSize) => { + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => { + this.specialAddDeductionGetDetailList({ specialAddDeductionId: specialId, current, pageSize }); + }); + }, + onChange: (current) => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => { + this.specialAddDeductionGetDetailList({ specialAddDeductionId: specialId, current }); + }); + } + }; + const rowSelection = { + selectedRowKeys, + onChange: (selectedRowKeys) => this.setState({ selectedRowKeys }) + }; + return ( + ); } } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js index 59b9313d..99f2a477 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js @@ -1,7 +1,7 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { Button, Dropdown, Menu, message, Modal, Popover } from "antd"; -import { WeaPopoverHrm, WeaSlideModal, WeaTab, WeaTable, WeaTop } from "ecCom"; +import { Button, Col, Dropdown, Menu, message, Modal, Popover, Row } from "antd"; +import { WeaPopoverHrm, WeaSelect, WeaSlideModal, WeaTab, WeaTable, WeaTop } from "ecCom"; import InlineForm from "./components/inlineForm"; import { getSearchs, renderLoading } from "../../../util"; import * as API from "../../../apis/special"; @@ -9,6 +9,8 @@ import SlideModalTitle from "../../../components/slideModalTitle"; import AddItems from "../addItems"; import SpecialAddContent from "./components/specialAddContent"; import { condition } from "./components/condition"; +import ImportModal from "../../../components/importModal"; +import { modalColumns } from "../cumDeduct/columns"; import "./index.less"; @inject("specialAddStore", "taxAgentStore") @@ -29,6 +31,11 @@ class SpecialAddDeduction extends Component { loading: false, isView: true, editId: {} }, + importParams: { //导入弹框参数 + visible: false, step: 0, + importResult: [], + payload: { taxAgentId: "" } + }, dataSource: [], columns: [], selectedRowKeys: [], @@ -38,6 +45,7 @@ class SpecialAddDeduction extends Component { }; this.inlineForm = null; this.addItemRef = null; + this.specialContentRef = null; } componentDidMount() { @@ -104,6 +112,15 @@ class SpecialAddDeduction extends Component { render: (text, record) => (
{ + this.setState({ + drawerParams: { + ...this.state.drawerParams, + visible: true, + isView: true, + title: "专项附加扣除记录", + editId: record + } + }); }}> 查看明细 @@ -142,6 +159,7 @@ class SpecialAddDeduction extends Component { drawerParams: { ...drawerParams, visible: false, + isView: true, editId: {} } }, () => { @@ -162,6 +180,7 @@ class SpecialAddDeduction extends Component { drawerParams: { ...drawerParams, visible: false, + isView: true, editId: {} } }, () => { @@ -187,7 +206,7 @@ class SpecialAddDeduction extends Component { } }, () => { const { drawerParams: params } = this.state; - API.specialAddDeductionGetDetailList({ specialAddDeductionId: row.id }).then(({ status, data }) => { + API.getSpecialAddDeduction({ id: row.id }).then(({ status, data }) => { if (status) { this.setState({ drawerParams: { @@ -219,13 +238,13 @@ class SpecialAddDeduction extends Component { } }; deleteSelectAddUpDeduction = () => { - const { selectedRowKeysKey } = this.state; - if (selectedRowKeysKey.length === 0) { + const { selectedRowKeys } = this.state; + if (selectedRowKeys.length === 0) { message.warning("未选择条目"); return; } const payload = { - ids: selectedRowKeysKey + ids: selectedRowKeys }; Modal.confirm({ title: "信息确认", @@ -245,6 +264,80 @@ class SpecialAddDeduction extends Component { }); }; + specialAddDeductionDeleteAllData = () => { + const extraParams = this.inlineForm ? this.inlineForm.getFieldsValue() : {}; + const payload = { + ...extraParams + }; + Modal.confirm({ + title: "信息确认", + content: `确定清空所有专项附加扣除数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。`, + onOk: () => { + API.specialAddDeductionDeleteAllData(payload).then(({ status, errormsg }) => { + if (status) { + message.success("删除成功"); + this.specialAddDeductionList(); + } else { + message.error(errormsg || "删除失败"); + } + }); + } + }); + }; + specialAddDeductionPreview = (payload) => { + const { importParams } = this.state; + API.specialAddDeductionPreview(payload).then(({ status, data }) => { + if (status) { + const { preview: slideDataSource } = data; + this.setState({ + importParams: { + ...importParams, + slideDataSource + } + }); + } + }); + }; + specialAddDeductionImportData = (payload) => { + const { importParams } = this.state; + API.specialAddDeductionImportData(payload).then(({ status, data: importResult }) => { + if (status) { + this.setState({ + importParams: { + ...importParams, + step: 2, + importResult + } + }); + } + }); + }; + specialAddDeductionExport = () => { + const url = `${window.location.origin}/api/bs/hrmsalary/specialAddDeduction/export?ids=&taxAgentId=${this.inlineForm.getFieldsValue().taxAgentId}`; + window.open(url, "_self"); + }; + specialAddDeductionExportSelect = () => { + const { selectedRowKeys } = this.state; + if (selectedRowKeys.length === 0) { + message.warning("未选择条目"); + return; + } + const url = `${window.location.origin}/api/bs/hrmsalary/specialAddDeduction/export?ids=${selectedRowKeys.join(",")}&taxAgentId=${this.inlineForm.getFieldsValue().taxAgentId}`; + window.open(url, "_self"); + }; + handleExportAllSpecialDetail = () => { + const url = `${window.location.origin}/api/bs/hrmsalary/specialAddDeduction/export`; + window.open(url, "_self"); + }; + handleExportSelectSpecialDetail = () => { + const { state: { selectedRowKeys } } = this.specialContentRef; + if (selectedRowKeys.length === 0) { + message.warning("未选择条目"); + return; + } + const url = `${window.location.origin}/api/bs/hrmsalary/specialAddDeduction/export?ids=${selectedRowKeys.join(",")}`; + window.open(url, "_self"); + }; getSearchsAdQuick = (isAd) => { const { advanceParams } = this.state; const { taxAgentStore: { taxAgentAdminOption }, specialAddStore: { advanceForm } } = this.props; @@ -255,9 +348,42 @@ class SpecialAddDeduction extends Component { onChange={this.specialAddDeductionList} />; }; + renderImportormComponent = () => { + const { importParams } = this.state; + const { taxAgentStore: { taxAgentAdminOption } } = this.props; + return ( + + + + 个税扣缴义务人 + + { + this.setState({ importParams: { ...importParams, payload: { taxAgentId: v } } }); + }} + /> + + + ); + }; render() { - const { advanceParams, dataSource, columns, loading, selectedRowKeys, pageInfo, drawerParams } = this.state; + const { + advanceParams, + dataSource, + columns, + loading, + selectedRowKeys, + pageInfo, + drawerParams, + importParams + } = this.state; const { taxAgentStore, specialAddStore: { advanceForm, addForm } } = this.props; const { showOperateBtn, taxAgentAdminOption } = taxAgentStore; const rowSelection = { @@ -266,11 +392,9 @@ class SpecialAddDeduction extends Component { }; const customBtns = [ { - }} + onClick={this.handleExportAllSpecialDetail} overlay={ - { - }}> + 导出选中 } @@ -280,13 +404,19 @@ class SpecialAddDeduction extends Component { ]; const btns = [ - , + , { - }} + onClick={this.specialAddDeductionExport} overlay={ - { - }}> + 导出选中 } @@ -303,8 +433,7 @@ class SpecialAddDeduction extends Component { } })}>新建, { - }} + onClick={this.specialAddDeductionDeleteAllData} overlay={ 删除所选 @@ -404,9 +533,9 @@ class SpecialAddDeduction extends Component { }; this.handleSaveSpecialList(payload); }} - editable={!drawerParams.isView} + editable={showOperateBtn && !drawerParams.isView} showOperateBtn={showOperateBtn} - customOperate={(showOperateBtn && !drawerParams.isView) ? customBtns : []} + customOperate={(showOperateBtn && drawerParams.isView) ? customBtns : []} /> } content={ @@ -419,7 +548,7 @@ class SpecialAddDeduction extends Component { editId={drawerParams.editId} condition={condition} /> : - + this.specialContentRef = dom} specialId={drawerParams.editId.id}/> } onClose={() => this.setState({ drawerParams: { @@ -441,6 +570,41 @@ class SpecialAddDeduction extends Component { /> {/*人员卡片*/} + {/* 导入模板*/} + { + importParams.visible && + this.setState({ importParams: { ...importParams, step } })} + slideDataSource={importParams.slideDataSource} + importResult={importParams.importResult} + onFinish={() => { + this.setState({ importParams: { ...importParams, step: 0, visible: false } }, () => { + this.specialAddDeductionList(); + localStorage.removeItem("fileList"); + }); + }} + previewImport={this.specialAddDeductionPreview} + importFile={this.specialAddDeductionImportData} + templateLink="/api/bs/hrmsalary/specialAddDeduction/downloadTemplate" + renderFormComponent={this.renderImportormComponent} + visiable={importParams.visible} + onCancel={() => { + localStorage.removeItem("fileList"); + this.setState({ + importParams: { + ...importParams, + step: 0, visible: false, + slideDataSource: [], importResult: [], + payload: { taxAgentId: "" } + } + }); + }} + /> + }
From 824508b41a99e81d7a4f4a4eebadefeb608b3ab3 Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Mon, 7 Nov 2022 13:58:01 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E4=B8=93=E9=A1=B9=E9=99=84=E5=8A=A0?= =?UTF-8?q?=E6=89=A3=E9=99=A4=E6=A8=A1=E5=9D=97=E9=A1=B5=E9=9D=A2=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=81=94=E8=B0=83=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js index 99f2a477..a9b7d33c 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js @@ -82,7 +82,6 @@ class SpecialAddDeduction extends Component { ...extraParams, ...params }; - console.log(queryParams, payload); this.setState({ loading: { ...loading, query: true } }); API.specialAddDeductionList(payload).then(({ status, data }) => { this.setState({ loading: { ...loading, query: false } }); From 8e133ea43a7a5e692dfc4f4f2a045a9d846669bf Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Mon, 7 Nov 2022 15:29:46 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E7=B4=AF=E8=AE=A1=E4=B8=93=E9=A1=B9?= =?UTF-8?q?=E6=89=A3=E9=99=A4=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E4=B8=80?= =?UTF-8?q?=E9=94=AE=E7=B4=AF=E8=AE=A1=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/cumDeduct.js | 4 ++ .../pages/dataAcquisition/cumDeduct/index.js | 37 ++++++++++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/cumDeduct.js b/pc4mobx/hrmSalary/apis/cumDeduct.js index 18ddb1a5..8d54f306 100644 --- a/pc4mobx/hrmSalary/apis/cumDeduct.js +++ b/pc4mobx/hrmSalary/apis/cumDeduct.js @@ -123,3 +123,7 @@ export const deleteSelectAddUpDeduction = (params) => { export const deleteAllAddUpDeduction = (params) => { return postFetch('/api/bs/hrmsalary/addUpDeduction/deleteAllAddUpDeduction', params); } +//一键累计 +export const autoAddAll = (params) => { + return postFetch('/api/bs/hrmsalary/addUpDeduction/autoAddAll', params); +} diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index f3861c66..c63452f8 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -24,6 +24,7 @@ export default class CumDeduct extends React.Component { addVisible: false, editId: {}, saveLoading: false, + addAllLoading: false, value: "", selectedKey: [], slideSelectedKey: [], //详情表格的选中项 @@ -411,9 +412,35 @@ export default class CumDeduct extends React.Component { }); } }; + autoAddAll = () => { + const { monthValue: declareMonth, taxAgentId } = this.state; + const { cumDeductStore: { doSearch } } = this.props; + this.setState({ addAllLoading: true }); + API.autoAddAll({}).then(({ status, errormsg }) => { + this.setState({ addAllLoading: false }); + if (status) { + message.success("操作成功"); + doSearch({ + declareMonth: [declareMonth], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + } else { + message.error(errormsg || "操作失败"); + } + }).catch(() => this.setState({ addAllLoading: false })); + }; render() { - const { modalParam, slideSelectedKey, monthValue, taxAgentId, addVisible, editId, saveLoading } = this.state; + const { + modalParam, + slideSelectedKey, + monthValue, + taxAgentId, + addVisible, + editId, + saveLoading, + addAllLoading + } = this.state; const { cumDeductStore, taxAgentStore } = this.props; const { loading, @@ -546,7 +573,13 @@ export default class CumDeduct extends React.Component { } type="ghost"> 一键清空 - + , + ]; const handleExportAllDetailClick = () => { From 0e4587d18d124fea54a29cf603cbcc56eb00d1d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 8 Nov 2022 09:08:34 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E4=B8=93=E9=A1=B9=E9=99=84=E5=8A=A0?= =?UTF-8?q?=E6=89=A3=E9=99=A4=E5=AF=BC=E5=85=A5=E5=AD=97=E6=AE=B5=E7=9A=84?= =?UTF-8?q?=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataAcquisition/cumDeduct/columns.js | 72 +++++++++++++++++++ .../specialAddDeduction/index.js | 46 ++++++++++-- 2 files changed, 113 insertions(+), 5 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js index fed2a7cb..8bb48c16 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js @@ -139,6 +139,78 @@ export const modalColumns = [ key: "addUpIllnessMedical" } ]; +export const specialModalColumns = [ + { + title: "姓名", + dataIndex: "username", + key: "username" + }, + { + title: "个税扣缴义务人", + dataIndex: "taxAgentName", + key: "taxAgentName" + }, + { + title: "部门", + dataIndex: "departmentName", + key: "departmentName" + }, + { + title: "手机号", + dataIndex: "mobile", + key: "mobile" + }, + { + title: "工号", + dataIndex: "jobNum", + key: "jobNum" + }, + { + title: "证件号码", + dataIndex: "idNo", + key: "idNo" + }, + { + title: "入职日期", + dataIndex: "hiredate", + key: "hiredate" + }, + { + title: "子女教育", + dataIndex: "childrenEducation", + key: "childrenEducation" + }, + { + title: "继续教育", + dataIndex: "continuingEducation", + key: "continuingEducation" + }, + { + title: "住房贷款利息", + dataIndex: "housingLoanInterest", + key: "housingLoanInterest" + }, + { + title: "住房租金", + dataIndex: "housingRent", + key: "housingRent" + }, + { + title: "赡养老人", + dataIndex: "supportingElder", + key: "supportingElder" + }, + { + title: "婴幼儿照护", + dataIndex: "infantCare", + key: "infantCare" + }, + { + title: "大病医疗", + dataIndex: "seriousIllnessTreatment", + key: "seriousIllnessTreatment" + } +]; export const dataSource = []; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js index a9b7d33c..bd97ff8b 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js @@ -1,7 +1,7 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { Button, Col, Dropdown, Menu, message, Modal, Popover, Row } from "antd"; -import { WeaPopoverHrm, WeaSelect, WeaSlideModal, WeaTab, WeaTable, WeaTop } from "ecCom"; +import { WeaPopoverHrm, WeaSelect, WeaSlideModal, WeaTab, WeaTable, WeaTools, WeaTop } from "ecCom"; import InlineForm from "./components/inlineForm"; import { getSearchs, renderLoading } from "../../../util"; import * as API from "../../../apis/special"; @@ -10,7 +10,7 @@ import AddItems from "../addItems"; import SpecialAddContent from "./components/specialAddContent"; import { condition } from "./components/condition"; import ImportModal from "../../../components/importModal"; -import { modalColumns } from "../cumDeduct/columns"; +import { specialModalColumns } from "../cumDeduct/columns"; import "./index.less"; @inject("specialAddStore", "taxAgentStore") @@ -87,6 +87,7 @@ class SpecialAddDeduction extends Component { this.setState({ loading: { ...loading, query: false } }); if (status) { const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + const { userid } = WeaTools.ls.getJSONObj("theme-account") || {}; this.setState({ pageInfo: { ...pageInfo, current, pageSize, total }, dataSource, @@ -123,6 +124,17 @@ class SpecialAddDeduction extends Component { }}> 查看明细 + { + (!this.props.taxAgentStore.showOperateBtn && userid == record.employeeId) && + this.handleOperate(e, record)}> + 编辑 +
} title=""> + + + } { this.props.taxAgentStore.showOperateBtn && + { + console.log(drawerParams.editId.employeeId, userid) + } + { + console.log((showOperateBtn && !drawerParams.isView) || (!showOperateBtn && userid == drawerParams.editId.employeeId)) + } { + const { baseInfo } = this.addItemRef.state; + const bool = _.every(_.pick(baseInfo, ["taxAgentId", "employeeId"]), v => !_.isEmpty(v)); + if (!bool && _.isEmpty(drawerParams.editId)) { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + return; + } + const payload = { + ..._.pick(baseInfo, ["taxAgentId", "employeeId", "taxAgentName"]), + ...addForm.getFormParams() + }; + this.handleSaveSpecialList(payload); + }} loading={drawerParams.loading}>保存 + ] : []} /> } content={ @@ -575,7 +611,7 @@ class SpecialAddDeduction extends Component { this.setState({ importParams: { ...importParams, step } })} slideDataSource={importParams.slideDataSource} From 596392a1027cc05ec4630b47f00a025767b0b494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 8 Nov 2022 15:47:20 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E4=B8=93=E9=A1=B9=E9=99=84=E5=8A=A0?= =?UTF-8?q?=E6=89=A3=E9=99=A4=E9=A1=B5=E9=9D=A2=E6=9F=A5=E8=AF=A2=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E7=9A=84=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/dataAcquisition/specialAddDeduction/index.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js index bd97ff8b..97e8d8e1 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js @@ -356,7 +356,7 @@ class SpecialAddDeduction extends Component { : this.inlineForm = dom} taxAgentOption={taxAgentAdminOption} - onChange={this.specialAddDeductionList} + onChange={(taxAgentId)=>this.specialAddDeductionList({taxAgentId})} />; }; renderImportormComponent = () => { @@ -517,12 +517,6 @@ class SpecialAddDeduction extends Component { pagination={pagination} loading={loading.query} /> - { - console.log(drawerParams.editId.employeeId, userid) - } - { - console.log((showOperateBtn && !drawerParams.isView) || (!showOperateBtn && userid == drawerParams.editId.employeeId)) - }