From 560af8a7039fd96f0dba5cd243958f41c137e8b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 6 Nov 2023 09:24:47 +0800 Subject: [PATCH 01/17] =?UTF-8?q?feature/2.9.42310.01-=E6=8E=A5=E5=8F=A3fe?= =?UTF-8?q?tch=E9=87=8D=E6=96=B0=E5=B0=81=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/archive.js | 289 ++++----------------- pc4mobx/hrmSalary/apis/attendance.js | 248 ++---------------- pc4mobx/hrmSalary/apis/calculate.js | 217 ++-------------- pc4mobx/hrmSalary/apis/cumDeduct.js | 52 +--- pc4mobx/hrmSalary/apis/cumSituation.js | 81 ++---- pc4mobx/hrmSalary/apis/declare.js | 71 ++--- pc4mobx/hrmSalary/apis/item.js | 148 +---------- pc4mobx/hrmSalary/apis/ledger.js | 237 ++--------------- pc4mobx/hrmSalary/apis/mySalaryBenefits.js | 17 +- pc4mobx/hrmSalary/apis/otherDeduct.js | 88 ++----- pc4mobx/hrmSalary/apis/payroll.js | 213 ++------------- pc4mobx/hrmSalary/apis/standingBook.js | 194 ++------------ pc4mobx/hrmSalary/apis/sysconfig.js | 34 +-- pc4mobx/hrmSalary/apis/taxAgent.js | 42 +-- pc4mobx/hrmSalary/apis/taxrate.js | 45 +--- pc4mobx/hrmSalary/apis/welfareArchive.js | 55 +--- pc4mobx/hrmSalary/apis/welfareScheme.js | 81 +----- pc4mobx/hrmSalary/util/request.js | 78 ++++-- 18 files changed, 344 insertions(+), 1846 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/archive.js b/pc4mobx/hrmSalary/apis/archive.js index 5ce04a25..025c17d5 100644 --- a/pc4mobx/hrmSalary/apis/archive.js +++ b/pc4mobx/hrmSalary/apis/archive.js @@ -1,293 +1,112 @@ -import { WeaTools } from 'ecCom'; - -/** - * 薪资档案api - * @param data - */ +import { WeaTools } from "ecCom"; +import { postFetch } from "../util/request"; //薪资档案-薪资档案列表 export const getArchiveList = params => { - return fetch('/api/bs/hrmsalary/salaryArchive/list', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} - - -//薪资档案的高级搜索 -export const getSaCondition = params => { - return WeaTools.callApi('/api/bs/hrmsalary/archives/getSearchCondition', 'get', params); -} - - -//薪资档案-导出薪资档案 -export const exportArchiveList = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/exportList', 'POST', params); -} - -//薪资档案-获取导入参数 -export const getImportArchiveParam = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getImportParams', 'get', params); -} + return postFetch("/api/bs/hrmsalary/salaryArchive/list", params); +}; //薪资档案-获取薪资档案详情表单 export const getArchiveForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getForm', 'get', params); -} - + return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getForm", "get", params); +}; //薪资档案-获取薪资项目调整表单 export const getSalaryItemForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getSalaryItemForm', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getSalaryItemForm", "GET", params); +}; //薪资档案-保存薪资项目调整 export const saveSalaryItem = params => { - return fetch('/api/bs/hrmsalary/salaryArchive/saveSalaryItem', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return postFetch("/api/bs/hrmsalary/salaryArchive/saveSalaryItem", params); +}; //薪资档案-获取个税扣缴义务人调整表单 export const getTaxAgentForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getTaxAgentForm', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getTaxAgentForm", "GET", params); +}; //薪资档案-保存个税扣缴义务人调整 export const saveTaxAgent = params => { - return fetch('/api/bs/hrmsalary/salaryArchive/saveTaxAgent', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} - -//薪资档案-删除个税扣缴义务人调整 -export const deleteTaxAgent = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/deleteTaxAgent', 'GET', params); -} - -//薪资档案操作记录-薪资项目操作记录列表 -export const getItemAdjustList = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchiveOperateLog/salaryItemList', 'POST', params); -} - - -//薪资档案操作记录-薪资项目操作记录列表的高级搜索 -export const getItemAdjustSaCondition = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchiveOperateLog/getSalaryItemSearchCondition', 'GET', params); -} - -//薪资档案操作记录-导出-薪资项目操作记录列表 -export const exportItemAdjust = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchiveOperateLog/exportSalaryItemList', 'POST', params); -} - - -//薪资档案操作记录-个税扣缴义务人操作记录列表 -export const getPersonAdjustList = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchiveOperateLog/salaryItemList', 'POST', params); -} - - -//薪资档案操作记录-个税扣缴义务人操作记录列表的高级搜索 -export const getPersonAdjustSaCondition = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchiveOperateLog/getTaxAgentSearchCondition', 'GET', params); -} - -//薪资档案操作记录-导出-个税扣缴义务人操作记录列表 -export const exportPersonAdjust = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchiveOperateLog/exportTaxAgentList', 'POST', params); -} - -//薪资档案-获取设置表单 -export const getSettingForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getDimissionSetForm', 'GET', params); -} - -//薪资档案-保存离职时段设置 -export const saveSetting = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/saveDimissionSet', 'POST', params); -} - - -//薪资档案-模版下载链接(无数据) -export const downloadSalaryArchiveTemplateurl = `/api/bs/hrmsalary/salaryArchive/downloadTemplate`; - -// 薪资档案- 模版下载 (有之前数据) -export const downloadsalaryArchiveDetail = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/exportList', 'POST', params); -} + return postFetch("/api/bs/hrmsalary/salaryArchive/saveTaxAgent", params); +}; // 获取导入类型 export const getImportTypes = () => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getImportTypes', 'GET', {}); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getImportTypes", "GET", {}); +}; // 获取档案和人员状态类型 export const commonEnumList = (params) => { - return WeaTools.callApi('/api/bs/hrmsalary/common/enum/list', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/common/enum/list", "GET", params); +}; // 发起调薪地址 export const salaryAdjustmentInfo = (params) => { - return WeaTools.callApi('/api/bs/hrmsalary/process/salaryAdjustmentInfo', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/process/salaryAdjustmentInfo", "GET", params); +}; // 导入预览 export const importPreview = (params) => { - return fetch('/api/bs/hrmsalary/salaryArchive/preview', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return postFetch("/api/bs/hrmsalary/salaryArchive/preview", params); +}; // 导入档案 export const importSalaryArchive = (params) => { - return fetch('/api/bs/hrmsalary/salaryArchive/importSalaryArchive', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return postFetch("/api/bs/hrmsalary/salaryArchive/importSalaryArchive", params); +}; // 导出档案 export const exportSalaryArchive = (ids = "") => { - fetch('/api/bs/hrmsalary/salaryArchive/exportList?ids=' + ids).then(res => res.blob().then(blob => { - var filename=`薪资档案.xlsx` - var a = document.createElement('a'); - var url = window.URL.createObjectURL(blob); - a.href = url; - a.download = filename; - a.click(); - window.URL.revokeObjectURL(url); - })) -} + fetch("/api/bs/hrmsalary/salaryArchive/exportList?ids=" + ids).then(res => res.blob().then(blob => { + var filename = `薪资档案.xlsx`; + var a = document.createElement("a"); + var url = window.URL.createObjectURL(blob); + a.href = url; + a.download = filename; + a.click(); + window.URL.revokeObjectURL(url); + })); +}; // 调整记录-个税扣缴义务人列表 export const adjustRecordTaxAgentList = (params) => { - return fetch('/api/bs/hrmsalary/salaryArchive/adjustRecord/taxAgentList', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return postFetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/taxAgentList", params); +}; // 调整记录-薪资项目-列表 export const adjustRecordSalaryItemList = (params) => { - return fetch('/api/bs/hrmsalary/salaryArchive/adjustRecord/salaryItemList', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return postFetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/salaryItemList", params); +}; // 调整记录-薪资项目-单个 export const singleSalaryItemList = (params) => { - return fetch('/api/bs/hrmsalary/salaryArchive/adjustRecord/singleSalaryItemList', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return postFetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/singleSalaryItemList", params); +}; // 调整记录-个税扣缴义务人-单个 export const singleTaxAgentList = (params) => { - return fetch('/api/bs/hrmsalary/salaryArchive/adjustRecord/singleTaxAgentList', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return postFetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/singleTaxAgentList", params); +}; // 调整-义务扣缴人-通过薪资档案的个税扣缴义务人id获取个税扣缴义务人调整表单 export const getTaxAgentFormBySalaryArchiveTaxAgentId = (params) => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getTaxAgentFormBySalaryArchiveTaxAgentId', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getTaxAgentFormBySalaryArchiveTaxAgentId", "GET", params); +}; // 调整-薪资项目-获取调整前的值 export const getSalaryItemAdjustBeforeValue = (params) => { - return fetch('/api/bs/hrmsalary/salaryArchive/getSalaryItemAdjustBeforeValue', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return postFetch("/api/bs/hrmsalary/salaryArchive/getSalaryItemAdjustBeforeValue", params); +}; // 停薪 export const stopSalary = (params) => { - return fetch('/api/bs/hrmsalary/salaryArchive/stopSalary', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} - -// 调整-薪资项目-通过薪资档案的薪资项目id获取薪资项目调整表单 -export const getSalaryItemFormByItemId = (params) => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryArchive/getSalaryItemFormBySalaryArchiveItemId', 'GET', params); -} + return postFetch("/api/bs/hrmsalary/salaryArchive/stopSalary", params); +}; // 删除薪资项目调薪 export const deleteSalaryItem = (params) => { - return fetch(`/api/bs/hrmsalary/salaryArchive/deleteSalaryItem?salaryArchiveItemId=${params.salaryArchiveItemId}`, { - method: 'GET', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - }).then(res => res.json()) -} + return postFetch(`/api/bs/hrmsalary/salaryArchive/deleteSalaryItem?salaryArchiveItemId=${params.salaryArchiveItemId}`, params); +}; export const getSingleSalaryItemInfo = (params) => { - return fetch('/api/bs/hrmsalary/salaryArchive/adjustRecord/getSingleSalaryItemInfo', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return postFetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/getSingleSalaryItemInfo", params); +}; export const editSingleSalaryItem = (params) => { - return fetch('/api/bs/hrmsalary/salaryArchive/adjustRecord/editSingleSalaryItem', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return postFetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/editSingleSalaryItem", params); +}; diff --git a/pc4mobx/hrmSalary/apis/attendance.js b/pc4mobx/hrmSalary/apis/attendance.js index d4a2b304..50fdc9c2 100644 --- a/pc4mobx/hrmSalary/apis/attendance.js +++ b/pc4mobx/hrmSalary/apis/attendance.js @@ -1,294 +1,80 @@ import { WeaTools } from "ecCom"; +import { postFetch } from "../util/request"; //数据采集-考勤引用-考勤数据列表 export const checkOperation = (params) => { - return fetch("/api/bs/hrmsalary/attendQuote/checkOperation", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/attendQuote/checkOperation", params); }; //数据采集-考勤引用-考勤数据列表 export const getAttendanceList = (params) => { - return fetch("/api/bs/hrmsalary/attendQuote/list", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); -}; - -//数据采集-考勤引用-考勤数据-获取导入参数 -export const getImportAttendanceParam = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/attendQuote/getImportParams", - "get", - params - ); + return postFetch("/api/bs/hrmsalary/attendQuote/list", params); }; //数据采集-考勤引用-获取账套列表 export const getLedgerList = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/attendQuote/selectSalarySobList", - "get", - params - ); -}; - -//数据采集-考勤引用-获取引用考勤表单 -export const getAttendanceReferForm = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/attendQuote/getSyncForm", - "get", - params - ); -}; - -//数据采集-考勤引用-获取引用考勤表单周期数据 -export const getAttendanceReferPeriod = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/attendQuote/getSalaryCycleAndAttendCycle", - "post", - params - ); + return WeaTools.callApi("/api/bs/hrmsalary/attendQuote/selectSalarySobList", "get", params); }; //数据采集-考勤引用-同步引用考勤数据 export const syncAttendanceRefer = (params) => { - return fetch("/api/bs/hrmsalary/attendQuote/syncAttendQuoteData", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); -}; - -//数据采集-考勤引用-查看考勤数据 -export const getAttendanceDetail = (params) => { - return WeaTools.callApi("/api/bs/hrmsalary/attendQuote/view", "get", params); + return postFetch("/api/bs/hrmsalary/attendQuote/syncAttendQuoteData", params); }; //数据采集-考勤引用-删除考勤数据 export const deleteAttendance = (params) => { - return fetch("/api/bs/hrmsalary/attendQuote/delete", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); - // return WeaTools.callApi( - // "/api/bs/hrmsalary/attendQuote/delete", - // "POST", - // params - // ); -}; - -//数据采集-考勤引用-导出考勤数据 -export const exportAttendance = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/attendQuote/export", - "POST", - params - ); -}; - -//数据采集- 考勤应用-导出模版+全量数据 -export const exportForTemplate = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/attendQuote/exportForTemplate", - "POST", - params - ); + return postFetch("/api/bs/hrmsalary/attendQuote/delete", params); }; //数据采集-考勤引用-考勤字段管理列表 export const getAttendanceFieldList = (params) => { - return fetch("/api/bs/hrmsalary/attendQuote/fieldList", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); -}; - -//数据采集-考勤引用-获取考勤字段表单 -export const getAttendanceFieldForm = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/attendQuote/getFieldForm", - "get", - params - ); + return postFetch("/api/bs/hrmsalary/attendQuote/fieldList", params); }; //数据采集-考勤引用-新建考勤字段 export const saveAttendanceField = (params) => { - return fetch("/api/bs/hrmsalary/attendQuote/saveField", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); -}; - -//数据采集-考勤引用-修改考勤字段 -export const updateAttendanceField = (params) => { - return fetch("/api/bs/hrmsalary/attendQuote/updateField", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/attendQuote/saveField", params); }; //数据采集-考勤引用-启用/停用自定义字段 export const updateAttendanceFieldStatus = (params) => { - return fetch("/api/bs/hrmsalary/attendQuote/updateEnableStatus", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); -}; - -//数据采集-考勤引用-删除考勤字段 -export const deleteAttendanceField = (params) => { - return fetch("/api/bs/hrmsalary/attendQuote/deleteField", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/attendQuote/updateEnableStatus", params); }; //数据采集-考勤引用-考勤引用字段设置-列表 export const getAttendanceFieldSettingList = (params) => { - return fetch("/api/bs/hrmsalary/attendQuote/fieldSetting/list", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/attendQuote/fieldSetting/list", params); }; //数据采集-考勤引用-考勤引用字段设置-保存 export const saveAttendanceFieldSetting = (params) => { - return fetch("/api/bs/hrmsalary/attendQuote/fieldSetting/save", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/attendQuote/fieldSetting/save", params); }; //数据采集-考勤引用-考勤引用字段设置-恢复默认设置 export const returnToAttendanceFieldSettingDefault = (params) => { - return fetch("/api/bs/hrmsalary/attendQuote/fieldSetting/recoverAsDefault", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/attendQuote/fieldSetting/recoverAsDefault", params); }; //数据采集-考勤引用-考勤引用字段设置-设为默认设置 export const saveAttendanceFieldSettingAsDefault = (params) => { - return fetch("/api/bs/hrmsalary/attendQuote/fieldSetting/saveAsDefault", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); -}; - -// 考勤导入模板下载 -export const downloadTemplate = (salaryYearMonth, salarySobId) => { - // /api/bs/hrmsalary/attendQuote/downloadTemplate - fetch( - "/api/bs/hrmsalary/attendQuote/downloadTemplate?salaryYearMonth=" + - salaryYearMonth + - "&salarySobId=" + - salarySobId - ).then((res) => - res.blob().then((blob) => { - var filename = `考勤导入模板.xlsx`; - var a = document.createElement("a"); - var url = window.URL.createObjectURL(blob); - a.href = url; - a.download = filename; - a.click(); - window.URL.revokeObjectURL(url); - }) - ); + return postFetch("/api/bs/hrmsalary/attendQuote/fieldSetting/saveAsDefault", params); }; // 考勤导入预览 export const previewAttendQuote = (params) => { - return fetch("/api/bs/hrmsalary/attendQuote/preview", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/attendQuote/preview", params); }; // 考勤数据导入 export const importAttendQuoteData = (params) => { - return fetch("/api/bs/hrmsalary/attendQuote/importAttendQuoteData", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/attendQuote/importAttendQuoteData", params); }; // 查看考勤详情 export const viewAttendQuote = (params) => { - return fetch("/api/bs/hrmsalary/attendQuote/view", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/attendQuote/view", params); }; // 根据所属月和账套获取周期 export const getSalaryCycleAndAttendCycle = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/attendQuote/getSalaryCycleAndAttendCycle", - "get", - params - ); + return WeaTools.callApi("/api/bs/hrmsalary/attendQuote/getSalaryCycleAndAttendCycle", "get", params); }; diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index 28067063..a9f7fbc6 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -1,27 +1,14 @@ import { WeaTools } from "ecCom"; +import { postFetch } from "../util/request"; // 薪资记录--薪资核算列表 export const getSalaryAcctList = params => { - return fetch("/api/bs/hrmsalary/salaryacct/list", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/list", params); }; // 薪资记录--保存薪资核算的基本信息 export const saveBasic = params => { - return fetch("/api/bs/hrmsalary/salaryacct/basic/save", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/basic/save", params); }; // 薪资记录--薪资核算详情 @@ -31,49 +18,21 @@ export const salaryacctGetForm = params => { // 核算人员--薪资核算环比上期减少人员列表 export const reducedemployeeList = params => { - return fetch("/api/bs/hrmsalary/salaryacct/reducedemployee/list", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/reducedemployee/list", params); }; // 核算人员--薪资核算环比上月增加人员 export const addedemployeeList = params => { - return fetch("/api/bs/hrmsalary/salaryacct/addedemployee/list", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/addedemployee/list", params); }; // 核算人员--薪资核算人员确认列表 export const acctemployeeList = params => { - return fetch("/api/bs/hrmsalary/salaryacct/acctemployee/list", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/acctemployee/list", params); }; // 核算人员--检查薪资核算人员的个税扣缴义务人 export const checkTaxAgent = params => { - return fetch("/api/bs/hrmsalary/salaryacct/acctemployee/checkTaxAgent", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/acctemployee/checkTaxAgent", params); }; // 薪资记录--获取薪资核算的薪资周期、考勤周期等 @@ -83,14 +42,7 @@ export const getSalarySobCycle = params => { // 核算人员--添加薪资核算人员 export const saveAcctemployee = params => { - return fetch("/api/bs/hrmsalary/salaryacct/acctemployee/save", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/acctemployee/save", params); }; // 核算人员--导出环比减少人员 @@ -121,62 +73,27 @@ export const exportAcctEmployee = (id) => { // 核算人员--删除薪资核算人员 export const deleteAcctemployee = (params) => { - return fetch("/api/bs/hrmsalary/salaryacct/acctemployee/delete", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/acctemployee/delete", params); }; // 核算结果--列表 export const acctResultList = (params) => { - return fetch("/api/bs/hrmsalary/salaryacct/acctresult/list", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/list", params); }; // 核算结果--薪资核算 export const acctresultAccounting = (params) => { - return fetch("/api/bs/hrmsalary/salaryacct/acctresult/accounting", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/accounting", params); }; // 线下比对-列表 export const comparisonresultList = (params) => { - return fetch("/api/bs/hrmsalary/salaryacct/acctresult/accounting", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/accounting", params); }; // 核算人员--刷新薪资核算人员的个税扣缴义务人 export const refreshTaxAgent = (params) => { - return fetch("/api/bs/hrmsalary/salaryacct/acctemployee/refreshTaxAgent", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/acctemployee/refreshTaxAgent", params); }; // 薪资核算-编辑表单 @@ -186,14 +103,7 @@ export const acctresultDetail = (params) => { // 薪资记录--删除薪资核算记录 export const deleteSalaryacct = (params) => { - return fetch("/api/bs/hrmsalary/salaryacct/delete", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/delete", params); }; // 薪资记录--归档薪资核算记录 @@ -208,38 +118,17 @@ export const fileSalaryAcct = (params) => { }; // 薪资记录-回算 export const backCalculate = (params) => { - return fetch("/api/bs/hrmsalary/salaryacct/backCalculate", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/backCalculate", params); }; // 薪资记录-重新核算 export const reAccounting = (params) => { - return fetch("/api/bs/hrmsalary/salaryacct/reAccounting", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/reAccounting", params); }; // 薪资结果-编辑表单保存 export const saveAcctResult = (params) => { - return fetch("/api/bs/hrmsalary/salaryacct/acctresult/save", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/save", params); }; // 核算结果--导入核算结果前生成导入模板时可选的薪资项目 @@ -262,26 +151,12 @@ export const getImportTemplate = (salaryItemIds, salaryAcctRecordId) => { // 核算结果-导入预览 export const previewAcctResult = (params) => { - return fetch("/api/bs/hrmsalary/salaryacct/acctresult/preview", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/preview", params); }; // 核算结果-导入 export const importAcctResult = (params) => { - return fetch("/api/bs/hrmsalary/salaryacct/acctresult/importSalaryAcctResult", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/importSalaryAcctResult", params); }; // 核算结果-导出全部 @@ -299,14 +174,7 @@ export const exportAcctResult = (salaryAcctRecordId, ids) => { // 线下对比-列表 export const comparisonResultList = (params) => { - return fetch("/api/bs/hrmsalary/salaryacct/comparisonresult/list", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/comparisonresult/list", params); }; // 线下对比--结果导入模板 @@ -324,26 +192,12 @@ export const exportImportTemplate = (salaryAcctRecordId) => { // 线下对比--导入预览 export const previewComparisonResult = (params) => { - return fetch("/api/bs/hrmsalary/salaryacct/comparisonresult/preview", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/comparisonresult/preview", params); }; // 线下对比--导入 export const importComparisonExcelAcctResult = (params) => { - return fetch("/api/bs/hrmsalary/salaryacct/comparisonresult/importExcelAcctResult", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/comparisonresult/importExcelAcctResult", params); }; // 线下对比-导出 @@ -371,25 +225,11 @@ export const getColumnDesc = (params) => { // 更新薪资核算结果的锁定状态 export const updateLockStatus = (params) => { - return fetch("/api/bs/hrmsalary/salaryacct/acctresult/updateLockStatus", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/updateLockStatus", params); }; // 导入薪资核算添加表头字段缓存 export const cacheImportField = (params) => { - return fetch("/api/bs/hrmsalary/salaryacct/acctresult/cacheImportField", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/cacheImportField", params); }; //薪资核算-页面查看权限 export const salaryacctAcctresultCheckAuth = params => { @@ -403,12 +243,5 @@ export const getExportField = params => { //薪资核算-导出薪资核算添加表头字段缓存 export const customCacheExportField = (params) => { - return fetch("/api/bs/hrmsalary/salaryacct/acctresult/cacheExportField", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/cacheExportField", params); }; diff --git a/pc4mobx/hrmSalary/apis/cumDeduct.js b/pc4mobx/hrmSalary/apis/cumDeduct.js index fc963bb5..ba918db0 100644 --- a/pc4mobx/hrmSalary/apis/cumDeduct.js +++ b/pc4mobx/hrmSalary/apis/cumDeduct.js @@ -3,23 +3,12 @@ import { postFetch } from "../util/request"; //数据采集-累计专项附加扣除列表 export const getCumDeductList = (params) => { - return fetch("/api/bs/hrmsalary/addUpDeduction/list", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/addUpDeduction/list", params); }; //数据采集-累计专项附加扣除列表的高级搜索 export const getCumDeductSaCondition = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/addUpDeduction/getSearchCondition", - "get", - params - ); + return WeaTools.callApi("/api/bs/hrmsalary/addUpDeduction/getSearchCondition", "get", params); }; //数据采集-累计专项附加扣除-导出 @@ -37,25 +26,9 @@ export const exportCumDeductList = (ids = "") => { ); }; -//数据采集-累计专项附加扣除-获取导入参数 -export const getImportCumDeductParam = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/addUpDeduction/getImportParams", - "get", - params - ); -}; - //数据采集-获取累计专项附加扣除记录 export const getCumDeductDetailList = (params) => { - return fetch("/api/bs/hrmsalary/addUpDeduction/getDetailList", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/addUpDeduction/getDetailList", params); }; //数据采集-累计专项附加扣除-导出明细 @@ -80,29 +53,14 @@ export const exportCumDeductDetailList = (id, ids = "") => { // 数据采集-获取累计专项附加扣除-导入 export const importCumDeductParam = (params) => { - return fetch("/api/bs/hrmsalary/addUpDeduction/importAddUpDeduction", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/addUpDeduction/importAddUpDeduction", params); }; // 数据采集-获取累计专项附加扣除-导入预览 export const importCumDeductPreview = (params) => { - return fetch("/api/bs/hrmsalary/addUpDeduction/preview", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/addUpDeduction/preview", params); }; - //新增累计专项附加扣除 export const createAddUpDeduction = (params) => { return postFetch("/api/bs/hrmsalary/addUpDeduction/createAddUpDeduction", params); diff --git a/pc4mobx/hrmSalary/apis/cumSituation.js b/pc4mobx/hrmSalary/apis/cumSituation.js index 512f3d14..69df7644 100644 --- a/pc4mobx/hrmSalary/apis/cumSituation.js +++ b/pc4mobx/hrmSalary/apis/cumSituation.js @@ -1,25 +1,14 @@ import { WeaTools } from "ecCom"; -import { postFetch } from '../util/request'; +import { postFetch } from "../util/request"; //数据采集-累计情况列表 export const getCumSituationList = (params) => { - return fetch("/api/bs/hrmsalary/addUpSituation/list", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/addUpSituation/list", params); }; //数据采集-累计情况列表的高级搜索 export const getCumSituationSaCondition = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/addUpSituation/getSearchCondition", - "get", - params - ); + return WeaTools.callApi("/api/bs/hrmsalary/addUpSituation/getSearchCondition", "get", params); }; //数据采集-累计情况-导出 @@ -37,34 +26,18 @@ export const exportCumSituationList = (ids) => { ); }; -//数据采集-累计情况-获取导入参数 -export const getImportCumSituationParam = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/addUpSituation/getImportParams", - "get", - params - ); -}; - //数据采集-获取累计情况记录 export const getCumSituationDetailList = (params) => { - return fetch("/api/bs/hrmsalary/addUpSituation/getDetailList", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/addUpSituation/getDetailList", params); }; //数据采集-累计情况-导出明细 -export const exportCumSituationDetailList = (id, ids = "", taxAgentId='') => { +export const exportCumSituationDetailList = (id, ids = "", taxAgentId = "") => { fetch( "/api/bs/hrmsalary/addUpSituation/exportDetail?accumulatedSituationId=" + - id + - "&ids=" + - ids + "&taxAgentId=" + taxAgentId + id + + "&ids=" + + ids + "&taxAgentId=" + taxAgentId ).then((res) => res.blob().then((blob) => { var filename = `往期累计情况(工资、薪金).xlsx`; @@ -80,44 +53,30 @@ export const exportCumSituationDetailList = (id, ids = "", taxAgentId='') => { // 数据采集-累计情况-导入 export const importCumSituationParam = (params) => { - return fetch("/api/bs/hrmsalary/addUpSituation/importAddUpSituation", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/addUpSituation/importAddUpSituation", params); }; // 数据采集-累计情况-导入预览 export const importCumSituationPreview = (params) => { - return fetch("/api/bs/hrmsalary/addUpSituation/preview", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/addUpSituation/preview", params); }; //新建往期累计情况 export const createAddUpSituation = (params) => { - return postFetch('/api/bs/hrmsalary/addUpSituation/createAddUpSituation', params); -} + return postFetch("/api/bs/hrmsalary/addUpSituation/createAddUpSituation", params); +}; //编辑往期累计情况 export const editAddUpSituation = (params) => { - return postFetch('/api/bs/hrmsalary/addUpSituation/editAddUpSituation', params); -} + return postFetch("/api/bs/hrmsalary/addUpSituation/editAddUpSituation", params); +}; //删除所选往期累计情况 export const deleteSelectAddUpSituation = (params) => { - return postFetch('/api/bs/hrmsalary/addUpSituation/deleteSelectAddUpSituation', params); -} + return postFetch("/api/bs/hrmsalary/addUpSituation/deleteSelectAddUpSituation", params); +}; //一键清空往期累计情况 export const deleteAllAddUpSituation = (params) => { - return postFetch('/api/bs/hrmsalary/addUpSituation/deleteAllAddUpSituation', params); -} + return postFetch("/api/bs/hrmsalary/addUpSituation/deleteAllAddUpSituation", params); +}; //查看信息 export const getAddUpSituation = (params) => { - return postFetch('/api/bs/hrmsalary/addUpSituation/getAddUpSituation', params); -} + return postFetch("/api/bs/hrmsalary/addUpSituation/getAddUpSituation", params); +}; diff --git a/pc4mobx/hrmSalary/apis/declare.js b/pc4mobx/hrmSalary/apis/declare.js index 360c8b62..2c37805d 100644 --- a/pc4mobx/hrmSalary/apis/declare.js +++ b/pc4mobx/hrmSalary/apis/declare.js @@ -1,68 +1,41 @@ -import { WeaTools } from 'ecCom'; -import { postFetch } from '../util/request'; +import { WeaTools } from "ecCom"; +import { postFetch } from "../util/request"; //个税申报表-个税申报表列表 export const getDeclareList = params => { - return fetch('/api/bs/hrmsalary/taxdeclaration/list', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} - -//个税申报表-个税申报表表单 -export const getDeclareForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/taxdeclaration/getForm', 'get', params); -} + return postFetch("/api/bs/hrmsalary/taxdeclaration/list", params); +}; //个税申报表-个税申报表生成 export const saveDeclare = params => { - return fetch('/api/bs/hrmsalary/taxdeclaration/save', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return postFetch("/api/bs/hrmsalary/taxdeclaration/save", params); +}; //个税申报表-个税申报表相关信息 export const getDeclareInfo = params => { - return WeaTools.callApi('/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationInfo', 'get', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationInfo", "get", params); +}; // 个税申报表详情列表 export const getDetailList = params => { - return fetch('/api/bs/hrmsalary/taxdeclaration/detail/list', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} - + return postFetch("/api/bs/hrmsalary/taxdeclaration/detail/list", params); +}; // 个税申报表导出 export const exportSalaryArchive = (id = "") => { - fetch('/api/bs/hrmsalary/taxdeclaration/export?taxDeclarationId=' + id).then(res => res.blob().then(blob => { - var filename=`个税申报表.xlsx` - var a = document.createElement('a'); - var url = window.URL.createObjectURL(blob); - a.href = url; - a.download = filename; - a.click(); - window.URL.revokeObjectURL(url); - })) -} + fetch("/api/bs/hrmsalary/taxdeclaration/export?taxDeclarationId=" + id).then(res => res.blob().then(blob => { + var filename = `个税申报表.xlsx`; + var a = document.createElement("a"); + var url = window.URL.createObjectURL(blob); + a.href = url; + a.download = filename; + a.click(); + window.URL.revokeObjectURL(url); + })); +}; //个税申报表-撤回申报 export const withDrawTaxDeclaration = (params) => { - return postFetch('/api/bs/hrmsalary/taxdeclaration/withDrawTaxDeclaration', params); -} + return postFetch("/api/bs/hrmsalary/taxdeclaration/withDrawTaxDeclaration", params); +}; diff --git a/pc4mobx/hrmSalary/apis/item.js b/pc4mobx/hrmSalary/apis/item.js index 2d23377a..ab4ff6c2 100644 --- a/pc4mobx/hrmSalary/apis/item.js +++ b/pc4mobx/hrmSalary/apis/item.js @@ -1,25 +1,9 @@ import { WeaTools } from "ecCom"; - -/** - * 薪资项目api - * @param data - */ +import { postFetch } from "../util/request"; // 薪资项目-获取列表 export const getItemList = params => { - return fetch("/api/bs/hrmsalary/salaryitem/list", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); -}; - -//薪资项目的高级搜索 -export const getSaCondition = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryitem/getSearchCondition", "GET", params); + return postFetch("/api/bs/hrmsalary/salaryitem/list", params); }; //数据源列表字典项 @@ -29,61 +13,23 @@ export const formulaDatasourceList = params => { //薪资项目-系统薪资项目列表 export const getSysItemList = params => { - return fetch("/api/bs/hrmsalary/salaryitem/sysList", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); -}; - -//系统薪资项目的高级搜索 -export const getSysSaCondition = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryitem/getSysSearchCondition", "GET", params); + return postFetch("/api/bs/hrmsalary/salaryitem/sysList", params); }; //薪资项目-批量删除薪资项目 export const deleteItem = params => { - return fetch("/api/bs/hrmsalary/salaryitem/delete", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryitem/delete", params); }; //薪资项目-批量删除列表 export const deleteItemList = params => { - return fetch("/api/bs/hrmsalary/salaryitem/listCanDelete", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryitem/listCanDelete", params); }; //薪资项目-新增薪资项目 export const saveItem = params => { delete params.formulaContent; - return fetch("/api/bs/hrmsalary/salaryitem/save", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); -}; - -//薪资项目-更新薪资项目 -export const updateItem = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryitem/update", "POST", params); + return postFetch("/api/bs/hrmsalary/salaryitem/save", params); }; //薪资项目-薪资项目详情 @@ -93,100 +39,41 @@ export const getItemForm = params => { //薪资项目-添加系统薪资项目 export const saveSysItem = params => { - return fetch("/api/bs/hrmsalary/salaryitem/saveSys", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryitem/saveSys", params); }; -//获取薪资项目可选的类型(与属性有联动) -export const getItemTypeOption = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryitem/listSalaryItemTypeOption", "GET", params); -}; //获取公式描述 export const getFormulaDes = params => { return WeaTools.callApi("/api/bs/hrmsalary/formula/des", "GET", params); }; -// *** 公式 start *** // 获取公式变量类型 export const formualSearchGroup = params => { - return fetch("/api/bs/hrmsalary/formula/search/group", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/formula/search/group", params); }; //获取公式变量字段 export const formualSearchField = params => { - return fetch("/api/bs/hrmsalary/formula/search/field", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/formula/search/field", params); }; -// /api/bs/hrmsalary/formula/save // 保存公式 export const saveFormual = params => { - return fetch("/api/bs/hrmsalary/formula/save", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/formula/save", params); }; // 公式测试 export const testFormual = params => { - return fetch("/api/bs/hrmsalary/formula/mock", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/formula/mock", params); }; // 根据id获取formual export const detailFormual = params => { - return fetch("/api/bs/hrmsalary/formula/detail", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/formula/detail", params); }; - -// *** 公式 end *** - - // 列出可以删除的薪资项目 export const listCanDelete = params => { - return fetch("/api/bs/hrmsalary/salaryitem/listCanDelete", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryitem/listCanDelete", params); }; //获取哪些账套中使用了该薪资项目 @@ -195,12 +82,5 @@ export const getSalarySobBySalaryItem = params => { }; // 同步到薪资账套 export const syncSalaryItemToSalarySobItem = params => { - return fetch("/api/bs/hrmsalary/salaryitem/syncSalaryItemToSalarySobItem ", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryitem/syncSalaryItemToSalarySobItem", params); }; diff --git a/pc4mobx/hrmSalary/apis/ledger.js b/pc4mobx/hrmSalary/apis/ledger.js index c74cf8b7..487181bc 100644 --- a/pc4mobx/hrmSalary/apis/ledger.js +++ b/pc4mobx/hrmSalary/apis/ledger.js @@ -8,171 +8,64 @@ export const getLedgerList = params => { //启用/禁用薪资帐套 export const changeLedgerStatus = params => { - return fetch("/api/bs/hrmsalary/salarysob/disable", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salarysob/disable", params); }; //复制薪资帐套 export const duplicateLedger = params => { - return fetch("/api/bs/hrmsalary/salarysob/duplicate", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salarysob/duplicate", params); }; //删除薪资帐套 export const deleteLedger = params => { - return fetch("/api/bs/hrmsalary/salarysob/delete", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salarysob/delete", params); }; //薪资帐套基本信息表单 export const getLedgerBasicForm = params => { - return WeaTools.callApi( - "/api/bs/hrmsalary/salarysob/basic/getForm", - "get", - params - ); - // return fetch('/api/bs/hrmsalary/salarysob/basic/getForm', { - // method: 'POST', - // mode: 'cors', - // headers: { - // 'Content-Type': 'application/json' - // }, - // body: JSON.stringify(params) - // }).then(res => res.json()) + return WeaTools.callApi("/api/bs/hrmsalary/salarysob/basic/getForm", "get", params); }; //保存薪资帐套基本信息 export const saveLedgerBasic = params => { - return fetch("/api/bs/hrmsalary/salarysob/basic/save", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salarysob/basic/save", params); }; //薪资帐套外部人员范围(包含)列表 export const getLedgerPersonRangeExtList = params => { - return fetch("/api/bs/hrmsalary/salarysob/range/ext/list", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salarysob/range/ext/list", params); }; //薪资帐套人员范围(包含)列表 export const getLedgerPersonRangeInclude = params => { - return fetch("/api/bs/hrmsalary/salarysob/range/listInclude", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salarysob/range/listInclude", params); }; //薪资帐套人员范围(排除)列表 export const getLedgerPersonRangeExclude = params => { - return fetch("/api/bs/hrmsalary/salarysob/range/listExclude", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); -}; - -//薪资帐套人员范围表单 -export const getLedgerPersonRangeForm = params => { - return WeaTools.callApi( - "/api/bs/hrmsalary/salarysob/range/getForm", - "get", - params - ); + return postFetch("/api/bs/hrmsalary/salarysob/range/listExclude", params); }; //保存薪资帐套外部人员范围 export const saveLedgerPersonExtRange = params => { - return fetch("/api/bs/hrmsalary/salarysob/ext/save", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salarysob/ext/save", params); }; //删除薪资帐套外部人员范围 export const deleteLedgerPersonExtRange = params => { - return fetch("/api/bs/hrmsalary/salarysob/range/ext/delete", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salarysob/range/ext/delete", params); }; //保存薪资帐套人员范围 export const saveLedgerPersonRange = params => { - return fetch("/api/bs/hrmsalary/salarysob/range/save", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salarysob/range/save", params); }; //删除薪资帐套人员范围 export const deleteLedgerPersonRange = params => { - return fetch("/api/bs/hrmsalary/salarysob/range/delete", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); -}; - -//薪资帐套项目分组的详情 -export const getLedgerItemGroupForm = params => { - return WeaTools.callApi( - "/api/bs/hrmsalary/salarysob/item/group/getForm", - "get", - params - ); + return postFetch("/api/bs/hrmsalary/salarysob/range/delete", params); }; //保存薪资帐套薪资项目 export const saveLedgerItem = params => { - const { itemGroups, items, ...extra } = params; + const { itemGroups, items, ...extra } = params; const payload = { itemGroups: _.map(itemGroups, item => { return { @@ -189,136 +82,52 @@ export const saveLedgerItem = params => { }) || [], ...extra }; - - - return fetch("/api/bs/hrmsalary/salarysob/item/save", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(payload) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salarysob/item/save", payload); }; //薪资帐套薪资项目详情 export const getLedgerItemForm = params => { - return WeaTools.callApi( - "/api/bs/hrmsalary/salarysob/item/getForm", - "get", - params - ); + return WeaTools.callApi("/api/bs/hrmsalary/salarysob/item/getForm", "get", params); }; //薪资帐套校验规则列表 export const getLedgerRuleList = params => { - return fetch("/api/bs/hrmsalary/salarysob/checkrule/list", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); -}; - -//薪资帐套校验规则表单 -export const getLedgerRuleForm = params => { - return WeaTools.callApi( - "/api/bs/hrmsalary/salarysob/checkrule/getForm", - "get", - params - ); + return postFetch("/api/bs/hrmsalary/salarysob/checkrule/list", params); }; //保存薪资帐套校验规则 export const saveLedgerRule = params => { - return fetch("/api/bs/hrmsalary/salarysob/checkrule/save", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); -}; - -//编辑薪资帐套校验规则公式 -export const updateLedgerRuleFormula = params => { - return WeaTools.callApi( - "/api/bs/hrmsalary/salarysob/checkrule/formula/update", - "POST", - params - ); + return postFetch("/api/bs/hrmsalary/salarysob/checkrule/save", params); }; //删除薪资帐套校验规则 export const deleteLedgerRule = params => { - return fetch("/api/bs/hrmsalary/salarysob/checkrule/delete", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salarysob/checkrule/delete", params); }; // 薪资项目可选列表 export const listSalaryItem = params => { - return fetch("/api/bs/hrmsalary/salarysob/item/listSalaryItem", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salarysob/item/listSalaryItem", params); }; // 员工信息字段列表 export const empFieldList = () => { - return WeaTools.callApi( - "/api/bs/hrmsalary/salarysob/empField/list", - "GET", - {} - ); + return WeaTools.callApi("/api/bs/hrmsalary/salarysob/empField/list", "GET", {}); }; // 调薪计薪规则可选的薪资项目列表 export const listSalarySobItem = params => { - return fetch("/api/bs/hrmsalary/salarysob/adjustmentrule/listSalarySobItem", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salarysob/adjustmentrule/listSalarySobItem", params); }; // 调薪计薪规则保存 export const saveAdjustmentRule = params => { - return fetch("/api/bs/hrmsalary/salarysob/adjustmentrule/save", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salarysob/adjustmentrule/save", params); }; // 调薪计薪规则列表 export const listAdjustmentRule = params => { - return fetch("/api/bs/hrmsalary/salarysob/adjustmentrule/list", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salarysob/adjustmentrule/list", params); }; //获取回算薪资项目 diff --git a/pc4mobx/hrmSalary/apis/mySalaryBenefits.js b/pc4mobx/hrmSalary/apis/mySalaryBenefits.js index d28d7ed7..2cd64d80 100644 --- a/pc4mobx/hrmSalary/apis/mySalaryBenefits.js +++ b/pc4mobx/hrmSalary/apis/mySalaryBenefits.js @@ -1,25 +1,12 @@ import { WeaTools } from "ecCom"; -import { formHeaderPost } from "../util/request"; +import { formHeaderPost, postFetch } from "../util/request"; import { convertToUrlString } from "../util/url"; // 工资单列表 export const mySalaryBillList = params => { - return fetch("/api/bs/hrmsalary/salaryBill/mySalaryBillList", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryBill/mySalaryBillList", params); }; -// 社保福利列表 -export const welfareList = params => { - return WeaTools.callApi("/api/bs/hrmsalary/report/welfare/list", "GET", params); -}; - - // 调薪记录列表 export const recordList = params => { return WeaTools.callApi("/api/bs/hrmsalary/report/record/list", "GET", params); diff --git a/pc4mobx/hrmSalary/apis/otherDeduct.js b/pc4mobx/hrmSalary/apis/otherDeduct.js index edf7211d..4797a844 100644 --- a/pc4mobx/hrmSalary/apis/otherDeduct.js +++ b/pc4mobx/hrmSalary/apis/otherDeduct.js @@ -1,34 +1,14 @@ import { WeaTools } from "ecCom"; -import { postFetch } from '../util/request'; +import { postFetch } from "../util/request"; //数据采集-其他免税扣除列表 export const getOtherDeductList = (params) => { - return fetch("/api/bs/hrmsalary/otherDeduction/list", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/otherDeduction/list", params); }; //数据采集-其他免税扣除列表的高级搜索 export const getOtherDeductSaCondition = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/otherDeduction/getSearchCondition", - "get", - params - ); -}; - -//数据采集-其他免税扣除-获取导入参数 -export const getImportOtherDeductParam = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/otherDeduction/getImportParams", - "get", - params - ); + return WeaTools.callApi("/api/bs/hrmsalary/otherDeduction/getSearchCondition", "get", params); }; //数据采集-其他免税扣除-导出 @@ -44,32 +24,20 @@ export const exportOtherDeductList = (ids = "") => { window.URL.revokeObjectURL(url); }) ); - // return WeaTools.callApi( - // "/api/bs/hrmsalary/otherDeduction/export", - // "POST", - // params - // ); }; //数据采集-获取其他免税扣除记录 export const getOtherDeductDetailList = (params) => { - return fetch("/api/bs/hrmsalary/otherDeduction/getDetailList", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/otherDeduction/getDetailList", params); }; //数据采集-其他免税扣除-导出明细 export const exportOtherDeductDetailList = (id, ids) => { fetch( "/api/bs/hrmsalary/otherDeduction/exportDetail?otherTaxExemptDeductionId=" + - id + - "&ids=" + - ids + "&taxAgentId=" + taxAgentId + id + + "&ids=" + + ids + "&taxAgentId=" + taxAgentId ).then((res) => res.blob().then((blob) => { var filename = `其他免税扣除.xlsx`; @@ -85,49 +53,35 @@ export const exportOtherDeductDetailList = (id, ids) => { // 数据采集-其他免税扣除-导入 export const importOtherDeductionParam = (params) => { - return fetch("/api/bs/hrmsalary/otherDeduction/importData", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/otherDeduction/importData", params); }; // 数据采集-其他免税扣除-导入预览 export const importOtherDeductionPreview = (params) => { - return fetch("/api/bs/hrmsalary/otherDeduction/preview", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(params), - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/otherDeduction/preview", params); }; //新增其他免税扣除 export const createData = (params) => { - return postFetch('/api/bs/hrmsalary/otherDeduction/createData', params); -} + return postFetch("/api/bs/hrmsalary/otherDeduction/createData", params); +}; //查看信息 export const getData = (params) => { - return postFetch('/api/bs/hrmsalary/otherDeduction/getData', params); -} + return postFetch("/api/bs/hrmsalary/otherDeduction/getData", params); +}; //编辑其他免税扣除 export const editData = (params) => { - return postFetch('/api/bs/hrmsalary/otherDeduction/editData', params); -} + return postFetch("/api/bs/hrmsalary/otherDeduction/editData", params); +}; //批量删除其他免税扣除 export const deleteSelectData = (params) => { - return postFetch('/api/bs/hrmsalary/otherDeduction/deleteSelectData', params); -} + return postFetch("/api/bs/hrmsalary/otherDeduction/deleteSelectData", params); +}; //一键清空其他免税扣除 export const deleteAllData = (params) => { - return postFetch('/api/bs/hrmsalary/otherDeduction/deleteAllData', params); -} + return postFetch("/api/bs/hrmsalary/otherDeduction/deleteAllData", params); +}; //沿用上月 export const extendToLastMonth = (params) => { - return postFetch('/api/bs/hrmsalary/otherDeduction/extendToLastMonth', params); -} + return postFetch("/api/bs/hrmsalary/otherDeduction/extendToLastMonth", params); +}; diff --git a/pc4mobx/hrmSalary/apis/payroll.js b/pc4mobx/hrmSalary/apis/payroll.js index 890c7069..4f12eda9 100644 --- a/pc4mobx/hrmSalary/apis/payroll.js +++ b/pc4mobx/hrmSalary/apis/payroll.js @@ -4,14 +4,7 @@ import { convertToUrlString } from "../util/url"; //工资单-工资单发放列表 export const getPayrollList = params => { - return fetch("/api/bs/hrmsalary/salaryBill/send/list", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryBill/send/list", params); }; // 工资单发放进度条 export const getPayrollIssuanceProgressBar = (id) => { @@ -20,68 +13,32 @@ export const getPayrollIssuanceProgressBar = (id) => { //工资单-获取table提示信息 export const getPayrollInfo = params => { - return WeaTools.callApi( - "/api/bs/hrmsalary/salaryBill/send/getBaseInfo", - "get", - params - ); + return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/send/getBaseInfo", "get", params); }; //工资单-获取工资单发放高级搜索 export const getPaySa = params => { - return WeaTools.callApi( - "/api/bs/hrmsalary/salaryBill/send/getInfoSearchCondition", - "get", - params - ); + return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/send/getInfoSearchCondition", "get", params); }; //工资单-工资单发放 export const grantPayroll = params => { - return fetch("/api/bs/hrmsalary/salaryBill/send/grant", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryBill/send/grant", params); }; //工资单-工资单撤回 export const withdrawPayroll = params => { - return fetch("/api/bs/hrmsalary/salaryBill/send/withdraw", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryBill/send/withdraw", params); }; //工资单-工资单发放详情列表 export const getPayrollDetailList = params => { - return fetch("/api/bs/hrmsalary/salaryBill/send/detailList", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryBill/send/detailList", params); }; //工资单-工资单发放详情列表的高级搜索 export const getPayrollDetailSa = params => { - return fetch("/api/bs/hrmsalary/salaryBill/send/getDetailSearchCondition", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryBill/send/getDetailSearchCondition", params); }; //工资单-导出-工资单发放信息列表 @@ -108,150 +65,58 @@ export const exportPayroll = params => { //工资单-工资单模板列表 export const getPayrollTemplateList = params => { - return fetch("/api/bs/hrmsalary/salaryBill/template/list", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryBill/template/list", params); }; //工资单-获取薪资账套下拉列表 export const getPayrollTemplateLedgerList = params => { - return WeaTools.callApi( - "/api/bs/hrmsalary/salaryBill/template/selectSalarySobList", - "POST", - params - ); + return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/template/selectSalarySobList", "POST", params); }; //工资单-获取工资单基础设置表单 export const getPayrollBaseForm = params => { - return WeaTools.callApi( - "/api/bs/hrmsalary/salaryBill/template/getBaseForm", - "get", - params - ); + return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/template/getBaseForm", "get", params); }; //工资单-获取工资单显示设置表单 export const getPayrollShowForm = params => { - return WeaTools.callApi( - "/api/bs/hrmsalary/salaryBill/template/getShowForm", - "get", - params - ); + return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/template/getShowForm", "get", params); }; //工资单-获取工资单薪资项目设置 export const getPayrollItemList = params => { - return WeaTools.callApi( - "/api/bs/hrmsalary/salaryBill/template/getSalaryItemSet", - "get", - params - ); + return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/template/getSalaryItemSet", "get", params); }; //工资单-更改默认使用 export const changePayrollDefaultUse = params => { - return fetch("/api/bs/hrmsalary/salaryBill/template/defaultUse", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryBill/template/defaultUse", params); }; //工资单-新建工资单 export const savePayroll = params => { - return fetch("/api/bs/hrmsalary/salaryBill/template/save", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryBill/template/save", params); }; //工资单-编辑工资单 export const updatePayroll = params => { const { background, ...extra } = params; - return fetch("/api/bs/hrmsalary/salaryBill/template/update", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify({ background: _.isNil(background) ? "" : background, ...extra }) - }).then(res => res.json()); -}; - -//工资单-编辑工资单-编辑基础设置 -export const updatePayrollBase = params => { - return WeaTools.callApi( - "/api/bs/hrmsalary/salaryBill/template/updateBase", - "POST", - params - ); -}; - -//工资单-编辑工资单-编辑显示设置 -export const updatePayrollShow = params => { - return WeaTools.callApi( - "/api/bs/hrmsalary/salaryBill/template/updateShow", - "POST", - params - ); + return postFetch("/api/bs/hrmsalary/salaryBill/template/update", { background: _.isNil(background) ? "" : background, ...extra }); }; //工资单-复制工资单 export const duplicatePayroll = params => { - return fetch("/api/bs/hrmsalary/salaryBill/template/copy", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryBill/template/copy", params); }; //工资单-删除工资单 export const deletePayroll = params => { - return fetch("/api/bs/hrmsalary/salaryBill/template/delete", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); -}; - -//工资单-获取租户名 -export const getTenantName = params => { - return WeaTools.callApi( - "/api/bs/hrmsalary/salaryBill/template/getTenantName", - "get", - params - ); + return postFetch("/api/bs/hrmsalary/salaryBill/template/delete", params); }; // 工资单发放-工资单发放信息列表 export const getInfoList = params => { - return fetch("/api/bs/hrmsalary/salaryBill/send/infoList", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryBill/send/infoList", params); }; // 工资单发放-导出-工资单发放详情列表 @@ -278,59 +143,27 @@ export const exportDetailList = params => { // 工资单发放-工资单批量发放信息列表 export const batchSendInfoList = params => { - return fetch("/api/bs/hrmsalary/salaryBill/send/batchSendInfoList", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryBill/send/batchSendInfoList", params); }; // 工资单发放-工资单批量撤回信息列表 export const batchWithdrawInfoList = params => { - return fetch("/api/bs/hrmsalary/salaryBill/send/batchWithdrawInfoList", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryBill/send/batchWithdrawInfoList", params); }; // 工资单发放-按钮状态 export const getSendBtnStatus = params => { - return WeaTools.callApi( - "/api/bs/hrmsalary/salaryBill/send/getSendBtnStatus", - "get", - params - ); + return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/send/getSendBtnStatus", "get", params); }; // 工资单发放-扩展按钮点击 export const grantProxy = params => { - return fetch("/api/bs/hrmsalary/salaryBill/grantProxy", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryBill/grantProxy", params); }; // 工资单发放-新建时获取补发工资单模板薪资项目设置 export const getReplenishForm = params => { - return fetch("/api/bs/hrmsalary/salaryBill/template/getReplenishForm", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryBill/template/getReplenishForm", params); }; // 工资单发放-获取规则设置下拉框 diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index cef1aa55..118e6fbc 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -3,15 +3,7 @@ import { postExportFetch, postFetch } from "../util/request"; //社会福利台账-获取正常缴纳列表 export const getCommonList = (params) => { - // return WeaTools.callApi('/api/bs/hrmsalary/siaccount/batch/list', 'POST', params); - return fetch("/api/bs/hrmsalary/siaccount/batch/list", { - method: "post", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/siaccount/batch/list", params); }; //社会福利台账-获取tab列表 @@ -21,241 +13,101 @@ export const getTabList = (params) => { //社会福利台账-获取正常缴纳列表 export const getNormalList = (params) => { - // return WeaTools.callApi('/api/bs/hrmsalary/siaccount/detail/common/list', 'get', params); - return fetch("/api/bs/hrmsalary/siaccount/detail/common/list", { - method: "post", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/siaccount/detail/common/list", params); }; //社会福利台账-获取补缴列表 export const getSupplementaryList = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/detail/supplementary/list", { - method: "post", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/siaccount/detail/supplementary/list", params); }; //社会福利台账-获取总览列表 export const getOverViewList = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/overView", { - method: "post", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/siaccount/overView", params); }; //社会福利台账-获取异常列表 export const getChangeList = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/changeList", { - method: "post", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/siaccount/changeList", params); }; //社会福利台账-保存并进入核算 export const save = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/save", { - method: "post", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/siaccount/save", params); }; //社会福利台账-归档 export const siaccountFile = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/file", { - method: "post", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/siaccount/file", params); }; //社会福利台账-核算异常列表 export const inspectList = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/inspectList", { - method: "post", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/siaccount/inspectList", params); }; //社会福利台账-删除正常缴纳人员 export const siaccountCommonDelete = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/common/delete", { - method: "post", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/siaccount/common/delete", params); }; //社会福利台账-添加正常缴纳人员 export const siaccountCommonSave = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/common/save", { - method: "post", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/siaccount/common/save", params); }; //社会福利台账-添加补缴人员 export const siaccountSupplementarySave = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/supplementary/save", { - method: "post", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/siaccount/supplementary/save", params); }; //社会福利台账-删除月份表单 export const siaccountDelete = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/delete", { - method: "post", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/siaccount/delete", params); }; //社会福利台账-正常缴纳添加缴纳人员表单 export const siaccountCommonForm = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/siaccount/commonForm", - "get", - params - ); + return WeaTools.callApi("/api/bs/hrmsalary/siaccount/commonForm", "get", params); }; //社会福利台账-补缴添加缴纳人员表单 export const querySupplementaryForm = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/siaccount/querySupplementaryForm", - "get", - params - ); + return WeaTools.callApi("/api/bs/hrmsalary/siaccount/querySupplementaryForm", "get", params); }; // 核算详情页核算 export const commonAccount = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/commonAccount", { - method: "post", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/siaccount/commonAccount", params); }; // 社保福利台账重新核算 export const socialSecurityBenefitsRecalculate = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/socialSecurityBenefitsRecalculate", { - method: "post", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/siaccount/socialSecurityBenefitsRecalculate", params); }; // 获取当前管理员下的所有的个税扣缴义务人 export const getAdminTaxAgentList = () => { - return WeaTools.callApi( - "/api/bs/hrmsalary/siaccount/getAdminTaxAgentList", - "get", - {} - ); + return WeaTools.callApi("/api/bs/hrmsalary/siaccount/getAdminTaxAgentList", "get", {}); }; // 表单字段对应的接口 export const getWelfareList = () => { - return WeaTools.callApi( - "/api/bs/hrmsalary/siaccount/getWelfareList", - "get", - {} - ); + return WeaTools.callApi("/api/bs/hrmsalary/siaccount/getWelfareList", "get", {}); }; // 补差表单字段对应的接口 export const getBalanceWelfareList = () => { - return WeaTools.callApi( - "/api/bs/hrmsalary/siaccount/getBalanceWelfareList", - "get", - {} - ); + return WeaTools.callApi("/api/bs/hrmsalary/siaccount/getBalanceWelfareList", "get", {}); }; // 社保福利台账-导入预览 export const welfarePreview = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/welfare/preview", { - method: "post", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/siaccount/welfare/preview", params); }; // 社保福利台账-核算数据导入 export const importInsuranceAcctDetail = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/welfare/importInsuranceAcctDetail", { - method: "post", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/siaccount/welfare/importInsuranceAcctDetail", params); }; // 社保福利台账-补差数据导入 export const importBalanceInsuranceDetail = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/welfare/importBalanceInsuranceDetail", { - method: "post", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/siaccount/welfare/importBalanceInsuranceDetail", params); }; // 社保福利台账-线下对比数据导入 export const importExcelInsuranceDetail = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/comparisonwelfare/importExcelInsuranceDetail", { - method: "post", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/siaccount/comparisonwelfare/importExcelInsuranceDetail", params); }; //获取当前登录人所控制的人员范围 diff --git a/pc4mobx/hrmSalary/apis/sysconfig.js b/pc4mobx/hrmSalary/apis/sysconfig.js index 86e0e7b9..52b1878e 100644 --- a/pc4mobx/hrmSalary/apis/sysconfig.js +++ b/pc4mobx/hrmSalary/apis/sysconfig.js @@ -1,38 +1,18 @@ -import { WeaTools } from 'ecCom'; +import { WeaTools } from "ecCom"; +import { postFetch } from "../util/request"; export const getSysList = params => { - return fetch('/api/bs/hrmsalary/sys/list', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) + return postFetch("/api/bs/hrmsalary/sys/list", params); }; export const sysSave = params => { - return fetch('/api/bs/hrmsalary/sys/save', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) + return postFetch("/api/bs/hrmsalary/sys/save", params); }; export const sysUpdate = params => { - return fetch('/api/bs/hrmsalary/sys/update', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) + return postFetch("/api/bs/hrmsalary/sys/update", params); }; export const getSysDetail = params => { - return WeaTools.callApi('/api/bs/hrmsalary/sys/detail', 'get', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/sys/detail", "get", params); +}; diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index 1b0f58d8..f3c527b1 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -3,34 +3,16 @@ import { postFetch } from "../util/request"; //个税扣缴义务人列表 export const getTaxAgentList = (params) => { - return fetch("/api/bs/hrmsalary/taxAgent/list", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/taxAgent/list", params); }; //同步人员范围 export const taxAgentRangeSync = (params) => { - return fetch("/api/bs/hrmsalary/taxAgent/range/sync", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then((res) => res.json()); + return postFetch("/api/bs/hrmsalary/taxAgent/range/sync", params); }; // 系统管理员权限 export const getPermission = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/taxAgent/permission", - "GET", - params - ); + return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/permission", "GET", params); }; //获取个税扣缴义务人表单 @@ -40,11 +22,7 @@ export const getTaxAgentForm = (params) => { //获取个税扣缴义务人基础信息表单 export const getTaxAgentBaseForm = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/taxAgent/base/getForm", - "get", - params - ); + return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/base/getForm", "get", params); }; //新建个税扣缴义务人 @@ -114,17 +92,9 @@ export const getTaxAgentSelectList = (isShare = false) => { //当前登录人个税扣缴义务人下拉列表 export const getTaxAgentSelectListAsAdmin = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/taxAgent/selectListAsAdmin", - "GET", - params - ); + return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/selectListAsAdmin", "GET", params); }; //当前登录人是否有添加人员范围的权限 export const hasIconInTax = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/sys/conf/code?code=hideIconInTax", - "GET", - params - ); + return WeaTools.callApi("/api/bs/hrmsalary/sys/conf/code?code=hideIconInTax", "GET", params); }; diff --git a/pc4mobx/hrmSalary/apis/taxrate.js b/pc4mobx/hrmSalary/apis/taxrate.js index 6457fc1c..67b28102 100644 --- a/pc4mobx/hrmSalary/apis/taxrate.js +++ b/pc4mobx/hrmSalary/apis/taxrate.js @@ -1,48 +1,27 @@ -import { WeaTools } from 'ecCom'; +import { WeaTools } from "ecCom"; +import { postFetch } from "../util/request"; //税率表列表 export const getTaxRateList = params => { - return WeaTools.callApi('/api/bs/hrmsalary/taxrate/list', 'get', params); -} - + return WeaTools.callApi("/api/bs/hrmsalary/taxrate/list", "get", params); +}; //删除税率表 export const deleteTaxRate = params => { - return fetch('/api/bs/hrmsalary/taxrate/delete', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return postFetch("/api/bs/hrmsalary/taxrate/delete", params); +}; //获取新建或者详情表单 export const getTaxRateForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/taxrate/getForm', 'get', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/taxrate/getForm", "get", params); +}; //新建税率表 export const saveTaxRate = params => { - return fetch('/api/bs/hrmsalary/taxrate/save', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return postFetch("/api/bs/hrmsalary/taxrate/save", params); +}; //编辑税率表 export const updateTaxRate = params => { - return fetch('/api/bs/hrmsalary/taxrate/update', { - method: 'POST', - mode: 'cors', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(params) - }).then(res => res.json()) -} + return postFetch("/api/bs/hrmsalary/taxrate/update", params); +}; diff --git a/pc4mobx/hrmSalary/apis/welfareArchive.js b/pc4mobx/hrmSalary/apis/welfareArchive.js index e86e909e..63153659 100644 --- a/pc4mobx/hrmSalary/apis/welfareArchive.js +++ b/pc4mobx/hrmSalary/apis/welfareArchive.js @@ -54,14 +54,7 @@ export const cancelStopPayment = (params) => { return postFetch("/api/bs/hrmsalary/archives/cancelStopPayment", params); }; export const getTable = params => { - return fetch("/api/bs/hrmsalary/archives/getTable", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/archives/getTable", params); }; export const getBaseForm = params => { @@ -74,36 +67,12 @@ export const getPaymentForm = params => { // 保存 export const save = params => { - return fetch("/api/bs/hrmsalary/archives/save", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); -}; - -// 导出档案 -export const exportDocument = params => { - return WeaTools.callApi("/api/bs/hrmsalary/archives/export", "get", params); -}; - -// 导入档案 - 获取组件的一些前置参数 -export const getImportDocumentParams = params => { - return WeaTools.callApi("/api/bs/hrmsalary/archives/getImportParams", "get", params); + return postFetch("/api/bs/hrmsalary/archives/save", params); }; // 导入档案- 导出现有数据 export const exportCurData = params => { - fetch("/api/bs/hrmsalary/scheme/template/export", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.blob().then(blob => { + postFetch("/api/bs/hrmsalary/scheme/template/export", params).then(res => res.blob().then(blob => { var filename = `社保福利档案模板.xlsx`; var a = document.createElement("a"); var url = window.URL.createObjectURL(blob); @@ -116,26 +85,12 @@ export const exportCurData = params => { // 导入档案-预览 export const previewCurData = (params) => { - return fetch("/api/bs/hrmsalary/scheme/preview", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/scheme/preview", params); }; // 档案导入 export const importBatch = (params) => { - return fetch("/api/bs/hrmsalary/scheme/importBatch", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/scheme/importBatch", params); }; // 导出档案 diff --git a/pc4mobx/hrmSalary/apis/welfareScheme.js b/pc4mobx/hrmSalary/apis/welfareScheme.js index cd5aab94..45a194c0 100644 --- a/pc4mobx/hrmSalary/apis/welfareScheme.js +++ b/pc4mobx/hrmSalary/apis/welfareScheme.js @@ -1,45 +1,27 @@ import { WeaTools } from "ecCom"; import { postFetch } from "../util/request"; +import { convertToUrlString } from "../util/url"; export const getForm = params => { return WeaTools.callApi("/api/bs/hrmsalary/scheme/getForm", "get", params); }; export const getTable = params => { - // return WeaTools.callApi('/api/bs/hrmsalary/scheme/getTable', 'get', params); - return fetch("/api/bs/hrmsalary/scheme/getTable", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/scheme/getTable", params); }; export const createScheme = params => { - return fetch("/api/bs/hrmsalary/scheme/insert", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/scheme/insert", params); }; export const updateScheme = params => { - return fetch("/api/bs/hrmsalary/scheme/update", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/scheme/update", params); }; export const getCopyForm = params => { return WeaTools.callApi("/api/bs/hrmsalary/scheme/copyForm", "get", params); }; export const copyScheme = params => { - return fetch(`/api/bs/hrmsalary/scheme/copyScheme?id=${params.id}&schemeName=${params.schemeName}`, { + if (typeof localStorage.access_token === "string" && localStorage.access_token !== "") { + params.access_token = localStorage.access_token; + } + return fetch(`/api/bs/hrmsalary/scheme/copyScheme?${convertToUrlString(params)}`, { method: "GET", mode: "cors", headers: { @@ -48,61 +30,24 @@ export const copyScheme = params => { }).then(res => res.json()); }; export const deleteScheme = params => { - return fetch("/api/bs/hrmsalary/scheme/delete", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/scheme/delete", params); }; - export const getCustomCategoryForm = params => { return WeaTools.callApi("/api/bs/hrmsalary/sicategory/customCategoryForm", "get", params); }; export const getCustomCategoryList = params => { - // return WeaTools.callApi('/api/bs/hrmsalary/sicategory/customCategoryList', 'get', params); - return fetch("/api/bs/hrmsalary/sicategory/customCategoryList", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/sicategory/customCategoryList", params); }; export const createSICategory = params => { - return fetch("/api/bs/hrmsalary/sicategory/createSICategory", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/sicategory/createSICategory", params); }; export const updateCustomCategory = params => { - return fetch("/api/bs/hrmsalary/sicategory/updateCustomCategoryName", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/sicategory/updateCustomCategoryName", params); }; export const deleteCustomCategory = (params) => { return postFetch("/api/bs/hrmsalary/sicategory/deleteCustomCategory", params); }; export const updateCustomCategoryStatus = params => { - return fetch("/api/bs/hrmsalary/sicategory/updateCustomCategoryStatus", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/sicategory/updateCustomCategoryStatus", params); }; diff --git a/pc4mobx/hrmSalary/util/request.js b/pc4mobx/hrmSalary/util/request.js index a7a1c7f2..3c4bc87c 100644 --- a/pc4mobx/hrmSalary/util/request.js +++ b/pc4mobx/hrmSalary/util/request.js @@ -1,5 +1,9 @@ +const server = window.server || ""; export const formHeaderPost = (url, method, params, header) => { - url = url + "?__random__=" + (new Date()).valueOf(); + if (typeof localStorage.access_token === "string" && localStorage.access_token !== "") { + params.access_token = localStorage.access_token; + } + url = server + url + "?__random__=" + (new Date()).valueOf(); let formdata = new URLSearchParams(); Object.keys(params).map(key => { formdata.append(key, params[key]); @@ -10,36 +14,26 @@ export const formHeaderPost = (url, method, params, header) => { body: formdata }).then(res => res.json()); }; - export const postFetch = (url, params) => { - url = url + "?__random__=" + (new Date()).valueOf(); - return fetch(url, { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + if (typeof localStorage.access_token === "string" && localStorage.access_token !== "") { + params.access_token = localStorage.access_token; + } + url = server + url + "?__random__=" + (new Date()).valueOf(); + return fetch(url, getFetchParams("POST", params)).then(res => res.json()); }; export const headerRequestFetch = (url, method, params, header) => { - url = url + "?__random__=" + (new Date()).valueOf(); - return fetch(url, { - method, mode: "cors", - headers: { "Content-Type": "application/json", ...header }, - body: JSON.stringify(params) - }).then(res => res.json()); + if (typeof localStorage.access_token === "string" && localStorage.access_token !== "") { + params.access_token = localStorage.access_token; + } + url = server + url + "?__random__=" + (new Date()).valueOf(); + return fetch(url, getFetchParams(method, params, header)).then(res => res.json()); }; export const postExportFetch = (url, params) => { - url = url + "?__random__=" + (new Date()).valueOf(); - return fetch(url, { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => { + if (typeof localStorage.access_token === "string" && localStorage.access_token !== "") { + params.access_token = localStorage.access_token; + } + url = server + url + "?__random__=" + (new Date()).valueOf(); + return fetch(url, getFetchParams(method, params)).then(res => { const filename = res.headers.get("Content-Disposition").split("filename=")[1]; res.blob().then(blob => { const url = window.URL.createObjectURL(blob); @@ -51,4 +45,36 @@ export const postExportFetch = (url, params) => { }); }); }; +export const getFd = (values) => { + let fd = {}; + for (let p in values) { + values[p] = _.isNil(values[p]) ? "" : values[p]; + let item = values[p]; + if (window.E9Encrypt && __AESEcrypt__) item = __AESEcrypt__.aes_data_encrypt(item); + fd = { ...fd, [p]: item }; + } + if (window.E9Encrypt && __AESEcrypt__) { + fd = { ...fd, rsaAes01: __AESEcrypt__.get_rsa_aes_01(), rsaAes02: __AESEcrypt__.get_rsa_aes_02() }; + } + return fd; +}; +const getFetchParams = (method, params, header = {}) => { + let obj = { + method, mode: "cors", + headers: { + "Content-Type": "application/json", + "X-Requested-With": "XMLHttpRequest", + ...header + } + }; + if (server === "") { + obj.credentials = "include"; + } + if (!_.isEmpty(params)) { + obj.body = JSON.stringify(getFd(params)); + } else { + obj.body = JSON.stringify(params); + } + return obj; +}; From 858b69456806c00bbf150e5c99b490eacdcdcf0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 7 Nov 2023 11:26:08 +0800 Subject: [PATCH 02/17] =?UTF-8?q?feature/2.9.42310.01-=E6=8E=A5=E5=8F=A3fe?= =?UTF-8?q?tch=E9=87=8D=E6=96=B0=E5=B0=81=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/util/request.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/util/request.js b/pc4mobx/hrmSalary/util/request.js index 3c4bc87c..2b9a6acd 100644 --- a/pc4mobx/hrmSalary/util/request.js +++ b/pc4mobx/hrmSalary/util/request.js @@ -70,7 +70,7 @@ const getFetchParams = (method, params, header = {}) => { if (server === "") { obj.credentials = "include"; } - if (!_.isEmpty(params)) { + if (!_.isEmpty(params) && Object.prototype.toString.call(params) === "[object Object]") { obj.body = JSON.stringify(getFd(params)); } else { obj.body = JSON.stringify(params); From d9a7814080a35c847d172e2ff9a031054a0aea36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 7 Nov 2023 16:43:23 +0800 Subject: [PATCH 03/17] =?UTF-8?q?feature/2.9.42310.01-=E6=8E=A5=E5=8F=A3fe?= =?UTF-8?q?tch=E9=87=8D=E6=96=B0=E5=B0=81=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/calculate.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index a9f7fbc6..a8ee74c4 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -108,13 +108,14 @@ export const deleteSalaryacct = (params) => { // 薪资记录--归档薪资核算记录 export const fileSalaryAcct = (params) => { - return fetch(`/api/bs/hrmsalary/salaryacct/file?id=${params.id}`, { - method: "GET", - mode: "cors", - headers: { - "Content-Type": "application/json" - } - }).then(res => res.json()); + return WeaTools.callApi(`/api/bs/hrmsalary/salaryacct/file`, "GET", params); + // return fetch(`/api/bs/hrmsalary/salaryacct/file?id=${params.id}`, { + // method: "GET", + // mode: "cors", + // headers: { + // "Content-Type": "application/json" + // } + // }).then(res => res.json()); }; // 薪资记录-回算 export const backCalculate = (params) => { From 84a908e94e68010ee0a8604cbbd5777787fd541c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 8 Nov 2023 16:14:10 +0800 Subject: [PATCH 04/17] =?UTF-8?q?feature/2.9.42310.02-=E7=A4=BE=E4=BF=9D?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=E9=A1=B5=E9=9D=A2=E9=87=8D?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/standingBook.js | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index 118e6fbc..0dd811a2 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -148,23 +148,11 @@ export const getPaymentGroup = (params) => { }; //获取核算项个人和公司社保福利缴纳详情 export const getPaymentById = ({ id }) => { - return fetch(`/api/bs/hrmsalary/siaccount/getPaymentById?id=${id}`, { - method: "GET", - mode: "cors", - headers: { - "Content-Type": "application/json" - } - }).then(res => res.json()); + return WeaTools.callApi("/api/bs/hrmsalary/siaccount/getPaymentById", "GET", { id }); }; //获取社保福利项列表 export const compensationCategoryType = ({ id }) => { - return fetch(`/api/bs/hrmsalary/siaccount/compensationCategoryType?id=${id}`, { - method: "GET", - mode: "cors", - headers: { - "Content-Type": "application/json" - } - }).then(res => res.json()); + return WeaTools.callApi("/api/bs/hrmsalary/siaccount/compensationCategoryType", "GET", { id }); }; //获取调差列表 From 36eb6eae6ac7fcb2d3cede723098d43732769b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 30 Nov 2023 14:04:57 +0800 Subject: [PATCH 05/17] =?UTF-8?q?feature/2.9.9.2312.01-=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=A4=8D=E5=86=99=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/archive.js | 215 ++---------------------------- 1 file changed, 14 insertions(+), 201 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/archive.js b/pc4mobx/hrmSalary/apis/archive.js index c4e69e14..fe9af3ed 100644 --- a/pc4mobx/hrmSalary/apis/archive.js +++ b/pc4mobx/hrmSalary/apis/archive.js @@ -3,130 +3,28 @@ import { postFetch } from "../util/request"; //薪资档案-薪资档案列表 export const getArchiveList = params => { - return fetch("/api/bs/hrmsalary/salaryArchive/list", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryArchive/list", params); }; - - -//薪资档案的高级搜索 -export const getSaCondition = params => { - return WeaTools.callApi("/api/bs/hrmsalary/archives/getSearchCondition", "get", params); -}; - - -//薪资档案-导出薪资档案 -export const exportArchiveList = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/exportList", "POST", params); -}; - -//薪资档案-获取导入参数 -export const getImportArchiveParam = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getImportParams", "get", params); -}; - //薪资档案-获取薪资档案详情表单 export const getArchiveForm = params => { return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getForm", "get", params); }; - - //薪资档案-获取薪资项目调整表单 export const getSalaryItemForm = params => { return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getSalaryItemForm", "GET", params); }; - //薪资档案-保存薪资项目调整 export const saveSalaryItem = params => { - return fetch("/api/bs/hrmsalary/salaryArchive/saveSalaryItem", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryArchive/saveSalaryItem", params); }; - //薪资档案-获取个税扣缴义务人调整表单 export const getTaxAgentForm = params => { return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getTaxAgentForm", "GET", params); }; - //薪资档案-保存个税扣缴义务人调整 export const saveTaxAgent = params => { - return fetch("/api/bs/hrmsalary/salaryArchive/saveTaxAgent", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryArchive/saveTaxAgent", params); }; - -//薪资档案-删除个税扣缴义务人调整 -export const deleteTaxAgent = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/deleteTaxAgent", "GET", params); -}; - -//薪资档案操作记录-薪资项目操作记录列表 -export const getItemAdjustList = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryArchiveOperateLog/salaryItemList", "POST", params); -}; - - -//薪资档案操作记录-薪资项目操作记录列表的高级搜索 -export const getItemAdjustSaCondition = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryArchiveOperateLog/getSalaryItemSearchCondition", "GET", params); -}; - -//薪资档案操作记录-导出-薪资项目操作记录列表 -export const exportItemAdjust = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryArchiveOperateLog/exportSalaryItemList", "POST", params); -}; - - -//薪资档案操作记录-个税扣缴义务人操作记录列表 -export const getPersonAdjustList = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryArchiveOperateLog/salaryItemList", "POST", params); -}; - - -//薪资档案操作记录-个税扣缴义务人操作记录列表的高级搜索 -export const getPersonAdjustSaCondition = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryArchiveOperateLog/getTaxAgentSearchCondition", "GET", params); -}; - -//薪资档案操作记录-导出-个税扣缴义务人操作记录列表 -export const exportPersonAdjust = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryArchiveOperateLog/exportTaxAgentList", "POST", params); -}; - -//薪资档案-获取设置表单 -export const getSettingForm = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getDimissionSetForm", "GET", params); -}; - -//薪资档案-保存离职时段设置 -export const saveSetting = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/saveDimissionSet", "POST", params); -}; - - -//薪资档案-模版下载链接(无数据) -export const downloadSalaryArchiveTemplateurl = `/api/bs/hrmsalary/salaryArchive/downloadTemplate`; - -// 薪资档案- 模版下载 (有之前数据) -export const downloadsalaryArchiveDetail = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/exportList", "POST", params); -}; - // 获取导入类型 export const getImportTypes = () => { return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getImportTypes", "GET", {}); @@ -139,31 +37,14 @@ export const commonEnumList = (params) => { export const salaryAdjustmentInfo = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/process/salaryAdjustmentInfo", "GET", params); }; - // 导入预览 export const importPreview = (params) => { - return fetch("/api/bs/hrmsalary/salaryArchive/preview", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryArchive/preview", params); }; - // 导入档案 export const importSalaryArchive = (params) => { - return fetch("/api/bs/hrmsalary/salaryArchive/importSalaryArchive", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryArchive/importSalaryArchive", params); }; - // 导出档案 export const exportSalaryArchive = (ids = "") => { fetch("/api/bs/hrmsalary/salaryArchive/exportList?ids=" + ids).then(res => res.blob().then(blob => { @@ -179,113 +60,45 @@ export const exportSalaryArchive = (ids = "") => { // 调整记录-个税扣缴义务人列表 export const adjustRecordTaxAgentList = (params) => { - return fetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/taxAgentList", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/taxAgentList", params); }; - // 调整记录-薪资项目-列表 export const adjustRecordSalaryItemList = (params) => { - return fetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/salaryItemList", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/salaryItemList", params); }; - // 调整记录-薪资项目-单个 export const singleSalaryItemList = (params) => { - return fetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/singleSalaryItemList", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/singleSalaryItemList", params); }; - // 调整记录-个税扣缴义务人-单个 export const singleTaxAgentList = (params) => { - return fetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/singleTaxAgentList", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/singleTaxAgentList", params); }; - // 调整-义务扣缴人-通过薪资档案的个税扣缴义务人id获取个税扣缴义务人调整表单 export const getTaxAgentFormBySalaryArchiveTaxAgentId = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getTaxAgentFormBySalaryArchiveTaxAgentId", "GET", params); }; - // 调整-薪资项目-获取调整前的值 export const getSalaryItemAdjustBeforeValue = (params) => { - return fetch("/api/bs/hrmsalary/salaryArchive/getSalaryItemAdjustBeforeValue", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryArchive/getSalaryItemAdjustBeforeValue", params); }; // 停薪 export const stopSalary = (params) => { - return fetch("/api/bs/hrmsalary/salaryArchive/stopSalary", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryArchive/stopSalary", params); }; - // 调整-薪资项目-通过薪资档案的薪资项目id获取薪资项目调整表单 export const getSalaryItemFormByItemId = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/salaryArchive/getSalaryItemFormBySalaryArchiveItemId", "GET", params); }; // 删除薪资项目调薪 export const deleteSalaryItem = (params) => { - return fetch(`/api/bs/hrmsalary/salaryArchive/deleteSalaryItem?salaryArchiveItemId=${params.salaryArchiveItemId}`, { - method: "GET", - mode: "cors", - headers: { - "Content-Type": "application/json" - } - }).then(res => res.json()); + return WeaTools.callApi(`/api/bs/hrmsalary/salaryArchive/deleteSalaryItem?salaryArchiveItemId=${params.salaryArchiveItemId}`, "GET", params); }; export const getSingleSalaryItemInfo = (params) => { - return fetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/getSingleSalaryItemInfo", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/getSingleSalaryItemInfo", params); }; export const editSingleSalaryItem = (params) => { - return fetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/editSingleSalaryItem", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); + return postFetch("/api/bs/hrmsalary/salaryArchive/adjustRecord/editSingleSalaryItem", params); }; // 基数调整记录列表 export const getAdjustHistoryList = (params) => { From 2e38e5a5c68c5f7ca72f80649ffdd8b07b6462e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 12 Dec 2023 10:25:02 +0800 Subject: [PATCH 06/17] =?UTF-8?q?hotfix/2.9.9.2312.01=20=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E5=AF=BC=E5=85=A5=E4=B8=8B=E8=BD=BD=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../doCalc/components/salaryEditCalcImport/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js index ed63d364..ede7b2fa 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js @@ -36,7 +36,7 @@ class Index extends Component { const { data } = await getImportField({ salaryAcctRecordId: nextProps.salaryAcctRecordId }); const { checkItems, itemsByGroup } = data; const payload = { - exportData: false, salaryAcctRecordId: nextProps.salaryAcctRecordId, + importType: false, salaryAcctRecordId: nextProps.salaryAcctRecordId, salaryItemIds: checkItems.join(",") }; this.setState({ @@ -128,11 +128,11 @@ class Index extends Component { exportDataDom={ { const payload = { - exportData: val === "1", salaryAcctRecordId, + importType: val === "1", salaryAcctRecordId, salaryItemIds: headerFieldsDialog.selectItems }; this.setState(({ @@ -159,7 +159,7 @@ class Index extends Component { .then(({ status, errormsg }) => { if (status) { const payload = { - exportData: getURLParameters(exportTempUrl).exportData, + importType: getURLParameters(exportTempUrl).importType, salaryAcctRecordId, salaryItemIds: salaryItems }; this.setState(({ From 4acefa765c42b0cf4ebb4bf8bd63b2c5b9c4da33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 12 Dec 2023 15:19:59 +0800 Subject: [PATCH 07/17] =?UTF-8?q?hotfix/2.9.9.2312.01=20=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/importDialog/index.js | 48 ++++++++++++------- .../calcOc/components/salaryCalcOcImport.js | 3 +- .../components/salaryEditCalcImport/index.js | 3 +- .../socialSecurityBenefits/archives/index.js | 3 +- 4 files changed, 37 insertions(+), 20 deletions(-) diff --git a/pc4mobx/hrmSalary/components/importDialog/index.js b/pc4mobx/hrmSalary/components/importDialog/index.js index b7eafd97..f174e93d 100644 --- a/pc4mobx/hrmSalary/components/importDialog/index.js +++ b/pc4mobx/hrmSalary/components/importDialog/index.js @@ -19,7 +19,7 @@ class Index extends Component { constructor(props) { super(props); this.state = { - current: 0 + current: 0, fileid: "" }; } @@ -29,7 +29,10 @@ class Index extends Component { current: this.state.current + 1 }); } - if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ current: 0 }); + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ + current: 0, + fileid: "" + }, () => this.props.onResetImportResult()); } renderChildren = () => { @@ -76,25 +79,36 @@ class Index extends Component { * Date: 2023/8/11 */ handleNext = () => { - const { params, importResult } = this.props; + const { params, importResult, excludeKey } = this.props; + const { current } = this.state; if (_.isEmpty(importResult)) { - const { fileList } = this.step1Ref.state; - if (!_.isEmpty(params)) { - if (!Object.values(params).every(o => !!o)) { - Modal.warning({ - title: getLabel(131329, "信息确认"), - content: getLabel(518702, "必要信息不完整,红色*为必填项!") - }); + if (current === 0) { + const { fileList } = this.step1Ref.state; + if (!_.isEmpty(params)) { + if (!Object.values(params).every(o => !!o)) { + Modal.warning({ + title: getLabel(131329, "信息确认"), + content: getLabel(518702, "必要信息不完整,红色*为必填项!") + }); + return; + } + } + if (_.isEmpty(fileList)) { + message.warning(getLabel(111, "请先上传EXCEL文件")); return; } + const [file] = fileList; + const { response } = file; + this.setState({ + current: this.state.current + 1, + fileid: response.data.fileid + }, () => { + !excludeKey && this.props.nextCallback && this.props.nextCallback(this.state.fileid); + excludeKey && this.props.nextUplaodCallback && this.props.nextUplaodCallback(this.state.fileid); + }); + } else { + this.props.nextUplaodCallback && this.props.nextUplaodCallback(this.state.fileid); } - if (_.isEmpty(fileList)) { - message.warning(getLabel(111, "请先上传EXCEL文件")); - return; - } - const [file] = fileList; - const { response } = file; - this.props.nextCallback(response.data.fileid); } else { this.setState({ current: this.state.current + 1 }); } diff --git a/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcImport.js b/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcImport.js index 10f92051..11a784ca 100644 --- a/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcImport.js +++ b/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcImport.js @@ -62,7 +62,8 @@ class SalaryCalcOcImport extends Component { onResetImportResult={() => this.setState(({ importDialog: { ...importDialog, importResult: {}, imageId: "" } }))} - nextCallback={imageId => this.handleImport({ imageId })} + nextCallback={imageId => this.setState({ importDialog: { ...importDialog, imageId } })} + nextUplaodCallback={imageId => this.handleImport({ imageId })} /> ); } diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js index ede7b2fa..463c7df4 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js @@ -141,7 +141,8 @@ class Index extends Component { }} /> } - nextCallback={imageId => this.handleImport({ imageId })} + nextCallback={imageId => this.setState({ importDialog: { ...importDialog, imageId } })} + nextUplaodCallback={imageId => this.handleImport({ imageId })} /> } - nextCallback={imageId => this.handleImport({ imageId })} + nextCallback={imageId => this.setState({ importDialog: { ...importDialog, imageId } })} + nextUplaodCallback={imageId => this.handleImport({ imageId })} /> { this.state.importVisible && Date: Tue, 12 Dec 2023 16:40:58 +0800 Subject: [PATCH 08/17] hotfix/2.9.9.2312.01 --- .../pages/mySalaryBenefits/components/payrollTable/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js index 28fc0278..33cb6873 100644 --- a/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js +++ b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js @@ -75,7 +75,7 @@ class Index extends Component { }; return ( Date: Wed, 13 Dec 2023 10:19:37 +0800 Subject: [PATCH 09/17] =?UTF-8?q?hotfix/2.9.10.2312.02=20=E5=B7=A5?= =?UTF-8?q?=E8=B5=84=E5=8D=95=E6=A8=A1=E6=9D=BFbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/payrollRelease/components/payrollTempBaseSet/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js index 4828795d..bd4f6429 100644 --- a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js +++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempBaseSet/index.js @@ -110,7 +110,7 @@ class Index extends Component { } else if (getKey(o) === "smsSetting") { return { ...o, - hide: _.isNil(fieldsEchoData["smsStatus"]) || (!_.isNil(fieldsEchoData["smsStatus"]) && (fieldsEchoData["smsStatus"].toString() === "0")) + hide: _.isNil(fieldsEchoData["smsStatus"]) || !fieldsEchoData["smsStatus"] || (!_.isNil(fieldsEchoData["smsStatus"]) && (fieldsEchoData["smsStatus"].toString() === "0")) }; } return { ...o }; From 8bcf268ed0cef7beed36a4c456fd112ebddf1624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 19 Dec 2023 16:18:44 +0800 Subject: [PATCH 10/17] hotfix/2.9.10.2312.02 --- pc4mobx/hrmSalary/util/request.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/util/request.js b/pc4mobx/hrmSalary/util/request.js index 2b9a6acd..821d58d6 100644 --- a/pc4mobx/hrmSalary/util/request.js +++ b/pc4mobx/hrmSalary/util/request.js @@ -33,7 +33,7 @@ export const postExportFetch = (url, params) => { params.access_token = localStorage.access_token; } url = server + url + "?__random__=" + (new Date()).valueOf(); - return fetch(url, getFetchParams(method, params)).then(res => { + return fetch(url, getFetchParams("POST", params)).then(res => { const filename = res.headers.get("Content-Disposition").split("filename=")[1]; res.blob().then(blob => { const url = window.URL.createObjectURL(blob); From 238d97798a37ab6d492ebf1dfd98d1c5b1b2c8d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 22 Dec 2023 14:42:27 +0800 Subject: [PATCH 11/17] =?UTF-8?q?hotfix/2.9.10.2312.02=20=E8=96=AA?= =?UTF-8?q?=E9=85=AC=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=E6=94=BE=E5=BC=80=E4=B8=AA=E7=A8=8E=E6=89=A3?= =?UTF-8?q?=E7=BC=B4=E4=B9=89=E5=8A=A1=E4=BA=BA=E8=AE=BE=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/reportView/components/condition.js | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/reportView/components/condition.js b/pc4mobx/hrmSalary/pages/reportView/components/condition.js index b631fb0c..9d141953 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/condition.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/condition.js @@ -5,19 +5,19 @@ const { getLabel } = WeaLocaleProvider; export const condition = [ { items: [ - // { - // colSpan: 2, - // checkbox: false, - // checkboxValue: false, - // conditionType: "SELECT", - // domkey: ["taxAgent"], - // fieldcol: 18, - // label: getLabel(111, "个税扣缴义务人"), - // labelcol: 6, - // options: [], - // multiple: true, - // viewAttr: 2 - // }, + { + colSpan: 2, + checkbox: false, + checkboxValue: false, + conditionType: "SELECT", + domkey: ["taxAgent"], + fieldcol: 18, + label: getLabel(111, "个税扣缴义务人"), + labelcol: 6, + options: [], + multiple: true, + viewAttr: 2 + }, { browserConditionParam: { completeParams: {}, From 854949ab624b86b131bcec608caf89f151f2b555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 25 Dec 2023 14:37:14 +0800 Subject: [PATCH 12/17] =?UTF-8?q?hotfix/2.9.10.2312.02=20=E8=96=AA?= =?UTF-8?q?=E9=85=AC=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=E6=94=BE=E5=BC=80=E4=B8=AA=E7=A8=8E=E6=89=A3?= =?UTF-8?q?=E7=BC=B4=E4=B9=89=E5=8A=A1=E4=BA=BA=E8=AE=BE=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reportView/components/statisticalMicroSettingsSlide.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js index ce900020..6de7fa2a 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js @@ -69,7 +69,7 @@ class StatisticalMicroSettingsSlide extends Component { } getTaxAgentSelectList = (props) => { - getTaxAgentSelectList(props.isShare).then(({ status, data }) => { + getTaxAgentSelectList(true).then(({ status, data }) => { if (status) { const conditions = _.map(condition, item => { return { From d5fa8d7e844b8643a128395a3fd1af610a4e3417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 25 Dec 2023 14:54:55 +0800 Subject: [PATCH 13/17] =?UTF-8?q?hotfix/2.9.10.2312.02=20=E8=96=AA?= =?UTF-8?q?=E9=85=AC=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=E6=94=BE=E5=BC=80=E4=B8=AA=E7=A8=8E=E6=89=A3?= =?UTF-8?q?=E7=BC=B4=E4=B9=89=E5=8A=A1=E4=BA=BA=E8=AE=BE=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reportView/components/statisticalMicroSettingsSlide.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js index 6de7fa2a..f5237045 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js @@ -125,7 +125,7 @@ class StatisticalMicroSettingsSlide extends Component { const { form, id, dimension, onClose } = this.props; const [salaryStartMonth, salaryEndMonth] = salaryMonth; const { department, employee, position, subCompany, taxAgent, ...extra } = form.getFormDatas(); - // const { value, valueSpan } = taxAgent; + const { value, valueSpan } = taxAgent; if (!salaryEndMonth || !salaryStartMonth) { this.refs.weaError.showError(); return; @@ -137,7 +137,7 @@ class StatisticalMicroSettingsSlide extends Component { employee: _.map(employee.valueObj, it => ({ id: it.id, name: it.name })), // position: _.map(position.valueObj, it => ({ id: it.id, name: it.name })), subCompany: _.map(subCompany.valueObj, it => ({ id: it.id, name: it.name })), - // taxAgent: value ? _.map(value.split(","), (it, idx) => ({ id: it, name: valueSpan.split(",")[idx] })) : [], + taxAgent: value ? _.map(value.split(","), (it, idx) => ({ id: it, name: valueSpan.split(",")[idx] })) : [], items: dataSource, salaryEndMonth: salaryEndMonth + "-01", salaryStartMonth: salaryStartMonth + "-01" From 1be637e168653611f8a94a9476235881c3ef3eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 28 Dec 2023 09:46:25 +0800 Subject: [PATCH 14/17] =?UTF-8?q?hotfix/2.9.9.2312.02-=E4=B8=AA=E7=A8=8E?= =?UTF-8?q?=20=E4=B8=AA=E7=A8=8E=E7=94=B3=E6=8A=A5=E8=A1=A8=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=96=B0=E5=A2=9E=E7=BC=96=E8=BE=91=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/declare.js | 17 +- .../declareDetail/components/constants.js | 45 ++++ .../incomeTaxDeclarationPersonnelSlide.js | 193 ++++++++++++++++++ .../hrmSalary/pages/declareDetail/index.js | 106 +++++++--- .../hrmSalary/pages/declareDetail/index.less | 39 ++++ pc4mobx/hrmSalary/stores/declare.js | 3 + 6 files changed, 373 insertions(+), 30 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/declareDetail/components/incomeTaxDeclarationPersonnelSlide.js diff --git a/pc4mobx/hrmSalary/apis/declare.js b/pc4mobx/hrmSalary/apis/declare.js index 23760cbe..76709840 100644 --- a/pc4mobx/hrmSalary/apis/declare.js +++ b/pc4mobx/hrmSalary/apis/declare.js @@ -213,8 +213,23 @@ export const taxPaymentVoucherPrintFeedback = (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 WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/detailInfo", "GET", params); +}; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/constants.js b/pc4mobx/hrmSalary/pages/declareDetail/components/constants.js index 483d987c..5d03b906 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/components/constants.js +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/constants.js @@ -91,3 +91,48 @@ export const paymentBankConditions = [ 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 + } +]; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/incomeTaxDeclarationPersonnelSlide.js b/pc4mobx/hrmSalary/pages/declareDetail/components/incomeTaxDeclarationPersonnelSlide.js new file mode 100644 index 00000000..54fd02b1 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/incomeTaxDeclarationPersonnelSlide.js @@ -0,0 +1,193 @@ +/* + * 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) { + const { declareStore: { initTaxDecForm } } = nextProps; + if (nextProps.visible !== this.props.visible && nextProps.visible) this.getTaxDecForm(nextProps); + if (nextProps.visible !== this.props.visible && !nextProps.visible) { + 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 }) => { + 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] || "" + }); + }); + }); + } + }); + }; + 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/index.js b/pc4mobx/hrmSalary/pages/declareDetail/index.js index 156d8a6b..86906901 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/index.js +++ b/pc4mobx/hrmSalary/pages/declareDetail/index.js @@ -5,8 +5,8 @@ * Date: 2023/8/18 */ import React, { Component } from "react"; -import { WeaLocaleProvider, WeaTab, WeaTable } from "ecCom"; -import { Button, message } from "antd"; +import { WeaLocaleProvider, WeaTab } from "ecCom"; +import { Button, message, Spin } from "antd"; import TaxDeclarationInfo from "./components/taxDeclarationInfo"; import { apiflowBillingConfigStatus } from "../../apis/intelligentCalculateSalarySettings"; import PaymentBtn from "./components/paymentBtn"; @@ -26,6 +26,7 @@ import { taxPaymentWithheldVoucherGet } from "../../apis/declare"; import { convertToUrlString, getQueryString } from "../../util/url"; +import IncomeTaxDeclarationPersonnelSlide from "./components/incomeTaxDeclarationPersonnelSlide"; import "./index.less"; const { getLabel } = WeaLocaleProvider; @@ -49,6 +50,9 @@ class Index extends Component { 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 } }; @@ -56,7 +60,11 @@ class Index extends Component { } componentDidMount() { - const promise = this.init(); + window.addEventListener("message", this.handleReceive, false); + } + + componentWillUnmount() { + window.removeEventListener("message", this.handleReceive, false); } init = async () => { @@ -95,6 +103,32 @@ class Index extends Component { 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, "编辑") + }); + } + } + }; + postMessageToChild = (payload = {}) => { + const { declareInfo, intelCalcSalaryStatus } = this.state; + const i18n = { + "总计": getLabel(523, "总计"), "编辑": getLabel(501169, "编辑"), + "操作": getLabel(30585, "操作"), "共": getLabel(83698, "共"), + "条": getLabel(18256, "条") + }; + const declareStatus = intelCalcSalaryStatus ? declareInfo.declareStatus : ""; + const childFrameObj = document.getElementById("atdTable"); + childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n, declareStatus }), "*"); + }; getDetailList = () => { const { loading, pageInfo, selectedKey } = this.state; const [incomeCategory, taxDeclarationId] = selectedKey.split("%%"); @@ -111,10 +145,16 @@ class Index extends Component { dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, columns: _.map(columns, (it, idx) => { if (idx <= 1) { - return { ...it, width: 150, fixed: "left" }; + return { ...it, width: 150, fixed: "left", ellipsis: true }; } - return { ...it, width: 150 }; + return { ...it, width: 150, ellipsis: true }; }) + }, () => { + const payload = { + dataSource, pageInfo: this.state.pageInfo, + columns: this.state.columns + }; + this.postMessageToChild(payload); }); } }).catch(() => this.setState({ loading: { ...loading, query: false } })); @@ -221,11 +261,18 @@ class Index extends Component { }; window.open(`${window.ecologyContentPath || ""}/api/bs/hrmsalary/taxdeclaration/detail/export?${convertToUrlString(payload)}`, "_blank"); }; + handleTaxDescPerSlide = (params) => { + const { callback, ...module } = params; + const { taxDecPersonSlide, selectedKey } = this.state; + const [__, taxDeclarationId] = selectedKey.split("%%"); + this.setState({ + taxDecPersonSlide: { ...taxDecPersonSlide, ...module, taxDeclarationId } + }, () => callback && this.getDetailList()); + }; render() { const { - tabs, selectedKey, columns, pageInfo, - dataSource, loading, declareInfo, intelCalcSalaryStatus + tabs, selectedKey, loading, declareInfo, intelCalcSalaryStatus, taxDecPersonSlide } = this.state; let btns = [ , @@ -234,23 +281,6 @@ class Index extends Component { ]; - 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.getDetailList()); - }, - onChange: current => { - this.setState({ - pageInfo: { ...pageInfo, current } - }, () => this.getDetailList()); - } - }; //申报状态:作废中 declareInfo.declareStatus === "DECLARE_CANCELLING" && (btns.splice(1, 2, + ); + } + } if (intelCalcSalaryStatus && (declareInfo.declareStatus === "DECLARE_SUCCESS_UNPAID")) { btns.push( , @@ -309,13 +349,21 @@ class Index extends Component { datas={tabs} keyParam="viewcondition" selectedKey={selectedKey} buttons={btns} onChange={(v) => this.setState({ selectedKey: v }, () => this.getDetailList())} /> - this.handleTaxDescPerSlide({ visible: false, id: "", callback })} /> +
+ +