diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index b14015a7..28067063 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -1,141 +1,5 @@ import { WeaTools } from "ecCom"; -//薪资核算-薪资核算列表 -export const getCalcList = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/list", "POST", params); -}; - - -//薪资核算-删除薪资核算记录 -export const deleteCalc = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/delete", "POST", params); -}; - -//薪资核算-归档薪资核算记录 -export const fileCalc = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/file", "POST", params); -}; - -//薪资核算-薪资核算详情 -export const getCalcForm = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/getForm", "get", params); -}; - -//薪资核算-保存薪资核算的基本信息 -export const saveCalc = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/basic/save", "POST", params); -}; - -//薪资核算-获取薪资核算提示信息 -export const getCalcInfo = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/getSalarySobCycle", "get", params); -}; - -//薪资核算-薪资核算人员确认列表 -export const getCalcPersonList = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctEmployee/list", "POST", params); -}; - -//薪资核算-薪资核算人员高级搜索 -export const getCalcPersonSa = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctEmployee/getSearchCondition", "get", params); -}; - -//薪资核算-删除薪资核算人员 -export const deleteCalcPerson = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctEmployee/delete", "POST", params); -}; - -//薪资核算-添加薪资核算人员 -export const saveCalcPerson = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctEmployee/save", "POST", params); -}; - -//薪资核算-导出人员范围 -export const exportCalcPerson = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctEmployee/export", "POST", params); -}; - -//薪资核算-薪资核算环比上期减少人员列表 -export const getCalcPersonSubList = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/reducedEmployee/list", "POST", params); -}; - -//薪资核算-导出环比减少人员 -export const exportCalcPersonSub = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/reducedEmployee/export", "POST", params); -}; - - -//薪资核算-执行薪资核算 -export const doScCalc = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/accounting", "POST", params); -}; - - -//薪资核算-获取薪资核算结果高级搜索 -export const getScSa = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/getSearchCondition", "get", params); -}; - -//薪资核算-薪资核算结果列表 -export const getScList = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/list", "post", params); -}; - - -//薪资核算-导出薪资核算 -export const exportSc = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/export", "post", params); -}; - -//薪资核算-导出线下对比结果 -export const exportOc = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/comparisonResult/export", "post", params); -}; - - -//薪资核算-薪资核算结果详情 -export const getScDetail = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/detail", "get", params); -}; - -//薪资核算-薪资核算合并计税详情 -export const getScMergeTaxDetail = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/getConsolidatedTaxDetail", "get", params); -}; - -//薪资核算-编辑薪资核算结果 -export const editScResult = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/save", "post", params); -}; - -//薪资核算-薪资核算结果校验 -export const checkScResult = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/acctResult/check", "post", params); -}; - - -//薪资核算-获取校验结果(异常)总数 -export const getScResultExceptionCount = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/checkResult/getCount", "get", params); -}; - -//薪资核算-校验结果列表 -export const getCheckResultList = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/checkResult/list", "POST", params); -}; - -//薪资核算-校验结果明细列表 -export const getCheckResultDetailList = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/checkResultRecord/list", "POST", params); -}; - -//薪资核算-获取导入组件前置参数 -export const getImportParams = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryAcct/checkResultRecord/list", "POST", params); -}; - // 薪资记录--薪资核算列表 export const getSalaryAcctList = params => { return fetch("/api/bs/hrmsalary/salaryacct/list", { @@ -176,6 +40,17 @@ export const reducedemployeeList = params => { body: JSON.stringify(params) }).then(res => res.json()); }; +// 核算人员--薪资核算环比上月增加人员 +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()); +}; // 核算人员--薪资核算人员确认列表 export const acctemployeeList = params => { @@ -206,7 +81,6 @@ export const getSalarySobCycle = params => { return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/getSalarySobCycle", "GET", params); }; - // 核算人员--添加薪资核算人员 export const saveAcctemployee = params => { return fetch("/api/bs/hrmsalary/salaryacct/acctemployee/save", { @@ -232,7 +106,6 @@ export const exportReducedEmployee = (id) => { })); }; - // 核算人员--导出人员范围 export const exportAcctEmployee = (id) => { fetch("/api/bs/hrmsalary/salaryacct/acctemployee/export?salaryAcctRecordId=" + id).then(res => res.blob().then(blob => { @@ -374,7 +247,6 @@ export const getImportField = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/acctresult/importField", "GET", params); }; - // 核算结果-导入模板 export const getImportTemplate = (salaryItemIds, salaryAcctRecordId) => { fetch("/api/bs/hrmsalary/salaryacct/acctresult/importtemplate/export?salaryItemIds=" + salaryItemIds + "&salaryAcctRecordId=" + salaryAcctRecordId).then(res => res.blob().then(blob => { @@ -412,7 +284,6 @@ export const importAcctResult = (params) => { }).then(res => res.json()); }; - // 核算结果-导出全部 export const exportAcctResult = (salaryAcctRecordId, ids) => { fetch("/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=" + salaryAcctRecordId + "&ids=" + ids).then(res => res.blob().then(blob => { @@ -509,50 +380,6 @@ export const updateLockStatus = (params) => { body: JSON.stringify(params) }).then(res => res.json()); }; -// 社保福利台账合计接口 -export const siaccountDetailCommonListSum = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/detail/common/list/sum", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); -}; -// 社保福利台账补缴合计接口 -export const siaccountDetailSupplementaryListSum = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/detail/supplementary/list/sum", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); -}; -// 社保福利台账退差合计接口 -export const siaccountDetailRecessionListSum = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/detail/recession/list/sum", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); -}; -// 社保福利台账补差合计接口 -export const siaccountDetailBalanceListSum = (params) => { - return fetch("/api/bs/hrmsalary/siaccount/detail/balance/list/sum", { - method: "POST", - mode: "cors", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify(params) - }).then(res => res.json()); -}; // 导入薪资核算添加表头字段缓存 export const cacheImportField = (params) => { return fetch("/api/bs/hrmsalary/salaryacct/acctresult/cacheImportField", { diff --git a/pc4mobx/hrmSalary/apis/item.js b/pc4mobx/hrmSalary/apis/item.js index 3c3bb052..2d23377a 100644 --- a/pc4mobx/hrmSalary/apis/item.js +++ b/pc4mobx/hrmSalary/apis/item.js @@ -1,4 +1,4 @@ -import { WeaTools } from 'ecCom'; +import { WeaTools } from "ecCom"; /** * 薪资项目api @@ -7,171 +7,171 @@ import { WeaTools } from 'ecCom'; // 薪资项目-获取列表 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()) + 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 WeaTools.callApi("/api/bs/hrmsalary/salaryitem/getSearchCondition", "GET", params); }; //数据源列表字典项 export const formulaDatasourceList = params => { - return WeaTools.callApi('/api/bs/hrmsalary/formula/datasource/list', 'GET', params); + return WeaTools.callApi("/api/bs/hrmsalary/formula/datasource/list", "GET", 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()) + 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 WeaTools.callApi("/api/bs/hrmsalary/salaryitem/getSysSearchCondition", "GET", 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 fetch("/api/bs/hrmsalary/salaryitem/delete", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; //薪资项目-批量删除列表 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 fetch("/api/bs/hrmsalary/salaryitem/listCanDelete", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; //薪资项目-新增薪资项目 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()) -} + 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 WeaTools.callApi("/api/bs/hrmsalary/salaryitem/update", "POST", params); +}; //薪资项目-薪资项目详情 export const getItemForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryitem/getSalaryForm', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/salaryitem/getSalaryForm", "GET", 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 fetch("/api/bs/hrmsalary/salaryitem/saveSys", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; //获取薪资项目可选的类型(与属性有联动) export const getItemTypeOption = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryitem/listSalaryItemTypeOption', 'GET', 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); -} + 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 fetch("/api/bs/hrmsalary/formula/search/group", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; //获取公式变量字段 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 fetch("/api/bs/hrmsalary/formula/search/field", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // /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 fetch("/api/bs/hrmsalary/formula/save", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // 公式测试 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 fetch("/api/bs/hrmsalary/formula/mock", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // 根据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 fetch("/api/bs/hrmsalary/formula/detail", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // *** 公式 end *** @@ -179,14 +179,28 @@ export const detailFormual = params => { // 列出可以删除的薪资项目 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 fetch("/api/bs/hrmsalary/salaryitem/listCanDelete", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; +//获取哪些账套中使用了该薪资项目 +export const getSalarySobBySalaryItem = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryitem/getSalarySobBySalaryItem", "GET", 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()); +}; diff --git a/pc4mobx/hrmSalary/apis/mySalaryBenefits.js b/pc4mobx/hrmSalary/apis/mySalaryBenefits.js index c87cd3ab..e985ac5a 100644 --- a/pc4mobx/hrmSalary/apis/mySalaryBenefits.js +++ b/pc4mobx/hrmSalary/apis/mySalaryBenefits.js @@ -1,4 +1,5 @@ import { WeaTools } from "ecCom"; +import { convertToUrlString } from "../util/url"; // 工资单列表 export const mySalaryBillList = params => { @@ -25,7 +26,13 @@ export const recordList = params => { // 工资查看详情 export const mySalaryBill = params => { - return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/mySalaryBill", "GET", params); + return fetch(`/api/bs/hrmsalary/salaryBill/mySalaryBill?${convertToUrlString(params)}`, { + method: "GET", + mode: "cors", + headers: { + "Content-Type": "application/json" + } + }).then(res => res.json()); }; export const isNeedSecondPwdVerify = params => { diff --git a/pc4mobx/hrmSalary/apis/statistics.js b/pc4mobx/hrmSalary/apis/statistics.js index f5f4aff6..6297dfa8 100644 --- a/pc4mobx/hrmSalary/apis/statistics.js +++ b/pc4mobx/hrmSalary/apis/statistics.js @@ -78,3 +78,31 @@ export const statisticsEmployeeDetailList = (params) => { export const getDataPerspective = (params) => { return postFetch("/api/bs/hrmsalary/report/statistics/report/getDataPerspective", params); }; +//报表分享-确认分享 +export const salaryStatisticsPushSendMsg = (params) => { + return postFetch("/api/bs/salaryreport/salary/statistics/push/sendMsg", params); +}; +//报表分享-表单数据 +export const salaryStatisticsPushGetForm = (params) => { + return WeaTools.callApi("/api/bs/salaryreport/salary/statistics/push/getForm", "GET", params); +}; +//报表记录-全部撤回 +export const salaryStatisticsPushcancelAll = (params) => { + return WeaTools.callApi("/api/bs/salaryreport/salary/statistics/push/cancelAll", "GET", params); +}; +//报表记录-撤回单条记录 +export const salaryStatisticsPushcancel = (params) => { + return WeaTools.callApi("/api/bs/salaryreport/salary/statistics/push/cancel", "GET", params); +}; +//报表记录-列表数据 +export const salaryStatisticsPushGetTable = (params) => { + return postFetch("/api/bs/salaryreport/salary/statistics/push/getTable", params); +}; +//报表记录-查看分享记录详情 +export const salaryStatisticsPushGetDetail = (params) => { + return postFetch("/api/bs/salaryreport/salary/statistics/push/getDetail", params); +}; +//报表记录-追加被分享人 +export const salaryStatisticsPushAddSharedSendMsg = (params) => { + return postFetch("/api/bs/salaryreport/salary/statistics/push/addSharedSendMsg", params); +}; diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index 25747f12..1b0f58d8 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -1,5 +1,5 @@ import { WeaTools } from "ecCom"; -import { formPost, postFetch } from "../util/request"; +import { postFetch } from "../util/request"; //个税扣缴义务人列表 export const getTaxAgentList = (params) => { @@ -7,9 +7,9 @@ export const getTaxAgentList = (params) => { method: "POST", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; //同步人员范围 @@ -18,9 +18,9 @@ export const taxAgentRangeSync = (params) => { method: "POST", mode: "cors", headers: { - "Content-Type": "application/json", + "Content-Type": "application/json" }, - body: JSON.stringify(params), + body: JSON.stringify(params) }).then((res) => res.json()); }; @@ -108,12 +108,8 @@ export const taxAgentRangeImportData = (params) => { }; //个税扣缴义务人下拉列表 -export const getTaxAgentSelectList = (params) => { - return WeaTools.callApi( - "/api/bs/hrmsalary/taxAgent/selectList", - "GET", - params - ); +export const getTaxAgentSelectList = (isShare = false) => { + return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/selectList", "GET", { isShare }); }; //当前登录人个税扣缴义务人下拉列表 diff --git a/pc4mobx/hrmSalary/apis/welfareArchive.js b/pc4mobx/hrmSalary/apis/welfareArchive.js index a38f22ce..e86e909e 100644 --- a/pc4mobx/hrmSalary/apis/welfareArchive.js +++ b/pc4mobx/hrmSalary/apis/welfareArchive.js @@ -13,6 +13,10 @@ export const getCondition = params => { export const queryList = (params) => { return postFetch("/api/bs/hrmsalary/archives/getTable", params); }; +//社保福利档案_非系统人员列表 +export const getExtTable = (params) => { + return postFetch("/api/bs/hrmsalary/archives/getExtTable", params); +}; //社保福利档案列表 export const queryInsuranceTabTotal = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/archives/queryInsuranceTabTotal", params); diff --git a/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js b/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js index 7707880c..19a14492 100644 --- a/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js +++ b/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js @@ -8,6 +8,7 @@ import React, { Component } from "react"; import { WeaBrowser, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect, WeaLocaleProvider } from "ecCom"; import { Button, message, Modal } from "antd"; import { getTaxAgentRangeForm } from "../../apis/taxAgent"; +import { commonEnumList } from "../../apis/ruleconfig"; import { SelectWithAll } from "../../pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee"; import "./index.less"; @@ -32,41 +33,74 @@ class PersonalScopeModal extends Component { if (isTaxgent) { this.getTaxAgentRangeForm(); } else { - const employeeStatus = [ - { key: "TRIAL", showname: getLabel(18883, "试用") }, - { key: "FORMAL", showname: getLabel(15711, "正式") }, - { key: "TEMPORARY", showname: getLabel(480, "临时") }, - { key: "DELAY", showname: getLabel(15844, "试用延期") }, - { key: "FIRE", showname: getLabel(542707, "解雇") }, - { key: "DEPARTURE", showname: getLabel(6091, "离职") }, - { key: "RETIRED", showname: getLabel(6092, "退休") } - ]; - const targetTypeList = [ - { - key: "EMPLOYEE", - showname: getLabel(30042, "人员"), - selected: false - }, - { - key: "SUBCOMPANY", - showname: getLabel(33553, "分部"), - selected: false - }, - { - key: "DEPT", - showname: getLabel(27511, "部门"), - selected: false - }, - { - key: "POSITION", - showname: getLabel(6086, "岗位"), - selected: false - } - ]; - this.setState({ targetTypeList, employeeStatus }); + this.commonEnumList(); + // const employeeStatus = [ + // { key: "TRIAL", showname: "试用" }, + // { key: "FORMAL", showname: "正式" }, + // { key: "TEMPORARY", showname: "临时" }, + // { key: "DELAY", showname: "试用延期" }, + // { key: "FIRE", showname: "解雇" }, + // { key: "DEPARTURE", showname: "离职" }, + // { key: "RETIRED", showname: "退休" } + // ]; + // const targetTypeList = [ + // { + // key: "EMPLOYEE", + // showname: "人员", + // selected: false + // }, + // { + // key: "SUBCOMPANY", + // showname: "分部", + // selected: false + // }, + // { + // key: "DEPT", + // showname: "部门", + // selected: false + // }, + // { + // key: "POSITION", + // showname: "岗位", + // selected: false + // } + // ]; + // this.setState({ targetTypeList, employeeStatus }); } } + commonEnumList = () => { + commonEnumList({ enumClass: "com.engine.salary.enums.UserStatusEnum" }).then(({ status, data }) => { + if (status) { + const targetTypeList = [ + { + key: "EMPLOYEE", + showname: "人员", + selected: false + }, + { + key: "SUBCOMPANY", + showname: "分部", + selected: false + }, + { + key: "DEPT", + showname: "部门", + selected: false + }, + { + key: "POSITION", + showname: "岗位", + selected: false + } + ]; + this.setState({ + targetTypeList, + employeeStatus: _.map(_.filter(data, o => o.value !== 7), it => ({ key: it.enum, showname: it.defaultLabel })) + }); + } + }); + }; getTaxAgentRangeForm = () => { getTaxAgentRangeForm().then(({ status, data }) => { if (status) { @@ -92,7 +126,7 @@ class PersonalScopeModal extends Component { employeeStatus: status.split(","), includeType, targetParams: _.map(targetTypeIds.split(","), it => ({ targetType, targetId: it })), - [saveKeyVal["key"]]: saveKeyVal["value"], + [saveKeyVal["key"]]: saveKeyVal["value"] }; this.setState({ loading: true }); APISaveFox["save"](payload).then(({ status, errormsg }) => { diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js new file mode 100644 index 00000000..209125fb --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js @@ -0,0 +1,94 @@ +/* + * Author: 黎永顺 + * name: 导入-步骤一 + * Description: + * Date: 2023/8/11 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { Icon, message, Upload } from "antd"; + +const Dragger = Upload.Dragger; +const { getLabel } = WeaLocaleProvider; + +class ImpStep1 extends Component { + constructor(props) { + super(props); + this.state = { + fileList: [] + }; + } + + handleChange = (data) => { + const { fileList, file } = data; + if (file.response && typeof (file.response) != "undefined" && file.status !== "removed") message.success(getLabel(111, "上传成功")); + this.setState({ fileList: fileList.slice(-1) }); + }; + + render() { + const { fileList } = this.state; + const dragger = { + accept: ".xlsx", + name: "file", + multiple: false, + action: "/api/doc/upload/uploadFile", + fileList, + onChange: this.handleChange + }; + return ( +
+ {/* 导入选项 */} + { + this.props.importParams && +
+
{getLabel(543201, "导入选项")}
+ {this.props.importParams} +
+ } +
{getLabel(543202, "导入Excel")}
+

