diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 272bdbdd..23c9a6e9 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -54,6 +54,8 @@ import TopologyMap from "./pages/topologyMap"; import SupplementaryCalc from "./pages/supplementaryCalc"; import VariableSalary from "./pages/variableSalary"; import Layout from "./layout"; + +import CustomRoutes from "./pages/custom-pages"; import stores from "./stores"; import "./style/index"; // 读取系统多语言配置 @@ -118,6 +120,7 @@ const Routes = ( + {CustomRoutes} ); diff --git a/pc4mobx/hrmSalary/pages/custom-pages/guangyang/actualSalaryReport/index.js b/pc4mobx/hrmSalary/pages/custom-pages/guangyang/actualSalaryReport/index.js new file mode 100644 index 00000000..b44bf14f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/custom-pages/guangyang/actualSalaryReport/index.js @@ -0,0 +1,129 @@ +/* + * 光阳摩托薪酬二开 + * 实发工资报表 + * @Author: 黎永顺 + * @Date: 2025/7/23 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaDatePicker, WeaInputSearch, WeaLoadingGlobal, WeaLocaleProvider, WeaTable, WeaTools, WeaTop } from "ecCom"; +import FormInfo from "../../../../components/FormInfo"; +import { convertToUrlString } from "../../../../util/url"; +import { conditions } from "../conditions"; +import moment from "moment"; +import * as API from "../api"; +import { WeaForm } from "comsMobx"; +import cs from "classnames"; +import { Button } from "antd"; +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 = { + showAdvance: false, conditions: [], payload: {}, loading: false, dataSource: [], columns: [] + }; + } + + async componentDidMount() { + const { data } = await API.getLedgerList(); + this.setState({ + conditions: _.map(conditions, item => ({ + ...item, items: _.map(item.items, o => { + o = { ...o, label: getLabel(o.lanId, o.label) }; + if (getKey(o) === "salarySobIds") { + return { ...o, options: _.map(data, it => ({ key: it.id, showname: it.content })) }; + } else if (getKey(o) === "salaryMonth") { + return { ...o, value: moment(new Date()).format("YYYY-MM") }; + } + return o; + }) + })) + }, () => { + form.initFormFields(this.state.conditions); + this.getQysfgzReportList(); + }); + } + + getQysfgzReportList = () => { + const { employeeName, salaryMonth, salarySobIds, ygxzs, kbIds } = form.getFormParams(); + const payload = { + employeeName, + salaryMonth: moment(salaryMonth).startOf("month").format("YYYY-MM-DD"), + salarySobIds: salarySobIds ? salarySobIds.split(",") : [], + ygxzs: ygxzs ? ygxzs.split(",") : [], + kbIds: kbIds ? kbIds.split(",") : [] + }; + this.setState({ loading: true }); + API.getQysfgzReportList(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { column, data: dataSource } = data; + this.setState({ + payload, dataSource, + columns: _.map(column, item => ({ title: item.text, dataIndex: item.column, width: item.width })) + }); + } + }); + }; + handleExport = () => { + const { payload } = this.state; + WeaLoadingGlobal.start(); + const promise = API.exportQysfgzReport(payload); + }; + handlePrint = () => { + const { employeeName, salaryMonth } = form.getFormParams(); + const payload = { + ...form.getFormParams(), employeeName, type: "actual", + salaryMonth: moment(salaryMonth).startOf("month").format("YYYY-MM-DD") + }; + window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/printReport_guangyang?${convertToUrlString(payload)}`); + }; + + render() { + const { showAdvance, conditions, columns, loading, dataSource } = this.state; + const buttons = [, + , +
+ { + form.updateFields({ salaryMonth: v }); + this.getQysfgzReportList(); + }} + style={{ width: 200, marginRight: 10 }}/> + form.updateFields({ employeeName: v })} + onSearch={this.getQysfgzReportList}/> + this.setState({ showAdvance: !showAdvance })}>{getLabel(111, "高级搜索")} +
]; + return (} iconBgcolor="#F14A2D" + buttons={buttons} className="actualSalaryReport"> +
+
+ +
+ + + +
+
+ +
+
); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/guangyang/api.js b/pc4mobx/hrmSalary/pages/custom-pages/guangyang/api.js new file mode 100644 index 00000000..1ec250cd --- /dev/null +++ b/pc4mobx/hrmSalary/pages/custom-pages/guangyang/api.js @@ -0,0 +1,21 @@ +import { WeaTools } from "ecCom"; +import { postExportFetch, postFetch } from "../../../util/request"; + +export const getAccountList = (params) => { + return WeaTools.callApi("/api/hrm/login/getAccountList", "GET", params); +}; +export const getLedgerList = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/attendQuote/allSalarySobList", "GET", params); +}; +export const getQysfgzReportList = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/gysfgzReport/list", params); +}; +export const getGyDepartmentSalaryReport = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/gyDepartmentSalaryReport/list", params); +}; +export const exportQysfgzReport = (params) => { + return postExportFetch("/api/bs/hrmsalary/salaryacct/acctresult/gysfgzReport/export", params); +}; +export const exportGyDepartmentSalaryReport = (params) => { + return postExportFetch("/api/bs/hrmsalary/salaryacct/acctresult/gyDepartmentSalaryReport/export", params); +}; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/guangyang/conditions.js b/pc4mobx/hrmSalary/pages/custom-pages/guangyang/conditions.js new file mode 100644 index 00000000..cfee1740 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/custom-pages/guangyang/conditions.js @@ -0,0 +1,101 @@ +export const conditions = [ + { + items: [ + { + conditionType: "INPUT", + domkey: ["employeeName"], + fieldcol: 18, + label: "姓名", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + conditionType: "INPUT", + domkey: ["salaryMonth"], + fieldcol: 18, + label: "薪资所属月", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 2, + hide: true + }, + { + conditionType: "SELECT", + domkey: ["salarySobIds"], + fieldcol: 18, + label: "薪资账套", + lanId: 111, + labelcol: 6, + multiple: true, + value: "", + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "用工性质", + type: "31", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["ygxzs"], + fieldcol: 18, + isQuickSearch: false, + label: "用工性质", + lanId: 111, + labelcol: 6, + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: true, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "部门", + type: "57", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["kbIds"], + fieldcol: 18, + isQuickSearch: false, + label: "部门", + lanId: 111, + labelcol: 6, + viewAttr: 2 + } + ], + defaultshow: true + } +]; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/guangyang/index.less b/pc4mobx/hrmSalary/pages/custom-pages/guangyang/index.less new file mode 100644 index 00000000..51891fff --- /dev/null +++ b/pc4mobx/hrmSalary/pages/custom-pages/guangyang/index.less @@ -0,0 +1,154 @@ +.actualSalaryReport { + .report-body { + height: 100%; + width: 100%; + overflow-y: auto; + padding: 8px 16px 0; + background: #f6f6f6; + + .wea-new-table { + background: #fff; + } + } + + .advance-custom { + display: flex; + align-items: center; + + & > a { + border-radius: 0; + height: 28px; + position: relative; + color: #474747; + padding: 4px 15px; + background-color: transparent; + display: flex; + align-items: center; + border: 1px solid #d9d9d9; + border-left: none + } + } + + .advance-report { + display: none; + background: #FFF; + margin-bottom: 8px; + + .wea-form-item-wrapper { + display: inline-block !important; + } + + .advance-report-btns { + display: flex; + justify-content: center; + align-items: center; + padding: 15px 0; + border-top: 1px solid #dadada; + + button { + margin-right: 15px; + } + } + + .wea-search-group, .wea-content { + padding: 0; + } + } + + .show-advance-report { + display: block; + } + + .wea-input-focus { + margin-top: -4px; + } +} + +.print-salary-detail-container { + width: 100%; + height: 100%; + overflow-y: auto; + padding: 8px 16px; + page-break-after: avoid; //避免在元素后插入分页符。 + table { + table-layout: fixed; + width: 100%; + border: 1px solid #d9d9d9; + border-collapse: collapse; + overflow: hidden; + page-break-inside: avoid; + page-break-after: avoid; + page-break-before: avoid; + + thead { + tr { + th { + height: 35px; + border: 1px solid #d9d9d9; + text-align: center; + font-weight: 400; + font-size: 9pt; + word-wrap: break-word; + word-break: break-word; + min-width: 60px; + } + } + } + + tbody { + tr { + td:first-child { + padding-left: 0 !important; + } + + td { + height: 35px; + border: 1px solid #d9d9d9; + text-align: left; + font-size: 9pt; + width: 100px; + word-wrap: break-word; + word-break: break-word; + padding-left: 5px; + min-width: 60px; + } + } + } + } + + .print-table-bottom-info { + padding: 10px 40px; + display: flex; + align-items: center; + justify-content: space-between; + font-size: 14px; + + span { + padding-left: 8px; + } + } +} + +@media print { + body { + height: auto !important; + } + + table { + page-break-inside: auto; + } + + tr { + page-break-inside: avoid; + page-break-after: auto; + } + + thead { + display: table-header-group; + } + + tfoot { + display: table-footer-group; + } +} + diff --git a/pc4mobx/hrmSalary/pages/custom-pages/guangyang/printReport/index.js b/pc4mobx/hrmSalary/pages/custom-pages/guangyang/printReport/index.js new file mode 100644 index 00000000..82062c93 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/custom-pages/guangyang/printReport/index.js @@ -0,0 +1,99 @@ +/* + * 光阳摩托薪酬二开 + * 报表打印 + * @Author: 黎永顺 + * @Date: 2025/7/23 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTools } from "ecCom"; +import moment from "moment"; +import * as API from "../api"; +import "../index.less"; + +const getLabel = WeaLocaleProvider.getLabel; +const getList = { + "actual": API.getQysfgzReportList, "summary": API.getGyDepartmentSalaryReport +}; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + columns: [], dataSource: [], userInfo: {} + }; + } + + async componentDidMount() { + const { data: userInfo } = await API.getAccountList(); + const { employeeName, kbIds, salaryMonth, salarySobIds, type, ygxzs } = WeaTools.getUrlParams(); + let payload = {}; + if (type === "actual") { + payload = { + employeeName, + salaryMonth: moment(salaryMonth).startOf("month").format("YYYY-MM-DD"), + salarySobIds: salarySobIds ? salarySobIds.split(",") : [], + ygxzs: ygxzs ? ygxzs.split(",") : [], + kbIds: kbIds ? kbIds.split(",") : [] + }; + } else { + payload = { + salaryMonth: moment(salaryMonth).startOf("month").format("YYYY-MM-DD"), + salarySobIds: salarySobIds ? salarySobIds.split(",") : [], + ygxzs: ygxzs ? ygxzs.split(",") : [], + kbIds: kbIds ? kbIds.split(",") : [] + }; + } + getList[type](payload).then(({ status, data }) => { + if (status) { + const { column: columns, data: dataSource } = data; + this.setState({ columns, dataSource, userInfo }); + } + }); + } + + componentDidUpdate() { + const { columns, dataSource } = this.state; + if (!_.isEmpty(columns) && !_.isEmpty(dataSource)) { + setTimeout("window.print()", 500); + //window.print() + } + } + + + render() { + const { columns, dataSource, userInfo } = this.state; + return (
+ + + + + {_.map(columns, col => ())} + + + + {_.map(dataSource, (item, index) => ( + + {_.map(columns, col => ())} + ))} + + + + + + +
{getLabel(111, "序号")}{col.text}
{index + 1}{item[col.column]}
+
+

