From c5b401f9f4f51b80be12223bde4a7ce3e7de2ede Mon Sep 17 00:00:00 2001 From: MustangDeng <670124965@qq.com> Date: Tue, 31 May 2022 16:21:25 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/dataAcquisition/cumDeduct/index.js | 11 ++++++++--- .../pages/dataAcquisition/cumSituation/index.js | 7 ++++++- .../pages/dataAcquisition/otherDeduct/index.js | 7 ++++++- pc4mobx/hrmSalary/pages/ledger/salaryItemForm.js | 2 +- pc4mobx/hrmSalary/stores/ledger.js | 2 +- pc4mobx/hrmSalary/util/options.js | 10 ++++++++++ 6 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 pc4mobx/hrmSalary/util/options.js diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index f283ab35..be624ed6 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -15,6 +15,7 @@ import CustomTab from '../../../components/customTab'; import ContentWrapper from '../../../components/contentWrapper'; import ImportModal from '../../../components/importModal' import { columns, dataSource, modalColumns } from './columns'; +import { optionAddAll } from '../../../util/options' const { MonthPicker } = DatePicker; @@ -88,11 +89,16 @@ export default class CumDeduct extends React.Component { this.state.inited && { this.setState({taxAgentId: v}) - getTableDatas({taxAgentId: v, declareMonth: [monthValue]}) + if(v == "All") { + getTableDatas({taxAgentId: "", declareMonth: [monthValue]}) + } else { + getTableDatas({taxAgentId: v, declareMonth: [monthValue]}) + } + }} /> } @@ -104,7 +110,6 @@ export default class CumDeduct extends React.Component { renderFormComponent() { const { modalParam } = this.state const { taxAgentStore: {taxAgentOption} } = this.props; - let options = [...taxAgentOption] return ( diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index 80fda3d4..e62b8156 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -15,6 +15,7 @@ import CustomTab from '../../../components/customTab'; import ContentWrapper from '../../../components/contentWrapper'; import ImportModal from '../../../components/importModal' import { columns, dataSource, modalColumns } from './columns'; +import { optionAddAll } from '../../../util/options'; const { MonthPicker } = DatePicker; @@ -85,10 +86,14 @@ export default class CumSituation extends React.Component { this.state.inited && { this.setState({taxAgentId: v}) + let taxAgentId = v; + if(v == "All") { + taxAgentId = "" + } getTableDatas({ taxAgentId: v, taxYearMonth: [monthValue]}) }} /> diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js index e1958e8c..79421de4 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js @@ -23,6 +23,7 @@ import "./index.less" import SlideModalTitle from '../../../components/slideModalTitle'; import EditSlideContent from './editSlideContent'; +import { optionAddAll } from '../../../util/options'; @inject('otherDeductStore', "taxAgentStore") @@ -85,10 +86,14 @@ export default class OtherDeduct extends React.Component { this.state.inited && { this.setState({taxAgentId: v}) + let taxAgentId = v + if(v == "All") { + taxAgentId = "" + } getTableDatas({ taxAgentId: v, declareMonth: [monthValue]}) }} /> diff --git a/pc4mobx/hrmSalary/pages/ledger/salaryItemForm.js b/pc4mobx/hrmSalary/pages/ledger/salaryItemForm.js index 3c7643a6..9414cef3 100644 --- a/pc4mobx/hrmSalary/pages/ledger/salaryItemForm.js +++ b/pc4mobx/hrmSalary/pages/ledger/salaryItemForm.js @@ -118,7 +118,7 @@ export default class SalaryItemForm extends React.Component { { itemGroups && itemGroups.map(item => { if(item.items) { - item.items.map(i => {i.key = i.id}) + item.items && item.items.map(i => {i.key = i.id}) return ( {this.handleItemDataSourceChange(dataSource, item)}} title={item.name} onGroupDelete={() => {this.handleGroupDelete(item)}} onTitleChange={(value) => {this.handleItemTitleChange(item, value)}} onChange={(dataSource) => {this.handleCanMoveItemChange(dataSource, item)}}/> ) diff --git a/pc4mobx/hrmSalary/stores/ledger.js b/pc4mobx/hrmSalary/stores/ledger.js index 33279240..3d269f48 100644 --- a/pc4mobx/hrmSalary/stores/ledger.js +++ b/pc4mobx/hrmSalary/stores/ledger.js @@ -449,7 +449,7 @@ export class LedgerStore { listSalaryItem = (searchValue = "", current = 1) => { let excludeIds = [] this.itemGroups.map(item => { - item.items.map(i => { + item.items && item.items.map(i => { excludeIds.push(i.salaryItemId) }) }) diff --git a/pc4mobx/hrmSalary/util/options.js b/pc4mobx/hrmSalary/util/options.js new file mode 100644 index 00000000..670d5dee --- /dev/null +++ b/pc4mobx/hrmSalary/util/options.js @@ -0,0 +1,10 @@ +// 添加全部选项 +export const optionAddAll = (options) => { + let results = [...options]; + results.unshift({ + key: "All", + showname: "全部", + selected: false + }) + return results; +} \ No newline at end of file