diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index e1f1168f..f7295726 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -277,6 +277,10 @@ export const deleteExportTemplate = (params) => { export const getExportTemplateForm = (params) => { return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/getExportTemplateForm", params); }; +//薪资审批-薪资核算页面获取审批信息 +export const getApprovalInfoByRecordId = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salarysob/salaryApproval/getApprovalInfoByRecordId", "GET", params); +}; //薪资核算-薪资项目改变否 export const getCompareSobConfig = params => { return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/compareSobConfig", "GET", params); diff --git a/pc4mobx/hrmSalary/apis/ledger.js b/pc4mobx/hrmSalary/apis/ledger.js index 8e9a949a..2952dfe8 100644 --- a/pc4mobx/hrmSalary/apis/ledger.js +++ b/pc4mobx/hrmSalary/apis/ledger.js @@ -191,6 +191,18 @@ export const saveTaxMapping = params => { export const getSalaryItemForm = params => { return postFetch("/api/bs/hrmsalary/salarysob/item/getSalaryItemForm", params); }; +//薪资核算规则配置-获取薪资审批规则表单 +export const getSalaryApprovalForm = params => { + return postFetch("/api/bs/hrmsalary/salarysob/salaryApproval/getForm", params); +}; +//薪资核算规则配置-保存薪资审批规则表单 +export const salaryApprovalSaveForm = params => { + return postFetch("/api/bs/hrmsalary/salarysob/salaryApproval/saveForm", params); +}; +//薪资核算规则配置-获取能够添加的项目 +export const getListSalaryItem = params => { + return postFetch("/api/bs/hrmsalary/salarysob/salaryApproval/listSalaryItem", params); +}; //薪资账套-获取薪资账套中拓扑图数据 export const getSalaryItemTopology = params => { return postFetch("/api/bs/hrmsalary/salarysob/item/topology", params); diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js index a77e6e4d..d8a69b3e 100644 --- a/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js +++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customBrowserMutiRight.js @@ -75,9 +75,9 @@ class CustomBrowserMutiRight extends Component { const targetNode = obj.node.props.eventKey; const result = []; this.nodeIds.filter((item) => { - return dragNodes.indexOf(item) === -1; + return dragNodes.indexOf(String(item)) === -1; }).forEach((id) => { - if (id === targetNode) { + if (String(id) === targetNode) { dragNodes.forEach((drag) => { result.push(this.nodeObj[drag]); }); diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js index cbc72a7c..a45cee0f 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js @@ -177,8 +177,9 @@ class SalaryDetails extends Component { } }); converCheckedCol = (data) => { + const { salaryDetailShowType } = this.props; return _.reduce(data.checked || [], (pre, cur) => { - const item = _.find(data.setting, k => (k.id === cur) || (k.column === cur.column)); + const item = _.find(data.setting, k => (salaryDetailShowType !== "1" && k.id === cur) || (salaryDetailShowType === "1" && k.column === cur.column)); if (!_.isEmpty(item)) return [...pre, { ...item, id: item.id || item.column, name: item.name || item.text }]; return pre; }, []); diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js index d4aca862..e06144ba 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryCalcPersonConfirm/index.js @@ -79,6 +79,7 @@ class Index extends Component { renderTabBtns = () => { const { selectedKey, selectedRowKeys } = this.state; + const { calcDetail } = this.props; let tabBtns = []; switch (selectedKey) { case "range": @@ -95,6 +96,7 @@ class Index extends Component { className="icon-coms-Refresh"/>, ]; + calcDetail && tabBtns.splice(0, 2); break; case "add": case "sub": @@ -202,7 +204,7 @@ class Index extends Component { }; render() { - const { calculateStore: { PCSearchForm } } = this.props; + const { calculateStore: { PCSearchForm }, calcDetail } = this.props; const { selectedKey, showSearchAd, searchConditions, pageInfo, loading, selectedRowKeys, columns, dataSource @@ -280,8 +282,8 @@ class Index extends Component { onAdReset={() => PCSearchForm.resetForm()} autoCalculateWidth /> { let width = ""; const { dataIndex } = item; @@ -300,9 +302,10 @@ class Index extends Component { dataIndex: "operate", title: getLabel(30585, "操作"), width: 120, - render: (_, record) => ( - this.handleDeletePCitem([record.id])}>{getLabel(535052, "删除")} + render: (_, record) => ( + {calcDetail ? null : this.handleDeletePCitem([record.id])}>{getLabel(535052, "删除")}} + ) } ]} diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js index 737ac7cf..a8280592 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js @@ -30,6 +30,7 @@ class Index extends Component { selectedKey: "person", progressVisible: false, progress: 0, loading: { calcTax: false, feedback: false }, customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] }, salaryImpDialog: { visible: false, title: "", salaryAcctRecordId: "" }, + approvalInfo: {},//审批信息, accountExceptInfo: "" //核算报错信息, }; @@ -37,6 +38,12 @@ class Index extends Component { this.timer = null; } + init = () => { + const { routeParams: { salaryAcctRecordId } } = this.props; + API.getApprovalInfoByRecordId({ salaryAcctRecordId }).then(({ status, data: approvalInfo }) => { + if (status) this.setState({ approvalInfo }); + }); + }; handleMenuClick = ({ key }) => { switch (key) { case "calc_selected": @@ -202,7 +209,9 @@ class Index extends Component { }); }; renderReqBtns = () => { - const { selectedKey, accountExceptInfo, loading } = this.state; + const { routeParams: { salaryAcctRecordId } } = this.props; + const { selectedKey, accountExceptInfo, approvalInfo, loading } = this.state; + const { isOpenApproval, approvalWorkflowUrl, canEdit } = approvalInfo; let reqBtns = []; switch (selectedKey) { case "calc": @@ -213,7 +222,7 @@ class Index extends Component { ); const moreMenu = ( - {getLabel(32935, "导入")} + {canEdit && {getLabel(32935, "导入")}} {getLabel(81272, "导出全部")} {getLabel(544270, "自定义导出")} {getLabel(543249, "线下对比")} @@ -233,6 +242,10 @@ class Index extends Component { this.calc.openAdvanceSearch()} onAdvanceSearch={() => this.calc.onAdSearch(false)}/> ]; + !canEdit && reqBtns.splice(0, 1); + isOpenApproval && reqBtns.unshift(); accountExceptInfo && reqBtns.unshift( this.downloadTxtfile(accountExceptInfo)}/>); @@ -251,14 +264,15 @@ class Index extends Component { element.click(); }; renderContent = () => { - const { selectedKey } = this.state; + const { selectedKey, approvalInfo } = this.state; + const { canEdit } = approvalInfo; let dom = null; switch (selectedKey) { case "person": - dom = ; + dom = ; break; case "calc": - dom = this.calc = dom}/>; + dom = this.calc = dom}/>; break; default: break; @@ -274,7 +288,7 @@ class Index extends Component { const { calculateStore: { setOtherConditions } } = this.props; const { selectedKey, progressVisible, progress, customExpDialog, salaryImpDialog } = this.state; return ( - +
- {getSearchs(form, condition)} +
+ {getSearchs(form, condition, 2, false)} 若此员工数据已存在在同期列表中,则当前数据保存后会覆盖列表数据
); diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.less b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.less index fafbff7c..b8713b71 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.less +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.less @@ -4,7 +4,15 @@ flex-direction: column; .wea-form-item { - padding: 8px 16px 0 16px; + height: 46px; + line-height: 46px; + background: #FFF; + margin: 8px 16px 0 16px; + + .wea-form-item-label { + line-height: 46px !important; + padding-left: 8px !important; + } .to { padding: 0 10px @@ -15,7 +23,7 @@ flex: 1; overflow: hidden; background: #FFF; - margin: 16px; + margin: 8px 16px; } .linkWapper { diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/components/index.less b/pc4mobx/hrmSalary/pages/dataAcquisition/components/index.less index 4d16b78a..94ab3cad 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/components/index.less +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/components/index.less @@ -1,13 +1,41 @@ .tableRecordWrapper { + padding: 0 16px; + + .form-dialog-layout { + padding: 0 !important; + + .wea-search-group { + padding: 16px 0 !important; + } + } + + .wea-form-cell-wrapper { + & > div:first-child { + height: 47px !important; + line-height: 47px; + } + + & > div:last-child { + + .wea-form-item-wrapper { + display: flex !important; + align-items: center; + + .to { + padding: 0 10px; + } + } + } + } + .accumulated { .wea-form-cell-wrapper { & > div:first-child { - height: 46px !important; - line-height: 46px; + height: 47px !important; + line-height: 47px; } & > div:nth-child(2) { - //width: 40% !important; .wea-form-item-wrapper { display: flex !important; @@ -18,10 +46,6 @@ } } } - - & > div:last-child { - //width: 40% !important; - } } } } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/components/tableRecord.js b/pc4mobx/hrmSalary/pages/dataAcquisition/components/tableRecord.js index 9db08fac..4bba03cd 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/components/tableRecord.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/components/tableRecord.js @@ -5,8 +5,7 @@ * Date: 2023/2/20 */ import React, { Component } from "react"; -import { WeaSearchGroup } from "ecCom"; -import UnifiedTable from "../../../components/UnifiedTable"; +import { WeaSearchGroup, WeaTable } from "ecCom"; import { getTableRecordDate } from "../../../apis/cumDeduct"; import { DataCollectionDateRangePick, DataCollectionSelect, Input } from "../cumDeduct"; import "./index.less"; @@ -87,9 +86,22 @@ class TableRecord extends Component { if (status) { const { columns, list: dataSource, pageNum: current, pageSize, total } = data; this.setState({ - pageInfo: { ...pageInfo, current, pageSize, total }, - dataSource, - columns + pageInfo: { ...pageInfo, current, pageSize, total }, dataSource, + columns: _.map(columns, (o, i) => { + let col = { + ...o, width: 110, + render: text => ({text}) + }; + switch (o.dataIndex) { + case "taxAgentName": + col = { ...col, width: 180 }; + break; + default: + col = { ...col }; + break; + } + return i === 0 ? { ...col, fixed: "left" } : col; + }) }); } }).catch(() => this.setState({ loading: { ...loading, query: false } })); @@ -161,14 +173,6 @@ class TableRecord extends Component { { com: Input({ value: record.username }) }, - { - com: DataCollectionDateRangePick({ - label: "税款所属期", - range: recordPayload[screenParams[screenParams.length - 1]] || [], - onChange: this.handleTablerecordScreen, - key: screenParams[screenParams.length - 1] - }) - }, { com: DataCollectionSelect({ label: "个税扣缴义务人", @@ -177,28 +181,26 @@ class TableRecord extends Component { onChange: this.handleTablerecordScreen, key: "taxAgentId" }) + }, + { + com: DataCollectionDateRangePick({ + label: "税款所属期", + range: recordPayload[screenParams[screenParams.length - 1]] || [], + onChange: this.handleTablerecordScreen, + key: screenParams[screenParams.length - 1] + }) } ]; return (
{ !_.isEmpty(screenParams) && - 1280 ? 3 : 2}/> +
+ +
} - ({ - ...item, - render: (text) => { - return {text} ; - } - }))} - dataSource={dataSource} - pagination={pagination} - loading={loading.query} - xWidth={columns.length * 180} - /> +
); } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js index c2c2a844..f63bc98e 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/columns.js @@ -1,400 +1,3 @@ -export const columns = [ - { - title: "姓名", - dataIndex: "title", - key: "title" - }, - { - title: "个税扣缴义务人", - dataIndex: "title", - key: "title" - }, - { - title: "部门", - dataIndex: "title", - key: "title" - }, - { - title: "手机号", - dataIndex: "title", - key: "title" - }, - { - title: "工号", - dataIndex: "title", - key: "title" - }, - { - title: "证件号码", - dataIndex: "title", - key: "title" - }, - { - title: "入职日期", - dataIndex: "title", - key: "title" - }, - { - title: "累计子女教育", - dataIndex: "title", - key: "title" - }, - { - title: "累计继续教育", - dataIndex: "title", - key: "title" - }, - { - title: "累计住房贷款利息", - dataIndex: "title", - key: "title" - }, - { - title: "累计住房租金", - dataIndex: "title", - key: "title" - }, - { - title: "累计赡养老人", - dataIndex: "title", - key: "title" - }, - { - title: "操作", - dataIndex: "title", - key: "title" - } -]; - - -export const modalColumns = [ - { - title: "姓名", - dataIndex: "username", - key: "username" - }, - { - title: "个税扣缴义务人", - dataIndex: "taxAgentName", - key: "taxAgentName" - }, - { - title: "部门", - dataIndex: "departmentName", - key: "departmentName" - }, - { - title: "手机号", - dataIndex: "mobile", - key: "mobile" - }, - { - title: "工号", - dataIndex: "jobNum", - key: "jobNum" - }, - { - title: "证件号码", - dataIndex: "idNo", - key: "idNo" - }, - { - title: "入职日期", - dataIndex: "hiredate", - key: "hiredate" - }, - { - title: "累计子女教育", - dataIndex: "addUpChildEducation", - key: "addUpChildEducation" - }, - { - title: "累计继续教育", - dataIndex: "addUpContinuingEducation", - key: "addUpContinuingEducation" - }, - { - title: "累计住房贷款利息", - dataIndex: "addUpHousingLoanInterest", - key: "addUpHousingLoanInterest" - }, - { - title: "累计住房租金", - dataIndex: "addUpHousingRent", - key: "addUpHousingRent" - }, - { - title: "累计赡养老人", - dataIndex: "addUpSupportElderly", - key: "addUpSupportElderly" - }, - { - title: "累计婴幼儿照护", - dataIndex: "addUpInfantCare", - key: "addUpInfantCare" - }, - { - title: "累计大病医疗", - dataIndex: "addUpIllnessMedical", - key: "addUpIllnessMedical" - } -]; -export const specialModalColumns = [ - { - title: "姓名", - dataIndex: "username", - key: "username" - }, - { - title: "个税扣缴义务人", - dataIndex: "taxAgentName", - key: "taxAgentName" - }, - { - title: "部门", - dataIndex: "departmentName", - key: "departmentName" - }, - { - title: "手机号", - dataIndex: "mobile", - key: "mobile" - }, - { - title: "工号", - dataIndex: "jobNum", - key: "jobNum" - }, - { - title: "证件号码", - dataIndex: "idNo", - key: "idNo" - }, - { - title: "入职日期", - dataIndex: "hiredate", - key: "hiredate" - }, - { - title: "子女教育", - dataIndex: "childrenEducation", - key: "childrenEducation" - }, - { - title: "继续教育", - dataIndex: "continuingEducation", - key: "continuingEducation" - }, - { - title: "住房贷款利息", - dataIndex: "housingLoanInterest", - key: "housingLoanInterest" - }, - { - title: "住房租金", - dataIndex: "housingRent", - key: "housingRent" - }, - { - title: "赡养老人", - dataIndex: "supportingElder", - key: "supportingElder" - }, - { - title: "婴幼儿照护", - dataIndex: "infantCare", - key: "infantCare" - }, - { - title: "大病医疗", - dataIndex: "seriousIllnessTreatment", - key: "seriousIllnessTreatment" - } -]; -export const otherModalColumns = [ - { - title: "姓名", - dataIndex: "username", - key: "username" - }, - { - title: "个税扣缴义务人", - dataIndex: "taxAgentName", - key: "taxAgentName" - }, - { - title: "部门", - dataIndex: "departmentName", - key: "departmentName" - }, - { - title: "手机号", - dataIndex: "mobile", - key: "mobile" - }, - { - title: "工号", - dataIndex: "jobNum", - key: "jobNum" - }, - { - title: "证件号码", - dataIndex: "idNo", - key: "idNo" - }, - { - title: "入职日期", - dataIndex: "hiredate", - key: "hiredate" - }, - { - title: "商业健康保险", - dataIndex: "businessHealthyInsurance", - key: "businessHealthyInsurance" - }, - { - title: "税延养老保险", - dataIndex: "taxDelayEndowmentInsurance", - key: "taxDelayEndowmentInsurance" - }, - { - title: "其他", - dataIndex: "otherDeduction", - key: "otherDeduction" - }, - { - title: "准予扣除的捐赠额", - dataIndex: "deductionAllowedDonation", - key: "deductionAllowedDonation" - } -]; -export const situationModalColumns = [ - { - title: "姓名", - dataIndex: "username", - key: "username" - }, - { - title: "个税扣缴义务人", - dataIndex: "taxAgentName", - key: "taxAgentName" - }, - { - title: "部门", - dataIndex: "departmentName", - key: "departmentName" - }, - { - title: "手机号", - dataIndex: "mobile", - key: "mobile" - }, - { - title: "工号", - dataIndex: "jobNum", - key: "jobNum" - }, - { - title: "证件号码", - dataIndex: "idNo", - key: "idNo" - }, - { - title: "入职日期", - dataIndex: "hiredate", - key: "hiredate" - }, - { - title: "累计收入额", - dataIndex: "addUpIncome", - key: "addUpIncome" - }, - { - title: "累计减除费用", - dataIndex: "addUpSubtraction", - key: "addUpSubtraction" - }, - { - title: "累计社保个人合计", - dataIndex: "addUpSocialSecurityTotal", - key: "addUpSocialSecurityTotal" - }, - { - title: "累计公积金个人合计", - dataIndex: "addUpAccumulationFundTotal", - key: "addUpAccumulationFundTotal" - }, - { - title: "累计子女教育", - dataIndex: "addUpChildEducation", - key: "addUpChildEducation" - }, - { - title: "累计继续教育", - dataIndex: "addUpContinuingEducation", - key: "addUpContinuingEducation" - }, - { - title: "累计住房贷款利息", - dataIndex: "addUpHousingLoanInterest", - key: "addUpHousingLoanInterest" - }, - { - title: "累计住房租金", - dataIndex: "addUpHousingRent", - key: "addUpHousingRent" - }, - { - title: "累计赡养老人", - dataIndex: "addUpSupportElderly", - key: "addUpSupportElderly" - }, - { - title: "累计企业(职业)年金及其他福利", - dataIndex: "addUpEnterpriseAndOther", - key: "addUpEnterpriseAndOther" - }, - { - title: "累计其他免税扣除", - dataIndex: "addUpOtherDeduction", - key: "addUpOtherDeduction" - }, - { - title: "累计免税收入", - dataIndex: "addUpTaxExemptIncome", - key: "addUpTaxExemptIncome" - }, - { - title: "累计准予扣除的捐赠额", - dataIndex: "addUpAllowedDonation", - key: "addUpAllowedDonation" - }, - { - title: "累计减免税额", - dataIndex: "addUpTaxSavings", - key: "addUpTaxSavings" - }, - { - title: "累计已预扣预缴税额", - dataIndex: "addUpAdvanceTax", - key: "addUpAdvanceTax" - }, - { - title: "累计婴幼儿照护", - dataIndex: "addUpInfantCare", - key: "addUpInfantCare" - }, - { - title: "累计大病医疗", - dataIndex: "addUpIllnessMedical", - key: "addUpIllnessMedical" - } - -]; - - -export const dataSource = []; - export const dataCollectCondition = [ { items: [ @@ -404,7 +7,7 @@ export const dataCollectCondition = [ fieldcol: 12, label: "税款所属期", lanId: 542240, - labelcol: 4, + labelcol: 8, value: "", rules: "required|string", viewAttr: 3 @@ -414,7 +17,7 @@ export const dataCollectCondition = [ domkey: ["taxAgentId"], fieldcol: 12, label: "个税扣缴义务人", - labelcol: 4, + labelcol: 8, lanId: 537996, value: "", options: [], @@ -448,7 +51,7 @@ export const dataCollectCondition = [ isQuickSearch: false, label: "人员", lanId: 30042, - labelcol: 4, + labelcol: 8, rules: "required", viewAttr: 3 } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index 5f85ee0f..f6590053 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -346,7 +346,7 @@ class Index extends Component { ...slidePayload, visible: false, title: "", - chidren: null, + children: null, data: {} } }); diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js index 8ae68eee..c86da196 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/columns.js @@ -1,70 +1,3 @@ -export const columns = [ - { - title: "姓名", - dataIndex: "title", - key: "title" - }, - { - title: "个税扣缴义务人", - dataIndex: "title", - key: "title" - }, - { - title: "部门", - dataIndex: "title", - key: "title" - }, - { - title: "手机号", - dataIndex: "title", - key: "title" - }, - { - title: "工号", - dataIndex: "title", - key: "title" - }, - { - title: "证件号码", - dataIndex: "title", - key: "title" - }, - { - title: "入职日期", - dataIndex: "title", - key: "title" - }, - { - title: "累计子女教育", - dataIndex: "title", - key: "title" - }, - { - title: "累计继续教育", - dataIndex: "title", - key: "title" - }, - { - title: "累计住房贷款利息", - dataIndex: "title", - key: "title" - }, - { - title: "累计住房租金", - dataIndex: "title", - key: "title" - }, - { - title: "累计赡养老人", - dataIndex: "title", - key: "title" - }, - { - title: "操作", - dataIndex: "title", - key: "title" - } -]; export const dataCollectCondition = [ { items: [ @@ -74,7 +7,7 @@ export const dataCollectCondition = [ fieldcol: 12, label: "税款所属期", lanId: 542240, - labelcol: 4, + labelcol: 8, value: "", rules: "required|string", viewAttr: 3 @@ -84,7 +17,7 @@ export const dataCollectCondition = [ domkey: ["taxAgentId"], fieldcol: 12, label: "个税扣缴义务人", - labelcol: 4, + labelcol: 8, lanId: 537996, value: "", options: [], @@ -133,7 +66,7 @@ export const dataCollectCondition = [ isQuickSearch: false, label: "人员", lanId: 30042, - labelcol: 4, + labelcol: 8, rules: "required", viewAttr: 3 } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index 73bda8ff..660c148e 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -416,7 +416,7 @@ class Index extends Component { ...slidePayload, visible: false, title: "", - chidren: null, + children: null, data: {} } }); diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/dataTables.js b/pc4mobx/hrmSalary/pages/dataAcquisition/dataTables.js index e677d531..dc5d395d 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/dataTables.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/dataTables.js @@ -5,9 +5,8 @@ * Date: 2023/2/17 */ import React, { Component } from "react"; -import UnifiedTable from "../../components/UnifiedTable"; import { getTableDate } from "../../apis/cumDeduct"; -import { Menu, Popover } from "antd"; +import { Spin } from "antd"; import { WeaLocaleProvider } from "ecCom"; const getLabel = WeaLocaleProvider.getLabel; @@ -16,25 +15,53 @@ class DataTables extends Component { constructor(props) { super(props); this.state = { - loading: { - query: false - }, - dataSource: [], - columns: [], - selectedRowKeys: [], - pageInfo: { - current: 1, pageSize: 10, total: 0 - } + loading: { query: false }, dataSource: [], columns: [], selectedRowKeys: [], + pageInfo: { current: 1, pageSize: 10, total: 0 } }; } componentDidMount() { - this.getTableDate(); + window.addEventListener("message", this.handleReceive, false); } + componentWillUnmount() { + window.removeEventListener("message", this.handleReceive, false); + } + + handleReceive = async ({ data }) => { + const { type, payload: { id, params } = {} } = data; + if (type === "init") { + this.getTableDate(); + } else if (type === "turn") { + switch (id) { + case "PAGEINFO": + this.setState({ pageInfo: { ...this.state.pageInfo, ...params } }, () => this.getTableDate()); + break; + case "CHECKBOX": + const { selectedRowKeys } = params; + this.setState({ selectedRowKeys }); + break; + case "DEL": + this.props.onTableOperate({ key: "deleteSelectAddUpDeduction" }, params); + break; + case "EDIT": + this.props.onTableOperate({ key: "handleAddData" }, params); + break; + case "VIEW": + this.props.onViewDetails(params); + break; + case "log": + this.props.onTableOperate({ key: "log" }, params); + break; + default: + break; + } + } + }; + getTableDate = (extraPayload = {}) => { - const { loading, pageInfo } = this.state; - const { url, payload } = this.props; + const { loading, pageInfo, selectedRowKeys } = this.state; + const { url, payload, isSpecial } = this.props; const module = { ...pageInfo, url, ...payload, ...extraPayload, departmentIds: extraPayload.departmentIds ? extraPayload.departmentIds.split(",") : [] @@ -45,10 +72,12 @@ class DataTables extends Component { if (status) { const { columns, list: dataSource, pageNum: current, pageSize, total } = data; this.setState({ - pageInfo: { ...pageInfo, current, pageSize, total }, - dataSource, - columns - }); + pageInfo: { ...pageInfo, current, pageSize, total }, dataSource, columns + }, () => this.postMessageToChild({ + dataSource: this.state.dataSource, scrollHeight: 103, selectedRowKeys, isSpecial, + pageInfo: this.state.pageInfo, unitTableType: "dataAcquisition", + columns: this.state.columns + })); } }).catch(() => this.setState({ loading: { ...loading, query: false } })); }; @@ -59,124 +88,34 @@ class DataTables extends Component { * Date: 2023/2/20 */ handleClearRows = () => this.setState({ selectedRowKeys: [] }); + postMessageToChild = (payload = {}) => { + const i18n = { + "操作": getLabel(30585, "操作"), "编辑": getLabel(111, "编辑"), "共": getLabel(18609, "共"), + "条": getLabel(18256, "条"), "删除": getLabel(111, "删除"), "查看明细": getLabel(111, "查看明细"), + "操作日志": getLabel(545781, "操作日志") + }; + const childFrameObj = document.getElementById("unitTable"); + childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); + }; render() { - const { columns, dataSource, loading, selectedRowKeys, pageInfo } = this.state; - const { showOperateBtn, onTableOperate, onViewDetails, isSpecial = false, form } = this.props; - const rowSelection = { - selectedRowKeys, - onChange: (selectedRowKeys) => this.setState({ selectedRowKeys }) - }; - const pagination = { - ...pageInfo, - showTotal: (total) => `共 ${total} 条`, - pageSizeOptions: ["10", "20", "50", "100"], - showSizeChanger: true, - showQuickJumper: true, - onShowSizeChange: (current, pageSize) => { - this.setState({ - pageInfo: { ...pageInfo, current, pageSize } - }, () => { - this.getTableDate({ ...form.getFormParams() }); - }); - }, - onChange: (current) => { - this.setState({ - pageInfo: { ...pageInfo, current } - }, () => { - this.getTableDate({ ...form.getFormParams() }); - }); - } - }; - const getColumns = _.map(columns, item => { - const { dataIndex } = item; - if (dataIndex === "username") { - return { - ...item, - render: (text, record) => { - return window.pointerXY(e)} - title={text} - > - {text} - ; - } - }; - } else if (dataIndex === "operate") { - return { - ...item, - width: 150, - render: (text, record) => ( -
- { - !isSpecial && - - onTableOperate({ key: "handleAddData" }, record)}>编辑 - onViewDetails(record)}>查看明细 - { - showOperateBtn && - onTableOperate(e, record)}> - 删除 - {getLabel(545781, "操作日志")} -
} title=""> - - - } - - } - { - isSpecial && - - { - showOperateBtn && - - onTableOperate({ key: "handleAddData" }, record)}>编辑 - onTableOperate({ key: "deleteSelectAddUpDeduction" }, record)}>删除 - { - showOperateBtn && - onTableOperate(e, record)}> - {getLabel(545781, "操作日志")} - } title=""> - - - } - - } - - } - - ) - }; - } else { - return { - ...item, - render: (text) => { - return {text} ; - } - }; - } - }); - return ; + const { dataSource, loading } = this.state; + const dom = document.querySelector(".dataContent"); + let height = 280; + if (dataSource.length > 0 && dom) { + const tableHeight = dataSource.length * 46 + 124; + height = dom.offsetHeight > tableHeight ? tableHeight : dom.offsetHeight; + } + return (
+ +