|
@@ -1,9 +1,9 @@
|
|
|
import React, { Component } from 'react'
|
|
|
import { connect } from 'react-redux'
|
|
|
-import { Input, Textarea, View, Text, Picker, Button } from '@tarojs/components'
|
|
|
+import { Input, Textarea, View, Text, Picker, Button, Image } from '@tarojs/components'
|
|
|
import Taro from '@tarojs/taro';
|
|
|
import {
|
|
|
- AtButton, AtList, AtListItem
|
|
|
+ AtButton, AtModal, AtModalContent, AtModalAction
|
|
|
} from "taro-ui";
|
|
|
import dayjs from 'dayjs';
|
|
|
import Skeleton from 'taro-skeleton'
|
|
@@ -11,6 +11,7 @@ import HistoricalClock from '../../components/historicalClock';
|
|
|
import ImagePicker from '../../components/common/imagePicker';
|
|
|
import { add, minus, asyncAdd } from '../../actions/counter'
|
|
|
import { recordAdd, myDuration, getInfo, } from '../../utils/servers/servers';
|
|
|
+import Select from "../../image/dui.png";
|
|
|
import './index.less';
|
|
|
import 'taro-ui/dist/style/components/noticebar.scss';
|
|
|
import 'taro-ui/dist/style/components/icon.scss';
|
|
@@ -44,15 +45,17 @@ class PunchClocks extends Component {
|
|
|
selectorChecked: {},
|
|
|
remark: "",
|
|
|
data: {},
|
|
|
+ isOpened: false,
|
|
|
+ clockId: "",
|
|
|
}
|
|
|
this.onChange = this.onChange.bind(this);
|
|
|
this.publicReleaseClockIn = this.publicReleaseClockIn.bind(this);
|
|
|
+ this.onClose = this.onClose.bind(this);
|
|
|
}
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
this.imagePickerRef && this.imagePickerRef.clear();
|
|
|
- // this.getMyDuration();
|
|
|
this.getInfo()
|
|
|
}
|
|
|
|
|
@@ -61,13 +64,6 @@ class PunchClocks extends Component {
|
|
|
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
- getMyDuration() {
|
|
|
- myDuration().then(v => {
|
|
|
-
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
componentWillMount() {
|
|
|
Taro.eventCenter.on('GoPunchIn', (arg) => {
|
|
|
this.setState({
|
|
@@ -119,6 +115,10 @@ class PunchClocks extends Component {
|
|
|
Taro.hideLoading()
|
|
|
if (v.code === 200) {
|
|
|
Taro.showToast({ title: '打卡成功', icon: 'none' });
|
|
|
+ this.setState({
|
|
|
+ clockId: v.data.id,
|
|
|
+ isOpened: true,
|
|
|
+ })
|
|
|
} else {
|
|
|
Taro.showToast({ title: v.msg, icon: 'none' })
|
|
|
}
|
|
@@ -143,6 +143,18 @@ class PunchClocks extends Component {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ onClose() {
|
|
|
+ const { clockId } = this.state
|
|
|
+ this.setState({
|
|
|
+ isOpened: false
|
|
|
+ })
|
|
|
+ if (!!clockId) {
|
|
|
+ Taro.navigateTo({
|
|
|
+ url: `/pages/detail/index?id=${clockId}&type=0`
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
render() {
|
|
|
const { data } = this.state;
|
|
|
return (
|
|
@@ -194,7 +206,7 @@ class PunchClocks extends Component {
|
|
|
</View>
|
|
|
|
|
|
<View className='item'>
|
|
|
- <View className='ititle'>研发时间:
|
|
|
+ <View className='ititle'><Text style={{ color: "red", width: "7px" }}>*</Text>研发时间:
|
|
|
<Picker mode='date'
|
|
|
onChange={e => {
|
|
|
this.setState({
|
|
@@ -209,7 +221,7 @@ class PunchClocks extends Component {
|
|
|
</View>
|
|
|
|
|
|
<View className='items'>
|
|
|
- <View className='ititle'>研发工时:
|
|
|
+ <View className='ititle'><Text style={{ color: "red", width: "7px" }}>*</Text>研发工时:
|
|
|
<Input value={this.state.duration} type='digit' className='input' placeholder='请输入'
|
|
|
style={{ textAlign: "center", background: "#D7D7D7", borderRadius: "10px", }}
|
|
|
// border: "1px solid #d6e4ef",
|
|
@@ -224,7 +236,7 @@ class PunchClocks extends Component {
|
|
|
</View>
|
|
|
|
|
|
<View className='item'>
|
|
|
- <View className='ititle'>研发阶段:
|
|
|
+ <View className='ititle'><Text style={{ color: "red", width: "7px" }}>*</Text>研发阶段:
|
|
|
<Picker mode='selector' range={this.state.selector} rangeKey="lable"
|
|
|
onChange={e => {
|
|
|
this.setState({
|
|
@@ -239,7 +251,7 @@ class PunchClocks extends Component {
|
|
|
</View>
|
|
|
|
|
|
<View className='items'>
|
|
|
- <View className='ititles'>研发记录:
|
|
|
+ <View className='ititles'><Text style={{ width: "7px" }}></Text>研发记录:
|
|
|
<Textarea
|
|
|
value={this.state.remark}
|
|
|
placeholder="请填写研发过程记录"
|
|
@@ -260,7 +272,7 @@ class PunchClocks extends Component {
|
|
|
onChange={this.onChange}
|
|
|
/> */}
|
|
|
<View className='items'>
|
|
|
- <View className='ititles'>上传附件:</View>
|
|
|
+ <View className='ititles'><Text style={{ width: "7px" }}></Text>上传附件:</View>
|
|
|
<ImagePicker
|
|
|
showAddBtn
|
|
|
ref={(ref) => (this.imagePickerRef = ref)}
|
|
@@ -285,9 +297,28 @@ class PunchClocks extends Component {
|
|
|
</View>
|
|
|
}
|
|
|
</Skeleton>
|
|
|
- </View>
|
|
|
+ </View >
|
|
|
+
|
|
|
+ <AtModal
|
|
|
+ width="90%"
|
|
|
+ isOpened={this.state.isOpened}
|
|
|
+ // onClose={this.props.onClose}
|
|
|
+ // onCancel={this.props.onClose}
|
|
|
+ >
|
|
|
+ <AtModalContent>
|
|
|
+ <View className='tips'>
|
|
|
+ <Image src={Select} className="img" />
|
|
|
+ <View className="tit">成功打卡</View>
|
|
|
+ <View className="txt">您的研发打卡,已经确定</View>
|
|
|
+ <View className="txt">请注意查看打卡审核情况!</View>
|
|
|
+ </View>
|
|
|
+ </AtModalContent>
|
|
|
+ <AtModalAction>
|
|
|
+ <Button onClick={this.onClose}>确定</Button>
|
|
|
+ </AtModalAction>
|
|
|
+ </AtModal>
|
|
|
|
|
|
- </View>
|
|
|
+ </View >
|
|
|
)
|
|
|
}
|
|
|
}
|