diff --git a/pc4mobx/hrmSalary/apis/index.js b/pc4mobx/hrmSalary/apis/index.js index 854c9bf6..6be981c4 100644 --- a/pc4mobx/hrmSalary/apis/index.js +++ b/pc4mobx/hrmSalary/apis/index.js @@ -1,4 +1,5 @@ import { WeaTools } from "ecCom"; +import { postFetch } from "../util/request"; // form基础数据 export const getBaseForm = (params) => { @@ -19,3 +20,20 @@ export const getCondition = (params) => { export const getTableDatas = (params) => { return WeaTools.callApi("/api/demo03/weatableDemo", "GET", params); }; +//获取日志列表 +export const getLogs = params => { + const payload = { + ...params, + module: "hrsa", dataset: "dataset", + filterConditions: "[]", transMethod: "hrsa", + authParams: "{}" + }; + return postFetch("/api/bs/hrmsalary/elog/getLogs", payload); +}; +//获取单条操作记录的更新明细 +export const getDetailChanges = params => { + const payload = { + ...params, module: "hrsa", detailTransMethod: "elogDemoDetail", + }; + return postFetch("/api/bs/hrmsalary/elog/getDetailChanges", payload); +}; diff --git a/pc4mobx/hrmSalary/components/logViewModal/config.js b/pc4mobx/hrmSalary/components/logViewModal/config.js new file mode 100644 index 00000000..872a90c0 --- /dev/null +++ b/pc4mobx/hrmSalary/components/logViewModal/config.js @@ -0,0 +1,78 @@ +import React from "react"; +import { WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; +import { WeaSwitch } from "comsMobx"; +import { Button } from "antd"; + +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; +export const logConditions = [ + { + items: [ + { + conditionType: "INPUT", + domkey: ["operator"], + fieldcol: 18, + label: "操作人", + lanId: 17482, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["targetname"], + fieldcol: 18, + label: "对象", + lanId: 106, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["operatetypename"], + fieldcol: 18, + label: "操作类型", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 2 + } + ], + defaultshow: true, + title: "" + } +]; + +export const renderLogSearchsForm = (form, condition, onSearch = () => void (0)) => { + const { isFormInit } = form; + const formParams = form.getFormParams(); + let group = []; + isFormInit && condition && condition.map(c => { + let items = []; + c.items.map(fields => { + items.push({ + com: ( + + + { + getKey(fields) === "operatetypename" && +
+ + +
+ } +
), + colSpan: 1 + }); + }); + group.push( + ); + }); + return group; +}; diff --git a/pc4mobx/hrmSalary/components/logViewModal/index.js b/pc4mobx/hrmSalary/components/logViewModal/index.js index d95ceb25..aeab775a 100644 --- a/pc4mobx/hrmSalary/components/logViewModal/index.js +++ b/pc4mobx/hrmSalary/components/logViewModal/index.js @@ -1,99 +1,116 @@ -import React from 'react' -import { Button, Modal } from 'antd'; -import { WeaInput, WeaRangePicker, WeaTable} from 'ecCom' -import { logColumns, dataSource } from "../../common/columns" +/* + * Author: 黎永顺 + * name: 薪酬日志查看 + * Description: + * Date: 2024/1/24 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaLocaleProvider, WeaTable } from "ecCom"; +import { logConditions, renderLogSearchsForm } from "./config"; +import "./index.less"; -export default class LogViewModal extends React.Component { - constructor(props) { - super(props) - this.state ={ - value: "" - } +const getLabel = WeaLocaleProvider.getLabel; + +@inject("baseFormStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, + loading: false, conditions: [] + }; + } + + componentDidMount() { + const { baseFormStore: { form } } = this.props; + this.setState({ + conditions: _.map(logConditions, it => ({ + ...it, items: _.map(it.items, o => ({ ...o, label: getLabel(o.lanId, o.label) })) + })) + }, () => form.initFormFields(this.state.conditions)); + } + + componentWillReceiveProps(nextProps, nextContext) { + // if (nextProps.visible !== this.props.visible && nextProps.visible) this.getAdjustHistoryList(); + if (nextProps.visible !== this.props.visible && !nextProps.visible) { + this.setState({ + dataSource: [], columns: [], pageInfo: { current: 0, pageSize: 10, total: 0 }, + loading: false + }); } - render() { - return ( - alert("ok")} onCancel={this.props.onCancel} - className="logViewModal" - style={{ top: 150 }} - width={'80%'} height={'50%'} - > -
-
-
操作时间
-
- this.setState({ value: v })} - /> -
-
-
-
操作人
-
- { - console.log(value); - this.setState({ value }); - }} - customBlur={v => { - console.log("custom blur", v); - }} - onFocus={v => console.log("focus", v)} - onBlur={v => console.log("blur", v)} - /> -
-
+ } -
-
对象
-
- { - console.log(value); - this.setState({ value }); - }} - customBlur={v => { - console.log("custom blur", v); - }} - onFocus={v => console.log("focus", v)} - onBlur={v => console.log("blur", v)} - /> -
-
+ // getAdjustHistoryList = (extra = {}) => { + // const { pageInfo } = this.state; + // const { archivesStore: { logForm } } = this.props; + // const payload = { ...pageInfo, ...logForm.getFormParams(), ...extra }; + // this.setState({ loading: true }); + // getAdjustHistoryList(payload).then(({ status, data }) => { + // this.setState({ loading: false }); + // if (status) { + // const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + // this.setState({ + // pageInfo: { ...pageInfo, current, pageSize, total }, + // dataSource, columns: _.map(columns, it => { + // if (it.dataIndex === "operateTime") { + // return { ...it, render: (text) => ({moment(text).format("YYYY-MM-DD")}) }; + // } + // return { ...it }; + // }) + // }); + // } + // }).catch(() => this.setState({ loading: false })); + // }; -
-
操作类型
-
- { - console.log(value); - this.setState({ value }); - }} - customBlur={v => { - console.log("custom blur", v); - }} - onFocus={v => console.log("focus", v)} - onBlur={v => console.log("blur", v)} - /> -
-
- -
- -
-
- -
- ) - } -} \ No newline at end of file + render() { + const { loading, dataSource, columns, pageInfo, conditions } = this.state; + const { baseFormStore: { form } } = this.props; + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => this.getAdjustHistoryList()); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.getAdjustHistoryList()); + } + }; + const scrollHeight = this.logRef ? this.logRef.state.height - 210 : 606.6; + return ( + this.logRef = dom} className="logDialog" initLoadCss + style={{ + width: 1150, + height: 606.6, + minHeight: 200, + minWidth: 380, + maxHeight: "90%", + maxWidth: "90%", + overflow: "hidden", + transform: "translate(0px, 0px)" + }} + > +
+ {renderLogSearchsForm(form, conditions, () => this.getAdjustHistoryList({ current: 1 }))} + +
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/components/logViewModal/index.less b/pc4mobx/hrmSalary/components/logViewModal/index.less new file mode 100644 index 00000000..6c10dc6f --- /dev/null +++ b/pc4mobx/hrmSalary/components/logViewModal/index.less @@ -0,0 +1,30 @@ +.logDialog { + .wea-dialog-body { + overflow-y: hidden; + } + + .logDialogContent { + background: #F6F6F6; + padding: 16px; + width: 100%; + height: 100%; + + .wea-search-group { + padding: 0; + margin-bottom: 10px; + background: #FFF; + + .wea-form-cell { + padding: 0; + + .wea-form-item { + padding: 10px; + } + } + } + + .logTable { + background: #FFFFFF; + } + } +} diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.js b/pc4mobx/hrmSalary/pages/salaryItem/index.js index 921c9d2f..67a0f05e 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.js @@ -11,6 +11,7 @@ import CustomSalaryItemSlide from "./customSalaryItemSlide"; import CustomPaginationTable from "../../components/customPaginationTable"; import SyncToSalaryAccountSetDialog from "./syncToSalaryAccountSetDialog"; import "../socialSecurityBenefits/programme/index.less"; +import LogDialog from "../../components/logViewModal"; const { getLabel } = WeaLocaleProvider; @inject("salaryItemStore", "taxAgentStore", "salaryFileStore") @@ -27,7 +28,8 @@ export default class SalaryItem extends React.Component { formalModalVisible: false, searchParams: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [], - syncSalarySetDialog: { visible: false, title: "", id: "" } + syncSalarySetDialog: { visible: false, title: "", id: "" }, + logDialogVisible: false }; columns.map(item => { if (item.dataIndex == "refere") { @@ -191,6 +193,16 @@ export default class SalaryItem extends React.Component { getTableDatas({ ...searchParams }); } + onDropMenuClick = (key) => { + switch (key) { + case "log": + this.setState({ logDialogVisible: true }); + break; + default: + break; + } + }; + render() { const { salaryItemStore, @@ -198,7 +210,7 @@ export default class SalaryItem extends React.Component { taxAgentStore: { showOperateBtn, showSalaryItemBtn, taxAgentOption } } = this.props; const { userStatusList } = salaryFileStore; - const { selectedRowKeys } = this.state; + const { selectedRowKeys, logDialogVisible } = this.state; const { loading, deleteItemRequest, getTableDatas } = salaryItemStore; const { tableDataSource, @@ -342,11 +354,14 @@ export default class SalaryItem extends React.Component { }; return (
- } - iconBgcolor="#F14A2D" - showDropIcon={false} + } iconBgcolor="#F14A2D" + showDropIcon onDropMenuClick={this.onDropMenuClick} + dropMenuDatas={[ + { + key: "log", icon: , + content: getLabel(545781, "操作日志") + } + ]} >
@@ -387,7 +402,8 @@ export default class SalaryItem extends React.Component { } })} /> - + {/*操作日志*/} + this.setState({ logDialogVisible: false })}/> { systemItemVisible && this.logVisible = bool - -} \ No newline at end of file + +}