dev01 1 yıl önce
ebeveyn
işleme
9dd3ca477c
1 değiştirilmiş dosya ile 7 ekleme ve 1 silme
  1. 7 1
      src/pages/punchClock/punchClocks.jsx

+ 7 - 1
src/pages/punchClock/punchClocks.jsx

@@ -87,7 +87,8 @@ class PunchClocks extends Component {
 
     Taro.eventCenter.on('GoPunchIn', (arg) => {
       this.setState({
-        data: arg
+        data: arg,
+        isCalendar: false,
       }, () => {
         this.onmyDuration()
         !!arg.id && this.onMyDurationMonth({ id: arg.id }, { year, month })
@@ -120,19 +121,23 @@ class PunchClocks extends Component {
   }
 
   onMyDurationMonth(val, time) {
+    Taro.showLoading({ title: '加载中...' });
     myDurationMonth({
       id: val.id,
       year: time.year,
       month: time.month,
     }).then(v => {
+      Taro.hideLoading()
       if (v.code === 200) {
         this.setState({
           dateList: v.data,
+          isCalendar: true,
         })
       } else {
         Taro.showToast({ title: v.msg, icon: 'none' })
       }
     }).catch(() => {
+      Taro.hideLoading()
       Taro.showToast({
         title: '系统错误,请稍后再试',
         icon: 'none'
@@ -366,6 +371,7 @@ class PunchClocks extends Component {
                       /> */}
                     </View>
                   </View>
+
                   <View className='items'>
                     <View className='ititles'><Text style={{ width: "7px" }}></Text>上传附件:</View>
                     <ImagePicker