Merge branch 'release/2.19.1.2501.01' into release/2.19.1.2501.01-个税

# Conflicts:
#	pc4mobx/hrmSalary/pages/declare/components/declareDialog/index.js
This commit is contained in:
lys 2025-02-08 17:16:08 +08:00
commit 20fdfda922
11 changed files with 122 additions and 17 deletions

View File

@ -142,6 +142,10 @@ export const savePageListSetting = (params) => {
export const savePageListTemplate = (params) => { export const savePageListTemplate = (params) => {
return postFetch("/api/bs/hrmsalary/common/pageList/template/save", params); return postFetch("/api/bs/hrmsalary/common/pageList/template/save", params);
}; };
// 薪酬统计报表-导出模板示例下载
export const downloadPageListTemplate = (params) => {
return postExportFetch("/api/bs/hrmsalary/common/pageList/template/file/download", params);
};
//薪酬统计报表-获取页面模板 //薪酬统计报表-获取页面模板
export const getPageListTemplatelist = (params) => { export const getPageListTemplatelist = (params) => {
return postFetch("/api/bs/hrmsalary/common/pageList/template/list", params); return postFetch("/api/bs/hrmsalary/common/pageList/template/list", params);

View File

@ -232,6 +232,25 @@ export const tempCondition = [
rules: "required|string", rules: "required|string",
viewAttr: 3 viewAttr: 3
}, },
{
conditionType: "UPLOAD",
domkey: ["fileId"],
fieldcol: 14,
label: "导出模板",
lanId: 111,
labelcol: 6,
value: "",
datas: [],
multiSelection: false,
showClearAll: false,
showListBottom: true,
showListTop: true,
maxFilesNumber: 1,
limitType: "xlsx",
uploadUrl: "/api/doc/upload/uploadFile",
category: "111",
viewAttr: 2
},
{ {
conditionType: "SELECT", conditionType: "SELECT",
domkey: ["sharedType"], domkey: ["sharedType"],

View File

@ -32,7 +32,8 @@ class SalaryDetails extends Component {
this.state = { this.state = {
loading: false, dataSource: [], columns: [], selectedRowKeys: [], tempPageList: [], sumRow: {}, loading: false, dataSource: [], columns: [], selectedRowKeys: [], tempPageList: [], sumRow: {},
pageInfo: { current: 1, pageSize: 10, total: 0 }, payload: {}, templateId: "", tempManageQuery: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, payload: {}, templateId: "", tempManageQuery: false,
showTotalCell: false, updateSum: true, tempDialog: { visible: false, setting: [], id: "", template: {} }, showTotalCell: false, updateSum: true,
tempDialog: { visible: false, setting: [], heads: [], id: "", template: {} },
transferDialog: { transferDialog: {
visible: false, searchParamsKey: "name", saveLoading: false, visible: false, searchParamsKey: "name", saveLoading: false,
dataParams: { page: "salary_details_report" }, dataParams: { page: "salary_details_report" },
@ -200,9 +201,14 @@ class SalaryDetails extends Component {
}; };
handelAddTemp = (templateId = "") => { handelAddTemp = (templateId = "") => {
const { tempDialog, tempPageList } = this.state; const { tempDialog, tempPageList } = this.state;
if (_.isEmpty(this.transferRef.state.rightDatas)) {
message.warning(getLabel(111, "请选择设置!"));
return;
}
this.setState({ this.setState({
tempDialog: { tempDialog: {
...tempDialog, visible: true, setting: _.map(this.transferRef.state.rightDatas, o => o.id) ...tempDialog, visible: true, setting: _.map(this.transferRef.state.rightDatas, o => o.id),
heads: _.map(this.transferRef.state.rightDatas, o => o.name)
// template: _.find(tempPageList, o => o.key === templateId) // template: _.find(tempPageList, o => o.key === templateId)
} }
}); });
@ -303,7 +309,7 @@ class SalaryDetails extends Component {
{/*薪资明细模板设置*/} {/*薪资明细模板设置*/}
<SalaryDetailsTempDialog {...tempDialog} <SalaryDetailsTempDialog {...tempDialog}
onCancel={callback => this.setState({ onCancel={callback => this.setState({
tempDialog: { ...tempDialog, visible: false, setting: [] } tempDialog: { ...tempDialog, visible: false, setting: [], heads: [] }
}, () => callback && callback())} }, () => callback && callback())}
onSuccess={this.getPageListTemplatelist}/> onSuccess={this.getPageListTemplatelist}/>
{/*薪资明细自定义列模板管理*/} {/*薪资明细自定义列模板管理*/}

View File

@ -9,10 +9,11 @@
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import { inject, observer } from "mobx-react"; import { inject, observer } from "mobx-react";
import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; import { WeaDialog, WeaLoadingGlobal, WeaLocaleProvider, WeaTools } from "ecCom";
import { tempCondition } from "./conditions"; import { tempCondition } from "./conditions";
import { getTaxAgentSelectList } from "../../../apis/taxAgent"; import { getTaxAgentSelectList } from "../../../apis/taxAgent";
import * as API from "../../../apis/statistics"; import * as API from "../../../apis/statistics";
import { downloadPageListTemplate } from "../../../apis/statistics";
import { Button, message } from "antd"; import { Button, message } from "antd";
import { getSearchs } from "../../../util"; import { getSearchs } from "../../../util";
@ -57,6 +58,13 @@ class SalaryDetailTempDialog extends Component {
value: id ? template["limitIds"].join(",") : "", value: id ? template["limitIds"].join(",") : "",
options: _.map(data, o => ({ key: o.id, showname: o.content })) options: _.map(data, o => ({ key: o.id, showname: o.content }))
}; };
} else if (getKey(o) === "fileId") {
return {
...o, label: getLabel(o.lanId, o.label), value: id ? template[getKey(o)] : "",
datas: id && template[getKey(o)] ? [
{ fileid: template[getKey(o)], filename: template["fileName"], showDelete: true }
] : [], labelExtra: getLabel(111, "下载示例"), labelType: "download"
};
} }
return { ...o, label: getLabel(o.lanId, o.label), value: id ? template[getKey(o)] : "" }; return { ...o, label: getLabel(o.lanId, o.label), value: id ? template[getKey(o)] : "" };
}) })
@ -73,12 +81,13 @@ class SalaryDetailTempDialog extends Component {
tempForm.validateForm().then(f => { tempForm.validateForm().then(f => {
if (f.isValid) { if (f.isValid) {
this.setState({ loading: true }); this.setState({ loading: true });
const { limitIds, ...formVal } = tempForm.getFormParams(); const { limitIds, fileId, ...formVal } = tempForm.getFormParams();
const payload = { const payload = {
page: "salary_details_report", setting, id, ...formVal, page: "salary_details_report", setting, id, ...formVal,
limitIds: !_.isEmpty(limitIds) ? limitIds.split(",") : [] limitIds: !_.isEmpty(limitIds) ? limitIds.split(",") : []
}; };
API.savePageListTemplate(payload).then(({ status, errormsg }) => { API.savePageListTemplate(_.assign(payload, fileId ? { fileId } : {})).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) { if (status) {
message.success(getLabel(111, "操作成功!")); message.success(getLabel(111, "操作成功!"));
this.props.onCancel(this.props.onSuccess()); this.props.onCancel(this.props.onSuccess());
@ -92,6 +101,12 @@ class SalaryDetailTempDialog extends Component {
}).catch(() => this.setState({ loading: false })); }).catch(() => this.setState({ loading: false }));
}; };
formFieldChange = (field) => { formFieldChange = (field) => {
if (field === "download") {
const { setting, heads } = this.props;
WeaLoadingGlobal.start();
const promise = downloadPageListTemplate({ setting, heads });
return;
}
const key = Object.keys(field)[0], value = field[key].value; const key = Object.keys(field)[0], value = field[key].value;
this.setState({ this.setState({
conditions: _.map(this.state.conditions, item => ({ conditions: _.map(this.state.conditions, item => ({
@ -101,6 +116,12 @@ class SalaryDetailTempDialog extends Component {
...o, hide: value !== "0", viewAttr: value === "0" ? 3 : 1, ...o, hide: value !== "0", viewAttr: value === "0" ? 3 : 1,
rules: value === "0" ? "required|string" : "" rules: value === "0" ? "required|string" : ""
}; };
} else if (key === "fileId" && getKey(o) === "fileId") {
return {
...o, value, datas: value ? _.map(field[key].valueSpan, o => ({
fileid: o.fileid, filename: o.filename, showDelete: true
})) : []
};
} }
return { ...o }; return { ...o };
}) })
@ -118,7 +139,8 @@ class SalaryDetailTempDialog extends Component {
<WeaDialog <WeaDialog
{...this.props} style={{ width: 480, height: 127 }} initLoadCss title={getLabel(111, "模板保存")} {...this.props} style={{ width: 480, height: 127 }} initLoadCss title={getLabel(111, "模板保存")}
buttons={[<Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button>]}> buttons={[<Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button>]}>
<div className="form-dialog-layout">{getSearchs(tempForm, conditions, 1, false, this.formFieldChange)}</div> <div
className="form-dialog-layout tempDialog">{getSearchs(tempForm, conditions, 1, false, this.formFieldChange)}</div>
</WeaDialog> </WeaDialog>
); );
} }

View File

@ -40,6 +40,11 @@ class SalaryTempAdminDialog extends Component {
render() { render() {
const { dataSource, selectedKeys } = this.state, { dataParams } = this.props; const { dataSource, selectedKeys } = this.state, { dataParams } = this.props;
const heads = _.reduce(selectedKeys, (pre, cur) => {
const item = dataSource.find(data => data.id === cur);
if (item) pre.push(item.name);
return pre;
}, []);
return (<WeaDialog return (<WeaDialog
{...this.props} initLoadCss ref={dom => this.dialog = dom} title={getLabel(111, "模板管理")} {...this.props} initLoadCss ref={dom => this.dialog = dom} title={getLabel(111, "模板管理")}
className="temp_admin_dialog" style={{ className="temp_admin_dialog" style={{
@ -47,7 +52,7 @@ class SalaryTempAdminDialog extends Component {
maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" maxHeight: "90%", maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
}} buttons={[ }} buttons={[
<Button type="primary" <Button type="primary"
onClick={() => this.props.onAddTemp(dataParams.id, selectedKeys)}>{getLabel(111, "确 定")}</Button>, onClick={() => this.props.onAddTemp(dataParams.id, selectedKeys, heads)}>{getLabel(111, "确 定")}</Button>,
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(111, "取 消")}</Button> <Button type="ghost" onClick={this.props.onCancel}>{getLabel(111, "取 消")}</Button>
]}> ]}>
<WeaTransfer data={dataSource} selectedKeys={selectedKeys} onChange={v => this.setState({ selectedKeys: v })} <WeaTransfer data={dataSource} selectedKeys={selectedKeys} onChange={v => this.setState({ selectedKeys: v })}

View File

@ -20,7 +20,7 @@ class SalaryTempMangerDialog extends Component {
super(props); super(props);
this.state = { this.state = {
selectedRowKeys: [], tempAdminDialog: { visible: false, dataParams: { page: "salary_details_report" } }, selectedRowKeys: [], tempAdminDialog: { visible: false, dataParams: { page: "salary_details_report" } },
tempDialog: { visible: false, setting: [], id: "", template: {} } tempDialog: { visible: false, setting: [], heads: [], id: "", template: {} }
}; };
} }
@ -31,10 +31,10 @@ class SalaryTempMangerDialog extends Component {
handleTempAdminCols = (params = {}) => this.setState({ handleTempAdminCols = (params = {}) => this.setState({
tempAdminDialog: { visible: true, dataParams: { ...this.state.tempAdminDialog.dataParams, ...params } } tempAdminDialog: { visible: true, dataParams: { ...this.state.tempAdminDialog.dataParams, ...params } }
}); });
handelAddTemp = (id = "", setting = []) => { handelAddTemp = (id = "", setting = [], heads = []) => {
this.setState({ this.setState({
tempDialog: { tempDialog: {
visible: true, setting, id, template: _.find(this.tempManageRef.state.listDatas, o => o.id === id) visible: true, setting, heads, id, template: _.find(this.tempManageRef.state.listDatas, o => o.id === id)
} }
}); });
}; };
@ -76,7 +76,7 @@ class SalaryTempMangerDialog extends Component {
{/*薪资明细模板设置*/} {/*薪资明细模板设置*/}
<SalaryDetailsTempDialog {...tempDialog} <SalaryDetailsTempDialog {...tempDialog}
onCancel={callback => this.setState({ onCancel={callback => this.setState({
tempDialog: { ...tempDialog, visible: false, setting: [] } tempDialog: { ...tempDialog, visible: false, setting: [], heads: [] }
}, () => callback && callback())} }, () => callback && callback())}
onSuccess={() => this.setState({ onSuccess={() => this.setState({
tempAdminDialog: { visible: false, dataParams: { page: "salary_details_report" } } tempAdminDialog: { visible: false, dataParams: { page: "salary_details_report" } }

View File

@ -382,3 +382,17 @@
} }
} }
.tempDialog {
.wea-form-item-label {
min-height: 50px;
}
.wea-form-item-label-extra {
position: absolute;
left: 0;
bottom: 0;
cursor: pointer;
color: #4d7ad8;
}
}

View File

@ -12,6 +12,7 @@ import { getSearchs } from "../../../../util";
import { getTaxAgentSelectListAsAdmin } from "../../../../apis/taxAgent"; import { getTaxAgentSelectListAsAdmin } from "../../../../apis/taxAgent";
import { saveDeclare, taxdeclarationGetRate } from "../../../../apis/declare"; import { saveDeclare, taxdeclarationGetRate } from "../../../../apis/declare";
import { declareConditions } from "./condition"; import { declareConditions } from "./condition";
import * as API from "../../../../apis/ruleconfig";
const getKey = WeaTools.getKey; const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel; const getLabel = WeaLocaleProvider.getLabel;
@ -31,7 +32,8 @@ class Index extends Component {
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.declareStore.initDeclareForm(); if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.declareStore.initDeclareForm();
} }
getTaxAgentSelectListAsAdmin = (props) => { getTaxAgentSelectListAsAdmin = async (props) => {
const { data: sysinfo } = await API.sysinfo();
const { declareStore: { declareForm } } = props; const { declareStore: { declareForm } } = props;
getTaxAgentSelectListAsAdmin().then(({ status, data }) => { getTaxAgentSelectListAsAdmin().then(({ status, data }) => {
if (status) { if (status) {
@ -44,6 +46,11 @@ class Index extends Component {
...o, options: _.map(data, g => ({ key: g.id, showname: g.content })) ...o, options: _.map(data, g => ({ key: g.id, showname: g.content }))
// helpfulTitle: getLabel(563420, "提示:可选择单个个税扣缴义务人进行申报,若不选择,则批量对管理下的所有个税扣缴义务人进行申报;") // helpfulTitle: getLabel(563420, "提示:可选择单个个税扣缴义务人进行申报,若不选择,则批量对管理下的所有个税扣缴义务人进行申报;")
}; };
} else if (getKey(o) === "salaryMonthStr") {
return {
...o,
label: sysinfo["TAX_DECLARATION_DATE_TYPE"] === "1" ? getLabel(111, "税款所属期") : getLabel(111, "薪资所属月")
};
} }
return { ...o }; return { ...o };
}) })
@ -58,8 +65,11 @@ class Index extends Component {
if (f.isValid) { if (f.isValid) {
const { salaryMonth, ...payload } = declareForm.getFormParams(); const { salaryMonth, ...payload } = declareForm.getFormParams();
this.setState({ loading: true }); this.setState({ loading: true });
saveDeclare({ ...payload, salaryMonth: salaryMonth + "-01" }) saveDeclare({
.then(async ({ status, data, errormsg }) => { ...payload, salaryMonth: salaryMonth + "-01",
taxCycle: `${salaryMonth}-01`,
salaryDate: `${salaryMonth}-01`
}).then(async ({ status, data, errormsg }) => {
this.setState({ loading: false }); this.setState({ loading: false });
if (status) { if (status) {
message.destroy(); message.destroy();

View File

@ -222,6 +222,16 @@ export const conditions = [
lanId: 111, lanId: 111,
labelcol: 8, labelcol: 8,
viewAttr: 2 viewAttr: 2
},
{
conditionType: "SELECT",
domkey: ["TAX_DECLARATION_DATE_TYPE"],
fieldcol: 10,
label: "申报日期类型",
lanId: 111,
labelcol: 8,
options: [],
viewAttr: 2
} }
], ],
title: "算税规则", title: "算税规则",

View File

@ -73,6 +73,13 @@ class RuleConfig extends Component {
...o, ...o,
hide: sysinfo["SALARY_APPROVAL_STATUS"] === "0" || _.isNil(sysinfo["SALARY_APPROVAL_STATUS"]) hide: sysinfo["SALARY_APPROVAL_STATUS"] === "0" || _.isNil(sysinfo["SALARY_APPROVAL_STATUS"])
}; };
} else if (getKey(o) === "TAX_DECLARATION_DATE_TYPE") {
return {
...o, options: [
{ key: "0", showname: getLabel(111, "薪资所属月"), selected: true },
{ key: "1", showname: getLabel(111, "税款所属期"), selected: false }
]
};
} }
return { ...o }; return { ...o };
}) })
@ -154,6 +161,7 @@ class RuleConfig extends Component {
case "APPROVAL_CAN_RE_CALC_STATUS": case "APPROVAL_CAN_RE_CALC_STATUS":
case "APPROVAL_CAN_EDIT_RESULT_STATUS": case "APPROVAL_CAN_EDIT_RESULT_STATUS":
case "ATTENDANCE_SERIAL_COLLECTION_BTN": case "ATTENDANCE_SERIAL_COLLECTION_BTN":
case "TAX_DECLARATION_DATE_TYPE":
case "SHOT_EMP_BTN": case "SHOT_EMP_BTN":
if (!this.handleDebounce) { if (!this.handleDebounce) {
this.handleDebounce = _.debounce(() => { this.handleDebounce = _.debounce(() => {
@ -173,7 +181,8 @@ class RuleConfig extends Component {
APPROVAL_CAN_RE_CALC_STATUS: getLabel(111, "开启审批的核算记录允许重新核算"), APPROVAL_CAN_RE_CALC_STATUS: getLabel(111, "开启审批的核算记录允许重新核算"),
APPROVAL_CAN_EDIT_RESULT_STATUS: getLabel(111, "审批流程发起后允许修改核算数据"), APPROVAL_CAN_EDIT_RESULT_STATUS: getLabel(111, "审批流程发起后允许修改核算数据"),
ATTENDANCE_SERIAL_COLLECTION_BTN: getLabel(111, "考勤引用是否采集班次数据"), ATTENDANCE_SERIAL_COLLECTION_BTN: getLabel(111, "考勤引用是否采集班次数据"),
SHOT_EMP_BTN: getLabel(111, "启用组织快照") TAX_DECLARATION_DATE_TYPE: getLabel(111, "申报日期类型"),
SHOT_EMP_BTN: getLabel(111, "启用组织快照"),
}; };
this.unifiedSettings(key, confTitle[key]); this.unifiedSettings(key, confTitle[key]);
this.handleDebounce = null; this.handleDebounce = null;

View File

@ -36,7 +36,13 @@ export const getSearchs = (form, condition, col, isCenter, onChange = () => void
items.push({ items.push({
com: ( com: (
<WeaFormItem <WeaFormItem
label={`${fields.label}`} // label 标签的文本 label={<span>
<span>{`${fields.label}`}</span>
{
fields.labelExtra && <span className="wea-form-item-label-extra"
onClick={() => onChange(fields.labelType)}>{fields.labelExtra}</span>
}
</span>} // label 标签的文本
labelCol={{ span: `${fields.labelcol}` }} // label标签占一行比例 labelCol={{ span: `${fields.labelcol}` }} // label标签占一行比例
wrapperCol={{ span: `${fields.fieldcol}` }} // 右侧控件占一行比例 wrapperCol={{ span: `${fields.fieldcol}` }} // 右侧控件占一行比例
error={form.getError(fields)} // 错误提示: 处理表单中有必填项,保存的校验 error={form.getError(fields)} // 错误提示: 处理表单中有必填项,保存的校验