+ +

+

+

{getLabel(543203, "点击或将文件拖拽到此区域上传")}

+

{getLabel(543204, "支持单个或批量上传,严禁上传公司内部资料及其他违禁文件")}

+
+ +

+ +
+
{getLabel(27577, "操作步骤")}
+

+ {`1. ${getLabel(30907, "第一步")},${getLabel(543205, "请选择导出的Excel文件或")}`}   + { + typeof this.props.link === "string" ? + {getLabel(543207, "点击这里下载模板")} : + {getLabel(543207, "点击这里下载模板")} + } +    + {this.props.exportDataDom} +

+

{`2. ${getLabel(543211, "第二步")},${getLabel(543212, "请一定要确定Excel文档中的格式是模板中的格式")},${getLabel(543213, "没有被修改掉")};`}

+

{`3. ${getLabel(543216, "第三步")},${getLabel(543215, "选择填写好的Excel文档")},${getLabel(543214, "点击“下一步”按钮进行数据预览")};`}

+

+ {`4. ${getLabel(543217, "第四步")},${getLabel(543218, "如果以上步骤和Excel文档正确的话")},${getLabel(543219, "导入成功会有提示")},${getLabel(543220, "数据会被正确导入")}。${getLabel(543221, "如果有问题")},${getLabel(543222, "则会提示Excel文档的错误之处")}。`} +

