Bladeren bron

协单页面完善

dev01 1 week geleden
bovenliggende
commit
9b250e6a79

+ 115 - 88
src/pages/applyDepart/publicContent.jsx

@@ -63,8 +63,8 @@ class PublicContent extends Component {
 
 
       assistType: '',
       assistType: '',
       assistTypeName: '',
       assistTypeName: '',
-      assistContent: '',
-      assistContentName: '',
+      assistContentType: '',
+      assistContentTypeName: '',
 
 
       multiplePickerShow: false,
       multiplePickerShow: false,
       multiplePickerType: '',
       multiplePickerType: '',
@@ -116,6 +116,11 @@ class PublicContent extends Component {
   // 增加 省 市 区拼接,地址带区域的则把区域去掉
   // 增加 省 市 区拼接,地址带区域的则把区域去掉
   getArea() {
   getArea() {
     const { selectArrderLocation } = this.props
     const { selectArrderLocation } = this.props
+
+    if (!Object.keys(selectArrderLocation).length) {
+      return ''
+    }
+
     let address = selectArrderLocation.name;
     let address = selectArrderLocation.name;
     let defaultProvince = selectArrderLocation.province || "";
     let defaultProvince = selectArrderLocation.province || "";
     let defaultCity = selectArrderLocation.city || "";
     let defaultCity = selectArrderLocation.city || "";
@@ -143,6 +148,15 @@ class PublicContent extends Component {
 
 
   onSubmit() {
   onSubmit() {
     let objectType = this.props.enterpriseInfor.id.indexOf(',') > -1 ? 1 : 0
     let objectType = this.props.enterpriseInfor.id.indexOf(',') > -1 ? 1 : 0
+    const { selectArrderLocation } = this.props
+    let addressName = ''  
+    let longitude = ''
+    let latitude = ''
+    if (Object.keys(selectArrderLocation).length) {
+      addressName = selectArrderLocation.province + selectArrderLocation.city + selectArrderLocation.district
+      longitude = selectArrderLocation.longitude
+      latitude = selectArrderLocation.latitude
+    }
     this.setState({
     this.setState({
       loading: true,
       loading: true,
     });
     });
@@ -152,9 +166,9 @@ class PublicContent extends Component {
       releaseStarts: this.state.rangeStartMinuteVal,
       releaseStarts: this.state.rangeStartMinuteVal,
       releaseEnds: this.state.rangeEndMinuteVal,
       releaseEnds: this.state.rangeEndMinuteVal,
       districtName: this.getArea(),
       districtName: this.getArea(),
-      addressName: this.props.selectArrderLocation.province + this.props.selectArrderLocation.city + this.props.selectArrderLocation.district,
-      longitude: this.props.selectArrderLocation.longitude,
-      latitude: this.props.selectArrderLocation.latitude,
+      addressName,
+      longitude,
+      latitude,
       annexUrl: this.state.imgs.length === 0 ? "" : this.state.imgs.join(","),
       annexUrl: this.state.imgs.length === 0 ? "" : this.state.imgs.join(","),
       duration: this.state.totalDuration,
       duration: this.state.totalDuration,
       type: this.props.enterpriseInfor.type,
       type: this.props.enterpriseInfor.type,
@@ -172,7 +186,7 @@ class PublicContent extends Component {
       datas = {
       datas = {
         ...datas,
         ...datas,
         assistType: this.state.assistType,
         assistType: this.state.assistType,
-        assistContentType: this.state.assistContent
+        assistContentTypeType: this.state.assistContentType
       }
       }
     } else {
     } else {
       datas = {
       datas = {
@@ -455,7 +469,7 @@ class PublicContent extends Component {
     let multiplePickerOptions = [];
     let multiplePickerOptions = [];
     let multiplePickerTitle = '';
     let multiplePickerTitle = '';
     let multiplePickerCheckedList = [];
     let multiplePickerCheckedList = [];
-    const { assistType, assistContent } = this.state;
+    const { assistType, assistContentType } = this.state;
     switch (type) {
     switch (type) {
       case 'assistType':
       case 'assistType':
         // 协单项目类型
         // 协单项目类型
@@ -463,10 +477,10 @@ class PublicContent extends Component {
         multiplePickerCheckedList = assistType ? assistType.toString().split(',') : []
         multiplePickerCheckedList = assistType ? assistType.toString().split(',') : []
         multiplePickerTitle = '请选择协单项目类型';
         multiplePickerTitle = '请选择协单项目类型';
         break;
         break;
-      case 'assistContent':
+      case 'assistContentType':
         // 协单项目内容
         // 协单项目内容
         multiplePickerOptions = assistContentList;
         multiplePickerOptions = assistContentList;
-        multiplePickerCheckedList = assistContent ? assistContent.toString().split(',') : []
+        multiplePickerCheckedList = assistContentType ? assistContentType.toString().split(',') : []
         multiplePickerTitle = '请选择协单项目内容';
         multiplePickerTitle = '请选择协单项目内容';
         break;
         break;
       default:
       default:
@@ -478,9 +492,7 @@ class PublicContent extends Component {
       multiplePickerType: type,
       multiplePickerType: type,
       multiplePickerTitle,
       multiplePickerTitle,
       multiplePickerOptions,
       multiplePickerOptions,
-      multiplePickerCheckedList: multiplePickerCheckedList.map(item => Number(item))
-    }, () => {
-      console.log(assistTypeList, this.state.multiplePickerOptions)
+      multiplePickerCheckedList: multiplePickerCheckedList
     })
     })
   }
   }
 
 
@@ -494,11 +506,11 @@ class PublicContent extends Component {
           assistTypeName: selectedLabels.join(',')
           assistTypeName: selectedLabels.join(',')
         })
         })
         break;
         break;
-      case "assistContent":
+      case "assistContentType":
         // 协单项目内容
         // 协单项目内容
         this.setState({
         this.setState({
-          assistContent: selectedIds.join(','),
-          assistContentName: selectedLabels.join(',')
+          assistContentType: selectedIds.join(','),
+          assistContentTypeName: selectedLabels.join(',')
         })
         })
         break;
         break;
       default:
       default:
@@ -509,6 +521,7 @@ class PublicContent extends Component {
   render() {
   render() {
     const { cList, coorderList, popup } = this.state
     const { cList, coorderList, popup } = this.state
     const info = Taro.getStorageSync("userInfor");
     const info = Taro.getStorageSync("userInfor");
+    console.log(this.props.enterpriseInfor.type)
     return (
     return (
       <View className="publicContent">
       <View className="publicContent">
         <View className="formItem">
         <View className="formItem">
@@ -570,62 +583,66 @@ class PublicContent extends Component {
                 "请选择公出时间"
                 "请选择公出时间"
               )}
               )}
             </View>
             </View>
-            <timePicker
-              config={{
-                endDate: true,
-                column: "day",
-                dateLimit: false,
-                // initStartTime: "2019-01-01 12:32:44", //默认开始时间
-                // initEndTime: "2019-12-01 12:32:44",   //默认结束时间
-                limitStartTime: dayjs()
-                  .subtract(3, "year")
-                  .format("YYYY-MM-DD HH:mm:ss"),
-                limitEndTime: dayjs()
-                  .add(3, "year")
-                  .format("YYYY-MM-DD HH:mm:ss"),
-              }}
-              isPartition
-              pickerShow={this.state.isPickerRender}
-              onconditionaljudgment={(v) => {
-                const { enterpriseInfor } = this.props
-                let formatTemp = enterpriseInfor.type == 5 ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm:ss"
-                let selTimeStr = dayjs(v.detail.startTime).second(0).format(formatTemp)
-                let selEndTimeStr = dayjs(v.detail.endTime).second(0).format(formatTemp)
-                
-                let startTimeD = dayjs(enterpriseInfor.type == 5 ? `${selTimeStr} 00:00:00` : selTimeStr);
-                let endTimeD = dayjs(enterpriseInfor.type == 5 ? `${selEndTimeStr} 23:59:59` : selEndTimeStr);
+            { this.state.isPickerRender && (
+              <timePicker
+                config={{
+                  endDate: true,
+                  column: this.props.enterpriseInfor.type == 5 ? "day" : 'minute',
+                  dateLimit: false,
+                  // initStartTime: "2019-01-01 12:32:44", //默认开始时间
+                  // initEndTime: "2019-12-01 12:32:44",   //默认结束时间
+                  limitStartTime: dayjs()
+                    .subtract(3, "year")
+                    .format("YYYY-MM-DD HH:mm:ss"),
+                  limitEndTime: dayjs()
+                    .add(3, "year")
+                    .format("YYYY-MM-DD HH:mm:ss"),
+                }}
+                isPartition
+                pickerShow={this.state.isPickerRender}
+                onconditionaljudgment={(v) => {
+                  const { enterpriseInfor } = this.props
+                  let formatTemp = enterpriseInfor.type == 5 ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm:ss"
+                  let selTimeStr = dayjs(v.detail.startTime).second(0).format(formatTemp)
+                  let selEndTimeStr = dayjs(v.detail.endTime).second(0).format(formatTemp)
+                  
+                  let startTimeD = dayjs(enterpriseInfor.type == 5 ? `${selTimeStr} 00:00:00` : selTimeStr);
+                  let endTimeD = dayjs(enterpriseInfor.type == 5 ? `${selEndTimeStr} 23:59:59` : selEndTimeStr);
 
 
-                let now = dayjs()
-                let currTime = enterpriseInfor.type == 5 ? now.subtract(1, 'day').set('hour', 23).set('minute', 59).set('second', 59) : dayjs().second(0)
+                  let now = dayjs()
+                  let currTime = enterpriseInfor.type == 5 ? now.subtract(1, 'day').set('hour', 23).set('minute', 59).set('second', 59) : dayjs().second(0)
 
 
-                let currTimeD = dayjs(currTime.format("YYYY-MM-DD HH:mm:ss"));
-                if (!startTimeD.isAfter(currTimeD)) {
-                  Taro.showToast({
-                    title: "开始时间不能小于当前时间",
-                    icon: "none",
-                  });
-                  v.detail.setLv(false);
-                } else if (!endTimeD.isAfter(startTimeD)) {
-                  Taro.showToast({
-                    title: "结束时间不能小于开始时间",
-                    icon: "none",
-                  });
-                  v.detail.setLv(false);
-                }
-              }}
-              onhidepicker={() => {
-                this.onPickerHide();
-              }}
-              onsetpickertime={(v) => {
-                this.onSetPickerTime(v);
-              }}
-            />
+                  let currTimeD = dayjs(currTime.format("YYYY-MM-DD HH:mm:ss"));
+                  if (!startTimeD.isAfter(currTimeD)) {
+                    Taro.showToast({
+                      title: "开始时间不能小于当前时间",
+                      icon: "none",
+                    });
+                    v.detail.setLv(false);
+                  } else if (!endTimeD.isAfter(startTimeD)) {
+                    Taro.showToast({
+                      title: "结束时间不能小于开始时间",
+                      icon: "none",
+                    });
+                    v.detail.setLv(false);
+                  }
+                }}
+                onhidepicker={() => {
+                  this.onPickerHide();
+                }}
+                onsetpickertime={(v) => {
+                  this.onSetPickerTime(v);
+                }}
+              />
+            ) }
           </View>
           </View>
         </View>
         </View>
-        <View className="formItem">
-          <View className="formName">总时长:</View>
-          <View className="formValue">{this.state.totalDuration}小时</View>
-        </View>
+        { this.props.enterpriseInfor.type != 5 ? (
+          <View className="formItem">
+            <View className="formName">总时长:</View>
+            <View className="formValue">{this.state.totalDuration}小时</View>
+          </View>
+        ) : null }
         {this.state.validDates.length !== 0 ? (
         {this.state.validDates.length !== 0 ? (
           <View
           <View
             className="formItem"
             className="formItem"
@@ -778,7 +795,7 @@ class PublicContent extends Component {
         { this.props.enterpriseInfor.type == 5 ? (
         { this.props.enterpriseInfor.type == 5 ? (
           <Fragment>
           <Fragment>
             <View className="formItem">
             <View className="formItem">
-              <View className="formName">协单类型:</View>
+              <View className="formName"><Text style={{ color: "red" }}>*</Text>协单类型:</View>
               <View className="formValue" onClick={() => this.handleOpenMultiplePicker('assistType')}>
               <View className="formValue" onClick={() => this.handleOpenMultiplePicker('assistType')}>
                 <Text className="formValueText">
                 <Text className="formValueText">
                   { this.state.assistTypeName }
                   { this.state.assistTypeName }
@@ -787,10 +804,10 @@ class PublicContent extends Component {
               </View>
               </View>
             </View>
             </View>
             <View className="formItem">
             <View className="formItem">
-              <View className="formName">协单内容:</View>
-              <View className="formValue" onClick={() => this.handleOpenMultiplePicker('assistContent')}>
+              <View className="formName"><Text style={{ color: "red" }}>*</Text>协单内容:</View>
+              <View className="formValue" onClick={() => this.handleOpenMultiplePicker('assistContentType')}>
                 <Text className="formValueText">
                 <Text className="formValueText">
-                  { this.state.assistContentName }
+                  { this.state.assistContentTypeName }
                 </Text>
                 </Text>
                 <AtIcon value="chevron-right" size="30" color="#bbbbbb" />
                 <AtIcon value="chevron-right" size="30" color="#bbbbbb" />
               </View>
               </View>
@@ -917,6 +934,7 @@ class PublicContent extends Component {
               if (this.state.loading) {
               if (this.state.loading) {
                 return;
                 return;
               }
               }
+              const { type } = this.props.enterpriseInfor
               if (!this.state.rangeStartMinuteVal) {
               if (!this.state.rangeStartMinuteVal) {
                 Taro.showToast({ title: "请选择公出时间", icon: "none" });
                 Taro.showToast({ title: "请选择公出时间", icon: "none" });
                 return;
                 return;
@@ -926,7 +944,7 @@ class PublicContent extends Component {
                 return;
                 return;
               }
               }
               if (
               if (
-                !(
+                type != 5 && !(
                   this.props.selectArrderLocation.longitude &&
                   this.props.selectArrderLocation.longitude &&
                   this.props.selectArrderLocation.latitude
                   this.props.selectArrderLocation.latitude
                 )
                 )
@@ -934,15 +952,26 @@ class PublicContent extends Component {
                 Taro.showToast({ title: "请选择公出地点", icon: "none" });
                 Taro.showToast({ title: "请选择公出地点", icon: "none" });
                 return;
                 return;
               }
               }
-              if (this.props.enterpriseInfor.type !=0 && !this.state.reason) {
+
+              if (type == 5 && !this.state.assistType) {
+                Taro.showToast({ title: "请选择协单类型", icon: "none" });
+                return
+              }
+
+              if (type == 5 && !this.state.assistContentType) {
+                Taro.showToast({ title: "请选择协单内容", icon: "none" });
+                return
+              }
+
+              if (type !=0 && !this.state.reason) {
                 Taro.showToast({ title: "请输入公出目标", icon: "none" });
                 Taro.showToast({ title: "请输入公出目标", icon: "none" });
                 return;
                 return;
               }
               }
-              if (this.props.enterpriseInfor.type == 1 && !this.state.plan) {
+              if ((type == 1 || type == 5) && !this.state.plan) {
                 Taro.showToast({ title: "请输入公出计划", icon: "none" });
                 Taro.showToast({ title: "请输入公出计划", icon: "none" });
                 return;
                 return;
               }
               }
-              if (this.props.enterpriseInfor.type == 1 && !this.state.expectedEffect) {
+              if ((type == 1 || type == 5) && !this.state.expectedEffect) {
                 Taro.showToast({ title: "请输入预计效果", icon: "none" });
                 Taro.showToast({ title: "请输入预计效果", icon: "none" });
                 return;
                 return;
               }
               }
@@ -954,23 +983,21 @@ class PublicContent extends Component {
                 return;
                 return;
               }
               }
               let info = Taro.getStorageSync("userInfor");
               let info = Taro.getStorageSync("userInfor");
-              if (this.state.totalDuration > info.workTimeInfor.minHours && this.state.imgs.length == 0) {
+              if (type != 5 && this.state.totalDuration > info.workTimeInfor.minHours && this.state.imgs.length == 0) {
                 Taro.showToast({ title: "请上传附件", icon: "none" });
                 Taro.showToast({ title: "请上传附件", icon: "none" });
                 return
                 return
               }
               }
 
 
-              this.props.enterpriseInfor.type == 1
-                ? this.checkOrderNoDuration()
-                : this.props.enterpriseInfor.type == 0
-                  ? this.getRestrictProjectUser()
-                  : this.setState({
-                    isInquiryOpened: true,
-                    inquiryTitle: "提醒",
-                    inquiryContent: "您确定要提交此申请吗?",
-                    inquiryFn: () => {
-                      this.onSubmit();
-                    },
-                  });
+              type == 1 ? this.checkOrderNoDuration() : type == 0
+                ? this.getRestrictProjectUser()
+                : this.setState({
+                  isInquiryOpened: true,
+                  inquiryTitle: "提醒",
+                  inquiryContent: "您确定要提交此申请吗?",
+                  inquiryFn: () => {
+                    this.onSubmit();
+                  },
+                });
             }}
             }}
           >
           >
             提交申请
             提交申请

+ 5 - 2
src/pages/egressDetails/index.jsx

@@ -143,10 +143,12 @@ class EgressDetails extends Component {
       id: this.$instance.router.params.id,
       id: this.$instance.router.params.id,
     })
     })
       .then((v) => {
       .then((v) => {
+        console.log(v)
         if (v.error.length === 0) {
         if (v.error.length === 0) {
           if (v.data) {
           if (v.data) {
             let list = [];
             let list = [];
-            for (let i of v.data.annexUrl.split(",")) {
+            let annexUrl = v.data.annexUrl || ''
+            for (let i of annexUrl.split(",")) {
               if (i) {
               if (i) {
                 list.push({ url: resourceAddress + i });
                 list.push({ url: resourceAddress + i });
               }
               }
@@ -672,7 +674,8 @@ class EgressDetails extends Component {
                     ? "技术公出" : dtails.type == 2
                     ? "技术公出" : dtails.type == 2
                       ? "行政公出" : dtails.type == 3
                       ? "行政公出" : dtails.type == 3
                         ? "技术协单" : dtails.type == 4
                         ? "技术协单" : dtails.type == 4
-                          ? "协单助手" : ""}
+                          ? "协单助手" : dtails.type == 5
+                            ? "非公出协单" : ""}
               </View>
               </View>
             </View>
             </View>
             {dtails.type == 1 ? (
             {dtails.type == 1 ? (

+ 185 - 47
src/pages/egressDetails/publicContent.jsx

@@ -1,4 +1,4 @@
-import React, { Component } from "react";
+import React, { Component, Fragment } from "react";
 import Taro from "@tarojs/taro";
 import Taro from "@tarojs/taro";
 import { Text, View, Button, Icon, Radio, RadioGroup } from "@tarojs/components";
 import { Text, View, Button, Icon, Radio, RadioGroup } from "@tarojs/components";
 import dayjs from "dayjs";
 import dayjs from "dayjs";
@@ -35,6 +35,8 @@ import "taro-ui/dist/style/components/calendar.scss";
 import "./publicContent.less";
 import "./publicContent.less";
 import InquiryModal from "../../components/common/inquiryModal";
 import InquiryModal from "../../components/common/inquiryModal";
 import UserQuery from "../../components/common/userquery"; //选择协单人弹窗
 import UserQuery from "../../components/common/userquery"; //选择协单人弹窗
+import CheckboxPicker from "../../components/common/CheckboxPicker";
+import { assistTypeList, assistContentList } from "../../utils/tools/config";
 
 
 class PublicContent extends Component {
 class PublicContent extends Component {
   constructor(props) {
   constructor(props) {
@@ -59,6 +61,17 @@ class PublicContent extends Component {
       cList: [],
       cList: [],
       isNewshow: false,
       isNewshow: false,
       alone: 1,
       alone: 1,
+
+      assistType: '',
+      assistTypeName: '',
+      assistContentType: '',
+      assistContentTypeName: '',
+
+      multiplePickerShow: false,
+      multiplePickerType: '',
+      multiplePickerTitle: '',
+      multiplePickerOptions: [],
+      multiplePickerCheckedList: [],
     };
     };
     this.onSubmit = this.onSubmit.bind(this);
     this.onSubmit = this.onSubmit.bind(this);
     this.selectArrder = this.selectArrder.bind(this);
     this.selectArrder = this.selectArrder.bind(this);
@@ -68,6 +81,8 @@ class PublicContent extends Component {
     this.onPickerHide = this.onPickerHide.bind(this);
     this.onPickerHide = this.onPickerHide.bind(this);
     this.onSetPickerTime = this.onSetPickerTime.bind(this);
     this.onSetPickerTime = this.onSetPickerTime.bind(this);
     this.getNumHourse = this.getNumHourse.bind(this);
     this.getNumHourse = this.getNumHourse.bind(this);
+    this.handleOpenMultiplePicker = this.handleOpenMultiplePicker.bind(this)
+    this.handleMultipleConfirm = this.handleMultipleConfirm.bind(this)
   }
   }
 
 
   componentDidMount() {
   componentDidMount() {
@@ -107,21 +122,43 @@ class PublicContent extends Component {
         alone: this.props.dtails.alone,
         alone: this.props.dtails.alone,
       })
       })
     } else {
     } else {
+      let rangeStartMinuteVal = dayjs(this.props.dtails.releaseStarts).format("YYYY-MM-DD HH:mm:ss")
+      let rangeEndMinuteVal = dayjs(this.props.dtails.releaseEnds).format("YYYY-MM-DD HH:mm:ss")
+      let assistTypeName = ''
+      let assistContentTypeName = ''
+      if (this.props.dtails.type == 5) {
+        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 || ''
+
+        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({
       this.setState({
         imgs: arr,
         imgs: arr,
         totalDuration: this.props.dtails.duration,
         totalDuration: this.props.dtails.duration,
-        reason: this.props.dtails.remarks,
+        reason: this.props.dtails.remarks || '',
         validDates: JSON.parse(this.props.dtails.validDate),
         validDates: JSON.parse(this.props.dtails.validDate),
         rangeEndVal: dayjs(this.props.dtails.releaseEnds).format("YYYY-MM-DD"),
         rangeEndVal: dayjs(this.props.dtails.releaseEnds).format("YYYY-MM-DD"),
-        rangeEndMinuteVal: dayjs(this.props.dtails.releaseEnds).format("YYYY-MM-DD HH:mm:ss"),
+        rangeEndMinuteVal,
         rangeStartVal: dayjs(this.props.dtails.releaseStarts).format("YYYY-MM-DD"),
         rangeStartVal: dayjs(this.props.dtails.releaseStarts).format("YYYY-MM-DD"),
-        rangeStartMinuteVal: dayjs(this.props.dtails.releaseStarts).format("YYYY-MM-DD HH:mm:ss"),
+        rangeStartMinuteVal,
         plan: this.props.dtails.plan || "",
         plan: this.props.dtails.plan || "",
         expectedEffect: this.props.dtails.expectedEffect || "",
         expectedEffect: this.props.dtails.expectedEffect || "",
         cList: list,
         cList: list,
         coorderList: !dtails.assistAid ? [] : dtails.assistAid.split(","),
         coorderList: !dtails.assistAid ? [] : dtails.assistAid.split(","),
         alone: this.props.dtails.alone,
         alone: this.props.dtails.alone,
+        assistType: this.props.dtails.assistType,
+        assistTypeName,
+        assistContentType: this.props.dtails.assistContentType,
+        assistContentTypeName,
       });
       });
     }
     }
 
 
@@ -293,6 +330,11 @@ class PublicContent extends Component {
     if (isVerify) {
     if (isVerify) {
       datas = { ...datas, ...{ reason: this.props.reason, objectType, } };
       datas = { ...datas, ...{ reason: this.props.reason, objectType, } };
     }
     }
+
+    if(this.props.dtails.type == 5) {
+      datas.assistType = this.state.assistType
+      datas.assistContentTypeType = this.state.assistContentType
+    }
   
   
     for (let key in datas) {
     for (let key in datas) {
       if (datas[key] === undefined || datas[key] === 'undefined' || datas[key] === null || datas[key] === 'null') {
       if (datas[key] === undefined || datas[key] === 'undefined' || datas[key] === null || datas[key] === 'null') {
@@ -623,6 +665,59 @@ class PublicContent extends Component {
       });
       });
   }
   }
 
 
+  handleOpenMultiplePicker(type) {
+    let multiplePickerOptions = [];
+    let multiplePickerTitle = '';
+    let multiplePickerCheckedList = [];
+    const { assistType, assistContentType } = this.state;
+    switch (type) {
+      case 'assistType':
+        // 协单项目类型
+        multiplePickerOptions = assistTypeList;
+        multiplePickerCheckedList = assistType ? assistType.toString().split(',') : []
+        multiplePickerTitle = '请选择协单项目类型';
+        break;
+      case 'assistContentType':
+        // 协单项目内容
+        multiplePickerOptions = assistContentList;
+        multiplePickerCheckedList = assistContentType ? assistContentType.toString().split(',') : []
+        multiplePickerTitle = '请选择协单项目内容';
+        break;
+      default:
+        break;
+    }
+
+    this.setState({
+      multiplePickerShow: true,
+      multiplePickerType: type,
+      multiplePickerTitle,
+      multiplePickerOptions,
+      multiplePickerCheckedList: multiplePickerCheckedList
+    })
+  }
+
+  handleMultipleConfirm(selectedIds, selectedLabels) {
+    const { multiplePickerType } = this.state;
+    switch (multiplePickerType) {
+      case "assistType":
+        // 协单项目类型
+        this.setState({
+          assistType: selectedIds.join(','),
+          assistTypeName: selectedLabels.join(',')
+        })
+        break;
+      case "assistContentType":
+        // 协单项目内容
+        this.setState({
+          assistContentType: selectedIds.join(','),
+          assistContentTypeName: selectedLabels.join(',')
+        })
+        break;
+      default:
+        break;
+    }
+  }
+
   render() {
   render() {
     const { dtails, userList, type, again = false } = this.props;
     const { dtails, userList, type, again = false } = this.props;
     const { cList, coorderList, popup, } = this.state;
     const { cList, coorderList, popup, } = this.state;
@@ -657,7 +752,8 @@ class PublicContent extends Component {
               ? "业务公出" : dtails.type == 1
               ? "业务公出" : dtails.type == 1
                 ? "技术公出" : dtails.type == 2
                 ? "技术公出" : dtails.type == 2
                   ? "行政公出" : dtails.type == 3
                   ? "行政公出" : dtails.type == 3
-                    ? "技术协单" : ""}
+                    ? "技术协单"  : dtails.type == 5
+                      ? "非公出协单" : ""}
           </View>
           </View>
         </View>
         </View>
         {dtails.contractNo && dtails.type == 1 ? (
         {dtails.contractNo && dtails.type == 1 ? (
@@ -668,41 +764,45 @@ class PublicContent extends Component {
         ) : (
         ) : (
           ""
           ""
         )}
         )}
-        <View className="formItem">
-          <View className="formName">作息时间类型:</View>
-          <View className="formValue">
-            <picker
-              onChange={(e) => {
-                this.setState({
-                  workType: e.detail.value,
-                });
-                if (this.state.workTypeList[e.detail.value]) {
-                  let obj = Taro.getStorageSync("userInfor");
-                  obj.workTimeInfor = this.state.workTypeList[e.detail.value];
-                  Taro.setStorageSync("userInfor", obj);
-                  this.setState({
-                    rangeStartVal: "",
-                    rangeStartMinuteVal: "",
-                    rangeEndMinuteVal: "",
-                    rangeEndVal: "",
-                    validDates: [],
-                    totalDuration: 0,
-                  });
-                }
-              }}
-              value={this.state.workType}
-              rangeKey="name"
-              range={this.state.workTypeList}
-            >
-              <view style={{ display: "flex", alignItems: "center" }}>
-                {this.state.workTypeList[this.state.workType]
-                  ? this.state.workTypeList[this.state.workType].name
-                  : ""}
-                <AtIcon value="chevron-right" size="20" color="#bbbbbb" />
-              </view>
-            </picker>
-          </View>
-        </View>
+        {
+          dtails.type != 5 ? (
+            <View className="formItem">
+              <View className="formName">作息时间类型:</View>
+              <View className="formValue">
+                <picker
+                  onChange={(e) => {
+                    this.setState({
+                      workType: e.detail.value,
+                    });
+                    if (this.state.workTypeList[e.detail.value]) {
+                      let obj = Taro.getStorageSync("userInfor");
+                      obj.workTimeInfor = this.state.workTypeList[e.detail.value];
+                      Taro.setStorageSync("userInfor", obj);
+                      this.setState({
+                        rangeStartVal: "",
+                        rangeStartMinuteVal: "",
+                        rangeEndMinuteVal: "",
+                        rangeEndVal: "",
+                        validDates: [],
+                        totalDuration: 0,
+                      });
+                    }
+                  }}
+                  value={this.state.workType}
+                  rangeKey="name"
+                  range={this.state.workTypeList}
+                >
+                  <view style={{ display: "flex", alignItems: "center" }}>
+                    {this.state.workTypeList[this.state.workType]
+                      ? this.state.workTypeList[this.state.workType].name
+                      : ""}
+                    <AtIcon value="chevron-right" size="20" color="#bbbbbb" />
+                  </view>
+                </picker>
+              </View>
+            </View>
+          ) : null
+        }
         <View className="formItem">
         <View className="formItem">
           <View className="formName">公出时间:</View>
           <View className="formName">公出时间:</View>
           <View className="formValue">
           <View className="formValue">
@@ -727,7 +827,7 @@ class PublicContent extends Component {
             <timePicker
             <timePicker
               config={{
               config={{
                 endDate: true,
                 endDate: true,
-                column: "minute",
+                column: dtails.type == 5 ? "day" : "minute",
                 dateLimit: false,
                 dateLimit: false,
                 initStartTime: this.state.rangeStartMinuteVal, //默认开始时间
                 initStartTime: this.state.rangeStartMinuteVal, //默认开始时间
                 initEndTime: this.state.rangeEndMinuteVal, //默认结束时间
                 initEndTime: this.state.rangeEndMinuteVal, //默认结束时间
@@ -776,10 +876,14 @@ class PublicContent extends Component {
             />
             />
           </View>
           </View>
         </View>
         </View>
-        <View className="formItem">
-          <View className="formName">总时长:</View>
-          <View className="formValue">{this.state.totalDuration}小时</View>
-        </View>
+        {
+          dtails.type != 5 && (
+            <View className="formItem">
+              <View className="formName">总时长:</View>
+              <View className="formValue">{this.state.totalDuration}小时</View>
+            </View>
+          )
+        }
         {
         {
           dtails.type === 0 &&
           dtails.type === 0 &&
           <View className="formItem" style={{ alignItems: "flex-start" }}>
           <View className="formItem" style={{ alignItems: "flex-start" }}>
@@ -934,6 +1038,30 @@ class PublicContent extends Component {
         <View className="tips">
         <View className="tips">
           以地图为中心100米范围为可打卡区域,移动红标只需要拖动地图即可
           以地图为中心100米范围为可打卡区域,移动红标只需要拖动地图即可
         </View>
         </View>
+
+        { dtails.type == 5 ? (
+          <Fragment>
+            <View className="formItem">
+              <View className="formName">协单类型:</View>
+              <View className="formValue" onClick={() => this.handleOpenMultiplePicker('assistType')}>
+                <Text className="formValueText">
+                  { this.state.assistTypeName }
+                </Text>
+                <AtIcon value="chevron-right" size="30" color="#bbbbbb" />
+              </View>
+            </View>
+            <View className="formItem">
+              <View className="formName">协单内容:</View>
+              <View className="formValue" onClick={() => this.handleOpenMultiplePicker('assistContentType')}>
+                <Text className="formValueText">
+                  { this.state.assistContentTypeName }
+                </Text>
+                <AtIcon value="chevron-right" size="30" color="#bbbbbb" />
+              </View>
+            </View>
+          </Fragment>
+        ) : null }
+
         <View
         <View
           className="formItem"
           className="formItem"
           style={{ display: "block", paddingTop: "15px" }}
           style={{ display: "block", paddingTop: "15px" }}
@@ -965,7 +1093,7 @@ class PublicContent extends Component {
             </View>
             </View>
           </View>)}
           </View>)}
           {/* 公出计划 */}
           {/* 公出计划 */}
-          {dtails.type != 2 || dtails.type != 0 && (
+          {(dtails.type != 2 || dtails.type != 0) && (
             <View className="formName">
             <View className="formName">
               <Text>
               <Text>
                 <Text style={{ color: "red" }}>*</Text>
                 <Text style={{ color: "red" }}>*</Text>
@@ -989,7 +1117,7 @@ class PublicContent extends Component {
             </View>
             </View>
           )}
           )}
           {/* 预计效果 */}
           {/* 预计效果 */}
-          {dtails.type != 2 || dtails.type != 0 && (
+          {(dtails.type != 2 || dtails.type != 0) && (
             <View className="formName">
             <View className="formName">
               <Text>
               <Text>
                 <Text style={{ color: "red" }}>*</Text>
                 <Text style={{ color: "red" }}>*</Text>
@@ -1266,6 +1394,16 @@ class PublicContent extends Component {
             </View>
             </View>
           </InquiryModal>
           </InquiryModal>
         }
         }
+
+        {/* 多选框 */}
+        <CheckboxPicker
+          isOpened={this.state.multiplePickerShow}
+          title={this.state.multiplePickerTitle}
+          options={this.state.multiplePickerOptions}
+          checkedList={this.state.multiplePickerCheckedList}
+          onClose={() => { this.setState({ multiplePickerShow: false, multiplePickerCheckedList: [] }) }}
+          onConfirm={this.handleMultipleConfirm}
+        ></CheckboxPicker>
       </View>
       </View>
     );
     );
   }
   }

+ 26 - 21
src/pages/mybusiness/index.jsx

@@ -60,7 +60,12 @@ class Examine extends Component {
       id: "",
       id: "",
       rmk: "",
       rmk: "",
       isOpen: false,
       isOpen: false,
+      coorderPublic: [
+        { title: '非公出协单', type: 9 },
+        { title: '公出协单', type: 2 },
+        { title: '全部', type: 4 }],
       coorder: [
       coorder: [
+        { title: '非公出协单', type: 9 },
         { title: '协单助手', type: 3 },
         { title: '协单助手', type: 3 },
         { title: '技术协单', type: 2 },
         { title: '技术协单', type: 2 },
         { title: '全部', type: 4 }],
         { title: '全部', type: 4 }],
@@ -342,6 +347,8 @@ class Examine extends Component {
   }
   }
 
 
   render() {
   render() {
+    const { coorderPublic, current, coorder } = this.state
+    const currCoorderList = current == 0 ? coorderPublic : coorder
     return (
     return (
       <View className='indexPage' >
       <View className='indexPage' >
         <MessageNoticebar />
         <MessageNoticebar />
@@ -510,6 +517,7 @@ class Examine extends Component {
               list: [],
               list: [],
               pageNo: 1,
               pageNo: 1,
               current,
               current,
+              selcotype: 4,
             }, () => {
             }, () => {
               this.getPublicReleaseList();
               this.getPublicReleaseList();
             })
             })
@@ -520,27 +528,24 @@ class Examine extends Component {
                 current={this.state.current}
                 current={this.state.current}
                 index={index}
                 index={index}
               >
               >
-                {
-                  this.state.current === 1 &&
-                  <View className='navs'>
-                    {
-                      this.state.coorder.map((it) =>
-                        <View className={this.state.selcotype == it.type ? 'nitems' : 'nitem'}
-                          key={it.type}
-                          onClick={() => {
-                            this.setState({
-                              list: [],
-                              pageNo: 1,
-                              selcotype: it.type,
-                            }, () => {
-                              this.getPublicReleaseList();
-                            })
-                          }}
-                        >{it.title}</View>
-                      )
-                    }
-                  </View>
-                }
+                <View className='navs'>
+                  {
+                    currCoorderList.map((it) =>
+                      <View className={this.state.selcotype == it.type ? 'nitems' : 'nitem'}
+                        key={it.type}
+                        onClick={() => {
+                          this.setState({
+                            list: [],
+                            pageNo: 1,
+                            selcotype: it.type,
+                          }, () => {
+                            this.getPublicReleaseList();
+                          })
+                        }}
+                      >{it.title}</View>
+                    )
+                  }
+                </View>
                 <MyList
                 <MyList
                   type={0}
                   type={0}
                   title={item.title}
                   title={item.title}

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

@@ -89,6 +89,7 @@ class PunchClocks extends Component {
     let list = dtails.prdList
     let list = dtails.prdList
     for (var i = 0; i < list.length; i++) {
     for (var i = 0; i < list.length; i++) {
       if (list[i].uid == selectUid) {
       if (list[i].uid == selectUid) {
+        console.log(list[i])
         this.setState({
         this.setState({
           data: list[i],
           data: list[i],
           addressLatitude: parseFloat(list[i].latitude),
           addressLatitude: parseFloat(list[i].latitude),
@@ -477,9 +478,9 @@ class PunchClocks extends Component {
                   }
                   }
                 </View>
                 </View>
                 <View className='types'
                 <View className='types'
-                  style={{ color: ["#1D4FEA", "#1E90FF", "#FF5500", "red"][dtails.type] }}
+                  style={{ color: ["#1D4FEA", "#1E90FF", "#FF5500", "red", "", "#1D4FEA"][dtails.type] }}
                 >
                 >
-                  {["业务公出", "技术公出", "行政公出", "技术协单"][dtails.type]}
+                  {["业务公出", "技术公出", "行政公出", "技术协单", "", "非公出协单"][dtails.type]}
                 </View>
                 </View>
               </View>
               </View>
               {
               {

+ 18 - 13
src/utils/tools/config.js

@@ -13673,16 +13673,21 @@ export const assistTypeList = [{
   id: '9'
   id: '9'
 }]
 }]
 
 
-export const assistContentList = [{
-  title: '其他',
-  id: '0'
-}, {
-  title: '会议',
-  id: '1'
-}, {
-  title: '写方案',
-  id: '2'
-}, {
-  title: '接待',
-  id: '3'
-}]
+export const assistContentList = [
+  // {
+  //   title: '其他',
+  //   id: '0'
+  // },
+  {
+    title: '会议',
+    id: '1'
+  },
+  {
+    title: '写方案',
+    id: '2'
+  },
+  {
+    title: '接待',
+    id: '3'
+  }
+]