Browse Source

Merge remote-tracking branch 'origin/master'

zhouy 3 years ago
parent
commit
9ece7f6218

+ 3 - 2
uas-office-web/uas-mobile/src/components/common/formNew/FormLine.jsx

@@ -24,7 +24,8 @@ export default class FormLine extends Component {
   }
 
   render () {
-    const { caption, required, arrow, children } = this.props
+    const { caption, required, arrow, children, extraClassName } = this.props
+    const extraCname = extraClassName ? extraClassName : ''
     return (
       <div className='form-common-layout'
            style={{ minHeight: '46px' }}>
@@ -33,7 +34,7 @@ export default class FormLine extends Component {
           ? 'form-input-fill'
           : 'visibleHidden'}>*
         </div>
-        <div className='form-input-value'>
+        <div className={'form-input-value' + extraCname}>
           {children}
         </div>
         {arrow && <Icon

+ 19 - 0
uas-office-web/uas-mobile/src/configs/api.config.js

@@ -9,6 +9,7 @@ export const _host = window.location.origin
   // && 'http://usoft.f3322.net:10007/uas'
   // && 'http://erp.yitoa.com:8888/ERP'
   // && 'http://sisemi03.zicp.io/ERP/'
+  // && 'http://10.1.7.143:8088/ERP/'
 
 export const _baseURL = _host + (process.env.REACT_APP_ROUTER_BASE_NAME || '')
 
@@ -125,4 +126,22 @@ export const API = {
   //订阅图表
   SUBSCRIBE_GETCHARTTYPE: _baseURL +
     '/mobile/appcommon/getSingleAllType.action',
+
+  /******************************工资条*************************************/
+  //检查是否设置过查询密码
+  CHECK_PASSWORD: _baseURL +
+    '/mobile/salary/checkPassword.action',
+  //设置查询密码
+  CHANGE_PASSWORD: _baseURL +
+    '/mobile/salary/changePassword.action',
+  //发送验证码
+  SEND_VERIFICATIONCODE: _baseURL +
+    '/mobile/salary/verificationCode.action',
+  //查询工资条
+  GET_SALARY: _baseURL +
+    '/mobile/salary/getEmSalary.action',
+  //确认签收工资条
+  CONFIRM_SALARYBACK: _baseURL +
+    '/mobile/salary/salaryBackNoSignature.action',
+
 }

+ 1 - 1
uas-office-web/uas-mobile/src/configs/iconfont.conig.js

@@ -5,7 +5,7 @@ import { createFromIconfontCN } from '@ant-design/icons'
  * Desc: iconfont图标库
  */
 const UasIcon = createFromIconfontCN({
-  scriptUrl: '//at.alicdn.com/t/font_2183203_6fsgn5p6ff.js',
+  scriptUrl: '//at.alicdn.com/t/font_2183203_38xgf94njo.js',
 })
 
 export default UasIcon

+ 8 - 0
uas-office-web/uas-mobile/src/configs/router.config.js

@@ -87,6 +87,10 @@ const WorkOutAdd = PageLoadable(
   import(/* webpackChunkName:'service' */'@/pages/private/workOut/WorkOutAdd'))
 const WorkOutDetail = PageLoadable(
   import(/* webpackChunkName:'service' */'@/pages/private/workOut/WorkOutDetail'))
+const SalaryQuery = PageLoadable(
+  import(/* webpackChunkName:'service' */'@/pages/private/salaryQuery/SalaryQuery'))
+const SalaryDetail = PageLoadable(
+  import(/* webpackChunkName:'service' */'@/pages/private/salaryQuery/SalaryDetail'))
 
 /*************************************************我的信息************************************************/
 const ChangeAccount = PageLoadable(
@@ -213,6 +217,10 @@ class Routes extends React.Component {
           {/*新增外勤计划*/}
           <Route path='/workOutDetail/:id/:caller'
                  component={WorkOutDetail}/>
+          {/*工资条查询*/}
+          <Route path='/salaryQuery' component={SalaryQuery}/>
+          {/*工资条查询明细*/}
+          <Route path='/salary/salaryDetail/:date' component={SalaryDetail}/>
 
           {/*************************************我的信息*****************************************/}
           {/*切换账套列表*/}

+ 857 - 857
uas-office-web/uas-mobile/src/pages/private/approval/pages/ApprovalHome.jsx

@@ -1,857 +1,857 @@
-/**
- * Created by RaoMeng on 2020/2/17
- * Desc: 审批功能首页
- */
-
-import React, { Component } from 'react'
-import ReactDOM from 'react-dom'
-import { TabBar, SearchBar } from 'antd-mobile'
-import { List, Skeleton, message } from 'antd'
-import './approval.css'
-import Swiper from 'swiper/js/swiper.min'
-import 'swiper/css/swiper.min.css'
-import {
-  getIntValue,
-  isObjEmpty,
-  isObjNull,
-} from '../../../../utils/common/common.util'
-import { fetchGet } from '../../../../utils/common/fetchRequest'
-import { connect } from 'react-redux'
-import {
-  clearReceiveState,
-  clearSendState,
-  freshApprovalHomeState,
-  saveReceiveState,
-  saveSendState,
-} from '../../../../redux/actions/approvalState'
-import ApprovalItem from '../components/approvalItem/ApprovalItem'
-import LoadingMore from '../components/LoadingMore'
-import InfiniteScroll from 'react-infinite-scroller'
-import { _baseURL } from '../../../../configs/api.config'
-import UasIcon from '../../../../configs/iconfont.conig'
-
-let mMaster
-const mPageSize = 20
-let mTodoIndex = 0
-let mDoneIndex = 0
-let mSendIndex = 0
-
-class ApprovalHome extends Component {
-
-  constructor () {
-    super()
-
-    this.state = {
-      pageVisible: false,
-      tabHidden: false,
-      isNewMenuLoading: true,
-      isReceiveTodoLoading: true,
-      isReceiveDoneLoading: true,
-      isReceiveTodoRefresh: false,
-      isReceiveDoneRefresh: false,
-      isSendRefresh: false,
-      isSendLoading: true,
-      receiveKey: '',
-      sendKey: '',
-    }
-  }
-
-  componentDidMount () {
-    mMaster = this.props.match.params.master
-    document.title = '审批'
-
-    const { homeState } = this.props
-    let { newState, receiveState, sendState, selectedTab } = homeState
-
-    this.initSwiper(receiveState)
-
-    this.setState({
-      receiveKey: receiveState.searchKey,
-      sendKey: sendState.searchKey,
-    })
-
-    let pageType = this.props.match.params.type
-    if (pageType == 'receive') {
-      selectedTab = 1
-      freshApprovalHomeState({
-        selectedTab: 1,
-      })()
-    } else if (pageType == 'send') {
-      selectedTab = 2
-      freshApprovalHomeState({
-        selectedTab: 2,
-      })()
-    }
-    switch (selectedTab) {
-      case 1: {
-        this.initReceive(receiveState)
-        break
-      }
-      case 2: {
-        this.initSend(sendState)
-        break
-      }
-      default:
-        break
-    }
-  }
-
-  initSwiper (receiveState) {
-    let that = this
-    this.mySwiper = new Swiper('.swiper-container', {
-      autoplay: false,
-      loop: false,
-      noSwiping: true,
-      initialSlide: receiveState.tabIndex,
-      on: {
-        slideChangeTransitionEnd: function () {
-          saveReceiveState({
-            tabIndex: this.activeIndex,
-          })()
-          if (this.activeIndex == 0) {
-            that.refreshTodoList()
-          } else {
-            that.refreshDoneList()
-          }
-        },
-      },
-    })
-  }
-
-  initReceive (receiveState) {
-    if (receiveState && receiveState.tabIndex >= 0) {
-      this.mySwiper.slideTo(receiveState.tabIndex, 0, false)
-    }
-
-    if (receiveState && !isObjEmpty(receiveState.listData)) {
-      this.setState({
-        isReceiveTodoLoading: false,
-      }, () => {
-        setTimeout(() => {
-          ReactDOM.findDOMNode(this.todoTab).parentNode.scrollTop =
-            receiveState.scrollTop
-        }, 10)
-      })
-      mTodoIndex = receiveState.pageIndex
-    } else {
-      mTodoIndex = 0
-      this.loadTodoList()
-    }
-
-    if (receiveState && !isObjEmpty(receiveState.listData2)) {
-      this.setState({
-        isReceiveDoneLoading: false,
-      }, () => {
-        setTimeout(() => {
-          ReactDOM.findDOMNode(this.doneTab).parentNode.scrollTop =
-            receiveState.scrollTop2
-        }, 10)
-
-      })
-      mDoneIndex = receiveState.pageIndex2
-    } else {
-      mDoneIndex = 0
-      this.loadDoneList()
-    }
-  }
-
-  initSend (sendState) {
-    if (!isObjEmpty(sendState.sendList)) {
-      this.setState({
-        isSendLoading: false,
-      }, () => {
-        setTimeout(() => {
-          ReactDOM.findDOMNode(this.sendList).parentNode.scrollTop =
-            sendState.scrollTop
-        }, 10)
-      })
-    } else {
-      mSendIndex = 0
-      this.loadSendList()
-    }
-  }
-
-  componentWillUnmount () {
-
-  }
-
-  render () {
-    return (
-      <div className={'home-root'}>
-        <TabBar
-          unselectedTintColor="#949494"
-          tintColor="#33A3F4"
-          barTintColor="white"
-          prerenderingSiblingsNumber={1}
-          hidden={this.state.tabHidden}
-        >
-          {this.getReceiveTab()}
-          {this.getSendTab()}
-        </TabBar>
-      </div>
-    )
-  }
-
-  /**
-   * 【我的审批】
-   * @returns {*}
-   */
-  getReceiveTab = () => {
-    return (
-      <TabBar.Item
-        title="我的审批"
-        key="Receive"
-        icon={<UasIcon type='uas-receive'/>}
-        selectedIcon={<UasIcon type="uas-receive-selected"/>}
-        selected={this.props.homeState.selectedTab === 1}
-        badge={this.props.homeState.receiveState
-          ? this.props.homeState.receiveState.todoCount : 0}
-        onPress={this.onTab2Selected}
-      >
-        {this.renderReceiveTab()}
-      </TabBar.Item>
-    )
-  }
-
-  /**
-   * 【我发起的】
-   * @returns {*}
-   */
-  getSendTab = () => {
-    return (
-      <TabBar.Item
-        title="我发起的"
-        key="Send"
-        icon={<UasIcon type="uas-send"/>}
-        selectedIcon={<UasIcon type="uas-send-selected"/>}
-        selected={this.props.homeState.selectedTab === 2}
-        // badge={''}
-        onPress={this.onTab3Selected}
-      >
-        {this.renderSendTab()}
-      </TabBar.Item>
-    )
-  }
-
-  onTab2Selected = () => {
-    const { isReceiveTodoLoading, isReceiveDoneLoading } = this.state
-    const { homeState: { receiveState, selectedTab } } = this.props
-    if (selectedTab === 1) {
-      // 刷新页面
-      clearReceiveState()()
-      this.setState({
-        receiveKey: '',
-      })
-      this.mySwiper.slideTo(0, 0, false)
-      if (!isReceiveTodoLoading) {
-        this.setState({
-          isReceiveTodoLoading: true,
-        })
-        mTodoIndex = 0
-        this.loadTodoList()
-      }
-      if (!isReceiveDoneLoading) {
-        this.setState({
-          isReceiveDoneLoading: true,
-        })
-        mDoneIndex = 0
-        this.loadDoneList()
-      }
-    } else {
-      if (isObjEmpty(receiveState.listData)) {
-        this.setState({
-          isReceiveTodoLoading: true,
-        })
-        mTodoIndex = 0
-        this.loadTodoList()
-      } else {
-        this.setState({
-          isReceiveTodoLoading: false,
-        }, () => {
-
-        })
-        mTodoIndex = receiveState.pageIndex
-      }
-      if (isObjEmpty(receiveState.listData2)) {
-        this.setState({
-          isReceiveDoneLoading: true,
-        })
-        mDoneIndex = 0
-        this.loadDoneList()
-      } else {
-        this.setState({
-          isReceiveDoneLoading: false,
-        }, () => {
-
-        })
-        mDoneIndex = receiveState.pageIndex2
-      }
-    }
-    freshApprovalHomeState({
-      selectedTab: 1,
-    })()
-  }
-
-  onTab3Selected = () => {
-    const { isSendLoading } = this.state
-    const { homeState: { sendState, selectedTab } } = this.props
-    if (selectedTab === 2) {
-      // 刷新页面
-      clearSendState()()
-      this.setState({
-        sendKey: '',
-      })
-      if (!isSendLoading) {
-        this.setState({
-          isSendLoading: true,
-        })
-        mSendIndex = 0
-        this.loadSendList()
-      }
-    } else {
-      if (isObjEmpty(sendState.sendList)) {
-        this.setState({
-          isSendLoading: true,
-        })
-        mSendIndex = 0
-        this.loadSendList()
-      } else {
-        this.setState({
-          isSendLoading: false,
-        }, () => {
-
-        })
-      }
-    }
-    freshApprovalHomeState({
-      selectedTab: 2,
-    })()
-  }
-
-  renderReceiveTab = () => {
-    const { homeState: { receiveState } } = this.props
-    const { tabIndex } = receiveState
-    const todoItems = this.renderReceiveTodoItems()
-    const doneItems = this.renderReceiveDoneItems()
-    return (
-      <div className='receive-root'>
-        <SearchBar
-          value={this.state.receiveKey}
-          placeholder={'搜索'}
-          maxLength={16}
-          onChange={value => {
-            this.setState({
-              receiveKey: value,
-            })
-          }}
-          onClear={value => {
-            this.setState({
-              receiveKey: value,
-            })
-          }}
-          onCancel={() => {
-            this.setState({
-              receiveKey: '',
-            })
-            if (!isObjEmpty(receiveState.searchKey)) {
-              this.searchSubmit(0, '')
-            }
-          }}
-          onSubmit={this.searchSubmit.bind(this, 0, this.state.receiveKey)}
-        />
-        {/*<div className='line'></div>*/}
-        <div className='identity-select'>
-          <div className={tabIndex === 0 ?
-            'identity-item-select' : 'identity-item-normal'}
-               onClick={() => {
-                 this.refreshTodoList()
-                 if (tabIndex === 0) {
-
-                 } else {
-                   saveReceiveState({
-                     tabIndex: 0,
-                   })()
-                   this.mySwiper.slideTo(0, 300, false)
-                 }
-               }}>待审批{this.props.homeState.receiveState ?
-            (this.props.homeState.receiveState.todoCount > 0
-              ? ('(' + this.props.homeState.receiveState.todoCount + ')')
-              : '') : ''}
-          </div>
-          <div className={tabIndex === 1 ?
-            'identity-item-select' : 'identity-item-normal'}
-               onClick={() => {
-                 this.refreshDoneList()
-                 if (tabIndex === 1) {
-
-                 } else {
-                   saveReceiveState({
-                     tabIndex: 1,
-                   })()
-                   this.mySwiper.slideTo(1, 300, false)
-                 }
-               }}>已审批
-          </div>
-        </div>
-        <div className="swiper-container"
-             ref={el => {
-               this.contain = el
-             }}>
-          <div className="swiper-wrapper">
-            <div className="swiper-slide swiper-no-swiping">
-              {todoItems}
-            </div>
-            <div className="swiper-slide swiper-no-swiping">
-              {doneItems}
-            </div>
-          </div>
-        </div>
-      </div>
-    )
-  }
-
-  refreshDoneList () {
-    const { isReceiveDoneLoading } = this.state
-    if (!isReceiveDoneLoading) {
-      this.setState({
-        isReceiveDoneLoading: true,
-      })
-      saveReceiveState({
-        hasMore2: true,
-        scrollTop2: 0,
-      })()
-      mDoneIndex = 0
-      this.loadDoneList()
-    }
-  }
-
-  refreshTodoList () {
-    const { isReceiveTodoLoading } = this.state
-    if (!isReceiveTodoLoading) {
-      this.setState({
-        isReceiveTodoLoading: true,
-      })
-      saveReceiveState({
-        hasMore1: true,
-        scrollTop: 0,
-      })()
-      mTodoIndex = 0
-      this.loadTodoList()
-    }
-  }
-
-  renderSendTab = () => {
-    const { homeState: { sendState } } = this.props
-
-    return (
-      <div className='receive-content-root'>
-        <SearchBar
-          value={this.state.sendKey}
-          placeholder={'搜索'}
-          maxLength={16}
-          onChange={value => {
-            this.setState({
-              sendKey: value,
-            })
-          }}
-          onClear={value => {
-            this.setState({
-              sendKey: value,
-            })
-          }}
-          onCancel={() => {
-            this.setState({
-              sendKey: '',
-            })
-            if (!isObjEmpty(sendState.searchKey)) {
-              this.searchSubmit(1, '')
-            }
-          }}
-          onSubmit={this.searchSubmit.bind(this, 1, this.state.sendKey)}
-        />
-        <div className='receive-content-root'>
-          <InfiniteScroll
-            initialLoad={false}
-            pageStart={0}
-            ref={el => {
-              this.sendList = el
-            }}
-            loadMore={this.loadSendList}
-            hasMore={sendState.sendHasMore}
-            loader={<LoadingMore/>}
-            threshold={1}
-            useWindow={false}>
-            <Skeleton loading={this.state.isSendLoading} active
-                      paragraph={{ rows: 4 }}>
-              <List split={false}
-                    dataSource={sendState.sendList}
-                    renderItem={(item, index) => (
-                      <ApprovalItem approval={item}
-                                    type={3}
-                                    onItemClick={this.onSendItemClick.bind(
-                                      this)}
-                                    index={index}/>
-                    )}/>
-            </Skeleton>
-          </InfiniteScroll>
-        </div>
-
-      </div>
-    )
-  }
-
-  renderReceiveTodoItems = () => (
-    <div className='receive-content-root'>
-      <InfiniteScroll
-        initialLoad={false}
-        pageStart={0}
-        ref={el => {
-          this.todoTab = el
-        }}
-        loadMore={this.loadTodoList.bind(this, undefined)}
-        hasMore={this.props.homeState.receiveState.hasMore1}
-        loader={<LoadingMore/>}
-        threshold={1}
-        useWindow={false}>
-        <Skeleton loading={this.state.isReceiveTodoLoading} active
-                  paragraph={{ rows: 4 }}>
-          <List split={false}
-                dataSource={this.props.homeState.receiveState.listData}
-                renderItem={(item, index) => (
-                  <ApprovalItem approval={item}
-                                type={1}
-                                onItemClick={this.onReceiveItemClick.bind(this)}
-                                index={index}/>
-                )}/>
-        </Skeleton>
-      </InfiniteScroll>
-    </div>
-  )
-
-  renderReceiveDoneItems = () => (
-    <div className='receive-content-root'>
-      <InfiniteScroll
-        initialLoad={false}
-        pageStart={0}
-        ref={el => {
-          this.doneTab = el
-        }}
-        loadMore={this.loadDoneList.bind(this, undefined)}
-        hasMore={this.props.homeState.receiveState.hasMore2}
-        loader={<LoadingMore/>}
-        threshold={1}
-        useWindow={false}>
-        <Skeleton loading={this.state.isReceiveDoneLoading} active
-                  paragraph={{ rows: 4 }}>
-          <List split={false}
-                dataSource={this.props.homeState.receiveState.listData2}
-                renderItem={(item, index) => (
-                  <ApprovalItem approval={item}
-                                type={2}
-                                onItemClick={this.onReceiveItemClick.bind(this)}
-                                index={index}/>
-                )}/>
-        </Skeleton>
-      </InfiniteScroll>
-    </div>
-  )
-
-  searchSubmit = (type, value) => {
-    if (type === 0) {
-      const { isReceiveTodoLoading, isReceiveDoneLoading } = this.state
-      this.setState({
-        receiveKey: value,
-      })
-      clearReceiveState({
-        searchKey: value,
-        tabIndex: this.props.homeState.receiveState.tabIndex,
-      })()
-      // this.mySwiper.slideTo(0, 0, false)
-      if (!isReceiveTodoLoading) {
-        this.setState({
-          isReceiveTodoLoading: true,
-        })
-        mTodoIndex = 0
-        this.loadTodoList(value)
-      }
-      if (!isReceiveDoneLoading) {
-        this.setState({
-          isReceiveDoneLoading: true,
-        })
-        mDoneIndex = 0
-        this.loadDoneList(value)
-      }
-    } else if (type === 1) {
-      const { isSendLoading } = this.state
-      this.setState({
-        sendKey: value,
-      })
-      clearSendState({
-        searchKey: value,
-      })()
-      if (!isSendLoading) {
-        this.setState({
-          isSendLoading: true,
-        })
-        mSendIndex = 0
-        this.loadSendList(value)
-      }
-    }
-  }
-
-  onFuncClick = (obj) => {
-    this.cacheScrollState()
-    this.props.history.push('/approvalAdd/' + obj.sv_caller + '/' + mMaster)
-  }
-
-  onReceiveItemClick = (index, approval) => {
-    this.cacheScrollState()
-    saveReceiveState({
-      itemIndex: index,
-    })()
-    let jp_form = approval.JP_FORM
-    let currentmaster = approval.CURRENTMASTER
-    if (!isObjEmpty(jp_form) && !isObjEmpty(currentmaster) &&
-      (jp_form.indexOf(currentmaster) != -1)) {
-
-    } else {
-      currentmaster = mMaster
-    }
-    let type = 0
-    if (this.props.homeState.receiveState.tabIndex === 1) {
-      type = 1
-    }
-    this.props.history.push('/approval/%7B%22' +
-      'master%22%3A%22' + currentmaster
-      + '%22%2C%22nodeId%22%3A' + approval.JP_NODEID
-      + '%2C%22type%22%3A' + type
-      + '%2C%22baseUrl%22%3A%22' + encodeURIComponent(_baseURL)
-      + '%22%7D')
-  }
-
-  onSendItemClick = (index, approval) => {
-    this.cacheScrollState()
-    let jp_form = approval.JP_FORM
-    let currentmaster = approval.CURRENTMASTER
-    if (!isObjEmpty(jp_form) && !isObjEmpty(currentmaster) &&
-      (jp_form.indexOf(currentmaster) != -1)) {
-
-    } else {
-      currentmaster = mMaster
-    }
-    this.props.history.push('/approval/%7B%22' +
-      'master%22%3A%22' + currentmaster
-      + '%22%2C%22nodeId%22%3A' + approval.JP_NODEID
-      + '%2C%22type%22%3A' + 2
-      + '%2C%22baseUrl%22%3A%22' + encodeURIComponent(_baseURL)
-      + '%22%7D')
-  }
-
-  cacheScrollState () {
-    // saveNewState({
-    //   scrollTop: ReactDOM.findDOMNode(this.newList).parentNode.scrollTop,
-    // })()
-    saveReceiveState({
-      scrollTop: ReactDOM.findDOMNode(this.todoTab).parentNode.scrollTop,
-      scrollTop2: ReactDOM.findDOMNode(this.doneTab).parentNode.scrollTop,
-    })()
-    saveSendState({
-      scrollTop: ReactDOM.findDOMNode(this.sendList).parentNode.scrollTop,
-    })()
-  }
-
-  loadTodoList = (keyword) => {
-    let { homeState: { receiveState } } = this.props
-    let { listData } = receiveState
-    if (isObjEmpty(listData)) {
-      mTodoIndex = 0
-    }
-    mTodoIndex++
-    if (!this.state.isReceiveTodoLoading) {
-      this.setState({
-        isReceiveTodoRefresh: true,
-      })
-    }
-
-    if (mTodoIndex === 1) {
-      listData.length = 0
-    }
-
-    fetchGet(_baseURL + '/common/desktop/process/uapproval/toDo.action', {
-      pageSize: mPageSize,
-      page: mTodoIndex,
-      keyword: !isObjNull(keyword) ? keyword : receiveState.searchKey,
-    }).then(response => {
-      this.setState({
-        isReceiveTodoLoading: false,
-        isReceiveTodoRefresh: false,
-      })
-      if (response && !isObjEmpty(response.data)) {
-        listData = listData.concat(response.data)
-      } else {
-        if (mTodoIndex > 1) {
-          mTodoIndex--
-        }
-      }
-      saveReceiveState({
-        hasMore1: !(isObjNull(response.data)
-          || response.data.length < mPageSize),
-        listData,
-        pageIndex: mTodoIndex,
-        todoCount: getIntValue(response, 'totalCount'),
-      })()
-    }).catch(error => {
-      if (mTodoIndex > 1) {
-        mTodoIndex--
-      }
-      saveReceiveState({
-        hasMore1: false,
-        listData,
-        pageIndex: mTodoIndex,
-      })()
-      this.setState({
-        isReceiveTodoLoading: false,
-        isReceiveTodoRefresh: false,
-      })
-      if (typeof error === 'string') {
-        message.error(error)
-      } else {
-        message.error('待审批列表请求异常')
-      }
-    })
-  }
-
-  loadDoneList = (keyword) => {
-    let { homeState: { receiveState } } = this.props
-    let { listData2 } = receiveState
-    if (isObjEmpty(listData2)) {
-      mDoneIndex = 0
-    }
-    mDoneIndex++
-    if (!this.state.isReceiveDoneLoading) {
-      this.setState({
-        isReceiveDoneRefresh: true,
-      })
-    }
-
-    if (mDoneIndex === 1) {
-      listData2.length = 0
-    }
-
-    fetchGet(_baseURL + '/common/desktop/process/uapproval/alreadyDo.action', {
-      pageSize: mPageSize,
-      page: mDoneIndex,
-      keyword: !isObjNull(keyword) ? keyword : receiveState.searchKey,
-      isMobile: 1,
-      _do: 1,
-    }).then(response => {
-      this.setState({
-        isReceiveDoneLoading: false,
-        isReceiveDoneRefresh: false,
-      })
-      if (response && !isObjEmpty(response.data)) {
-        listData2 = listData2.concat(response.data)
-      } else {
-        if (mDoneIndex > 1) {
-          mDoneIndex--
-        }
-      }
-      saveReceiveState({
-        hasMore2: !(isObjNull(response.data)
-          || response.data.length < mPageSize),
-        listData2,
-        pageIndex: mDoneIndex,
-      })()
-    }).catch(error => {
-      if (mDoneIndex > 1) {
-        mDoneIndex--
-      }
-      saveReceiveState({
-        hasMore2: false,
-        listData2,
-        pageIndex: mDoneIndex,
-      })()
-      this.setState({
-        isReceiveDoneLoading: false,
-        isReceiveDoneRefresh: false,
-      })
-      if (typeof error === 'string') {
-        message.error(error)
-      } else {
-        message.error('已审批列表请求异常')
-      }
-    })
-  }
-
-  loadSendList = (keyword) => {
-    let { homeState: { sendState } } = this.props
-    let { sendList } = sendState
-    if (isObjEmpty(sendList)) {
-      mSendIndex = 0
-    }
-    mSendIndex++
-    if (!this.state.isSendLoading) {
-      this.setState({
-        isSendRefresh: true,
-      })
-    }
-
-    if (mSendIndex === 1) {
-      sendList.length = 0
-    }
-
-    fetchGet(
-      _baseURL + '/common/desktop/process/uapproval/alreadyLaunch.action',
-      {
-        pageSize: mPageSize,
-        page: mSendIndex,
-        keyword: !isObjNull(keyword) ? keyword : sendState.searchKey,
-        isMobile: 1,
-        _do: 1,
-      }).then(response => {
-      this.setState({
-        isSendLoading: false,
-        isSendRefresh: false,
-      })
-      if (response && !isObjEmpty(response.data)) {
-        sendList = sendList.concat(response.data)
-      } else {
-        if (mSendIndex > 1) {
-          mSendIndex--
-        }
-      }
-      saveSendState({
-        sendHasMore: !(isObjNull(response.data)
-          || response.data.length < mPageSize),
-        sendList,
-        pageIndex: mSendIndex,
-      })()
-    }).catch(error => {
-      if (mSendIndex > 1) {
-        mSendIndex--
-      }
-      saveSendState({
-        sendHasMore: false,
-        sendList,
-        pageIndex: mSendIndex,
-      })()
-      this.setState({
-        isSendLoading: false,
-        isSendRefresh: false,
-      })
-      if (typeof error === 'string') {
-        message.error(error)
-      } else {
-        message.error('列表请求异常')
-      }
-    })
-  }
-}
-
-let mapStateToProps = (state) => ({
-  homeState: { ...state.approvalState },
-})
-
-let mapDispatchToProps = (dispatch) => ({})
-
-export default connect(mapStateToProps, mapDispatchToProps)(ApprovalHome)
+/**
+ * Created by RaoMeng on 2020/2/17
+ * Desc: 审批功能首页
+ */
+
+import React, { Component } from 'react'
+import ReactDOM from 'react-dom'
+import { TabBar, SearchBar } from 'antd-mobile'
+import { List, Skeleton, message } from 'antd'
+import './approval.css'
+import Swiper from 'swiper/js/swiper.min'
+import 'swiper/css/swiper.min.css'
+import {
+  getIntValue,
+  isObjEmpty,
+  isObjNull,
+} from '../../../../utils/common/common.util'
+import { fetchGet } from '../../../../utils/common/fetchRequest'
+import { connect } from 'react-redux'
+import {
+  clearReceiveState,
+  clearSendState,
+  freshApprovalHomeState,
+  saveReceiveState,
+  saveSendState,
+} from '../../../../redux/actions/approvalState'
+import ApprovalItem from '../components/approvalItem/ApprovalItem'
+import LoadingMore from '../components/LoadingMore'
+import InfiniteScroll from 'react-infinite-scroller'
+import { _baseURL } from '../../../../configs/api.config'
+import UasIcon from '../../../../configs/iconfont.conig'
+
+let mMaster
+const mPageSize = 20
+let mTodoIndex = 0
+let mDoneIndex = 0
+let mSendIndex = 0
+
+class ApprovalHome extends Component {
+
+  constructor () {
+    super()
+
+    this.state = {
+      pageVisible: false,
+      tabHidden: false,
+      isNewMenuLoading: true,
+      isReceiveTodoLoading: true,
+      isReceiveDoneLoading: true,
+      isReceiveTodoRefresh: false,
+      isReceiveDoneRefresh: false,
+      isSendRefresh: false,
+      isSendLoading: true,
+      receiveKey: '',
+      sendKey: '',
+    }
+  }
+
+  componentDidMount () {
+    mMaster = this.props.match.params.master || this.props.match.params.type
+    document.title = '审批'
+
+    const { homeState } = this.props
+    let { newState, receiveState, sendState, selectedTab } = homeState
+
+    this.initSwiper(receiveState)
+
+    this.setState({
+      receiveKey: receiveState.searchKey,
+      sendKey: sendState.searchKey,
+    })
+
+    let pageType = this.props.match.params.type
+    if (pageType == 'receive') {
+      selectedTab = 1
+      freshApprovalHomeState({
+        selectedTab: 1,
+      })()
+    } else if (pageType == 'send') {
+      selectedTab = 2
+      freshApprovalHomeState({
+        selectedTab: 2,
+      })()
+    }
+    switch (selectedTab) {
+      case 1: {
+        this.initReceive(receiveState)
+        break
+      }
+      case 2: {
+        this.initSend(sendState)
+        break
+      }
+      default:
+        break
+    }
+  }
+
+  initSwiper (receiveState) {
+    let that = this
+    this.mySwiper = new Swiper('.swiper-container', {
+      autoplay: false,
+      loop: false,
+      noSwiping: true,
+      initialSlide: receiveState.tabIndex,
+      on: {
+        slideChangeTransitionEnd: function () {
+          saveReceiveState({
+            tabIndex: this.activeIndex,
+          })()
+          if (this.activeIndex == 0) {
+            that.refreshTodoList()
+          } else {
+            that.refreshDoneList()
+          }
+        },
+      },
+    })
+  }
+
+  initReceive (receiveState) {
+    if (receiveState && receiveState.tabIndex >= 0) {
+      this.mySwiper.slideTo(receiveState.tabIndex, 0, false)
+    }
+
+    if (receiveState && !isObjEmpty(receiveState.listData)) {
+      this.setState({
+        isReceiveTodoLoading: false,
+      }, () => {
+        setTimeout(() => {
+          ReactDOM.findDOMNode(this.todoTab).parentNode.scrollTop =
+            receiveState.scrollTop
+        }, 10)
+      })
+      mTodoIndex = receiveState.pageIndex
+    } else {
+      mTodoIndex = 0
+      this.loadTodoList()
+    }
+
+    if (receiveState && !isObjEmpty(receiveState.listData2)) {
+      this.setState({
+        isReceiveDoneLoading: false,
+      }, () => {
+        setTimeout(() => {
+          ReactDOM.findDOMNode(this.doneTab).parentNode.scrollTop =
+            receiveState.scrollTop2
+        }, 10)
+
+      })
+      mDoneIndex = receiveState.pageIndex2
+    } else {
+      mDoneIndex = 0
+      this.loadDoneList()
+    }
+  }
+
+  initSend (sendState) {
+    if (!isObjEmpty(sendState.sendList)) {
+      this.setState({
+        isSendLoading: false,
+      }, () => {
+        setTimeout(() => {
+          ReactDOM.findDOMNode(this.sendList).parentNode.scrollTop =
+            sendState.scrollTop
+        }, 10)
+      })
+    } else {
+      mSendIndex = 0
+      this.loadSendList()
+    }
+  }
+
+  componentWillUnmount () {
+
+  }
+
+  render () {
+    return (
+      <div className={'home-root'}>
+        <TabBar
+          unselectedTintColor="#949494"
+          tintColor="#33A3F4"
+          barTintColor="white"
+          prerenderingSiblingsNumber={1}
+          hidden={this.state.tabHidden}
+        >
+          {this.getReceiveTab()}
+          {this.getSendTab()}
+        </TabBar>
+      </div>
+    )
+  }
+
+  /**
+   * 【我的审批】
+   * @returns {*}
+   */
+  getReceiveTab = () => {
+    return (
+      <TabBar.Item
+        title="我的审批"
+        key="Receive"
+        icon={<UasIcon type='uas-receive'/>}
+        selectedIcon={<UasIcon type="uas-receive-selected"/>}
+        selected={this.props.homeState.selectedTab === 1}
+        badge={this.props.homeState.receiveState
+          ? this.props.homeState.receiveState.todoCount : 0}
+        onPress={this.onTab2Selected}
+      >
+        {this.renderReceiveTab()}
+      </TabBar.Item>
+    )
+  }
+
+  /**
+   * 【我发起的】
+   * @returns {*}
+   */
+  getSendTab = () => {
+    return (
+      <TabBar.Item
+        title="我发起的"
+        key="Send"
+        icon={<UasIcon type="uas-send"/>}
+        selectedIcon={<UasIcon type="uas-send-selected"/>}
+        selected={this.props.homeState.selectedTab === 2}
+        // badge={''}
+        onPress={this.onTab3Selected}
+      >
+        {this.renderSendTab()}
+      </TabBar.Item>
+    )
+  }
+
+  onTab2Selected = () => {
+    const { isReceiveTodoLoading, isReceiveDoneLoading } = this.state
+    const { homeState: { receiveState, selectedTab } } = this.props
+    if (selectedTab === 1) {
+      // 刷新页面
+      clearReceiveState()()
+      this.setState({
+        receiveKey: '',
+      })
+      this.mySwiper.slideTo(0, 0, false)
+      if (!isReceiveTodoLoading) {
+        this.setState({
+          isReceiveTodoLoading: true,
+        })
+        mTodoIndex = 0
+        this.loadTodoList()
+      }
+      if (!isReceiveDoneLoading) {
+        this.setState({
+          isReceiveDoneLoading: true,
+        })
+        mDoneIndex = 0
+        this.loadDoneList()
+      }
+    } else {
+      if (isObjEmpty(receiveState.listData)) {
+        this.setState({
+          isReceiveTodoLoading: true,
+        })
+        mTodoIndex = 0
+        this.loadTodoList()
+      } else {
+        this.setState({
+          isReceiveTodoLoading: false,
+        }, () => {
+
+        })
+        mTodoIndex = receiveState.pageIndex
+      }
+      if (isObjEmpty(receiveState.listData2)) {
+        this.setState({
+          isReceiveDoneLoading: true,
+        })
+        mDoneIndex = 0
+        this.loadDoneList()
+      } else {
+        this.setState({
+          isReceiveDoneLoading: false,
+        }, () => {
+
+        })
+        mDoneIndex = receiveState.pageIndex2
+      }
+    }
+    freshApprovalHomeState({
+      selectedTab: 1,
+    })()
+  }
+
+  onTab3Selected = () => {
+    const { isSendLoading } = this.state
+    const { homeState: { sendState, selectedTab } } = this.props
+    if (selectedTab === 2) {
+      // 刷新页面
+      clearSendState()()
+      this.setState({
+        sendKey: '',
+      })
+      if (!isSendLoading) {
+        this.setState({
+          isSendLoading: true,
+        })
+        mSendIndex = 0
+        this.loadSendList()
+      }
+    } else {
+      if (isObjEmpty(sendState.sendList)) {
+        this.setState({
+          isSendLoading: true,
+        })
+        mSendIndex = 0
+        this.loadSendList()
+      } else {
+        this.setState({
+          isSendLoading: false,
+        }, () => {
+
+        })
+      }
+    }
+    freshApprovalHomeState({
+      selectedTab: 2,
+    })()
+  }
+
+  renderReceiveTab = () => {
+    const { homeState: { receiveState } } = this.props
+    const { tabIndex } = receiveState
+    const todoItems = this.renderReceiveTodoItems()
+    const doneItems = this.renderReceiveDoneItems()
+    return (
+      <div className='receive-root'>
+        <SearchBar
+          value={this.state.receiveKey}
+          placeholder={'搜索'}
+          maxLength={16}
+          onChange={value => {
+            this.setState({
+              receiveKey: value,
+            })
+          }}
+          onClear={value => {
+            this.setState({
+              receiveKey: value,
+            })
+          }}
+          onCancel={() => {
+            this.setState({
+              receiveKey: '',
+            })
+            if (!isObjEmpty(receiveState.searchKey)) {
+              this.searchSubmit(0, '')
+            }
+          }}
+          onSubmit={this.searchSubmit.bind(this, 0, this.state.receiveKey)}
+        />
+        {/*<div className='line'></div>*/}
+        <div className='identity-select'>
+          <div className={tabIndex === 0 ?
+            'identity-item-select' : 'identity-item-normal'}
+               onClick={() => {
+                 this.refreshTodoList()
+                 if (tabIndex === 0) {
+
+                 } else {
+                   saveReceiveState({
+                     tabIndex: 0,
+                   })()
+                   this.mySwiper.slideTo(0, 300, false)
+                 }
+               }}>待审批{this.props.homeState.receiveState ?
+            (this.props.homeState.receiveState.todoCount > 0
+              ? ('(' + this.props.homeState.receiveState.todoCount + ')')
+              : '') : ''}
+          </div>
+          <div className={tabIndex === 1 ?
+            'identity-item-select' : 'identity-item-normal'}
+               onClick={() => {
+                 this.refreshDoneList()
+                 if (tabIndex === 1) {
+
+                 } else {
+                   saveReceiveState({
+                     tabIndex: 1,
+                   })()
+                   this.mySwiper.slideTo(1, 300, false)
+                 }
+               }}>已审批
+          </div>
+        </div>
+        <div className="swiper-container"
+             ref={el => {
+               this.contain = el
+             }}>
+          <div className="swiper-wrapper">
+            <div className="swiper-slide swiper-no-swiping">
+              {todoItems}
+            </div>
+            <div className="swiper-slide swiper-no-swiping">
+              {doneItems}
+            </div>
+          </div>
+        </div>
+      </div>
+    )
+  }
+
+  refreshDoneList () {
+    const { isReceiveDoneLoading } = this.state
+    if (!isReceiveDoneLoading) {
+      this.setState({
+        isReceiveDoneLoading: true,
+      })
+      saveReceiveState({
+        hasMore2: true,
+        scrollTop2: 0,
+      })()
+      mDoneIndex = 0
+      this.loadDoneList()
+    }
+  }
+
+  refreshTodoList () {
+    const { isReceiveTodoLoading } = this.state
+    if (!isReceiveTodoLoading) {
+      this.setState({
+        isReceiveTodoLoading: true,
+      })
+      saveReceiveState({
+        hasMore1: true,
+        scrollTop: 0,
+      })()
+      mTodoIndex = 0
+      this.loadTodoList()
+    }
+  }
+
+  renderSendTab = () => {
+    const { homeState: { sendState } } = this.props
+
+    return (
+      <div className='receive-content-root'>
+        <SearchBar
+          value={this.state.sendKey}
+          placeholder={'搜索'}
+          maxLength={16}
+          onChange={value => {
+            this.setState({
+              sendKey: value,
+            })
+          }}
+          onClear={value => {
+            this.setState({
+              sendKey: value,
+            })
+          }}
+          onCancel={() => {
+            this.setState({
+              sendKey: '',
+            })
+            if (!isObjEmpty(sendState.searchKey)) {
+              this.searchSubmit(1, '')
+            }
+          }}
+          onSubmit={this.searchSubmit.bind(this, 1, this.state.sendKey)}
+        />
+        <div className='receive-content-root'>
+          <InfiniteScroll
+            initialLoad={false}
+            pageStart={0}
+            ref={el => {
+              this.sendList = el
+            }}
+            loadMore={this.loadSendList}
+            hasMore={sendState.sendHasMore}
+            loader={<LoadingMore/>}
+            threshold={1}
+            useWindow={false}>
+            <Skeleton loading={this.state.isSendLoading} active
+                      paragraph={{ rows: 4 }}>
+              <List split={false}
+                    dataSource={sendState.sendList}
+                    renderItem={(item, index) => (
+                      <ApprovalItem approval={item}
+                                    type={3}
+                                    onItemClick={this.onSendItemClick.bind(
+                                      this)}
+                                    index={index}/>
+                    )}/>
+            </Skeleton>
+          </InfiniteScroll>
+        </div>
+
+      </div>
+    )
+  }
+
+  renderReceiveTodoItems = () => (
+    <div className='receive-content-root'>
+      <InfiniteScroll
+        initialLoad={false}
+        pageStart={0}
+        ref={el => {
+          this.todoTab = el
+        }}
+        loadMore={this.loadTodoList.bind(this, undefined)}
+        hasMore={this.props.homeState.receiveState.hasMore1}
+        loader={<LoadingMore/>}
+        threshold={1}
+        useWindow={false}>
+        <Skeleton loading={this.state.isReceiveTodoLoading} active
+                  paragraph={{ rows: 4 }}>
+          <List split={false}
+                dataSource={this.props.homeState.receiveState.listData}
+                renderItem={(item, index) => (
+                  <ApprovalItem approval={item}
+                                type={1}
+                                onItemClick={this.onReceiveItemClick.bind(this)}
+                                index={index}/>
+                )}/>
+        </Skeleton>
+      </InfiniteScroll>
+    </div>
+  )
+
+  renderReceiveDoneItems = () => (
+    <div className='receive-content-root'>
+      <InfiniteScroll
+        initialLoad={false}
+        pageStart={0}
+        ref={el => {
+          this.doneTab = el
+        }}
+        loadMore={this.loadDoneList.bind(this, undefined)}
+        hasMore={this.props.homeState.receiveState.hasMore2}
+        loader={<LoadingMore/>}
+        threshold={1}
+        useWindow={false}>
+        <Skeleton loading={this.state.isReceiveDoneLoading} active
+                  paragraph={{ rows: 4 }}>
+          <List split={false}
+                dataSource={this.props.homeState.receiveState.listData2}
+                renderItem={(item, index) => (
+                  <ApprovalItem approval={item}
+                                type={2}
+                                onItemClick={this.onReceiveItemClick.bind(this)}
+                                index={index}/>
+                )}/>
+        </Skeleton>
+      </InfiniteScroll>
+    </div>
+  )
+
+  searchSubmit = (type, value) => {
+    if (type === 0) {
+      const { isReceiveTodoLoading, isReceiveDoneLoading } = this.state
+      this.setState({
+        receiveKey: value,
+      })
+      clearReceiveState({
+        searchKey: value,
+        tabIndex: this.props.homeState.receiveState.tabIndex,
+      })()
+      // this.mySwiper.slideTo(0, 0, false)
+      if (!isReceiveTodoLoading) {
+        this.setState({
+          isReceiveTodoLoading: true,
+        })
+        mTodoIndex = 0
+        this.loadTodoList(value)
+      }
+      if (!isReceiveDoneLoading) {
+        this.setState({
+          isReceiveDoneLoading: true,
+        })
+        mDoneIndex = 0
+        this.loadDoneList(value)
+      }
+    } else if (type === 1) {
+      const { isSendLoading } = this.state
+      this.setState({
+        sendKey: value,
+      })
+      clearSendState({
+        searchKey: value,
+      })()
+      if (!isSendLoading) {
+        this.setState({
+          isSendLoading: true,
+        })
+        mSendIndex = 0
+        this.loadSendList(value)
+      }
+    }
+  }
+
+  onFuncClick = (obj) => {
+    this.cacheScrollState()
+    this.props.history.push('/approvalAdd/' + obj.sv_caller + '/' + mMaster)
+  }
+
+  onReceiveItemClick = (index, approval) => {
+    this.cacheScrollState()
+    saveReceiveState({
+      itemIndex: index,
+    })()
+    let jp_form = approval.JP_FORM
+    let currentmaster = approval.CURRENTMASTER
+    if (!isObjEmpty(jp_form) && !isObjEmpty(currentmaster) &&
+      (jp_form.indexOf(currentmaster) != -1)) {
+
+    } else {
+      currentmaster = mMaster
+    }
+    let type = 0
+    if (this.props.homeState.receiveState.tabIndex === 1) {
+      type = 1
+    }
+    this.props.history.push('/approval/%7B%22' +
+      'master%22%3A%22' + currentmaster
+      + '%22%2C%22nodeId%22%3A' + approval.JP_NODEID
+      + '%2C%22type%22%3A' + type
+      + '%2C%22baseUrl%22%3A%22' + encodeURIComponent(_baseURL)
+      + '%22%7D')
+  }
+
+  onSendItemClick = (index, approval) => {
+    this.cacheScrollState()
+    let jp_form = approval.JP_FORM
+    let currentmaster = approval.CURRENTMASTER
+    if (!isObjEmpty(jp_form) && !isObjEmpty(currentmaster) &&
+      (jp_form.indexOf(currentmaster) != -1)) {
+
+    } else {
+      currentmaster = mMaster
+    }
+    this.props.history.push('/approval/%7B%22' +
+      'master%22%3A%22' + currentmaster
+      + '%22%2C%22nodeId%22%3A' + approval.JP_NODEID
+      + '%2C%22type%22%3A' + 2
+      + '%2C%22baseUrl%22%3A%22' + encodeURIComponent(_baseURL)
+      + '%22%7D')
+  }
+
+  cacheScrollState () {
+    // saveNewState({
+    //   scrollTop: ReactDOM.findDOMNode(this.newList).parentNode.scrollTop,
+    // })()
+    saveReceiveState({
+      scrollTop: ReactDOM.findDOMNode(this.todoTab).parentNode.scrollTop,
+      scrollTop2: ReactDOM.findDOMNode(this.doneTab).parentNode.scrollTop,
+    })()
+    saveSendState({
+      scrollTop: ReactDOM.findDOMNode(this.sendList).parentNode.scrollTop,
+    })()
+  }
+
+  loadTodoList = (keyword) => {
+    let { homeState: { receiveState } } = this.props
+    let { listData } = receiveState
+    if (isObjEmpty(listData)) {
+      mTodoIndex = 0
+    }
+    mTodoIndex++
+    if (!this.state.isReceiveTodoLoading) {
+      this.setState({
+        isReceiveTodoRefresh: true,
+      })
+    }
+
+    if (mTodoIndex === 1) {
+      listData.length = 0
+    }
+
+    fetchGet(_baseURL + '/common/desktop/process/uapproval/toDo.action', {
+      pageSize: mPageSize,
+      page: mTodoIndex,
+      keyword: !isObjNull(keyword) ? keyword : receiveState.searchKey,
+    }).then(response => {
+      this.setState({
+        isReceiveTodoLoading: false,
+        isReceiveTodoRefresh: false,
+      })
+      if (response && !isObjEmpty(response.data)) {
+        listData = listData.concat(response.data)
+      } else {
+        if (mTodoIndex > 1) {
+          mTodoIndex--
+        }
+      }
+      saveReceiveState({
+        hasMore1: !(isObjNull(response.data)
+          || response.data.length < mPageSize),
+        listData,
+        pageIndex: mTodoIndex,
+        todoCount: getIntValue(response, 'totalCount'),
+      })()
+    }).catch(error => {
+      if (mTodoIndex > 1) {
+        mTodoIndex--
+      }
+      saveReceiveState({
+        hasMore1: false,
+        listData,
+        pageIndex: mTodoIndex,
+      })()
+      this.setState({
+        isReceiveTodoLoading: false,
+        isReceiveTodoRefresh: false,
+      })
+      if (typeof error === 'string') {
+        message.error(error)
+      } else {
+        message.error('待审批列表请求异常')
+      }
+    })
+  }
+
+  loadDoneList = (keyword) => {
+    let { homeState: { receiveState } } = this.props
+    let { listData2 } = receiveState
+    if (isObjEmpty(listData2)) {
+      mDoneIndex = 0
+    }
+    mDoneIndex++
+    if (!this.state.isReceiveDoneLoading) {
+      this.setState({
+        isReceiveDoneRefresh: true,
+      })
+    }
+
+    if (mDoneIndex === 1) {
+      listData2.length = 0
+    }
+
+    fetchGet(_baseURL + '/common/desktop/process/uapproval/alreadyDo.action', {
+      pageSize: mPageSize,
+      page: mDoneIndex,
+      keyword: !isObjNull(keyword) ? keyword : receiveState.searchKey,
+      isMobile: 1,
+      _do: 1,
+    }).then(response => {
+      this.setState({
+        isReceiveDoneLoading: false,
+        isReceiveDoneRefresh: false,
+      })
+      if (response && !isObjEmpty(response.data)) {
+        listData2 = listData2.concat(response.data)
+      } else {
+        if (mDoneIndex > 1) {
+          mDoneIndex--
+        }
+      }
+      saveReceiveState({
+        hasMore2: !(isObjNull(response.data)
+          || response.data.length < mPageSize),
+        listData2,
+        pageIndex: mDoneIndex,
+      })()
+    }).catch(error => {
+      if (mDoneIndex > 1) {
+        mDoneIndex--
+      }
+      saveReceiveState({
+        hasMore2: false,
+        listData2,
+        pageIndex: mDoneIndex,
+      })()
+      this.setState({
+        isReceiveDoneLoading: false,
+        isReceiveDoneRefresh: false,
+      })
+      if (typeof error === 'string') {
+        message.error(error)
+      } else {
+        message.error('已审批列表请求异常')
+      }
+    })
+  }
+
+  loadSendList = (keyword) => {
+    let { homeState: { sendState } } = this.props
+    let { sendList } = sendState
+    if (isObjEmpty(sendList)) {
+      mSendIndex = 0
+    }
+    mSendIndex++
+    if (!this.state.isSendLoading) {
+      this.setState({
+        isSendRefresh: true,
+      })
+    }
+
+    if (mSendIndex === 1) {
+      sendList.length = 0
+    }
+
+    fetchGet(
+      _baseURL + '/common/desktop/process/uapproval/alreadyLaunch.action',
+      {
+        pageSize: mPageSize,
+        page: mSendIndex,
+        keyword: !isObjNull(keyword) ? keyword : sendState.searchKey,
+        isMobile: 1,
+        _do: 1,
+      }).then(response => {
+      this.setState({
+        isSendLoading: false,
+        isSendRefresh: false,
+      })
+      if (response && !isObjEmpty(response.data)) {
+        sendList = sendList.concat(response.data)
+      } else {
+        if (mSendIndex > 1) {
+          mSendIndex--
+        }
+      }
+      saveSendState({
+        sendHasMore: !(isObjNull(response.data)
+          || response.data.length < mPageSize),
+        sendList,
+        pageIndex: mSendIndex,
+      })()
+    }).catch(error => {
+      if (mSendIndex > 1) {
+        mSendIndex--
+      }
+      saveSendState({
+        sendHasMore: false,
+        sendList,
+        pageIndex: mSendIndex,
+      })()
+      this.setState({
+        isSendLoading: false,
+        isSendRefresh: false,
+      })
+      if (typeof error === 'string') {
+        message.error(error)
+      } else {
+        message.error('列表请求异常')
+      }
+    })
+  }
+}
+
+let mapStateToProps = (state) => ({
+  homeState: { ...state.approvalState },
+})
+
+let mapDispatchToProps = (dispatch) => ({})
+
+export default connect(mapStateToProps, mapDispatchToProps)(ApprovalHome)

+ 2 - 0
uas-office-web/uas-mobile/src/pages/private/homePage/HomePage.jsx

@@ -16,6 +16,7 @@ import { clearFormState } from '../../../redux/actions/formState'
 import { clearScheduleState } from '../../../redux/actions/scheduleState'
 import { forceVisible } from 'react-lazyload'
 import { clearApprovalHomeState } from '../../../redux/actions/approvalState'
+import { clearSalaryState } from '../../../redux/actions/salaryState'
 import introJs from 'intro.js'
 
 /**
@@ -39,6 +40,7 @@ class HomePage extends Component {
     clearFormState()
     clearScheduleState()
     clearApprovalHomeState()
+    clearSalaryState()
 
     requestUserInfo()
 

+ 141 - 0
uas-office-web/uas-mobile/src/pages/private/salaryQuery/SalaryDetail.jsx

@@ -0,0 +1,141 @@
+/**
+ * Created by Hujs on 2021/11/15
+ * Desc: 工资条明细
+ */
+
+import React, { Component } from 'react'
+import { connect } from 'react-redux'
+import './salary-query.less'
+import {
+    InputItem,
+    Button,
+    Toast,
+} from 'antd-mobile'
+import { isObjEmpty } from '../../../utils/common/common.util'
+import FormLine from '../../../components/common/formNew/FormLine'
+import { fetchPostObj, fetchGet, fetchPostForm } from '../../../utils/common/fetchRequest'
+import { API } from '../../../configs/api.config'
+import { message, Empty } from 'antd'
+import { saveSalaryState } from '../../../redux/actions/salaryState'
+
+class SalaryDetail extends Component {
+
+    constructor() {
+        super()
+
+        this.state = {
+
+        }
+    }
+
+    componentDidMount() {
+        document.title = '工资条明细'
+    }
+
+    componentWillUnmount() {
+    }
+
+    render() {
+        const { salarsyState: { salaryConfig, salaryData } } = this.props
+        const date = this.props.match.params.date
+        let formItems = this.getFormItems()
+        return (
+            <div className='com-column-flex-root'
+                style={{ height: '100%' }}>
+                {
+                    date ? <div className="salary-panel-date">{date + '月工资'}</div> : null
+                }
+                {formItems}
+                <div className="salary-btn-panel">
+                    {
+                        salaryConfig.length > 0
+                            ? (salaryData.sl_result == 0
+                                ? (<Button
+                                    className='salary-btn-panel-button'
+                                    type="primary"
+                                    onClick={this.onSignature}
+                                    inline>确定签收</Button>)
+                                : (
+                                    <Button
+                                        className='salary-btn-panel-button'
+                                        type="primary"
+                                        disabled
+                                        inline>已签收</Button>
+                                ))
+                            : null
+                    }
+                </div>
+            </div>
+        )
+    }
+
+    getFormItems = () => {
+        let { salarsyState: { salaryConfig, salaryData } } = this.props;
+        let formItems = [];
+        if (!isObjEmpty(salaryConfig)) {
+            salaryConfig.forEach((item, index) => {
+                let val = '';
+                for (let key in salaryData) {
+                    if (key == item.Field) {
+                        val = salaryData[key];
+                    }
+                }
+                formItems.push(
+                    <FormLine
+                        key={index} caption={item.Caption}>
+                        <InputItem
+                            type='text'
+                            value={val}
+                            editable={false}
+                        />
+                    </FormLine>
+                )
+            })
+        }
+        if (salaryConfig.length == 0) {
+            return <div style={{ marginTop: 100 }}>
+                <Empty />
+            </div>
+
+        }
+        return formItems
+    }
+
+    onSignature = () => {
+        let { salarsyState: { salaryData }, userState: { userCode, accountCode } } = this.props;
+        let id = salaryData.sl_id;
+        Toast.loading('正在签收', 0)
+        fetchPostForm(API.CONFIRM_SALARYBACK, {
+            sl_id: id,
+            result: true,
+            emcode: userCode,
+            master: accountCode
+        }).then(response => {
+            if (response.success) {
+                Toast.hide();
+                message.success('签收工资条成功');
+                salaryData.sl_result = 1;
+                saveSalaryState({
+                    salaryData
+                })
+            }
+        }).catch(error => {
+            Toast.hide();
+            if (typeof error === 'string') {
+                message.error(error)
+            } else {
+                message.error('签收工资条失败')
+            }
+        })
+    }
+
+
+}
+
+
+let mapStateToProps = (state) => ({
+    salarsyState: state.salaryState,
+    userState: state.userState,
+})
+
+export default connect(mapStateToProps)(SalaryDetail)

+ 395 - 0
uas-office-web/uas-mobile/src/pages/private/salaryQuery/SalaryQuery.jsx

@@ -0,0 +1,395 @@
+/**
+ * Created by Hujs on 2021/11/11
+ * Desc: 工资条查询
+ */
+
+import React, { Component } from 'react'
+import { connect } from 'react-redux'
+import './salary-query.less'
+import moment from 'moment'
+import {
+    InputItem,
+    Icon,
+    DatePicker,
+    Button,
+    Modal,
+    List,
+    Toast,
+    WingBlank,
+    WhiteSpace
+} from 'antd-mobile'
+import { isObjEmpty, isObjNull } from '../../../utils/common/common.util'
+import FormInput from '../../../components/common/formNew/FormInput'
+import FormLine from '../../../components/common/formNew/FormLine'
+import { fetchPostObj, fetchGet, fetchPostForm } from '../../../utils/common/fetchRequest'
+import { API } from '../../../configs/api.config'
+import { message } from 'antd'
+import { clearSalaryState, saveSalaryState } from '../../../redux/actions/salaryState'
+
+let maxTime = 60;
+const prompt = Modal.prompt
+
+class SalaryQuery extends Component {
+
+    constructor() {
+        super()
+
+        this.state = {
+            phone: null,
+            veCode: null,
+            period: new Date(),
+            btnText: '获取验证码',
+            btnBool: false,
+            password: null
+        }
+    }
+
+    componentDidMount() {
+        clearSalaryState()
+        document.title = '工资条'
+        let { userState: { userCode, accountCode } } = this.props;
+        this.promptAlert1 = prompt('提示', '请先输入手机号码', [
+            {
+                text: '确定',
+                onPress: value => new Promise((resolve, reject) => {
+                    let reg = /^1[3|4|5|8][0-9]\d{4,8}$/
+                    if (value == '' || value == undefined) {
+                        Toast.info('请输入手机号码', 1);
+                        reject();
+                    } else if (!reg.test(value)) {
+                        Toast.info('请输入正确的手机号码', 1);
+                        reject();
+                    } else {
+                        Toast.loading('校验中', 0)
+                        this.fetchPostForm(API.CHECK_PASSWORD, {
+                            phone: value,
+                            emcode: userCode,
+                            master: accountCode
+                        }).then(response => {
+                            Toast.hide()
+                            this.setState({
+                                phone: value
+                            }, () => {
+                                if (!response.success) {
+                                    this.setQueryCode();
+                                }
+                            })
+                            resolve();
+                        }).catch(error => {
+                            Toast.hide()
+                            if (typeof error === 'string') {
+                                message.error(error)
+                            } else {
+                                message.error('校验手机号是否设置查询密码失败')
+                            }
+                            reject();
+                        })
+
+                    }
+
+                }),
+            },
+        ], 'default')
+    }
+
+    componentWillUnmount() {
+        clearInterval(this.timer);
+        maxTime = 60;
+        Toast.hide();
+        this.promptAlert1 && this.promptAlert1.close();
+        this.promptAlert2 && this.promptAlert2.close();
+    }
+
+    render() {
+        const { phone, period, btnBool, btnText } = this.state
+        return (
+            <div className='com-column-flex-root'
+                style={{ height: '100%' }}>
+                <div className='com-column-flex-root'
+                    style={{ flex: 1 }}>
+                    <FormLine caption={'期间'} arrow>
+                        <DatePicker
+                            locale={{
+                                okText: '确定',
+                                dismissText: '取消',
+                            }}
+                            mode={'month'}
+                            extra={'请选择期间'}
+                            value={period}
+                            format={(value) => {
+                                return this.getCustomDate(value)
+                            }}
+                            onChange={this.onDateChange}
+                        >
+                            <DatePickerCustom>
+                                <div style={{ flex: 1 }}></div>
+                            </DatePickerCustom>
+                        </DatePicker>
+                    </FormLine>
+                    <FormLine caption={'手机号'}>
+                        <InputItem
+                            type='phone'
+                            placeholder='请输入手机号'
+                            value={phone}
+                            editable={false}
+                        />
+                    </FormLine>
+                    <FormLine caption={'查询密码'}>
+                        <InputItem
+                            type='password'
+                            placeholder='请输入查询密码'
+                            clear
+                            onChange={this.onPasswordChange}
+                        />
+                    </FormLine>
+                    <FormLine caption={'验证码'} extraClassName=' form-input-flex'>
+                        <InputItem
+                            type='digit'
+                            placeholder='请输入验证码'
+                        />
+                        <Button
+                            className='form-verification-code'
+                            type="ghost"
+                            inline
+                            size="small"
+                            onClick={this.getVeriCode}
+                            disabled={btnBool}
+                        >{btnText}</Button>
+                    </FormLine>
+                    <Button
+                        type={'primary'}
+                        style={{
+                            margin: '60px 24px',
+                            height: '36px',
+                            lineHeight: '36px',
+                            fontSize: '16px',
+                        }}
+                        onClick={this.onQueryData}>查询</Button>
+                </div>
+
+
+            </div>
+        )
+    }
+
+    fetchPostForm = (url, params, header) => {
+        if (window.navigator.onLine == false) {
+            return Promise.reject('网络连接失败,请检查网络连接')
+        }
+        if (isObjNull(header)) {
+            header = {}
+        }
+        let formData = new FormData()
+        if (params) {
+            for (let key in params) {
+                // if ((typeof params[key]) === 'string') {
+                //     formData.append(key, encodeURI(params[key].toString()))
+                // } else {
+                formData.append(key, params[key])
+                // }
+            }
+        }
+        const request = fetch(url, {
+            method: 'POST',
+            body: formData,
+            mode: 'cors',
+            credentials: 'include',
+            // cache: "force-cache",
+            headers: new Headers({
+                'Accept': 'application/json',
+                // "Content-Type": "application/x-www-form-urlencoded; charset=utf-8",
+                // "Authorization": userInfo.token,
+                ...header,
+            }),
+        })
+
+        return this.fetchResult(request)
+    }
+
+    fetchResult = request => {
+        try {
+            return request.then(response => {
+                if (response.status == 200) {
+                    return response
+                } else {
+                    throw response
+                }
+            }).catch(error => {
+                if (error.json) {
+                    return error.json()
+                } else {
+                    return Promise.reject('请求异常')
+                }
+            }).then(result => {
+                if (result.status == 200) {
+                    return result.json()
+                } else {
+                    if (result.exceptionInfo || result.message) {
+                        if ((result.exceptionInfo || result.message).length > 80) {
+                            throw '接口请求异常'
+                        } else {
+                            throw (result.exceptionInfo || result.message).replace(
+                                /<[\/\!]*[^<>]*>/ig, '')
+                        }
+                    } else {
+                        throw result
+                    }
+                }
+            })
+        } catch (e) {
+            return Promise.reject('请求异常')
+        }
+    }
+
+    getCustomDate = date => {
+        let dateValue = moment(date).format('YYYYMM');
+        return dateValue
+    }
+    onDateChange = date => {
+        let dateValue = new Date(date)
+        this.setState({
+            period: dateValue
+        })
+    }
+    onPasswordChange = val => {
+        this.setState({
+            password: val
+        })
+    }
+
+    setQueryCode = () => {
+        let { phone } = this.state
+        let { userState: { userCode, accountCode } } = this.props;
+        this.promptAlert2 = prompt('首次使用,请设置查询密码', null, [
+            {
+                text: '确定',
+                onPress: value => new Promise((resolve, reject) => {
+                    if (value.length > 20) {
+                        Toast.info('请输入20位以内的密码', 1);
+                        reject();
+                    } else {
+                        Toast.loading('设置中', 0)
+                        fetchPostForm(API.CHANGE_PASSWORD, {
+                            password: value,
+                            phone: phone,
+                            emcode: userCode,
+                            master: accountCode
+                        }).then(response => {
+                            if (response.success) {
+                                Toast.info('设置查询密码成功', 1);
+                                resolve();
+                            } else {
+                                Toast.info('设置查询密码失败', 1);
+                                reject()
+                            }
+                            Toast.hide()
+                        }).catch(error => {
+                            Toast.hide()
+                            if (typeof error === 'string') {
+                                message.error(error)
+                            } else {
+                                message.error('设置查询密码失败')
+                            }
+                            reject();
+                        })
+                    }
+
+                }),
+            },
+        ], 'default', null, ['请输入查询密码(限20位)'])
+    }
+
+    getVeriCode = () => {
+        let { phone } = this.state
+        this.timer = setInterval(() => {
+            if (maxTime > 0) {
+                --maxTime
+                this.setState({
+                    btnText: '重新获取' + maxTime,
+                    btnBool: true
+                })
+            } else {
+                maxTime = 60;
+                clearInterval(this.timer)
+                this.setState({
+                    btnText: '获取验证码',
+                    btnBool: false
+                })
+            }
+        }, 1000)
+
+        fetchPostForm(API.SEND_VERIFICATIONCODE, {
+            phone: phone
+        }).then(response => {
+            if (response.success) {
+                this.setState({
+                    veCode: response.vecode
+                })
+            }
+        }).catch(error => {
+            if (typeof error === 'string') {
+                message.error(error)
+            } else {
+                message.error('获取验证码失败')
+            }
+        })
+    }
+
+    onQueryData = () => {
+        let { phone, veCode, period, password } = this.state
+        let { userState: { userCode, accountCode } } = this.props;
+        let date = moment(period).format('YYYY-MM')
+        if (!veCode) {
+            Toast.info('请输入验证码', 1);
+            return false
+        } else if (!password) {
+            Toast.info('请输入密码', 1);
+            return false
+        } else {
+            Toast.loading('查询中', 0)
+            fetchPostForm(API.GET_SALARY, {
+                date: date,
+                password: password,
+                phone: phone,
+                vecode: veCode,
+                emcode: userCode,
+                master: accountCode
+            }).then(response => {
+                Toast.hide()
+                if (response.success) {
+                    saveSalaryState({
+                        salaryConfig: response.salary.configs,
+                        salaryData: response.salary.data
+                    })
+                    this.props.history.push(
+                        '/salary/salaryDetail/' + date)
+                }
+            }).catch(error => {
+                Toast.hide()
+                if (typeof error === 'string') {
+                    message.error(error)
+                } else {
+                    message.error('查询数据失败')
+                }
+            })
+        }
+    }
+
+}
+const DatePickerCustom = ({ extra, onClick, children }) => (
+    <div onClick={onClick}>
+        {children}
+        <span style={{
+            float: 'right',
+            color: '#000',
+            height: '32px',
+            lineHeight: '32px',
+        }}>{extra}</span>
+    </div>
+)
+
+let mapStateToProps = (state) => ({
+    userState: state.userState,
+})
+
+export default connect(mapStateToProps)(SalaryQuery)

+ 43 - 0
uas-office-web/uas-mobile/src/pages/private/salaryQuery/salary-query.less

@@ -0,0 +1,43 @@
+.com-column-flex-root{
+    position: relative;
+    .form-input-flex{
+        display: flex;
+        justify-content:flex-end;
+        .form-verification-code{
+            padding:4px;
+            width:100px;
+            font-size: 12px !important;
+            line-height: 25px !important;
+            height:32px !important;
+            position: static;
+            border:1px solid #007aff;
+        }
+    }
+    .salary-panel-date{
+      font-size: 16px;
+      margin:4px;
+      color:#757276;
+    }
+    .salary-btn-panel {
+        width: 100%;
+        background: #fff;
+        position: fixed;
+        bottom: 0px;
+        z-index: 99;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        justify-content: center;
+    
+        .salary-btn-panel-button {
+          flex: 1;
+          margin: 12px;
+          border: 1px solid #108ee9;
+    
+          &:before {
+            border: none !important;
+          }
+        }
+    
+      }
+}

+ 31 - 0
uas-office-web/uas-mobile/src/redux/actions/salaryState.js

@@ -0,0 +1,31 @@
+/**
+ * Created by Hujs on 2021/11/15
+ * Desc: 工资条
+ */
+import store from '../store/store'
+import {
+    SAVE_SALARY_STATE,
+    CLEAR_SALARY_STATE,
+} from '../constants/actionTypes'
+
+/**
+ * Created by Hujs on 2021/11/15
+ * Desc: 储存工资条数据
+ */
+export const saveSalaryState = (data) => {
+    return store.dispatch({
+        type: SAVE_SALARY_STATE,
+        ...data,
+    })
+}
+
+/**
+ * 清除工资条数据
+ * @returns {Function}
+ */
+export const clearSalaryState = () => {
+    return store.dispatch({
+        type: CLEAR_SALARY_STATE,
+    })
+}
+

+ 60 - 56
uas-office-web/uas-mobile/src/redux/constants/actionTypes.js

@@ -1,56 +1,60 @@
-/**
- * Created by RaoMeng on 2020/10/22
- * Desc: action操作标识常量
- */
-
-/**********************************主页********************************************/
-export const CLEAR_HOME_STATE = 'CLEAR_HOME_STATE'
-export const FRESH_HOME_STATE = 'FRESH_HOME_STATE'
-
-export const SAVE_USER_STATE = 'SAVE_USER_STATE'
-export const CLEAR_USER_STATE = 'CLEAR_USER_STATE'
-
-/**********************************首页********************************************/
-export const CLEAR_MAIN_STATE = 'CLEAR_MAIN_STATE'
-export const FRESH_MAIN_STATE = 'FRESH_MAIN_STATE'
-
-/**********************************审批********************************************/
-export const FRESH_APPROVAL_HOME_STATE = 'FRESH_APPROVAL_HOME_STATE'
-export const NEW_TAB_STATE = 'NEW_TAB_STATE'
-export const RECEIVE_TAB_STATE = 'RECEIVE_TAB_STATE'
-export const SEND_TAB_STATE = 'SEND_TAB_STATE'
-export const CLEAR_NEW_STATE = 'CLEAR_NEW_STATE'
-export const CLEAR_RECEIVE_STATE = 'CLEAR_RECEIVE_STATE'
-export const CLEAR_SEND_STATE = 'CLEAR_SEND_STATE'
-export const CLEAR_APPROVAL_HOME_STATE = 'CLEAR_APPROVAL_HOME_STATE'
-
-/**********************************列表********************************************/
-export const SAVE_LIST_STATE = 'SAVE_LIST_STATE'
-export const CLEAR_LIST_STATE = 'CLEAR_LIST_STATE'
-
-/**********************************应用********************************************/
-export const REFRESH_DOC_LIST = 'REFRESH_DOC_LIST'
-export const CLEAR_DOC_STATE = 'CLEAR_DOC_STATE'
-export const REFRESH_DOC_COUNT = 'REFRESH_DOC_COUNT'
-
-/**********************************报表********************************************/
-export const REFRESH_REPORT_LIST = 'REFRESH_REPORT_LIST'
-export const CLEAR_REPORT_STATE = 'CLEAR_REPORT_STATE'
-
-/*********************************通用表单******************************************/
-export const FILTER_STATE = 'FILTER_STATE'
-export const BILL_STATE = 'BILL_STATE'
-
-export const REFRESH_FORM_STATE = 'REFRESH_FORM_STATE'
-export const CLEAR_FORM_STATE = 'CLEAR_FORM_STATE'
-export const CLEAR_FILTER_STATE = 'CLEAR_FILTER_STATE'
-export const CLEAR_BILL_STATE = 'CLEAR_BILL_STATE'
-
-/**********************************看板图表*****************************************/
-export const CLEAR_CHART_STATE = 'CLEAR_CHART_STATE'
-export const SAVE_CHART_STATE = 'SAVE_CHART_STATE'
-
-/**********************************日程*********************************************/
-export const CLEAR_SCHEDULE_STATE = 'CLEAR_SCHEDULE_STATE'
-export const SAVE_SCHEDULE_STATE = 'SAVE_SCHEDULE_STATE'
-
+/**
+ * Created by RaoMeng on 2020/10/22
+ * Desc: action操作标识常量
+ */
+
+/**********************************主页********************************************/
+export const CLEAR_HOME_STATE = 'CLEAR_HOME_STATE'
+export const FRESH_HOME_STATE = 'FRESH_HOME_STATE'
+
+export const SAVE_USER_STATE = 'SAVE_USER_STATE'
+export const CLEAR_USER_STATE = 'CLEAR_USER_STATE'
+
+/**********************************首页********************************************/
+export const CLEAR_MAIN_STATE = 'CLEAR_MAIN_STATE'
+export const FRESH_MAIN_STATE = 'FRESH_MAIN_STATE'
+
+/**********************************审批********************************************/
+export const FRESH_APPROVAL_HOME_STATE = 'FRESH_APPROVAL_HOME_STATE'
+export const NEW_TAB_STATE = 'NEW_TAB_STATE'
+export const RECEIVE_TAB_STATE = 'RECEIVE_TAB_STATE'
+export const SEND_TAB_STATE = 'SEND_TAB_STATE'
+export const CLEAR_NEW_STATE = 'CLEAR_NEW_STATE'
+export const CLEAR_RECEIVE_STATE = 'CLEAR_RECEIVE_STATE'
+export const CLEAR_SEND_STATE = 'CLEAR_SEND_STATE'
+export const CLEAR_APPROVAL_HOME_STATE = 'CLEAR_APPROVAL_HOME_STATE'
+
+/**********************************列表********************************************/
+export const SAVE_LIST_STATE = 'SAVE_LIST_STATE'
+export const CLEAR_LIST_STATE = 'CLEAR_LIST_STATE'
+
+/**********************************应用********************************************/
+export const REFRESH_DOC_LIST = 'REFRESH_DOC_LIST'
+export const CLEAR_DOC_STATE = 'CLEAR_DOC_STATE'
+export const REFRESH_DOC_COUNT = 'REFRESH_DOC_COUNT'
+
+/**********************************报表********************************************/
+export const REFRESH_REPORT_LIST = 'REFRESH_REPORT_LIST'
+export const CLEAR_REPORT_STATE = 'CLEAR_REPORT_STATE'
+
+/*********************************通用表单******************************************/
+export const FILTER_STATE = 'FILTER_STATE'
+export const BILL_STATE = 'BILL_STATE'
+
+export const REFRESH_FORM_STATE = 'REFRESH_FORM_STATE'
+export const CLEAR_FORM_STATE = 'CLEAR_FORM_STATE'
+export const CLEAR_FILTER_STATE = 'CLEAR_FILTER_STATE'
+export const CLEAR_BILL_STATE = 'CLEAR_BILL_STATE'
+
+/**********************************看板图表*****************************************/
+export const CLEAR_CHART_STATE = 'CLEAR_CHART_STATE'
+export const SAVE_CHART_STATE = 'SAVE_CHART_STATE'
+
+/**********************************日程*********************************************/
+export const CLEAR_SCHEDULE_STATE = 'CLEAR_SCHEDULE_STATE'
+export const SAVE_SCHEDULE_STATE = 'SAVE_SCHEDULE_STATE'
+
+/**********************************工资条********************************************/
+export const CLEAR_SALARY_STATE = 'CLEAR_SALARY_STATE'
+export const SAVE_SALARY_STATE = 'SAVE_SALARY_STATE'
+

+ 2 - 0
uas-office-web/uas-mobile/src/redux/reducers/index.js

@@ -10,6 +10,7 @@ import redFormState from './redFormState'
 import redChartState from './redChartState'
 import redScheduleState from './redScheduleState'
 import redApprovalState from './redApprovalState'
+import redSalaryState from './redSalaryState'
 
 /**
  * Created by RaoMeng on 2020/11/9
@@ -27,4 +28,5 @@ export const appReducer = combineReducers({
   chartState: redChartState,
   scheduleState: redScheduleState,
   approvalState: redApprovalState,
+  salaryState: redSalaryState
 })

+ 29 - 0
uas-office-web/uas-mobile/src/redux/reducers/redSalaryState.js

@@ -0,0 +1,29 @@
+import { SAVE_SALARY_STATE, CLEAR_SALARY_STATE } from '../constants/actionTypes'
+
+const initSalaryState = {
+  salaryConfig: [],
+  salaryData: {}
+}
+
+const redSalaryState = (state = initSalaryState, action) => {
+  if (action === undefined) {
+    return state
+  }
+
+  switch (action.type) {
+    case SAVE_SALARY_STATE:
+      //获取个人信息
+      return {
+        ...state,
+        ...action,
+      }
+    case CLEAR_SALARY_STATE:
+      //清空个人信息
+      return initSalaryState
+    default:
+      return state
+  }
+
+}
+
+export default redSalaryState

+ 1 - 0
uas-office-web/uas-mobile/src/redux/reducers/redUserState.js

@@ -11,6 +11,7 @@ const initUserState = {
   type: '',
   userName: '',
   userPost: '',
+  userCode:''
 }
 
 const redUserState = (state = initUserState, action) => {

+ 2 - 0
uas-office-web/uas-mobile/src/redux/utils/redux.utils.js

@@ -7,6 +7,7 @@ import { clearUserInfo } from '../actions/userState'
 import { clearChartState } from '../actions/chartState'
 import { clearScheduleState } from '../actions/scheduleState'
 import { clearApprovalHomeState } from '../actions/approvalState'
+import { clearSalaryState } from '../actions/salaryState'
 
 /**
  * Created by RaoMeng on 2020/12/14
@@ -26,4 +27,5 @@ export function clearAllRedux () {
   clearChartState()
   clearScheduleState()
   clearApprovalHomeState()
+  clearSalaryState()
 }