diff --git a/pc4mobx/hrmSalary/apis/taxAgent.js b/pc4mobx/hrmSalary/apis/taxAgent.js index e5177c4d..d68e965d 100644 --- a/pc4mobx/hrmSalary/apis/taxAgent.js +++ b/pc4mobx/hrmSalary/apis/taxAgent.js @@ -12,6 +12,17 @@ export const getTaxAgentList = (params) => { body: JSON.stringify(params), }).then((res) => res.json()); }; +//同步人员范围 +export const taxAgentRangeSync = (params) => { + return fetch("/api/bs/hrmsalary/taxAgent/range/sync", { + method: "POST", + mode: "cors", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(params), + }).then((res) => res.json()); +}; // 系统管理员权限 export const getPermission = (params) => { diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/index.js b/pc4mobx/hrmSalary/pages/calculateDetail/index.js index d59b9429..53550cee 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/index.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/index.js @@ -3,11 +3,13 @@ import UserSure from "./userSure"; import { inject, observer } from "mobx-react"; import SalaryDetail from "./salaryDetail"; import { Button, Dropdown, Menu, message, Modal } from "antd"; -import { WeaBrowser, WeaCheckbox, WeaFormItem, WeaInput, WeaSearchGroup, WeaSelect, WeaTab } from "ecCom"; +import { WeaBrowser, WeaCheckbox, WeaDropdown, WeaFormItem, WeaInput, WeaSearchGroup, WeaSelect, WeaTab } from "ecCom"; import { getQueryString } from "../../util/url"; import AcctResultImportModal from "./acctResult/importModal/acctResultImportModal"; import ProgressModal from "../../components/progressModal"; +const { ButtonSelect } = WeaDropdown; + @inject("calculateStore", "salaryFileStore") @observer export default class CalculateDetail extends React.Component { @@ -27,7 +29,8 @@ export default class CalculateDetail extends React.Component { fieldData: {}, acctResultImportVisiable: false, progressVisible: false, - progress: 0 + progress: 0, + accountIds: [] }; this.id = ""; this.timer; @@ -100,8 +103,8 @@ export default class CalculateDetail extends React.Component { this.setState({ searchItemsValue: { ...this.state.searchItemsValue, [key]: val } })}/> @@ -126,19 +129,23 @@ export default class CalculateDetail extends React.Component { }; // 核算点击事件 - handleAccount() { + handleAccount = (key) => { const { calculateStore } = this.props; - const { - acctresultAccounting, - acctResultList, - getCalculateProgress - } = calculateStore; + const { acctresultAccounting, getCalculateProgress } = calculateStore; + if (key === "SELECT" && _.isEmpty(this.state.accountIds)) { + message.warning("请先选择表格数据"); + return; + } Modal.confirm({ title: "信息确认", content: "点击核算,公式项将按照公式逻辑核算,核算结果将覆盖原数据", onOk: () => { this.setState({ progress: 0 }); - acctresultAccounting(this.id).then(() => { + let payload = { salaryAcctRecordId: this.id }; + if (key === "SELECT") { + payload = _.assign(payload, { employeeIds: this.state.accountIds }); + } + acctresultAccounting(payload).then(() => { this.setState({ progressVisible: true }); @@ -152,7 +159,8 @@ export default class CalculateDetail extends React.Component { clearInterval(this.timer); this.timer = null; this.setState({ - progressVisible: false + progressVisible: false, + accountIds: [] }); message.success("核算完成"); // acctResultList({ salaryAcctRecordId: this.id }); @@ -163,7 +171,7 @@ export default class CalculateDetail extends React.Component { listType: "", url: "/api/bs/hrmsalary/salaryacct/acctresult/list", queryParams: { - salaryAcctRecordId, + salaryAcctRecordId } }; childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); @@ -171,7 +179,8 @@ export default class CalculateDetail extends React.Component { clearInterval(this.timer); this.timer = null; this.setState({ - progressVisible: false + progressVisible: false, + accountIds: [] }); message.error(data.message); } @@ -183,7 +192,7 @@ export default class CalculateDetail extends React.Component { onCancel() { } }); - } + }; // 更多选项点击 handleMenuClick = e => { @@ -199,7 +208,7 @@ export default class CalculateDetail extends React.Component { ); } else if (e.key == "3") { window.open( - '/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=' + this.id +"&ids=" + "/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=" + this.id + "&ids=" ); } }; @@ -223,7 +232,7 @@ export default class CalculateDetail extends React.Component { url: "/api/bs/hrmsalary/salaryacct/acctresult/list", queryParams: { salaryAcctRecordId, - ...params, + ...params } }; childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); @@ -248,11 +257,19 @@ export default class CalculateDetail extends React.Component { const renderRightOperation = () => { return [ - , + this.handleAccount(key)} + />, + // , 更多 @@ -333,7 +350,8 @@ export default class CalculateDetail extends React.Component { searchsBaseValue={this.state.searchItemsValue.employeeName} // 外部input搜索值受控: 这里和高级搜索的requestname同步form.getFormParams().username /> {selectedKey == 0 && } - {selectedKey == 1 && } + {selectedKey == 1 && this.setState({ accountIds: ids })} + employeeName={this.state.searchValue}/>} {acctResultImportVisiable && `共 ${total} 条`, showSizeChanger: true, onShowSizeChange(current, pageSize) { setSlidePageObj({ ...slidePageObj, current, pageSize }); + getCumDeductDetailList(currentRecord.id, { + ...slidePageObj, + current, + pageSize, + declareMonth: _.filter(declareMonth, item => item) + }); }, onChange(current) { setSlidePageObj({ @@ -114,6 +119,10 @@ export default class EditSlideContent extends React.Component { current, pageSize: slidePageObj.pageSize }); + getCumDeductDetailList(currentRecord.id, { + ...slidePageObj, current, + declareMonth: _.filter(declareMonth, item => item) + }); } }; const newColumns = _.map([...slideColumns], (item) => ({ ...item })); @@ -169,19 +178,6 @@ export default class EditSlideContent extends React.Component { - {/**/} - {/* 个税扣缴义务人*/} - {/* {*/} - {/* this.setState({ taxAgentId: v });*/} - {/* this.handleFetchCumDeductDetailList(startDate, endDate, v);*/} - {/* }}*/} - {/* />*/} - {/**/}
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/editSlideContent.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/editSlideContent.js index 0c374c99..fc9b430a 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/editSlideContent.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/editSlideContent.js @@ -86,12 +86,10 @@ export default class EditSlideContent extends React.Component { }; render() { - const { - taxAgentStore: { taxAgentOption } - } = this.props; const { cumSituationStore } = this.props; + const { startDate, endDate, taxAgentId } = this.state; const { - slideTableStore, + getCumDeductDetailList, currentRecord, slideColumns, slidePageObj, @@ -99,14 +97,22 @@ export default class EditSlideContent extends React.Component { setSlidePageObj, slideLoading } = cumSituationStore; - const { startDate, endDate, taxAgentId } = this.state; + const declareMonth = [startDate, endDate]; const pagination = { + current: slidePageObj.current, + pageSize: slidePageObj.pageSize, total: slidePageObj.total, showTotal: (total) => `共 ${total} 条`, showSizeChanger: true, onShowSizeChange(current, pageSize) { setSlidePageObj({ ...slidePageObj, current, pageSize }); + getCumDeductDetailList(currentRecord.id, { + ...slidePageObj, + current, + pageSize, + declareMonth: _.filter(declareMonth, item => item) + }); }, onChange(current) { setSlidePageObj({ @@ -114,6 +120,12 @@ export default class EditSlideContent extends React.Component { current, pageSize: slidePageObj.pageSize }); + getCumDeductDetailList(currentRecord.id, { + ...slidePageObj, + current, + pageSize, + declareMonth: _.filter(declareMonth, item => item) + }); } }; const newColumns = _.map([...slideColumns], (item) => ({ ...item })); @@ -170,22 +182,6 @@ export default class EditSlideContent extends React.Component {
- {/**/} - {/* 个税扣缴义务人*/} - {/* {*/} - {/* this.setState({ taxAgentId: v });*/} - {/* this.fetchCumDeductDetailList({*/} - {/* declareMonth: [startDate, endDate],*/} - {/* taxAgentId: v,*/} - {/* });*/} - {/* }}*/} - {/* />*/} - {/**/}
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/editSlideContent.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/editSlideContent.js index 3079fa7b..6f464d9e 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/editSlideContent.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/editSlideContent.js @@ -92,12 +92,9 @@ export default class EditSlideContent extends React.Component { }; render() { - const { - taxAgentStore: { taxAgentOption }, - } = this.props; const { otherDeductStore } = this.props; const { - slideTableStore, + getOtherDeductDetailList, currentRecord, slideColumns, slidePageObj, @@ -106,13 +103,22 @@ export default class EditSlideContent extends React.Component { slideLoading, } = otherDeductStore; const { startDate, endDate, taxAgentId } = this.state; + const declareMonth = [startDate, endDate]; const pagination = { + current: slidePageObj.current, + pageSize: slidePageObj.pageSize, total: slidePageObj.total, showTotal: (total) => `共 ${total} 条`, showSizeChanger: true, onShowSizeChange(current, pageSize) { setSlidePageObj({ ...slidePageObj, current, pageSize }); + getOtherDeductDetailList(currentRecord.id, { + ...slidePageObj, + current, + pageSize, + declareMonth: _.filter(declareMonth, item => item) + }); }, onChange(current) { setSlidePageObj({ @@ -120,6 +126,11 @@ export default class EditSlideContent extends React.Component { current, pageSize: slidePageObj.pageSize, }); + getOtherDeductDetailList(currentRecord.id, { + ...slidePageObj, + current, + declareMonth: _.filter(declareMonth, item => item) + }); }, }; const newColumns = _.map([...slideColumns], (item) => ({ ...item })); diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/index.js index faef8b8c..2d87d3da 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/index.js @@ -487,7 +487,7 @@ class Index extends Component { ...item, width: item.oldWidth, render: (text) => { - return {text} + return {text}; } }; }); @@ -541,7 +541,8 @@ class Index extends Component { let arrList = []; if (showOperateBtn && isShow === "true" && selectedKey === "fixed") { arrList.push(); } if (showOperateBtn && selectedKey === "fixed") { diff --git a/pc4mobx/hrmSalary/pages/taxAgent/index.js b/pc4mobx/hrmSalary/pages/taxAgent/index.js index d599b779..66e84489 100644 --- a/pc4mobx/hrmSalary/pages/taxAgent/index.js +++ b/pc4mobx/hrmSalary/pages/taxAgent/index.js @@ -1,7 +1,7 @@ import React from "react"; import { inject, observer } from "mobx-react"; -import { Col, message, Modal, Row, Switch } from "antd"; -import { WeaFormItem, WeaRightMenu, WeaSearchGroup, WeaTable, WeaTop } from "ecCom"; +import { Button, Col, message, Modal, Row, Switch } from "antd"; +import { WeaFormItem, WeaRightMenu, WeaSearchGroup, WeaTable, WeaTop, WeaInputSearch } from "ecCom"; import { renderNoright } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中 import EditModal from "./editModal"; import TipLabel from "../../components/TipLabel"; @@ -14,6 +14,7 @@ export default class TaxAgent extends React.Component { constructor(props) { super(props); this.state = { + name: '', editModalProps: { title: "新增个税扣缴义务人", visible: false, @@ -28,7 +29,8 @@ export default class TaxAgent extends React.Component { devolutionStatus: 0, conditions: editConditions, decentralizationConditions: decentralizationConditions, - permission: {} + permission: {}, + syncLoading: false }; } @@ -120,7 +122,7 @@ export default class TaxAgent extends React.Component { this.setState( { conditions: [{ defaultshow: true, items: conditionMap }], - decentralizationConditions: [{ defaultshow: true, items: conditionMap }], + decentralizationConditions: [{ defaultshow: true, items: conditionMap }] }, () => { devolutionStatus === 1 ? getCondition(this.state.conditions) : getFormDecentralizationCondition(this.state.decentralizationConditions); @@ -268,6 +270,19 @@ export default class TaxAgent extends React.Component { } }); }; + taxAgentRangeSync = () => { + const { taxAgentStore } = this.props; + const { taxAgentRangeSync, getTaxAgentList } = taxAgentStore; + this.setState({ syncLoading: true }); + taxAgentRangeSync({}).then(({ status, data }) => { + this.setState({ syncLoading: false }); + if (status) { + message.success(data || "操作成功"); + getTaxAgentList(); + } + }); + }; + render() { const { taxAgentStore } = this.props; @@ -277,7 +292,9 @@ export default class TaxAgent extends React.Component { devolutionStatus, conditions, decentralizationConditions, - permission + permission, + syncLoading, + name } = this.state; const { loading, @@ -285,7 +302,8 @@ export default class TaxAgent extends React.Component { dataSource, columns, doInit, - hasRight + hasRight, + getTaxAgentList } = taxAgentStore; if (!hasRight && !loading) { @@ -293,6 +311,16 @@ export default class TaxAgent extends React.Component { return renderNoright(); } + const btns = [ + , + this.setState({ name })} + onSearch={() => getTaxAgentList({name})} + /> + ]; const renderTipsLabel = () => { const tipList = [ "1、个税扣缴义务人与档案中的个税扣缴义务人匹配,修改个税扣缴义务人名称,薪资档案的个税扣缴义务人数据同步更新;", @@ -376,6 +404,7 @@ export default class TaxAgent extends React.Component { title="个税扣缴义务人" // 文字 icon={} // 左侧图标 iconBgcolor="#F14A2D" // 左侧图标背景色 + buttons={btns} showDropIcon={true}> { + return new Promise((resolve, reject) => { API.acctResultList({ ...params }).then(res => { if (res.status) { let list = res.data.pageInfo.list ? res.data.pageInfo.list : []; @@ -366,11 +366,10 @@ export class calculateStore { // 核算结果--薪资核算 @action - acctresultAccounting = (salaryAcctRecordId) => { + acctresultAccounting = (params) => { return new Promise((resolve, reject) => { - API.acctresultAccounting({ salaryAcctRecordId }).then(res => { + API.acctresultAccounting(params).then(res => { if (res.status) { - // message.success("核算成功") resolve(); } else { message.error(res.errormsg || "核算失败"); @@ -449,7 +448,7 @@ export class calculateStore { message.error(res.errormsg || "归档失败"); reject(res); } - }) + }); }); }; @@ -662,6 +661,6 @@ export class calculateStore { @action("更新薪资核算结果的锁定状态") updateLockStatus = (params) => { - return API.updateLockStatus(params) + return API.updateLockStatus(params); }; } diff --git a/pc4mobx/hrmSalary/stores/cumDeduct.js b/pc4mobx/hrmSalary/stores/cumDeduct.js index b276dd0b..44b46552 100644 --- a/pc4mobx/hrmSalary/stores/cumDeduct.js +++ b/pc4mobx/hrmSalary/stores/cumDeduct.js @@ -191,7 +191,7 @@ export class CumDeductStore { pageSize }); } else { - this.setSlideTableDataSource(list); + this.setSlideTableDataSource([]); this.setSlidePageObj({ ...this.slidePageObj, total: 0 diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index 3a042247..3624a583 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -4,7 +4,6 @@ import { WeaForm, WeaTableNew } from "comsMobx"; import * as API from "../apis/taxAgent"; // 引入API接口文件 import { decentralizationConditions, editConditions } from "../pages/taxAgent/editConditions"; -import { hasIconInTax } from "../apis/taxAgent"; const { TableStore } = WeaTableNew; @@ -85,6 +84,11 @@ export class TaxAgentStore { @action setShowSearchAd = bool => (this.showSearchAd = bool); + @action("同步人员范围") + taxAgentRangeSync = params => { + return API.taxAgentRangeSync(params); + }; + // 高级搜索 - 搜索 @action doSearch = name => {