diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index 1cfca645..85805d5c 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -228,6 +228,10 @@ export const getColumnDesc = (params) => { export const updateLockStatus = (params) => { return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/updateLockStatus", params); }; +// 更新薪资核算结果的锁定状态 +export const updateLockEmpStatus = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/lockEmp", params); +}; // 导入薪资核算添加表头字段缓存 export const cacheImportField = (params) => { return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/cacheImportField", params); @@ -250,3 +254,29 @@ export const customCacheExportField = (params) => { export const salaryacctBatchUpdate = (params) => { return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/batchUpdate", params); }; +//薪资核算-自定义导出模板保存新建 +export const saveExportTemplate = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/saveExportTemplate", params); +}; +//薪资核算-获取自定义导出模板列表 +export const getExportTemplateList = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/exportTemplateList", params); +}; +//薪资核算-删除自定义导出模板列表 +export const deleteExportTemplate = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/deleteExportTemplate", params); +}; +//薪资核算-获取导出模板详细信息 +export const getExportTemplateForm = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/getExportTemplateForm", params); +}; +//薪资核算-薪资项目改变否 +export const getCompareSobConfig = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/compareSobConfig", "GET", params); +}; +//薪资核算-更新薪资账套 +export const updateSobConfig = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/updateSobConfig", "GET", params); +}; + + diff --git a/pc4mobx/hrmSalary/apis/declare.js b/pc4mobx/hrmSalary/apis/declare.js index 8c9a2a11..746bcf99 100644 --- a/pc4mobx/hrmSalary/apis/declare.js +++ b/pc4mobx/hrmSalary/apis/declare.js @@ -16,9 +16,13 @@ export const saveDeclare = params => { return postFetch("/api/bs/hrmsalary/taxdeclaration/save", params); }; +//个税申报表-获取分类 +export const getTaxReports = params => { + return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/getTaxReports", "get", params); +}; //个税申报表-个税申报表相关信息 export const getDeclareInfo = params => { - return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationInfo", "get", params); + return postFetch("/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationInfo", params); }; // 个税申报表详情列表 @@ -98,6 +102,10 @@ export const getEmployeeSave = (params) => { export const employeeDelete = (params) => { return postFetch("/api/bs/hrmsalary/employeedeclare/delete", params); }; +//人员报送-作废 +export const employeeInvalid = (params) => { + return postFetch("/api/bs/hrmsalary/employeedeclare/invalid", params); +}; //人员报送-全部报送 export const employeedeclareDeclare = (params) => { @@ -106,7 +114,7 @@ export const employeedeclareDeclare = (params) => { //个税在线对接-获取个税申报记录下的个税申报表TAB export const getTaxDeclarationTab = params => { - return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationTab", "GET", params); + return postFetch("/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationTab", params); }; //个税在线对接-个税申报表是否已经生成 diff --git a/pc4mobx/hrmSalary/apis/mySalaryBenefits.js b/pc4mobx/hrmSalary/apis/mySalaryBenefits.js index 0cb56cfe..b79a6718 100644 --- a/pc4mobx/hrmSalary/apis/mySalaryBenefits.js +++ b/pc4mobx/hrmSalary/apis/mySalaryBenefits.js @@ -42,6 +42,9 @@ export const doSecondAuth = (params, headers) => { return formHeaderPost("/api/encrypt/secondauthsetting/doSecondAuth", "POST", params, headers); // return WeaTools.callApi("/api/encrypt/secondauthsetting/doSecondAuth", "POST", params); }; +export const getPasswordForm = params => { + return WeaTools.callApi("/api/hrm/secondarypwd/getPasswordForm", "GET", params); +}; export const checkPassword = params => { return WeaTools.callApi("/api/hrm/secondarypwd/checkPassword", "POST", params); }; diff --git a/pc4mobx/hrmSalary/apis/payroll.js b/pc4mobx/hrmSalary/apis/payroll.js index 01048186..8ca9fab7 100644 --- a/pc4mobx/hrmSalary/apis/payroll.js +++ b/pc4mobx/hrmSalary/apis/payroll.js @@ -240,3 +240,11 @@ export const salaryBillBaseSetPreviewWaterMark = (params) => { export const getSmsSalaryItemSet = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/template/getSmsSalaryItemSet", "GET", params); }; +// 工资单导出PDF-检查 +export const genPdfBeforeExport = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/genPdfBeforeExport", "GET", params); +}; +//工资单预览 +export const salaryBillPreview = (params) => { + return postFetch("/api/bs/hrmsalary/salaryBill/preview", params); +}; diff --git a/pc4mobx/hrmSalary/common/columns.js b/pc4mobx/hrmSalary/common/columns.js deleted file mode 100644 index 4c9dc027..00000000 --- a/pc4mobx/hrmSalary/common/columns.js +++ /dev/null @@ -1,77 +0,0 @@ -export const logColumns = [ - { - title: "操作时间", - dataIndex: 'title', - key: 'title', - }, - { - title: "操作人", - dataIndex: 'title', - key: 'title', - }, - { - title: "操作类型", - dataIndex: 'title', - key: 'title', - }, - { - title: "模块", - dataIndex: 'title', - key: 'title', - }, - { - title: "对象", - dataIndex: 'title', - key: 'title', - }, - { - title: "修改详情", - dataIndex: 'title', - key: 'title', - }, - { - title: "客户端IP", - dataIndex: 'title', - key: 'title', - } -] - -export const testColumns = [ - { - title: "姓名", - dataIndex: 'title', - key: 'title', - }, - { - title: "个税扣缴义务人", - dataIndex: 'title', - key: 'title', - }, - { - title: "部门", - dataIndex: 'title', - key: 'title', - }, - { - title: "手机号", - dataIndex: 'title', - key: 'title', - }, - { - title: "工号", - dataIndex: 'title', - key: 'title', - }, - { - title: "证件号码", - dataIndex: 'title', - key: 'title', - }, - { - title: "入职日期", - dataIndex: 'title', - key: 'title', - }, -] - -export const dataSource = []; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/common/conditions.js b/pc4mobx/hrmSalary/common/conditions.js new file mode 100644 index 00000000..81e041a6 --- /dev/null +++ b/pc4mobx/hrmSalary/common/conditions.js @@ -0,0 +1,24 @@ +import React from "react"; +import { WeaLocaleProvider } from "ecCom"; + +const getLabel = WeaLocaleProvider.getLabel; +//薪资核算-自定义导出-模板设置 +export const tempConditions = [ + { + items: [ + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["templateName"], + fieldcol: 16, + label: getLabel(111, "导出模板名称"), + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + } + ], + defaultshow: true, + title: "" + } +]; diff --git a/pc4mobx/hrmSalary/components/captchaModal/index.js b/pc4mobx/hrmSalary/components/captchaModal/index.js index 35661772..a7f00b9b 100644 --- a/pc4mobx/hrmSalary/components/captchaModal/index.js +++ b/pc4mobx/hrmSalary/components/captchaModal/index.js @@ -36,7 +36,6 @@ class Index extends Component { handleSendCaptcha = () => { sendMobileCode({ id: this.props.id }).then(({ status, data }) => { if (status) { - console.log(data); this.timeRef = setInterval(() => { const { time } = this.state; this.setState({ time: time - 1 }, () => { diff --git a/pc4mobx/hrmSalary/components/custom-title/weaReqTitle/index.js b/pc4mobx/hrmSalary/components/custom-title/weaReqTitle/index.js new file mode 100644 index 00000000..69766076 --- /dev/null +++ b/pc4mobx/hrmSalary/components/custom-title/weaReqTitle/index.js @@ -0,0 +1,17 @@ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaReqTop } from "ecCom"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + render() { + return ( + } iconBgcolor="#F14A2D" + showDropIcon={false} tabDatas={this.props.tabDatas} {...this.props} + /> + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/components/custom-title/weaTopTitle/index.js b/pc4mobx/hrmSalary/components/custom-title/weaTopTitle/index.js new file mode 100644 index 00000000..d265c8eb --- /dev/null +++ b/pc4mobx/hrmSalary/components/custom-title/weaTopTitle/index.js @@ -0,0 +1,15 @@ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTop } from "ecCom"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + render() { + return ( + } + iconBgcolor="#F14A2D" {...this.props}/> + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js index 91f3e690..0afc13f4 100644 --- a/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js @@ -5,9 +5,11 @@ * Date: 2023/9/5 */ import React, { Component } from "react"; -import { WeaTable } from "ecCom"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; import { postFetch } from "../../../util/request"; +const { getLabel } = WeaLocaleProvider; + class ImpStep2 extends Component { constructor(props) { super(props); @@ -41,9 +43,15 @@ class ImpStep2 extends Component { render() { const { dataSource, columns, loading } = this.state; const { scrollHeight } = this.props; + const pagination = { + showTotal: total => `${getLabel(111, "共")} ${total} ${getLabel(111, "条")}`, + total: dataSource.length, + showSizeChanger: true + }; return ( ); } diff --git a/pc4mobx/hrmSalary/components/mobileTemplate/index.js b/pc4mobx/hrmSalary/components/mobileTemplate/index.js index 18de0574..ca9c8b63 100644 --- a/pc4mobx/hrmSalary/components/mobileTemplate/index.js +++ b/pc4mobx/hrmSalary/components/mobileTemplate/index.js @@ -14,7 +14,7 @@ const getLabel = WeaLocaleProvider.getLabel; class Index extends Component { render() { const { theme, background, tip, tipPosi, itemTypeList, title } = this.props; - const { onlyOneGrup, showData } = dealTemplate(itemTypeList, "mobile"); + const { onlyOneGrup, showData } = dealTemplate(_.filter(itemTypeList, o => !!o), "mobile"); return ( {/*
{title || getLabel(111, "薪酬预览")}
*/} diff --git a/pc4mobx/hrmSalary/components/pcTemplate/content.js b/pc4mobx/hrmSalary/components/pcTemplate/content.js index 310999d6..6bc3c60e 100644 --- a/pc4mobx/hrmSalary/components/pcTemplate/content.js +++ b/pc4mobx/hrmSalary/components/pcTemplate/content.js @@ -7,7 +7,7 @@ const getLabel = WeaLocaleProvider.getLabel; class Content extends Component { render() { const { theme, background, tip, tipPosi, itemTypeList, sendTime = new Date() } = this.props; - const { onlyOneGrup, showData } = dealTemplate(itemTypeList, "pc"); + const { onlyOneGrup, showData } = dealTemplate(_.filter(itemTypeList, o => !!o), "pc"); return (
diff --git a/pc4mobx/hrmSalary/components/pcTemplate/index.js b/pc4mobx/hrmSalary/components/pcTemplate/index.js index ba6cd4a0..d0d0a123 100644 --- a/pc4mobx/hrmSalary/components/pcTemplate/index.js +++ b/pc4mobx/hrmSalary/components/pcTemplate/index.js @@ -24,7 +24,7 @@ export const dealTemplate = (itemTypeList, type) => { const { items, groupName, groupId } = group; if (items.length !== 0) { items.forEach((item) => { - item.salaryItemValue = !_.isNil(item.salaryItemValue) ? item.salaryItemValue : "100"; + item.salaryItemValue = !_.isNil(item.salaryItemValue) ? item.salaryItemValue : ""; }); if (items.length % 2 && type === "pc") items.push({}); // 未分类不展示标题 diff --git a/pc4mobx/hrmSalary/custom-components/index.js b/pc4mobx/hrmSalary/custom-components/index.js new file mode 100644 index 00000000..e69de29b diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 20e7ced2..c3c33dc8 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -129,41 +129,23 @@ const DataAcquisition = (props) => props.children; // intelligentCalculateSalarySettings 智能算薪 const Routes = ( - + - + - - + + - + diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js index 7ff80bb3..9d8d2816 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js @@ -26,7 +26,7 @@ class SalaryDetails extends Component { this.state = { loading: false, dataSource: [], columns: [], selectedRowKeys: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, payload: {}, - countResult: {}, showTotalCell: false + showTotalCell: false, updateSum: true }; } @@ -37,7 +37,7 @@ class SalaryDetails extends Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.isQuery !== this.props.isQuery) this.setState({ - pageInfo: { ...this.state.pageInfo, current: 1 } + pageInfo: { ...this.state.pageInfo, current: 1 }, updateSum: true }, () => this.getSalaryList(nextProps)); } @@ -54,10 +54,13 @@ class SalaryDetails extends Component { } else if (type === "turn") { if (id === "PAGEINFO") { const { pageNum: current, size: pageSize } = params; - this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.getSalaryList(this.props)); + this.setState({ + pageInfo: { ...pageInfo, current, pageSize }, + updateSum: false + }, () => this.getSalaryList(this.props)); } else if (id === "CHECKBOX") { const { selectedRowKeys: checkBox } = params; - this.setState({ selectedRowKeys: checkBox }); + this.setState({ selectedRowKeys: checkBox, updateSum: false }); } } }; @@ -82,14 +85,15 @@ class SalaryDetails extends Component { }; this.setState({ loading: true }); API.getSalaryList(payload).then(async ({ status, data }) => { - const [{ data: sumData }, { data: confCode }] = await Promise.all([API.getSalaryListSum(payload), sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" })]); + // API.getSalaryListSum(payload), + const [{ data: confCode }] = await Promise.all([sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" })]); this.setState({ loading: false }); if (status) { const { dataKey, pageInfo: pageparams } = data; const { list: dataSource, pageNum: current, total, pageSize } = pageparams; this.setState({ dataSource, pageInfo: { ...pageInfo, current, total, pageSize }, payload, - countResult: sumData.sumRow, showTotalCell: confCode === "1" + showTotalCell: confCode === "1" }, () => tableStore.getDatas(dataKey.datas)); } }).catch(() => this.setState({ loading: false })); @@ -101,16 +105,17 @@ class SalaryDetails extends Component { return; } WeaLoadingGlobal.start(); - const promise = API.exportSalaryList({ ...payload, ids: selectedRowKeys }); + const promise = API.exportSalaryList({ ...payload, ids: key === "SELECTED" ? selectedRowKeys : [] }); }; getColumns = () => { const { attendanceStore: { tableStore } } = this.props; - const { dataSource, pageInfo, selectedRowKeys, countResult, showTotalCell } = this.state; + const { dataSource, pageInfo, selectedRowKeys, showTotalCell, payload, updateSum } = this.state; const columns = _.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes"); + const sumRowlistUrl = showTotalCell ? "/api/bs/hrmsalary/report/statistics/employee/salaryListSum" : ""; if (!_.isEmpty(columns)) { this.postMessageToChild({ dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, tableScrollHeight: 154, - sumRow: countResult, + sumRowlistUrl, payload: { ...payload, updateSum }, columns: _.map(columns, (it, idx) => ({ ...it, width: (it.dataIndex === "taxAgent" || it.dataIndex === "salarySob") ? 176 : it.oldWidth, diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js index a653e118..121e334a 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js @@ -42,8 +42,8 @@ class Index extends Component { keyword: "", year: moment().format("YYYY"), dateRange: [ - moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"), - moment(new Date()).endOf("year").format("YYYY-MM") + moment(new Date()).subtract(6, "months").format("YYYY-MM"), + moment(new Date()).format("YYYY-MM") ], showSearchAd: false, isQuery: false, @@ -331,7 +331,7 @@ class Index extends Component { const tabs = [ { key: "statistics", title: getLabel(111, "统计表") }, { key: "detail", title: getLabel(111, "员工明细") }, - // { key: "salaryDetail", title: getLabel(111, "薪资明细") } + { key: "salaryDetail", title: getLabel(111, "薪资明细") } ]; return ( this.getExportTemplateList(nextProps)); + } else { + this.setState({ + tempOptions: [ + { key: "NULL", showname: "" }, + { key: "system", selected: true, showname: getLabel(111, "系统模板") } + ] }); } } + getExportTemplateList = (props) => { + const { salaryAcctRecordId } = props; + getExportTemplateList({ salaryAcctRecordId }).then(({ status, data }) => { + if (status) { + const { pageInfo: { list } } = data; + this.setState({ + tempOptions: [ + ...this.state.tempOptions, ..._.map(list, o => ({ key: String(o.id), showname: o.templateName })) + ] + }); + } + }); + }; + customExportClick = () => { const { calculateStore: { ECSearchForm }, salaryAcctRecordId } = this.props; const { itemsCheckeds } = this.state; @@ -67,10 +99,26 @@ class Index extends Component { } }); }; + handleChangeExpTemp = async (id) => { + switch (id) { + case "system": + const { salaryAcctRecordId } = this.props; + const { data: { checkItems: checkeds } } = await getExportField({ salaryAcctRecordId }); + this.setState({ itemsCheckeds: checkeds }); + break; + case "NULL": + this.setState({ itemsCheckeds: [] }); + break; + default: + const { data: { checkItems } } = await getExportTemplateForm({ id }); + this.setState({ itemsCheckeds: _.map(checkItems, o => parseInt(o)) }); + break; + } + }; render() { - const { showOnlyChecked, itemsCheckeds } = this.state; - const { itemsByGroup } = this.props; + const { showOnlyChecked, itemsCheckeds, tempMangeDialog, tempDialog, tempOptions } = this.state; + const { itemsByGroup, salaryAcctRecordId } = this.props; let dataSource = _.map(itemsByGroup, item => { return { ...item, @@ -84,10 +132,15 @@ class Index extends Component { return { ...item, salaryItems: _.filter(item.salaryItems, it => !!it.checked) }; }); } + const titleComp =
+ {getLabel(111, "选择字段")} + +
; return ( {getLabel(17416, "导出")}, + , + , ]} bottomLeft={; }) } + this.setState({ + tempMangeDialog: { ...tempMangeDialog, visible: false } + }, () => this.getExportTemplateList(this.props))} + /> + {/*模板保存*/} + this.setState({ + tempDialog: { ...tempDialog, visible: false } + }, () => this.getExportTemplateList(this.props))}/> ); } diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.less index 3519fe22..8b8433ec 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.less @@ -1,4 +1,15 @@ .customEpDialogLayout { + .text-elli { + padding-right: 16px; + } + + .setHeaderWrapper { + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; + } + .wea-search-group { .wea-title { padding-left: 0 !important; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/expFieldsSetDialog/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/expFieldsSetDialog/index.js new file mode 100644 index 00000000..ec38b1bf --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/expFieldsSetDialog/index.js @@ -0,0 +1,134 @@ +/* + * Author: 黎永顺 + * name:自定义导出-导出字段设置 + * Description: + * Date: 2024/3/28 + */ +import React, { Component } from "react"; +import { WeaCheckbox, WeaDialog, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import { Button, Col, message, Row } from "antd"; +import * as API from "../../../../../apis/calculate"; +import TempDialog from "./tempDialog"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + itemsCheckeds: [], itemsByGroup: [], + tempDialog: { visible: false, salaryAcctRecordId: "", id: "", salaryItemIds: [] } + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getExportField(nextProps); + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ + itemsCheckeds: [], itemsByGroup: [] + }); + } + + getExportField = (props) => { + const { salaryAcctRecordId, checkItems } = props; + API.getExportField({ salaryAcctRecordId }).then(({ status, data }) => { + if (status) { + const { itemsByGroup } = data; + this.setState({ itemsByGroup, itemsCheckeds: checkItems }); + } + }); + }; + handleSelectGroupAll = (groupId, checked) => { + const { itemsCheckeds, itemsByGroup } = this.state; + _.map(itemsByGroup, item => { + if (item.salarySobItemGroupId === groupId) { + if (!!Number(checked)) { + this.setState({ + itemsCheckeds: [...itemsCheckeds, ..._.map(item.salaryItems, child => String(child.salaryItemId))] + }); + } else { + this.setState({ + itemsCheckeds: _.differenceWith(itemsCheckeds, _.map(item.salaryItems, child => String(child.salaryItemId)), _.isEqual) + }); + } + } + }); + }; + save = () => { + const { itemsCheckeds } = this.state; + const { salaryAcctRecordId, tempId: id, templateName } = this.props; + if (!id) { + this.setState({ + tempDialog: { + visible: true, salaryAcctRecordId, id, salaryItemIds: itemsCheckeds + } + }); + } else { + API.saveExportTemplate({ templateName, salaryAcctRecordId, id, salaryItemIds: itemsCheckeds }) + .then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(111, "操作成功!")); + this.props.onCancel(true); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: false })); + } + }; + + render() { + const { itemsCheckeds, itemsByGroup, tempDialog } = this.state; + let dataSource = _.map(itemsByGroup, item => { + return { + ...item, salaryItems: _.map(item.salaryItems, child => { + return { ...child, checked: itemsCheckeds.includes(String(child.salaryItemId)) }; + }) + }; + }); + return ( + {getLabel(111, "保存")}]} + > + { + _.map(dataSource, item => { + const { salarySobItemGroupName, salaryItems, salarySobItemGroupId } = item; + const value = _.every(salaryItems, it => !!it.checked) ? "1" : "0"; + return this.handleSelectGroupAll(salarySobItemGroupId, val)} + />}> + + { + !_.isEmpty(salaryItems) ? + _.map(salaryItems, it => { + const { salaryItemId, salaryItemName, checked } = it; + return + this.setState({ itemsCheckeds: _.xorWith(itemsCheckeds, [String(salaryItemId)], _.isEqual) })} + /> + ; + }) : {getLabel(83553, "暂无数据")} + } + + ; + }) + } + this.setState({ + tempDialog: { ...tempDialog, visible: false } + }, () => isRefresh && this.props.onCancel(true))}/> + + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/expFieldsSetDialog/tempDialog.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/expFieldsSetDialog/tempDialog.js new file mode 100644 index 00000000..c6c9d754 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/expFieldsSetDialog/tempDialog.js @@ -0,0 +1,73 @@ +/* + * Author: 黎永顺 + * name: 导出模板保存框 + * Description: + * Date: 2024/3/29 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaLocaleProvider } from "ecCom"; +import { Button, message } from "antd"; +import { getSearchs } from "../../../../../util"; +import { tempConditions } from "../../../../../common/conditions"; +import * as API from "../../../../../apis/calculate"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("calculateStore") +@observer +class TempDialog extends Component { + constructor(props) { + super(props); + this.state = { + loading: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + nextProps.calculateStore.tempForm.initFormFields(tempConditions); + } else { + nextProps.calculateStore.initTempForm(); + } + } + + save = () => { + const { calculateStore: { tempForm }, salaryAcctRecordId, id, salaryItemIds } = this.props; + tempForm.validateForm().then(f => { + if (f.isValid) { + const payload = tempForm.getFormParams(); + this.setState({ loading: true }); + API.saveExportTemplate({ ...payload, salaryAcctRecordId, id, salaryItemIds }) + .then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(111, "操作成功!")); + this.props.onCancel(true); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: false })); + } else { + f.showErrors(); + } + }); + }; + + render() { + const { loading } = this.state; + const { calculateStore: { tempForm } } = this.props; + return ( + {getLabel(111, "保存")} + ]} + > +
{getSearchs(tempForm, tempConditions, 1, false)}
+
+ ); + } +} + +export default TempDialog; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/expTempManagementDialog/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/expTempManagementDialog/index.js new file mode 100644 index 00000000..e965df70 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/expTempManagementDialog/index.js @@ -0,0 +1,154 @@ +/* + * Author: 黎永顺 + * name: 自定义导出-导出模板管理 + * Description: + * Date: 2024/3/28 + */ +import React, { Component } from "react"; +import { WeaButtonIcon, WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaTab, WeaTable } from "ecCom"; +import { message, Modal } from "antd"; +import ExpFieldsSetDialog from "../expFieldsSetDialog"; +import * as API from "../../../../../apis/calculate"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + pageInfo: { current: 1, pageSize: 10, total: 0 }, dataSource: [], columns: [], loading: false, + fieldsSetDialog: { visible: false, salaryAcctRecordId: "", tempId: "", templateName: "", checkItems: [] }, + query: { templateName: "" }, selectedRowKeys: [] + }; + this.dialogRef = null; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getExportTemplateList(nextProps); + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ selectedRowKeys: [] }); + } + + getExportTemplateList = (props) => { + const { pageInfo, query } = this.state; + const { salaryAcctRecordId } = props; + const payload = { ...pageInfo, ...query, salaryAcctRecordId }; + this.setState({ loading: true }); + API.getExportTemplateList(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { pageInfo: { columns, list: dataSource, pageNum: current, pageSize, total } } = data; + this.setState({ + dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, + columns: [...columns, { + dataIndex: "operate", title: getLabel(111, "操作"), width: 120, + render: (__, record) => ( + this.getExportTemplateForm(record)}>{getLabel(111, "编辑")} + this.deleteExportTemplate([record.id])}>{getLabel(111, "删除")} + ) + }] + }); + } + }).catch(() => this.setState({ loading: false })); + }; + getExportTemplateForm = (record) => { + const { id, templateName } = record; + const { fieldsSetDialog } = this.state; + const { salaryAcctRecordId } = this.props; + API.getExportTemplateForm({ id }).then(({ status, data }) => { + if (status) { + const { checkItems } = data; + this.setState({ + fieldsSetDialog: { + ...fieldsSetDialog, tempId: id, templateName, visible: true, salaryAcctRecordId, checkItems + } + }); + } else { + this.setState({ + fieldsSetDialog: { + ...fieldsSetDialog, tempId: id, templateName, visible: true, salaryAcctRecordId, checkItems: [] + } + }); + } + }); + }; + deleteExportTemplate = (ids) => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "确定要删除吗?"), + onOk: () => { + API.deleteExportTemplate({ ids }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "操作成功!")); + this.setState({ selectedRowKeys: [] }, () => this.getExportTemplateList(this.props)); + } else { + message.error(errormsg); + } + }); + } + }); + }; + + render() { + const { fieldsSetDialog, query, pageInfo, selectedRowKeys, dataSource, columns } = this.state; + const { salaryAcctRecordId } = this.props; + const dialogBodyHeight = this.dialogRef ? this.dialogRef.state.height : 600; + 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.getExportTemplateList(this.props)); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.getExportTemplateList(this.props)); + } + }; + const rowSelection = { + selectedRowKeys, onChange: selectedRowKeys => this.setState({ selectedRowKeys }) + }; + return ( + this.dialogRef = dom} initLoadCss className="tempManageDialogLayout" + style={{ + width: 700, height: 606.6, minHeight: 200, minWidth: 380, maxHeight: "70%", + maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" + }} + > + this.setState({ + fieldsSetDialog: { + ...fieldsSetDialog, visible: true, tempId: "", templateName: "", + salaryAcctRecordId, checkItems: [] + } + })}/>, + this.deleteExportTemplate(selectedRowKeys)}/>, + this.setState({ query: { ...query, templateName: val } })} + onSearch={() => this.setState({ + pageInfo: { ...pageInfo, current: 1 } + }, () => this.getExportTemplateList(this.props))}/> + ]}/> + + this.setState({ + fieldsSetDialog: { ...fieldsSetDialog, visible: false, checkItems: [] } + }, () => isRefresh && this.getExportTemplateList(this.props))}/> + + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js index ca5b3f86..58f353f1 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js @@ -8,7 +8,7 @@ import React, { Component } from "react"; import { WeaLocaleProvider, WeaTools } from "ecCom"; import { message, Modal, Spin } from "antd"; import { inject, observer } from "mobx-react"; -import { acctResultList, updateLockStatus } from "../../../../../apis/calculate"; +import { acctResultList, updateLockEmpStatus, updateLockStatus } from "../../../../../apis/calculate"; import ProgressModal from "../../../../../components/progressModal"; import BatchUpdateSalaryItemValDialog from "./batchUpdateSalaryItemValDialog"; import EditSalaryCalcSlide from "./editSalaryCalcSlide"; @@ -57,12 +57,15 @@ class EditCalcTable extends Component { this.props.onShowFormulaTd(dataIndex); break; case "LOCKING": - const { salaryItemId, lockType: lockStatus } = params; - if (lockStatus === "BATCHUPDATE") { + const { salaryItemId, lockType } = params; + if (lockType === "BATCHUPDATE") { this.batchUpdateSalaryItemVal(params); return; } - this.updateLockStatus({ lockStatus, salaryItemId }); + this.updateLockStatus({ lockStatus: lockType, salaryItemId }); + break; + case "LOCKEMP": + this.updateEmpLockStatus({ ...params }); break; case "EDIT": const { id: salaryCalcId } = params; @@ -131,6 +134,52 @@ class EditCalcTable extends Component { } }); }; + updateEmpLockStatus = (payload) => { + const { lockStatus } = payload; + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content:
+
+ {lockStatus === "LOCK" ? getLabel(111, "确定要锁定该人员核算数据吗?") : getLabel(111, "确定要解锁该人员核算数据吗?")} +
+
+ {lockStatus === "LOCK" ? getLabel(111, "确定后,核算数据锁定,项目公式失效;点击核算将跳过该人员已核算的项目!") : + getLabel(111, "确定后,则项目公式生效,页面仍显示手动修改的项目值;点击核算将按公式重新核算,不再显示解锁标识!")} +
+
, + onOk: () => { + this.setState({ + progressVisible: true + }, () => { + this.timerLock = setInterval(() => { + if (this.state.progress !== 100) { + this.setState({ + progress: this.state.progress + 1 + }); + } else { + clearInterval(this.timerLock); + this.setState({ + progressVisible: false, + progress: 0 + }); + } + }, 500); + }); + const { routeParams: { salaryAcctRecordId } } = this.props; + updateLockEmpStatus({ ...payload, salaryAcctRecordId }).then(({ status, errormsg }) => { + if (status) { + clearInterval(this.timerLock); + this.setState({ + progressVisible: false, + progress: 0 + }, () => this.queryCalcResultList()); + } else { + message.error(errormsg); + } + }); + } + }); + }; batchUpdateSalaryItemVal = (payload) => { Modal.confirm({ title: getLabel(131329, "信息确认"), @@ -180,7 +229,8 @@ class EditCalcTable extends Component { "共": getLabel(18609, "共"), "条": getLabel(18256, "条"), "总计": getLabel(523, "总计"), "批量解锁": getLabel(111, "批量解锁"), "批量锁定": getLabel(111, "批量锁定"), "批量更新": getLabel(111, "批量更新"), - "查看拓扑图": getLabel(111, "查看拓扑图") + "查看拓扑图": getLabel(111, "查看拓扑图"), "锁定": getLabel(111, "锁定"), + "解锁": getLabel(111, "解锁") }; this.setState({ originPayloadData: { ...payload, i18n } }); const childFrameObj = document.getElementById("atdTable"); diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js index b17b22c2..ee91061b 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js @@ -11,6 +11,7 @@ import { sysConfCodeRule } from "../../../../../apis/ruleconfig"; import EditCalcAdvanceSearchPannel from "./editCalcAdvanceSearchPannel"; import EditCalcTable from "./editCalcTable"; import SalaryMonthTip from "../salaryMonthTip"; +import SalaryCalcLayout from "./salaryCalcLayout"; import cs from "classnames"; import "./index.less"; @@ -25,10 +26,6 @@ class Index extends Component { }; } - componentDidMount() { - const promise = this.init(); - } - openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd }); onAdSearch = (bool = true) => { this.calcTableRef.wrappedInstance.queryCalcResultList(); @@ -56,7 +53,7 @@ class Index extends Component { const { salarySobCycle, showSearchAd, formulaTd, columnDesc, showTotalCell } = this.state; const { routeParams: { salaryAcctRecordId } } = this.props; const formulaObj = _.get(columnDesc, [formulaTd]) || {}; - return ( + return ( this.onAdSearch(false)}>
@@ -91,7 +88,7 @@ class Index extends Component { {...this.props} showTotalCell={showTotalCell} onShowFormulaTd={this.handleShowFormulaTa}/>
- ); + ); } } diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less index 77f3e425..3d23810b 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less @@ -207,3 +207,39 @@ } } } + +.infoConfirmDialog { + .confirm-content { + width: 100%; + height: 100%; + padding: 16px; + overflow: auto; + position: relative; + display: flex; + flex-direction: column; + justify-content: space-between; + + .contract { + text-align: center; + flex-grow: 1; + flex-shrink: 1; + } + + .confirm-container { + flex-grow: 0; + flex-shrink: 0; + margin-top: 8px; + width: 100%; + + } + } +} + +.loadingLayout { + width: 100%; + height: 100%; + text-align: center; + border-radius: 4px; + padding: 30px 50px; + margin: 20px 0; +} diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/salaryCalcLayout.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/salaryCalcLayout.js new file mode 100644 index 00000000..c95f07b0 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/salaryCalcLayout.js @@ -0,0 +1,96 @@ +/* + * Author: 黎永顺 + * name: 薪资核算-layout + * Description: + * Date: 2024/4/26 + */ +import React, { Component } from "react"; +import { WeaCheckbox, WeaDialog, WeaLocaleProvider } from "ecCom"; +import { Button, message, Spin } from "antd"; +import * as API from "../../../../../apis/calculate"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class SalaryCalcLayout extends Component { + constructor(props) { + super(props); + this.state = { + fieldInformationConfirm: { visible: false, data: {} }, userConfirmed: "0", show: false + }; + } + + componentDidMount() { + this.getCompareSobConfig(); + } + + getCompareSobConfig = () => { + const { fieldInformationConfirm } = this.state; + const { routeParams: { salaryAcctRecordId: id } } = this.props; + API.getCompareSobConfig({ id }).then(({ status, data }) => { + if (status && data) { + this.setState({ + fieldInformationConfirm: { ...fieldInformationConfirm, visible: data } + }); + } else { + this.setState({ show: true }, () => this.props.init()); + } + }).catch(() => this.setState({ show: true }, () => this.props.init())); + }; + onOk = () => { + const { fieldInformationConfirm } = this.state; + const { routeParams: { salaryAcctRecordId: id } } = this.props; + API.updateSobConfig({ id }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(30700, "操作成功!")); + this.setState({ + show: true, + fieldInformationConfirm: { ...fieldInformationConfirm, visible: false } + }, () => { + this.props.init(); + this.props.onConfirm(); + }); + } else { + message.error(errormsg); + } + }); + }; + + render() { + const { fieldInformationConfirm, userConfirmed, show } = this.state; + const buttons = [ + , + + ]; + return ( + + { + show ? this.props.children :
+ } + + this.setState({ + show: true, + fieldInformationConfirm: { ...fieldInformationConfirm, visible: false } + }, () => this.props.init())}> +
+
+ {getLabel("111", "账套发生变更,是否需要更新账套设置?更新后核算将按照最新的账套进行核算,请谨慎操作。")} +
+
+ this.setState({ userConfirmed: v })}/> +
+
+
+
+ ); + } +} + +export default SalaryCalcLayout; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js index 535f7c7e..17d4b09e 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js @@ -233,23 +233,17 @@ class Index extends Component { /> } {/* 薪资核算-自定义导出*/} - { - this.setState({ - customExpDialog: { ...customExpDialog, visible: false } - }); - }} - /> + { + this.setState({ + customExpDialog: { ...customExpDialog, visible: false } + }); + }}/> {/* 薪资核算-导入*/} - { - this.setState({ - salaryImpDialog: { ...salaryImpDialog, visible: false } - }, () => isFresh && this.calc.onAdSearch(false)); - }} - /> + { + this.setState({ + salaryImpDialog: { ...salaryImpDialog, visible: false } + }, () => isFresh && this.calc.onAdSearch(false)); + }}/>
diff --git a/pc4mobx/hrmSalary/pages/calculate/index.less b/pc4mobx/hrmSalary/pages/calculate/index.less index 98cfc21f..bc3f7755 100644 --- a/pc4mobx/hrmSalary/pages/calculate/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/index.less @@ -83,10 +83,10 @@ .ant-table-tbody { .ant-table-row-indent { - display: none; + display: none!important; } - td { + td:not(.ant-table-selection-column) { span { width: 100%; overflow: hidden; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataViewSlide.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataViewSlide.js index 4e2735aa..634d36fe 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataViewSlide.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataViewSlide.js @@ -40,7 +40,8 @@ class AttendanceDataViewSlide extends Component { const { columns, list: dataSource, pageNum: current, pageSize, total } = data.pageInfo; this.setState({ pageInfo: { ...pageInfo, current, pageSize, total }, dataSource, - columns: _.map(columns, o => ({ ...o, width: 150, fixed: o.dataIndex === "username" ? "left" : null })) + // o.dataIndex === "username" ? "left" : + columns: _.map(columns, o => ({ ...o, width: 150, fixed: null })) }); } }).catch(() => this.setState({ loading: { ...loading, query: false } })); diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js index 219240ec..b3124f6d 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js @@ -550,6 +550,17 @@ export const cumTaxPeriodCondition = [ value: "", rules: "required", viewAttr: 3 + },{ + colSpan: 1, + conditionType: "SELECT", + domkey: ["taxAgentIds"], + multiple: true, + fieldcol: 18, + label: "个税扣缴义务人", + lanId: 537996, + labelcol: 6, + value: "", + viewAttr: 2 }], title: "数据采集", defaultshow: true, diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog.js index 7e0c76f4..5947b8da 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog.js @@ -6,7 +6,8 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaDialog, WeaLocaleProvider } from "ecCom"; +import { toJS } from "mobx"; +import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; import { Button, message } from "antd"; import { getSearchs } from "../../../../util"; import { cumTaxPeriodCondition } from "../columns"; @@ -14,6 +15,7 @@ import { onlineRequest } from "../../../../apis/cumDeduct"; import { onlineActualAddUpAdvanceTax } from "../../../../apis/cumSituation"; const getLabel = WeaLocaleProvider.getLabel; +const getKey = WeaTools.getKey; const APIFox = { online: onlineRequest, advance: onlineActualAddUpAdvanceTax @@ -25,13 +27,23 @@ class SalaryCumDeductChooseTaxPeriodDialog extends Component { constructor(props) { super(props); this.state = { - loading: false + loading: false, conditions: [] }; } componentWillReceiveProps(nextProps, nextContext) { const { cumDeductStore: { cumTaxPeriodForm, changeCumTaxPeriodForm } } = nextProps; if (nextProps.visible !== this.props.visible && nextProps.visible) { + this.setState({ + conditions: _.map(cumTaxPeriodCondition, item => ({ + ...item, items: _.map(item.items, o => { + if (getKey(o) === "taxAgentIds") { + return { ...o, lable: getLabel(o.lanId, o.label), options: toJS(nextProps.taxAgentOption) }; + } + return { ...o, lable: getLabel(o.lanId, o.label) }; + }) + })) + }); cumTaxPeriodForm.initFormFields(cumTaxPeriodCondition); } if (nextProps.visible !== this.props.visible && !nextProps.visible) { @@ -43,18 +55,19 @@ class SalaryCumDeductChooseTaxPeriodDialog extends Component { save = () => { const { cumDeductStore: { cumTaxPeriodForm }, type } = this.props; cumTaxPeriodForm.validateForm().then(f => { - const { declareMonth } = cumTaxPeriodForm.getFormParams(); + const { declareMonth, taxAgentIds } = cumTaxPeriodForm.getFormParams(); if (f.isValid) { this.setState({ loading: true }); - APIFox[type]({ declareMonth: declareMonth + "-01" }).then(({ status, errormsg }) => { - this.setState({ loading: false }); - if (status) { - message.success(getLabel(111, "获取成功!")); - this.props.onCancel(); - } else { - message.error(errormsg); - } - }).catch(() => this.setState({ loading: false })); + APIFox[type]({ declareMonth: declareMonth + "-01", taxAgentIds: taxAgentIds ? taxAgentIds.split(",") : [] }) + .then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(111, "获取成功!")); + this.props.onCancel(); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: false })); } else { f.showErrors(); } @@ -62,17 +75,17 @@ class SalaryCumDeductChooseTaxPeriodDialog extends Component { }; render() { - const { loading } = this.state; + const { loading, conditions } = this.state; const { cumDeductStore: { cumTaxPeriodForm } } = this.props; return ( {getLabel(33703, "确认")}]} bottomLeft={getLabel(111, "点击保存后,稍后请点击【获取结果下载】下载获取结果。获取的数据将覆盖列表原本数据(有则覆盖无则新增)。")} >
- {getSearchs(cumTaxPeriodForm, cumTaxPeriodCondition, 1, false)} + {getSearchs(cumTaxPeriodForm, conditions, 1, false)}
); diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index 0c8a25cf..06aa7d03 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -69,7 +69,7 @@ class Index extends Component { exportPayloadType: false, advanceCondition: null, cumTaxPeriodDialog: { - visible: false, title: "", type: "" + visible: false, title: "", type: "", taxAgentOption: [] }, feedbackLoading: false, incomeTaxStatus: false, @@ -97,17 +97,18 @@ class Index extends Component { * Date: 2023/2/17 */ autoAddAll = () => { - const { declareMonth } = this.state; + const { declareMonth, taxAgentId } = this.state; this.setState({ addAllLoading: true }); - autoAddAll({ yearMonth: declareMonth }).then(({ status, data, errormsg }) => { - this.setState({ addAllLoading: false }); - if (status) { - message.success(data || "操作成功"); - this.tableRef.getTableDate(); - } else { - message.error(errormsg || "操作失败"); - } - }).catch(() => this.setState({ addAllLoading: false })); + autoAddAll({ yearMonth: declareMonth, taxAgentIds: taxAgentId ? taxAgentId.split(",") : [] }) + .then(({ status, data, errormsg }) => { + this.setState({ addAllLoading: false }); + if (status) { + message.success(data || "操作成功"); + this.tableRef.getTableDate(); + } else { + message.error(errormsg || "操作失败"); + } + }).catch(() => this.setState({ addAllLoading: false })); }; /* * Author: 黎永顺 @@ -376,8 +377,8 @@ class Index extends Component { label: "个税扣缴义务人", value: taxAgentId, onChange: this.screenChange, - options: [{ key: "", showname: "全部" }, ...taxAgentOption], - key: "taxAgentId" + options: taxAgentOption, + key: "taxAgentId", multiple: true }) } ]; @@ -400,6 +401,7 @@ class Index extends Component { */ getTopBtns = () => { const { addAllLoading, cumTaxPeriodDialog, feedbackLoading, incomeTaxStatus } = this.state; + const { taxAgentStore: { taxAgentOption } } = this.props; const commonBtns = [ , , @@ -420,7 +422,7 @@ class Index extends Component { const incomeTaxBtns = [ , - , @@ -355,30 +364,30 @@ class Index extends Component { //申报状态:申报中 declareInfo.declareStatus === "DECLARING" && (btns.splice(1, 2, )); + onClick={() => this.handleOperateDeclare("feedback", { reportType })}>{getLabel(111, "申报反馈")})); //申报状态:缴款中 declareInfo.declareStatus === "DECLARE_SUCCESS_PAYING" && (btns.splice(1, 2)); //申报状态:已缴款 declareInfo.declareStatus === "DECLARE_SUCCESS_PAID" && (btns.splice(1, 2, )); + onClick={() => confirmDialog("correct", () => this.handleOperateDeclare("correct", { reportType }))}>{getLabel(111, "更正申报")})); //申报状态:申报成功,无需缴款 declareInfo.declareStatus === "DECLARE_SUCCESS_NO_PAY" && (btns.splice(1, 2, , + onClick={() => confirmDialog("correct", () => this.handleOperateDeclare("correct", { reportType }))}>{getLabel(111, "更正申报")}, + onClick={() => confirmDialog("cancel", () => this.handleOperateDeclare("cancel", { reportType }))}>{getLabel(111, "作废申报")} )); //申报状态:申报成功,未缴款 declareInfo.declareStatus === "DECLARE_SUCCESS_UNPAID" && (btns.splice(1, 2, , + onClick={() => confirmDialog("correct", () => this.handleOperateDeclare("correct", { reportType }))}>{getLabel(111, "更正申报")}, , + onClick={() => confirmDialog("cancel", () => this.handleOperateDeclare("cancel", { reportType }))}>{getLabel(111, "作废申报")}, @@ -404,7 +413,7 @@ class Index extends Component { } if (intelCalcSalaryStatus && (declareInfo.declareStatus === "DECLARE_SUCCESS_UNPAID")) { btns.push( - , + , ); } @@ -413,41 +422,49 @@ class Index extends Component { onClick={this.getEnterprisePayCertificate}>{getLabel(111, "开具企业完税证明")}); } return ( -
- this[fun]()}/> -
- this.setState({ selectedKey: v }, () => this.getDetailList())} - searchType={["base"]} searchsBasePlaceHolder={getLabel(26919, "请输入姓名")} - onSearchChange={keyword => this.setState({ keyword })} - onSearch={this.getDetailList} - /> - {/*个税申报表-新增编辑框*/} - this.handleTaxDescPerSlide({ visible: false, id: "", callback })} - /> - {/*个税申报表导入*/} - this.taxDeclareRef = dom} - onSuccess={this.declare} - /> - {/*个税申报表-新增tab弹框*/} - this.setState({ editTabVisible: false }, () => isRefresh && this.init(false))}/> -
-
- -