瀏覽代碼

公出限制

dev01 1 年之前
父節點
當前提交
227d61616b

+ 1 - 1
src/app.config.js

@@ -53,7 +53,7 @@ export default {
   ],
   plugins: {
     chooseLocation: {
-      version: "1.0.8",
+      version: "1.0.10",
       provider: "wx76a9a06e5b4e693e"
     },
   },

+ 33 - 3
src/app.jsx

@@ -15,7 +15,37 @@ import 'taro-ui/dist/style/components/list.scss';
 const store = configStore()
 
 class App extends Component {
-  componentDidMount() { }
+
+  componentDidMount() {
+    //在页面加载完成的生命周期加入这段代码,Taro在componentDidMount生命周期中使用,原生在onLoad中使用
+    const updateManager = Taro.getUpdateManager()
+    updateManager.onCheckForUpdate(function (res) {
+      // 请求完新版本信息的回调
+      //console.log('请求完新版本信息的回调')
+      console.log(res.hasUpdate);
+    })
+
+    updateManager.onUpdateReady(function () {
+      Taro.showModal({
+        title: '更新提示',
+        content: '新版本已经准备好,是否重启应用?',
+        success(res) {
+          if (res.confirm) {
+            console.log("go")
+            // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
+            updateManager.applyUpdate()
+          }
+        }
+      })
+    })
+
+    updateManager.onUpdateFailed(function () {
+      // 新版本下载失败
+      console.log('新版本下载失败')
+      // errorReport(ERROREVENTS.VERSION_UPGRADE_FAILED, '新版本下载失败');
+    })
+
+  }
 
   componentDidShow() {
     Taro.eventCenter.on('getStorageSync', () => {
@@ -57,8 +87,8 @@ class App extends Component {
       header: {
         'token': token,
       },
-      url: 'wss://bm.jishutao.com/webSocketServer',
-      // url: 'wss://172.16.0.255:8080/webSocketServer'
+      // url: 'wss://bm.jishutao.com/webSocketServer',
+      url: 'wss://172.16.0.255:8080/webSocketServer'
       // url: 'wss://uat.jishutao.com/webSocketServer'
     })
 

+ 11 - 3
src/pages/applyDepart/enterprise.jsx

@@ -1,5 +1,5 @@
 import React, { Component } from "react";
-import { View, Text } from "@tarojs/components";
+import { View, Text, Icon } from "@tarojs/components";
 import { getUserByName, getOrderByUid } from "../../utils/servers/servers";
 import { AtSearchBar, AtListItem, AtButton, AtIcon } from "taro-ui";
 import "taro-ui/dist/style/components/search-bar.scss";
@@ -86,6 +86,7 @@ class Enterprise extends Component {
     });
     getUserByName({
       name: value,
+      type: 1,
       pageNo: pageNo,
       pageSize: 10,
     })
@@ -195,7 +196,8 @@ class Enterprise extends Component {
                   Taro.eventCenter.trigger("enterprise",
                     {
                       id: this.state.newList.map(obj => { return obj.id; }).join(","),
-                      name: this.state.newList.map(obj => { return obj.name; }).join(",")
+                      name: this.state.newList.map(obj => { return obj.name; }).join(","),
+                      list: this.state.newList,
                     }
                   );
                 }}
@@ -274,6 +276,13 @@ class Enterprise extends Component {
                   arrow="right"
                   iconInfo={{ size: 25, color: "#000000", value: "bookmark" }}
                   onClick={() => {
+                    if (v.status == 2 && this.props.type == 0) {
+                      Taro.showToast({
+                        title: "请在“单位公共客户”中领取后,再次发起公出!",
+                        icon: 'none'
+                      })
+                      return
+                    }
                     let list = this.state.newList
                     for (var i = 0; i < list.length; i++) {
                       if (list[i].id == v.id) {
@@ -310,7 +319,6 @@ class Enterprise extends Component {
                           select = 1
                         }
                       }
-
                       if (select == 0) {
                         this.setState({
                           listVisible: true,

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

@@ -54,6 +54,8 @@ class ApplyDepart extends Component {
       // color: "secondary",
       // selectColor: 0,
       type: 0,
+      isShow: false,
+      tipList: [],
     };
   }
 
@@ -72,6 +74,8 @@ class ApplyDepart extends Component {
         resultState: arg.code,
         resultId: arg.data.id,
         punchClockInfor: arg.data,
+        isShow: arg.isShow,
+        tipList: arg?.list,
       });
     });
     Taro.eventCenter.on("enterpriseBack", () => {
@@ -166,6 +170,8 @@ class ApplyDepart extends Component {
                 resultState={this.state.resultState}
                 resultId={this.state.resultId}
                 punchClockInfor={this.state.punchClockInfor}
+                isShow={this.state.isShow}
+                tipList={this.state.tipList}
               />
             </View>
             {/* <View style={{display:this.state.current===3 ? 'block' : 'none'}}>

+ 8 - 0
src/pages/applyDepart/index.less

@@ -46,6 +46,14 @@
       padding-top: 15px;
     }
   }
+  .resultTips{
+    font-size: 24px;
+    text-align: center;
+    color: #f00;
+    background: #c9c9c9;
+    padding: 20px 100px;
+    margin-bottom: 40px;
+  }
   .resultOperation{
     display: flex;
     flex-flow: row nowrap;

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

@@ -17,6 +17,8 @@ import {
   getNumHourse,
   getUserWordTimes,
   getNameList,
+  getList,
+  isTips,
 } from "../../utils/tools";
 
 import "taro-ui/dist/style/components/form.scss";
@@ -140,6 +142,11 @@ class PublicContent extends Component {
       });
       return;
     }
+    if (this.state.totalDuration > 4 && this.state.imgs.length == 0) {
+      Taro.showToast({ title: "请上传附件", icon: "none" });
+      return
+    }
+
     this.setState({
       loading: true,
     });
@@ -186,8 +193,15 @@ class PublicContent extends Component {
         this.setState({
           loading: false,
         });
+        let newData = {
+          ...v.data,
+          ...{
+            isShow: this.props.enterpriseInfor.type == 0 ? isTips(this.props.enterpriseInfor.list) : false,
+            list: this.props.enterpriseInfor.type == 0 ? getList(this.props.enterpriseInfor.list, "aname", true) : []
+          }
+        }
         if (v.error.length === 0) {
-          Taro.eventCenter.trigger("publicContent", v.data);
+          Taro.eventCenter.trigger("publicContent", newData);
         } else {
           Taro.showToast({
             title: v.error[0].message,
@@ -322,6 +336,12 @@ class PublicContent extends Component {
             }
           </View>
         </View>
+        {
+          (this.props.enterpriseInfor.type == 0 && isTips(this.props.enterpriseInfor.list)) &&
+          <View className="othersTips">您正在申请公出他人企业:需跟单员“
+            {getList(this.props.enterpriseInfor.list, "aname", true).toString()}
+            ”审核同意,您才可公出!</View>
+        }
         <View className="formItem">
           <View className="formName">公出类型:</View>
           <View className="formValue">

+ 11 - 2
src/pages/applyDepart/publicContent.less

@@ -33,10 +33,10 @@
       align-items: center;
       justify-content: flex-end;
 
-      .button{
+      .button {
         font-size: 22px;
         padding: 0 10px;
-        
+
       }
 
       .time {
@@ -120,6 +120,15 @@
 
   }
 
+  .othersTips {
+    font-size: 28px;
+    text-align: center;
+    color: #f00;
+    background: #c9c9c9;
+    padding: 20px 100px;
+    
+  }
+
   .tips {
     font-size: 20px;
     text-align: left;

+ 18 - 5
src/pages/applyDepart/result.jsx

@@ -35,10 +35,14 @@ class Result extends Component {
           {/*      <Icon size='80' type='info' /> :*/}
           {/*      <Icon size='80' type='warn' />*/}
           {/*}*/}
-          <Icon size='80' type='success' />
+          {
+            this.props.isShow
+              ? <Icon size='80' type='warn' color='#ff9900'/>
+              : <Icon size='80' type='success' />
+          }
         </View>
         <View className='resultTitle'>
-          <View>申请成功,可以打卡了!</View>
+          <View>申请成功{!this.props.isShow && ",可以打卡了!"}</View>
           <View className='resultError'>
             {
               this.props.resultState === 0 ?
@@ -51,13 +55,22 @@ class Result extends Component {
             }
           </View>
         </View>
+        {
+          this.props.isShow &&
+          <View className="resultTips">公出他人企业,需跟单人员“
+            {this.props.tipList.toString()}
+            ”审核同意,才可以打卡!!!</View>
+        }
         <View className='resultOperation'>
           <AtButton circle onClick={this.determine}>
             再次发起
           </AtButton>
-          <AtButton circle type='primary' onClick={this.punchClock}>
-            前往打卡
-          </AtButton>
+          {
+            !this.props.isShow &&
+            <AtButton circle type='primary' onClick={this.punchClock}>
+              前往打卡
+            </AtButton>
+          }
           <AtButton type='secondary' circle onClick={() => {
             Taro.navigateTo({
               url: '/pages/egressDetails/index?id=' + this.props.resultId

+ 35 - 28
src/pages/egressDetails/enterprise.jsx

@@ -85,6 +85,7 @@ class Enterprise extends Component {
       listState: "LOADING",
     });
     getUserByName({
+      type: 1,
       name: value,
       pageNo: pageNo,
       pageSize: 10,
@@ -244,6 +245,13 @@ class Enterprise extends Component {
                   }}
                   key={k}
                   onClick={() => {
+                    if (v.status == 2 && this.props.type == 0) {
+                      Taro.showToast({
+                        title: "请在“单位公共客户”中领取后,再次发起公出!",
+                        icon: 'none'
+                      })
+                      return
+                    }
                     let list = this.props.newList
                     for (var i = 0; i < list.length; i++) {
                       if (list[i].id == v.id) {
@@ -299,38 +307,37 @@ class Enterprise extends Component {
                   }}
                   key={k}
                   onClick={() => {
-
                     let select = 0
-                      if (this.props.jsList.length == 0) {
-                        select = 0
-                      }
-                      for (var i = 0; i < this.props.jsList.length; i++) {
-                        if (!!this.props.jsList[i].contractNo) {
-                          select = 1
-                        }
+                    if (this.props.jsList.length == 0) {
+                      select = 0
+                    }
+                    for (var i = 0; i < this.props.jsList.length; i++) {
+                      if (!!this.props.jsList[i].contractNo) {
+                        select = 1
                       }
-                      if (select == 0) {
-                        this.setState({
-                          listVisible: true,
-                          listValue: v,
-                        });
-                        this.getByUid(v);
-                      } else {
-                        let list = this.props.jsList
-                        for (var i = 0; i < list.length; i++) {
-                          if (list[i].id == v.id) {
-                            Taro.showToast({
-                              title: "该企业已在公出列表中",
-                              icon: 'none'
-                            })
-                            return
-                          }
+                    }
+                    if (select == 0) {
+                      this.setState({
+                        listVisible: true,
+                        listValue: v,
+                      });
+                      this.getByUid(v);
+                    } else {
+                      let list = this.props.jsList
+                      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({
-                          jsList: list
-                        })
                       }
+                      list.push(v)
+                      this.setState({
+                        jsList: list
+                      })
+                    }
 
                     // this.setState({
                     //   // selectId:v.id

+ 77 - 65
src/pages/egressDetails/index.jsx

@@ -206,27 +206,37 @@ class EgressDetails extends Component {
       return;
     }
     Taro.showLoading({ title: "加载中..." });
-    examinePublicRelease({
-      status,
-      remarks: this.state.opinion,
-      id: this.state.dtails.id,
-    })
+    let isSuperior = this.state.current == "他人公出" ? false : true
+    examinePublicRelease(
+      isSuperior,
+      {
+        status,
+        remarks: this.state.opinion,
+        id: this.state.dtails.id,
+      }
+    )
       .then((v) => {
         Taro.hideLoading();
         if (v.error.length === 0) {
           Taro.showToast({
-            title: status === 0 ? "驳回成功" : "通过成功",
+            title: "操作成功",
             icon: "none",
           });
-          this.state.dtails.status = status;
-          this.setState({
-            dtails: this.state.dtails,
-          });
-          Taro.eventCenter.trigger("listOperation", {
-            type: this.state.dtails.permission,
-            index: this.$instance.router.params.index,
-            status: status === 0 ? 0 : 2,
-          });
+          this.getReleasetDails();
+
+          // Taro.showToast({
+          //   title: status === 0 ? "驳回成功" : "通过成功",
+          //   icon: "none",
+          // });
+          // this.state.dtails.status = status;
+          // this.setState({
+          //   dtails: this.state.dtails,
+          // });
+          // Taro.eventCenter.trigger("listOperation", {
+          //   type: this.state.dtails.permission,
+          //   index: this.$instance.router.params.index,
+          //   status: status === 0 ? 0 : 2,
+          // });
         } else {
           Taro.showToast({ title: v.error[0].message, icon: "none" });
         }
@@ -243,9 +253,9 @@ class EgressDetails extends Component {
         this.state.dtails.status === 3
           ? this.state.dtails.aname +
           "撤销了前往" +
-          this.state.dtails.districtName +
+          this.state.dtails.prdList[0]?.districtName +
           "的公出"
-          : this.state.dtails.aname + "将要去" + this.state.dtails.districtName,
+          : this.state.dtails.aname + "将要去" + this.state.dtails.prdList[0]?.districtName,
       path: "pages/egressDetails/index?id=" + this.$instance.router.params.id,
     };
   }
@@ -380,6 +390,12 @@ class EgressDetails extends Component {
               >
                 {getClockState(dtails.status).title}
               </View>
+              {
+                dtails.peList?.map(item =>
+                  <View style={{ fontSize: "15px", color: "#007AFF" }}>{item.aname + `(${["审核中", "已审核"][item.status]})`}</View>
+                )
+              }
+              <View></View>
               <Image
                 src={
                   dtails.status === 0
@@ -593,8 +609,8 @@ class EgressDetails extends Component {
                 </View>
               </View>
             ) : null}
-            {dtails.status === 1 &&
-              current === "审核" ? (
+            {((dtails.status === 1 && current === "审核") ||
+              (dtails.publicType == 1 && current === "他人公出" && dtails.myExamine == 0)) &&
               <View className="item">
                 <View className="title">
                   填写审批意见
@@ -612,52 +628,48 @@ class EgressDetails extends Component {
                   maxLength={20}
                   placeholder="请填写审批意见"
                 />
-              </View>
-            ) : null}
-            {dtails.status === 1 &&
-              current === "审核" ? (
-              <View className="operation">
-                <AtButton
-                  type="secondary"
-                  circle
-                  loading={this.state.loading}
-                  onClick={() => {
-                    this.setState({
-                      isInquiryOpened: true,
-                      inquiryTitle: "提醒",
-                      inquiryContent: "您确定要驳回此申请吗?",
-                      inquiryFn: () => {
-                        this.agree(0);
-                        // this.examinePublicRelease(0);
-                      },
-                    });
-                  }}
-                >
-                  驳回
-                </AtButton>
-                <AtButton
-                  type="primary"
-                  loading={this.state.loading}
-                  circle
-                  onClick={() => {
-                    if (this.state.loading) {
-                      return;
-                    }
-                    this.setState({
-                      isInquiryOpened: true,
-                      inquiryTitle: "提醒",
-                      inquiryContent: "您确定要同意此申请吗?",
-                      inquiryFn: () => {
-                        this.agree(2);
-                        // this.examinePublicRelease(2);
-                      },
-                    });
-                  }}
-                >
-                  同意
-                </AtButton>
-              </View>
-            ) : null}
+                <View className="operation">
+                  <AtButton
+                    type="secondary"
+                    circle
+                    loading={this.state.loading}
+                    onClick={() => {
+                      this.setState({
+                        isInquiryOpened: true,
+                        inquiryTitle: "提醒",
+                        inquiryContent: "您确定要驳回此申请吗?",
+                        inquiryFn: () => {
+                          this.agree(0);
+                          // this.examinePublicRelease(0);
+                        },
+                      });
+                    }}
+                  >
+                    驳回
+                  </AtButton>
+                  <AtButton
+                    type="primary"
+                    loading={this.state.loading}
+                    circle
+                    onClick={() => {
+                      if (this.state.loading) {
+                        return;
+                      }
+                      this.setState({
+                        isInquiryOpened: true,
+                        inquiryTitle: "提醒",
+                        inquiryContent: "您确定要同意此申请吗?",
+                        inquiryFn: () => {
+                          this.agree(2);
+                          // this.examinePublicRelease(2);
+                        },
+                      });
+                    }}
+                  >
+                    同意
+                  </AtButton>
+                </View>
+              </View>}
             {current !== "审核" && dtails.permission === 0
               && dtails.type !== 3 && dtails.type !== 4 ? (
               <View className="item" id={"reasons"}>

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

@@ -225,6 +225,7 @@
   .operation {
     display: flex;
     flex-flow: row nowrap;
+    margin-top: 30px;
   }
 
   .at-image-picker__flex-box {

+ 4 - 3
src/pages/egressDetails/modify.jsx

@@ -59,9 +59,9 @@ class Modify extends Component {
     // }
     let obj = {}
     if (this.state.type != 1) {
-      obj = { uids: this.getValue(this.state.newList, "id"), userNames: this.getValue(this.state.newList, "name"), type: this.state.type }
+      obj = { uids: this.getValue(this.state.newList, "id"), userNames: this.getValue(this.state.newList, "name"), type: this.state.type, newList: this.state.newList }
     } else {
-      obj = { uids: this.getValue(this.state.jsList, "id"), userNames: this.getValue(this.state.jsList, "name"), type: this.state.type }
+      obj = { uids: this.getValue(this.state.jsList, "id"), userNames: this.getValue(this.state.jsList, "name"), type: this.state.type, newList: this.state.newList }
     }
     this.setState({
       dtails: {
@@ -103,7 +103,6 @@ class Modify extends Component {
       modifyType: 2,
     });
 
-    //判断不明确暂时注释,明确后再行修改
     // if (visi == 0) {
     //   this.setState({
     //     dtails: {
@@ -126,6 +125,7 @@ class Modify extends Component {
   }
 
   render() {
+    let userInfor = Taro.getStorageSync('userInfor');
     return (
       <AtModal isOpened={this.props.isOpened} onClose={this.props.onModalClose}>
         {this.state.modifyType === 1 ? (
@@ -141,6 +141,7 @@ class Modify extends Component {
                 <AtButton
                   circle
                   size="small"
+                  disabled={item.type === 1 && userInfor.type !== 3}
                   type={this.state.type == item.type ? "primary" : "secondary"}
                   onClick={() => {
                     this.setState({

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

@@ -14,7 +14,7 @@ import {
   addPublicRelease,
 } from "../../utils/servers/servers";
 
-import { getHours, getNumHourse, getUserWordTimes, getNameList } from "../../utils/tools";
+import { getHours, getNumHourse, getUserWordTimes, getNameList, getList, isTips, } from "../../utils/tools";
 
 import "taro-ui/dist/style/components/form.scss";
 import "taro-ui/dist/style/components/button.scss";
@@ -172,6 +172,10 @@ class PublicContent extends Component {
   onSubmit() {
     const { isVerify = false } = this.props;
     let objectType = this.props.dtails.uids.indexOf(',') > -1 ? 1 : 0
+    if (!this.props.dtails.uids) {
+      Taro.showToast({ title: "请选择公出企业", icon: "none" });
+      return;
+    }
     if (!this.state.rangeStartMinuteVal) {
       Taro.showToast({ title: "请选择公出时间", icon: "none" });
       return;
@@ -516,6 +520,12 @@ class PublicContent extends Component {
             }
           </View>
         </View>
+        {
+          (dtails.type == 0 && !!dtails.newList && isTips(dtails.newList)) &&
+          <View className="othersTips">您正在申请公出他人企业:需跟单员“
+            {getList(dtails.newList, "aname", true).toString()}
+            ”审核同意,您才可公出!</View>
+        }
         <View className="formItem">
           <View className="formName">公出类型:</View>
           <View className="formValue">

+ 9 - 0
src/pages/egressDetails/publicContent.less

@@ -68,6 +68,15 @@
     }
   }
 
+  .othersTips{
+    font-size: 28px;
+    text-align: center;
+    color: #f00;
+    background: #c9c9c9;
+    padding: 20px 50px;
+
+  }
+
   .tips {
     font-size: 20px;
     text-align: left;

+ 6 - 2
src/pages/examine/index.jsx

@@ -35,7 +35,8 @@ class Examine extends Component {
       typeList: [
         { title: '审核', type: 1 },
         { title: '查看公出', type: 2 },
-        { title: '查看协单', type: 3 }],
+        { title: '查看协单', type: 3 },
+        { title: '他人公出', type: 4 }],
       current: 0,
       isPickerRender: false,
       validDates: '',
@@ -74,6 +75,8 @@ class Examine extends Component {
         })
       }
     })
+
+    this.getPublicReleaseList();
   }
 
   async componentDidMount() {
@@ -128,7 +131,8 @@ class Examine extends Component {
       pageSize: 10,
       type: current === 0
         ? "1" : current === 1
-          ? "2" : current === 2 && "3",
+          ? "2" : current === 2
+            ? "3" : current === 3 && "4",
       releaseStarts: this.state.rangeStartMinuteVal || undefined,
       releaseEnds: this.state.rangeEndMinuteVal || undefined,
       status: isNaN(parseInt(this.state.starts.id)) ? undefined : String(this.state.starts.id),

+ 5 - 0
src/pages/examine/index.less

@@ -306,6 +306,11 @@
           padding-bottom: 15px;
         }
 
+        .examine{
+          text-align: right;
+          font-size: 25px;
+        }
+
         .bottomContent {
           display: flex;
           flex-flow: row nowrap;

+ 1 - 0
src/pages/examine/myList.jsx

@@ -117,6 +117,7 @@ class MyList extends Component {
                     协单助手:{v.assistantName.replace(/,/g, " ")}
                   </View>
                 }
+                <View className="examine">{v.adminExamine}</View>
                 <View className="bottomContent">
                   <View className="clockIn"
                     style={{ color: ['red', "#6eb173", '#dbc037'][v.clockIn] }}

+ 2 - 0
src/pages/mybusiness/index.jsx

@@ -88,6 +88,8 @@ class Examine extends Component {
         selectArrderLocation: location,
       });
     }
+
+    this.getPublicReleaseList();
   }
 
   async componentDidMount() {

+ 1 - 1
src/pages/punchClock/index.config.js

@@ -1,3 +1,3 @@
 export default {
-  navigationBarTitleText: '打卡'
+  navigationBarTitleText: '打卡',
 }

+ 6 - 1
src/pages/punchClock/index.jsx

@@ -80,13 +80,18 @@ class PunchClock extends Component {
     Taro.eventCenter.trigger('GoPuncsshIn', { data: 'unread' })
   }
 
+
   render() {
     return (
       <>
         <MessageNoticebar />
         {
           // 刷新打卡页
-          !this.state.isOpened && <PunchClocks getId={this.getId.bind(this)} getHome={this.getHome.bind(this)} />
+          !this.state.isOpened &&
+          <PunchClocks
+            getId={this.getId.bind(this)}
+            getHome={this.getHome.bind(this)}
+          />
         }
         <AtModal
           isOpened={this.state.isOpened}

+ 6 - 0
src/pages/punchClock/index.less

@@ -264,6 +264,12 @@
         color: #f5f6f8;
         font-size: 25px;
       }
+
+      .refresh{
+        position: absolute;
+        right: 60px;
+      }
+
     }
 
     .switchposition {

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

@@ -628,8 +628,22 @@ class PunchClocks extends Component {
                     }
                   </View>
                   <View className='punchClockTime'>{this.state.nowTime}</View>
+                  <View
+                    onClick={e => {
+                      e.stopPropagation()
+                      this.refresh()
+                    }}
+                    className='refresh'
+                    style={{
+                      alignSelf: 'center',
+                      textAlign: 'center',
+                      color: '#b6b5b5',
+                      fontSize: '11px'
+                    }}>
+                    <AtIcon value='reload' size='20' />
+                    <View>刷新</View>
+                  </View>
                 </View>
-
                 {
                   !(this.state.distance <= this.wxConfig.clockInRange && this.state.distance >= 0) &&
                   <View className='switchposition'>您不在打卡范围:

+ 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
 }

+ 14 - 13
src/utils/servers/servers.js

@@ -4,29 +4,29 @@ import Taro from "@tarojs/taro";
 
 //登录
 export const login = (res) => {
-  return new Promise(async (resolve,reject)=>{
+  return new Promise(async (resolve, reject) => {
     Taro.showLoading({
-      title:'登录中...',
+      title: '登录中...',
     })
-    try{
+    try {
       let msg = await HTTPREQUEST.post('/managesignin', {
-        mobile:res.username,
-        password:res.password,
+        mobile: res.username,
+        password: res.password,
         remeber: false
       });
-      if(msg.error.length === 0){
+      if (msg.error.length === 0) {
         Taro.setStorageSync('token', msg.token);
         Taro.setStorageSync('userInfor', msg.data);
         Taro.hideLoading();
-        Taro.showToast({title:'登录成功',icon:'success'})
+        Taro.showToast({ title: '登录成功', icon: 'success' })
         resolve(msg);
-      }else{
+      } else {
         Taro.hideLoading();
-        Taro.showToast({title:msg.error[0].message,icon:'none'})
+        Taro.showToast({ title: msg.error[0].message, icon: 'none' })
         reject();
       }
-    }catch (err) {
-      Taro.showToast({title:'系统错误,请稍后重试',icon:'none'});
+    } catch (err) {
+      Taro.showToast({ title: '系统错误,请稍后重试', icon: 'none' });
       Taro.hideLoading();
       reject();
       // console.log(err,'login')
@@ -65,8 +65,9 @@ export const publicReleaseClockIn = (postData = {}) => {
   return HTTPREQUEST.post('/api/admin/release/publicReleaseClockIn', postData)
 }
 
-export const examinePublicRelease = (postData = {}) => {
-  return HTTPREQUEST.post('/api/admin/release/examinePublicRelease', postData)
+// 公出审批
+export const examinePublicRelease = (isSuperior = true, postData = {}) => {
+  return HTTPREQUEST.post(isSuperior ? '/api/admin/release/examinePublicRelease' : '/api/admin/release/MarketersExamine', postData)
 }
 
 //获取外出公出详情

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

@@ -171,6 +171,32 @@ export const getNewOptions = (arr) => {
   return list
 }
 
+// 提取数组里的某一项组成新数组(公出他人企业限制)
+export const getList = (arr, name, isUnique = false) => {
+  let list = []
+  for (var i = 0; i < arr.length; i++) {
+    if (arr[i].status == 1) {
+      list.push(arr[i][name])
+    }
+  }
+  // 去重
+  if (isUnique) {
+    unique(list)
+  }
+  return list
+}
+
+// 显示提示(公出他人企业)
+export const isTips = (arr) => {
+  let show = false
+  for (var i = 0; i < arr.length; i++) {
+    if (arr[i].status == 1) {
+      show = true
+    }
+  }
+  return show
+}
+
 // 数组去重
 export const unique = (arr, key) => {
   if (arr.length <= 1) {