feature/2.15.1.2407.01-权限

This commit is contained in:
黎永顺 2024-09-13 11:12:53 +08:00
parent 85cdbbe8b2
commit 3f0502aabf
8 changed files with 127 additions and 89 deletions

View File

@ -4,5 +4,10 @@ export const PAGE = {
"salaryAcct": ["/hrmSalary/calculate", "/hrmSalary/calcView"], //薪资核算
"salaryBill": ["/hrmSalary/payroll", "/hrmSalary/payrollGrant", "/hrmSalary/payrollDetail"], //工资单
"taxDeclaration": ["/hrmSalary/declare", "/hrmSalary/generateDeclarationDetail"], //个税
"addUpDeduction": ["/dataAcquisition/cumDeduct"] //累计专项附加扣除
"addUpDeduction": ["/dataAcquisition/cumDeduct"], //累计专项附加扣除
"specialAddDeduction": ["/dataAcquisition/specialAddDeduction"], //专项附加扣除
"otherDeduction": ["/dataAcquisition/otherDeduct"], //其他免税扣除
"addUpSituation": ["/dataAcquisition/cumSituation"], //往期累计情况
"attendQuote": ["/dataAcquisition/attendance"], //考勤引用
"myBill": ["/hrmSalary/mySalary", "/hrmSalary/mySalaryMobile"] //薪资福利
};

View File

