From 938fb94743cb42443cf53761f09ea634cbac878e Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Thu, 8 Sep 2022 17:04:36 +0800 Subject: [PATCH] =?UTF-8?q?bug=E7=9A=84=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/archive.js | 11 + pc4mobx/hrmSalary/apis/standingBook.js | 33 + pc4mobx/hrmSalary/apis/taxAgent.js | 8 + .../hrmSalary/components/importModal/index.js | 50 +- .../components/importModal/modalStep1.js | 4 + .../components/importModal/modalStep3.js | 34 +- .../importModal/acctResultImportModal.js | 136 +++-- .../importModal/selectFieldModal.js | 228 +++---- .../pages/dataAcquisition/cumDeduct/index.js | 12 +- .../hrmSalary/pages/mobilePayroll/index.js | 292 ++++----- pc4mobx/hrmSalary/pages/payroll/index.js | 5 +- .../templatePreview/computerTemplate/index.js | 169 +++--- .../pages/payroll/templatePreview/index.js | 89 ++- .../pages/payroll/templatePreview/index.less | 218 ++++--- .../templatePreview/phoneTemplate/index.js | 154 ++--- .../pages/salaryFile/changeSalaryModal.js | 565 +++++++++--------- pc4mobx/hrmSalary/pages/salaryFile/index.js | 58 +- pc4mobx/hrmSalary/pages/salaryFile/index.less | 43 +- pc4mobx/hrmSalary/pages/salaryItem/index.less | 2 +- .../pages/salaryItem/systemSalaryItemModal.js | 2 +- .../standingBookDetail/components/normal.js | 36 +- .../standingBookDetail/index.js | 43 +- pc4mobx/hrmSalary/pages/taxAgent/index.less | 22 +- .../hrmSalary/pages/taxAgent/personalScope.js | 9 +- .../pages/taxAgent/slideTaxagentUser.js | 33 +- pc4mobx/hrmSalary/stores/StandingBook.js | 69 +++ pc4mobx/hrmSalary/stores/cumDeduct.js | 19 +- pc4mobx/hrmSalary/stores/salaryFile.js | 34 +- pc4mobx/hrmSalary/stores/taxAgent.js | 21 + 29 files changed, 1422 insertions(+), 977 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/archive.js b/pc4mobx/hrmSalary/apis/archive.js index 4a568959..c2299b92 100644 --- a/pc4mobx/hrmSalary/apis/archive.js +++ b/pc4mobx/hrmSalary/apis/archive.js @@ -245,6 +245,17 @@ export const getSalaryItemAdjustBeforeValue = (params) => { body: JSON.stringify(params) }).then(res => res.json()) } +// 停薪 +export const stopSalary = (params) => { + return fetch('/api/bs/hrmsalary/salaryArchive/stopSalary', { + method: 'POST', + mode: 'cors', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(params) + }).then(res => res.json()) +} // 调整-薪资项目-通过薪资档案的薪资项目id获取薪资项目调整表单 export const getSalaryItemFormByItemId = (params) => { diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js index 06d5f8bd..323e1818 100644 --- a/pc4mobx/hrmSalary/apis/standingBook.js +++ b/pc4mobx/hrmSalary/apis/standingBook.js @@ -192,3 +192,36 @@ export const getAdminTaxAgentList = () => { {} ); } + +// 表单字段对应的接口 +export const getWelfareList = () => { + return WeaTools.callApi( + "/api/bs/hrmsalary/siaccount/getWelfareList", + "get", + {} + ); +} + +// 社保福利台账-导入预览 +export const welfarePreview = (params) => { + return fetch("/api/bs/hrmsalary/siaccount/welfare/preview", { + method: "post", + mode: "cors", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(params), + }).then((res) => res.json()); +} + +// 社保福利台账-核算数据导入 +export const importInsuranceAcctDetail = (params) => { + return fetch("/api/bs/hrmsalary/siaccount/welfare/importInsuranceAcctDetail", { + method: "post", + mode: "cors", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(params), + }).then((res) => res.json()); +} diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index 57be3815..e5177c4d 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -93,3 +93,11 @@ export const getTaxAgentSelectListAsAdmin = (params) => { params ); }; +//当前登录人是否有添加人员范围的权限 +export const hasIconInTax = (params) => { + return WeaTools.callApi( + "/api/bs/hrmsalary/sys/conf/code?code=hideIconInTax", + "GET", + params + ); +}; diff --git a/pc4mobx/hrmSalary/components/importModal/index.js b/pc4mobx/hrmSalary/components/importModal/index.js index 0adb3bcd..54b1251e 100644 --- a/pc4mobx/hrmSalary/components/importModal/index.js +++ b/pc4mobx/hrmSalary/components/importModal/index.js @@ -40,15 +40,15 @@ export default class ImportModal extends React.Component { } validateDate() { - const { params } = this.props; + // const { params } = this.props; let flag = true; try { - params && Object.keys(params).forEach((key) => { - if (!params[key] || params[key] == "") { - message.warning("请完善导入选项"); - throw new Error("请完善导入选项"); - } - }); + // params && Object.keys(params).forEach((key) => { + // if (!params[key] || params[key] == "") { + // message.warning("请完善导入选项"); + // throw new Error("请完善导入选项"); + // } + // }); } catch (e) { flag = false; } @@ -65,29 +65,40 @@ export default class ImportModal extends React.Component { } else { message.warning("请上传文件"); } - } handlePreviewDate() { const { fileId } = this.state; - const { params } = this.props; - this.props.previewImport({ - ...params, - imageId: fileId - }); + const { params, isStandingBook } = this.props; + if(!isStandingBook){ + this.props.previewImport({ + ...params, + imageId: fileId + }); + }else{ + this.props.previewImport({ + imageId: fileId + }); + } } hanleImportData() { const { fileId } = this.state; - const { params } = this.props; - this.props.importFile({ - ...params, - imageId: fileId - }); + const { params, isStandingBook } = this.props; + if(!isStandingBook){ + this.props.importFile({ + ...params, + imageId: fileId + }); + }else{ + this.props.importFile({ + imageId: String(fileId) + }); + } } render() { - const { step, slideDataSource, isInit } = this.props; + const { step, slideDataSource, isInit, isStandingBook } = this.props; return ( 1. 后缀名为xls或者xlsx;
2. 数据请勿放在合并的单元格中;
+ { + this.props.isStandingBook && + 3. 账单月份格式必须为:YYYY-MM; + } diff --git a/pc4mobx/hrmSalary/components/importModal/modalStep3.js b/pc4mobx/hrmSalary/components/importModal/modalStep3.js index 12600f8b..c836622a 100644 --- a/pc4mobx/hrmSalary/components/importModal/modalStep3.js +++ b/pc4mobx/hrmSalary/components/importModal/modalStep3.js @@ -1,6 +1,6 @@ import React from "react"; import successImg from "./success.svg"; -import { Button, Table, Spin } from "antd"; +import { Button, Spin } from "antd"; import { WeaTable } from "ecCom"; export default class ModalStep3 extends React.Component { @@ -29,24 +29,24 @@ export default class ModalStep3 extends React.Component {
{importResult.successCount === undefined ?
- - 正在导入请稍后... -
+ + 正在导入请稍后... +
:
- -
- 数据导入完成 -
-
- 已导入{" "} - - {" "}{importResult.successCount}{" "} - {" "} - 条数据,失败 - {" "}{importResult.errorCount}{" "} + +
+ 数据导入完成 +
+
+ 已导入 + + {importResult.successCount}{" "} + + 条数据,失败 + {importResult.errorCount}{" "} 条数据 -
-
} +
+ }
{ - this.handleSelectedField(); - }}>请选择表单字段; + return + + ; } // 选择表单字段 @@ -78,18 +94,27 @@ export default class AcctResultImportModal extends React.Component { // 添加表头字段 handleAdd(fieldDate) { let salaryItemIdsList = []; - fieldDate.formulaItems.map(item => { - if (item.checked) { - salaryItemIdsList.push(item.salaryItemId); - } - }); - - fieldDate.inputItems.map(item => { - if (item.checked) { - salaryItemIdsList.push(item.salaryItemId); - } - }); - + if (!_.isEmpty(fieldDate.formulaItems)) { + fieldDate.formulaItems.map(item => { + if (item.checked) { + salaryItemIdsList.push(item.salaryItemId); + } + }); + } + if (!_.isEmpty(fieldDate.inputItems)) { + fieldDate.inputItems.map(item => { + if (item.checked) { + salaryItemIdsList.push(item.salaryItemId); + } + }); + } + if (!_.isEmpty(fieldDate.sqlItems)) { + fieldDate.sqlItems.map(item => { + if (item.checked) { + salaryItemIdsList.push(item.salaryItemId); + } + }); + } let salaryItemIds = ""; if (salaryItemIdsList.length > 0) { salaryItemIds = salaryItemIdsList.join(","); @@ -110,15 +135,28 @@ export default class AcctResultImportModal extends React.Component { setPreviewAcctResultColumns, setPreviewAcctResultDataSource, setImportAcctResult - } + }, + standingBookStore: { + setPreviewStandingBookAcctResultDataSource, + setPreviewStandingBookAcctResultColumns, + setImportStandingBookAcctResult + }, + isStandingBook } = this.props; - setPreviewAcctResultColumns([]); - setPreviewAcctResultDataSource([]); - setImportAcctResult({}); + if (!isStandingBook) { + setPreviewAcctResultColumns([]); + setPreviewAcctResultDataSource([]); + setImportAcctResult({}); + } else { + setPreviewStandingBookAcctResultDataSource([]); + setPreviewStandingBookAcctResultColumns([]); + setImportStandingBookAcctResult({}); + } } render() { - const { calculateStore } = this.props; + //isStandingBook: 是否是社保福利台账核算的导入标识 + const { calculateStore, standingBookStore, isStandingBook, visiable } = this.props; const { fetchPreviewAcctResult, previewAcctResultColumns, @@ -126,29 +164,36 @@ export default class AcctResultImportModal extends React.Component { importAcctResult, fetchImportAcctResult } = calculateStore; + const { + welfarePreview, + previewStandingBookAcctResultColumns, + previewStandingBookAcctResultDataSource, + importStandingBookAcctResult, + importInsuranceAcctDetail + } = standingBookStore; const { step, selectFieldVisible, modalParam } = this.state; - const { visiable } = this.props; return (
{ visiable && { this.handleImportModalInit(); }} params={modalParam} - columns={previewAcctResultColumns} + columns={!isStandingBook ? previewAcctResultColumns : previewStandingBookAcctResultColumns} step={step} setStep={this.setStep.bind(this)} - slideDataSource={previewAcctResultDataSource} - importResult={importAcctResult} + slideDataSource={!isStandingBook ? previewAcctResultDataSource : previewStandingBookAcctResultDataSource} + importResult={!isStandingBook ? importAcctResult : importStandingBookAcctResult} onFinish={() => { this.handleFinish(); }} previewImport={(params) => { - fetchPreviewAcctResult(params); + !isStandingBook ? fetchPreviewAcctResult(params) : welfarePreview(params); }} importFile={(params) => { - fetchImportAcctResult(params); + !isStandingBook ? fetchImportAcctResult(params) : importInsuranceAcctDetail(params); }} templateLink={() => { this.handleAccResultTemplateLink(); @@ -162,6 +207,7 @@ export default class AcctResultImportModal extends React.Component { } { selectFieldVisible && { - let fieldData = {}; - let formulaItems = []; - formulaItems = data.formulaItems; - if (this.props.fieldData.formulaItems) { - formulaItems = this.props.fieldData.formulaItems; - } - let inputItems = []; - inputItems = data.inputItems; - if (this.props.fieldData.inputItems) { - inputItems = this.props.fieldData.inputItems; - } - let sqlItems = []; - sqlItems = data.sqlItems; - if (this.props.fieldData.inputItems) { - sqlItems = this.props.fieldData.sqlItems; - } - fieldData.formulaItems = formulaItems; - fieldData.inputItems = inputItems; - fieldData.sqlItems = sqlItems; + const { calculateStore: { getImportField }, standingBookStore: { getWelfareList }, isStandingBook } = this.props; + if(!isStandingBook){ + getImportField(this.props.id).then(data => { + let fieldData = {}; + let formulaItems = []; + formulaItems = data.formulaItems; + if (this.props.fieldData.formulaItems) { + formulaItems = this.props.fieldData.formulaItems; + } + let inputItems = []; + inputItems = data.inputItems; + if (this.props.fieldData.inputItems) { + inputItems = this.props.fieldData.inputItems; + } + let sqlItems = []; + sqlItems = data.sqlItems; + if (this.props.fieldData.inputItems) { + sqlItems = this.props.fieldData.sqlItems; + } + fieldData.formulaItems = formulaItems; + fieldData.inputItems = inputItems; + fieldData.sqlItems = sqlItems; - this.setState({ - fieldData + this.setState({ + fieldData + }); + this.fieldData = fieldData; }); - this.fieldData = fieldData; - }); + }else{ + getWelfareList().then(result => { + let fieldData = {}; + let formulaItems = []; + formulaItems = _.map(result, it => ({...it, salaryItemId: it.salaryItemName})); + if (this.props.fieldData.formulaItems) { + formulaItems = this.props.fieldData.formulaItems; + } + fieldData.formulaItems = formulaItems; + + this.setState({ + fieldData + }); + this.fieldData = fieldData; + }) + } } // 公式项改变 @@ -140,86 +157,95 @@ export default class SelectFieldModal extends React.Component { this.handleAddClick(); }}>添加
-
-
- { - this.handleTitleCheckboxChange(value, "formula"); - }}/> + { + !_.isEmpty(fieldData.formulaItems) && +
+
+ { + this.handleTitleCheckboxChange(value, "formula"); + }}/> +
+
+ + {fieldData.formulaItems && fieldData.formulaItems.map(item => ( + + { + this.handleFormalChange(item, value, "formula"); + }}/> + ))} + +
-
- - {fieldData.formulaItems && fieldData.formulaItems.map(item => ( - - { - this.handleFormalChange(item, value, "formula"); - }}/> - ))} - -
-
+ } -
-
- { - this.handleTitleCheckboxChange(value, "input"); - }}/> + { + !_.isEmpty(fieldData.inputItems) && +
+
+ { + this.handleTitleCheckboxChange(value, "input"); + }}/> +
+
+ + {fieldData.inputItems && fieldData.inputItems.map(item => ( + + { + this.handleFormalChange(item, value, "input"); + }}/> + ))} + +
-
- - {fieldData.inputItems && fieldData.inputItems.map(item => ( - - { - this.handleFormalChange(item, value, "input"); - }}/> - ))} - -
-
+ } -
-
- { - this.handleTitleCheckboxChange(value, "sql"); - }}/> + { + !_.isEmpty(fieldData.sqlItems) && +
+
+ { + this.handleTitleCheckboxChange(value, "sql"); + }}/> +
+
+ + {fieldData.sqlItems && fieldData.sqlItems.map(item => ( + + { + this.handleFormalChange(item, value, "sql"); + }}/> + ))} + +
-
- - {fieldData.sqlItems && fieldData.sqlItems.map(item => ( - - { - this.handleFormalChange(item, value, "sql"); - }}/> - ))} - -
-
+ }
{ diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index 289193bf..e723b238 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -1,7 +1,7 @@ import React from "react"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; -import { Button, Col, DatePicker, Dropdown, Menu, message, Row } from "antd"; +import { Button, Col, Dropdown, Menu, message, Row } from "antd"; import { WeaDatePicker, WeaHelpfulTip, WeaRightMenu, WeaSelect, WeaSlideModal, WeaTab, WeaTable, WeaTop } from "ecCom"; import moment from "moment"; import { getSearchs, renderNoright } from "../../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 @@ -13,8 +13,6 @@ import "./index.less"; import SlideModalTitle from "../../../components/slideModalTitle"; import EditSlideContent from "./editSlideContent"; -const { MonthPicker } = DatePicker; - @inject("cumDeductStore", "taxAgentStore") @observer export default class CumDeduct extends React.Component { @@ -172,7 +170,7 @@ export default class CumDeduct extends React.Component { } = this.props; setSlideVisiable(true); setCurrentRecord(record); - getCumDeductDetailList(record.id,{taxAgentId:record.taxAgentId}); + getCumDeductDetailList(record.id, { taxAgentId: record.taxAgentId }); }; // 增加编辑功能,重写columns绑定事件 @@ -316,7 +314,7 @@ export default class CumDeduct extends React.Component { ]; const adBtn = [ // 高级搜索内部按钮 - , } - > -
- - - 生效日期 - - - { -this.handleChange({ effectiveTime: value }) -}} - /> - - - - - 调整原因 - - - {/* { - this.state.inited && {this.handleChange({ adjustReason: value })}} - /> - } */} - - - - - - - 说明 - - - - { -this.handleChange({description: value}) -}} - /> - - -
- -
-
- 调薪明细 -
- { -this.handleRemoveClick() -}}/> - { -this.handleAddItemClick() -}}/> -
-
- -
- { - this.state.inited && - } -
-
- - - ) + // 添加按钮点击回调 + handleAddItemClick() { + const { salaryArchiveItems } = this.state; + let result = [...salaryArchiveItems]; + let lastKey = "1"; + if (result.length > 0) { + lastKey = parseInt(result[result.length - 1].key) + 1; } -} \ No newline at end of file + result.push({ + key: lastKey + "", + salaryItem: "", + adjustBefore: "", + adjustAfter: "" + }); + + this.setState({ + salaryArchiveItems: result + }); + } + + componentWillMount() { + const { + salaryFileStore: { salaryItemChangeForm, getSalaryItemForm, getSalaryItemFormByItemId }, + currentId, + recordId + } = this.props; + if (recordId) { + getSalaryItemFormByItemId(recordId).then(data => { + let request = { ...this.state.request }; + request.effectiveTime = data.effectiveTime; + request.adjustReason = data.adjustReason; + request.description = data.description; + this.setState({ + salaryArchiveItems: data.dataSource, + inited: true, + request + }); + }); + } else { + getSalaryItemForm(currentId).then(() => { + this.setState({ + inited: true + }); + }); + } + } + + // 保存 + handleSave() { + const { salaryFileStore: { saveSalaryItem, fetchSingleSalaryItemList, getArchiveForm } } = this.props; + let saveRequest = { ...this.state.request }; + const { salaryArchiveItems } = this.state; + if (salaryArchiveItems.length === 0) { + message.warning("请添加调薪明细"); + return; + } + saveRequest.salaryArchiveItems = salaryArchiveItems.map(item => { + let result = {}; + result.salaryItemId = item.salaryItem; + result.adjustValue = item.adjustAfter; + return result; + }); + saveSalaryItem(saveRequest).then(() => { + getArchiveForm(this.props.currentId); + fetchSingleSalaryItemList({ salaryArchiveId: this.props.currentId }); + this.props.onCancel(); + }); + } + + onSelectChange = selectedRowKeys => { + this.setState({ selectedRowKeys }); + }; + + // 批量删除回调 + handleRemoveClick = () => { + const { selectedRowKeys, salaryArchiveItems } = this.state; + let result = [...salaryArchiveItems]; + if (selectedRowKeys.length === 0) { + message.warning("未选择条目"); + } + + this.setState({ + salaryArchiveItems: result.filter(item => selectedRowKeys.indexOf(item.key) < 0) + }); + }; + + render() { + const { salaryFileStore: { salaryItemChangeForm } } = this.props; + const { request, salaryArchiveItems, selectedRowKeys } = this.state; + const { effectiveTime, adjustReason, description } = request; + + const rowSelection = { + selectedRowKeys, + onChange: this.onSelectChange + }; + return ( + { + this.props.onCancel(); + }} + buttons={[]} + > +
+
+ + + 生效日期 + + + { + this.handleChange({ effectiveTime: value }); + }} + /> + + + + + 调整原因 + + + + + + + + 说明 + + + + { + this.handleChange({ description: value }); + }} + /> + + +
+
+
+ 调薪明细 +
+ + +
+
+ +
+ { + this.state.inited && + + } +
+
+
+
+ ); + } +} diff --git a/pc4mobx/hrmSalary/pages/salaryFile/index.js b/pc4mobx/hrmSalary/pages/salaryFile/index.js index 047b398d..0a57dc82 100644 --- a/pc4mobx/hrmSalary/pages/salaryFile/index.js +++ b/pc4mobx/hrmSalary/pages/salaryFile/index.js @@ -5,6 +5,7 @@ import { Button, Dropdown, Menu, message, Modal } from "antd"; import { WeaBrowser, WeaCheckbox, + WeaDatePicker, WeaFormItem, WeaHelpfulTip, WeaInput, @@ -57,7 +58,8 @@ export default class SalaryFile extends React.Component { archiveStatus: "EFFICIENT", taxAgentId: "", subcompanyIds: "" - } + }, + noPayDate: "" //最后停薪日期 }; this.pageInfo = { current: 1, pageSize: 10 }; } @@ -230,13 +232,35 @@ export default class SalaryFile extends React.Component { setCurrentId(record.id); } - // 显示调整个税扣缴义务人表单 - handSildeOptionMenuClick(e) { + // 停薪 + handleNoPay = () => { const { - salaryFileStore: { setEditAgentVisible } + salaryFileStore: { stopSalary, getTableDatas } } = this.props; - setEditAgentVisible(true); - } + Modal.confirm({ + title: "停薪确认", + content: + this.setState({ noPayDate })} + /> + , + width: 516, + onOk: () => { + stopSalary(this.state.noPayDate).then(()=>{ + getTableDatas({ ...this.state.searchItemsValue }); + }) + }, + onCancel: () => { + } + }); + }; // 查看 Slide 头部操作按钮 renderEditSlideOperate = () => { @@ -252,26 +276,14 @@ export default class SalaryFile extends React.Component { } { showOperateBtn && - } - {/*暂时去掉调整个税扣缴义务人导入按钮*/} - {/*{*/} - {/* showOperateBtn &&*/} - {/* */} - {/* 调整个税扣缴义务人*/} - {/* */} - {/* }*/} - {/* onClick={() => {*/} - {/* this.setState({ changeSalaryVisible: true });*/} - {/* }}>*/} - {/* 调薪*/} - {/* */} - {/*}*/} + { + showOperateBtn && + + }
); }; diff --git a/pc4mobx/hrmSalary/pages/salaryFile/index.less b/pc4mobx/hrmSalary/pages/salaryFile/index.less index dbb8df8f..bb87e3e8 100644 --- a/pc4mobx/hrmSalary/pages/salaryFile/index.less +++ b/pc4mobx/hrmSalary/pages/salaryFile/index.less @@ -1,12 +1,24 @@ -.changeSalaryModal { - padding: 10px 20px; +.changeSalaryWrapper { + width: 100%; + min-height: 50vh; + max-height: 60vh; + overflow-y: auto; - .itemWrapper { - line-height: 47px; + .changeSalaryModal { + padding: 10px 20px; + + .itemWrapper { + line-height: 47px; + + .ant-select-selection { + border-radius: 0 !important; + height: 30px !important; + } + } } .contentWrapper { - margin-top: 10px; + padding: 10px 20px; .contentTitleWrapper { height: 40px; @@ -15,15 +27,36 @@ .rightIconWrapper { display: inline-block; float: right; + .ant-btn{ + margin-left: 10px; + border-radius: 0; + padding: 0; + background: transparent; + border: none; + font-size: 20px; + line-height: 20px; + } + .ant-btn.ant-btn-primary[disabled]{ + color: #d8d8d8; + } + .ant-btn.ant-btn-primary{ + color: #55a1f8; + } } } .tableWrapper { margin-top: 10px; } + + .ant-select-selection { + border-radius: 0 !important; + height: 30px !important; + } } } + .salaryFileSlide { padding: 10px 20px; diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.less b/pc4mobx/hrmSalary/pages/salaryItem/index.less index 7ab8549e..5ba1b84d 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.less +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.less @@ -9,7 +9,7 @@ .formula-wrapper{ .ant-modal-body{ min-height: 200px; - max-height: 50vh; + max-height: 85vh; overflow: auto; } } diff --git a/pc4mobx/hrmSalary/pages/salaryItem/systemSalaryItemModal.js b/pc4mobx/hrmSalary/pages/salaryItem/systemSalaryItemModal.js index 9c255013..8831d317 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/systemSalaryItemModal.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/systemSalaryItemModal.js @@ -46,7 +46,7 @@ export default class SystemSalaryItemModal extends React.Component { visible={this.props.visible} onCancel={() => { this.props.onCancel(); - }} width={800} + }} width={900} >
添加系统薪资项目 diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js index b1f25c49..5cdf5def 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js @@ -12,6 +12,7 @@ import { WeaDialog, WeaInputSearch, WeaTable } from "ecCom"; import { getSearchs } from "../../../../util"; import { getQueryString } from "../../../../util/url"; import ProgressModal from "../../../../components/progressModal"; +import AcctResultImportModal from '../../../calculateDetail/acctResult/importModal/acctResultImportModal'; import _ from "lodash"; import "./index.less"; @@ -36,7 +37,11 @@ export default class NormalIndex extends Component { }, searchValue: "", progressVisible: false, - progress: 0 + progress: 0, + fieldData:{}, //选中的表单头信息 + importParams:{ //导入信息的弹框表示 + visible: false + } }; this.timer = null; } @@ -354,7 +359,7 @@ export default class NormalIndex extends Component { render() { const { remarks, billMonth, selectedKey, paymentOrganization } = this.props; - const { selectedRowKeys, addProps, date } = this.state; + const { selectedRowKeys, addProps, date, importParams } = this.state; const { loading, form, @@ -478,8 +483,33 @@ export default class NormalIndex extends Component { }} progress={this.state.progress} /> + + this.setState({importParams: {...importParams, visible: true}})}/> + + {/*导入弹框*/} + { + this.setState({ + fieldData + }); + }} + onCancel={() =>{ + this.setState({importParams: {...importParams, visible: false}},()=>{ + const { billMonth, selectedKey, paymentOrganization } = this.props; + const { current } = this.state; + selectedKey === "1" + ? this.getNormalList({ billMonth, current, paymentOrganization }) + : this.getSupplementaryList({ billMonth, current, paymentOrganization }); + }) + }} + isStandingBook + /> + - { const { tabList, remarks, billMonth } = data; - let newTabList = tabList.filter(item => item.id != "2") + let newTabList = tabList.filter(item => item.id != "2"); this.setState({ selectedKey: newTabList[0].id, tabList: _.map(newTabList, it => ({ title: it.content, viewcondition: it.id })), remarks, billMonth }); - }) - } + }); + }; render() { const { selectedKey, tabList, remarks, billMonth } = this.state; @@ -56,19 +56,20 @@ class StandingBookDetail extends Component { keyParam="viewcondition" //主键 selectedKey={selectedKey} onChange={(selectedKey) => { - this.setState({ selectedKey }) + this.setState({ selectedKey }); }} /> { - (selectedKey === '1' || selectedKey === '3') && - + (selectedKey === "1" || selectedKey === "3") && + } { - selectedKey === '2' && + selectedKey === "2" && } { - selectedKey === '4' && + selectedKey === "4" && }
diff --git a/pc4mobx/hrmSalary/pages/taxAgent/index.less b/pc4mobx/hrmSalary/pages/taxAgent/index.less index 79eb19b4..56df1d61 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/index.less +++ b/pc4mobx/hrmSalary/pages/taxAgent/index.less @@ -78,4 +78,24 @@ position: absolute; bottom: 0px; } -} \ No newline at end of file +} + +.slideWrapper{ + .slideRefereUser{ + .ant-btn{ + margin-left: 10px; + border-radius: 0; + padding: 0; + background: transparent; + border: none; + font-size: 20px; + line-height: 20px; + } + .ant-btn.ant-btn-primary[disabled]{ + color: #d8d8d8; + } + .ant-btn.ant-btn-primary{ + color: #55a1f8; + } + } +} diff --git a/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js b/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js index 2f550bb9..5fddf07a 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/personalScope.js @@ -17,8 +17,8 @@ const personScopeWarrper = { @inject("taxAgentStore", "ledgerStore") @observer export default class PersonalScope extends Component { - constructor() { - super(); + constructor(props) { + super(props); this.state = { queryLoading: false, submitLoading: false, @@ -171,13 +171,16 @@ export default class PersonalScope extends Component { submitLoading, queryLoading, } = this.state; + const { hideIconInTax, showSalaryItemBtn } = this.props.taxAgentStore; return ( -
+
(this.tagAgentRef = dom)} dataSource={dataSource} columns={columns} pageObj={pageObj} + hideIconInTax={hideIconInTax} + showSalaryItemBtn={showSalaryItemBtn} submitLoading={submitLoading} queryLoading={queryLoading} setPageObj={(params) => { diff --git a/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js b/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js index cccc4707..6281d96b 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/slideTaxagentUser.js @@ -1,5 +1,5 @@ import React from "react"; -import { Icon, Table, message } from "antd"; +import { Icon, Table, message, Button } from "antd"; import { WeaInputSearch } from "ecCom"; import AddTaxAgentModal from "./addTaxAgentModal"; @@ -71,7 +71,9 @@ export default class SlideTaxagentUser extends React.Component { setPageObj, employeeStatus, targetTypeList, - onTaxAgentSave + onTaxAgentSave, + hideIconInTax, + showSalaryItemBtn } = this.props; const rowSelection = { @@ -144,18 +146,21 @@ export default class SlideTaxagentUser extends React.Component { display: "inlineBlock", float: "left" }}> - { - this.handleTabDelete(); - }} - /> - this.setState({ addTaxagentModalVisible: true })} - /> + { + hideIconInTax && !showSalaryItemBtn && + + + + }
{ @@ -391,4 +396,68 @@ export class StandingBookStore { }) }) } + + @action("社保福利台账核算导入信息表头信息列表") + getWelfareList = () => { + return new Promise((resolve, reject) => { + API.getWelfareList().then(res => { + if(res.status) { + resolve(res.data); + } else { + message.error(res.errormsg || "接口调用失败!") + reject(); + } + }) + }) + } + + @action + setPreviewStandingBookAcctResultDataSource = previewAcctResultDataSource => { + this.previewStandingBookAcctResultDataSource = previewAcctResultDataSource; + }; + @action + setPreviewStandingBookAcctResultColumns = (previewAcctResultColumns) => { + this.previewStandingBookAcctResultColumns = previewAcctResultColumns; + }; + @action + setImportStandingBookAcctResult = importAcctResult => { + this.importStandingBookAcctResult = importAcctResult; + }; + + + @action("社保福利台账-导入预览") + welfarePreview = (params) => { + API.welfarePreview(params).then((res) => { + if (res.status) { + this.previewStandingBookAcctResultColumns = res.data.headers.map((item, index) => { + let column = {}; + column.title = item; + column.dataIndex = "" + index; + column.key = index + ""; + return column; + }); + + this.previewStandingBookAcctResultDataSource = res.data.list.map((item) => { + let data = {}; + item.map((i, index) => { + data[index + ""] = i; + }); + return data; + }); + } else { + message.error(res.errormsg || "获取失败"); + } + }); + }; + + @action("社保福利台账-核算数据导入") + importInsuranceAcctDetail = (params) => { + API.importInsuranceAcctDetail(params).then(res => { + if (res.status) { + this.importStandingBookAcctResult = res.data; + } else { + message.error(res.errormsg || "导入失败"); + } + }); + }; } diff --git a/pc4mobx/hrmSalary/stores/cumDeduct.js b/pc4mobx/hrmSalary/stores/cumDeduct.js index ab9d792d..6efa21bd 100644 --- a/pc4mobx/hrmSalary/stores/cumDeduct.js +++ b/pc4mobx/hrmSalary/stores/cumDeduct.js @@ -1,9 +1,8 @@ -import { observable, action, toJS } from "mobx"; +import { action, observable } from "mobx"; import { message } from "antd"; import { WeaForm, WeaTableNew } from "comsMobx"; import * as API from "../apis/cumDeduct"; // 引入API接口文件 -import * as TaxAgentApi from "../apis/taxAgent"; import { removePropertyCondition } from "../util/response"; const { TableStore } = WeaTableNew; @@ -108,7 +107,7 @@ export class CumDeductStore { ...requestParams, ...params, current: this.pageObj.current, - pageSize: this.pageObj.pageSize, + pageSize: this.pageObj.pageSize }; API.getCumDeductList(requestParams).then( action(({ status, data, errormsg }) => { @@ -121,13 +120,13 @@ export class CumDeductStore { this.setPageObj({ total, current, - pageSize, + pageSize }); } else { this.setDataSource([]); this.setPageObj({ ...this.pageObj, - total: 0, + total: 0 }); message.error(errormsg || "接口调用失败!"); } @@ -139,8 +138,8 @@ export class CumDeductStore { setShowSearchAd = (bool) => (this.showSearchAd = bool); // 高级搜索 - 搜索 - @action doSearch = () => { - this.getTableDatas(); + @action doSearch = (params) => { + this.getTableDatas(params); this.showSearchAd = false; }; @@ -188,13 +187,13 @@ export class CumDeductStore { this.setSlidePageObj({ total, current, - pageSize, + pageSize }); } else { this.setSlideTableDataSource(list); this.setSlidePageObj({ ...this.slidePageObj, - total: 0, + total: 0 }); message.error(errormsg || "接口调用失败!"); } @@ -203,7 +202,7 @@ export class CumDeductStore { }; // 导出明细 - @action exportCumDeductDetailList = (id, ids = "", taxAgentId="") => { + @action exportCumDeductDetailList = (id, ids = "", taxAgentId = "") => { API.exportCumDeductDetailList(id, ids, taxAgentId); }; } diff --git a/pc4mobx/hrmSalary/stores/salaryFile.js b/pc4mobx/hrmSalary/stores/salaryFile.js index 17d4b252..aeaaa57d 100644 --- a/pc4mobx/hrmSalary/stores/salaryFile.js +++ b/pc4mobx/hrmSalary/stores/salaryFile.js @@ -5,6 +5,7 @@ import moment from "moment"; import * as API from "../apis/archive"; // 引入API接口文件 import { notNull } from "../util/validate"; +import { stopSalary } from "../apis/archive"; const { TableStore } = WeaTableNew; @@ -406,7 +407,6 @@ export class salaryFileStore { } }); }); - }; validateSaveSalaryForm = (params) => { @@ -416,17 +416,17 @@ export class salaryFileStore { } if (!notNull(params.effectiveTime)) { - message.error("生效日期不能为空"); + message.warning("生效日期不能为空"); return false; } if (!notNull(params.adjustReason)) { - message.error("调整原因不能为空"); + message.warning("调整原因不能为空"); return false; } if (!params.salaryArchiveItems || params.salaryArchiveItems.length == 0) { - message.error("调整明细不能为空"); + message.warning("调整明细不能为空"); return false; } @@ -447,10 +447,11 @@ export class salaryFileStore { // 保存调薪 @action saveSalaryItem = (params) => { - if (!this.validateSaveSalaryForm(params)) { - return; - } return new Promise((resolve, reject) => { + if (!this.validateSaveSalaryForm(params)) { + reject("校验失败"); + return; + } API.saveSalaryItem(params).then(res => { if (res.status) { message.success("保存成功"); @@ -495,4 +496,23 @@ export class salaryFileStore { }); }; + + @action("停薪") + stopSalary = (payEndDateStr) => { + const payload= { + payEndDateStr, + salaryArchiveId: this.currentId + } + return new Promise((resolve, reject) => { + API.stopSalary(payload).then(res => { + if (res.status) { + message.success("操作成功"); + resolve(res); + } else { + message.error(res.errormsg || "获取失败"); + reject(); + } + }); + }); + }; } diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index 62fd814c..606cd849 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -4,6 +4,7 @@ import { WeaForm, WeaTableNew } from "comsMobx"; import * as API from "../apis/taxAgent"; // 引入API接口文件 import { editConditions } from "../pages/taxAgent/editConditions"; +import { hasIconInTax } from "../apis/taxAgent"; const { TableStore } = WeaTableNew; @@ -22,6 +23,8 @@ export class TaxAgentStore { @observable dataSource = []; //列表数据 @observable taxAgentOption = []; // 个税扣缴义务人 @observable taxAgentAdminOption = []; // 当前登录人个税扣缴义务人下拉列表项 + @observable hideIconInTax = true; // 当前登录人是否有添加人员范围的权限 + @action setModalVisiable = visiable => (this.modalVisiable = visiable); @@ -40,6 +43,7 @@ export class TaxAgentStore { doInit = params => { this.getTaxAgentList(params); this.getCondition(editConditions); + this.hasIconInTax(); }; // 获得高级搜索表单数据 @@ -197,4 +201,21 @@ export class TaxAgentStore { ); }); }; + + @action("当前登录人是否有添加人员范围的权限") + hasIconInTax = () => { + return new Promise((resolve, reject) => { + API.hasIconInTax().then( + action(res => { + if (res.status) { + this.hideIconInTax= res.data !== "true"; + resolve(res); + } else { + message.error(res.errormsg || "获取失败"); + reject(); + } + }) + ); + }); + }; }