Merge branch 'master' into custom-昂立/薪资账套配置流程审批地址

# Conflicts:
#	pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js
#	pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js
#	pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js
#	pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js
This commit is contained in:
黎永顺 2023-11-13 14:23:20 +08:00
commit 9854e56324
46 changed files with 1979 additions and 545 deletions

View File

@ -1,4 +1,5 @@
import { WeaTools } from 'ecCom';
import { WeaTools } from "ecCom";
import { postFetch } from "../util/request";
/**
* 薪资档案api
@ -7,120 +8,120 @@ import { WeaTools } from 'ecCom';
//薪资档案-薪资档案列表
export const getArchiveList = params => {
return fetch('/api/bs/hrmsalary/salaryArchive/list', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryArchive/list", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
//薪资档案的高级搜索
export const getSaCondition = params => {
return WeaTools.callApi('/api/bs/hrmsalary/archives/getSearchCondition', 'get', params);
}
return WeaTools.callApi("/api/bs/hrmsalary/archives/getSearchCondition", "get", params);
};
//薪资档案-导出薪资档案
export const exportArchiveList = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/exportList', 'POST', params);
}
return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/exportList", "POST", params);
};
//薪资档案-获取导入参数
export const getImportArchiveParam = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getImportParams', 'get', params);
}
return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getImportParams", "get", params);
};
//薪资档案-获取薪资档案详情表单
export const getArchiveForm = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getForm', 'get', params);
}
return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getForm", "get", params);
};
//薪资档案-获取薪资项目调整表单
export const getSalaryItemForm = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getSalaryItemForm', 'GET', params);
}
return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getSalaryItemForm", "GET", params);
};
//薪资档案-保存薪资项目调整
export const saveSalaryItem = params => {
return fetch('/api/bs/hrmsalary/salaryArchive/saveSalaryItem', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryArchive/saveSalaryItem", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
//薪资档案-获取个税扣缴义务人调整表单
export const getTaxAgentForm = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getTaxAgentForm', 'GET', params);
}
return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getTaxAgentForm", "GET", params);
};
//薪资档案-保存个税扣缴义务人调整
export const saveTaxAgent = params => {
return fetch('/api/bs/hrmsalary/salaryArchive/saveTaxAgent', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryArchive/saveTaxAgent", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
//薪资档案-删除个税扣缴义务人调整
export const deleteTaxAgent = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/deleteTaxAgent', 'GET', params);
}
return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/deleteTaxAgent", "GET", params);
};
//薪资档案操作记录-薪资项目操作记录列表
export const getItemAdjustList = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchiveOperateLog/salaryItemList', 'POST', params);
}
return WeaTools.callApi("/api/bs/hrmsalary/salaryArchiveOperateLog/salaryItemList", "POST", params);
};
//薪资档案操作记录-薪资项目操作记录列表的高级搜索
export const getItemAdjustSaCondition = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchiveOperateLog/getSalaryItemSearchCondition', 'GET', params);
}
return WeaTools.callApi("/api/bs/hrmsalary/salaryArchiveOperateLog/getSalaryItemSearchCondition", "GET", params);
};
//薪资档案操作记录-导出-薪资项目操作记录列表
export const exportItemAdjust = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchiveOperateLog/exportSalaryItemList', 'POST', params);
}
return WeaTools.callApi("/api/bs/hrmsalary/salaryArchiveOperateLog/exportSalaryItemList", "POST", params);
};
//薪资档案操作记录-个税扣缴义务人操作记录列表
export const getPersonAdjustList = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchiveOperateLog/salaryItemList', 'POST', params);
}
return WeaTools.callApi("/api/bs/hrmsalary/salaryArchiveOperateLog/salaryItemList", "POST", params);
};
//薪资档案操作记录-个税扣缴义务人操作记录列表的高级搜索
export const getPersonAdjustSaCondition = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchiveOperateLog/getTaxAgentSearchCondition', 'GET', params);
}
return WeaTools.callApi("/api/bs/hrmsalary/salaryArchiveOperateLog/getTaxAgentSearchCondition", "GET", params);
};
//薪资档案操作记录-导出-个税扣缴义务人操作记录列表
export const exportPersonAdjust = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchiveOperateLog/exportTaxAgentList', 'POST', params);
}
return WeaTools.callApi("/api/bs/hrmsalary/salaryArchiveOperateLog/exportTaxAgentList", "POST", params);
};
//薪资档案-获取设置表单
export const getSettingForm = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getDimissionSetForm', 'GET', params);
}
return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getDimissionSetForm", "GET", params);
};
//薪资档案-保存离职时段设置
export const saveSetting = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/saveDimissionSet', 'POST', params);
}
return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/saveDimissionSet", "POST", params);
};
//薪资档案-模版下载链接(无数据)
@ -128,166 +129,170 @@ export const downloadSalaryArchiveTemplateurl = `/api/bs/hrmsalary/salaryArchive
// 薪资档案- 模版下载 (有之前数据)
export const downloadsalaryArchiveDetail = params => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/exportList', 'POST', params);
}
return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/exportList", "POST", params);
};
// 获取导入类型
export const getImportTypes = () => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getImportTypes', 'GET', {});
}
return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getImportTypes", "GET", {});
};
// 获取档案和人员状态类型
export const commonEnumList = (params) => {
return WeaTools.callApi('/api/bs/hrmsalary/common/enum/list', 'GET', params);
}
return WeaTools.callApi("/api/bs/hrmsalary/common/enum/list", "GET", params);
};
// 发起调薪地址
export const salaryAdjustmentInfo = (params) => {
return WeaTools.callApi('/api/bs/hrmsalary/process/salaryAdjustmentInfo', 'GET', params);
}
return WeaTools.callApi("/api/bs/hrmsalary/process/salaryAdjustmentInfo", "GET", params);
};
// 导入预览
export const importPreview = (params) => {
return fetch('/api/bs/hrmsalary/salaryArchive/preview', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryArchive/preview", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
// 导入档案
export const importSalaryArchive = (params) => {
return fetch('/api/bs/hrmsalary/salaryArchive/importSalaryArchive', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryArchive/importSalaryArchive", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
// 导出档案
export const exportSalaryArchive = (ids = "") => {
fetch('/api/bs/hrmsalary/salaryArchive/exportList?ids=' + ids).then(res => res.blob().then(blob => {
var filename=`薪资档案.xlsx`
var a = document.createElement('a');
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
}))
}
fetch("/api/bs/hrmsalary/salaryArchive/exportList?ids=" + ids).then(res => res.blob().then(blob => {
var filename = `薪资档案.xlsx`;
var a = document.createElement("a");
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
}));
};
// 调整记录-个税扣缴义务人列表
export const adjustRecordTaxAgentList = (params) => {
return fetch('/api/bs/hrmsalary/salaryArchive/adjustRecord/taxAgentList', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/taxAgentList", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
// 调整记录-薪资项目-列表
export const adjustRecordSalaryItemList = (params) => {
return fetch('/api/bs/hrmsalary/salaryArchive/adjustRecord/salaryItemList', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/salaryItemList", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
// 调整记录-薪资项目-单个
export const singleSalaryItemList = (params) => {
return fetch('/api/bs/hrmsalary/salaryArchive/adjustRecord/singleSalaryItemList', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/singleSalaryItemList", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
// 调整记录-个税扣缴义务人-单个
export const singleTaxAgentList = (params) => {
return fetch('/api/bs/hrmsalary/salaryArchive/adjustRecord/singleTaxAgentList', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/singleTaxAgentList", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
// 调整-义务扣缴人-通过薪资档案的个税扣缴义务人id获取个税扣缴义务人调整表单
export const getTaxAgentFormBySalaryArchiveTaxAgentId = (params) => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getTaxAgentFormBySalaryArchiveTaxAgentId', 'GET', params);
}
return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getTaxAgentFormBySalaryArchiveTaxAgentId", "GET", params);
};
// 调整-薪资项目-获取调整前的值
export const getSalaryItemAdjustBeforeValue = (params) => {
return fetch('/api/bs/hrmsalary/salaryArchive/getSalaryItemAdjustBeforeValue', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryArchive/getSalaryItemAdjustBeforeValue", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
// 停薪
export const stopSalary = (params) => {
return fetch('/api/bs/hrmsalary/salaryArchive/stopSalary', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryArchive/stopSalary", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
// 调整-薪资项目-通过薪资档案的薪资项目id获取薪资项目调整表单
export const getSalaryItemFormByItemId = (params) => {
return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getSalaryItemFormBySalaryArchiveItemId', 'GET', params);
}
return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getSalaryItemFormBySalaryArchiveItemId", "GET", params);
};
// 删除薪资项目调薪
export const deleteSalaryItem = (params) => {
return fetch(`/api/bs/hrmsalary/salaryArchive/deleteSalaryItem?salaryArchiveItemId=${params.salaryArchiveItemId}`, {
method: 'GET',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
}).then(res => res.json())
}
return fetch(`/api/bs/hrmsalary/salaryArchive/deleteSalaryItem?salaryArchiveItemId=${params.salaryArchiveItemId}`, {
method: "GET",
mode: "cors",
headers: {
"Content-Type": "application/json"
}
}).then(res => res.json());
};
export const getSingleSalaryItemInfo = (params) => {
return fetch('/api/bs/hrmsalary/salaryArchive/adjustRecord/getSingleSalaryItemInfo', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/getSingleSalaryItemInfo", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
export const editSingleSalaryItem = (params) => {
return fetch('/api/bs/hrmsalary/salaryArchive/adjustRecord/editSingleSalaryItem', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
return fetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/editSingleSalaryItem", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(params)
}).then(res => res.json());
};
// 基数调整记录列表
export const getAdjustHistoryList = (params) => {
return postFetch("/api/bs/hrmsalary/archives/getAdjustHistoryList", params);
};

View File

@ -106,3 +106,19 @@ export const salaryStatisticsPushGetDetail = (params) => {
export const salaryStatisticsPushAddSharedSendMsg = (params) => {
return postFetch("/api/bs/salaryreport/salary/statistics/push/addSharedSendMsg", params);
};
//薪酬统计维度-切换薪资项目
export const statisticsItemChangetab = (params) => {
return WeaTools.callApi("/api/bs/hrmsalary/report/statistics/item/changeTab", "GET", params);
};
//报表记录-扩展人员维度显示值
export const saveExpandFieldSettings = (params) => {
return postFetch("/api/bs/hrmsalary/report/statistics/dimension/saveExpandFieldSettings", params);
};
//报表记录-查询薪酬统计维度扩展字段设置
export const getExpandFieldSettings = (params) => {
return WeaTools.callApi("/api/bs/hrmsalary/report/statistics/dimension/getExpandFieldSettings", "GET", params);
};
//报表记录-复制薪酬统计报表
export const statisticsReportDuplicate = (params) => {
return WeaTools.callApi("/api/bs/hrmsalary/report/statistics/report/duplicate", "GET", params);
};

View File

@ -155,6 +155,7 @@
.ant-tree-title {
display: inline-block;
width: 100%;
max-width: 208px;
.funcListTitle {
width: 100%;
@ -216,9 +217,9 @@
}
.danger {
color: rgb(255, 102, 106)!important;
border: 1px solid rgb(255, 193, 195)!important;
background-color: rgb(255, 223, 224)!important;
color: rgb(255, 102, 106) !important;
border: 1px solid rgb(255, 193, 195) !important;
background-color: rgb(255, 223, 224) !important;
}
.weapp-excel-code-action-list-variable-tip {

View File

@ -49,7 +49,7 @@ export const condition = [
labelcol: 6,
options: [],
viewAttr: 2,
helpfulTip: "",
helpfulTip: ""
},
{
colSpan: 1,
@ -90,10 +90,41 @@ export const reportCondition = [
options: [],
rules: "required|string",
viewAttr: 3,
helpfulTip: "",
helpfulTip: ""
}
],
title: "",
defaultshow: true
}
];
export const extensionCondition = [
{
items: [
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["pk"],
fieldcol: 14,
label: "主键",
lanId: 111,
labelcol: 6,
value: "",
rules: "required|string",
viewAttr: 3
},
{
colSpan: 1,
conditionType: "TEXTAREA",
domkey: ["expandSql"],
fieldcol: 14,
label: "sql",
lanId: 111,
labelcol: 6,
value: "",
rules: "required|string",
viewAttr: 3
}
],
defaultshow: true
}
];

View File

@ -0,0 +1,142 @@
/*
* Author: 黎永顺
* name: 统计维度-新增扩展属性
* Description:
* Date: 2023/11/7
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaDialog, WeaLocaleProvider, WeaTableEdit } from "ecCom";
import { Button, message } from "antd";
import { getExpandFieldSettings, saveExpandFieldSettings } from "../../../apis/statistics";
import { extensionCondition } from "./conditions";
import { getConditionDomkeys, getSearchs } from "../../../util";
const getLabel = WeaLocaleProvider.getLabel;
@inject("attendanceStore")
@observer
class DimensionExtensionAttrsDialog extends Component {
constructor(props) {
super(props);
this.state = {
conditions: [], loading: false, datas: [], extensionId: ""
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) this.getExpandFieldSettings(nextProps);
if (nextProps.visible !== this.props.visible && !nextProps.visible) {
this.setState({ extensionId: "", datas: [] });
nextProps.attendanceStore.initExtensionForm();
}
}
getExpandFieldSettings = (props) => {
getExpandFieldSettings({ module: "dim_employee" }).then(({ status, data }) => {
if (status) {
const { id: extensionId = "", fieldSettings: datas = [] } = data || {};
this.setState({
extensionId, datas,
conditions: _.map(extensionCondition, o => {
return {
...o,
items: _.map(o.items, g => {
return { ...g, label: getLabel(g.lanId, g.label) };
})
};
})
}, () => {
const { attendanceStore: { extensionForm } } = props;
extensionForm.initFormFields(this.state.conditions);
if (!_.isNil(data))
_.map(getConditionDomkeys(this.state.conditions), o => {
extensionForm.updateFields({ [o]: data[o] || "" });
});
});
}
});
};
save = () => {
const { attendanceStore: { extensionForm } } = this.props;
const { datas, extensionId: id } = this.state;
const { pass } = this.tableEdit.refs.edit.doRequiredCheck();
extensionForm.validateForm().then(f => {
if (f.isValid && pass) {
const paylaod = {
fieldSettings: _.map(datas, (o, i) => ({ ...o, index: i + 1 })),
module: "dim_employee", moduleInfo: "", id,
...extensionForm.getFormParams()
};
this.setState({ loading: true });
saveExpandFieldSettings(paylaod).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(30700, "操作成功!"));
this.props.onCancel();
} else {
message.error(errormsg);
}
}).catch(() => this.setState({ loading: false }));
} else {
f.showErrors();
}
});
};
render() {
const { attendanceStore: { extensionForm } } = this.props;
const { conditions, loading, datas } = this.state;
const columns = [
{
title: getLabel(33439, "名称"),
dataIndex: "name",
key: "name",
com: [
{ label: "", type: "INPUT", viewAttr: 3, key: "name" }
],
colSpan: 1,
width: "50%"
},
{
title: getLabel(111, "字段"),
dataIndex: "field",
key: "field",
com: [
{ label: "", type: "INPUT", viewAttr: 3, key: "field" }
],
colSpan: 1,
width: "50%"
}
];
return (
<WeaDialog
{...this.props} title={getLabel(111, "属性扩展")} hasScroll
className="extensionAttrsDialog" initLoadCss
buttons={[
<Button type="primary" loading={loading} onClick={this.save}>{getLabel(537558, "保存")}</Button>
]}
style={{
width: 850,
height: 606.6,
minHeight: 200,
minWidth: 380,
maxHeight: "90%",
maxWidth: "90%",
overflow: "hidden",
transform: "translate(0px, 0px)"
}}
>
<div className="extensionAttrsDialogContent">
{getSearchs(extensionForm, conditions, 1, false)}
<WeaTableEdit
ref={el => this.tableEdit = el} showCopy={false} draggable deleteConfirm
columns={columns} datas={datas} onChange={datas => this.setState({ datas })}
/>
</div>
</WeaDialog>
);
}
}
export default DimensionExtensionAttrsDialog;

View File

@ -8,6 +8,7 @@ import React, { Component } from "react";
import { WeaLocaleProvider, WeaTable } from "ecCom";
import { message, Modal } from "antd";
import { dimensionDelete, dimensionList } from "../../../apis/statistics";
import DimensionExtensionAttrsDialog from "./dimensionExtensionAttrsDialog";
import "../index.less";
const { getLabel } = WeaLocaleProvider;
@ -16,8 +17,7 @@ class DimensionTable extends Component {
constructor(props) {
super(props);
this.state = {
loading: false,
dataSource: [],
loading: false, dataSource: [], visible: false,
pageInfo: {
current: 1, pageSize: 10, total: 0
}
@ -63,7 +63,7 @@ class DimensionTable extends Component {
};
render() {
const { dataSource, loading, pageInfo } = this.state;
const { dataSource, loading, pageInfo, visible } = this.state;
const { onEdit } = this.props;
const pagination = {
...pageInfo,
@ -100,20 +100,28 @@ class DimensionTable extends Component {
<a href="javascript: void(0);"
onClick={() => this.dimensionDelete([record.id])}>{getLabel(535052, "删除")}</a>
}
{
record.dimName === getLabel(30042, "人员") && record.dimType === getLabel(111, "定性") &&
<a href="javascript: void(0);"
onClick={() => this.setState({ visible: true })}>{getLabel(111, "扩展属性")}</a>
}
</span>
);
}
}
];
return (
<WeaTable
rowKey="id"
className="dimensionTableWrapper"
dataSource={dataSource}
pagination={pagination}
loading={loading}
columns={columns}
/>
<React.Fragment>
<WeaTable
rowKey="id"
className="dimensionTableWrapper"
dataSource={dataSource}
pagination={pagination}
loading={loading}
columns={columns}
/>
<DimensionExtensionAttrsDialog visible={visible} onCancel={() => this.setState({ visible: false })}/>
</React.Fragment>
);
}
}

View File

@ -7,7 +7,11 @@
import React, { Component } from "react";
import { WeaLocaleProvider } from "ecCom";
import { Button, Col, Dropdown, Menu, message, Modal, Row } from "antd";
import { reportStatisticsReportDelete, reportStatisticsReportList } from "../../../apis/statistics";
import {
reportStatisticsReportDelete,
reportStatisticsReportList,
statisticsReportDuplicate
} from "../../../apis/statistics";
import "../index.less";
const SubMenu = Menu.SubMenu;
@ -26,10 +30,20 @@ class ReportList extends Component {
}
handleOptsClick = ({ key }, id, dimensionId) => {
const { reportName = "" } = this.props;
if (key === "delete") {
this.reportStatisticsReportDelete(id.split(","));
} else if (key === "edit") {
this.props.onEdit("addReport", id);
} else if (key === "copy") {
statisticsReportDuplicate({ id }).then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(30700, "操作成功!"));
this.reportStatisticsReportList({ reportName });
} else {
message.error(errormsg);
}
});
}
};
reportStatisticsReportDelete = (payload) => {
@ -90,6 +104,7 @@ class ReportList extends Component {
<Dropdown overlay={
<Menu onClick={e => this.handleOptsClick(e, id, dimensionId)}>
<Menu.Item key="edit">{getLabel(501169, "编辑")}</Menu.Item>
<Menu.Item key="copy">{getLabel(77, "复制")}</Menu.Item>
<Menu.Item key="delete">{getLabel(535052, "删除")}</Menu.Item>
</Menu>
}>

View File

@ -6,7 +6,7 @@
*/
import React, { Component } from "react";
import { Button, message, Modal } from "antd";
import { WeaDialog, WeaLocaleProvider } from "ecCom";
import { WeaDialog, WeaLocaleProvider, WeaSlideModal } from "ecCom";
import { reportStatisticsReportSave } from "../../../apis/ruleconfig";
import "../index.less";
@ -45,6 +45,17 @@ class StatisticsModal extends Component {
}
});
};
renderTitle = () => {
return <div className="titleDialog">
<div className="titleCol titleLeftBox">
<div className="titleIcon"><i className="icon-coms-fa"/></div>
<div className="title">{getLabel(543313, "统计维度管理")}</div>
</div>
<div className="titleCol titleRightBox">
<Button type="primary" onClick={() => this.props.onAddDimension()}>{getLabel(543314, "新建统计维度")}</Button>
</div>
</div>;
};
render() {
const { loading } = this.state;
@ -53,16 +64,25 @@ class StatisticsModal extends Component {
<Button type="primary" onClick={this.handleSaveReportList} loading={loading}>{getLabel(111, "保存")}</Button>
] : [];
return (
<WeaDialog
{...this.props} hasScroll
style={typeKey === "addReport" ? { width: 600 } : { width: 640, height: 540 }}
buttons={buttons}
onCancel={onCancel}
initLoadCss
className="dimensionModalWrapper"
>
{this.props.children}
</WeaDialog>
<React.Fragment>
{
typeKey === "addReport" ? <WeaDialog
{...this.props} hasScroll
style={typeKey === "addReport" ? { width: 600 } : { width: 640, height: 540 }}
buttons={buttons}
onCancel={onCancel}
initLoadCss
className="dimensionModalWrapper"
>
{this.props.children}
</WeaDialog> :
<WeaSlideModal
className="dimensionModalWrapper" {...this.props}
top={0} width={760} height={100} measureT={"%"} measureY={"%"} measureX={"px"}
direction={"right"} content={this.props.children} title={this.renderTitle()}
/>
}
</React.Fragment>
);
}
}

