diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js index c28d3c92..7e9fc146 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js @@ -24,8 +24,6 @@ import TwoColContent from '../../../components/twoColContent' import TipLabel from '../../../components/TipLabel' import ItemMangeFormModal from './itemMangeFormModal' -// const { MonthPicker } = DatePicker; - const { RangePicker } = DatePicker; diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index 9135ba5c..9a2f3235 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -37,6 +37,7 @@ export default class CumDeduct extends React.Component { monthValue: moment(new Date()).format("YYYY-MM"), taxAgentId: "", datetime: "", + inited: false, modalParam: { declareMonth: "", taxAgentId: "" @@ -47,7 +48,11 @@ export default class CumDeduct extends React.Component { componentWillMount() { // 初始化渲染页面 const { cumDeductStore: { doInit }, taxAgentStore: { fetchTaxAgentOption } } = this.props; doInit(); - fetchTaxAgentOption(); + fetchTaxAgentOption().then(() => { + this.setState({ + inited: true + }) + }) } getSearchsAdQuick() { @@ -78,16 +83,19 @@ export default class CumDeduct extends React.Component {
个税扣缴义务人: - { - this.setState({taxAgentId: v}) - getTableDatas({taxAgentId: v, declareMonth: [monthValue]}) - }} - /> + + { + this.state.inited && { + this.setState({taxAgentId: v}) + getTableDatas({taxAgentId: v, declareMonth: [monthValue]}) + }} + /> + }
) @@ -195,13 +203,6 @@ export default class CumDeduct extends React.Component { onClick: this.showColumn }, ]; - const collectParams = { // 收藏功能配置 - favname: '累计专项附加扣除', - favouritetype: 1, - objid: 0, - link: 'wui/index.html#/ns_demo03/index', - importantlevel: 1, - }; const adBtn = [ // 高级搜索内部按钮 , , @@ -286,7 +287,6 @@ export default class CumDeduct extends React.Component { iconBgcolor='#F14A2D' // 左侧图标背景色 showDropIcon={true} // 是否显示下拉按钮 dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同) - dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 buttons={btns} > diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index 1419f17b..744402a3 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -34,6 +34,7 @@ export default class CumSituation extends React.Component { value: "", selectedKey: "0", visiable: false, + inited: false, monthValue: moment(new Date()).format("YYYY-MM"), taxAgentId: "", modalParam: { @@ -45,7 +46,11 @@ export default class CumSituation extends React.Component { componentWillMount() { // 初始化渲染页面 const { cumSituationStore: { doInit }, taxAgentStore: { fetchTaxAgentOption } } = this.props; doInit(); - fetchTaxAgentOption(); + fetchTaxAgentOption().then(() => { + this.setState({ + inited: true + }) + }) } getSearchsAdQuick() { @@ -76,16 +81,18 @@ export default class CumSituation extends React.Component {
个税扣缴义务人: - { - this.setState({taxAgentId: v}) - getTableDatas({ taxAgentId: v, declareMonth: [monthValue]}) - }} - /> + { + this.state.inited && { + this.setState({taxAgentId: v}) + getTableDatas({ taxAgentId: v, declareMonth: [monthValue]}) + }} + /> + }
) diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js index 049e301c..6c52c589 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js @@ -36,6 +36,7 @@ export default class OtherDeduct extends React.Component { visiable: false, monthValue: moment(new Date()).format("YYYY-MM"), taxAgentId: "", + inited: false, modalParam: { declareMonth: "", } @@ -45,7 +46,11 @@ export default class OtherDeduct extends React.Component { componentWillMount() { // 初始化渲染页面 const { otherDeductStore: { doInit }, taxAgentStore: { fetchTaxAgentOption } } = this.props; doInit(); - fetchTaxAgentOption(); + fetchTaxAgentOption().then(() => { + this.setState({ + inited: true + }) + }) } getSearchsAdQuick() { @@ -76,16 +81,18 @@ export default class OtherDeduct extends React.Component {
个税扣缴义务人: - { - this.setState({taxAgentId: v}) - getTableDatas({ taxAgentId: v, declareMonth: [monthValue]}) - }} - /> + { + this.state.inited && { + this.setState({taxAgentId: v}) + getTableDatas({ taxAgentId: v, declareMonth: [monthValue]}) + }} + /> + }
) diff --git a/pc4mobx/hrmSalary/pages/mySalary/index.js b/pc4mobx/hrmSalary/pages/mySalary/index.js index e7ec9da3..94715a45 100644 --- a/pc4mobx/hrmSalary/pages/mySalary/index.js +++ b/pc4mobx/hrmSalary/pages/mySalary/index.js @@ -18,7 +18,7 @@ import { payrollColumns, dataSource } from './columns'; import PayrollModal from './payrollModal'; -const { MonthPicker } = DatePicker; +const { RangePicker } = DatePicker; @inject('mySalaryStore') @observer @@ -28,8 +28,6 @@ export default class MySalary extends React.Component { this.state = { value: "", selectedKey: "0", - salaryStartDate: moment(new Date()).format("YYYY-MM"), - salaryEndDate: moment(new Date()).format("YYYY-MM"), salaryBillVisible: false } this.salaryInfoId = "" @@ -37,7 +35,7 @@ export default class MySalary extends React.Component { componentWillMount() { const { mySalaryStore : {mySalaryBillList}} = this.props; - mySalaryBillList([this.state.salaryStartDate, this.state.salaryEndDate]) + mySalaryBillList() } // 查看工资单 @@ -75,18 +73,10 @@ export default class MySalary extends React.Component { return columns; } - // 工资单开始时间 - onSalaryStartDateChange(value) { - this.setState({salaryStartDate: value}) + // 区间改变事件 + handleSalaryRangePickerChange(range) { const { mySalaryStore : {mySalaryBillList}} = this.props; - mySalaryBillList([value, this.state.salaryEndDate]) - } - - // 工资单结束时间 - onSalaryEndDateChange(value) { - this.setState({salaryEndDate: value}) - const { mySalaryStore : {mySalaryBillList}} = this.props; - mySalaryBillList([this.state.salaryStartDate, value]) + mySalaryBillList(range.map(item => moment(item).format("YYYY-MM"))) } render() { @@ -137,25 +127,11 @@ export default class MySalary extends React.Component { const renderSearchOperationItem = () => { if(this.state.selectedKey == "0") { return (
薪资所属月: -
-
- this.onSalaryStartDateChange(value)} - /> -
- - 至 - -
- this.onSalaryEndDateChange(value)} - /> -
-
) + + this.handleSalaryRangePickerChange(value)} + /> + ) } else if(this.state.selectedKey == "1"){ return (
缴纳月份:
diff --git a/pc4mobx/hrmSalary/stores/mySalary.js b/pc4mobx/hrmSalary/stores/mySalary.js index 842c1af1..54b744f7 100644 --- a/pc4mobx/hrmSalary/stores/mySalary.js +++ b/pc4mobx/hrmSalary/stores/mySalary.js @@ -72,10 +72,6 @@ export class MySalaryStore { API.mySalaryBillList(param) break; } - if(params == 0) { - // 工资单 - - } API.getTableDatas(params).then(action(res => { if (res.api_status) { // 接口请求成功/失败处理 this.tableStore.getDatas(res.datas); // table 请求数据 diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index d1bde52f..ab00ab2d 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -123,11 +123,11 @@ export class TaxAgentStore { return new Promise((resolve, reject) => { API.getTaxAgentSelectList().then(action(res => { if(res.status) { - resolve() this.taxAgentOption = res.data.list.map(item => {return {key: item.id, showname: item.content}}) + resolve() } else { - reject() message.error(res.errormsg || "获取失败") + reject() } })) })