diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 29804d06..4b788091 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -21,7 +21,7 @@ import PayrollGrant from "./pages/payroll/payrollGrant"; import PayrollDetail from "./pages/payroll/payrollDetail"; import Declare from "./pages/declare"; import TaxRate from "./pages/taxRate"; -// import TaxAgent from "./pages/taxAgent"; +import TaxAgents from "./pages/taxAgent"; import TaxAgent from "./pages/salary/taxAgent"; import CalculateDetail from "./pages/calculateDetail"; import PlaceOnFileDetail from "./pages/calculateDetail/placeOnFileDetail"; @@ -156,6 +156,7 @@ const Routes = ( /> + diff --git a/pc4mobx/hrmSalary/pages/salary/components/baseSettings.js b/pc4mobx/hrmSalary/pages/salary/components/baseSettings.js index ffdd7870..5e24cb5c 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/baseSettings.js +++ b/pc4mobx/hrmSalary/pages/salary/components/baseSettings.js @@ -18,13 +18,13 @@ class BaseSettings extends Component { } render() { - const { taxAgentStore: { salarytaxAgentForm }, decentralization } = this.props; + const { taxAgentStore: { salarytaxAgentForm }, decentralization, isChief } = this.props; return (
{ decentralization === "0" ? - getSearchs(salarytaxAgentForm, decentralizationConditions, 1, true) : - getSearchs(salarytaxAgentForm, editConditions, 1, true) + getSearchs(salarytaxAgentForm, convertConditon(decentralizationConditions, !isChief), 1, false) : + getSearchs(salarytaxAgentForm, convertConditon(editConditions, !isChief), 1, false) }
); @@ -32,3 +32,17 @@ class BaseSettings extends Component { } export default BaseSettings; + +export const convertConditon = (condition, bool) => { + return _.map(condition, item => { + return { + ...item, + items: _.map(item.items, child => { + return { + ...child, + viewAttr: bool ? 1 : child.viewAttr + }; + }) + }; + }); +}; diff --git a/pc4mobx/hrmSalary/pages/salary/components/index.less b/pc4mobx/hrmSalary/pages/salary/components/index.less index a0dcddd6..0743a792 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/index.less +++ b/pc4mobx/hrmSalary/pages/salary/components/index.less @@ -1,3 +1,29 @@ +.taxAgentSlideContent { + .baseSettingWrapper, .taxDeclarationInfoWrapper { + padding: 12px 12px 12px 20px; + + .wea-search-group { + padding: 0; + border: 1px solid #e5e5e5; + border-bottom: none; + + .wea-content { + padding: 0; + + .wea-form-cell, .wea-form-item { + border-bottom: 1px solid #e5e5e5; + padding: 5px 10px 5px 30px; + + .wea-form-item { + padding: 0 !important; + border-bottom: none !important; + } + } + } + } + } +} + .comHint { width: 100%; margin: 16px 0; @@ -55,15 +81,17 @@ } //添加关联人员弹框中的下拉框样式 -.personalScopeModalWrapper{ - .wea-select,.ant-select-selection,.ant-select{ +.personalScopeModalWrapper { + .wea-select, .ant-select-selection, .ant-select { width: 100%; } - .wea-select{ + + .wea-select { display: inline-block; position: relative; } - .ant-select-selection{ + + .ant-select-selection { height: 30px; border-radius: 0; } diff --git a/pc4mobx/hrmSalary/pages/salary/components/personalScope.js b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js index 0e4b71c0..54ba7ccb 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/personalScope.js +++ b/pc4mobx/hrmSalary/pages/salary/components/personalScope.js @@ -5,12 +5,14 @@ * Date: 2022/11/30 */ import React, { Component } from "react"; -import { message, Modal } from "antd"; +import { Button, message, Modal } from "antd"; import { inject, observer } from "mobx-react"; import { WeaButtonIcon, WeaInputSearch, WeaTab } from "ecCom"; -import { taxAgentRangeDelete } from "../../../apis/taxAgent"; +import { taxAgentRangeDelete, taxAgentRangeImportData, taxAgentRangePreview } from "../../../apis/taxAgent"; import PersonalScopeTable from "./personalScopeTable"; import PersonalScopeModal from "./personalScopeModal"; +import ImportModal from "../../../components/importModal"; +import { importEmployColumns } from "../../taxAgent/columns"; @inject("taxAgentStore") @@ -25,7 +27,13 @@ class PersonalScope extends Component { personalAddModal: { visible: false, title: "关联人员", - includeType: "", + includeType: "" + }, + previewDataSource: [], + importParams: { + visible: false, + step: 0, + importResult: {} } }; this.personalScopeTableRef = null; @@ -74,13 +82,36 @@ class PersonalScope extends Component { personalAddModal: { ...personalAddModal, visible: true, - includeType: selectedKey === "listInclude" ? 1 : 0, + includeType: selectedKey === "listInclude" ? 1 : 0 + } + }); + }; + salaryArchivePreview = (params) => { + taxAgentRangePreview(params).then(({ status, data }) => { + if (status) { + const { preview } = data; + this.setState({ + previewDataSource: preview + }); + } + }); + }; + handleImportFile = (params) => { + const { taxAgentId } = this.props; + taxAgentRangeImportData({ ...params, taxAgentId }).then(({ status, data }) => { + if (status) { + this.setState({ + importParams: { + ...this.state.importParams, + importResult: data + } + }); } }); }; render() { - const { selectedKey, searchValue, rowKeys, personalAddModal } = this.state; + const { selectedKey, searchValue, rowKeys, personalAddModal, importParams, previewDataSource } = this.state; const { taxAgentStore: { hideIconInTax, showSalaryItemBtn }, taxAgentId } = this.props; const topTab = [ { @@ -93,6 +124,12 @@ class PersonalScope extends Component { } ]; const btns = (hideIconInTax || showSalaryItemBtn) ? [ + , this.personalScopeTableRef.getPersonalScopeList()} />]; + selectedKey === "listExclude" && btns.shift(); return (
+ {importParams.visible && ( + { + this.setState({ importParams: { ...this.state.importParams, step } }); + }} + importResult={importParams.importResult} + onFinish={() => { + this.setState({ + importParams: { + ...this.state.importParams, + visible: false + } + }, () => this.personalScopeTableRef.getPersonalScopeList()); + }} + previewImport={(params) => this.salaryArchivePreview(params)} + importFile={(params) => this.handleImportFile(params)} + templateLink={`/api/bs/hrmsalary/taxAgent/range/downloadTemplate?taxAgentId=${taxAgentId}`} + visiable={importParams.visible} + onCancel={() => { + this.setState({ importParams: { ...this.state.importParams, visible: false } }); + }} + /> + )}
); } diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js index eac13735..e55ddf30 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js +++ b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js @@ -10,7 +10,7 @@ import { Button, message } from "antd"; import { WeaSlideModal, WeaSteps } from "ecCom"; import SlideModalTitle from "../../../components/slideModalTitle"; import { decentralizationConditions, editConditions } from "../../taxAgent/editConditions"; -import BaseSettings from "./baseSettings"; +import BaseSettings, { convertConditon } from "./baseSettings"; import PersonalScope from "./personalScope"; import TaxDeclarationInfo from "./taxDeclarationInfo"; import * as API from "../../../apis/taxAgent"; @@ -38,10 +38,10 @@ class TaxAgentSlide extends Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible || nextProps.decentralization !== this.props.decentralization) { - const { taxAgentStore: { salarytaxAgentForm }, decentralization } = nextProps; + const { taxAgentStore: { salarytaxAgentForm }, decentralization, isChief } = nextProps; decentralization === "0" ? - salarytaxAgentForm.setCondition(decentralizationConditions, true) : - salarytaxAgentForm.setCondition(editConditions, true); + salarytaxAgentForm.setCondition(convertConditon(decentralizationConditions, !isChief), true) : + salarytaxAgentForm.setCondition(convertConditon(editConditions, !isChief), true); this.setState({ current: nextProps.current, taxAgentId: nextProps.taxAgentId }, () => { if (this.state.taxAgentId) this.getTaxAgentForm(); }); @@ -53,13 +53,14 @@ class TaxAgentSlide extends Component { const { taxAgentStore: { salarytaxAgentForm } } = this.props; API.getTaxAgentForm({ id: taxAgentId }).then(({ status, data }) => { if (status) { - const { name, description, adminUserIds } = data; + const { name, description, adminUserIds, sortedIndex } = data; salarytaxAgentForm.updateFields({ name: { value: name }, adminUserIds: { value: _.map(adminUserIds, it => it.id.toString()).join(","), valueSpan: _.map(adminUserIds, it => it.content).join(",") }, + sortedIndex: { value: sortedIndex }, description: { value: description } }); } @@ -128,13 +129,12 @@ class TaxAgentSlide extends Component { console.log(this.taxInfoRef); }; renderChildren = () => { - const { current } = this.state; - const { decentralization } = this.props; - const { taxAgentId } = this.state; + const { current, taxAgentId } = this.state; + const { decentralization, isChief } = this.props; let CurrentDom = null; switch (current) { case 0: - CurrentDom = ; + CurrentDom = ; break; case 1: CurrentDom = this.taxInfoRef = dom} taxAgentId={taxAgentId}/>; @@ -192,7 +192,7 @@ class TaxAgentSlide extends Component { className="slideOuterWrapper" visible={visible} top={0} - width={50} + width={65} height={100} direction="right" measure="%" @@ -228,7 +228,7 @@ class TaxAgentSlide extends Component { } } - onClose={onCancel} + onClose={() => onCancel()} /> ); } diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxAgentTable.js b/pc4mobx/hrmSalary/pages/salary/components/taxAgentTable.js index 8d9b2465..bf34dbfd 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/taxAgentTable.js +++ b/pc4mobx/hrmSalary/pages/salary/components/taxAgentTable.js @@ -70,7 +70,7 @@ class TaxAgentTable extends Component { render() { const { dataSource, columns, pageInfo, loading } = this.state; - const { onOperate } = this.props; + const { onOperate, isChief } = this.props; const pagination = { ...pageInfo, showTotal: total => `共 ${total} 条`, @@ -102,9 +102,15 @@ class TaxAgentTable extends Component { { title: "操作", key: "operation", + width: 120, render: (text, record) => } ]} diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js b/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js index f4b77ad0..a155dc49 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js +++ b/pc4mobx/hrmSalary/pages/salary/components/taxDeclarationInfo.js @@ -69,30 +69,32 @@ class TaxDeclarationInfo extends Component { render() { const { fieldItem, fieldForm } = this.state; return ( - - { - _.map(fieldItem, item => { - const { key, label, type, viewAttr, options = [] } = item; - return - { - (type === "TEXT" || type === "PASSWORD") && - this.handleChangeValue(key, v)}/> - } - { - type === "SELECT" && - + + { + _.map(fieldItem, item => { + const { key, label, type, viewAttr, options = [] } = item; + return + { + (type === "TEXT" || type === "PASSWORD") && + this.handleChangeValue(key, v)}/> - } - { - type === "RADIO" && - this.handleChangeValue(key, v)}/> - } - ; - }) - } - + } + { + type === "SELECT" && + this.handleChangeValue(key, v)}/> + } + { + type === "RADIO" && + this.handleChangeValue(key, v)}/> + } + ; + }) + } + + ); } } diff --git a/pc4mobx/hrmSalary/pages/salary/index.less b/pc4mobx/hrmSalary/pages/salary/index.less index d77e6909..671f114e 100644 --- a/pc4mobx/hrmSalary/pages/salary/index.less +++ b/pc4mobx/hrmSalary/pages/salary/index.less @@ -1,8 +1,5 @@ .salaryAgentWrapper { .comContent { - .wea-search-group { - padding: 0; - } .customTitleWrapper { width: 100%; diff --git a/pc4mobx/hrmSalary/pages/salary/taxAgent.js b/pc4mobx/hrmSalary/pages/salary/taxAgent.js index f32f2cba..07042e64 100644 --- a/pc4mobx/hrmSalary/pages/salary/taxAgent.js +++ b/pc4mobx/hrmSalary/pages/salary/taxAgent.js @@ -144,6 +144,22 @@ class TaxAgent extends Component { } }); break; + case "delete": + Modal.confirm({ + title: "信息确认", + content: `确认要删除吗?`, + onOk: () => { + API.deleteTaxAgent([itemId]).then(({ status, errormsg }) => { + if (status) { + message.success("删除成功"); + this.taxAgentTableRef.getTaxAgentList(); + } else { + message.error(errormsg || "删除失败"); + } + }); + } + }); + break; default: break; } @@ -184,7 +200,7 @@ class TaxAgent extends Component {
{ permission.isChief && - + @@ -192,13 +208,14 @@ class TaxAgent extends Component { } this.taxAgentTableRef = dom}/>
this.taxAgentTableRef.getTaxAgentList()} onCancel={(isUpdate = false) => this.handelResetSlide(isUpdate)}