{getLabel(111, "总经理:")}

+

{getLabel(111, "副总经理:")}

+

{getLabel(111, "管理中心:")}

+

{getLabel(111, "制表人:")}{userInfo.username}

+
+
+
); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/guangyang/salarySummaryReport/index.js b/pc4mobx/hrmSalary/pages/custom-pages/guangyang/salarySummaryReport/index.js new file mode 100644 index 00000000..905feac6 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/custom-pages/guangyang/salarySummaryReport/index.js @@ -0,0 +1,128 @@ +/* + * 光阳摩托薪酬二开 + * 工资汇总报表列表 + * @Author: 黎永顺 + * @Date: 2025/7/23 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaDatePicker, WeaLoadingGlobal, WeaLocaleProvider, WeaTable, WeaTools, WeaTop } from "ecCom"; +import { convertToUrlString } from "../../../../util/url"; +import FormInfo from "../../../../components/FormInfo"; +import { conditions } from "../conditions"; +import moment from "moment"; +import * as API from "../api"; +import { WeaForm } from "comsMobx"; +import cs from "classnames"; +import { Button } from "antd"; +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 = { + showAdvance: false, conditions: [], payload: {}, loading: false, dataSource: [], columns: [] + }; + } + + async componentDidMount() { + const { data } = await API.getLedgerList(); + this.setState({ + conditions: _.map(conditions, item => ({ + ...item, items: _.map(item.items, o => { + o = { ...o, label: getLabel(o.lanId, o.label) }; + if (getKey(o) === "salarySobIds") { + return { ...o, options: _.map(data, it => ({ key: it.id, showname: it.content })) }; + } else if (getKey(o) === "salaryMonth") { + return { ...o, value: moment(new Date()).format("YYYY-MM") }; + } else if (getKey(o) === "employeeName") { + return { ...o, hide: true }; + } + return o; + }) + })) + }, () => { + form.initFormFields(this.state.conditions); + this.getQysfgzReportList(); + }); + } + + getQysfgzReportList = () => { + const { salaryMonth, salarySobIds, ygxzs, kbIds } = form.getFormParams(); + const payload = { + salaryMonth: moment(salaryMonth).startOf("month").format("YYYY-MM-DD"), + salarySobIds: salarySobIds ? salarySobIds.split(",") : [], + ygxzs: ygxzs ? ygxzs.split(",") : [], + kbIds: kbIds ? kbIds.split(",") : [] + }; + this.setState({ loading: true }); + API.getGyDepartmentSalaryReport(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { column, data: dataSource } = data; + this.setState({ + payload, dataSource, + columns: _.map(column, item => ({ title: item.text, dataIndex: item.column, width: item.width })) + }); + } + }); + }; + handleExport = () => { + const { payload } = this.state; + WeaLoadingGlobal.start(); + const promise = API.exportGyDepartmentSalaryReport(payload); + }; + handlePrint = () => { + const { employeeName, salaryMonth, ...extra } = form.getFormParams(); + const payload = { + ...extra, type: "summary", + salaryMonth: moment(salaryMonth).startOf("month").format("YYYY-MM-DD") + }; + window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/printReport_guangyang?${convertToUrlString(payload)}`); + }; + + + render() { + const { showAdvance, conditions, columns, loading, dataSource } = this.state; + const buttons = [, + , +
+ { + form.updateFields({ salaryMonth: v }); + this.getQysfgzReportList(); + }} + style={{ width: 200, marginRight: 10 }}/> + this.setState({ showAdvance: !showAdvance })}>{getLabel(111, "高级搜索")} +
]; + return (} iconBgcolor="#F14A2D" + buttons={buttons} className="actualSalaryReport"> +
+
+ +
+ + + +
+
+ +
+
); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/index.js b/pc4mobx/hrmSalary/pages/custom-pages/index.js index e69de29b..6d5acfc1 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/index.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/index.js @@ -0,0 +1,13 @@ +import React from "react"; +import Route from "react-router/lib/Route"; +import ActualSalaryReport from "./guangyang/actualSalaryReport"; +import SalarySummaryReport from "./guangyang/salarySummaryReport"; +import PrintReport from "./guangyang/printReport"; + +const CustomRoutes = [ + , + , + +]; + +export default CustomRoutes;