|
@@ -1,15 +1,17 @@
|
|
import React, { Component } from 'react';
|
|
import React, { Component } from 'react';
|
|
import Taro from '@tarojs/taro';
|
|
import Taro from '@tarojs/taro';
|
|
-import { View, Picker, ScrollView } from '@tarojs/components'
|
|
|
|
-import { getPublicReleaseList } from '../../utils/servers/servers';
|
|
|
|
|
|
+import { View, Picker, ScrollView, Button } from '@tarojs/components'
|
|
|
|
+import { getPublicReleaseList, techReject } from '../../utils/servers/servers';
|
|
import dayjs from 'dayjs';
|
|
import dayjs from 'dayjs';
|
|
import {
|
|
import {
|
|
AtSearchBar,
|
|
AtSearchBar,
|
|
AtTabs,
|
|
AtTabs,
|
|
AtTabsPane,
|
|
AtTabsPane,
|
|
- AtList,
|
|
|
|
- AtListItem,
|
|
|
|
- AtIcon
|
|
|
|
|
|
+ AtIcon,
|
|
|
|
+ AtModal,
|
|
|
|
+ AtModalContent,
|
|
|
|
+ AtModalAction,
|
|
|
|
+ AtTextarea
|
|
} from 'taro-ui';
|
|
} from 'taro-ui';
|
|
import { clockState } from '../../utils/tools/config';
|
|
import { clockState } from '../../utils/tools/config';
|
|
|
|
|
|
@@ -21,6 +23,7 @@ import "taro-ui/dist/style/components/action-sheet.scss";
|
|
import "taro-ui/dist/style/components/icon.scss";
|
|
import "taro-ui/dist/style/components/icon.scss";
|
|
import "taro-ui/dist/style/components/list.scss";
|
|
import "taro-ui/dist/style/components/list.scss";
|
|
import "taro-ui/dist/style/components/icon.scss";
|
|
import "taro-ui/dist/style/components/icon.scss";
|
|
|
|
+import "taro-ui/dist/style/components/modal.scss";
|
|
|
|
|
|
import MyList from '../examine/myList';
|
|
import MyList from '../examine/myList';
|
|
import MessageNoticebar from "../../components/common/messageNoticebar";
|
|
import MessageNoticebar from "../../components/common/messageNoticebar";
|
|
@@ -46,6 +49,10 @@ class Examine extends Component {
|
|
rangeStartVal: '',
|
|
rangeStartVal: '',
|
|
rangeEndMinuteVal: '',
|
|
rangeEndMinuteVal: '',
|
|
rangeStartMinuteVal: '',
|
|
rangeStartMinuteVal: '',
|
|
|
|
+
|
|
|
|
+ id: "",
|
|
|
|
+ rmk: "",
|
|
|
|
+ isOpen: false,
|
|
}
|
|
}
|
|
this.getPublicReleaseList = this.getPublicReleaseList.bind(this);
|
|
this.getPublicReleaseList = this.getPublicReleaseList.bind(this);
|
|
this.getMyList = this.getMyList.bind(this);
|
|
this.getMyList = this.getMyList.bind(this);
|
|
@@ -137,7 +144,8 @@ class Examine extends Component {
|
|
listState: 'NO_DATA'
|
|
listState: 'NO_DATA'
|
|
})
|
|
})
|
|
} else if (msg.data.totalCount === this.state.list.length && pageNo !== 1) {
|
|
} else if (msg.data.totalCount === this.state.list.length && pageNo !== 1) {
|
|
- Taro.showToast({ title: '没有更多数据了', icon: 'none' });
|
|
|
|
|
|
+ // 防止提示挡住驳回弹窗
|
|
|
|
+ !this.state.isOpen && Taro.showToast({ title: '没有更多数据了', icon: 'none' });
|
|
this.setState({
|
|
this.setState({
|
|
listState: 'NO_MORE_DATA'
|
|
listState: 'NO_MORE_DATA'
|
|
})
|
|
})
|
|
@@ -174,6 +182,35 @@ class Examine extends Component {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ submit() {
|
|
|
|
+ if (!this.state.rmk) {
|
|
|
|
+ Taro.showToast({ title: '请填写备注!', icon: 'none' });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ Taro.showLoading({ title: '正在提交...' });
|
|
|
|
+ techReject({
|
|
|
|
+ id: this.state.id,
|
|
|
|
+ remarks: this.state.rmk,
|
|
|
|
+ }).then(v => {
|
|
|
|
+ Taro.hideLoading()
|
|
|
|
+ if (v.error.length === 0) {
|
|
|
|
+ Taro.showToast({ title: '提交成功', icon: 'none' });
|
|
|
|
+ this.getPublicReleaseList();
|
|
|
|
+ this.setState({
|
|
|
|
+ isOpen: false,
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ Taro.showToast({ title: v.error[0].message, icon: 'none' })
|
|
|
|
+ }
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ Taro.hideLoading()
|
|
|
|
+ Taro.showToast({
|
|
|
|
+ title: '系统错误,请稍后再试',
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
render() {
|
|
render() {
|
|
return (
|
|
return (
|
|
<View className='indexPage' >
|
|
<View className='indexPage' >
|
|
@@ -246,7 +283,7 @@ class Examine extends Component {
|
|
<View className='searchItem' >
|
|
<View className='searchItem' >
|
|
<Picker
|
|
<Picker
|
|
value={this.state.clockInStarts}
|
|
value={this.state.clockInStarts}
|
|
- range={['未打卡', '已打卡']}
|
|
|
|
|
|
+ range={['未打卡', '已打卡', '异常打卡']}
|
|
mode='selector'
|
|
mode='selector'
|
|
onChange={(e) => {
|
|
onChange={(e) => {
|
|
this.setState({
|
|
this.setState({
|
|
@@ -264,9 +301,10 @@ class Examine extends Component {
|
|
<View className='shortValuecontent'>
|
|
<View className='shortValuecontent'>
|
|
<View className='selectValue'>
|
|
<View className='selectValue'>
|
|
{
|
|
{
|
|
- this.state.clockInStarts === '1'
|
|
|
|
- ? '已打卡' : this.state.clockInStarts === '0'
|
|
|
|
- ? '未打卡' : ''
|
|
|
|
|
|
+ this.state.clockInStarts === '2'
|
|
|
|
+ ? '异常打卡' : this.state.clockInStarts === '1'
|
|
|
|
+ ? '已打卡' : this.state.clockInStarts === '0'
|
|
|
|
+ ? '未打卡' : ''
|
|
}
|
|
}
|
|
</View>
|
|
</View>
|
|
<View className='iconContent' />
|
|
<View className='iconContent' />
|
|
@@ -366,6 +404,7 @@ class Examine extends Component {
|
|
tabList={this.state.typeList}
|
|
tabList={this.state.typeList}
|
|
onClick={(current) => {
|
|
onClick={(current) => {
|
|
this.setState({
|
|
this.setState({
|
|
|
|
+ list: [],
|
|
pageNo: 1,
|
|
pageNo: 1,
|
|
current,
|
|
current,
|
|
}, () => {
|
|
}, () => {
|
|
@@ -375,23 +414,50 @@ class Examine extends Component {
|
|
{
|
|
{
|
|
this.state.typeList?.map((item, index) =>
|
|
this.state.typeList?.map((item, index) =>
|
|
<AtTabsPane
|
|
<AtTabsPane
|
|
- key={item.title}
|
|
|
|
current={this.state.current}
|
|
current={this.state.current}
|
|
index={index}
|
|
index={index}
|
|
>
|
|
>
|
|
<MyList
|
|
<MyList
|
|
type={0}
|
|
type={0}
|
|
|
|
+ title={item.title}
|
|
typelist={this.state.typeList}
|
|
typelist={this.state.typeList}
|
|
seeView={this.state.current}
|
|
seeView={this.state.current}
|
|
list={this.state.list}
|
|
list={this.state.list}
|
|
listState={this.state.listState}
|
|
listState={this.state.listState}
|
|
onRefresh={() => {
|
|
onRefresh={() => {
|
|
this.getPublicReleaseList(true);
|
|
this.getPublicReleaseList(true);
|
|
- }} />
|
|
|
|
|
|
+ }}
|
|
|
|
+ opens={e => {
|
|
|
|
+ this.setState({
|
|
|
|
+ id: e,
|
|
|
|
+ isOpen: true,
|
|
|
|
+ })
|
|
|
|
+ }}
|
|
|
|
+ />
|
|
</AtTabsPane>
|
|
</AtTabsPane>
|
|
)
|
|
)
|
|
}
|
|
}
|
|
</AtTabs>
|
|
</AtTabs>
|
|
|
|
+ {/* 驳回协单 */}
|
|
|
|
+ <AtModal
|
|
|
|
+ style={{ position: 'fixed' }}
|
|
|
|
+ isOpened={this.state.isOpen}
|
|
|
|
+ >
|
|
|
|
+ <AtModalContent>
|
|
|
|
+ <AtTextarea
|
|
|
|
+ value={this.state.rmk}
|
|
|
|
+ onChange={e => {
|
|
|
|
+ this.setState({ rmk: e })
|
|
|
|
+ }}
|
|
|
|
+ maxLength={200}
|
|
|
|
+ placeholder='请填写备注~'
|
|
|
|
+ />
|
|
|
|
+ </AtModalContent>
|
|
|
|
+ <AtModalAction>
|
|
|
|
+ <Button type='secondary' onClick={() => { this.setState({ isOpen: false }) }}>取消</Button>
|
|
|
|
+ <Button type='primary' onClick={this.submit.bind(this)}>提交</Button>
|
|
|
|
+ </AtModalAction>
|
|
|
|
+ </AtModal>
|
|
</View>
|
|
</View>
|
|
)
|
|
)
|
|
}
|
|
}
|