diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index 009a9bd8..688c5bb6 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -290,5 +290,23 @@ export const getCompareSobConfig = params => { export const updateSobConfig = params => { return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/updateSobConfig", "GET", params); }; - - +//薪资核算-计算个税 +export const acctresultCalcTax = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/calcTax", params); +}; +//薪资核算-获取个税计算反馈 +export const calcTaxFeedback = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/calcTaxFeedback", params); +}; +//薪资核算-人员异常 +export const listPage4NotDeclare = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctemployee/listPage4NotDeclare", params); +}; +// 核算结果--核算税后工资 +export const afterTaxAccounting = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/afterTaxAccounting", params); +}; +// 核算税后工资进度条 +export const getAfterTaxAccountingProgress = (id) => { + return WeaTools.callApi("/api/bs/hrmsalary/progress/getRate?cacheKey=AFTER_TAX_ACCT_PROGRESS_" + id, "get", {}); +}; diff --git a/pc4mobx/hrmSalary/apis/cumDeduct.js b/pc4mobx/hrmSalary/apis/cumDeduct.js index ba918db0..fba89460 100644 --- a/pc4mobx/hrmSalary/apis/cumDeduct.js +++ b/pc4mobx/hrmSalary/apis/cumDeduct.js @@ -95,3 +95,15 @@ export const getTableRecordDate = ({ url, ...params }) => { return postFetch(url, params); }; +//个税-在线获取 +export const onlineRequest = (params) => { + return postFetch("/api/bs/hrmsalary/addUpDeduction/online/request", params); +}; + +//个税-在线获取结果查询 +export const onlineFeedback = () => { + return fetch("/api/bs/hrmsalary/addUpDeduction/online/feedback", { + method: "GET", + mode: "cors" + }).then((res) => res.json()); +}; diff --git a/pc4mobx/hrmSalary/apis/cumSituation.js b/pc4mobx/hrmSalary/apis/cumSituation.js index 69df7644..7a8469a2 100644 --- a/pc4mobx/hrmSalary/apis/cumSituation.js +++ b/pc4mobx/hrmSalary/apis/cumSituation.js @@ -80,3 +80,7 @@ export const deleteAllAddUpSituation = (params) => { export const getAddUpSituation = (params) => { return postFetch("/api/bs/hrmsalary/addUpSituation/getAddUpSituation", params); }; +//个税相关-在线获取 +export const onlineActualAddUpAdvanceTax = (params) => { + return postFetch('/api/bs/hrmsalary/addUpSituation/online/actualAddUpAdvanceTax', params); +} diff --git a/pc4mobx/hrmSalary/apis/declare.js b/pc4mobx/hrmSalary/apis/declare.js index 2c37805d..54c6959f 100644 --- a/pc4mobx/hrmSalary/apis/declare.js +++ b/pc4mobx/hrmSalary/apis/declare.js @@ -1,19 +1,28 @@ import { WeaTools } from "ecCom"; -import { postFetch } from "../util/request"; +import { postExportFetch, postFetch } from "../util/request"; +import { convertToUrlString } from "../util/url"; //个税申报表-个税申报表列表 export const getDeclareList = params => { return postFetch("/api/bs/hrmsalary/taxdeclaration/list", params); }; +//个税申报表-个税申报表表单 +export const getDeclareForm = params => { + return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/getForm", "get", params); +}; //个税申报表-个税申报表生成 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); }; // 个税申报表详情列表 @@ -37,5 +46,265 @@ export const exportSalaryArchive = (id = "") => { export const withDrawTaxDeclaration = (params) => { return postFetch("/api/bs/hrmsalary/taxdeclaration/withDrawTaxDeclaration", params); }; +//人员信息报送-个税扣缴义务人列表 +export const taxAgentDeclareList = (params) => { + return postFetch("/api/bs/hrmsalary/employeedeclare/taxAgentDeclareList", params); +}; +//人员信息报送-全部人员列表 +export const employeedeclareList = (params) => { + return postFetch("/api/bs/hrmsalary/employeedeclare/list", params); +}; +//人员信息报送-本月新增人员列表 +export const employeedeclareList4Add = (params) => { + return postFetch("/api/bs/hrmsalary/employeedeclare/list4Add", params); +}; +//人员信息报送-本月信息变动列表 +export const employeedeclareList4Update = (params) => { + return postFetch("/api/bs/hrmsalary/employeedeclare/list4Update", params); +}; +//人员信息报送-本月报送失败人员列表 +export const employeedeclareList4Fail = (params) => { + return postFetch("/api/bs/hrmsalary/employeedeclare/list4Fail", params); +}; +//人员报送-刷新数据 +export const employeedeclareRefresh = (params) => { + return postFetch("/api/bs/hrmsalary/employeedeclare/refresh", params); +}; + +//人员报送-获取报送结果反馈 +export const getDeclareFeedback = (params) => { + return postFetch("/api/bs/hrmsalary/employeedeclare/getDeclareFeedback", params); +}; + +//人员报送-获取整体的报送情况 +export const getEmployeeDeclareInfo = (params) => { + return postFetch("/api/bs/hrmsalary/employeedeclare/getDeclareInfo", params); +}; + +//人员报送-后端业务逻辑是否已经完成 +export const employeedeclareGetRate = params => { + return WeaTools.callApi("/api/bs/hrmsalary/employeedeclare/getRate", "GET", params); +}; + +//人员报送-获取新建或编辑的表单 +export const employeedeclareGetForm = params => { + return WeaTools.callApi("/api/bs/hrmsalary/employeedeclare/getForm", "GET", params); +}; + +//人员报送-新增人员/编辑人员保存 +export const getEmployeeSave = (params) => { + return postFetch("/api/bs/hrmsalary/employeedeclare/save", 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) => { + return postFetch("/api/bs/hrmsalary/employeedeclare/declare", params); +}; + +//个税在线对接-获取个税申报记录下的个税申报表TAB +export const getTaxDeclarationTab = params => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationTab", params); +}; + +//个税在线对接-个税申报表是否已经生成 +export const taxdeclarationGetRate = params => { + return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/getRate", "GET", params); +}; + +//人员报送-刷新数据 +export const taxdeclarationRefreshData = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/refreshData", params); +}; + +//人员报送-在线申报 +export const taxdeclarationDeclare = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/declare", params); +}; +//个税申报表申报数据-人员未报送列表 +export const taxdeclarationEmployeeList4NotDeclare = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/employee/list4NotDeclare", params); +}; +//个税申报表申报数据-报送人员无申报数据列表 +export const taxdeclarationEmployeeList4NoValue = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/employee/list4NoValue", params); +}; +//个税申报表申报数据-申报失败列表 +export const taxdeclarationEmployeeList4Fail = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/employee/list4Fail", params); +}; +//个税申报表申报数据-删除个税申报表 +export const taxdeclarationDelete = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/delete", params); +}; + +//个税申报表申报数据-获取在线申报反馈 +export const taxdeclarationGetDeclareFeedback = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/getDeclareFeedback", params); +}; + +//个税申报表申报数据-更正申报 +export const taxdeclaratioUpdateDeclare = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/updateDeclare", params); +}; + +//个税申报表申报数据-作废申报 +export const taxdeclaratioUpdateCancel = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/cancel", params); +}; + +//个税申报表申报数据-获取作废反馈 +export const taxdeclaratioGetCancelFeedback = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/getCancelFeedback", params); +}; + +//个税申报表申报数据-三方协议缴款反馈 +export const taxPaymentAgreementPayFeedback = (params) => { + return postFetch("/api/bs/hrmsalary/taxPayment/agreement/pay/feedback", params); +}; + +//个税申报表申报数据-应缴税额查询 +export const taxPaymentTaxAmount = (params) => { + return postFetch("/api/bs/hrmsalary/taxPayment/tax/amount", params); +}; + +//个税申报表申报数据-获取企业的三方信息 +export const taxPaymentgetAgreement = (params) => { + return postFetch("/api/bs/hrmsalary/taxPayment/getAgreement", params); +}; + +//个税申报表申报数据-获取企业的三方信息查询反馈 +export const taxPaymentgetAgreementFeedback = (params) => { + return postFetch("/api/bs/hrmsalary/taxPayment/getAgreementFeedback", params); +}; + +//个税申报表申报数据-同步缴款状态 +export const taxPaymentVoucherStatusSync = (params) => { + return postFetch("/api/bs/hrmsalary/taxPayment/voucher/status/sync", params); +}; + +//个税申报表申报数据-三方缴款,最终支付 +export const taxPaymentAgreemenPay = (params) => { + return postFetch("/api/bs/hrmsalary/taxPayment/agreement/pay", params); +}; + +//个税申报表申报数据-开具企业缴税完税证明 +export const taxPaymentWithheldVoucherGet = (params) => { + return postFetch("/api/bs/hrmsalary/taxPayment/withheldVoucher/get", params); +}; + +//个税申报表申报数据-作废缴款凭证 +export const taxPaymentVoucherCancel = (params) => { + return postFetch("/api/bs/hrmsalary/taxPayment/voucher/cancel", params); +}; + +//个税申报表申报数据-缴款凭证打印 +export const taxPaymentVoucherPrint = (params) => { + return postFetch("/api/bs/hrmsalary/taxPayment/voucher/print", params); +}; + +//个税申报表申报数据-缴款凭证打印反馈 +export const taxPaymentVoucherPrintFeedback = (params) => { + return postFetch("/api/bs/hrmsalary/taxPayment/voucher/print/feedback", params); +}; + +//个税申报表申报数据-缴款凭证打印反馈 +export const taxdeclarationUpdateIcon = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/updateIcon", params); +}; +export const employeedeclareExport = params => { + return postExportFetch("/api/bs/hrmsalary/employeedeclare/export", params); +}; +//个税申报表申报数据-获取表单 +export const getTaxDecForm = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/getAddForm", params); +}; +//个税申报表申报数据-新增 +export const taxdeclarationAdd = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/add", params); +}; +//个税申报表申报数据-编辑 +export const taxdeclarationEdit = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/edit", params); +}; +//个税申报表申报数据-详情 +export const getTaxdeclarationDetailInfo = (params) => { + return fetch(`/api/bs/hrmsalary/taxdeclaration/detailInfo?${convertToUrlString(params)}`, { + method: "GET", + mode: "cors" + }).then((res) => res.json()); +}; +//个税申报表申报数据-下载模板 +export const taxdeclarationExportTemplate = params => { + return postExportFetch("/api/bs/hrmsalary/taxdeclaration/downloadTemplate", params); +}; +//人员信息报送-下载人员信息报送导入模板 +export const employeedeclareExportTemplate = params => { + return postExportFetch("/api/bs/hrmsalary/employeedeclare/exportTemplate", params); +}; +//个税申报表申报数据-下载申报内置算税结果 +export const exportGetDeclareTaxResultFeedback = params => { + return postExportFetch("/api/bs/hrmsalary/taxdeclaration/exportGetDeclareTaxResultFeedback", params); +}; +//个税申报表申报数据-数据导入 +export const taxdeclarationImportData = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/importData", params); +}; +//人员信息报送-人员信息报送导入 +export const employeedeclareImportData = (params) => { + return postFetch("/api/bs/hrmsalary/employeedeclare/importData", params); +}; +//个税申报表-新增申报表Tab +export const addTaxDeclaration = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/addTaxDeclaration", params); +}; +//个税申报表-删除申报表Tab +export const deleteTaxDeclaration = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/deleteTaxDeclaration", params); +}; +//个税申报表-删除申报表 +export const deleteInfo = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/deleteInfo", params); +}; +//个税申报表-对比申报结果 +export const getTaxdeclarationContrastList = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/contrast", params); +}; +export const exportContrast = params => { + return postExportFetch("/api/bs/hrmsalary/taxdeclaration/exportContrast", params); +}; + +//扣除名单确认-人员列表 +export const getDeductionAmountList = (params) => { + return postFetch("/api/bs/hrmsalary/deductionAmount/list", params); +}; +//扣除名单确认-增加人员 +export const addDeductionAmount = (params) => { + return postFetch("/api/bs/hrmsalary/deductionAmount/add", params); +}; +//扣除名单确认-删除人员 +export const deleteDeductionAmount = (params) => { + return postFetch("/api/bs/hrmsalary/deductionAmount/delete", params); +}; +//扣除名单确认-编辑人员 +export const editDeductionAmount = (params) => { + return postFetch("/api/bs/hrmsalary/deductionAmount/edit", params); +}; +//扣除名单确认-确认人员 +export const confirmDeductionAmount = (params) => { + return postFetch("/api/bs/hrmsalary/deductionAmount/confirm", params); +}; +//扣除名单确认-反馈人员 +export const feedbackDeductionAmount = (params) => { + return postFetch("/api/bs/hrmsalary/deductionAmount/feedback", params); +}; diff --git a/pc4mobx/hrmSalary/apis/index.js b/pc4mobx/hrmSalary/apis/index.js index 2a7d00d9..553733d0 100644 --- a/pc4mobx/hrmSalary/apis/index.js +++ b/pc4mobx/hrmSalary/apis/index.js @@ -43,3 +43,8 @@ export const getSalarysobListAll = params => { export const supplementAcctRecord = (params) => { return postFetch("/api/bs/hrmsalary/salaryacct/supplementAcctRecord", params); }; + +// 薪资账套-浏览按钮数据 +export const commonBrowserData = (params) => { + return postFetch("/api/bs/hrmsalary/common/browser/data", params); +}; diff --git a/pc4mobx/hrmSalary/apis/intelligentCalculateSalarySettings.js b/pc4mobx/hrmSalary/apis/intelligentCalculateSalarySettings.js new file mode 100644 index 00000000..cd51bce3 --- /dev/null +++ b/pc4mobx/hrmSalary/apis/intelligentCalculateSalarySettings.js @@ -0,0 +1,55 @@ +import { WeaTools } from "ecCom"; +import { postFetch } from "../util/request"; + +//智能算薪-计费配置编辑表单 +export const apiflowBillingConfigGet = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/apiflow/billing/config/get", "GET", params); +}; +//智能算薪-查询计费配置开关状态 +export const apiflowBillingConfigStatus = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/apiflow/billing/config/status", "GET", params); +}; +//智能算薪-计费配置保存 +export const apiflowBillingConfigSave = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/apiflow/billing/config/save", params); +}; +//智能算薪-计费配置开关 +export const apiflowBillingConfigEnable = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/apiflow/billing/config/enable", params); +}; +//智能算薪-流量不足提醒初始化表单 +export const apiflowWarnConfigGetForm = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/apiflow/warn/config/getForm", "GET", params); +}; +//智能算薪-接口流量使用记录 +export const apiflowRecordList = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/apiflow/record/list", params); +}; +//智能算薪-接口流量使用记录 +export const apiflowStatisticsInfo = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/apiflow/statistics/info", params); +}; +//智能算薪-接口流量使用明细 +export const apiflowStatisticsList = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/apiflow/statistics/list", params); +}; +//智能算薪-流量不足提醒编辑或保存 +export const apiflowWarnConfigSave = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/apiflow/warn/config/save", params); +}; +//智能算薪-流量不足提醒对象列表 +export const apiflowWarnReceiverList = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/apiflow/warn/receiver/list", "GET", params); +}; +//智能算薪-编辑保存流量不足提醒对象 +export const apiflowWarnReceiverSave = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/apiflow/warn/receiver/save", params); +}; +//智能算薪-编辑保存流量不足提醒对象 +export const apiflowWarnReceiverGetForm = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/apiflow/warn/receiver/getForm", params); +}; +//智能算薪-流量不足提醒对象-删除 +export const apiflowWarnReceiverDelete = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/apiflow/warn/receiver/delete", "GET", params); +}; diff --git a/pc4mobx/hrmSalary/apis/ledger.js b/pc4mobx/hrmSalary/apis/ledger.js index 1f529d09..2952dfe8 100644 --- a/pc4mobx/hrmSalary/apis/ledger.js +++ b/pc4mobx/hrmSalary/apis/ledger.js @@ -25,6 +25,10 @@ export const deleteLedger = params => { export const getLedgerBasicForm = params => { return WeaTools.callApi("/api/bs/hrmsalary/salarysob/basic/getForm", "get", params); }; +//薪资帐套基本信息工资类型接口 +export const getIncomeCategoryList = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salarysob/incomeCategoryList", "get", params); +}; //保存薪资帐套基本信息 export const saveLedgerBasic = params => { @@ -143,6 +147,30 @@ export const getAggregate = params => { export const getBackitemForm = params => { return WeaTools.callApi("/api/bs/hrmsalary/salarysob/backitem/getForm", "GET", params); }; +//薪资账套下的个税申报表-申报字段对应 +export const taxreportruleGetForm = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salarysob/taxreportrule/getForm", "GET", params); +}; +//薪资账套下的个税字段对应-个税字段对应 +export const taxruleGetForm = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salarysob/taxrule/getForm", "GET", params); +}; +//薪资账套下的个税申报-累计字段对应 +export const addupruleGetForm = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salarysob/adduprule/getForm", "GET", params); +}; +//保存薪资账套下的个税申报表规则 +export const taxreportruleSave = params => { + return postFetch("/api/bs/hrmsalary/salarysob/taxreportrule/save", params); +}; +//保存薪资账套下的个税字段对应规则 +export const taxruleSave = params => { + return postFetch("/api/bs/hrmsalary/salarysob/taxrule/save", params); +}; +//保存薪资账套下的累计字段对应关系 +export const addupruleSave = params => { + return postFetch("/api/bs/hrmsalary/salarysob/adduprule/save", params); +}; //保存回算薪资项目详情 export const salarysobBackitemSave = params => { return postFetch("/api/bs/hrmsalary/salarysob/backitem/save", params); @@ -155,6 +183,10 @@ export const salarysobRangePreview = params => { export const salarysobRangeImportData = params => { return postFetch("/api/bs/hrmsalary/salarysob/range/importData", params); }; +//保存薪资账套个税字段 +export const saveTaxMapping = params => { + return postFetch("/api/bs/hrmsalary/salarysob/tax/saveTaxMapping", params); +}; //薪资账套-获取薪资账套中薪资项目明细 export const getSalaryItemForm = params => { return postFetch("/api/bs/hrmsalary/salarysob/item/getSalaryItemForm", params); @@ -171,3 +203,7 @@ export const salaryApprovalSaveForm = params => { export const getListSalaryItem = params => { return postFetch("/api/bs/hrmsalary/salarysob/salaryApproval/listSalaryItem", params); }; +//薪资账套-获取薪资账套中拓扑图数据 +export const getSalaryItemTopology = params => { + return postFetch("/api/bs/hrmsalary/salarysob/item/topology", params); +}; diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index 9d0f9f46..10d531b6 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -135,7 +135,7 @@ export const recessionListSum = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/detail/recession/list/sum", params); }; //查询补差列表 -export const balanceList = (params) => { +export const balanceList = (params, ids) => { return postFetch("/api/bs/hrmsalary/siaccount/detail/balance/list", params); }; //查询补差列表合计行 diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index 27d4be56..43863b58 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -102,6 +102,23 @@ export const getTaxAgentSelectListAsAdmin = (params) => { export const hasIconInTax = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/sys/conf/code?code=hideIconInTax", "GET", params); }; +//获取报税信息表单 +export const taxReturnGetForm = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/taxReturn/getForm", "GET", params); +}; + +//个税信息-保存并验证报税信息 +export const saveAndCheck = (params) => { + return postFetch("/api/bs/hrmsalary/taxAgent/taxReturn/saveAndCheck", params); +}; +//个税信息-部门备案报税信息保存 +export const saveDepartmentCodeAndCheck = (params) => { + return postFetch("/api/bs/hrmsalary/taxAgent/taxReturn/departmentCode/check", params); +}; +//个税信息-提交报税信息 +export const registrationCheck = (params) => { + return postFetch("/api/bs/hrmsalary/taxAgent/taxReturn/registration/check", params); +}; /**权限-角色相关*/ //同步业务线 diff --git a/pc4mobx/hrmSalary/common/purchased.png b/pc4mobx/hrmSalary/common/purchased.png new file mode 100644 index 00000000..64223fdc Binary files /dev/null and b/pc4mobx/hrmSalary/common/purchased.png differ diff --git a/pc4mobx/hrmSalary/common/remaining.png b/pc4mobx/hrmSalary/common/remaining.png new file mode 100644 index 00000000..655818c0 Binary files /dev/null and b/pc4mobx/hrmSalary/common/remaining.png differ diff --git a/pc4mobx/hrmSalary/common/traffic.png b/pc4mobx/hrmSalary/common/traffic.png new file mode 100644 index 00000000..477bfa10 Binary files /dev/null and b/pc4mobx/hrmSalary/common/traffic.png differ diff --git a/pc4mobx/hrmSalary/components/TipLabel/index.less b/pc4mobx/hrmSalary/components/TipLabel/index.less index addc7741..b88403e9 100644 --- a/pc4mobx/hrmSalary/components/TipLabel/index.less +++ b/pc4mobx/hrmSalary/components/TipLabel/index.less @@ -1,36 +1,41 @@ .tipLabelWrapper { - border-left: 1px solid #e2ecf2; + border-left: 1px solid #e2ecf2; + border-bottom: 1px solid #e2ecf2; + border-right: 1px solid #e2ecf2; + border-radius: 0px 0px 5px 5px; + width: 100%; + overflow: hidden; + + .titleWrapper { + width: 100%; + line-height: 19.2px; + padding: 10px; border-bottom: 1px solid #e2ecf2; - border-right: 1px solid #e2ecf2; - border-radius: 0px 0px 5px 5px; + background-color: #f7fbfe; + } + + .tipContentWrapper { + padding: 10px; + background: #FFF; + } + + .tipContentItem { + line-height: 20px; + padding: 10px 16px 0px; + color: rgb(153, 153, 153); + } + + .tipContentItem:first-child { + padding-top: 0; + } + + .formLabel { + font-size: 14px; + } + + .contentWrapper { width: 100%; overflow: hidden; - .titleWrapper { - width: 100%; - line-height: 19.2px; - padding: 10px; - border-bottom: 1px solid #e2ecf2; - background-color: #f7fbfe; - } - .tipContentWrapper { - padding: 10px; - } - .tipContentItem { - line-height: 20px; - padding: 0px 16px; - padding-top: 10px; - color: rgb(153, 153, 153); - } - .tipContentItem:first { - padding-top: 0px; - } - - .formLabel { - font-size: 14px; - } - .contentWrapper { - width: 100%; - overflow: hidden; - } + } } diff --git a/pc4mobx/hrmSalary/components/excelEditor/components/codeAction.js b/pc4mobx/hrmSalary/components/excelEditor/components/codeAction.js index 5dc1a646..7a4ac957 100644 --- a/pc4mobx/hrmSalary/components/excelEditor/components/codeAction.js +++ b/pc4mobx/hrmSalary/components/excelEditor/components/codeAction.js @@ -124,10 +124,10 @@ class CodeAction extends Component {
-
{getLabel(111, "变量")}
+
{getLabel(33748, "变量")}
- this.setState({ variableText })}/> this.setState({ variItemText })} /> } @@ -177,10 +177,10 @@ class CodeAction extends Component {
-
{getLabel(111, "函数")}
+
{getLabel(30686, "函数")}
- this.setState({ funcText })}/>
- {!_.isEmpty(funcHoverItem) ? funcHoverItem.name : getLabel(111, "提示")} + {!_.isEmpty(funcHoverItem) ? funcHoverItem.name : getLabel(558, "提示")}
@@ -243,12 +243,12 @@ const TipList = (props) => {
:
-
{getLabel(111, "语法")}
+
{getLabel(543403, "语法")}
{formatString}
{description}
-
{getLabel(111, "参数")}
+
{getLabel(561, "参数")}
{ _.map(paramDescs, it => { return
@@ -257,9 +257,9 @@ const TipList = (props) => {
; }) } -
{getLabel(111, "示例")}
+
{getLabel(82159, "示例")}
{example} -
{getLabel(111, "结果")}
+
{getLabel(356, "结果")}
{result}
; diff --git a/pc4mobx/hrmSalary/components/excelEditor/index.js b/pc4mobx/hrmSalary/components/excelEditor/index.js index 8b0fe4ae..c3a8fefc 100644 --- a/pc4mobx/hrmSalary/components/excelEditor/index.js +++ b/pc4mobx/hrmSalary/components/excelEditor/index.js @@ -157,7 +157,7 @@ class ExcelEditor extends Component {
} diff --git a/pc4mobx/hrmSalary/components/externalPersonModal/index.js b/pc4mobx/hrmSalary/components/externalPersonModal/index.js index 64f21fbf..b84a3aee 100644 --- a/pc4mobx/hrmSalary/components/externalPersonModal/index.js +++ b/pc4mobx/hrmSalary/components/externalPersonModal/index.js @@ -17,6 +17,12 @@ class Index extends Component { }; } + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && !nextProps.visible) { + this.setState({ targetIds: "", targetNames: "" }); + } + } + handleExternalPersonSave = () => { const { targetIds } = this.state; const { onExternalPersonSave } = this.props; diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js index b2ac42b0..5ca73075 100644 --- a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js @@ -6,7 +6,7 @@ */ import React, { Component } from "react"; import { WeaLocaleProvider } from "ecCom"; -import { Icon, message, Upload } from "antd"; +import { Icon, Upload, message } from "antd"; const Dragger = Upload.Dragger; const { getLabel } = WeaLocaleProvider; diff --git a/pc4mobx/hrmSalary/components/importDialog/index.js b/pc4mobx/hrmSalary/components/importDialog/index.js index 633df0ee..41e76e23 100644 --- a/pc4mobx/hrmSalary/components/importDialog/index.js +++ b/pc4mobx/hrmSalary/components/importDialog/index.js @@ -76,6 +76,7 @@ class Index extends Component { onOk: () => this.setState({ current: this.state.current - 1 }, () => this.props.onResetImportResult()) }); }; + /* * Author: 黎永顺 * Description: 下一步 diff --git a/pc4mobx/hrmSalary/config.js b/pc4mobx/hrmSalary/config.js index d040ac73..d730832e 100644 --- a/pc4mobx/hrmSalary/config.js +++ b/pc4mobx/hrmSalary/config.js @@ -1,7 +1,7 @@ export const PAGE = { "salaryArchive": ["/hrmSalary/salaryFile"], //薪资档案 - "salarySob": ["/hrmSalary/ledger"], //薪资账套 - "salaryAcct": ["/hrmSalary/calculate", "/hrmSalary/calcView"], //薪资核算 + "salarySob": ["/hrmSalary/ledger", "/hrmSalary/ledger/topologyView/"], //薪资账套 + "salaryAcct": ["/hrmSalary/calculate", "/hrmSalary/calcView", "/hrmSalary/topologyView"], //薪资核算 "salaryBill": ["/hrmSalary/payroll", "/hrmSalary/payrollGrant", "/hrmSalary/payrollDetail"], //工资单 "taxDeclaration": ["/hrmSalary/declare", "/hrmSalary/generateDeclarationDetail"], //个税 "addUpDeduction": ["/dataAcquisition/cumDeduct"], //累计专项附加扣除 @@ -20,6 +20,7 @@ export const PAGE = { "siScheme": ["/socialSecurityBenefits/programme"], //社保福利方案 "report": ["/hrmSalary/analysisOfSalaryStatistics", "/hrmSalary/reportView"], //报表 "dataPush": ["/hrmSalary/datapush"], //数据推送 - "adjustRecord": ["/hrmSalary/adjustSalaryManage"] //调薪管理 + "adjustRecord": ["/hrmSalary/adjustSalaryManage"], //调薪管理 + "employeeDeclare": ["/hrmSalary/employeedeclare"] //个税-人员信息报送给 }; export const EXCLUDE_PAGE = ["mobilepayroll"]; diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 42d08cee..b6808b84 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -6,7 +6,6 @@ import SalaryAdjustmentRecords from "./pages/salaryAdjustmentRecords"; import MySalaryMobile from "./pages/mySalaryMobile"; import MySalary from "./pages/mySalaryBenefits"; import Programme from "./pages/socialSecurityBenefits/welfarePlan"; -// import Archivess from "./pages/socialSecurityBenefits/archives"; import Archives from "./pages/socialSecurityBenefits/welfareArchive"; //社保福利档案重构页面 import StandingBook from "./pages/socialSecurityBenefits/standingBook/standingBook"; //社保福利台账重构页面 import StandingBookDetail from "./pages/socialSecurityBenefits/standingBookDetail"; @@ -19,15 +18,19 @@ import CumSituation from "./pages/dataAcquisition/cumSituation"; import Attendance from "./pages/dataAcquisition/attendance"; import SpecialAddDeduction from "./pages/dataAcquisition/specialAddDeduction"; import Ledger from "./pages/ledgerPage"; -// import Calculate from "./pages/calculate"; import Calculate from "./pages/calculate/calculate"; //重构的薪资核算页面 -// import Payroll from "./pages/payroll"; import Payroll from "./pages/payrollRelease"; //重构的工资单发放页面 import PayrollGrant from "./pages/payroll/payrollGrant"; import PayrollDetail from "./pages/payroll/payrollDetail/payrollDetail"; -// import Declare from "./pages/declare"; +import DeclareDetail from "./pages/declareDetail"; +import DeclareOnlineComparison from "./pages/declareOnlineComparison"; +import Employeedeclare from "./pages/employeedeclare"; +import EnterprisePayCertificationDetail from "./pages/enterprisePayCertificationDetail"; +import BankVoucherDetail from "./pages/bankVoucherDetail"; +import EmployeedeclareDetail from "./pages/employeedeclareDetail"; import Declare from "./pages/declare/declare"; //重构的个税申报表 import TaxRate from "./pages/taxRate"; +import TaxAgents from "./pages/taxAgent"; import TaxAgent from "./pages/salary/taxAgent"; import CalculateDetail from "./pages/calculateDetail"; import PlaceOnFileDetail from "./pages/calculateDetail/placeOnFileDetail"; @@ -49,6 +52,7 @@ import EmployeeList from "./pages/employeeView"; import ReportView from "./pages/reportView"; import MySalaryView from "./pages/mySalary/mySalaryView"; import WatermarkPreview from "./pages/payroll/watermarkPreview"; +import IntelligentCalculateSalarySettings from "./pages/intelligentCalculateSalarySettings"; import ExternalPersonManage from "./pages/externalPersonManage"; import AdjustSalaryManage from "./pages/adjustSalaryManage"; import TopologyMap from "./pages/topologyMap"; @@ -92,6 +96,7 @@ const Routes = ( + @@ -106,9 +111,17 @@ const Routes = ( + + + + + + + @@ -119,6 +132,8 @@ const Routes = ( + diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js index 80f7e4dd..e0d5b792 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js @@ -11,7 +11,7 @@ export const condition = [ conditionType: "SELECT", domkey: ["dimType"], fieldcol: 14, - label: getLabel(111, "维度类型"), + label: getLabel(389137, "维度类型"), labelcol: 6, options: [], detailtype: 3, @@ -23,7 +23,7 @@ export const condition = [ conditionType: "SELECT", domkey: ["setting4Qualitative"], fieldcol: 14, - label: getLabel(111, "统计维度"), + label: getLabel(506800, "统计维度"), labelcol: 6, options: [], rules: "required|string", @@ -37,7 +37,7 @@ export const condition = [ conditionType: "INPUT", domkey: ["dimName"], fieldcol: 14, - label: getLabel(111, "统计维度名称"), + label: getLabel(543321, "统计维度名称"), labelcol: 6, value: "", rules: "required|string", @@ -48,7 +48,7 @@ export const condition = [ conditionType: "SELECT", domkey: ["dimCode"], fieldcol: 14, - label: getLabel(111, "分组所属字段"), + label: getLabel(543322, "分组所属字段"), labelcol: 6, options: [], viewAttr: 2, @@ -59,13 +59,13 @@ export const condition = [ conditionType: "TEXTAREA", domkey: ["remark"], fieldcol: 14, - label: getLabel(111, "描述"), + label: getLabel(433, "描述"), labelcol: 6, value: "", viewAttr: 2 } ], - title: getLabel(111, "基础设置"), + title: getLabel(82751, "基础设置"), defaultshow: true } ]; @@ -77,7 +77,7 @@ export const reportCondition = [ conditionType: "INPUT", domkey: ["reportName"], fieldcol: 14, - label: getLabel(111, "报表名称"), + label: getLabel(15517, "报表名称"), labelcol: 6, value: "", rules: "required|string", @@ -88,7 +88,7 @@ export const reportCondition = [ conditionType: "SELECT", domkey: ["dimensionIds"], fieldcol: 14, - label: getLabel(111, "统计维度"), + label: getLabel(506800, "统计维度"), labelcol: 6, options: [], rules: "required|string", diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/dimensionSlide.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/dimensionSlide.js index b7bd9c2e..8afc64d6 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/dimensionSlide.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/dimensionSlide.js @@ -89,8 +89,8 @@ class DimensionSlide extends Component { if (dimType === "QUALITATIVE") { if (!setting4Qualitative || !extraParams.dimName) { Modal.warning({ - title: getLabel(111, "信息确认"), - content: getLabel(111, "必要信息不完整,红色*为必填项!") + title: getLabel(131329, "信息确认"), + content: getLabel(383779, "必要信息不完整,红色*为必填项!") }); return; } @@ -100,8 +100,8 @@ class DimensionSlide extends Component { } else { if (!extraParams.dimName) { Modal.warning({ - title: getLabel(111, "信息确认"), - content: getLabel(111, "必要信息不完整,红色*为必填项!") + title: getLabel(131329, "信息确认"), + content: getLabel(383779, "必要信息不完整,红色*为必填项!") }); return; } @@ -109,7 +109,7 @@ class DimensionSlide extends Component { const { setting4RationGroupSpacing } = this.state; const bool = _.every(setting4RationGroupSpacing, it => it.startValue !== "" && it.endValue !== "" && it.startValue <= it.endValue); if (_.isEmpty(setting4RationGroupSpacing) || !bool) { - message.warning(getLabel(111, "请完善分组设置相关数据!分组设置不能为空,起始值结束值必填,且起始值需小于结束值!")); + message.warning(getLabel(543318, "请完善分组设置相关数据!分组设置不能为空,起始值结束值必填,且起始值需小于结束值!")); return; } else { payload = { @@ -127,7 +127,7 @@ class DimensionSlide extends Component { const { setting4RationGroupIndividual } = this.state; const bool = _.every(setting4RationGroupIndividual, it => it.value !== ""); if (_.isEmpty(setting4RationGroupIndividual) || !bool) { - message.warning(getLabel(111, "请完善分组设置相关数据!分组设置不能为空,且数值必填")); + message.warning(getLabel(543319, "请完善分组设置相关数据!分组设置不能为空,且数值必填")); return; } else { payload = { @@ -141,11 +141,11 @@ class DimensionSlide extends Component { dimensionSave(payload).then(({ status, errormsg }) => { this.setState({ loading: false }); if (status) { - message.success(getLabel(111, "保存成功")); + message.success(getLabel(22619, "保存成功")); onCancel(true); this.props.form.resetForm(); } else { - message.error(errormsg || getLabel(111, "保存失败")); + message.error(errormsg || getLabel(22620, "保存失败")); } }).catch(() => this.setState({ loading: false })); }; @@ -176,15 +176,15 @@ class DimensionSlide extends Component { className="dimensionSlideWrapper" title={
- {formId ? getLabel(111, "编辑统计维度") : getLabel(111, "新建统计维度")} - + {formId ? getLabel(543407, "编辑统计维度") : getLabel(543314, "新建统计维度")} +
} > {getSearchs(form, condition, 1, false, this.formItemChange)} { dimType !== "QUALITATIVE" && - + { dimType === "RATION_GROUP_SPACING" && { Modal.confirm({ - title: getLabel(111, "信息确认"), - content: getLabel(111, "确认要删除吗?"), + title: getLabel(131329, "信息确认"), + content: getLabel(388758, "确认要删除吗?"), onOk: () => { dimensionDelete(payload).then(({ status, errormsg }) => { if (status) { - message.success(getLabel(111, "删除成功")); + message.success(getLabel(502230, "删除成功")); this.dimensionList(); } else { - message.error(errormsg || getLabel(111, "删除失败")); + message.error(errormsg || getLabel(20462, "删除失败")); } }); } @@ -67,7 +67,7 @@ class DimensionTable extends Component { const { onEdit } = this.props; const pagination = { ...pageInfo, - showTotal: total => `${getLabel(111, "共")} ${total} ${getLabel(111, "条")}`, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, showQuickJumper: true, showSizeChanger: true, pageSizeOptions: ["10", "20", "50", "100"], @@ -83,22 +83,22 @@ class DimensionTable extends Component { } }; const columns = [ - { dataIndex: "dimName", title: getLabel(111, "统计维度") }, - { dataIndex: "remark", title: getLabel(111, "描述") }, - { dataIndex: "dimType", title: getLabel(111, "维度类型") }, + { dataIndex: "dimName", title: getLabel(506800, "统计维度") }, + { dataIndex: "remark", title: getLabel(433, "描述") }, + { dataIndex: "dimType", title: getLabel(389137, "维度类型") }, { - dataIndex: "operate", title: getLabel(111, "操作"), + dataIndex: "operate", title: getLabel(30585, "操作"), render: (_, record) => { return ( { record.canEdit && - onEdit(record.id)}>{getLabel(111, "编辑")} + onEdit(record.id)}>{getLabel(501169, "编辑")} } { record.canDelete && this.dimensionDelete([record.id])}>{getLabel(111, "删除")} + onClick={() => this.dimensionDelete([record.id])}>{getLabel(535052, "删除")} } { record.dimName === getLabel(30042, "人员") && record.dimType === getLabel(111, "定性") && diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/employeeDetails.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/employeeDetails.js index 6429bba6..3b593604 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/employeeDetails.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/employeeDetails.js @@ -81,7 +81,7 @@ class EmployeeDetails extends Component { const { dataSource, loading, columns, pageInfo } = this.state; const pagination = { ...pageInfo, - showTotal: total => `${getLabel(111, "共")} ${total} ${getLabel(111, "条")}`, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, showQuickJumper: true, showSizeChanger: true, pageSizeOptions: ["10", "20", "50", "100"], diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/groupIndividualEditTable.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/groupIndividualEditTable.js index 1d709bc6..50b864b5 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/groupIndividualEditTable.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/groupIndividualEditTable.js @@ -32,7 +32,7 @@ class GroupIndividualEditTable extends Component { const { dataSource } = this.state; const columns = [ { - title: getLabel(111, "分组设置值"), + title: getLabel(543320, "分组设置值"), dataIndex: "value", key: "value", com: [ diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/groupSpacingEditTable.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/groupSpacingEditTable.js index c976cd93..3cb29022 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/groupSpacingEditTable.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/groupSpacingEditTable.js @@ -39,7 +39,7 @@ class GroupSpacingEditTable extends Component { const { dataSource } = this.state; const columns = [ { - title: getLabel(111, "起始值"), + title: getLabel(541412, "起始值"), dataIndex: "startValue", key: "startValue", com: [ @@ -47,19 +47,19 @@ class GroupSpacingEditTable extends Component { ] }, { - title: getLabel(111, "含"), + title: getLabel(33864, "含"), dataIndex: "includeStart", key: "includeStart", com: [ { type: "CHECKBOX", key: "includeStart", - otherParams: { content: getLabel(111, "含") } + otherParams: { content: getLabel(33864, "含") } } ] }, { - title: getLabel(111, "至"), + title: getLabel(15322, "至"), dataIndex: "to", key: "to", com: [ @@ -67,7 +67,7 @@ class GroupSpacingEditTable extends Component { ] }, { - title: getLabel(111, "结束值"), + title: getLabel(508931, "结束值"), dataIndex: "endValue", key: "endValue", com: [ @@ -75,14 +75,14 @@ class GroupSpacingEditTable extends Component { ] }, { - title: getLabel(111, "含"), + title: getLabel(33864, "含"), dataIndex: "includeEnd", key: "includeEnd", com: [ { type: "CHECKBOX", key: "includeEnd", - otherParams: { content: getLabel(111, "含") } + otherParams: { content: getLabel(33864, "含") } } ] } @@ -90,7 +90,7 @@ class GroupSpacingEditTable extends Component { return ( ({ ...item, to: getLabel(111, "至") }))} + datas={_.map(dataSource, item => ({ ...item, to: getLabel(15322, "至") }))} showCopy={false} onChange={this.handleChangeTableData} /> ); diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js index 586a1216..733a89cb 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js @@ -49,16 +49,16 @@ class ReportList extends Component { }; reportStatisticsReportDelete = (payload) => { Modal.confirm({ - title: getLabel(111, "信息确认"), - content: getLabel(111, "确认删除本条数据吗?"), + title: getLabel(131329, "信息确认"), + content: getLabel(543231, "确认删除本条数据吗?"), onOk: () => { const { reportName = "" } = this.props; reportStatisticsReportDelete(payload).then(({ status, errormsg }) => { if (status) { - message.success(getLabel(111, "删除成功")); + message.success(getLabel(502230, "删除成功")); this.reportStatisticsReportList({ reportName }); } else { - message.error(errormsg || getLabel(111, "删除失败")); + message.error(errormsg || getLabel(20462, "删除失败")); } }); } @@ -97,7 +97,7 @@ class ReportList extends Component {
{reportName}
-
{getLabel(111, "统计维度")}:
+
{getLabel(506800, "统计维度")}:
{dimension}
@@ -106,9 +106,9 @@ class ReportList extends Component { !isShare && this.handleOptsClick(e, id, dimensionId)}> - {getLabel(111, "编辑")} + {getLabel(501169, "编辑")} {getLabel(77, "复制")} - {getLabel(111, "删除")} + {getLabel(535052, "删除")} {getLabel(545781, "操作日志")} }> diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/statisticsModal.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/statisticsModal.js index d80b2877..2c792eae 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/statisticsModal.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/statisticsModal.js @@ -39,15 +39,15 @@ class StatisticsModal extends Component { this.setState({ loading: false }); if (status) { onCancel(true); - message.success(getLabel(111, "保存成功")); + message.success(getLabel(22619, "保存成功")); form.resetForm(); } else { - message.error(errormsg || getLabel(111, "保存失败")); + message.error(errormsg || getLabel(22620, "保存失败")); } }).catch(() => this.setState({ loading: false })); } else { Modal.warning({ - title: getLabel(111, "信息确认"), + title: getLabel(131329, "信息确认"), content: getLabel(111, "必要信息不完整,红色*为必填项!") }); } diff --git a/pc4mobx/hrmSalary/pages/bankVoucherDetail/index.js b/pc4mobx/hrmSalary/pages/bankVoucherDetail/index.js new file mode 100644 index 00000000..43916c7f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/bankVoucherDetail/index.js @@ -0,0 +1,494 @@ +/* + * Author: 黎永顺 + * name: 个税在线申报-银行端缴款凭证打印查看页面 + * Description: + * Date: 2023/8/24 + */ +import React, { Component } from "react"; +import { Button, message, Spin } from "antd"; +import { WeaLocaleProvider } from "ecCom"; +import { printDom } from "../../util"; +import { getQueryString } from "../../util/url"; +import { taxPaymentVoucherPrintFeedback } from "../../apis/declare"; +import "./index.less"; + +const { getLabel } = WeaLocaleProvider; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, + bankVoucherDetail: {} + }; + } + + componentDidMount() { + this.taxPaymentVoucherPrintFeedback(); + } + + taxPaymentVoucherPrintFeedback = () => { + const payload = { + taxDeclareRecordId: getQueryString("taxDeclareRecordId"), + taxAgentId: getQueryString("taxAgentId"), + taxYearMonth: getQueryString("taxYearMonth"), + checkFeedback: 0 + }; + this.setState({ loading: true }); + taxPaymentVoucherPrintFeedback(payload).then(({ status, data, errormsg }) => { + this.setState({ loading: false }); + if (status) { + this.setState({ bankVoucherDetail: data }); + } else { + message.error(errormsg || ""); + } + }).catch(() => this.setState({ loading: false })); + }; + print = () => { + printDom({ + hideDomId: "header_print_btn" + }); + }; + + render() { + const { loading, bankVoucherDetail } = this.state; + if (loading) { + return
+ +
; + } + return ( +
+
+
+ +
+
+
+
{getLabel(111, "银行端查询缴税凭证")}
+
+
+
{getLabel(111, "银行端查询缴税凭证号:")}
+
{bankVoucherDetail.voucherNo || ""}
+
+
{bankVoucherDetail.firstPrintDate}
+
+ +
+
+
+
{getLabel(111, "纳税人识别码")}
+
{bankVoucherDetail.taxCode || ""}
+
+
+
{getLabel(111, "税务机关代码")}
+
{bankVoucherDetail.taxAuthoritiesNo || ""}
+
+
+ +
+
+
{getLabel(111, "纳税人名称")}
+
{bankVoucherDetail.taxAgentName || ""}
+
+
+
{getLabel(111, "税务机关名称")}
+
{bankVoucherDetail.taxAuthoritiesName}
+
+
+ +
+
+
{getLabel(111, "付款人名称")}
+
{}
+
+
+
{getLabel(111, "开户银行名称")}
+
{}
+
+
+ +
+
+
{getLabel(111, "付款人账号")}
+
{}
+
+
+
{getLabel(111, "税款限缴日期")}
+
{bankVoucherDetail.deadline || ""}
+
+
+ +
+
+
{getLabel(111, "征收顶目名称")}
+
{getLabel(111, "征收品目名称")}
+
{getLabel(111, "应繳税额")}
+
+
+ { + !_.isEmpty(bankVoucherDetail.details) ? bankVoucherDetail.details.map((row, index) => ( +
+
{row.paymentCode}
+
{row.paymentItem}
+
{row.payAmount}
+
+ )) : null + } +
+
+
{getLabel(111, "金额合计(小写):")} {bankVoucherDetail.lowerFormatAmount}
+
{getLabel(111, "金额合计(大写):")} {bankVoucherDetail.upperFormatAmount}
+ +
+
+
{getLabel(111, "付款人 (签章)")}
+
{getLabel(111, "经办人 (签章)")}
+
+
+
{getLabel(111, "银行记账员")}
+
{getLabel(111, "(签章)")}
+
+
+
{getLabel(111, "备注:")}
+
{bankVoucherDetail.remark}
+
+
+
+
+
+
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/bankVoucherDetail/index.less b/pc4mobx/hrmSalary/pages/bankVoucherDetail/index.less new file mode 100644 index 00000000..3dc296ac --- /dev/null +++ b/pc4mobx/hrmSalary/pages/bankVoucherDetail/index.less @@ -0,0 +1,30 @@ +.loading-layout { + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; +} + +.printBankLayout { + width: 100%; + height: 100%; + overflow-y: auto; + + .print-bank-voucher-container { + font-size: 14px; + + #header_print_btn { + display: flex; + padding: calc(16 * 1px) calc(32 * 1px) 0; + justify-content: flex-end; + } + + .content { + padding: calc(32 * 1px) 0 calc(16 * 1px); + display: flex; + justify-content: center; + align-items: center; + } + } +} diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js index c7798e3f..0c12752c 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js @@ -92,7 +92,7 @@ class EditCalcTable extends Component { const { salarySobId } = this.props; const { lockStatus, salaryItemId } = payload; if (lockStatus === "DIAGRAM") { - window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/topologyView/${salarySobId}/${salaryItemId}`, "_blank"); + window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/topologyView/${salarySobId}/${salaryItemId}?type=ledger`, "_blank"); return; } Modal.confirm({ diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js index 6bfa4ca9..0661da26 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js @@ -12,6 +12,7 @@ import EditCalcAdvanceSearchPannel from "./editCalcAdvanceSearchPannel"; import EditCalcTable from "./editCalcTable"; import SalaryMonthTip from "../salaryMonthTip"; import SalaryCalcLayout from "./salaryCalcLayout"; +import PersonAbnormalDialog from "./personAbnormalDialog"; import cs from "classnames"; import "./index.less"; @@ -22,7 +23,8 @@ class Index extends Component { super(props); this.state = { salarySobCycle: {}, showSearchAd: false, - columnDesc: {}, formulaTd: "", showTotalCell: false + columnDesc: {}, formulaTd: "", showTotalCell: false, + perAbnormalDialog: { visible: false, salaryAcctRecordId: "" } }; } @@ -50,7 +52,7 @@ class Index extends Component { }; render() { - const { salarySobCycle, showSearchAd, formulaTd, columnDesc, showTotalCell } = this.state; + const { salarySobCycle, showSearchAd, formulaTd, columnDesc, showTotalCell, perAbnormalDialog } = this.state; const { routeParams: { salaryAcctRecordId } } = this.props; const formulaObj = _.get(columnDesc, [formulaTd]) || {}; return ( this.onAdSearch(false)}> @@ -65,7 +67,13 @@ class Index extends Component { style={{ marginLeft: 10 }} />
-
+
+
this.setState({ + perAbnormalDialog: { visible: true, salaryAcctRecordId } + })}>{getLabel(111, "未报送人员")}:{salarySobCycle.abnormalEmployeeNum} +
+
@@ -87,6 +95,10 @@ class Index extends Component { this.calcTableRef = dom} salarySobId={salarySobCycle.salarySobId} {...this.props} showTotalCell={showTotalCell} onShowFormulaTd={this.handleShowFormulaTa}/> + this.setState({ + perAbnormalDialog: { ...perAbnormalDialog, visible: false } + })}/>
); } diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less index 75d2f103..f9611c7f 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less @@ -14,6 +14,11 @@ padding-bottom: 0; height: 46px; margin-bottom: 0; + + .abnormal-text { + color: #ef9502; + cursor: pointer; + } } .formula-detail-area { diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/personAbnormalDialog.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/personAbnormalDialog.js new file mode 100644 index 00000000..34892f7b --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/personAbnormalDialog.js @@ -0,0 +1,84 @@ +/* + * Author: 黎永顺 + * name: 薪资核算-人员异常 + * Description: + * Date: 2023/8/18 + */ +import React, { Component } from "react"; +import { WeaDialog, WeaLocaleProvider, WeaTable } from "ecCom"; +import { listPage4NotDeclare } from "../../../../../apis/calculate"; + +const { getLabel } = WeaLocaleProvider; + +class PersonAbnormalDialog extends Component { + constructor(props) { + super(props); + this.state = { + pageInfo: { current: 1, pageSize: 10, total: 0 }, + loading: false, columns: [], dataSource: [] + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.queryList(nextProps); + } + + queryList = (props) => { + const { salaryAcctRecordId } = props, { pageInfo } = this.state; + const payload = { ...pageInfo, recordId: salaryAcctRecordId }; + this.setState({ loading: true }); + listPage4NotDeclare(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, columns + }); + } else { + + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { loading, columns, dataSource, pageInfo } = this.state; + 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.queryList(this.props)); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.queryList(this.props)); + } + }; + return ( + this.errorRef = dom} + style={{ + width: 1150, height: 606.6, minHeight: 200, minWidth: 380, maxHeight: "90%", + maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" + }} + > +
+ +
+
+ ); + } +} + +export default PersonAbnormalDialog; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js index 4f4944c7..a8280592 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js @@ -9,12 +9,7 @@ import { WeaLocaleProvider, WeaReqTop } from "ecCom"; import { Button, Dropdown, Menu, message, Modal } from "antd"; import { inject, observer } from "mobx-react"; import Layout from "./layout"; -import { - acctresultAccounting, - getApprovalInfoByRecordId, - getCalculateProgress, - getExportField -} from "../../../apis/calculate"; +import * as API from "../../../apis/calculate"; import AdvanceInputBtn from "./components/advanceInputBtn"; import SalaryCalcPersonConfirm from "./components/salaryCalcPersonConfirm"; import SalaryEditCalc from "./components/salaryEditCalc"; @@ -32,7 +27,7 @@ class Index extends Component { constructor(props) { super(props); this.state = { - selectedKey: "person", progressVisible: false, progress: 0, + selectedKey: "person", progressVisible: false, progress: 0, loading: { calcTax: false, feedback: false }, customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] }, salaryImpDialog: { visible: false, title: "", salaryAcctRecordId: "" }, approvalInfo: {},//审批信息, @@ -45,7 +40,7 @@ class Index extends Component { init = () => { const { routeParams: { salaryAcctRecordId } } = this.props; - getApprovalInfoByRecordId({ salaryAcctRecordId }).then(({ status, data: approvalInfo }) => { + API.getApprovalInfoByRecordId({ salaryAcctRecordId }).then(({ status, data: approvalInfo }) => { if (status) this.setState({ approvalInfo }); }); }; @@ -72,11 +67,11 @@ class Index extends Component { this.setState({ progress: 0 }); let payload = { salaryAcctRecordId }; if (key === "calc_selected") payload = _.assign(payload, { ids: selectedRowKeys }); - acctresultAccounting(payload).then(() => { + API.acctresultAccounting(payload).then(() => { this.setState({ progressVisible: true }); if (this.timer) clearInterval(this.timer); this.timer = setInterval(() => { - getCalculateProgress(salaryAcctRecordId).then(({ data }) => { + API.getCalculateProgress(salaryAcctRecordId).then(({ data }) => { let progress = data.progress; if (progress === 1 && this.timer) { clearInterval(this.timer); @@ -113,7 +108,7 @@ class Index extends Component { window.open(`${window.ecologyContentPath || ""}${url}`, "_blank"); break; case "export_custom": - getExportField({ salaryAcctRecordId }).then(({ status, data }) => { + API.getExportField({ salaryAcctRecordId }).then(({ status, data }) => { if (status) { const { checkItems, itemsByGroup } = data; this.setState({ @@ -150,9 +145,72 @@ class Index extends Component { break; } }; + acctresultCalcTax = () => { + const { routeParams: { salaryAcctRecordId } } = this.props; + this.setState({ loading: { ...this.state.loading, calcTax: true } }); + API.acctresultCalcTax({ salaryAcctRecordId }).then(({ status, errormsg }) => { + this.setState({ loading: { ...this.state.loading, calcTax: false } }); + if (status) { + message.success(getLabel(111, "操作成功!")); + this.calc.onAdSearch(false); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: { ...this.state.loading, calcTax: false } })); + }; + calcTaxFeedback = () => { + const { routeParams: { salaryAcctRecordId } } = this.props; + this.setState({ loading: { ...this.state.loading, feedback: true } }); + API.calcTaxFeedback({ salaryAcctRecordId }).then(({ status, errormsg }) => { + this.setState({ loading: { ...this.state.loading, feedback: false } }); + if (status) { + this.calc.onAdSearch(false); + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "成功获取个税信息,是否继续计算税后工资?"), + onOk: () => this.afterTaxAccounting() + }); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: { ...this.state.loading, feedback: false } })); + }; + afterTaxAccounting = () => { + const { routeParams: { salaryAcctRecordId } } = this.props; + this.setState({ progress: 0 }); + let payload = { salaryAcctRecordId }; + API.afterTaxAccounting(payload).then(() => { + this.setState({ progressVisible: true }); + if (this.timer) clearInterval(this.timer); + this.timer = setInterval(() => { + API.getAfterTaxAccountingProgress(salaryAcctRecordId).then(({ data }) => { + let progress = data.progress; + if (progress === 1 && this.timer) { + clearInterval(this.timer); + this.timer = null; + this.setState({ + progressVisible: false, + accountExceptInfo: data.message + }); + message.success(getLabel(111, "操作完成")); + this.calc.onAdSearch(false); + } else if (!data.status) { + clearInterval(this.timer); + this.timer = null; + this.setState({ + progressVisible: false, + accountExceptInfo: data.message + }); + message.error(data.message); + } + this.setState({ progress: Number(progress) * 100 }); + }); + }, 1000); + }); + }; renderReqBtns = () => { const { routeParams: { salaryAcctRecordId } } = this.props; - const { selectedKey, accountExceptInfo, approvalInfo } = this.state; + const { selectedKey, accountExceptInfo, approvalInfo, loading } = this.state; const { isOpenApproval, approvalWorkflowUrl, canEdit } = approvalInfo; let reqBtns = []; switch (selectedKey) { @@ -176,6 +234,10 @@ class Index extends Component { this.doCacl("ALL")} overlay={menu} type="primary"> {getLabel(543545, "核算所有人")} , + , + , , this.calc.openAdvanceSearch()} onAdvanceSearch={() => this.calc.onAdSearch(false)}/> diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js b/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js index a3a98e5e..e519037f 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/addItems.js @@ -5,7 +5,9 @@ */ import React, { Component } from "react"; import { WeaBrowser, WeaFormItem } from "ecCom"; -import { getDomkes, getSearchs } from "../../util"; +import { WeaSwitch } from "comsMobx"; +import { getDomkes, toDecimal_n } from "../../util"; +import FormInfo from "../../components/FormInfo"; import "./index.less"; class AddItems extends Component { @@ -60,9 +62,207 @@ class AddItems extends Component { render() { const { form, condition = [] } = this.props; + const itemRender = { + // 累计专项附加扣除 + addUpChildEducation: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ addUpChildEducation: { value: toDecimal_n(v, 2) } })}/>); + }, + addUpContinuingEducation: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ addUpContinuingEducation: { value: toDecimal_n(v, 2) } })}/>); + }, + addUpHousingLoanInterest: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ addUpHousingLoanInterest: { value: toDecimal_n(v, 2) } })}/>); + }, + addUpHousingRent: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ addUpHousingRent: { value: toDecimal_n(v, 2) } })}/>); + }, + addUpSupportElderly: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ addUpSupportElderly: { value: toDecimal_n(v, 2) } })}/>); + }, + addUpIllnessMedical: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ addUpIllnessMedical: { value: toDecimal_n(v, 2) } })}/>); + }, + addUpInfantCare: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ addUpInfantCare: { value: toDecimal_n(v, 2) } })}/>); + }, + //专项附加扣除 + childrenEducation: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ childrenEducation: { value: toDecimal_n(v, 2) } })}/>); + }, + continuingEducation: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ continuingEducation: { value: toDecimal_n(v, 2) } })}/>); + }, + housingLoanInterest: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ housingLoanInterest: { value: toDecimal_n(v, 2) } })}/>); + }, + housingRent: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ housingRent: { value: toDecimal_n(v, 2) } })}/>); + }, + supportingElder: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ supportingElder: { value: toDecimal_n(v, 2) } })}/>); + }, + seriousIllnessTreatment: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ seriousIllnessTreatment: { value: toDecimal_n(v, 2) } })}/>); + }, + infantCare: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ infantCare: { value: toDecimal_n(v, 2) } })}/>); + }, + //往期累计情况(工资、薪金) + addUpIncome: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ addUpIncome: { value: toDecimal_n(v, 2) } })}/>); + }, + addUpSubtraction: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ addUpSubtraction: { value: toDecimal_n(v, 2) } })}/>); + }, + addUpSocialSecurityTotal: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ addUpSocialSecurityTotal: { value: toDecimal_n(v, 2) } })}/>); + }, + addUpAccumulationFundTotal: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ addUpAccumulationFundTotal: { value: toDecimal_n(v, 2) } })}/>); + }, + addUpEnterpriseAndOther: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ addUpEnterpriseAndOther: { value: toDecimal_n(v, 2) } })}/>); + }, + addUpOtherDeduction: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ addUpOtherDeduction: { value: toDecimal_n(v, 2) } })}/>); + }, + addUpTaxExemptIncome: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ addUpTaxExemptIncome: { value: toDecimal_n(v, 2) } })}/>); + }, + addUpAllowedDonation: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ addUpAllowedDonation: { value: toDecimal_n(v, 2) } })}/>); + }, + addUpTaxSavings: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ addUpTaxSavings: { value: toDecimal_n(v, 2) } })}/>); + }, + addUpAdvanceTax: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ addUpAdvanceTax: { value: toDecimal_n(v, 2) } })}/>); + }, + actualAddUpAdvanceTax: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ actualAddUpAdvanceTax: { value: toDecimal_n(v, 2) } })}/>); + }, + taxAdjustment: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ taxAdjustment: { value: toDecimal_n(v, 2) } })}/>); + }, + addUpTaxableIncome: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ addUpTaxableIncome: { value: toDecimal_n(v, 2) } })}/>); + }, + // 其他免税扣除 + freeIncome: (field, textAreaProps, form, formParams) => { + return ( + v && form.updateFields({ freeIncome: { value: toDecimal_n(v, 2) } })}/> + {field.extraDom && field.extraDom} + ); + }, + businessHealthyInsurance: (field, textAreaProps, form, formParams) => { + return ( + v && form.updateFields({ businessHealthyInsurance: { value: toDecimal_n(v, 2) } })}/> + {field.extraDom && field.extraDom} + ); + }, + taxDelayEndowmentInsurance: (field, textAreaProps, form, formParams) => { + return ( + v && form.updateFields({ taxDelayEndowmentInsurance: { value: toDecimal_n(v, 2) } })}/> + {field.extraDom && field.extraDom} + ); + }, + deductionAllowedDonation: (field, textAreaProps, form, formParams) => { + return ( + v && form.updateFields({ deductionAllowedDonation: { value: toDecimal_n(v, 2) } })}/> + {field.extraDom && field.extraDom} + ); + }, + derateDeduction: (field, textAreaProps, form, formParams) => { + return ( + v && form.updateFields({ derateDeduction: { value: toDecimal_n(v, 2) } })}/> + {field.extraDom && field.extraDom} + ); + }, + otherDeduction: (field, textAreaProps, form, formParams) => { + return ( + v && form.updateFields({ otherDeduction: { value: toDecimal_n(v, 2) } })}/> + {field.extraDom && field.extraDom} + ); + }, + privatePension: (field, textAreaProps, form, formParams) => { + return ( + v && form.updateFields({ privatePension: { value: toDecimal_n(v, 2) } })}/> + {field.extraDom && field.extraDom} + ); + } + }; return (
- {getSearchs(form, condition, 2, false)} + 若此员工数据已存在在同期列表中,则当前数据保存后会覆盖列表数据
); diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js index fb50fd4c..f63bc98e 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js @@ -140,6 +140,37 @@ export const dataCollectCondition = [ ]; +export const cumTaxPeriodCondition = [ + { + items: [{ + colSpan: 1, + conditionType: "MONTHPICKER", + domkey: ["declareMonth"], + fieldcol: 18, + label: "税款所属期", + lanId: 542240, + labelcol: 6, + 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 new file mode 100644 index 00000000..ddf7a5eb --- /dev/null +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog.js @@ -0,0 +1,99 @@ +/* + * Author: 黎永顺 + * name: 个税对接-在线获取 + * Description: + * Date: 2023/9/5 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; +import { Button, message } from "antd"; +import { getSearchs } from "../../../../util"; +import { cumTaxPeriodCondition } from "../columns"; +import { onlineRequest } from "../../../../apis/cumDeduct"; +import { onlineActualAddUpAdvanceTax } from "../../../../apis/cumSituation"; +import { postFetch } from "../../../../util/request"; + +const getLabel = WeaLocaleProvider.getLabel; +const getKey = WeaTools.getKey; +const APIFox = { + online: onlineRequest, + advance: onlineActualAddUpAdvanceTax +}; + +@inject("cumDeductStore") +@observer +class SalaryCumDeductChooseTaxPeriodDialog extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, conditions: [] + }; + } + + async componentWillReceiveProps(nextProps, nextContext) { + const { cumDeductStore: { cumTaxPeriodForm, changeCumTaxPeriodForm } } = nextProps; + if (nextProps.visible !== this.props.visible && nextProps.visible) { + const { data } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }); + 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: _.map(data, g => ({ key: String(g.id), showname: g.name })) + }; + } + return { ...o, lable: getLabel(o.lanId, o.label) }; + }) + })) + }); + cumTaxPeriodForm.initFormFields(cumTaxPeriodCondition); + } + if (nextProps.visible !== this.props.visible && !nextProps.visible) { + cumTaxPeriodForm.resetForm(); + changeCumTaxPeriodForm(); + } + } + + save = () => { + const { cumDeductStore: { cumTaxPeriodForm }, type } = this.props; + cumTaxPeriodForm.validateForm().then(f => { + const { declareMonth, taxAgentIds } = cumTaxPeriodForm.getFormParams(); + if (f.isValid) { + this.setState({ loading: true }); + 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(); + } + }); + }; + + render() { + const { loading, conditions } = this.state; + const { cumDeductStore: { cumTaxPeriodForm } } = this.props; + return ( + {getLabel(33703, "确认")}]} + bottomLeft={getLabel(111, "点击保存后,稍后请点击【获取结果下载】下载获取结果。获取的数据将覆盖列表原本数据(有则覆盖无则新增)。")} + > +
+ {getSearchs(cumTaxPeriodForm, conditions, 1, false)} +
+
+ ); + } +} + +export default SalaryCumDeductChooseTaxPeriodDialog; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index 7b1bf8ff..171944e7 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -19,8 +19,10 @@ import { editAddUpDeduction, getAddUpDeduction, getCumDeductSaCondition, - importCumDeductParam + importCumDeductParam, + onlineFeedback } from "../../../apis/cumDeduct"; +import { apiflowBillingConfigStatus } from "../../../apis/intelligentCalculateSalarySettings"; import DataTables from "../dataTables"; import AddItems from "../addItems"; import ImportFormCom from "./components/importFormCom"; @@ -32,11 +34,12 @@ import { postFetch } from "../../../util/request"; import { getDomkes } from "../../../util"; import Layout from "../layout"; import moment from "moment"; +import SalaryCumDeductChooseTaxPeriodDialog from "./components/salaryCumDeductChooseTaxPeriodDialog"; -const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; +const getKey = WeaTools.getKey; -@inject("taxAgentStore", "cumDeductStore") +@inject("cumDeductStore") @observer class Index extends Component { constructor(props) { @@ -68,7 +71,12 @@ class Index extends Component { exportPayloadType: false, advanceCondition: null, targetid: "", - taxAgentOption: [] + taxAgentOption: [], + cumTaxPeriodDialog: { + visible: false, title: "", type: "" + }, + feedbackLoading: false, + incomeTaxStatus: false }; this.tableRef = null; this.addItemRef = null; @@ -77,8 +85,14 @@ class Index extends Component { componentDidMount() { this.getAdvanceCondition(); + this.apiflowBillingConfigStatus(); } + apiflowBillingConfigStatus = () => { + apiflowBillingConfigStatus().then(({ status, data }) => { + this.setState({ incomeTaxStatus: status && data }); + }); + }; /* * Author: 黎永顺 * Description:一键累计 @@ -395,8 +409,8 @@ class Index extends Component { * Date: 2023/2/17 */ getTopBtns = () => { - const { addAllLoading } = this.state; - return [ + const { addAllLoading, cumTaxPeriodDialog, feedbackLoading, incomeTaxStatus } = this.state; + const commonBtns = [ , , , @@ -413,6 +427,18 @@ class Index extends Component { ]; + const incomeTaxBtns = [ + , + + ]; + return incomeTaxStatus ? [...incomeTaxBtns, ...commonBtns] : commonBtns; }; handleDataMenuClick = ({ key: keyFunc }) => this[keyFunc](); /* @@ -505,11 +531,30 @@ class Index extends Component { }); }; + onlineFeedback = () => { + this.setState({ feedbackLoading: true }); + onlineFeedback().then(({ status, data, errormsg }) => { + this.setState({ feedbackLoading: false }); + if (status) { + if (data.finish) { + message.success(getLabel(111, "获取成功!")); + this.tableRef.getTableDate(); + } else { + message.warning(data.msg); + } + } else { + message.error(errormsg); + } + }).catch((error) => { + this.setState({ feedbackLoading: false }); + }); + }; + render() { const { cumDeductStore: { form } } = this.props; const { declareMonth, taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition, - importPayload, exportPayloadType, targetid + importPayload, exportPayloadType, cumTaxPeriodDialog, targetid } = this.state; const tablePayload = { declareMonth: [declareMonth], taxAgentIds: taxAgentId ? taxAgentId.split(",") : [] }; return ( @@ -531,6 +576,12 @@ class Index extends Component { onViewDetails={(record) => this.handleAddData("累计专项附加扣除记录", record)} form={form} /> + this.setState({ + cumTaxPeriodDialog: { ...cumTaxPeriodDialog, visible: false, title: "", type: "" } + })} + /> ); } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js index 4fb2d80f..d978e48a 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js @@ -117,66 +117,68 @@ export const dataCollectCondition = [ precision: 2, viewAttr: 2 }, - { - conditionType: "INPUTNUMBER", - domkey: ["addUpChildEducation"], - fieldcol: 14, - label: "累计子女教育", - labelcol: 8, - value: "", - precision: 2, - viewAttr: 2 - }, - { - conditionType: "INPUTNUMBER", - domkey: ["addUpContinuingEducation"], - fieldcol: 14, - label: "累计继续教育", - labelcol: 8, - value: "", - precision: 2, - viewAttr: 2 - }, - { - conditionType: "INPUTNUMBER", - domkey: ["addUpHousingLoanInterest"], - fieldcol: 14, - label: "累计住房贷款利息", - labelcol: 8, - value: "", - precision: 2, - viewAttr: 2 - }, - { - conditionType: "INPUTNUMBER", - domkey: ["addUpHousingRent"], - fieldcol: 14, - label: "累计住房租金", - labelcol: 8, - value: "", - precision: 2, - viewAttr: 2 - }, - { - conditionType: "INPUTNUMBER", - domkey: ["addUpSupportElderly"], - fieldcol: 14, - label: "累计赡养老人", - labelcol: 8, - value: "", - precision: 2, - viewAttr: 2 - }, - { - conditionType: "INPUTNUMBER", - domkey: ["addUpIllnessMedical"], - fieldcol: 14, - label: "累计大病医疗", - labelcol: 8, - value: "", - precision: 2, - viewAttr: 2 - }, + + // { + // conditionType: "INPUTNUMBER", + // domkey: ["addUpChildEducation"], + // fieldcol: 14, + // label: "累计子女教育", + // labelcol: 8, + // value: "", + // precision: 2, + // viewAttr: 2 + // }, + // { + // conditionType: "INPUTNUMBER", + // domkey: ["addUpContinuingEducation"], + // fieldcol: 14, + // label: "累计继续教育", + // labelcol: 8, + // value: "", + // precision: 2, + // viewAttr: 2 + // }, + // { + // conditionType: "INPUTNUMBER", + // domkey: ["addUpHousingLoanInterest"], + // fieldcol: 14, + // label: "累计住房贷款利息", + // labelcol: 8, + // value: "", + // precision: 2, + // viewAttr: 2 + // }, + // { + // conditionType: "INPUTNUMBER", + // domkey: ["addUpHousingRent"], + // fieldcol: 14, + // label: "累计住房租金", + // labelcol: 8, + // value: "", + // precision: 2, + // viewAttr: 2 + // }, + // { + // conditionType: "INPUTNUMBER", + // domkey: ["addUpSupportElderly"], + // fieldcol: 14, + // label: "累计赡养老人", + // labelcol: 8, + // value: "", + // precision: 2, + // viewAttr: 2 + // }, + // { + // conditionType: "INPUTNUMBER", + // domkey: ["addUpIllnessMedical"], + // fieldcol: 14, + // label: "累计大病医疗", + // labelcol: 8, + // value: "", + // precision: 2, + // viewAttr: 2 + // }, + { conditionType: "INPUTNUMBER", domkey: ["addUpEnterpriseAndOther"], @@ -239,14 +241,48 @@ export const dataCollectCondition = [ }, { conditionType: "INPUTNUMBER", - domkey: ["addUpInfantCare"], + domkey: ["actualAddUpAdvanceTax"], fieldcol: 14, - label: "累计婴幼儿照护", + label: "实际累计已预扣预缴税额", + labelcol: 8, + value: "", + precision: 2, + viewAttr: 2 + }, + { + conditionType: "INPUTNUMBER", + domkey: ["taxAdjustment"], + fieldcol: 14, + label: "个税调差", + helpfulTip: "1、【个税调差】=【实际累计已预扣预缴税额】-【累计已预扣预缴税额】。\n" + + "2、直接输入或导入【个税调差】值,则以输入/导入为准,公式失效。再次编辑减数或被减数,会再次按公式自动计算。", + helpfulTipLanId: 111, + labelcol: 8, + value: "", + precision: 2, + viewAttr: 2 + }, + { + conditionType: "INPUTNUMBER", + domkey: ["addUpTaxableIncome"], + fieldcol: 14, + label: "累计应纳税所得额", labelcol: 8, value: "", precision: 2, viewAttr: 2 } + + // { + // conditionType: "INPUTNUMBER", + // domkey: ["addUpInfantCare"], + // fieldcol: 14, + // label: "累计婴幼儿照护", + // labelcol: 8, + // value: "", + // precision: 2, + // viewAttr: 2 + // } ], title: "数据采集", defaultshow: true, diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index dbd9da42..d47812a9 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -17,6 +17,7 @@ import { getCumSituationSaCondition, importCumSituationParam } from "../../../apis/cumSituation"; +import { apiflowBillingConfigStatus } from "../../../apis/intelligentCalculateSalarySettings"; import { removePropertyCondition } from "../../../util/response"; import DataTables from "../dataTables"; import Layout from "../layout"; @@ -28,10 +29,11 @@ import AddItems from "../addItems"; import TableRecord from "../components/tableRecord"; import { convertToUrlString } from "../../../util/url"; import { postFetch } from "../../../util/request"; +import SalaryCumDeductChooseTaxPeriodDialog from "../cumDeduct/components/salaryCumDeductChooseTaxPeriodDialog"; import { getDomkes } from "../../../util"; -const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; +const getKey = WeaTools.getKey; @inject("taxAgentStore", "cumSituationStore") @observer @@ -65,7 +67,11 @@ class Index extends Component { exportPayloadType: false, advanceCondition: null, targetid: "", - taxAgentOption: [] + taxAgentOption: [], + incomeTaxStatus: false, + cumTaxPeriodDialog: { + visible: false, title: "", type: "" + }, }; this.tableRef = null; this.addItemRef = null; @@ -74,8 +80,14 @@ class Index extends Component { componentDidMount() { this.getAdvanceCondition(); + this.apiflowBillingConfigStatus(); } + apiflowBillingConfigStatus = () => { + apiflowBillingConfigStatus().then(({ status, data }) => { + this.setState({ incomeTaxStatus: status && data }); + }); + }; /* * Author: 黎永顺 * Description: 高级搜素框-表单项 @@ -298,6 +310,29 @@ class Index extends Component { exportPayloadUrl: `${window.location.origin}/api/bs/hrmsalary/addUpSituation/export?ids=${ids.join(",")}&year=${year}&taxYearMonth=${year}-${declareMonth}&taxAgentId=${taxAgentId}` }); }; + /* + * Author: 黎永顺 + * Description: 个税相关-在线获取 + * Params: + * Date: 2023/9/6 + */ + handleOnlineAccess = () => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "确定要在线获取税局数据更新实际累计已预扣预缴税额?\n" + + "此操作会依据实际累计已预扣预缴税额自动计算个税调差,不可回退,可重复获取,每次获取后重复数据会进行覆盖处理。"), + onOk: this.onlineActualAddUpAdvanceTax + }); + }; + onlineActualAddUpAdvanceTax = () => { + this.setState({ + cumTaxPeriodDialog: { + ...this.state.cumTaxPeriodDialog, + visible: true, type: "advance", + title: getLabel(542240, "税款所属期") + } + }); + }; /* * Author: 黎永顺 * Description: 顶部操作按钮 @@ -305,9 +340,10 @@ class Index extends Component { * Date: 2023/2/17 */ getTopBtns = () => { - const { addAllLoading } = this.state; - return [ + const { addAllLoading, incomeTaxStatus } = this.state; + const commonBtns = [ , + // , , 更多 ]; + return incomeTaxStatus ? commonBtns : _.filter(commonBtns, (__, index) => index !== 1); }; handleDataMenuClick = ({ key: keyFunc }) => this[keyFunc](); /* @@ -502,10 +539,10 @@ class Index extends Component { }; render() { - const { taxAgentStore: { showOperateBtn }, cumSituationStore: { form } } = this.props; + const { taxAgentStore: { showOperateBtn, taxAgentOption }, cumSituationStore: { form } } = this.props; const { declareMonth, taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition, - importPayload, year, exportPayloadType, targetid + importPayload, year, exportPayloadType, cumTaxPeriodDialog, targetid } = this.state; const tablePayload = { taxYearMonth: `${year}-${declareMonth}`, year, taxAgentId }; return ( @@ -520,6 +557,12 @@ class Index extends Component { importPayload={{ ...importPayload, importOpts: { taxYearMonth: importPayload.importOpts.declareMonth } }} targetid={targetid} onClearTargrtid={() => this.setState({ targetid: "" })} > + this.setState({ + cumTaxPeriodDialog: { ...cumTaxPeriodDialog, visible: false, title: "", type: "" } + })} + /> this.tableRef = dom} url="/api/bs/hrmsalary/addUpSituation/list" diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/index.less b/pc4mobx/hrmSalary/pages/dataAcquisition/index.less index 8b4093da..4d41fa25 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/index.less +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/index.less @@ -35,6 +35,18 @@ background: #FFF; margin: 0 16px; } + + .extra_tax { + position: absolute; + top: 50%; + margin-top: -8px; + right: -20px; + + i { + color: #2db7f5; + font-size: 16px; + } + } } .layoutWrapper { diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/layout.js b/pc4mobx/hrmSalary/pages/dataAcquisition/layout.js index efd888c6..9fd09ccf 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/layout.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/layout.js @@ -90,7 +90,7 @@ class Layout extends Component { const { showSearchAd, logDialogVisible, filterConditions } = this.state; const { title, btns, leftComp, children, taxAgentStore: { PageAndOptAuth }, - slidePayload, onClose, form, condition, onImportFile, + slidePayload, onClose, form, condition, onImportFile, tabBtns = [], onAdSearch, onCancel, importPayload, logFunction, onClearTargrtid } = this.props; const { visible, children: slideChildren } = slidePayload; @@ -123,6 +123,7 @@ class Layout extends Component { onSearch={onAdSearch} onSearchChange={(v) => form.updateFields({ username: v })} searchsBaseValue={form.getFormParams().username} + buttons={showOperateBtn ? tabBtns : []} />
{children} diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js index 92237ee8..ef7f4489 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js @@ -62,9 +62,22 @@ export const dataCollectCondition = [ }, { items: [ + { + conditionType: "INPUTNUMBER", + domkey: ["freeIncome"], + dataType: "freeIncome", + fieldcol: 14, + label: "免税收入", + labelcol: 8, + value: "", + precision: 2, + viewAttr: 2, + extraDom: null + }, { conditionType: "INPUTNUMBER", domkey: ["businessHealthyInsurance"], + dataType: "healthInsurance", fieldcol: 14, label: "商业健康保险", labelcol: 8, @@ -75,6 +88,7 @@ export const dataCollectCondition = [ { conditionType: "INPUTNUMBER", domkey: ["taxDelayEndowmentInsurance"], + dataType: "endowmentInsurance", fieldcol: 14, label: "税延养老保险", labelcol: 8, @@ -82,19 +96,10 @@ export const dataCollectCondition = [ precision: 2, viewAttr: 2 }, - { - conditionType: "INPUTNUMBER", - domkey: ["otherDeduction"], - fieldcol: 14, - label: "其他", - labelcol: 8, - value: "", - precision: 2, - viewAttr: 2 - }, { conditionType: "INPUTNUMBER", domkey: ["deductionAllowedDonation"], + dataType: "grantDonation", fieldcol: 14, label: "准予扣除的捐赠额", labelcol: 8, @@ -102,9 +107,32 @@ export const dataCollectCondition = [ precision: 2, viewAttr: 2 }, + { + conditionType: "INPUTNUMBER", + domkey: ["derateDeduction"], + dataType: "derateDeduction", + fieldcol: 14, + label: "减免税额", + labelcol: 8, + value: "", + precision: 2, + viewAttr: 2 + }, + { + conditionType: "INPUTNUMBER", + domkey: ["otherDeduction"], + dataType: "otherDerateDeduction", + fieldcol: 14, + label: "其他", + labelcol: 8, + value: "", + precision: 2, + viewAttr: 2 + }, { conditionType: "INPUTNUMBER", domkey: ["privatePension"], + dataType: "personalPension", fieldcol: 14, label: "个人养老金", labelcol: 8, @@ -118,8 +146,493 @@ export const dataCollectCondition = [ col: 2 } ]; - - - - - +export const taxDetailSettingsConditions = { + freeIncome: [{ + items: [ + { + conditionType: "SELECT", + domkey: ["incomeCategory"], + fieldcol: 14, + label: "所得项目", + lanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUT", + domkey: ["freeItem"], + fieldcol: 14, + label: "免税事项", + lanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUT", + domkey: ["freeProperty"], + fieldcol: 14, + label: "免税性质", + lanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUTNUMBER", + domkey: ["freeAmount"], + fieldcol: 14, + label: "免税金额", + lanId: 111, + labelcol: 8, + value: "", + rules: "required", + precision: 2, + viewAttr: 3 + } + ], + title: "", + defaultshow: true, + col: 1 + }], + healthInsurance: [{ + items: [ + { + conditionType: "SELECT", + domkey: ["incomeCategory"], + fieldcol: 14, + label: "所得项目", + lanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUT", + domkey: ["identificationNumber"], + fieldcol: 14, + label: "税优识别码", + lanId: 111, + helpfulTip: "为确保税收优惠商业健康保险保单的唯一性、真实性和有效性,由商业健康保险信息平台按照“一人一单一码”的原则进行核发,填写个人保单凭证上打印的数字识别码。", + helpfulTipLanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "DATEPICKER", + domkey: ["effectiveDate"], + fieldcol: 14, + label: "保单生效日期", + lanId: 111, + helpfulTip: "该商业健康保险保单生效的日期。", + helpfulTipLanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUTNUMBER", + domkey: ["yearPremium"], + fieldcol: 14, + label: "年度保费", + lanId: 111, + helpfulTip: "商业健康保险保单年度内该保单的总保费。", + helpfulTipLanId: 111, + labelcol: 8, + value: "", + rules: "required", + precision: 2, + viewAttr: 3 + }, + { + conditionType: "INPUTNUMBER", + domkey: ["monthPremium"], + fieldcol: 14, + label: "月度保费", + lanId: 111, + helpfulTip: "月缴费的保单填写每月所缴保费,按年一次性缴费的保单填写年度保费除以12后的金额。", + helpfulTipLanId: 111, + labelcol: 8, + value: "", + rules: "required", + precision: 2, + viewAttr: 3 + }, + { + conditionType: "INPUTNUMBER", + domkey: ["currentDeduction"], + fieldcol: 14, + label: "本期扣除金额", + lanId: 111, + helpfulTip: "根据国家有关政策对个人购买或单位统一购买符合规定的商业健康保险产品的支出,扣除限额为2400。", + helpfulTipLanId: 111, + labelcol: 8, + value: "", + rules: "required", + precision: 2, + viewAttr: 3 + } + ], + title: "", + defaultshow: true, + col: 1 + }], + endowmentInsurance: [{ + items: [ + { + conditionType: "SELECT", + domkey: ["incomeCategory"], + fieldcol: 14, + label: "所得项目", + lanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "MONTHPICKER", + domkey: ["deductionMonth"], + fieldcol: 14, + label: "申报扣除月份", + lanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUT", + domkey: ["accountNumber"], + fieldcol: 14, + label: "税延养老账户编号", + lanId: 111, + helpfulTip: "按照中国保险信息技术管理有限责任公司相关信息平台出具的《个人税收递延型商业养老保险扣除凭证》载明的对应项目填写。", + helpfulTipLanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUT", + domkey: ["checkCode"], + fieldcol: 14, + label: "报税校验码", + lanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUTNUMBER", + domkey: ["yearPremium"], + fieldcol: 14, + label: "年度保费", + lanId: 111, + labelcol: 8, + value: "", + rules: "required", + precision: 2, + viewAttr: 3 + }, + { + conditionType: "INPUTNUMBER", + domkey: ["monthPremium"], + fieldcol: 14, + label: "月度保费", + lanId: 111, + helpfulTip: "取得工资薪金所得、连续性劳务报酬所得(特定行业除外)的个人,填写《个人税收递延型商业养老保险扣除凭证》载明的月度保费金额,一次性缴费的保单填写月平均保费金额。", + helpfulTipLanId: 111, + labelcol: 8, + value: "", + rules: "required", + precision: 2, + viewAttr: 3 + }, + { + conditionType: "INPUTNUMBER", + domkey: ["currentDeduction"], + fieldcol: 14, + label: "本期扣除金额", + lanId: 111, + helpfulTip: "取得工资薪金所得的个人,应按税延养老保险扣除凭证记载的当月金额和扣除限额孰低的方法计算可扣除额。扣除限额按照申报扣除当月的工资薪金的 6%和1000元孰低的办法确定。", + helpfulTipLanId: 111, + labelcol: 8, + value: "", + rules: "required", + precision: 2, + viewAttr: 3 + } + ], + title: "", + defaultshow: true, + col: 1 + }], + grantDonation: [{ + items: [ + { + conditionType: "SELECT", + domkey: ["incomeCategory"], + fieldcol: 14, + label: "所得项目", + lanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUT", + domkey: ["recipientName"], + fieldcol: 14, + label: "受赠单位名称", + lanId: 111, + helpfulTip: "受赠单位名称填写受赠单位的法定名称全称。", + helpfulTipLanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUT", + domkey: ["taxCode"], + fieldcol: 14, + label: "受赠单位纳税人识别号", + lanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUT", + domkey: ["donationNumber"], + fieldcol: 14, + label: "捐赠凭证号", + lanId: 111, + helpfulTip: "捐赠凭证", + helpfulTipLanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "DATEPICKER", + domkey: ["donateDate"], + fieldcol: 14, + label: "捐赠日期", + lanId: 111, + helpfulTip: "填写个人发生的公益慈善事业捐赠的具体日期。", + helpfulTipLanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUTNUMBER", + domkey: ["donateAmount"], + fieldcol: 14, + label: "捐赠金额", + lanId: 111, + helpfulTip: "填写个人发生的公益慈善事业捐赠的具体金额。", + helpfulTipLanId: 111, + labelcol: 8, + value: "", + rules: "required", + precision: 2, + viewAttr: 3 + }, + { + conditionType: "INPUTNUMBER", + domkey: ["deductionProportion"], + fieldcol: 14, + label: "扣除比例", + lanId: 111, + helpfulTip: "填写税法规定的可以公益慈善事业捐赠支出税前扣除比例。如:0.3(30%)或者1(100%),请注意,必须是小数形式的百分比。", + helpfulTipLanId: 111, + labelcol: 8, + value: "", + rules: "required", + precision: 2, + viewAttr: 3 + }, + { + conditionType: "INPUTNUMBER", + domkey: ["actualDeduction"], + fieldcol: 14, + label: "实际扣除金额", + lanId: 111, + helpfulTip: "填写个人取得“扣除所得项目”对应收入办理扣缴申报或者自行申报时,实际扣除的公益慈善事业捐赠支出金额。", + helpfulTipLanId: 111, + labelcol: 8, + value: "", + rules: "required", + precision: 2, + viewAttr: 3 + } + ], + title: "", + defaultshow: true, + col: 1 + }], + derateDeduction: [{ + items: [ + { + conditionType: "SELECT", + domkey: ["incomeCategory"], + fieldcol: 14, + label: "所得项目", + lanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUT", + domkey: ["derateItem"], + fieldcol: 14, + label: "减免事项", + lanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUT", + domkey: ["derateProperty"], + fieldcol: 14, + label: "减免性质", + lanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUTNUMBER", + domkey: ["derateAmount"], + fieldcol: 14, + label: "减免金额", + lanId: 111, + labelcol: 8, + value: "", + rules: "required", + precision: 2, + viewAttr: 3 + } + ], + title: "", + defaultshow: true, + col: 1 + }], + otherDerateDeduction: [{ + items: [ + { + conditionType: "SELECT", + domkey: ["incomeCategory"], + fieldcol: 14, + label: "所得项目", + lanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUTNUMBER", + domkey: ["otherDeduction"], + fieldcol: 14, + label: "减免税额", + lanId: 111, + labelcol: 8, + value: "", + rules: "required", + precision: 2, + viewAttr: 3 + }, + { + conditionType: "INPUT", + domkey: ["remark"], + fieldcol: 14, + label: "备注", + lanId: 111, + helpfulTip: "根据政策要求,一定要在备注中写明具体扣除项目名称,备注不超过20个字符。", + helpfulTipLanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + } + ], + title: "", + defaultshow: true, + col: 1 + }], + personalPension: [{ + items: [ + { + conditionType: "SELECT", + domkey: ["incomeCategory"], + fieldcol: 14, + label: "所得项目", + lanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "SELECT", + domkey: ["voucherTypeName"], + fieldcol: 14, + label: "凭证类型", + lanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUT", + domkey: ["voucherNo"], + fieldcol: 14, + label: "凭证编码", + lanId: 111, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUTNUMBER", + domkey: ["payAmount"], + fieldcol: 14, + label: "缴费金额", + lanId: 111, + labelcol: 8, + value: "", + rules: "required", + precision: 2, + viewAttr: 3 + } + ], + title: "", + defaultshow: true, + col: 1 + }] +}; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/detailSettingsDialog.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/detailSettingsDialog.js new file mode 100644 index 00000000..3fd2e1e4 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/detailSettingsDialog.js @@ -0,0 +1,181 @@ +/* + * 数据采集-其他免税扣除 + * 明细设置弹框 + * @Author: 黎永顺 + * @Date: 2024/12/24 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaHelpfulTip, WeaLocaleProvider, WeaTools } from "ecCom"; +import { WeaSwitch } from "comsMobx"; +import FormInfo from "../../../components/FormInfo"; +import { taxDetailSettingsConditions } from "./columns"; +import { Button, message } from "antd"; +import { getDomkes, toDecimal_n } from "../../../util"; +import { postFetch } from "../../../util/request"; +import { getIncomeCategoryList } from "../../../apis/ledger"; //获取薪资类型 +import cs from "classnames"; + +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; + +@inject("otherDeductStore") +@observer +class DetailSettingsDialog extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, conditions: [] + }; + } + + async componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + const { data } = await getIncomeCategoryList(); + this.setState({ + conditions: _.map(taxDetailSettingsConditions[nextProps.dataType], item => ({ + ...item, items: _.map(item.items, o => ({ + ...o, options: getKey(o) === "voucherTypeName" ? + [{ key: "MONTH", showname: "月度" }, { key: "YEAR", showname: "年度" }] : + getKey(o) === "incomeCategory" ? _.map(data, it => ({ + key: it.value.toString(), + showname:
+ {it.defaultLabel} + + {it.reportTypeName} + +
+ })) : [] + })) + })) + }, () => { + this.props.otherDeductStore.settingsForm.initFormFields(this.state.conditions); + if (nextProps.id) _.map(getDomkes(this.state.conditions), domkey => { + this.props.otherDeductStore.settingsForm.updateFields({ [domkey]: { value: nextProps.record[domkey].toString() } }); + }); + }); + } else if (nextProps.visible !== this.props.visible && !nextProps.visible) { + this.props.otherDeductStore.initSettingsForm(); + } + } + + save = () => { + const { otherDeductStore: { settingsForm }, mainId, id, dataType } = this.props; + settingsForm.validateForm().then(f => { + if (f.isValid) { + let { deductionMonth, incomeCategory, ...payload } = settingsForm.getFormParams(); + deductionMonth && (payload = { ...payload, deductionMonth: deductionMonth + "-01" }); + this.setState({ loading: true }); + postFetch(`/api/bs/hrmsalary/otherDeduction/save${_.upperFirst(dataType)}`, { + ...payload, mainId, id, + incomeCategory: Number(incomeCategory) + }).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(111, "操作成功!")); + this.props.onCancel(this.props.onSuccess); + } else { + message.error(errormsg); + } + }); + } else { + f.showErrors(); + } + }); + }; + + render() { + const { otherDeductStore: { settingsForm } } = this.props, { loading, conditions } = this.state; + const itemRender = { + freeAmount: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ freeAmount: { value: toDecimal_n(v, 2) } })}/>); + }, + identificationNumber: (field, textAreaProps, form, formParams) => { + return (); + }, + effectiveDate: (field, textAreaProps, form, formParams) => { + return (
+ +
+ +
+
); + }, + donateDate: (field, textAreaProps, form, formParams) => { + return (
+ +
+ +
+
); + }, + yearPremium: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ yearPremium: { value: toDecimal_n(v, 2) } })}/>); + }, + monthPremium: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ monthPremium: { value: toDecimal_n(v, 2) } })}/>); + }, + currentDeduction: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ currentDeduction: { value: toDecimal_n(v, 2) } })}/>); + }, + donateAmount: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ donateAmount: { value: toDecimal_n(v, 2) } })}/>); + }, + deductionProportion: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ deductionProportion: { value: toDecimal_n(v, 2) } })}/>); + }, + actualDeduction: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ actualDeduction: { value: toDecimal_n(v, 2) } })}/>); + }, + derateAmount: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ derateAmount: { value: toDecimal_n(v, 2) } })}/>); + }, + otherDeduction: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ otherDeduction: { value: toDecimal_n(v, 2) } })}/>); + }, + payAmount: (field, textAreaProps, form, formParams) => { + return ( v && form.updateFields({ payAmount: { value: toDecimal_n(v, 2) } })}/>); + } + }; + if (_.reduce(conditions, (pre, cur) => (pre += cur.items.length), 0) * 47 + 33 === 33) return null; + return ( + (pre += cur.items.length), 0) * 47 + 33 }} + buttons={[ + , + + ]} + > + + + ); + } +} + +export default DetailSettingsDialog; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js index 03ae9ae7..9fc35ade 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js @@ -31,6 +31,7 @@ import TableRecord from "../components/tableRecord"; import { convertToUrlString } from "../../../util/url"; import { postFetch } from "../../../util/request"; import { getDomkes } from "../../../util"; +import TaxSetDialog from "./taxSetDialog"; const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; @@ -66,7 +67,8 @@ class Index extends Component { exportPayloadType: false, advanceCondition: null, targetid: "", - taxAgentOption: [] + taxAgentOption: [], + taxSetDialog: { visible: false, dataType: "", id: "" } }; this.tableRef = null; this.addItemRef = null; @@ -301,7 +303,17 @@ class Index extends Component { return { ...it, title: getLabel(83871, "数据采集"), items: _.map(it.items, o => ({ - ...o, label: getLabel(o.lanId, o.label) + ...o, label: getLabel(o.lanId, o.label), + extraDom: !_.isEmpty(editId) && + this.setState({ + taxSetDialog: { + visible: true, dataType: o.dataType, id: editId.id, + label: getLabel(o.lanId, o.label) + } + })}> + + })) }; } @@ -524,7 +536,7 @@ class Index extends Component { const { taxAgentStore: { showOperateBtn }, otherDeductStore: { form } } = this.props; const { declareMonth, taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition, - importPayload, exportPayloadType, targetid + importPayload, exportPayloadType, targetid, taxSetDialog } = this.state; const tablePayload = { declareMonth: [declareMonth], taxAgentId }; return ( @@ -547,6 +559,8 @@ class Index extends Component { onViewDetails={(record) => this.handleAddData("其他免税扣除记录", record)} form={form} /> + this.setState({ taxSetDialog: { ...taxSetDialog, visible: false } })}/> ); } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/taxSetDialog.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/taxSetDialog.js new file mode 100644 index 00000000..1848f4a9 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/taxSetDialog.js @@ -0,0 +1,143 @@ +/* + * 其他免税扣除设置 + * + * @Author: 黎永顺 + * @Date: 2024/12/24 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaButtonIcon, WeaDialog, WeaLocaleProvider, WeaTable } from "ecCom"; +import { message, Modal, Spin } from "antd"; +import { postFetch } from "../../../util/request"; +import DetailSettingsDialog from "./detailSettingsDialog"; + +const getLabel = WeaLocaleProvider.getLabel; + +class TaxSetDialog extends Component { + constructor(props) { + super(props); + this.state = { + dataSource: [], columns: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, + selectedRowKeys: [], detailSettingsDialog: { visible: false, dataType: "", mainId: "", id: "", record: {} } + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + this.setState({ + detailSettingsDialog: { ...this.state.detailSettingsDialog, dataType: nextProps.dataType, mainId: nextProps.id } + }, () => this.getList(nextProps)); + } else if (nextProps.visible !== this.props.visible && !nextProps.visible) { + this.setState({ + dataSource: [], + columns: [], + loading: false, + pageInfo: { current: 1, pageSize: 10, total: 0 }, + selectedRowKeys: [], + detailSettingsDialog: { visible: false } + }); + } + } + + getList = (props) => { + const { id, dataType, viewParams = {} } = props || this.props, { pageInfo, detailSettingsDialog } = this.state; + this.setState({ loading: true }); + postFetch(`/api/bs/hrmsalary/otherDeduction/${dataType}List`, { ...pageInfo, ...viewParams, id }) + .then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, pageInfo: { current, pageSize, total }, columns: _.map(columns, o => ({ + ...o, + width: o.dataIndex === "operate" && 120, + render: (text, record) => o.dataIndex === "operate" ? () : ({text}) + })) + }); + } + }); + }; + handleDelete = (ids = []) => { + const { selectedRowKeys } = this.state, { dataType, id: mainId } = this.props; + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(388758, "确认要删除吗?"), + onOk: () => { + postFetch(`/api/bs/hrmsalary/otherDeduction/delete${_.upperFirst(dataType)}`, { ids, mainId }) + .then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(502230, "删除成功!")); + this.setState({ selectedRowKeys: _.difference(selectedRowKeys, ids) }, () => this.getList()); + } else { + message.error(errormsg); + } + }); + } + }); + }; + + render() { + const { pageInfo, dataSource, loading, columns, selectedRowKeys, detailSettingsDialog } = this.state; + const { viewParams } = 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: 1, pageSize } }, () => this.getList()); + }, + onChange: current => { + this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getList()); + } + }; + const rowSelection = { + selectedRowKeys, onChange: (selectedRowKeys) => this.setState({ selectedRowKeys }) + }; + return ( this.taxSetRef = dom} + title={`${getLabel(111, "附表明细")}(${this.props.label})`} + style={{ + width: "60vw", height: 600, minHeight: 200, minWidth: 380, maxHeight: "90%", + maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)" + }}> +
+ + { + _.isEmpty(viewParams) &&
+ this.setState({ + detailSettingsDialog: { ...detailSettingsDialog, visible: true } + })}/> + { + if (_.isEmpty(selectedRowKeys)) { + message.warning(getLabel(111, "请选择要删除的数据!")); + return; + } + this.handleDelete(selectedRowKeys); + }}/> +
+ } + o.dataIndex !== "operate") : columns} + dataSource={dataSource} pagination={pagination} bordered + rowSelection={rowSelection} loading={loading} rowKey="id" + scroll={{ y: this.taxSetRef ? this.taxSetRef.state.height - 164 : 600 }}/> + this.setState({ + detailSettingsDialog: { ...detailSettingsDialog, visible: false, id: "" } + }, () => callback && callback())} onSuccess={this.getList}/> +
+
+
); + } +} + +export default TaxSetDialog; diff --git a/pc4mobx/hrmSalary/pages/declare/components/declareDialog/condition.js b/pc4mobx/hrmSalary/pages/declare/components/declareDialog/condition.js index d880c3f1..2537486e 100644 --- a/pc4mobx/hrmSalary/pages/declare/components/declareDialog/condition.js +++ b/pc4mobx/hrmSalary/pages/declare/components/declareDialog/condition.js @@ -4,7 +4,7 @@ export const declareConditions = [ { colSpan: 1, conditionType: "MONTHPICKER", - domkey: ["salaryMonthStr"], + domkey: ["salaryMonth"], fieldcol: 14, label: "薪资所属月", lanId: 542604, diff --git a/pc4mobx/hrmSalary/pages/declare/components/declareDialog/index.js b/pc4mobx/hrmSalary/pages/declare/components/declareDialog/index.js index c697bcfb..e5733bc5 100644 --- a/pc4mobx/hrmSalary/pages/declare/components/declareDialog/index.js +++ b/pc4mobx/hrmSalary/pages/declare/components/declareDialog/index.js @@ -9,7 +9,7 @@ import { inject, observer } from "mobx-react"; import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; import { Button, message } from "antd"; import { getSearchs } from "../../../../util"; -import { saveDeclare } from "../../../../apis/declare"; +import { saveDeclare, taxdeclarationGetRate } from "../../../../apis/declare"; import { declareConditions } from "./condition"; import { postFetch } from "../../../../util/request"; import * as API from "../../../../apis/ruleconfig"; @@ -48,7 +48,7 @@ class Index extends Component { options: _.map(data, g => ({ key: String(g.id), showname: g.name })) // helpfulTitle: getLabel(563420, "提示:可选择单个个税扣缴义务人进行申报,若不选择,则批量对管理下的所有个税扣缴义务人进行申报;") }; - } else if (getKey(o) === "salaryMonthStr") { + } else if (getKey(o) === "salaryMonth") { return { ...o, label: sysinfo["TAX_DECLARATION_DATE_TYPE"] === "1" ? getLabel(111, "税款所属期") : getLabel(111, "薪资所属月") @@ -65,19 +65,43 @@ class Index extends Component { const { declareStore: { declareForm } } = this.props; declareForm.validateForm().then(f => { if (f.isValid) { - const payload = declareForm.getFormParams(); + const { salaryMonth, ...payload } = declareForm.getFormParams(); this.setState({ loading: true }); saveDeclare({ - ...payload, taxCycle: `${payload.salaryMonthStr}-01`, salaryDate: `${payload.salaryMonthStr}-01` - }).then(({ status, errormsg }) => { + ...payload, salaryMonth: salaryMonth + "-01", + taxCycle: `${salaryMonth}-01`, + salaryDate: `${salaryMonth}-01` + }).then(async ({ status, data, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.destroy(); + message.loading(getLabel(111, "生成中..."), 0); + this.timer = setInterval(async () => { + const { status: resStatus, data: result } = await taxdeclarationGetRate({ index: data }); + const { status: rateStatus, finish, msg } = result; + if (resStatus && rateStatus) { + if (finish) { + clearInterval(this.timer); + message.destroy(); + message.success(getLabel(30700, "操作成功")); + this.props.onCancel("refresh"); + } + } else { + clearInterval(this.timer); + message.destroy(); + message.warning(msg); + } + }, 1000); + } else { + clearInterval(this.timer); + message.destroy(); + message.warning(errormsg); + } + }).catch(() => { + message.destroy(); + clearInterval(this.timer); this.setState({ loading: false }); - if (status) { - message.success(getLabel(30700, "操作成功")); - this.props.onCancel("refresh"); - } else { - message.error(errormsg); - } - }).catch(() => this.setState({ loading: false })); + }); } else { f.showErrors(); } diff --git a/pc4mobx/hrmSalary/pages/declare/components/declareTablelist/index.js b/pc4mobx/hrmSalary/pages/declare/components/declareTablelist/index.js index 831c33cb..7c8d471d 100644 --- a/pc4mobx/hrmSalary/pages/declare/components/declareTablelist/index.js +++ b/pc4mobx/hrmSalary/pages/declare/components/declareTablelist/index.js @@ -6,8 +6,8 @@ */ import React, { Component } from "react"; import { WeaLocaleProvider, WeaTable } from "ecCom"; -import { Dropdown, Menu, message, Modal } from "antd"; -import { getDeclareList, withDrawTaxDeclaration } from "../../../../apis/declare"; +import { Dropdown, Menu, message, Modal, Tag } from "antd"; +import { getDeclareList, taxdeclarationUpdateIcon, withDrawTaxDeclaration } from "../../../../apis/declare"; import { sysConfCodeRule, sysinfo } from "../../../../apis/ruleconfig"; const getLabel = WeaLocaleProvider.getLabel; @@ -31,8 +31,9 @@ class Index extends Component { } sysConfCodeRule = () => { + const { showOperateBtn } = this.props; sysConfCodeRule({ code: "WITHDRAW_TAX_DECLARATION" }).then(({ status, data }) => { - if (status && data === "1") this.setState({ showWithDrawBtn: data === "1" }); + if (status && data === "1") this.setState({ showWithDrawBtn: data === "1" && showOperateBtn }); }); }; getDeclareList = async (props) => { @@ -51,7 +52,7 @@ class Index extends Component { this.setState({ dataSource, pageInfo: { ...pageInfo, pageNum, pageSize, total }, columns: _.map(columns, o => { - const { dataIndex } = o; + const { dataIndex, displayIcon } = o; let width = ""; switch (dataIndex) { case "taxAgentName": @@ -65,12 +66,41 @@ class Index extends Component { width = "10%"; break; } + if (dataIndex === "taxDeclareStatusDesc") { + return { + ...o, width, + render: (text, record) => { + return (
+ {text} + { + displayIcon && + + this.handleUpdateicon(record)}> + + + + } +
); + } + }; + } return { ...o, width }; }) }); } }).catch(() => this.setState({ loading: false })); }; + handleUpdateicon = (record) => { + const { id: taxDeclareRecordId } = record; + taxdeclarationUpdateIcon({ taxDeclareRecordId }).then(({ status, errormsg }) => { + this.getDeclareList(this.props); + if (status) { + message.success(getLabel(502230, "删除成功!")); + } else { + message.error(errormsg || getLabel(20462, "删除失败!")); + } + }); + }; taxdeclarationDelete = (taxDeclarationId) => { withDrawTaxDeclaration({ taxDeclarationId }).then(({ status, errormsg }) => { if (status) { @@ -113,7 +143,7 @@ class Index extends Component { const { id, opts = [] } = record; return {getLabel(83110, "查看详情")} @@ -137,18 +167,16 @@ class Index extends Component { {getLabel(32025, "撤回")} } - { - showWithDrawBtn && - - this.props.onFilterLog("log", record.id)}>{getLabel(545781, "操作日志")} - - - }> - - - } + + + this.props.onFilterLog("log", record.id)}>{getLabel(545781, "操作日志")} + + + }> + + ; } } diff --git a/pc4mobx/hrmSalary/pages/declare/declare.js b/pc4mobx/hrmSalary/pages/declare/declare.js index 45f918f7..06cb173e 100644 --- a/pc4mobx/hrmSalary/pages/declare/declare.js +++ b/pc4mobx/hrmSalary/pages/declare/declare.js @@ -75,6 +75,7 @@ class Calculate extends Component { render() { const { queryParams, isRefresh, declareDaialog, logDialogVisible, filterConditions } = this.state; + const { taxAgentStore: { showOperateBtn } } = this.props; return ( } iconBgcolor="#F14A2D" buttons={this.renderCalculateOpts()} className="declare-main-layout" showDropIcon @@ -84,7 +85,7 @@ class Calculate extends Component { } ]}>
- this.onDropMenuClick(type, targetid)}/> this.setState({ diff --git a/pc4mobx/hrmSalary/pages/declare/generateModal.js b/pc4mobx/hrmSalary/pages/declare/generateModal.js index cde3f435..bc0f5c45 100644 --- a/pc4mobx/hrmSalary/pages/declare/generateModal.js +++ b/pc4mobx/hrmSalary/pages/declare/generateModal.js @@ -9,8 +9,10 @@ import { WeaSelect, WeaTextarea } from "ecCom"; -import { Button } from "antd"; +import { Button, message } from "antd"; import { inject, observer } from "mobx-react"; +import { taxdeclarationGetRate } from "../../apis/declare"; +import moment from "moment"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; @@ -25,6 +27,7 @@ export default class GenerateModal extends React.Component { description: "", loading: false }; + this.timer = null; } // 生成申报表 @@ -47,13 +50,41 @@ export default class GenerateModal extends React.Component { return; } this.setState({ loading: true }); - saveDeclare({ salaryMonthStr: date, taxAgentId, description }).then(() => { + saveDeclare({ + salaryMonth: moment(date).startOf("month").format("YYYY-MM-DD"), + taxAgentId, + description + }).then((data) => { this.setState({ loading: false }); - this.props.onGenerate(); + this.props.onCancel(); + message.destroy(); + message.loading(getLabel(111, "正在生成中..."), 0); + this.timer = setInterval(async () => { + const { status: resStatus, data: result } = await this.taxdeclarationGetRate(data); + const { status: rateStatus, finish, msg } = result; + if (resStatus && rateStatus) { + if (finish) { + message.destroy(); + clearInterval(this.timer); + message.success(msg || getLabel(22619, "保存成功!")); + this.props.onGenerate(); + } + } else { + clearInterval(this.timer); + message.destroy(); + message.warning(msg || getLabel(111, "生成申报表失败!")); + this.props.onGenerate(); + } + }, 1000); }).catch(() => { + message.destroy(); + clearInterval(this.timer); this.setState({ loading: false }); }); }; + taxdeclarationGetRate = (index) => { + return taxdeclarationGetRate({ index }); + }; render() { const { taxAgentStore: { taxAgentAdminOption } } = this.props; diff --git a/pc4mobx/hrmSalary/pages/declare/index.js b/pc4mobx/hrmSalary/pages/declare/index.js index 57e37c37..cffb075e 100644 --- a/pc4mobx/hrmSalary/pages/declare/index.js +++ b/pc4mobx/hrmSalary/pages/declare/index.js @@ -1,11 +1,11 @@ import React from "react"; import { inject, observer } from "mobx-react"; -import { Button, DatePicker, message, Modal } from "antd"; +import { Button, DatePicker, message, Modal, Tag } from "antd"; import { WeaLocaleProvider, WeaNewScroll, WeaTop } from "ecCom"; import CustomTab from "../../components/customTab"; import CustomTable from "../../components/customTable"; import GenerateModal from "./generateModal"; -import { getDeclareList, withDrawTaxDeclaration } from "../../apis/declare"; +import { getDeclareList, taxdeclarationDelete, taxdeclarationUpdateIcon } from "../../apis/declare"; import { sysConfCodeRule } from "../../apis/ruleconfig"; import moment from "moment"; @@ -65,13 +65,13 @@ export default class Declare extends React.Component { if (status && data === "1") this.setState({ showWithDrawBtn: data === "1" }); }); }; - withDrawTaxDeclaration = (taxDeclarationId) => { - withDrawTaxDeclaration({ taxDeclarationId }).then(({ status, errormsg }) => { + taxdeclarationDelete = (taxDeclarationId) => { + taxdeclarationDelete([taxDeclarationId]).then(({ status, errormsg }) => { if (status) { - message.success(getLabel(111, "撤回成功")); + message.success(getLabel(502230, "删除成功")); this.getDeclareList(); } else { - message.error(errormsg || getLabel(111, "撤回失败")); + message.error(errormsg || getLabel(20462, "删除失败")); } }); }; @@ -96,6 +96,17 @@ export default class Declare extends React.Component { } }, () => this.getDeclareList()); }; + handleUpdateicon = (record) => { + const { id: taxDeclareRecordId } = record; + taxdeclarationUpdateIcon({ taxDeclareRecordId }).then(({ status, errormsg }) => { + this.getDeclareList(); + if (status) { + message.success(getLabel(502230, "删除成功!")); + } else { + message.error(errormsg || getLabel(20462, "删除失败!")); + } + }); + }; render() { const { taxAgentStore: { showOperateBtn } } = this.props; @@ -129,7 +140,7 @@ export default class Declare extends React.Component { onClick={() => { this.setState({ declarationModalVisible: true }); }}> - 生成申报单 + {getLabel(111, "生成申报表")} }
@@ -147,21 +158,38 @@ export default class Declare extends React.Component { { + if (it.dataIndex === "taxDeclareStatusDesc") { + return { + ...it, + render: (text, record) => { + return (
+ {text} + { + record.displayIcon && + + this.handleUpdateicon(record)}> + + + + } +
); + } + }; + } + return { ...it }; + }), { title: "操作", dataIndex: "operate", render: (text, record) => { return ( - { - window.open( - "/spa/hrmSalary/static/index.html#/main/hrmSalary/generateDeclarationDetail?id=" + - record.id - ); - }}> - 查看 + + {getLabel(83110, "查看详情")} { showWithDrawBtn && @@ -169,13 +197,13 @@ export default class Declare extends React.Component { href="javascript:void(0);" style={{ marginLeft: 10 }} onClick={() => { Modal.confirm({ - title: getLabel(111, "信息确认"), - content: getLabel(111, "确认撤回该条数据吗?"), - onOk: () => this.withDrawTaxDeclaration(record.id) + title: getLabel(131329, "信息确认"), + content: getLabel(388758, "确认要删除吗?"), + onOk: () => this.taxdeclarationDelete(record.id) }); }} > - {getLabel(111, "撤回")} + {getLabel(535052, "删除")} } diff --git a/pc4mobx/hrmSalary/pages/declare/index.less b/pc4mobx/hrmSalary/pages/declare/index.less index 01b8fd58..11e4bf8a 100644 --- a/pc4mobx/hrmSalary/pages/declare/index.less +++ b/pc4mobx/hrmSalary/pages/declare/index.less @@ -89,3 +89,32 @@ } } } + +.declare-status-box { + .icon-span { + cursor: pointer; + + .ant-tag:hover .anticon-cross { + display: block; + } + + .ant-tag { + background: transparent; + border-radius: 0; + border: none; + position: relative; + + .anticon-cross { + position: absolute; + right: -1px; + top: -1px; + display: none; + } + } + + i.icon-coms02-Warning-01 { + font-size: 16px; + color: red; + } + } +} diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/constants.js b/pc4mobx/hrmSalary/pages/declareDetail/components/constants.js new file mode 100644 index 00000000..fa58142b --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/constants.js @@ -0,0 +1,181 @@ +export const paymentFeedbackConditions = [ + { + items: [ + { + colSpan: 1, + conditionType: "SELECT", + domkey: ["type"], + fieldcol: 12, + label: "缴款方式", + lanId: 111, + labelcol: 6, + value: "", + rules: "required", + viewAttr: 3, + detailtype: 3, + options: [] + } + ], + defaultshow: true + } +]; +export const paymentTripartiteConditions = [ + { + items: [ + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["taxAgent"], + fieldcol: 12, + label: "个税扣缴义务人", + lanId: 537996, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["amount"], + fieldcol: 12, + label: "应缴金额", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["personNum"], + fieldcol: 12, + label: "申报人数", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 1 + } + ], + defaultshow: true + } +]; +export const paymentBankConditions = [ + { + items: [ + { + colSpan: 1, + conditionType: "SELECT", + domkey: ["protocolNumber"], + fieldcol: 12, + label: "开户行", + lanId: 111, + labelcol: 6, + value: "", + rules: "required", + viewAttr: 3, + options: [] + }, + { + colSpan: 1, + conditionType: "SELECT", + domkey: ["count"], + fieldcol: 12, + label: "开户行号", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 1, + options: [] + }, + { + colSpan: 1, + conditionType: "SELECT", + domkey: ["paymentNumber"], + fieldcol: 12, + label: "缴款帐号", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 1, + options: [] + } + ], + defaultshow: true + } +]; +export const incomeTaxDecConditions = [ + { + items: [ + { + conditionType: "SELECT", + domkey: ["employeeId"], + fieldcol: 16, + label: "姓名", + lanId: 25034, + labelcol: 8, + value: "", + rules: "required|string", + viewAttr: 3, + options: [] + }, + { + conditionType: "INPUT", + domkey: ["jobNum"], + fieldcol: 16, + label: "工号", + lanId: 1933, + labelcol: 8, + value: "", + viewAttr: 1 + }, + { + conditionType: "INPUT", + domkey: ["cardNum"], + fieldcol: 16, + label: "证件号码", + lanId: 1839, + labelcol: 8, + value: "", + viewAttr: 1 + } + ], + title: "baseInfo", + defaultshow: true + }, + { + items: [], + title: "salaryItems", + defaultshow: true + } +]; +//个税申报表-tab新增删除 +export const taxTabConditions = [ + { + items: [ + { + colSpan: 1, + conditionType: "SELECT", + domkey: ["incomeCategory"], + fieldcol: 14, + label: "申报表类型", + lanId: 111, + labelcol: 6, + options: [], + rules: "required|string", + viewAttr: 3 + } + ], + defaultshow: true, + title: "" + } +]; +// 查看附表对应字段 +export const appendixFields = [ + { dataIndex: "taxFreeIncome", dataType: "freeIncome" }, + { dataIndex: "commercialHealthInsurance", dataType: "healthInsurance" }, + { dataIndex: "taxDeferredEndowmentInsurance", dataType: "endowmentInsurance" }, + { dataIndex: "allowedDonation", dataType: "grantDonation" }, + { dataIndex: "taxDeduction", dataType: "derateDeduction" }, + { dataIndex: "other", dataType: "otherDerateDeduction" }, + { dataIndex: "", dataType: "personalPension" } +]; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/declareResultDialog.js b/pc4mobx/hrmSalary/pages/declareDetail/components/declareResultDialog.js new file mode 100644 index 00000000..a462a426 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/declareResultDialog.js @@ -0,0 +1,157 @@ +/* + * Author: 黎永顺 + * name: 个税申报-异常、失败详情 + * Description: + * Date: 2023/8/18 + */ +import React, { Component } from "react"; +import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaReqTop, WeaTable } from "ecCom"; +import { Button, Col, Row } from "antd"; +import { + taxdeclarationEmployeeList4Fail, + taxdeclarationEmployeeList4NotDeclare, + taxdeclarationEmployeeList4NoValue +} from "../../../apis/declare"; +import { convertToUrlString, getQueryString } from "../../../util/url"; + +const { getLabel } = WeaLocaleProvider; +const APIFox = { + list4NotDeclare: taxdeclarationEmployeeList4NotDeclare, + list4NoValue: taxdeclarationEmployeeList4NoValue, + list4Fail: taxdeclarationEmployeeList4Fail +}; + +class DeclareResultDialog extends Component { + constructor(props) { + super(props); + this.state = { + keyword: "", selectedKey: "", + pageInfo: { current: 1, pageSize: 10, total: 0 }, + loading: false, columns: [], dataSource: [] + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + const { type } = nextProps; + this.setState({ + selectedKey: _.head(type).key + }, () => this.queryList()); + } + } + + queryList = () => { + const taxDeclareRecordId = getQueryString("id"); + const { keyword, pageInfo, selectedKey } = this.state; + const payload = { + ...pageInfo, keyword, taxDeclareRecordId + }; + this.setState({ loading: true }); + APIFox[selectedKey](payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, columns + }); + } else { + + } + }).catch(() => this.setState({ loading: false })); + }; + errorExport = () => { + let exportUrl = ""; + const { selectedKey, keyword } = this.state; + const payload = { + taxDeclareRecordId: getQueryString("id"), keyword + }; + if (selectedKey === "list4NotDeclare") { + exportUrl = "/api/bs/hrmsalary/taxdeclaration/employee/export4NotDeclare"; + } else if (selectedKey === "list4NoValue") { + exportUrl = "/api/bs/hrmsalary/taxdeclaration/employee/export4NoValue"; + } + window.open(`${window.ecologyContentPath || ""}${exportUrl}?${convertToUrlString(payload)}`, "_blank"); + }; + failExport = () => { + const payload = { + taxDeclareRecordId: getQueryString("id") + }; + window.open(`${window.ecologyContentPath || ""}/api/bs/hrmsalary/taxdeclaration/employee/export4Fail?${convertToUrlString(payload)}`, "_blank"); + }; + + render() { + const { type } = this.props; + const { loading, columns, dataSource, pageInfo, selectedKey, keyword } = this.state; + 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.queryList()); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.queryList()); + } + }; + return ( + + + {this.props.title} + + + + + ) : + {getLabel(17416, "导出")} + ]} + onChange={key => this.setState({ selectedKey: key }, () => this.queryList())} + /> + } + style={{ + width: 1150, + height: 606.6, + minHeight: 200, + minWidth: 380, + maxHeight: "90%", + maxWidth: "90%", + overflow: "hidden", + transform: "translate(0px, 0px)" + }} + > +
+ { + type.length !== 1 && + < div className="declareNoSearchBox"> + this.setState({ keyword: val })} + onSearch={this.queryList} + /> +
+ } + +
+ + ); + } +} + +export default DeclareResultDialog; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/incomeTaxDeclarationPersonnelSlide.js b/pc4mobx/hrmSalary/pages/declareDetail/components/incomeTaxDeclarationPersonnelSlide.js new file mode 100644 index 00000000..96647f35 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/incomeTaxDeclarationPersonnelSlide.js @@ -0,0 +1,196 @@ +/* + * Author: 黎永顺 + * name: 个税申报人员-新增与编辑 + * Description: + * Date: 2023/12/27 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { incomeTaxDecConditions } from "./constants"; +import { WeaLocaleProvider, WeaSlideModal, WeaTools } from "ecCom"; +import { Button, Col, message, Row } from "antd"; +import { getConditionDomkeys, getSearchs, toDecimal_n } from "../../../util"; +import * as API from "../../../apis/declare"; + +const getLabel = WeaLocaleProvider.getLabel; +const getKey = WeaTools.getKey; +const APIFOX = { + add: API.taxdeclarationAdd, + edit: API.taxdeclarationEdit +}; + +@inject("declareStore") +@observer +class IncomeTaxDeclarationPersonnelSlide extends Component { + constructor(props) { + super(props); + this.state = { + conditions: [], employeeDeclares: [], taxReportColumns: [], + loading: false, detailInfo: {} + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getTaxDecForm(nextProps); + if (nextProps.visible !== this.props.visible && !nextProps.visible) { + const { declareStore: { initTaxDecForm } } = nextProps; + this.setState({ + conditions: [], employeeDeclares: [], taxReportColumns: [], + loading: false, detailInfo: {} + }, () => initTaxDecForm()); + } + } + + getTaxDecForm = (props) => { + const { taxDeclarationId, id } = props; + API.getTaxDecForm({ taxDeclarationId }).then(({ status, data }) => { + if (status) { + const { employeeDeclares, taxReportColumns } = data; + this.setState({ + employeeDeclares, taxReportColumns, + conditions: _.map(incomeTaxDecConditions, item => { + if (item.title === "baseInfo") { + return { + ...item, title: getLabel(1361, "基本信息"), + items: _.map(item.items, o => { + if (getKey(o) === "employeeId") { + if (!id) { + return { + ...o, otherParams: { showSearch: true, optionFilterProp: "children" }, + label: getLabel(o.lanId, o.label), + options: _.map(employeeDeclares, g => ({ + key: g.employeeId.toString(), + showname: g.employeeName + })) + }; + } else { + return { + conditionType: "INPUT", + domkey: ["username"], + fieldcol: 16, + label: getLabel(25034, "姓名"), + labelcol: 8, + value: "", + viewAttr: 1 + }; + } + } + return { ...o, label: getLabel(o.lanId, o.label) }; + }) + }; + } else if (item.title === "salaryItems") { + return { + ...item, title: getLabel(111, "薪资项"), + items: _.map(taxReportColumns, o => ({ + conditionType: o.dataType === "number" ? "INPUTNUMBER" : "INPUT", + domkey: [o.reportColumnDataIndex], + fieldcol: 16, + label: o.reportColumnName, + labelcol: 8, + value: o.dataType === "number" ? 0 : "", + rules: o.dataType === "number" ? "required" : "", + otherParams: { precision: 2 }, + viewAttr: o.dataType === "number" ? 3 : 2 + })) + }; + } + }) + }, () => { + const { declareStore: { taxDecForm } } = props; + taxDecForm.initFormFields(this.state.conditions); + id && this.getTaxdeclarationDetailInfo(id); + }); + } + }); + }; + getTaxdeclarationDetailInfo = (id) => { + API.getTaxdeclarationDetailInfo({ id }).then(({ status, data, errormsg }) => { + if (status) { + const { conditions } = this.state; + const { declareStore: { taxDecForm } } = this.props; + const detailInfo = { ...data, ...data["resultValue"] }; + this.setState({ + detailInfo: detailInfo + }, () => { + _.forEach(getConditionDomkeys(conditions), o => { + taxDecForm.updateFields({ + [o]: this.state.detailInfo[o] || "" + }); + }); + }); + } else { + message.error(errormsg); + this.props.onClose(); + } + }); + }; + handleFormChange = (params) => { + const { declareStore: { taxDecForm } } = this.props; + const { employeeDeclares } = this.state; + const key = Object.keys(params)[0]; + const value = params[key].value; + if (key === "employeeId") { + taxDecForm.updateFields({ + jobNum: _.find(employeeDeclares, o => o.employeeId == value).jobNum, + cardNum: _.find(employeeDeclares, o => o.employeeId == value).cardNum + }); + } + }; + save = () => { + const { declareStore: { taxDecForm }, taxDeclarationId, id } = this.props; + const { employeeDeclares, detailInfo } = this.state; + const type = id ? "edit" : "add"; + taxDecForm.validateForm().then(f => { + if (f.isValid) { + const { cardNum, jobNum, employeeId, ...taxReportColumnValues } = taxDecForm.getFormParams(); + const payload = { + taxDeclarationId, employeeId: employeeId || detailInfo.employeeId, + employeeType: employeeId ? _.find(employeeDeclares, o => o.employeeId == employeeId).employeeType : detailInfo.employeeType, + taxReportColumnValues: _.reduce(_.keys(taxReportColumnValues), (pre, cur) => { + if (Object.prototype.toString.call(taxReportColumnValues[cur]) === "[object Number]") { + return { ...pre, [cur]: toDecimal_n(taxReportColumnValues[cur], 2) }; + } else { + return { ...pre, [cur]: taxReportColumnValues[cur] }; + } + }, {}) + }; + this.setState({ loading: true }); + APIFOX[type](type === "add" ? payload : { ...payload, id }).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(30700, "操作成功!")); + this.props.onClose(true); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: false })); + } else { + f.showErrors(); + } + }); + }; + renderTitle = () => { + return + +
+ {this.props.title} + + + + +
; + }; + + render() { + const { declareStore: { taxDecForm } } = this.props; + const { conditions } = this.state; + return ( + this.props.onClose()} + top={0} width={60} height={100} measure="%" direction="right" title={this.renderTitle()} + content={getSearchs(taxDecForm, conditions, 2, false, this.handleFormChange)} + /> + ); + } +} + +export default IncomeTaxDeclarationPersonnelSlide; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/leftTab.js b/pc4mobx/hrmSalary/pages/declareDetail/components/leftTab.js new file mode 100644 index 00000000..0703aa07 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/leftTab.js @@ -0,0 +1,71 @@ +/* + * Author: 黎永顺 + * name: 报表查看-左侧tab标题 + * Description: + * Date: 2023/4/20 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { Menu } from "antd"; +import * as API from "../../../apis/declare"; +import { getQueryString } from "../../../util/url"; + +const { getLabel } = WeaLocaleProvider; + +class LeftTab extends Component { + constructor(props) { + super(props); + this.state = { + reportName: "", + selectedKeys: "", + dataSource: [] + }; + } + + componentDidMount() { + this.getTaxReports(); + } + + getTaxReports = () => { + const { onChangeTab, onCollapse } = this.props; + API.getTaxReports({ id: getQueryString("id") }).then(({ status, data: dataSource }) => { + if (status) this.setState({ + dataSource, selectedKeys: !_.isEmpty(dataSource) ? _.head(dataSource).id + "" : "" + }, () => { + !_.isEmpty(this.state.dataSource) && onChangeTab(_.head(this.state.dataSource).reportType); + onCollapse(!_.isEmpty(this.state.dataSource) && this.state.dataSource.length > 1); + }); + }); + }; + + render() { + const { selectedKeys, dataSource } = this.state; + const { onChangeTab } = this.props; + const reportTypeNameMap = { + 1: getLabel(111, "综合所得"), + 2: getLabel(111, "分类所得"), + 3: getLabel(111, "非居民所得"), + 4: getLabel(111, "限售股所得") + }; + return ( +
+ { + this.setState({ selectedKeys: key }, () => { + onChangeTab(_.find(dataSource, o => String(o.id) === key).reportType, true); + }); + }} + > + { + _.map(dataSource, item => { + const { reportType, id } = item; + return {reportTypeNameMap[reportType]}; + }) + } + +
+ ); + } +} + +export default LeftTab; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/paymentBtn.js b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentBtn.js new file mode 100644 index 00000000..4523d1b0 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentBtn.js @@ -0,0 +1,365 @@ +/* + * Author: 黎永顺 + * name: 在线申报-缴款按钮 + * Description: + * Date: 2023/8/22 + */ +import React, { Component } from "react"; +import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom"; +import { inject, observer } from "mobx-react"; +import { Button, message, Modal } from "antd"; +import PaymentDialog from "./paymentDialog"; +import { + taxPaymentAgreemenPay, + taxPaymentgetAgreement, + taxPaymentgetAgreementFeedback, + taxPaymentTaxAmount, + taxPaymentVoucherCancel, + taxPaymentVoucherPrint +} from "../../../apis/declare"; +import { getQueryString } from "../../../util/url"; +import { paymentBankConditions, paymentTripartiteConditions } from "./constants"; + +const { getLabel } = WeaLocaleProvider; + +@inject("declareStore") +@observer +class PaymentBtn extends Component { + constructor(props) { + super(props); + this.state = { + paymentDialog: { + visible: false, title: "", + buttons: [], conditions: [], + taxAmount: "" + } + }; + this.timer = null; + } + + handleTripartiteContributions = () => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content:
+
{getLabel(111, "确定要进行三方缴款吗?")}
+
{getLabel(111, "若申请过银行缴款,点击确定,将自动作废银行缴款凭证。并进行三方缴款。 ")}
+
, + onOk: () => { + taxPaymentTaxAmount({ taxDeclareRecordId: getQueryString("id"), reportType: this.props.reportType }) + .then(({ status, data, errormsg }) => { + if (status) { + const { paymentDialog } = this.state; + this.setState({ + paymentDialog: { + ...paymentDialog, visible: true, + title: getLabel(111, "应缴纳"), taxAmount: data.amount, + buttons: [ + + ], + conditions: _.map(paymentTripartiteConditions, item => { + return { + ...item, + items: _.map(item.items, it => { + const key = it["domkey"][0]; + return { + ...it, + value: data[key] + }; + }) + }; + }) + } + }); + } else { + message.error(errormsg); + } + }); + } + }); + }; + taxPaymentgetAgreement = () => { + const { taxCycle: taxYearMonth, taxAgentId } = this.props.declareInfo; + const payload = { + taxDeclareRecordId: getQueryString("id"), + taxAgentId, taxYearMonth: taxYearMonth + "-01", + reportType: this.props.reportType + }; + this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + }); + taxPaymentgetAgreement(payload).then(({ status, data, errormsg }) => { + if (status) { + this.handleCancel(); + this.getBankAccountInfo({ ...payload, requestId: data }); + } else { + this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + }); + message.error(errormsg); + } + }).catch(() => { + this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + }); + }); + }; + getBankAccountInfo = (payload) => { + let loop = () => { + WeaLoadingGlobal.start({ tip: getLabel(111, "获取三方信息中...") }); + clearTimeout(this.timer); + this.timer = setTimeout(async () => { + let response = await taxPaymentgetAgreementFeedback(payload); + const { data, status, errormsg } = response; + if (status) { + const { finish, form } = data; + if (finish) { + WeaLoadingGlobal.destroy(); + const { feedbacks, bankForm } = form; + const { paymentDialog } = this.state; + this.setState({ + paymentDialog: { + ...paymentDialog, visible: true, + title: getLabel(111, "银行账号信息"), + buttons: [ + + ], + conditions: _.map(paymentBankConditions, item => { + return { + ...item, + items: _.map(item.items, it => { + const key = it["domkey"][0]; + if (key === "protocolNumber") { + return { + ...it, + value: !_.isEmpty(bankForm) ? bankForm.bank : "", + options: _.map(feedbacks, o => ({ key: o.sfxyh, showname: o.yhhbmc })) + }; + } else if (key === "count") { + return { + ...it, + value: !_.isEmpty(bankForm) ? bankForm.bank : "", + options: _.map(feedbacks, o => ({ key: o.sfxyh, showname: o.khhhh })) + }; + } else if (key === "paymentNumber") { + return { + ...it, + value: !_.isEmpty(bankForm) ? bankForm.bank : "", + options: _.map(feedbacks, o => ({ key: o.sfxyh, showname: o.jkzh })) + }; + } + return { ...it }; + }) + }; + }) + } + }); + } else { + loop(); + } + } else { + message.warning(errormsg); + clearTimeout(this.timer); + WeaLoadingGlobal.destroy(); + } + }, 800); + }; + loop(); + }; + taxPaymentAgreemenPay = () => { + const { paymentDialog } = this.state; + const { taxAmount } = paymentDialog; + const { declareStore: { paymentForm }, reportType } = this.props; + const { taxCycle: taxYearMonth, taxAgentId } = this.props.declareInfo; + paymentForm.validateForm().then(f => { + if (f.isValid) { + const { protocolNumber, paymentNumber } = paymentForm.getFormDatas(); + const payload = { + taxDeclareRecordId: getQueryString("id"), + taxYearMonth: taxYearMonth + "-01", + taxAgentId, taxAmount, protocolNumber: protocolNumber.value, + reportType, paymentNumber: paymentNumber.valueSpan + }; + this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + }); + taxPaymentAgreemenPay(payload).then(({ status, errormsg }) => { + this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + }); + if (status) { + message.success(getLabel(111, "缴款处理中,请稍后点击缴款反馈按钮获取缴款信息")); + this.handleCancel(); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + })); + } else { + f.showErrors(); + } + }); + }; + handleMenuChange = ({ key }) => { + if (key === "bank_voucher_payment") { + taxPaymentTaxAmount({ taxDeclareRecordId: getQueryString("id"), reportType: this.props.reportType }) + .then(({ status, data, errormsg }) => { + if (status) { + const { paymentDialog } = this.state; + this.setState({ + paymentDialog: { + ...paymentDialog, visible: true, title: getLabel(111, "应缴纳"), + buttons: [ + + ], + conditions: _.map(paymentTripartiteConditions, item => { + return { + ...item, + items: _.map(item.items, it => { + const key = it["domkey"][0]; + return { + ...it, + value: data[key] + }; + }) + }; + }) + } + }); + } else { + message.error(errormsg); + } + }); + } else if (key === "destory_voucher") { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "确定作废缴款凭证吗?作废后可重新获取。"), + onOk: () => { + const { taxAgentId, taxCycle: taxYearMonth } = this.props.declareInfo; + const payload = { + taxDeclareRecordId: getQueryString("id"), + taxAgentId, taxYearMonth: taxYearMonth + "-01", + reportType: this.props.reportType + }; + taxPaymentVoucherCancel(payload).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "作废缴款凭证成功!")); + } else { + message.error(errormsg || getLabel(111, "作废失败!")); + } + }); + } + }); + } + }; + taxPaymentVoucherPrint = () => { + const { taxCycle: taxYearMonth, taxAgentId } = this.props.declareInfo; + const payload = { + taxDeclareRecordId: getQueryString("id"), + taxAgentId, taxYearMonth: taxYearMonth + "-01" + }; + this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + }); + taxPaymentVoucherPrint(payload).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "处理中,请稍后点击缴款反馈!")); + this.handleCancel(); + } else { + this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + }); + message.error(errormsg || getLabel(111, "缴款反馈失败!")); + } + }).catch(() => { + this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + }); + }); + }; + handleCancel = () => { + const { paymentDialog } = this.state; + this.setState({ + paymentDialog: { + ...paymentDialog, visible: false, + title: "", buttons: [], conditions: [] + } + }); + }; + + render() { + const { paymentDialog } = this.state; + return ( + + + {/**/} + {/* {getLabel(111, "银行端凭证缴款")}*/} + {/* {getLabel(111, "作废缴款凭证")}*/} + {/* */} + {/* }*/} + {/* type="ghost">{getLabel(111, "三方缴款")}*/} + + + ); + } +} + +export default PaymentBtn; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/paymentDialog.js b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentDialog.js new file mode 100644 index 00000000..20617418 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentDialog.js @@ -0,0 +1,52 @@ +/* + * Author: 黎永顺 + * name: 在线申报-缴款弹框 + * Description: + * Date: 2023/8/22 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog } from "ecCom"; +import { getSearchs } from "../../../util"; + +@inject("declareStore") +@observer +class PaymentDialog extends Component { + componentWillReceiveProps(nextProps, nextContext) { + const { declareStore: { paymentForm, changePaymentForm }, conditions } = nextProps; + if (nextProps.visible !== this.props.visible && nextProps.visible && nextProps.conditions) { + paymentForm.initFormFields(conditions); + } + if (nextProps.visible !== this.props.visible && !nextProps.visible) { + paymentForm.resetForm(); + changePaymentForm(); + } + } + + handleChange = (val) => { + const key = Object.keys(val)[0]; + if (key === "protocolNumber") { + const { declareStore: { paymentForm } } = this.props; + paymentForm.updateFields({ + count: val[key].value, + paymentNumber: val[key].value, + }); + } + }; + + render() { + const { conditions, declareStore: { paymentForm } } = this.props; + return ( + +
+ {!_.isEmpty(conditions) && getSearchs(paymentForm, conditions, 1, false, this.handleChange)} +
+
+ ); + } +} + +export default PaymentDialog; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/paymentFeedBackDetail.js b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentFeedBackDetail.js new file mode 100644 index 00000000..9dad86e6 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentFeedBackDetail.js @@ -0,0 +1,42 @@ +/* + * Author: 黎永顺 + * name: 在线申报-三方缴款详情 + * Description: + * Date: 2023/8/22 + */ +import React, { Component } from "react"; +import { WeaDialog, WeaLocaleProvider } from "ecCom"; + +const { getLabel } = WeaLocaleProvider; + +class PaymentFeedBackDetail extends Component { + + render() { + const { showData } = this.props; + return ( + +
+
{getLabel(111, "缴款成功")}
+
+
{getLabel(111, "状态:")}
+
{getLabel(111, "申报成功,已缴款")}
+
+
+
{getLabel(111, "实缴金额:")}
+
{showData.payAmount}      {parseFloat(showData.otherAmount) > 0 ? `(含滞纳金等{${showData.otherAmount}元)` : ""}
+
+
+
{getLabel(111, "申报人数:")}
+
{showData.personNum}
+
+
+
+ ); + } +} + +export default PaymentFeedBackDetail; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/paymentFeedbackBtn.js b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentFeedbackBtn.js new file mode 100644 index 00000000..9dbb3b03 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentFeedbackBtn.js @@ -0,0 +1,203 @@ +/* + * Author: 黎永顺 + * name: 在线申报-缴款反馈按钮 + * Description: + * Date: 2023/8/22 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { Button, message } from "antd"; +import { inject, observer } from "mobx-react"; +import PaymentDialog from "./paymentDialog"; +import PaymentFeedBackDetail from "./paymentFeedBackDetail"; +import { paymentFeedbackConditions } from "./constants"; +import { convertToUrlString, getQueryString } from "../../../util/url"; +import { taxPaymentAgreementPayFeedback, taxPaymentVoucherPrintFeedback } from "../../../apis/declare"; + +const { getLabel } = WeaLocaleProvider; + +@inject("declareStore") +@observer +class PaymentFeedbackBtn extends Component { + constructor(props) { + super(props); + this.state = { + paymentDialog: { + visible: false, title: "", + buttons: [], conditions: null + }, + paymentFeedbackDialog: { + visible: false, title: "", showData: {} + }, + loading: false + }; + } + + getFeedback = () => { + const { declareStore: { paymentForm } } = this.props; + paymentForm.validateForm().then(f => { + const { type } = paymentForm.getFormParams(); + if (f.isValid) { + if (type === "WITHHOLDING_PAY") { + // 三方缴款 弹窗,打印新开页面 + this.taxPaymentAgreementPayFeedback(); + } else { + this.taxPaymentVoucherPrintFeedback(); + } + } else { + f.showErrors(); + } + }); + }; + taxPaymentAgreementPayFeedback = () => { + const { taxCycle: taxYearMonth, taxAgentId } = this.props.declareInfo; + const payload = { + taxDeclareRecordId: getQueryString("id"), + taxAgentId, taxYearMonth: taxYearMonth + "-01", + reportType: this.props.reportType + }; + this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + }); + taxPaymentAgreementPayFeedback(payload).then(({ status, data, errormsg }) => { + this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + }); + if (status) { + this.handleCancel(); + this.setState({ + paymentFeedbackDialog: { + ...this.state.paymentFeedbackDialog, + visible: true, title: getLabel(111, "三方缴款详情"), + showData: data + } + }); + } else { + message.error(errormsg || getLabel(111, "缴款反馈失败!")); + } + }).catch(() => { + this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + }); + }); + }; + taxPaymentVoucherPrintFeedback = () => { + const { taxCycle: taxYearMonth, taxAgentId } = this.props.declareInfo; + const payload = { + taxYearMonth: taxYearMonth + "-01", + taxDeclareRecordId: getQueryString("id"), + taxAgentId, checkFeedback: 1 + }; + this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + }); + taxPaymentVoucherPrintFeedback(payload).then(({ status, data, errormsg }) => { + this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + }); + if (status) { + this.handleCancel(); + window.open(`${window.ecologyContentPath || ""}/spa/hrmSalary/static/index.html#/main/hrmSalary/bankVoucherDetail?${convertToUrlString(payload)}`); + } else { + message.error(errormsg || getLabel(111, "缴款反馈失败!")); + } + }).catch(() => { + this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + }); + }); + }; + handlePaymentFeedback = () => { + const { paymentDialog } = this.state; + this.setState({ + paymentDialog: { + ...paymentDialog, visible: true, + title: getLabel(111, "获取反馈"), + buttons: [ + + ], + conditions: _.map(paymentFeedbackConditions, item => { + return { + ...item, + items: _.map(item.items, it => { + return { + ...it, + options: [ + { key: "WITHHOLDING_PAY", showname: getLabel(111, "三方缴款"), selected: true } + // { key: "WITHHOLDING_VOUCHER", showname: getLabel(111, "缴款凭证打印") } + ] + }; + }) + }; + }) + } + }); + }; + handleCancel = () => { + const { paymentDialog } = this.state; + this.setState({ + paymentDialog: { + ...paymentDialog, visible: false, + title: "", buttons: [], conditions: null + } + }); + }; + + render() { + const { paymentDialog, paymentFeedbackDialog } = this.state; + return ( + + {/*个税接口改造*/} + {/**/} + + + { + this.setState({ + paymentFeedbackDialog: { + ...paymentFeedbackDialog, + visible: false, title: "", showData: {} + } + }, () => this.props.updateDeclare()); + }} + /> + + ); + } +} + +export default PaymentFeedbackBtn; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/tabEditDialog.js b/pc4mobx/hrmSalary/pages/declareDetail/components/tabEditDialog.js new file mode 100644 index 00000000..931b6565 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/tabEditDialog.js @@ -0,0 +1,95 @@ +/* + * Author: 黎永顺 + * name: 个税申报表详情-tab动态添加 + * Description: + * Date: 2023/12/29 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; +import { Button, message } from "antd"; +import { getSearchs } from "../../../util/index"; +import * as API from "../../../apis/declare"; +import { commonEnumList } from "../../../apis/ruleconfig"; +import { taxTabConditions } from "./constants"; +import { getQueryString } from "../../../util/url"; + +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; + +@inject("declareStore") +@observer +class TabEditDialog extends Component { + constructor(props) { + super(props); + this.state = { + conditions: [], loading: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getTabForm(nextProps); + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.declareStore.initTabDecForm(); + } + + getTabForm = (props) => { + const payload = { + enumClass: "com.engine.salary.enums.salarysob.IncomeCategoryEnum" + }; + commonEnumList(payload).then(({ status, data }) => { + if (status) { + this.setState({ + conditions: _.map(taxTabConditions, item => ({ + ...item, items: _.map(item.items, o => { + if (getKey(o) === "incomeCategory") { + return { + ...o, label: getLabel(o.lanId, o.label), + options: _.map(data, it => ({ key: it.enum, showname: it.defaultLabel })) + }; + } + return { ...o }; + }) + })) + }, () => props.declareStore.tabDecForm.initFormFields(this.state.conditions)); + } + }); + }; + save = () => { + const { declareStore: { tabDecForm } } = this.props; + tabDecForm.validateForm().then(f => { + if (f.isValid) { + const payload = tabDecForm.getFormParams(); + this.setState({ loading: true }); + API.addTaxDeclaration({ ...payload, taxDeclareRecordId: Number(getQueryString("id")) }) + .then(({ status, data, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(30700, "操作成功")); + this.props.onCancel(true); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: false })); + } else { + f.showErrors(); + } + }); + }; + + render() { + const { conditions, loading } = this.state; + const { declareStore: { tabDecForm } } = this.props; + return ( + {getLabel(826, "确定")} + ]} + > +
{getSearchs(tabDecForm, conditions, 1, false)}
+
+ ); + } +} + +export default TabEditDialog; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/taxDeclarationInfo.js b/pc4mobx/hrmSalary/pages/declareDetail/components/taxDeclarationInfo.js new file mode 100644 index 00000000..ec5edc9c --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/taxDeclarationInfo.js @@ -0,0 +1,131 @@ +/* + * Author: 黎永顺 + * name: 个税申报表详情-基本信息 + * Description: + * Date: 2023/8/18 + */ +import React, { Component } from "react"; +import { message, Tag } from "antd"; +import { WeaLocaleProvider } from "ecCom"; +import DeclareResultDialog from "./declareResultDialog"; +import MoreBtnMenu from "../../../components/moreBtnMenu"; +import { taxdeclarationUpdateIcon } from "../../../apis/declare"; +import { getQueryString } from "../../../util/url"; + +const { getLabel } = WeaLocaleProvider; + +class TaxDeclarationInfo extends Component { + constructor(props) { + super(props); + this.state = { + resDialog: { + visible: false, title: "", + type: [] + } + }; + } + + handleSeeResult = (type, title) => { + this.setState({ + resDialog: { ...this.state.resDialog, visible: true, title: `${title}${getLabel(111, "详情")}`, type } + }); + }; + handleUpdateicon = () => { + taxdeclarationUpdateIcon({ taxDeclareRecordId: getQueryString("id") }) + .then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(502230, "删除成功!")); + } else { + message.error(errormsg || getLabel(20462, "删除失败!")); + } + }); + }; + + render() { + const { resDialog } = this.state; + const { declareInfo, onOperate } = this.props; + const { abnormalSize, declareFailSize } = declareInfo; + const infoItem = [ + { key: "taxCycle", label: getLabel(542240, "税款所属期") }, + { key: "salaryMonth", label: getLabel(542604, "薪资所属月") }, + { key: "taxAgentName", label: getLabel(537996, "个税扣缴义务人") }, + { key: "declareTypeDesc", label: getLabel(111, "申报类型") }, + { key: "declareStatusDesc", label: getLabel(111, "申报状态") }, + { key: "taxPaidAmount", label: getLabel(111, "已缴金额") } + ]; + let dropMenuDatas = []; + if (["DECLARE_SUCCESS_NO_PAY", "DECLARE_SUCCESS_UNPAID", "DECLARE_SUCCESS_PAID", "DECLARE_SUCCESS_PAYING"].includes(declareInfo.declareStatus)) { + dropMenuDatas = dropMenuDatas.concat([ + { + key: "exportGetDeclareTaxResultFeedback", + icon: , + content: getLabel(111, "下载申报内置算税结果"), + onClick: onOperate + }, + { + key: "onlineComparison", + icon: , + content: getLabel(111, "在线对比"), + onClick: onOperate + } + ]); + } + return ( +
+
+ { + _.map(infoItem, item => { + return
+ {item["label"]}: + + {declareInfo[item["key"]]} + { + ( + (item["key"] === "declareStatusDesc" && declareInfo["displayIcon"]) + || (item["key"] === "declareStatusDesc" && declareInfo["declareErrorMsg"]) + ) && + + + + + + } + + { + item.key === "taxPaidAmount" && + {getLabel(111, "元")} + } +
; + }) + } +
+
+ this.handleSeeResult([ + { key: "list4NotDeclare", title: getLabel(111, "待报送") }, + { key: "list4NoValue", title: getLabel(111, "缺申报数据") } + ], getLabel(111, "申报校验异常"))}> + {getLabel(111, "申报校验异常")}({abnormalSize || 0}) + + this.handleSeeResult([{ key: "list4Fail" }], getLabel(111, "申报失败数据"))}> + {getLabel(111, "申报失败数据")}({declareFailSize || 0}) + + + { + this.setState({ + resDialog: { ...resDialog, visible: false, title: "", type: [] } + }); + }} + /> +
+
+ ); + } +} + +export default TaxDeclarationInfo; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/taxDeclareDetailImportDialog.js b/pc4mobx/hrmSalary/pages/declareDetail/components/taxDeclareDetailImportDialog.js new file mode 100644 index 00000000..6553f6e4 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/taxDeclareDetailImportDialog.js @@ -0,0 +1,90 @@ +/* + * Author: 黎永顺 + * name: 个税申报表详情-导入 + * Description: + * Date: 2023/12/28 + */ +import React, { Component } from "react"; +import { WeaCheckbox, WeaLocaleProvider } from "ecCom"; +import { message } from "antd"; +import ImportDialog from "../../../components/importDialog"; +import * as API from "../../../apis/declare"; + +const getLabel = WeaLocaleProvider.getLabel; + +class TaxDeclareDetailImportDialog extends Component { + constructor(props) { + super(props); + this.state = { + importDialog: { + visible: false, title: "", nextloading: false, hasData: "0", + link: null, importResult: {}, imageId: "", taxDeclarationId: "", + previewUrl: "/api/bs/hrmsalary/taxdeclaration/preview", + extraPreview: { taxDeclarationId: "" } + } + }; + } + + handleImportTaxDeclare = (taxDeclarationId) => { + this.setState({ + importDialog: { + ...this.state.importDialog, link: this.handleExportTemp, + taxDeclarationId, visible: true, title: getLabel(24023, "数据导入"), + extraPreview: { taxDeclarationId } + } + }); + }; + handleImport = (payload) => { + const { importDialog } = this.state; + const { taxDeclarationId } = importDialog; + this.setState({ importDialog: { ...importDialog, nextloading: true } }); + API.taxdeclarationImportData({ ...payload, taxDeclarationId }) + .then(({ data, status }) => { + this.setState({ importDialog: { ...importDialog, nextloading: false } }); + if (status) { + this.setState({ + importDialog: { ...importDialog, ...payload, importResult: data } + }, () => this.props.onSuccess()); + } + }).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } })); + }; + handleExportTemp = () => { + const { importDialog: { taxDeclarationId, hasData } } = this.state; + message.destroy(); + message.loading(getLabel(111, "下载中"), 0); + const promise = API.taxdeclarationExportTemplate({ taxDeclarationId, hasData: hasData === "1" }); + message.destroy(); + }; + handleCancel = () => { + this.setState({ + importDialog: { + visible: false, title: "", nextloading: false, hasData: "0", + link: null, importResult: {}, imageId: "", taxDeclarationId: "", + previewUrl: "/api/bs/hrmsalary/taxdeclaration/preview" + } + }); + }; + + render() { + const { importDialog } = this.state; + return ( + this.setState(({ + importDialog: { ...importDialog, importResult: {}, imageId: "", hasData: "0" } + }))} + nextCallback={imageId => this.setState({ importDialog: { ...importDialog, imageId } })} + nextUplaodCallback={imageId => this.handleImport({ imageId })} + exportDataDom={ + this.setState({ importDialog: { ...importDialog, hasData: val } })} + /> + } + /> + ); + } +} + +export default TaxDeclareDetailImportDialog; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/confirm.js b/pc4mobx/hrmSalary/pages/declareDetail/confirm.js new file mode 100644 index 00000000..39c6c2d5 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/confirm.js @@ -0,0 +1,27 @@ +import { WeaLocaleProvider } from "ecCom"; +import { Modal } from "antd"; + +const { getLabel } = WeaLocaleProvider; +export const confirmDialog = (type, callback, reportType) => { + let content = ""; + switch (type) { + case "refresh": + content = getLabel(111, "刷新数据会重新从核算数据中取值,申报界面新增、编辑的数据会被全部覆盖,是否确认刷新?"); + break; + case "correct": + content = getLabel(111, "更正申报,当申报成功后,发现有错报、漏报的情况,可使用更正申报,更正申报成功时,企业状态会变成未申报"); + break; + case "cancel": + content = getLabel(111, "申报作废,只有申报成功,无需缴款/申报成功,未缴款的状态才能作废,当作废成功时,企业状态会变成未申报;当作废失败时,企业状态还是原来的未缴款或无需缴款的状态。"); + break; + case "declare": + content = reportType === 1 ? getLabel(111, "解除劳动合同一次性补偿金、全年一次性奖金所得,不能单独申报,需要同正常工资薪金一起申报;解除劳动合同一次性补偿金、稿酬所得,由于税务规则需要,解除劳动合同一次性补偿金、稿酬所得必须填写免税附表。是否确认申报?") : getLabel(111, "确认申报?"); + break; + default: + break; + } + return Modal.confirm({ + title: getLabel(131329, "信息确认"), content, + onOk: callback + }); +}; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/index.js b/pc4mobx/hrmSalary/pages/declareDetail/index.js new file mode 100644 index 00000000..c1dffb77 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/index.js @@ -0,0 +1,491 @@ +/* + * Author: 黎永顺 + * name: 个税查看详情页面 + * Description: + * Date: 2023/8/18 + */ +import React, { Component } from "react"; +import { WeaLeftRightLayout, WeaLocaleProvider, WeaTab } from "ecCom"; +import { Button, message, Modal, Spin } from "antd"; +import TaxDeclarationInfo from "./components/taxDeclarationInfo"; +import { apiflowBillingConfigStatus } from "../../apis/intelligentCalculateSalarySettings"; +import PaymentBtn from "./components/paymentBtn"; +import PaymentFeedbackBtn from "./components/paymentFeedbackBtn"; +import { + deleteInfo, + deleteTaxDeclaration, + exportGetDeclareTaxResultFeedback, + getDeclareInfo, + getDetailList, + getTaxDeclarationTab, + taxdeclaratioGetCancelFeedback, + taxdeclarationDeclare, + taxdeclarationGetDeclareFeedback, + taxdeclarationGetRate, + taxdeclarationRefreshData, + taxdeclaratioUpdateCancel, + taxdeclaratioUpdateDeclare, + taxPaymentVoucherStatusSync +} from "../../apis/declare"; +import { convertToUrlString, getQueryString } from "../../util/url"; +import IncomeTaxDeclarationPersonnelSlide from "./components/incomeTaxDeclarationPersonnelSlide"; +import TaxDeclareDetailImportDialog from "./components/taxDeclareDetailImportDialog"; +import TabEditDialog from "./components/tabEditDialog"; +import LeftTab from "./components/leftTab"; +import { confirmDialog } from "./confirm"; +import { appendixFields } from "./components/constants"; +import "./index.less"; +import TaxSetDialog from "../dataAcquisition/otherDeduct/taxSetDialog"; + +const { getLabel } = WeaLocaleProvider; + +const APIFox = { + refresh: taxdeclarationRefreshData, //刷新数据 + declare: taxdeclarationDeclare, //在线申报 + feedback: taxdeclarationGetDeclareFeedback,//申报反馈 + correct: taxdeclaratioUpdateDeclare,//更正申报 + cancel: taxdeclaratioUpdateCancel,//作废申报 + cancelFeedback: taxdeclaratioGetCancelFeedback//作废反馈 +}; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + tabs: [], selectedKey: "", columns: [], dataSource: [], editTabVisible: false, keyword: "", + loading: { + query: false, refresh: false, declare: false, feedback: false, + correct: false, cancel: false, cancelFeedback: false, refreshingPay: false, + issuance: false + }, + taxDecPersonSlide: { + visible: false, title: getLabel(1421, "新增"), taxDeclarationId: "", id: "" + }, + intelCalcSalaryStatus: false, //智能算薪 总开关是否开启 + declareInfo: {}, pageInfo: { current: 0, pageSize: 10, total: 0 }, + reportType: "", showLeft: false, + taxSetDialog: { visible: false, dataType: "", viewParams: {} }//查看附表 + }; + this.timer = null; + this.taxDeclareRef = null; + } + + componentDidMount() { + window.addEventListener("message", this.handleReceive, false); + } + + componentWillUnmount() { + window.removeEventListener("message", this.handleReceive, false); + } + + init = async (isInit = true) => { + const [tabsResult, infoResult, calcResult] = await Promise.all([ + this.getTaxDeclarationTab(), this.getDeclareInfo(), this.apiflowBillingConfigStatus()]); + const { data: tabDataSource, status: tabStatus } = tabsResult; + const { data: infoDataSource, status: infoStatus } = infoResult; + const { data: calcSalaryStatus, status: calcStatus } = calcResult; + this.setState({ + tabs: tabStatus ? _.map(tabDataSource, it => ({ + viewcondition: `${it.incomeCategory}%%${it.taxDeclarationId}`, + title: it.tabName, editable: true + })) : this.state.tabs, + selectedKey: (tabStatus && isInit) ? + `${_.first(tabDataSource).incomeCategory}%%${_.first(tabDataSource).taxDeclarationId}` : + `${_.last(tabDataSource).incomeCategory}%%${_.last(tabDataSource).taxDeclarationId}`, + declareInfo: infoStatus ? infoDataSource : this.state.declareInfo, + intelCalcSalaryStatus: calcStatus && calcSalaryStatus + }); + this.getDetailList(); + }; + declare = async () => { + const [infoResult] = await Promise.all([this.getDeclareInfo()]); + const { data: infoDataSource, status: infoStatus } = infoResult; + this.setState({ + declareInfo: infoStatus ? infoDataSource : this.state.declareInfo + }); + this.getDetailList(); + }; + getTaxDeclarationTab = () => { + const { reportType } = this.state; + return getTaxDeclarationTab({ taxDeclareRecordId: getQueryString("id"), reportType }); + }; + getDeclareInfo = () => { + const { reportType } = this.state; + return getDeclareInfo({ taxDeclareRecordId: getQueryString("id"), reportType }); + }; + apiflowBillingConfigStatus = () => { + return apiflowBillingConfigStatus(); + }; + taxdeclarationGetRate = (index) => { + return taxdeclarationGetRate({ index }); + }; + handleReceive = ({ data }) => { + const { type, payload: { id, params } = {} } = data; + if (type === "init") { + const promise = this.init(); + } else if (type === "turn") { + if (id === "PAGEINFO") { + this.setState({ pageInfo: { ...this.state.pageInfo, ...params } }, () => this.getDetailList()); + } else if (id === "EDIT") { + this.handleTaxDescPerSlide({ + visible: true, id: params.id, + title: getLabel(501169, "编辑") + }); + } else if (id === "DELETE") { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(543548, "确认删除吗?"), + onOk: () => { + deleteInfo({ id: params.id }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(502230, "删除成功!")); + this.getDetailList(); + } else { + message.error(errormsg || getLabel(20462, "删除失败!")); + } + }); + } + }); + } else if (id === "APPENDIX") { + const { taxAgentId, taxCycle } = this.state.declareInfo; + this.setState({ + taxSetDialog: { + visible: true, viewParams: { employeeId: params.employeeId, taxAgentId, taxCycle: taxCycle + "-01" }, + dataType: _.find(appendixFields, o => o.dataIndex === params.dataIndex).dataType, + label: params.title + } + }); + } + } + }; + postMessageToChild = (payload = {}) => { + const { declareInfo, intelCalcSalaryStatus } = this.state; + const i18n = { + "总计": getLabel(523, "总计"), "编辑": getLabel(501169, "编辑"), + "操作": getLabel(30585, "操作"), "共": getLabel(83698, "共"), + "条": getLabel(18256, "条"), "删除": getLabel(535052, "删除"), + "查看附表": getLabel(111, "查看附表") + }; + const declareStatus = intelCalcSalaryStatus ? declareInfo.declareStatus : ""; + const childFrameObj = document.getElementById("atdTable"); + childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n, declareStatus }), "*"); + }; + getDetailList = () => { + const { loading, pageInfo, selectedKey, keyword } = this.state; + const [incomeCategory, taxDeclarationId] = selectedKey.split("%%"); + const payload = { + ...pageInfo, incomeCategory, taxDeclarationId, keyword, + taxDeclareRecordId: getQueryString("id") + }; + this.setState({ loading: { ...loading, query: true } }); + getDetailList(payload).then(({ status, data }) => { + this.setState({ loading: { ...loading, query: false } }); + if (status) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, + columns: _.map(columns, (it, idx) => { + if (idx <= 1) { + return { ...it, width: 150, fixed: "left", ellipsis: true }; + } + return { + ...it, width: 150, ellipsis: true, + isAppendix: _.findIndex(appendixFields, o => o.dataIndex === it.dataIndex) !== -1 + }; + }) + }, () => { + const payload = { + dataSource, pageInfo: this.state.pageInfo, + columns: this.state.columns + }; + this.postMessageToChild(payload); + }); + } + }).catch(() => this.setState({ loading: { ...loading, query: false } })); + }; + handleOperateDeclare = (type, params = {}) => { + const loadingTxt = { + refresh: getLabel(111, "刷新中..."), //刷新数据 + declare: getLabel(111, "申报中..."), //在线申报 + feedback: getLabel(111, "反馈中..."),//申报反馈 + correct: getLabel(111, "更正申报中..."),//更正申报 + cancel: getLabel(111, "作废申报中..."),//作废申报 + cancelFeedback: getLabel(111, "作废反馈中...")//作废反馈 + }, successTxt = { + refresh: getLabel(111, "刷新数据成功!"), //刷新数据 + declare: getLabel(111, "在线申报成功!"), //在线申报 + feedback: getLabel(111, "申报反馈成功!"),//申报反馈 + correct: getLabel(111, "更正申报成功!"),//更正申报 + cancel: getLabel(111, "作废申报成功!"),//作废申报 + cancelFeedback: getLabel(111, "作废反馈成功!")//作废反馈 + }, failTxt = { + refresh: getLabel(111, "刷新数据失败!"), //刷新数据 + declare: getLabel(111, "在线申报失败!"), //在线申报 + feedback: getLabel(111, "申报反馈失败!"),//申报反馈 + correct: getLabel(111, "更正申报失败!"),//更正申报 + cancel: getLabel(111, "作废申报失败!"),//作废申报 + cancelFeedback: getLabel(111, "作废反馈失败!")//作废反馈 + }; + this.setState({ loading: { ...this.state.loading, [type]: true } }); + APIFox[type]({ taxDeclareRecordId: getQueryString("id"), ...params }) + .then(async ({ status, data, errormsg }) => { + if (status) { + message.destroy(); + message.loading(loadingTxt[type], 0); + this.timer = setInterval(async () => { + const { status: resStatus, data: result } = await this.taxdeclarationGetRate(data); + const { status: rateStatus, finish, msg } = result; + if (resStatus && rateStatus) { + if (finish) { + this.setState({ loading: { ...this.state.loading, [type]: false } }); + clearInterval(this.timer); + message.destroy(); + message.success(successTxt[type]); + const promise = type === "refresh" ? await this.init() : await this.declare(); + } + } else { + this.setState({ loading: { ...this.state.loading, [type]: false } }); + clearInterval(this.timer); + message.destroy(); + message.warning(msg || failTxt[type]); + const promise = type === "refresh" ? await this.init() : await this.declare(); + } + }, 1000); + } else { + this.setState({ loading: { ...this.state.loading, [type]: false } }); + clearInterval(this.timer); + message.destroy(); + message.warning(errormsg); + } + }).catch(() => { + message.destroy(); + clearInterval(this.timer); + this.setState({ loading: { ...this.state.loading, [type]: false } }); + }); + }; + taxPaymentVoucherStatusSync = () => { + const { taxAgentId, taxCycle: taxYearMonth } = this.state.declareInfo; + const payload = { + taxDeclareRecordId: getQueryString("id"), + taxAgentId, taxYearMonth: taxYearMonth + "-01", + reportType: this.state.reportType + }; + this.setState({ loading: { ...this.state.loading, refreshingPay: true } }); + taxPaymentVoucherStatusSync(payload).then(({ status, errormsg }) => { + this.setState({ loading: { ...this.state.loading, refreshingPay: false } }); + if (status) { + message.success(getLabel(111, "刷新成功!")); + const promise = this.declare(); + } else { + message.error(errormsg || getLabel(111, "刷新失败!")); + } + }).catch(() => this.setState({ loading: { ...this.state.loading, refreshingPay: false } })); + }; + getEnterprisePayCertificate = () => { + const { taxAgentId, taxCycle: taxYearMonth } = this.state.declareInfo; + const payload = { + taxDeclareRecordId: getQueryString("id"), + taxAgentId, taxYearMonth: taxYearMonth + "-01", + reportType: this.state.reportType + }; + window.open(`${window.ecologyContentPath || ""}/spa/hrmSalary/static/index.html#/main/hrmSalary/enterprisePayCertificationDetail?${convertToUrlString(payload)}`); + // this.setState({ loading: { ...this.state.loading, issuance: true } }); + // taxPaymentWithheldVoucherGet(payload).then(({ status, data, errormsg }) => { + // this.setState({ loading: { ...this.state.loading, issuance: false } }); + // if (status && !_.isEmpty(data.vouchers)) { + // window.open(`${window.ecologyContentPath || ""}/spa/hrmSalary/static/index.html#/main/hrmSalary/enterprisePayCertificationDetail?${convertToUrlString(payload)}`); + // } else { + // message.error(errormsg || ""); + // } + // }).catch(() => this.setState({ loading: { ...this.state.loading, issuance: false } })); + }; + export = () => { + const [incomeCategory, taxDeclarationId] = this.state.selectedKey.split("%%"); + const payload = { + taxDeclareRecordId: getQueryString("id"), + taxDeclarationId: taxDeclarationId.toString(), + incomeCategory + }; + window.open(`${window.ecologyContentPath || ""}/api/bs/hrmsalary/taxdeclaration/detail/export?${convertToUrlString(payload)}`, "_blank"); + }; + handleTaxDescPerSlide = (params) => { + const { callback, ...extra } = params; + const { taxDecPersonSlide, selectedKey } = this.state; + const [__, taxDeclarationId] = selectedKey.split("%%"); + this.setState({ + taxDecPersonSlide: { ...taxDecPersonSlide, ...extra, taxDeclarationId } + }, () => callback && this.getDetailList()); + }; + exportGetDeclareTaxResultFeedback = () => { + const { reportType } = this.state; + message.destroy(); + message.loading(getLabel(111, "下载中..."), 0); + exportGetDeclareTaxResultFeedback({ id: getQueryString("id"), reportType }) + .then(async () => { + message.destroy(); + message.success(getLabel(111, "下载成功!")); + }).catch(() => { + message.destroy(); + message.error(getLabel(111, "下载失败!")); + }); + }; + onlineComparison = () => { + const [__, taxDeclarationId] = this.state.selectedKey.split("%%"); + window.open(`${window.location.origin}/spa/hrmSalary/static/index.html#/main/hrmSalary/declareDetail/${taxDeclarationId}`, "_blank"); + }; + handleTabEdit = (tabKey, type) => { + if (type === "remove") { + const [__, taxDeclarationId] = tabKey.split("%%"); + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "确认删除吗?"), + onOk: () => { + message.destroy(); + message.loading("正在删除中...", 0); + deleteTaxDeclaration({ taxDeclarationId }) + .then(({ status, errormsg }) => { + message.destroy(); + if (status) { + message.success(getLabel(502230, "删除成功")); + const promise = this.init(); + } else { + message.error(errormsg); + } + }).catch(() => message.destroy()); + } + }); + } else if (type === "add") { + this.setState({ editTabVisible: true }); + } + }; + + render() { + const { + tabs, selectedKey, loading, declareInfo, intelCalcSalaryStatus, taxDecPersonSlide, + editTabVisible, reportType, showLeft, taxSetDialog + } = this.state; + const [__, taxDeclarationId] = selectedKey.split("%%"); + let btns = [ + , + , + + ]; + //申报状态:作废中 + declareInfo.declareStatus === "DECLARE_CANCELLING" && (btns.splice(1, 2, )); + //申报状态:申报中 + declareInfo.declareStatus === "DECLARING" && (btns.splice(1, 2, )); + //申报状态:缴款中 + declareInfo.declareStatus === "DECLARE_SUCCESS_PAYING" && (btns.splice(1, 2)); + //申报状态:已缴款 + declareInfo.declareStatus === "DECLARE_SUCCESS_PAID" && (btns.splice(1, 2, + )); + //申报状态:申报成功,无需缴款 + declareInfo.declareStatus === "DECLARE_SUCCESS_NO_PAY" && + (btns.splice(1, 2, + , + + )); + //申报状态:申报成功,未缴款 + declareInfo.declareStatus === "DECLARE_SUCCESS_UNPAID" && + (btns.splice(1, 2, + , + + // + )); + if (!intelCalcSalaryStatus) { + if (["NOT_DECLARE", "DECLARE_FAIL"].includes(declareInfo.declareStatus)) { + btns.splice(1, 1); + } + } + if (intelCalcSalaryStatus) { + if (["NOT_DECLARE", "DECLARE_FAIL"].includes(declareInfo.declareStatus)) { + btns.unshift( + + ); + btns.unshift( + + ); + } + } + if (intelCalcSalaryStatus && (declareInfo.declareStatus === "DECLARE_SUCCESS_UNPAID")) { + btns.push( + , + + ); + } + if (intelCalcSalaryStatus && declareInfo.taxPaidAmount && parseFloat(declareInfo.taxPaidAmount) > 0) { + btns.push(); + } + return ( + this.setState({ reportType }, () => isInit && this.init())} + onCollapse={showLeft => this.setState({ showLeft })}/>} + onCollapse={showLeft => this.setState({ showLeft })}> +
+ 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))}/> +
+ {/*查看附表*/} + this.setState({ taxSetDialog: { ...taxSetDialog, visible: false } })}/> +
+ +