diff --git a/pc4mobx/hrmSalary/apis/statistics.js b/pc4mobx/hrmSalary/apis/statistics.js
index 929f41b9..9f2aa6d4 100644
--- a/pc4mobx/hrmSalary/apis/statistics.js
+++ b/pc4mobx/hrmSalary/apis/statistics.js
@@ -142,6 +142,10 @@ export const savePageListSetting = (params) => {
export const savePageListTemplate = (params) => {
return postFetch("/api/bs/hrmsalary/common/pageList/template/save", params);
};
+// 薪酬统计报表-导出模板示例下载
+export const downloadPageListTemplate = (params) => {
+ return postExportFetch("/api/bs/hrmsalary/common/pageList/template/file/download", params);
+};
//薪酬统计报表-获取页面模板
export const getPageListTemplatelist = (params) => {
return postFetch("/api/bs/hrmsalary/common/pageList/template/list", params);
@@ -150,3 +154,7 @@ export const getPageListTemplatelist = (params) => {
export const changePageListTemplate = (params) => {
return postFetch("/api/bs/hrmsalary/common/pageList/template/change", params);
};
+//薪酬统计报表-删除模板
+export const deleteTemplatePageList = (params) => {
+ return postFetch("/api/bs/hrmsalary/common/pageList/template/delete", params);
+};
diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js
index a77e6e4d..d8a69b3e 100644
--- a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js
+++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js
@@ -75,9 +75,9 @@ class CustomBrowserMutiRight extends Component {
const targetNode = obj.node.props.eventKey;
const result = [];
this.nodeIds.filter((item) => {
- return dragNodes.indexOf(item) === -1;
+ return dragNodes.indexOf(String(item)) === -1;
}).forEach((id) => {
- if (id === targetNode) {
+ if (String(id) === targetNode) {
dragNodes.forEach((drag) => {
result.push(this.nodeObj[drag]);
});
diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js
index 94aaad3f..5714241e 100644
--- a/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js
+++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js
@@ -8,7 +8,7 @@
* @description:
*/
import React, { Component } from "react";
-import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaNewScroll } from "ecCom";
+import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaNewScroll, WeaTable } from "ecCom";
import { Button, Col, Row, Spin } from "antd";
import CustomBrowserMutiLeft from "./customBrowserMutiLeft";
import CustomBrowserMutiRight from "./customBrowserMutiRight";
@@ -22,8 +22,8 @@ class CustomTransferDialog extends Component {
constructor(props) {
super(props);
this.state = {
- loading: false, listDatas: [],
- query: { [props.searchParamsKey]: "" },
+ loading: false, listDatas: [], columns: [], selectedRowKeys: [], pageInfo: { current: 1, pageSize: 10, total: 0 },
+ query: props.searchParamsKey ? { [props.searchParamsKey]: "" } : {},
leftListSelectedKeys: [], // 左侧table选择的keys
leftListSelectedData: [], // 左侧table选择的数据
rightCheckedKeys: [], //右侧选择的keys
@@ -42,24 +42,27 @@ class CustomTransferDialog extends Component {
}
} else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
this.setState({
- query: { [this.props.searchParamsKey]: "" },
- rightDatas: [], rightCheckedKeys: [], leftListSelectedData: [], leftListSelectedKeys: []
+ query: { [this.props.searchParamsKey]: "" }, selectedRowKeys: [],
+ rightDatas: [], rightCheckedKeys: [], leftListSelectedData: [], leftListSelectedKeys: [],
+ pageInfo: { current: 1, pageSize: 10, total: 0 }
});
this.selectedData = {};
}
}
getData = (init = false, props) => {
- const { query } = this.state;
- const { completeURL, convertDatasource, dataParams = {} } = props || this.props;
+ const { query, pageInfo } = this.state;
+ const { completeURL, convertDatasource, dataParams = {}, dialogType } = props || this.props;
let payload = { ...dataParams, ...query };
+ dialogType === "table" && (payload = { ...payload, ...pageInfo });
this.setState({ loading: true });
postFetch(completeURL, payload).then(({ status, data }) => {
this.setState({ loading: false });
if (status && data.list) {
const { pageNum: current, pageSize, total } = data;
this.setState({
- listDatas: convertDatasource ? convertDatasource(data.list) : data.list
+ listDatas: convertDatasource ? convertDatasource(data.list) : data.list, columns: data.columns,
+ pageInfo: { ...pageInfo, current, pageSize, total }
});
} else {
this.setState({
@@ -132,18 +135,23 @@ class CustomTransferDialog extends Component {
};
renderTitle = () => {
return (
-
{getLabel(111, "数据选择")}
-
+
{this.props.title || getLabel(111, "数据选择")}
+
{this.props.titleOptsComs}
);
};
render() {
- const { loading, listDatas, query, leftListSelectedKeys, rightDatas, rightCheckedKeys } = this.state;
- const { searchParamsKey, saveLoading } = this.props;
- const buttons = [
- ,
- ];
+ const {
+ loading, listDatas, query, leftListSelectedKeys, rightDatas, rightCheckedKeys, pageInfo, selectedRowKeys,
+ columns
+ } = this.state;
+ const {
+ searchParamsKey, saveLoading, dialogType = "", rowKey, tableOpts = {}, buttons = [
+ ,
+
+ ]
+ } = this.props;
let rightActive = false, leftActive = false, rightAllActive = false;
if (leftListSelectedKeys && leftListSelectedKeys.length > 0) rightActive = true;
if (rightCheckedKeys && rightCheckedKeys.length > 0) leftActive = true;
@@ -188,15 +196,45 @@ class CustomTransferDialog extends Component {
data={rightDatas} checkedKeys={rightCheckedKeys}
checkedCb={rightCheckedKeys => this.setState({ rightCheckedKeys })}
onDoubleClick={this.onRightDoubleClick}
- onDrag={(data) => {this.setState({rightDatas: data})}}
+ onDrag={(data) => {
+ this.setState({ rightDatas: data });
+ }}
/>
;
+ if (dialogType === "table") {
+ const sheight = this.dialog ? this.dialog.state.height - 156 : 260;
+ 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.getData());
+ },
+ onChange: current => {
+ this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getData());
+ }
+ };
+ const rowSelection = {
+ selectedRowKeys,
+ onChange: selectedRowKeys => this.setState({ selectedRowKeys }, () => this.props.onSelect(selectedRowKeys))
+ };
+ dom =
+ {this.props.children}
+
+
;
+ }
return (
this.dialog = dom} title={this.renderTitle()}
- className="custom_browser_dialog" draggable={false} style={{
+ className="custom_browser_dialog" draggable={true} style={{
width: 784, height: 460, minHeight: 200, minWidth: 380,
maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
}} buttons={buttons}>{dom}
diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/index.less b/pc4mobx/hrmSalary/components/CustomBrowser/index.less
index d4d61a16..e49d982a 100644
--- a/pc4mobx/hrmSalary/components/CustomBrowser/index.less
+++ b/pc4mobx/hrmSalary/components/CustomBrowser/index.less
@@ -3,6 +3,20 @@
display: flex;
justify-content: space-between;
align-items: center;
+
+ .wea-select, .ant-select-selection, .ant-select {
+ width: 100%;
+ }
+
+ .wea-select {
+ display: inline-block;
+ position: relative;
+ }
+
+ .ant-select-selection {
+ height: 30px;
+ border-radius: 0;
+ }
}
.wea-hr-muti-input-table {
@@ -10,6 +24,19 @@
padding: 8px 16px;
height: 100%;
+ .table_opts {
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+ width: 100%;
+ height: 40px;
+ background: #FFF;
+
+ .wea-button-icon {
+ margin-right: 10px;
+ }
+ }
+
.wea-new-table {
background: #FFF;
}
diff --git a/pc4mobx/hrmSalary/components/FormInfo/index.js b/pc4mobx/hrmSalary/components/FormInfo/index.js
new file mode 100644
index 00000000..d6940489
--- /dev/null
+++ b/pc4mobx/hrmSalary/components/FormInfo/index.js
@@ -0,0 +1,98 @@
+import React, { Component } from "react";
+import { WeaCheckbox, WeaFormItem, WeaLocaleProvider, WeaSearchGroup } from "ecCom";
+import { observer } from "mobx-react";
+import { WeaSwitch } from "comsMobx";
+
+const getLabel = WeaLocaleProvider.getLabel;
+@observer
+export default class FormInfo extends Component {
+ renderForm = () => {
+ const {
+ formFields, form, colCount, itemRender, onSelectedChangeHandle, showLabel, multiColumn, custLabelCol,
+ childrenComponents
+ } = this.props;
+
+ let groupArr = [];
+ const formParams = form.getFormParams();
+ const labelVisible = showLabel == null || showLabel == true;
+ const col = colCount ? colCount : 1;
+ const labelCol = labelVisible ? (custLabelCol || 6) : 0;
+ const itemProps = {
+ // ratio1to2: labelVisible && custLabelCol == null,
+ style: { marginLeft: 0 },
+ tipPosition: "bottom",
+ labelCol: { span: labelCol },
+ wrapperCol: { span: 22 - labelCol }
+ };
+ const textAreaProps = { minRows: 4, maxRows: 4 };
+
+ formFields.map((fields, i) => {
+ let formItems = [];
+ fields.items.map((field, j) => {
+ const customerRender = itemRender != null ? itemRender[field.domkey[0]] : null;
+ const showCheckbox = field.checkbox || false;
+ let label = getLabel(field.lanId, field.label);
+ if (showCheckbox)
+ label = {
+ field.checkboxValue = v === "1";
+ onSelectedChangeHandle && onSelectedChangeHandle(field, v);
+ }}/>;
+ let coms;
+ if (customerRender == null) {
+ coms = ;
+ } else {
+ coms = customerRender({
+ ...field, helpfulTip: getLabel(field.helpfulTipLanId || "", field.helpfulTip || "")
+ }, textAreaProps, form, formParams);
+ }
+ Object.assign(itemProps, { label, error: form.getError(field) });
+ let col = colCount ? colCount : 1;
+ if (multiColumn != null) {//检查有哪些字段需要一行显示多个
+ const idx = _.findIndex(multiColumn, item => item.key === field.domkey[0]);
+ if (idx > -1) {
+ col = field.colSpan || 1;
+ if (multiColumn[idx].labelCol != null)//检查字段是否有配置标题宽度
+ Object.assign(itemProps, {
+ labelCol: { span: multiColumn[idx].labelCol },
+ wrapperCol: { span: 24 - multiColumn[idx].labelCol }
+ });
+ } else {
+ Object.assign(itemProps, {
+ labelCol: { span: labelCol },
+ wrapperCol: { span: 24 - labelCol }
+ });
+ }
+ }
+ coms != null && formItems.push({
+ com: ({coms}),
+ col
+ });
+
+ if (childrenComponents && childrenComponents[field.domkey[0]]) {
+ childrenComponents[field.domkey[0]]().map(child => formItems.push(child));
+ }
+ });
+
+ groupArr.push();
+ });
+ return groupArr;
+ };
+
+ render() {
+ const { formFields, className, form } = this.props;
+ if (formFields == null || !form.isFormInit) return ();
+ return (
+ {this.renderForm()}
+ );
+ }
+}
diff --git a/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js b/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js
index b51b5a63..f4c62718 100644
--- a/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js
+++ b/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js
@@ -53,7 +53,7 @@ class PersonalScopeModal extends Component {
if (!_.isEmpty(nextProps.record)) {
this.setState({
targetType: nextProps.record.targetType,
- targetTypeIds: String(nextProps.record.targetId),
+ targetTypeIds: nextProps.record.targetType !== "SQL" ? String(nextProps.record.targetId) : nextProps.record.target,
targetTypeIdsNames: nextProps.record.targetName,
status: nextProps.record.status,
statusAll: ""
@@ -168,7 +168,7 @@ class PersonalScopeModal extends Component {
break;
case "SQL":
return
- this.setState({ targetTypeIds: val, targetTypeIdsNames: val })}/>
}/>
;
diff --git a/pc4mobx/hrmSalary/components/PersonalScopeTable/index.js b/pc4mobx/hrmSalary/components/PersonalScopeTable/index.js
index 5faaf8a9..d8824c8b 100644
--- a/pc4mobx/hrmSalary/components/PersonalScopeTable/index.js
+++ b/pc4mobx/hrmSalary/components/PersonalScopeTable/index.js
@@ -41,7 +41,7 @@ class PersonalScopeTable extends Component {
}
getPersonalScopeList = (tabActive = this.props.tabActive) => {
- const { searchValue, searchKeyVal, APIFox } = this.props;
+ const { searchValue, searchKeyVal, APIFox, showOperateBtn } = this.props;
const { pageInfo, loading } = this.state;
const payload = {
[searchKeyVal["key"]]: searchKeyVal["value"],
@@ -60,7 +60,7 @@ class PersonalScopeTable extends Component {
return {
...item,
render: (text, record) => {
- if (item.dataIndex === "targetName") {
+ if (item.dataIndex === "targetName" && showOperateBtn) {
return this.props.onEditScope(record)}>{text};
}
return {text};
diff --git a/pc4mobx/hrmSalary/components/excelEditor/extendCodeMirror.js b/pc4mobx/hrmSalary/components/excelEditor/extendCodeMirror.js
index e70c6967..32a5e5b0 100644
--- a/pc4mobx/hrmSalary/components/excelEditor/extendCodeMirror.js
+++ b/pc4mobx/hrmSalary/components/excelEditor/extendCodeMirror.js
@@ -18,8 +18,10 @@ CodeMirror.extendMode("javascript", {
if (this.jsonMode) {
return /^[\[,{]$/.test(content) || /^}/.test(textAfter) || /^]/.test(textAfter);
} else {
- if (content == ";" && state.lexical && state.lexical.type == ")") return false;
- return /^[;{}]$/.test(content) && !/^;/.test(textAfter);
+ if (content == ";" && state.lexical && state.lexical.type == "}") return false;
+ // if (content == ";" && state.lexical && state.lexical.type == ")") return false;
+ return /[=,]/.test(content) || /.*\)/.test(textAfter);
+ // return /^[;{}]$/.test(content) && !/^;/.test(textAfter);
}
}
});
@@ -94,7 +96,8 @@ CodeMirror.defineExtension("autoFormatRange", function (from, to) {
atSol = false;
}
if (!atSol && inner.mode.newlineAfterToken &&
- inner.mode.newlineAfterToken(style, cur, stream.string.slice(stream.pos) || text[i + 1] || "", inner.state))
+ // inner.mode.newlineAfterToken(style, cur, stream.string.slice(stream.pos) || text[i + 1] || "", inner.state))
+ inner.mode.newlineAfterToken(style, cur, stream.string.slice(stream.pos, stream.pos + 2) || text[i + 1] || "", inner.state))
newline();
}
if (!stream.pos && outer.blankLine) outer.blankLine(state);
diff --git a/pc4mobx/hrmSalary/components/pcTemplate/index.less b/pc4mobx/hrmSalary/components/pcTemplate/index.less
index e57fe5e5..4f834426 100644
--- a/pc4mobx/hrmSalary/components/pcTemplate/index.less
+++ b/pc4mobx/hrmSalary/components/pcTemplate/index.less
@@ -82,6 +82,8 @@
}
.data-detail {
+ padding-bottom: 16px;
+
.salary-group {
background: #FFF;
diff --git a/pc4mobx/hrmSalary/layout.js b/pc4mobx/hrmSalary/layout.js
index 39c9d174..a4919d5d 100644
--- a/pc4mobx/hrmSalary/layout.js
+++ b/pc4mobx/hrmSalary/layout.js
@@ -22,6 +22,8 @@ class Layout extends Component {
componentWillReceiveProps(nextProps, nextContext) {
if (window.e9LibsConfigCustomF && _.some(window.e9LibsConfigCustomF, o => (_.some(o, k => k === "h_hrmSalary")))) {
+ stores.baseFormStore.initForm();
+ stores.baseFormStore.initFormExtra();
if (window.location.hash.indexOf("payroll") !== -1) {
window.localStorage.removeItem("template-basedata");
window.localStorage.removeItem("salary-showset");
diff --git a/pc4mobx/hrmSalary/pages/adjustSalaryManage/index.js b/pc4mobx/hrmSalary/pages/adjustSalaryManage/index.js
index d1fd2bb9..a58245c7 100644
--- a/pc4mobx/hrmSalary/pages/adjustSalaryManage/index.js
+++ b/pc4mobx/hrmSalary/pages/adjustSalaryManage/index.js
@@ -46,8 +46,8 @@ class Index extends Component {
const payload = {
...pageInfo, ...extra,
departmentIds: departmentIds ? departmentIds.split(",") : [],
- positionIds: departmentIds ? departmentIds.split(",") : [],
- operatorIds: departmentIds ? departmentIds.split(",") : [],
+ positionIds: positionIds ? positionIds.split(",") : [],
+ operatorIds: operatorIds ? operatorIds.split(",") : [],
effectiveTime: effectiveTime1 ? [effectiveTime1, effectiveTime2] : [],
operateTime: operateTime1 ? [operateTime1, operateTime2] : []
};
diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js
index 924662b3..63108170 100644
--- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js
+++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js
@@ -232,6 +232,25 @@ export const tempCondition = [
rules: "required|string",
viewAttr: 3
},
+ {
+ conditionType: "UPLOAD",
+ domkey: ["fileId"],
+ fieldcol: 14,
+ label: "导出模板",
+ lanId: 111,
+ labelcol: 6,
+ value: "",
+ datas: [],
+ multiSelection: false,
+ showClearAll: false,
+ showListBottom: true,
+ showListTop: true,
+ maxFilesNumber: 1,
+ limitType: "xlsx",
+ uploadUrl: "/api/doc/upload/uploadFile",
+ category: "111",
+ viewAttr: 2
+ },
{
conditionType: "SELECT",
domkey: ["sharedType"],
diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js
index cbc72a7c..e791e76e 100644
--- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js
+++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js
@@ -5,15 +5,15 @@
* Date: 2024/3/26
*/
import React, { Component } from "react";
-import { toJS } from "mobx";
import { inject, observer } from "mobx-react";
import { WeaTableNew } from "comsMobx";
import { WeaLoadingGlobal, WeaLocaleProvider, WeaSelect } from "ecCom";
-import { message, Spin } from "antd";
+import { Button, message, Modal, Spin } from "antd";
import { getIframeParentHeight } from "../../../util";
import { sysConfCodeRule } from "../../../apis/ruleconfig";
import CustomTransferDialog from "../../../components/CustomBrowser/components/customTransferDialog";
import SalaryDetailsTempDialog from "./salaryDetailsTempDialog";
+import SalaryTempMangerDialog from "./salaryTempMangerDialog";
import { MonthRangePicker } from "../../reportView/components/statisticalMicroSettingsSlide";
import AdvanceInputBtn from "../components/advanceInputBtn";
import SearchPannel from "../components/searchPannel";
@@ -31,29 +31,29 @@ class SalaryDetails extends Component {
super(props);
this.state = {
loading: false, dataSource: [], columns: [], selectedRowKeys: [], tempPageList: [], sumRow: {},
- pageInfo: { current: 1, pageSize: 10, total: 0 }, payload: {}, templateId: "",
- showTotalCell: false, updateSum: true, tempDialog: { visible: false, setting: [], id: "", template: {} },
+ pageInfo: { current: 1, pageSize: 10, total: 0 }, payload: {}, templateId: "", tempManageQuery: false,
+ showTotalCell: false, updateSum: true,
+ tempDialog: { visible: false, setting: [], heads: [], id: "", template: {} },
transferDialog: {
- visible: false, searchParamsKey: "name", dataParams: { page: "salary_details_report" }, saveLoading: false,
+ visible: false, searchParamsKey: "name", saveLoading: false,
+ dataParams: { page: "salary_details_report" },
completeURL: "", convertDatasource: datas => {
return {
listDatas: _.map(datas.setting, o => ({ id: o.id || o.column, name: o.name || o.text })),
- checked: this.converCheckedCol(datas)
+ checked: converCheckedCol(datas)
};
},
- type: "default"
+ dialogType: "temp"
+ },
+ tempManageDialog: { //模板管理
+ visible: false, completeURL: "", dialogType: "table", dataParams: { page: "salary_details_report" }
}
};
}
async componentDidMount() {
const [{ data: confCode }] = await Promise.all([sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" })]);
- this.setState({
- showTotalCell: confCode === "1"
- }, () => {
- this.getSalaryList(this.props);
- this.getPageListTemplatelist();
- });
+ this.setState({ showTotalCell: confCode === "1" });
window.addEventListener("message", this.handleReceive, false);
window.addEventListener("resize", () => this.forceUpdate(), false);
}
@@ -75,8 +75,7 @@ class SalaryDetails extends Component {
if (status) {
this.setState({
tempPageList: _.map(data, o => ({ ...o, key: String(o.id), showname: o.name })),
- templateId: !_.isEmpty(_.find(data, o => !!o.checked)) ? String(_.find(data, o => !!o.checked).id) : "",
- transferDialog: { ...this.state.transferDialog, visible: false, type: "default" }
+ templateId: !_.isEmpty(_.find(data, o => !!o.checked)) ? String(_.find(data, o => !!o.checked).id) : ""
});
}
});
@@ -85,13 +84,13 @@ class SalaryDetails extends Component {
const { type, payload: { id, params } = {} } = data;
const { pageInfo } = this.state;
if (type === "init") {
- this.getColumns();
+ // this.getColumns();
+ this.getSalaryList(this.props);
} else if (type === "turn") {
if (id === "PAGEINFO") {
const { pageNum: current, size: pageSize } = params;
this.setState({
- pageInfo: { ...pageInfo, current, pageSize },
- updateSum: false
+ pageInfo: { ...pageInfo, current, pageSize }, updateSum: false
}, () => this.getSalaryList(this.props));
} else if (id === "CHECKBOX") {
const { selectedRowKeys: checkBox } = params;
@@ -127,20 +126,24 @@ class SalaryDetails extends Component {
const { list: dataSource, pageNum: current, total, pageSize } = pageparams;
this.setState({
columns, dataSource, pageInfo: { ...pageInfo, current, total, pageSize }, payload
- }, () => tableStore.getDatas(dataKey.datas));
+ }, () => {
+ // tableStore.getDatas(dataKey.datas)
+ this.getColumns();
+ });
}
}).catch(() => this.setState({ loading: false }));
};
getSalaryListSum = (payload) => {
API.getSalaryListSum(payload).then(({ status, data }) => {
- if (status) this.setState({ sumRow: data.sumRow });
+ if (status) this.setState({ sumRow: data.sumRow }, () => this.getColumns());
});
};
handleExportSalaryList = (key) => {
- const { attendanceStore: { tableStore }, salaryDetailShowType } = this.props;
+ // const { attendanceStore: { tableStore }, salaryDetailShowType } = this.props;
let { selectedRowKeys, payload, columns: tempCols } = this.state;
- const customCols = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes");
- const columns = salaryDetailShowType === "1" ? _.filter(tempCols, o => o.column !== "acctTimes") : customCols;
+ // const customCols = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes");
+ // const columns = salaryDetailShowType === "1" ? _.filter(tempCols, o => o.column !== "acctTimes") : customCols;
+ const columns = _.filter(tempCols, o => o.column !== "acctTimes");
if (key === "SELECTED" && selectedRowKeys.length === 0) {
message.warning(getLabel(543345, "请选择需要导出的数据!"));
return;
@@ -151,12 +154,13 @@ class SalaryDetails extends Component {
});
};
getColumns = () => {
- const { attendanceStore: { tableStore }, salaryDetailShowType } = this.props;
+ // const { attendanceStore: { tableStore }, salaryDetailShowType } = this.props;
const {
- columns: tempCols, dataSource, pageInfo, selectedRowKeys, showTotalCell, sumRow, transferDialog
+ columns: tempCols, dataSource, pageInfo, selectedRowKeys, showTotalCell, sumRow
} = this.state;
- const customCols = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes");
- const columns = salaryDetailShowType === "1" ? _.filter(tempCols, o => o.column !== "acctTimes") : customCols;
+ // const customCols = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes");
+ // const columns = salaryDetailShowType === "1" ? _.filter(tempCols, o => o.column !== "acctTimes") : customCols;
+ const columns = _.filter(tempCols, o => o.column !== "acctTimes");
if (!_.isEmpty(columns)) {
this.postMessageToChild({
dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, tableScrollHeight: 154, sumRow,
@@ -170,30 +174,17 @@ class SalaryDetails extends Component {
}
return [];
};
- handleSetDefCols = () => this.setState({
+ handleSetDefCols = (params = {}) => this.setState({
transferDialog: {
- ...this.state.transferDialog, completeURL: "/api/bs/hrmsalary/common/pageList/get/setting", visible: true,
- dataParams: { page: "salary_details_report" }
+ ...this.state.transferDialog, visible: true, dataParams: { ...this.state.transferDialog.dataParams, ...params },
+ completeURL: "/api/bs/hrmsalary/common/pageList/template/get", dialogType: "temp"
}
- });
- converCheckedCol = (data) => {
- return _.reduce(data.checked || [], (pre, cur) => {
- const item = _.find(data.setting, k => (k.id === cur) || (k.column === cur.column));
- if (!_.isEmpty(item)) return [...pre, { ...item, id: item.id || item.column, name: item.name || item.text }];
- return pre;
- }, []);
- };
+ }, () => this.getPageListTemplatelist());
+
savePageListSetting = (values) => {
- const { transferDialog, tempDialog } = this.state, { type } = transferDialog;
- if (type === "temp") {
- this.setState({
- tempDialog: { ...tempDialog, visible: true, setting: _.map(values, o => o.id) }
- });
- return;
- }
+ const { transferDialog } = this.state;
const payload = {
- page: "salary_details_report",
- setting: _.map(values, o => o.id)
+ ...transferDialog.dataParams, setting: _.map(values, o => o.id)
};
this.setState({ transferDialog: { ...this.state.transferDialog, saveLoading: true } });
API.savePageListSetting(payload).then(({ status, errormsg }) => {
@@ -201,57 +192,73 @@ class SalaryDetails extends Component {
if (status) {
message.success(getLabel(111, "操作成功!"));
this.setState({
- transferDialog: { ...this.state.transferDialog, visible: false, type: "default" }
+ transferDialog: { ...this.state.transferDialog, visible: false, dialogType: "temp" }
}, () => this.getSalaryList());
} else {
message.error(errormsg);
}
});
};
- handelAddTemp = (templateId) => {
- const { transferDialog, tempDialog, tempPageList } = this.state;
+ handelAddTemp = (templateId = "") => {
+ const { tempDialog, tempPageList } = this.state;
+ if (_.isEmpty(this.transferRef.state.rightDatas)) {
+ message.warning(getLabel(111, "请选择设置!"));
+ return;
+ }
this.setState({
- transferDialog: {
- ...transferDialog, visible: true, type: "temp",
- dataParams: { ...transferDialog.dataParams, id: templateId },
- completeURL: "/api/bs/hrmsalary/common/pageList/template/get"
- },
- tempDialog: { ...tempDialog, id: templateId, template: _.find(tempPageList, o => o.key === templateId) }
+ tempDialog: {
+ ...tempDialog, visible: true, setting: _.map(this.transferRef.state.rightDatas, o => o.id),
+ heads: _.map(this.transferRef.state.rightDatas, o => o.name)
+ // template: _.find(tempPageList, o => o.key === templateId)
+ }
});
};
changePageListTemplate = (templateId) => {
this.setState({ templateId }, () => {
- API.changePageListTemplate({ page: "salary_details_report", templateId }).then(({ status, errormsg }) => {
- if (status) {
- message.success(getLabel(111, "操作成功!"));
- this.getSalaryList();
- } else {
- message.error(errormsg);
- }
- });
+ API.changePageListTemplate({ page: "salary_details_report", templateId })
+ .then(({ status, errormsg }) => {
+ if (status) {
+ message.success(getLabel(111, "操作成功!"));
+ this.setState({
+ transferDialog: {
+ ...this.state.transferDialog,
+ dataParams: { ...this.state.transferDialog.dataParams, id: templateId }
+ }
+ }, () => {
+ this.transferRef.getData(true);
+ this.getSalaryList();
+ });
+ } else {
+ message.error(errormsg);
+ }
+ });
+ });
+ };
+ handleDelTemp = (ids) => {
+ Modal.confirm({
+ title: getLabel(131329, "信息确认"),
+ content: getLabel(111, "确认删除吗?"),
+ onOk: () => {
+ API.deleteTemplatePageList({ ids }).then(({ status, errormsg }) => {
+ if (status) {
+ message.success(getLabel(111, "操作成功!"));
+ this.setState({ tempManageQuery: !this.state.tempManageQuery }, () => this.getPageListTemplatelist());
+ } else {
+ message.error(errormsg);
+ }
+ });
+ }
});
};
render() {
- const { loading, dataSource, transferDialog, tempDialog, tempPageList, templateId } = this.state;
- const { attendanceStore: { tableStore }, dateRange, showSearchAd, salaryDetailShowType } = this.props;
+ const {
+ loading, dataSource, transferDialog, tempDialog, tempPageList, templateId, tempManageDialog, tempManageQuery
+ } = this.state;
+ const { dateRange, showSearchAd } = this.props;
+ const { dialogType } = transferDialog;
return (
- {
- salaryDetailShowType === "1" &&
-
-
- {
- templateId &&
- this.handelAddTemp(templateId)}>
-
-
- }
-
- }
@@ -269,28 +276,47 @@ class SalaryDetails extends Component {
id="atdTable"
/>
-
+ {/**/}
{/*默认显示列,薪资模板列表*/}
- this.transferRef = dom}
onCancel={() => this.setState({
- transferDialog: {
- ...transferDialog, completeURL: "", visible: false, type: "default"
- }
- })}/>
+ transferDialog: { ...transferDialog, completeURL: "", visible: false }
+ })}
+ buttons={
+ dialogType === "temp" ? [
+ ,
+
+ ] : []
+ }
+ titleOptsComs={
+ dialogType === "temp" ?
+ : null
+ }/>
{/*薪资明细模板设置*/}
this.setState({
- tempDialog: { ...tempDialog, visible: false, setting: [] }
+ tempDialog: { ...tempDialog, visible: false, setting: [], heads: [] }
}, () => callback && callback())}
- onSuccess={() => {
- this.getPageListTemplatelist();
- this.getSalaryList();
- }}/>
+ onSuccess={this.getPageListTemplatelist}/>
+ {/*薪资明细自定义列模板管理*/}
+ this.setState({
+ tempManageDialog: { ...tempManageDialog, completeURL: "", visible: false }
+ })}/>
);
@@ -298,3 +324,11 @@ class SalaryDetails extends Component {
}
export default SalaryDetails;
+
+export const converCheckedCol = (data) => {
+ return _.reduce(data.checked || [], (pre, cur) => {
+ const item = _.find(data.setting, k => k.column === cur.column);
+ if (!_.isEmpty(item)) return [...pre, { ...item, id: item.id || item.column, name: item.name || item.text }];
+ return pre;
+ }, []);
+};
diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetailsTempDialog.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetailsTempDialog.js
index f89e5969..8c971aae 100644
--- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetailsTempDialog.js
+++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetailsTempDialog.js
@@ -9,10 +9,11 @@
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
-import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom";
+import { WeaDialog, WeaLoadingGlobal, WeaLocaleProvider, WeaTools } from "ecCom";
import { tempCondition } from "./conditions";
import { getTaxAgentSelectList } from "../../../apis/taxAgent";
import * as API from "../../../apis/statistics";
+import { downloadPageListTemplate } from "../../../apis/statistics";
import { Button, message } from "antd";
import { getSearchs } from "../../../util";
@@ -45,18 +46,25 @@ class SalaryDetailTempDialog extends Component {
...item, items: _.map(item.items, o => {
if (getKey(o) === "sharedType") {
return {
- ...o, label: getLabel(o.lanId, o.label), value: id ? String(template["sharedType"]) : "0",
+ ...o, label: getLabel(o.lanId, o.label), value: id ? String(template["sharedType"]) : "1",
options: [
- { key: "0", showname: getLabel(111, "公共") },
- { key: "1", showname: getLabel(111, "私有") }
+ { key: "1", showname: getLabel(111, "私有") },
+ { key: "0", showname: getLabel(111, "共享") }
]
};
} else if (getKey(o) === "limitIds") {
return {
- ...o, label: getLabel(o.lanId, o.label), hide: !id || (id && template["sharedType"] === 0),
+ ...o, label: getLabel(o.lanId, o.label), hide: !id || (id && template["sharedType"] === 1),
value: id ? template["limitIds"].join(",") : "",
options: _.map(data, o => ({ key: o.id, showname: o.content }))
};
+ } else if (getKey(o) === "fileId") {
+ return {
+ ...o, label: getLabel(o.lanId, o.label), value: id ? template[getKey(o)] : "",
+ datas: id && template[getKey(o)] ? [
+ { fileid: template[getKey(o)], filename: template["fileName"], showDelete: true }
+ ] : [], labelExtra: getLabel(111, "下载示例"), labelType: "download"
+ };
}
return { ...o, label: getLabel(o.lanId, o.label), value: id ? template[getKey(o)] : "" };
})
@@ -73,12 +81,13 @@ class SalaryDetailTempDialog extends Component {
tempForm.validateForm().then(f => {
if (f.isValid) {
this.setState({ loading: true });
- const { limitIds, ...formVal } = tempForm.getFormParams();
+ const { limitIds, fileId, ...formVal } = tempForm.getFormParams();
const payload = {
page: "salary_details_report", setting, id, ...formVal,
limitIds: !_.isEmpty(limitIds) ? limitIds.split(",") : []
};
- API.savePageListTemplate(payload).then(({ status, errormsg }) => {
+ API.savePageListTemplate(_.assign(payload, fileId ? { fileId } : {})).then(({ status, errormsg }) => {
+ this.setState({ loading: false });
if (status) {
message.success(getLabel(111, "操作成功!"));
this.props.onCancel(this.props.onSuccess());
@@ -92,14 +101,26 @@ class SalaryDetailTempDialog extends Component {
}).catch(() => this.setState({ loading: false }));
};
formFieldChange = (field) => {
+ if (field === "download") {
+ const { setting, heads } = this.props;
+ WeaLoadingGlobal.start();
+ const promise = downloadPageListTemplate({ setting, heads });
+ return;
+ }
const key = Object.keys(field)[0], value = field[key].value;
this.setState({
conditions: _.map(this.state.conditions, item => ({
...item, items: _.map(item.items, o => {
if (key === "sharedType" && getKey(o) === "limitIds") {
return {
- ...o, hide: value !== "1", viewAttr: value === "1" ? 3 : 1,
- rules: value === "1" ? "required|string" : ""
+ ...o, hide: value !== "0", viewAttr: value === "0" ? 3 : 1,
+ rules: value === "0" ? "required|string" : ""
+ };
+ } else if (key === "fileId" && getKey(o) === "fileId") {
+ return {
+ ...o, value, datas: value ? _.map(field[key].valueSpan, o => ({
+ fileid: o.fileid, filename: o.filename, showDelete: true
+ })) : []
};
}
return { ...o };
@@ -118,7 +139,8 @@ class SalaryDetailTempDialog extends Component {
{getLabel(537558, "保存")}]}>
- {getSearchs(tempForm, conditions, 1, false, this.formFieldChange)}
+ {getSearchs(tempForm, conditions, 1, false, this.formFieldChange)}
);
}
diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryTempAdminDialog.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryTempAdminDialog.js
new file mode 100644
index 00000000..8eecb1ab
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryTempAdminDialog.js
@@ -0,0 +1,64 @@
+/*
+ * 薪酬报表-薪酬明细
+ * 模板管理新增编辑弹框
+ * @Author: 黎永顺
+ * @Date: 2024/12/4
+ * @Wechat:
+ * @Email: 971387674@qq.com
+ * @description:
+*/
+import React, { Component } from "react";
+import { WeaDialog, WeaLocaleProvider, WeaTransfer } from "ecCom";
+import { postFetch } from "../../../util/request";
+import { Button } from "antd";
+
+const getLabel = WeaLocaleProvider.getLabel;
+
+class SalaryTempAdminDialog extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ loading: false, selectedKeys: [], dataSource: []
+ };
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visible && nextProps.visible) {
+ const { dataParams = {} } = nextProps;
+ this.setState({ loading: true });
+ postFetch("/api/bs/hrmsalary/common/pageList/template/get", { ...dataParams })
+ .then(({ status, data }) => {
+ if (status) {
+ this.setState({
+ dataSource: _.map(data.setting, o => ({ id: o.column, name: o.text })),
+ selectedKeys: _.map(data.checked, o => o.column)
+ });
+ }
+ });
+ }
+ }
+
+ render() {
+ const { dataSource, selectedKeys } = this.state, { dataParams } = this.props;
+ const heads = _.reduce(selectedKeys, (pre, cur) => {
+ const item = dataSource.find(data => data.id === cur);
+ if (item) pre.push(item.name);
+ return pre;
+ }, []);
+ return ( this.dialog = dom} title={getLabel(111, "模板管理")}
+ className="temp_admin_dialog" style={{
+ width: 784, height: 460, minHeight: 200, minWidth: 380,
+ maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
+ }} buttons={[
+ ,
+
+ ]}>
+ this.setState({ selectedKeys: v })}
+ height={this.dialog ? this.dialog.state.height - 10 : 260}/>
+ );
+ }
+}
+
+export default SalaryTempAdminDialog;
diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryTempMangerDialog.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryTempMangerDialog.js
new file mode 100644
index 00000000..9b309e4d
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryTempMangerDialog.js
@@ -0,0 +1,91 @@
+/*
+ * 薪酬报表-薪酬明细
+ * 模板管理弹框
+ * @Author: 黎永顺
+ * @Date: 2024/12/4
+ * @Wechat:
+ * @Email: 971387674@qq.com
+ * @description:
+*/
+import React, { Component } from "react";
+import { WeaButtonIcon, WeaLocaleProvider } from "ecCom";
+import CustomTransferDialog from "../../../components/CustomBrowser/components/customTransferDialog";
+import SalaryTempAdminDialog from "./salaryTempAdminDialog";
+import SalaryDetailsTempDialog from "./salaryDetailsTempDialog";
+
+const getLabel = WeaLocaleProvider.getLabel;
+
+class SalaryTempMangerDialog extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ selectedRowKeys: [], tempAdminDialog: { visible: false, dataParams: { page: "salary_details_report" } },
+ tempDialog: { visible: false, setting: [], heads: [], id: "", template: {} }
+ };
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.isQuery !== this.props.isQuery) this.setState({ selectedRowKeys: [] }, () => this.tempManageRef.getData());
+ }
+
+ handleTempAdminCols = (params = {}) => this.setState({
+ tempAdminDialog: { visible: true, dataParams: { ...this.state.tempAdminDialog.dataParams, ...params } }
+ });
+ handelAddTemp = (id = "", setting = [], heads = []) => {
+ this.setState({
+ tempDialog: {
+ visible: true, setting, heads, id, template: _.find(this.tempManageRef.state.listDatas, o => o.id === id)
+ }
+ });
+ };
+
+ render() {
+ const { selectedRowKeys, tempAdminDialog, tempDialog } = this.state;
+ return ( this.tempManageRef = dom} {...this.props} buttons={[]}
+ title={getLabel(111, "模板管理")}
+ onSelect={v => this.setState({ selectedRowKeys: v })}
+ tableOpts={{
+ title: getLabel(111, "操作"),
+ dataIndex: "options",
+ width: 120,
+ render: (text, record) => (
+ {
+ record.canEdit &&
+ this.handleTempAdminCols({ id: record.id })}
+ style={{ marginRight: 10 }}>{getLabel(111, "编辑")}
+ }
+ {
+ record.canEdit &&
+ this.props.onDelete([record.id])}>{getLabel(111, "删除")}
+ }
+
+ )
+ }}>
+
+ this.handleTempAdminCols()}/>
+ this.props.onDelete(selectedRowKeys)} disabled={_.isEmpty(selectedRowKeys)}/>
+
+ {/*模板管理*/}
+ this.setState({
+ tempAdminDialog: { visible: false, dataParams: { page: "salary_details_report" } }
+ })}/>
+ {/*薪资明细模板设置*/}
+ this.setState({
+ tempDialog: { ...tempDialog, visible: false, setting: [], heads: [] }
+ }, () => callback && callback())}
+ onSuccess={() => this.setState({
+ tempAdminDialog: { visible: false, dataParams: { page: "salary_details_report" } }
+ }, () => {
+ this.props.onSuccess();
+ this.tempManageRef.getData();
+ })}/>
+ );
+ }
+}
+
+export default SalaryTempMangerDialog;
diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js
index 3b68a2b3..f7c2ca7a 100644
--- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js
+++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js
@@ -9,7 +9,7 @@ import { inject, observer } from "mobx-react";
import { WeaDatePicker, WeaInputSearch, WeaLocaleProvider, WeaReqTop } from "ecCom";
import { Button, Dropdown, Menu } from "antd";
import { condition, reportCondition } from "./components/conditions";
-import { commonEnumList, reportGetForm, sysinfo } from "../../apis/ruleconfig";
+import { commonEnumList, reportGetForm } from "../../apis/ruleconfig";
import { dimensionGetForm } from "../../apis/statistics";
import EmployeeDetails from "./components/employeeDetails";
import SalaryDetails from "./components/salaryDetails";
@@ -50,16 +50,12 @@ class Index extends Component {
title: "", visible: false,
typeKey: "", id: ""
},
- logDialogVisible: false, filterConditions: "[]",
- salaryDetailShowType: "0" //薪资明细列表显示方式
+ logDialogVisible: false, filterConditions: "[]"
};
}
componentDidMount() {
this.initReportFormCondition();
- sysinfo().then(({ status, data }) => {
- if (status) this.setState({ salaryDetailShowType: data.SALARY_DETAILS_REPORT_SHOW_TYPE });
- });
}
initReportFormCondition = (payload = {}) => {
@@ -281,7 +277,7 @@ class Index extends Component {
const {
selectedKey, modalReq, slideReq, conditions, reportConditions,
reportName, keyword, year, logDialogVisible, filterConditions,
- dateRange, showSearchAd, isQuery, salaryDetailShowType
+ dateRange, showSearchAd, isQuery
} = this.state;
const buttons = selectedKey === "statistics" ? [
,
@@ -319,8 +315,9 @@ class Index extends Component {
icon: ,
content: getLabel(111, "显示列定制"),
onClick: () => {
- tableStore.setColSetVisible(true);
- tableStore.tableColSet(true);
+ this.salaryRef.wrappedInstance.handleSetDefCols();
+ // tableStore.setColSetVisible(true);
+ // tableStore.tableColSet(true);
}
}
];
@@ -330,18 +327,13 @@ class Index extends Component {
{ key: "salaryDetail", title: getLabel(111, "薪资明细") }
];
dropMenuDatas = selectedKey === "salaryDetail" ? dropMenuDatas.slice(-1) : dropMenuDatas.slice(0, 1);
- (PageAndOptAuth.isChief && selectedKey === "salaryDetail") && (dropMenuDatas = [...dropMenuDatas, {
- key: "DEF_COLUMN", icon: , content: getLabel(111, "默认显示列"),
- onClick: () => this.salaryRef.wrappedInstance.handleSetDefCols()
- }]);
return (
} selectedKey={selectedKey}
iconBgcolor="#F14A2D" tabDatas={tabs} className="xc_tj_fx_wrapper"
buttons={(!statisticsReportBtn && selectedKey === "statistics") ? buttons.slice(-1) : buttons} buttonSpace={10}
onChange={selectedKey => this.setState({ selectedKey }, () => this.state.selectedKey === "statistics" && this.initReportFormCondition())}
- showDropIcon={(selectedKey === "statistics") || (selectedKey === "salaryDetail" && salaryDetailShowType !== "1")}
- onDropMenuClick={this.onDropMenuClick} dropMenuDatas={dropMenuDatas}>
+ showDropIcon={selectedKey !== "detail"} onDropMenuClick={this.onDropMenuClick} dropMenuDatas={dropMenuDatas}>
{
selectedKey === "statistics" ?
this.onDropMenuClick(type, targetid)}
/> : this.salaryRef = dom} dateRange={dateRange} isQuery={isQuery}
- salaryDetailShowType={salaryDetailShowType}
showSearchAd={showSearchAd} handleOpenAdvanceSearch={this.handleOpenAdvanceSearch}
handleAdvanceSearch={this.handleAdvanceSearch} onAdSearch={this.onAdSearch}
onCancel={() => this.setState({ showSearchAd: false })}
diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less
index 40c137f0..7d481333 100644
--- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less
+++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less
@@ -382,3 +382,17 @@
}
}
+
+.tempDialog {
+ .wea-form-item-label {
+ min-height: 50px;
+ }
+
+ .wea-form-item-label-extra {
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ cursor: pointer;
+ color: #4d7ad8;
+ }
+}
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js
index 2380cfae..1e6eaac0 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js
@@ -46,7 +46,8 @@ class EditSalaryBaseInfo extends Component {
default:
break;
}
- return this.props.onChange(_.map(this.props.baseInfo, it => {
if (fieldCode === it.fieldCode) {
return { ...it, fieldValue: value, fieldValueObj: { id: value, name: valueSpan } };
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/calcAnchorList.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/calcAnchorList.js
new file mode 100644
index 00000000..a8cecca3
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/calcAnchorList.js
@@ -0,0 +1,110 @@
+/*
+ * 核算编辑
+ * 数据查看锚点
+ * @Author: 黎永顺
+ * @Date: 2025/2/10
+ * @Wechat:
+ * @Email: 971387674@qq.com
+ * @description:
+*/
+import React, { Component } from "react";
+import { WeaLocaleProvider } from "ecCom";
+import classnames from "classnames";
+
+const getLabel = WeaLocaleProvider.getLabel;
+
+class CalcAnchorList extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ collapsed: false, currentIndex: 0
+ };
+ this.isClickRef = null;
+ this.timerRef = null;
+ }
+
+ componentDidMount() {
+ document.getElementById("salary_anchor_area").addEventListener("scroll", this.handlerScroll);
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({
+ collapsed: false,
+ currentIndex: 0
+ });
+ }
+
+ componentWillUnmount() {
+ document.getElementById("salary_anchor_area").removeEventListener("scroll", this.handlerScroll);
+ }
+
+ handlerScroll = () => {
+ // 点击锚点时,不执行滚动函数
+ if (this.isClickRef) return;
+ // 获取滚动容器的滚动高度(这里相对于#salary_anchor_area滚动的)
+ const scrollTop = document.getElementById("salary_anchor_area").scrollTop;
+ // 获取所有wea-search-group anchor_开头的元素集合
+ const contentList = document.querySelectorAll("[class^='wea-search-group anchor_']");
+ const offsetTopArr = [];
+ contentList.forEach((item) => {
+ // 获取每个wea-search-group anchor_开头的元素的offsetTop
+ offsetTopArr.push(item.offsetTop);
+ });
+ for (let i = 0; i < offsetTopArr.length; i++) {
+ // 当滚动条高度达到对应wea-search-group anchor_开头的元素的滚动高度、则将锚点设置为高亮状态
+ if (scrollTop + 190 >= offsetTopArr[i]) this.setState({ currentIndex: i });
+ }
+ };
+ onClickAnchor = (item, index) => {
+ const anchorElement = document.getElementById("salary_anchor_area");
+ const el = document.querySelector(`.anchor_${item.salarySobItemGroupId}`);
+ if (el) {
+ anchorElement.scroll({ top: el.offsetTop, behavior: "smooth" });
+ }
+ this.setState({ currentIndex: index });
+ // 点击时设置为true,为了防止同时执行滚动事件
+ this.isClickRef = true;
+ // 清除定时器,防止滚动事件触发、出现走马灯闪烁问题
+ if (this.timerRef) clearTimeout(this.timerRef);
+ this.timerRef = setTimeout(() => {
+ this.isClickRef = false;
+ }, 1000);
+ };
+
+ render() {
+ const { collapsed, currentIndex } = this.state, { datas } = this.props;
+ return (
+
+
+ {
+ collapsed ?
+
+ this.setState({ collapsed: !collapsed })}/>
+
:
+
+
+ this.setState({ collapsed: !collapsed })}/>
+
+
+
+
+
+ {_.map(datas, (o, i) => (
+
this.onClickAnchor(o, i)}>
+ {o.salarySobItemGroupName}
+
)
+ )}
+
+
+ }
+
+
+ );
+ }
+}
+
+export default CalcAnchorList;
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js
index aa6baf65..986bb1bb 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js
@@ -30,7 +30,7 @@ class EditCalcTable extends Component {
this.state = {
loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 },
selectedRowKeys: [], progressVisible: false, progress: 0,
- salaryCalcSlide: { visible: false, id: "" }, originPayloadData: {},
+ salaryCalcSlide: { visible: false, id: "", viewAttr: 2 }, originPayloadData: {},
batchUpdateDialog: {
visible: false, salaryAcctRecordId: "", idList: [], salaryItemId: "",
conditions: [], pattern: 0, dataType: ""
@@ -73,9 +73,9 @@ class EditCalcTable extends Component {
this.updateEmpLockStatus({ ...params });
break;
case "EDIT":
- const { id: salaryCalcId } = params;
+ const { id: salaryCalcId, showSee } = params;
this.setState({
- salaryCalcSlide: { visible: true, id: salaryCalcId }
+ salaryCalcSlide: { visible: true, id: salaryCalcId, viewAttr: showSee ? 1 : 2 }
});
break;
case "DIAGRAM":
@@ -238,7 +238,7 @@ class EditCalcTable extends Component {
"总计": getLabel(523, "总计"), "批量解锁": getLabel(111, "批量解锁"),
"批量锁定": getLabel(111, "批量锁定"), "批量更新": getLabel(111, "批量更新"),
"查看拓扑图": getLabel(111, "查看拓扑图"), "锁定": getLabel(111, "锁定"),
- "解锁": getLabel(111, "解锁")
+ "解锁": getLabel(111, "解锁"), "查看": getLabel(111, "查看")
};
this.setState({ originPayloadData: { ...payload, i18n } });
const childFrameObj = document.getElementById("atdTable");
@@ -269,7 +269,7 @@ 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,
- calcDetail,
+ calcDetail, showSee: calcDetail,
columns: _.every(traverse(columns, calcDetail), (it, idx) => !it.fixed) ? _.map(traverse(columns, calcDetail), (it, idx) => ({
...it,
fixed: idx < 2 ? "left" : false
@@ -304,10 +304,7 @@ class EditCalcTable extends Component {
/>
this.setState({
- salaryCalcSlide: {
- visible: false,
- id: ""
- }
+ salaryCalcSlide: { visible: false, id: "", viewAttr: 2 }
}, () => isFresh === "true" && this.queryCalcResultList())}/>
{
progressVisible &&
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js
index 235bac13..9da20706 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js
@@ -12,9 +12,9 @@ import PayrollItemsTable from "../../../../calculateDetail/payrollItemsTable";
import IssuedAndReissueTable from "../../../../calculateDetail/issuedAndReissueTable";
import { acctresultDetail, saveAcctResult } from "../../../../../apis/calculate";
import { toDecimal_n } from "../../../../../util";
+import CalcAnchorList from "./calcAnchorList";
import "./index.less";
-
const getLabel = WeaLocaleProvider.getLabel;
class EditSalaryCalcSlide extends Component {
@@ -29,7 +29,7 @@ class EditSalaryCalcSlide extends Component {
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) this.acctresultDetail(nextProps.id);
- if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ selectedKey: "0" });
+ if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ selectedKey: "0" }, () => document.getElementById("salary_anchor_area").scrollTop = 0);
}
acctresultDetail = (id) => {
@@ -43,14 +43,17 @@ class EditSalaryCalcSlide extends Component {
});
};
renderTitle = () => {
- const { loading } = this.state;
+ const { loading } = this.state, { viewAttr } = this.props;
return
-
{getLabel(543559, "编辑薪资")}
+
{viewAttr === 2 ? getLabel(543559, "编辑薪资") : getLabel(111, "查看薪资")}
-
+ {
+ viewAttr === 2 &&
+
+ }
;
};
@@ -139,7 +142,9 @@ class EditSalaryCalcSlide extends Component {
className="salary-calculate-esf-layout" {...this.props}
top={0} width={60} height={100} measure={"%"}
direction={"right"} title={this.renderTitle()}
- content={
+ content={
+ {/*锚点*/}
+
this.setState({ baseInfo })}/>
{
selectedKey === "0" && _.map(itemsByGroup, item => {
- return ;
+ return ;
})
}
{
selectedKey === "1" &&
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less
index e2d8ce9b..4e3fb3b4 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less
@@ -142,6 +142,7 @@
height: 100%;
.salary-calculate-esf-area {
+ position: relative;
background: #f6f6f6;
height: 100%;
overflow-y: auto;
@@ -191,6 +192,109 @@
.wea-search-group {
padding: 0;
}
+
+ //锚点按钮
+ .anchor-list-collapsed {
+ padding: 0 !important;
+ }
+
+ .anchor-list-wrapper {
+ position: absolute;
+ right: 0;
+ margin: 10px 15px 20px;
+ padding: 8px 10px;
+ overflow: auto;
+ background-color: #fff;
+ box-shadow: 0 3px 12px 0 rgba(0, 0, 0, .12);
+ border-radius: 3px;
+ cursor: pointer;
+
+ .anchor-list-collapsed-btn {
+ opacity: .5;
+ background: #000;
+ color: #fff;
+ border-radius: 3px;
+ width: 30px;
+ height: 30px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 16px;
+ }
+
+ .anchor-list-header {
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+ min-width: 130px;
+ padding: 5px;
+ }
+
+ .anchor-list {
+ padding: 0 10px;
+ position: relative;
+ margin-top: 10px;
+ transition: margin-top .3s;
+
+ .anchor-list-ink {
+ position: absolute;
+ top: 0;
+ left: 5px;
+ height: 100%;
+
+ .anchor-list-ink-ball.visible {
+ display: inline-block;
+ }
+
+ .anchor-list-ink-ball {
+ position: absolute;
+ left: 50%;
+ display: none;
+ width: 3px;
+ height: 8px;
+ background-color: #5d9cec;
+ border: 1.5px solid #5d9cec;
+ border-radius: 8px;
+ transform: translateX(-50%);
+ transition: top .3s ease-in-out;
+ }
+ }
+
+ .anchor-list-ink:before {
+ position: relative;
+ display: block;
+ width: 1px;
+ height: 100%;
+ margin: 0 auto;
+ background-color: #f0f0f0;
+ content: " ";
+ }
+
+ .anchor-list-link {
+ padding: 7px 0 7px 10px;
+ line-height: 1.143;
+
+ .anchor-list-link-title {
+ position: relative;
+ display: block;
+ overflow: hidden;
+ color: #666;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ transition: all .3s;
+ cursor: pointer;
+ outline: none;
+ text-decoration: none;
+ background-color: transparent;
+ }
+ }
+
+ .anchor-list-link-active > .anchor-list-link-title {
+ color: #5d9cec;
+ }
+ }
+ }
+
}
}
}
diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/issuedAndReissueTable.js b/pc4mobx/hrmSalary/pages/calculateDetail/issuedAndReissueTable.js
index bf1c1286..65189b7e 100644
--- a/pc4mobx/hrmSalary/pages/calculateDetail/issuedAndReissueTable.js
+++ b/pc4mobx/hrmSalary/pages/calculateDetail/issuedAndReissueTable.js
@@ -29,10 +29,11 @@ class IssuedAndReissueTable extends Component {
/>
,
render: (text, record) => {
- const { canEdit, pattern } = record;
+ const { canEdit, pattern } = record, { viewAttr } = this.props;
return onChangeIssueReissueValue(record.salaryItemName, value, "issuedAndReissueItems")}
diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js b/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js
index 9d2ddfce..9f196d5f 100644
--- a/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js
+++ b/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js
@@ -37,8 +37,9 @@ class PayrollItemsTable extends Component {
,
width: "20%",
render: (text, record) => {
- const { canEdit, dataType, pattern } = record;
+ const { canEdit, dataType, pattern } = record, { viewAttr } = this.props;
return dataType === "number" ? : onChangeIssueReissueValue(record.salaryItemId, value, "itemsByGroup", salarySobItemGroupId)}
/>;
}
@@ -66,7 +68,7 @@ class PayrollItemsTable extends Component {
}
];
return (
-
+
({ ...o, width: 150, fixed: null }))
+ columns: _.map(columns, (o, i) => ({ ...o, width: 150, fixed: i === 0 ? "left" : null }))
});
}
}).catch(() => this.setState({ loading: { ...loading, query: false } }));
@@ -103,7 +102,7 @@ class AttendanceDataViewSlide extends Component {
+ loading={loading.query} scroll={{ x: 1200, y: `calc(100vh - 240px)` }}/>
}
/>
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/components/tableRecord.js b/pc4mobx/hrmSalary/pages/dataAcquisition/components/tableRecord.js
index 4bba03cd..9c36b02a 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/components/tableRecord.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/components/tableRecord.js
@@ -5,11 +5,13 @@
* Date: 2023/2/20
*/
import React, { Component } from "react";
-import { WeaSearchGroup, WeaTable } from "ecCom";
+import { WeaLocaleProvider, WeaSearchGroup, WeaTable } from "ecCom";
import { getTableRecordDate } from "../../../apis/cumDeduct";
import { DataCollectionDateRangePick, DataCollectionSelect, Input } from "../cumDeduct";
import "./index.less";
+const getLabel = WeaLocaleProvider.getLabel;
+
class TableRecord extends Component {
constructor(props) {
super(props);
@@ -167,11 +169,11 @@ class TableRecord extends Component {
};
const items = screenParams.length === 1 ? [
{
- com: Input({ value: record.username })
+ com: Input({ label: getLabel(111, "姓名"), value: record.username })
}
] : [
{
- com: Input({ value: record.username })
+ com: Input({ label: getLabel(111, "姓名"), value: record.username })
},
{
com: DataCollectionSelect({
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js
index e1c8e21b..d7d92744 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js
@@ -28,6 +28,7 @@ import TableRecord from "../components/tableRecord";
import { dataCollectCondition } from "./columns";
import { removePropertyCondition } from "../../../util/response";
import { convertToUrlString } from "../../../util/url";
+import { getDomkes } from "../../../util";
import Layout from "../layout";
import moment from "moment";
@@ -239,6 +240,7 @@ class Index extends Component {
addForm.validateForm().then(f => {
if (f.isValid) {
const payload = {
+ ..._.reduce(getDomkes(dataCollectCondition), (pre, cur) => ({ ...pre, [cur]: "" }), {}),
...addForm.getFormParams(),
taxAgentName: _.find(taxAgentOption, it => it.key === addForm.getFormParams().taxAgentId).showname
};
@@ -555,8 +557,10 @@ export const DataCollectionSelect = (props) => {
};
export const Input = (props) => {
- const { value } = props;
- return ();
+ const { value, label } = props;
+ return (
+
+ );
};
export const DataCollectionDateRangePick = (props) => {
const { range, label, onChange, format = "YYYY-MM", key } = props;
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js
index 7a0e0ea4..64cdd59e 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js
@@ -27,6 +27,7 @@ import { dataCollectCondition, taxOptions } from "./columns";
import AddItems from "../addItems";
import TableRecord from "../components/tableRecord";
import { convertToUrlString } from "../../../util/url";
+import { getDomkes } from "../../../util";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@@ -392,6 +393,7 @@ class Index extends Component {
addForm.validateForm().then(f => {
if (f.isValid) {
const payload = {
+ ..._.reduce(getDomkes(dataCollectCondition), (pre, cur) => ({ ...pre, [cur]: "" }), {}),
...addForm.getFormParams(),
taxAgentName: _.find(taxAgentOption, it => it.key === addForm.getFormParams().taxAgentId).showname
};
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js
index f812edda..8f786982 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js
@@ -29,6 +29,7 @@ import { dataCollectCondition } from "./columns";
import AddItems from "../addItems";
import TableRecord from "../components/tableRecord";
import { convertToUrlString } from "../../../util/url";
+import { getDomkes } from "../../../util";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@@ -407,6 +408,7 @@ class Index extends Component {
addForm.validateForm().then(f => {
if (f.isValid) {
const payload = {
+ ..._.reduce(getDomkes(dataCollectCondition), (pre, cur) => ({ ...pre, [cur]: "" }), {}),
...addForm.getFormParams(),
taxAgentName: _.find(taxAgentOption, it => it.key === addForm.getFormParams().taxAgentId).showname
};
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js
index 70c04767..5986baae 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js
@@ -20,6 +20,7 @@ import { condition } from "./components/condition";
import AddItems from "../addItems";
import TableRecord from "../components/tableRecord";
import { convertToUrlString } from "../../../util/url";
+import { getDomkes } from "../../../util";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@@ -345,6 +346,7 @@ class Index extends Component {
addForm.validateForm().then(f => {
if (f.isValid) {
const payload = {
+ ..._.reduce(getDomkes(condition), (pre, cur) => ({ ...pre, [cur]: "" }), {}),
...addForm.getFormParams(),
taxAgentName: _.find(taxAgentOption, it => it.key === addForm.getFormParams().taxAgentId).showname
};
diff --git a/pc4mobx/hrmSalary/pages/declare/components/declareDialog/index.js b/pc4mobx/hrmSalary/pages/declare/components/declareDialog/index.js
index 28bda271..36ef34ea 100644
--- a/pc4mobx/hrmSalary/pages/declare/components/declareDialog/index.js
+++ b/pc4mobx/hrmSalary/pages/declare/components/declareDialog/index.js
@@ -12,6 +12,7 @@ import { getSearchs } from "../../../../util";
import { getTaxAgentSelectListAsAdmin } from "../../../../apis/taxAgent";
import { saveDeclare } from "../../../../apis/declare";
import { declareConditions } from "./condition";
+import * as API from "../../../../apis/ruleconfig";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@@ -31,7 +32,8 @@ class Index extends Component {
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.declareStore.initDeclareForm();
}
- getTaxAgentSelectListAsAdmin = (props) => {
+ getTaxAgentSelectListAsAdmin = async (props) => {
+ const { data: sysinfo } = await API.sysinfo();
const { declareStore: { declareForm } } = props;
getTaxAgentSelectListAsAdmin().then(({ status, data }) => {
if (status) {
@@ -44,6 +46,11 @@ class Index extends Component {
...o, options: _.map(data, g => ({ key: g.id, showname: g.content }))
// helpfulTitle: getLabel(563420, "提示:可选择单个个税扣缴义务人进行申报,若不选择,则批量对管理下的所有个税扣缴义务人进行申报;")
};
+ } else if (getKey(o) === "salaryMonthStr") {
+ return {
+ ...o,
+ label: sysinfo["TAX_DECLARATION_DATE_TYPE"] === "1" ? getLabel(111, "税款所属期") : getLabel(111, "薪资所属月")
+ };
}
return { ...o };
})
@@ -58,7 +65,9 @@ class Index extends Component {
if (f.isValid) {
const payload = declareForm.getFormParams();
this.setState({ loading: true });
- saveDeclare({ ...payload }).then(({ status, errormsg }) => {
+ saveDeclare({
+ ...payload, taxCycle: `${payload.salaryMonthStr}-01`, salaryDate: `${payload.salaryMonthStr}-01`
+ }).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(30700, "操作成功"));
diff --git a/pc4mobx/hrmSalary/pages/declare/generateDeclarationDetail.js b/pc4mobx/hrmSalary/pages/declare/generateDeclarationDetail.js
index cdfe5a73..91a1a88f 100644
--- a/pc4mobx/hrmSalary/pages/declare/generateDeclarationDetail.js
+++ b/pc4mobx/hrmSalary/pages/declare/generateDeclarationDetail.js
@@ -1,27 +1,24 @@
import React from "react";
-import CustomTab from "../../components/customTab";
import { inject, observer } from "mobx-react";
+import { WeaLocaleProvider, WeaTable, WeaTop } from "ecCom";
import { getQueryString } from "../../util/url";
import * as API from "../../apis/declare";
import { Button } from "antd";
-import UnifiedTable from "../../components/UnifiedTable";
import "./index.less";
+const { getLabel } = WeaLocaleProvider;
@inject("taxAgentStore")
@observer
export default class GenerateDeclarationDetail extends React.Component {
constructor(props) {
super(props);
this.state = {
- loading: false,
- dataSource: [],
- columns: [],
- pageInfo: { current: 1, pageSize: 10, total: 0 },
- declareInfo: {}
+ loading: false, dataSource: [], columns: [], declareInfo: {},
+ pageInfo: { current: 1, pageSize: 10, total: 0 }
};
}
- componentWillMount() {
+ componentDidMount() {
this.getDetailList();
this.getDeclareInfo();
}
@@ -37,31 +34,19 @@ export default class GenerateDeclarationDetail extends React.Component {
if (status) {
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
this.setState({
- dataSource,
- pageInfo: {
- ...pageInfo,
- current, pageSize, total
- },
+ dataSource, pageInfo: { ...pageInfo, current, pageSize, total },
columns: _.map(_.filter(columns, it => it.dataIndex !== "jobNum"), item => {
if (item.dataIndex === "username") {
return {
- ...item,
- render: (text, record) => {
- return window.pointerXY(e)}
- title={text}
- >
- {text}
- ;
- }
+ ...item, width: 180,
+ render: (text, record) => ( window.pointerXY(e)}
+ title={text}>{text})
};
}
return {
- ...item,
- render: (text) => {
- return {text};
- }
+ ...item, width: (item.dataIndex === "cardType" || item.dataIndex === "cardNum") ? 180 : 100,
+ render: (text) => ({text})
};
})
});
@@ -78,26 +63,19 @@ export default class GenerateDeclarationDetail extends React.Component {
const url = `${window.location.origin}/api/bs/hrmsalary/taxdeclaration/export?taxDeclarationId=${getQueryString("id")}`;
window.open(url, "_self");
};
+ renderTitle = () => {
+ const { declareInfo } = this.state;
+ return (
+ {getLabel(111, "薪资所属月")}:{declareInfo.salaryMonth}
+ {getLabel(111, "个税扣缴义务人")}:{declareInfo.taxAgentName}
+ );
+ };
render() {
- const { declareInfo, loading, pageInfo, columns, dataSource } = this.state;
+ const { loading, pageInfo, columns, dataSource } = this.state;
const { taxAgentStore: { showOperateBtn } } = this.props;
-
- const renderRightOperation = () => {
- return (
-
-
-
- );
- };
- const renderLeftOperation = () => {
- return (
-
- 薪资所属月:{declareInfo.salaryMonth}
- 个税扣缴义务人:{declareInfo.taxAgentName}
-
- );
- };
+ const buttons = showOperateBtn ? [] : [];
const pagination = {
...pageInfo,
showTotal: (total) => `共 ${total} 条`,
@@ -115,23 +93,12 @@ export default class GenerateDeclarationDetail extends React.Component {
}, () => this.getDetailList());
}
};
- return (
-
-
-
-
-
+ return (
} iconBgcolor="#F14A2D"
+ buttons={buttons}>
+
+
- );
+ );
}
}
diff --git a/pc4mobx/hrmSalary/pages/declare/index.less b/pc4mobx/hrmSalary/pages/declare/index.less
index 9e4ced1a..01b8fd58 100644
--- a/pc4mobx/hrmSalary/pages/declare/index.less
+++ b/pc4mobx/hrmSalary/pages/declare/index.less
@@ -1,11 +1,10 @@
-.generateDeclarationDetail {
- .tabWrapper {
- padding-left: 10px
- }
+.declare-detail-table-container {
+ height: 100%;
+ background: #f6f6f6;
+ padding: 8px 16px;
- .tableWrapper {
- height: calc(100vh - 48px);
- overflow: auto;
+ .wea-new-table {
+ background: #FFF;
}
}
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js
index 0b71af53..905c2f3b 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js
@@ -289,6 +289,7 @@ class LedgerAssociatedPersonnel extends Component {
APIFox={APIFox}
tabActive={selectedKey}
searchValue={searchValue}
+ showOperateBtn={showOperateBtn}
onChangeSelectKey={rowKeys => this.setState({ rowKeys })}
onEditScope={this.handleAddPersonal}
/>
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerMovoTo.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerMovoTo.js
index af75ac82..8a333ea5 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerMovoTo.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerMovoTo.js
@@ -18,10 +18,8 @@ class LedgerMovoTo extends Component {
];
return (
+ {...extraProps} buttons={buttons} hasScroll initLoadCss className="moveModalWrapper"
+ style={{ width: 440, height: Math.ceil((dataList.length - 1) / 3) * 25 + 41 }}>
item.showname === "未分类")}
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItem.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItem.js
index 66134f24..65912404 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItem.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItem.js
@@ -254,20 +254,19 @@ class LedgerSalaryItem extends Component {
* Params:
* Date: 2022/12/14
*/
- handleAddSalaryItems = (id, items) => {
+ handleAddSalaryItems = (id, items, insertId) => {
const { itemGroups } = this.state;
this.setState({
itemGroups: _.map(itemGroups, it => {
if (id === it.uuid) {
+ items = _.map(items, child => {
+ const { id: itemsId, ...extraItems } = child;
+ return { ...extraItems, salaryItemGroupId: it.uuid };
+ });
+ if (insertId) it.items.splice(_.findIndex(it.items, k => (k.id === insertId) || (k.key === insertId)) + 1, 0, ...items);
return {
- ...it, items: _.map([..._.map(items, child => {
- const { id: itemsId, ...extraItems } = child;
- return { ...extraItems, salaryItemGroupId: it.uuid };
- }), ...it.items], (childItem, childItemIndex) => {
- return {
- ...childItem,
- sortedIndex: childItemIndex
- };
+ ...it, items: _.map(insertId ? it.items : [...items, ...it.items], (childItem, childItemIndex) => {
+ return { ...childItem, sortedIndex: childItemIndex };
})
};
}
@@ -319,7 +318,7 @@ class LedgerSalaryItem extends Component {
items: [...it.items, {
...extraItems,
salaryItemGroupId: moveToItemId,
- key: moveId,
+ key: moveId ? moveId : items.key,
sortedIndex: !_.isEmpty(it.items) ? it.items[it.items.length - 1].sortedIndex + 1 : 0
}]
};
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemAddModal.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemAddModal.js
index 774269f5..7830fbe5 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemAddModal.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemAddModal.js
@@ -1,25 +1,15 @@
import React from "react";
-import { Button, Switch } from "antd";
-import { WeaDialog, WeaInputSearch, WeaTable } from "ecCom";
+import { Button, Spin } from "antd";
+import { WeaCheckbox, WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaTable } from "ecCom";
import { listSalaryItem } from "../../../apis/ledger";
+const getLabel = WeaLocaleProvider.getLabel;
export default class LedgerSalaryItemAddModal extends React.Component {
constructor(props) {
super(props);
this.state = {
- loading: {
- query: false
- },
- name: "",
- selectedRowKeys: [],
- dataSource: [],
- dataSourceCopy: [],
- columns: [],
- pageInfo: {
- current: 1,
- pageSize: 10,
- total: 0
- }
+ loading: { query: false }, name: "", selectedRowKeys: [], dataSource: [],
+ dataSourceCopy: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }
};
}
@@ -42,12 +32,7 @@ export default class LedgerSalaryItemAddModal extends React.Component {
excludeIds.push(i.salaryItemId);
});
});
- const payload = {
- excludeIds,
- name,
- ...pageInfo,
- ...extra
- };
+ const payload = { excludeIds, name, ...pageInfo, ...extra };
this.setState({ loading: { ...loading, query: true } });
listSalaryItem(payload).then(({ status, data }) => {
this.setState({ loading: { ...loading, query: false } });
@@ -56,9 +41,7 @@ export default class LedgerSalaryItemAddModal extends React.Component {
const tmpV = !_.isEmpty(dataSource) ? dataSource : [];
this.setState({
dataSourceCopy: [...dataSourceCopy, ...tmpV],
- pageInfo: { ...pageInfo, current, pageSize, total },
- dataSource: tmpV,
- columns
+ pageInfo: { ...pageInfo, current, pageSize, total }, dataSource: tmpV, columns
});
}
}).catch(() => {
@@ -76,7 +59,7 @@ export default class LedgerSalaryItemAddModal extends React.Component {
case "useDefault":
case "hideDefault":
case "useInEmployeeSalary":
- return ;
+ return ;
default:
return ;
}
@@ -85,10 +68,9 @@ export default class LedgerSalaryItemAddModal extends React.Component {
});
return newColumns;
};
-
handleAdd = () => {
const { dataSourceCopy, selectedRowKeys } = this.state;
- const { onAddSalaryItems, id, onCancel, itemGroups } = this.props;
+ const { onAddSalaryItems, id, onCancel, itemGroups, record } = this.props;
const arrItems = _.find(itemGroups, it => it.uuid === id).items || [];
let selectItems = [];
_.uniqWith(dataSourceCopy, _.isEqual).map((item) => {
@@ -104,54 +86,53 @@ export default class LedgerSalaryItemAddModal extends React.Component {
});
});
onCancel();
- onAddSalaryItems(id, selectItems);
+ onAddSalaryItems(id, selectItems, record.id || record.key);
+ };
+ renderTitle = () => {
+ const { name, pageInfo } = this.state;
+ return
+ {getLabel(111, "添加薪资项目")}
+ this.setState({ name: val })} style={{ width: 200 }}
+ placeholder={getLabel(111, "请输入薪资项目名称")} onSearch={() => this.setState({
+ pageInfo: { ...pageInfo, current: 1 }
+ }, () => this.listSalaryItem())}/>
+
;
};
render() {
- const { onCancel, visible } = this.props;
- const { name, selectedRowKeys, pageInfo, dataSource, loading } = this.state;
+ const { selectedRowKeys, pageInfo, dataSource, loading } = this.state;
const pagination = {
...pageInfo,
showTotal: total => `共 ${total} 条`,
showQuickJumper: true,
+ showSizeChanger: true,
pageSizeOptions: ["10", "20", "50", "100"],
+ onShowSizeChange: (current, pageSize) => {
+ this.setState({ pageInfo: { ...pageInfo, current: 1, pageSize } }, () => this.listSalaryItem());
+ },
onChange: current => {
- this.setState({
- pageInfo: { ...pageInfo, current }
- }, () => {
- this.listSalaryItem();
- });
+ this.setState({ pageInfo: { ...pageInfo, current } }, () => this.listSalaryItem());
}
};
const rowSelection = {
- selectedRowKeys,
- onChange: (selectedRowKeys) => {
- this.setState({ selectedRowKeys }, () => {
- });
- }
+ selectedRowKeys, onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
};
return (
- 添加]}
- >
-
-
this.setState({ name })}
- onSearch={() => this.listSalaryItem({ current: 1 })}
- />
+ this.sysItemRef = dom}
+ title={this.renderTitle()}
+ buttons={[]}
+ style={{
+ width: "60vw", height: 600, minHeight: 200, minWidth: 380,
+ maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
+ }}>
+
+
+ record.id || record.key} rowSelection={rowSelection}/>
+
- record.id || record.key}
- rowSelection={rowSelection}
- dataSource={dataSource}
- pagination={pagination}
- loading={loading.query}
- columns={this.getSalaryItemAddColumns()}
- />
);
}
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js
index 1c176f06..4b9b42ec 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js
@@ -22,7 +22,7 @@ class LedgerSalaryItemNormal extends Component {
constructor(props) {
super(props);
this.state = {
- addCategoryItemsVisible: false,
+ addCategoryItemsVisible: { visible: false, id: "", record: {} },
categoryModal: {
visible: false,
title: "新增分类",
@@ -170,7 +170,11 @@ class LedgerSalaryItemNormal extends Component {
onEditCategory={this.handleAddCategory}
onDeleteCategory={this.handleDeleteCategory}
onDeleteCategoryItems={this.handleDeleteCategoryItems}
- onAddCategoryItems={(id) => this.setState({ addCategoryItemsVisible: { visible: true, id } })}
+ onAddCategoryItems={(id) => this.setState({
+ addCategoryItemsVisible: {
+ ...addCategoryItemsVisible, visible: true, id
+ }
+ })}
onUpgo={this.handleUpgo}
onDowngo={this.handleDowngo}
/>
@@ -178,13 +182,16 @@ class LedgerSalaryItemNormal extends Component {
>
childItem.id === id || childItem.uuid === uuid).items}
+ dataSource={_.find(newDateSource, childItem => childItem.uuid === uuid).items}
salarySobId={editId || saveSalarySobId}
selectedRowKeys={field.selectedRowKeys || []}
onDropCategoryItem={(data) => onDropCategoryItem(field, data)}
onHandleItemhide={(data) => onHandleItemhide(field, data)}
onChangeSelectedRowKeys={(data) => onChangeSelectedRowKeys(field, data)}
onMoveTo={this.handleMoveTo}
+ onAddCategoryItems={(record) => this.setState({
+ addCategoryItemsVisible: { visible: true, record, id: uuid }
+ })}
/>
;
})
@@ -198,7 +205,7 @@ class LedgerSalaryItemNormal extends Component {
this.setState({ addCategoryItemsVisible: { visible: false, id: "" } })}
+ onCancel={() => this.setState({ addCategoryItemsVisible: { visible: false, id: "", record: {} } })}
onAddSalaryItems={onAddSalaryItems}
/>
({ key: it.value.toString(), showname: it.defaultLabel }))
@@ -288,18 +290,22 @@ class LedgerSalaryItemTable extends Component {
width: 80,
render: (text, record) => this.handleChangeItem(value, record.id || record.key)}
+ onChange={value => {
+ this.handleChangeItem(value, record.id || record.key);
+ }}
/>
},
{
title: "操作",
dataIndex: "operate",
key: "operate",
- width: 120,
+ width: 180,
render: (_, record) => (
this.handleEditSalaryItem(record)}
style={{ marginRight: 10 }}>编辑
+ this.props.onAddCategoryItems(record)}
+ style={{ marginRight: 10 }}>{getLabel(111, "插入")}
onMoveTo(record)}>移动到
)
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js
index 2529bce9..c5ead666 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js
@@ -86,7 +86,7 @@ class LedgerSlide extends Component {
* Date: 2022/12/12
*/
saveLedgerAdjustRule = () => {
- const { adjustRules, saveSalarySobId } = this.state;
+ const { adjustRules, saveSalarySobId, salaryApprovalStatus } = this.state;
const payload = {
salarySobId: this.props.editId || saveSalarySobId,
ruleParams: adjustRules
@@ -96,6 +96,7 @@ class LedgerSlide extends Component {
this.setState({ loading: false });
if (status) {
message.success("保存成功");
+ !salaryApprovalStatus && this.handleClose();
} else {
message.success(errormsg || "保存失败");
}
@@ -259,7 +260,7 @@ class LedgerSlide extends Component {
,
+ onClick={() => this.setState({ current: !salaryApprovalStatus ? current : current + 1 }, () => this.saveLedgerAdjustRule())}>{!salaryApprovalStatus ? getLabel(111, "完成") : getLabel(111, "保存并进入下一步")}
],
editBtns: [
{`${getLabel(33564, "查看")}>`}
diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js
index 8cde7da5..f140ab79 100644
--- a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js
+++ b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js
@@ -599,6 +599,7 @@ export default class PayrollGrant extends React.Component {
this.setState({ selectedKey: v }, () => {
+ this.pageInfo = { current: 1, pageSize: 10 };
getInfoList({ salarySendId: currentId, isGranted: v !== "0" });
})}
searchsBasePlaceHolder="请输入姓名" showSearchAd={grantListShowSearchAd} buttonsAd={adBtn}
@@ -652,7 +653,7 @@ export default class PayrollGrant extends React.Component {
this.pageInfo = { current, pageSize };
this.handleShowSizeChange(this.pageInfo);
}}
- scroll={{ y: `calc(100vh - 236px)` }}
+ scroll={{ y: `calc(100vh - 255px)` }}
/> : renderLoading()
}
diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempNormalSet/formRender.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempNormalSet/formRender.js
index b004e177..5e7f1398 100644
--- a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempNormalSet/formRender.js
+++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempNormalSet/formRender.js
@@ -41,7 +41,7 @@ export const payrollTempNormalSetForm = (form, condition, background, onChange =
/>
}
{
- getKey(fields) === "theme" && c.viewAttr === 3 &&
+ getKey(fields) === "theme" && fields.viewAttr === 3 &&
{getLabel(500143, "插入变量")}:
div:last-child {
right: 16px;
}
diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js
index b385a4c2..a141d796 100644
--- a/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js
+++ b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js
@@ -59,6 +59,24 @@ export const conditions = [
lanId: 543358,
defaultshow: true
},
+ {
+ items: [
+ {
+ conditionType: "SWITCH",
+ domkey: ["openSecondaryAccount"],
+ fieldcol: 10,
+ label: "启用主次账号",
+ tip: "启用后,若有次账号相关档案,则此功能不能关闭。",
+ tipLanId: 111,
+ lanId: 111,
+ labelcol: 8,
+ viewAttr: 2
+ }
+ ],
+ title: "主次身份",
+ lanId: 111,
+ defaultshow: true
+ },
{
items: [
{
@@ -134,6 +152,22 @@ export const conditions = [
lanId: 538004,
defaultshow: true
},
+ {
+ items: [
+ {
+ conditionType: "SWITCH",
+ domkey: ["ATTENDANCE_SERIAL_COLLECTION_BTN"],
+ fieldcol: 10,
+ label: "考勤引用是否采集班次数据",
+ lanId: 111,
+ labelcol: 8,
+ viewAttr: 2
+ }
+ ],
+ title: "数据采集",
+ lanId: 111,
+ defaultshow: true
+ },
{
items: [
{
@@ -154,6 +188,15 @@ export const conditions = [
lanId: 111,
labelcol: 8,
viewAttr: 2
+ },
+ {
+ conditionType: "SWITCH",
+ domkey: ["SHOT_EMP_BTN"],
+ fieldcol: 10,
+ label: "启用人事信息快照",
+ lanId: 111,
+ labelcol: 8,
+ viewAttr: 2
}
],
title: "薪资核算",
@@ -179,6 +222,16 @@ export const conditions = [
lanId: 111,
labelcol: 8,
viewAttr: 2
+ },
+ {
+ conditionType: "SELECT",
+ domkey: ["TAX_DECLARATION_DATE_TYPE"],
+ fieldcol: 10,
+ label: "申报日期类型",
+ lanId: 111,
+ labelcol: 8,
+ options: [],
+ viewAttr: 2
}
],
title: "算税规则",
@@ -197,16 +250,16 @@ export const conditions = [
labelcol: 8,
viewAttr: 2
},
- {
- conditionType: "SELECT",
- domkey: ["SALARY_DETAILS_REPORT_SHOW_TYPE"],
- fieldcol: 10,
- label: "薪资明细显示模式",
- lanId: 111,
- options: [],
- labelcol: 8,
- viewAttr: 2
- }
+ // {
+ // conditionType: "SELECT",
+ // domkey: ["SALARY_DETAILS_REPORT_SHOW_TYPE"],
+ // fieldcol: 10,
+ // label: "薪资明细显示模式",
+ // lanId: 111,
+ // options: [],
+ // labelcol: 8,
+ // viewAttr: 2
+ // }
],
title: "薪资报表",
lanId: 111,
diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/form.js b/pc4mobx/hrmSalary/pages/ruleConfig/form.js
index 9b17f248..09a946f8 100644
--- a/pc4mobx/hrmSalary/pages/ruleConfig/form.js
+++ b/pc4mobx/hrmSalary/pages/ruleConfig/form.js
@@ -1,8 +1,9 @@
import React from "react";
-import { WeaFormItem, WeaSearchGroup, WeaTools } from "ecCom";
+import { WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
import { WeaSwitch } from "comsMobx";
const getKey = WeaTools.getKey;
+const getLabel = WeaLocaleProvider.getLabel;
export const renderRuleForm = (form, condition, onChange) => {
const { isFormInit } = form;
@@ -14,7 +15,12 @@ export const renderRuleForm = (form, condition, onChange) => {
items.push({
com: (
+ {fields.label}
+ {fields.tip && }
+ }
+ labelCol={{ span: `${fields.labelcol}` }}
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
tipPosition="bottom">
span {
+ margin-right: 4px;
+ }
+ }
+
.wea-search-group {
background: #fff;
margin-bottom: 16px;
diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js b/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js
index 87680f70..c9f57189 100644
--- a/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js
+++ b/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js
@@ -73,6 +73,13 @@ class RuleConfig extends Component {
...o,
hide: sysinfo["SALARY_APPROVAL_STATUS"] === "0" || _.isNil(sysinfo["SALARY_APPROVAL_STATUS"])
};
+ } else if (getKey(o) === "TAX_DECLARATION_DATE_TYPE") {
+ return {
+ ...o, options: [
+ { key: "0", showname: getLabel(111, "薪资所属月"), selected: true },
+ { key: "1", showname: getLabel(111, "税款所属期"), selected: false }
+ ]
+ };
}
return { ...o, label: getLabel(o.lanId, o.label) };
})
@@ -152,6 +159,10 @@ class RuleConfig extends Component {
case "APPROVAL_CAN_RE_CALC_STATUS":
case "APPROVAL_CAN_EDIT_RESULT_STATUS":
case "SALARY_DETAILS_REPORT_SHOW_TYPE":
+ case "openSecondaryAccount":
+ case "ATTENDANCE_SERIAL_COLLECTION_BTN":
+ case "TAX_DECLARATION_DATE_TYPE":
+ case "SHOT_EMP_BTN":
if (!this.handleDebounce) {
this.handleDebounce = _.debounce(() => {
const confTitle = {
@@ -167,7 +178,11 @@ class RuleConfig extends Component {
APPROVAL_CAN_MANUAL_FILE_STATUS: getLabel(111, "开启审批的核算记录允许手动归档"),
APPROVAL_CAN_RE_CALC_STATUS: getLabel(111, "开启审批的核算记录允许重新核算"),
APPROVAL_CAN_EDIT_RESULT_STATUS: getLabel(111, "审批流程发起后允许修改核算数据"),
- SALARY_DETAILS_REPORT_SHOW_TYPE: getLabel(111, "薪资明细显示模式")
+ SALARY_DETAILS_REPORT_SHOW_TYPE: getLabel(111, "薪资明细显示模式"),
+ openSecondaryAccount: getLabel(111, "启用主次身份"),
+ ATTENDANCE_SERIAL_COLLECTION_BTN: getLabel(111, "考勤引用是否采集班次数据"),
+ TAX_DECLARATION_DATE_TYPE: getLabel(111, "申报日期类型"),
+ SHOT_EMP_BTN: getLabel(111, "启用组织快照"),
};
this.unifiedSettings(key, confTitle[key]);
this.handleDebounce = null;
diff --git a/pc4mobx/hrmSalary/pages/salaryItem/columns.js b/pc4mobx/hrmSalary/pages/salaryItem/columns.js
index b2cae4bd..4cc0d47a 100644
--- a/pc4mobx/hrmSalary/pages/salaryItem/columns.js
+++ b/pc4mobx/hrmSalary/pages/salaryItem/columns.js
@@ -2,56 +2,240 @@ import { WeaLocaleProvider } from "ecCom";
import { dataTypeOptions, patternOptions, roundingModeOptions } from "./options";
const getLabel = WeaLocaleProvider.getLabel;
-export const columns = [
+
+
+export const salaryItemConditions = [
{
- title: "名称",
- dataIndex: "title",
- key: "title"
- },
- {
- title: "属性",
- dataIndex: "title",
- key: "title"
- },
- {
- title: "类型",
- dataIndex: "title",
- key: "title"
- },
- {
- title: "薪资档案引用",
- dataIndex: "refere",
- key: "refere"
- },
- {
- title: "默认使用",
- dataIndex: "refere",
- key: "refere"
- },
- {
- title: "进位规则",
- dataIndex: "title",
- key: "title"
- },
- {
- title: "保留小数位",
- dataIndex: "title",
- key: "title"
- },
- {
- title: "取值方式",
- dataIndex: "title",
- key: "title"
- },
- {
- title: "备注",
- dataIndex: "title",
- key: "title"
- },
- {
- title: "操作",
- dataIndex: "cz",
- key: "cz"
+ items: [
+ {
+ conditionType: "INPUT",
+ domkey: ["name"],
+ fieldcol: 14,
+ label: "名称",
+ lanId: 111,
+ labelcol: 8,
+ value: "",
+ rules: "required|string",
+ viewAttr: 3
+ },
+ {
+ conditionType: "SWITCH",
+ domkey: ["useDefault"],
+ fieldcol: 14,
+ label: "默认使用",
+ lanId: 111,
+ labelcol: 8,
+ value: "0",
+ rules: "required|string",
+ tipLanId: 111,
+ tip: "提示:开启后,每个薪资方案都有该薪资项目,可在具体薪资方案中删除",
+ viewAttr: 3
+ },
+ {
+ conditionType: "SWITCH",
+ domkey: ["hideDefault"],
+ fieldcol: 14,
+ label: "核算时隐藏",
+ lanId: 111,
+ labelcol: 8,
+ value: "0",
+ rules: "required|string",
+ tipLanId: 111,
+ tip: "提示:开启后,在薪资账套中添加该项目时,默认勾选隐藏且在核算时隐藏该薪资项目,可在具体薪资账套中设置是否隐藏",
+ viewAttr: 3
+ },
+ {
+ conditionType: "SELECT",
+ domkey: ["sharedType"],
+ fieldcol: 14,
+ label: "可见性",
+ lanId: 111,
+ labelcol: 8,
+ value: "",
+ options: [],
+ rules: "required|string",
+ viewAttr: 3
+ },
+ {
+ conditionType: "SELECT",
+ domkey: ["taxAgentIds"],
+ fieldcol: 14,
+ label: "可见性范围",
+ lanId: 111,
+ labelcol: 8,
+ value: "",
+ options: [],
+ multiple: true,
+ rules: "",
+ viewAttr: 2,
+ hide: true
+ },
+ {
+ conditionType: "SELECT",
+ domkey: ["dataType"],
+ fieldcol: 14,
+ label: "字段类型",
+ lanId: 111,
+ labelcol: 8,
+ value: "",
+ options: [
+ { key: "number", showname: "数值", lanId: 111, selected: true },
+ { key: "string", showname: "字符", lanId: 111, selected: false }
+ ],
+ rules: "required|string",
+ viewAttr: 3
+ },
+ {
+ conditionType: "SELECT",
+ domkey: ["roundingMode"],
+ fieldcol: 14,
+ label: "舍入规则",
+ lanId: 111,
+ labelcol: 8,
+ value: "",
+ options: [
+ { key: "1", selected: true, showname: "原始数据", lanId: 111 },
+ { key: "2", selected: false, showname: "四舍五入", lanId: 111 },
+ { key: "3", selected: false, showname: "向上舍入", lanId: 111 },
+ { key: "4", selected: false, showname: "向下舍入", lanId: 111 },
+ { key: "5", selected: false, showname: "见分进角", lanId: 111 }
+ ],
+ rules: "required|string",
+ viewAttr: 3
+ },
+ {
+ conditionType: "SELECT",
+ domkey: ["pattern"],
+ fieldcol: 14,
+ label: "保留小数位",
+ lanId: 111,
+ labelcol: 8,
+ value: "2",
+ options: [
+ { key: "0", selected: false, showname: "0" },
+ { key: "1", selected: false, showname: "1" },
+ { key: "2", selected: true, showname: "2" },
+ { key: "3", selected: false, showname: "3" },
+ { key: "4", selected: false, showname: "4" },
+ { key: "5", selected: false, showname: "5" },
+ { key: "6", selected: false, showname: "6" },
+ { key: "7", selected: false, showname: "7" },
+ { key: "8", selected: false, showname: "8" },
+ { key: "9", selected: false, showname: "9" },
+ { key: "10", selected: false, showname: "10" }
+ ],
+ rules: "required|string",
+ viewAttr: 3
+ },
+ {
+ conditionType: "SELECT",
+ domkey: ["valueType"],
+ fieldcol: 14,
+ label: "取值方式",
+ lanId: 111,
+ labelcol: 8,
+ value: "",
+ otherParams: { detailtype: 3 },
+ options: [
+ { key: "1", showname: "输入", selected: true, lanId: 111 },
+ { key: "2", showname: "公式", selected: false, lanId: 111 },
+ { key: "3", showname: "SQL", selected: false, lanId: 111 }
+ ],
+ rules: "required|string",
+ viewAttr: 3
+ },
+ {
+ conditionType: "INPUTNUMBER",
+ domkey: ["defaultValue"],
+ fieldcol: 14,
+ label: "默认值",
+ lanId: 111,
+ labelcol: 8,
+ value: "",
+ otherParams: { precision: 2 },
+ viewAttr: 2
+ },
+ {
+ conditionType: "INPUT",
+ domkey: ["formulaContent"],
+ fieldcol: 14,
+ label: "公式",
+ lanId: 111,
+ labelcol: 8,
+ value: "",
+ viewAttr: 3,
+ hide: true
+ },
+ {
+ conditionType: "INPUT",
+ domkey: ["formulaId"],
+ fieldcol: 14,
+ label: "公式",
+ lanId: 111,
+ labelcol: 8,
+ value: "",
+ viewAttr: 3,
+ hide: true
+ },
+ {
+ conditionType: "INPUTNUMBER",
+ domkey: ["sortedIndex"],
+ fieldcol: 14,
+ label: "显示顺序",
+ lanId: 111,
+ labelcol: 8,
+ value: "",
+ viewAttr: 2
+ },
+ {
+ conditionType: "INPUTNUMBER",
+ domkey: ["width"],
+ fieldcol: 14,
+ label: "显示宽度",
+ lanId: 111,
+ labelcol: 8,
+ value: "",
+ viewAttr: 2
+ },
+ {
+ conditionType: "TEXTAREA",
+ domkey: ["description"],
+ fieldcol: 14,
+ label: "备注",
+ lanId: 111,
+ labelcol: 8,
+ value: "",
+ viewAttr: 2,
+ otherParams: { minRows: 3 }
+ },
+ {
+ conditionType: "SWITCH",
+ domkey: ["useInEmployeeSalary"],
+ fieldcol: 14,
+ label: "薪资档案引用",
+ lanId: 111,
+ labelcol: 8,
+ value: "0",
+ viewAttr: 2,
+ tipLanId: 111,
+ tip: "提示:开启后,该薪资项目不可删除或设为无效,取值方式会默认置为输入",
+ hide: true
+ },
+ {
+
+ conditionType: "SWITCH",
+ domkey: ["systemType"],
+ fieldcol: 14,
+ label: "是否系统默认",
+ lanId: 111,
+ labelcol: 8,
+ value: "0",
+ viewAttr: 2,
+ hide: true
+ }
+ ],
+ title: "",
+ defaultshow: true
}
];
export const salaryItemFields = [
diff --git a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js
index 9e407f56..474eb08c 100644
--- a/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js
+++ b/pc4mobx/hrmSalary/pages/salaryItem/customSalaryItemSlide.js
@@ -1,62 +1,211 @@
import React from "react";
+import { inject, observer } from "mobx-react";
+import { WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTools } from "ecCom";
+import { WeaSwitch } from "comsMobx";
import FormalFormModal from "./formalFormModal";
-import SalaryItemForm from "./salaryItemForm";
-import "./index.less";
+import { salaryItemConditions } from "./columns";
+import { commonEnumList } from "../../apis/archive";
+import { getItemForm } from "../../apis/item";
+import { getTaxAgentSelectList } from "../../apis/taxAgent";
+
+const getLabel = WeaLocaleProvider.getLabel;
+const getKey = WeaTools.getKey;
+
+@inject("salaryItemStore")
+@observer
export default class CustomSalaryItemSlide extends React.Component {
constructor(props) {
super(props);
this.state = {
- showForm: false,
- formalModalVisible: false,
- salaryItemName: ""
+ conditions: [], visible: false
};
}
- handleChange = (params) => {
- this.props.onChange({ ...this.props.request, ...params });
- };
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visible && nextProps.visible) {
+ document.querySelector(".custom_salaryItemSlide").classList.add("zIndex0-weaslide-title");
+ this.initForm(nextProps);
+ } else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
+ document.querySelector(".custom_salaryItemSlide").classList.remove("zIndex0-weaslide-title");
+ this.props.salaryItemStore.initItemsForm();
+ }
+ }
- handleShowFormal = (salaryItemName) => {
+ handleChange = (data) => {
+ const { salaryItemStore: { itemsForm: form } } = this.props;
+ form.updateFields({ formulaContent: { value: data["formula"] }, formulaId: { value: data["id"] } });
+ };
+ initForm = async (props) => {
+ const { data: salaryItemForm } = props.id ?
+ await getItemForm({ id: props.id }) :
+ {
+ data: { sharedType: "0", useDefault: "0", hideDefault: "0", pattern: 2, dataType: "number", valueType: "1" }
+ };
+ const [{ data: sharedTypeList }, { data: taxAgentList }] = await Promise.all([
+ commonEnumList({ enumClass: "com.engine.salary.enums.sicategory.SharedTypeEnum" }),
+ getTaxAgentSelectList()
+ ]);
this.setState({
- formalModalVisible: true,
- salaryItemName
+ conditions: _.map(salaryItemConditions, c => {
+ return {
+ ...c, items: _.map(c.items, fields => {
+ fields = {
+ ...fields, viewAttr: props.showOperateBtn ? fields.viewAttr : 1,
+ label: getLabel(fields.lanId, fields.label),
+ value: !_.isNil(salaryItemForm[getKey(fields)]) ? String(salaryItemForm[getKey(fields)]) : fields.value
+ };
+ switch (getKey(fields)) {
+ case "sharedType":
+ fields = {
+ ...fields, options: _.map(sharedTypeList, o => ({ key: o.value, showname: o.defaultLabel }))
+ };
+ break;
+ case "taxAgentIds":
+ fields = {
+ ...fields, options: _.map(taxAgentList, o => ({ key: o.id, showname: o.content })),
+ hide: String(salaryItemForm["sharedType"]) === "0" || _.isNil(salaryItemForm["sharedType"])
+ };
+ break;
+ case "dataType":
+ case "valueType":
+ fields = {
+ ...fields, options: _.map(fields.options, o => ({ ...o, showname: getLabel(o.lanId, o.showname) }))
+ };
+ break;
+ case "roundingMode":
+ fields = {
+ ...fields, options: _.map(fields.options, o => ({ ...o, showname: getLabel(o.lanId, o.showname) })),
+ hide: String(salaryItemForm["dataType"]) === "string"
+ };
+ break;
+ case "pattern":
+ fields = {
+ ...fields, hide: String(salaryItemForm["dataType"]) === "string"
+ };
+ break;
+ case "defaultValue":
+ const otherParams = String(salaryItemForm["dataType"]) === "number" ? { precision: Number(salaryItemForm["pattern"]) } : {};
+ fields = {
+ ...fields, otherParams,
+ conditionType: String(salaryItemForm["dataType"]) === "string" ? "INPUT" : "INPUTNUMBER",
+ hide: String(salaryItemForm["valueType"]) !== "1"
+ };
+ break;
+ case "formulaContent":
+ fields = {
+ ...fields, hide: String(salaryItemForm["valueType"]) === "1",
+ label: String(salaryItemForm["valueType"]) === "2" ? getLabel(111, "公式") : getLabel(111, "SQL")
+ };
+ break;
+ default:
+ break;
+ }
+ return fields;
+ })
+ };
+ })
+ }, () => {
+ props.salaryItemStore.itemsForm.initFormFields(this.state.conditions);
});
};
-
- // 保存公式成功回调
- handleSaveFormal = (data) => {
- this.handleChange({
- formulaId: data.id, formulaContent: data.formula,
- originFormulaContent: data.referenceType === "formula" ? data.formula : "",
- originSqlContent: data.referenceType === "sql" ? data.formula : ""
+ handleChangeFormItem = (res) => {
+ const { salaryItemStore: { itemsForm: form } } = this.props;
+ const { conditions } = this.state, [key] = _.keys(res), value = res[key].value;
+ this.setState({
+ conditions: _.map(conditions, c => {
+ return {
+ ...c, items: _.map(c.items, fields => {
+ if (key === "sharedType" && getKey(fields) === "taxAgentIds") {
+ fields = { ...fields, viewAttr: value === "0" ? 2 : 3, hide: value === "0" };
+ } else if (key === "dataType" && (getKey(fields) === "roundingMode" || getKey(fields) === "pattern")) {
+ fields = { ...fields, hide: value === "string" };
+ } else if ((key === "dataType" || key === "pattern") && getKey(fields) === "defaultValue") {
+ const otherParams = form.getFormParams().dataType === "number" ? { precision: Number(form.getFormParams().pattern) } : {};
+ fields = {
+ ...fields, otherParams, conditionType: value === "string" ? "INPUT" : "INPUTNUMBER",
+ hide: form.getFormParams().valueType !== "1"
+ };
+ } else if (key === "valueType" && (getKey(fields) === "formulaContent" || getKey(fields) === "defaultValue")) {
+ fields = {
+ ...fields,
+ label: getKey(fields) === "defaultValue" ? fields.label : form.getFormDatas().valueType.valueSpan,
+ hide: (getKey(fields) === "formulaContent" && value === "1") || (getKey(fields) === "defaultValue" && value !== "1")
+ };
+ }
+ return fields;
+ })
+ };
+ })
+ }, () => {
+ form.getFormParams().valueType === "1" &&
+ form.updateFields({ formulaContent: { value: "" }, formulaId: { value: "" } });
+ (form.getFormParams().valueType === "2" || form.getFormParams().valueType === "3") &&
+ form.updateFields({ defaultValue: { value: "" } });
});
};
+ renderForm = () => {
+ const { salaryItemStore: { itemsForm: form } } = this.props;
+ const { conditions } = this.state, { isFormInit } = form, formParams = form.getFormParams();
+ let group = [];
+ isFormInit && conditions.map(c => {
+ let items = [];
+ c.items.map(fields => {
+ items.push({
+ com: (
+
+
+ {
+ getKey(fields) === "formulaContent" && form.getFormParams().valueType !== "1" &&
+ this.props.showOperateBtn &&
+ this.setState({ visible: true })}/>
+ }
+ {
+ fields.tip &&
+ }
+ ),
+ hide: fields.hide
+ });
+ });
+ group.push(
);
+ });
+ return group;
+ };
+ renderTitle = () => {
+ const { title, buttons } = this.props;
+ return ;
+ };
render() {
- const { request } = this.props;
- const { valueType, dataType, formulaId } = request;
- const { formalModalVisible, salaryItemName } = this.state;
- return (
-
-
- {formalModalVisible &&
- {
- this.handleSaveFormal(data);
- }}
- onCancel={() =>
- this.setState({
- formalModalVisible: false,
- salaryItemName: ""
- })}
- />}
-
+ const { onClose, salaryItemStore: { itemsForm: form } } = this.props;
+ const { visible } = this.state;
+ return ( onClose()}
+ content={
+ {this.renderForm()}
+ {visible &&
+ this.setState({ visible: false })}
+ />
+ }
+
}/>
);
}
}
diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.js b/pc4mobx/hrmSalary/pages/salaryItem/index.js
index f6898090..6a9c5f1f 100644
--- a/pc4mobx/hrmSalary/pages/salaryItem/index.js
+++ b/pc4mobx/hrmSalary/pages/salaryItem/index.js
@@ -1,18 +1,16 @@
import React from "react";
import { inject, observer } from "mobx-react";
-import { Button, Dropdown, Menu, message, Modal, Switch } from "antd";
-import { WeaInputSearch, WeaLoadingGlobal, WeaLocaleProvider, WeaNewScroll, WeaSlideModal, WeaTop } from "ecCom";
-import { renderLoading, toDecimal_n } from "../../util";
+import { Button, Dropdown, Menu, message, Modal } from "antd";
+import { WeaInputSearch, WeaLoadingGlobal, WeaLocaleProvider, WeaTop } from "ecCom";
+import * as API from "../../apis/item";
+import SalaryItemsTable from "./salaryItemsTable";
+import { toDecimal_n } from "../../util";
import SystemSalaryItemModal from "./systemSalaryItemModal";
-import { columns } from "./columns";
-import SlideModalTitle from "../../components/slideModalTitle";
import CustomSalaryItemSlide from "./customSalaryItemSlide";
-import CustomPaginationTable from "../../components/customPaginationTable";
import SyncToSalaryAccountSetDialog from "./syncToSalaryAccountSetDialog";
-import "../socialSecurityBenefits/programme/index.less";
import LogDialog from "../../components/logViewModal";
import SalaryItemImportDialog from "./salaryItemImport";
-import * as API from "../../apis/item";
+import "./index.less";
const { getLabel } = WeaLocaleProvider;
@inject("salaryItemStore", "taxAgentStore", "salaryFileStore")
@@ -21,192 +19,83 @@ export default class SalaryItem extends React.Component {
constructor(props) {
super(props);
this.state = {
- value: "",
- selectedKey: "0",
- editable: false,
- isAdd: false,
- searchValue: "",
- formalModalVisible: false,
- searchParams: { current: 1, pageSize: 10, total: 0 },
- selectedRowKeys: [],
- syncSalarySetDialog: { visible: false, title: "", id: "" },
- logDialogVisible: false, filterConditions: "[]",
+ name: "", isQuery: false, loading: false, sysVisible: false,
+ customItemDialog: { visible: false, title: "", buttons: [] },// 自定义薪资项弹窗
+ syncSalarySetDialog: { visible: false, id: "" }, // 同步到薪资账套弹窗
+ logDialogVisible: false, filterConditions: "[]", selectedRowKeys: [],
salaryItemImpDialog: { visible: false, title: getLabel(24023, "数据导入") }
};
- columns.map(item => {
- if (item.dataIndex == "refere") {
- item.render = () => {
- return (
-
- );
- };
- } else if (item.dataIndex == "cz") {
- item.render = () => {
- return ();
- };
-
- }
- });
- this.record = {};
}
-
- componentWillMount() { // 初始化渲染页面
- const { salaryItemStore: { getTableDatas }, salaryFileStore, taxAgentStore } = this.props;
- const { commonEnumList } = salaryFileStore;
- const { fetchTaxAgentOption } = taxAgentStore;
- fetchTaxAgentOption();
- commonEnumList("user", { enumClass: "com.engine.salary.enums.sicategory.SharedTypeEnum" });
- getTableDatas({}).then(res => {
- this.setState({
- searchParams: {
- ...this.state.searchParams,
- current: res.pageNum,
- total: res.total
- }
- });
- });
- }
-
- onEditItem = (record, isedit) => {
- this.record = record;
- const { salaryItemStore: { getItemForm, setEditSlideVisible } } = this.props;
- this.setState({
- editable: isedit, isAdd: false,
- syncSalarySetDialog: { ...this.state.syncSalarySetDialog, id: record.id }
- });
- getItemForm(record.id).then(() => {
- setEditSlideVisible(true);
- }).catch(({ errormsg }) => {
- message.error(errormsg || "");
- });
- };
-
- // 删除列表项
- handleDeleteItem(record) {
- const { salaryItemStore: { deleteItemRequest, getTableDatas } } = this.props;
+ handleDeleteItem = (recordId) => {
+ const { selectedRowKeys, isQuery } = this.state;
+ const params = recordId ? [recordId] : selectedRowKeys;
+ if (_.isEmpty(params)) {
+ message.warning(getLabel(111, "请勾选数据!"));
+ return;
+ }
Modal.confirm({
- title: "信息确认",
- content: "确认删除该条数据吗?",
+ title: getLabel(131329, "信息确认"),
+ content: getLabel(111, "确认删除吗?"),
onOk: () => {
- deleteItemRequest([record.id]).then(() => {
- getTableDatas({ ...this.state.searchParams }).then(res => {
- this.setState({
- searchParams: {
- ...this.state.searchParams,
- total: res.total
- }
- });
- });
+ API.deleteItem(params).then(({ status, errormsg }) => {
+ if (status) {
+ message.success(getLabel(111, "操作成功!"));
+ this.setState({ isQuery: !isQuery });
+ } else {
+ message.error(errormsg);
+ }
});
- },
- onCancel: () => {
}
});
- }
-
- getColumns = () => {
- const { salaryItemStore, taxAgentStore: { showSalaryItemBtn, showOperateBtn } } = this.props;
- const { tableColumns } = salaryItemStore;
- let columns = tableColumns.map(column => {
- let newColumn = column;
- newColumn.render = (text, record, index) => { //前端元素转义
- let valueSpan = record[newColumn.dataIndex + "span"] !== undefined ? record[newColumn.dataIndex + "span"] : record[newColumn.dataIndex];
- switch (newColumn.dataIndex) {
- case "name":
- return {
- this.onEditItem(record, false);
- }}>{text};
- case "useDefault":
- case "hideDefault":
- case "useInEmployeeSalary":
- return ;
- default:
- return ;
- }
- };
- return newColumn;
- });
- columns.push({
- key: "operate",
- title: "操作",
- width: 185,
- render: (text, record) => {
- return (
-
- this.onEditItem(record, true)}>{(showSalaryItemBtn || showOperateBtn) ? "编辑" : "查看"}
- {
- (record.canDelete && (showSalaryItemBtn || showOperateBtn)) &&
- this.handleDeleteItem(record)}
- >{getLabel(535052, "删除")}
- }
-
-
- this.onDropMenuClick("log", record.id)}>{getLabel(545781, "操作日志")}
-
-
- }>
-
-
-
- );
- }
- });
- return [
- // {
- // title: "序号",
- // dataIndex: "index",
- // align: "left",
- // width: 60,
- // render: (text, record, index) => {
- // const { current, pageSize } = this.state.searchParams;
- // return (current - 1) * pageSize + index + 1;
- // }
- // },
- ...columns];
};
+ handleValidateForm = () => {
+ return new Promise((resolve) => {
+ const { salaryItemStore: { itemsForm: form } } = this.props;
+ const { formulaId, valueType, sharedType, taxAgentIds } = form.getFormParams();
+ let taxAgentValidate = true, formulaValidate = true;
+ if (sharedType === "1" && !taxAgentIds) taxAgentValidate = false;
+ if (valueType !== "1" && !formulaId) formulaValidate = false;
+ resolve({ taxAgentValidate, formulaValidate });
+ });
+ };
+ handleSalaryItem = (type) => {
+ const { customItemDialog: { id }, isQuery } = this.state;
+ const { salaryItemStore: { itemsForm: form } } = this.props;
+ Promise.all([form.validateForm(), this.handleValidateForm()])
+ .then(([f1, f2]) => {
+ if (f1.isValid && f2.taxAgentValidate && f2.formulaValidate) {
+ const { formulaContent, valueType, dataType, defaultValue, pattern, ...formData } = form.getFormParams();
+ const key = valueType === "2" ? "originFormulaContent" : valueType === "3" ? "originSqlContent" : "formulaContent";
+ this.setState({ loading: true });
+ API.saveItem({
+ ...formData, valueType, dataType, pattern, [key]: formulaContent, id,
+ defaultValue: dataType === "number" ? toDecimal_n(defaultValue, parseInt(pattern)) : defaultValue
+ }).then(({ status, errormsg }) => {
+ this.setState({ loading: false });
+ if (status) {
+ this.setState({ isQuery: !isQuery }, () => {
+ message.success(getLabel(111, "操作成功"));
+ type === "SAVECREATE" && form.updateFields({
+ name: { value: "" }, formulaContent: { value: "" }, formulaId: { value: "" }
+ });
+ type !== "SAVECREATE" && this.setState({
+ customItemDialog: { ...this.state.customItemDialog, visible: false, id: "" }
+ });
+ });
- handleSearch(value) {
- const { salaryItemStore: { getTableDatas } } = this.props;
- getTableDatas({ ...this.state.searchParams, current: 1, name: value }).then(res => {
- this.setState({
- searchParams: {
- ...this.state.searchParams,
- current: 1,
- total: res.total
+ } else {
+ message.error(errormsg);
+ }
+ });
+ } else {
+ !f1.isValid && f1.showErrors();
+ !f2.taxAgentValidate && f1.showError("taxAgentIds", getLabel(111, "\"可见性范围\"未填写"));
+ !f2.formulaValidate && f1.showError("formulaContent", getLabel(111, `\"${form.getFormDatas().valueType.valueSpan}\"未填写`));
+ this.forceUpdate();
}
});
- });
- }
-
- handlePageChange(value) {
- const { salaryItemStore: { getTableDatas } } = this.props;
- getTableDatas({ ...this.state.searchParams, name: this.state.searchValue, current: value }).then(res => {
- this.setState({
- searchParams: {
- ...this.state.searchParams,
- current: value,
- total: res.total
- }
- });
- });
- }
-
- handleShowSizeChange(searchParams) {
- const { salaryItemStore: { getTableDatas } } = this.props;
- getTableDatas({ ...searchParams });
- }
-
-
+ };
onDropMenuClick = (key, targetid = "") => {
switch (key) {
case "log":
@@ -228,206 +117,84 @@ export default class SalaryItem extends React.Component {
}
});
break;
+ case "customAdd":
+ case "edit":
+ const { taxAgentStore: { showOperateBtn } } = this.props;
+ const { loading } = this.state;
+ const editTitle = !showOperateBtn ? getLabel(111, "查看自定义薪资项目") : getLabel(111, "修改自定义薪资项目");
+ const title = key === "edit" ? editTitle : getLabel(111, "新建自定义薪资项目");
+ const buttons = key === "edit" ? [
+ ,
+
+ ] : [
+ ,
+
+ ];
+ this.setState({
+ customItemDialog: {
+ visible: true, title, buttons: showOperateBtn ? buttons : [], id: targetid
+ }
+ });
+ break;
+ case "delete":
+ this.handleDeleteItem(targetid);
+ break;
+ case "sysAdd":
+ this.setState({ sysVisible: true });
+ break;
default:
break;
}
};
render() {
+ const { taxAgentStore: { showOperateBtn } } = this.props;
const {
- salaryItemStore, salaryFileStore, taxAgentStore: { showOperateBtn, showSalaryItemBtn, taxAgentOption }
- } = this.props;
- const { userStatusList } = salaryFileStore;
- const { selectedRowKeys, logDialogVisible, filterConditions, salaryItemImpDialog } = this.state;
- const { loading, deleteItemRequest, getTableDatas } = salaryItemStore;
- const {
- tableDataSource,
- tableColumns,
- systemItemVisible,
- setSystemItemVisible,
- editSlideVisible,
- setEditSlideVisible,
- request
- } = salaryItemStore;
- if (this.getColumns().length === 2) { // 无权限处理
- return renderLoading();
- }
-
- const handleMenuClick = (e) => {
- const { salaryItemStore: { setEditSlideVisible, initRequest } } = this.props;
- if (e.key === "1") {
- this.setState({ editable: true, isAdd: true });
- initRequest();
- setEditSlideVisible(true);
- } else if (e.key === "2") {
- setSystemItemVisible(true);
- }
- };
-
+ selectedRowKeys, logDialogVisible, filterConditions, name, isQuery, customItemDialog, sysVisible,
+ salaryItemImpDialog
+ } = this.state;
const menu = (
-