diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index e5177c4d..d68e965d 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -12,6 +12,17 @@ export const getTaxAgentList = (params) => { body: JSON.stringify(params), }).then((res) => res.json()); }; +//同步人员范围 +export const taxAgentRangeSync = (params) => { + return fetch("/api/bs/hrmsalary/taxAgent/range/sync", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(params), + }).then((res) => res.json()); +}; // 系统管理员权限 export const getPermission = (params) => { diff --git a/pc4mobx/hrmSalary/pages/taxAgent/index.js b/pc4mobx/hrmSalary/pages/taxAgent/index.js index d599b779..26356da9 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/index.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/index.js @@ -1,6 +1,6 @@ import React from "react"; import { inject, observer } from "mobx-react"; -import { Col, message, Modal, Row, Switch } from "antd"; +import { Button, Col, message, Modal, Row, Switch } from "antd"; import { WeaFormItem, WeaRightMenu, WeaSearchGroup, WeaTable, WeaTop } from "ecCom"; import { renderNoright } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 import EditModal from "./editModal"; @@ -28,7 +28,8 @@ export default class TaxAgent extends React.Component { devolutionStatus: 0, conditions: editConditions, decentralizationConditions: decentralizationConditions, - permission: {} + permission: {}, + syncLoading: false }; } @@ -120,7 +121,7 @@ export default class TaxAgent extends React.Component { this.setState( { conditions: [{ defaultshow: true, items: conditionMap }], - decentralizationConditions: [{ defaultshow: true, items: conditionMap }], + decentralizationConditions: [{ defaultshow: true, items: conditionMap }] }, () => { devolutionStatus === 1 ? getCondition(this.state.conditions) : getFormDecentralizationCondition(this.state.decentralizationConditions); @@ -268,6 +269,19 @@ export default class TaxAgent extends React.Component { } }); }; + taxAgentRangeSync = () => { + const { taxAgentStore } = this.props; + const { taxAgentRangeSync, getTaxAgentList } = taxAgentStore; + this.setState({ syncLoading: true }); + taxAgentRangeSync({}).then(({ status, data }) => { + this.setState({ syncLoading: false }); + if (status) { + message.success(data || "操作成功"); + getTaxAgentList(); + } + }); + }; + render() { const { taxAgentStore } = this.props; @@ -277,7 +291,8 @@ export default class TaxAgent extends React.Component { devolutionStatus, conditions, decentralizationConditions, - permission + permission, + syncLoading } = this.state; const { loading, @@ -293,6 +308,9 @@ export default class TaxAgent extends React.Component { return renderNoright(); } + const btns = [ + + ]; const renderTipsLabel = () => { const tipList = [ "1、个税扣缴义务人与档案中的个税扣缴义务人匹配,修改个税扣缴义务人名称,薪资档案的个税扣缴义务人数据同步更新;", @@ -376,6 +394,7 @@ export default class TaxAgent extends React.Component { title="个税扣缴义务人" // 文字 icon={} // 左侧图标 iconBgcolor="#F14A2D" // 左侧图标背景色 + buttons={btns} showDropIcon={true}> (this.showSearchAd = bool); + @action("同步人员范围") + taxAgentRangeSync = params => { + return API.taxAgentRangeSync(params); + }; + // 高级搜索 - 搜索 @action doSearch = name => {