Ver código fonte

非公出协单完善

dev01 2 semanas atrás
pai
commit
8948a94ad7

+ 6 - 0
src/pages/applyDepart/publicContent.jsx

@@ -190,6 +190,9 @@ class PublicContent extends Component {
         assistContentType: this.state.assistContentType,
         // 协单类型内容补充
         assistContent: this.state.assistContent,
+        remarks: this.state.reason,
+        plan: this.state.plan,
+        expectedEffect: this.state.expectedEffect,
       }
     } else {
       datas = {
@@ -462,6 +465,9 @@ class PublicContent extends Component {
       case 5:
         str = '非公出协单'
         break;
+      case 6:
+        str = '非公出协单'
+        break;
       default:
         break;
     }

+ 50 - 6
src/pages/egressDetails/index.jsx

@@ -48,6 +48,8 @@ import MessageNoticebar from "../../components/common/messageNoticebar";
 import { getClockState, unique, getUids } from "../../utils/tools";
 import HistoricalClock from "../../components/historicalClock";
 import UserQuery from "../../components/common/userquery"; //选择协单人弹窗
+import { Fragment } from "react";
+import { assistTypeList, assistContentList } from "../../utils/tools/config"
 
 class EgressDetails extends Component {
   $instance = getCurrentInstance();
@@ -82,7 +84,10 @@ class EgressDetails extends Component {
       // status=1			      0驳回 1发起 2通过
       // type			          0业务 1技术 2行政 3协单 4协单助手
 
-      detailUrl: ''
+      detailUrl: '',
+
+      assistTypeName: '',
+      assistContentTypeName: '',
     };
     this.examinePublicRelease = this.examinePublicRelease.bind(this);
     this.getReleasetDails = this.getReleasetDails.bind(this);
@@ -154,6 +159,21 @@ class EgressDetails extends Component {
               }
             }
             v.data.annexUrl = list;
+
+            let assistTypeName = ''
+            let assistContentTypeName = ''
+            if (v.data.type == 5) {
+      
+              const assistType = v.data.assistType || ''
+              const assistContentType = v.data.assistContentType || ''
+      
+              let currAssistTypeOption = assistTypeList.filter(item => assistType.indexOf(item.id) > -1)
+              assistTypeName = currAssistTypeOption.map(item => item.title).join(',')
+      
+              let currAssistContentTypeOption = assistContentList.filter(item => assistContentType.indexOf(item.id) > -1)
+              assistContentTypeName = currAssistContentTypeOption.map(item => item.title).join(',')
+            }
+
             this.setState({
               dtails: v.data,
               coorderList: v.data.assistantName != null && v.data.assistantName != "" ? v.data.assistantName.split(",") : [],
@@ -163,6 +183,8 @@ class EgressDetails extends Component {
                 latitude: parseFloat(v.data.prdList[0]?.latitude),
                 name: v.data.prdList[0]?.districtName,
               },
+              assistTypeName,
+              assistContentTypeName,
             });
           } else {
             setTimeout(() => {
@@ -611,7 +633,8 @@ class EgressDetails extends Component {
               </View>
               <View className="timeContent">
                 <View className="time">
-                  <View className="num">公出{dtails.duration}小时</View>
+                  
+                  <View className="num">公出{[5, 6].indexOf(dtails.type) > -1 ? 0 : dtails.duration}小时</View>
                   <View
                     className="journal"
                     onClick={(e) => {
@@ -675,7 +698,8 @@ class EgressDetails extends Component {
                       ? "行政公出" : dtails.type == 3
                         ? "技术协单" : dtails.type == 4
                           ? "协单助手" : dtails.type == 5
-                            ? "非公出协单" : ""}
+                            ? "非公出协单" : dtails.type == 6
+                              ? "非公出协单" : ""}
               </View>
             </View>
             {dtails.type == 1 ? (
@@ -721,20 +745,40 @@ class EgressDetails extends Component {
                 <View className="title">本人公出</View>
                 <View className="value">{["", "是,一同公出", "否,本人不公出"][dtails.alone]}</View>
               </View>}
+            
+            { [5, 6].indexOf(dtails.type) > -1 ? (
+              <Fragment>
+                <View className="item">
+                  <View className="title">协单类型</View>
+                  <View className="value">{this.state.assistTypeName}</View>
+                </View>
+                <View className="item">
+                  <View className="title">协单内容</View>
+                  <View className="value">{this.state.assistContentTypeName}</View>
+                </View>
+                { dtails.assistContentType.indexOf('0') > -1 && (
+                  <View className="item">
+                    <View className="title">内容说明</View>
+                    <View className="value">{dtails.assistContent}</View>
+                  </View>
+                ) }
+              </Fragment>
+            ) : null }
+
             {/* 公出目标 */}
-            {[1, 2].indexOf(dtails.type) > -1 && (<View className="item">
+            {[1, 2, 5].indexOf(dtails.type) > -1 && (<View className="item">
               <View className="title">公出目标</View>
               <View className="value">{dtails.remarks}</View>
             </View>)}
             {/* 公出计划 */}
-            {dtails.type === 1 && (
+            {[1, 5].indexOf(dtails.type) > -1 && (
               <View className="item">
                 <View className="title">公出计划</View>
                 <View className="value">{dtails.plan}</View>
               </View>
             )}
             {/* 预计效果 */}
-            {dtails.type === 1 && (
+            {[1, 5].indexOf(dtails.type) > -1 && (
               <View className="item">
                 <View className="title">预计效果</View>
                 <View className="value">{dtails.expectedEffect}</View>

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

@@ -755,7 +755,8 @@ class PublicContent extends Component {
               ? "业务公出" : dtails.type == 1
                 ? "技术公出" : dtails.type == 2
                   ? "行政公出" : dtails.type == 3
-                    ? "技术协单"  : dtails.type == 5
+                  ? "协单助手" : dtails.type == 5
+                    ? "非公出协单" : dtails.type == 6
                       ? "非公出协单" : ""}
           </View>
         </View>
@@ -1263,21 +1264,31 @@ class PublicContent extends Component {
                     Taro.showToast({ title: "请选择公出时间", icon: "none" });
                     return;
                   }
-                  if (
-                    !(this.props.locationInfor.longitude && this.props.locationInfor.latitude)
-                  ) {
+
+                  if ([5, 6].indexOf(this.props.dtails.type) === -1 && !(this.props.locationInfor.longitude && this.props.locationInfor.latitude)) {
                     Taro.showToast({ title: "请选择公出地点", icon: "none" });
                     return;
                   }
+
+                  if ([5, 6].indexOf(this.props.dtails.type) > -1 && !this.state.assistType) {
+                    Taro.showToast({ title: "请选择协单类型", icon: "none" });
+                    return;
+                  }
+
+                  if ([5, 6].indexOf(this.props.dtails.type) > -1 && !this.state.assistContentType) {
+                    Taro.showToast({ title: "请选择协单内容", icon: "none" });
+                    return;
+                  }
+
                   if (!this.state.reason && this.props.dtails.type != 0) {
                     Taro.showToast({ title: "请输入公出目标", icon: "none" });
                     return;
                   }
-                  if (!this.state.plan && this.props.dtails.type == 1) {
+                  if (!this.state.plan && [1, 5, 6].indexOf(this.props.dtails.type) > -1) {
                     Taro.showToast({ title: "请输入公出计划", icon: "none" });
                     return;
                   }
-                  if (!this.state.expectedEffect && this.props.dtails.type == 1) {
+                  if (!this.state.expectedEffect && [1, 5, 6].indexOf(this.props.dtails.type) > -1) {
                     Taro.showToast({ title: "请输入预计效果", icon: "none" });
                     return;
                   }
@@ -1289,7 +1300,7 @@ class PublicContent extends Component {
                     return;
                   }
                   let info = Taro.getStorageSync("userInfor");
-                  if (this.state.totalDuration > info.workTimeInfor.minHours && this.state.imgs.length == 0) {
+                  if ([5, 6].indexOf(this.props.dtails.type) === -1 && this.state.totalDuration > info.workTimeInfor.minHours && this.state.imgs.length == 0) {
                     Taro.showToast({ title: "请上传附件", icon: "none" });
                     return
                   }

+ 20 - 4
src/pages/mybusiness/index.jsx

@@ -69,7 +69,7 @@ class Examine extends Component {
         { title: '协单助手', type: 3 },
         { title: '技术协单', type: 2 },
         { title: '全部', type: 4 }],
-      selcotype: 4,
+      selcotype: 0,
       isOpinion: false,
       opinion: [],
       isFill: true,
@@ -186,11 +186,27 @@ class Examine extends Component {
     this.setState({
       listState: 'LOADING'
     })
+
+    let type = 0;
+    let assist = 0
+    if (this.state.current === 0) {
+      type = this.state.selcotype
+    } else if (this.state.current === 1 && this.state.selcotype === 10) {
+      if (this.state.selcotype === 10) {
+        type = 10
+        assist = 2
+      } else {
+        type = 0
+        assist = this.state.selcotype
+      }
+      
+    }
+
     let data = {
       pageNo: pageNo,
       pageSize: 10,
-      type: '0',
-      assist: this.state.current === 0 ? 0 : this.state.selcotype,
+      type: type.toString(),
+      assist: assist.toString(),
       releaseStarts: this.state.rangeStartMinuteVal || undefined,
       releaseEnds: this.state.rangeEndMinuteVal || undefined,
       status: isNaN(parseInt(this.state.starts.id)) ? undefined : String(this.state.starts.id),
@@ -517,7 +533,7 @@ class Examine extends Component {
               list: [],
               pageNo: 1,
               current,
-              selcotype: 4,
+              selcotype: current === 1 ? 4 : 0,
             }, () => {
               this.getPublicReleaseList();
             })

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

@@ -267,7 +267,8 @@ class PunchClocks extends Component {
       Taro.showToast({ title: '当前时间不在打卡时间范围内,无法打卡', icon: 'none' })
       return;
     }
-    if (!(this.state.distance <= this.wxConfig.clockInRange && this.state.distance >= 0)) {
+    // 非公出协单不受位置影响
+    if ([5, 6].indexOf(dtails.type) === -1 && !(this.state.distance <= this.wxConfig.clockInRange && this.state.distance >= 0)) {
       Taro.hideLoading()
       Taro.showToast({ title: '当前位置未处于可打卡范围,无法打卡', icon: 'none' })
       return;
@@ -282,7 +283,7 @@ class PunchClocks extends Component {
     //   Taro.showToast({ title: '已超过合同规定时限,需审核通过,才可打卡!', icon: 'none' });
     //   return
     // }
-    if (this.state.imgs.length === 0) {
+    if ([5, 6].indexOf(dtails.type) === -1 && this.state.imgs.length === 0) {
       Taro.hideLoading()
       Taro.showToast({ title: '请上传打卡照片', icon: 'none' })
       return;
@@ -480,7 +481,7 @@ class PunchClocks extends Component {
                 <View className='types'
                   style={{ color: ["#1D4FEA", "#1E90FF", "#FF5500", "red", "", "#1D4FEA"][dtails.type] }}
                 >
-                  {["业务公出", "技术公出", "行政公出", "技术协单", "", "非公出协单"][dtails.type]}
+                  {["业务公出", "技术公出", "行政公出", "技术协单", "", "非公出协单", "非公出协单"][dtails.type]}
                 </View>
               </View>
               {