custom/钱智

This commit is contained in:
lys 2025-12-29 16:09:22 +08:00
parent c53a7d5451
commit 9f2d341a76
5 changed files with 47 additions and 17 deletions

View File

@ -5,6 +5,10 @@ import { postFetch } from "../util/request";
export const getTaxAgentList = (params) => {
return postFetch("/api/bs/hrmsalary/taxAgent/list", params);
};
//钱智-同步管理员角色
export const syncAdminRoles = (params) => {
return postFetch("/api/bs/hrmsalary/taxAgent/syncAdminRoles", params);
};
//同步人员范围
export const taxAgentRangeSync = (params) => {
return postFetch("/api/bs/hrmsalary/taxAgent/range/sync", params);

View File

@ -57,12 +57,12 @@ class TaxAgentSlide extends Component {
const { taxAgentStore: { salarytaxAgentForm } } = this.props;
API.getTaxAgentForm({ id: taxAgentId }).then(({ status, data }) => {
if (status) {
const { name, description, adminUserIds, sortedIndex } = data;
const { name, description, roleId, sortedIndex } = data;
salarytaxAgentForm.updateFields({
name: { value: name },
adminUserIds: {
value: _.map(adminUserIds, it => it.id.toString()).join(","),
valueSpan: _.map(adminUserIds, it => it.content).join(",")
roleId: {
value: _.map(roleId, it => it.id.toString()).join(","),
valueSpan: _.map(roleId, it => it.content).join(",")
},
sortedIndex: { value: sortedIndex },
description: { value: description }
@ -121,7 +121,7 @@ class TaxAgentSlide extends Component {
const formData = salarytaxAgentForm.getFormParams();
const payload = {
...formData,
adminUserIds: formData.adminUserIds ? formData.adminUserIds.split(",") : []
// adminUserIds: formData.adminUserIds ? formData.adminUserIds.split(",") : []
};
taxAgentId ? this.updateTaxAgent({ ...payload, id: taxAgentId }) : this.saveTaxAgent(payload);
} else {

View File

@ -18,6 +18,7 @@ class TaxAgent extends Component {
constructor(props) {
super(props);
this.state = {
roleLoading: false, //钱智同步管理员角色loading
syncLoading: false, //同步人员范围loading
searchValue: "",
decentralization: "0", //启用分权
@ -94,6 +95,25 @@ class TaxAgent extends Component {
}
});
};
/*
* Author: 黎永顺
* Description:钱智同步管理员角色
* Params:
* Date: 2025/12/25
*/
syncAdminRoles = () => {
const { taxAgentStore } = this.props, { syncAdminRoles } = taxAgentStore;
this.setState({ roleLoading: true });
syncAdminRoles({}).then(({ status, data, errormsg }) => {
this.setState({ roleLoading: false });
if (status) {
message.success(data || getLabel(30700, "操作成功"));
this.taxAgentTableRef.getTaxAgentList();
} else {
message.error(data || errormsg || getLabel(30651, "操作失败"));
}
})
};
/*
* Author: 黎永顺
* Description:启用分权
@ -172,9 +192,11 @@ class TaxAgent extends Component {
render() {
const { taxAgentStore: { PageAndOptAuth: permission } } = this.props;
const {
searchValue, decentralization, taxAgentSlideProps, syncLoading, logDialogVisible, filterConditions
searchValue, decentralization, taxAgentSlideProps, syncLoading, logDialogVisible, filterConditions, roleLoading
} = this.state;
const btns = [
<Button type="primary" onClick={this.syncAdminRoles}
loading={roleLoading}>{getLabel(111, "同步管理员角色")}</Button>,
<Button type="primary" onClick={this.taxAgentRangeSync}
loading={syncLoading}>{getLabel(543633, "同步人员范围")}</Button>,
<WeaInputSearch
@ -201,7 +223,7 @@ class TaxAgent extends Component {
title={getLabel(537996, "个税扣缴义务人")}
icon={<i className="icon-coms-fa"/>}
iconBgcolor="#F14A2D"
buttons={showOperateBtn ? btns : btns.slice(1)}
buttons={showOperateBtn ? btns : btns.slice(2)}
showDropIcon onDropMenuClick={key => this.handleOperate(key)}
dropMenuDatas={[
{

View File

@ -31,21 +31,21 @@ export const editConditions = [
isDetail: 0,
isMultCheckbox: false,
isSingle: false,
linkUrl: "/hrm/resource/HrmResource.jsp?id=",
linkUrl: "/spa/hrm/engine.html#/hrmengine/roleInfo/info?id=",
pageSize: 10,
quickSearchName: "",
replaceDatas: [],
title: "人力资源",
type: "1",
title: "角色",
type: "65",
viewAttr: 3,
rules: "required",
},
colSpan: 1,
conditionType: "BROWSER",
rules: "required|string",
domkey: ["adminUserIds"],
domkey: ["roleId"],
fieldcol: 14,
label: "管理员",
label: "角色",
labelcol: 6,
viewAttr: 3,
},

View File

@ -105,6 +105,10 @@ export class TaxAgentStore {
@action setShowSearchAd = bool => (this.showSearchAd = bool);
@action("钱智-同步管理员角色")
syncAdminRoles = params => {
return API.syncAdminRoles(params);
};
@action("同步人员范围")
taxAgentRangeSync = params => {
return API.taxAgentRangeSync(params);