|
@@ -1,7 +1,8 @@
|
|
|
import React, { Component } from 'react';
|
|
|
import Taro from '@tarojs/taro';
|
|
|
-import { View ,Picker,ScrollView} from '@tarojs/components'
|
|
|
+import { View, Picker, ScrollView } from '@tarojs/components'
|
|
|
import { getPublicReleaseList } from '../../utils/servers/servers';
|
|
|
+import dayjs from 'dayjs';
|
|
|
import {
|
|
|
AtSearchBar,
|
|
|
AtTabs,
|
|
@@ -10,7 +11,7 @@ import {
|
|
|
AtListItem,
|
|
|
AtIcon
|
|
|
} from 'taro-ui';
|
|
|
-import {clockState} from '../../utils/tools/config';
|
|
|
+import { clockState } from '../../utils/tools/config';
|
|
|
|
|
|
import './index.less';
|
|
|
|
|
@@ -28,7 +29,7 @@ class Examine extends Component {
|
|
|
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
- this.state= {
|
|
|
+ this.state = {
|
|
|
current: 0,
|
|
|
|
|
|
list: [],
|
|
@@ -37,41 +38,68 @@ class Examine extends Component {
|
|
|
|
|
|
examinelist: [],
|
|
|
examinePageNo: 1,
|
|
|
+ seePageNo: 1,
|
|
|
+ seeList: [],
|
|
|
examineListState: 'LOADING',
|
|
|
-
|
|
|
+ seeListState: 'LOADING',
|
|
|
starts: {},
|
|
|
clockInStarts: '',
|
|
|
|
|
|
-
|
|
|
- rangeStartVal1:'',
|
|
|
- rangeEndVal1:'',
|
|
|
- starts1:{},
|
|
|
- clockInStarts1:''
|
|
|
+ rangeStartVal2:'',
|
|
|
+ rangeEndVal2: '',
|
|
|
+ starts2: {},
|
|
|
+ clockInStarts2: '',
|
|
|
+ rangeStartVal1: '',
|
|
|
+ rangeEndVal1: '',
|
|
|
+ starts1: {},
|
|
|
+ clockInStarts1: '',
|
|
|
+ isPickerRender:false,
|
|
|
+ rangeStartMinuteVal:'',
|
|
|
+ rangeEndMinuteVal1:'',
|
|
|
+ rangeStartMinuteVal1:'',
|
|
|
+ rangeEndMinuteVal2:'',
|
|
|
+ rangeStartMinuteVal2:'',
|
|
|
+ rangeEndMinuteVal:'',
|
|
|
+ rangeEndVal:'',
|
|
|
+ rangeStartVal:'',
|
|
|
+ validDates:''
|
|
|
}
|
|
|
- this.getPublicReleaseList= this.getPublicReleaseList.bind(this);
|
|
|
- this.getMyList= this.getMyList.bind(this);
|
|
|
- this.getExamineList= this.getExamineList.bind(this);
|
|
|
+ this.getPublicReleaseList = this.getPublicReleaseList.bind(this);
|
|
|
+ this.getMyList = this.getMyList.bind(this);
|
|
|
+ this.getExamineList = this.getExamineList.bind(this);
|
|
|
+ this.getSeeList = this.getSeeList.bind(this);
|
|
|
+ this.onSetPickerTime = this.onSetPickerTime.bind(this);
|
|
|
+ this.onPickerHide = this.onPickerHide.bind(this)
|
|
|
}
|
|
|
|
|
|
- componentDidShow(){
|
|
|
- Taro.eventCenter.on('listOperation',(data)=>{
|
|
|
- if(data.type === 1 && (!isNaN(parseInt(data.index)))){
|
|
|
+ componentDidShow() {
|
|
|
+ Taro.eventCenter.on('listOperation', (data) => {
|
|
|
+ if (data.type === 1 && (!isNaN(parseInt(data.index)))) {
|
|
|
let arr = this.state.examinelist.concat([]);
|
|
|
arr[data.index] = {
|
|
|
...arr[data.index],
|
|
|
...data
|
|
|
}
|
|
|
this.setState({
|
|
|
- examinelist:arr
|
|
|
+ examinelist: arr
|
|
|
})
|
|
|
- }else if(data.type === 0 && (!isNaN(parseInt(data.index)))){
|
|
|
+ } else if (data.type === 0 && (!isNaN(parseInt(data.index)))) {
|
|
|
let arr = this.state.list.concat([]);
|
|
|
arr[data.index] = {
|
|
|
...arr[data.index],
|
|
|
...data
|
|
|
}
|
|
|
this.setState({
|
|
|
- list:arr
|
|
|
+ list: arr
|
|
|
+ })
|
|
|
+ } else if(data.type === 2 && (!isNaN(parseInt(data.index)))) {
|
|
|
+ let arr = this.state.seeList.concat([]);
|
|
|
+ arr[data.index] = {
|
|
|
+ ...arr[data.index],
|
|
|
+ ...data
|
|
|
+ }
|
|
|
+ this.setState({
|
|
|
+ seeList: arr
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -81,79 +109,111 @@ class Examine extends Component {
|
|
|
await this.getPublicReleaseList();
|
|
|
}
|
|
|
|
|
|
- onPullDownRefresh(){
|
|
|
+ onPullDownRefresh() {
|
|
|
this.getPublicReleaseList();
|
|
|
}
|
|
|
|
|
|
- onReachBottom(){
|
|
|
+ onReachBottom() {
|
|
|
this.getPublicReleaseList(true);
|
|
|
}
|
|
|
|
|
|
- onTabItemTap(obj){
|
|
|
- if(obj.index === 1){
|
|
|
+ onTabItemTap(obj) {
|
|
|
+ if (obj.index === 1) {
|
|
|
this.onTabTap();
|
|
|
}
|
|
|
}
|
|
|
+ onPickerHide(){
|
|
|
+ this.setState({
|
|
|
+ isPickerRender: false,
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
- async onTabTap(){
|
|
|
+async onSetPickerTime(val){
|
|
|
+ let data = val.detail;
|
|
|
+ if(this.state.current === 0) {
|
|
|
+ await this.setState({
|
|
|
+ rangeStartMinuteVal: dayjs(data.selectStartTime).format("YYYY-MM-DD"),
|
|
|
+ rangeEndMinuteVal: dayjs(data.selectEndTime).format("YYYY-MM-DD")
|
|
|
+ })
|
|
|
+ await this.getMyList(1);
|
|
|
+ }else if(this.state.current === 1){
|
|
|
+ await this.setState({
|
|
|
+ rangeStartMinuteVal1: dayjs(data.selectStartTime).format("YYYY-MM-DD"),
|
|
|
+ rangeEndMinuteVal1: dayjs(data.selectEndTime).format("YYYY-MM-DD")
|
|
|
+ })
|
|
|
+ await this.getExamineList(1);
|
|
|
+ }else if(this.state.current === 2) {
|
|
|
+ await this.setState({
|
|
|
+ rangeStartMinuteVal2: dayjs(data.selectStartTime).format("YYYY-MM-DD"),
|
|
|
+ rangeEndMinuteVal2: dayjs(data.selectEndTime).format("YYYY-MM-DD")
|
|
|
+ })
|
|
|
+ await this.getSeeList(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ async onTabTap() {
|
|
|
await this.getMyList(1);
|
|
|
await this.getExamineList(1);
|
|
|
+ await this.getSeeList(1);
|
|
|
}
|
|
|
|
|
|
- async getPublicReleaseList (lv){
|
|
|
- if(this.state.current === 0){
|
|
|
+ async getPublicReleaseList(lv) {
|
|
|
+ if (this.state.current === 0) {
|
|
|
await this.getMyList(lv ? this.state.pageNo + 1 : 1);
|
|
|
Taro.stopPullDownRefresh();
|
|
|
- } else if(this.state.current === 1){
|
|
|
+ } else if (this.state.current === 1) {
|
|
|
await this.getExamineList(lv ? this.state.examinePageNo + 1 : 1);
|
|
|
Taro.stopPullDownRefresh();
|
|
|
+ } else if (this.state.current === 2) {
|
|
|
+ console.log(lv,this.state.seePageNo);
|
|
|
+ await this.getSeeList(lv ? this.state.seePageNo + 1 : 1);
|
|
|
+ Taro.stopPullDownRefresh();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- async getMyList(pageNo){
|
|
|
+ async getMyList(pageNo) {
|
|
|
this.setState({
|
|
|
listState: 'LOADING'
|
|
|
})
|
|
|
let data = {
|
|
|
pageNo: pageNo,
|
|
|
pageSize: 10,
|
|
|
- type:'0',
|
|
|
+ type: '0',
|
|
|
|
|
|
- releaseStarts:this.state.rangeStartVal || undefined,
|
|
|
- releaseEnds:this.state.rangeEndVal || undefined,
|
|
|
+ releaseStarts: this.state.rangeStartMinuteVal || undefined,
|
|
|
+ releaseEnds: this.state.rangeEndMinuteVal || undefined,
|
|
|
status: isNaN(parseInt(this.state.starts.id)) ? undefined : String(this.state.starts.id),
|
|
|
- clockIn:this.state.clockInStarts || undefined,
|
|
|
- userName:this.state.searchValue || undefined,
|
|
|
+ clockIn: this.state.clockInStarts || undefined,
|
|
|
+ userName: this.state.searchValue || undefined,
|
|
|
}
|
|
|
- for(let i in data){
|
|
|
- if(!data[i]){
|
|
|
+ for (let i in data) {
|
|
|
+ if (!data[i]) {
|
|
|
delete data[i]
|
|
|
}
|
|
|
}
|
|
|
let msg = await getPublicReleaseList(data);
|
|
|
- if(msg.error.length === 0){
|
|
|
- if(msg.data.totalCount === 0){
|
|
|
+ if (msg.error.length === 0) {
|
|
|
+ if (msg.data.totalCount === 0) {
|
|
|
this.setState({
|
|
|
listState: 'NO_DATA'
|
|
|
})
|
|
|
- }else if(msg.data.totalCount === this.state.list.length && pageNo !== 1){
|
|
|
- Taro.showToast({title:'没有更多数据了',icon:'none'});
|
|
|
+ } else if (msg.data.totalCount === this.state.list.length && pageNo !== 1) {
|
|
|
+ Taro.showToast({ title: '没有更多数据了', icon: 'none' });
|
|
|
this.setState({
|
|
|
listState: 'NO_MORE_DATA'
|
|
|
})
|
|
|
- }else{
|
|
|
- if(msg.data.totalCount === (pageNo === 1 ? msg.data.list : this.state.list.concat(msg.data.list)).length){
|
|
|
+ } else {
|
|
|
+ if (msg.data.totalCount === (pageNo === 1 ? msg.data.list : this.state.list.concat(msg.data.list)).length) {
|
|
|
this.setState({
|
|
|
listState: 'NO_MORE_DATA'
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
this.setState({
|
|
|
- list:pageNo === 1 ? msg.data.list : this.state.list.concat(msg.data.list),
|
|
|
+ list: pageNo === 1 ? msg.data.list : this.state.list.concat(msg.data.list),
|
|
|
pageNo: msg.data.pageNo
|
|
|
})
|
|
|
- }else{
|
|
|
- Taro.showToast({title:msg.error[0].message,icon:'none'});
|
|
|
+ } else {
|
|
|
+ Taro.showToast({ title: msg.error[0].message, icon: 'none' });
|
|
|
this.setState({
|
|
|
listState: msg.error[0].field === '403' ? 'NO_DATA' : 'RELOAD'
|
|
|
})
|
|
@@ -161,154 +221,226 @@ class Examine extends Component {
|
|
|
Taro.stopPullDownRefresh();
|
|
|
}
|
|
|
|
|
|
- async getExamineList(pageNo){
|
|
|
+ async getExamineList(pageNo) {
|
|
|
this.setState({
|
|
|
examineListState: 'LOADING'
|
|
|
})
|
|
|
let data = {
|
|
|
pageNo: pageNo,
|
|
|
pageSize: 10,
|
|
|
- type:'1',
|
|
|
+ type: '1',
|
|
|
|
|
|
- releaseStarts:this.state.rangeStartVal1 || null,
|
|
|
- releaseEnds:this.state.rangeEndVal1 || null,
|
|
|
- status:isNaN(parseInt(this.state.starts1.id)) ? undefined : String(this.state.starts1.id),
|
|
|
- clockIn:this.state.clockInStarts1 || null,
|
|
|
- userName:this.state.searchValue1 || undefined,
|
|
|
+ releaseStarts: this.state.rangeStartMinuteVal1 || null,
|
|
|
+ releaseEnds: this.state.rangeEndMinuteVal1 || null,
|
|
|
+ status: isNaN(parseInt(this.state.starts1.id)) ? undefined : String(this.state.starts1.id),
|
|
|
+ clockIn: this.state.clockInStarts1 || null,
|
|
|
+ userName: this.state.searchValue1 || undefined,
|
|
|
}
|
|
|
- for(let i in data){
|
|
|
- if(!data[i]){
|
|
|
+ for (let i in data) {
|
|
|
+ if (!data[i]) {
|
|
|
delete data[i]
|
|
|
}
|
|
|
}
|
|
|
let msg = await getPublicReleaseList(data);
|
|
|
- if(msg.error.length === 0){
|
|
|
- if(msg.data.totalCount === 0){
|
|
|
+ if (msg.error.length === 0) {
|
|
|
+ if (msg.data.totalCount === 0) {
|
|
|
this.setState({
|
|
|
examineListState: 'NO_DATA'
|
|
|
})
|
|
|
- }else if(msg.data.totalCount === this.state.examinelist.length && pageNo !== 1){
|
|
|
- Taro.showToast({title:'没有更多数据了',icon:'none'});
|
|
|
+ } else if (msg.data.totalCount === this.state.examinelist.length && pageNo !== 1) {
|
|
|
+ Taro.showToast({ title: '没有更多数据了', icon: 'none' });
|
|
|
this.setState({
|
|
|
examineListState: 'NO_MORE_DATA'
|
|
|
})
|
|
|
- }else{
|
|
|
- if(msg.data.totalCount === (pageNo === 1 ? msg.data.list : this.state.examinelist.concat(msg.data.list)).length){
|
|
|
+ } else {
|
|
|
+ if (msg.data.totalCount === (pageNo === 1 ? msg.data.list : this.state.examinelist.concat(msg.data.list)).length) {
|
|
|
this.setState({
|
|
|
examineListState: 'NO_MORE_DATA'
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
this.setState({
|
|
|
- examinelist:pageNo === 1 ? msg.data.list : this.state.examinelist.concat(msg.data.list),
|
|
|
+ examinelist: pageNo === 1 ? msg.data.list : this.state.examinelist.concat(msg.data.list),
|
|
|
examinePageNo: msg.data.pageNo
|
|
|
})
|
|
|
- }else{
|
|
|
- Taro.showToast({title:msg.error[0].message,icon:'none'});
|
|
|
+ } else {
|
|
|
+ Taro.showToast({ title: msg.error[0].message, icon: 'none' });
|
|
|
this.setState({
|
|
|
examineListState: msg.error[0].field === '403' ? 'NO_DATA' : 'RELOAD'
|
|
|
})
|
|
|
}
|
|
|
Taro.stopPullDownRefresh();
|
|
|
}
|
|
|
+ // 查看
|
|
|
+ async getSeeList(pageNo) {
|
|
|
+ console.log(pageNo);
|
|
|
+ this.setState({
|
|
|
+ seeListState: 'LOADING',
|
|
|
+ })
|
|
|
+ console.log(this.state.clockInStarts2);
|
|
|
+ let data = {
|
|
|
+ pageNo: pageNo,
|
|
|
+ pageSize: 10,
|
|
|
+ type: '2',
|
|
|
|
|
|
- onPageScroll(event){
|
|
|
+ releaseStarts: this.state.rangeStartMinuteVal2 || null,
|
|
|
+ releaseEnds: this.state.rangeEndMinuteVal2 || null,
|
|
|
+ status: isNaN(parseInt(this.state.starts2.id)) ? undefined : String(this.state.starts2.id),
|
|
|
+ clockIn: this.state.clockInStarts2 || null,
|
|
|
+ userName: this.state.searchValue2 || undefined,
|
|
|
+ }
|
|
|
+ for (let i in data) {
|
|
|
+ if (!data[i]) {
|
|
|
+ delete data[i]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let msg = await getPublicReleaseList(data);
|
|
|
+ if (msg.error.length === 0) {
|
|
|
+ if (msg.data.totalCount === 0) {
|
|
|
+ this.setState({
|
|
|
+ seeListState: 'NO_DATA'
|
|
|
+ })
|
|
|
+ } else if (msg.data.totalCount === this.state.seeList.length && pageNo !== 1) {
|
|
|
+ Taro.showToast({ title: '没有更多数据了', icon: 'none' });
|
|
|
+ this.setState({
|
|
|
+ seeListState: 'NO_MORE_DATA'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ if (msg.data.totalCount === (pageNo === 1 ? msg.data.list : this.state.seeList.concat(msg.data.list)).length) {
|
|
|
+ this.setState({
|
|
|
+ seeListState: 'NO_MORE_DATA'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.setState({
|
|
|
+ seeList: pageNo === 1 ? msg.data.list : this.state.seeList.concat(msg.data.list),
|
|
|
+ seePageNo: msg.data.pageNo
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ Taro.showToast({ title: msg.error[0].message, icon: 'none' });
|
|
|
+ this.setState({
|
|
|
+ seeListState: msg.error[0].field === '403' ? 'NO_DATA' : 'RELOAD'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ Taro.stopPullDownRefresh();
|
|
|
+ }
|
|
|
+ onPageScroll(event) {
|
|
|
let touchMove = event.scrollTop;
|
|
|
- if(touchMove >= 37){
|
|
|
+ if (touchMove >= 37) {
|
|
|
this.setState({
|
|
|
- openSearch:true
|
|
|
+ openSearch: true
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.setState({
|
|
|
- openSearch:false
|
|
|
+ openSearch: false
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- render () {
|
|
|
+ render() {
|
|
|
return (
|
|
|
<View className='indexPage' >
|
|
|
- <MessageNoticebar/>
|
|
|
+ <MessageNoticebar />
|
|
|
<View className='searchContent'>
|
|
|
<View className='searchTop'>
|
|
|
<AtSearchBar
|
|
|
showActionButton
|
|
|
placeholder='请输入企业名称'
|
|
|
- value={this.state.current === 0 ? this.state.searchValue : this.state.searchValue1}
|
|
|
- onActionClick={()=>{
|
|
|
+ value={this.state.current === 0 ? this.state.searchValue : this.state.current === 1 ? this.state.searchValue1 : this.state.searchValue2}
|
|
|
+ onActionClick={() => {
|
|
|
this.getPublicReleaseList();
|
|
|
}}
|
|
|
- onChange={(value)=>{
|
|
|
- if(this.state.current === 0){
|
|
|
+ onChange={(value) => {
|
|
|
+ if (this.state.current === 0) {
|
|
|
this.setState({
|
|
|
- searchValue:value
|
|
|
+ searchValue: value
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else if(this.state.current === 1) {
|
|
|
this.setState({
|
|
|
- searchValue1:value
|
|
|
+ searchValue1: value
|
|
|
+ })
|
|
|
+ } else if(this.state.current === 2) {
|
|
|
+ this.setState({
|
|
|
+ searchValue2: value
|
|
|
})
|
|
|
}
|
|
|
}}
|
|
|
- onClear={()=>{
|
|
|
- if(this.state.current === 0){
|
|
|
+ onClear={() => {
|
|
|
+ if (this.state.current === 0) {
|
|
|
+ this.setState({
|
|
|
+ searchValue: ''
|
|
|
+ })
|
|
|
+ } else if(this.state.current === 1) {
|
|
|
this.setState({
|
|
|
- searchValue:''
|
|
|
+ searchValue1: ''
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else if(this.state.current === 2) {
|
|
|
this.setState({
|
|
|
- searchValue1:''
|
|
|
+ searchValue2: ''
|
|
|
})
|
|
|
}
|
|
|
}}
|
|
|
/>
|
|
|
</View>
|
|
|
- <ScrollView className={this.state.openSearch ? 'searchBottomLOL' : ''} scrollX style={{width:'100%'}}>
|
|
|
+ <ScrollView className={this.state.openSearch ? 'searchBottomLOL' : ''} scrollX style={{ width: '100%' }}>
|
|
|
<View className='searchBottom'>
|
|
|
- <View className='searchItem' style={{paddingLeft:'5px'}}>
|
|
|
- <Picker value={this.state.current === 0 ? this.state.starts.id : this.state.starts1.id} range={clockState} rangeKey='title' mode='selector' onChange={(e)=>{
|
|
|
- if(this.state.current === 0){
|
|
|
+ <View className='searchItem' style={{ paddingLeft: '5px' }}>
|
|
|
+ <Picker value={this.state.current === 0 ? this.state.starts.id : this.state.current === 1 ? this.state.starts1.id : this.state.starts2.id } range={clockState} rangeKey='title' mode='selector' onChange={(e) => {
|
|
|
+ if (this.state.current === 0) {
|
|
|
+ this.setState({
|
|
|
+ starts: clockState[e.detail.value],
|
|
|
+ }, () => {
|
|
|
+ this.getPublicReleaseList();
|
|
|
+ })
|
|
|
+ } else if(this.state.current === 1) {
|
|
|
this.setState({
|
|
|
- starts:clockState[e.detail.value],
|
|
|
- },()=>{
|
|
|
+ starts1: clockState[e.detail.value],
|
|
|
+ }, () => {
|
|
|
this.getPublicReleaseList();
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else if(this.state.current === 2){
|
|
|
this.setState({
|
|
|
- starts1:clockState[e.detail.value],
|
|
|
- },()=>{
|
|
|
+ starts2: clockState[e.detail.value],
|
|
|
+ }, () => {
|
|
|
this.getPublicReleaseList();
|
|
|
})
|
|
|
}
|
|
|
}}>
|
|
|
{
|
|
|
- (this.state.current === 0 && !this.state.starts.title) || (this.state.current === 1 && !this.state.starts1.title) ?
|
|
|
+ (this.state.current === 0 && !this.state.starts.title) || (this.state.current === 1 && !this.state.starts1.title) || (this.state.current === 2 && !this.state.starts2.title) ?
|
|
|
<View className='shortValuecontent'>
|
|
|
<View className='selectTitle'>审核状态</View>
|
|
|
<View className='iconContent'><AtIcon value='chevron-down' size='10' color='#FFFFFF' /></View>
|
|
|
</View> :
|
|
|
<View className='shortValuecontent'>
|
|
|
<View className='selectValue'>
|
|
|
- {this.state.current === 0? this.state.starts.title: this.state.starts1.title}
|
|
|
+ {this.state.current === 0 ? this.state.starts.title : this.state.current === 1 ? this.state.starts1.title : this.state.starts2.title}
|
|
|
</View>
|
|
|
- <View className='iconContent'/>
|
|
|
+ <View className='iconContent' />
|
|
|
</View>
|
|
|
}
|
|
|
</Picker>
|
|
|
{
|
|
|
- (this.state.current === 0 && this.state.starts.title) || (this.state.current === 1 && this.state.starts1.title) ?
|
|
|
+ (this.state.current === 0 && this.state.starts.title) || (this.state.current === 1 && this.state.starts1.title) || (this.state.current === 2 && this.state.starts2.title) ?
|
|
|
<View className='searchSelectContent'>
|
|
|
- <View className='selectIcon' onClick={(e)=>{
|
|
|
+ <View className='selectIcon' onClick={(e) => {
|
|
|
e.stopPropagation();
|
|
|
- if(this.state.current === 0){
|
|
|
+ if (this.state.current === 0) {
|
|
|
+ this.setState({
|
|
|
+ starts: {}
|
|
|
+ }, () => {
|
|
|
+ this.getPublicReleaseList();
|
|
|
+ })
|
|
|
+ } else if(this.state.current === 1) {
|
|
|
this.setState({
|
|
|
- starts:{}
|
|
|
- },()=>{
|
|
|
+ starts1: {}
|
|
|
+ }, () => {
|
|
|
this.getPublicReleaseList();
|
|
|
})
|
|
|
- }else{
|
|
|
+ }else if(this.state.current === 2) {
|
|
|
this.setState({
|
|
|
- starts1:{}
|
|
|
- },()=>{
|
|
|
+ starts2: {}
|
|
|
+ }, () => {
|
|
|
this.getPublicReleaseList();
|
|
|
})
|
|
|
}
|
|
@@ -318,58 +450,71 @@ class Examine extends Component {
|
|
|
</View> : null
|
|
|
}
|
|
|
</View>
|
|
|
- <View className='searchItem'>
|
|
|
- <Picker value={this.state.current === 0 ? this.state.clockInStarts : this.state.clockInStarts1} range={[
|
|
|
+ <View className='searchItem' >
|
|
|
+ <Picker value={this.state.current === 0 ? this.state.clockInStarts : this.state.current === 1 ? this.state.clockInStarts1 : this.state.clockInStarts2} range={[
|
|
|
'未打卡',
|
|
|
'已打卡'
|
|
|
- ]} mode='selector' onChange={(e)=>{
|
|
|
- if(this.state.current === 0){
|
|
|
+ ]} mode='selector' onChange={(e) => {
|
|
|
+ if (this.state.current === 0) {
|
|
|
+ this.setState({
|
|
|
+ clockInStarts: String(e.detail.value)
|
|
|
+ }, () => {
|
|
|
+ this.getPublicReleaseList();
|
|
|
+ })
|
|
|
+ } else if(this.state.current === 1){
|
|
|
this.setState({
|
|
|
- clockInStarts:String(e.detail.value)
|
|
|
- },()=>{
|
|
|
+ clockInStarts1: String(e.detail.value)
|
|
|
+ }, () => {
|
|
|
this.getPublicReleaseList();
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else if(this.state.current === 2) {
|
|
|
this.setState({
|
|
|
- clockInStarts1:String(e.detail.value)
|
|
|
- },()=>{
|
|
|
+ clockInStarts2: String(e.detail.value)
|
|
|
+ }, () => {
|
|
|
this.getPublicReleaseList();
|
|
|
})
|
|
|
}
|
|
|
}}>
|
|
|
{
|
|
|
- (this.state.current === 0 && !this.state.clockInStarts) || (this.state.current === 1 && !this.state.clockInStarts1) ?
|
|
|
+ (this.state.current === 0 && !this.state.clockInStarts) || (this.state.current === 1 && !this.state.clockInStarts1) || (this.state.current === 2 && !this.state.clockInStarts2) ?
|
|
|
<View className='shortValuecontent'>
|
|
|
<View className='selectTitle'>打卡状态</View>
|
|
|
<View className='iconContent'><AtIcon value='chevron-down' size='10' color='#FFFFFF' /></View>
|
|
|
</View> :
|
|
|
<View className='shortValuecontent'>
|
|
|
<View className='selectValue'>
|
|
|
- {this.state.current === 0? (
|
|
|
+ {this.state.current === 0 ? (
|
|
|
this.state.clockInStarts === '1' ? '已打卡' :
|
|
|
- this.state.clockInStarts === '0' ? '未打卡' :''
|
|
|
- ): this.state.clockInStarts1 === '1' ? '已打卡' :
|
|
|
- this.state.clockInStarts1 === '0' ? '未打卡' :''}
|
|
|
+ this.state.clockInStarts === '0' ? '未打卡' : ''
|
|
|
+ ) : this.state.current === 1 ? (this.state.clockInStarts1 === '1' ? '已打卡' :
|
|
|
+ this.state.clockInStarts1 === '0' ? '未打卡' : '') : this.state.clockInStarts2 === '1' ? '已打卡' :
|
|
|
+ this.state.clockInStarts2 === '0' ? '未打卡' : ''}
|
|
|
</View>
|
|
|
- <View className='iconContent'/>
|
|
|
+ <View className='iconContent' />
|
|
|
</View>
|
|
|
}
|
|
|
</Picker>
|
|
|
{
|
|
|
- (this.state.current === 0 && this.state.clockInStarts) || (this.state.current === 1 && this.state.clockInStarts1) ?
|
|
|
+ (this.state.current === 0 && this.state.clockInStarts) || (this.state.current === 1 && this.state.clockInStarts1) || (this.state.current === 2 && this.state.clockInStarts2) ?
|
|
|
<View className='searchSelectContent'>
|
|
|
- <View className='selectIcon' onClick={(e)=>{
|
|
|
+ <View className='selectIcon' onClick={(e) => {
|
|
|
e.stopPropagation();
|
|
|
- if(this.state.current === 0){
|
|
|
+ if (this.state.current === 0) {
|
|
|
this.setState({
|
|
|
clockInStarts: '',
|
|
|
- },()=>{
|
|
|
+ }, () => {
|
|
|
+ this.getPublicReleaseList();
|
|
|
+ })
|
|
|
+ } else if(this.state.current === 1){
|
|
|
+ this.setState({
|
|
|
+ clockInStarts1: '',
|
|
|
+ }, () => {
|
|
|
this.getPublicReleaseList();
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else if(this.state.current === 2) {
|
|
|
this.setState({
|
|
|
- clockInStarts1:'',
|
|
|
- },()=>{
|
|
|
+ clockInStarts2: '',
|
|
|
+ }, () => {
|
|
|
this.getPublicReleaseList();
|
|
|
})
|
|
|
}
|
|
@@ -379,51 +524,152 @@ class Examine extends Component {
|
|
|
</View> : null
|
|
|
}
|
|
|
</View>
|
|
|
- <View className='searchItem'>
|
|
|
- <Picker mode='date' onChange={(e)=>{
|
|
|
- if(this.state.current === 0){
|
|
|
+ {/* */}
|
|
|
+ {/* 多选时间框 */}
|
|
|
+ <View className='searchItem' onClick={()=>{
|
|
|
+ this.setState({
|
|
|
+ isPickerRender:true
|
|
|
+ })
|
|
|
+ }}>
|
|
|
+ <View>
|
|
|
+ {
|
|
|
+ (this.state.current === 0 && !this.state.rangeStartMinuteVal) || (this.state.current === 1 && !this.state.rangeStartMinuteVal1) ||
|
|
|
+ (this.state.current === 2 && !this.state.rangeStartMinuteVal2) ?
|
|
|
+ <View className='valuecontent' style={{width:'200px'}}>
|
|
|
+ <View className='selectTitle' style={{paddingLeft:'50px'}}>开始及结束时间</View>
|
|
|
+ <View className='iconContent' style={{paddingLeft:'20px'}}><AtIcon value='chevron-down' size='10' color='#FFFFFF' /></View>
|
|
|
+ </View> :
|
|
|
+ <View className='valuecontent' style={{width:'200px'}}>
|
|
|
+ <View className='selectValue' >
|
|
|
+ {this.state.current === 0 ? this.state.rangeStartMinuteVal +"~"+ this.state.rangeEndMinuteVal : this.state.current === 1 ? this.state.rangeStartMinuteVal1 +"~"+ this.state.rangeEndMinuteVal1 : this.state.rangeStartMinuteVal2 +"~"+ this.state.rangeEndMinuteVal2}
|
|
|
+ </View>
|
|
|
+ <View className='iconContent' />
|
|
|
+ </View>
|
|
|
+ }
|
|
|
+ </View>
|
|
|
+ {
|
|
|
+ (this.state.current === 0 && this.state.rangeStartMinuteVal) || (this.state.current === 1 && this.state.rangeStartMinuteVal1)
|
|
|
+ || (this.state.current === 2 && this.state.rangeStartMinuteVal2) ?
|
|
|
+ <View className='searchSelectContent'>
|
|
|
+ <View className='selectIcon' onClick={(e) => {
|
|
|
+ e.stopPropagation();
|
|
|
+ if (this.state.current === 0) {
|
|
|
+ this.setState({
|
|
|
+ rangeStartMinuteVal: '',
|
|
|
+ rangeEndMinuteVal: '',
|
|
|
+ }, () => {
|
|
|
+ this.getPublicReleaseList();
|
|
|
+ })
|
|
|
+ } else if(this.state.current === 1) {
|
|
|
+ this.setState({
|
|
|
+ rangeStartMinuteVal1: '',
|
|
|
+ rangeEndMinuteVal1: '',
|
|
|
+ }, () => {
|
|
|
+ this.getPublicReleaseList();
|
|
|
+ })
|
|
|
+ } else if(this.state.current === 2) {
|
|
|
+ this.setState({
|
|
|
+ rangeStartMinuteVal2: '',
|
|
|
+ rangeEndMinuteVal2: '',
|
|
|
+ }, () => {
|
|
|
+ this.getPublicReleaseList();
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }}>
|
|
|
+ <AtIcon value='close-circle' size='10' color='#FFFFFF' />
|
|
|
+ </View>
|
|
|
+ </View> : null
|
|
|
+ }
|
|
|
+ </View>
|
|
|
+ <timePicker
|
|
|
+ config={{
|
|
|
+ endDate: true,
|
|
|
+ column: "minute",
|
|
|
+ dateLimit: false,
|
|
|
+ // initStartTime: "2019-01-01 12:32:44", //默认开始时间
|
|
|
+ // initEndTime: "2019-12-01 12:32:44", //默认结束时间
|
|
|
+ limitStartTime: dayjs().subtract(3,'year').format('YYYY-MM-DD '),
|
|
|
+ limitEndTime: dayjs().add(3,'year').format('YYYY-MM-DD ')
|
|
|
+ }}
|
|
|
+ isPartition
|
|
|
+ pickerShow={this.state.isPickerRender}
|
|
|
+ onconditionaljudgment={(v)=>{
|
|
|
+ // let a = dayjs(dayjs(v.detail.endTime).second(0).format('YYYY-MM-DD'));
|
|
|
+ // let b = dayjs(dayjs().second(0).format('YYYY-MM-DD'))
|
|
|
+ // if(a.isBefore(b)){
|
|
|
+ // Taro.showToast({
|
|
|
+ // title:'结束时间不能小于当前时间',
|
|
|
+ // icon:'none'
|
|
|
+ // })
|
|
|
+ // v.detail.setLv(false);
|
|
|
+ // }
|
|
|
+ }}
|
|
|
+ onhidepicker={()=>{
|
|
|
+ this.onPickerHide()
|
|
|
+ }}
|
|
|
+ onsetpickertime={(v)=>{
|
|
|
+ this.onSetPickerTime(v)
|
|
|
+ }}>
|
|
|
+ </timePicker>
|
|
|
+ {/* <View className='searchItem'>
|
|
|
+ <Picker mode='date' onChange={(e) => {
|
|
|
+ if (this.state.current === 0) {
|
|
|
+ this.setState({
|
|
|
+ rangeStartVal: e.detail.value,
|
|
|
+ }, () => {
|
|
|
+ this.getPublicReleaseList();
|
|
|
+ })
|
|
|
+ } else if(this.state.current === 1) {
|
|
|
this.setState({
|
|
|
- rangeStartVal:e.detail.value,
|
|
|
- },()=>{
|
|
|
+ rangeStartVal1: e.detail.value,
|
|
|
+ }, () => {
|
|
|
this.getPublicReleaseList();
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else if(this.state.current === 2) {
|
|
|
this.setState({
|
|
|
- rangeStartVal1:e.detail.value,
|
|
|
- },()=>{
|
|
|
+ rangeStartVal2: e.detail.value,
|
|
|
+ }, () => {
|
|
|
this.getPublicReleaseList();
|
|
|
})
|
|
|
}
|
|
|
}}>
|
|
|
{
|
|
|
- (this.state.current === 0 && !this.state.rangeStartVal) || (this.state.current === 1 && !this.state.rangeStartVal1) ?
|
|
|
+ (this.state.current === 0 && !this.state.rangeStartVal) || (this.state.current === 1 && !this.state.rangeStartVal1) ||
|
|
|
+ (this.state.current === 2 && !this.state.rangeStartVal2) ?
|
|
|
<View className='valuecontent'>
|
|
|
<View className='selectTitle'>开始时间</View>
|
|
|
<View className='iconContent'><AtIcon value='chevron-down' size='10' color='#FFFFFF' /></View>
|
|
|
</View> :
|
|
|
<View className='valuecontent'>
|
|
|
<View className='selectValue'>
|
|
|
- {this.state.current === 0? this.state.rangeStartVal: this.state.rangeStartVal1}
|
|
|
+ {this.state.current === 0 ? this.state.rangeStartVal : this.state.current === 1 ? this.state.rangeStartVal1 : this.state.rangeStartVal2}
|
|
|
</View>
|
|
|
- <View className='iconContent'/>
|
|
|
+ <View className='iconContent' />
|
|
|
</View>
|
|
|
}
|
|
|
</Picker>
|
|
|
{
|
|
|
- (this.state.current === 0 && this.state.rangeStartVal) || (this.state.current === 1 && this.state.rangeStartVal1) ?
|
|
|
+ (this.state.current === 0 && this.state.rangeStartVal) || (this.state.current === 1 && this.state.rangeStartVal1)
|
|
|
+ || (this.state.current === 2 && this.state.rangeStartVal2) ?
|
|
|
<View className='searchSelectContent'>
|
|
|
- <View className='selectIcon' onClick={(e)=>{
|
|
|
+ <View className='selectIcon' onClick={(e) => {
|
|
|
e.stopPropagation();
|
|
|
- if(this.state.current === 0){
|
|
|
+ if (this.state.current === 0) {
|
|
|
+ this.setState({
|
|
|
+ rangeStartVal: ''
|
|
|
+ }, () => {
|
|
|
+ this.getPublicReleaseList();
|
|
|
+ })
|
|
|
+ } else if(this.state.current === 1) {
|
|
|
this.setState({
|
|
|
- rangeStartVal:''
|
|
|
- },()=>{
|
|
|
+ rangeStartVal1: ''
|
|
|
+ }, () => {
|
|
|
this.getPublicReleaseList();
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else if(this.state.current === 2) {
|
|
|
this.setState({
|
|
|
- rangeStartVal1:''
|
|
|
- },()=>{
|
|
|
+ rangeStartVal2: ''
|
|
|
+ }, () => {
|
|
|
this.getPublicReleaseList();
|
|
|
})
|
|
|
}
|
|
@@ -432,52 +678,64 @@ class Examine extends Component {
|
|
|
</View>
|
|
|
</View> : null
|
|
|
}
|
|
|
- </View>
|
|
|
- <View className='searchItem' style={{marginRight:'5px'}}>
|
|
|
- <Picker mode='date' onChange={(e)=>{
|
|
|
- if(this.state.current === 0){
|
|
|
+ </View> */}
|
|
|
+ {/* <View className='searchItem' style={{ marginRight: '5px' }}>
|
|
|
+ <Picker mode='date' onChange={(e) => {
|
|
|
+ if (this.state.current === 0) {
|
|
|
+ this.setState({
|
|
|
+ rangeEndVal: e.detail.value,
|
|
|
+ }, () => {
|
|
|
+ this.getPublicReleaseList();
|
|
|
+ })
|
|
|
+ } else if(this.state.current === 1){
|
|
|
this.setState({
|
|
|
- rangeEndVal:e.detail.value,
|
|
|
- },()=>{
|
|
|
+ rangeEndVal1: e.detail.value,
|
|
|
+ }, () => {
|
|
|
this.getPublicReleaseList();
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else if(this.state.current === 2) {
|
|
|
this.setState({
|
|
|
- rangeEndVal1:e.detail.value,
|
|
|
- },()=>{
|
|
|
+ rangeEndVal2: e.detail.value,
|
|
|
+ }, () => {
|
|
|
this.getPublicReleaseList();
|
|
|
})
|
|
|
}
|
|
|
}}>
|
|
|
{
|
|
|
- (this.state.current === 0 && !this.state.rangeEndVal) || (this.state.current === 1 && !this.state.rangeEndVal1) ?
|
|
|
+ (this.state.current === 0 && !this.state.rangeEndVal) || (this.state.current === 1 && !this.state.rangeEndVal1) || (this.state.current === 2 && !this.state.rangeEndVal2) ?
|
|
|
<View className='valuecontent'>
|
|
|
<View className='selectTitle'>结束时间</View>
|
|
|
<View className='iconContent'><AtIcon value='chevron-down' size='10' color='#FFFFFF' /></View>
|
|
|
</View> :
|
|
|
<View className='valuecontent'>
|
|
|
<View className='selectValue'>
|
|
|
- {this.state.current === 0? this.state.rangeEndVal: this.state.rangeEndVal1}
|
|
|
+ {this.state.current === 0 ? this.state.rangeEndVal : this.state.current === 1 ? this.state.rangeEndVal1 : this.state.rangeEndVal2}
|
|
|
</View>
|
|
|
- <View className='iconContent'/>
|
|
|
+ <View className='iconContent' />
|
|
|
</View>
|
|
|
}
|
|
|
</Picker>
|
|
|
{
|
|
|
- (this.state.current === 0 && this.state.rangeEndVal) || (this.state.current === 1 && this.state.rangeEndVal1) ?
|
|
|
+ (this.state.current === 0 && this.state.rangeEndVal) || (this.state.current === 1 && this.state.rangeEndVal1) || (this.state.current === 2 && this.state.rangeEndVal2) ?
|
|
|
<View className='searchSelectContent'>
|
|
|
- <View className='selectIcon' onClick={(e)=>{
|
|
|
+ <View className='selectIcon' onClick={(e) => {
|
|
|
e.stopPropagation();
|
|
|
- if(this.state.current === 0){
|
|
|
+ if (this.state.current === 0) {
|
|
|
+ this.setState({
|
|
|
+ rangeEndVal: ''
|
|
|
+ }, () => {
|
|
|
+ this.getPublicReleaseList();
|
|
|
+ })
|
|
|
+ } else if(this.state.current === 1) {
|
|
|
this.setState({
|
|
|
- rangeEndVal:''
|
|
|
- },()=>{
|
|
|
+ rangeEndVal1: ''
|
|
|
+ }, () => {
|
|
|
this.getPublicReleaseList();
|
|
|
})
|
|
|
- }else{
|
|
|
+ }else if(this.state.current === 2) {
|
|
|
this.setState({
|
|
|
- rangeEndVal1:''
|
|
|
- },()=>{
|
|
|
+ rangeEndVal2: ''
|
|
|
+ }, () => {
|
|
|
this.getPublicReleaseList();
|
|
|
})
|
|
|
}
|
|
@@ -486,15 +744,15 @@ class Examine extends Component {
|
|
|
</View>
|
|
|
</View> : null
|
|
|
}
|
|
|
- </View>
|
|
|
+ </View> */}
|
|
|
</View>
|
|
|
</ScrollView>
|
|
|
</View>
|
|
|
- <AtTabs current={this.state.current || 0} tabList={[{ title: '我的' }, { title: '审核' }]} onClick={(current)=>{
|
|
|
+ <AtTabs current={this.state.current || 0} tabList={[{ title: '我的' }, { title: '审核' }, { title: '查看' }]} onClick={(current) => {
|
|
|
this.setState({
|
|
|
- current
|
|
|
- },()=>{
|
|
|
- if((current === 0 && this.state.pageNo === 1) || (current === 1 && this.state.examinePageNo === 1)){
|
|
|
+ current,
|
|
|
+ }, () => {
|
|
|
+ if ((current === 0 && this.state.pageNo === 1) || (current === 1 && this.state.examinePageNo === 1) || (current === 2 && this.state.seePageNo === 1)) {
|
|
|
this.getPublicReleaseList();
|
|
|
}
|
|
|
})
|
|
@@ -502,20 +760,32 @@ class Examine extends Component {
|
|
|
<AtTabsPane current={this.state.current} index={0} >
|
|
|
<MyList
|
|
|
type={0}
|
|
|
+ seeView={this.state.current}
|
|
|
list={this.state.list}
|
|
|
listState={this.state.listState}
|
|
|
- onRefresh={()=>{
|
|
|
+ onRefresh={() => {
|
|
|
this.getPublicReleaseList(true);
|
|
|
- }}/>
|
|
|
+ }} />
|
|
|
</AtTabsPane>
|
|
|
<AtTabsPane current={this.state.current} index={1}>
|
|
|
<MyList
|
|
|
type={1}
|
|
|
+ seeView={this.state.current}
|
|
|
list={this.state.examinelist}
|
|
|
listState={this.state.examineListState}
|
|
|
- onRefresh={()=>{
|
|
|
+ onRefresh={() => {
|
|
|
+ this.getPublicReleaseList(true);
|
|
|
+ }} />
|
|
|
+ </AtTabsPane>
|
|
|
+ <AtTabsPane current={this.state.current} index={2}>
|
|
|
+ <MyList
|
|
|
+ type={2}
|
|
|
+ seeView={this.state.current}
|
|
|
+ list={this.state.seeList}
|
|
|
+ listState={this.state.seeListState}
|
|
|
+ onRefresh={() => {
|
|
|
this.getPublicReleaseList(true);
|
|
|
- }}/>
|
|
|
+ }} />
|
|
|
</AtTabsPane>
|
|
|
</AtTabs>
|
|
|
</View>
|