diff --git a/pc4mobx/hrmSalary/pages/custom-pages/wandelong/api/index.js b/pc4mobx/hrmSalary/pages/custom-pages/wandelong/api/index.js index 2956ccc8..07e703ac 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/wandelong/api/index.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/wandelong/api/index.js @@ -1,3 +1,4 @@ +import { WeaTools } from "ecCom"; import { postFetch } from "../../../../util/request"; // 万德隆薪资动态表 @@ -8,3 +9,6 @@ export const getDynamicSalaryReport = params => { export const importWdlDynamicSalaryReport = params => { return postFetch("/api/bs/hrmsalary/salaryacct/wdl/importWdlDynamicSalaryReport", params); }; +export const getlbSelectList = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/wdl/lbSelectList", "GET", params); +}; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/wandelong/salaryDynamicTable/conditions.js b/pc4mobx/hrmSalary/pages/custom-pages/wandelong/salaryDynamicTable/conditions.js new file mode 100644 index 00000000..f184ab44 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/custom-pages/wandelong/salaryDynamicTable/conditions.js @@ -0,0 +1,125 @@ +export const conditions = [ + { + items: [ + { + conditionType: "SELECT", + domkey: ["lbList"], + fieldcol: 18, + label: "类别", + lanId: 111, + labelcol: 6, + multiple: true, + 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: "262", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["bgddList"], + fieldcol: 18, + label: "办公地点", + lanId: 111, + labelcol: 6, + 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: "278", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["gwmcList"], + fieldcol: 18, + label: "岗位名称", + lanId: 111, + labelcol: 6, + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: { + type: 162, + fielddbtype: "browser.zj_123", + f_weaver_belongto_usertype: "0" + }, + conditionDataParams: { + type: "browser.zj_123", + fielddbtype: "browser.zj_123", + f_weaver_belongto_usertype: "0" + }, + dataParams: { + type: "browser.zj_123", + f_weaver_belongto_usertype: "0" + }, + destDataParams: { + type: "browser.zj_123", + f_weaver_belongto_usertype: "0" + }, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "162", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["gwzjList"], + fieldcol: 18, + label: "岗位职级", + lanId: 111, + labelcol: 6, + viewAttr: 2 + } + ], + defaultshow: true + } +]; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/wandelong/salaryDynamicTable/index.js b/pc4mobx/hrmSalary/pages/custom-pages/wandelong/salaryDynamicTable/index.js index 22947d27..5f7fe852 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/wandelong/salaryDynamicTable/index.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/wandelong/salaryDynamicTable/index.js @@ -8,30 +8,60 @@ * @description: */ import React, { Component } from "react"; -import { WeaLocaleProvider, WeaTable, WeaTop } from "ecCom"; +import { WeaLocaleProvider, WeaTable, WeaTools, WeaTop } from "ecCom"; import WdlImportDialog from "../components/wdlImportDialog"; -import { Button } from "antd"; +import { convertToUrlString } from "../../../../util/url"; +import FormInfo from "../../../../components/FormInfo"; +import { conditions } from "./conditions"; import * as API from "../api"; +import { getlbSelectList } from "../api"; +import { WeaForm } from "comsMobx"; +import { Button } from "antd"; +import cs from "classnames"; import "./index.less"; +const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; +const form = new WeaForm(); class Index extends Component { constructor(props) { super(props); this.state = { - columns: [], dataSource: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, visible: false + columns: [], dataSource: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false, visible: false, + showAdvance: false, conditions: [] }; } - componentDidMount() { - this.getDynamicSalaryReport(); + async componentDidMount() { + const { data } = await getlbSelectList(); + this.setState({ + conditions: _.map(conditions, item => ({ + ...item, items: _.map(item.items, o => { + o = { ...o, label: getLabel(o.lanId, o.label) }; + if (getKey(o) === "lbList") { + return { ...o, options: _.map(data, it => ({ key: String(it.id), showname: it.name })) }; + } + return o; + }) + })) + }, () => { + form.initFormFields(this.state.conditions); + this.getDynamicSalaryReport(); + }); } getDynamicSalaryReport = () => { - const { pageInfo } = this.state; + const { pageInfo } = this.state, { lbList, bgddList, gwmcList, gwzjList } = form.getFormParams(); + const payload = { + lbList: lbList ? lbList.split(",") : [], + bgddList: bgddList ? bgddList.split(",") : [], + gwmcList: gwmcList ? gwmcList.split(",") : [], + gwzjList: gwzjList ? gwzjList.split(",") : [], + ...pageInfo + }; this.setState({ loading: true }); - API.getDynamicSalaryReport({ ...pageInfo }).then(({ status, data }) => { + API.getDynamicSalaryReport(payload).then(({ status, data }) => { this.setState({ loading: false }); if (status) { const { columns, pageInfo: result } = data, { pageNum: current, pageSize, total, list: dataSource } = result; @@ -45,7 +75,7 @@ class Index extends Component { }; render() { - const { loading, columns, dataSource, pageInfo, visible } = this.state; + const { loading, columns, dataSource, pageInfo, visible, showAdvance, conditions } = this.state; const pagination = { ...pageInfo, showTotal: total => `${getLabel(111, "共")} ${total} ${getLabel(111, "条")}`, @@ -67,9 +97,22 @@ class Index extends Component { buttons={[, ]} - > + onClick={() => window.open(`/api/bs/hrmsalary/salaryacct/wdl/exportDynamicSalaryReport?${convertToUrlString(form.getFormParams())}`, "_blank")}>{getLabel(17416, "导出")}, + this.setState({ showAdvance: !showAdvance })}>{getLabel(111, "高级搜索")}]}>