Merge branch 'release/2.19.1.2501.01' into custom/金华交投
# Conflicts: # pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js # pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js
This commit is contained in:
commit
cf7da9cf2c
|
|
@ -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);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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]);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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 (<div className="wea-hr-muti-dialog-title">
|
||||
<span>{getLabel(111, "数据选择")}</span>
|
||||
<div/>
|
||||
<span>{this.props.title || getLabel(111, "数据选择")}</span>
|
||||
<div>{this.props.titleOptsComs}</div>
|
||||
</div>);
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loading, listDatas, query, leftListSelectedKeys, rightDatas, rightCheckedKeys } = this.state;
|
||||
const { searchParamsKey, saveLoading } = this.props;
|
||||
const buttons = [
|
||||
<Button type="primary" loading={saveLoading} onClick={this.handleOk}
|
||||
disabled={_.isEmpty(rightDatas)}>{getLabel(111, "确 定")}</Button>,
|
||||
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(111, "取 消")}</Button>];
|
||||
const {
|
||||
loading, listDatas, query, leftListSelectedKeys, rightDatas, rightCheckedKeys, pageInfo, selectedRowKeys,
|
||||
columns
|
||||
} = this.state;
|
||||
const {
|
||||
searchParamsKey, saveLoading, dialogType = "", rowKey, tableOpts = {}, buttons = [
|
||||
<Button type="primary" loading={saveLoading} onClick={this.handleOk}
|
||||
disabled={_.isEmpty(rightDatas)}>{getLabel(111, "确 定")}</Button>,
|
||||
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(111, "取 消")}</Button>
|
||||
]
|
||||
} = 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 });
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</Spin>;
|
||||
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 = <div className="wea-hr-muti-input-table">
|
||||
{this.props.children}
|
||||
<WeaTable dataSource={listDatas} loading={loading} pagination={pagination} scroll={{ y: sheight }}
|
||||
rowSelection={rowSelection} rowKey={rowKey || "id"}
|
||||
columns={!_.isEmpty(tableOpts) ? [...columns, tableOpts] : columns}/>
|
||||
</div>;
|
||||
}
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} initLoadCss ref={dom => 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}</WeaDialog>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 = <WeaCheckbox content={label} value={field.checkboxValue} onChange={(v) => {
|
||||
field.checkboxValue = v === "1";
|
||||
onSelectedChangeHandle && onSelectedChangeHandle(field, v);
|
||||
}}/>;
|
||||
let coms;
|
||||
if (customerRender == null) {
|
||||
coms = <WeaSwitch fieldConfig={{
|
||||
...field, helpfulTip: getLabel(field.helpfulTipLanId || "", field.helpfulTip || ""), ...textAreaProps,
|
||||
hasBorder: false
|
||||
}} form={form} formParams={formParams}/>;
|
||||
} 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: (<WeaFormItem {...itemProps}>{coms}</WeaFormItem>),
|
||||
col
|
||||
});
|
||||
|
||||
if (childrenComponents && childrenComponents[field.domkey[0]]) {
|
||||
childrenComponents[field.domkey[0]]().map(child => formItems.push(child));
|
||||
}
|
||||
});
|
||||
|
||||
groupArr.push(<WeaSearchGroup
|
||||
center={this.props.center != null ? this.props.center : true}
|
||||
needTigger={true}
|
||||
title={formFields.length < 2 ? null : fields.title}
|
||||
showGroup={true}
|
||||
items={formItems}
|
||||
col={col}
|
||||
fontSize={14}/>);
|
||||
});
|
||||
return groupArr;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { formFields, className, form } = this.props;
|
||||
if (formFields == null || !form.isFormInit) return (<div></div>);
|
||||
return (
|
||||
<div className={className}>{this.renderForm()}</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -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 <div style={{ display: "flex", alignItems: "center" }}>
|
||||
<WeaTextarea minRows={2} viewAttr={3} style={{ width: 270 }} value={targetTypeIds}
|
||||
<WeaTextarea minRows={2} viewAttr={3} style={{ width: 270 }} value={targetTypeIdsNames}
|
||||
onChange={val => this.setState({ targetTypeIds: val, targetTypeIdsNames: val })}/>
|
||||
<WeaHelpfulTip style={{ marginLeft: 10 }} width={200} placement="topLeft" title={<SQLHelpTip/>}/>
|
||||
</div>;
|
||||
|
|
|
|||
|
|
@ -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 <a href="javascript:void(0);" onClick={() => this.props.onEditScope(record)}>{text}</a>;
|
||||
}
|
||||
return <span className="tdEllipsis" title={text}>{text}</span>;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -82,6 +82,8 @@
|
|||
}
|
||||
|
||||
.data-detail {
|
||||
padding-bottom: 16px;
|
||||
|
||||
.salary-group {
|
||||
background: #FFF;
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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] : []
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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"],
|
||||
|
|
|
|||
|
|
@ -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 (<React.Fragment>
|
||||
<div className="query-div">
|
||||
{
|
||||
salaryDetailShowType === "1" &&
|
||||
<div className="custom-select">
|
||||
<WeaSelect style={{ width: 200 }} hasAddBtn options={tempPageList} addOnClick={this.handelAddTemp}
|
||||
showSearch optionFilterProp="children" value={templateId}
|
||||
onChange={this.changePageListTemplate}/>
|
||||
{
|
||||
templateId &&
|
||||
<span className="custom-select-edit" title={getLabel(111, "编辑模板")}
|
||||
onClick={() => this.handelAddTemp(templateId)}>
|
||||
<i className="icon-coms-BatchEditing-Hot"></i>
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
<MonthRangePicker dateRange={dateRange} viewAttr={2} onChange={this.props.onChange}/>
|
||||
<AdvanceInputBtn onOpenAdvanceSearch={this.props.handleOpenAdvanceSearch}
|
||||
onAdvanceSearch={this.props.handleAdvanceSearch}/>
|
||||
|
|
@ -269,28 +276,47 @@ class SalaryDetails extends Component {
|
|||
id="atdTable"
|
||||
/>
|
||||
</Spin>
|
||||
<WeaTableComx
|
||||
style={{ display: "none" }}
|
||||
comsWeaTableStore={tableStore}
|
||||
needScroll={true}
|
||||
columns={this.getColumns()}
|
||||
/>
|
||||
{/*<WeaTableComx*/}
|
||||
{/* style={{ display: "none" }}*/}
|
||||
{/* comsWeaTableStore={tableStore}*/}
|
||||
{/* needScroll={true}*/}
|
||||
{/* columns={this.getColumns()}*/}
|
||||
{/*/>*/}
|
||||
{/*默认显示列,薪资模板列表*/}
|
||||
<CustomTransferDialog {...transferDialog} onChange={this.savePageListSetting}
|
||||
<CustomTransferDialog {...transferDialog} ref={dom => this.transferRef = dom}
|
||||
onCancel={() => this.setState({
|
||||
transferDialog: {
|
||||
...transferDialog, completeURL: "", visible: false, type: "default"
|
||||
}
|
||||
})}/>
|
||||
transferDialog: { ...transferDialog, completeURL: "", visible: false }
|
||||
})}
|
||||
buttons={
|
||||
dialogType === "temp" ? [
|
||||
<Button type="primary"
|
||||
onClick={this.handelAddTemp}>{getLabel(111, "存为模板")}</Button>,
|
||||
<Button type="ghost" onClick={() => this.setState({
|
||||
tempManageDialog: {
|
||||
...tempManageDialog, visible: true,
|
||||
completeURL: "/api/bs/hrmsalary/common/pageList/template/pageList"
|
||||
}
|
||||
})}>{getLabel(111, "模板管理")}</Button>
|
||||
] : []
|
||||
}
|
||||
titleOptsComs={
|
||||
dialogType === "temp" ?
|
||||
<WeaSelect style={{ width: 200 }} options={tempPageList}
|
||||
showSearch optionFilterProp="children"
|
||||
value={templateId}
|
||||
onChange={this.changePageListTemplate}/> : null
|
||||
}/>
|
||||
{/*薪资明细模板设置*/}
|
||||
<SalaryDetailsTempDialog {...tempDialog}
|
||||
onCancel={callback => this.setState({
|
||||
tempDialog: { ...tempDialog, visible: false, setting: [] }
|
||||
tempDialog: { ...tempDialog, visible: false, setting: [], heads: [] }
|
||||
}, () => callback && callback())}
|
||||
onSuccess={() => {
|
||||
this.getPageListTemplatelist();
|
||||
this.getSalaryList();
|
||||
}}/>
|
||||
onSuccess={this.getPageListTemplatelist}/>
|
||||
{/*薪资明细自定义列模板管理*/}
|
||||
<SalaryTempMangerDialog {...tempManageDialog} onDelete={this.handleDelTemp} isQuery={tempManageQuery}
|
||||
onSuccess={this.getPageListTemplatelist} onCancel={() => this.setState({
|
||||
tempManageDialog: { ...tempManageDialog, completeURL: "", visible: false }
|
||||
})}/>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
);
|
||||
|
|
@ -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;
|
||||
}, []);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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 {
|
|||
<WeaDialog
|
||||
{...this.props} style={{ width: 480, height: 127 }} initLoadCss title={getLabel(111, "模板保存")}
|
||||
buttons={[<Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button>]}>
|
||||
<div className="form-dialog-layout">{getSearchs(tempForm, conditions, 1, false, this.formFieldChange)}</div>
|
||||
<div
|
||||
className="form-dialog-layout tempDialog">{getSearchs(tempForm, conditions, 1, false, this.formFieldChange)}</div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 (<WeaDialog
|
||||
{...this.props} initLoadCss ref={dom => 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={[
|
||||
<Button type="primary"
|
||||
onClick={() => this.props.onAddTemp(dataParams.id, selectedKeys, heads)}>{getLabel(111, "确 定")}</Button>,
|
||||
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(111, "取 消")}</Button>
|
||||
]}>
|
||||
<WeaTransfer data={dataSource} selectedKeys={selectedKeys} onChange={v => this.setState({ selectedKeys: v })}
|
||||
height={this.dialog ? this.dialog.state.height - 10 : 260}/>
|
||||
</WeaDialog>);
|
||||
}
|
||||
}
|
||||
|
||||
export default SalaryTempAdminDialog;
|
||||
|
|
@ -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 (<CustomTransferDialog ref={dom => 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) => (<React.Fragment>
|
||||
{
|
||||
record.canEdit &&
|
||||
<a href="javascript:void(0);"
|
||||
onClick={() => this.handleTempAdminCols({ id: record.id })}
|
||||
style={{ marginRight: 10 }}>{getLabel(111, "编辑")}</a>
|
||||
}
|
||||
{
|
||||
record.canEdit &&
|
||||
<a href="javascript:void(0);"
|
||||
onClick={() => this.props.onDelete([record.id])}>{getLabel(111, "删除")}</a>
|
||||
}
|
||||
|
||||
</React.Fragment>)
|
||||
}}>
|
||||
<div className="table_opts">
|
||||
<WeaButtonIcon buttonType="add" type="primary" title={getLabel(111, "添加")}
|
||||
onClick={() => this.handleTempAdminCols()}/>
|
||||
<WeaButtonIcon buttonType="del" type="primary" title={getLabel(111, "删除")}
|
||||
onClick={() => this.props.onDelete(selectedRowKeys)} disabled={_.isEmpty(selectedRowKeys)}/>
|
||||
</div>
|
||||
{/*模板管理*/}
|
||||
<SalaryTempAdminDialog {...tempAdminDialog} onAddTemp={this.handelAddTemp} onCancel={() => this.setState({
|
||||
tempAdminDialog: { visible: false, dataParams: { page: "salary_details_report" } }
|
||||
})}/>
|
||||
{/*薪资明细模板设置*/}
|
||||
<SalaryDetailsTempDialog {...tempDialog}
|
||||
onCancel={callback => 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();
|
||||
})}/>
|
||||
</CustomTransferDialog>);
|
||||
}
|
||||
}
|
||||
|
||||
export default SalaryTempMangerDialog;
|
||||
|
|
@ -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" ? [
|
||||
<Button type="primary" onClick={() => this.handleReqBtnsClick("addReport")}>{getLabel(111, "新建报表")}</Button>,
|
||||
|
|
@ -319,8 +315,9 @@ class Index extends Component {
|
|||
icon: <i className="icon-coms-Custom"/>,
|
||||
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: <i className="icon-coms-Custom"/>, content: getLabel(111, "默认显示列"),
|
||||
onClick: () => this.salaryRef.wrappedInstance.handleSetDefCols()
|
||||
}]);
|
||||
return (
|
||||
<WeaReqTop
|
||||
title={getLabel(111, "薪酬统计报表")} icon={<i className="icon-coms-fa"/>} 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" ?
|
||||
<ReportList
|
||||
|
|
@ -354,7 +346,6 @@ class Index extends Component {
|
|||
keyword={keyword} year={year}
|
||||
onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}
|
||||
/> : <SalaryDetails ref={dom => 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 })}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,8 @@ class EditSalaryBaseInfo extends Component {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
return <WeaBrowser {...browserType} viewAttr={3} value={value} valueSpan={valueSpan} inputStyle={{ width: 200 }}
|
||||
return <WeaBrowser {...browserType} viewAttr={this.props.viewAttr === 1 ? 1 : 3}
|
||||
value={value} valueSpan={valueSpan} inputStyle={{ width: 200 }}
|
||||
onChange={(value, valueSpan) => this.props.onChange(_.map(this.props.baseInfo, it => {
|
||||
if (fieldCode === it.fieldCode) {
|
||||
return { ...it, fieldValue: value, fieldValueObj: { id: value, name: valueSpan } };
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<div id="anchorList-contianer" style={{ position: "sticky", top: 8, zIndex: 10086 }}>
|
||||
<div className={classnames("anchor-list-wrapper", { "anchor-list-collapsed": collapsed })}>
|
||||
{
|
||||
collapsed ?
|
||||
<div className="anchor-list-collapsed-btn">
|
||||
<i className="icon-coms02-Initialize-template"
|
||||
onClick={() => this.setState({ collapsed: !collapsed })}/>
|
||||
</div> :
|
||||
<React.Fragment>
|
||||
<div className="anchor-list-header">
|
||||
<i className="icon-coms-right" onClick={() => this.setState({ collapsed: !collapsed })}/>
|
||||
</div>
|
||||
<div className="anchor-list">
|
||||
<div className="anchor-list-ink">
|
||||
<span className="anchor-list-ink-ball visible"
|
||||
style={{ top: `${2.5 + currentIndex * 27.7}px`, height: 23 }}/>
|
||||
</div>
|
||||
{_.map(datas, (o, i) => (
|
||||
<div className={classnames("anchor-list-link", { "anchor-list-link-active": currentIndex === i })}
|
||||
onClick={() => this.onClickAnchor(o, i)}>
|
||||
<span
|
||||
className={classnames("anchor-list-link-title", { "anchor-list-link-title-active": currentIndex === i })}>{o.salarySobItemGroupName}</span>
|
||||
</div>)
|
||||
)}
|
||||
</div>
|
||||
</React.Fragment>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default CalcAnchorList;
|
||||
|
|
@ -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 {
|
|||
/>
|
||||
<EditSalaryCalcSlide {...salaryCalcSlide}
|
||||
onClose={(isFresh) => this.setState({
|
||||
salaryCalcSlide: {
|
||||
visible: false,
|
||||
id: ""
|
||||
}
|
||||
salaryCalcSlide: { visible: false, id: "", viewAttr: 2 }
|
||||
}, () => isFresh === "true" && this.queryCalcResultList())}/>
|
||||
{
|
||||
progressVisible &&
|
||||
|
|
|
|||
|
|
@ -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 <div className="titleDialog">
|
||||
<div className="titleCol titleLeftBox">
|
||||
<div className="titleIcon"><i className="icon-coms-fa"/></div>
|
||||
<div className="title">{getLabel(543559, "编辑薪资")}</div>
|
||||
<div className="title">{viewAttr === 2 ? getLabel(543559, "编辑薪资") : getLabel(111, "查看薪资")}</div>
|
||||
</div>
|
||||
<div className="titleCol titleRightBox">
|
||||
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button>
|
||||
{
|
||||
viewAttr === 2 &&
|
||||
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button>
|
||||
}
|
||||
</div>
|
||||
</div>;
|
||||
};
|
||||
|
|
@ -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={<div className="salary-calculate-esf-area">
|
||||
content={<div className="salary-calculate-esf-area" id="salary_anchor_area">
|
||||
{/*锚点*/}
|
||||
<CalcAnchorList datas={itemsByGroup} visible={this.props.visible}/>
|
||||
<EditSalaryBaseInfo {...this.props} baseInfo={baseInfo}
|
||||
onChange={baseInfo => this.setState({ baseInfo })}/>
|
||||
<WeaTab keyParam="viewcondition" className="calc-esf-tab"
|
||||
|
|
@ -148,12 +153,14 @@ class EditSalaryCalcSlide extends Component {
|
|||
/>
|
||||
{
|
||||
selectedKey === "0" && _.map(itemsByGroup, item => {
|
||||
return <PayrollItemsTable {...item} onChangeIssueReissueValue={this.handleItemValueChange}/>;
|
||||
return <PayrollItemsTable {...this.props} {...item}
|
||||
onChangeIssueReissueValue={this.handleItemValueChange}/>;
|
||||
})
|
||||
}
|
||||
{
|
||||
selectedKey === "1" &&
|
||||
<IssuedAndReissueTable
|
||||
{...this.props}
|
||||
dataSource={issuedAndReissueItems}
|
||||
onChangeIssueReissueValue={this.handleItemValueChange}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,10 +29,11 @@ class IssuedAndReissueTable extends Component {
|
|||
/>
|
||||
</span>,
|
||||
render: (text, record) => {
|
||||
const { canEdit, pattern } = record;
|
||||
const { canEdit, pattern } = record, { viewAttr } = this.props;
|
||||
return <WeaInputNumber
|
||||
disabled={!canEdit}
|
||||
min={0}
|
||||
viewAttr={viewAttr}
|
||||
precision={pattern || 2}
|
||||
value={text || 0}
|
||||
onChange={(value) => onChangeIssueReissueValue(record.salaryItemName, value, "issuedAndReissueItems")}
|
||||
|
|
|
|||
|
|
@ -37,8 +37,9 @@ class PayrollItemsTable extends Component {
|
|||
</span>,
|
||||
width: "20%",
|
||||
render: (text, record) => {
|
||||
const { canEdit, dataType, pattern } = record;
|
||||
const { canEdit, dataType, pattern } = record, { viewAttr } = this.props;
|
||||
return dataType === "number" ? <WeaInputNumber
|
||||
viewAttr={viewAttr}
|
||||
disabled={!canEdit}
|
||||
precision={!_.isNil(pattern) ? pattern : 0}
|
||||
value={text || 0}
|
||||
|
|
@ -46,6 +47,7 @@ class PayrollItemsTable extends Component {
|
|||
/> : <WeaInput
|
||||
disabled={!canEdit}
|
||||
value={text}
|
||||
viewAttr={viewAttr}
|
||||
onChange={(value) => onChangeIssueReissueValue(record.salaryItemId, value, "itemsByGroup", salarySobItemGroupId)}
|
||||
/>;
|
||||
}
|
||||
|
|
@ -66,7 +68,7 @@ class PayrollItemsTable extends Component {
|
|||
}
|
||||
];
|
||||
return (
|
||||
<WeaSearchGroup title={salarySobItemGroupName} showGroup needTigger>
|
||||
<WeaSearchGroup title={salarySobItemGroupName} showGroup needTigger className={`anchor_${salarySobItemGroupId}`}>
|
||||
<WeaTable
|
||||
rowKey="salaryItemId"
|
||||
dataSource={dataSource}
|
||||
|
|
|
|||
|
|
@ -41,8 +41,7 @@ class AttendanceDataViewSlide extends Component {
|
|||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data.pageInfo;
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }, dataSource,
|
||||
// o.dataIndex === "username" ? "left" :
|
||||
columns: _.map(columns, o => ({ ...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 {
|
|||
</div>
|
||||
<WeaTable
|
||||
columns={columns} dataSource={dataSource} bordered pagination={pagination}
|
||||
loading={loading.query} scroll={{ x: 1200, y: `calc(100vh - 225px)` }}/>
|
||||
loading={loading.query} scroll={{ x: 1200, y: `calc(100vh - 240px)` }}/>
|
||||
</div>
|
||||
}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -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({
|
||||
|
|
|
|||
|
|
@ -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 (<WeaInput value={value} viewAttr={1}/>);
|
||||
const { value, label } = props;
|
||||
return (<WeaFormItem label={label} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
|
||||
<WeaInput value={value} viewAttr={1}/>
|
||||
</WeaFormItem>);
|
||||
};
|
||||
export const DataCollectionDateRangePick = (props) => {
|
||||
const { range, label, onChange, format = "YYYY-MM", key } = props;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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, "操作成功"));
|
||||
|
|
|
|||
|
|
@ -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 <a className="ellipsis"
|
||||
href={`javaScript:openhrm(${record.employeeId});`}
|
||||
onClick={e => window.pointerXY(e)}
|
||||
title={text}
|
||||
>
|
||||
{text}
|
||||
</a>;
|
||||
}
|
||||
...item, width: 180,
|
||||
render: (text, record) => (<a className="ellipsis" href={`javaScript:openhrm(${record.employeeId});`}
|
||||
onClick={e => window.pointerXY(e)}
|
||||
title={text}>{text}</a>)
|
||||
};
|
||||
}
|
||||
return {
|
||||
...item,
|
||||
render: (text) => {
|
||||
return <span className="ellipsis" title={text}>{text}</span>;
|
||||
}
|
||||
...item, width: (item.dataIndex === "cardType" || item.dataIndex === "cardNum") ? 180 : 100,
|
||||
render: (text) => (<span className="ellipsis" title={text}>{text}</span>)
|
||||
};
|
||||
})
|
||||
});
|
||||
|
|
@ -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 (<React.Fragment>
|
||||
<span>{getLabel(111, "薪资所属月")}:{declareInfo.salaryMonth}</span>
|
||||
<span style={{ marginLeft: "10px" }}>{getLabel(111, "个税扣缴义务人")}:{declareInfo.taxAgentName}</span>
|
||||
</React.Fragment>);
|
||||
};
|
||||
|
||||
render() {
|
||||
const { declareInfo, loading, pageInfo, columns, dataSource } = this.state;
|
||||
const { loading, pageInfo, columns, dataSource } = this.state;
|
||||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
|
||||
const renderRightOperation = () => {
|
||||
return (
|
||||
<div style={{ display: "inline-block" }}>
|
||||
<Button type="primary" onClick={this.handleExport}>导出</Button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
const renderLeftOperation = () => {
|
||||
return (
|
||||
<div style={{ display: "inline-block", lineHeight: "47px" }}>
|
||||
<span>薪资所属月:{declareInfo.salaryMonth}</span>
|
||||
<span style={{ marginLeft: "10px" }}>个税扣缴义务人:{declareInfo.taxAgentName}</span>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
const buttons = showOperateBtn ? [<Button type="primary"
|
||||
onClick={this.handleExport}>{getLabel(111, "导出全部")}</Button>] : [];
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
|
|
@ -115,23 +93,12 @@ export default class GenerateDeclarationDetail extends React.Component {
|
|||
}, () => this.getDetailList());
|
||||
}
|
||||
};
|
||||
return (
|
||||
<div className="generateDeclarationDetail">
|
||||
<CustomTab
|
||||
searchOperationItem={showOperateBtn && renderRightOperation()}
|
||||
leftOperation={renderLeftOperation()}
|
||||
/>
|
||||
<div className="tableWrapper">
|
||||
<UnifiedTable
|
||||
rowKey="id"
|
||||
columns={columns}
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
loading={loading}
|
||||
xWidth={columns.length * 120}
|
||||
/>
|
||||
</div>
|
||||
return (<WeaTop title={this.renderTitle()} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
||||
buttons={buttons}>
|
||||
<div className="declare-detail-table-container">
|
||||
<WeaTable columns={columns} dataSource={dataSource} pagination={pagination} loading={loading}
|
||||
scroll={{ x: 1200, y: `calc(100vh - 186px)` }}/>
|
||||
</div>
|
||||
);
|
||||
</WeaTop>);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -289,6 +289,7 @@ class LedgerAssociatedPersonnel extends Component {
|
|||
APIFox={APIFox}
|
||||
tabActive={selectedKey}
|
||||
searchValue={searchValue}
|
||||
showOperateBtn={showOperateBtn}
|
||||
onChangeSelectKey={rowKeys => this.setState({ rowKeys })}
|
||||
onEditScope={this.handleAddPersonal}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -18,10 +18,8 @@ class LedgerMovoTo extends Component {
|
|||
];
|
||||
return (
|
||||
<WeaDialog
|
||||
{...extraProps} style={{ width: 440, height: 232 }}
|
||||
buttons={buttons} hasScroll initLoadCss
|
||||
className="moveModalWrapper"
|
||||
>
|
||||
{...extraProps} buttons={buttons} hasScroll initLoadCss className="moveModalWrapper"
|
||||
style={{ width: 440, height: Math.ceil((dataList.length - 1) / 3) * 25 + 41 }}>
|
||||
<WeaSearchGroup showGroup needTigger={false}>
|
||||
<WeaSelect
|
||||
options={_.filter(dataList, item => item.showname === "未分类")}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}]
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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 <Switch checked={text === 1}/>;
|
||||
return <WeaCheckbox value={String(text)} disabled display="switch"/>;
|
||||
default:
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }}/>;
|
||||
}
|
||||
|
|
@ -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 <div className="sys-item-title">
|
||||
<span>{getLabel(111, "添加薪资项目")}</span>
|
||||
<WeaInputSearch value={name} onChange={val => this.setState({ name: val })} style={{ width: 200 }}
|
||||
placeholder={getLabel(111, "请输入薪资项目名称")} onSearch={() => this.setState({
|
||||
pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.listSalaryItem())}/>
|
||||
</div>;
|
||||
};
|
||||
|
||||
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 (
|
||||
<WeaDialog
|
||||
visible={visible} onCancel={onCancel} hasScroll
|
||||
title="添加薪资项目" style={{ width: "80vw", height: 400 }}
|
||||
buttons={[<Button type="primary" onClick={this.handleAdd} disabled={_.isEmpty(selectedRowKeys)}>添加</Button>]}
|
||||
>
|
||||
<div style={{ display: "flex", justifyContent: "flex-end", alignItems: "center", padding: 20 }}>
|
||||
<WeaInputSearch
|
||||
placeholder="请输入薪资项目名称"
|
||||
value={name}
|
||||
onChange={(name) => this.setState({ name })}
|
||||
onSearch={() => this.listSalaryItem({ current: 1 })}
|
||||
/>
|
||||
<WeaDialog {...this.props} initLoadCss className="sys-salary-wrapper" ref={dom => this.sysItemRef = dom}
|
||||
title={this.renderTitle()}
|
||||
buttons={[<Button type="primary" onClick={this.handleAdd}
|
||||
disabled={_.isEmpty(selectedRowKeys)}>{getLabel(111, "添加")}</Button>]}
|
||||
style={{
|
||||
width: "60vw", height: 600, minHeight: 200, minWidth: 380,
|
||||
maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
|
||||
}}>
|
||||
<div className="sys-item-table-box">
|
||||
<Spin spinning={loading.query && pageInfo.total === 0}>
|
||||
<WeaTable columns={this.getSalaryItemAddColumns()} dataSource={dataSource} pagination={pagination}
|
||||
loading={loading.query} scroll={{ y: this.sysItemRef ? this.sysItemRef.state.height - 112 : 600 }}
|
||||
rowKey={record => record.id || record.key} rowSelection={rowSelection}/>
|
||||
</Spin>
|
||||
</div>
|
||||
<WeaTable
|
||||
rowKey={record => record.id || record.key}
|
||||
rowSelection={rowSelection}
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
loading={loading.query}
|
||||
columns={this.getSalaryItemAddColumns()}
|
||||
/>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
|||
>
|
||||
<LedgerSalaryItemTable
|
||||
tableData={items}
|
||||
dataSource={_.find(dataSource, childItem => 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 }
|
||||
})}
|
||||
/>
|
||||
</WeaSearchGroup>;
|
||||
})
|
||||
|
|
@ -198,7 +205,7 @@ class LedgerSalaryItemNormal extends Component {
|
|||
<LedgerSalaryItemAddModal
|
||||
{...addCategoryItemsVisible}
|
||||
itemGroups={dataSource}
|
||||
onCancel={() => this.setState({ addCategoryItemsVisible: { visible: false, id: "" } })}
|
||||
onCancel={() => this.setState({ addCategoryItemsVisible: { visible: false, id: "", record: {} } })}
|
||||
onAddSalaryItems={onAddSalaryItems}
|
||||
/>
|
||||
<CategoryAddModal
|
||||
|
|
|
|||
|
|
@ -128,8 +128,10 @@ class LedgerSalaryItemTable extends Component {
|
|||
formulaContent, formulaId, name,
|
||||
hideDefault: _.isNil(hideDefault) ? "0" : hideDefault,
|
||||
valueType, roundingMode, pattern,
|
||||
originFormulaContent, originSqlContent,
|
||||
useInEmployeeSalary: !_.isNil(useInEmployeeSalary) ? useInEmployeeSalary : "0"
|
||||
useInEmployeeSalary: !_.isNil(useInEmployeeSalary) ? useInEmployeeSalary : "0",
|
||||
//不能改成其他空值
|
||||
originFormulaContent: _.isNil(originFormulaContent) ? formulaContent : originFormulaContent,
|
||||
originSqlContent: _.isNil(originSqlContent) ? formulaContent : originSqlContent
|
||||
},
|
||||
record,
|
||||
userStatusList: _.map(userStatusList, it => ({ key: it.value.toString(), showname: it.defaultLabel }))
|
||||
|
|
@ -288,18 +290,22 @@ class LedgerSalaryItemTable extends Component {
|
|||
width: 80,
|
||||
render: (text, record) => <WeaCheckbox
|
||||
value={text ? String(text) : !text ? "0" : "1"}
|
||||
onChange={value => 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) => (
|
||||
<React.Fragment>
|
||||
<a href="javascript:void(0);" onClick={() => this.handleEditSalaryItem(record)}
|
||||
style={{ marginRight: 10 }}>编辑</a>
|
||||
<a href="javascript:void(0);" onClick={() => this.props.onAddCategoryItems(record)}
|
||||
style={{ marginRight: 10 }}>{getLabel(111, "插入")}</a>
|
||||
<a href="javascript:void(0);" onClick={() => onMoveTo(record)}>移动到</a>
|
||||
</React.Fragment>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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 {
|
|||
<Button type="ghost"
|
||||
onClick={() => this.setState({ current: current - 1 })}>{getLabel(111, "上一步")}</Button>,
|
||||
<Button type="primary"
|
||||
onClick={() => this.setState({ current: current + 1 }, () => this.saveLedgerAdjustRule())}>{getLabel(111, "保存并进入下一步")}</Button>
|
||||
onClick={() => this.setState({ current: !salaryApprovalStatus ? current : current + 1 }, () => this.saveLedgerAdjustRule())}>{!salaryApprovalStatus ? getLabel(111, "完成") : getLabel(111, "保存并进入下一步")}</Button>
|
||||
],
|
||||
editBtns: [
|
||||
<Button type="primary" loading={loading}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class Index extends Component {
|
|||
<span>{moment(it.sendTime).format("YYYY-MM")}</span>
|
||||
</div>
|
||||
<a
|
||||
href={`/spa/hrmSalary/static/index.html#/main/hrmSalary/mobilepayroll?id=${it.id}&recipient=${it.employeeId}&type=phone`}
|
||||
href={`/spa/hrmSalary/static/index.html#/main/hrmSalary/mobilepayroll?id=${it.id}&salaryCode=${it.salaryCode}&type=phone`}
|
||||
target="_blank">
|
||||
{`${getLabel(33564, "查看")}>`}
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -599,6 +599,7 @@ export default class PayrollGrant extends React.Component {
|
|||
<WeaTab
|
||||
datas={topTab} keyParam="viewcondition" selectedKey={selectedKey} searchType={["base", "advanced"]}
|
||||
onChange={v => 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()
|
||||
}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ export const payrollTempNormalSetForm = (form, condition, background, onChange =
|
|||
/>
|
||||
}
|
||||
{
|
||||
getKey(fields) === "theme" && c.viewAttr === 3 &&
|
||||
getKey(fields) === "theme" && fields.viewAttr === 3 &&
|
||||
<div className="sft-variables">
|
||||
<span className="sftv-tip">{getLabel(500143, "插入变量")}:</span>
|
||||
<a className="sftv-item"
|
||||
|
|
|
|||
|
|
@ -20,6 +20,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
.wea-new-top-req {
|
||||
z-index: 0 !important;
|
||||
}
|
||||
|
||||
.wea-new-top-req-wapper .wea-new-top-req-title > div:last-child {
|
||||
right: 16px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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: (
|
||||
<WeaFormItem
|
||||
label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
|
||||
label={<div className="customFormLabel">
|
||||
<span>{fields.label}</span>
|
||||
{fields.tip && <WeaHelpfulTip width={200} title={getLabel(fields.tipLanId, fields.tip)}
|
||||
placement="topLeft"/>}
|
||||
</div>}
|
||||
labelCol={{ span: `${fields.labelcol}` }}
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
|
||||
tipPosition="bottom">
|
||||
<WeaSwitch
|
||||
|
|
|
|||
|
|
@ -8,6 +8,19 @@
|
|||
height: 100%;
|
||||
overflow: hidden auto;
|
||||
|
||||
.wea-form-item .wea-form-item-label.colon:after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.customFormLabel {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
& > span {
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-search-group {
|
||||
background: #fff;
|
||||
margin-bottom: 16px;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 = [
|
||||
|
|
|
|||
|
|
@ -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: (
|
||||
<WeaFormItem label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)} tipPosition="bottom">
|
||||
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams} onChange={this.handleChangeFormItem}/>
|
||||
{
|
||||
getKey(fields) === "formulaContent" && form.getFormParams().valueType !== "1" &&
|
||||
this.props.showOperateBtn &&
|
||||
<div className="formula_input_div" onClick={() => this.setState({ visible: true })}/>
|
||||
}
|
||||
{
|
||||
fields.tip && <WeaHelpfulTip
|
||||
style={{ marginLeft: 16 }} width={350} title={getLabel(fields.tipLanId, fields.tip)}
|
||||
placement="topLeft"/>
|
||||
}
|
||||
</WeaFormItem>),
|
||||
hide: fields.hide
|
||||
});
|
||||
});
|
||||
group.push(<WeaSearchGroup col={1} needTigger showGroup={c.defaultshow} items={items}/>);
|
||||
});
|
||||
return group;
|
||||
};
|
||||
renderTitle = () => {
|
||||
const { title, buttons } = this.props;
|
||||
return <div className="titleDialog">
|
||||
<div className="titleCol titleLeftBox">
|
||||
<div className="titleIcon"><i className="icon-coms-fa"/></div>
|
||||
<div className="title">{title}</div>
|
||||
</div>
|
||||
<div className="titleCol titleRightBox">{buttons}</div>
|
||||
</div>;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { request } = this.props;
|
||||
const { valueType, dataType, formulaId } = request;
|
||||
const { formalModalVisible, salaryItemName } = this.state;
|
||||
return (
|
||||
<div className="customSalaryItemSlide">
|
||||
<SalaryItemForm {...this.props} onChangeFieldsItem={this.handleChange} onShowFormal={this.handleShowFormal}/>
|
||||
{formalModalVisible &&
|
||||
<FormalFormModal
|
||||
name={salaryItemName}
|
||||
formulaId={formulaId}
|
||||
visible={formalModalVisible}
|
||||
valueType={valueType}
|
||||
dataType={dataType}
|
||||
onSaveFormal={data => {
|
||||
this.handleSaveFormal(data);
|
||||
}}
|
||||
onCancel={() =>
|
||||
this.setState({
|
||||
formalModalVisible: false,
|
||||
salaryItemName: ""
|
||||
})}
|
||||
/>}
|
||||
</div>
|
||||
const { onClose, salaryItemStore: { itemsForm: form } } = this.props;
|
||||
const { visible } = this.state;
|
||||
return (<WeaSlideModal
|
||||
className="custom_salaryItemSlide"{...this.props}
|
||||
top={0} width={800} height={100} measureT="%" measureX="px" measureY="%"
|
||||
direction="right" title={this.renderTitle()} onClose={() => onClose()}
|
||||
content={<div className="form-dialog-layout">
|
||||
{this.renderForm()}
|
||||
{visible &&
|
||||
<FormalFormModal
|
||||
formulaId={form.getFormParams().formulaId}
|
||||
visible={visible}
|
||||
name={form.getFormParams().name}
|
||||
valueType={form.getFormParams().valueType}
|
||||
dataType={form.getFormParams().dataType}
|
||||
onSaveFormal={this.handleChange}
|
||||
onCancel={() => this.setState({ visible: false })}
|
||||
/>
|
||||
}
|
||||
</div>}/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<Switch/>
|
||||
);
|
||||
};
|
||||
} else if (item.dataIndex == "cz") {
|
||||
item.render = () => {
|
||||
return (<div>
|
||||
<a style={{ marginRight: "10px" }}>编辑</a>
|
||||
<a style={{ marginRight: "10px" }}>删除</a>
|
||||
{/* <a>操作日志</a> */}
|
||||
</div>);
|
||||
};
|
||||
|
||||
}
|
||||
});
|
||||
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 <a onClick={() => {
|
||||
this.onEditItem(record, false);
|
||||
}}>{text}</a>;
|
||||
case "useDefault":
|
||||
case "hideDefault":
|
||||
case "useInEmployeeSalary":
|
||||
return <Switch checked={text === 1} disabled/>;
|
||||
default:
|
||||
return <div dangerouslySetInnerHTML={{ __html: valueSpan }}/>;
|
||||
}
|
||||
};
|
||||
return newColumn;
|
||||
});
|
||||
columns.push({
|
||||
key: "operate",
|
||||
title: "操作",
|
||||
width: 185,
|
||||
render: (text, record) => {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<a
|
||||
onClick={() => this.onEditItem(record, true)}>{(showSalaryItemBtn || showOperateBtn) ? "编辑" : "查看"}</a>
|
||||
{
|
||||
(record.canDelete && (showSalaryItemBtn || showOperateBtn)) &&
|
||||
<a href="javascript:void(0)" style={{ marginLeft: 10 }}
|
||||
onClick={() => this.handleDeleteItem(record)}
|
||||
>{getLabel(535052, "删除")}</a>
|
||||
}
|
||||
<Dropdown
|
||||
overlay={
|
||||
<Menu>
|
||||
<Menu.Item>
|
||||
<a href="javascript:void(0);"
|
||||
onClick={() => this.onDropMenuClick("log", record.id)}>{getLabel(545781, "操作日志")}</a>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
}>
|
||||
<a href="javascript:void(0)" style={{ marginLeft: 10 }}><i className="icon-coms-more"/></a>
|
||||
</Dropdown>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
});
|
||||
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" ? [
|
||||
<Button type="ghost" onClick={() => this.setState({
|
||||
syncSalarySetDialog: { visible: true, id: targetid }
|
||||
})}>{getLabel(111, "同步到薪资账套")}</Button>,
|
||||
<Button type="primary" loading={loading}
|
||||
onClick={() => this.handleSalaryItem("SAVE")}>{getLabel(111, "保存")}</Button>
|
||||
] : [
|
||||
<Button type="primary" loading={loading}
|
||||
onClick={() => this.handleSalaryItem("SAVE")}>{getLabel(111, "保存")}</Button>,
|
||||
<Button type="ghost" loading={loading}
|
||||
onClick={() => this.handleSalaryItem("SAVECREATE")}>{getLabel(111, "保存并继续创建")}</Button>
|
||||
];
|
||||
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 = (
|
||||
<Menu onClick={handleMenuClick}>
|
||||
<Menu.Item key="2">{getLabel(111, "新增系统薪资项")}</Menu.Item>
|
||||
<Menu onClick={({ key }) => this.onDropMenuClick(key)}>
|
||||
<Menu.Item key="sysAdd">{getLabel(111, "新增系统薪资项")}</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
|
||||
const buttons = [
|
||||
let buttons = [
|
||||
<Dropdown.Button overlay={menu} type="primary"
|
||||
onClick={() => handleMenuClick({ key: "1" })}>{getLabel(111, "新增自定义薪资项")}</Dropdown.Button>,
|
||||
<Button type="primary" onClick={() => {
|
||||
if (!selectedRowKeys.length) {
|
||||
message.info("未选中任何数据!");
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: `确定要将所选的薪资项(共${selectedRowKeys.length}条数据)删除吗?`,
|
||||
onOk: () => {
|
||||
deleteItemRequest(selectedRowKeys).then(() => {
|
||||
getTableDatas({ ...this.state.searchParams }).then(res => {
|
||||
this.setState({
|
||||
selectedRowKeys: [],
|
||||
searchParams: {
|
||||
...this.state.searchParams,
|
||||
total: res.total
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}}>{getLabel(32136, "批量删除")}</Button>,
|
||||
<WeaInputSearch value={this.state.searchValue} placeholder={getLabel(111, "请输入名称")}
|
||||
onChange={value => this.setState({ searchValue: value })}
|
||||
onSearch={value => this.handleSearch(value)}/>
|
||||
onClick={() => this.onDropMenuClick("customAdd")}>{getLabel(111, "新增自定义薪资项")}</Dropdown.Button>,
|
||||
<Button type="ghost" onClick={() => this.handleDeleteItem()}>{getLabel(32136, "批量删除")}</Button>,
|
||||
<WeaInputSearch value={name} onChange={val => this.setState({ name: val })}
|
||||
placeholder={getLabel(111, "请输入名称")} onSearch={() => this.setState({ isQuery: !isQuery })}/>
|
||||
];
|
||||
// 新建和修改保存的回调
|
||||
const handleSlideSave = (continueFlag) => {
|
||||
const { salaryItemStore: { saveItem, request, getTableDatas } } = this.props;
|
||||
const payload = _.cloneDeep(request);
|
||||
const { name, sharedType, taxAgentIds } = request;
|
||||
if (!name || (sharedType === "1" && !taxAgentIds)) {
|
||||
Modal.warning({
|
||||
title: "信息确认",
|
||||
content: "必要信息不完整,红色*为必填项!"
|
||||
});
|
||||
return;
|
||||
}
|
||||
const { pattern, defaultValue, dataType, ...extra } = payload;
|
||||
saveItem({
|
||||
...extra, pattern, dataType,
|
||||
defaultValue: dataType === "number" ? toDecimal_n(defaultValue, parseInt(pattern)) : defaultValue
|
||||
}, continueFlag)
|
||||
.then(() => {
|
||||
getTableDatas({ ...this.state.searchParams }).then(res => {
|
||||
this.setState({
|
||||
searchParams: {
|
||||
...this.state.searchParams,
|
||||
total: res.total
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const renderCustomOperate = () => {
|
||||
let arrList = [];
|
||||
if (this.state.isAdd) {
|
||||
arrList = [
|
||||
<Button type="primary" onClick={() => {
|
||||
handleSlideSave(false);
|
||||
}}>保存</Button>,
|
||||
<Button type="default" onClick={() => {
|
||||
handleSlideSave(true);
|
||||
}}>保存并继续创建</Button>
|
||||
];
|
||||
} else if (this.state.editable) {
|
||||
arrList = [
|
||||
<Button type="ghost"
|
||||
onClick={() => this.setState({
|
||||
syncSalarySetDialog: {
|
||||
...this.state.syncSalarySetDialog,
|
||||
visible: true,
|
||||
title: getLabel(111, "请选择薪资账套")
|
||||
}
|
||||
})}
|
||||
>{getLabel(111, "同步到薪资账套")}</Button>,
|
||||
<Button type="primary" onClick={() => {
|
||||
handleSlideSave(true);
|
||||
}}>保存</Button>
|
||||
];
|
||||
}
|
||||
return arrList;
|
||||
};
|
||||
|
||||
const handleSaveSlideChange = (value) => {
|
||||
const { salaryItemStore: { setRequest } } = this.props;
|
||||
setRequest(value);
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
|
||||
// getCheckboxProps: record => ({
|
||||
// disabled: !record.canDelete // Column configuration not to be checked
|
||||
// })
|
||||
};
|
||||
let dropMenuDatas = [
|
||||
{ key: "import", icon: <i className="icon-coms02-Template-import1"/>, content: getLabel(111, "导入") },
|
||||
{ key: "export", icon: <i className="iconfont icon-daochu"/>, content: getLabel(111, "导出") },
|
||||
{ key: "log", icon: <i className="iconfont icon-caozuorizhi32"/>, content: getLabel(545781, "操作日志") }
|
||||
];
|
||||
!showOperateBtn && (buttons = buttons.slice(-1));
|
||||
!showOperateBtn && (dropMenuDatas = dropMenuDatas.slice(-1));
|
||||
return (
|
||||
<div className="mySalaryBenefitsWrapper">
|
||||
<WeaTop title="薪资项目管理" icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
||||
showDropIcon onDropMenuClick={this.onDropMenuClick}
|
||||
dropMenuDatas={[
|
||||
{
|
||||
key: "import",
|
||||
icon: <i className="icon-coms02-Template-import1"/>,
|
||||
content: getLabel(111, "导入")
|
||||
},
|
||||
{
|
||||
key: "export",
|
||||
icon: <i className="iconfont icon-daochu"/>,
|
||||
content: getLabel(111, "导出")
|
||||
},
|
||||
{
|
||||
key: "log", icon: <i className="iconfont icon-caozuorizhi32"/>,
|
||||
content: getLabel(545781, "操作日志")
|
||||
}
|
||||
]} buttons={(showOperateBtn || showSalaryItemBtn) ? buttons : buttons.slice(-1)}>
|
||||
<div className="tableWrapper">
|
||||
<WeaNewScroll height="100%">
|
||||
<CustomPaginationTable
|
||||
rowKey={record => record.id}
|
||||
loading={loading}
|
||||
rowSelection={rowSelection}
|
||||
dataSource={tableDataSource}
|
||||
columns={this.getColumns(tableColumns)}
|
||||
total={this.state.searchParams.total}
|
||||
current={this.state.searchParams.current}
|
||||
pageSize={this.state.searchParams.pageSize}
|
||||
onPageChange={(value) => {
|
||||
this.handlePageChange(value);
|
||||
}}
|
||||
onShowSizeChange={(current, pageSize) => {
|
||||
this.setState({
|
||||
searchParams: {
|
||||
...this.state.searchParams,
|
||||
current,
|
||||
pageSize
|
||||
}
|
||||
}, () => {
|
||||
this.handleShowSizeChange({ name: this.state.searchValue, ...this.state.searchParams });
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</WeaNewScroll>
|
||||
<React.Fragment>
|
||||
<WeaTop title={getLabel(111, "薪资项目管理")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
||||
buttons={buttons} showDropIcon onDropMenuClick={this.onDropMenuClick} dropMenuDatas={dropMenuDatas}
|
||||
className="salaryProjectManagement">
|
||||
<div className="salaryItems_content">
|
||||
<SalaryItemsTable {...this.props} name={name} isQuery={isQuery} showOperateBtn={showOperateBtn}
|
||||
selectedRowKeys={selectedRowKeys} onDropMenuClick={this.onDropMenuClick}
|
||||
onChange={val => this.setState({ selectedRowKeys: val })}/>
|
||||
</div>
|
||||
</WeaTop>
|
||||
{/*添加系统薪资项目*/}
|
||||
<SystemSalaryItemModal visible={sysVisible} onSearch={() => this.setState({ isQuery: !isQuery })}
|
||||
onCancel={(callback) => this.setState({ sysVisible: false }, () => callback && callback())}/>
|
||||
{/*同步薪资账套*/}
|
||||
<SyncToSalaryAccountSetDialog
|
||||
{...this.state.syncSalarySetDialog}
|
||||
onCancel={() => this.setState({
|
||||
syncSalarySetDialog: {
|
||||
...this.state.syncSalarySetDialog,
|
||||
visible: false, title: ""
|
||||
}
|
||||
})}
|
||||
/>
|
||||
onCancel={() => this.setState({ syncSalarySetDialog: { visible: false, id: "" } })}/>
|
||||
{/*操作日志*/}
|
||||
<LogDialog visible={logDialogVisible} logFunction="salaryitem" filterConditions={filterConditions}
|
||||
onCancel={() => this.setState({ logDialogVisible: false })}/>
|
||||
|
|
@ -436,61 +203,15 @@ export default class SalaryItem extends React.Component {
|
|||
onCancel={callback => {
|
||||
this.setState({
|
||||
salaryItemImpDialog: { ...salaryItemImpDialog, visible: false }
|
||||
}, () => callback && this.handleSearch(this.state.searchValue));
|
||||
}, () => callback && this.setState({ isQuery: !isQuery }));
|
||||
}}/>
|
||||
{
|
||||
systemItemVisible &&
|
||||
<SystemSalaryItemModal
|
||||
visible={systemItemVisible}
|
||||
onCancel={() => {
|
||||
setSystemItemVisible(false);
|
||||
}}
|
||||
onInitTableList={() => {
|
||||
getTableDatas({ ...this.state.searchParams, name: this.state.searchValue }).then(res => {
|
||||
this.setState({
|
||||
searchParams: {
|
||||
...this.state.searchParams,
|
||||
total: res.total
|
||||
}
|
||||
});
|
||||
});
|
||||
}}
|
||||
/>
|
||||
}
|
||||
{
|
||||
editSlideVisible &&
|
||||
<WeaSlideModal
|
||||
className="slideOuterWrapper"
|
||||
visible={editSlideVisible}
|
||||
top={0}
|
||||
measureT="%"
|
||||
width={800}
|
||||
measureX="px"
|
||||
height={100}
|
||||
measureY="%"
|
||||
direction={"right"}
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={(this.state.isAdd ? "新建" : "修改") + "自定义薪资项目"}
|
||||
editable={false}
|
||||
showOperateBtn={(showSalaryItemBtn || showOperateBtn)}
|
||||
customOperate={(showSalaryItemBtn || showOperateBtn) ? renderCustomOperate() : []}
|
||||
/>
|
||||
}
|
||||
content={
|
||||
<CustomSalaryItemSlide
|
||||
record={this.record} editable={this.state.editable}
|
||||
isAdd={this.state.isAdd} request={request}
|
||||
userStatusList={userStatusList}
|
||||
taxAgentAdminOption={taxAgentOption}
|
||||
onChange={(value) => {
|
||||
handleSaveSlideChange(value);
|
||||
}}/>
|
||||
}
|
||||
onClose={() => setEditSlideVisible(false)}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
{/*新增编辑自定义薪资项目*/}
|
||||
<CustomSalaryItemSlide {...customItemDialog} onSearch={() => this.setState({ isQuery: !isQuery })}
|
||||
showOperateBtn={showOperateBtn}
|
||||
onClose={callback => this.setState({
|
||||
customItemDialog: { ...customItemDialog, visible: false, id: "" }
|
||||
}, () => callback && callback())}/>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,91 @@
|
|||
//薪资项目重构项
|
||||
.salaryProjectManagement {
|
||||
.wea-input-focus {
|
||||
height: 31.36px;
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
.salaryItems_content {
|
||||
height: 100%;
|
||||
padding: 8px 16px;
|
||||
background: #f6f6f6;
|
||||
|
||||
.wea-new-table {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.custom_salaryItemSlide {
|
||||
.wea-slide-modal-title {
|
||||
border-bottom: 1px solid #e5e5e5 !important;
|
||||
}
|
||||
|
||||
.wea-slide-modal-content {
|
||||
height: 100%;
|
||||
background: #f6f6f6;
|
||||
|
||||
.wea-form-item-wrapper {
|
||||
//display: block !important;
|
||||
|
||||
.formula_input_div {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.titleDialog {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 46px 0 16px;
|
||||
|
||||
.titleCol {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.titleLeftBox {
|
||||
.titleIcon {
|
||||
color: #fff;
|
||||
margin: 0;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
font-size: 22px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #F14A2D;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
padding-left: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
.titleRightBox {
|
||||
justify-content: flex-end;
|
||||
|
||||
button {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.customSalaryItemSlide {
|
||||
padding: 16px;
|
||||
|
||||
|
|
@ -62,20 +150,20 @@
|
|||
|
||||
//系统薪资项添加modal
|
||||
.sys-salary-wrapper {
|
||||
.wea-dialog-body {
|
||||
height: 50vh;
|
||||
overflow: hidden auto;
|
||||
.sys-item-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.headerSearchWrapper {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
padding: 16px 20px;
|
||||
.sys-item-table-box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #F6F6F6;
|
||||
padding: 8px 16px;
|
||||
|
||||
.wea-tab {
|
||||
width: 100%;
|
||||
border-bottom: none;
|
||||
}
|
||||
.wea-new-table {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ export const roundingModeOptions = [
|
|||
showname: "见分进角"
|
||||
}
|
||||
];
|
||||
|
||||
export const patternOptions = [
|
||||
{
|
||||
key: "0",
|
||||
|
|
@ -83,7 +82,6 @@ export const patternOptions = [
|
|||
selected: false
|
||||
}
|
||||
];
|
||||
|
||||
export const dataTypeOptions = [
|
||||
{
|
||||
key: "number",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,111 @@
|
|||
/*
|
||||
* 薪资项目管理
|
||||
* 表格
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/8/16
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaCheckbox, WeaLocaleProvider, WeaTable } from "ecCom";
|
||||
import { Dropdown, Menu, Spin } from "antd";
|
||||
import * as API from "../../apis/item";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class SalaryItemsTable extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, columns: [], dataSource: [],
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 }
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.getItemList(this.props);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.isQuery !== this.props.isQuery) this.setState({
|
||||
pageInfo: { ...this.state.pageInfo, current: 1 }
|
||||
}, () => this.getItemList(nextProps));
|
||||
}
|
||||
|
||||
getItemList = (props) => {
|
||||
const { name } = props;
|
||||
const { pageInfo } = this.state;
|
||||
const payload = { name, ...pageInfo };
|
||||
this.setState({ loading: true });
|
||||
API.getItemList(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
dataSource, pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
columns: _.map(columns, o => {
|
||||
if (o.dataIndex === "useDefault" || o.dataIndex === "hideDefault" || o.dataIndex === "useInEmployeeSalary") {
|
||||
return { ...o, width: 80, render: text => <WeaCheckbox value={String(text)} disabled display="switch"/> };
|
||||
}
|
||||
return { ...o };
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { dataSource, columns, pageInfo, loading } = this.state;
|
||||
const { selectedRowKeys, onChange, onDropMenuClick, showOperateBtn } = this.props;
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: total => `${getLabel(111, "共")} ${total} ${getLabel(111, "条")}`,
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize }
|
||||
}, () => this.getItemList(this.props));
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getItemList(this.props));
|
||||
}
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys, onChange,
|
||||
getCheckboxProps: record => ({ disabled: !record.canDelete })
|
||||
};
|
||||
return (<Spin spinning={loading && pageInfo.total === 0}>
|
||||
<WeaTable rowKey="id" dataSource={dataSource} rowSelection={rowSelection} pagination={pagination}
|
||||
loading={loading} scroll={{ y: `calc(100vh - 180px)` }}
|
||||
columns={[
|
||||
...columns, {
|
||||
dataIndex: "opt", title: getLabel(111, "操作"), width: 140,
|
||||
render: (__, record) => (<React.Fragment>
|
||||
<a style={{ marginRight: 8 }} onClick={() => onDropMenuClick("edit", record.id)}
|
||||
href="javascript:void(0);">{showOperateBtn ? getLabel(111, "编辑") : getLabel(111, "查看")}</a>
|
||||
{
|
||||
showOperateBtn && record.canDelete &&
|
||||
<a style={{ marginRight: 8 }} href="javascript:void(0);"
|
||||
onClick={() => onDropMenuClick("delete", record.id)}>{getLabel(111, "删除")}</a>
|
||||
}
|
||||
<Dropdown overlay={
|
||||
<Menu>
|
||||
<Menu.Item>
|
||||
<a href="javascript:void(0);"
|
||||
onClick={() => onDropMenuClick("log", record.id)}>{getLabel(545781, "操作日志")}</a>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
}>
|
||||
<a href="javascript:void(0)"><i className="icon-coms-more"/></a>
|
||||
</Dropdown>
|
||||
</React.Fragment>)
|
||||
}
|
||||
]}/>
|
||||
</Spin>);
|
||||
}
|
||||
}
|
||||
|
||||
export default SalaryItemsTable;
|
||||
|
|
@ -51,7 +51,6 @@ class SyncToSalaryAccountSetDialog extends Component {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
save = () => {
|
||||
const { salaryItemStore: { salarySetform }, id: salaryItemId } = this.props;
|
||||
salarySetform.validateForm().then(f => {
|
||||
|
|
@ -79,14 +78,12 @@ class SyncToSalaryAccountSetDialog extends Component {
|
|||
const { conditions } = this.state;
|
||||
return (
|
||||
<WeaDialog
|
||||
{...this.props} className="salarySetDialog" initLoadCss
|
||||
style={{ width: 480 }}
|
||||
{...this.props} className="salarySetDialog" initLoadCss title={getLabel(111, "请选择薪资账套")}
|
||||
style={{ width: 480, height: _.reduce(conditions, (pre, cur) => (pre += cur.items.length), 0) * 47 + 33 }}
|
||||
buttons={[<Button type="primary" onClick={this.save}
|
||||
loading={this.state.loading}>{getLabel(537558, "确定")}</Button>]}
|
||||
>
|
||||
<div className="salarySetDialogContent">
|
||||
{getSearchs(salarySetform, conditions, 1)}
|
||||
</div>
|
||||
<div className="salarySetDialogContent"> {getSearchs(salarySetform, conditions, 1, false)} </div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
import React from "react";
|
||||
import { WeaDialog, WeaLocaleProvider, WeaTab } from "ecCom";
|
||||
import { Button, message } from "antd";
|
||||
import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaTable } from "ecCom";
|
||||
import { Button, message, Spin } from "antd";
|
||||
import { getSysItemList, saveSysItem } from "../../apis/item";
|
||||
import UnifiedTable from "../../components/UnifiedTable";
|
||||
import "./index.less";
|
||||
|
||||
const { getLabel } = WeaLocaleProvider;
|
||||
|
|
@ -10,20 +9,16 @@ export default class SystemSalaryItemModal extends React.Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
dataSource: [],
|
||||
columns: [],
|
||||
name: "",
|
||||
loading: false,
|
||||
saveLoading: false,
|
||||
selectedRowKeys: [],
|
||||
pageInfo: {
|
||||
current: 1, pageSize: 10, total: 0
|
||||
}
|
||||
dataSource: [], columns: [], name: "", loading: false, saveLoading: false,
|
||||
selectedRowKeys: [], pageInfo: { current: 1, pageSize: 10, total: 0 }
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.getSysItemList();
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.visible !== this.props.visible && nextProps.visible) this.getSysItemList();
|
||||
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({
|
||||
selectedRowKeys: [], name: ""
|
||||
});
|
||||
}
|
||||
|
||||
getSysItemList = () => {
|
||||
|
|
@ -33,41 +28,33 @@ export default class SystemSalaryItemModal extends React.Component {
|
|||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
|
||||
this.setState({
|
||||
columns: _.map(columns, item => {
|
||||
return {
|
||||
...item,
|
||||
render: (text) => {
|
||||
return <span className="ellipsis" title={text}>{text}</span>;
|
||||
}
|
||||
};
|
||||
}),
|
||||
dataSource,
|
||||
pageInfo: { ...pageInfo, current, pageSize, total }
|
||||
});
|
||||
this.setState({ columns, dataSource, pageInfo: { ...pageInfo, current, pageSize, total } });
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
handleAdd = () => {
|
||||
const { selectedRowKeys } = this.state;
|
||||
if (_.isEmpty(selectedRowKeys)) {
|
||||
message.info(getLabel(111, "未选择任何条目"));
|
||||
return;
|
||||
}
|
||||
this.setState({ saveLoading: true });
|
||||
saveSysItem(selectedRowKeys).then(({ status, errormsg }) => {
|
||||
this.setState({ saveLoading: false });
|
||||
if (status) {
|
||||
message.success(getLabel(111, "添加成功"));
|
||||
this.setState({ selectedRowKeys: [] }, () => {
|
||||
this.props.onInitTableList();
|
||||
this.props.onCancel();
|
||||
});
|
||||
this.setState({ selectedRowKeys: [] }, () => this.props.onCancel(this.props.onSearch()));
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
}).catch(() => this.setState({ saveLoading: false }));
|
||||
};
|
||||
renderTitle = () => {
|
||||
const { name, pageInfo } = this.state;
|
||||
return <div className="sys-item-title">
|
||||
<span>{getLabel(111, "添加系统薪资项目")}</span>
|
||||
<WeaInputSearch value={name} onChange={val => this.setState({ name: val })} style={{ width: 200 }}
|
||||
placeholder={getLabel(111, "请输入薪资项目名称")} onSearch={() => this.setState({
|
||||
pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.getSysItemList())}/>
|
||||
</div>;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { selectedRowKeys, pageInfo, loading, columns, dataSource, saveLoading } = this.state;
|
||||
|
|
@ -95,33 +82,20 @@ export default class SystemSalaryItemModal extends React.Component {
|
|||
onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
|
||||
};
|
||||
return (
|
||||
<WeaDialog
|
||||
title="添加系统薪资项目"
|
||||
initLoadCss className="sys-salary-wrapper"
|
||||
visible={this.props.visible} onCancel={() => {
|
||||
this.setState({ selectedRowKeys: [] }, () => {
|
||||
this.props.onCancel();
|
||||
});
|
||||
}} style={{ width: "60vw" }} scalable
|
||||
buttons={[
|
||||
<Button type="primary" loading={saveLoading} onClick={this.handleAdd}>添加</Button>
|
||||
]}
|
||||
>
|
||||
<div className="headerSearchWrapper">
|
||||
<WeaTab datas={[]} keyParam="viewcondition" //主键
|
||||
searchType={["base"]} onSearchChange={name => this.setState({ name })}
|
||||
onSearch={this.getSysItemList}
|
||||
/>
|
||||
<WeaDialog {...this.props} initLoadCss className="sys-salary-wrapper" ref={dom => this.sysItemRef = dom}
|
||||
style={{
|
||||
width: "60vw", height: 600, minHeight: 200, minWidth: 380,
|
||||
maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
|
||||
}} title={this.renderTitle()}
|
||||
buttons={[<Button type="primary" loading={saveLoading} disabled={_.isEmpty(selectedRowKeys)}
|
||||
onClick={this.handleAdd}>{getLabel(111, "添加")}</Button>]}>
|
||||
<div className="sys-item-table-box">
|
||||
<Spin spinning={loading && pageInfo.total === 0}>
|
||||
<WeaTable columns={columns} dataSource={dataSource} pagination={pagination} rowSelection={rowSelection}
|
||||
loading={loading} scroll={{ y: this.sysItemRef ? this.sysItemRef.state.height - 16 : 600 }}
|
||||
rowKey="id"/>
|
||||
</Spin>
|
||||
</div>
|
||||
<UnifiedTable
|
||||
loading={loading}
|
||||
rowKey="id"
|
||||
columns={columns}
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
rowSelection={rowSelection}
|
||||
xWidth={columns.length * 120}
|
||||
/>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,8 @@ class StandingBook extends Component {
|
|||
progressVisible: true
|
||||
}, () => {
|
||||
this.timer = setInterval(() => {
|
||||
getCalculateProgress(moment(billMonth).format("YYYY-MM"), payload.paymentOrganization).then(({ status, data }) => {
|
||||
getCalculateProgress(moment(billMonth).format("YYYY-MM"), payload.paymentOrganization)
|
||||
.then(({ status, data }) => {
|
||||
if (status) {
|
||||
if (!data.status) {
|
||||
clearInterval(this.timer);
|
||||
|
|
|
|||
|
|
@ -4,12 +4,16 @@
|
|||
height: 100%;
|
||||
background: #f6f6f6;
|
||||
|
||||
.wea-tab {
|
||||
border-bottom: none !important;
|
||||
}
|
||||
|
||||
.wea-new-top-req-wapper .wea-new-top-req {
|
||||
z-index: 0 !important;
|
||||
}
|
||||
|
||||
.wea-search-tab, .wea-input-focus {
|
||||
background: #f6f6f6;
|
||||
background: #f1f1f1;
|
||||
}
|
||||
|
||||
.normalWapper {
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ class Index extends Component {
|
|||
} else if (getKey(g).indexOf("StartTime") !== -1) {
|
||||
return {
|
||||
...g, label: getLabel(g.lanId, g.label),
|
||||
viewAttr: (formData[o["typename"]][`${o.title}Name`] && showOperateBtn) ? 3 : g.viewAttr
|
||||
viewAttr: (runStatuses === "4,5" || !showOperateBtn) ? 1 : (formData[o["typename"]][`${o.title}Name`] && showOperateBtn) ? 3 : g.viewAttr
|
||||
};
|
||||
}
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class PlanSetTable extends Component {
|
|||
com: [{
|
||||
type: "custom",
|
||||
key: "custom",
|
||||
render: text => (<span>{text}</span>)
|
||||
render: text => (<span className="text-td-elli" title={text}>{text}</span>)
|
||||
}]
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -232,6 +232,14 @@
|
|||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.text-td-elli {
|
||||
display: inline-block;
|
||||
width: 120px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,29 +46,20 @@ class Index extends Component {
|
|||
...item, items: _.map(item.items, o => {
|
||||
if (getKey(o) === "taxAgentIds") {
|
||||
return {
|
||||
...o,
|
||||
viewAttr: !_.isEmpty(detail) ? 1 : 3,
|
||||
label: getLabel(o.lanId, o.label),
|
||||
...o, viewAttr: !_.isEmpty(detail) ? 1 : 3, label: getLabel(o.lanId, o.label),
|
||||
value: detail[getKey(o)] || "",
|
||||
options: _.map(taxAgentOption, (o, i) => ({ key: o.id, showname: o.content }))
|
||||
};
|
||||
}
|
||||
return {
|
||||
...o,
|
||||
viewAttr: !_.isEmpty(detail) ? 1 : 3,
|
||||
label: getLabel(o.lanId, o.label),
|
||||
...o, viewAttr: !_.isEmpty(detail) ? 1 : 3, label: getLabel(o.lanId, o.label),
|
||||
value: detail[getKey(o)] || ""
|
||||
};
|
||||
})
|
||||
})), {
|
||||
items: _.map(data, o => ({
|
||||
conditionType: "INPUT",
|
||||
domkey: [String(o.id)],
|
||||
fieldcol: 14,
|
||||
label: o.name,
|
||||
labelcol: 6,
|
||||
value: detail[`${String(o.id)}_variableItem`] || "",
|
||||
viewAttr: 2
|
||||
conditionType: "INPUT", domkey: [String(o.id)], fieldcol: 14, label: o.name, labelcol: 6,
|
||||
value: detail[`${String(o.id)}_variableItem`] || "", viewAttr: 2, dataType: o.dataType
|
||||
})), title: "", col: 2, defaultshow: true
|
||||
}]
|
||||
}, () => {
|
||||
|
|
@ -76,8 +67,7 @@ class Index extends Component {
|
|||
if (!_.isEmpty(detail)) {
|
||||
VSSalaryFileForm.updateFields({
|
||||
employeeId: {
|
||||
value: detail["employeeId"],
|
||||
valueSpan: detail["username"],
|
||||
value: detail["employeeId"], valueSpan: detail["username"],
|
||||
valueObj: [{ id: detail["employeeId"], name: detail["username"] }]
|
||||
}
|
||||
});
|
||||
|
|
@ -128,6 +118,19 @@ class Index extends Component {
|
|||
</div>
|
||||
</div>;
|
||||
};
|
||||
handleChange = (formVal) => {
|
||||
const key = _.keys(formVal)[0], value = formVal[key].value;
|
||||
const [__, fields] = this.state.conditions, { items } = fields;
|
||||
_.forEach(items, o => {
|
||||
if (getKey(o) === key && o.dataType === "number") {
|
||||
if (_.isNaN(Number(value)) || value.indexOf(" ") !== -1) {
|
||||
const { baseTableStore: { VSSalaryFileForm } } = this.props;
|
||||
message.warning(getLabel(111, "数值类型有误!"));
|
||||
VSSalaryFileForm.updateFields({ [getKey(o)]: { value: "" } });
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { conditions } = this.state;
|
||||
|
|
@ -135,7 +138,8 @@ class Index extends Component {
|
|||
return (<WeaSlideModal
|
||||
className="variable_salary_file_dialog" {...this.props} direction="right" onClose={() => onClose()}
|
||||
top={0} width={800} height={100} measureT="%" measureX="px" measureY="%" title={this.renderTitle()}
|
||||
content={<div className="form-dialog-layout">{getSearchs(VSSalaryFileForm, conditions, 2, false)}</div>}
|
||||
content={<div
|
||||
className="form-dialog-layout">{getSearchs(VSSalaryFileForm, conditions, 2, false, this.handleChange)}</div>}
|
||||
/>);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,12 +10,9 @@ const getLabel = WeaLocaleProvider.getLabel;
|
|||
|
||||
export class BaseFormStore {
|
||||
@observable form = new WeaForm(); // 规则渲染form
|
||||
|
||||
@observable logStore = new LogStore();
|
||||
@observable condition = []; // 存储后台得到的form数据
|
||||
@observable saveLoading = false; // 保存状态处理:保证保存的时候接口只走一次
|
||||
@observable loading = true; // 页面初始化的loading状态:数据加载成功前后前使用
|
||||
@observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据
|
||||
@action("初始化form表单") initForm = () => this.form = new WeaForm();
|
||||
@observable formExtra = new WeaForm(); // 规则渲染form
|
||||
@action("初始化form表单") initFormExtra = () => this.formExtra = new WeaForm();
|
||||
@observable logVisible = false; // 控制日志弹框的显影
|
||||
|
||||
@action // 初始化操作: 一般用来初始化获取后台数据
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@ const { TableStore } = WeaTableNew;
|
|||
|
||||
export class SalaryItemStore {
|
||||
@observable salarySetform = new WeaForm(); //同步薪资账套form
|
||||
@observable itemsForm = new WeaForm(); //自定义薪资项目form
|
||||
@action initItemsForm = () => this.itemsForm = new WeaForm();
|
||||
|
||||
|
||||
@observable tableStore = new TableStore(); // new table
|
||||
@observable sysListTableStore = new TableStore();
|
||||
|
|
|
|||
|
|
@ -39,6 +39,10 @@
|
|||
.form-dialog-layout {
|
||||
background: #f6f6f6;
|
||||
|
||||
.wea-form-item-wrapper {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.wea-form-item .wea-form-item-wrapper .wea-field-readonly {
|
||||
line-height: 28px;
|
||||
}
|
||||
|
|
@ -134,3 +138,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
//公共表格操作按钮间距
|
||||
.space_div {
|
||||
a:not(:last-child) {
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,19 +36,20 @@ export const getSearchs = (form, condition, col, isCenter, onChange = () => void
|
|||
items.push({
|
||||
com: (
|
||||
<WeaFormItem
|
||||
label={`${fields.label}`} // label 标签的文本
|
||||
label={<span>
|
||||
<span>{`${fields.label}`}</span>
|
||||
{
|
||||
fields.labelExtra && <span className="wea-form-item-label-extra"
|
||||
onClick={() => onChange(fields.labelType)}>{fields.labelExtra}</span>
|
||||
}
|
||||
</span>} // label 标签的文本
|
||||
labelCol={{ span: `${fields.labelcol}` }} // label标签占一行比例
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} // 右侧控件占一行比例
|
||||
error={form.getError(fields)} // 错误提示: 处理表单中有必填项,保存的校验
|
||||
tipPosition="bottom" // 错误提示的显示位置: top/bottom
|
||||
className={(fields.domkey[0] === "subcompanyName" || fields.domkey[0] === "departmentName") ? "hideFormItem" : classnames}
|
||||
>
|
||||
<WeaSwitch
|
||||
fieldConfig={fields}
|
||||
form={form}
|
||||
formParams={formParams}
|
||||
onChange={onChange}
|
||||
/>
|
||||
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams} onChange={onChange}/>
|
||||
{
|
||||
fields.helpfulTitle &&
|
||||
<WeaHelpfulTip title={fields.helpfulTitle} style={{ position: "absolute", right: "-20px", top: "25%" }}/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue