diff --git a/pc4mobx/hrmSalary/apis/attendance.js b/pc4mobx/hrmSalary/apis/attendance.js index f528ce12..d4a2b304 100644 --- a/pc4mobx/hrmSalary/apis/attendance.js +++ b/pc4mobx/hrmSalary/apis/attendance.js @@ -273,14 +273,14 @@ export const importAttendQuoteData = (params) => { }; // 查看考勤详情 -export const viewAttendQuote = (ids) => { +export const viewAttendQuote = (params) => { return fetch("/api/bs/hrmsalary/attendQuote/view", { method: "POST", mode: "cors", headers: { "Content-Type": "application/json", }, - body: JSON.stringify(ids), + body: JSON.stringify(params), }).then((res) => res.json()); }; diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index c03ac28a..2ffee227 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -333,6 +333,17 @@ export const fileSalaryAcct = (params) => { } }).then(res => res.json()); }; +// 薪资记录-回算 +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()); +}; // 薪资记录-重新核算 export const reAccounting = (params) => { @@ -498,3 +509,62 @@ 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", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; +//薪资核算-页面查看权限 +export const salaryacctAcctresultCheckAuth = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/acctresult/checkAuth", "GET", params); +}; diff --git a/pc4mobx/hrmSalary/apis/cumDeduct.js b/pc4mobx/hrmSalary/apis/cumDeduct.js index 8d54f306..fc963bb5 100644 --- a/pc4mobx/hrmSalary/apis/cumDeduct.js +++ b/pc4mobx/hrmSalary/apis/cumDeduct.js @@ -1,5 +1,5 @@ import { WeaTools } from "ecCom"; -import { postFetch } from '../util/request'; +import { postFetch } from "../util/request"; //数据采集-累计专项附加扣除列表 export const getCumDeductList = (params) => { @@ -7,9 +7,9 @@ export const getCumDeductList = (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()); }; @@ -52,9 +52,9 @@ export const getCumDeductDetailList = (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()); }; @@ -62,9 +62,9 @@ export const getCumDeductDetailList = (params) => { export const exportCumDeductDetailList = (id, ids = "") => { fetch( "/api/bs/hrmsalary/addUpDeduction/exportDetail?accumulatedSpecialAdditionalDeductionId=" + - id + - "&ids=" + - ids+ "&taxAgentId=" + taxAgentId + id + + "&ids=" + + ids + "&taxAgentId=" + taxAgentId ).then((res) => res.blob().then((blob) => { var filename = `累计专项附加扣除.xlsx`; @@ -84,9 +84,9 @@ export const importCumDeductParam = (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()); }; @@ -96,34 +96,44 @@ export const importCumDeductPreview = (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()); }; //新增累计专项附加扣除 export const createAddUpDeduction = (params) => { - return postFetch('/api/bs/hrmsalary/addUpDeduction/createAddUpDeduction', params); -} + return postFetch("/api/bs/hrmsalary/addUpDeduction/createAddUpDeduction", params); +}; //查看信息 export const getAddUpDeduction = (params) => { - return postFetch('/api/bs/hrmsalary/addUpDeduction/getAddUpDeduction', params); -} + return postFetch("/api/bs/hrmsalary/addUpDeduction/getAddUpDeduction", params); +}; //编辑累计专项附加扣除 export const editAddUpDeduction = (params) => { - return postFetch('/api/bs/hrmsalary/addUpDeduction/editAddUpDeduction', params); -} + return postFetch("/api/bs/hrmsalary/addUpDeduction/editAddUpDeduction", params); +}; //批量删除累计专项附加扣除 export const deleteSelectAddUpDeduction = (params) => { - return postFetch('/api/bs/hrmsalary/addUpDeduction/deleteSelectAddUpDeduction', params); -} + return postFetch("/api/bs/hrmsalary/addUpDeduction/deleteSelectAddUpDeduction", params); +}; //一键清空累计专项附加扣除 export const deleteAllAddUpDeduction = (params) => { - return postFetch('/api/bs/hrmsalary/addUpDeduction/deleteAllAddUpDeduction', params); -} + return postFetch("/api/bs/hrmsalary/addUpDeduction/deleteAllAddUpDeduction", params); +}; //一键累计 export const autoAddAll = (params) => { - return postFetch('/api/bs/hrmsalary/addUpDeduction/autoAddAll', params); -} + return postFetch("/api/bs/hrmsalary/addUpDeduction/autoAddAll", params); +}; + +//数据采集列表查询 +export const getTableDate = ({ url, ...params }) => { + return postFetch(url, params); +}; +//数据采集列表详情记录查询 +export const getTableRecordDate = ({ url, ...params }) => { + return postFetch(url, params); +}; + diff --git a/pc4mobx/hrmSalary/apis/declare.js b/pc4mobx/hrmSalary/apis/declare.js index 8cf65377..360c8b62 100644 --- a/pc4mobx/hrmSalary/apis/declare.js +++ b/pc4mobx/hrmSalary/apis/declare.js @@ -1,4 +1,5 @@ import { WeaTools } from 'ecCom'; +import { postFetch } from '../util/request'; //个税申报表-个税申报表列表 export const getDeclareList = params => { @@ -7,7 +8,7 @@ export const getDeclareList = params => { mode: 'cors', headers: { 'Content-Type': 'application/json' - }, + }, body: JSON.stringify(params) }).then(res => res.json()) } @@ -24,7 +25,7 @@ export const saveDeclare = params => { mode: 'cors', headers: { 'Content-Type': 'application/json' - }, + }, body: JSON.stringify(params) }).then(res => res.json()) } @@ -41,7 +42,7 @@ export const getDetailList = params => { mode: 'cors', headers: { 'Content-Type': 'application/json' - }, + }, body: JSON.stringify(params) }).then(res => res.json()) } @@ -52,13 +53,16 @@ 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); + 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); +} diff --git a/pc4mobx/hrmSalary/apis/fieldManage.js b/pc4mobx/hrmSalary/apis/fieldManage.js new file mode 100644 index 00000000..5e75f876 --- /dev/null +++ b/pc4mobx/hrmSalary/apis/fieldManage.js @@ -0,0 +1,20 @@ +import { WeaTools } from "ecCom"; +import { postFetch } from "../util/request"; + +//获取编辑详情 +export const getSalaryFieldForm = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryField/getSalaryForm", "GET", params); +}; +// 字段管理查询 +export const salaryFieldList = (params) => { + return postFetch('/api/bs/hrmsalary/salaryField/list', params); +} + +// 字段管理查询 +export const saveSalaryField = (params) => { + return postFetch('/api/bs/hrmsalary/salaryField/save', params); +} +// 删除字段管理 +export const deleteSalaryField = (params) => { + return postFetch('/api/bs/hrmsalary/salaryField/delete', params); +} diff --git a/pc4mobx/hrmSalary/apis/item.js b/pc4mobx/hrmSalary/apis/item.js index 5ad36dbc..ccf93af9 100644 --- a/pc4mobx/hrmSalary/apis/item.js +++ b/pc4mobx/hrmSalary/apis/item.js @@ -70,6 +70,7 @@ export const deleteItemList = params => { //薪资项目-新增薪资项目 export const saveItem = params => { + delete params.formulaContent return fetch('/api/bs/hrmsalary/salaryitem/save', { method: 'POST', mode: 'cors', @@ -106,6 +107,10 @@ export const saveSysItem = 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 *** // 获取公式变量类型 @@ -144,6 +149,17 @@ export const saveFormual = params => { 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()) +} // 根据id获取formual export const detailFormual = params => { diff --git a/pc4mobx/hrmSalary/apis/ledger.js b/pc4mobx/hrmSalary/apis/ledger.js index 2d411cd3..b04e881e 100644 --- a/pc4mobx/hrmSalary/apis/ledger.js +++ b/pc4mobx/hrmSalary/apis/ledger.js @@ -139,13 +139,32 @@ export const getLedgerItemGroupForm = params => { //保存薪资帐套薪资项目 export const saveLedgerItem = params => { + const { itemGroups, items, ...extra } = params; + const payload = { + itemGroups: _.map(itemGroups, item => { + return { + ...item, + items: _.map(item.items, it => { + delete it.formulaContent; + return { ...it }; + }) + }; + }), + items: _.map(items, child => { + delete child.formulaContent; + return { ...child }; + }) || [], + ...extra + }; + + return fetch("/api/bs/hrmsalary/salarysob/item/save", { method: "POST", mode: "cors", headers: { "Content-Type": "application/json" }, - body: JSON.stringify(params) + body: JSON.stringify(payload) }).then(res => res.json()); }; @@ -268,3 +287,25 @@ export const listAdjustmentRule = params => { body: JSON.stringify(params) }).then(res => res.json()); }; + +//获取回算薪资项目 +export const getAggregate = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salarysob/backitem/getAggregate", "GET", params); +}; + +//编辑回算薪资项目详情 +export const getBackitemForm = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salarysob/backitem/getForm", "GET", params); +}; +//保存回算薪资项目详情 +export const salarysobBackitemSave = params => { + return postFetch("/api/bs/hrmsalary/salarysob/backitem/save", params); +}; +//预览人员范围导入 +export const salarysobRangePreview = params => { + return postFetch("/api/bs/hrmsalary/salarysob/range/preview", params); +}; +//导入人员范围 +export const salarysobRangeImportData = params => { + return postFetch("/api/bs/hrmsalary/salarysob/range/importData", params); +}; diff --git a/pc4mobx/hrmSalary/apis/mySalaryBenefits.js b/pc4mobx/hrmSalary/apis/mySalaryBenefits.js index 7a29d7db..c87cd3ab 100644 --- a/pc4mobx/hrmSalary/apis/mySalaryBenefits.js +++ b/pc4mobx/hrmSalary/apis/mySalaryBenefits.js @@ -1,29 +1,45 @@ -import { WeaTools } from 'ecCom'; +import { WeaTools } from "ecCom"; // 工资单列表 export const mySalaryBillList = params => { - return fetch('/api/bs/hrmsalary/salaryBill/mySalaryBillList', { - method: 'POST', - mode: 'cors', + return fetch("/api/bs/hrmsalary/salaryBill/mySalaryBillList", { + method: "POST", + mode: "cors", headers: { - 'Content-Type': 'application/json' - }, + "Content-Type": "application/json" + }, body: JSON.stringify(params) - }).then(res => res.json()) + }).then(res => res.json()); }; // 社保福利列表 export const welfareList = params => { - return WeaTools.callApi('/api/bs/hrmsalary/report/welfare/list', 'GET', 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); + return WeaTools.callApi("/api/bs/hrmsalary/report/record/list", "GET", params); }; // 工资查看详情 export const mySalaryBill = params => { - return WeaTools.callApi('/api/bs/hrmsalary/salaryBill/mySalaryBill', 'GET', params); -}; \ No newline at end of file + return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/mySalaryBill", "GET", params); +}; + +export const isNeedSecondPwdVerify = params => { + return WeaTools.callApi("/api/encrypt/secondauthsetting/isNeedSecondAuth", "POST", params); +}; +export const getSecondAuthForm = params => { + return WeaTools.callApi("/api/encrypt/secondauthsetting/getSecondAuthForm", "POST", params); +}; +export const doSecondAuth = params => { + return WeaTools.callApi("/api/encrypt/secondauthsetting/doSecondAuth", "POST", params); +}; +export const checkPassword = params => { + return WeaTools.callApi("/api/hrm/secondarypwd/checkPassword", "POST", params); +}; +export const saveSecondaryPwd = params => { + return WeaTools.callApi("/api/hrm/secondarypwd/saveSecondaryPwd", "POST", params); +}; diff --git a/pc4mobx/hrmSalary/apis/payroll.js b/pc4mobx/hrmSalary/apis/payroll.js index 954050e9..1f9b1d64 100644 --- a/pc4mobx/hrmSalary/apis/payroll.js +++ b/pc4mobx/hrmSalary/apis/payroll.js @@ -1,4 +1,5 @@ import { WeaTools } from "ecCom"; +import { postFetch } from "../util/request"; //工资单-工资单发放列表 export const getPayrollList = params => { @@ -11,6 +12,10 @@ export const getPayrollList = params => { body: JSON.stringify(params) }).then(res => res.json()); }; +// 工资单发放进度条 +export const getPayrollIssuanceProgressBar = (id) => { + return WeaTools.callApi("/api/bs/hrmsalary/progress/getRate?cacheKey=SALARY_GRANT_PROGRESS_" + id, "get", {}); +}; //工资单-获取table提示信息 export const getPayrollInfo = params => { @@ -174,13 +179,14 @@ export const savePayroll = 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(params) + body: JSON.stringify({ background: _.isNil(background) ? "" : background, ...extra }) }).then(res => res.json()); }; @@ -313,3 +319,72 @@ export const grantProxy = params => { body: JSON.stringify(params) }).then(res => res.json()); }; + +// 工资单发放-新建时获取补发工资单模板薪资项目设置 +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()); +}; + +// 工资单发放-获取规则设置下拉框 +export const getReplenishRuleSetOptions = ({ salarySobId }) => { + return fetch(`/api/bs/hrmsalary/salaryBill/template/getReplenishRuleSetOptions?salarySobId=${salarySobId}`, { + method: "GET", + mode: "cors", + headers: { + "Content-Type": "application/json" + } + }).then(res => res.json()); +}; + +//添加发送和撤回人员范围列表 +export const sendRangeList = (params) => { + return postFetch("/api/bs/hrmsalary/salaryBill/send/range/list", params); +}; +//创建范围 +export const sendRangeSave = (params) => { + return postFetch("/api/bs/hrmsalary/salaryBill/send/range/save", params); +}; +//刪除范围 +export const sendRangeDelete = (params) => { + return postFetch("/api/bs/hrmsalary/salaryBill/send/range/delete", params); +}; +//工资单模板-获取模板可用的分组 +export const getAvailableSalaryGroupSet = (params) => { + return postFetch("/api/bs/hrmsalary/salaryBill/template/getAvailableSalaryGroupSet", params); +}; +//工资单模板-获取模板分组下可用的薪资项目 +export const getAvailableSalaryItemSet = (params) => { + return postFetch("/api/bs/hrmsalary/salaryBill/template/getAvailableSalaryItemSet", params); +}; +//工资单发放-查看详情页面列表合计行数据 +export const salaryBillSendSum = (params) => { + return postFetch("/api/bs/hrmsalary/salaryBill/send/sum", params); +}; +//工资单发放-发送短信验证码 +export const sendMobileCode = (params) => { + return postFetch("/api/bs/hrmsalary/salaryBill/sendMobileCode", params); +}; +//工资单-验证方式 +export const payrollCheckType = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/payrollCheckType", "GET", params); +}; + +// 工资单基础设置-获取设置列表 +export const getSalaryBillBaseSetForm = (id) => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/baseSet/getForm", "get", {}); +}; +//工资单基础设置-保存工资单基础设置(设置水印) +export const salaryBillBaseSetSave = (params) => { + return postFetch("/api/bs/hrmsalary/salaryBill/baseSet/save", params); +}; +//工资单基础设置-保存工资单基础设置(水印预览) +export const salaryBillBaseSetPreviewWaterMark = (params) => { + return postFetch("/api/bs/hrmsalary/salaryBill/baseSet/previewWaterMark", params); +}; diff --git a/pc4mobx/hrmSalary/apis/payrollFiles.js b/pc4mobx/hrmSalary/apis/payrollFiles.js index 74cf1d72..7ebdb6bb 100644 --- a/pc4mobx/hrmSalary/apis/payrollFiles.js +++ b/pc4mobx/hrmSalary/apis/payrollFiles.js @@ -65,3 +65,11 @@ export const deletePendingTodo = (params) => { export const deleteSuspendTodo = (params) => { return postFetch('/api/bs/hrmsalary/salaryArchive/deleteSuspendTodo', params); } +// 待定薪、停薪员工 是否允许删除薪资档案 +export const salaryArchiveDelete = (params) => { + return WeaTools.callApi('/api/bs/hrmsalary/sys/conf/code?code=salaryArchiveDelete', 'GET', params); +} +// 删除薪资档案 +export const deleteSalaryArchive = (params) => { + return postFetch('/api/bs/hrmsalary/salaryArchive/deleteSalaryArchive', params); +} diff --git a/pc4mobx/hrmSalary/apis/ruleconfig.js b/pc4mobx/hrmSalary/apis/ruleconfig.js index 2e5967fc..2e3c0c4f 100644 --- a/pc4mobx/hrmSalary/apis/ruleconfig.js +++ b/pc4mobx/hrmSalary/apis/ruleconfig.js @@ -1,45 +1,65 @@ -import { WeaTools } from 'ecCom'; -import { postFetch } from '../util/request'; +import { WeaTools } from "ecCom"; +import { postFetch } from "../util/request"; //通用字典表 {enumClass:""} 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 sysOrderRule = params => { - return WeaTools.callApi('/api/bs/hrmsalary/sys/orderRule', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/sys/orderRule", "GET", params); +}; //保存排序规则 export const updateOrderRule = (params) => { - return postFetch('/api/bs/hrmsalary/sys/updateOrderRule', params); -} + return postFetch("/api/bs/hrmsalary/sys/updateOrderRule", params); +}; //导入规则详情信息 export const sysConfCodeRule = params => { - return WeaTools.callApi('/api/bs/hrmsalary/sys/conf/code', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/sys/conf/code", "GET", params); +}; //保存导入规则 export const saveMatchEmployeeModeRule = (params) => { - return postFetch('/api/bs/hrmsalary/sys/saveMatchEmployeeModeRule', params); -} + return postFetch("/api/bs/hrmsalary/sys/saveMatchEmployeeModeRule", params); +}; //应用配置查询 export const queryAppsetting = (params) => { - return WeaTools.callApi('/api/bs/hrmsalary/sys/app/setting', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/sys/app/setting", "GET", params); +}; //加密配置保存 export const saveEncryptSetting = (params) => { - return postFetch('/api/bs/hrmsalary/sys/app/setting/saveEncryptSetting', params); -} + return postFetch("/api/bs/hrmsalary/sys/app/setting/saveEncryptSetting", params); +}; //加密配置保存 export const appSettingSave = (params) => { - return postFetch('/api/bs/hrmsalary/sys/app/setting/save', params); -} + return postFetch("/api/bs/hrmsalary/sys/app/setting/save", params); +}; //获取加密进度条 export const getEncryptProgress = params => { - return WeaTools.callApi('/api/bs/hrmsalary/sys/app/getEncryptProgress', 'GET', params); -} + return WeaTools.callApi("/api/bs/hrmsalary/sys/app/getEncryptProgress", "GET", params); +}; //保存报税规则 export const operateTaxDeclarationFunction = (params) => { - return postFetch('/api/bs/hrmsalary/sys/operateTaxDeclarationFunction', params); -} + return postFetch("/api/bs/hrmsalary/sys/operateTaxDeclarationFunction", params); +}; +//保存档案删除规则 +export const saveArchiveDelete = (params) => { + return postFetch("/api/bs/hrmsalary/sys/saveArchiveDelete", params); +}; +//保存个税申报撤回规则 +export const saveWithDrawTaxDeclaration = (params) => { + return postFetch("/api/bs/hrmsalary/sys/saveWithDrawTaxDeclaration", params); +}; +//保存匹配规则 +export const saveSalaryAcctEmployeeRule = (params) => { + return postFetch("/api/bs/hrmsalary/sys/saveSalaryAcctEmployeeRule", params); +}; +//保存薪酬统计报表 +export const reportStatisticsReportSave = (params) => { + return postFetch("/api/bs/hrmsalary/report/statistics/report/save", params); +}; +//薪酬统计维度下拉列表 +export const reportGetForm = params => { + return WeaTools.callApi("/api/bs/hrmsalary/report/statistics/report/getForm", "GET", params); +}; diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index 24da62d4..28235f77 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -202,6 +202,14 @@ export const getWelfareList = () => { {} ); }; +// 补差表单字段对应的接口 +export const getBalanceWelfareList = () => { + return WeaTools.callApi( + "/api/bs/hrmsalary/siaccount/getBalanceWelfareList", + "get", + {} + ); +}; // 社保福利台账-导入预览 export const welfarePreview = (params) => { @@ -226,6 +234,17 @@ export const importInsuranceAcctDetail = (params) => { body: JSON.stringify(params) }).then((res) => res.json()); }; +// 社保福利台账-补差数据导入 +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()); +}; // 社保福利台账-线下对比数据导入 export const importExcelInsuranceDetail = (params) => { @@ -251,14 +270,30 @@ export const saveRecession = (params) => { export const recessionList = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/detail/recession/list", params); }; +//查询补差列表 +export const balanceList = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/detail/balance/list", params); +}; //删除退差数据 export const delRecession = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/delRecession", params); }; +//删除补差数据 +export const delBalance = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/delBalance", params); +}; //编辑社保福利缴纳数据 export const editAccount = (params) => { return postFetch("/api/bs/hrmsalary/siaccount/editAccount", params); }; +//获取指定月份的福利基数 +export const getSupplementPaymentForm = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/detail/getSupplementPaymentForm", params); +}; +//获取待编辑的补缴费用相关福利项 +export const getPaymentGroup = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/detail/getPaymentGroup", params); +}; //获取核算项个人和公司社保福利缴纳详情 export const getPaymentById = ({ id }) => { return fetch(`/api/bs/hrmsalary/siaccount/getPaymentById?id=${id}`, { @@ -266,6 +301,41 @@ export const getPaymentById = ({ id }) => { mode: "cors", headers: { "Content-Type": "application/json" - }, + } }).then(res => res.json()); }; +//获取社保福利项列表 +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()); +}; + +//获取调差列表 +export const getCompensationList = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/compensationList", params); +}; +//获取可调差的人员列表 +export const getEmployeeListToCompensation = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/getEmployeeListToCompensation", params); +}; +//获取当前调差行-公司方支出总计 +export const getCompensationComTotal = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/compensationComTotal", params); +}; +//社保调差保存 +export const compensationSave = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/compensationSave", params); +}; +//社保调差默认配置保存 +export const compensationConfigSave = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/compensationConfigSave", params); +}; +//撤回调差数据 +export const compensationBack = (params) => { + return postFetch("/api/bs/hrmsalary/siaccount/compensationBack", params); +}; diff --git a/pc4mobx/hrmSalary/apis/statistics.js b/pc4mobx/hrmSalary/apis/statistics.js new file mode 100644 index 00000000..f5f4aff6 --- /dev/null +++ b/pc4mobx/hrmSalary/apis/statistics.js @@ -0,0 +1,80 @@ +import { WeaTools } from "ecCom"; +import { postFetch } from "../util/request"; + +//薪酬统计维度下拉列表 +export const dimensionGetForm = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/report/statistics/dimension/getForm", "GET", params); +}; +//获取自定义统计项目表单 +export const statisticsItemGetform = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/report/statistics/item/getForm", "GET", params); +}; +//自定义统计项目列表 +export const statisticsItemList = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/report/statistics/item/list", "GET", params); +}; +// 保存薪酬统计维度 +export const dimensionSave = (params) => { + return postFetch("/api/bs/hrmsalary/report/statistics/dimension/save", params); +}; +// 薪酬统计维度列表 +export const dimensionList = (params) => { + return postFetch("/api/bs/hrmsalary/report/statistics/dimension/list", params); +}; +// 删除薪酬统计维度 +export const dimensionDelete = (params) => { + return postFetch("/api/bs/hrmsalary/report/statistics/dimension/delete", params); +}; + +//保存薪酬统计报表 +export const reportStatisticsReportList = (params) => { + return postFetch("/api/bs/hrmsalary/report/statistics/report/list", params); +}; +//删除薪酬统计报表 +export const reportStatisticsReportDelete = (params) => { + return postFetch("/api/bs/hrmsalary/report/statistics/report/delete", params); +}; +//获取薪酬统计报表数据 +export const reportStatisticsReportGetData = (params) => { + return postFetch("/api/bs/hrmsalary/report/statistics/report/getData", params); +}; +//保存自定义统计项目 +export const reportStatisticsItemSave = (params) => { + return postFetch("/api/bs/hrmsalary/report/statistics/item/save", params); +}; +//保存数据范围及负责设置 +export const reportStatisticsSaveSearchCondition = (params) => { + return postFetch("/api/bs/hrmsalary/report/statistics/report/saveSearchCondition", params); +}; +//删除自定义统计项目 +export const reportStatisticsItemDelete = (params) => { + return postFetch("/api/bs/hrmsalary/report/statistics/item/delete", params); +}; +//获取薪酬统计报表查询条件 +export const reportStatisticsGetSearchCondition = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/report/statistics/report/getSearchCondition", "GET", params); +}; +//分析图数据展示范围设置查询 +export const queryRangeSetting = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/report/statistics/echarts/queryRangeSetting", "GET", params); +}; +//分析图数据展示范围设置删除 +export const deleteRangeSetting = (params) => { + return WeaTools.callApi("/api/bs/hrmsalary/report/statistics/echarts/deleteRangeSetting", "GET", params); +}; +//分析图数据展示范围设置保存 +export const saveRangeSetting = (params) => { + return postFetch("/api/bs/hrmsalary/report/statistics/echarts/saveRangeSetting", params); +}; +//员工列表 +export const statisticsEmployeeList = (params) => { + return postFetch("/api/bs/hrmsalary/report/statistics/employee/list", params); +}; +//员工详情列表 +export const statisticsEmployeeDetailList = (params) => { + return postFetch("/api/bs/hrmsalary/report/statistics/employee/detailList", params); +}; +//数据透视-列表查询 +export const getDataPerspective = (params) => { + return postFetch("/api/bs/hrmsalary/report/statistics/report/getDataPerspective", params); +}; diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index 1c5b7670..3ca3a72d 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -86,6 +86,14 @@ export const getTaxAgentRangeListExclude = (params) => { export const getTaxAgentRangeForm = (params) => { return postFetch("/api/bs/hrmsalary/taxAgent/range/getForm", params); }; +//预览个税扣缴义务人中人员范围 +export const taxAgentRangePreview = (params) => { + return postFetch("/api/bs/hrmsalary/taxAgent/range/preview", params); +}; +//导入个税扣缴义务人中人员范围 +export const taxAgentRangeImportData = (params) => { + return postFetch("/api/bs/hrmsalary/taxAgent/range/importData", params); +}; //个税扣缴义务人下拉列表 export const getTaxAgentSelectList = (params) => { diff --git a/pc4mobx/hrmSalary/apis/welfareArchive.js b/pc4mobx/hrmSalary/apis/welfareArchive.js index 5c1a1b48..a38f22ce 100644 --- a/pc4mobx/hrmSalary/apis/welfareArchive.js +++ b/pc4mobx/hrmSalary/apis/welfareArchive.js @@ -1,142 +1,150 @@ -import { WeaTools } from 'ecCom'; +import { WeaTools } from "ecCom"; import { postFetch } from "../util/request"; export const tips = params => { - return WeaTools.callApi('/api/bs/hrmsalary/archives/tips', 'get', params); + return WeaTools.callApi("/api/bs/hrmsalary/archives/tips", "get", params); }; export const getCondition = params => { - return WeaTools.callApi('/api/bs/hrmsalary/archives/getSearchCondition', 'get', params); + return WeaTools.callApi("/api/bs/hrmsalary/archives/getSearchCondition", "get", params); }; //社保福利档案列表 export const queryList = (params) => { - return postFetch('/api/bs/hrmsalary/archives/getTable', params); + return postFetch("/api/bs/hrmsalary/archives/getTable", params); }; //社保福利档案列表 export const queryInsuranceTabTotal = (params) => { - return WeaTools.callApi('/api/bs/hrmsalary/archives/queryInsuranceTabTotal', params); + return WeaTools.callApi("/api/bs/hrmsalary/archives/queryInsuranceTabTotal", params); }; -//删除待办 +//删除待办-待增员 export const updateRunStatus = (params) => { - return postFetch('/api/bs/hrmsalary/archives/updateRunStatus', params); + return postFetch("/api/bs/hrmsalary/archives/updateRunStatus", params); +}; +//删除待办-待减员 +export const cancelStayDel = (params) => { + return postFetch("/api/bs/hrmsalary/archives/cancelStayDel", params); }; //全量增员 export const allStayAddToPay = (params) => { - return WeaTools.callApi('/api/bs/hrmsalary/archives/allStayAddToPay', 'GET', params); + return WeaTools.callApi("/api/bs/hrmsalary/archives/allStayAddToPay", "GET", params); }; //全量减员 export const allStayDelToStop = (params) => { - return WeaTools.callApi('/api/bs/hrmsalary/archives/allStayDelToStop', 'GET', params); + return WeaTools.callApi("/api/bs/hrmsalary/archives/allStayDelToStop", "GET", params); }; //增员 export const stayAddToPay = (params) => { - return postFetch('/api/bs/hrmsalary/archives/stayAddToPay', params); + return postFetch("/api/bs/hrmsalary/archives/stayAddToPay", params); }; //减员 export const stayDelToStop = (params) => { - return postFetch('/api/bs/hrmsalary/archives/stayDelToStop', params); + return postFetch("/api/bs/hrmsalary/archives/stayDelToStop", params); +}; +//删除社保档案 +export const deleteArchive = (params) => { + return postFetch("/api/bs/hrmsalary/archives/deleteArchive", params); }; //取消停缴 export const cancelStopPayment = (params) => { - return postFetch('/api/bs/hrmsalary/archives/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 fetch("/api/bs/hrmsalary/archives/getTable", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); }; export const getBaseForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/archives/getBaseForm', 'get', params); + return WeaTools.callApi("/api/bs/hrmsalary/archives/getBaseForm", "get", params); }; export const getPaymentForm = params => { - return WeaTools.callApi('/api/bs/hrmsalary/archives/getPaymentForm', 'get', params); + return WeaTools.callApi("/api/bs/hrmsalary/archives/getPaymentForm", "get", 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()) + 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); + 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 WeaTools.callApi("/api/bs/hrmsalary/archives/getImportParams", "get", 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 => { - 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/scheme/template/export", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).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 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 fetch("/api/bs/hrmsalary/scheme/preview", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // 档案导入 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 fetch("/api/bs/hrmsalary/scheme/importBatch", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(params) + }).then(res => res.json()); +}; // 导出档案 export const exportArchives = (ids) => { - fetch('/api/bs/hrmsalary/scheme/export?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/scheme/export?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); + })); +}; diff --git a/pc4mobx/hrmSalary/apis/welfareScheme.js b/pc4mobx/hrmSalary/apis/welfareScheme.js index d0e0b11c..e7d1f3e7 100644 --- a/pc4mobx/hrmSalary/apis/welfareScheme.js +++ b/pc4mobx/hrmSalary/apis/welfareScheme.js @@ -62,7 +62,15 @@ 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 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()) }; export const createSICategory = params => { return fetch('/api/bs/hrmsalary/sicategory/createSICategory', { diff --git a/pc4mobx/hrmSalary/common/Icon-empty-file.svg b/pc4mobx/hrmSalary/common/Icon-empty-file.svg new file mode 100644 index 00000000..cfab82a9 --- /dev/null +++ b/pc4mobx/hrmSalary/common/Icon-empty-file.svg @@ -0,0 +1,38 @@ + + + Icon-empty-file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pc4mobx/hrmSalary/common/leftTree-hide.png b/pc4mobx/hrmSalary/common/leftTree-hide.png new file mode 100644 index 00000000..0a1cadfc Binary files /dev/null and b/pc4mobx/hrmSalary/common/leftTree-hide.png differ diff --git a/pc4mobx/hrmSalary/common/leftTree-show.png b/pc4mobx/hrmSalary/common/leftTree-show.png new file mode 100644 index 00000000..cc791aad Binary files /dev/null and b/pc4mobx/hrmSalary/common/leftTree-show.png differ diff --git a/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js b/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js new file mode 100644 index 00000000..1668de36 --- /dev/null +++ b/pc4mobx/hrmSalary/components/PersonalScopeModal/index.js @@ -0,0 +1,227 @@ +/* + * Author: 黎永顺 + * name: 新增人员范围弹框 + * Description: + * Date: 2022/11/30 + */ +import React, { Component } from "react"; +import { WeaBrowser, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect } from "ecCom"; +import { Button, message, Modal } from "antd"; +import { getTaxAgentRangeForm } from "../../apis/taxAgent"; +import { SelectWithAll } from "../../pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee"; +import "./index.less"; + +class PersonalScopeModal extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, + employeeStatus: [], + targetTypeList: [], + targetType: "EMPLOYEE", + targetTypeIds: "", + targetTypeIdsNames: "", + status: "", + statusAll: "" + }; + } + + componentDidMount() { + const { isTaxgent = true } = this.props; + if (isTaxgent) { + this.getTaxAgentRangeForm(); + } else { + 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 }); + } + } + + getTaxAgentRangeForm = () => { + getTaxAgentRangeForm().then(({ status, data }) => { + if (status) { + const { employeeStatus, targetTypeList } = data; + this.setState({ + targetTypeList: _.map(targetTypeList, it => ({ key: it.id, showname: it.name })), + employeeStatus: _.map(employeeStatus, it => ({ key: it.id, showname: it.name })) + }); + } + }); + }; + handleSubmit = () => { + const { status, targetTypeIds, targetType } = this.state; + const { includeType, saveKeyVal, onSuccess, onCancel, APISaveFox } = this.props; + if (_.isEmpty(status) || _.isEmpty(targetTypeIds)) { + Modal.warning({ + title: "信息确认", + content: "必要信息不完整,红色*为必填项!" + }); + return; + } + const payload = { + employeeStatus: status.split(","), + includeType, + targetParams: _.map(targetTypeIds.split(","), it => ({ targetType, targetId: it })), + [saveKeyVal["key"]]: saveKeyVal["value"], + }; + this.setState({ loading: true }); + APISaveFox["save"](payload).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success("保存成功"); + this.handleReset(); + onSuccess(); + onCancel(); + } else { + message.error(errormsg || "保存失败"); + } + }).catch(() => this.setState({ loading: true })); + }; + renderBrowser = () => { + const { targetType, targetTypeIds, targetTypeIdsNames } = this.state; + let browserType = {}; + switch (targetType) { + case "EMPLOYEE": + browserType = { ...browserType, type: 17, title: "人员选择" }; + break; + case "DEPT": + browserType = { ...browserType, type: 57, title: "部门选择" }; + break; + case "SUBCOMPANY": + browserType = { ...browserType, type: 164, title: "分部选择" }; + break; + case "POSITION": + browserType = { ...browserType, type: 278, title: "岗位选择" }; + break; + default: + break; + } + return { + this.setState({ targetTypeIds, targetTypeIdsNames }); + }} + />; + }; + handleReset = () => { + this.setState({ + targetType: "EMPLOYEE", + targetTypeIds: "", + status: "", + statusAll: "" + }); + }; + + render() { + const { onCancel, title, visible } = this.props; + const { employeeStatus, targetTypeList, targetType, status, statusAll, loading } = this.state; + const buttons = [ + , + + ]; + return ( + { + this.handleReset(); + onCancel(); + }} + > + + +
+ this.setState({ targetType })} + /> + {this.renderBrowser()} +
+
+ { + SelectWithAll({ + label: "选择员工状态", + options: employeeStatus, + detailtype: 2, + valueAll: statusAll, + value: status, + onChangeAll: ({ selected }) => { + if (selected) { + this.setState({ + status: _.map(employeeStatus, it => it.key).join(","), + statusAll: selected + }); + } else { + this.setState({ + status: "", + statusAll: selected + }); + } + }, + onChange: ({ selected }) => { + const bool = _.every(_.map(employeeStatus, it => it.key), item => selected.split(",").includes(item)); + if (bool) { + this.setState({ + status: selected, + statusAll: "0" + }); + } else { + this.setState({ + status: selected, + statusAll: "" + }); + } + } + }) + } +
+
+ ); + } +} + +export default PersonalScopeModal; diff --git a/pc4mobx/hrmSalary/components/PersonalScopeModal/index.less b/pc4mobx/hrmSalary/components/PersonalScopeModal/index.less new file mode 100644 index 00000000..0c603d8e --- /dev/null +++ b/pc4mobx/hrmSalary/components/PersonalScopeModal/index.less @@ -0,0 +1,14 @@ +//添加关联人员弹框中的下拉框样式 +.personalScopeModalWrapper{ + .wea-select,.ant-select-selection,.ant-select{ + width: 100%; + } + .wea-select{ + display: inline-block; + position: relative; + } + .ant-select-selection{ + height: 30px; + border-radius: 0; + } +} diff --git a/pc4mobx/hrmSalary/components/PersonalScopeTable/index.js b/pc4mobx/hrmSalary/components/PersonalScopeTable/index.js new file mode 100644 index 00000000..8b38ba01 --- /dev/null +++ b/pc4mobx/hrmSalary/components/PersonalScopeTable/index.js @@ -0,0 +1,138 @@ +/* + * Author: 黎永顺 + * name: 人员范围列表数据 + * Description: + * Date: 2022/11/30 + */ +import React, { Component } from "react"; +import { WeaTable } from "ecCom"; +import { calcPageNo } from "../../util"; +import "./index.less"; + +class PersonalScopeTable extends Component { + constructor(props) { + super(props); + this.state = { + loading: { + query: false + }, + dataSource: [], + columns: [], + selectedRowKeys: [], + pageInfo: { + current: 1, + pageSize: 10, + total: 0 + } + }; + } + + componentDidMount() { + this.getPersonalScopeList(); + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.tabActive !== this.props.tabActive) { + this.setState({ selectedRowKeys: [] }, () => { + this.getPersonalScopeList(nextProps.tabActive); + nextProps.onChangeSelectKey([]); + }); + } + } + + getPersonalScopeList = (tabActive = this.props.tabActive) => { + const { searchValue, searchKeyVal, APIFox } = this.props; + const { pageInfo, loading } = this.state; + const payload = { + [searchKeyVal["key"]]: searchKeyVal["value"], + targetName: searchValue, + ...pageInfo + }; + this.setState({ loading: { ...loading, query: true } }); + APIFox[tabActive](payload).then(({ status, data }) => { + this.setState({ loading: { ...loading, query: false } }); + if (status) { + const { pageNum: current, pageSize, total, columns, list: dataSource } = data; + this.setState({ + pageInfo: { ...pageInfo, current, pageSize, total }, + dataSource, + columns: _.map(columns, item => { + return { + ...item, + render: (text) => { + return {text}; + } + }; + }) + }); + } + }).catch(() => { + this.setState({ loading: { ...loading, query: false } }); + }); + }; + + /* + * Author: 黎永顺 + * Description: 清空选中项 + * Params: + * Date: 2022/11/30 + */ + clearRowkeys = () => { + const { pageInfo, selectedRowKeys } = this.state; + this.setState({ + selectedRowKeys: [], + pageInfo: { + ...pageInfo, + current: calcPageNo(pageInfo.total, pageInfo.current, 10, selectedRowKeys.length) + } + }, () => { + this.getPersonalScopeList(); + }); + }; + + render() { + const { dataSource, columns, pageInfo, loading, selectedRowKeys } = this.state; + const { onChangeSelectKey } = this.props; + const pagination = { + ...pageInfo, + showTotal: total => `共 ${total} 条`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => { + this.getPersonalScopeList(); + }); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => { + this.getPersonalScopeList(); + }); + } + }; + const rowSelection = { + selectedRowKeys, + onChange: (selectedRowKeys) => { + this.setState({ selectedRowKeys }, () => { + onChangeSelectKey(this.state.selectedRowKeys); + }); + } + }; + return ( + + ); + } +} + +export default PersonalScopeTable; diff --git a/pc4mobx/hrmSalary/components/PersonalScopeTable/index.less b/pc4mobx/hrmSalary/components/PersonalScopeTable/index.less new file mode 100644 index 00000000..3f90918b --- /dev/null +++ b/pc4mobx/hrmSalary/components/PersonalScopeTable/index.less @@ -0,0 +1,11 @@ +.ledgerWrapper { + height: 100%; + + .tdEllipsis { + display: inline-block; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } +} diff --git a/pc4mobx/hrmSalary/components/UnifiedTable/index.js b/pc4mobx/hrmSalary/components/UnifiedTable/index.js new file mode 100644 index 00000000..f8cbff97 --- /dev/null +++ b/pc4mobx/hrmSalary/components/UnifiedTable/index.js @@ -0,0 +1,26 @@ +import React, { Component } from "react"; +import { WeaTable } from "ecCom"; +import "./index.less"; + +class Index extends Component { + + render() { + const { columns, xWidth = 1440 } = this.props; + const unifiedColumns = _.map(columns, (item, index) => { + if (index === 0 || index === 2) { + return { ...item, fixed: "left", width: 150 }; + } else if (index === 1) { + return { ...item, fixed: "left", width: 176 }; + } + if (item.dataIndex === "operate") { + return { ...item, fixed: "right", width: item.width || "120px" }; + } + return { ...item, width: "33%" }; + }); + return ( + + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/components/UnifiedTable/index.less b/pc4mobx/hrmSalary/components/UnifiedTable/index.less new file mode 100644 index 00000000..616d16f0 --- /dev/null +++ b/pc4mobx/hrmSalary/components/UnifiedTable/index.less @@ -0,0 +1,24 @@ +.unifiedTable { + .ellipsis { + display: inline-block; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .linkWapper { + //a { + // color: #4d7ad8; + // margin-right: 8px; + //} + + i { + cursor: pointer; + } + + //a:hover { + // text-decoration: none; + //} + } +} diff --git a/pc4mobx/hrmSalary/components/captchaModal/index.js b/pc4mobx/hrmSalary/components/captchaModal/index.js new file mode 100644 index 00000000..35661772 --- /dev/null +++ b/pc4mobx/hrmSalary/components/captchaModal/index.js @@ -0,0 +1,94 @@ +/* + * Author: 黎永顺 + * name: 验证码弹框 + * Description: + * Date: 2023/6/16 + */ +import React, { Component } from "react"; +import { WeaDialog, WeaError, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import { sendMobileCode } from "../../apis/payroll"; +import { Button } from "antd"; +import "./index.less"; + +const { getLabel } = WeaLocaleProvider; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + captcha: "", + time: 60 + }; + this.timeRef = null; + } + + componentWillUnmount() { + clearInterval(this.timeRef); + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && !nextProps.visible) { + clearInterval(this.timeRef); + this.setState({ captcha: "", time: 60 }); + } + } + + handleSendCaptcha = () => { + sendMobileCode({ id: this.props.id }).then(({ status, data }) => { + if (status) { + console.log(data); + this.timeRef = setInterval(() => { + const { time } = this.state; + this.setState({ time: time - 1 }, () => { + if (this.state.time === -1) { + clearInterval(this.timeRef); + this.setState({ time: 60 }); + } + }); + }, 1000); + } + }); + }; + handleConfirm = () => { + if (!this.state.captcha) { + this.refs.weaError.showError(); + // return + } + this.props.onCancel(); + this.props.onConfirm(); + }; + + render() { + const { captcha, time } = this.state; + return ( + {getLabel(826, "确定")} + ]} + > + + + +
+ this.setState({ captcha })}/> + +
+
+
+
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/components/captchaModal/index.less b/pc4mobx/hrmSalary/components/captchaModal/index.less new file mode 100644 index 00000000..4f8d23b7 --- /dev/null +++ b/pc4mobx/hrmSalary/components/captchaModal/index.less @@ -0,0 +1,29 @@ +.captchaWrapper { + .wea-dialog-body { + padding: 30px 20px; + + .wea-form-item-wrapper { + .wea-error { + width: 100%; + + .captchaInputBox { + display: flex; + align-items: center; + + .wea-input-normal { + flex: 1; + } + + button { + padding: 8px 10px; + border-radius: 0; + min-width: 80px; + text-align: center; + height: 30px; + line-height: 15px; + } + } + } + } + } +} diff --git a/pc4mobx/hrmSalary/components/customPaginationTable/index.js b/pc4mobx/hrmSalary/components/customPaginationTable/index.js index c7192db2..72fcddd5 100644 --- a/pc4mobx/hrmSalary/components/customPaginationTable/index.js +++ b/pc4mobx/hrmSalary/components/customPaginationTable/index.js @@ -3,8 +3,7 @@ import CustomTable from "../../components/customTable"; class CustomPaginationTable extends PureComponent { shouldComponentUpdate(nextProps, nextState, nextContext) { - if (nextProps.columnIndex && this.props.columnIndex !== nextProps.columnIndex) return false; - return true; + return !(nextProps.columnIndex && this.props.columnIndex !== nextProps.columnIndex); } render() { diff --git a/pc4mobx/hrmSalary/components/excelEditor/components/codeAction.js b/pc4mobx/hrmSalary/components/excelEditor/components/codeAction.js new file mode 100644 index 00000000..bca61000 --- /dev/null +++ b/pc4mobx/hrmSalary/components/excelEditor/components/codeAction.js @@ -0,0 +1,255 @@ +/* + * Author: 黎永顺 + * name: 公式列表 + * Description: + * Date: 2023/4/25 + */ +import React, { Component } from "react"; +import { WeaInputSearch, WeaLocaleProvider } from "ecCom"; +import { Tree } from "antd"; +import { formualSearchField, formualSearchGroup, getFormulaDes } from "../../../apis/item"; +import "../index.less"; + +const TreeNode = Tree.TreeNode; +const getLabel = WeaLocaleProvider.getLabel; + +class CodeAction extends Component { + constructor(props) { + super(props); + this.state = { + disabled: false, + variableText: "", + funcText: "", + variItemText: "", + variableList: [], //变量列表 + variableExpandedKeys: [], //变量展开的节点 + funcList: [], //函数列表 + funcExpandedKeys: [], //函数展开的节点 + funcHoverItem: {} //选中的函数节点 + }; + } + + componentDidMount() { + const { groupParams = {} } = this.props; + this.getFormulaDes(); + this.formualSearchGroup(groupParams); + } + + componentWillReceiveProps(nextProps, nextContext) { + const { isCustomFunction, isCustomFunctionClick, onChangeCustomFunction } = nextProps; + if (isCustomFunction === "1" && !isCustomFunctionClick) { + this.setState({ disabled: true }); + } else { + this.setState({ disabled: false }, () => { + isCustomFunction === "1" && onChangeCustomFunction("0"); + }); + } + } + + getFormulaDes = () => { + getFormulaDes().then(({ data }) => { + if (!_.isEmpty(data)) this.setState({ funcList: data }); + }); + }; + formualSearchGroup = (payload) => { + formualSearchGroup(payload).then(({ status, data }) => { + if (status) this.setState({ + variableList: _.map(data, item => ({ + ...item, + children: [{ name: "", fieldId: "searchInput" }] + })) + }); + }); + }; + formualSearchField = (sourceId) => { + const { groupParams } = this.props; + const { variableList } = this.state; + formualSearchField({ sourceId, extendParam: { ...groupParams } }).then(({ status, data }) => { + if (status) { + this.setState({ + variableList: _.map(variableList, it => ({ + ...it, + children: sourceId === it.key ? [...it.children, ...data] : [...it.children] + })) + }); + } + }); + }; + handleExpandVari = (variableExpandedKeys, { expanded, node }) => { + const { props: { eventKey } } = node; + const { variableList } = this.state; + this.setState({ variableExpandedKeys }); + if (expanded) { + this.formualSearchField(eventKey); + } else { + this.setState({ + variableList: _.map(variableList, it => ({ + ...it, + children: eventKey === it.key ? [{ name: "", fieldId: "searchInput" }] : [...it.children] + })) + }); + } + }; + handleVariNode = (selectedKeys) => { + const { onVariSelect } = this.props; + const { variableList } = this.state; + const parentNode = _.map(variableList, it => it.key); + if (selectedKeys.join() && selectedKeys.join().indexOf("searchInput") === -1 && + !parentNode.includes(selectedKeys.join())) { + const selectParentNodeKey = selectedKeys.join().split("_")[0]; + const convertStr = _.reduce(variableList, (pre, cur) => { + if (cur.key === selectParentNodeKey) { + return pre + cur.value + "." + _.find(cur.children, child => child.fieldId === selectedKeys.join()).name; + } + return pre; + }, ""); + onVariSelect(convertStr); + } + }; + + render() { + const { + variableList, variableExpandedKeys, variableText, variItemText, + funcList, funcText, funcExpandedKeys, funcHoverItem, disabled + } = this.state; + const { groupParams = {} } = this.props; + const { referenceType } = groupParams; + const variableDatalist = _.filter(variableList, it => it.value.indexOf(variableText) !== -1); + const funcDatalist = _.map(funcList, it => ({ + ...it, + children: _.filter(it.children, child => _.lowerCase(child.name).indexOf(_.lowerCase(funcText)) !== -1) + })); + return ( +
+
+
+
{getLabel(111, "变量")}
+
+
+ this.setState({ variableText })}/> + + { + _.map(variableDatalist, item => { + const { key, value, children = [] } = item; + const itemChildren = _.filter(children.slice(1), it => it.name.indexOf(variItemText) !== -1); + return + { + _.map([...children.slice(0, 1), ...itemChildren], (child, childIndex) => { + const { name, fieldId } = child; + return ( + fieldId === "searchInput" ? + this.setState({ variItemText })} + /> + } + key={fieldId + "_" + childIndex}/> : + + ); + }) + } + ; + }) + } + +
+
+ { + referenceType !== "sql" && + +
+
+
{getLabel(111, "函数")}
+
+
+ this.setState({ funcText })}/> + this.setState({ funcExpandedKeys })} + > + { + _.map(funcDatalist, item => { + const { name, dataType, children = [] } = item; + return + { + _.map(children, (child, childIndex) => { + const { name: childName, chineseName } = child; + return ( + this.props.onFuncSelect(childName)} + onMouseEnter={() => this.setState({ funcHoverItem: child })}> + {childName} + {chineseName} +
+ } + key={childIndex} + /> + ); + }) + } + ; + }) + } + +
+
+
+
+
+ {!_.isEmpty(funcHoverItem) ? funcHoverItem.name : getLabel(111, "提示")} +
+
+
+
+ + } + + ); + } +} + +export default CodeAction; + +const TipList = (props) => { + const { tips } = props; + const { paramDescs = [], formatString, description, example, result } = tips; + return _.isEmpty(tips) ?
+
+ {/*
{getLabel(111, "{C:选项} 用来选择特定选项字段下的备选项")}
*/} + {/*
{getLabel(111, "{U:姓名} 用来选择工作区成员")}
*/} + {/*
{getLabel(111, "{D:数据} 用来选择一个部门")}
*/} +
+
:
+
+
{getLabel(111, "语法")}
+
+
{formatString}
+
{description}
+
+
{getLabel(111, "参数")}
+ { + _.map(paramDescs, it => { + return
+ . + {it} +
; + }) + } +
{getLabel(111, "示例")}
+ {example} +
{getLabel(111, "结果")}
+ {result} +
+
; +}; diff --git a/pc4mobx/hrmSalary/components/excelEditor/constants.js b/pc4mobx/hrmSalary/components/excelEditor/constants.js new file mode 100644 index 00000000..2bb11e58 --- /dev/null +++ b/pc4mobx/hrmSalary/components/excelEditor/constants.js @@ -0,0 +1,16 @@ +export const keyboardBaseBtns=[ + { key:"+", label: "+" }, + { key:"-", label: "-" }, + { key:">", label: ">" }, + { key:">=", label: ">=" }, + { key:"=", label: "=" }, + { key:"*", label: "*" }, + { key:"/", label: "/" }, + { key:"<", label: "<" }, + { key:"<=", label: "<=" }, + { key:"!=", label: "!=" }, + { key:"()", label: "(" }, + { key:")", label: ")" }, + { key:"%", label: "%" }, + { key:" ", label: "space" }, +] diff --git a/pc4mobx/hrmSalary/components/excelEditor/extendCodeMirror.js b/pc4mobx/hrmSalary/components/excelEditor/extendCodeMirror.js new file mode 100644 index 00000000..e70c6967 --- /dev/null +++ b/pc4mobx/hrmSalary/components/excelEditor/extendCodeMirror.js @@ -0,0 +1,112 @@ +// extendCodeMirror.js +/* eslint-disable */ +import * as CodeMirror from "codemirror"; + +CodeMirror.extendMode("css", { + commentStart: "/*", + commentEnd: "*/", + newlineAfterToken: function (type, content) { + return /^[;{}]$/.test(content); + } +}); + +CodeMirror.extendMode("javascript", { + commentStart: "", + commentEnd: "", +// FIXME semicolons inside of for + newlineAfterToken: function (type, content, textAfter, state) { + if (this.jsonMode) { + return /^[\[,{]$/.test(content) || /^}/.test(textAfter) || /^]/.test(textAfter); + } else { + if (content == ";" && state.lexical && state.lexical.type == ")") return false; + return /^[;{}]$/.test(content) && !/^;/.test(textAfter); + } + } +}); + +CodeMirror.extendMode("xml", { + commentStart: "", + newlineAfterToken: function (type, content, textAfter) { + return type == "tag" && />$/.test(content) || /^ -1 && endIndex > -1 && endIndex > startIndex) { + // Take string till comment start + selText = selText.substr(0, startIndex) + // From comment start till comment end + + selText.substring(startIndex + curMode.commentStart.length, endIndex) + // From comment end till string end + + selText.substr(endIndex + curMode.commentEnd.length); + } + cm.replaceRange(selText, from, to); + } + }); +}); + +// Applies automatic mode-aware indentation to the specified range +CodeMirror.defineExtension("autoIndentRange", function (from, to) { + var cmInstance = this; + this.operation(function () { + for (var i = from.line; i <= to.line; i++) { + cmInstance.indentLine(i, "smart"); + } + }); +}); + +// Applies automatic formatting to the specified range +CodeMirror.defineExtension("autoFormatRange", function (from, to) { + var cm = this; + var outer = cm.getMode(), text = cm.getRange(from, to).split("\n"); + var state = CodeMirror.copyState(outer, cm.getTokenAt(from).state); + var tabSize = cm.getOption("tabSize"); + + var out = "", lines = 0, atSol = from.ch == 0; + + function newline() { + out += "\n"; + atSol = true; + ++lines; + } + + for (var i = 0; i < text.length; ++i) { + var stream = new CodeMirror.StringStream(text[i], tabSize); + while (!stream.eol()) { + var inner = CodeMirror.innerMode(outer, state); + var style = outer.token(stream, state), cur = stream.current(); + stream.start = stream.pos; + if (!atSol || /\S/.test(cur)) { + out += cur; + atSol = false; + } + if (!atSol && inner.mode.newlineAfterToken && + inner.mode.newlineAfterToken(style, cur, stream.string.slice(stream.pos) || text[i + 1] || "", inner.state)) + newline(); + } + if (!stream.pos && outer.blankLine) outer.blankLine(state); + if (!atSol) newline(); + } + + cm.operation(function () { + cm.replaceRange(out, from, to); + for (var cur = from.line + 1, end = from.line + lines; cur <= end; ++cur) + cm.indentLine(cur, "smart"); + cm.setSelection(from, cm.getCursor(false)); + }); +}); +// export default CodeMirror; +module.exports = { CodeMirror }; diff --git a/pc4mobx/hrmSalary/components/excelEditor/index.js b/pc4mobx/hrmSalary/components/excelEditor/index.js new file mode 100644 index 00000000..8b0fe4ae --- /dev/null +++ b/pc4mobx/hrmSalary/components/excelEditor/index.js @@ -0,0 +1,175 @@ +import React, { Component } from "react"; +import { Button } from "antd"; +import { WeaLocaleProvider } from "ecCom"; +import { Controlled as CodeMirror } from "react-codemirror2"; +import { keyboardBaseBtns } from "./constants"; +import CodeAction from "./components/codeAction"; +import cs from "classnames"; +import "./index.less"; +import "codemirror/lib/codemirror.css"; +import "codemirror/lib/codemirror.js"; +import "codemirror/mode/javascript/javascript.js"; + +require("./extendCodeMirror"); +const getLabel = WeaLocaleProvider.getLabel; + +class ExcelEditor extends Component { + constructor(props) { + super(props); + this.state = { + value: "", + isFormter: false, + isCustomFunctionClick: false + }; + this.editorRef = null; + this.timer = null; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.value !== this.props.value && nextProps.value) this.setState({ value: nextProps.value }); + } + + componentWillUnmount() { + if (this.timer) clearInterval(this.timer); + this.setState({ isCustomFunctionClick: false }); + } + + autoFormatSelection = () => { + const { isFormter } = this.state; + if (isFormter) { + const script_length = this.editorRef.getValue().length; + const startPos = { line: 0, ch: 0, sticky: null }; + const endPos = this.editorRef.doc.posFromIndex(script_length); + this.editorRef.setSelection(startPos, endPos); + this.editorRef.autoFormatRange(startPos, endPos); + this.editorRef.commentRange(true, startPos, endPos); + } else { + this.editorRef.undo(); + // this.editorRef.undo(); + } + }; + insertText = text => { + const cursor = this.editorRef.getCursor(); + this.editorRef.replaceRange(text, cursor); + this.editorRef.refresh(); + this.editorRef.focus(); + }; + replaceToWidget = (editor) => { + editor.getAllMarks().forEach(m => m.clear()); + }; + handleVariSelect = str => this.insertText(`{${str}}`); + handleFuncSelect = str => { + const cursor = this.editorRef.getCursor(); + this.editorRef.replaceRange(`${str}()`, cursor); + this.timer = setTimeout(() => { + const { line, ch } = this.editorRef.getCursor(); + this.editorRef.setCursor({ line, ch: ch - 1 }); + this.editorRef.refresh(); + this.editorRef.focus(); + }, 100); + }; + handleEditorRedo = () => { + const { ch, line } = this.editorRef.getCursor(); + const delStr = this.editorRef.getRange({ line, ch: ch - 1 }, { line, ch }); + const codeValue = this.editorRef.getValue(); + if (delStr === "}") { + if (codeValue.slice(0, ch).lastIndexOf("{") === -1) { + this.editorRef.replaceRange("", { line, ch: ch - 1 }, { line, ch }); + } else { + this.editorRef.replaceRange("", { line, ch: codeValue.slice(0, ch).lastIndexOf("{") }, { line, ch }); + } + } else { + this.editorRef.replaceRange("", { line, ch: ch - 1 }, { line, ch }); + } + this.editorRef.refresh(); + this.editorRef.focus(); + }; + handleBackSpaceRedo = () => { + const { ch, line } = this.editorRef.getCursor(); + const delStr = this.editorRef.getRange({ line, ch: ch - 1 }, { line, ch }); + const codeValue = this.editorRef.getValue(); + if (delStr === "}") { + if (codeValue.slice(0, ch).lastIndexOf("{") === -1) { + this.editorRef.replaceRange("", { line, ch: ch - 1 }, { line, ch }); + } else { + this.editorRef.replaceRange("", { line, ch: codeValue.slice(0, ch).lastIndexOf("{") + 1 }, { line, ch }); + } + } + this.editorRef.refresh(); + this.editorRef.focus(); + }; + + render() { + const { isFormter, isCustomFunctionClick } = this.state; + const { groupParams = {}, isCustomFunction, value, onChangeCustomFunction } = this.props; + const { referenceType } = groupParams; + return ( + +
+
+ this.editorRef = editor} + value={this.state.value} + onBeforeChange={(editor, data, value) => { + this.setState({ value }, () => this.props.onChange(this.state.value)); + }} + onChange={(editor, data, value) => { + this.replaceToWidget(editor, data, value); + }} + options={{ + lineNumbers: false, + mode: "javascript", + autofocus: false, + styleActiveLine: true, + lineWrapping: true, + matchBrackets: true, + lint: false, + indentUnit: 2, + cursorHeight: 0.85, + placeholder: "", + showCursorWhenSelecting: true + }} + onKeyDown={(_, { keyCode }) => keyCode === 8 && this.handleBackSpaceRedo()} + /> +
+ { + referenceType !== "sql" && +
+
+
+ { + _.map(keyboardBaseBtns, item => { + const { key, label } = item; + return ; + }) + } +
+
+ + +
+
+ +
+ } +
+ {/*公式参数列表*/} + +
+ ); + } +} + +export default ExcelEditor; diff --git a/pc4mobx/hrmSalary/components/excelEditor/index.less b/pc4mobx/hrmSalary/components/excelEditor/index.less new file mode 100644 index 00000000..0ea0081a --- /dev/null +++ b/pc4mobx/hrmSalary/components/excelEditor/index.less @@ -0,0 +1,199 @@ +.excel-codeWrap { + width: 100%; + display: flex; + justify-content: space-around; + padding: 0 0 8px; + + .excel-codeBox { + flex: 1; + overflow: auto; + background: #fff; + box-sizing: content-box; + border: 1px solid #e5e5e5; + + span { + font-family: Liberation Mono, LiberationMonoRegular, Courier New, monospace; + } + + .CodeMirror-code { + font-size: 16px; + + + } + + .CodeMirror-scroll { + overflow-x: visible !important; + padding: 4px; + } + + .CodeMirror-sizer { + margin-left: 0 !important; + } + + .CodeMirror-gutters { + border-right: none; + background-color: #f7f7f7; + opacity: 0; + display: none; + } + } + + .excel-codeBox-keyboard { + width: 272px; + min-height: 232px; + padding: 20px; + background: #fff; + border: 1px solid #e5e5e5; + border-left: none; + + .excel-codeBox-keyboard-operate { + display: flex; + + .excel-codeBox-keyboard-operate-content { + display: flex; + flex-wrap: wrap; + flex: 1; + + .excel-codeBox-keyboard-base { + width: 30px; + height: 30px; + text-align: center; + margin: 0 10px 10px 0; + } + + .excel-codeBox-keyboard-space { + width: 70px; + height: 30px; + } + } + + .excel-codeBox-keyboard-operate-clear { + width: 30px; + + .excel-codeBox-keyboard-del { + width: 30px; + height: 70px; + } + + .excel-codeBox-keyboard-clear { + width: 30px; + height: 30px; + margin-top: 10px; + } + } + } + } +} + +.excel-codeAction { + width: 100%; + display: flex; + justify-content: space-between; + + .excel-codeAction-item:last-child { + margin-right: 0; + + .excel-codeAction-header-title { + color: rgb(217, 82, 189); + } + } + + .excel-codeAction-item { + width: 33%; + min-height: 317px; + flex: 1; + background: #fff; + border: 1px solid #e5e5e5; + margin-right: 16px; + display: flex; + flex-direction: column; + + .excel-codeAction-header { + display: flex; + padding: 10px 16px; + border-bottom: 1px solid #e5e5e5; + + .excel-codeAction-header-title { + flex: 1; + font-weight: 600; + } + } + + .excel-codeAction-content { + flex: 1; + overflow: hidden auto; + padding: 0 16px; + max-height: 280px; + position: relative; + + .variableOuterInput { + width: 100%; + margin-top: 10px; + position: sticky; + top: 10px; + background-color: #fff; + z-index: 1; + } + + .variableTree { + li a:hover, li a.ant-tree-node-selected { + background: transparent; + } + + li:first-child { + a { + padding: 2px 5px; + } + } + + li a { + width: calc(100% - 16px); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + + .ant-tree-title { + display: inline-block; + width: 100%; + + .funcListTitle { + width: 100%; + display: flex; + justify-content: space-between; + + & > span { + display: inline-block; + flex: 1 1; + overflow: hidden; + text-overflow: ellipsis; + word-break: keep-all; + white-space: nowrap; + } + + .functionName { + max-width: 100px; + } + + .functionDesc { + max-width: 100px; + text-align: right; + color: #999; + } + } + } + } + } + + .code-action-list { + padding: 10px 0; + .code-action-tips-title{ + height: 22px; + line-height: 22px; + } + .code-action-tips-info{ + color: #999 + } + } + } + } +} diff --git a/pc4mobx/hrmSalary/components/importModal/headerSet.js b/pc4mobx/hrmSalary/components/importModal/headerSet.js index e51047b1..41fe75a7 100644 --- a/pc4mobx/hrmSalary/components/importModal/headerSet.js +++ b/pc4mobx/hrmSalary/components/importModal/headerSet.js @@ -1,20 +1,20 @@ -import React from "react" -import { Button } from "antd" -import { WeaCheckbox, WeaHelpfulTip } from "ecCom"; +import React from "react"; +import { Button } from "antd"; export default class HeaderSet extends React.Component { - render() { - return ( -
- - - -
- ) - } -} \ No newline at end of file + render() { + return ( +
+ + {/**/} + {/**/} +
+ ); + } +} diff --git a/pc4mobx/hrmSalary/components/importModal/index.js b/pc4mobx/hrmSalary/components/importModal/index.js index 8e47ef9a..012c113f 100644 --- a/pc4mobx/hrmSalary/components/importModal/index.js +++ b/pc4mobx/hrmSalary/components/importModal/index.js @@ -107,7 +107,8 @@ export default class ImportModal extends React.Component { localStorage.removeItem("fileList"); this.props.onCancel(); }} - style={{ width: 850 }} + style={{ width: 850, height: 600 }} + hasScroll className="importModalWrapper" initLoadCss buttons={ diff --git a/pc4mobx/hrmSalary/components/importModal/index.less b/pc4mobx/hrmSalary/components/importModal/index.less index d472ab37..64c95083 100644 --- a/pc4mobx/hrmSalary/components/importModal/index.less +++ b/pc4mobx/hrmSalary/components/importModal/index.less @@ -1,7 +1,5 @@ .importModalWrapper { - .wea-dialog-body { - height: 80vh; - overflow: hidden auto; + .ant-modal-body { padding: 16px; } diff --git a/pc4mobx/hrmSalary/components/index.js b/pc4mobx/hrmSalary/components/index.js index 98497f66..74d0b74a 100644 --- a/pc4mobx/hrmSalary/components/index.js +++ b/pc4mobx/hrmSalary/components/index.js @@ -1,17 +1,17 @@ -import React from 'react'; -import { inject, observer } from 'mobx-react'; -import { toJS } from 'mobx'; +import React from "react"; +import { inject, observer } from "mobx-react"; +import { toJS } from "mobx"; -import { Button } from 'antd'; -import { WeaLogView } from 'comsMobx'; -import { WeaTop, WeaRightMenu, WeaLocaleProvider, WeaNewScroll } from 'ecCom'; +import { Button } from "antd"; +import { WeaLogView } from "comsMobx"; +import { WeaLocaleProvider, WeaNewScroll, WeaTop } from "ecCom"; -import { renderNoright, renderLoading, getSearchs } from '../util'; // 从util文件引入公共的方法 +import { getSearchs, renderLoading, renderNoright } from "../util"; // 从util文件引入公共的方法 const getLabel = WeaLocaleProvider.getLabel; const WeaLogViewComp = WeaLogView.Component; -@inject('baseFormStore') +@inject("baseFormStore") @observer export default class BaseForm extends React.Component { componentWillMount() { // 初始化渲染页面 @@ -31,24 +31,24 @@ export default class BaseForm extends React.Component { const { baseFormStore: { setLogVisible, saveForm } } = this.props; let btnArr = [ { - key: 'BTN_SAVE', - icon: , - content : `${getLabel(86,'保存')}`, - onClick : () => saveForm() + key: "BTN_SAVE", + icon: , + content: `${getLabel(86, "保存")}`, + onClick: () => saveForm() }, { - key: 'log', - content: getLabel(83, '日志'), - icon: , - onClick: () => setLogVisible(true), - },] + key: "log", + content: getLabel(83, "日志"), + icon: , + onClick: () => setLogVisible(true) + }]; return btnArr; } - + render() { /* 页面渲染说明: 1、判断是否无权限: 是显示无权限页面 - 2、渲染form页面: + 2、渲染form页面: 2-1: WeaRightMenu 右键菜单 2-2: WeaTop: 顶部: 包括下拉菜单 2-3: renderLoading: 加载数据中的loading效果(统一封装在util中) @@ -56,51 +56,56 @@ export default class BaseForm extends React.Component { 2-5: 通过getSearchs方法渲染form */ const { baseFormStore } = this.props; - const { loading, hasRight, form, condition, logVisible, logStore, saveLoading, setLogVisible, saveForm } = baseFormStore; // 从后台取数据 和 方法 - + const { + loading, + hasRight, + form, + condition, + logVisible, + logStore, + saveLoading, + setLogVisible, + saveForm + } = baseFormStore; // 从后台取数据 和 方法 + if (!hasRight && !loading) { // 无权限处理 return renderNoright(); } const btns = [ // 顶部按钮 - , + ]; const collectParams = { // 收藏功能配置 - favname: '基础表单', + favname: "基础表单", favouritetype: 1, objid: 0, - link: 'wui/index.html#/ns_demo01/index', - importantlevel: 1, + link: "wui/index.html#/ns_demo01/index", + importantlevel: 1 }; return ( - } // 左侧图标 + iconBgcolor="#F14A2D" // 左侧图标背景色 + buttons={btns} // 顶部按钮: 这里是保存按钮,不需要可以不显示 + buttonSpace={10} // 按钮之间的间隔 + showDropIcon={true} // 是否显示右侧下拉按钮 + dropMenuDatas={this.getRightMenu()} // 下拉菜单(和页面的右键菜单相同) + dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 > - } // 左侧图标 - iconBgcolor='#F14A2D' // 左侧图标背景色 - buttons={btns} // 顶部按钮: 这里是保存按钮,不需要可以不显示 - buttonSpace={10} // 按钮之间的间隔 - showDropIcon={true} // 是否显示右侧下拉按钮 - dropMenuDatas={this.getRightMenu()} // 下拉菜单(和页面的右键菜单相同) - dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 - > - {loading ? renderLoading() : - - {getSearchs(form, toJS(condition), 1)} - - } - setLogVisible(false)} // 关闭日志弹框时的操作:设置logVisible属性为false - logStore={logStore} // 日志的store - logType="1" // 模块编码: 该参数要根据模块来给 - logSmallType="1" // 细分模块编码: 该参数要根据模块来给 - /> - - - ) + {loading ? renderLoading() : + + {getSearchs(form, toJS(condition), 1)} + + } + setLogVisible(false)} // 关闭日志弹框时的操作:设置logVisible属性为false + logStore={logStore} // 日志的store + logType="1" // 模块编码: 该参数要根据模块来给 + logSmallType="1" // 细分模块编码: 该参数要根据模块来给 + /> + + ); } } diff --git a/pc4mobx/hrmSalary/components/selectItemsModal/index.js b/pc4mobx/hrmSalary/components/selectItemsModal/index.js index 27cc02a7..b7d01a5d 100644 --- a/pc4mobx/hrmSalary/components/selectItemsModal/index.js +++ b/pc4mobx/hrmSalary/components/selectItemsModal/index.js @@ -5,24 +5,11 @@ * LastEditTime: 2022-06-29 10:06:13 */ import React from "react"; -import { WeaCheckbox, WeaInputSearch, WeaDialog } from "ecCom"; -import { Button, Dropdown, Menu, Modal } from "antd"; -import "../../pages/dataAcquisition/attendance/index.less" +import { WeaCheckbox, WeaDialog, WeaInputSearch } from "ecCom"; +import { Button } from "antd"; +import "./index.less"; -export const items = [ - { - key: "1", - title: "测试", - checked: false - }, - { - key: "2", - title: "测试2", - checked: true - } -]; - export default class SelectItemModal extends React.Component { constructor(props) { super(props); @@ -31,62 +18,52 @@ export default class SelectItemModal extends React.Component { }; } - handleShowChecked(value) { - value = value == 1 ? true : false; - this.props.onShowChecked(value); - } - - handleMenuClick(e) { - if (e.key == "1") { //恢复默认设置 - this.props.onRestoreDefault(); - } else if (e.key == "2") { - this.props.onSetDefault(); - } else if (e.key == "3") { - - } + componentWillReceiveProps(nextProps, nextContext) { + if ( + nextProps.visible !== this.props.visible && + !nextProps.visible + ) this.setState({ searchValue: "" }); } render() { - const menu = ( - this.handleMenuClick(e)}> - 恢复默认设置 - 设置默认设置 - {/* 操作日志 */} - - ); + const { searchValue } = this.state; + const { + title, onSearchItemSet, onShowOnlyChecked, children, + onMoreOpts, onSave, ...extra + } = this.props; + const btns = []; + const moreBtn = { + datas: [ + { + key: "recovery", + content: "恢复默认设置", + icon: , + onClick: key => onMoreOpts(key) + }, + { + key: "setting", + content: "设为默认设置", + icon: , + onClick: key => onMoreOpts(key) + } + ] + }; + const titleComp =
+ {title} + this.setState({ searchValue })} + placeholder="请输入关键字" style={{ width: 200 }} + onSearch={onSearchItemSet} + /> +
; + const bottomLeft = ; return ( - { - this.props.onSave(); - }}>保存, - 更多 - ]} + -
- { - this.setState({ searchValue: value }); - }} - onSearch={(value) => { - this.props.onSearch(value); - }} - /> -
- {this.props.children} -
- { - this.handleShowChecked(value); - }}/> -
+ {children}
); } diff --git a/pc4mobx/hrmSalary/components/selectItemsModal/index.less b/pc4mobx/hrmSalary/components/selectItemsModal/index.less new file mode 100644 index 00000000..6486a98c --- /dev/null +++ b/pc4mobx/hrmSalary/components/selectItemsModal/index.less @@ -0,0 +1,67 @@ +.setWrapper { + .setHeaderWrapper, .setGroupWrapper { + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; + } + + .wea-title .ant-checkbox-wrapper > span:last-child, .setGroupWrapper > .checkedtitle { + color: #111; + font-weight: 600; + font-size: 12px; + padding-right: 8px; + } + + .itemContUl { + display: flex; + align-items: center; + flex-wrap: wrap; + + li { + width: 124px; + overflow: hidden; + padding: 4px 0; + + .wea-checkbox { + width: 100%; + } + + .ant-checkbox-wrapper { + display: flex; + align-items: center; + width: 100%; + + span:last-child { + flex: 1; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } + } + } + + .itemsWrapper { + height: 160px; + overflow: scroll; + border: 1px solid #e5e5e5; + border-radius: 4px; + padding: 16px; + width: 100%; + + .empty { + line-height: 160px; + text-align: center; + font-size: 14px; + display: inline-block; + width: 100%; + } + } + + .wea-more-button { + ul > li:last-child { + display: none !important; + } + } +} diff --git a/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js b/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js index b29f38b8..1a0d44d0 100644 --- a/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js +++ b/pc4mobx/hrmSalary/components/selectItemsModal/selectItemsWrapper.js @@ -1,78 +1,121 @@ -import React from "react"; -import { WeaCheckbox } from "ecCom"; -import { Col, Icon, Row } from "antd"; +/* + * Author: 黎永顺 + * name: 设置项目 + * Description: + * Date: 2023/3/6 + */ +import React, { Component } from "react"; +import { WeaCheckbox, WeaSearchGroup } from "ecCom"; -export default class SelectItemsWrapper extends React.Component { +class SelectItemsWrapper extends Component { constructor(props) { super(props); this.state = { - showContent: true, - checkStatus: false + searchVal: "", + selectItem: [], + groupItem: [], + showOnlyChecked: false }; } - handleAllChecked(value) { - value = value == 1 ? true : false; - let items = [...this.props.items]; - items.map(item => { - item.checked = value; - }); + componentDidMount() { + const { dataSource } = this.props this.setState({ - checkStatus: value + selectItem: _.map(_.filter(_.reduce(dataSource, (pre, cur) => { + return [...pre, ...cur.items]; + }, []), item => !!item.checked), it => it.id) }); - this.props.onChange(items); } - handleItemChange(value, record) { - value = value == 1 ? true : false; - let items = [...this.props.items]; - items.map(item => { - if (item.id == record.id) { - item.checked = value; + handleSearchItemSet = (searchVal) => this.setState({ searchVal }); + handleShowOnlyChecked = (showOnlyChecked) => this.setState({ showOnlyChecked: !!Number(showOnlyChecked) }); + handleSelectGroupAll = (groupId, checked) => { + const { selectItem, groupItem } = this.state; + const { dataSource } = this.props; + _.map(dataSource, item => { + if (item.groupId === groupId) { + if (!!Number(checked)) { + this.setState({ + groupItem: [...groupItem, ..._.map(item.items, child => child.id)] + }, () => this.setState({ selectItem: [...selectItem, ...this.state.groupItem] })); + } else { + this.setState({ + groupItem: _.differenceWith(groupItem, _.map(item.items, child => child.id), _.isEqual) + }, () => this.setState({ selectItem: this.state.groupItem })); + } } }); - this.props.onChange(items); - } + }; + handleSelectItem = (id, checked) => { + const { selectItem } = this.state; + this.setState({ + selectItem: !!Number(checked) ? [...selectItem, id] : _.xorWith(selectItem, [id], _.isEqual) + }); + }; + renderTitle = (item) => { + const { onSelectGroupAll } = this.props; + const { groupName, groupId, items } = item; + const number = _.filter(items, it => !!it.checked).length; + const value = _.every(items, it => !!it.checked) ? "1" : "0"; + return
+ onSelectGroupAll(groupId, val)}/> + 已选择{number}个字段 +
; + }; render() { + const { searchVal, selectItem, showOnlyChecked } = this.state; + const { onSelectItem, dataSource } = this.props; + let setItemList = _.map(dataSource, item => { + return { + ...item, + items: _.filter(item.items || [], child => child.name.indexOf(searchVal) !== -1) + }; + }); + setItemList = _.map(setItemList, item => { + return { + ...item, + items: _.map(item.items, child => { + return { ...child, checked: selectItem.includes(child.id) }; + }) + }; + }); + if (showOnlyChecked) { + setItemList = _.map(setItemList, item => { + return { ...item, items: _.filter(item.items, it => !!it.checked) }; + }); + } return ( -
-
-
{this.props.title}} onChange={(value) => { - this.handleAllChecked(value); - }} value={this.state.checkStatus}/>
-
this.setState({ - showContent: !this.state.showContent - })}>已选中{this.props.items ? this.props.items.filter(item => item.checked).length : 0}个字段 - - { - this.state.showContent ? : - } - -
-
+ { - this.state.showContent &&
- - { - this.props.items && this.props.items.map(item => ( - { - this.handleItemChange(value, item); - }}/> - )) - } - -
+ _.map(setItemList, item => { + const { items } = item; + return +
+ { + _.isEmpty(items) ? + 暂无数据 : +
    + { + _.map(items, child => { + const { name, checked, id } = child; + return
  • + onSelectItem(id, val)} + /> +
  • ; + }) + } +
+ } +
+
; + }) } - -
+ ); } } + +export default SelectItemsWrapper; diff --git a/pc4mobx/hrmSalary/components/slideModalTitle/index.less b/pc4mobx/hrmSalary/components/slideModalTitle/index.less index 1fadc267..4810f6f8 100644 --- a/pc4mobx/hrmSalary/components/slideModalTitle/index.less +++ b/pc4mobx/hrmSalary/components/slideModalTitle/index.less @@ -50,7 +50,7 @@ .btnWrapper { position: absolute; right: 50px; - top: 0px; + top: 0; } } @@ -58,5 +58,8 @@ .wea-new-top-req-wapper .wea-new-top-req-title>div:last-child{ right: 16px!important; } + .wea-new-top-req-wapper .wea-new-top-req-title>div:first-child>div:first-child{ + min-width: 440px!important; + } } diff --git a/pc4mobx/hrmSalary/components/stepSlide/index.js b/pc4mobx/hrmSalary/components/stepSlide/index.js index d58989b9..cc5e8143 100644 --- a/pc4mobx/hrmSalary/components/stepSlide/index.js +++ b/pc4mobx/hrmSalary/components/stepSlide/index.js @@ -11,7 +11,7 @@ export default class StepSlide extends React.Component { className='slideOuterWrapper' visible={this.props.visible} top={0} - width={40} + width={65} height={100} direction={"right"} measure={"%"} diff --git a/pc4mobx/hrmSalary/components/stepSlide/stepSlideHeader.js b/pc4mobx/hrmSalary/components/stepSlide/stepSlideHeader.js index 4a4918d9..35d4ac22 100644 --- a/pc4mobx/hrmSalary/components/stepSlide/stepSlideHeader.js +++ b/pc4mobx/hrmSalary/components/stepSlide/stepSlideHeader.js @@ -1,28 +1,29 @@ -import React from 'react'; -import { WeaSteps } from 'ecCom' +import React from "react"; +import { WeaSteps } from "ecCom"; +import "./index.less"; + const Step = WeaSteps.Step; -import "./index.less" export default class StepSlideHeader extends React.Component { - render() { - return ( -
-
- - { - this.props.steps && this.props.steps.map(item => - ( - - ) - ) - } - -
-
- {this.props.children} -
-
- - ) - } -} \ No newline at end of file + render() { + return ( +
+
+ + { + this.props.steps && this.props.steps.map(item => + ( + + ) + ) + } + +
+
+ {this.props.children} +
+
+ + ); + } +} diff --git a/pc4mobx/hrmSalary/components/upload/index.js b/pc4mobx/hrmSalary/components/upload/index.js new file mode 100644 index 00000000..fd7cdd57 --- /dev/null +++ b/pc4mobx/hrmSalary/components/upload/index.js @@ -0,0 +1,84 @@ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTools, WeaUpload } from "ecCom"; +import { Icon, Modal } from "antd"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; +const { viewer } = WeaTools; + +class ImageUploadList extends Component { + constructor(props) { + super(props); + this.state = { + imageUrl: "" + }; + } + + componentDidMount() { + const { wmImg } = this.props; + if (!_.isEmpty(wmImg)) { + this.setState({ + imageUrl: wmImg[0].imgSrc + }); + } + } + + handleChange = (ids, list) => { + this.setState({ + imageUrl: list[0].imgSrc + }, () => this.props.onChange([{ imgSrc: this.state.imageUrl }])); + }; + handleDelete = () => { + Modal.confirm({ + title: getLabel(111, "信息确认"), + content: getLabel(111, "确认要删除吗?"), + onOk: () => { + this.setState({ + imageUrl: "" + }, () => this.props.onChange(null)); + } + }); + }; + + + render() { + const { imageUrl } = this.state; + const uploadProps = { + uploadUrl: "/api/doc/upload/uploadFile", + listType: "img", + limitType: "jpg,jpeg,png,gif", + category: "string", + maxFilesNumber: 1, + onChange: this.handleChange + }; + const imgPreviewProps = { + src: imageUrl, + width: 100, + height: 100 + }; + return ( +
+ { + imageUrl && +
+ +
+ +
+
+ } + { + !imageUrl && + +
+ +
{getLabel(111, "上传图片")}
+
+
+ } +
+ ); + } +} + +export default ImageUploadList; diff --git a/pc4mobx/hrmSalary/components/upload/index.less b/pc4mobx/hrmSalary/components/upload/index.less new file mode 100644 index 00000000..577de7c7 --- /dev/null +++ b/pc4mobx/hrmSalary/components/upload/index.less @@ -0,0 +1,68 @@ +.textSetting { + .uploadWrapper { + display: flex; + align-items: center; + position: relative; + + .previewWrapper { + border: 1px solid #d9d9d9 !important; + + img { + width: 100%; + height: 100%; + margin-left: 0 !important; + cursor: pointer; + } + + .operateWrapper { + display: none; + } + } + + .previewWrapper:hover { + .operateWrapper { + display: flex; + position: absolute; + align-items: center; + justify-content: flex-end; + width: 30px; + height: 20px; + background-color: rgba(0, 0, 0, 0.3); + bottom: 4px; + right: 13px; + border-radius: 3px; + padding-right: 4px; + } + } + } + + .upload-select-picture-card, .previewWrapper { + border: 1px dashed #d9d9d9; + width: 96px; + height: 96px; + padding: 0; + border-radius: 6px; + background-color: #fbfbfb; + text-align: center; + cursor: pointer; + -webkit-transition: border-color .3s ease; + -o-transition: border-color .3s ease; + transition: border-color .3s ease; + display: flex; + flex-direction: column; + justify-content: center; + margin-right: 8px; + margin-bottom: 8px; + + span.rc-upload { + height: 100%; + display: flex; + align-items: center; + justify-content: center; + } + } + + .upload-select-picture-card:hover { + border-color: #2db7f5; + } +} diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index fdfd4990..29804d06 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -14,7 +14,7 @@ import OtherDeduct from "./pages/dataAcquisition/otherDeduct"; import CumSituation from "./pages/dataAcquisition/cumSituation"; import Attendance from "./pages/dataAcquisition/attendance"; import SpecialAddDeduction from "./pages/dataAcquisition/specialAddDeduction"; -import Ledger from "./pages/ledger"; +import Ledger from "./pages/ledgerPage"; import Calculate from "./pages/calculate"; import Payroll from "./pages/payroll"; import PayrollGrant from "./pages/payroll/payrollGrant"; @@ -32,6 +32,12 @@ import MobilePayroll from "./pages/mobilePayroll"; import SysConfig from "./pages/sysConfig"; import RuleConfig from "./pages/ruleConfig"; import Appconfig from "./pages/appConfig"; +import FieldManagement from "./pages/fieldManagement"; +import AnalysisOfSalaryStatistics from "./pages/analysisOfSalaryStatistics"; +import EmployeeList from "./pages/employeeView"; +import ReportView from "./pages/reportView"; +import MySalaryView from "./pages/mySalary/mySalaryView"; +import WatermarkPreview from "./pages/payroll/watermarkPreview"; import stores from "./stores"; import "./style/index"; @@ -50,6 +56,7 @@ const SocialSecurityBenefits = (props) => props.children; const DataAcquisition = (props) => props.children; // mySalary 我的薪资福利 +// mySalaryView 我的薪资福利-查看工资单 // socialSecurityBenefits 社保福利 // programme 社保福利方案 // archives 社保福利档案 @@ -77,6 +84,9 @@ const DataAcquisition = (props) => props.children; // sysconfig 系統配置 // sysconfig-1 规则配置 // appconfig 应用配置 +// fieldManagement 字段管理 +// analysisOfSalaryStatistics 薪酬统计分析 +// reportView 薪酬报表查看 const Routes = ( + + + + + + ); diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js new file mode 100644 index 00000000..a622aefb --- /dev/null +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/conditions.js @@ -0,0 +1,101 @@ +import { WeaLocaleProvider } from "ecCom"; + +const { getLabel } = WeaLocaleProvider; +export const condition = [ + { + items: [ + { + colSpan: 1, + checkbox: false, + checkboxValue: false, + conditionType: "SELECT", + domkey: ["dimType"], + fieldcol: 14, + label: getLabel(111, "维度类型"), + labelcol: 6, + options: [], + detailtype: 3, + rules: "required|string", + viewAttr: 3 + }, + { + colSpan: 1, + conditionType: "SELECT", + domkey: ["setting4Qualitative"], + fieldcol: 14, + label: getLabel(111, "统计维度"), + labelcol: 6, + options: [], + rules: "required|string", + viewAttr: 3 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["dimName"], + fieldcol: 14, + label: getLabel(111, "统计维度名称"), + labelcol: 6, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + colSpan: 1, + conditionType: "SELECT", + domkey: ["dimCode"], + fieldcol: 14, + label: getLabel(111, "分组所属字段"), + labelcol: 6, + options: [], + viewAttr: 2, + helpfulTip: "", + hide: true + }, + { + colSpan: 1, + conditionType: "TEXTAREA", + domkey: ["remark"], + fieldcol: 14, + label: getLabel(111, "描述"), + labelcol: 6, + value: "", + viewAttr: 2 + } + ], + title: getLabel(111, "基础设置"), + defaultshow: true + } +]; +export const reportCondition = [ + { + items: [ + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["reportName"], + fieldcol: 14, + label: getLabel(111, "报表名称"), + labelcol: 6, + value: "", + rules: "required|string", + viewAttr: 3 + }, + { + colSpan: 1, + conditionType: "SELECT", + domkey: ["dimensionIds"], + fieldcol: 14, + label: getLabel(111, "统计维度"), + labelcol: 6, + options: [], + rules: "required|string", + viewAttr: 3, + helpfulTip: "", + hide: true + } + ], + title: "", + defaultshow: true + } +]; diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/dimensionSlide.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/dimensionSlide.js new file mode 100644 index 00000000..b7bd9c2e --- /dev/null +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/dimensionSlide.js @@ -0,0 +1,205 @@ +/* + * Author: 黎永顺 + * name: 新增统计维度弹框 + * Description: + * Date: 2023/4/11 + */ +import React, { Component } from "react"; +import { WeaDialog, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import { Button, message, Modal } from "antd"; +import { dimensionGetForm, dimensionSave } from "../../../apis/statistics"; +import { getSearchs } from "../../../util"; +import GroupSpacingEditTable from "./groupSpacingEditTable"; +import GroupIndividualEditTable from "./groupIndividualEditTable"; +import "../index.less"; + +const { getLabel } = WeaLocaleProvider; +const keyObj = { + "RATION_GROUP_SPACING": "setting4RationGroupSpacing", + "RATION_GROUP_INDIVIDUAL": "setting4RationGroupIndividual" +}; + +class DimensionSlide extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, + dimType: "QUALITATIVE", + setting4RationGroupSpacing: [], + setting4RationGroupIndividual: [] + }; + } + + componentDidMount() { + this.props.initCondition(); + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.formId) this.dimensionGetForm({ id: nextProps.formId }); + if (nextProps.visible !== this.props.visible && !nextProps.formId) { + nextProps.form.updateFields({ + dimType: "QUALITATIVE" + }); + nextProps.onChangeCondition("QUALITATIVE"); + } + if (nextProps.visible !== this.props.visible && !nextProps.visible) { + this.setState({ + loading: false, + dimType: "QUALITATIVE", + setting4RationGroupSpacing: [], + setting4RationGroupIndividual: [] + }); + } + } + + + dimensionGetForm = (payload) => { + dimensionGetForm(payload).then(({ status, data }) => { + if (status) { + const { baseForm: { data: formData } } = data; + const setting = formData.setting ? JSON.parse(formData.setting) : {}; + this.props.onChangeCondition(formData["dimType"], 1); + this.setState({ + dimType: formData.dimType, + [keyObj[formData["dimType"]]]: setting + }, () => { + const fields = _.map(this.props.condition[0].items, it => { + return it.domkey[0]; + }); + fields.map(item => { + if (item !== "setting4Qualitative") { + this.props.form.updateFields({ + [item]: formData[item] || "" + }); + } else if (item === "setting4Qualitative" && formData.statsDim) { + this.props.form.updateFields({ + setting4Qualitative: formData.statsDim + }); + } + }); + }); + } + }); + }; + handleSave = () => { + const { dimType } = this.state; + const { condition, onCancel, formId } = this.props; + const { setting4Qualitative, dimCode, ...extraParams } = this.props.form.getFormParams(); + let payload = { id: formId, ...extraParams }; + if (dimType === "QUALITATIVE") { + if (!setting4Qualitative || !extraParams.dimName) { + Modal.warning({ + title: getLabel(111, "信息确认"), + content: getLabel(111, "必要信息不完整,红色*为必填项!") + }); + return; + } + const tjOptions = _.find(condition[0].items, item => item.domkey[0] === "setting4Qualitative").options; + const tjObj = _.find(tjOptions, item => item.key === setting4Qualitative); + payload = { ...payload, setting4Qualitative: { id: tjObj.key, name: tjObj.showname } }; + } else { + if (!extraParams.dimName) { + Modal.warning({ + title: getLabel(111, "信息确认"), + content: getLabel(111, "必要信息不完整,红色*为必填项!") + }); + return; + } + if (dimType === "RATION_GROUP_SPACING") { + const { setting4RationGroupSpacing } = this.state; + const bool = _.every(setting4RationGroupSpacing, it => it.startValue !== "" && it.endValue !== "" && it.startValue <= it.endValue); + if (_.isEmpty(setting4RationGroupSpacing) || !bool) { + message.warning(getLabel(111, "请完善分组设置相关数据!分组设置不能为空,起始值结束值必填,且起始值需小于结束值!")); + return; + } else { + payload = { + ...payload, dimCode, + setting4RationGroupSpacing: _.map(setting4RationGroupSpacing, (it, index) => ({ + id: index + 1, + endValue: it.endValue, + startValue: it.startValue, + includeEnd: it.includeEnd === "1", + includeStart: it.includeStart === "1" + })) + }; + } + } else if (dimType === "RATION_GROUP_INDIVIDUAL") { + const { setting4RationGroupIndividual } = this.state; + const bool = _.every(setting4RationGroupIndividual, it => it.value !== ""); + if (_.isEmpty(setting4RationGroupIndividual) || !bool) { + message.warning(getLabel(111, "请完善分组设置相关数据!分组设置不能为空,且数值必填")); + return; + } else { + payload = { + ...payload, dimCode, + setting4RationGroupIndividual: _.map(setting4RationGroupIndividual, (it, index) => ({ id: index + 1, ...it })) + }; + } + } + } + this.setState({ loading: true }); + dimensionSave(payload).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(111, "保存成功")); + onCancel(true); + this.props.form.resetForm(); + } else { + message.error(errormsg || getLabel(111, "保存失败")); + } + }).catch(() => this.setState({ loading: false })); + }; + formItemChange = (formObj) => { + const { onChangeCondition } = this.props; + const filedKey = _.keys(formObj)[0]; + if (filedKey === "dimType") { + this.setState({ + dimType: formObj[filedKey].value, + setting4RationGroupSpacing: [], + setting4RationGroupIndividual: [] + }, () => onChangeCondition(formObj[filedKey].value)); + } + }; + handleConvertGroupDatasource = (data) => { + const { dimType } = this.state; + this.setState({ [keyObj[dimType]]: data }); + }; + + render() { + const { loading, dimType, setting4RationGroupSpacing, setting4RationGroupIndividual } = this.state; + const { form, condition, formId } = this.props; + return ( + + {formId ? getLabel(111, "编辑统计维度") : getLabel(111, "新建统计维度")} + + + } + > + {getSearchs(form, condition, 1, false, this.formItemChange)} + { + dimType !== "QUALITATIVE" && + + { + dimType === "RATION_GROUP_SPACING" && + + } + { + dimType === "RATION_GROUP_INDIVIDUAL" && + + } + + } + + ); + } +} + +export default DimensionSlide; diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/dimensionTable.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/dimensionTable.js new file mode 100644 index 00000000..48eecf43 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/dimensionTable.js @@ -0,0 +1,121 @@ +/* + * Author: 黎永顺 + * name: 统计维度管理列表 + * Description: + * Date: 2023/4/11 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; +import { message, Modal } from "antd"; +import { dimensionDelete, dimensionList } from "../../../apis/statistics"; +import "../index.less"; + +const { getLabel } = WeaLocaleProvider; + +class DimensionTable extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, + dataSource: [], + pageInfo: { + current: 1, pageSize: 10, total: 0 + } + }; + } + + componentDidMount() { + this.dimensionList(); + } + + dimensionList = (extra = {}) => { + const { pageInfo } = this.state; + this.setState({ loading: true }); + dimensionList({ ...pageInfo, ...extra }).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { pageNum: current, pageSize, total, list: dataSource } = data; + this.setState({ + dataSource, + pageInfo: { + ...pageInfo, + current, pageSize, total + } + }); + } + }).catch(() => this.setState({ loading: false })); + }; + dimensionDelete = (payload) => { + Modal.confirm({ + title: getLabel(111, "信息确认"), + content: getLabel(111, "确认要删除吗?"), + onOk: () => { + dimensionDelete(payload).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "删除成功")); + this.dimensionList(); + } else { + message.error(errormsg || getLabel(111, "删除失败")); + } + }); + } + }); + }; + + render() { + const { dataSource, loading, pageInfo } = this.state; + const { onEdit } = this.props; + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(111, "共")} ${total} ${getLabel(111, "条")}`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => this.dimensionList()); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.dimensionList()); + } + }; + const columns = [ + { dataIndex: "dimName", title: getLabel(111, "统计维度") }, + { dataIndex: "remark", title: getLabel(111, "描述") }, + { dataIndex: "dimType", title: getLabel(111, "维度类型") }, + { + dataIndex: "operate", title: getLabel(111, "操作"), + render: (_, record) => { + return ( + + { + record.canEdit && + onEdit(record.id)}>{getLabel(111, "编辑")} + } + { + record.canDelete && + this.dimensionDelete([record.id])}>{getLabel(111, "删除")} + } + + ); + } + } + ]; + return ( + + ); + } +} + +export default DimensionTable; diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/employeeDetails.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/employeeDetails.js new file mode 100644 index 00000000..dc89547d --- /dev/null +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/employeeDetails.js @@ -0,0 +1,103 @@ +/* + * Author: 黎永顺 + * name: 员工明细列表 + * Description: + * Date: 2023/5/24 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; +import { statisticsEmployeeList } from "../../../apis/statistics"; +import "../index.less"; + +const { getLabel } = WeaLocaleProvider; + +class EmployeeDetails extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, + dataSource: [], + columns: [], + pageInfo: { + current: 1, + pageSize: 10, + total: 0 + } + }; + } + + componentDidMount() { + this.statisticsEmployeeList(); + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.year !== this.props.year) this.statisticsEmployeeList(nextProps); + } + + statisticsEmployeeList = (props) => { + const { pageInfo } = this.state; + const payload = { + year: props ? props.year : this.props.year, + keyword: props ? props.keyword : this.props.keyword, + ...pageInfo + }; + this.setState({ loading: true }); + statisticsEmployeeList(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource, pageNum: current, total, pageSize } = data; + this.setState({ + pageInfo: { ...pageInfo, current, pageSize, total }, + dataSource, + columns: [...columns, { + title: "操作", + dataIndex: "operate", + width: 80, + render: (_, record) => { + return {getLabel(111, "查看")}; + } + }] + }); + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { dataSource, loading, columns, pageInfo } = this.state; + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(111, "共")} ${total} ${getLabel(111, "条")}`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => { + this.statisticsEmployeeList(); + }); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => { + this.statisticsEmployeeList(); + }); + } + }; + return ( + + ); + } +} + +export default EmployeeDetails; diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/groupIndividualEditTable.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/groupIndividualEditTable.js new file mode 100644 index 00000000..1d709bc6 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/groupIndividualEditTable.js @@ -0,0 +1,52 @@ +/* + * Author: 黎永顺 + * name: 分组设置-定量-单项式分组编辑表格 + * Description: + * Date: 2023/4/12 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTableEdit } from "ecCom"; + +const { getLabel } = WeaLocaleProvider; +class GroupIndividualEditTable extends Component { + constructor(props) { + super(props); + this.state = { + dataSource: [] + }; + } + + componentDidMount() { + const { setting4RationGroupIndividual } = this.props; + this.setState({ + dataSource: setting4RationGroupIndividual + }); + } + + handleChangeTableData = (dataSource) => { + const { onChange } = this.props; + this.setState({ dataSource }, () => onChange(this.state.dataSource)); + }; + + render() { + const { dataSource } = this.state; + const columns = [ + { + title: getLabel(111, "分组设置值"), + dataIndex: "value", + key: "value", + com: [ + { label: "", key: "value", type: "INPUTNUMBER" } + ] + } + ]; + return ( + + ); + } +} + +export default GroupIndividualEditTable; diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/groupSpacingEditTable.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/groupSpacingEditTable.js new file mode 100644 index 00000000..c976cd93 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/groupSpacingEditTable.js @@ -0,0 +1,100 @@ +/* + * Author: 黎永顺 + * name: 分组设置-定量-组距式分组编辑表格 + * Description: + * Date: 2023/4/12 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTableEdit } from "ecCom"; + +const { getLabel } = WeaLocaleProvider; + +class GroupSpacingEditTable extends Component { + constructor(props) { + super(props); + this.state = { + dataSource: [] + }; + } + + componentDidMount() { + const { setting4RationGroupSpacing } = this.props; + this.setState({ + dataSource: _.map(setting4RationGroupSpacing, item => { + return { + ...item, + includeStart: item.includeStart ? "1" : "0", + includeEnd: item.includeEnd ? "1" : "0" + }; + }) + }); + } + + handleChangeTableData = (dataSource) => { + const { onChange } = this.props; + this.setState({ dataSource }, () => onChange(this.state.dataSource)); + }; + + render() { + const { dataSource } = this.state; + const columns = [ + { + title: getLabel(111, "起始值"), + dataIndex: "startValue", + key: "startValue", + com: [ + { label: "", key: "startValue", type: "INPUTNUMBER" } + ] + }, + { + title: getLabel(111, "含"), + dataIndex: "includeStart", + key: "includeStart", + com: [ + { + type: "CHECKBOX", + key: "includeStart", + otherParams: { content: getLabel(111, "含") } + } + ] + }, + { + title: getLabel(111, "至"), + dataIndex: "to", + key: "to", + com: [ + { label: "", type: "TEXT" } + ] + }, + { + title: getLabel(111, "结束值"), + dataIndex: "endValue", + key: "endValue", + com: [ + { label: "", key: "endValue", type: "INPUTNUMBER" } + ] + }, + { + title: getLabel(111, "含"), + dataIndex: "includeEnd", + key: "includeEnd", + com: [ + { + type: "CHECKBOX", + key: "includeEnd", + otherParams: { content: getLabel(111, "含") } + } + ] + } + ]; + return ( + ({ ...item, to: getLabel(111, "至") }))} + showCopy={false} onChange={this.handleChangeTableData} + /> + ); + } +} + +export default GroupSpacingEditTable; diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportForm.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportForm.js new file mode 100644 index 00000000..0308e2ed --- /dev/null +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportForm.js @@ -0,0 +1,19 @@ +/* + * Author: 黎永顺 + * name: 报表表单 + * Description: + * Date: 2023/4/17 + */ +import React, { Component } from "react"; +import { getSearchs } from "../../../util"; + +class ReportForm extends Component { + render() { + const { form, condition } = this.props; + return ( + {getSearchs(form, condition, 1, false)} + ); + } +} + +export default ReportForm; diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js new file mode 100644 index 00000000..6510d5b1 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js @@ -0,0 +1,106 @@ +/* + * Author: 黎永顺 + * name: 统计表 + * Description: + * Date: 2023/4/17 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { Button, Col, Dropdown, Menu, message, Modal, Row } from "antd"; +import { reportStatisticsReportDelete, reportStatisticsReportList } from "../../../apis/statistics"; +import "../index.less"; + +const SubMenu = Menu.SubMenu; +const { getLabel } = WeaLocaleProvider; + +class ReportList extends Component { + constructor(props) { + super(props); + this.state = { + dataSource: [] + }; + } + + componentDidMount() { + this.reportStatisticsReportList(); + } + + handleOptsClick = ({ key }, id, dimensionId) => { + if (key === "delete") { + this.reportStatisticsReportDelete(id.split(",")); + } else if (key === "edit") { + this.props.onEdit("addReport", id); + } + }; + reportStatisticsReportDelete = (payload) => { + Modal.confirm({ + title: getLabel(111, "信息确认"), + content: getLabel(111, "确认删除本条数据吗?"), + onOk: () => { + const { reportName = "" } = this.props; + reportStatisticsReportDelete(payload).then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(111, "删除成功")); + this.reportStatisticsReportList({ reportName }); + } else { + message.error(errormsg || getLabel(111, "删除失败")); + } + }); + } + }); + }; + reportStatisticsReportList = (payload = {}) => { + reportStatisticsReportList(payload).then(({ status, data: dataSource }) => { + if (status) { + this.setState({ dataSource }); + } + }); + }; + /* + * Author: 黎永顺 + * Description: 报表查看 + * Params: + * Date: 2023/4/20 + */ + handleGoReportView = (id) => { + window.open(`${window.location.origin}/spa/hrmSalary/static/index.html#/main/hrmSalary/reportView?id=${id}`); + }; + + render() { + const { dataSource } = this.state; + return ( + + { + _.isEmpty(dataSource) ?
{getLabel(111, "暂无数据")}
: + _.map(dataSource, it => { + const { reportName, dimension, id, dimensionId } = it; + return this.handleGoReportView(id)}> +
+
+
+ {reportName} +
+
{getLabel(111, "统计维度")}:
+
{dimension}
+
+
+
+ this.handleOptsClick(e, id, dimensionId)}> + {getLabel(111, "编辑")} + {getLabel(111, "删除")} + + }> + + +
+
+ ; + }) + } +
+ ); + } +} + +export default ReportList; diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/statisticsModal.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/statisticsModal.js new file mode 100644 index 00000000..c8920887 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/statisticsModal.js @@ -0,0 +1,70 @@ +/* + * Author: 黎永顺 + * name: 统计弹框 + * Description: + * Date: 2023/4/10 + */ +import React, { Component } from "react"; +import { Button, message, Modal } from "antd"; +import { WeaDialog, WeaLocaleProvider } from "ecCom"; +import { reportStatisticsReportSave } from "../../../apis/ruleconfig"; +import "../index.less"; + +const { getLabel } = WeaLocaleProvider; + +class StatisticsModal extends Component { + constructor(props) { + super(props); + this.state = { + loading: false + }; + } + + handleSaveReportList = () => { + const { form, id, onCancel } = this.props; + form.validateForm().then(f => { + if (f.isValid) { + const { dimensionIds, reportName } = form.getFormParams(); + const payload = { id, reportName, dimensionIds: dimensionIds.split(",") }; + this.setState({ loading: true }); + reportStatisticsReportSave(payload).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + onCancel(true); + message.success(getLabel(111, "保存成功")); + form.resetForm(); + } else { + message.error(errormsg || getLabel(111, "保存失败")); + } + }).catch(() => this.setState({ loading: false })); + } else { + Modal.warning({ + title: getLabel(111, "信息确认"), + content: getLabel(111, "必要信息不完整,红色*为必填项!") + }); + } + }); + }; + + render() { + const { loading } = this.state; + const { typeKey, onCancel } = this.props; + const buttons = typeKey === "addReport" ? [ + + ] : []; + return ( + + {this.props.children} + + ); + } +} + +export default StatisticsModal; diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js new file mode 100644 index 00000000..20748a27 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.js @@ -0,0 +1,312 @@ +/* + * Author: 黎永顺 + * name: 薪酬统计分析 + * Description: + * Date: 2023/4/10 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDatePicker, WeaInputSearch, WeaLocaleProvider, WeaReqTop } from "ecCom"; +import { Button } from "antd"; +import { condition, reportCondition } from "./components/conditions"; +import { commonEnumList, reportGetForm } from "../../apis/ruleconfig"; +import { dimensionGetForm } from "../../apis/statistics"; +import EmployeeDetails from "./components/employeeDetails"; +import StatisticsModal from "./components/statisticsModal"; +import DimensionSlide from "./components/dimensionSlide"; +import DimensionTable from "./components/dimensionTable"; +import ReportList from "./components/reportList"; +import ReportForm from "./components/reportForm"; +import moment from "moment"; +import "./index.less"; + +const { getLabel } = WeaLocaleProvider; + +@inject("taxAgentStore", "attendanceStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + conditions: [], + convertConditions: [], + reportConditions: [], + selectedKey: "statistics", + reportName: "", + keyword: "", + year: moment().format("YYYY"), + slideReq: { + visible: false, formId: "" + }, + modalReq: { + title: "", visible: false, + typeKey: "", id: "" + } + }; + } + + componentDidMount() { + this.initReportFormCondition(); + } + + initReportFormCondition = (payload = {}) => { + const { attendanceStore: { reportForm } } = this.props; + reportGetForm(payload).then(({ status, data }) => { + if (status) { + const { statsDimOptions, data: detailData } = data; + if (_.isEmpty(payload)) { + this.setState({ + reportConditions: _.map(reportCondition, item => { + return { + ...item, + items: _.map(item.items, child => { + if (child.domkey[0] === "dimensionIds") { + return { + ...child, + options: _.map(statsDimOptions, dimTypeItem => ({ + key: dimTypeItem.id, + showname: dimTypeItem.content + })) + }; + } + return { ...child }; + }) + }; + }) + }, () => { + reportForm.initFormFields(this.state.reportConditions); + }); + } else { + reportForm.updateFields({ + reportName: detailData.reportName, + dimensionIds: detailData.dimension.join(",") + }); + } + } + }); + }; + initCondition = async () => { + const { attendanceStore: { statisticsForm } } = this.props; + const [dimTypeEnum, dimCodeList] = await Promise.all([this.commonEnumList(), this.dimensionGetForm()]); + const { data: dimTypeData } = dimTypeEnum, { data: dimCodeData } = dimCodeList; + const { baseForm: { statsDimOptions, groupDimOptions, data: dimTypeValue } } = dimCodeData; + this.setState({ + conditions: _.map(condition, item => { + return { + ...item, + items: _.map(item.items, child => { + if (child.domkey[0] === "dimType") { + return { + ...child, + value: dimTypeValue.dimType, + options: _.map(dimTypeData, dimTypeItem => ({ + key: dimTypeItem.value, + showname: dimTypeItem.defaultLabel + })) + }; + } + if (child.domkey[0] === "setting4Qualitative") { + return { + ...child, + options: _.map(statsDimOptions, dimCodeItem => ({ + key: dimCodeItem.id, + showname: dimCodeItem.content + })) + }; + } + if (child.domkey[0] === "dimCode") { + return { + ...child, + options: _.map(groupDimOptions, dimCodeItem => ({ + key: dimCodeItem.id, + showname: dimCodeItem.content + })) + }; + } + return { ...child }; + }) + }; + }) + }, () => { + this.setState({ convertConditions: this.state.conditions }); + statisticsForm.initFormFields(this.state.conditions); + }); + }; + commonEnumList = () => { + const payload = { + enumClass: "com.engine.salary.report.enums.SalaryStatisticsDimensionTypeEnum" + }; + return commonEnumList(payload); + }; + dimensionGetForm = () => { + return dimensionGetForm(); + }; + handleChangeCondition = (val, viewAttr) => { + const { attendanceStore: { statisticsForm } } = this.props; + const helpfulTitle = val === "RATION_GROUP_SPACING" ? + "例:\n" + + " 若:所属字段为【工龄】,分组设置为【0-5】,【5-10】;统计项为【税前薪资】,对应的统计规则为【求和】; 则统计结果为:【工龄】为【0-5】的所有人的【税前薪资】求和,【工龄】为【5-10】的所有人的【税前薪资】求和;\n" + + "若:未选择所属字段,分组设置为【0-10,000.00】,【10,000.00-20,000.00】;若统计项为【税前薪资】,对应的统计规则为【计数】; 则统计结果为:【税前薪资】为【0-10,000.00】有多少人,【税前薪资】为【10,000.00-20,000.00】有多少人;" : + val === "RATION_GROUP_INDIVIDUAL" ? + "例:\n" + + " 若:所属字段为【职级】,分组设置为【1】,【2】,【3】;统计项为【税前薪资】,对应的统计规则为【平均值】; 则统计结果为:【职级】为【1】的所有人的【税前薪资】的平均值,【职级】为【2】的所有人的【税前薪资】的平均值;【职级】为【3】的所有人的【税前薪资】的平均值;\n" + + "若:未选择所属字段,分组设置为【1】,【2】,【3】;若统计项为【绩效】,对应的统计规则为【计数】; 则统计结果为:【绩效】为【1】有多少人,绩效为【2】有多少人,绩效为【3】有多少人;" : ""; + + if (val === "QUALITATIVE") { + this.setState({ + conditions: _.map(this.state.convertConditions, item => { + return { + ...item, + items: _.map(_.filter(item.items, child => child.domkey[0] !== "dimCode"), it => { + if (it.domkey[0] === "dimType") { + return { ...it, value: val, viewAttr: viewAttr ? viewAttr : it.viewAttr }; + } + return { ...it }; + }) + }; + }) + }, () => { + statisticsForm.setCondition(this.state.conditions); + }); + } else { + this.setState({ + conditions: _.map(this.state.convertConditions, item => { + return { + ...item, + items: _.map(_.filter(item.items, child => child.domkey[0] !== "setting4Qualitative"), it => { + if (it.domkey[0] === "dimType") { + return { ...it, value: val, viewAttr: viewAttr ? viewAttr : it.viewAttr }; + } else if (it.domkey[0] === "dimCode") { + return { ...it, helpfulTitle }; + } + return { ...it }; + }) + }; + }) + }, () => { + statisticsForm.setCondition(this.state.conditions); + }); + } + }; + handleReqBtnsClick = (key, id = "") => { + if (key === "search") { + const { reportName } = this.state; + this.reportListRef.reportStatisticsReportList({ reportName }); + } else { + const { modalReq } = this.state; + const title = key === "dimension" ? +
+ {getLabel(111, "统计维度管理")} + +
+ : getLabel(111, id ? "编辑报表" : "新建报表"); + this.setState({ + modalReq: { + ...modalReq, id, title, + visible: true, typeKey: key + } + }, () => id && this.initReportFormCondition({ id })); + } + }; + handleCancel = (refresh = false) => { + const { attendanceStore: { reportForm } } = this.props; + const { modalReq } = this.state; + this.setState({ + modalReq: { + ...modalReq, visible: false, id: "" + } + }, () => { + const { selectedKey, reportName, modalReq: { typeKey } } = this.state; + selectedKey === "statistics" && reportForm.resetForm(); + typeKey === "dimension" && this.initReportFormCondition(); + refresh && selectedKey === "statistics" && this.reportListRef.reportStatisticsReportList({ reportName }); + }); + }; + handleAddDimension = (formId = "") => { + const { slideReq } = this.state; + this.setState({ + slideReq: { + ...slideReq, visible: true, + formId + } + }); + }; + handleClose = (initTable = false) => { + const { attendanceStore: { statisticsForm } } = this.props; + const { slideReq } = this.state; + this.setState({ + slideReq: { + ...slideReq, visible: false, formId: "" + } + }, () => { + statisticsForm.resetForm(); + initTable && this.dimensionTableRef.dimensionList(); + }); + }; + + render() { + const { taxAgentStore: { statisticsReportBtn }, attendanceStore: { statisticsForm, reportForm } } = this.props; + const { selectedKey, modalReq, slideReq, conditions, reportConditions, reportName, keyword, year } = this.state; + const buttons = selectedKey === "statistics" ? [ + , + , + this.setState({ reportName })} + onSearch={() => this.handleReqBtnsClick("search")}/> + ] : [ + + {getLabel(111, "年薪资核算人员明细:")} + this.setState({ year })}/> + , + this.setState({ keyword })} + onSearch={() => this.employeeListRef.statisticsEmployeeList()}/> + ]; + const tabs = [ + { key: "statistics", title: getLabel(111, "统计表") }, + { key: "detail", title: getLabel(111, "员工明细") } + ]; + return ( + } selectedKey={selectedKey} + iconBgcolor="#F14A2D" tabDatas={tabs} className="xc_tj_fx_wrapper" showDropIcon={false} + buttons={(!statisticsReportBtn && selectedKey === "statistics") ? buttons.slice(-1) : buttons} buttonSpace={10} + onChange={selectedKey => this.setState({ selectedKey }, () => this.state.selectedKey === "statistics" && this.initReportFormCondition())} + > + { + selectedKey === "statistics" ? + this.reportListRef = dom} + reportName={reportName} + onEdit={this.handleReqBtnsClick} + /> : this.employeeListRef = dom} + keyword={keyword} year={year} + /> + } + + { + modalReq.typeKey === "dimension" && + this.dimensionTableRef = dom} + onEdit={id => this.handleAddDimension(id)} + /> + } + { + modalReq.typeKey === "addReport" && + + } + + + + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less new file mode 100644 index 00000000..e0326f2a --- /dev/null +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/index.less @@ -0,0 +1,178 @@ +.xc_tj_fx_wrapper { + .search { + top: -3px; + margin-right: 10px; + width: 220px; + } + + .employeeYearWrapper { + display: flex; + align-items: center; + + & > span:first-child { + margin-right: 4px; + } + } + + .wea-new-top-req-content { + background: #FFF; + + .reportRow { + padding: 16px; + + .gutter-row { + margin-bottom: 16px; + border-radius: 6px; + + .card-item { + border-radius: 6px; + display: flex; + height: 90px; + justify-content: space-between; + padding: 22px 0 22px 16px; + border: 1px solid #e5e5e5; + + .cardLeft { + display: flex; + align-items: center; + justify-content: center; + + i { + padding: 10px; + color: #FFF; + font-size: 20px; + border-radius: 50%; + background-color: #ff666a; + } + } + + .cardCenter { + display: flex; + flex: 1; + flex-direction: column; + justify-content: space-between; + margin-left: 10px; + + .reportName { + font-size: 14px; + color: #111; + font-weight: 600; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .dimension { + display: flex; + + .label { + height: 12px; + font-size: 12px; + color: #999; + line-height: 12px; + font-weight: 400; + } + + .value { + height: 12px; + font-size: 12px; + color: #111; + line-height: 12px; + font-weight: 400; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } + } + + .cardRight { + display: flex; + align-items: center; + justify-content: center; + + .ant-btn-ghost { + color: #999; + border: 1px solid transparent; + } + + .ant-btn-ghost:focus, .ant-btn-ghost:hover, + .ant-btn-ghost.active, .ant-btn-ghost:active { + color: #2baee9; + background-color: #FFF; + border: 1px solid #e5e5e5; + } + } + } + } + + .card-item:hover { + cursor: pointer; + box-shadow: 0 3px 12px 0 rgba(0, 0, 0, .12); + } + } + + .empty { + font-size: 16px; + width: 100%; + text-align: center; + margin-top: 26px; + } + } +} + + +//统计维度弹框 +.dimensionModalWrapper, .dimensionSlideWrapper { + .dimensionTitle { + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; + } + + .dimensionTableWrapper { + .space10 { + a:first-child { + margin-right: 10px; + } + } + } + +} + +.dimensionSlideWrapper, .dimensionModalWrapper { + .wea-search-group { + .wea-select, .ant-select, .ant-select-selection { + width: 100%; + } + } +} + +//员工明细 +.employeeTableWrapper { + + .operates i.icon-coms-more { + padding: 5px 0; + display: inline-block; + width: 40px; + font-size: 20px; + color: #333; + cursor: pointer; + font-weight: 400; + } +} + +.operatePopover { + .ant-popover-inner { + min-width: 100px !important; + } + + .ant-popover-inner-content { + padding: 0; + + .ant-menu { + border-right: none; + } + } +} diff --git a/pc4mobx/hrmSalary/pages/appConfig/index.js b/pc4mobx/hrmSalary/pages/appConfig/index.js index 97054546..a7b3d7ce 100644 --- a/pc4mobx/hrmSalary/pages/appConfig/index.js +++ b/pc4mobx/hrmSalary/pages/appConfig/index.js @@ -5,9 +5,19 @@ * Date: 2022-09-27 18:17:02 */ import React, { Component } from "react"; -import { WeaCheckbox, WeaDatePicker, WeaFormItem, WeaSearchGroup, WeaTop } from "ecCom"; +import { WeaCheckbox, WeaDatePicker, WeaFormItem, WeaInput, WeaSearchGroup, WeaTop } from "ecCom"; import * as API from "../../apis/ruleconfig"; import { Button, message } from "antd"; +import "./index.less"; + +const Input = (props) => { + const { label, value } = props; + return ( + + + + ); +}; class AppConfig extends Component { constructor(props) { @@ -15,6 +25,9 @@ class AppConfig extends Component { this.state = { openAcctResultSum: "0", displayEmpInfoReport: "0", + isLog: "0", + openFormulaForcedEditing: "0", + version: "", loading: false }; } @@ -26,8 +39,13 @@ class AppConfig extends Component { queryAppsetting = () => { API.queryAppsetting().then(({ status, data }) => { if (status) { - const { openAcctResultSum, displayEmpInfoReport } = data; - this.setState({ openAcctResultSum, displayEmpInfoReport }); + const { openAcctResultSum, displayEmpInfoReport, isLog, openFormulaForcedEditing, version } = data; + this.setState({ + openAcctResultSum, displayEmpInfoReport, + isLog: isLog === "true" ? "1" : "0", + openFormulaForcedEditing: openFormulaForcedEditing === "true" ? "1" : "0", + version + }); } }); }; @@ -46,9 +64,15 @@ class AppConfig extends Component { }; render() { - const { openAcctResultSum, displayEmpInfoReport, loading } = this.state; + const { openAcctResultSum, displayEmpInfoReport, loading, openFormulaForcedEditing, isLog, version } = this.state; const btns = []; const items = [ + { + com: Input({ + label: "版本号", + value: version + }) + }, { com: CheckBox({ label: "显示薪资核算结果合计列", @@ -66,6 +90,20 @@ class AppConfig extends Component { this.setState({ displayEmpInfoReport }); } }) + }, + { + com: CheckBox({ + label: "是否输出日志", + disabled: true, + value: isLog + }) + }, + { + com: CheckBox({ + label: "是否可编辑系统公式", + disabled: true, + value: openFormulaForcedEditing + }) } ]; return ( @@ -85,10 +123,10 @@ class AppConfig extends Component { export default AppConfig; export const CheckBox = payload => { - const { label, onChange, value } = payload; + const { label, onChange, value, disabled = false } = payload; return ( - + ); }; diff --git a/pc4mobx/hrmSalary/pages/appConfig/index.less b/pc4mobx/hrmSalary/pages/appConfig/index.less new file mode 100644 index 00000000..53fd7ecb --- /dev/null +++ b/pc4mobx/hrmSalary/pages/appConfig/index.less @@ -0,0 +1,11 @@ +.appConfigWrapper { + height: 100%; + display: flex; + flex-direction: column; + + .wea-search-group { + flex: 1; + height: 100%; + overflow: auto; + } +} diff --git a/pc4mobx/hrmSalary/pages/calculate/index.js b/pc4mobx/hrmSalary/pages/calculate/index.js index cc175022..d9a3699a 100644 --- a/pc4mobx/hrmSalary/pages/calculate/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/index.js @@ -1,16 +1,16 @@ import React from "react"; import { inject, observer } from "mobx-react"; -import { Button, DatePicker, Dropdown, Menu, message, Modal } from "antd"; -import { WeaInputSearch, WeaRightMenu, WeaTop } from "ecCom"; -import { renderNoright } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 +import { Button, DatePicker, Dropdown, Menu, message, Modal, Tag } from "antd"; +import { WeaInputSearch, WeaLocaleProvider, WeaNewScroll, WeaTop } from "ecCom"; +import { renderNoright } from "../../util"; import CustomTab from "../../components/customTab"; - -import { columns } from "./columns"; import moment from "moment"; import BaseFormModal from "./baseFormModal"; import CustomPaginationTable from "../../components/customPaginationTable"; import ProgressModal from "../../components/progressModal"; +import "./index.less"; +const { getLabel } = WeaLocaleProvider; const MonthPicker = DatePicker.MonthPicker; @inject("calculateStore", "taxAgentStore") @@ -26,25 +26,7 @@ export default class Calculate extends React.Component { searchValue: "", startDate: moment(new Date()).startOf("year").format("YYYY-MM"), endDate: moment(new Date()).startOf("month").format("YYYY-MM"), - current: 1, - columns: columns.map(item => { - if (item.dataIndex == "cz") { - item.render = () => - ; - } - }) + current: 1 }; this.pageInfo = { current: 1, pageSize: 10 }; } @@ -60,16 +42,17 @@ export default class Calculate extends React.Component { } // 搜索 - handleSearch(value) { + handleSearch = (value, extra = {}) => { const { calculateStore } = this.props; const { getSalaryAcctList } = calculateStore; getSalaryAcctList({ name: value, startMonthStr: this.state.startDate, endMonthStr: this.state.endDate, - current: this.state.current + current: this.state.current, + ...extra }); - } + }; handleRangePickerChange(type, value) { const { calculateStore: { getSalaryAcctList } } = this.props; @@ -141,6 +124,12 @@ export default class Calculate extends React.Component { message.success("归档成功"); this.handleSearch(this.state.searchValue); }); + }).catch(() => { + clearInterval(this.timer); + this.setState({ + progressVisible: false, + progress: 0 + }); }); } @@ -152,6 +141,20 @@ export default class Calculate extends React.Component { }); } + // 回算 + handleBackCalculate = (record) => { + Modal.confirm({ + title: "信息确认", + content: "确定回算吗?\n 回算后,正常核算的数据会被覆盖,正常核算的工资单不能继续发放或撤回!", + onOk: () => { + const { calculateStore: { backCalculate } } = this.props; + backCalculate(record.id).then(() => { + this.handleSearch(this.state.searchValue); + }); + } + }); + }; + // 查看详情回调 handleDetail(record) { window.open( @@ -161,23 +164,33 @@ export default class Calculate extends React.Component { } // 获取列表 - getColumns() { + getColumns = () => { const { calculateStore: { salaryListColumns }, taxAgentStore: { showOperateBtn } } = this.props; - let columns = [...salaryListColumns]; + let columns = [...salaryListColumns].filter(item => item.dataIndex !== "backCalcStatus" && item.dataIndex !== "acctTimes"); columns.map(item => { - if (item.title == "操作" && showOperateBtn) { + if (item.dataIndex === "salarySobName") { + item.width = 300; item.render = (text, record) => { - const accountBtn = _.filter( - record.operate, - it => it.text == "核算" || it.text == "重新核算" - ); - const notAccountBtn = _.filter( - record.operate, - it => it.text != "核算" && it.text != "重新核算" - ); + return
+ {text} +
+ { + record.backCalcStatus === 1 && + + } + {`第${record.acctTimes}次`} +
+
; + }; + } + if (item.dataIndex === "operate" && showOperateBtn) { + item.width = 150; + item.render = (text, record) => { + const accountBtn = _.take(record.operate, 2); + const notAccountBtn = _.drop(record.operate, 2); let operateBtn = []; if (!_.isEmpty(accountBtn)) { operateBtn.push( @@ -189,13 +202,8 @@ export default class Calculate extends React.Component { style={{ display: "inline-block", marginRight: 8 }}> { - if (it.text == "核算" || it.text == "重新核算") { - it.text == "核算" - ? this.handleAccount(record) - : this.handleReaccount(record); - } - }}> + style={(idx === 1 && it.text.length === 2) ? { padding: "0 12px" } : {}} + onClick={() => this.handleOperateClick(it.index, record)}> {it.text} @@ -211,29 +219,14 @@ export default class Calculate extends React.Component { {notAccountBtn.map(cz => { - if (cz.text == "核算") { - this.handleAccount(record); - } else if (cz.text == "删除") { - this.handleDeleteItem(record); - } else if (cz.text == "归档") { - this.handleFile(record); - } else if (cz.text == "重新核算") { - this.handleReaccount(record); - } else if (cz.text == "查看") { - this.handleDetail(record); - } - }}> + onClick={() => this.handleOperateClick(cz.index, record)}> {cz.text} )} }> - + ); } @@ -241,8 +234,24 @@ export default class Calculate extends React.Component { }; } }); - return showOperateBtn ? columns : _.filter(columns, it => it.title != "操作"); - } + return showOperateBtn ? columns : _.filter(columns, it => it.title !== "操作"); + }; + + handleOperateClick = (index, record) => { + if (index === "0") { + this.handleAccount(record); + } else if (index === "1") { + this.handleDeleteItem(record); + } else if (index === "2") { + this.handleFile(record); + } else if (index === "4") { + this.handleReaccount(record); + } else if (index === "3") { + this.handleDetail(record); + } else if (index === "5") { + this.handleBackCalculate(record); + } + }; // 分页 handleDataPageChange(value) { @@ -271,56 +280,13 @@ export default class Calculate extends React.Component { render() { const { calculateStore, taxAgentStore: { showOperateBtn } } = this.props; - const { - salaryListDataSource, - salaryListColumns, - loading, - hasRight, - form, - condition, - tableStore, - showSearchAd, - getTableDatas, - doSearch, - setShowSearchAd, - salaryListPageInfo - } = calculateStore; + const { salaryListDataSource, loading, hasRight, salaryListPageInfo } = calculateStore; const { modalParam } = this.state; if (!hasRight && !loading) { // 无权限处理 return renderNoright(); } - const rightMenu = [ - // 右键菜单 - { - key: "BTN_COLUMN", - icon: , - content: "显示列定制", - onClick: this.showColumn - } - ]; - const collectParams = { - // 收藏功能配置 - favname: "薪资核算", - favouritetype: 1, - objid: 0, - link: "wui/index.html#/ns_demo03/index", - importantlevel: 1 - }; - const adBtn = [ - // 高级搜索内部按钮 - , - , - - ]; - const renderRightOperation = () => { const { startDate, endDate } = this.state; return ( @@ -363,7 +329,7 @@ export default class Calculate extends React.Component { this.setState({ searchValue: value }); }} onSearch={value => { - this.handleSearch(value); + this.handleSearch(value, { current: 1 }); }} /> @@ -372,60 +338,53 @@ export default class Calculate extends React.Component { return (
- - {/* 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 */} - } // 左侧图标 - iconBgcolor="#F14A2D" // 左侧图标背景色 - showDropIcon={false} // 是否显示下拉按钮 - dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同) - dropMenuProps={{ collectParams }}> - {/* 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 */} - { - }} - /> - { - this.handleDataPageChange(value); - }} - onShowSizeChange={(current, pageSize) => { - this.pageInfo = { current, pageSize }; - this.handleShowSizeChange(this.pageInfo); - }} - /> - - {/*归档进度条*/} - { - this.state.progressVisible && - { - this.setState({ progressVisible: false, progress: 0 }); - }} - progress={this.state.progress} - /> - } - {this.state.baseFormVisible && - this.handleSearch(this.state.searchValue)} - onCancel={() => { - this.setState({ baseFormVisible: false }); - }} - />} - + {/* 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 */} + } + iconBgcolor="#F14A2D" + showDropIcon={false}> + +
+ + { + this.handleDataPageChange(value); + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = { current, pageSize }; + this.handleShowSizeChange(this.pageInfo); + }} + /> + +
+
+ {/*归档进度条*/} + { + this.state.progressVisible && + { + this.setState({ progressVisible: false, progress: 0 }); + }} + progress={this.state.progress} + /> + } + {this.state.baseFormVisible && + this.handleSearch(this.state.searchValue)} + onCancel={() => { + this.setState({ baseFormVisible: false }); + }} + />}
); } diff --git a/pc4mobx/hrmSalary/pages/calculate/index.less b/pc4mobx/hrmSalary/pages/calculate/index.less index 1a510f08..2a274b60 100644 --- a/pc4mobx/hrmSalary/pages/calculate/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/index.less @@ -1,11 +1,19 @@ .dataList-wrapper { - .ant-modal-body{ + .ant-modal-body { padding: 16px 120px } + .formItem { + display: flex; + + .ant-col-8 { + line-height: 30px; + } + .wea-select, .ant-select { width: 100%; } + .ant-select-selection { width: 100%; height: 30px; @@ -13,3 +21,25 @@ } } } + +.salarySobNameWrapper { + display: flex; + align-items: center; + justify-content: space-between; + width: 100%; + + & > span { + flex: 1; + } + + .salarySobNameTagWrapper { + display: flex; + align-items: center; + + i { + color: #5d9cec; + margin-right: 10px; + cursor: pointer; + } + } +} diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js index 44d0a208..b7bc7c27 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js @@ -4,6 +4,8 @@ import { Badge, Button, message } from "antd"; import { inject, observer } from "mobx-react"; import SelectFieldModal from "./selectFieldModal"; import { getQueryString } from "../../../../util/url"; +import AddHeaderFieldsModal from "./addHeaderFieldsModal"; +import { cacheImportField } from "../../../../apis/calculate"; @inject("calculateStore", "standingBookStore") @observer @@ -16,18 +18,17 @@ export default class AcctResultImportModal extends React.Component { salaryItemIds: "" }, step: 0, - selectFieldVisible: false + selectFieldVisible: false, + addHeadFields: { + visible: false, itemsByGroup: [] + } }; } componentWillMount() { const { id } = this.props; if (id) { - let modalParam = { ...this.state.modalParam }; - modalParam.salaryAcctRecordId = id; - this.setState({ - modalParam - }); + this.getImportField(); } else { this.setState({ modalParam: { ...this.state.modalParam, salaryAcctRecordId: "123" } @@ -35,9 +36,35 @@ export default class AcctResultImportModal extends React.Component { } } + getImportField = () => { + const { calculateStore: { getImportField }, id } = this.props; + const { addHeadFields } = this.props; + getImportField(id).then(data => { + this.setState({ + addHeadFields: { + ...addHeadFields, + itemsByGroup: _.map(data.itemsByGroup, item => { + return { + ...item, + salaryItems: _.map(item.salaryItems, it => ({ + ...it, + checked: false + })) + }; + }) + }, + modalParam: { + ...this.state.modalParam, + salaryAcctRecordId: id, + salaryItemIds: data.checkItems.join(",") + } + }); + }); + }; + // 获取模板 handleAccResultTemplateLink() { - const { isStandingBook, standingBookTabKey } = this.props; + const { isStandingBook, standingBookTabKey, standingBookType } = this.props; let url = ""; if (_.isEmpty(this.state.modalParam.salaryItemIds)) { message.warning("请选择表单字段"); @@ -52,6 +79,8 @@ export default class AcctResultImportModal extends React.Component { url = `${window.location.origin}/api/bs/hrmsalary/siaccount/welfare/importtemplate/export?welfareNames=${this.state.modalParam.salaryItemIds}&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`; } else if (standingBookTabKey === "3") { url = `${window.location.origin}/api/bs/hrmsalary/siaccount/welfare/supplyimporttemplate/export?welfareNames=${this.state.modalParam.salaryItemIds}&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`; + } else if (standingBookType === "difference") { + url = `${window.location.origin}/api/bs/hrmsalary/siaccount/welfare/balanceimporttemplate/export?welfareNames=${this.state.modalParam.salaryItemIds}&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`; } } window.open(url, "_self"); @@ -82,24 +111,31 @@ export default class AcctResultImportModal extends React.Component { } // 渲染第一步表单 - renderFormComponent() { + renderFormComponent = () => { return - + ; - } + }; // 选择表单字段 - handleSelectedField() { - this.setState({ - selectFieldVisible: true - }); - } + handleSelectedField = () => { + if (window.location.hash.indexOf("calculateDetail") !== -1) { + this.setState({ + addHeadFields: { + ...this.state.addHeadFields, + visible: true + } + }); + } else { + this.setState({ + selectFieldVisible: true + }); + } + }; // 添加表头字段 - handleAdd(fieldDate) { + handleAdd = (fieldDate) => { let salaryItemIdsList = []; if (!_.isEmpty(fieldDate.formulaItems)) { fieldDate.formulaItems.map(item => { @@ -133,7 +169,7 @@ export default class AcctResultImportModal extends React.Component { modalParam }); this.props.onAdd(fieldDate); - } + }; // 初始化Import数据 handleImportModalInit() { @@ -162,8 +198,10 @@ export default class AcctResultImportModal extends React.Component { } render() { + const billMonth = getQueryString("billMonth"); //isStandingBook: 是否是社保福利台账核算的导入标识 - const { calculateStore, standingBookStore, isStandingBook, visiable } = this.props; + //standingBookType: 是否是补差的导入标识 + const { calculateStore, standingBookStore, isStandingBook, visiable, standingBookType } = this.props; const { fetchPreviewAcctResult, previewAcctResultColumns, @@ -176,14 +214,16 @@ export default class AcctResultImportModal extends React.Component { previewStandingBookAcctResultColumns, previewStandingBookAcctResultDataSource, importStandingBookAcctResult, - importInsuranceAcctDetail + importInsuranceAcctDetail, + importBalanceInsuranceDetail } = standingBookStore; - const { step, selectFieldVisible, modalParam } = this.state; + const { step, modalParam, selectFieldVisible, addHeadFields } = this.state; return (
{ visiable && { this.handleImportModalInit(); }} @@ -200,7 +240,11 @@ export default class AcctResultImportModal extends React.Component { !isStandingBook ? fetchPreviewAcctResult(params) : welfarePreview(params); }} importFile={(params) => { - !isStandingBook ? fetchImportAcctResult(params) : importInsuranceAcctDetail(params); + !isStandingBook ? + fetchImportAcctResult(params) : + standingBookType === "difference" ? + importBalanceInsuranceDetail({ ...params, billMonth }) : + importInsuranceAcctDetail(params); }} templateLink={() => { this.handleAccResultTemplateLink(); @@ -215,6 +259,7 @@ export default class AcctResultImportModal extends React.Component { { selectFieldVisible && } + this.setState({ addHeadFields: { ...addHeadFields, visible: false } })} + onAdd={(salaryItemIds) => this.setState({ + addHeadFields: { + ...addHeadFields, + visible: false + }, + modalParam: { + ...modalParam, + salaryItemIds: salaryItemIds.join(",") + } + }, () => { + const { salaryItemIds } = this.state.modalParam; + cacheImportField({ + salaryItems: salaryItemIds ? salaryItemIds.split(",") : [] + }).then(); + })} + />
); } diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/addHeaderFieldsModal.js b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/addHeaderFieldsModal.js new file mode 100644 index 00000000..66b00e4c --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/addHeaderFieldsModal.js @@ -0,0 +1,105 @@ +/* + * Author: 黎永顺 + * name: 表头字段添加 + * Description: + * Date: 2023/5/17 + */ +import React, { Component } from "react"; +import { Button, Col, Row } from "antd"; +import { WeaCheckbox, WeaDialog, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import "./index.less"; + +const { getLabel } = WeaLocaleProvider; + +class AddHeaderFieldsModal 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: nextProps.selectItems ? _.map(nextProps.selectItems.split(","), it => Number(it)) : [] + }); + } + } + + 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 ( + this.props.onAdd(itemsCheckeds)}>{getLabel(111, "添加")}, + + ]} + 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) })}/> + ; + }) : 暂无数据 + } + + ; + }) + } + + ); + } +} + +export default AddHeaderFieldsModal; diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/index.less b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/index.less new file mode 100644 index 00000000..1de6458c --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/index.less @@ -0,0 +1,11 @@ +.addHeaderFieldsWrapper { + .wea-search-group { + .wea-title { + padding-left: 0 !important; + } + + .wea-content { + padding: 8px 16px 0; + } + } +} diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/selectFieldModal.js b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/selectFieldModal.js index 5c51b0f1..f288cc35 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/selectFieldModal.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/selectFieldModal.js @@ -2,6 +2,7 @@ import React from "react"; import { Button, Col, Row } from "antd"; import { inject, observer } from "mobx-react"; import { WeaCheckbox, WeaDialog } from "ecCom"; +import { cacheImportField } from "../../../../apis/calculate"; @inject("calculateStore", "standingBookStore") @observer @@ -14,7 +15,11 @@ export default class SelectFieldModal extends React.Component { } componentWillMount() { - const { calculateStore: { getImportField }, standingBookStore: { getWelfareList }, isStandingBook } = this.props; + const { + calculateStore: { getImportField }, + standingBookStore: { getWelfareList, getBalanceWelfareList }, + isStandingBook, standingBookType + } = this.props; if (!isStandingBook) { getImportField(this.props.id).then(data => { let fieldData = {}; @@ -33,17 +38,30 @@ export default class SelectFieldModal extends React.Component { if (this.props.fieldData.inputItems) { sqlItems = this.props.fieldData.sqlItems; } - fieldData.formulaItems = formulaItems; - fieldData.inputItems = inputItems; - fieldData.sqlItems = sqlItems; - - this.setState({ - fieldData + fieldData.formulaItems = _.map(formulaItems, item => { + if (data.checkItems.includes(item.salaryItemId)) { + return { ...item, checked: true }; + } + return { ...item }; }); + fieldData.inputItems = _.map(inputItems, item => { + if (data.checkItems.includes(item.salaryItemId)) { + return { ...item, checked: true }; + } + return { ...item }; + }); + fieldData.sqlItems = _.map(sqlItems, item => { + if (data.checkItems.includes(item.salaryItemId)) { + return { ...item, checked: true }; + } + return { ...item }; + }); + this.setState({ fieldData }); this.fieldData = fieldData; }); } else { - getWelfareList().then(result => { + const APIFox = standingBookType === "difference" ? getBalanceWelfareList : getWelfareList; + APIFox().then(result => { let fieldData = {}; let formulaItems = []; formulaItems = _.map(result, it => ({ ...it, salaryItemId: it.salaryItemName })); @@ -90,10 +108,19 @@ export default class SelectFieldModal extends React.Component { } // 添加按钮点击回调 - handleAddClick() { + handleAddClick = async () => { + //薪资核算详情页面的导入表单字段缓存功能 + if (window.location.hash.indexOf("calculateDetail") !== -1) { + const { status } = await this.cacheImportField(); + } this.props.onAdd(this.fieldData); this.props.onCancel(); - } + }; + cacheImportField = () => { + const salaryItemList = _.reduce(_.keys(this.fieldData), (pre, cur) => ([...pre, ...this.fieldData[cur]]), []); + const salaryItems = _.map(_.filter(salaryItemList, it => !!it.checked), item => item.salaryItemId); + return cacheImportField({ salaryItems }); + }; // 标题checkbox点击 handleTitleCheckboxChange(value, flag) { @@ -146,22 +173,20 @@ export default class SelectFieldModal extends React.Component { const { isStandingBook } = this.props; return ( { this.props.onCancel(); }} buttons={[ - + ]} >
{ !_.isEmpty(fieldData.formulaItems) && -
+
{ this.handleTitleCheckboxChange(value, "formula"); diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js index 89423428..49085673 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js @@ -6,8 +6,10 @@ import CustomTab from "../../components/customTab"; import { inject, observer } from "mobx-react"; import CompareDetailImportModal from "./compareDetailImportModal"; import CustomPaginationTable from "../../components/customPaginationTable"; +import { salaryacctAcctresultCheckAuth } from "../../apis/calculate"; +import Authority from "../mySalary/authority"; -@inject("calculateStore") +@inject("calculateStore", "taxAgentStore") @observer export default class CompareDetail extends React.Component { constructor(props) { @@ -17,15 +19,14 @@ export default class CompareDetail extends React.Component { onlyDiffEmployee: true, onlyDiffSalaryItem: true, importModalVisible: false, - searchValue: "" + searchValue: "", + calculateAuth: false }; this.pageInfo = { current: 1, pageSize: 10 }; } componentWillMount() { - let id = getQueryString("id"); - this.id = id; - + this.id = getQueryString("id"); const { calculateStore: { fetchComparisonResultList } } = this.props; const { onlyDiffEmployee, onlyDiffSalaryItem } = this.state; let params = { @@ -35,27 +36,50 @@ export default class CompareDetail extends React.Component { current: 1 }; fetchComparisonResultList(params); + this.salaryacctAcctresultCheckAuth({ salaryAcctRecordId: getQueryString("id") }) } - getColumns(columns) { + salaryacctAcctresultCheckAuth = (params) => { + const { taxAgentStore: { getPermission } } = this.props; + getPermission().then(({ data }) => { + const { isOpenDevolution } = data; + if (isOpenDevolution) { + salaryacctAcctresultCheckAuth(params).then(({ status, data }) => { + this.setState({ calculateAuth: data && status }); + }); + } else { + this.setState({ calculateAuth: true }); + } + }); + }; + + getColumns = (columns) => { let newColumns = [...columns]; newColumns.map(item => { let n = Number(item.dataIndex); if (!isNaN(n)) { // 数字 item.render = (text, record) => { + const showDifference = record[`${item.dataIndex}_type`] === "number"; + const { acctResultValue, excelResultValue } = record[item.dataIndex]; return (
-
系统值:{record[item.dataIndex].acctResultValue}
-
线下值:{record[item.dataIndex].excelResultValue}
-
差值:{calculateCompares(record[item.dataIndex].acctResultValue, record[item.dataIndex].excelResultValue)}
+
系统值:{acctResultValue}
+
线下值:{excelResultValue}
+ { + showDifference && +
+ 差值:{calculateCompares(acctResultValue, excelResultValue)} +
+ }
); }; + } else { + item.fixed = "left"; } }); return newColumns; - } + }; // 导入 handleImportClick() { @@ -163,7 +187,7 @@ export default class CompareDetail extends React.Component { comparisonResultColumns } } = this.props; - const { importModalVisible, searchValue } = this.state; + const { importModalVisible, searchValue, calculateAuth } = this.state; const renderRightOperation = () => { return (
@@ -197,70 +221,70 @@ export default class CompareDetail extends React.Component { ); }; return ( -
- -
-
- 公式= - 系统值;线下值;差值 + +
+ +
+
+ 公式= + 系统值;线下值;差值 +
-
-
- { - this.pageInfo.current = value; - this.handleDataPageChange(value); - }} - onShowSizeChange={(current, pageSize) => { - this.pageInfo = { current, pageSize }; - this.handleShowSizeChange(this.pageInfo); - }} - /> -
+
+ { + this.pageInfo.current = value; + this.handleDataPageChange(value); + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = { current, pageSize }; + this.handleShowSizeChange(this.pageInfo); + }} + /> +
- { - importModalVisible && { - this.handleComparisonFinish(); - }} - onCancel={() => { - this.setState({ - importModalVisible: false - }); - }} - /> - } -
+ { + importModalVisible && { + this.handleComparisonFinish(); + }} + onCancel={() => { + this.setState({ + importModalVisible: false + }); + }} + /> + } +
+ ); } } // 计算差值 -export const calculateCompares=(systemValue, excelValue)=> { - if (systemValue == null || excelValue == null) { - return ""; - } - let systemNum = Number(systemValue); - let excelNum = Number(excelValue); - if (!isNaN(systemNum) || !isNaN(excelNum)) { // 数字 - return (systemNum - excelNum).toFixed(2); - } - return ""; -} +export const calculateCompares = (systemValue = 0, excelValue = 0) => { + const systemNum = Number(systemValue); + const excelNum = Number(excelValue); + return (systemNum - excelNum).toFixed(2); +}; diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/compareDetailImportModal.js b/pc4mobx/hrmSalary/pages/calculateDetail/compareDetailImportModal.js index 1c276127..9fc924e1 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/compareDetailImportModal.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/compareDetailImportModal.js @@ -1,7 +1,7 @@ import React from "react"; import ImportModal from "../../components/importModal"; import { inject, observer } from "mobx-react"; -import { getQueryString } from "../../util/url"; +import { convertToUrlString, getQueryString } from "../../util/url"; @inject("calculateStore", "standingBookStore") @observer @@ -35,7 +35,12 @@ export default class CompareDetailImportModal extends React.Component { if (this.props.id) { url = "/api/bs/hrmsalary/salaryacct/comparisonresult/importtemplate/export?salaryAcctRecordId=" + this.props.id; } else { - url = `/api/bs/hrmsalary/siaccount/comparisonwelfare/importtemplate/export`; + const payload = { + billMonth: getQueryString("billMonth"), + paymentOrganization: getQueryString("paymentOrganization"), + paymentStatus: 0 + }; + url = `/api/bs/hrmsalary/siaccount/comparisonwelfare/importtemplate/export?${convertToUrlString(payload)}`; } window.open(url); } diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/editSalaryDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/editSalaryDetail.js index 385fa87b..2051451d 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/editSalaryDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/editSalaryDetail.js @@ -1,41 +1,55 @@ import React from "react"; -import { WeaHelpfulTip, WeaInput } from "ecCom"; -import { Col, Row } from "antd"; +import { WeaHelpfulTip, WeaTab } from "ecCom"; +import IssuedAndReissueTable from "./issuedAndReissueTable"; +import PayrollItemsTable from "./payrollItemsTable"; import { inject, observer } from "mobx-react"; -import cs from "classnames"; +import { toJS } from "mobx"; import "./index.less"; @inject("calculateStore") @observer export default class EditSalaryDetail extends React.Component { + constructor(props) { + super(props); + this.state = { + selectedKey: "0" + }; + } + componentWillMount() { const { calculateStore: { acctresultDetail } } = this.props; acctresultDetail(this.props.id); } - handleItemValueChange(field, value, isInput) { + handleItemValueChange = (field, value, isInput, groupId) => { const { calculateStore: { acctresultDetailForm, setAcctresultDetailForm } } = this.props; let form = { ...acctresultDetailForm }; - if (isInput) { - form.inputItems = acctresultDetailForm.inputItems.map(item => { - item = { ...item }; - if (item.salaryItemName == field) { - item.resultValue = value; + if (isInput === "itemsByGroup") { + form.itemsByGroup = acctresultDetailForm.itemsByGroup.map(item => { + if (item.salarySobItemGroupId === groupId) { + return { + ...item, + salaryItems: _.map(item.salaryItems, it => { + if (it.salaryItemId === field) { + return { ...it, resultValue: value }; + } + return { ...it }; + }) + }; } - return item; + return { ...item }; }); - } else { - form.formulaItems = acctresultDetailForm.formulaItems.map(item => { + } else if (isInput === "issuedAndReissueItems") { + form.issuedAndReissueItems = acctresultDetailForm.issuedAndReissueItems.map(item => { item = { ...item }; - if (item.salaryItemName == field) { + if (item.salaryItemName === field) { item.resultValue = value; } return item; }); } setAcctresultDetailForm(form); - } - + }; renderTableTr = (data, isInput) => { const tables = []; const len = data.length; @@ -59,22 +73,27 @@ export default class EditSalaryDetail extends React.Component { return tables; }; - render() { const { calculateStore: { acctresultDetailForm } } = this.props; + const { selectedKey } = this.state; + const { itemsByGroup = [] } = toJS(acctresultDetailForm); + const topTab = [ + { + title: "正常工资薪金所得", + viewcondition: "0" + }, + { + title: "已发补发", + viewcondition: "1" + } + ]; return (
基本信息 - +
-
{ !_.isEmpty(acctresultDetailForm.employeeInfos) && @@ -84,73 +103,27 @@ export default class EditSalaryDetail extends React.Component { }
- -
-
- 输入项 -
- - { - acctresultDetailForm.inputItems && acctresultDetailForm.inputItems.map((item, index) => { - const len = acctresultDetailForm.inputItems.length; - return ( - - - {item.salaryItemName} - { - this.handleItemValueChange(item.salaryItemName, value, true); - }}/> - - - ); - }) - } - -
-
-
- - -
-
- - 公式项 - - -
- - { - acctresultDetailForm.formulaItems && acctresultDetailForm.formulaItems.map((item, index) => { - const len = acctresultDetailForm.formulaItems.length; - return ( - - - {item.salaryItemName} - { - this.handleItemValueChange(item.salaryItemName, value, false); - }}/> - - - ); - }) - } - -
-
-
+ { + !_.isEmpty(toJS(acctresultDetailForm.issuedAndReissueItems)) && + this.setState({ selectedKey: v })} + /> + } + { + selectedKey === "0" && _.map(itemsByGroup, item => { + return ; + }) + } + { + selectedKey === "1" && + + }
); } diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/index.js b/pc4mobx/hrmSalary/pages/calculateDetail/index.js index 668a798e..72ce7a6b 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/index.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/index.js @@ -4,13 +4,16 @@ import { inject, observer } from "mobx-react"; import SalaryDetail from "./salaryDetail"; import { Button, Dropdown, Menu, message, Modal } from "antd"; import { WeaBrowser, WeaCheckbox, WeaDropdown, WeaFormItem, WeaInput, WeaSearchGroup, WeaSelect, WeaTab } from "ecCom"; -import { getQueryString } from "../../util/url"; +import { convertToUrlString, getQueryString } from "../../util/url"; import AcctResultImportModal from "./acctResult/importModal/acctResultImportModal"; import ProgressModal from "../../components/progressModal"; +import { salaryacctAcctresultCheckAuth } from "../../apis/calculate"; +import Authority from "../mySalary/authority"; + const { ButtonSelect } = WeaDropdown; -@inject("calculateStore", "salaryFileStore") +@inject("calculateStore", "salaryFileStore", "taxAgentStore") @observer export default class CalculateDetail extends React.Component { constructor(props) { @@ -19,10 +22,11 @@ export default class CalculateDetail extends React.Component { showSearchAd: false, searchItemsValue: { employeeName: "", + workcode: "", departmentIds: "", positionIds: "", subcompanyIds: "", - status: "", + statuses: "", consolidatedTaxation: "0" }, selectedKey: "0", @@ -30,37 +34,55 @@ export default class CalculateDetail extends React.Component { acctResultImportVisiable: false, progressVisible: false, progress: 0, - accountIds: [] + accountIds: [], + accountExceptInfo: "", + calculateAuth: false }; this.id = ""; - this.timer; + this.timer = null; } - componentWillMount() { + async componentWillMount() { let id = getQueryString("id"); this.id = id; const { calculateStore: { checkTaxAgent }, salaryFileStore } = this.props; const { commonEnumList } = salaryFileStore; + this.salaryacctAcctresultCheckAuth({ salaryAcctRecordId: id }); checkTaxAgent(this.id); let modalParam = { ...this.state.modalParam, salaryAcctRecordId: id }; this.setState({ modalParam }); commonEnumList("user", { enumClass: "com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum" }); } + salaryacctAcctresultCheckAuth = (params) => { + const { taxAgentStore: { getPermission } } = this.props; + getPermission().then(({ data }) => { + const { isOpenDevolution } = data; + if (isOpenDevolution) { + salaryacctAcctresultCheckAuth(params).then(({ status, data }) => { + this.setState({ calculateAuth: data && status }); + }); + } else { + this.setState({ calculateAuth: true }); + } + }); + }; + Input = (value, key) => { - const { employeeName } = this.state.searchItemsValue; + const { employeeName, workcode } = this.state.searchItemsValue; return ( - this.setState({ - searchItemsValue: { - ...this.state.searchItemsValue, - [key]: val - } - })}/> + this.setState({ + searchItemsValue: { + ...this.state.searchItemsValue, + [key]: val + } + })}/> ); }; @@ -93,7 +115,7 @@ export default class CalculateDetail extends React.Component { ); }; Select = (value, key) => { - const { status } = this.state.searchItemsValue; + const { statuses } = this.state.searchItemsValue; return ( this.setState({ searchItemsValue: { ...this.state.searchItemsValue, [key]: val } })}/> @@ -160,7 +185,8 @@ export default class CalculateDetail extends React.Component { this.timer = null; this.setState({ progressVisible: false, - accountIds: [] + accountIds: [], + accountExceptInfo: data.message }); message.success("核算完成"); // acctResultList({ salaryAcctRecordId: this.id }); @@ -172,7 +198,7 @@ export default class CalculateDetail extends React.Component { url: "/api/bs/hrmsalary/salaryacct/acctresult/list", selectedRowKeys: [], queryParams: { - salaryAcctRecordId, + salaryAcctRecordId } }; childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); @@ -181,7 +207,8 @@ export default class CalculateDetail extends React.Component { this.timer = null; this.setState({ progressVisible: false, - accountIds: [] + accountIds: [], + accountExceptInfo: data.message }); message.error(data.message); } @@ -189,8 +216,6 @@ export default class CalculateDetail extends React.Component { }); }, 1000); }); - }, - onCancel() { } }); }; @@ -208,8 +233,11 @@ export default class CalculateDetail extends React.Component { this.id ); } else if (e.key == "3") { + const { searchItemsValue } = this.state; + const { consolidatedTaxation, ...extra } = searchItemsValue; + const payload = { ...extra, consolidatedTaxation: consolidatedTaxation === "0" ? "" : consolidatedTaxation }; window.open( - "/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=" + this.id + "&ids=" + `/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=${this.id}&ids=&${convertToUrlString(payload)}` ); } }; @@ -246,8 +274,18 @@ export default class CalculateDetail extends React.Component { } } + downloadTxtfile = (value) => { + const element = document.createElement("a"); + const file = new Blob([value], { type: "text/plain" }); + element.href = URL.createObjectURL(file); + element.download = "核算异常信息.txt"; + document.body.appendChild(element); + element.click(); + }; + render() { - const { selectedKey, acctResultImportVisiable, showSearchAd } = this.state; + const { selectedKey, acctResultImportVisiable, showSearchAd, calculateAuth } = this.state; + const { taxAgentStore: { payrollPermission } } = this.props; const menu = ( 导入 @@ -257,7 +295,8 @@ export default class CalculateDetail extends React.Component { ); const renderRightOperation = () => { - return [ + const { accountExceptInfo } = this.state; + let buttons = [ ]; + accountExceptInfo && buttons.unshift(