dev01 1 jaar geleden
bovenliggende
commit
0097723313

+ 4 - 3
src/app.config.js

@@ -43,7 +43,7 @@ export default {
     backgroundTextStyle: 'light',
     navigationBarBackgroundColor: '#fff',
     navigationBarTitleText: 'WeChat',
-    navigationBarTextStyle: 'black'
+    navigationBarTextStyle: 'black',
   },
   requiredBackgroundModes: ['location'],
   requiredPrivateInfos: ["getLocation"],
@@ -51,11 +51,12 @@ export default {
     chooseLocation: {
       version: "1.0.8",
       provider: "wx76a9a06e5b4e693e"
-    }
+    },
   },
   permission: {
     "scope.userLocation": {
       desc: "你的位置信息将用于小程序定位"
     }
-  }
+  },
+  "lazyCodeLoading": "requiredComponents"
 }

+ 59 - 7
src/pages/applyDepart/enterprise.jsx

@@ -1,17 +1,14 @@
 import React, { Component } from "react";
-import { View } from "@tarojs/components";
+import { View, Text } from "@tarojs/components";
 import { getUserByName, getOrderByUid } from "../../utils/servers/servers";
-
-import { AtSearchBar, AtListItem, AtButton } from "taro-ui";
-
+import { AtSearchBar, AtListItem, AtButton, AtIcon } from "taro-ui";
 import "taro-ui/dist/style/components/search-bar.scss";
 import "taro-ui/dist/style/components/button.scss";
 import "taro-ui/dist/style/components/icon.scss";
 import "taro-ui/dist/style/components/list.scss";
 import "taro-ui/dist/style/components/icon.scss";
-
 import ListBottomStart from "../../components/common/listBottomStart";
-
+import "./enterprise.less";
 import Taro from "@tarojs/taro";
 
 class Enterprise extends Component {
@@ -25,6 +22,7 @@ class Enterprise extends Component {
       listVisible: false,
       listValue: {},
       orderNo: [],
+      newList: [],
     };
     this.onChange = this.onChange.bind(this);
     this.getList = this.getList.bind(this);
@@ -35,6 +33,7 @@ class Enterprise extends Component {
       this.setState({
         value: "",
         list: [],
+        newList: [],
         listState: "NO_DATA",
         pageNo: 1,
       });
@@ -164,6 +163,45 @@ class Enterprise extends Component {
             });
           }}
         />
