From c9cda1fdfc9f706412ce137a863b284897c0ea1a Mon Sep 17 00:00:00 2001 From: MustangDeng <670124965@qq.com> Date: Thu, 2 Jun 2022 13:51:45 +0800 Subject: [PATCH] =?UTF-8?q?bug=20=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/components/customTab/index.js | 2 +- pc4mobx/hrmSalary/index.js | 2 +- pc4mobx/hrmSalary/pages/calculate/index.js | 12 ++++--- .../pages/dataAcquisition/cumDeduct/index.js | 2 +- .../dataAcquisition/cumSituation/index.js | 2 +- .../dataAcquisition/otherDeduct/index.js | 2 +- pc4mobx/hrmSalary/pages/declare/index.js | 18 +++++++--- .../hrmSalary/pages/ledger/salaryItemForm.js | 4 +-- .../pages/ledger/step3/canMoveItem.js | 2 +- .../pages/payroll/payrollDetail/index.js | 34 ++++++++++++++++--- .../socialSecurityBenefits/archives/index.js | 3 +- .../standingBook/index.js | 4 +-- pc4mobx/hrmSalary/single.js | 31 ++++++++++------- pc4mobx/hrmSalary/stores/archives.js | 8 ++--- pc4mobx/hrmSalary/stores/payroll.js | 9 +++-- 15 files changed, 92 insertions(+), 43 deletions(-) diff --git a/pc4mobx/hrmSalary/components/customTab/index.js b/pc4mobx/hrmSalary/components/customTab/index.js index a55d410a..07a742e2 100644 --- a/pc4mobx/hrmSalary/components/customTab/index.js +++ b/pc4mobx/hrmSalary/components/customTab/index.js @@ -6,7 +6,7 @@ export default class CustomTab extends React.Component { constructor(props) { super(props); this.state = { - selectedKey: "" + selectedKey: "0" } } render() { diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 58b6124a..806319b1 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -61,7 +61,7 @@ const DataAcquisition = (props) => props.children; // placeOnFileDetail 核算归档详情 // compareDetail 线下线上对比 // payroll 工资单发放 -// declare 个税申请表 +// declare 个税申报表 // generateDeclarationDetail 个税单详情 // taxRate 个税税率表 // taxAgent 个税扣缴义务人 diff --git a/pc4mobx/hrmSalary/pages/calculate/index.js b/pc4mobx/hrmSalary/pages/calculate/index.js index ea1d984c..a40a19da 100644 --- a/pc4mobx/hrmSalary/pages/calculate/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/index.js @@ -26,8 +26,8 @@ export default class Calculate extends React.Component { value: "", selectedKey: "0", searchValue: "", - startDate: moment(new Date()).format("YYYY-MM"), - endDate: moment(new Date()).format("YYYY-MM"), + startDate: moment(new Date()).subtract(3,'months').startOf('month').format('YYYY-MM'), + endDate: moment(new Date()).subtract(-3,'months').startOf('month').format('YYYY-MM'), current: 1, columns: columns.map(item => { if(item.dataIndex == 'cz') { @@ -49,8 +49,8 @@ export default class Calculate extends React.Component { const { getSalaryAcctList } = calculateStore getSalaryAcctList({ name: "", - startMonthStr: moment(new Date()).format("YYYY-MM"), - endMonthStr: moment(new Date()).format("YYYY-MM") + startMonthStr: this.state.startDate, + endMonthStr: this.state.endDate }) } @@ -170,6 +170,8 @@ export default class Calculate extends React.Component { // 分页 handleDataPageChange(value) { this.setState({current: value}) + const { calculateStore } = this.props; + const { getSalaryAcctList } = calculateStore getSalaryAcctList({ name: this.state.searchValue, startMonthStr: this.state.startDate, @@ -225,7 +227,7 @@ export default class Calculate extends React.Component { onClick={() => {this.setState({baseFormVisible: true})}} >核算
- this.handleRangePickerChange(value)} />
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index be624ed6..f2ca818f 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -35,7 +35,7 @@ export default class CumDeduct extends React.Component { value: "", selectedKey: "0", visiable: false, - monthValue: moment(new Date()).format("YYYY-MM"), + monthValue: "", taxAgentId: "", datetime: "", inited: false, diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index e62b8156..cf26e00e 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -36,7 +36,7 @@ export default class CumSituation extends React.Component { selectedKey: "0", visiable: false, inited: false, - monthValue: moment(new Date()).format("YYYY-MM"), + monthValue: "", taxAgentId: "", modalParam: { taxYearMonth: "", diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js index 79421de4..270cd2cd 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js @@ -35,7 +35,7 @@ export default class OtherDeduct extends React.Component { value: "", selectedKey: "0", visiable: false, - monthValue: moment(new Date()).format("YYYY-MM"), + monthValue: "", taxAgentId: "", inited: false, modalParam: { diff --git a/pc4mobx/hrmSalary/pages/declare/index.js b/pc4mobx/hrmSalary/pages/declare/index.js index cd86ec73..cc4559d8 100644 --- a/pc4mobx/hrmSalary/pages/declare/index.js +++ b/pc4mobx/hrmSalary/pages/declare/index.js @@ -26,8 +26,8 @@ export default class Declare extends React.Component { value: "", selectedKey: "0", declarationModalVisible: false, - startDate: moment(new Date()).format("YYYY-MM"), - endDate: moment(new Date()).format("YYYY-MM") + startDate: moment(new Date()).subtract(3,'months').startOf('month').format('YYYY-MM'), + endDate: moment(new Date()).subtract(-3,'months').startOf('month').format('YYYY-MM') } this.searchParams = {current: 1} columns.map(item => { @@ -61,7 +61,8 @@ export default class Declare extends React.Component { }) getDeclareList({ fromSalaryMonthStr: range[0], - endSalaryMonthStr: range[1] + endSalaryMonthStr: range[1], + current: 1 }) } @@ -95,7 +96,13 @@ export default class Declare extends React.Component { handleDataPageChange(value) { - + const { declareStore : {getDeclareList} } = this.props; + this.searchParams = { + fromSalaryMonthStr: this.state.startDate, + endSalaryMonthStr: this.state.endDate, + current: value + } + getDeclareList(this.searchParams) } @@ -131,7 +138,7 @@ export default class Declare extends React.Component { ]; const topTab = [ - ]; + ]; const renderRightOperation = () => { return
@@ -140,6 +147,7 @@ export default class Declare extends React.Component { defaultValue={[this.state.startDate, this.state.endDate]} onChange={(value) => this.handleRangePickerChange(value)} /> + diff --git a/pc4mobx/hrmSalary/pages/ledger/salaryItemForm.js b/pc4mobx/hrmSalary/pages/ledger/salaryItemForm.js index 0b583f47..6ab00d6e 100644 --- a/pc4mobx/hrmSalary/pages/ledger/salaryItemForm.js +++ b/pc4mobx/hrmSalary/pages/ledger/salaryItemForm.js @@ -92,9 +92,9 @@ export default class SalaryItemForm extends React.Component {
-
+ {/*
-
+
*/}
diff --git a/pc4mobx/hrmSalary/pages/ledger/step3/canMoveItem.js b/pc4mobx/hrmSalary/pages/ledger/step3/canMoveItem.js index 8513fb91..a2939e2c 100644 --- a/pc4mobx/hrmSalary/pages/ledger/step3/canMoveItem.js +++ b/pc4mobx/hrmSalary/pages/ledger/step3/canMoveItem.js @@ -164,7 +164,7 @@ export default class CanMoveItem extends React.Component { dataSource={this.props.dataSource} columns={this.state.columns} pagination={false} - onDrop={this.handleTableDrop} + onDrop={(datas) => this.handleTableDrop(datas)} draggable={true}/> } { diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollDetail/index.js b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/index.js index 7548f5e5..49bc837c 100644 --- a/pc4mobx/hrmSalary/pages/payroll/payrollDetail/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/index.js @@ -15,7 +15,8 @@ export default class PayrollDetail extends React.Component { constructor(props) { super(props); this.state = { - currentId: "" + currentId: "", + current: 1 } } @@ -111,11 +112,25 @@ export default class PayrollDetail extends React.Component { return ( {this.handleExportAll()}}>导出全部 ) + // return (
) } + + // 分页 + handleDataPageChange(value) { + this.setState({current: value}) + const { payrollStore: {getPayrollInfo, getPayrollDetailList, getPayrollDetailSa} } = this.props; + getPayrollDetailList({salarySendId: this.state.currentId, current: value}) + } + + + handleSearch() { + const { payrollStore: {getPayrollDetailList}} = this.props; + getPayrollDetailList({salarySendId: this.state.currentId, current: this.state.current}) + } render() { const {payrollStore} = this.props; - const { setDetailListShowSearchAd, detailListShowSearchAd, getPayrollDetailList, detailListCondition, detailListConditionForm, salarySendDetailBaseInfo, salarySendDetailTableStore, salarySendDetailDataSource } = payrollStore; + const { setDetailListShowSearchAd, detailListShowSearchAd, getPayrollDetailList, detailListCondition, detailListConditionForm, salarySendDetailBaseInfo, salarySendDetailTableStore, salarySendDetailDataSource, salarySendDetailPageInfo } = payrollStore; return (
setDetailListShowSearchAd(bool)} //高级搜索面板受控 searchsAd={getSearchs(detailListConditionForm, toJS(detailListCondition), 2)} // 高级搜索内部数据 // buttonsAd={adBtn} // 高级搜索内部按钮 - onSearch={getPayrollDetailList} // 点搜索按钮时的回调 + onSearch={() => {this.handleSearch()}} // 点搜索按钮时的回调 // searchsAdQuick={this.getSearchsAdQuick()} onSearchChange={v => detailListConditionForm.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值 searchsBaseValue={detailListConditionForm.getFormParams().username} // 外部input搜索值受控: 这里和高级搜索的requestname同步 @@ -161,7 +176,18 @@ export default class PayrollDetail extends React.Component {
- + { + this.handleDataPageChange(value)}, + total: salarySendDetailPageInfo.total, + current: salarySendDetailPageInfo.pageNum, + showTotal: (total) => `共 ${total} 条`, + }} + />
) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index 821848aa..41888735 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -149,6 +149,7 @@ export default class Archives extends React.Component { } this.setState({importVisible: false, step: 0}); } + render() { const { archivesStore } = this.props; const { selectedTab, selectedRowKeys } = this.state; @@ -195,7 +196,7 @@ export default class Archives extends React.Component { const { selectedRowKeys } = this.state; console.log("selectedRowKeys:", selectedRowKeys); if(selectedRowKeys.length == 0) { - message.warning("未选择任何条目"); + message.warning("未选择任何条目", 1); return } let ids = selectedRowKeys.join(",") diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js index dacd5047..938e7433 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js @@ -26,8 +26,8 @@ export default class StandingBook extends React.Component { value: "", selectedKey: "0", tableParams: { - startTime: moment(new Date()).format("YYYY-MM"), - endTime: moment(new Date()).format("YYYY-MM"), + startTime: moment(new Date()).subtract(3,'months').startOf('month').format('YYYY-MM'), + endTime: moment(new Date()).subtract(-3,'months').startOf('month').format('YYYY-MM') }, current: 1, dialogProps: { diff --git a/pc4mobx/hrmSalary/single.js b/pc4mobx/hrmSalary/single.js index 20c3b5f6..06f68823 100644 --- a/pc4mobx/hrmSalary/single.js +++ b/pc4mobx/hrmSalary/single.js @@ -27,17 +27,24 @@ const history = syncHistoryWithStore(browserHistory, allStore.routing); const Home = props => props.children; -const Root = () => ( - - - - - - { Module.Route } - - - - -); +class Root extends React.Component { + componentWillMount() { + top.$(".ant-message").remove() + } + render() { + return ( + + + + + + { Module.Route } + + + + + ) + } +} ReactDOM.render(, document.getElementById('container')); diff --git a/pc4mobx/hrmSalary/stores/archives.js b/pc4mobx/hrmSalary/stores/archives.js index 0b764b7e..6b12044f 100644 --- a/pc4mobx/hrmSalary/stores/archives.js +++ b/pc4mobx/hrmSalary/stores/archives.js @@ -195,10 +195,10 @@ export class ArchivesStore { } API.save({welfareType, baseForm, paymentForm}).then(res => { if(res.status) { - message.success("保存成功") + message.success("保存成功", 1) this.getTableDatas() } else { - message.error(res.errormsg || "保存失败") + message.error(res.errormsg || "保存失败", 1) } }) } @@ -232,7 +232,7 @@ export class ArchivesStore { }) } else { - message.error(res.errormsg || "获取失败"); + message.error(res.errormsg || "获取失败", 1); } }) } @@ -246,7 +246,7 @@ export class ArchivesStore { this.importResult = res.data resolve(); } else { - message.error(res.errormsg || "导入失败") + message.error(res.errormsg || "导入失败", 1) reject(); } }) diff --git a/pc4mobx/hrmSalary/stores/payroll.js b/pc4mobx/hrmSalary/stores/payroll.js index 50c72d7f..ed987caf 100644 --- a/pc4mobx/hrmSalary/stores/payroll.js +++ b/pc4mobx/hrmSalary/stores/payroll.js @@ -38,6 +38,7 @@ export class payrollStore { @observable detailListConditionForm = new WeaForm(); // 详情页搜索条件 @observable detailListShowSearchAd = false; // 详情页是否展开搜索面板 @observable detailListCondition = []; // 详情页搜索条件 + @observable salarySendDetailPageInfo ={} // **** 工资单发放页 **** @observable salaryGrantDataSource = []; @@ -395,10 +396,13 @@ export class payrollStore { // 工资单-工资单发放详情列表 @action getPayrollDetailList = (params) => { + let form = this.detailListConditionForm.getFormParams() || {} + params = {...form, ...params} API.getPayrollDetailList(params).then(res => { if(res.status) { this.salarySendDetailTableStore.getDatas(res.data.dataKey.datas) this.salarySendDetailDataSource = res.data.datas + this.salarySendDetailPageInfo = res.data.pageInfo } else { message.error(res.errormsg || "获取失败") } @@ -411,8 +415,9 @@ export class payrollStore { getPayrollDetailSa = (params = {}) => { API.getPayrollDetailSa(params).then(res => { if (res.status) { // 接口请求成功/失败处理 - this.detailListCondition = res.data.condition; - this.detailListConditionForm.initFormFields(res.data.condition); // 渲染高级搜索form表单 + let condition = removePropertyCondition(res.data.condition); + this.detailListCondition = condition + this.detailListConditionForm.initFormFields(condition); // 渲染高级搜索form表单 } else { message.error(res.errormsg || '接口调用失败!') }