Przeglądaj źródła

修复打卡背景颜色bug

dev01 6 dni temu
rodzic
commit
c47ccf08ae

+ 11 - 8
src/pages/addEnterprise/index.jsx

@@ -488,10 +488,10 @@ class AddEnterprise extends Component {
               <View className={!!info.province ? "avals" : "aval"} onClick={() => { this.setState({ pickerShow: true }) }}>
                 {!!info.province ? (info.province || "") + (!info.city ? "" : "-") + (info.city || "") + (!info.area ? "" : "-") + (info.area || "") : "点击选择"}
               </View>
-              <AddressPicker
+              { pickerShow && <AddressPicker
                 pickerShow={pickerShow}
                 onHandleToggleShow={this.toggleAddressPicker.bind(this)}
-              />
+              />}
             </View>
             <AtInput
               required
@@ -607,10 +607,13 @@ class AddEnterprise extends Component {
               }}>
                 {!!info.natureName ? info.natureName : "点击选择"}
               </View>
-              <CustomNatureSelect
-                pickerShow={this.state.naturePickerShow}
-                onHandleToggleShow={this.handleNatureToggleShow.bind(this)}
-              />
+
+              { this.state.naturePickerShow ? (
+                <CustomNatureSelect
+                  pickerShow={this.state.naturePickerShow}
+                  onHandleToggleShow={this.handleNatureToggleShow.bind(this)}
+                />
+              ) : null }
             </View>
 
             { info.nature && info.nature[0] == 0 ? (
@@ -699,10 +702,10 @@ class AddEnterprise extends Component {
                   <View className={!!info.province ? "avals" : "aval"} onClick={() => { this.setState({ pickerShow: true }) }}>
                     {!!info.province ? (info.province || "") + (!info.city ? "" : "-") + (info.city || "") + (!info.area ? "" : "-") + (info.area || "") : "点击选择"}
                   </View>
-                  <AddressPicker
+                  { pickerShow &&  <AddressPicker
                     pickerShow={pickerShow}
                     onHandleToggleShow={this.toggleAddressPicker.bind(this)}
-                  />
+                  />}
                 </View>
                 <AtInput
                   required

+ 14 - 9
src/pages/applyDepart/publicContent.jsx

@@ -831,7 +831,7 @@ class PublicContent extends Component {
             </View>
             { this.state.assistContentType.indexOf('0') > -1 ? (
               <View className="formItem">
-                <View className="formName">内容说明:</View>
+                <View className="formName"><Text style={{ color: "red" }}>*</Text>内容说明:</View>
                 <View
                 className="formValue"
                 style={{ paddingTop: "10px", textAlign: "left" }}
@@ -997,14 +997,19 @@ class PublicContent extends Component {
                 return;
               }
 
-              if ((type == 5 || (type == 0 && this.state.cList.length)) && !this.state.assistType) {
-                Taro.showToast({ title: "请选择协单类型", icon: "none" });
-                return
-              }
-
-              if ((type == 5 || (type == 0 && this.state.cList.length)) && !this.state.assistContentType) {
-                Taro.showToast({ title: "请选择协单内容", icon: "none" });
-                return
+              if(type == 5 || (type == 0 && this.state.cList.length)) {
+                if (!this.state.assistType) {
+                  Taro.showToast({ title: "请选择协单类型", icon: "none" });
+                  return
+                }
+                if (!this.state.assistContentType) {
+                  Taro.showToast({ title: "请选择协单内容", icon: "none" });
+                  return
+                }
+                if (this.state.assistType.indexOf('0') && !this.state.assistContent) {
+                  Taro.showToast({ title: "请输入协单内容说明", icon: "none" });
+                  return
+                }
               }
 
               if (type !=0 && !this.state.reason) {

+ 18 - 11
src/pages/egressDetails/publicContent.jsx

@@ -128,6 +128,8 @@ class PublicContent extends Component {
       let assistTypeName = ''
       let assistContentTypeName = ''
       if ([5, 6].indexOf(this.props.dtails.type) > -1 || this.props.dtails.type == 0 && list.length) {
+        rangeStartMinuteVal = dayjs(this.props.dtails.releaseStarts).format("YYYY-MM-DD")
+        rangeEndMinuteVal = dayjs(this.props.dtails.releaseEnds).format("YYYY-MM-DD")
         const assistType = this.props.dtails.assistType || ''
         const assistContentType = this.props.dtails.assistContentType || ''
 
@@ -1061,7 +1063,7 @@ class PublicContent extends Component {
         { [5, 6].indexOf(dtails.type) > -1 || (dtails.type == 0 && this.state.cList.length) ? (
           <Fragment>
             <View className="formItem">
-              <View className="formName">协单类型:</View>
+              <View className="formName"><Text style={{ color: "red" }}>*</Text>协单类型:</View>
               <View className="formValue" onClick={() => this.handleOpenMultiplePicker('assistType')}>
                 <Text className="formValueText">
                   { this.state.assistTypeName }
@@ -1070,7 +1072,7 @@ class PublicContent extends Component {
               </View>
             </View>
             <View className="formItem">
-              <View className="formName">协单内容:</View>
+              <View className="formName"><Text style={{ color: "red" }}>*</Text>协单内容:</View>
               <View className="formValue" onClick={() => this.handleOpenMultiplePicker('assistContentType')}>
                 <Text className="formValueText">
                   { this.state.assistContentTypeName }
@@ -1080,7 +1082,7 @@ class PublicContent extends Component {
             </View>
             { (this.state.assistContentType || '').indexOf('0') > -1 ? (
               <View className="formItem">
-                <View className="formName">内容说明:</View>
+                <View className="formName"><Text style={{ color: "red" }}>*</Text>内容说明:</View>
                 <View
                 className="formValue"
                 style={{ paddingTop: "10px", textAlign: "left" }}
@@ -1290,14 +1292,19 @@ class PublicContent extends Component {
                     return;
                   }
 
-                  if (([5, 6].indexOf(this.props.dtails.type) > -1 || (this.props.dtails.type == 0 && this.state.cList.length)) && !this.state.assistType) {
-                    Taro.showToast({ title: "请选择协单类型", icon: "none" });
-                    return;
-                  }
-
-                  if (([5, 6].indexOf(this.props.dtails.type) > -1 || (this.props.dtails.type == 0 && this.state.cList.length)) && !this.state.assistContentType) {
-                    Taro.showToast({ title: "请选择协单内容", icon: "none" });
-                    return;
+                  if ([5, 6].indexOf(this.props.dtails.type) > -1 || (this.props.dtails.type == 0 && this.state.cList.length)) {
+                    if (!this.state.assistType) {
+                      Taro.showToast({ title: "请选择协单类型", icon: "none" });
+                      return
+                    }
+                    if (!this.state.assistContentType) {
+                      Taro.showToast({ title: "请选择协单内容", icon: "none" });
+                      return
+                    }
+                    if (this.state.assistType.indexOf('0') && !this.state.assistContent) {
+                      Taro.showToast({ title: "请输入协单内容说明", icon: "none" });
+                      return
+                    }
                   }
 
                   if (!this.state.reason && this.props.dtails.type != 0) {

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

@@ -466,7 +466,10 @@ class PunchClocks extends Component {
     const { dtails, distance, data } = this.state
     const newClockIn = !!data.prdcList && data.prdcList.length > 0 ? data.prdcList[0] : {};
     if ([5, 6].indexOf(dtails.type) > -1) {
-      if (!dayjs().isAfter(dayjs(dtails.releaseEnds).add(1, 'day'))) {
+      let nowTime = dayjs().format('YYYY-MM-DD HH:mm:ss')
+      let startTime = dayjs(dtails.releaseStarts).format('YYYY-MM-DD 00:00:00')
+      let endTime = dayjs(dtails.releaseEnds).format('YYYY-MM-DD 23:59:59')
+      if (dayjs(nowTime).isAfter(dayjs(startTime)) && dayjs(nowTime).isBefore(dayjs(endTime)) ) {
         return [1, 2].includes(newClockIn.status) ? '#3f82e8' : '#72cb78'
       } else {
         return '#828e83'