-
} iconBgcolor="#F14A2D"
- showDropIcon onDropMenuClick={this.onDropMenuClick}
- dropMenuDatas={[
- {
- key: "import",
- icon:
,
- content: getLabel(111, "导入")
- },
- {
- key: "export",
- icon:
,
- content: getLabel(111, "导出")
- },
- {
- key: "log", icon:
,
- content: getLabel(545781, "操作日志")
- }
- ]} buttons={(showOperateBtn || showSalaryItemBtn) ? buttons : buttons.slice(-1)}>
-
-
- 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 });
- });
- }}
- />
-
+
+ } iconBgcolor="#F14A2D"
+ buttons={buttons} showDropIcon onDropMenuClick={this.onDropMenuClick} dropMenuDatas={dropMenuDatas}
+ className="salaryProjectManagement">
+
+ this.setState({ selectedRowKeys: val })}/>
+ {/*添加系统薪资项目*/}
+ this.setState({ isQuery: !isQuery })}
+ onCancel={(callback) => this.setState({ sysVisible: false }, () => callback && callback())}/>
+ {/*同步薪资账套*/}
this.setState({
- syncSalarySetDialog: {
- ...this.state.syncSalarySetDialog,
- visible: false, title: ""
- }
- })}
- />
+ onCancel={() => this.setState({ syncSalarySetDialog: { visible: false, id: "" } })}/>
{/*操作日志*/}
this.setState({ logDialogVisible: false })}/>
@@ -436,61 +204,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 &&
- {
- setSystemItemVisible(false);
- }}
- onInitTableList={() => {
- getTableDatas({ ...this.state.searchParams, name: this.state.searchValue }).then(res => {
- this.setState({
- searchParams: {
- ...this.state.searchParams,
- total: res.total
- }
- });
- });
- }}
- />
- }
- {
- editSlideVisible &&
-
- }
- content={
- {
- handleSaveSlideChange(value);
- }}/>
- }
- onClose={() => setEditSlideVisible(false)}
- />
- }
-
+ {/*新增编辑自定义薪资项目*/}
+
this.setState({ isQuery: !isQuery })}
+ showOperateBtn={showOperateBtn}
+ onClose={callback => this.setState({
+ customItemDialog: { ...customItemDialog, visible: false, id: "" }
+ }, () => callback && callback())}/>
+
);
}
}
diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.less b/pc4mobx/hrmSalary/pages/salaryItem/index.less
index 1d28f1ca..cf539484 100644
--- a/pc4mobx/hrmSalary/pages/salaryItem/index.less
+++ b/pc4mobx/hrmSalary/pages/salaryItem/index.less
@@ -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;
}
}
}
diff --git a/pc4mobx/hrmSalary/pages/salaryItem/options.js b/pc4mobx/hrmSalary/pages/salaryItem/options.js
index 58e64e3e..e7ac5f78 100644
--- a/pc4mobx/hrmSalary/pages/salaryItem/options.js
+++ b/pc4mobx/hrmSalary/pages/salaryItem/options.js
@@ -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",
diff --git a/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js
new file mode 100644
index 00000000..56de78a7
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/salaryItem/salaryItemsTable.js
@@ -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 => };
+ }
+ 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 (
+ (
+ onDropMenuClick("edit", record.id)}
+ href="javascript:void(0);">{showOperateBtn ? getLabel(111, "编辑") : getLabel(111, "查看")}
+ {
+ showOperateBtn && record.canDelete &&
+ onDropMenuClick("delete", record.id)}>{getLabel(111, "删除")}
+ }
+
+
+ onDropMenuClick("log", record.id)}>{getLabel(545781, "操作日志")}
+
+
+ }>
+
+
+ )
+ }
+ ]}/>
+ );
+ }
+}
+
+export default SalaryItemsTable;
diff --git a/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js b/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js
index 797a6466..f97ef453 100644
--- a/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js
+++ b/pc4mobx/hrmSalary/pages/salaryItem/syncToSalaryAccountSetDialog.js
@@ -51,7 +51,6 @@ class SyncToSalaryAccountSetDialog extends Component {
}
});
};
-
save = () => {
const { salaryItemStore: { salarySetform }, id: salaryItemId } = this.props;
salarySetform.validateForm().then(f => {
@@ -80,7 +79,7 @@ class SyncToSalaryAccountSetDialog extends Component {
return (
{getLabel(537558, "确定")}]}
>
diff --git a/pc4mobx/hrmSalary/pages/salaryItem/systemSalaryItemModal.js b/pc4mobx/hrmSalary/pages/salaryItem/systemSalaryItemModal.js
index 2e7d169f..b1c3a1f8 100644
--- a/pc4mobx/hrmSalary/pages/salaryItem/systemSalaryItemModal.js
+++ b/pc4mobx/hrmSalary/pages/salaryItem/systemSalaryItemModal.js
@@ -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 {text};
- }
- };
- }),
- 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
+ {getLabel(111, "添加系统薪资项目")}
+ this.setState({ name: val })} style={{ width: 200 }}
+ placeholder={getLabel(111, "请输入薪资项目名称")} a onSearch={() => this.setState({
+ pageInfo: { ...pageInfo, current: 1 }
+ }, () => this.getSysItemList())}/>
+
;
+ };
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 (
- {
- this.setState({ selectedRowKeys: [] }, () => {
- this.props.onCancel();
- });
- }} style={{ width: "60vw" }} scalable
- buttons={[
-
- ]}
- >
-
-
this.setState({ name })}
- onSearch={this.getSysItemList}
- />
+ 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={[]}>
+
+
+
+
-
);
}
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordList.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordList.js
index 27409fb5..cd9dd5c7 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordList.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordList.js
@@ -5,7 +5,6 @@
* Date: 2024/1/23
*/
import React, { Component } from "react";
-import { inject, observer } from "mobx-react";
import { message, Modal, Spin } from "antd";
import { WeaLocaleProvider } from "ecCom";
import { getIframeParentHeight } from "../../../../util";
@@ -14,8 +13,6 @@ import { convertToUrlString } from "../../../../util/url";
const getLabel = WeaLocaleProvider.getLabel;
-@inject("taxAgentStore")
-@observer
class WelfareRecordList extends Component {
constructor(props) {
super(props);
@@ -126,7 +123,7 @@ class WelfareRecordList extends Component {
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
};
getWelfareRecordList = () => {
- const { queryForm, taxAgentStore: { showOperateBtn } } = this.props;
+ const { queryForm } = this.props;
const { pageInfo } = this.state;
const payload = { ...pageInfo, ...queryForm, taxAgents: queryForm.taxAgents ? queryForm.taxAgents.split(",") : [] };
this.setState({ loading: true });
@@ -139,8 +136,7 @@ class WelfareRecordList extends Component {
pageInfo: { ...pageInfo, current, pageSize, total },
dataSource, columns
}, () => this.postMessageToChild({
- scrollHeight: 108, dataSource, columns, pageInfo: this.state.pageInfo, showOperateBtn,
- unitTableType: "welfareRecord"
+ scrollHeight: 108, dataSource, columns, pageInfo: this.state.pageInfo, unitTableType: "welfareRecord"
}));
}
}).catch(() => this.setState({ loading: false }));
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordQuery.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordQuery.js
index 16dd0855..3db29a36 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordQuery.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordQuery.js
@@ -8,8 +8,8 @@ import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
import { WeaSwitch } from "comsMobx";
-import * as API from "../../../../apis/standingBook";
import { welfareRQConditions } from "../columns";
+import { postFetch } from "../../../../util/request";
import { MonthRangePicker } from "../../../reportView/components/statisticalMicroSettingsSlide";
import moment from "moment";
@@ -31,27 +31,28 @@ class WelfareRecordQuery extends Component {
}
componentDidMount() {
- API.getAdminTaxAgentList().then(({ status, data }) => {
- if (status) {
- this.setState({
- conditions: _.map(welfareRQConditions, item => {
- return {
- ...item,
- items: _.map(item.items, o => {
- if (getKey(o) === "taxAgents") {
- return { ...o, options: _.map(data, g => ({ key: g.id.toString(), showname: g.name })) };
- }
- return o;
- })
- };
- })
- }, () => {
- const { standingBookStore: { welfareRQForm }, onPutAccountOptions } = this.props;
- welfareRQForm.initFormFields(this.state.conditions);
- onPutAccountOptions(_.map(data, g => ({ key: g.id.toString(), showname: g.name })));
- });
- }
- });
+ postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" })
+ .then(({ status, data }) => {
+ if (status) {
+ this.setState({
+ conditions: _.map(welfareRQConditions, item => {
+ return {
+ ...item,
+ items: _.map(item.items, o => {
+ if (getKey(o) === "taxAgents") {
+ return { ...o, options: _.map(data, g => ({ key: String(g.id), showname: g.name })) };
+ }
+ return o;
+ })
+ };
+ })
+ }, () => {
+ const { standingBookStore: { welfareRQForm }, onPutAccountOptions } = this.props;
+ welfareRQForm.initFormFields(this.state.conditions);
+ onPutAccountOptions(_.map(data, g => ({ key: g.id.toString(), showname: g.name })));
+ });
+ }
+ });
}
renderForm = (form, conditions) => {
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js
index 30ec27a6..9736415a 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js
@@ -24,7 +24,7 @@ export default class StandingBook extends React.Component {
value: "",
selectedKey: "0",
tableParams: {
- startTime: moment(new Date()).subtract(1, 'year').startOf("year").format("YYYY-MM"),
+ startTime: moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"),
endTime: moment(new Date()).endOf("year").format("YYYY-MM"),
paymentOrganization: ""
},
@@ -68,49 +68,45 @@ export default class StandingBook extends React.Component {
init = () => {
const { current, dialogProps } = this.state;
const {
- taxAgentStore: { getPermission, fetchTaxAgentOption },
+ taxAgentStore: { PageAndOptAuth, fetchTaxAgentOption },
standingBookStore: { getAdminTaxAgentList }
} = this.props;
- getPermission().then(({ status, data }) => {
- if (status) {
- this.setState({ adminData: data });
- if (data.isOpenDevolution) {
- getAdminTaxAgentList().then((data) => {
- let taxAgentList = data.map(item => {
- let result = {};
- result.showname = item.name;
- result.key = item.id + "";
- result.selected = false;
- return result;
- });
- this.setState({
- dialogProps: {
- ...dialogProps,
- options: taxAgentList,
- isAdmin: true
- }
- });
- });
- } else {
- fetchTaxAgentOption().then(({ data }) => {
- let taxAgentList = data.map(item => {
- let result = {};
- result.showname = item.content;
- result.key = item.id + "";
- result.selected = false;
- return result;
- });
- this.setState({
- dialogProps: {
- ...dialogProps,
- options: taxAgentList
- }
- });
- });
- }
- this.getCommonList({ ...this.state.tableParams, current });
- }
- });
+ this.setState({ adminData: PageAndOptAuth });
+ if (data.isOpenDevolution) {
+ getAdminTaxAgentList().then((data) => {
+ let taxAgentList = data.map(item => {
+ let result = {};
+ result.showname = item.name;
+ result.key = item.id + "";
+ result.selected = false;
+ return result;
+ });
+ this.setState({
+ dialogProps: {
+ ...dialogProps,
+ options: taxAgentList,
+ isAdmin: true
+ }
+ });
+ });
+ } else {
+ fetchTaxAgentOption().then(({ data }) => {
+ let taxAgentList = data.map(item => {
+ let result = {};
+ result.showname = item.content;
+ result.key = item.id + "";
+ result.selected = false;
+ return result;
+ });
+ this.setState({
+ dialogProps: {
+ ...dialogProps,
+ options: taxAgentList
+ }
+ });
+ });
+ }
+ this.getCommonList({ ...this.state.tableParams, current });
};
getCommonList = (payload = {}) => {
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js
index f4089c44..88243286 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js
@@ -119,7 +119,8 @@ class StandingBook extends Component {
render() {
const { accountDialog, queryForm, logDialogVisible, filterConditions } = this.state;
- const { taxAgentStore: { showOperateBtn } } = this.props;
+ const { taxAgentStore: { PageAndOptAuth } } = this.props;
+ const showOperateBtn = PageAndOptAuth.opts.includes("admin");
const rightBtns = [];
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js
index e2342e93..c4eb3b57 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js
@@ -8,10 +8,10 @@ import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaDialog, WeaLocaleProvider, WeaSlideModal, WeaTools } from "ecCom";
import * as API from "../../../../../apis/welfareArchive";
-import { getTaxAgentSelectList } from "../../../../../apis/taxAgent";
import { sysinfo } from "../../../../../apis/ruleconfig";
import { getWelfareSearchsForm, welfareConditions } from "../../config";
import { getConditionDomkeys, toDecimal_n } from "../../../../../util";
+import { postFetch } from "../../../../../util/request";
import { Button, message, Modal } from "antd";
const getKey = WeaTools.getKey;
@@ -39,7 +39,9 @@ class Index extends Component {
}
getBaseForm = async (props) => {
- const [taxAgentListData, sysInfoData] = await Promise.all([getTaxAgentSelectList(), sysinfo()]);
+ const [taxAgentListData, sysInfoData] = await Promise.all([
+ postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }), sysinfo()
+ ]);
const {
archivesStore: { welfareProfileForm }, socialBase, fundBase, otherBase, runStatuses,
employeeId, paymentOrganization, socialBaseData, fundBaseData, othersBaseData,
@@ -97,7 +99,7 @@ class Index extends Component {
items: _.map(o.items, g => {
return {
...g, label: getLabel(g.lanId, g.label),
- options: _.map(taxAgentListData.data, j => ({ key: j.id, showname: j.content }))
+ options: _.map(taxAgentListData.data, j => ({ key: String(j.id), showname: j.name }))
};
})
};
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js
index a9029a86..52bc2061 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js
@@ -70,8 +70,8 @@ class Index extends Component {
if (type === "init") {
this.getWelfareList(this.props, true);
} else if (type === "turn") {
- const { record: { baseInfo, employeeId, paymentOrganization } = {}, interfaceParams = {} } = params;
- const { runStatuses, showOperateBtn } = this.props;
+ const { record: { baseInfoId, opts, employeeId, paymentOrganization } = {}, interfaceParams = {} } = params;
+ const { runStatuses } = this.props;
switch (id) {
case "PAGEINFO":
this.setState({
@@ -114,6 +114,7 @@ class Index extends Component {
this.getPaymentForm({ ...payload, welfareTypeEnum: welfareTypeEnum["fund"], schemeId: fundSchemeId }),
this.getPaymentForm({ ...payload, welfareTypeEnum: welfareTypeEnum["other"], schemeId: otherSchemeId })
]);
+ const showOperateBtn = opts.includes("admin");
this.setState({
welfareEditSlide: {
...this.state.welfareEditSlide, visible: true, showOperateBtn,
@@ -128,18 +129,18 @@ class Index extends Component {
case "DEL-TO-DO":
case "DEL-TO-DO-STAY":
const module = (id === "ADD-TO-PAY" || id === "STAY-DEL-TO-STOP" || id === "CANCEL-STOP") ?
- [baseInfo] : { ids: [baseInfo], ...interfaceParams };
+ [baseInfoId] : { ids: [baseInfoId], ...interfaceParams };
this.handleWelfareOpts(_.camelCase(id), module);
break;
case "DEL-ARCHIVE":
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: getLabel(388758, "确认要删除吗?"),
- onOk: () => this.handleWelfareOpts(_.camelCase(id), [baseInfo])
+ onOk: () => this.handleWelfareOpts(_.camelCase(id), [baseInfoId])
});
break;
case "log":
- this.props.onFilterLog(id, baseInfo);
+ this.props.onFilterLog(id, baseInfoId);
break;
default:
break;
@@ -156,7 +157,7 @@ class Index extends Component {
};
getWelfareList = (props, init = false) => {
const { pageInfo } = this.state;
- const { archivesStore: { welfareForm }, runStatuses, onChangeTopTabCount, showOperateBtn } = props;
+ const { archivesStore: { welfareForm }, runStatuses, onChangeTopTabCount } = props;
const params = { ...pageInfo, ...welfareForm.getFormParams() };
const payload = runStatuses === "ext" ? { ...params, extWelArchiveList: true } : {
...params,
@@ -183,10 +184,7 @@ class Index extends Component {
}, () => {
const { pageInfo, selectedRowKeys, columns, dataSource } = this.state;
onChangeTopTabCount(runStatuses, total, init);
- this.postMessageToChild({
- dataSource, pageInfo, selectedRowKeys, runStatuses,
- columns, showOperateBtn
- });
+ this.postMessageToChild({ dataSource, pageInfo, selectedRowKeys, runStatuses, columns });
});
}
}).catch(() => this.setState({ loading: false }));
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js
index 4da87e27..f64404e9 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js
@@ -151,7 +151,8 @@ class Index extends Component {
selectedKey, topTabCount, showSearchAd, isQuery, recordDialogVisible,
logDialogVisible, filterConditions, welfareImpDialog, showExtEmpsWitch
} = this.state;
- const { taxAgentStore: { showOperateBtn } } = this.props;
+ const { taxAgentStore: { PageAndOptAuth } } = this.props;
+ const showOperateBtn = PageAndOptAuth.opts.includes("admin");
const tipList = _.find(welfareTipList, o => o.viewcondition === selectedKey).list;
const tabs = _.map(tabList, o => ({ ...o, title: getLabel(o.lanId, o.title) }));
return (
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/baseValidateDialog.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/baseValidateDialog.js
new file mode 100644
index 00000000..631ef2ee
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/baseValidateDialog.js
@@ -0,0 +1,76 @@
+/*
+ * 方案信息确认
+ * 保存并自动修改基数,仅保存方案设置
+ * @Author: 黎永顺
+ * @Date: 2024/8/19
+ * @Wechat:
+ * @Email: 971387674@qq.com
+ * @description:
+*/
+import React, { Component } from "react";
+import { WeaDialog, WeaLocaleProvider, WeaTransfer } from "ecCom";
+import { Alert, Button } from "antd";
+
+const getLabel = WeaLocaleProvider.getLabel;
+const WeaTransferList = WeaTransfer.list;
+
+class BaseValidateDialog extends Component {
+ constructor(props) {
+ super(props);
+ this.state = { dataSource: [] };
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visible && nextProps.visible) {
+ this.setState({
+ dataSource: _.filter(_.map(nextProps.baseChangeInfo.split("\n"), (g, gi) => ({
+ id: gi + 1, name: g
+ })), k => !!k.name)
+ });
+ }
+ if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({
+ dataSource: []
+ });
+ }
+
+ render() {
+ const { dataSource } = this.state, { onCancel } = this.props;
+ const scrollHeight = this.baseChangeRef ? this.baseChangeRef.state.height - 118 : 606.6;
+ const buttons = [
+ ,
+
+ ];
+ return (
+ this.baseChangeRef = dom}
+ title={getLabel(131329, "信息确认")} buttons={buttons}
+ style={{
+ width: 750, height: 606.6, minHeight: 200, minWidth: 380,
+ maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
+ }}
+ >
+
+
+ {
+ !_.isEmpty(dataSource) ?
()}
+ height={scrollHeight} checkedCb={() => ({})} checkedKeys={[]}
+ /> : {getLabel(111, "无数据变更记录")}
+ }
+
+
+ );
+ }
+}
+
+export default BaseValidateDialog;
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/index.js
index d97654e6..077d7bfc 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/index.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/index.js
@@ -10,8 +10,9 @@ import { WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTab, WeaTools } fr
import PlanSetTable from "./planSetTable";
import { Button, message, Modal } from "antd";
import * as API from "../../../../../apis/welfareScheme";
-import { getTaxAgentSelectListAsAdmin } from "../../../../../apis/taxAgent";
+import { postFetch } from "../../../../../util/request";
import { getConditionDomkeys, getSearchs } from "../../../../../util";
+import BaseValidateDialog from "./baseValidateDialog";
import { planConditons } from "../../config";
import cs from "classnames";
@@ -24,7 +25,10 @@ class Index extends Component {
constructor(props) {
super(props);
this.state = {
- loading: false, conditions: [], selectedKey: "2", planDatas: []
+ loading: false, conditions: [], selectedKey: "2", planDatas: [],
+ baseValidateDialog: {
+ visible: false, baseChangeInfo: [], validatePayload: { validate: true, changeData: false }
+ }
};
}
@@ -40,7 +44,7 @@ class Index extends Component {
}
getForm = async (props) => {
- const { data: result } = await getTaxAgentSelectListAsAdmin();
+ const { data: result } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" });
const { id, welfareTypeEnum, programmeStore: { planForm }, showOperateBtn } = props;
API.getForm(id ? _.assign({ welfareTypeEnum }, { id }) : { welfareTypeEnum }).then(({ status, data }) => {
if (status) {
@@ -54,7 +58,7 @@ class Index extends Component {
return {
...o, hide: schemeBatch["sharedType"] === "0" || _.isNil(schemeBatch["sharedType"]),
viewAttr: (schemeBatch["sharedType"] === "1" && showOperateBtn) ? 3 : showOperateBtn ? o.viewAttr : 1,
- options: _.map(result, k => ({ key: k.id, showname: k.content })),
+ options: _.map(result, k => ({ key: String(k.id), showname: k.name })),
label: getLabel(o.lanId, o.label)
};
} else if (getKey(o) === "paymentType" || getKey(o) === "sharedType") {
@@ -86,21 +90,37 @@ class Index extends Component {
if (planForm.getFormParams().sharedType === "1" && _.isEmpty(planForm.getFormParams().taxAgentIds)) {
planForm.showError("taxAgentIds", getLabel(111, "\"可见范围\"未填写"));
} else {
- const { planDatas } = this.state;
- const payload = {
+ const { planDatas, baseValidateDialog } = this.state;
+ const { validatePayload } = baseValidateDialog;
+ let payload = {
insuranceScheme: {
...planForm.getFormParams(), welfareType: welfareTypeEnum, id,
paymentArea: planForm.getFormParams().paymentType
},
insuranceSchemeDetailList: planDatas
};
+ id && (payload = { ...payload, ...validatePayload });
this.setState({ loading: true });
- API[id ? "updateScheme" : "createScheme"](payload).then(({ status, errormsg }) => {
+ API[id ? "updateScheme" : "createScheme"](payload).then(({ status, data, errormsg }) => {
this.setState({ loading: false });
if (status) {
- message.success(getLabel(30700, "操作成功!"));
- setHasBeenModify(false);
- this.props.onClose(true);
+ if (id && Object.prototype.toString.call(data) === "[object String]" && data.indexOf("\n") !== -1) {
+ this.setState({
+ baseValidateDialog: {
+ visible: true, baseChangeInfo: data,
+ validatePayload: { ...baseValidateDialog.validatePayload, validate: false }
+ }
+ });
+ } else {
+ message.success(getLabel(30700, "操作成功!"));
+ setHasBeenModify(false);
+ this.props.onClose(true);
+ this.setState({
+ baseValidateDialog: {
+ ...baseValidateDialog, baseChangeInfo: [], validatePayload: { validate: true, changeData: false }
+ }
+ });
+ }
} else {
message.error(errormsg);
}
@@ -194,7 +214,7 @@ class Index extends Component {
render() {
- const { conditions, planDatas, selectedKey } = this.state;
+ const { conditions, planDatas, selectedKey, baseValidateDialog } = this.state;
const { programmeStore: { planForm }, showOperateBtn } = this.props;
return (
+ {/* */}
+ this.setState({
+ baseValidateDialog: {
+ visible: false, baseChangeInfo: [],
+ validatePayload: { validate: true, changeData: false, ...validatePayload }
+ }
+ }, () => !_.isEmpty(validatePayload) && this.save())}/>
}
/>
);
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanList/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanList/index.js
index 1035015a..c7ee09b6 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanList/index.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanList/index.js
@@ -60,8 +60,9 @@ class Index extends Component {
getList = (props) => {
const {
programmeStore: { planSearchForm }, selectedKey: welfareTypeEnum, customQuery,
- taxAgentStore: { showOperateBtn }
+ taxAgentStore: { PageAndOptAuth }
} = props;
+ const showOperateBtn = PageAndOptAuth.opts.includes("admin");
const { pageInfo } = this.state;
const originPayload = { ...pageInfo, welfareTypeEnum }, customPayload = { welfareTypeEnum: customQuery },
welfarePayload = { ...planSearchForm.getFormParams() };
@@ -239,7 +240,8 @@ class Index extends Component {
render() {
const { dataSource, columns, pageInfo, loading, copyDialog, customDialog, welfarePlanEditSlide } = this.state;
- const { selectedKey, taxAgentStore: { showOperateBtn } } = this.props;
+ const { selectedKey, taxAgentStore: { PageAndOptAuth } } = this.props;
+ const showOperateBtn = PageAndOptAuth.opts.includes("admin");
const pagination = {
...pageInfo,
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.js
index 20d50c88..69382697 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.js
@@ -13,7 +13,6 @@ import WelfarePlanList from "./components/welfarePlanList";
import LogDialog from "../../../components/logViewModal";
import cs from "classnames";
import "./index.less";
-import { tabList } from "../welfareArchive/config";
const getLabel = WeaLocaleProvider.getLabel;
@@ -63,7 +62,8 @@ class Index extends Component {
};
render() {
- const { taxAgentStore: { showOperateBtn } } = this.props;
+ const { taxAgentStore: { PageAndOptAuth } } = this.props;
+ const showOperateBtn = PageAndOptAuth.opts.includes("admin");
const { logDialogVisible, filterConditions, selectedKey, showSearchAd, isQuery, customQuery } = this.state;
const tabs = _.map(tabWelfarePlanList, o => ({ ...o, title: getLabel(o.lanId, o.title) }));
return (
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.less
index 5a057203..5566cc8e 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.less
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/index.less
@@ -269,3 +269,91 @@
}
}
+
+//方案基数变化
+.baseChangeDialog {
+ .wea-dialog-body {
+ overflow-y: hidden;
+ }
+
+ .baseChangeContent {
+ background: #F6F6F6;
+ padding: 16px;
+ width: 100%;
+ height: 100%;
+
+ .empty {
+ width: 100%;
+ display: flex;
+ height: 100%;
+ justify-content: center;
+ align-items: center;
+ background: #ffff;
+ }
+
+ .wea-search-group {
+ padding: 0;
+ margin-bottom: 10px;
+ background: #FFF;
+
+ .wea-form-cell {
+ padding: 0;
+
+ .wea-form-item {
+ padding: 10px;
+ }
+ }
+ }
+
+ .logTable {
+ background: #FFFFFF;
+ }
+
+ .wea-transfer-list-wrapper {
+ border: none;
+
+ .ant-tree-switcher {
+ display: none;
+ }
+
+ .transfer-tree {
+ background: #FFF;
+ border: 1px solid #dadada;
+ padding: 0;
+
+ & > li:not(:last-child) {
+ .detailBox .content {
+ border-bottom: 1px solid #dadada;
+ }
+ }
+
+ & > li {
+ margin: 0 !important;
+
+ .detailBox {
+ display: flex;
+ align-items: center;
+
+ .order {
+ width: 35px;
+ color: #999;
+ text-align: center;
+ }
+
+ .content {
+ position: relative;
+ flex: 1;
+ min-height: 40px;
+ line-height: 40px;
+ color: #000;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
diff --git a/pc4mobx/hrmSalary/pages/taxAgent/index.js b/pc4mobx/hrmSalary/pages/taxAgent/index.js
index 39ceeec2..02bd0a71 100644
--- a/pc4mobx/hrmSalary/pages/taxAgent/index.js
+++ b/pc4mobx/hrmSalary/pages/taxAgent/index.js
@@ -48,13 +48,9 @@ export default class TaxAgent extends React.Component {
}
getPermission = () => {
- const { getPermission } = this.props.taxAgentStore;
- getPermission().then(({ status, data }) => {
- if (status) {
- this.setState({ permission: data }, () => {
- this.getTaxAgentBaseForm();
- });
- }
+ const { PageAndOptAuth } = this.props.taxAgentStore;
+ this.setState({ permission: PageAndOptAuth }, () => {
+ this.getTaxAgentBaseForm();
});
};
@@ -323,9 +319,9 @@ export default class TaxAgent extends React.Component {
doInit,
hasRight,
getTaxAgentList,
- showOperateBtn
+ PageAndOptAuth
} = taxAgentStore;
-
+ const showOperateBtn = PageAndOptAuth.opts.includes("admin");
if (!hasRight && !loading) {
// 无权限处理
return renderNoright();
diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/advanceInputBtn/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/advanceInputBtn/index.js
new file mode 100644
index 00000000..8c0983da
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/variableSalary/components/advanceInputBtn/index.js
@@ -0,0 +1,35 @@
+/*
+ * Author: 黎永顺
+ * name:薪酬统计报表-高级搜索
+ * Description:
+ * Date: 2024/3/26
+ */
+import React, { Component } from "react";
+import { inject, observer } from "mobx-react";
+import { Button } from "antd";
+import { WeaInputSearch, WeaLocaleProvider } from "ecCom";
+import "./index.less";
+
+const getLabel = WeaLocaleProvider.getLabel;
+
+@inject("baseTableStore")
+@observer
+class Index extends Component {
+ render() {
+ const { baseTableStore: { VSalryForm }, searchType } = this.props;
+ return (
+
+ VSalryForm.updateFields({ username: v })}
+ onSearch={this.props.onAdvanceSearch}
+ />
+ {
+ searchType === "advance" &&
+ }
+
+ );
+ }
+}
+
+export default Index;
diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/advanceInputBtn/index.less b/pc4mobx/hrmSalary/pages/variableSalary/components/advanceInputBtn/index.less
new file mode 100644
index 00000000..f301e571
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/variableSalary/components/advanceInputBtn/index.less
@@ -0,0 +1,28 @@
+.variable-advance-search {
+ display: flex;
+ align-items: center;
+ position: relative;
+ top: -1.5px;
+
+ .wea-advanced-search {
+ top: 1px;
+ left: -1px;
+ height: 28px;
+ line-height: 1;
+ border-radius: 0;
+ position: relative;
+ color: #474747;
+ padding: 4px 15px;
+ }
+
+ .wea-advanced-search:hover {
+ border: 1px solid #dadada;
+ color: #474747;
+ }
+
+ .text-elli {
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ }
+}
diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js
new file mode 100644
index 00000000..1635c3a4
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileDialog/index.js
@@ -0,0 +1,146 @@
+/*
+ * 浮动薪酬
+ * 新建编辑薪资档案
+ * @Author: 黎永顺
+ * @Date: 2024/8/8
+ * @Wechat:
+ * @Email: 971387674@qq.com
+ * @description:
+*/
+import React, { Component } from "react";
+import { inject, observer } from "mobx-react";
+import { WeaLocaleProvider, WeaSlideModal, WeaTools } from "ecCom";
+import { Button, message } from "antd";
+import { getSearchs } from "../../../../util";
+import { salaryFileConditions } from "../../conditions";
+import * as API from "../../../../apis/variableSalary";
+
+const getKey = WeaTools.getKey;
+const getLabel = WeaLocaleProvider.getLabel;
+
+@inject("baseTableStore")
+@observer
+class Index extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ conditions: [], loading: false
+ };
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visible && nextProps.visible) {
+ document.querySelector(".variable_salary_wrapper").classList.add("zIndex0-weaslide-title");
+ this.initForm(nextProps);
+ } else if (nextProps.visible !== this.props.visible && !nextProps.visible) {
+ document.querySelector(".variable_salary_wrapper").classList.remove("zIndex0-weaslide-title");
+ this.props.baseTableStore.initVSSalaryFileForm();
+ }
+ }
+
+ initForm = (props) => {
+ const { baseTableStore: { VSSalaryFileForm }, detail, taxAgentOption } = props;
+ API.getCreateForm().then(({ data }) => {
+ this.setState({
+ conditions: [
+ ..._.map(salaryFileConditions, item => ({
+ ...item, items: _.map(item.items, o => {
+ if (getKey(o) === "taxAgentIds") {
+ return {
+ ...o, viewAttr: !_.isEmpty(detail) ? 1 : 3, label: getLabel(o.lanId, o.label),
+ options: taxAgentOption, value: detail[getKey(o)] || ""
+ };
+ }
+ return {
+ ...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: !_.isEmpty(detail) ? 1 : 2
+ })),
+ title: "", col: 2,
+ defaultshow: true
+ }
+ ]
+ }, () => {
+ VSSalaryFileForm.initFormFields(this.state.conditions);
+ if (!_.isEmpty(detail)) {
+ VSSalaryFileForm.updateFields({
+ employeeId: {
+ value: detail["employeeId"],
+ valueSpan: detail["username"],
+ valueObj: [{ id: detail["employeeId"], name: detail["username"] }]
+ }
+ });
+ }
+ });
+ });
+ };
+ convertPayload = (payload) => {
+ const itemValueList = [];
+ return _.reduce(_.keys(payload), (pre, cur) => {
+ if (!_.isNaN(parseInt(cur))) {
+ itemValueList.push({ variableItemId: cur, itemValue: payload[cur] });
+ return { ...pre, itemValueList };
+ }
+ return { ...pre, [cur]: payload[cur] };
+ }, {});
+ };
+ save = () => {
+ const { baseTableStore: { VSSalaryFileForm }, onSearch, id } = this.props;
+ VSSalaryFileForm.validateForm().then(f => {
+ if (f.isValid) {
+ const payload = VSSalaryFileForm.getFormParams();
+ this.setState({ loading: true });
+ API.createVariableSalary({ ...this.convertPayload(payload), id })
+ .then(({ status, errormsg }) => {
+ this.setState({ loading: false });
+ if (status) {
+ message.success(getLabel(30700, "操作成功"));
+ this.props.onClose(onSearch());
+ } else {
+ message.error(errormsg);
+ }
+ }).catch(() => this.setState({ loading: false }));
+ } else {
+ f.showErrors();
+ }
+ });
+ };
+ renderTitle = () => {
+ const { loading } = this.state, { title, detail } = this.props;
+ return
+
+
+ {
+ _.isEmpty(detail) &&
+
+ }
+
+
;
+ };
+
+ render() {
+ const { conditions } = this.state;
+ const { baseTableStore: { VSSalaryFileForm }, onClose } = this.props;
+ return ( onClose()}
+ top={0} width={800} height={100} measureT="%" measureX="px" measureY="%" title={this.renderTitle()}
+ content={{getSearchs(VSSalaryFileForm, conditions)}
}
+ />);
+ }
+}
+
+export default Index;
diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js
new file mode 100644
index 00000000..c8917e45
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js
@@ -0,0 +1,120 @@
+/*
+ * 浮动薪酬
+ * 薪资档案导入
+ * @Author: 黎永顺
+ * @Date: 2024/8/8
+ * @Wechat:
+ * @Email: 971387674@qq.com
+ * @description:
+*/
+import React, { Component } from "react";
+import { WeaCheckbox, WeaDatePicker, WeaFormItem, WeaLocaleProvider } from "ecCom";
+import ImportDialog from "../../../../components/importDialog";
+import * as API from "../../../../apis/variableSalary";
+import { convertToUrlString } from "../../../../util/url";
+
+const getLabel = WeaLocaleProvider.getLabel;
+
+class Index extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ importDialog: {
+ nextloading: false, link: "/api/bs/hrmsalary/variableSalary/downloadTemplate",
+ importResult: {}, imageId: "", hasData: false, salaryMonth: "",
+ previewUrl: "/api/bs/hrmsalary/variableSalary/preview"
+ }
+ };
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ const { importDialog } = this.state;
+ if (nextProps.visible !== this.props.visible && nextProps.visible) {
+ const { baseTableStore: { VSalryForm }, salaryMonth, taxAgentIds } = nextProps;
+ const payload = {
+ salaryMonth, taxAgentIds, ...VSalryForm.getFormParams(), hasData: importDialog.hasData
+ };
+ this.setState({
+ importDialog: { ...importDialog, salaryMonth, link: `${importDialog.link}?${convertToUrlString(payload)}` }
+ });
+ } else {
+ this.setState({
+ importDialog: {
+ nextloading: false, link: "/api/bs/hrmsalary/variableSalary/downloadTemplate", hasData: false,
+ importResult: {}, imageId: "", previewUrl: "/api/bs/hrmsalary/variableSalary/preview", salaryMonth: ""
+ }
+ });
+ }
+ }
+
+ handleImport = (payload) => {
+ const { taxAgentIds } = this.props;
+ const { importDialog } = this.state;
+ const { salaryMonth } = importDialog;
+ this.setState({ importDialog: { ...importDialog, nextloading: true } });
+ API.importVariableSalary({
+ ...payload, salaryMonth, taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",")
+ }).then(({ data, status }) => {
+ this.setState({ importDialog: { ...importDialog, nextloading: false } });
+ if (status) {
+ this.setState({
+ importDialog: { ...importDialog, ...payload, importResult: data }
+ });
+ }
+ }).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } }));
+ };
+ renderFormComponent = () => {
+ const { baseTableStore: { VSalryForm }, taxAgentIds } = this.props;
+ const { importDialog } = this.state;
+ const { salaryMonth: month, hasData } = importDialog;
+ return
+
+ {
+ const payload = { salaryMonth: val, hasData, taxAgentIds, ...VSalryForm.getFormParams() };
+ this.setState({
+ importDialog: {
+ ...importDialog, salaryMonth: val,
+ link: `/api/bs/hrmsalary/variableSalary/downloadTemplate?${convertToUrlString(payload)}`
+ }
+ });
+ }}/>
+
+
;
+ };
+
+ render() {
+ const { importDialog } = this.state;
+ return (
+ this.setState({
+ importDialog: { ...importDialog, importResult: {}, imageId: "", link: null }
+ })}
+ importParams={this.renderFormComponent()}
+ exportDataDom={
+ {
+ const { baseTableStore: { VSalryForm }, taxAgentIds } = this.props;
+ const { salaryMonth } = importDialog;
+ const payload = { salaryMonth, taxAgentIds, ...VSalryForm.getFormParams(), hasData: val === "1" };
+ this.setState({
+ importDialog: {
+ ...importDialog, hasData: val === "1",
+ link: `/api/bs/hrmsalary/variableSalary/downloadTemplate?${convertToUrlString(payload)}`
+ }
+ });
+ }}
+ />
+ }
+ nextCallback={imageId => this.setState({ importDialog: { ...importDialog, imageId } })}
+ nextUplaodCallback={imageId => this.handleImport({ imageId })}
+ />
+ );
+ }
+}
+
+export default Index;
diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js
new file mode 100644
index 00000000..f3b0e52a
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileList/index.js
@@ -0,0 +1,162 @@
+/*
+ * 浮动薪酬
+ * 薪资档案列表
+ * @Author: 黎永顺
+ * @Date: 2024/8/8
+ * @Wechat:
+ * @Email: 971387674@qq.com
+ * @description:
+*/
+import React, { Component } from "react";
+import { inject, observer } from "mobx-react";
+import { WeaLocaleProvider } from "ecCom";
+import { WeaTableNew } from "comsMobx";
+import { message, Modal, Spin } from "antd";
+import * as API from "../../../../apis/variableSalary";
+import { toJS } from "mobx";
+
+const WeaTableComx = WeaTableNew.WeaTable;
+const getLabel = WeaLocaleProvider.getLabel;
+
+@inject("baseTableStore")
+@observer
+class Index extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, dataSource: [], columns: []
+ };
+ }
+
+ componentDidMount() {
+ window.addEventListener("message", this.handleReceive, false);
+ window.addEventListener("resize", this.handleResize, false);
+ this.getVariableSalaryList();
+ }
+
+ componentWillUnmount() {
+ window.removeEventListener("message", this.handleReceive, false);
+ window.removeEventListener("resize", this.handleResize, false);
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.isQuery !== this.props.isQuery) this.setState({
+ pageInfo: { ...this.state.pageInfo, current: 1 }
+ }, () => this.getVariableSalaryList());
+ }
+
+ handleReceive = async ({ data }) => {
+ const { type, payload: { id, params } = {} } = data;
+ if (type === "init") {
+ this.getColumns();
+ } else if (type === "turn") {
+ switch (id) {
+ case "PAGEINFO":
+ this.setState({
+ pageInfo: { ...this.state.pageInfo, ...params }
+ }, () => this.getVariableSalaryList());
+ break;
+ case "DEL":
+ this.handleDelete([params.id]);
+ break;
+ case "VIEW":
+ this.handleView(params.id);
+ break;
+ default:
+ break;
+ }
+ }
+ };
+ getVariableSalaryList = () => {
+ const { baseTableStore: { VSalryForm, getVariableSalaryList }, salaryMonth, taxAgentIds } = this.props;
+ const { pageInfo } = this.state;
+ const { departmentIds } = VSalryForm.getFormParams();
+ this.setState({ loading: true });
+ getVariableSalaryList({
+ ...pageInfo, salaryMonth, taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(","),
+ ...VSalryForm.getFormParams(), departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : []
+ }).then(({ status, data }) => {
+ this.setState({ loading: false });
+ if (status) {
+ const { pageInfo: result } = data;
+ const { list: dataSource, pageNum: current, pageSize, total } = result;
+ this.setState({
+ pageInfo: { ...pageInfo, current, pageSize, total }, dataSource
+ }
+ );
+ }
+ });
+ };
+ handleView = (id) => {
+ API.getVariableSalaryDetail({ id }).then(({ status, data }) => {
+ if (status) this.props.onViewSalaryFile(data.data);
+ });
+ };
+ handleDelete = (ids) => {
+ Modal.confirm({
+ title: getLabel(111, "信息确认"),
+ content: getLabel(111, "确认删除吗?"),
+ onOk: () => {
+ API.deleteVariableSalary({ ids }).then(({ status, errormsg }) => {
+ if (status) {
+ message.success(getLabel(111, "删除成功"));
+ this.getVariableSalaryList();
+ } else {
+ message.error(errormsg);
+ }
+ });
+ }
+ });
+ };
+ getColumns = () => {
+ const { baseTableStore: { SFTableStore }, showOperateBtn } = this.props;
+ const columns = _.map(_.filter(toJS(SFTableStore.columns), (item) => item.display === "true"), (it, idx) => ({
+ dataIndex: it.dataIndex, title: it.title, align: "left",
+ width: 150, ellipsis: true
+ }));
+ if (!_.isEmpty(columns)) {
+ this.postMessageToChild({
+ columns, showOperateBtn, dataSource: this.state.dataSource, scrollHeight: 98,
+ pageInfo: this.state.pageInfo, unitTableType: "variableSalary"
+ });
+ }
+ return columns;
+ };
+ postMessageToChild = (payload = {}) => {
+ const i18n = {
+ "操作": getLabel(30585, "操作"), "查看详情": getLabel(111, "查看详情"),
+ "共": getLabel(18609, "共"), "条": getLabel(18256, "条"),
+ "删除": getLabel(111, "删除")
+ };
+ const childFrameObj = document.getElementById("unitTable");
+ childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
+ };
+
+ render() {
+ const { loading, dataSource } = this.state;
+ const { baseTableStore: { SFTableStore } } = this.props;
+ const dom = document.querySelector(".wea-new-top-req-content");
+ let height = 280;
+ if (dom && dataSource.length > 0) {
+ height = (parseFloat(dom.style.height) > 620 && dataSource.length === 10) ? dataSource.length * 46 + 108 : dataSource.length < 10 ? dataSource.length * 46 + 108 : parseFloat(dom.style.height) - 16;
+ }
+ return (
+
+
+
+
+
+
+
+
+ );
+ }
+}
+
+export default Index;
diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryItemDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryItemDialog/index.js
new file mode 100644
index 00000000..cc4d456d
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryItemDialog/index.js
@@ -0,0 +1,80 @@
+import React, { Component } from "react";
+import { inject, observer } from "mobx-react";
+import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom";
+import { Button, message } from "antd";
+import { getSearchs } from "../../../../util";
+import { salaryItemsConditions } from "../../conditions";
+import * as API from "../../../../apis/variableSalary";
+
+const getKey = WeaTools.getKey;
+const getLabel = WeaLocaleProvider.getLabel;
+
+@inject("baseTableStore")
+@observer
+class Index extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ conditions: [], loading: false
+ };
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visible && nextProps.visible) this.initForm(nextProps);
+ if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.baseTableStore.initVSSalaryItemForm();
+ }
+
+ initForm = (props) => {
+ const { baseTableStore: { VSSalaryItemForm } } = props;
+ this.setState({
+ conditions: _.map(salaryItemsConditions, item => ({
+ ...item,
+ items: _.map(item.items, o => {
+ if (getKey(o) === "dataType") {
+ return { ...o, options: _.map(o.options, g => ({ ...g, showname: getLabel(g.lanId, g.showname) })) };
+ }
+ return { ...o, label: getLabel(o.lanId, o.label) };
+ })
+ }))
+ }, () => VSSalaryItemForm.initFormFields(this.state.conditions));
+ };
+ save = () => {
+ const { baseTableStore: { VSSalaryItemForm }, onSearch, id } = this.props;
+ VSSalaryItemForm.validateForm().then(f => {
+ if (f.isValid) {
+ const payload = VSSalaryItemForm.getFormParams();
+ this.setState({ loading: true });
+ API.saveVariableSalaryItem({ ...payload, id })
+ .then(({ status, errormsg }) => {
+ this.setState({ loading: false });
+ if (status) {
+ message.success(getLabel(30700, "操作成功"));
+ this.props.onCancel(onSearch());
+ } else {
+ message.error(errormsg);
+ }
+ }).catch(() => this.setState({ loading: false }));
+ } else {
+ f.showErrors();
+ }
+ });
+ };
+
+ render() {
+ const { conditions, loading } = this.state;
+ const { baseTableStore: { VSSalaryItemForm } } = this.props;
+ return (
+ this.props.onCancel()}>{getLabel(111, "取消")},
+
+ ]}
+ >
+ {getSearchs(VSSalaryItemForm, conditions, 1, false)}
+
+ );
+ }
+}
+
+export default Index;
diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryItemList/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryItemList/index.js
new file mode 100644
index 00000000..bceb4585
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryItemList/index.js
@@ -0,0 +1,113 @@
+/*
+ * 浮动薪酬
+ * 薪资项目列表
+ * @Author: 黎永顺
+ * @Date: 2024/8/8
+ * @Wechat:
+ * @Email: 971387674@qq.com
+ * @description:
+*/
+import React, { Component } from "react";
+import { WeaLocaleProvider, WeaTable } from "ecCom";
+import { message, Modal } from "antd";
+import * as API from "../../../../apis/variableSalary";
+
+const getLabel = WeaLocaleProvider.getLabel;
+
+class Index extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, dataSource: [], columns: []
+ };
+ }
+
+ componentDidMount() {
+ this.getVariableSalaryItemList();
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.isQuery !== this.props.isQuery) this.setState({
+ pageInfo: { ...this.state.pageInfo, current: 1 }
+ }, () => this.getVariableSalaryItemList());
+ }
+
+ getVariableSalaryItemList = () => {
+ const { baseTableStore: { VSalryForm } } = this.props;
+ const { pageInfo } = this.state;
+ const { username: itemName } = VSalryForm.getFormParams();
+ this.setState({ loading: true });
+ API.getVariableSalaryItemList({ ...pageInfo, itemName }).then(({ status, data }) => {
+ this.setState({ loading: false });
+ if (status) {
+ const { list: dataSource, columns, pageNum: current, pageSize, total } = data;
+ this.setState({
+ pageInfo: { ...pageInfo, current, pageSize, total }, dataSource,
+ columns: [
+ ..._.filter(columns, o => o.dataIndex !== "id"),
+ {
+ title: getLabel(111, "操作"), dataIndex: "oprate",
+ render: (__, record) => (
+ this.handleEdit(record.id)}>{getLabel(111, "编辑")}
+ {
+ record.canDelete && this.handleDelete([record.id])}>{getLabel(111, "删除")}
+ }
+ )
+ }
+ ]
+ }
+ );
+ }
+ });
+ };
+ handleEdit = (id) => {
+ API.getVariableSalaryItemDetail({ id }).then(({ status, data }) => {
+ if (status) this.props.onEditSalaryItem(data);
+ });
+ };
+ handleDelete = (itemIds) => {
+ Modal.confirm({
+ title: getLabel(111, "信息确认"),
+ content: getLabel(111, "确认删除吗?"),
+ onOk: () => {
+ API.deleteVariableSalaryItem({ itemIds }).then(({ status, errormsg }) => {
+ if (status) {
+ message.success(getLabel(111, "删除成功"));
+ this.getVariableSalaryItemList();
+ } else {
+ message.error(errormsg);
+ }
+ });
+ }
+ });
+ };
+
+ render() {
+ const { columns, dataSource, loading, pageInfo } = this.state;
+ 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.getVariableSalaryItemList());
+ },
+ onChange: current => {
+ this.setState({
+ pageInfo: { ...pageInfo, current }
+ }, () => this.getVariableSalaryItemList());
+ }
+ };
+ return (
+
+ );
+ }
+}
+
+export default Index;
diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js
new file mode 100644
index 00000000..d5b274a9
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/variableSalary/components/searchPannel/index.js
@@ -0,0 +1,70 @@
+/*
+ * Author: 黎永顺
+ * name:薪酬统计报薪资明细-高级查询
+ * Description:
+ * Date: 2024/3/26
+ */
+import React, { Component } from "react";
+import { WeaLocaleProvider, WeaTools } from "ecCom";
+import { Button } from "antd";
+import { inject, observer } from "mobx-react";
+import { getSearchs } from "../../../../util";
+import { conditions } from "../../conditions";
+
+const getLabel = WeaLocaleProvider.getLabel;
+const getKey = WeaTools.getKey;
+
+@inject("baseTableStore")
+@observer
+class VariableSalarySearchPannel extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ searchConditions: []
+ };
+ }
+
+ componentDidMount() {
+ this.setState({
+ searchConditions: _.map(conditions, item => {
+ return {
+ ...item,
+ items: _.map(item.items, child => {
+ return { ...child, label: getLabel(child.lanId, child.label) };
+ })
+ };
+ })
+ }, () => {
+ const { baseTableStore: { VSalryForm } } = this.props;
+ VSalryForm.initFormFields(this.state.searchConditions);
+ });
+ }
+
+ render() {
+ const { searchConditions } = this.state;
+ const { baseTableStore: { VSalryForm } } = this.props;
+ return (
+
+
+ {getSearchs(VSalryForm, searchConditions, 2, false)}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+ }
+}
+
+export default VariableSalarySearchPannel;
+
diff --git a/pc4mobx/hrmSalary/pages/variableSalary/conditions.js b/pc4mobx/hrmSalary/pages/variableSalary/conditions.js
new file mode 100644
index 00000000..72ff44cf
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/variableSalary/conditions.js
@@ -0,0 +1,167 @@
+export const conditions = [
+ {
+ items: [
+ {
+ conditionType: "INPUT",
+ domkey: ["itemName"],
+ fieldcol: 14,
+ label: "项目名称",
+ lanId: 111,
+ labelcol: 6,
+ value: "",
+ hide: true,
+ viewAttr: 2
+ },
+ {
+ conditionType: "INPUT",
+ domkey: ["username"],
+ fieldcol: 14,
+ label: "名称",
+ lanId: 111,
+ labelcol: 6,
+ value: "",
+ viewAttr: 2
+ },
+ {
+ browserConditionParam: {
+ completeParams: {},
+ conditionDataParams: {},
+ dataParams: {},
+ destDataParams: {},
+ hasAddBtn: false,
+ hasAdvanceSerach: false,
+ idSeparator: ",",
+ isAutoComplete: 1,
+ isDetail: 0,
+ isMultCheckbox: false,
+ isSingle: false,
+ icon: "icon-coms-hrm",
+ linkUrl: "",
+ pageSize: 10,
+ quickSearchName: "",
+ replaceDatas: [],
+ title: "",
+ type: "57",
+ viewAttr: 2
+ },
+ conditionType: "BROWSER",
+ domkey: ["departmentIds"],
+ fieldcol: 14,
+ label: "部门",
+ lanId: 111,
+ labelcol: 6,
+ value: "",
+ viewAttr: 2
+ },
+ {
+ conditionType: "INPUT",
+ domkey: ["workcode"],
+ fieldcol: 14,
+ label: "工号",
+ lanId: 111,
+ labelcol: 6,
+ value: "",
+ viewAttr: 2
+ }
+ ],
+ title: "",
+ defaultshow: true
+ }
+];
+export const salaryItemsConditions = [
+ {
+ items: [
+ {
+ conditionType: "INPUT",
+ domkey: ["name"],
+ fieldcol: 14,
+ label: "名称",
+ lanId: 111,
+ labelcol: 6,
+ value: "",
+ rules: "required|string",
+ viewAttr: 3
+ },
+ {
+ conditionType: "SELECT",
+ domkey: ["dataType"],
+ fieldcol: 14,
+ label: "字段类型",
+ lanId: 111,
+ labelcol: 6,
+ value: "",
+ options: [
+ { key: "number", showname: "数值", lanId: 111, selected: true },
+ { key: "string", showname: "字符", lanId: 111, selected: false }
+ ],
+ rules: "required|string",
+ viewAttr: 3
+ }
+ ],
+ title: "",
+ defaultshow: true
+ }
+];
+export const salaryFileConditions = [
+ {
+ items: [
+ {
+ conditionType: "MONTHPICKER",
+ domkey: ["salaryMonth"],
+ fieldcol: 16,
+ label: "薪资所属月",
+ lanId: 111,
+ labelcol: 8,
+ value: "",
+ rules: "required|string",
+ viewAttr: 3
+ },
+ {
+ conditionType: "SELECT",
+ domkey: ["taxAgentIds"],
+ fieldcol: 16,
+ label: "个税扣缴义务人",
+ lanId: 111,
+ labelcol: 8,
+ value: "",
+ options: [],
+ rules: "required|string",
+ viewAttr: 3
+ },
+ {
+ browserConditionParam: {
+ completeParams: {},
+ conditionDataParams: {},
+ dataParams: {},
+ destDataParams: {},
+ hasAddBtn: false,
+ hasAdvanceSerach: false,
+ idSeparator: ",",
+ isAutoComplete: 1,
+ isDetail: 0,
+ isMultCheckbox: false,
+ isSingle: true,
+ icon: "icon-coms-hrm",
+ linkUrl: "",
+ pageSize: 10,
+ quickSearchName: "",
+ replaceDatas: [],
+ title: "",
+ type: "17",
+ viewAttr: 2
+ },
+ conditionType: "BROWSER",
+ domkey: ["employeeId"],
+ fieldcol: 16,
+ label: "人员",
+ lanId: 111,
+ labelcol: 8,
+ value: "",
+ rules: "required|string",
+ viewAttr: 3
+ }
+ ],
+ title: "", col: 2,
+ defaultshow: true
+ }
+];
diff --git a/pc4mobx/hrmSalary/pages/variableSalary/index.js b/pc4mobx/hrmSalary/pages/variableSalary/index.js
new file mode 100644
index 00000000..16df4811
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/variableSalary/index.js
@@ -0,0 +1,177 @@
+/*
+ * 浮动薪酬
+ *
+ * @Author: 黎永顺
+ * @Date: 2024/8/8
+ * @Wechat:
+ * @Email: 971387674@qq.com
+ * @description:
+*/
+import React, { Component } from "react";
+import { inject, observer } from "mobx-react";
+import { toJS } from "mobx";
+import { WeaDatePicker, WeaLoadingGlobal, WeaLocaleProvider, WeaReqTop, WeaSelect } from "ecCom";
+import * as API from "../../apis/variableSalary";
+import AdvanceInputBtn from "./components/advanceInputBtn";
+import SearchPannel from "./components/searchPannel";
+import SalaryItemDialog from "./components/salaryItemDialog";
+import SalaryFileDialog from "./components/salaryFileDialog";
+import SalaryItemList from "./components/salaryItemList";
+import SalaryFileList from "./components/salaryFileList";
+import SalaryFileImportDialog from "./components/salaryFileImportDialog";
+import { postFetch } from "../../util/request";
+import moment from "moment";
+import { Button } from "antd";
+import cs from "classnames";
+import "./index.less";
+
+const getLabel = WeaLocaleProvider.getLabel;
+
+@inject("taxAgentStore", "baseTableStore")
+@observer
+class Index extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ selectedKey: "salaryFile", isQuery: false, showSearchAd: false, taxAgentIds: "",
+ salaryMonth: moment(new Date()).format("YYYY-MM"), taxAgentOption: [],
+ SIDialog: { visible: false, title: "", id: "", taxAgentOption: [] }, //薪资项目薪资编辑弹框
+ SFDialog: { visible: false, title: "", detail: {}, taxAgentOption: [] }, //薪资档案编辑弹框
+ SFImpDialog: { visible: false, title: getLabel(24023, "数据导入") }//薪资档案导入
+ };
+ }
+
+ async componentDidMount() {
+ const [queryTax, adminTax] = await Promise.all([
+ postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" }),
+ postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" })
+ ]);
+ const taxAgentOption = _.map(adminTax.data, o => ({ key: String(o.id), showname: o.name }));
+ this.setState({
+ taxAgentOption: _.map(queryTax.data, o => ({ key: String(o.id), showname: o.name })),
+ taxAgentIds: _.map(queryTax.data, o => String(o.id)).join(","),
+ SIDialog: { ...this.state.SIDialog, taxAgentOption },
+ SFDialog: { ...this.state.SFDialog, taxAgentOption }
+ });
+ }
+
+ handleAdvanceSearch = () => this.setState({ isQuery: !this.state.isQuery });
+ openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd });
+ handleOperate = (type, detail = {}) => {
+ const { baseTableStore: { SFTableStore, VSalryForm } } = this.props;
+ switch (type) {
+ case "create":
+ this.setState({
+ SFDialog: {
+ ...this.state.SFDialog, visible: true, detail,
+ title: _.isEmpty(detail) ? getLabel(111, "新增薪资档案") : getLabel(111, "查看薪资档案")
+ }
+ });
+ break;
+ case "import":
+ this.setState({ SFImpDialog: { ...this.state.SFImpDialog, visible: true } });
+ break;
+ case "export":
+ const columns = _.map(_.filter(toJS(SFTableStore.columns), (item) => item.display === "true"), it => it.dataIndex);
+ const { salaryMonth, taxAgentIds } = this.state;
+ const payload = {
+ ...VSalryForm.getFormParams(),
+ taxAgentIds: !_.isEmpty(taxAgentIds) ? taxAgentIds.split(",") : [],
+ departmentIds: !_.isEmpty(VSalryForm.getFormParams().taxAgentIds) ? VSalryForm.getFormParams().taxAgentIds.split(",") : [],
+ salaryMonth, columns
+ };
+ WeaLoadingGlobal.start();
+ const promise = API.exportVariableSalary(payload);
+ break;
+ case "custom_cols":
+ SFTableStore.setColSetVisible(true);
+ SFTableStore.tableColSet(true);
+ break;
+ default:
+ break;
+ }
+ };
+
+ render() {
+ const {
+ selectedKey, SIDialog, SFDialog, SFImpDialog, showSearchAd, isQuery, salaryMonth, taxAgentOption, taxAgentIds
+ } = this.state;
+ const { taxAgentStore: { PageAndOptAuth }, baseTableStore: { VSSalaryItemForm } } = this.props;
+ const showOperateBtn = PageAndOptAuth.opts.includes("admin");
+ const tabs = [
+ {
+ title: getLabel(111, "浮动数据"), key: "salaryFile", showDropIcon: true,
+ dropMenuDatas: showOperateBtn ? [
+ { key: "export", icon: , content: getLabel(111, "导出") },
+ { key: "custom_cols", icon: , content: getLabel(32535, "显示列定制") }
+ ] : [
+ { key: "custom_cols", icon: , content: getLabel(32535, "显示列定制") }
+ ],
+ buttons: showOperateBtn ? [
+ ,
+ ,
+ this.setState({ salaryMonth: val }, () => this.handleAdvanceSearch())}/>,
+ this.setState({ taxAgentIds: val }, () => this.handleAdvanceSearch())}/>,
+ this.openAdvanceSearch()}
+ onAdvanceSearch={this.handleAdvanceSearch}/>
+ ] : [
+ this.setState({ salaryMonth: val }, () => this.handleAdvanceSearch())}/>,
+ this.setState({ taxAgentIds: val }, () => this.handleAdvanceSearch())}/>,
+ this.openAdvanceSearch()}
+ onAdvanceSearch={this.handleAdvanceSearch}/>
+ ],
+ children: this.handleOperate("create", data)}/>
+ },
+ {
+ title: getLabel(111, "字段管理"), key: "salaryItem", showDropIcon: false, dropMenuDatas: [],
+ buttons: showOperateBtn ? [
+ ,
+
+ ] : [],
+ children: this.setState({
+ SIDialog: { visible: true, id: data.id, title: getLabel(111, "编辑薪资项目") }
+ }, () => VSSalaryItemForm.updateFields({
+ name: data.name, dataType: data.dataType
+ }))}/>
+ }
+ ];
+ return (
+ } selectedKey={selectedKey}
+ iconBgcolor="#F14A2D" tabDatas={tabs} className="variable_salary_wrapper"
+ buttons={_.find(tabs, o => selectedKey === o.key).buttons} buttonSpace={10}
+ onChange={selectedKey => this.setState({ selectedKey, SFDialog: { ...SFDialog, visible: false } })}
+ showDropIcon={_.find(tabs, o => selectedKey === o.key).showDropIcon} onDropMenuClick={this.handleOperate}
+ dropMenuDatas={_.find(tabs, o => selectedKey === o.key).dropMenuDatas}
+ >
+
+ this.setState({ showSearchAd: false })} onAdSearch={this.handleAdvanceSearch}/>
+
+ {_.find(tabs, o => selectedKey === o.key).children}
+ {/*薪资项目*/}
+ this.setState({
+ SIDialog: { ...SIDialog, visible: false }
+ }, () => callback && callback())}/>
+ {/*薪资档案*/}
+ this.setState({
+ SFDialog: { ...SFDialog, visible: false }
+ }, () => callback && callback())}/>
+ {/* 薪资档案导入*/}
+ {
+ this.setState({ SFImpDialog: { ...SFImpDialog, visible: false } },
+ () => callback && this.handleAdvanceSearch());
+ }}/>
+
+ );
+ }
+}
+
+export default Index;
diff --git a/pc4mobx/hrmSalary/pages/variableSalary/index.less b/pc4mobx/hrmSalary/pages/variableSalary/index.less
new file mode 100644
index 00000000..b76440d6
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/variableSalary/index.less
@@ -0,0 +1,115 @@
+.variable_salary_wrapper {
+ .wea-new-top-req-title > div:last-child {
+ right: 16px !important;
+ }
+
+ .wea-new-top-req-content {
+ padding: 16px;
+
+ .wea-new-table {
+ background: #FFF;
+ }
+
+ .ant-spin-nested-loading, .ant-spin-container {
+ height: 100% !important;
+ }
+
+ }
+
+ .searchAdvanced-condition-hide {
+ display: none;
+ }
+
+ .searchAdvanced-condition-container {
+ background: #FFF;
+ margin-bottom: 10px;
+ border: 1px solid #e5e5e5;
+
+ .wea-search-buttons {
+ border-top: 1px solid #dadada;
+ padding: 15px 0;
+ }
+
+ .wea-advanced-searchsAd {
+ height: 108px;
+ overflow: hidden auto;
+
+ .formItem-delete {
+ position: absolute;
+ top: 0;
+ right: -40px;
+ }
+
+ .searchAdvanced-commonSelect {
+ border-top: 1px solid #ebebeb;
+ margin: 0 25px;
+ padding: 10px 0;
+ }
+
+ .custom-advance-largeSpacing {
+ padding-left: 26px;
+
+ .link {
+ border: none;
+ border-radius: 0;
+ padding: 12px 10px 12px 26px;
+ color: #2db7f5
+ }
+ }
+
+ }
+ }
+
+ .variable_salary_file_dialog {
+ .scroller {
+ background: #f6f6f6 !important;
+ }
+
+ .wea-slide-modal-title {
+ border-bottom: 1px solid #e5e5e5 !important;
+ }
+
+ .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:last-child {
+ margin-left: 10px;
+ }
+ }
+ }
+ }
+}
diff --git a/pc4mobx/hrmSalary/single.js b/pc4mobx/hrmSalary/single.js
index 863c0a8a..1de2325b 100644
--- a/pc4mobx/hrmSalary/single.js
+++ b/pc4mobx/hrmSalary/single.js
@@ -10,6 +10,7 @@ import { RouterStore, syncHistoryWithStore } from "mobx-react-router";
import { Provider } from "mobx-react";
import Module from "weaHrmSalary";
+import stores from "./stores";
const routing = new RouterStore();
@@ -38,6 +39,7 @@ class Root extends React.Component {
header.appendChild(link)
top.$(".ant-message").remove();
window.location.hash.indexOf("mobilepayroll") === -1 && allStore.taxAgentStore.getPermission();
+ window.location.hash.indexOf("mobilepayroll") !== -1 && allStore.taxAgentStore.initPageAndOptAuth();
if (window.location.hash.indexOf("payroll") !== -1) {
window.localStorage.removeItem("template-basedata");
window.localStorage.removeItem("salary-showset");
diff --git a/pc4mobx/hrmSalary/stores/baseTable.js b/pc4mobx/hrmSalary/stores/baseTable.js
index cc639b54..19333392 100644
--- a/pc4mobx/hrmSalary/stores/baseTable.js
+++ b/pc4mobx/hrmSalary/stores/baseTable.js
@@ -1,8 +1,9 @@
-import { observable, action, toJS } from 'mobx';
-import { message } from 'antd';
-import { WeaForm, WeaTableNew } from 'comsMobx';
+import { action, observable } from "mobx";
+import { message } from "antd";
+import { WeaForm, WeaTableNew } from "comsMobx";
-import * as API from '../apis'; // 引入API接口文件
+import * as API from "../apis"; // 引入API接口文件
+import { getVariableSalaryList } from "../apis/variableSalary"; //浮动薪酬-薪资档案列表查询
const { TableStore } = WeaTableNew;
@@ -14,12 +15,38 @@ export class BaseTableStore {
@observable showSearchAd = false; // 高级搜索面板显示
@observable loading = true; // 数据加载状态
+ // 浮动薪酬相关
+ @observable VSalryForm = new WeaForm(); // 浮动薪酬查询form
+ @observable VSSalaryItemForm = new WeaForm(); // 新增编辑浮动薪酬项目form
+ @action initVSSalaryItemForm = () => this.VSSalaryItemForm = new WeaForm();
+ @observable VSSalaryFileForm = new WeaForm(); // 新增编辑薪资档案form
+ @action initVSSalaryFileForm = () => this.VSSalaryFileForm = new WeaForm();
+ @observable SFTableStore = new TableStore(); // 浮动薪酬-薪资档案table
+
+ @action("浮动薪酬-薪资档案列表查询")
+ getVariableSalaryList = (payload) => {
+ return new Promise((resolve, reject) => {
+ getVariableSalaryList(payload).then(res => {
+ const { data, status } = res;
+ if (status) {
+ const { dataKey } = data;
+ const { datas } = dataKey;
+ this.SFTableStore.getDatas(datas);
+ }
+ resolve(res);
+ }).catch(() => {
+ reject();
+ });
+ });
+ };
+
+
// 初始化操作
@action
doInit = () => {
this.getCondition();
this.getTableDatas();
- }
+ };
// 获得高级搜索表单数据
@action
@@ -29,10 +56,10 @@ export class BaseTableStore {
this.condition = res.condition;
this.form.initFormFields(res.condition); // 渲染高级搜索form表单
} else {
- message.error(res.msg || '接口调用失败!')
+ message.error(res.msg || "接口调用失败!");
}
}));
- }
+ };
// 渲染table数据
@action
@@ -45,11 +72,11 @@ export class BaseTableStore {
this.tableStore.getDatas(res.datas); // table 请求数据
this.hasRight = res.hasRight;
} else {
- message.error(res.msg || '接口调用失败!')
+ message.error(res.msg || "接口调用失败!");
}
this.loading = false;
}));
- }
+ };
@action
setShowSearchAd = bool => this.showSearchAd = bool;
@@ -58,6 +85,6 @@ export class BaseTableStore {
@action doSearch = () => {
this.getTableDatas();
this.showSearchAd = false;
- }
+ };
-}
\ No newline at end of file
+}
diff --git a/pc4mobx/hrmSalary/stores/salaryItem.js b/pc4mobx/hrmSalary/stores/salaryItem.js
index cc3a0214..45f30171 100644
--- a/pc4mobx/hrmSalary/stores/salaryItem.js
+++ b/pc4mobx/hrmSalary/stores/salaryItem.js
@@ -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();
diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js
index 1e02f209..62a99dab 100644
--- a/pc4mobx/hrmSalary/stores/taxAgent.js
+++ b/pc4mobx/hrmSalary/stores/taxAgent.js
@@ -4,10 +4,20 @@ import { WeaForm, WeaTableNew } from "comsMobx";
import * as API from "../apis/taxAgent"; // 引入API接口文件
import { decentralizationConditions, editConditions } from "../pages/taxAgent/editConditions";
+import { PAGE } from "../config";
const { TableStore } = WeaTableNew;
export class TaxAgentStore {
+ @observable advanceForm = new WeaForm(); //权限-角色高级搜索form表单
+ @observable roleForm = new WeaForm(); //权限-角色form表单
+ @action initRoleForm = () => this.roleForm = new WeaForm();
+ @observable roleOperatorForm = new WeaForm(); //权限-角色操作者form表单
+ @action initRoleOperatorForm = () => this.roleOperatorForm = new WeaForm();
+ @observable PageAndOptAuth = { able: false, opts: [] }; // 业务线页面权限
+ @action initPageAndOptAuth = () => this.PageAndOptAuth = { able: true, opts: ["query", "admin"] };// 设置业务线页面权限
+
+
@observable tableStore = new TableStore(); // new table
@observable form = new WeaForm(); //表单实体
@observable formDecentralization = new WeaForm(); //关闭分权表单
@@ -66,11 +76,9 @@ export class TaxAgentStore {
// 渲染table数据
@action
getTaxAgentList = params => {
- this.loading = true;
params = params || {};
API.getTaxAgentList(params).then(
action(({ data, status }) => {
- this.loading = false;
if (status) {
// 接口请求成功/失败处理
const { columns, list, total, pageNum: current, pageSize } = data;
@@ -139,9 +147,15 @@ export class TaxAgentStore {
@action
getPermission = params => {
+ _.map(_.keys(PAGE), page => {
+ if (_.some(PAGE[page], k => window.location.hash.indexOf(k) !== -1)) params = { ...params, page };
+ });
+ this.loading = true;
return new Promise((resolve, reject) => {
API.getPermission(params).then(({ status, data }) => {
+ this.loading = false;
if (status) {
+ this.PageAndOptAuth = data;
const { isAdminEnable, isChief, isOpenDevolution } = data;
this.setShowOperateBtn(
!isOpenDevolution ? true : isAdminEnable ? true : false
diff --git a/pc4mobx/hrmSalary/style/index.less b/pc4mobx/hrmSalary/style/index.less
index 8e65be90..02955b0b 100644
--- a/pc4mobx/hrmSalary/style/index.less
+++ b/pc4mobx/hrmSalary/style/index.less
@@ -39,6 +39,10 @@
.form-dialog-layout {
background: #f6f6f6;
+ .wea-form-item .wea-form-item-wrapper .wea-field-readonly {
+ line-height: 28px;
+ }
+
.wea-search-group {
padding: 16px;
}
@@ -117,3 +121,10 @@
}
+//公共slide框标题样式
+.zIndex0-weaslide-title {
+ .wea-new-top-req {
+ z-index: 0 !important;
+ }
+}
+
diff --git a/pc4mobx/hrmSalary/util/index.js b/pc4mobx/hrmSalary/util/index.js
index 0ce4532f..ca93a24d 100644
--- a/pc4mobx/hrmSalary/util/index.js
+++ b/pc4mobx/hrmSalary/util/index.js
@@ -1,8 +1,10 @@
import { Spin } from "antd";
import { WeaSwitch } from "comsMobx";
-import { WeaAlertPage, WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup } from "ecCom";
+import { WeaAlertPage, WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
+import CustomBrowser from "../components/CustomBrowser";
const getLabel = WeaLocaleProvider.getLabel;
+const getKey = WeaTools.getKey;
// 获取condition的domKey值
export const getConditionDomkeys = (condition) => {
@@ -43,12 +45,14 @@ export const getSearchs = (form, condition, col, isCenter, onChange = () => void
tipPosition="bottom" // 错误提示的显示位置: top/bottom
className={(fields.domkey[0] === "subcompanyName" || fields.domkey[0] === "departmentName") ? "hideFormItem" : classnames}
>
-
+ {
+ fields.conditionType === "CUSTOMBROWSER" ?
+ onChange({
+ [getKey(fields)]: _.map(_.values(val), o => ({ id: o.id, name: o.name }))
+ })}/> :
+
+ }
{
fields.helpfulTitle &&