+
+ +
+
{getLabel(543223, "Excel文件说明")}
+

{`1. ${getLabel(543224, "后缀名为xls或者xlsx")};`}

+

{`2. ${getLabel(543225, "数据请勿放在合并的单元格中")};`}

+

{`3. ${getLabel(543226, "账单月份格式必须为")}:YYYY-MM;`}

+
+ +
+ ); + } +} + +export default ImpStep1; diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js new file mode 100644 index 00000000..71c6e099 --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js @@ -0,0 +1,49 @@ +/* + * Author: 黎永顺 + * name: 导入-步骤二 + * Description: + * Date: 2023/9/5 + */ +import React, { Component } from "react"; +import { WeaTable } from "ecCom"; +import { postFetch } from "../../../util/request"; + +class ImpStep2 extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, columns: [], dataSource: [] + }; + } + + componentDidMount() { + this.init(); + } + + init = () => { + const { previewUrl, imageId, extraPreview = {} } = this.props; + const payload = { imageId, ...extraPreview }; + this.setState({ loading: true }); + postFetch(previewUrl, payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { headers, list } = data; + this.setState({ + columns: _.map(headers, (item, index) => ({ title: item, dataIndex: index + "", width: 120 })), + dataSource: _.map(list, item => { + return _.reduce(item, (pre, cur, key) => (_.assign(pre, { [key]: cur })), {}); + }) + }); + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { dataSource, columns, loading } = this.state; + return ( + + ); + } +} + +export default ImpStep2; diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js new file mode 100644 index 00000000..481813b4 --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep3.js @@ -0,0 +1,51 @@ +/* + * Author: 黎永顺 + * name: 导入-步骤3 + * Description: + * Date: 2023/8/11 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; +import successImg from "../../importModal/success.svg"; + +const getLabel = WeaLocaleProvider.getLabel; + +class ImpStep3 extends Component { + render() { + const { importResult } = this.props; + return ( +
+ { + !_.isEmpty(importResult) ? +
+

+

+ {getLabel(389249, "已导入")} + {importResult.successCount}   + {`${getLabel(30690, "条数据")},${getLabel(25009, "失败")}`} + {importResult.errorCount}  {getLabel(30690, "条数据")} +

+
: +
+

{getLabel(111, "导入失败")}

+
+ } + { + !_.isEmpty(importResult.errorData) && + + } +
+ ); + } +} + +export default ImpStep3; diff --git a/pc4mobx/hrmSalary/components/importDialog/index.js b/pc4mobx/hrmSalary/components/importDialog/index.js new file mode 100644 index 00000000..b7eafd97 --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/index.js @@ -0,0 +1,153 @@ +/* + * Author: 黎永顺 + * name: 导入弹框-步骤条 + * Description: + * Date: 2023/8/11 + */ +import React, { Component } from "react"; +import { Button, message, Modal } from "antd"; +import { WeaDialog, WeaLocaleProvider, WeaSteps } from "ecCom"; +import ImpStep1 from "./components/impStep1"; +import ImpStep2 from "./components/impStep2"; +import ImpStep3 from "./components/impStep3"; +import "./index.less"; + +const { getLabel } = WeaLocaleProvider; +const Step = WeaSteps.Step; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + current: 0 + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (JSON.stringify(nextProps.importResult) !== JSON.stringify(this.props.importResult) && !_.isEmpty(nextProps.importResult)) { + this.setState({ + current: this.state.current + 1 + }); + } + if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ current: 0 }); + } + + renderChildren = () => { + const { current } = this.state; + const { importParams, link, excludeKey, importResult, exportDataDom = null } = this.props; + let CurrentDom = null; + switch (current) { + case 0: + CurrentDom = this.step1Ref = dom}/>; + break; + case 1: + CurrentDom = ; + if (excludeKey) { + CurrentDom = ; + } + break; + case 2: + CurrentDom = ; + break; + default: + CurrentDom = null; + break; + } + return CurrentDom; + }; + /* + * Author: 黎永顺 + * Description: 上一步 + * Params: + * Date: 2023/9/5 + */ + handlePreviousStep = () => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "是否放弃已上传的文件?"), + onOk: () => this.setState({ current: this.state.current - 1 }, () => this.props.onResetImportResult()) + }); + }; + /* + * Author: 黎永顺 + * Description: 下一步 + * Params: + * Date: 2023/8/11 + */ + handleNext = () => { + const { params, importResult } = this.props; + 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, "必要信息不完整,红色*为必填项!") + }); + return; + } + } + 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 }); + } + }; + + render() { + const { current } = this.state; + const stepData = [ + { key: 0, label: getLabel(543202, "上传EXCEL") }, + { key: 1, label: getLabel(543200, "数据预览") }, + { key: 2, label: getLabel(502835, "导入数据") } + ]; + const btns = [ + , + , + + ]; + return ( + +
+
+ + {/*this.props.key: 不需要展示的步骤*/} + { + _.map(_.filter(stepData, item => item.key !== this.props.excludeKey), it => ( + )) + } + +
+
+ { + this.renderChildren() + } +
+
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/components/importDialog/index.less b/pc4mobx/hrmSalary/components/importDialog/index.less new file mode 100644 index 00000000..95cee40b --- /dev/null +++ b/pc4mobx/hrmSalary/components/importDialog/index.less @@ -0,0 +1,143 @@ +.importBox { + .importCont { + padding: 16px 8px; + + .weapp-batch-impsteps-picker-content-imp-steps { + width: 80%; + margin: 0 auto; + } + + .weapp-batch-impsteps-picker { + margin: 16px auto; + + .weapp-batch-impsteps-picker-content-imp-step1 { + width: 98%; + background-color: #fff; + margin: 8px auto; + border-radius: 3px; + padding: 1px 12px; + + .weapp-batch-impsteps-picker-content-imp-step1 div { + color: #111; + line-height: 22px; + } + + .weapp-salary-tb-border-bottom .weapp-salary-tb-filter.weapp-salary-import-param { + box-sizing: border-box; + padding: 16px; + height: auto; + flex-wrap: wrap; + width: 100%; + } + + .weapp-salary-import-param { + border: 1px solid #ebedf0; + padding: 8px; + margin: 4px 0 14px; + } + + .weapp-salary-tb-filter { + display: flex; + flex-wrap: wrap; + align-items: center; + height: 46px; + } + + .weapp-salary-tb-border-bottom .weapp-salary-tb-filter.weapp-salary-import-param .tbf-item { + display: flex; + justify-content: flex-start !important; + } + + .weapp-salary-tb-filter .tbf-item { + padding: 0 20px 0 0; + display: flex; + align-items: center; + font-size: 12px; + color: #111; + height: 40px; + } + + .weapp-salary-tb-filter .tbf-item > .tbfi-label { + flex-basis: 100px; + flex-shrink: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + padding-right: 10px; + color: #666; + } + + .draggerUploadWrapper { + margin: 16px 0 0; + + .ant-upload-drag-container { + padding: 24px 0 16px; + + .iconUpload { + i { + color: #5d9cec; + font-size: 43px; + } + } + + .uplaod-title { + font-size: 14px; + color: #333; + height: 24px; + line-height: 24px; + margin-top: 8px; + } + + .uplaod-subTitle { + height: 22px; + font-size: 12px; + color: #666; + text-align: center; + line-height: 22px; + } + } + } + + .bottom-border, .description { + margin-top: 12px; + + p { + font-size: 12px; + color: #666; + line-height: 15px; + margin: 12px 0; + } + } + + .bottom-border { + border-bottom: 1px solid #e5e5e5; + + .weapp-salary-link { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + color: #5d9cec; + } + } + + } + } + + .weapp-batch-impsteps-picker-content-imp-step3 { + .weapp-batch-impsteps-picker-spinText { + position: relative; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + text-align: center; + + p { + margin: 14px 0; + } + } + } + + } +} diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 6b369e25..fcda1779 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -25,6 +25,8 @@ import TaxAgent from "./pages/taxAgent"; import CalculateDetail from "./pages/calculateDetail"; import PlaceOnFileDetail from "./pages/calculateDetail/placeOnFileDetail"; import CompareDetail from "./pages/calculateDetail/compareDetail"; +import DoCalcDetail from "./pages/calculate/doCalc"; +import OfflineCompare from "./pages/calculate/calcOc"; import GenerateDeclarationDetail from "./pages/declare/generateDeclarationDetail"; import TemplatePreview from "./pages/payroll/templatePreview"; import MobilePayroll from "./pages/mobilePayroll"; @@ -73,6 +75,8 @@ const DataAcquisition = (props) => props.children; // ledger 薪资账套 // calculate 薪资核算 // calculateDetail 核算详情 +// DoCalcDetail 核算详情页面-新 +// OfflineCompare 薪资核算线下对比-新 // placeOnFileDetail 核算归档详情 // compareDetail 线下线上对比 // payroll 工资单发放 @@ -129,16 +133,10 @@ const Routes = ( - - + + + + diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js index e010e827..9f4803e6 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js @@ -54,7 +54,6 @@ export const condition = [ options: [], viewAttr: 2, helpfulTip: "", - hide: true }, { colSpan: 1, @@ -99,7 +98,6 @@ export const reportCondition = [ rules: "required|string", viewAttr: 3, helpfulTip: "", - hide: true } ], title: "", diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js index 0345cad3..2051d811 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js @@ -73,7 +73,7 @@ class ReportList extends Component { { _.isEmpty(dataSource) ?
{getLabel(83553, "暂无数据")}
: _.map(dataSource, it => { - const { reportName, dimension, id, dimensionId } = it; + const { reportName, dimension, id, dimensionId, isShare } = it; return this.handleGoReportView(id)}>
@@ -85,15 +85,25 @@ class ReportList extends Component {
- this.handleOptsClick(e, id, dimensionId)}> - {getLabel(501169, "编辑")} - {getLabel(535052, "删除")} - - }> - - + { + !isShare && + this.handleOptsClick(e, id, dimensionId)}> + {getLabel(501169, "编辑")} + {getLabel(535052, "删除")} + + }> + + + }
+ { + isShare && +
+ {getLabel(111, "被分享")} +
+
+ } ; }) diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less index e0326f2a..5a3c335e 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less @@ -31,6 +31,47 @@ justify-content: space-between; padding: 22px 0 22px 16px; border: 1px solid #e5e5e5; + position: relative; + + .ant-ribbon { + padding: 0 8px; + color: #1677ff; + font-size: 12px; + line-height: 22px; + list-style: none; + position: absolute; + top: 0; + white-space: nowrap; + background-color: #1677ff; + border-radius: 4px; + + .ant-ribbon-text { + color: #FFF; + } + + .ant-ribbon-corner { + position: absolute; + top: 100%; + width: 8px; + height: 8px; + color: currentcolor; + border: 4px solid; + transform: scaleY(.75); + transform-origin: top; + filter: brightness(75%); + } + } + + .ant-ribbon-placement-end { + inset-inline-end: -8px; + border-end-end-radius: 0; + + .ant-ribbon-corner { + inset-inline-end: 0; + border-inline-end-color: transparent; + border-block-end-color: transparent; + } + } .cardLeft { display: flex; diff --git a/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcImport.js b/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcImport.js new file mode 100644 index 00000000..10f92051 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcImport.js @@ -0,0 +1,71 @@ +/* + * Author: 黎永顺 + * name: 薪資核算-线下对比导入 + * Description: + * Date: 2023/9/27 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import ImportDialog from "../../../../components/importDialog"; +import { importComparisonExcelAcctResult } from "../../../../apis/calculate"; + +const getLabel = WeaLocaleProvider.getLabel; + +class SalaryCalcOcImport extends Component { + constructor(props) { + super(props); + this.state = { + importDialog: { + visible: false, title: "", nextloading: false, importResult: {}, imageId: "", + link: "/api/bs/hrmsalary/salaryacct/comparisonresult/importtemplate/export?salaryAcctRecordId=", + previewUrl: "/api/bs/hrmsalary/salaryacct/comparisonresult/preview", + extraPreview: { salaryAcctRecordId: "" } + } + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible) { + const { importDialog } = this.state; + this.setState({ + importDialog: { + ...this.state.importDialog, + link: `${importDialog.link}${nextProps.salaryAcctRecordId}`, + visible: nextProps.visible, importResult: {}, + title: nextProps.title, imageId: "", + extraPreview: { salaryAcctRecordId: nextProps.salaryAcctRecordId } + } + }); + } + } + + handleImport = (payload) => { + const { importDialog } = this.state; + const { salaryAcctRecordId } = this.props; + this.setState({ importDialog: { ...importDialog, nextloading: true } }); + importComparisonExcelAcctResult({ ...payload, salaryAcctRecordId }) + .then(({ data, status }) => { + this.setState({ importDialog: { ...importDialog, nextloading: false } }); + if (status) { + this.setState({ + importDialog: { ...importDialog, ...payload, importResult: data } + }); + } + }).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } })); + }; + + render() { + const { importDialog } = this.state; + return ( + this.setState(({ + importDialog: { ...importDialog, importResult: {}, imageId: "" } + }))} + nextCallback={imageId => this.handleImport({ imageId })} + /> + ); + } +} + +export default SalaryCalcOcImport; diff --git a/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcList.js b/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcList.js new file mode 100644 index 00000000..e3dda5fb --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcList.js @@ -0,0 +1,126 @@ +/* + * Author: 黎永顺 + * name: 薪资核算-线下对比列表 + * Description: + * Date: 2023/9/26 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; +import { Alert } from "antd"; +import { comparisonResultList } from "../../../../apis/calculate"; + +const getLabel = WeaLocaleProvider.getLabel; + +class SalaryCalcOcList extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, + columns: [], dataSource: [], formulaDesc: "" + }; + } + + componentDidMount() { + this.comparisonResultList(this.props); + } + + componentWillReceiveProps(nextProps, nextContext) { + if ( + (nextProps.form.onlyDiffEmployee !== this.props.form.onlyDiffEmployee) || + (nextProps.form.onlyDiffSalaryItem !== this.props.form.onlyDiffSalaryItem) || + (nextProps.searchBool !== this.props.searchBool) + ) { + this.comparisonResultList(nextProps); + } + } + + comparisonResultList = (props) => { + const { form, routeParams: { salaryAcctRecordId } } = props; + const { pageInfo } = this.state; + this.setState({ loading: true }); + const payload = { ...pageInfo, ...form, salaryAcctRecordId }; + comparisonResultList(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { list: dataSource, columns, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, columns, + pageInfo: { ...pageInfo, current, pageSize, total } + }); + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { dataSource, loading, columns, pageInfo, formulaDesc } = this.state; + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => this.comparisonResultList(this.props)); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.comparisonResultList(this.props)); + } + }; + return ( + + + { + if (i > 1) { + if (i > 2) { + return { + ...o, width: 180, + render: (__, record) => { + const formulaDesc = record["customParameters"][`${o["dataIndex"]}`]; + const showDifference = record[`${o["dataIndex"]}_type`] === "number"; + const { acctResultValue, excelResultValue } = record[o["dataIndex"]]; + return
this.setState({ formulaDesc })}> +
+ {getLabel(543280, "系统值")}: + {acctResultValue} +
+
+ {getLabel(543281, "线下值")}: + {excelResultValue} +
+ { + showDifference && +
+ {getLabel(543282, "差值")}: + {calculateDifference(acctResultValue, excelResultValue)} +
+ } +
; + } + }; + } + return { ...o, width: 180 }; + } + return { ...o, width: 150, fixed: "left" }; + })} + /> +
+ ); + } +} + +export default SalaryCalcOcList; +// 计算差值 +const calculateDifference = (systemValue, excelValue) => { + if (_.isNil(systemValue) || _.isNil(excelValue)) return ""; + const systemNum = Number(systemValue); + const excelNum = Number(excelValue); + return (systemNum - excelNum).toFixed(2); +}; diff --git a/pc4mobx/hrmSalary/pages/calculate/calcOc/index.js b/pc4mobx/hrmSalary/pages/calculate/calcOc/index.js new file mode 100644 index 00000000..62e0a92d --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/calcOc/index.js @@ -0,0 +1,85 @@ +/* + * Author: 黎永顺 + * name: 薪资核算-线下对比 + * Description: + * Date: 2023/9/26 + */ +import React, { Component } from "react"; +import { Button } from "antd"; +import { WeaCheckbox, WeaInputSearch, WeaLocaleProvider } from "ecCom"; +import SalaryCalcOcList from "./components/salaryCalcOcList"; +import SalaryCalcOcImport from "./components/salaryCalcOcImport"; +import Layout from "../doCalc/layout"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + salaryOcImpDialog: { visible: false, title: "", salaryAcctRecordId: "" }, + form: { + onlyDiffEmployee: true, onlyDiffSalaryItem: true, + employeeName: "" + }, searchBool: false + }; + } + + handleFiledChange = (key, value) => { + const { form } = this.state; + this.setState({ + form: { ...form, [key]: value } + }); + }; + + handleExportClick = () => { + const { routeParams: { salaryAcctRecordId } } = this.props; + window.open(`/api/bs/hrmsalary/salaryacct/comparisonresult/export?salaryAcctRecordId=${salaryAcctRecordId}`, "_blank"); + }; + handleImportClick = () => { + const { routeParams: { salaryAcctRecordId } } = this.props; + this.setState({ + salaryOcImpDialog: { visible: true, title: getLabel(24023, "数据导入"), salaryAcctRecordId } + }); + }; + + render() { + const { form, searchBool, salaryOcImpDialog } = this.state; + return ( + +
+
+
+ this.handleFiledChange("onlyDiffEmployee", v === "1")}/> + this.handleFiledChange("onlyDiffSalaryItem", v === "1")}/> +
+
+ + + this.handleFiledChange("employeeName", v)} + onSearch={() => this.setState({ searchBool: !searchBool })}/> +
+
+
+ + this.setState({ + salaryOcImpDialog: { ...salaryOcImpDialog, visible: false }, + searchBool: typeof isFresh === "boolean" ? !searchBool : searchBool + })} + /> +
+
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/calculate/calcOc/index.less b/pc4mobx/hrmSalary/pages/calculate/calcOc/index.less new file mode 100644 index 00000000..7ec01822 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/calcOc/index.less @@ -0,0 +1,83 @@ +.salary-calc-oc { + width: 100%; + height: 100%; + overflow: hidden; + background: #f6f6f6; + display: flex; + flex-direction: column; + + .compare-header { + padding-left: 16px; + display: flex; + justify-content: space-between; + align-items: center; + + .left-search { + display: flex; + align-items: center; + } + + .weapp-salary-btn-flex { + display: flex; + align-items: center; + justify-content: flex-end; + cursor: auto; + + & > button { + margin-right: 10px; + } + + .wea-input-focus { + background: #f6f6f6; + margin-top: -4px; + + .ant-input { + background: #f6f6f6; + } + } + } + + .header { + height: 48px; + padding: 0 16px; + font-size: 12px; + color: #111; + } + } + + .header-border-bottom { + border-bottom: 1px solid #e5e5e5; + } + + .salary-calc-oc-body { + flex: 1; + padding: 16px; + overflow-y: hidden; + + .wea-new-table { + background: #FFF; + height: calc(100% - 44px); + + .ant-table-tbody { + td { + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } + + .comparison-column-item-container { + cursor: pointer; + + .comparison-single-row { + margin: 4px 0; + } + + .danger { + color: #ff4d4f; + } + } + } + } +} diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.js new file mode 100644 index 00000000..97fe5c49 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.js @@ -0,0 +1,27 @@ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { Button } from "antd"; +import { WeaInputSearch, WeaLocaleProvider } from "ecCom"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("calculateStore") +@observer +class Index extends Component { + render() { + const { calculateStore: { ECSearchForm } } = this.props; + return ( +
+ ECSearchForm.updateFields({ employeeName: v })} + onSearch={this.props.onAdvanceSearch} + /> + +
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.less new file mode 100644 index 00000000..1a3d7283 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/advanceInputBtn/index.less @@ -0,0 +1,28 @@ +.advance-search { + display: flex; + align-items: center; + position: relative; + top: -2.5px; + + .wea-advanced-search { + top: 2px; + left: -1px; + height: 28px; + line-height: 1; + border-radius: 0; + position: relative; + color: #474747; + padding: 4px 15px; + } + + .wea-advanced-search:hover { + border: 1px solid #dadada; + color: #474747; + } + + .text-elli { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } +} diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js new file mode 100644 index 00000000..9d76e00f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js @@ -0,0 +1,138 @@ +/* + * Author: 黎永顺 + * name: 薪资核算-自定义导出 + * Description: + * Date: 2023/9/18 + */ + +import React, { Component } from "react"; +import { Button, Col, message, Row } from "antd"; +import { inject, observer } from "mobx-react"; +import { WeaCheckbox, WeaDialog, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import { customCacheExportField } from "../../../../../apis/calculate"; +import { convertToUrlString } from "../../../../../util/url"; + +const { getLabel } = WeaLocaleProvider; + +@inject("calculateStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + itemsCheckeds: [], + showOnlyChecked: false + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) { + this.setState({ + itemsCheckeds: !_.isEmpty(nextProps.checkItems) ? nextProps.checkItems : [] + }); + } + } + + customExportClick = () => { + const { calculateStore: { ECSearchForm }, salaryAcctRecordId } = this.props; + const { itemsCheckeds } = this.state; + customCacheExportField({ salaryItems: _.map(itemsCheckeds, it => it.toString()) }).then(({ status, errorMsg }) => { + if (status) { + const { consolidatedTaxation = "0", ...extra } = ECSearchForm.getFormParams(); + const payload = { ...extra, consolidatedTaxation: consolidatedTaxation === "0" ? "" : consolidatedTaxation }; + window.open( + `/api/bs/hrmsalary/salaryacct/acctresult/exportWithCustomFields?salaryAcctRecordId=${salaryAcctRecordId}&ids=&${convertToUrlString(payload)}&salaryItemIds=${itemsCheckeds.join(",")}` + ); + } else { + message.error(errorMsg); + } + }); + }; + handleShowOnlyChecked = (showOnlyChecked) => this.setState({ showOnlyChecked: !!Number(showOnlyChecked) }); + handleSelectGroupAll = (groupId, checked) => { + const { itemsCheckeds } = this.state; + const { itemsByGroup } = this.props; + _.map(itemsByGroup, item => { + if (item.salarySobItemGroupId === groupId) { + if (!!Number(checked)) { + this.setState({ + itemsCheckeds: [...itemsCheckeds, ..._.map(item.salaryItems, child => child.salaryItemId)] + }); + } else { + this.setState({ + itemsCheckeds: _.differenceWith(itemsCheckeds, _.map(item.salaryItems, child => child.salaryItemId), _.isEqual) + }); + } + } + }); + }; + + render() { + const { showOnlyChecked, itemsCheckeds } = this.state; + const { itemsByGroup } = this.props; + let dataSource = _.map(itemsByGroup, item => { + return { + ...item, + salaryItems: _.map(item.salaryItems, child => { + return { ...child, checked: itemsCheckeds.includes(child.salaryItemId) }; + }) + }; + }); + if (showOnlyChecked) { + dataSource = _.map(dataSource, item => { + return { ...item, salaryItems: _.filter(item.salaryItems, it => !!it.checked) }; + }); + } + return ( + {getLabel(17416, "导出")}, + + ]} + bottomLeft={} + > + { + _.map(dataSource, item => { + const { salarySobItemGroupName, salaryItems, salarySobItemGroupId } = item; + const value = _.every(salaryItems, it => !!it.checked) ? "1" : "0"; + return this.handleSelectGroupAll(salarySobItemGroupId, val)}/>}> + + { + !_.isEmpty(salaryItems) ? + _.map(salaryItems, it => { + const { salaryItemId, salaryItemName, checked } = it; + return + this.setState({ itemsCheckeds: _.xorWith(itemsCheckeds, [salaryItemId], _.isEqual) })}/> + ; + }) : {getLabel(83553, "暂无数据")} + } + + ; + }) + } + + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/baseInfo.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/baseInfo.js new file mode 100644 index 00000000..c12b35e7 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/baseInfo.js @@ -0,0 +1,75 @@ +/* + * Author: 黎永顺 + * name: 人员信息确认-基础信息 + * Description: + * Date: 2023/9/13 + */ +import React, { Component } from "react"; +import { WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import SalaryMonthTip from "../salaryMonthTip"; +import { getSalarySobCycle, salaryacctGetForm } from "../../../../../apis/calculate"; +import { Col, Row } from "antd"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class BaseInfo extends Component { + constructor(props) { + super(props); + this.state = { + salaryInfo: {}, salarySobCycle: {} + }; + } + + componentDidMount() { + const promise = this.init(); + } + + init = async () => { + const { routeParams: { salaryAcctRecordId } } = this.props; + const [salaryInfo, salarySobCycle] = await Promise.all([salaryacctGetForm({ id: salaryAcctRecordId }), getSalarySobCycle({ salaryAcctRecordId })]); + if (salaryInfo.status && salarySobCycle.status) { + this.setState({ + salaryInfo: salaryInfo.data, salarySobCycle: salarySobCycle.data + }); + } + }; + + render() { + const { salaryInfo, salarySobCycle } = this.state; + const { formDTO } = salaryInfo || {}; + return ( + + + + + + {getLabel(542604, "薪资所属月")} + } + style={{ marginLeft: 10 }} + /> + + {formDTO && formDTO.salaryMonth} + + + + + {getLabel(519146, "核算账套")} + {formDTO && formDTO.salarySobName} + + + + + {getLabel(536726, "备注")} + {formDTO && formDTO.description} + + + + + ); + } +} + +export default BaseInfo; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/condition.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/condition.js new file mode 100644 index 00000000..a92c43df --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/condition.js @@ -0,0 +1,104 @@ +export const personConfirmSearchConditions = [ + { + items: [ + { + colSpan: 2, + conditionType: "INPUT", + domkey: ["employeeName"], + fieldcol: 12, + label: "姓名", + lanId: 25034, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "INPUT", + domkey: ["workcode"], + fieldcol: 12, + label: "工号", + lanId: 1933, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "57", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["departmentIds"], + fieldcol: 12, + label: "部门", + lanId: 27511, + labelcol: 6, + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "24", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["positionIds"], + fieldcol: 12, + label: "岗位", + lanId: 6086, + labelcol: 6, + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "SELECT", + domkey: ["statuses"], + fieldcol: 12, + multiple: true, + label: "状态", + lanId: 535101, + labelcol: 6, + options: [], + viewAttr: 2 + } + ], + defaultshow: true, + title: "常用条件" + } +]; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js new file mode 100644 index 00000000..6c544e8f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js @@ -0,0 +1,287 @@ +/* + * Author: 黎永顺 + * name: 人员确认 + * Description: + * Date: 2023/9/13 + */ +import React, { Component } from "react"; +import { WeaBrowser, WeaButtonIcon, WeaHelpfulTip, WeaLocaleProvider, WeaTab, WeaTable, WeaTools } from "ecCom"; +import { inject, observer } from "mobx-react"; +import { Button, message, Modal } from "antd"; +import BaseInfo from "./baseInfo"; +import { + acctemployeeList, + addedemployeeList, + deleteAcctemployee, + reducedemployeeList, + saveAcctemployee +} from "../../../../../apis/calculate"; +import { personConfirmSearchConditions } from "./condition"; +import { getSearchs } from "../../../../../util"; +import { convertToUrlString } from "../../../../../util/url"; + +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; +const api = { + range: acctemployeeList, + sub: reducedemployeeList, + add: addedemployeeList +}; + +@inject("calculateStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + selectedKey: "range", showSearchAd: false, + searchConditions: [], loading: false, + pageInfo: { current: 1, pageSize: 10, total: 0 }, + selectedRowKeys: [], dataSource: [], columns: [] + }; + } + + componentDidMount() { + if ($) { + const domTabInnerList = $(".salary-calculate-do-calc-content .ant-tabs-tab-inner"); + domTabInnerList[0].setAttribute("title", ""); + domTabInnerList[1].setAttribute("title", ""); + domTabInnerList[2].setAttribute("title", ""); + } + this.setState({ + searchConditions: _.map(personConfirmSearchConditions, item => { + return { + ...item, + items: _.map(item.items, o => { + if (getKey(o) === "statuses") { + return { + ...o, + options: [ + { key: "0", showname: getLabel(18883, "试用") }, { key: "1", showname: getLabel(15711, "正式") }, + { key: "2", showname: getLabel(480, "临时") }, { key: "3", showname: getLabel(15844, "试用延期") }, + { key: "4", showname: getLabel(542707, "解雇") }, { key: "5", showname: getLabel(6091, "离职") }, + { key: "6", showname: getLabel(6092, "退休") } + ] + }; + } + return { ...o }; + }), + title: getLabel(32905, "常用条件") + }; + }) + }, () => { + const { calculateStore: { PCSearchForm } } = this.props; + PCSearchForm.initFormFields(this.state.searchConditions); + this.queryPCList(); + }); + } + + renderTabBtns = () => { + const { selectedKey, selectedRowKeys } = this.state; + let tabBtns = []; + switch (selectedKey) { + case "range": + tabBtns = [ + this.handleDeletePCitem()}/>, + ids && this.handleUserBrowserChange(ids.split(","))} + > + + , + + ]; + break; + case "add": + case "sub": + tabBtns = [ + + ]; + break; + default: + break; + } + return tabBtns; + }; + queryPCList = () => { + const { pageInfo, selectedKey } = this.state; + const { calculateStore: { PCSearchForm }, routeParams: { salaryAcctRecordId } } = this.props; + const { departmentIds, positionIds, statuses, ...extra } = PCSearchForm.getFormParams(); + const payload = { + salaryAcctRecordId, ...pageInfo, ...extra, + departmentIds: !_.isEmpty(departmentIds) ? departmentIds.split(",") : [], + positionIds: !_.isEmpty(positionIds) ? positionIds.split(",") : [], + statuses: !_.isEmpty(statuses) ? statuses.split(",") : [] + }; + this.setState({ loading: true }); + api[selectedKey](payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource = [], pageNum: current, pageSize, total } = data; + this.setState({ + columns, dataSource, pageInfo: { ...pageInfo, current, pageSize, total } + }); + } + }).catch(() => this.setState({ loading: false })); + }; + handleDeletePCitem = (ids) => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(388758, "确认要删除吗?"), + onOk: () => { + const { selectedRowKeys } = this.state; + const { routeParams: { salaryAcctRecordId } } = this.props; + deleteAcctemployee({ salaryAcctRecordId, ids: !_.isEmpty(ids) ? ids : selectedRowKeys }) + .then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(502230, "删除成功!")); + this.queryPCList(); + _.isNil(ids) && this.setState({ selectedRowKeys: [] }); + } else { + message.error(errormsg || getLabel(20462, "删除失败!")); + } + }); + } + }); + }; + /* + * Author: 黎永顺 + * Description: 人员确认导出 + * Params: + * Date: 2023/9/14 + */ + handleExport = () => { + let url = ""; + const { routeParams: { salaryAcctRecordId }, calculateStore: { PCSearchForm } } = this.props; + if (this.state.selectedKey === "range") { + url = `${window.location.origin}/api/bs/hrmsalary/salaryacct/acctemployee/export?salaryAcctRecordId=${salaryAcctRecordId}&${convertToUrlString(PCSearchForm.getFormParams())}`; + } else if (this.state.selectedKey === "sub") { + url = `${window.location.origin}/api/bs/hrmsalary/salaryacct/reducedemployee/export?salaryAcctRecordId=${salaryAcctRecordId}&${convertToUrlString(PCSearchForm.getFormParams())}`; + } else { + url = `${window.location.origin}/api/bs/hrmsalary/salaryacct/addedemployee/export?salaryAcctRecordId=${salaryAcctRecordId}&${convertToUrlString(PCSearchForm.getFormParams())}`; + } + window.open(url, "_blank"); + }; + /* + * Author: 黎永顺 + * Description: 添加人员确认 + * Params: + * Date: 2023/9/14 + */ + handleUserBrowserChange = (employeeIds) => { + const { routeParams: { salaryAcctRecordId } } = this.props; + saveAcctemployee({ salaryAcctRecordId, employeeIds }).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(541531, "添加成功!")); + this.queryPCList(); + } else { + message.error(errormsg || getLabel(111, "添加失败!")); + } + }); + }; + + render() { + const { calculateStore: { PCSearchForm } } = this.props; + const { + selectedKey, showSearchAd, searchConditions, pageInfo, loading, selectedRowKeys, + columns, dataSource + } = this.state; + const tabDatas = [ + { + title: + {getLabel(542307, "核算人员范围")} + + , viewcondition: "range" + }, + { + title: + {getLabel(542308, "环比上月减少人员")} + + , viewcondition: "sub" + }, + { + title: + {getLabel(542308, "环比上月增加人员")} + + , viewcondition: "add" + } + ]; + 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.queryPCList()); + }, + onChange: current => { + this.setState({ pageInfo: { ...pageInfo, current } }, () => this.queryPCList()); + } + }; + const rowSelection = { + columnWidth: 80, + selectedRowKeys, + onChange: selectedRowKeys => this.setState({ selectedRowKeys }) + }; + return ( +
+ + this.setState({ selectedKey: v }, () => this.queryPCList())} + buttons={this.renderTabBtns()} searchType={["base", "advanced"]} advanceHeight={220} + showSearchAd={showSearchAd} setShowSearchAd={bool => this.setState({ showSearchAd: bool })} + searchsAd={getSearchs(PCSearchForm, searchConditions, 2, false)} + onSearchChange={(v) => PCSearchForm.updateFields({ employeeName: v })} + searchsBaseValue={PCSearchForm.getFormParams().employeeName} + onSearch={this.queryPCList} onAdSearch={this.queryPCList} + onAdReset={() => PCSearchForm.resetForm()} autoCalculateWidth + /> + { + let width = ""; + const { dataIndex } = item; + switch (dataIndex) { + case "taxAgentName": + case "departmentName": + width = "15%"; + break; + default: + width = "10%"; + break; + } + return { ...item, width }; + }), + { + dataIndex: "operate", + title: getLabel(30585, "操作"), + width: 120, + render: (_, record) => ( + this.handleDeletePCitem([record.id])}>{getLabel(535052, "删除")} + ) + } + ]} + /> +
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less new file mode 100644 index 00000000..eb4fb73b --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.less @@ -0,0 +1,47 @@ +.person-confirm-layout { + .wea-tab .wea-tab-right, .wea-input-focus { + background: transparent; + } + + .wea-new-table { + background: #fff; + } +} + +.docalc-baseinfo-layout { + padding: 0; + + .wea-title { + border-bottom: none; + padding-left: 0; + } + + .wea-content.pt15 { + padding-top: 0; + } + + .docalc-baseinfo { + background: #fff; + border: 1px solid #e5e5e5; + border-right: none; + + .ant-col-24 { + border-top: 1px solid #e5e5e5; + } + + .label { + color: #666; + } + + .value { + color: #111; + } + + & > div { + border-right: 1px solid #e5e5e5; + line-height: 30px; + padding: 5px 16px; + + } + } +} diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js new file mode 100644 index 00000000..3539ec72 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js @@ -0,0 +1,59 @@ +/* + * Author: 黎永顺 + * name: 薪资基本信息 + * Description: + * Date: 2023/9/25 + */ +import React, { Component } from "react"; +import { WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import cs from "classnames"; +import { Col, Row } from "antd"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class EditSalaryBaseInfo extends Component { + render() { + const { baseInfo } = this.props; + return ( + + {getLabel(82743, "基础信息")} + + + } + > + + { + _.map(baseInfo, (item, index) => { + const { fieldName, fieldValue } = item; + return ( + + + + {fieldName} + + + {fieldValue} + + + + ); + }) + } + + + ); + } +} + +export default EditSalaryBaseInfo; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/condition.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/condition.js new file mode 100644 index 00000000..59fcb015 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/condition.js @@ -0,0 +1,145 @@ +export const editCalcSearchConditions = [ + { + items: [ + { + colSpan: 2, + conditionType: "INPUT", + domkey: ["employeeName"], + fieldcol: 12, + label: "姓名", + lanId: 25034, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "INPUT", + domkey: ["workcode"], + fieldcol: 12, + label: "工号", + lanId: 1933, + labelcol: 6, + value: "", + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "164", + viewAttr: 2 + }, + colSpan: 1, + conditionType: "BROWSER", + domkey: ["subcompanyIds"], + fieldcol: 12, + label: "分部", + lanId: 33553, + labelcol: 6, + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "57", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["departmentIds"], + fieldcol: 12, + label: "部门", + lanId: 27511, + labelcol: 6, + viewAttr: 2 + }, + { + browserConditionParam: { + completeParams: {}, + conditionDataParams: {}, + dataParams: {}, + destDataParams: {}, + hasAddBtn: false, + hasAdvanceSerach: false, + idSeparator: ",", + isAutoComplete: 1, + isDetail: 0, + isMultCheckbox: false, + isSingle: false, + icon: "icon-coms-hrm", + linkUrl: "", + pageSize: 10, + quickSearchName: "", + replaceDatas: [], + title: "", + type: "24", + viewAttr: 2 + }, + colSpan: 2, + conditionType: "BROWSER", + domkey: ["positionIds"], + fieldcol: 12, + label: "岗位", + lanId: 6086, + labelcol: 6, + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "SELECT", + domkey: ["statuses"], + fieldcol: 12, + multiple: true, + label: "状态", + lanId: 535101, + labelcol: 6, + options: [], + viewAttr: 2 + }, + { + colSpan: 2, + conditionType: "CHECKBOX", + domkey: ["consolidatedTaxation"], + fieldcol: 12, + isQuickSearch: false, + label: "合并计税", + labelcol: 6, + viewAttr: 2 + } + ], + defaultshow: true, + title: "常用条件" + } +]; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcAdvanceSearchPannel.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcAdvanceSearchPannel.js new file mode 100644 index 00000000..4ddc7908 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcAdvanceSearchPannel.js @@ -0,0 +1,206 @@ +/* + * Author: 黎永顺 + * name: 薪资核算-高级搜索面板 + * Description: + * Date: 2023/9/14 + */ +import React, { Component } from "react"; +import { WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup, WeaSelect, WeaTools } from "ecCom"; +import { Button, Col, Row } from "antd"; +import { inject, observer } from "mobx-react"; +import uuidV4 from "uuid/v4"; +import { editCalcSearchConditions } from "./condition"; +import { getExportField } from "../../../../../apis/calculate"; +import { commonEnumList } from "../../../../../apis/ruleconfig"; +import { getSearchs } from "../../../../../util"; + +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; + +@inject("calculateStore") +@observer +class EditCalcAdvanceSearchPannel extends Component { + constructor(props) { + super(props); + this.state = { + searchConditions: [], salaryItems: [], + customSearchConditions: [], filterEnum: [] + }; + } + + componentDidMount() { + this.getExportField(); + this.getFilterEnumList(); + this.setState({ + searchConditions: _.map(editCalcSearchConditions, item => { + return { + ...item, + items: _.map(item.items, o => { + if (getKey(o) === "statuses") { + return { + ...o, + options: [ + { key: "0", showname: getLabel(18883, "试用") }, { key: "1", showname: getLabel(15711, "正式") }, + { key: "2", showname: getLabel(480, "临时") }, { key: "3", showname: getLabel(15844, "试用延期") }, + { key: "4", showname: getLabel(542707, "解雇") }, { key: "5", showname: getLabel(6091, "离职") }, + { key: "6", showname: getLabel(6092, "退休") } + ] + }; + } + return { ...o }; + }), + title: getLabel(32905, "常用条件") + }; + }) + }, () => { + const { calculateStore: { ECSearchForm } } = this.props; + ECSearchForm.initFormFields(this.state.searchConditions); + }); + } + + getFilterEnumList = () => { + commonEnumList({ enumClass: "com.engine.salary.enums.common.FilterEnum" }) + .then(({ status, data }) => { + if (status) { + this.setState({ + filterEnum: _.map(data, item => ({ + key: item.value, + showname: item.defaultLabel + })) + }); + } + }); + }; + getExportField = () => { + getExportField({ salaryAcctRecordId: this.props.salaryAcctRecordId }) + .then(({ status, data }) => { + if (status) { + const { itemsByGroup } = data; + this.setState({ + salaryItems: _.map(itemsByGroup, item => ({ + key: item.salarySobItemGroupId.toString(), + label: item.salarySobItemGroupName, + options: _.map(item.salaryItems, o => ({ + key: o.salaryItemId.toString(), showname: o.salaryItemName + })) + })) + }); + } + }); + }; + handleAddCustomSearchForm = () => { + const { calculateStore: { setOtherConditions } } = this.props; + const { customSearchConditions, salaryItems, filterEnum } = this.state; + const uuid = uuidV4(); + this.setState({ + customSearchConditions: [ + ...customSearchConditions, + { + com: CustomFormFields({ + uuid, salaryItems, filterEnum, onDelete: this.handleDelete, onChange: this.handleChange + }), + uuid, itemId: "", filter: "", params: "" + } + ] + }, () => { + setOtherConditions(_.map(this.state.customSearchConditions, o => ({ + itemId: o.itemId, filter: o.filter, params: o.params + }))); + }); + }; + handleChange = (uuid, params) => { + const { calculateStore: { setOtherConditions } } = this.props; + const { customSearchConditions } = this.state; + this.setState({ + customSearchConditions: _.map(customSearchConditions, o => { + if (o.uuid === uuid) { + return { ...o, ...params }; + } + return { ...o }; + }) + }, () => { + setOtherConditions(_.map(this.state.customSearchConditions, o => ({ + itemId: o.itemId, filter: o.filter, params: o.params + }))); + }); + }; + handleDelete = (uuid) => { + const { calculateStore: { setOtherConditions } } = this.props; + const { customSearchConditions } = this.state; + this.setState({ + customSearchConditions: _.filter(customSearchConditions, o => o.uuid !== uuid) + }, () => { + setOtherConditions(_.map(this.state.customSearchConditions, o => ({ + itemId: o.itemId, filter: o.filter, params: o.params + }))); + }); + }; + + render() { + const { searchConditions, customSearchConditions } = this.state; + const { calculateStore: { ECSearchForm, setOtherConditions } } = this.props; + return ( + +
+ {getSearchs(ECSearchForm, searchConditions, 2, false)} + +
+ +
+
+ {/**/} +
+
+
+
+ + + +
+
+
+ ); + } +} + +export default EditCalcAdvanceSearchPannel; + +const CustomFormFields = (props) => { + const { uuid, onDelete, salaryItems, filterEnum, onChange } = props; + return + + + onChange(uuid, { itemId: v })} + /> + + + + + onChange(uuid, { filter: v })}/> + + + onChange(uuid, { params: v })}/> +