@ -11,7 +11,6 @@ import {
deleteAttendance,
getAttendanceFieldSettingList,
getAttendanceList,
getLedgerList,
getSalaryCycleAndAttendCycle,
importAttendQuoteData,
returnToAttendanceFieldSettingDefault,
@ -26,6 +25,7 @@ import moment from "moment";
import SelectItemsWrapper from "../../../../components/selectItemsModal/selectItemsWrapper";
import AttendanceRefrenceDataModal from "./attendanceRefrenceDataModal";
import AttendanceDataViewSlide from "./attendanceDataViewSlide";
import { postFetch } from "../../../../util/request";
const getLabel = WeaLocaleProvider.getLabel;
@ -51,7 +51,7 @@ class AttendanceDataComp extends Component {
},
fieldSetPayload: { visible: false, title: "", children: null },
attendanceReferencePayload: { visible: false, title: "" },
attendanceViewPayload: { visible: false, attendQuoteId: "", salaryYearMonth: "" }
attendanceViewPayload: { visible: false, attendQuoteId: "", salaryYearMonth: "", showOperateBtn: false }
};
}
@ -85,25 +85,26 @@ class AttendanceDataComp extends Component {
};
getLedgerList = (importData) => {
const { importFormPayload } = this.state;
getLedgerList().then(({ status, data }) => {
if (status) {
this.setState({
importFormPayload: {
...importFormPayload, salarySobId: _.head(data).id,
salarySobList: _.map(data, it => ({ key: it.id, showname: it.content }))
}
}, async () => {
const { importFormPayload } = this.state;
const { salaryYearMonth, salarySobId } = importFormPayload;
const payload = { salaryYearMonthStr: salaryYearMonth, salarySobId };
const { data } = await getSalaryCycleAndAttendCycle(payload);
postFetch("/api/bs/hrmsalary/salarysob/listAuth", { filterType: "ADMIN_DATA" })
.then(({ status, data }) => {
if (status) {
this.setState({
importData: { ...importData, params: { salaryYearMonth, salarySobId } },
importFormPayload: { ...importFormPayload, ...data }
importFormPayload: {
...importFormPayload, salarySobId: String(_.head(data).id),
salarySobList: _.map(data, it => ({ key: String(it.id), showname: it.name }))
}
}, async () => {
const { importFormPayload } = this.state;
const { salaryYearMonth, salarySobId } = importFormPayload;
const payload = { salaryYearMonthStr: salaryYearMonth, salarySobId };
const { data } = await getSalaryCycleAndAttendCycle(payload);
this.setState({
importData: { ...importData, params: { salaryYearMonth, salarySobId } },
importFormPayload: { ...importFormPayload, ...data }
});
});
});
}
});
}
});
};
handleChangeImportPayload = (key, value) => {
const { importFormPayload, importData } = this.state;
@ -149,11 +150,11 @@ class AttendanceDataComp extends Component {
}
});
};
handleViewAttendanceData = ({ id, attendCycle }) => {
handleViewAttendanceData = ({ id, attendCycle, opts = [] }) => {
const { attendanceViewPayload } = this.state;
this.setState({
attendanceViewPayload: {
...attendanceViewPayload,
...attendanceViewPayload, showOperateBtn: opts.includes("admin"),
visible: true, attendQuoteId: id,
salaryYearMonth: attendCycle
}
@ -287,7 +288,7 @@ class AttendanceDataComp extends Component {
dataSource, columns, pageInfo, loading, importData, importFormPayload, fieldSetPayload,
attendanceReferencePayload, attendanceViewPayload
} = this.state;
const { showOperateBtn, salaryYearMonth } = this.props;
const { salaryYearMonth } = this.props;
const pagination = {
...pageInfo,
showTotal: total => `${total}`,
@ -315,10 +316,11 @@ class AttendanceDataComp extends Component {
width: 120,
dataIndex: "operate",
render: (_, record) => {
const { opts = [] } = record;
return (
<div className="linkWapper">
<a href="javascript: void(0);" onClick={() => this.handleViewAttendanceData(record)}>查看</a>
{showOperateBtn &&
{opts.includes("admin") &&
<React.Fragment>
<a href="javascript: void(0);" style={{ marginRight: 10 }}
onClick={() => this.handleDeleteAttendanceData(record)}>删除</a>
@ -336,9 +338,18 @@ class AttendanceDataComp extends Component {
</React.Fragment>
}
{
!showOperateBtn &&
<a href="javascript:void(0)"
onClick={() => this.props.onFilterLog("log", record.id)}>{getLabel(545781, "操作日志")}</a>
!opts.includes("admin") &&
<Dropdown
overlay={
<Menu>
<Menu.Item>
<a href="javascript:void(0)"
onClick={() => this.props.onFilterLog("log", record.id)}>{getLabel(545781, "操作日志")}</a>
</Menu.Item>
</Menu>
}>
<a href="javascript:void(0)"><i className="icon-coms-more"/></a>
</Dropdown>
}
</div>
);
@ -361,14 +372,13 @@ class AttendanceDataComp extends Component {
{/* 考勤数据引用 */}
<AttendanceRefrenceDataModal {...attendanceReferencePayload} onCancel={this.handleCloseQuoteModal}/>
{/* 考勤数据查看 */}
<AttendanceDataViewSlide {...attendanceViewPayload} showOperateBtn={showOperateBtn}
onClose={() => this.setState({
attendanceViewPayload: {
...attendanceViewPayload,
visible: false,
attendQuoteId: ""
}
})}/>
<AttendanceDataViewSlide {...attendanceViewPayload} onClose={() => this.setState({
attendanceViewPayload: {
...attendanceViewPayload,
visible: false,
attendQuoteId: ""
}
})}/>
</React.Fragment>
);
}

View File

@ -13,7 +13,6 @@ import { getSearchs } from "../../../../util";
import {
checkOperation,
getAttendanceFieldSettingList,
getLedgerList,
returnToAttendanceFieldSettingDefault,
saveAttendanceFieldSetting,
saveAttendanceFieldSettingAsDefault,
@ -21,6 +20,7 @@ import {
} from "../../../../apis/attendance";
import SelectItemModal from "../../../../components/selectItemsModal";
import SelectItemsWrapper from "../../../../components/selectItemsModal/selectItemsWrapper";
import { postFetch } from "../../../../util/request";
import "./index.less";
@inject("attendanceStore")
@ -46,25 +46,26 @@ class AttendanceRefrenceDataModal extends Component {
getLedgerList = () => {
const { attendanceStore: { refenceform } } = this.props;
getLedgerList().then(({ status, data }) => {
if (status) {
this.setState({
condition: _.map(reFrenceConditions, (item) => {
const { items } = item;
return {
...item,
items: _.map(items, child => {
const { domkey } = child;
if (domkey[0] === "salarySobIds") {
return { ...child, options: _.map(data, it => ({ key: it.id, showname: it.content })) };
}
return { ...child };
})
};
})
}, () => refenceform.initFormFields(this.state.condition));
}
});
postFetch("/api/bs/hrmsalary/salarysob/listAuth", { filterType: "ADMIN_DATA" })
.then(({ status, data }) => {
if (status) {
this.setState({
condition: _.map(reFrenceConditions, (item) => {
const { items } = item;
return {
...item,
items: _.map(items, child => {
const { domkey } = child;
if (domkey[0] === "salarySobIds") {
return { ...child, options: _.map(data, it => ({ key: String(it.id), showname: it.name })) };
}
return { ...child };
})
};
})
}, () => refenceform.initFormFields(this.state.condition));
}
});
};
/*
* Author: 黎永顺

View File

@ -78,7 +78,8 @@ class Index extends Component {
render() {
const { selectedKey, salaryMonth, fieldName, logDialogVisible, filterConditions } = this.state;
const { taxAgentStore: { showOperateBtn } } = this.props;
const { taxAgentStore: { PageAndOptAuth } } = this.props;
const showOperateBtn = PageAndOptAuth.opts.includes("admin");
const topTab = [
{ title: "考勤数据", key: "DATA" },
{ title: "字段管理", key: "FIELD" }
@ -115,7 +116,6 @@ class Index extends Component {
selectedKey === "DATA" ?
<AttendanceDataComp
ref={dom => this.attendanceTableRef = dom}
showOperateBtn={showOperateBtn}
salaryYearMonth={salaryMonth}
onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}
/> :

View File

@ -241,7 +241,8 @@ class Index extends Component {
}
};
handleSaveData = () => {
const { cumDeductStore: { addForm } } = this.props, { taxAgentOption } = this.state;
const { cumDeductStore: { addForm } } = this.props, { slidePayload } = this.state;
const taxAgentOption = slidePayload.children.props.taxAgentOption;
addForm.validateForm().then(f => {
if (f.isValid) {
const payload = {

View File

@ -27,6 +27,7 @@ import { dataCollectCondition, taxOptions } from "./columns";
import AddItems from "../addItems";
import TableRecord from "../components/tableRecord";
import { convertToUrlString } from "../../../util/url";
import { postFetch } from "../../../util/request";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@ -62,7 +63,8 @@ class Index extends Component {
exportPayloadUrl: "",
exportPayloadType: false,
advanceCondition: null,
targetid: ""
targetid: "",
taxAgentOption: []
};
this.tableRef = null;
this.addItemRef = null;
@ -79,11 +81,15 @@ class Index extends Component {
* Params:
* Date: 2023/2/20
*/
getAdvanceCondition = () => {
getAdvanceCondition = async () => {
const { data: authTaxAgent } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" });
const { cumSituationStore: { form } } = this.props;
getCumSituationSaCondition().then(({ status, data }) => {
if (status) {
this.setState({ advanceCondition: removePropertyCondition(data.condition) });
this.setState({
advanceCondition: removePropertyCondition(data.condition),
taxAgentOption: _.map(authTaxAgent, g => ({ key: String(g.id), showname: g.name }))
});
form.initFormFields(removePropertyCondition(data.condition));
}
});
@ -141,10 +147,11 @@ class Index extends Component {
* Params: screenParams规则日期必须放在数组最后一位人员信息必须第一位
* Date: 2023/2/20
*/
handleAddData = (title = "新建", editId = {}) => {
const { taxAgentStore, cumSituationStore: { addForm } } = this.props;
handleAddData = async (title = "新建", editId = {}) => {
const { data } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" });
const taxAgentOption = _.map(data, o => ({ key: String(o.id), showname: o.name }));
const { cumSituationStore: { addForm } } = this.props;
const { slidePayload } = this.state;
const { taxAgentOption } = taxAgentStore;
const conditions = _.map(dataCollectCondition, (it, idx) => {
if (idx === 0) {
return {
@ -323,8 +330,7 @@ class Index extends Component {
* Date: 2023/2/17
*/
getScreen = () => {
const { taxAgentStore: { taxAgentOption } } = this.props;
const { declareMonth, year, taxAgentId, innerWidth } = this.state;
const { declareMonth, year, taxAgentId, innerWidth, taxAgentOption } = this.state;
const items = [
{
com: DataCollectionDatePicker({
@ -388,7 +394,8 @@ class Index extends Component {
this.props.cumSituationStore.initAddForm();
};
handleSaveData = () => {
const { cumSituationStore: { addForm }, taxAgentStore: { taxAgentOption } } = this.props;
const { cumSituationStore: { addForm } } = this.props, { slidePayload } = this.state;
const taxAgentOption = slidePayload.children.props.taxAgentOption;
addForm.validateForm().then(f => {
if (f.isValid) {
const payload = {

View File

@ -29,6 +29,7 @@ import { dataCollectCondition } from "./columns";
import AddItems from "../addItems";
import TableRecord from "../components/tableRecord";
import { convertToUrlString } from "../../../util/url";
import { postFetch } from "../../../util/request";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@ -63,7 +64,8 @@ class Index extends Component {
exportPayloadUrl: "",
exportPayloadType: false,
advanceCondition: null,
targetid: ""
targetid: "",
taxAgentOption: []
};
this.tableRef = null;
this.addItemRef = null;
@ -80,11 +82,15 @@ class Index extends Component {
* Params:
* Date: 2023/2/20
*/
getAdvanceCondition = () => {
getAdvanceCondition = async () => {
const { data: authTaxAgent } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" });
const { otherDeductStore: { form } } = this.props;
getOtherDeductSaCondition().then(({ status, data }) => {
if (status) {
this.setState({ advanceCondition: removePropertyCondition(data.condition) });
this.setState({
advanceCondition: removePropertyCondition(data.condition),
taxAgentOption: _.map(authTaxAgent, g => ({ key: String(g.id), showname: g.name }))
});
form.initFormFields(removePropertyCondition(data.condition));
}
});
@ -269,10 +275,11 @@ class Index extends Component {
* Params: screenParams规则日期必须放在数组最后一位人员信息必须第一位
* Date: 2023/2/20
*/
handleAddData = (title = "新建", editId = {}) => {
const { taxAgentStore, otherDeductStore: { addForm } } = this.props;
handleAddData = async (title = "新建", editId = {}) => {
const { data } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" });
const taxAgentOption = _.map(data, o => ({ key: String(o.id), showname: o.name }));
const { otherDeductStore: { addForm } } = this.props;
const { slidePayload } = this.state;
const { taxAgentOption } = taxAgentStore;
const conditions = _.map(dataCollectCondition, (it, idx) => {
if (idx === 0) {
return {
@ -358,8 +365,7 @@ class Index extends Component {
* Date: 2023/2/17
*/
getScreen = () => {
const { taxAgentStore: { taxAgentOption } } = this.props;
const { declareMonth, taxAgentId, innerWidth } = this.state;
const { declareMonth, taxAgentId, innerWidth, taxAgentOption } = this.state;
const items = [
{
com: DataCollectionDatePicker({
@ -403,7 +409,8 @@ class Index extends Component {
this.props.otherDeductStore.initAddForm();
};
handleSaveData = () => {
const { otherDeductStore: { addForm }, taxAgentStore: { taxAgentOption } } = this.props;
const { otherDeductStore: { addForm } } = this.props, { slidePayload } = this.state;
const taxAgentOption = slidePayload.children.props.taxAgentOption;
addForm.validateForm().then(f => {
if (f.isValid) {
const payload = {

View File

@ -20,6 +20,7 @@ import { condition } from "./components/condition";
import AddItems from "../addItems";
import TableRecord from "../components/tableRecord";
import { convertToUrlString } from "../../../util/url";
import { postFetch } from "../../../util/request";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@ -52,7 +53,8 @@ class Index extends Component {
exportPayloadUrl: "",
exportPayloadType: false,
advanceCondition: null,
targetid: ""
targetid: "",
taxAgentOption: []
};
this.tableRef = null;
this.addItemRef = null;
@ -104,11 +106,15 @@ class Index extends Component {
* Params:
* Date: 2023/2/20
*/
getAdvanceCondition = () => {
getAdvanceCondition = async () => {
const { data: authTaxAgent } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" });
const { specialAddStore: { advanceForm } } = this.props;
getSearchCondition().then(({ status, data }) => {
if (status) {
this.setState({ advanceCondition: removePropertyCondition(data.condition) });
this.setState({
advanceCondition: removePropertyCondition(data.condition),
taxAgentOption: _.map(authTaxAgent, g => ({ key: String(g.id), showname: g.name }))
});
advanceForm.initFormFields(removePropertyCondition(data.condition));
}
});
@ -207,8 +213,7 @@ class Index extends Component {
* Date: 2023/2/17
*/
getScreen = () => {
const { taxAgentStore: { taxAgentOption } } = this.props;
const { taxAgentId } = this.state;
const { taxAgentId, taxAgentOption } = this.state;
const items = [
{
com: DataCollectionSelect({
@ -257,10 +262,11 @@ class Index extends Component {
* Params: screenParams规则日期必须放在数组最后一位人员信息必须第一位
* Date: 2023/2/20
*/
handleAddData = (title = "新建", editId = {}) => {
const { taxAgentStore, specialAddStore: { addForm } } = this.props;
handleAddData = async (title = "新建", editId = {}) => {
const { data } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" });
const taxAgentOption = _.map(data, o => ({ key: String(o.id), showname: o.name }));
const { specialAddStore: { addForm } } = this.props;
const { slidePayload } = this.state;
const { taxAgentOption } = taxAgentStore;
const conditions = _.map(condition, (it, idx) => {
if (idx === 0) {
return {
@ -341,7 +347,8 @@ class Index extends Component {
this.props.specialAddStore.initAddForm();
};
handleSaveData = () => {
const { specialAddStore: { addForm }, taxAgentStore: { taxAgentOption } } = this.props;
const { specialAddStore: { addForm } } = this.props, { slidePayload } = this.state;
const taxAgentOption = slidePayload.children.props.taxAgentOption;
addForm.validateForm().then(f => {
if (f.isValid) {
const payload = {
@ -369,10 +376,11 @@ class Index extends Component {
* Params:
* Date: 2023/2/20
*/
handleOpenImport = () => {
handleOpenImport = async () => {
const { data } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" });
const taxAgentOption = _.map(data, o => ({ key: String(o.id), showname: o.name }));
const { importPayload } = this.state;
const { importOpts } = importPayload;
const { taxAgentStore: { taxAgentOption } } = this.props;
this.setState({
importPayload: {
...importPayload,
@ -403,7 +411,7 @@ class Index extends Component {
};
render() {
const { taxAgentStore: { showOperateBtn }, specialAddStore: { advanceForm } } = this.props;
const { specialAddStore: { advanceForm } } = this.props;
const {
taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition, importPayload,
exportPayloadType, targetid
@ -425,7 +433,6 @@ class Index extends Component {
url="/api/bs/hrmsalary/specialAddDeduction/list"
payload={tablePayload}
isSpecial
showOperateBtn={showOperateBtn}
onTableOperate={this.handleTableOperate}
onViewDetails={(record) => this.handleAddData("专项附加扣除记录", record)}
form={advanceForm}