View File

@ -287,7 +287,9 @@ class Index extends Component {
keyword={keyword} year={year}
/>
}
<StatisticsModal {...modalReq} onCancel={this.handleCancel} form={reportForm}>
<StatisticsModal {...modalReq} onCancel={this.handleCancel} form={reportForm} onClose={this.handleCancel}
onAddDimension={this.handleAddDimension}
>
{
modalReq.typeKey === "dimension" &&
<DimensionTable ref={dom => this.dimensionTableRef = dom}

View File

@ -1,4 +1,8 @@
.xc_tj_fx_wrapper {
.wea-new-top-req {
z-index: 0 !important;
}
.search {
top: -3px;
margin-right: 10px;
@ -180,6 +184,45 @@
}
}
.titleDialog {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 46px 0 16px;
.titleCol {
flex: 1;
display: flex;
align-items: center;
}
.titleLeftBox {
.titleIcon {
color: #fff;
margin: 0;
width: 40px;
height: 40px;
line-height: 40px;
font-size: 22px;
display: flex;
align-items: center;
justify-content: center;
background: #F14A2D;
border-radius: 50%;
}
.title {
font-size: 14px;
color: #333;
padding-left: 6px;
}
}
.titleRightBox {
justify-content: flex-end;
}
}
}
.dimensionSlideWrapper, .dimensionModalWrapper {
@ -217,3 +260,32 @@
}
}
}
//重构-社保福利档案
.extensionAttrsDialog {
.extensionAttrsDialogContent {
background: #F6F6F6;
padding: 16px;
width: 100%;
height: 100%;
.wea-table-edit {
background: #FFF;
}
.wea-search-group {
padding: 0;
margin-bottom: 10px;
background: #FFF;
.wea-form-cell {
padding: 0;
.wea-form-item {
padding: 10px;
}
}
}
}
}

View File

@ -78,7 +78,7 @@ class Index extends Component {
const { calculateStore: { calculateForm } } = this.props;
return (
<WeaDialog
{...this.props} style={{ width: 480 }} initLoadCss
{...this.props} style={{ width: 480, height: 174 }} initLoadCss
buttons={[
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(543233, "保存并进入核算")}</Button>
]}

View File

@ -152,7 +152,10 @@ class EditCalcTable extends Component {
const sumRowlistUrl = this.props.showTotalCell ? "/api/bs/hrmsalary/salaryacct/acctresult/sum" : "";
this.postMessageToChild({
dataSource, pageInfo, selectedRowKeys, showTotalCell: this.props.showTotalCell, sumRowlistUrl, payload,
columns: _.map(traverse(columns), (it, idx) => ({ ...it, fixed: idx < 2 ? "left" : false }))
columns: _.every(traverse(columns), (it, idx) => !it.fixed) ? _.map(traverse(columns), (it, idx) => ({
...it,
fixed: idx < 2 ? "left" : false
})) : traverse(columns)
});
});
}
@ -201,11 +204,12 @@ const traverse = (arr) => {
if (!_.isEmpty(item.children)) {
return {
title: item.text, width: item.width + "px", ellipsis: true,
dataIndex: item.column, children: traverse(item.children)
dataIndex: item.column, children: traverse(item.children),
fixed: item.fixed || false
};
} else {
return {
title: item.text, width: item.width + "px",
title: item.text, width: item.width + "px", fixed: item.fixed || false,
dataIndex: item.column, ellipsis: true, lockStatus: item.lockStatus
};
}

View File

@ -155,7 +155,20 @@ class Index extends Component {
}
}, () => {
const { selectItems: salaryItems } = this.state.headerFieldsDialog;
cacheImportField({ salaryItems: salaryItems ? salaryItems.split(",") : [] }).then();
cacheImportField({ salaryItems: salaryItems ? salaryItems.split(",") : [] })
.then(({ status, errormsg }) => {
if (status) {
const payload = {
exportData: getURLParameters(exportTempUrl).exportData,
salaryAcctRecordId, salaryItemIds: salaryItems
};
this.setState(({
exportTempUrl: `/api/bs/hrmsalary/salaryacct/acctresult/importtemplate/export?${convertToUrlString(payload)}`
}));
} else {
message.error(errormsg);
}
});
})}
/>
</React.Fragment>

