|
@@ -1,15 +1,17 @@
|
|
|
import React, { Component } from 'react';
|
|
|
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 {
|
|
|
AtSearchBar,
|
|
|
AtTabs,
|
|
|
AtTabsPane,
|
|
|
- AtList,
|
|
|
- AtListItem,
|
|
|
- AtIcon
|
|
|
+ AtIcon,
|
|
|
+ AtModal,
|
|
|
+ AtModalContent,
|
|
|
+ AtModalAction,
|
|
|
+ AtTextarea
|
|
|
} from 'taro-ui';
|
|
|
import { clockState } from '../../utils/tools/config';
|
|
|
|
|
@@ -47,6 +49,11 @@ class Examine extends Component {
|
|
|
rangeStartVal: '',
|
|
|
rangeEndMinuteVal: '',
|
|
|
rangeStartMinuteVal: '',
|
|
|
+
|
|
|
+ id: "",
|
|
|
+ rmk: "",
|
|
|
+ isOpen: false,
|
|
|
+
|
|
|
}
|
|
|
this.getPublicReleaseList = this.getPublicReleaseList.bind(this);
|
|
|
this.getMyList = this.getMyList.bind(this);
|
|
@@ -140,7 +147,7 @@ class Examine extends Component {
|
|
|
listState: 'NO_DATA'
|
|
|
})
|
|
|
} 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({
|
|
|
listState: 'NO_MORE_DATA'
|
|
|
})
|
|
@@ -153,7 +160,7 @@ class Examine extends Component {
|
|
|
}
|
|
|
this.setState({
|
|
|
list: pageNo === 1 ? msg.data.list : this.state.list.concat(msg.data.list),
|
|
|
- pageNo: msg.data.pageNo
|
|
|
+ pageNo: msg.data.list.length === 0 ? this.state.pageNo : msg.data.pageNo
|
|
|
})
|
|
|
} else {
|
|
|
Taro.showToast({ title: msg.error[0].message, icon: 'none' });
|
|
@@ -177,6 +184,36 @@ 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,
|
|
|
+ rmk: "",
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ Taro.showToast({ title: v.error[0].message, icon: 'none' })
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ Taro.hideLoading()
|
|
|
+ Taro.showToast({
|
|
|
+ title: '系统错误,请稍后再试',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
render() {
|
|
|
return (
|
|
|
<View className='indexPage' >
|
|
@@ -294,7 +331,6 @@ class Examine extends Component {
|
|
|
</View> : null
|
|
|
}
|
|
|
</View>
|
|
|
- {/* */}
|
|
|
{/* 多选时间框 */}
|
|
|
<View className='searchItem' onClick={() => {
|
|
|
this.setState({
|
|
@@ -334,38 +370,11 @@ class Examine extends Component {
|
|
|
</View>
|
|
|
}
|
|
|
</View>
|
|
|
- <timePicker
|
|
|
- config={{
|
|
|
- endDate: true,
|
|
|
- column: "minute",
|
|
|
- dateLimit: false,
|
|
|
- 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>
|
|
|
</ScrollView>
|
|
|
</View>
|
|
|
<AtTabs
|
|
|
+ swipeable={false}
|
|
|
current={this.state.current || 0}
|
|
|
tabList={this.state.typeList}
|
|
|
onClick={(current) => {
|
|
@@ -385,17 +394,75 @@ class Examine extends Component {
|
|
|
>
|
|
|
<MyList
|
|
|
type={item.type}
|
|
|
+ title={item.title}
|
|
|
typelist={this.state.typeList}
|
|
|
seeView={this.state.current}
|
|
|
list={this.state.list}
|
|
|
listState={this.state.listState}
|
|
|
onRefresh={() => {
|
|
|
this.getPublicReleaseList(true);
|
|
|
- }} />
|
|
|
+ }}
|
|
|
+ opens={e => {
|
|
|
+ this.setState({
|
|
|
+ id: e,
|
|
|
+ isOpen: true,
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ />
|
|
|
</AtTabsPane>
|
|
|
)
|
|
|
}
|
|
|
</AtTabs>
|
|
|
+ <timePicker
|
|
|
+ config={{
|
|
|
+ endDate: true,
|
|
|
+ column: "minute",
|
|
|
+ dateLimit: false,
|
|
|
+ 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>
|
|
|
+ {/* 驳回协单 */}
|
|
|
+ {
|
|
|
+ this.state.isOpen &&
|
|
|
+ <AtModal
|
|
|
+ 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>
|
|
|
)
|
|
|
}
|