+        {
+          this.state.newList.length > 0 && this.props.type != 1 &&
+          <View className="slist">
+            <View style={{ fontSize: "30rpx" }}>本次公出列表</View>
+            {
+              this.state.newList.map((item, index) =>
+                <View className="slitems" key={index}>
+                  <Text>{index + 1}、{item.name}</Text>
+                  <AtIcon value='close' size='18'
+                    onClick={() => {
+                      let list = this.state.newList
+                      for (var i = 0; i < list.length; i++) {
+                        if (list[i].id == item.id) {
+                          list.splice(i, 1)
+                          this.setState({
+                            newList: list
+                          })
+                        }
+                      }
+                    }}
+                  />
+                </View>
+              )
+            }
+            <View className="slbt">
+              <AtButton size="small" type='primary'
+                onClick={() => {
+                  Taro.eventCenter.trigger("enterprise",
+                    {
+                      id: this.state.newList.map(obj => { return obj.id; }).join(","),
+                      name: this.state.newList.map(obj => { return obj.name; }).join(",")
+                    }
+                  );
+                }}
+              >确定公出列表</AtButton>
+            </View>
+            <View className="cltips">增加企业:搜索增加更多企业,删除企业:点击“X”删除公出列表</View>
+          </View>
+        }
         <View>
           {this.props.type == 0 || this.props.type == 2
             ? this.state.list.map((v, k) => (
@@ -173,7 +211,21 @@ class Enterprise extends Component {
                   arrow="right"
                   iconInfo={{ size: 25, color: "#000000", value: "bookmark" }}
                   onClick={() => {
-                    Taro.eventCenter.trigger("enterprise", v);
+                    let list = this.state.newList
+                    for (var i = 0; i < list.length; i++) {
+                      if (list[i].id == v.id) {
+                        Taro.showToast({
+                          title: "该企业已在公出列表中",
+                          icon: 'none'
+                        })
+                        return
+                      }
+                    }
+                    list.push(v)
+                    this.setState({
+                      newList: list
+                    })
+                    // Taro.eventCenter.trigger("enterprise", v);
                   }}
                 />
               </View>

+ 22 - 0
src/pages/applyDepart/enterprise.less

@@ -0,0 +1,22 @@
+.slist{
+  padding: 10px 20px;
+  font-size: 26px;
+
+  .slitems{
+    margin: 15px 0;
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    justify-content: space-between;
+  }
+
+  .slbt{ 
+    width: 30%;
+    margin: 20px auto;
+  }
+  .cltips{
+    text-align: center;
+    font-size: 24px;
+    color: #4395ff;
+  }
+}

+ 21 - 21
src/pages/applyDepart/publicContent.jsx

@@ -102,6 +102,7 @@ class PublicContent extends Component {
   }
 
   onSubmit() {
+    let objectType = this.props.enterpriseInfor.id.indexOf(',') > -1 ? 1 : 0
     if (!this.state.rangeStartMinuteVal) {
       Taro.showToast({ title: "请选择公出时间", icon: "none" });
       return;
@@ -143,17 +144,12 @@ class PublicContent extends Component {
     });
     const { selectArrderLocation } = this.props
     let datas = {
-      uid: this.props.enterpriseInfor.id,
+      objectType,
+      uids: this.props.enterpriseInfor.id,
       releaseStarts: this.state.rangeStartMinuteVal,
       releaseEnds: this.state.rangeEndMinuteVal,
       remarks: this.state.reason,
-      // plan: this.state.plan,
-      // expectedEffect: this.state.expectedEffect,
-      // userName: selectArrderLocation.province +
-      //   selectArrderLocation.city +
-      //   selectArrderLocation.district +
-      //   selectArrderLocation.name,
-      userName: this.getArea(),
+      districtName: this.getArea(),
       longitude: this.props.selectArrderLocation.longitude,
       latitude: this.props.selectArrderLocation.latitude,
       annexUrl: this.state.imgs.length === 0 ? "" : this.state.imgs.join(","),
@@ -285,18 +281,15 @@ class PublicContent extends Component {
         arr.push({ value: time });
       }
     }
-    this.setState(
-      {
-        rangeEndVal: dayjs(data.endTime).format("YYYY-MM-DD"),
-        rangeStartVal: dayjs(data.startTime).format("YYYY-MM-DD"),
-        validDates: arr,
-      },
-      () => {
-        let a1 = dayjs(dayjs(data.endTime).format("YYYY-MM-DD HH:mm:ss"));
-        let b1 = dayjs(dayjs(data.startTime).format("YYYY-MM-DD  HH:mm:ss"));
-        this.getNumHourse(b1, a1);
-      }
-    );
+    this.setState({
+      rangeEndVal: dayjs(data.endTime).format("YYYY-MM-DD"),
+      rangeStartVal: dayjs(data.startTime).format("YYYY-MM-DD"),
+      validDates: arr,
+    }, () => {
+      let a1 = dayjs(dayjs(data.endTime).format("YYYY-MM-DD HH:mm:ss"));
+      let b1 = dayjs(dayjs(data.startTime).format("YYYY-MM-DD  HH:mm:ss"));
+      this.getNumHourse(b1, a1);
+    });
   }
   // 新增技术协单
   setList(list, arr) {
@@ -318,7 +311,14 @@ class PublicContent extends Component {
       <View className="publicContent">
         <View className="formItem">
           <View className="formName">公出企业:</View>
-          <View className="formValue">{this.props.enterpriseInfor.name}</View>
+          <View className="formValue" style={{ flexDirection: "column", alignItems: "flex-end" }}>
+            {/* {this.props.enterpriseInfor.name} */}
+            {
+              !!this.props.enterpriseInfor.name && this.props.enterpriseInfor.name.indexOf(',') > -1
+                ? this.props.enterpriseInfor.name.split(',')?.map((item, index) => <View key={index}>{item}</View>)
+                : this.props.enterpriseInfor.name
+            }
+          </View>
         </View>
         <View className="formItem">
           <View className="formName">公出类型:</View>

+ 15 - 15
src/pages/applyDepart/result.jsx

@@ -1,23 +1,23 @@
-import React,{Component} from "react";
-import {View,Icon} from '@tarojs/components'
-import {AtButton} from "taro-ui";
+import React, { Component } from "react";
+import { View, Icon } from '@tarojs/components'
+import { AtButton } from "taro-ui";
 import './index.less';
 import Taro from "@tarojs/taro";
 
-class Result extends Component{
+class Result extends Component {
   constructor(props) {
     super(props);
-    this.determine= this.determine.bind(this);
-    this.punchClock= this.punchClock.bind(this);
+    this.determine = this.determine.bind(this);
+    this.punchClock = this.punchClock.bind(this);
   }
 
-  determine(){
+  determine() {
     Taro.eventCenter.trigger('result')
   }
 
-  punchClock(e){
+  punchClock(e) {
     e.stopPropagation();
-    Taro.eventCenter.trigger('GoPunchIn',this.props.punchClockInfor)
+    Taro.eventCenter.trigger('GoPunchIn', this.props.punchClockInfor)
     Taro.switchTab({
       url: '/pages/punchClock/index',
     })
@@ -25,7 +25,7 @@ class Result extends Component{
   }
 
   render() {
-    return(
+    return (
       <View className='result'>
         <View className='resultIcon'>
           {/*{*/}
@@ -44,10 +44,10 @@ class Result extends Component{
               this.props.resultState === 0 ?
                 '' :
                 this.props.resultState === 43101 || this.props.resultState === 2 || this.props.resultState === 40003 ?
-                  ('您可以联系上级审核' + '(' +this.props.resultState + ')') :
+                  ('您可以联系上级审核' + '(' + this.props.resultState + ')') :
                   this.props.resultState === 41030 || this.props.resultState === 47003 || this.props.resultState === 40037 ?
-                    ('您可以联系上级审核' + '(' +this.props.resultState + ')'):
-                    ('您可以联系上级审核' + '(' +this.props.resultState + ')')
+                    ('您可以联系上级审核' + '(' + this.props.resultState + ')') :
+                    ('您可以联系上级审核' + '(' + this.props.resultState + ')')
             }
           </View>
         </View>
@@ -58,9 +58,9 @@ class Result extends Component{
           <AtButton circle type='primary' onClick={this.punchClock}>
             前往打卡
           </AtButton>
-          <AtButton type='secondary' circle onClick={()=>{
+          <AtButton type='secondary' circle onClick={() => {
             Taro.navigateTo({
-              url:'/pages/egressDetails/index?id='+this.props.resultId
+              url: '/pages/egressDetails/index?id=' + this.props.resultId
             })
           }}>
             前往分享

+ 52 - 7
src/pages/egressDetails/enterprise.jsx

@@ -1,14 +1,15 @@
 import React, { Component } from "react";
-import { View, Icon } from "@tarojs/components";
+import { View, Text, Icon } from "@tarojs/components";
 import { getUserByName, getOrderByUid } from "../../utils/servers/servers";
 
-import { AtSearchBar, AtPagination, AtListItem } from "taro-ui";
+import { AtSearchBar, AtPagination, AtListItem, AtIcon, AtButton } from "taro-ui";
 
 import "taro-ui/dist/style/components/search-bar.scss";
 import "taro-ui/dist/style/components/button.scss";
 import "taro-ui/dist/style/components/list.scss";
 import "taro-ui/dist/style/components/icon.scss";
 import "taro-ui/dist/style/components/pagination.scss";
+import "./index.less";
 
 import ListBottomStart from "../../components/common/listBottomStart";
 
@@ -55,6 +56,7 @@ class Enterprise extends Component {
       totalCount: 0,
     });
   }
+
   getByUid(val) {
     this.setState({
       listState: "LOADING",
@@ -76,6 +78,7 @@ class Enterprise extends Component {
       }
     });
   }
+
   getList(value = this.state.value, pageNo = 1) {
     Taro.showLoading({ title: "加载中..." });
     this.setState({
@@ -167,6 +170,34 @@ class Enterprise extends Component {
             );
           }}
         />
+        {
+          this.props.newList.length > 0 && this.props.type != 1 &&
+          <View className="slist">
+            <View style={{ fontSize: "30rpx" }}>本次公出列表</View>
+            {
+              this.props.newList.map((item, index) =>
+                <View className="slitems" key={index}>
+                  <Text>{index + 1}、{item.name}</Text>
+                  <AtIcon value='close' size='18'
+                    onClick={() => {
+                      let list = this.props.newList
+                      for (var i = 0; i < list.length; i++) {
+                        if (list[i].id == item.id) {
+                          list.splice(i, 1)
+                          this.setState({
+                            newList: list
+                          })
+                        }
+                      }
+                    }}
+                  />
+                </View>
+              )
+            }
+            <View className="cltips">增加企业:搜索增加更多企业</View>
+            <View className="cltips">删除企业:点击“X”删除公出列表</View>
+          </View>
+        }
         <View>
           {this.props.type == 0 || this.props.type == 2 ? (
             <View>
@@ -183,11 +214,25 @@ class Enterprise extends Component {
                   }}
                   key={k}
                   onClick={() => {
+                    let list = this.props.newList
+                    for (var i = 0; i < list.length; i++) {
+                      if (list[i].id == v.id) {
+                        Taro.showToast({
+                          title: "该企业已在公出列表中",
+                          icon: 'none'
+                        })
+                        return
+                      }
+                    }
+                    list.push(v)
                     this.setState({
-                      selectId: v.id,
-                    });
+                      newList: list
+                    })
+                    // this.setState({
+                    //   selectId: v.id,
+                    // });
                     // this.getByUid(v)
-                    this.props.onChange({ uid: v.id, nickname: v.name }, 0);
+                    // this.props.onChange({ uid: v.id, nickname: v.name }, 0);
                   }}
                 >
                   <View style={{ fontSize: "15px" }}>{v.name}</View>
@@ -298,8 +343,8 @@ class Enterprise extends Component {
                             v.name = this.state.listValue.name;
                             this.props.onChange(
                               {
-                                uid: v.id,
-                                nickname: v.name,
+                                uids: v.id,
+                                userNames: v.name,
                                 orderNo: v.orderNo,
                                 contractNo: v.contractNo,
                               },

+ 37 - 1
src/pages/egressDetails/index.css

@@ -3,12 +3,14 @@
   background: #F5F5F5;
   padding-bottom: 30px;
 }
+
 .egressDetails .titleContent {
   position: relative;
   background: white;
   padding: 20px 30px;
   border-bottom: 1px #dadada solid;
 }
+
 .egressDetails .titleContent .title {
   font-weight: bolder;
   padding-bottom: 20px;
@@ -16,6 +18,7 @@
   flex-direction: row;
   align-items: center;
 }
+
 .egressDetails .titleContent .title .titRight {
   background: #1E90FF;
   color: white;
@@ -24,6 +27,7 @@
   margin-left: 10px;
   font-size: 25px;
 }
+
 .egressDetails .titleContent .address {
   font-size: 25px;
   color: #767272;
@@ -32,10 +36,12 @@
   flex-flow: row;
   align-items: center;
 }
+
 .egressDetails .titleContent .state {
   font-size: 30px;
   color: #767272;
 }
+
 .egressDetails .titleContent .startIcon {
   width: 180px;
   height: 180px;
@@ -43,15 +49,18 @@
   right: 55px;
   bottom: 0px;
 }
+
 .egressDetails .valueContent {
   margin: 20px;
   padding: 30px;
   background: white;
   border-radius: 20px;
 }
+
 .egressDetails .valueContent .item {
   padding-bottom: 30px;
 }
+
 .egressDetails .valueContent .item .title {
   display: flex;
   flex-flow: row nowrap;
@@ -62,67 +71,80 @@
   padding-bottom: 10px;
   position: relative;
 }
+
 .egressDetails .valueContent .item .title .titleTips {
   color: #ff0000;
   font-size: 18px;
   padding-left: 10px;
 }
+
 .egressDetails .valueContent .item .title .edit {
   position: absolute;
   right: -30px;
   padding: 30px;
 }
+
 .egressDetails .valueContent .item .title .switchItem {
   width: 40px;
   height: 40px;
   margin-left: 20px;
 }
+
 .egressDetails .valueContent .item .value {
   color: #000000;
   font-size: 30px;
 }
+
 .egressDetails .valueContent .item .timeContent {
   background: rgba(0, 51, 255, 0.09);
   border-radius: 30px;
   padding: 30px;
   margin-top: 45px;
 }
+
 .egressDetails .valueContent .item .timeContent .time {
   display: flex;
   flex-flow: row nowrap;
   justify-content: space-between;
   align-items: center;
 }
+
 .egressDetails .valueContent .item .timeContent .time .num {
   font-size: 30px;
 }
+
 .egressDetails .valueContent .item .timeContent .time .journal {
   font-size: 28px;
   color: #007aff;
 }
+
 .egressDetails .valueContent .item .timeContent .timeAxis {
   display: flex;
   flex-flow: column nowrap;
   padding-top: 30px;
 }
+
 .egressDetails .valueContent .item .timeContent .timeAxis .startTime {
   display: flex;
   align-items: center;
   color: #b7acac;
   font-size: 25px;
 }
+
 .egressDetails .valueContent .item .timeContent .timeAxis .axis {
   width: 1px;
   height: 40px;
   border-left: 1px #b7acac solid;
   margin-left: 11px;
 }
+
 .egressDetails .valueContent .item .timeContent .timeAxis .endTime {
   display: flex;
   align-items: center;
   color: #b7acac;
   font-size: 25px;
 }
+
 .egressDetails .valueContent .item .timeContent .timeAxis .circle {
   margin-right: 15px;
   width: 20px;
@@ -130,6 +152,7 @@
   border-radius: 30px;
   border: 1px #b7acac solid;
 }
+
 .egressDetails .valueContent .shareContent {
   display: flex;
   flex-flow: column nowrap;
@@ -137,6 +160,7 @@
   align-items: center;
   width: 100%;
 }
+
 .egressDetails .valueContent .shareContent .share {
   overflow: visible;
   width: 100px;
@@ -145,15 +169,18 @@
   border-radius: 161px;
   background: #0000;
 }
+
 .egressDetails .valueContent .shareContent .share .shareIcon {
   width: 100px;
   height: 100px;
 }
+
 .egressDetails .valueContent .shareContent .shareTitle {
   padding-top: 15px;
   font-size: 19px;
   color: #767272;
 }
+
 .egressDetails .history {
   display: flex;
   flex-flow: row nowrap;
@@ -161,36 +188,45 @@
   align-items: center;
   font-size: 30px;
 }
+
 .egressDetails .operation {
   display: flex;
   flex-flow: row nowrap;
 }
+
 .egressDetails .at-image-picker__flex-box {
   padding-left: 0;
 }
+
 .egressDetails .at-image-picker__remove-btn {
   display: none;
 }
+
 .egressDetails .at-calendar__list.flex .flex__item--selected {
   color: white;
   border: 0 !important;
   border-radius: 0 !important;
   background: #6eb173;
 }
+
 .egressDetails .at-calendar__list.flex .flex__item--selected-head.flex__item--selected-tail {
   background-color: #6eb173;
 }
+
 .egressDetails .at-calendar__list.flex .flex__item {
   background: #6eb173;
   color: #FFFFFF;
 }
+
 .egressDetails .at-calendar__list.flex .flex__item--blur {
   background: #fff !important;
   color: #e1e4e7 !important;
 }
+
 .egressDetails .at-modal__container {
   width: 718px;
 }
+
 .egressDetails button::after {
   border: 0px !important;
-}
+}

+ 33 - 22
src/pages/egressDetails/index.jsx

@@ -40,7 +40,7 @@ import Revoke from "../../image/revoke.png";
 
 import ImagePicker from "../../components/common/imagePicker";
 import MessageNoticebar from "../../components/common/messageNoticebar";
-import { getClockState } from "../../utils/tools";
+import { getClockState, unique } from "../../utils/tools";
 import HistoricalClock from "../../components/historicalClock";
 import UserQuery from "../../components/common/userquery"; //选择协单人弹窗
 
@@ -108,9 +108,9 @@ class EgressDetails extends Component {
               coorderList: v.data.assistantName != null && v.data.assistantName != "" ? v.data.assistantName.split(",") : [],
               cList: v.data.assistantAid != null && v.data.assistantName != "" ? v.data.assistantAid.split(",") : [],
               selectArrderLocation: {
-                longitude: parseFloat(v.data.longitude),
-                latitude: parseFloat(v.data.latitude),
-                name: v.data.userName,
+                longitude: parseFloat(v.data.prdList[0]?.longitude),
+                latitude: parseFloat(v.data.prdList[0]?.latitude),
+                name: v.data.prdList[0]?.districtName,
               },
             });
           } else {
@@ -173,9 +173,9 @@ class EgressDetails extends Component {
             this.setState({
               dtails: v.data,
               selectArrderLocation: {
-                longitude: parseFloat(v.data.longitude),
-                latitude: parseFloat(v.data.latitude),
-                name: v.data.userName,
+                longitude: parseFloat(v.data.prdList[0]?.longitude),
+                latitude: parseFloat(v.data.prdList[0]?.latitude),
+                name: v.data.prdList[0]?.districtName,
               },
             });
           } else {
@@ -243,9 +243,9 @@ class EgressDetails extends Component {
         this.state.dtails.status === 3
           ? this.state.dtails.aname +
           "撤销了前往" +
-          this.state.dtails.userName +
+          this.state.dtails.districtName +
           "的公出"
-          : this.state.dtails.aname + "将要去" + this.state.dtails.userName,
+          : this.state.dtails.aname + "将要去" + this.state.dtails.districtName,
       path: "pages/egressDetails/index?id=" + this.$instance.router.params.id,
     };
   }
@@ -261,7 +261,7 @@ class EgressDetails extends Component {
     updatePublicRelease({
       id: this.$instance.router.params.id,
       status: 3,
-      uid: this.state.dtails.uid,
+      uids: this.state.dtails.uids,
       reason: this.state.reasonsInvalidation,
     })
       .then((v) => {
@@ -272,16 +272,13 @@ class EgressDetails extends Component {
           Taro.showToast({
             title: "修改成功",
           });
-          this.setState(
-            {
-              isInquiryOpened: false,
-              inquiryTitle: "",
-              inquiryContent: "",
-            },
-            () => {
-              this.getReleasetDails();
-            }
-          );
+          this.setState({
+            isInquiryOpened: false,
+            inquiryTitle: "",
+            inquiryContent: "",
+          }, () => {
+            this.getReleasetDails();
+          });
           Taro.eventCenter.trigger("listOperation", {
             type: this.state.dtails.permission,
             index: this.$instance.router.params.index,
@@ -467,7 +464,14 @@ class EgressDetails extends Component {
                   </View>
                 ) : null}
               </View>
-              <View className="value">{dtails.userName}</View>
+              <View className="value">
+                {/* {dtails.districtName} */}
+                {
+                  unique(dtails.prdList, "districtName")?.map((item, index) =>
+                    <View key={index}>{item.districtName}</View>
+                  )
+                }
+              </View>
               <View className="timeContent">
                 <View className="time">
                   <View className="num">公出{dtails.duration}小时</View>
@@ -546,7 +550,14 @@ class EgressDetails extends Component {
             )}
             <View className="item">
               <View className="title">公出企业</View>
-              <View className="value">{dtails.nickname}</View>
+              <View className="value">
+                {/* {dtails.nickname} */}
+                {
+                  !!dtails.userNames && dtails.userNames.indexOf(',') > -1
+                    ? dtails.userNames.split(',')?.map((item, index) => <View key={index}>{item}</View>)
+                    : dtails.userNames
+                }
+              </View>
             </View>
             {
               dtails.assistAidName != null && dtails.assistAidName != "" &&

+ 22 - 0
src/pages/egressDetails/index.less

@@ -263,4 +263,26 @@
   button::after {
     border: 0px !important;
   }
+}
+
+.slist{
+  padding: 10px 20px;
+  font-size: 26px;
+
+  .slitems{
+    margin: 15px 0;
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    justify-content: space-between;
+  }
+  .slbt{ 
+    width: 30%;
+    margin: 20px auto;
+  }
+  .cltips{
+    text-align: center;
+    font-size: 24px;
+    color: #4395ff;
+  }
 }

+ 38 - 21
src/pages/egressDetails/modify.jsx

@@ -9,6 +9,7 @@ import {
 import { Button, View } from "@tarojs/components";
 import Enterprise from "./enterprise";
 import PublicContent from "./publicContent";
+import { getNewList } from "../../utils/tools";
 
 import { updatePublicRelease } from "../../utils/servers/servers";
 
@@ -26,19 +27,43 @@ class Modify extends Component {
       // color: "secondary",
       type: 0,
       visibles: true,
+      newList: getNewList(props.dtails.uids, props.dtails.userNames),
     };
     this.submit = this.submit.bind(this);
     this.onChange = this.onChange.bind(this);
     this.onVisible = this.onVisible.bind(this);
+    this.onListChange = this.onListChange.bind(this);
+    this.getValue = this.getValue.bind(this);
+  }
+
+  getValue(arr, key) {
+    return arr.map(obj => { return obj[key]; }).join(",")
   }
 
   submit() {
-    if (Object.keys(this.state.data).length === 0) {
-      Taro.showToast({ title: "请先选择公出的企业", icon: "none" });
-      return;
-    } else if (this.state.type == 1) {
+    if (this.state.type == 1) {
       Taro.showToast({ title: "技术公出请直接点击公出企业", icon: "none" });
       return;
+    } else if (this.state.length == 0) {
+      Taro.showToast({ title: "请先选择公出的企业", icon: "none" });
+      return;
+    }
+    // if (Object.keys(this.state.data).length === 0) {
+    //   Taro.showToast({ title: "请先选择公出的企业", icon: "none" });
+    //   return;
+    // } else if (this.state.type == 1) {
+    //   Taro.showToast({ title: "技术公出请直接点击公出企业", icon: "none" });
+    //   return;
+    // }
+    if (this.state.type != 1) {
+      let obj = { uids: this.getValue(this.state.newList, "id"), userNames: this.getValue(this.state.newList, "name") }
+      this.setState({
+        dtails: {
+          ...this.state.dtails,
+          ...obj,
+        },
+        data: obj,
+      })
     }
     this.setState({
       modifyType: 2,
@@ -55,6 +80,12 @@ class Modify extends Component {
     });
   }
 
+  onListChange(list) {
+    this.setState({
+      newList: list
+    })
+  }
+
   onChange(value, visi) {
     value.type = this.state.type;
     this.setState({
@@ -65,6 +96,7 @@ class Modify extends Component {
       data: value,
       modifyType: 2,
     });
+
     //判断不明确暂时注释,明确后再行修改
     // if (visi == 0) {
     //   this.setState({
@@ -118,23 +150,6 @@ class Modify extends Component {
                 </AtButton>
               </View>
             ))}
-            {/* <View style={{ margin: '0 10px' }}>
-              <AtButton circle size='small' type={this.state.colors} onClick={() => {
-                this.setState({
-                  colors: 'primary',
-                  color: 'secondary',
-                  type: 0,
-                  visibles:true
-                })
-              }}>业务/行政公出</AtButton>
-            </View>
-            <AtButton type={this.state.color} circle size='small' onClick={() => {
-              this.setState({
-                colors: 'secondary',
-                color: 'primary',
-                type: 1,
-              })
-            }}>技术公出</AtButton> */}
             <View style={{ flex: "1" }}></View>
           </View>
         ) : (
@@ -148,6 +163,8 @@ class Modify extends Component {
               isOpened={this.props.isOpened}
               isVerify={this.props.isVerify} //判断是否在审核中修改
               onChange={this.onChange}
+              newList={this.state.newList}
+              onListChange={this.onListChange}
             />
           ) : (
             <PublicContent

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

@@ -171,6 +171,7 @@ class PublicContent extends Component {
   // 修改公出提交
   onSubmit() {
     const { isVerify = false } = this.props;
+    let objectType = this.props.dtails.uids.indexOf(',') > -1 ? 1 : 0
     if (!this.state.rangeStartMinuteVal) {
       Taro.showToast({ title: "请选择公出时间", icon: "none" });
       return;
@@ -211,13 +212,13 @@ class PublicContent extends Component {
     if (this.props.dtails.type == 0) {
       datas = {
         id: this.props.dtails.id,
-        uid: this.props.dtails.uid,
+        uids: this.props.dtails.uids,
         releaseStarts: this.state.rangeStartMinuteVal,
         releaseEnds: this.state.rangeEndMinuteVal,
         remarks: this.state.reason,
         plan: this.state.plan,
         expectedEffect: this.state.expectedEffect,
-        userName: this.props.locationInfor.name,
+        districtName: this.props.locationInfor.name,
         longitude: this.props.locationInfor.longitude,
         latitude: this.props.locationInfor.latitude,
         annexUrl: this.state.imgs.length === 0 ? "" : this.state.imgs.join(","),
@@ -231,13 +232,13 @@ class PublicContent extends Component {
     } else if (this.props.dtails.type == 2) {
       datas = {
         id: this.props.dtails.id,
-        uid: this.props.dtails.uid,
+        uids: this.props.dtails.uids,
         releaseStarts: this.state.rangeStartMinuteVal,
         releaseEnds: this.state.rangeEndMinuteVal,
         remarks: this.state.reason,
         // plan: this.state.plan,
         // expectedEffect: this.state.expectedEffect,
-        userName: this.props.locationInfor.name,
+        districtName: this.props.locationInfor.name,
         longitude: this.props.locationInfor.longitude,
         latitude: this.props.locationInfor.latitude,
         annexUrl: this.state.imgs.length === 0 ? "" : this.state.imgs.join(","),
@@ -252,13 +253,13 @@ class PublicContent extends Component {
     } else {
       datas = {
         id: this.props.dtails.id,
-        uid: this.props.dtails.uid,
+        uids: this.props.dtails.uids,
         releaseStarts: this.state.rangeStartMinuteVal,
         releaseEnds: this.state.rangeEndMinuteVal,
         remarks: this.state.reason,
         plan: this.state.plan,
         expectedEffect: this.state.expectedEffect,
-        userName: this.props.locationInfor.name,
+        districtName: this.props.locationInfor.name,
         longitude: this.props.locationInfor.longitude,
         latitude: this.props.locationInfor.latitude,
         annexUrl: this.state.imgs.length === 0 ? "" : this.state.imgs.join(","),
@@ -272,7 +273,7 @@ class PublicContent extends Component {
       };
     }
     if (isVerify) {
-      datas = { ...datas, ...{ reason: this.props.reason } };
+      datas = { ...datas, ...{ reason: this.props.reason, objectType, } };
     }
     updatePublicRelease(datas)
       .then((v) => {
@@ -287,7 +288,7 @@ class PublicContent extends Component {
             type: this.props.permission,
             index: this.props.index,
             status: 1,
-            userName: this.props.locationInfor.name,
+            districtName: this.props.locationInfor.name,
             releaseStarts: this.state.rangeStartMinuteVal,
             releaseEnds: this.state.rangeEndMinuteVal,
           });
@@ -348,11 +349,12 @@ class PublicContent extends Component {
     });
     let datas = {
       publicAgain: 1,
-      uid: this.props.dtails.uid,
+      uids: this.props.dtails.uids,
+      objectType: this.props.dtails.uids.indexOf(',') > -1 ? 1 : 0,
       releaseStarts: this.state.rangeStartMinuteVal,
       releaseEnds: this.state.rangeEndMinuteVal,
       remarks: this.state.reason,
-      userName: this.props.locationInfor.name,
+      districtName: this.props.locationInfor.name,
       longitude: this.props.locationInfor.longitude,
       latitude: this.props.locationInfor.latitude,
       annexUrl: this.state.imgs.length === 0 ? "" : this.state.imgs.join(","),
@@ -501,7 +503,14 @@ class PublicContent extends Component {
       <View className="publicContent">
         <View className="formItem">
           <View className="formName">公出企业:</View>
-          <View className="formValue">{dtails.nickname}</View>
+          <View className="formValue" style={{ flexDirection: "column", alignItems: "flex-end" }}>
+            {/* {dtails.nickname} */}
+            {
+              !!dtails.userNames && dtails.userNames.indexOf(',') > -1
+                ? dtails.userNames.split(',')?.map((item, index) => <View key={index}>{item}</View>)
+                : dtails.userNames
+            }
+          </View>
         </View>
         <View className="formItem">
           <View className="formName">公出类型:</View>

+ 2 - 2
src/pages/examine/myList.jsx

@@ -49,7 +49,7 @@ class MyList extends Component {
                 </View>
                 <View className="userName">
                   <View className="uNtext">
-                    公出企业:{v.nickname}
+                    公出企业:{v.userNames}
                   </View>
                   {
                     title == "我的公出" &&
@@ -82,7 +82,7 @@ class MyList extends Component {
                 </View>
                 <View className="userName">
                   <View className="uNtext">
-                    公出地点:{v.userName}
+                    公出地点:{v.districtName}
                   </View>
                 </View>
                 <View className="releaseStarts">

+ 3 - 3
src/pages/mybusiness/index.jsx

@@ -130,9 +130,9 @@ class Examine extends Component {
           this.setState({
             dtails: v.data,
             selectArrderLocation: {
-              longitude: parseFloat(v.data.longitude),
-              latitude: parseFloat(v.data.latitude),
-              name: v.data.userName,
+              longitude: parseFloat(v.data.prdList[0]?.longitude),
+              latitude: parseFloat(v.data.prdList[0]?.latitude),
+              name: v.data.prdList[0]?.districtName,
             },
           })
         }

+ 85 - 8
src/pages/punchClock/index.jsx

@@ -1,26 +1,103 @@
-import React,{Component} from "react";
+import React, { Component } from "react";
 import PunchClocks from './punchClocks';
 import MessageNoticebar from "../../components/common/messageNoticebar";
+import { AtModal, } from "taro-ui"
 import Taro from "@tarojs/taro";
+import { updateLocation } from '../../utils/servers/servers';
 
-class PunchClock extends Component{
+class PunchClock extends Component {
   constructor(props) {
     super(props);
+    this.state = {
+      data: {},
+      isOpened: false,
+      isHome: false,
+    }
+    this.onClose = this.onClose.bind(this);
+    this.handleConfirm = this.handleConfirm.bind(this);
   }
 
-  componentDidShow(){
-    Taro.eventCenter.trigger('punchClockComponentDidShow');
+  componentDidShow() {
+    if (this.state.isHome) {
+      Taro.eventCenter.trigger('punchClockComponentDidShow');
+      //获取地区选定数据
+      const chooseLocation = requirePlugin("chooseLocation");
+      const location = chooseLocation.getLocation();
+      if (location) {
+        this.setState({
+          data: location,
+          isOpened: true
+        })
+        // 清除数据
+        chooseLocation.setLocation(null);
+      }
+    }
   }
 
-  componentDidMount(){
-    Taro.eventCenter.trigger('GoPuncsshIn',{data:'unread'})
+  onClose() {
+    this.setState({
+      data: {},
+      isOpened: false,
+      isHome: false,
+    })
+  }
+
+  getId(id, uid) {
+    this.setState({ id, uid })
+  }
+  // 判断是否是首页打卡切换位置
+  getHome() {
+    this.setState({ isHome: true })
+  }
+
+  handleConfirm() {
+    const { id, uid, data } = this.state
+    updateLocation({
+      id,
+      uid,
+      longitude: data.longitude,
+      latitude: data.latitude,
+      districtName: data.name,
+    }).then(v => {
+      this.onClose()
+      Taro.hideLoading()
+      if (v.error.length === 0) {
+        Taro.showToast({ title: '打卡位置已更新', icon: 'none' });
+      } else {
+        Taro.showToast({ title: v.error[0].message, icon: 'none' })
+      }
+    }).catch(() => {
+      this.onClose()
+      Taro.hideLoading()
+      Taro.showToast({
+        title: '系统错误,请稍后再试',
+        icon: 'none'
+      })
+    })
+  }
+
+  componentDidMount() {
+    Taro.eventCenter.trigger('GoPuncsshIn', { data: 'unread' })
   }
 
   render() {
     return (
       <>
-        <MessageNoticebar/>
-        <PunchClocks/>
+        <MessageNoticebar />
+        {
+          // 刷新打卡页
+          !this.state.isOpened && <PunchClocks getId={this.getId.bind(this)} getHome={this.getHome.bind(this)} />
+        }
+        <AtModal
+          isOpened={this.state.isOpened}
+          title='提示'
+          cancelText='取消'
+          confirmText='确认'
+          onClose={this.onClose}
+          onCancel={this.onClose}
+          onConfirm={this.handleConfirm}
+          content='您确定是否切换位置?切换位置,将重新提交“公出审核”,如您的公出审核已通过,则需再次审核。'
+        />
       </>
     )
   }

+ 64 - 1
src/pages/punchClock/index.less

@@ -93,6 +93,59 @@
     align-items: center;
     position: relative;
 
+    .enterprise {
+      width: 94%;
+      background: #eae8e8;
+      margin: 0 30px;
+      padding: 20px;
+      border-radius: 20px;
+
+      .entit {
+        font-size: 30px;
+        margin-bottom: 8px;
+
+      }
+
+      .userlist {
+        display: flex;
+        flex-direction: row;
+        justify-content: space-between;
+
+        .username {
+          font-size: 26px;
+          line-height: 38px;
+          color: #4564DC;
+          max-width: 70%;
+
+        }
+
+        .switch{
+          display: flex;
+          align-items: center;
+          justify-content: center;
+          border-radius: 30px;
+          border: 1px solid #999999;
+          padding: 11px 10px;
+          height: 24px;
+
+          .stxt{
+            font-size: 18px;
+            color: #999999;
+            padding-right: 10px;
+          }
+
+          .sicon{
+            width: 25px;
+            height: 25px;
+          }
+
+        }
+
+      }
+
+    }
+
+
     .history {
       display: flex;
       flex-flow: row nowrap;
@@ -193,7 +246,7 @@
       flex-flow: column nowrap;
       justify-content: center;
       align-items: center;
-      margin-bottom: 75px;
+      margin-bottom: 20px;
 
       .punchClockTitle {
         color: white;
@@ -213,6 +266,16 @@
       }
     }
 
+    .switchposition {
+      margin-bottom: 50px;
+      font-size: 30px;
+
+      .stxt {
+        color: #4395ff;
+      }
+
+    }
+
     .photographContent {
       display: flex;
       flex-flow: row nowrap;

+ 152 - 46
src/pages/punchClock/punchClocks.jsx

@@ -2,28 +2,24 @@ import React, { Component } from 'react'
 import { connect } from 'react-redux'
 import { Map, OpenData, View, Image, Text, Button } from '@tarojs/components'
 import Taro from '@tarojs/taro';
-import { AtIcon, AtModal, AtModalContent, AtModalAction, AtTextarea } from "taro-ui";
+import { AtIcon, AtModal, AtModalHeader, AtModalContent, AtModalAction, AtTextarea, AtRadio, AtList } from "taro-ui";
 import dayjs from 'dayjs';
 import Skeleton from 'taro-skeleton'
-
 import HistoricalClock from '../../components/historicalClock';
-
 import ImagePicker from '../../components/common/imagePicker';
-
 import { add, minus, asyncAdd } from '../../actions/counter'
-
-import { getPublicReleaseList, publicReleaseClockIn, getPunchClockInfo } from '../../utils/servers/servers';
-
+import { getPublicReleaseList, publicReleaseClockIn, getPunchClockInfo, getReleasetDails } from '../../utils/servers/servers';
 import './index.less'
-
 import switchIocn from '../../image/switch.png';
 import Location from '../../image/location.png';
 import PunchRange from '../../image/punchRange.png';
-
 import 'taro-ui/dist/style/components/noticebar.scss';
 import 'taro-ui/dist/style/components/icon.scss';
 import 'taro-ui/dist/style/components/list.scss';
-import { getClockState } from "../../utils/tools";
+import "taro-ui/dist/style/components/radio.scss";
+import "taro-ui/dist/style/components/icon.scss";
+
+import { getClockState, getNewOptions } from "../../utils/tools";
 
 const QQMapWX = require('../../components/common/mapSDK/qqmap-wx-jssdk.min.js');
 
@@ -52,6 +48,7 @@ class PunchClocks extends Component {
       addressLongitude: '',
       distance: '',
       dtails: {},
+      data: {},
       loading: true,
       isAbnormalOpen: false,
       clockInRemarks: "",//打卡说明
@@ -63,6 +60,8 @@ class PunchClocks extends Component {
     this.abnormalClockIn = this.abnormalClockIn.bind(this);
     this.refresh = this.refresh.bind(this);
     this.getDtails = this.getDtails.bind(this);
+    this.selectArrder = this.selectArrder.bind(this);
+    this.selectOn = this.selectOn.bind(this);
   }
 
   nowTime = null;
@@ -79,6 +78,44 @@ class PunchClocks extends Component {
     this.getDtails();
   }
 
+  selectOn() {
+    const { dtails, selectUid } = this.state
+    if (!selectUid) {
+      Taro.showToast({ title: '请选择您要打卡的企业', icon: 'none' });
+      return
+    }
+    let list = dtails.prdList
+    for (var i = 0; i < list.length; i++) {
+      if (list[i].uid == selectUid) {
+        this.setState({
+          data: list[i],
+          addressLatitude: parseFloat(list[i].latitude),
+          addressLongitude: parseFloat(list[i].longitude),
+          isTips: false,
+          selectUid: "",
+        })
+      }
+    }
+  }
+
+  selectArrder() {
+    const { dtails, data } = this.state
+    this.props.getId(dtails.id, data.uid)
+    this.props.getHome()
+    const key = "AWBBZ-GRAC2-JFYUO-CLA7I-JAHXK-YFFGT"; //使用在腾讯位置服务申请的key
+    const referer = "科德打卡定位"; //调用插件的app的名称
+    const category = "公司企业,房产小区";
+    Taro.navigateTo({
+      url:
+        "plugin://chooseLocation/index?key=" +
+        key +
+        "&referer=" +
+        referer +
+        "&category=" +
+        category,
+    });
+  }
+
   getDtails() {
     this.getData(() => {
       Taro.startLocationUpdate({
@@ -145,25 +182,45 @@ class PunchClocks extends Component {
     })
 
     Taro.eventCenter.on('GoPunchIn', (arg) => {
-      this.setState({
-        dtails: arg,
-        addressLatitude: parseFloat(arg.latitude),
-        addressLongitude: parseFloat(arg.longitude),
-      }, () => {
-        Taro.showToast({ title: '切换成功' });
-        Taro.startLocationUpdate({
-          success: () => {
-            Taro.onLocationChange((v) => {
-              this.getSpacing(v.latitude, v.longitude)
-            })
-          },
-          fail: () => {
+      getReleasetDails({
+        id: arg.id,
+      }).then((v) => {
+        if (v.error.length === 0) {
+          if (v.data) {
+            if (!v.data.prdList) {
+              return
+            }
+            let data = v.data.prdList[0]
             this.setState({
-              loading: false
+              dtails: v.data,
+              data,
+              // addressLatitude: parseFloat(arg.latitude),
+              // addressLongitude: parseFloat(arg.longitude),
+              addressLatitude: parseFloat(data.latitude),
+              addressLongitude: parseFloat(data.longitude),
+            }, () => {
+              Taro.showToast({ title: '切换成功' });
+              Taro.startLocationUpdate({
+                success: () => {
+                  Taro.onLocationChange((v) => {
+                    this.getSpacing(v.latitude, v.longitude)
+                  })
+                },
+                fail: () => {
+                  this.setState({
+                    loading: false
+                  })
+                }
+              })
             })
+          } else {
           }
-        })
-      })
+        } else {
+          Taro.showToast({ title: v.error[0].message, icon: "none" });
+        }
+      }).catch((err) => {
+        Taro.showToast({ title: "系统错误,请稍后再试", icon: "none" });
+      });
     })
   }
 
@@ -171,8 +228,10 @@ class PunchClocks extends Component {
     Taro.offLocationChange();
     this.nowTime && this.nowTime.clearTimeout();
   }
+
   // 正常打卡
-  publicReleaseClockIn() {
+  publicReleaseClockIn(uid) {
+
     if (this.state.dtails.status === 3) {
       Taro.hideLoading()
       Taro.showToast({ title: '申请已撤销,无法打卡', icon: 'none' });
@@ -203,18 +262,20 @@ class PunchClocks extends Component {
       Taro.showToast({ title: '请上传打卡照片', icon: 'none' })
       return;
     }
+
     publicReleaseClockIn({
       id: this.state.dtails.id,
       photoUrl: this.state.imgs.join(','),
       clockIn: 1,
+      uid: this.state.data.uid,
     }).then(v => {
       Taro.hideLoading()
       if (v.error.length === 0) {
         Taro.showToast({ title: '打卡成功', icon: 'none' });
         this.imagePicker.clear();
-        this.state.dtails.clockIn = 1;
+        this.state.data.clockIn = 1;
         this.setState({
-          dtails: this.state.dtails,
+          data: this.state.data,
           imgs: []
         })
       } else {
@@ -245,9 +306,9 @@ class PunchClocks extends Component {
       if (v.error.length === 0) {
         Taro.showToast({ title: '打卡成功', icon: 'none' });
         this.imagePicker.clear();
-        this.state.dtails.clockIn = 2;
+        this.state.data.clockIn = 2;
         this.setState({
-          dtails: this.state.dtails,
+          data: this.state.data,
           imgs: [],
           clockInRemarks: "",
           isAbnormalOpen: false,
@@ -263,6 +324,7 @@ class PunchClocks extends Component {
       })
     })
   }
+
   getData(fn) {
     this.setState({
       loading: true
@@ -273,16 +335,19 @@ class PunchClocks extends Component {
           loading: false
         })
         if (v.data) {
+          let data = v.data.prdList[0]
           this.setState({
             dtails: v.data,
-            addressLatitude: v.data.latitude,
-            addressLongitude: v.data.longitude,
+            data,
+            addressLatitude: data.latitude,
+            addressLongitude: data.longitude,
           }, () => {
             fn();
           })
         } else {
           this.setState({
             dtails: {},
+            data: {},
           })
         }
       } else {
@@ -354,7 +419,7 @@ class PunchClocks extends Component {
   }
 
   render() {
-    const { dtails } = this.state;
+    const { dtails, data } = this.state;
     return (
       <View className='punchClock'>
         <View className='header'>
@@ -373,21 +438,21 @@ class PunchClocks extends Component {
               <View className='infor'>
                 <View className='name'>
                   {
-                    Object.keys(this.state.dtails).length <= 0 ?
+                    Object.keys(dtails).length <= 0 ?
                       Taro.getStorageSync('userInfor').name :
                       dtails.aname
                   }
                 </View>
-                <View className='address'>
+                {/* <View className='address'>
                   公出企业:
                   <View className='nickname'>
                     {
-                      Object.keys(this.state.dtails).length <= 0 ?
+                      Object.keys(dtails).length <= 0 ?
                         '无' :
-                        dtails.nickname
+                        dtails.userNames
                     }
                   </View>
-                </View>
+                </View> */}
                 <View className='types'
                   style={{ color: ["#1D4FEA", "#1E90FF", "#FF5500", "red"][dtails.type] }}
                 >
@@ -454,6 +519,19 @@ class PunchClocks extends Component {
             </View> :
             <View>
               <View className='content'>
+                <View className="enterprise">
+                  <View className='entit'>公出企业</View>
+                  <View className='userlist'>
+                    <Text className='username'>{data.userName}</Text>
+                    {
+                      this.state.dtails.prdList?.length > 1 &&
+                      <View className='switch'>
+                        <View className='stxt' onClick={() => { this.setState({ isTips: true }) }}>切换企业</View>
+                        <Image src={switchIocn} className='sicon' />
+                      </View>
+                    }
+                  </View>
+                </View>
                 <View className='timeContent'>
                   <View className='timeItem'>
                     <View className='timeTitle'>公出开始时间</View>
@@ -488,7 +566,7 @@ class PunchClocks extends Component {
                   false &&
                   <View
                     className="photographUnusual"
-                    style={{ background: dtails.clockIn === 1 ? "#f69c9f" : "red" }}
+                    style={{ background: data.clockIn === 1 ? "#f69c9f" : "red" }}
                     onClick={() => {
                       if (this.state.imgs.length === 0) {
                         Taro.hideLoading()
@@ -499,8 +577,9 @@ class PunchClocks extends Component {
                         isAbnormalOpen: true
                       })
                     }}
-                  >{(dtails.clockIn === 1 || dtails.clockIn === 2) ? "刷新打卡" : "异常打卡"}</View>
+                  >{(data.clockIn === 1 || data.clockIn === 2) ? "刷新打卡" : "异常打卡"}</View>
                 }
+
                 <View className='punchClockContent'
                   onClick={() => {
                     let _this = this;
@@ -532,23 +611,31 @@ class PunchClocks extends Component {
                         && this.state.distance <= this.wxConfig.clockInRange && this.state.distance >= 0 &&
                         !(dayjs().isBefore(this.state.dtails.releaseStarts) || dayjs().isAfter(this.state.dtails.releaseEnds)) &&
                         dtails.status !== 3
-                        ? ((dtails.clockIn === 1 && dtails.clockIn === 2) ? '1px 1px 15px 1px #3f82e8' : '1px 1px 15px 1px #659268') : '1px 1px 15px 1px #828e83',
+                        ? ((data.clockIn === 1 || data.clockIn === 2) ? '1px 1px 15px 1px #3f82e8' : '1px 1px 15px 1px #72cb78') : '1px 1px 15px 1px #828e83',
                     background: (!isNaN(parseInt(this.state.distance)))
                       &&
                       this.state.distance <= this.wxConfig.clockInRange &&
                       this.state.distance >= 0 &&
                       !(dayjs().isBefore(this.state.dtails.releaseStarts) || dayjs().isAfter(this.state.dtails.releaseEnds)) &&
                       dtails.status !== 3
-                      ? ((dtails.clockIn === 1 && dtails.clockIn === 2) ? '#3f82e8' : '#72cb78') : '#828e83'
+                      ? ((data.clockIn === 1 || data.clockIn === 2) ? '#3f82e8' : '#72cb78') : '#828e83'
                   }}>
                   <View className='punchClockTitle'>
                     {
-                      (dtails.clockIn === 1 || dtails.clockIn === 2) ?
+                      (data.clockIn === 1 || data.clockIn === 2) ?
                         '刷新打卡' : '公出打卡'
                     }
                   </View>
                   <View className='punchClockTime'>{this.state.nowTime}</View>
                 </View>
+
+                {
+                  !(this.state.distance <= this.wxConfig.clockInRange && this.state.distance >= 0) &&
+                  <View className='switchposition'>您不在打卡范围:
+                    <Text className='stxt' onClick={this.selectArrder}>切换位置</Text>
+                  </View>
+                }
+
                 <View className='map'>
                   <View className='locationContent'>
                     <View className='location' onClick={() => {
@@ -658,7 +745,8 @@ class PunchClocks extends Component {
             </AtModalAction>
           </AtModal>
         }
-        {this.state.historicalIsOpened &&
+        {
+          this.state.historicalIsOpened &&
           <HistoricalClock
             id={dtails.id}
             isOpened={this.state.historicalIsOpened}
@@ -667,7 +755,25 @@ class PunchClocks extends Component {
                 historicalIsOpened: false
               })
             }}
-          />}
+          />
+        }
+        {
+          this.state.isTips &&
+          <AtModal isOpened={this.state.isTips}>
+            <AtModalHeader>请选择</AtModalHeader>
+            <AtModalContent>
+              <AtRadio
+                options={getNewOptions(dtails.prdList)}
+                value={this.state.selectUid}
+                onClick={e => { this.setState({ selectUid: e }) }}
+              />
+            </AtModalContent>
+            <AtModalAction>
+              <Button type='secondary' onClick={() => { this.setState({ isTips: false }) }}>取消</Button>
+              <Button type='primary' onClick={this.selectOn}>确定</Button>
+            </AtModalAction>
+          </AtModal>
+        }
       </View>
     )
   }

+ 2 - 2
src/utils/config.js

@@ -1,7 +1,7 @@
 // 本地
-// export const resourceAddress = 'http://172.16.0.255:3000/upload;'
+export const resourceAddress = 'http://172.16.0.255:3000/upload;'
 // 生产
-export const resourceAddress = 'https://s.jishutao.com/upload';
+// export const resourceAddress = 'https://s.jishutao.com/upload';
 // 测试
 // export const resourceAddress = 'https://static.jishutao.com/upload';
 

+ 2 - 2
src/utils/servers/baseUrl.js

@@ -7,9 +7,9 @@ const getBaseUrl = (url) => {
     BASE_URL = 'https://bm.jishutao.com'
   } else {
     // 生产环境
-    // BASE_URL = 'http://172.16.0.255:8080'
+    BASE_URL = 'http://172.16.0.255:8080'
     // BASE_URL = 'https://uat.jishutao.com'
-    BASE_URL = 'https://bm.jishutao.com'
+    // BASE_URL = 'https://bm.jishutao.com'
   }
   return BASE_URL
 }

+ 5 - 0
src/utils/servers/servers.js

@@ -122,4 +122,9 @@ export const addAssistant = (postData = {}) => {
 //删除协单助力
 export const deleteAssistant = (postData = {}) => {
   return HTTPREQUEST.post('/api/admin/release/deleteAssistant', postData)
+}
+
+//修改公出地址
+export const updateLocation = (postData = {}) => {
+  return HTTPREQUEST.post('/api/admin/release/updateLocation', postData)
 }

+ 50 - 0
src/utils/tools/index.js

@@ -133,6 +133,7 @@ export const deepClone1 = (obj) => {
   }
   return objClone;
 }
+
 // 是否是登录人的id
 export const isOneself = (id) => {
   let userInfor = Taro.getStorageSync('userInfor');
@@ -143,3 +144,52 @@ export const isOneself = (id) => {
   }
 }
 
+// 数组合并处理
+export const getNewList = (uids, unames) => {
+  // if(!uids){
+  //   return []
+  // }
+  if (uids.indexOf(",") > -1) {
+    let idlist = uids.split(',')
+    let namelist = unames.split(',')
+    let newlist = []
+    for (var i = 0; i < idlist.length; i++) {
+      newlist.push({ id: idlist[i], name: namelist[i] })
+    }
+    return newlist
+  } else {
+    return [{ id: uids, name: unames }]
+  }
+}
+
+// 数组重组
+export const getNewOptions = (arr) => {
+  let list = []
+  for (var i = 0; i < arr.length; i++) {
+    list.push({ label: arr[i].userName, value: arr[i].uid })
+  }
+  return list
+}
+
+// 数组去重
+export const unique = (arr, key) => {
+  if (arr.length <= 1) {
+    return arr
+  }
+  for (var i = 0; i < arr.length; i++) {
+    for (var j = i + 1; j < arr.length; j++) {
+      if (key) {
+        if (arr[i][key] == arr[j][key]) {         //第一个等同于第二个,splice方法删除第二个
+          arr.splice(j, 1);
+          j--;
+        }
+      } else {
+        if (arr[i] == arr[j]) {
+          arr.splice(j, 1);
+          j--;
+        }
+      }
+    }
+  }
+  return arr;
+}