View File

@ -4,195 +4,65 @@
* Description:
*/
import React, { Component } from "react";
import { WeaBrowser, WeaFormItem, WeaInput, WeaSearchGroup } from "ecCom";
import { getSearchs } from "../../util";
import { Select } from "../ruleConfig";
import { PickDate } from "../appConfig";
import { WeaBrowser, WeaFormItem } from "ecCom";
import { getDomkes, getSearchs } from "../../util";
import "./index.less";
class AddItems extends Component {
constructor(props) {
super(props);
this.state = {
baseInfo: {
declareMonth: "",
taxAgentId: "",
taxAgentName: "",
employeeId: "",
employeeName: "",
personArea: "ORGANIZATION",
username: "",
idcard: ""
}
};
}
componentDidMount() {
this.setState({
baseInfo: {
...this.state.baseInfo,
declareMonth: this.props.editId.declareMonth || this.props.editId.taxYearMonth,
taxAgentId: this.props.editId.taxAgentId,
taxAgentName: this.props.editId.taxAgentName,
employeeId: this.props.editId.employeeId,
employeeName: this.props.editId.username
}
});
const fields = _.map(this.props.condition[0].items, it => {
return it.domkey[0];
});
fields.map(item => {
this.props.form.updateFields({
[item]: this.props.editId[item] || ""
const { editId, condition, form } = this.props;
if (!_.isEmpty(editId)) {
getDomkes(condition).map(item => {
if (item === "employeeId") {
form.updateFields({
[item]: {
value: editId[item],
valueSpan: editId["username"],
valueObj: [{ id: editId[item], name: editId["username"] }]
}
});
} else if (item === "taxAgentId") {
form.updateFields({
[item]: editId[item].toString()
});
} else {
form.updateFields({
[item]: editId[item] || ""
});
}
});
});
}
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.editId !== this.props.editId) {
this.setState({
baseInfo: {
...this.state.baseInfo,
declareMonth: nextProps.editId.declareMonth || nextProps.editId.taxYearMonth,
taxAgentId: nextProps.editId.taxAgentId,
taxAgentName: nextProps.editId.taxAgentName,
employeeId: nextProps.editId.employeeId,
employeeName: nextProps.editId.username
if (nextProps.editId !== this.props.editId && !_.isEmpty(nextProps.editId)) {
getDomkes(nextProps.condition).map(item => {
if (item === "employeeId") {
nextProps.form.updateFields({
[item]: {
value: nextProps.editId[item],
valueSpan: nextProps.editId["username"],
valueObj: [{ id: nextProps.editId[item], name: nextProps.editId["username"] }]
}
});
} else if (item === "taxAgentId") {
nextProps.form.updateFields({
[item]: nextProps.editId[item].toString()
});
} else {
nextProps.form.updateFields({
[item]: nextProps.editId[item] || ""
});
}
});
const fields = _.map(nextProps.condition[0].items, it => {
return it.domkey[0];
});
fields.map(item => {
nextProps.form.updateFields({
[item]: nextProps.editId[item] || ""
});
});
}
}
render() {
const { taxAgentOption = [], form, condition = [], isCum, isSpecial, editId } = this.props;
const { baseInfo } = this.state;
let items = [
{
com: PickDate({
label: "税款所属期",
viewAttr: _.isEmpty(editId) ? 3 : 1,
labelCol: { span: 6 },
wrapperCol: { span: 18 },
format: "YYYY-MM",
value: baseInfo.declareMonth,
onChange: (data) => {
this.setState({ baseInfo: { ...baseInfo, declareMonth: data.date } });
}
})
},
{
com: Select({
label: "个税扣缴义务人",
viewAttr: _.isEmpty(editId) ? 3 : 1,
options: taxAgentOption,
value: baseInfo.taxAgentId,
onChange: (data) => {
this.setState({ baseInfo: { ...baseInfo, taxAgentId: data.selected, taxAgentName: data.showName } });
}
})
},
{
com: Browser({
label: "人员",
viewAttr: _.isEmpty(editId) ? 3 : 1,
value: baseInfo.employeeId,
valueSpan: baseInfo.employeeName,
onChange: ({ ids, names }) => {
this.setState({ baseInfo: { ...baseInfo, employeeId: ids, employeeName: names } });
}
})
}
];
const cumSituationitems = [
{
com: PickDate({
label: "税款所属期",
viewAttr: _.isEmpty(editId) ? 3 : 1,
labelCol: { span: 6 },
wrapperCol: { span: 18 },
format: "YYYY-MM",
value: baseInfo.declareMonth,
onChange: (data) => {
this.setState({ baseInfo: { ...baseInfo, declareMonth: data.date } });
}
})
},
{
com: Select({
label: "个税扣缴义务人",
viewAttr: _.isEmpty(editId) ? 3 : 1,
options: taxAgentOption,
value: baseInfo.taxAgentId,
onChange: (data) => {
this.setState({ baseInfo: { ...baseInfo, taxAgentId: data.selected, taxAgentName: data.showName } });
}
})
},
{
com: Select({
label: "人员范围",
viewAttr: _.isEmpty(editId) ? 3 : 1,
options: [
{ key: "ORGANIZATION", showname: "内部人员" }
// { key: "EXT_EMPLOYEE", showname: "非系统人员" }
],
value: baseInfo.personArea,
onChange: (data) => {
this.setState({ baseInfo: { ...baseInfo, personArea: data.selected } });
}
})
}
];
const insider = [{
com: Browser({
label: "人员",
viewAttr: _.isEmpty(editId) ? 3 : 1,
value: baseInfo.employeeId,
valueSpan: baseInfo.employeeName,
onChange: ({ ids, names }) => {
this.setState({ baseInfo: { ...baseInfo, employeeId: ids, employeeName: names } });
}
})
}];
const noSysPerson = [
{
com: InputCus({
label: "姓名",
viewAttr: 2,
onChange: (username) => {
this.setState({ baseInfo: { ...baseInfo, username } });
}
})
},
{
com: InputCus({
label: "身份证号码",
viewAttr: 3,
onChange: (idcard) => {
this.setState({ baseInfo: { ...baseInfo, idcard } });
}
})
}
];
isSpecial && items.shift();
const { form, condition = [] } = this.props;
return (
<div className="addItemsWrapper">
<WeaSearchGroup
className="baseForm"
title="基础信息"
items={!isCum ? items : baseInfo.personArea === "ORGANIZATION" ? [...cumSituationitems, ...insider] : baseInfo.personArea === "EXT_EMPLOYEE" ? [...cumSituationitems, ...noSysPerson] : cumSituationitems}
needTigger showGroup col={1}/>
{
getSearchs(form, condition, 2)
}
{getSearchs(form, condition)}
<Tips><span>若此员工数据已存在在同期列表中则当前数据保存后会覆盖列表数据</span></Tips>
</div>
);
@ -215,14 +85,6 @@ export const Browser = payload => {
</WeaFormItem>
);
};
export const InputCus = payload => {
const { label, onChange, value, viewAttr = 3 } = payload;
return (
<WeaFormItem label={label} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
<WeaInput value={value} onChange={onChange} viewAttr={viewAttr}/>
</WeaFormItem>
);
};
export const Tips = payload => {
const { children } = payload;
return (

View File

@ -396,6 +396,67 @@ export const situationModalColumns = [
export const dataSource = [];
export const dataCollectCondition = [
{
items: [
{
conditionType: "MONTHPICKER",
domkey: ["declareMonth"],
fieldcol: 12,
label: "税款所属期",
lanId: 542240,
labelcol: 4,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "SELECT",
domkey: ["taxAgentId"],
fieldcol: 12,
label: "个税扣缴义务人",
labelcol: 4,
lanId: 537996,
value: "",
options: [],
rules: "required|string",
viewAttr: 3
},
{
browserConditionParam: {
completeParams: {},
conditionDataParams: {},
dataParams: {},
destDataParams: {},
hasAddBtn: false,
hasAdvanceSerach: true,
idSeparator: ",",
isAutoComplete: 1,
isDetail: 0,
isMultCheckbox: false,
isSingle: true,
linkUrl: "",
pageSize: 10,
quickSearchName: "",
replaceDatas: [],
type: "1",
viewAttr: 3
},
colSpan: 2,
conditionType: "BROWSER",
domkey: ["employeeId"],
fieldcol: 12,
isQuickSearch: false,
label: "人员",
lanId: 30042,
labelcol: 4,
rules: "required",
viewAttr: 3
}
],
title: "基础信息",
defaultshow: true,
col: 1
},
{
items: [
{
@ -470,7 +531,8 @@ export const dataCollectCondition = [
}
],
title: "数据采集",
defaultshow: true
defaultshow: true,
col: 2
}
];
@ -491,6 +553,9 @@ export const cumTaxPeriodCondition = [
}],
title: "",
defaultshow: true
title: "数据采集",
defaultshow: true,
col: 2
}
];

View File

@ -7,7 +7,8 @@ import {
WeaInput,
WeaLocaleProvider,
WeaSearchGroup,
WeaSelect
WeaSelect,
WeaTools
} from "ecCom";
import { Button, Dropdown, Menu, message, Modal } from "antd";
import {
@ -34,6 +35,7 @@ import Layout from "../layout";
import moment from "moment";
import SalaryCumDeductChooseTaxPeriodDialog from "./components/salaryCumDeductChooseTaxPeriodDialog";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@inject("taxAgentStore", "cumDeductStore")
@ -282,21 +284,21 @@ class Index extends Component {
}
};
handleSaveData = () => {
const { cumDeductStore: { addForm } } = this.props;
const { baseInfo } = this.addItemRef.state;
const bool = _.every(_.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId"]), v => !!v);
if (!bool) {
Modal.warning({
title: "信息确认",
content: "必要信息不完整,红色*为必填项!"
});
return;
}
const payload = {
..._.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId", "taxAgentName"]),
...addForm.getFormParams()
};
this.handleSaveDeduction(payload);
const { cumDeductStore: { addForm }, taxAgentStore: { taxAgentOption } } = this.props;
addForm.validateForm().then(f => {
if (f.isValid) {
const payload = {
...addForm.getFormParams(),
taxAgentName: _.find(taxAgentOption, it => it.key === addForm.getFormParams().taxAgentId).showname
};
this.handleSaveDeduction(payload);
} else {
Modal.warning({
title: "信息确认",
content: "必要信息不完整,红色*为必填项!"
});
}
});
};
handleResize = (innerWidth) => this.setState({ innerWidth });
/*
@ -309,7 +311,32 @@ class Index extends Component {
const { taxAgentStore, cumDeductStore: { addForm } } = this.props;
const { slidePayload } = this.state;
const { taxAgentOption } = taxAgentStore;
addForm.initFormFields(dataCollectCondition);
const conditions = _.map(dataCollectCondition, (it, idx) => {
if (idx === 0) {
return {
...it, title: getLabel(82743, "基础信息"),
items: _.map(it.items, o => {
if (getKey(o) === "taxAgentId") {
return {
...o, label: getLabel(o.lanId, o.label),
options: taxAgentOption, viewAttr: _.isEmpty(editId) ? 3 : 1
};
}
return {
...o, label: getLabel(o.lanId, o.label), viewAttr: _.isEmpty(editId) ? 3 : 1
};
})
};
} else if (idx === 1) {
return {
...it, title: getLabel(83871, "数据采集"),
items: _.map(it.items, o => ({
...o, label: getLabel(o.lanId, o.label)
}))
};
}
});
addForm.initFormFields(conditions);
this.setState({
slidePayload: {
...slidePayload,
@ -322,7 +349,7 @@ class Index extends Component {
taxAgentOption={taxAgentOption}
form={addForm}
editId={editId}
condition={dataCollectCondition}
condition={conditions}
/> :
<TableRecord
ref={(dom) => this.tableRecordRef = dom}
@ -360,6 +387,7 @@ class Index extends Component {
});
this.tableRecordRef && this.tableRecordRef.handleResetSelectKeys();
this.handleDebounce = null;
this.props.cumDeductStore.initAddForm();
};
/*
* Author: 黎永顺

View File

@ -66,6 +66,82 @@ export const columns = [
}
];
export const dataCollectCondition = [
{
items: [
{
conditionType: "MONTHPICKER",
domkey: ["taxYearMonth"],
fieldcol: 12,
label: "税款所属期",
lanId: 542240,
labelcol: 4,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "SELECT",
domkey: ["taxAgentId"],
fieldcol: 12,
label: "个税扣缴义务人",
labelcol: 4,
lanId: 537996,
value: "",
options: [],
rules: "required|string",
viewAttr: 3
},
// {
// conditionType: "SELECT",
// domkey: ["employeeScope"],
// fieldcol: 14,
// label: "人员范围",
// labelcol: 8,
// lanId: 124810,
// value: "ORGANIZATION",
// options: [
// { key: "ORGANIZATION", showname: "内部人员" }
// // { key: "EXT_EMPLOYEE", showname: "非系统人员" }
// ],
// rules: "required|string",
// viewAttr: 3
// },
{
browserConditionParam: {
completeParams: {},
conditionDataParams: {},
dataParams: {},
destDataParams: {},
hasAddBtn: false,
hasAdvanceSerach: true,
idSeparator: ",",
isAutoComplete: 1,
isDetail: 0,
isMultCheckbox: false,
isSingle: true,
linkUrl: "",
pageSize: 10,
quickSearchName: "",
replaceDatas: [],
type: "1",
viewAttr: 3
},
colSpan: 2,
conditionType: "BROWSER",
domkey: ["employeeId"],
fieldcol: 12,
isQuickSearch: false,
label: "人员",
lanId: 30042,
labelcol: 4,
rules: "required",
viewAttr: 3
}
],
title: "基础信息",
defaultshow: true,
col: 1
},
{
items: [
{
@ -275,7 +351,8 @@ export const dataCollectCondition = [
// }
],
title: "数据采集",
defaultshow: true
defaultshow: true,
col: 2
}
];
export const taxOptions = [

View File

@ -6,7 +6,7 @@
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaLocaleProvider, WeaSearchGroup } from "ecCom";
import { WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
import { Button, Dropdown, Menu, message, Modal } from "antd";
import {
createAddUpSituation,
@ -32,6 +32,7 @@ import { situationModalColumns } from "../cumDeduct/columns";
import { convertToUrlString } from "../../../util/url";
import SalaryCumDeductChooseTaxPeriodDialog from "../cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@inject("taxAgentStore", "cumSituationStore")
@ -198,7 +199,32 @@ class Index extends Component {
const { taxAgentStore, cumSituationStore: { addForm } } = this.props;
const { slidePayload } = this.state;
const { taxAgentOption } = taxAgentStore;
addForm.initFormFields(dataCollectCondition);
const conditions = _.map(dataCollectCondition, (it, idx) => {
if (idx === 0) {
return {
...it, title: getLabel(82743, "基础信息"),
items: _.map(it.items, o => {
if (getKey(o) === "taxAgentId") {
return {
...o, label: getLabel(o.lanId, o.label),
options: taxAgentOption, viewAttr: _.isEmpty(editId) ? 3 : 1
};
}
return {
...o, label: getLabel(o.lanId, o.label), viewAttr: _.isEmpty(editId) ? 3 : 1
};
})
};
} else if (idx === 1) {
return {
...it, title: getLabel(83871, "数据采集"),
items: _.map(it.items, o => ({
...o, label: getLabel(o.lanId, o.label)
}))
};
}
});
addForm.initFormFields(conditions);
this.setState({
slidePayload: {
...slidePayload,
@ -212,7 +238,7 @@ class Index extends Component {
form={addForm}
isCum
editId={editId}
condition={dataCollectCondition}
condition={conditions}
/> :
<TableRecord
ref={(dom) => this.tableRecordRef = dom}
@ -438,24 +464,24 @@ class Index extends Component {
});
this.tableRecordRef && this.tableRecordRef.handleResetSelectKeys();
this.handleDebounce = null;
this.props.cumSituationStore.initAddForm();
};
handleSaveData = () => {
const { cumSituationStore: { addForm } } = this.props;
const { baseInfo } = this.addItemRef.state;
const bool = _.every(_.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId"]), v => !!v);
if (!bool) {
Modal.warning({
title: "信息确认",
content: "必要信息不完整,红色*为必填项!"
});
return;
}
const payload = {
taxYearMonth: baseInfo.declareMonth,
..._.pick(baseInfo, ["taxAgentId", "employeeId", "taxAgentName"]),
...addForm.getFormParams()
};
this.handleSaveDeduction(payload);
const { cumSituationStore: { addForm }, taxAgentStore: { taxAgentOption } } = this.props;
addForm.validateForm().then(f => {
if (f.isValid) {
const payload = {
...addForm.getFormParams(),
taxAgentName: _.find(taxAgentOption, it => it.key === addForm.getFormParams().taxAgentId).showname
};
this.handleSaveDeduction(payload);
} else {
Modal.warning({
title: "信息确认",
content: "必要信息不完整,红色*为必填项!"
});
}
});
};
handleResize = (innerWidth) => this.setState({ innerWidth });

View File

@ -66,6 +66,67 @@ export const columns = [
}
];
export const dataCollectCondition = [
{
items: [
{
conditionType: "MONTHPICKER",
domkey: ["declareMonth"],
fieldcol: 12,
label: "税款所属期",
lanId: 542240,
labelcol: 4,
value: "",
rules: "required|string",
viewAttr: 3
},
{
conditionType: "SELECT",
domkey: ["taxAgentId"],
fieldcol: 12,
label: "个税扣缴义务人",
labelcol: 4,
lanId: 537996,
value: "",
options: [],
rules: "required|string",
viewAttr: 3
},
{
browserConditionParam: {
completeParams: {},
conditionDataParams: {},
dataParams: {},
destDataParams: {},
hasAddBtn: false,
hasAdvanceSerach: true,
idSeparator: ",",
isAutoComplete: 1,
isDetail: 0,
isMultCheckbox: false,
isSingle: true,
linkUrl: "",
pageSize: 10,
quickSearchName: "",
replaceDatas: [],
type: "1",
viewAttr: 3
},
colSpan: 2,
conditionType: "BROWSER",
domkey: ["employeeId"],
fieldcol: 12,
isQuickSearch: false,
label: "人员",
lanId: 30042,
labelcol: 4,
rules: "required",
viewAttr: 3
}
],
title: "基础信息",
defaultshow: true,
col: 1
},
{
items: [
{
@ -120,7 +181,8 @@ export const dataCollectCondition = [
}
],
title: "数据采集",
defaultshow: true
defaultshow: true,
col: 2
}
];

View File

@ -6,7 +6,7 @@
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaSearchGroup } from "ecCom";
import { WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
import { Button, Dropdown, Menu, message, Modal } from "antd";
import {
createData,
@ -31,6 +31,9 @@ import TableRecord from "../components/tableRecord";
import { otherModalColumns } from "../cumDeduct/columns";
import { convertToUrlString } from "../../../util/url";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@inject("taxAgentStore", "otherDeductStore")
@observer
class Index extends Component {
@ -287,7 +290,32 @@ class Index extends Component {
const { taxAgentStore, otherDeductStore: { addForm } } = this.props;
const { slidePayload } = this.state;
const { taxAgentOption } = taxAgentStore;
addForm.initFormFields(dataCollectCondition);
const conditions = _.map(dataCollectCondition, (it, idx) => {
if (idx === 0) {
return {
...it, title: getLabel(82743, "基础信息"),
items: _.map(it.items, o => {
if (getKey(o) === "taxAgentId") {
return {
...o, label: getLabel(o.lanId, o.label),
options: taxAgentOption, viewAttr: _.isEmpty(editId) ? 3 : 1
};
}
return {
...o, label: getLabel(o.lanId, o.label), viewAttr: _.isEmpty(editId) ? 3 : 1
};
})
};
} else if (idx === 1) {
return {
...it, title: getLabel(83871, "数据采集"),
items: _.map(it.items, o => ({
...o, label: getLabel(o.lanId, o.label)
}))
};
}
});
addForm.initFormFields(conditions);
this.setState({
slidePayload: {
...slidePayload,
@ -300,7 +328,7 @@ class Index extends Component {
taxAgentOption={taxAgentOption}
form={addForm}
editId={editId}
condition={dataCollectCondition}
condition={conditions}
/> :
<TableRecord
ref={(dom) => this.tableRecordRef = dom}
@ -389,23 +417,24 @@ class Index extends Component {
});
this.tableRecordRef && this.tableRecordRef.handleResetSelectKeys();
this.handleDebounce = null;
this.props.otherDeductStore.initAddForm();
};
handleSaveData = () => {
const { otherDeductStore: { addForm } } = this.props;
const { baseInfo } = this.addItemRef.state;
const bool = _.every(_.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId"]), v => !!v);
if (!bool) {
Modal.warning({
title: "信息确认",
content: "必要信息不完整,红色*为必填项!"
});
return;
}
const payload = {
..._.pick(baseInfo, ["declareMonth", "taxAgentId", "employeeId", "taxAgentName"]),
...addForm.getFormParams()
};
this.handleSaveDeduction(payload);
const { otherDeductStore: { addForm }, taxAgentStore: { taxAgentOption } } = this.props;
addForm.validateForm().then(f => {
if (f.isValid) {
const payload = {
...addForm.getFormParams(),
taxAgentName: _.find(taxAgentOption, it => it.key === addForm.getFormParams().taxAgentId).showname
};
this.handleSaveDeduction(payload);
} else {
Modal.warning({
title: "信息确认",
content: "必要信息不完整,红色*为必填项!"
});
}
});
};
handleAdSearch = () => {
const { otherDeductStore: { form } } = this.props;

View File

@ -1,4 +1,54 @@
export const condition = [
{
items: [
{
conditionType: "SELECT",
domkey: ["taxAgentId"],
fieldcol: 12,
label: "个税扣缴义务人",
lanId: 537996,
labelcol: 4,
value: "",
options: [],
rules: "required|string",
viewAttr: 3
},
{
browserConditionParam: {
completeParams: {},
conditionDataParams: {},
dataParams: {},
destDataParams: {},
hasAddBtn: false,
hasAdvanceSerach: true,
idSeparator: ",",
isAutoComplete: 1,
isDetail: 0,
isMultCheckbox: false,
isSingle: true,
linkUrl: "",
pageSize: 10,
quickSearchName: "",
replaceDatas: [],
type: "1",
viewAttr: 3
},
colSpan: 2,
conditionType: "BROWSER",
domkey: ["employeeId"],
fieldcol: 12,
isQuickSearch: false,
label: "人员",
lanId: 30042,
labelcol: 4,
rules: "required",
viewAttr: 3
}
],
title: "基础信息",
defaultshow: true,
col: 1
},
{
items: [
{
@ -73,7 +123,8 @@ export const condition = [
}
],
title: "数据采集",
defaultshow: true
defaultshow: true,
col: 2
}
];
@ -114,7 +165,7 @@ export const searchCondition = [
showOrder: 0
}
],
title: '部门',
title: "部门",
type: "4",
viewAttr: 2,
pageSize: 10,

View File

@ -1,6 +1,6 @@
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaSearchGroup } from "ecCom";
import { WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
import { Button, Dropdown, Menu, message, Modal } from "antd";
import DataTables from "../dataTables";
import Layout from "../layout";
@ -23,6 +23,9 @@ import TableRecord from "../components/tableRecord";
import { specialModalColumns } from "../cumDeduct/columns";
import { convertToUrlString } from "../../../util/url";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@inject("taxAgentStore", "specialAddStore")
@observer
class Index extends Component {
@ -295,7 +298,32 @@ class Index extends Component {
const { taxAgentStore, specialAddStore: { addForm } } = this.props;
const { slidePayload } = this.state;
const { taxAgentOption } = taxAgentStore;
addForm.initFormFields(condition);
const conditions = _.map(condition, (it, idx) => {
if (idx === 0) {
return {
...it, title: getLabel(82743, "基础信息"),
items: _.map(it.items, o => {
if (getKey(o) === "taxAgentId") {
return {
...o, label: getLabel(o.lanId, o.label),
options: taxAgentOption, viewAttr: _.isEmpty(editId) ? 3 : 1
};
}
return {
...o, label: getLabel(o.lanId, o.label), viewAttr: _.isEmpty(editId) ? 3 : 1
};
})
};
} else if (idx === 1) {
return {
...it, title: getLabel(83871, "数据采集"),
items: _.map(it.items, o => ({
...o, label: getLabel(o.lanId, o.label)
}))
};
}
});
addForm.initFormFields(conditions);
this.setState({
slidePayload: {
...slidePayload,
@ -309,7 +337,7 @@ class Index extends Component {
form={addForm}
isSpecial
editId={editId}
condition={condition}
condition={conditions}
/> :
<TableRecord
ref={(dom) => this.tableRecordRef = dom}
@ -347,23 +375,24 @@ class Index extends Component {
});
this.tableRecordRef && this.tableRecordRef.handleResetSelectKeys();
this.handleDebounce = null;
this.props.specialAddStore.initAddForm();
};
handleSaveData = () => {
const { specialAddStore: { addForm } } = this.props;
const { baseInfo } = this.addItemRef.state;
const bool = _.every(_.pick(baseInfo, ["taxAgentId", "employeeId"]), v => !!v);
if (!bool) {
Modal.warning({
title: "信息确认",
content: "必要信息不完整,红色*为必填项!"
});
return;
}
const payload = {
..._.pick(baseInfo, ["taxAgentId", "employeeId", "taxAgentName"]),
...addForm.getFormParams()
};
this.handleSaveDeduction(payload);
const { specialAddStore: { addForm }, taxAgentStore: { taxAgentOption } } = this.props;
addForm.validateForm().then(f => {
if (f.isValid) {
const payload = {
...addForm.getFormParams(),
taxAgentName: _.find(taxAgentOption, it => it.key === addForm.getFormParams().taxAgentId).showname
};
this.handleSaveDeduction(payload);
} else {
Modal.warning({
title: "信息确认",
content: "必要信息不完整,红色*为必填项!"
});
}
});
};
handleAdSearch = () => {
const { specialAddStore: { advanceForm } } = this.props;

View File

@ -13,10 +13,12 @@ export const loginCondition = [
fieldcol: 18,
label: getLabel(388431, "登录密码"),
labelcol: 6,
detailtype: 3,
detailtype: 1,
rules: "required|string",
type: "password",
viewAttr: 3
viewAttr: 3,
otherParams: {
type: "password"
}
}
],
title: "",
@ -35,10 +37,12 @@ export const condition = [
fieldcol: 18,
label: getLabel(409, "密码"),
labelcol: 6,
detailtype: 3,
detailtype: 1,
rules: "required|string",
viewAttr: 3,
type: "password"
otherParams: {
type: "password"
}
},
{
colSpan: 1,
@ -49,7 +53,10 @@ export const condition = [
labelcol: 6,
rules: "required|string",
viewAttr: 3,
type: "password"
detailtype: 1,
otherParams: {
type: "password"
}
},
{
colSpan: 1,

View File

@ -634,7 +634,7 @@ class Index extends Component {
});
}}>调薪</Button>);
}
selectedKey !== "stop" && arrList.push(<Button type="primary" onClick={this.handleSave}>保存</Button>);
(showOperateBtn && selectedKey !== "stop") && arrList.push(<Button type="primary" onClick={this.handleSave}>保存</Button>);
return arrList;
};
//切换tab
@ -730,7 +730,7 @@ class Index extends Component {
paysetParams,
extEmpsWitch
} = this.state;
const { payrollFilesStore: { tableStore } } = this.props;
const { payrollFilesStore: { tableStore }, taxAgentStore: { showOperateBtn } } = this.props;
const renderSearch = () => {
const searchItems = [
{ com: this.Input("姓名", "username") },
@ -871,6 +871,7 @@ class Index extends Component {
<SalaryFileViewSlide
id={slideParams.id}
selectedKey={selectedKey}
showOperateBtn={showOperateBtn}
handleSetpay={this.handleSetpay}
paysetParams={paysetParams}
onChangePaySetParams={(res) => {

View File

@ -0,0 +1,422 @@
/*
* Author: 黎永顺
* name: 新建自定义统计项目弹框
* Description:
* Date: 2023/4/10
*/
import React, { Component } from "react";
import { Button, message, Modal } from "antd";
import {
WeaBrowser,
WeaCheckbox,
WeaDialog,
WeaError,
WeaFormItem,
WeaHelpfulTip,
WeaInput,
WeaInputNumber,
WeaLocaleProvider,
WeaTable
} from "ecCom";
import { reportStatisticsItemSave, statisticsItemGetform } from "../../../apis/statistics";
import "../index.less";
const { getLabel } = WeaLocaleProvider;
class CustomStatisticsItemsModal extends Component {
constructor(props) {
super(props);
this.state = {
loading: false,
columns: [],
dataSource: [],
formData: {
itemValue: "", itemValueSpan: "",
itemName: ""
}
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) {
this.statisticsItemGetform({ id: nextProps.statisticsItemId });
} else {
this.setState({
columns: [],
dataSource: [],
formData: {
itemValue: "", itemValueSpan: "",
itemName: ""
}
});
}
}
handleSaveStatisticalItems = () => {
const { dataSource, formData } = this.state;
const { id: statReportId, statisticsItemId } = this.props;
const { itemValue, itemName } = formData;
const isNoRules = _.some(dataSource, it => !!it.m2mValue || !!it.ratioValue || !!it.totalValue || !!it.y2yValue);
const isChainRequired = _.some(dataSource, it => !!it.m2mValue && (!it.m2mLowerLimit || !it.m2mUpperLimit));
const isChainValRight = _.some(dataSource, it => !!it.m2mValue && it.m2mLowerLimit !== 0 && it.m2mUpperLimit !== 0 && (Number(it.m2mLowerLimit) > Number(it.m2mUpperLimit)));
const isYoyRequired = _.some(dataSource, it => !!it.y2yValue && (!it.y2yLowerLimit || !it.y2yUpperLimit));
const isYoyValRight = _.some(dataSource, it => !!it.y2yValue && it.y2yLowerLimit !== 0 && it.y2yUpperLimit !== 0 && (Number(it.y2yLowerLimit) > Number(it.y2yUpperLimit)));
if (!itemValue && !itemName) {
this.refs.proError.showError();
this.refs.nameError.showError();
return;
}
if (!itemValue) {
this.refs.proError.showError();
return;
}
if (!itemName) {
this.refs.nameError.showError();
return;
}
if (!isNoRules) {
message.warning(getLabel(111, "请至少设置一个统计规则"));
return;
}
if (isChainRequired) {
message.warning(getLabel(111, "请完善环比增幅正常区间设置上下限"));
return;
}
if (isChainValRight) {
message.warning(getLabel(111, "环比增幅上下限设置错误"));
return;
}
if (isYoyRequired) {
message.warning(getLabel(111, "请完善同比增幅正常区间设置上下限"));
return;
}
if (isYoyValRight) {
message.warning(getLabel(111, "同比增幅上下限设置错误"));
return;
}
let payload = { statReportId, itemValue: itemValue.split(","), itemName };
payload = {
id: statisticsItemId,
...payload,
..._.reduce(dataSource, (pre, cur) => {
if (!!cur.m2mValue || !!cur.ratioValue || !!cur.totalValue || !!cur.y2yValue) {
const { y2yLowerLimit, y2yUpperLimit, m2mLowerLimit, m2mUpperLimit } = cur;
if (!!cur.m2mValue) {
return {
...pre,
[`${cur["id"]}Rule`]: {
m2mValue: cur.m2mValue.toString(),
ratioValue: cur.ratioValue.toString(),
totalValue: cur.totalValue.toString(),
y2yValue: cur.y2yValue.toString(),
m2mLowerLimit: m2mLowerLimit.toString(),
m2mUpperLimit: m2mUpperLimit.toString()
}
};
}
if (!!cur.m2mValue) {
return {
...pre,
[`${cur["id"]}Rule`]: {
m2mValue: cur.m2mValue.toString(),
ratioValue: cur.ratioValue.toString(),
totalValue: cur.totalValue.toString(),
y2yValue: cur.y2yValue.toString(),
y2yLowerLimit: y2yLowerLimit.toString(),
y2yUpperLimit: y2yUpperLimit.toString()
}
};
}
if (!!cur.y2yValue && !!cur.y2yValue) {
return {
...pre,
[`${cur["id"]}Rule`]: {
m2mValue: cur.m2mValue.toString(),
ratioValue: cur.ratioValue.toString(),
totalValue: cur.totalValue.toString(),
y2yValue: cur.y2yValue.toString(),
m2mLowerLimit: m2mLowerLimit.toString(),
m2mUpperLimit: m2mUpperLimit.toString(),
y2yLowerLimit: y2yLowerLimit.toString(),
y2yUpperLimit: y2yUpperLimit.toString()
}
};
}
return {
...pre,
[`${cur["id"]}Rule`]: {
m2mValue: cur.m2mValue.toString(),
ratioValue: cur.ratioValue.toString(),
totalValue: cur.totalValue.toString(),
y2yValue: cur.y2yValue.toString()
}
};
}
return { ...pre };
}, {})
};
if (statisticsItemId) {
Modal.confirm({
title: getLabel(111, "信息确认"),
content: getLabel(111, `确定要编辑统计项吗?编辑后,可能需要重新设置分析图设置。`),
onOk: () => this.reportStatisticsItemSave(payload)
});
} else {
this.reportStatisticsItemSave(payload);
}
};
reportStatisticsItemSave = (payload) => {
this.setState({ loading: true });
reportStatisticsItemSave(payload).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
this.setState({
formData: {
itemValue: "", itemName: ""
}
}, () => this.props.onCancel(true));
} else {
message.error(errormsg);
}
}).catch(() => this.setState({ loading: false }));
};
statisticsItemGetform = (payload) => {
statisticsItemGetform(payload).then(({ status, data }) => {
if (status) {
const { formData } = this.state;
const { ruleData, baseForm } = data;
const { data: dataDetail } = baseForm;
const { columns, data: dataSource } = ruleData;
this.setState({
columns, dataSource,
formData: {
...formData,
itemName: dataDetail ? dataDetail.itemName : "",
itemValue: dataDetail ? _.map(dataDetail.itemValue, it => it.id).join() : "",
itemValueSpan: dataDetail ? _.map(dataDetail.itemValue, it => it.name).join() : ""
}
});
}
});
};
handleChangeColumnCheckBox = (key, value, id) => {
const { dataSource } = this.state;
this.setState({
dataSource: _.map(dataSource, it => {
if (it.id === id) {
if (key !== "totalValue" && !!value && value !== "0") {
return {
...it,
totalValue: Number(value),
[key]: Number(value)
};
}
return {
...it,
[key]: Number(value)
};
}
return { ...it };
})
});
};
handleChangeColumnAllChecked = (key, val) => {
const { dataSource } = this.state;
this.setState({
dataSource: _.map(dataSource, it => {
if (key !== "totalValue" && !!val && val !== "0") {
return {
...it,
totalValue: Number(val),
[key]: Number(val)
};
}
return {
...it,
[key]: Number(val)
};
})
});
};
handleChangeColumnM2MValue = (key, value, id) => {
const { dataSource } = this.state;
this.setState({
dataSource: _.map(dataSource, it => {
if (it.id === id) {
return {
...it,
[key]: value
};
}
return { ...it };
})
});
};
handleChangeStatisticalItems = (itemValue, _names, datas) => {
const { formData } = this.state;
this.setState({
formData: {
...formData,
itemValue,
itemValueSpan: _.map(datas, it => it.name).join(","),
itemName: datas.length === 1 ? _.map(datas, it => it.names).join(",") : ""
}
});
};
render() {
const { loading, columns, dataSource, formData } = this.state;
const { itemName, itemValue, itemValueSpan } = formData;
const { statisticsItemId, isShare } = this.props;
const cols = _.map(columns, it => {
const { text, column } = it;
if (column === "ruleName" || column === "ratio" || column === "m2m" || column === "y2y") {
const key = column === "ruleName" ? "total" : column;
return {
...it,
title: <span>
<WeaCheckbox
disabled={isShare}
value={_.every(dataSource, child => !!child[`${key}Value`])}
onChange={val => this.handleChangeColumnAllChecked(`${key}Value`, val)}
/>
<span style={{ marginLeft: 8 }}>{text}</span>
</span>,
render: (txt, record) => {
return <span>
<WeaCheckbox
disabled={isShare}
value={record[`${key}Value`].toString()}
onChange={val => this.handleChangeColumnCheckBox(`${key}Value`, val, record.id)}
/>
<span style={{ marginLeft: 8 }}>
{column === "ruleName" ? record["ruleName"] : text}
</span>
</span>;
}
};
} else if (column === "m2mLimit") {
return {
...it,
title: <span>
<span style={{ marginRight: 8 }}>{text}</span>
<WeaHelpfulTip title={getLabel(111, "如:增幅>10%,差值和增幅标记为红色,增幅<-10%标记为绿色")}
placement="top" width={200}/>
</span>,
render: (txt, record) => {
return !!record["m2mValue"] && <IntervalSettingsComp
isShare={isShare}
LowerLimit={record[`${column.replace("Limit", "")}LowerLimit`]}
UpperLimit={record[`${column.replace("Limit", "")}UpperLimit`]}
onChange={(type, val) => this.handleChangeColumnM2MValue(`${column.replace("Limit", "")}${type === "min" ? "LowerLimit" : "UpperLimit"}`, val, record.id)}
/>;
}
};
} else if (column === "y2yLimit") {
return {
...it,
title: <span>
<span style={{ marginRight: 8 }}>{text}</span>
<WeaHelpfulTip title={getLabel(111, "如:增幅>10%,差值和增幅标记为红色,增幅<-10%标记为绿色")}
placement="top" width={200}/>
</span>,
render: (txt, record) => {
return !!record["y2yValue"] && <IntervalSettingsComp
isShare={isShare}
LowerLimit={record[`${column.replace("Limit", "")}LowerLimit`]}
UpperLimit={record[`${column.replace("Limit", "")}UpperLimit`]}
onChange={(type, val) => this.handleChangeColumnM2MValue(`${column.replace("Limit", "")}${type === "min" ? "LowerLimit" : "UpperLimit"}`, val, record.id)}
/>;
}
};
}
});
return (
<WeaDialog
{...this.props} hasScroll buttons={[]} initLoadCss
title={
<div className="itemsTitle">
<span>{statisticsItemId ? getLabel(111, "编辑自定义统计项目") : getLabel(111, "新建自定义统计项目")}</span>
{
!isShare && <Button type="primary" loading={loading}
onClick={this.handleSaveStatisticalItems}>{getLabel(111, "保存")}</Button>
}
</div>
}
style={{ width: 900, height: 450 }}
className="statisticItemsWrapper"
>
<div className="statisticItemsBox">
<WeaFormItem label={getLabel(111, "统计项目")} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
<WeaError tipPosition="bottom" ref="proError" error={getLabel(111, "此项必填")}>
<WeaBrowser
title={getLabel(111, "统计项目")}
type={162}
viewAttr={!isShare ? 3 : 1}
isSingle={false}
value={itemValue}
replaceDatas={itemValue ? _.map(itemValue.split(","), (it, idx) => ({
id: it,
name: itemValueSpan.split(",")[idx]
})) : []}
completeParams={{
type: 162,
fielddbtype: "browser.salaryItemBrowser",
f_weaver_belongto_usertype: "0"
}}
conditionDataParams={{
type: "browser.salaryItemBrowser",
fielddbtype: "browser.salaryItemBrowser",
f_weaver_belongto_usertype: "0"
}}
dataParams={{
type: "browser.salaryItemBrowser",
f_weaver_belongto_usertype: "0"
}}
destDataParams={{
type: "browser.salaryItemBrowser",
f_weaver_belongto_usertype: "0"
}}
isMultCheckbox
inputStyle={{ width: "100%" }}
onChange={this.handleChangeStatisticalItems}
/>
</WeaError>
</WeaFormItem>
<WeaFormItem label={getLabel(111, "统计项名称")} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
<WeaError tipPosition="bottom" ref="nameError" error={getLabel(111, "此项必填")}>
<WeaInput value={itemName} viewAttr={!isShare ? 3 : 1}
onChange={itemName => this.setState({ formData: { ...formData, itemName } })}/>
</WeaError>
</WeaFormItem>
<div className="customRuleTableWrapper">
<WeaTable
dataSource={dataSource}
columns={cols}
pagination={false}
/>
</div>
</div>
</WeaDialog>
);
}
}
export default CustomStatisticsItemsModal;
/*
* Author: 黎永顺
* Description: 区间设置
* Params:
* Date: 2023/4/23
*/
const IntervalSettingsComp = (props) => {
const { LowerLimit, UpperLimit, onChange, isShare } = props;
return <div className="intervalSettingsCompWrapper">
<WeaInputNumber value={LowerLimit} precision={2} onChange={val => onChange("min", val)} disabled={isShare}/>
<span className="increaseTitle">{`% <${getLabel(111, "增幅")}<`}</span>
<WeaInputNumber value={UpperLimit} precision={2} onChange={val => onChange("max", val)} disabled={isShare}/>
<span className="pecentTitle">%</span>
</div>;
};

View File

@ -18,7 +18,7 @@ import {
WeaLocaleProvider,
WeaTable
} from "ecCom";
import { reportStatisticsItemSave, statisticsItemGetform } from "../../../apis/statistics";
import { reportStatisticsItemSave, statisticsItemChangetab, statisticsItemGetform } from "../../../apis/statistics";
import "../index.less";
const { getLabel } = WeaLocaleProvider;
@ -142,15 +142,24 @@ class CustomStatisticsItemsModal extends Component {
}
};
}
return {
...pre,
[`${cur["id"]}Rule`]: {
m2mValue: cur.m2mValue.toString(),
ratioValue: cur.ratioValue.toString(),
totalValue: cur.totalValue.toString(),
y2yValue: cur.y2yValue.toString()
}
};
if (_.isNil(cur.m2mValue) && _.isNil(cur.ratioValue) && _.isNil(cur.y2yValue)) {
return {
...pre,
[`${cur["id"]}Rule`]: {
totalValue: cur.totalValue.toString()
}
};
} else {
return {
...pre,
[`${cur["id"]}Rule`]: {
m2mValue: cur.m2mValue.toString(),
ratioValue: cur.ratioValue.toString(),
totalValue: cur.totalValue.toString(),
y2yValue: cur.y2yValue.toString()
}
};
}
}
return { ...pre };
}, {})
@ -194,8 +203,8 @@ class CustomStatisticsItemsModal extends Component {
formData: {
...formData,
itemName: dataDetail ? dataDetail.itemName : "",
itemValue: dataDetail ? _.map(dataDetail.itemValue, it => it.id).join() : "",
itemValueSpan: dataDetail ? _.map(dataDetail.itemValue, it => it.name).join() : ""
itemValue: dataDetail ? dataDetail.itemValue.id : "",
itemValueSpan: dataDetail ? dataDetail.itemValue.name : ""
}
});
}
@ -263,6 +272,16 @@ class CustomStatisticsItemsModal extends Component {
itemValueSpan: _.map(datas, it => it.name).join(","),
itemName: datas.length === 1 ? _.map(datas, it => it.names).join(",") : ""
}
}, () => {
statisticsItemChangetab({ itemId: itemValue }).then(({ status, data }) => {
if (status) {
const { ruleData } = data;
const { columns, data: dataSource } = ruleData;
this.setState({
columns, dataSource
});
}
});
});
};
@ -352,10 +371,7 @@ class CustomStatisticsItemsModal extends Component {
<WeaFormItem label={getLabel(111, "统计项目")} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
<WeaError tipPosition="bottom" ref="proError" error={getLabel(111, "此项必填")}>
<WeaBrowser
title={getLabel(111, "统计项目")}
type={162}
viewAttr={!isShare ? 3 : 1}
isSingle={false}
title={getLabel(111, "统计项目")} type={162} viewAttr={!isShare ? 3 : 1} isSingle
value={itemValue}
replaceDatas={itemValue ? _.map(itemValue.split(","), (it, idx) => ({
id: it,
@ -379,7 +395,7 @@ class CustomStatisticsItemsModal extends Component {
type: "browser.salaryItemBrowser",
f_weaver_belongto_usertype: "0"
}}
isMultCheckbox
// isMultCheckbox
inputStyle={{ width: "100%" }}
onChange={this.handleChangeStatisticalItems}
/>

View File

@ -12,6 +12,7 @@ import ChartsRangeSettingsModal from "./chartsRangeSettingsModal";
import { mapBarOptions, mapLineOptions, mapPieOptions } from "./condition";
import { queryRangeSetting, reportStatisticsReportGetData } from "../../../apis/statistics";
import PovitpivotChartModal from "./povitpivotChartModal";
import { getSalaryMonthValue } from "./statisticalMicroSettingsSlide";
import "../index.less";
class ReportContent extends Component {
@ -43,7 +44,7 @@ class ReportContent extends Component {
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.report !== this.props.report && nextProps.report.dimensionId) {
this.reportStatisticsReportGetData(nextProps.report.id, nextProps.report.dimensionId, nextProps.report.isShare);
this.reportStatisticsReportGetData(nextProps.report);
this.setState({ viewType: "dataView", chartsInfo: {} });
}
}
@ -81,8 +82,13 @@ class ReportContent extends Component {
dataSource, columns, showSum, countResult
}), "*");
};
reportStatisticsReportGetData = (id, dimensionId, isShare) => {
const payload = { id, dimensionId, isShare };
reportStatisticsReportGetData = (params) => {
const { id, dimensionId, isShare, timeType, salaryEndMonth: end, salaryStartMonth: start } = params;
const [salaryStartMonth, salaryEndMonth] = getSalaryMonthValue(timeType);
const payload = {
id, dimensionId, isShare,
salaryStartMonth: (salaryStartMonth || start) + "-01", salaryEndMonth: (salaryEndMonth || end) + "-01"
};
this.setState({ loading: true });
reportStatisticsReportGetData(payload).then(({ status, data }) => {
this.setState({ loading: false });
@ -191,13 +197,13 @@ class ReportContent extends Component {
handleChangeChartOpts = (chartsType, viewType) => {
this.setState({ chartsInfo: {} });
if (this.refs.chart && viewType !== "setting" && viewType !== "dataView" && !this.state.rangSet.visible) this.refs.chart.clear();
const { report: { id: reportId, dimensionId, isShare } } = this.props;
const { report: { id: reportId } } = this.props;
const { rangSet } = this.state;
viewType !== "setting" && this.setState({ chartsType, viewType }, () => {
const { viewType, chartsType } = this.state;
viewType !== "dataView" ?
this.queryRangeSetting({ reportId, chartsType }, true) :
this.reportStatisticsReportGetData(reportId, dimensionId, isShare);
this.reportStatisticsReportGetData(this.props.report);
});
viewType === "setting" && this.setState({ rangSet: { ...rangSet, visible: true, reportId } }, () => {
this.queryRangeSetting({ reportId, chartsType });
@ -213,8 +219,7 @@ class ReportContent extends Component {
};
handleGetData = () => {
const { report } = this.props;
const { id, dimensionId, isShare } = report;
this.setState({ viewType: "dataView" }, () => this.reportStatisticsReportGetData(id, dimensionId, isShare));
this.setState({ viewType: "dataView" }, () => this.reportStatisticsReportGetData(report));
};
renderCharts = () => {
const { chartsInfo, viewType } = this.state;

View File

@ -32,6 +32,7 @@ import {
import { commonEnumList } from "../../../apis/ruleconfig";
import { getTaxAgentSelectList } from "../../../apis/taxAgent";
import { condition } from "./condition";
import cs from "classnames";
import "../index.less";
const getKey = WeaTools.getKey;
@ -47,6 +48,7 @@ class StatisticalMicroSettingsSlide extends Component {
dataSource: [],
unitTypeList: [],
salaryMonth: [],
timeType: 10,
statisticalItemPayload: {
visible: false, id: "", dimension: "",
statisticsItemId: "", isShare: false
@ -96,8 +98,9 @@ class StatisticalMicroSettingsSlide extends Component {
const { form } = this.props;
reportStatisticsGetSearchCondition({ id }).then(({ status, data }) => {
if (status && !_.isEmpty(data)) {
const { salaryEndMonth, salaryStartMonth, ...formData } = data.data;
const { salaryEndMonth, salaryStartMonth, timeType, ...formData } = data.data;
this.setState({
timeType,
salaryMonth: [salaryStartMonth || moment().startOf("year").format("YYYY-MM"), salaryEndMonth || moment().format("YYYY-MM")]
});
const fields = _.map(conditions[0].items, it => it.domkey[0]);
@ -118,7 +121,7 @@ class StatisticalMicroSettingsSlide extends Component {
});
};
reportStatisticsSaveSearchCondition = () => {
const { salaryMonth, dataSource } = this.state;
const { salaryMonth, timeType, dataSource } = this.state;
const { form, id, dimension, onClose } = this.props;
const [salaryStartMonth, salaryEndMonth] = salaryMonth;
const { department, employee, position, subCompany, taxAgent, ...extra } = form.getFormDatas();
@ -128,7 +131,7 @@ class StatisticalMicroSettingsSlide extends Component {
return;
}
const payload = {
dimension, id,
dimension, id, timeType,
hiredate: extra["hiredate1__hiredate2"].value || [],
department: _.map(department.valueObj, it => ({ id: it.id, name: it.name })),
employee: _.map(employee.valueObj, it => ({ id: it.id, name: it.name })),
@ -233,7 +236,7 @@ class StatisticalMicroSettingsSlide extends Component {
render() {
const {
salaryMonth, conditions, selectedRowKeys, loading,
statisticalItemPayload, dataSource, unitTypeList
statisticalItemPayload, dataSource, unitTypeList, timeType
} = this.state;
const { id, dimension, isShare } = this.props;
const columns = [
@ -288,8 +291,8 @@ class StatisticalMicroSettingsSlide extends Component {
<WeaSearchGroup title={getLabel(111, "统计时间范围")} col={2} showGroup needTigger>
<WeaFormItem label={getLabel(111, "薪资所属月")} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
<WeaError tipPosition="bottom" ref="weaError" error={getLabel(111, "此项必填")}>
<MonthRangePicker viewAttr={3} dateRange={salaryMonth} disabled={isShare}
onChange={v => this.setState({ salaryMonth: v })}/>
<StatisticalScopePicker viewAttr={3} dateRange={salaryMonth} disabled={isShare} timeType={timeType}
onChange={(v, timeType) => this.setState({ salaryMonth: v, timeType })}/>
</WeaError>
</WeaFormItem>
</WeaSearchGroup>
@ -344,6 +347,69 @@ const TitleDialog = (props) => {
</div>
</div>;
};
const StatisticalScopePicker = (props) => {
const scopeBtns = [
{ key: 1, label: getLabel(111, "上月") },
{ key: 2, label: getLabel(111, "本月") },
{ key: 3, label: getLabel(111, "一季度") },
{ key: 4, label: getLabel(111, "二季度") },
{ key: 5, label: getLabel(111, "三季度") },
{ key: 6, label: getLabel(111, "四季度") },
{ key: 7, label: getLabel(111, "上半年") },
{ key: 8, label: getLabel(111, "下半年") },
{ key: 9, label: getLabel(111, "本年") }
];
const { timeType, dateRange, onChange, viewAttr, disabled = false } = props;
const [startDate, endDate] = dateRange || [];
return <div className="date-set-area">
<div className="date-item">
{
_.map(scopeBtns.slice(0, 2), o => (
<Button type={timeType === o.key ? "primary" : "ghost"} disabled={disabled}
onClick={() => onChange(getSalaryMonthValue(o.key), o.key)}>{o.label}</Button>))
}
</div>
<div className="date-item">
{
_.map(scopeBtns.slice(2, 6), o => (
<Button type={timeType === o.key ? "primary" : "ghost"} disabled={disabled}
onClick={() => onChange(getSalaryMonthValue(o.key), o.key)}>{o.label}</Button>))
}
</div>
<div className="date-item">
{
_.map(scopeBtns.slice(6), o => (
<Button type={timeType === o.key ? "primary" : "ghost"} disabled={disabled}
onClick={() => onChange(getSalaryMonthValue(o.key), o.key)}>{o.label}</Button>))
}
</div>
<div className="data-picker">
<span className="title" onClick={(val) => onChange([], 10)}>{getLabel(111, "指定月份")}</span>
<div
className={cs("rangePickerBox", { "hide-data-picker": timeType !== 10, "show-data-picker": timeType === 10 })}>
<WeaDatePicker
value={startDate} disabled={disabled}
disabledDate={(current) => {
return current && endDate && current.getTime() > new Date(endDate).getTime();
}}
format="YYYY-MM"
onChange={(val) => onChange([val, endDate], timeType)}
viewAttr={viewAttr}
/>
<span className="to" style={{ margin: "0 10px" }}></span>
<WeaDatePicker
value={endDate} disabled={disabled}
disabledDate={(current) => {
return current && startDate && current.getTime() < new Date(startDate).getTime();
}}
format="YYYY-MM"
viewAttr={viewAttr}
onChange={(val) => onChange([startDate, val], timeType)}
/>
</div>
</div>
</div>;
};
export const MonthRangePicker = (props) => {
const { dateRange, onChange, viewAttr, disabled = false } = props;
const [startDate, endDate] = dateRange || [];
@ -369,3 +435,48 @@ export const MonthRangePicker = (props) => {
/>
</div>;
};
// 获取所属月份值
export const getSalaryMonthValue = (dateType) => {
let start = "", end = "";
switch (dateType) {
case 1:
start = moment().add(-1, "month").startOf("month").format("YYYY-MM");
end = moment().add(-1, "month").endOf("month").format("YYYY-MM");
break;
case 2:
start = moment().startOf("month").format("YYYY-MM");
end = moment().endOf("month").format("YYYY-MM");
break;
case 3:
start = moment().year() + "-01";
end = moment().year() + "-03";
break;
case 4:
start = moment().year() + "-04";
end = moment().year() + "-06";
break;
case 5:
start = moment().year() + "-07";
end = moment().year() + "-09";
break;
case 6:
start = moment().year() + "-10";
end = moment().year() + "-12";
break;
case 7:
start = moment().startOf("year").format("YYYY-MM");
end = moment().endOf("year").subtract(6, "month").format("YYYY-MM");
break;
case 8:
start = moment().startOf("year").add(6, "month").format("YYYY-MM");
end = moment().endOf("year").format("YYYY-MM");
break;
case 9:
start = moment().startOf("year").format("YYYY-MM");
end = moment().endOf("year").format("YYYY-MM");
break;
default:
break;
}
return [start, end];
};

View File

@ -10,9 +10,10 @@ import { WeaLeftRightLayout, WeaLocaleProvider, WeaSelect, WeaTop } from "ecCom"
import { message, Modal } from "antd";
import LeftTab from "./components/leftTab";
import ReportContent from "./components/reportContent";
import StatisticalMicroSettingsSlide from "./components/statisticalMicroSettingsSlide";
import TopBtns from "./components/topBtns";
import StatisticalMicroSettingsSlide, { getSalaryMonthValue } from "./components/statisticalMicroSettingsSlide";
import { reportGetForm, reportStatisticsReportSave } from "../../apis/ruleconfig";
import { convertToUrlString } from "../../util/url";
import TopBtns from "./components/topBtns";
import "./index.less";
@ -92,8 +93,13 @@ class Index extends Component {
*/
exportData = () => {
const { report } = this.state;
const { id, dimensionId, isShare } = report;
window.open(`${window.location.origin}/api/bs/hrmsalary/report/statistics/report/exportData?id=${id}&dimensionId=${dimensionId}&isShare=${isShare}`, "_blank");
const { id, dimensionId, isShare, timeType, salaryEndMonth: end, salaryStartMonth: start } = report;
const [salaryStartMonth, salaryEndMonth] = getSalaryMonthValue(timeType);
const payload = {
id, dimensionId, isShare,
salaryStartMonth: (salaryStartMonth || start) + "-01", salaryEndMonth: (salaryEndMonth || end) + "-01"
};
window.open(`${window.location.origin}/api/bs/hrmsalary/report/statistics/report/exportData?${convertToUrlString(payload)}`, "_blank");
};
render() {
@ -113,7 +119,7 @@ class Index extends Component {
ref={dom => this.leftTabRef = dom}
onChangeTab={report =>
this.setState({
report,
report: !_.isNil(report) ? report : this.state.report,
statisticalPayload: { visible: false, id: "", dimension: "" }
})}
/>
@ -152,7 +158,7 @@ class Index extends Component {
taxAgentAdminOption={taxAgentOption} isShare={isShare}
onClose={(isRefresh) => this.setState({
statisticalPayload: { visible: false, id: "", dimension: "" }
}, () => isRefresh && this.reportRef.reportStatisticsReportGetData(report.id, report.dimensionId, report.isShare))}
}, () => isRefresh && this.leftTabRef.reportStatisticsReportList())}
/>
</div>
</div>

View File

@ -304,6 +304,36 @@
display: flex;
align-items: center;
}
.date-set-area {
.date-item {
margin-bottom: 5px;
button {
margin-right: 10px;
}
}
.data-picker {
display: flex;
align-items: center;
.title {
color: #5d9cec;
cursor: pointer;
font-size: 12px;
margin-right: 10px;
}
.show-data-picker {
display: flex;
}
.hide-data-picker {
display: none !important;
}
}
}
}
//新建自定义统计项目

View File

@ -59,7 +59,7 @@ export default class SalaryItemChangeList extends React.Component {
// 获取Columns
getColumns = () => {
const { salaryFileStore: { singleSalaryItemList }, selectedKey } = this.props;
const { salaryFileStore: { singleSalaryItemList }, selectedKey, showOperateBtn } = this.props;
let columns = [];
if (singleSalaryItemList.columns) {
columns = _.map([...singleSalaryItemList.columns], o => {
@ -83,7 +83,7 @@ export default class SalaryItemChangeList extends React.Component {
}
return { ...o, width, render: text => (<span title={text}>{text}</span>) };
});
if (selectedKey === "fixed") {
if (showOperateBtn && selectedKey === "fixed") {
columns = [...columns, {
dataIndex: "operate", fixed: "right", width: 120, title: "操作",
render: (text, record) => {

View File

@ -80,7 +80,8 @@ export default class SalaryFileViewSlide extends React.Component {
salaryFileStore: { detailForm, adjustSalaryItems, setAdjustSalaryItems },
selectedKey,
handleSetpay,
paysetParams
paysetParams,
showOperateBtn
} = this.props;
const { baseInfo } = detailForm;
const items = [
@ -189,7 +190,7 @@ export default class SalaryFileViewSlide extends React.Component {
>
{
this.state.selectedTab === "0" ?
<SalaryItemChangeList id={this.props.id} selectedKey={selectedKey}/> :
<SalaryItemChangeList id={this.props.id} selectedKey={selectedKey} showOperateBtn={showOperateBtn}/> :
<TaxAgentChangeList id={this.props.id}/>
}
</WeaSearchGroup>

View File

@ -226,8 +226,7 @@ export default class SalaryItem extends React.Component {
const menu = (
<Menu onClick={handleMenuClick}>
<Menu.Item key="1">系统薪资项</Menu.Item>
<Menu.Item key="2">自定义薪资项</Menu.Item>
<Menu.Item key="2">{getLabel(111, "新增自定义薪资项")}</Menu.Item>
</Menu>
);
@ -236,7 +235,8 @@ export default class SalaryItem extends React.Component {
return (<div style={{ display: "inline-block" }}>
{
(showOperateBtn || showSalaryItemBtn) &&
<Dropdown.Button overlay={menu} type="primary" style={{ marginRight: "10px" }}>新增</Dropdown.Button>
<Dropdown.Button overlay={menu} type="primary" onClick={() => handleMenuClick({ key: "1" })}
style={{ marginRight: "10px" }}>{getLabel(111, "新增系统薪资项")}</Dropdown.Button>
}
{
(showOperateBtn || showSalaryItemBtn) &&

View File

@ -1,3 +1,10 @@
import { WeaSwitch } from "comsMobx";
import { Button } from "antd";
import { WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
export const tabCondition = [
{
color: "#000000",
@ -33,5 +40,99 @@ export const tabCondition = [
showcount: true,
title: "非系统人员",
viewcondition: "ext"
},
}
];
export const logConditions = [
{
items: [
{
colSpan: 1,
conditionType: "BROWSER",
browserConditionParam: {
completeParams: {},
conditionDataParams: {},
dataParams: {},
destDataParams: {},
hasAddBtn: false,
hasAdvanceSerach: true,
idSeparator: ",",
isAutoComplete: 1,
isDetail: 0,
isMultCheckbox: false,
isSingle: true,
linkUrl: "/hrm/resource/HrmResource.jsp?id=",
pageSize: 10,
quickSearchName: "",
replaceDatas: [],
title: "",
type: "1"
},
domkey: ["employeeId"],
fieldcol: 17,
label: "对象",
lanId: 106,
labelcol: 7,
value: ""
},
{
colSpan: 1,
conditionType: "BROWSER",
browserConditionParam: {
completeParams: {},
conditionDataParams: {},
dataParams: {},
destDataParams: {},
hasAddBtn: false,
hasAdvanceSerach: true,
idSeparator: ",",
isAutoComplete: 1,
isDetail: 0,
isMultCheckbox: false,
isSingle: true,
linkUrl: "/hrm/resource/HrmResource.jsp?id=",
pageSize: 10,
quickSearchName: "",
replaceDatas: [],
title: "",
type: "1"
},
domkey: ["operator"],
fieldcol: 17,
label: "操作人",
lanId: 111,
labelcol: 7,
value: ""
}
],
defaultshow: true
}
];
export const getLogSearchsForm = (form, condition, onSearch = () => void (0)) => {
const { isFormInit } = form;
const formParams = form.getFormParams();
let group = [];
isFormInit && condition && condition.map(c => {
let items = [];
c.items.map(fields => {
items.push({
com: (
<WeaFormItem
label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
tipPosition="bottom"
>
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams}/>
{
getKey(fields) === "operator" &&
<Button type="primary" onClick={onSearch} style={{ position: "absolute", right: "-70px", top: "0" }}>{getLabel(388113, "搜索")}</Button>
}
</WeaFormItem>),
colSpan: 1
});
});
group.push(
<WeaSearchGroup col={4} needTigger={true} title={c.title} showGroup={c.defaultshow} items={items} center={false}
/>);
});
return group;
};

View File

@ -17,6 +17,7 @@ import UnifiedTable from "../../../components/UnifiedTable";
import { convertToUrlString, getURLParameters } from "../../../util/url";
import { salaryArchiveDelete } from "../../../apis/payrollFiles";
import ImportDialog from "../../../components/importDialog";
import OperateLogDialog from "./operateLogDialog";
import "./index.less";
import { sysinfo } from "../../../apis/ruleconfig";
@ -66,7 +67,8 @@ export default class Archives extends React.Component {
link: "", importResult: {}, imageId: "",
previewUrl: "/api/bs/hrmsalary/scheme/preview"
},
extEmpsWitch: "1" //非系统人员开关, 1 开启, 0关闭
extEmpsWitch: "1", //非系统人员开关, 1 开启, 0关闭
logDialog: { visible: false }
};
this.record = {};
}
@ -627,7 +629,8 @@ export default class Archives extends React.Component {
tabCount,
loading,
importDialog,
extEmpsWitch
extEmpsWitch,
logDialog
} = this.state;
const {
form, condition, showSearchAd, setShowSearchAd,
@ -814,10 +817,15 @@ export default class Archives extends React.Component {
return (
<div className="mySalaryBenefitsWrapper">
<WeaTop
title="社保福利档案" // 文字
icon={<i className="icon-coms-fa"/>} // 左侧图标
iconBgcolor="#F14A2D" // 左侧图标背景色
showDropIcon={false} // 是否显示下拉按钮
title="社保福利档案" icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D" showDropIcon={true}
dropMenuDatas={[
{
key: "log",
icon: <i className="iconfont icon-caozuorizhi32"/>,
content: getLabel(111, "操作日志"),
onClick: key => this.setState({ logDialog: { ...logDialog, visible: true } })
}
]}
>
<WeaTab
datas={(extEmpsWitch === "0" || !extEmpsWitch) ? _.dropRight(tabCondition) : tabCondition}
@ -866,6 +874,10 @@ export default class Archives extends React.Component {
</WeaNewScroll>
</div>
</WeaTop>
{/*操作日志*/}
<OperateLogDialog {...logDialog}
onCancel={() => this.setState({ logDialog: { ...logDialog, visible: false } })}
/>
{
this.state.editSlideVisible &&
<WeaSlideModal

View File

@ -85,3 +85,36 @@
}
}
}
//重构-社保福利档案
.logDialog {
.wea-dialog-body {
overflow-y: hidden;
}
.logDialogContent {
background: #F6F6F6;
padding: 16px;
width: 100%;
height: 100%;
.wea-search-group {
padding: 0;
margin-bottom: 10px;
background: #FFF;
.wea-form-cell {
padding: 0;
.wea-form-item {
padding: 10px;
}
}
}
.logTable {
background: #FFFFFF;
}
}
}

View File

@ -0,0 +1,117 @@
/*
* Author: 黎永顺
* name: 社保福利档案-操作日志
* Description:
* Date: 2023/10/23
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaDialog, WeaLocaleProvider, WeaTable } from "ecCom";
import { getAdjustHistoryList } from "../../../../apis/archive";
import { getLogSearchsForm, logConditions } from "../config";
import moment from "moment";
const getLabel = WeaLocaleProvider.getLabel;
@inject("archivesStore")
@observer
class Index extends Component {
constructor(props) {
super(props);
this.state = {
dataSource: [], columns: [], pageInfo: { current: 0, pageSize: 10, total: 0 },
loading: false, conditions: []
};
}
componentDidMount() {
const { archivesStore: { logForm } } = this.props;
this.setState({
conditions: _.map(logConditions, it => ({
...it, items: _.map(it.items, o => ({ ...o, label: getLabel(o.lanId, o.label) }))
}))
}, () => logForm.initFormFields(this.state.conditions));
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) this.getAdjustHistoryList();
if (nextProps.visible !== this.props.visible && !nextProps.visible) {
this.setState({
dataSource: [], columns: [], pageInfo: { current: 0, pageSize: 10, total: 0 },
loading: false
});
}
}
getAdjustHistoryList = (extra = {}) => {
const { pageInfo } = this.state;
const { archivesStore: { logForm } } = this.props;
const payload = { ...pageInfo, ...logForm.getFormParams(), ...extra };
this.setState({ loading: true });
getAdjustHistoryList(payload).then(({ status, data }) => {
this.setState({ loading: false });
if (status) {
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
this.setState({
pageInfo: { ...pageInfo, current, pageSize, total },
dataSource, columns: _.map(columns, it => {
if (it.dataIndex === "operateTime") {
return { ...it, render: (text) => (<span>{moment(text).format("YYYY-MM-DD")}</span>) };
}
return { ...it };
})
});
}
}).catch(() => this.setState({ loading: false }));
};
render() {
const { loading, dataSource, columns, pageInfo, conditions } = this.state;
const { archivesStore: { logForm } } = this.props;
const pagination = {
...pageInfo,
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
showQuickJumper: true,
showSizeChanger: true,
pageSizeOptions: ["10", "20", "50", "100"],
onShowSizeChange: (current, pageSize) => {
this.setState({
pageInfo: { ...pageInfo, current, pageSize }
}, () => this.getAdjustHistoryList());
},
onChange: current => {
this.setState({
pageInfo: { ...pageInfo, current }
}, () => this.getAdjustHistoryList());
}
};
const scrollHeight = this.logRef ? this.logRef.state.height - 210 : 606.6;
return (
<WeaDialog
{...this.props} title={getLabel(111, "操作日志")}
ref={dom => this.logRef = dom} className="logDialog" initLoadCss
style={{
width: 1150,
height: 606.6,
minHeight: 200,
minWidth: 380,
maxHeight: "90%",
maxWidth: "90%",
overflow: "hidden",
transform: "translate(0px, 0px)"
}}
>
<div className="logDialogContent">
{getLogSearchsForm(logForm, conditions, () => this.getAdjustHistoryList({ current: 1 }))}
<WeaTable
columns={columns} dataSource={dataSource}
loading={loading} className="logTable"
pagination={pagination} scroll={{ y: `${scrollHeight}px` }}
/>
</div>
</WeaDialog>
);
}
}
export default Index;

View File

@ -434,8 +434,8 @@ export default class Programme extends React.Component {
visible={this.state.slideVisiable}
top={0}
measureT="%"
width={800}
measureX="px"
width={100}
measureX="%"
height={100}
measureY="%"
direction={"right"}

View File

@ -19,7 +19,7 @@ class InputPaymentAmount extends Component {
render: (text, record) => {
return (
<WeaInputNumber
value={record[`${record.insuranceId}_per`]} min={0}
value={record[`${record.insuranceId}_per`]}
precision={2} onChange={(val) => this.handleChangeBaseItem(record, val, type, "per")}
/>
);
@ -30,7 +30,7 @@ class InputPaymentAmount extends Component {
render: (text, record) => {
return (
<WeaInputNumber
value={record[`${record.insuranceId}_com`]} min={0}
value={record[`${record.insuranceId}_com`]}
precision={2} onChange={(val) => this.handleChangeBaseItem(record, val, type, "com")}
/>
);

View File

@ -8,6 +8,13 @@ import * as API from "../apis/welfareArchive"; // 引入API接口文件
const { TableStore } = WeaTableNew;
export class ArchivesStore {
@observable logForm = new WeaForm(); // 社保福利档案重构-日志查询条件log
@observable tableStore = new TableStore(
// {dataHandle: (datas) => {
// return dataSource;

View File

@ -14,6 +14,9 @@ export class AttendanceStore {
@observable shareForm = new WeaForm();
@observable shareLogForm = new WeaForm();
@observable sharePerForm = new WeaForm();
@observable extensionForm = new WeaForm(); //扩展属性
@action("报表查看-扩展属性表单初始化")
initExtensionForm = () => this.extensionForm = new WeaForm();
@action("报表查看-分享报表表单初始化")
initShareForm = () => this.shareForm = new WeaForm();

View File

@ -14,6 +14,7 @@ export class CumDeductStore {
@observable slideTableStore = new TableStore();
@observable form = new WeaForm(); // new 一个form
@observable addForm = new WeaForm(); // 新增form
@action initAddForm = () => this.addForm = new WeaForm(); // 初始化新增form
@observable condition = []; // 存储后台得到的form数据
@observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据
@observable showSearchAd = false; // 高级搜索面板显示
@ -113,7 +114,7 @@ export class CumDeductStore {
...requestParams,
current: this.pageObj.current,
pageSize: this.pageObj.pageSize,
...params,
...params
};
API.getCumDeductList(requestParams).then(
action(({ status, data, errormsg }) => {

View File

@ -12,6 +12,7 @@ export class CumSituationStore {
@observable slideTableStore = new TableStore();
@observable form = new WeaForm(); // new 一个form
@observable addForm = new WeaForm(); // 新增form
@action initAddForm = () => this.addForm = new WeaForm();
@observable condition = []; // 存储后台得到的form数据
@observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据
@observable showSearchAd = false; // 高级搜索面板显示

View File

@ -1,4 +1,4 @@
import { observable, action, toJS } from "mobx";
import { action, observable } from "mobx";
import { message } from "antd";
import { WeaForm, WeaTableNew } from "comsMobx";
import { removePropertyCondition } from "../util/response";
@ -12,6 +12,7 @@ export class OtherDeductStore {
@observable slideTableStore = new TableStore();
@observable form = new WeaForm(); // new 一个form
@observable addForm = new WeaForm(); // 新增form
@action initAddForm = () => this.addForm = new WeaForm();
@observable condition = []; // 存储后台得到的form数据
@observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据
@observable showSearchAd = false; // 高级搜索面板显示
@ -115,13 +116,13 @@ export class OtherDeductStore {
this.setPageObj({
total,
current,
pageSize,
pageSize
});
} else {
this.setDataSource([]);
this.setPageObj({
...this.pageObj,
total: 0,
total: 0
});
message.error(errormsg || "接口调用失败!");
}
@ -184,23 +185,23 @@ export class OtherDeductStore {
this.setSlidePageObj({
total,
current,
pageSize,
pageSize
});
} else {
this.setSlideTableDataSource([]);
this.setSlidePageObj({
...this.slidePageObj,
total: 0,
total: 0
});
message.error(errormsg || "接口调用失败!");
}
this.slideLoading = false
this.slideLoading = false;
}
);
};
// 导出明细
@action exportOtherDeductDetailList = (id, ids = "", taxAgentId="") => {
@action exportOtherDeductDetailList = (id, ids = "", taxAgentId = "") => {
API.exportOtherDeductDetailList(id, ids, taxAgentId);
};
}

View File

@ -1,7 +1,8 @@
import { observable, action, toJS } from 'mobx';
import { WeaForm } from 'comsMobx';
import { action, observable } from "mobx";
import { WeaForm } from "comsMobx";
export class SpecialAddStore {
@observable advanceForm = new WeaForm();
@observable addForm = new WeaForm();
@action initAddForm = () => this.addForm = new WeaForm();
}

View File

@ -51,7 +51,7 @@ export const getSearchs = (form, condition, col, isCenter, onChange = () => void
});
group.push(
<WeaSearchGroup
col={col || 1} // 高级搜索列布局列数
col={col || c.col || 1} // 高级搜索列布局列数
needTigger={true} // 是否开启收缩
title={c.title || title} // 高级搜索标题
showGroup={c.defaultshow} // 是否开启面板
@ -123,7 +123,7 @@ export const printDom = (printParams) => {
}
};
export const getDomkes = (conditions) => {
return _.map(conditions[0].items, it => it.domkey[0]);
return _.reduce(conditions, (pre, cur) => ([...pre, ..._.map(cur.items, o => o.domkey[0])]), []);
};
export const padding0 = (num, length) => {