dev01 před 3 měsíci
rodič
revize
b5eaa0ed5e

+ 2 - 1
src/app.config.js

@@ -8,8 +8,9 @@ export default {
     'pages/applyDepart/index',//申请公出
     'pages/mybusiness/index',//我的
     'pages/enterprise/index',//企业
-    'pages/customerProfile/index',//企业详情
+    'pages/customerProfile/index',//企业详情/客户档案
     'pages/situation/index',//公出情况
+    'pages/addEnterprise/index',//新增企业/渠道
   ],
   tabBar: {
     list: [

+ 121 - 0
src/components/common/addressPicker/index.jsx

@@ -0,0 +1,121 @@
+import React, { Component } from "react";
+import Taro from '@tarojs/taro'
+import { View, PickerView, PickerViewColumn } from '@tarojs/components'
+import PropTypes from 'prop-types'
+import address from '../../../utils/tools/city.js'
+
+import './index.less'
+
+class AddressPicker extends Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+      value: [17, 0, 1],
+      provinces: address.provinces || [],
+      citys: address.citys[430000] || {},
+      areas: address.areas[430100] || {},
+      areaInfo: {
+        province: "湖南省",
+        city: "长沙市",
+        county: "芙蓉区",
+      },
+
+    }
+    this.cityChange = this.cityChange.bind(this);
+  }
+
+  cityChange(e) {
+    const { provinces, citys, value } = this.state
+    const pickerValue = e.detail.value
+    const provinceNum = pickerValue[0]
+    const cityNum = pickerValue[1]
+    const countyNum = pickerValue[2]
+    // 如果省份选择项和之前不一样,表示滑动了省份,此时市默认是省的第一组数据,
+    if (value[0] != provinceNum) {
+      const id = provinces[provinceNum].id
+      this.setState({
+        value: [provinceNum, 0, 0],
+        citys: address.citys[id],
+        areas: address.areas[address.citys[id][0].id]
+      })
+    } else if (value[1] != cityNum) {
+      // 滑动选择了第二项数据,即市,此时区显示省市对应的第一组数据
+      const id = citys[cityNum].id
+      this.setState({
+        value: [provinceNum, cityNum, 0],
+        areas: address.areas[citys[cityNum].id]
+      })
+    } else {
+      // 滑动选择了区
+      this.setState({
+        value: [provinceNum, cityNum, countyNum]
+      })
+    }
+  }
+
+  //  params true代表传递地址,false不传递
+  handlePickerShow(params) {
+    if (params) {
+      const { provinces, citys, areas, value } = this.state
+      // 将选择的城市信息显示到输入框
+      const tempAreaInfo = {
+        province: provinces[value[0]].name,
+        city: citys[value[1]].name,
+        area: areas[value[2]].name
+      }
+      this.setState({
+        areaInfo: tempAreaInfo
+      }, () => {
+        this.props.onHandleToggleShow(tempAreaInfo, true)
+      })
+    } else {
+      this.props.onHandleToggleShow({}, false)
+    }
+  }
+
+  render() {
+    const { provinces, citys, areas, value } = this.state
+    const { pickerShow } = this.props
+    return (
+      <View className={pickerShow ? 'address-picker-container show' : 'address-picker-container'} onClick={this.handlePickerShow.bind(this, false)}>
+        <View className="picker-content" onClick={e => { e.stopPropagation() }}>
+          <View className="dialog-header">
+            <View className="dialog-button cancel" onClick={this.handlePickerShow.bind(this, false)}>取消</View>
+            <View className="dialog-title">请选择省市区</View>
+            <View className="dialog-button" onClick={this.handlePickerShow.bind(this, true)}>确定</View>
+          </View>
+          <PickerView onChange={this.cityChange} value={value} className='picker-view-wrap'>
+            <PickerViewColumn>
+              {
+                provinces.map((province, index) => {
+                  return <View className="picker-item" key={index}>{province.name}</View>
+                })
+              }
+            </PickerViewColumn>
+            <PickerViewColumn>
+              {
+                citys.map((city, index) => {
+                  return <View className="picker-item" key={index}>{city.name}</View>
+                })
+              }
+            </PickerViewColumn>
+            <PickerViewColumn>
+              {
+                areas.map((area, index) => {
+                  return <View className="picker-item" key={index}>{area.name}</View>
+                })
+              }
+            </PickerViewColumn>
+          </PickerView>
+        </View>
+      </View>
+    )
+  }
+}
+
+AddressPicker.propTypes = {
+  pickerShow: PropTypes.bool.isRequired,
+  onHandleToggleShow: PropTypes.func.isRequired,
+}
+
+export default AddressPicker;

+ 64 - 0
src/components/common/addressPicker/index.less

@@ -0,0 +1,64 @@
+.address-picker-container {
+  width: 100%;
+  height: 100vh;
+  display: flex;
+  z-index: 12;
+  background: rgba(0, 0, 0, 0.7);
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+  position: fixed;
+  bottom: 0px;
+  left: 0px;
+  visibility: hidden;
+  &.show {
+      visibility: visible;
+      .picker-content {
+          transform: translateY(0);
+          transition: all 0.4s ease;
+      }
+  }
+}
+
+.picker-content {
+  position: absolute;
+  width: 100%;
+  bottom: 0;
+  background-color: #fff;
+  transform: translateY(150%);
+  transition: all 0.4s ease;
+
+  .picker-view-wrap {
+      width: 100%;
+      height: 400px;
+  }
+}
+
+.picker-item {
+  line-height: 70px;
+  font-size: 36px;
+  text-align: center;
+}
+
+.dialog-header {
+  width: 100%;
+  background: #ededed;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+
+  .dialog-title {
+      color: #333;
+  }
+
+  .dialog-button {
+      display: inline-block;
+      text-align: center;
+      font-size: 32px;
+      color: #E28E81;
+      padding: 30px;
+      &.cancel {
+          color: #666;
+      }
+  }
+}

+ 43 - 43
src/components/common/imagePicker/index.jsx

@@ -1,7 +1,7 @@
-import React,{Component} from "react";
+import React, { Component } from "react";
 import Taro from '@tarojs/taro';
-import {Text, View} from "@tarojs/components";
-import {AtImagePicker,AtToast } from "taro-ui";
+import { Text, View } from "@tarojs/components";
+import { AtImagePicker, AtToast } from "taro-ui";
 
 import './index.less';
 
@@ -12,58 +12,58 @@ import 'taro-ui/dist/style/components/icon.scss';
 
 import getBaseUrl from "../../../utils/servers/baseUrl";
 
-class ImagePicker extends Component{
+class ImagePicker extends Component {
   constructor(props) {
     super(props);
-    this.state={
+    this.state = {
       files: props.files || [],
-      speedProgress:0,
-      loading:false
+      speedProgress: 0,
+      loading: false
     }
     this.onImgChange = this.onImgChange.bind(this);
     this.onFail = this.onFail.bind(this);
     this.onImageClick = this.onImageClick.bind(this);
   }
 
-  onImgChange(files, operationType, index, type){
+  onImgChange(files, operationType, index, type) {
     const BASE_URL = getBaseUrl(this.props.url);
     let token = Taro.getStorageSync('token');
     let _this = this;
-    if(operationType === 'remove'){
+    if (operationType === 'remove') {
       let filesArr = files.concat([]);
-      this.props.onChange(index,'remove');
+      this.props.onChange(index, 'remove');
       this.setState({
-        files:filesArr
+        files: filesArr
       })
-    }else{
+    } else {
       let fileArr = this.state.files.concat([]);
-      let arr = type === 'camera' ? files : files.splice(fileArr.length,files.length - fileArr.length)
+      let arr = type === 'camera' ? files : files.splice(fileArr.length, files.length - fileArr.length)
       this.setState({
-        loading:true
+        loading: true
       })
-      for(let i = 0;i<arr.length;i++){
+      for (let i = 0; i < arr.length; i++) {
         const uploadTask = Taro.uploadFile({
           url: BASE_URL + this.props.url, //仅为示例,非真实的接口地址
           filePath: arr[i].url,
           name: 'file',
           header: {
-            'Accept':'application/json, text/javascript,',
+            'Accept': 'application/json, text/javascript,',
             'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
             'token': token
           },
-          success: function (res){
+          success: function (res) {
             let dataJson = JSON.parse(res.data)
-            if(dataJson.error.length === 0){
-              _this.props.onChange(dataJson.data,'add');
+            if (dataJson.error.length === 0) {
+              _this.props.onChange(dataJson.data, 'add');
               _this.state.files.push(arr[i]);
               _this.setState({
-                files:_this.state.files
+                files: _this.state.files
               })
-            }else{
-              Taro.showToast({title:dataJson.error[0].message,icon:'none'})
-              if(dataJson.error[0].field === '403'){
+            } else {
+              Taro.showToast({ title: dataJson.error[0].message, icon: 'none' })
+              if (dataJson.error[0].field === '403') {
                 _this.setState({
-                  loading:false
+                  loading: false
                 })
                 Taro.reLaunch({
                   url: '/pages/login/index'
@@ -71,30 +71,30 @@ class ImagePicker extends Component{
               }
             }
           },
-          fail: function (err){
+          fail: function (err) {
             //console.log(err);
-            Taro.showToast({title:'系统错误,请稍后重试',icon:'none'});
+            Taro.showToast({ title: '系统错误,请稍后重试', icon: 'none' });
           },
-          complete: function(v){
+          complete: function (v) {
             //console.log(v)
           }
         })
         uploadTask.progress((res) => {
-          if(res.progress === 100){
-            let num = this.state.speedProgress+1;
-            let speed = num/arr.length*100;
+          if (res.progress === 100) {
+            let num = this.state.speedProgress + 1;
+            let speed = num / arr.length * 100;
             //console.log(num,arr.length)
             //console.log(num/arr.length)
             this.setState({
-              speedProgress:num,
-            },()=>{
-              if(speed === 100){
-                setTimeout(()=>{
+              speedProgress: num,
+            }, () => {
+              if (speed === 100) {
+                setTimeout(() => {
                   _this.setState({
-                    speedProgress:0,
-                    loading:false
+                    speedProgress: 0,
+                    loading: false
                   })
-                },1200)
+                }, 1200)
               }
             })
           }
@@ -105,12 +105,12 @@ class ImagePicker extends Component{
       }
     }
   }
-  onFail(){
+  onFail() {
 
   }
-  onImageClick(index){
+  onImageClick(index) {
     let arr = [];
-    for(let i of this.state.files){
+    for (let i of this.state.files) {
       arr.push(i.url)
     }
     Taro.previewImage({
@@ -118,9 +118,9 @@ class ImagePicker extends Component{
       urls: arr // 需要预览的图片http链接列表
     })
   }
-  clear(){
+  clear() {
     this.setState({
-      files:[]
+      files: []
     })
   }
 
@@ -136,7 +136,7 @@ class ImagePicker extends Component{
           onFail={this.onFail}
           onImageClick={this.onImageClick}
         />
-        <AtToast isOpened={this.state.loading} text="图片上传中" status='loading'/>
+        <AtToast isOpened={this.state.loading} text="图片上传中" status='loading' />
       </>
     )
   }

+ 5 - 0
src/pages/addEnterprise/index.config.js

@@ -0,0 +1,5 @@
+export default {
+  navigationBarTitleText: '新增企业/渠道',
+  enablePullDownRefresh: true,
+  onReachBottomDistance: 50,
+}

+ 686 - 0
src/pages/addEnterprise/index.jsx

@@ -0,0 +1,686 @@
+import React, { Component } from "react";
+import { View, Button, Text, Picker } from "@tarojs/components";
+import Taro, { getCurrentInstance } from "@tarojs/taro";
+import {
+  AtButton,
+  AtSearchBar,
+  AtCheckbox,
+  AtModal,
+  AtModalHeader,
+  AtModalContent,
+  AtModalAction,
+  AtInput,
+  AtTextarea,
+} from "taro-ui";
+import {
+  checkUserName,
+  getBusinessProjectByName,
+  addCustomer,
+  addChannel,
+} from "../../utils/servers/servers";
+import { getProvince } from '../../utils/tools/index'
+import "./index.less";
+
+import "taro-ui/dist/style/components/icon.scss";
+import "taro-ui/dist/style/components/textarea.scss";
+import "taro-ui/dist/style/components/modal.scss";
+import "taro-ui/dist/style/components/timeline.scss";
+import "taro-ui/dist/style/components/calendar.scss";
+import "taro-ui/dist/style/components/input.scss";
+import "taro-ui/dist/style/components/button.scss";
+import "taro-ui/dist/style/components/search-bar.scss";
+import "taro-ui/dist/style/components/checkbox.scss";
+
+import MessageNoticebar from "../../components/common/messageNoticebar";
+import AddressPicker from "../../components/common/addressPicker"
+
+class AddEnterprise extends Component {
+  $instance = getCurrentInstance();
+
+  constructor(props) {
+    super(props);
+    this.state = {
+      isOpened: false,
+      info: {
+        name: "",
+      },
+      pickerShow: false,
+      isProject: false,
+      options: [],
+      checkOptions: [],
+      channelTypeList: [
+        { id: 2, title: "民主党派" },
+        { id: 3, title: "园区" },
+        { id: 4, title: "民间组织" },
+        { id: 5, title: "战略合作单位" },
+        { id: 1, title: "其他" },
+      ],
+      channe: "",
+      selChannelType: 0,
+    };
+    this.checkUserName = this.checkUserName.bind(this);
+    this.onSearchChange = this.onSearchChange.bind(this);
+    this.submit = this.submit.bind(this);
+    this.channeSubmit = this.channeSubmit.bind(this);
+  }
+
+  componentDidMount() {
+
+  }
+
+  componentDidShow() {
+
+  }
+  // 公司名称验证
+  checkUserName() {
+    const { info } = this.state
+    let yzName = info.name
+    if (!yzName) {
+      Taro.showToast({ title: "请输入公司名称", icon: "none" });
+      return
+    }
+    let re = new RegExp("^[\u4e00-\u9fa5]");
+    if (!re.test(yzName)) {
+      Taro.showToast({ title: "公司名称必须以汉字开头!", icon: "none" });
+      return
+    }
+    if (!re.test(yzName.charAt(yzName.length - 1))) {
+      Taro.showToast({ title: "公司名称必须以汉字结尾!", icon: "none" });
+      return
+    }
+    if (yzName.length > 64) {
+      Taro.showToast({ title: "公司名称字数不超过64个!", icon: "none" });
+      return
+    };
+    let regu = /[`~!#$%^&*'_[\]+=<>?:"{}|~!#¥%……&*=-@-!{}|/《》?:“”【】、;;‘’,,.。、\s+]/g;
+    if (regu.test(yzName)) {
+      Taro.showToast({ title: "公司名称不能存在特殊符号或空格!", icon: "none" });
+      return
+    }
+    checkUserName({
+      userName: yzName
+    })
+      .then((v) => {
+        if (v.error.length === 0) {
+          if (v.data) {
+            this.setState({
+              isOpened: true
+            })
+          } else {
+            Taro.showToast({ title: "", icon: "success" });
+            this.setState({
+              isOpened: false
+            })
+          }
+        }
+      })
+      .catch((err) => {
+        Taro.showToast({ title: "系统错误,请稍后再试", icon: "none" });
+      })
+  }
+
+  // 项目列表
+  getBusinessProjectByName(val) {
+    getBusinessProjectByName({
+      businessName: val,
+    })
+      .then((v) => {
+        if (v.error.length === 0) {
+          let theArr = [];
+          if (v.data.length > 0) {
+            for (let i = 0; i < v.data.length; i++) {
+              let thisdata = v.data[i];
+              theArr.push({
+                value: thisdata.bname,
+                label: thisdata.bname,
+              });
+            };
+          }
+          this.setState({
+            options: theArr
+          })
+        } else {
+          Taro.showToast({ title: v.error[0].message, icon: "none" });
+        }
+      })
+      .catch((err) => {
+        Taro.showToast({ title: "系统错误,请稍后再试", icon: "none" });
+      });
+  }
+
+  onSearchChange(value, lv = true) {
+    this.setState({
+      value,
+    });
+    if (value.length < 2 && !lv) {
+      Taro.showToast({ title: "最少输入两个字符", icon: "none" });
+      return;
+    }
+    if (value.length < 4 && lv) {
+      return;
+    }
+    this.getBusinessProjectByName(value);
+  }
+
+  // 新增企业
+  submit() {
+    const { info } = this.state
+    let re = new RegExp("^[\u4e00-\u9fa5]");
+    if (!re.test(info.name)) {
+      Taro.showToast({ title: "公司名称必须以汉字开头!", icon: "none" });
+      return
+    }
+    if (!re.test(info.name.charAt(info.name.length - 1))) {
+      Taro.showToast({ title: "公司名称必须以汉字结尾!", icon: "none" });
+      return
+    }
+    if (info.name.length > 64) {
+      Taro.showToast({ title: "公司名称字数不超过64个!", icon: "none" });
+      return
+    };
+    let regu = /[`~!#$%^&*'_[\]+=<>?:"{}|~!#¥%……&*=-@-!{}|/《》?:“”【】、;;‘’,,.。、\s+]/g;
+    if (regu.test(info.name)) {
+      Taro.showToast({ title: "公司名称不能存在特殊符号或空格!", icon: "none" });
+      return
+    }
+    if (!/^[A-Z0-9]{15}$|^[A-Z0-9]{17}$|^[A-Z0-9]{18}$|^[A-Z0-9]{20}$/.test(info.orgCode)) {
+      Taro.showToast({ title: "请输入正确的统一社会信用代码!", icon: "none" });
+      return
+    }
+    if (!info.province) {
+      Taro.showToast({ title: "请选择地区", icon: "none" });
+      return
+    };
+    if (/.*[\u4e00-\u9fa5]+.*$/.test(info.contacts)) {
+    } else {
+      Taro.showToast({ title: "请填写正确的联系人,且至少包含一个汉字", icon: "none" });
+      return
+    };
+    if (info.contacts.length > 32) {
+      Taro.showToast({ title: "联系人字数不超过32个", icon: "none" });
+      return
+    };
+    if (/.*[\u4e00-\u9fa5]+.*$/.test(info.position)) {
+    } else {
+      Taro.showToast({ title: "请填写正确的职位,且至少包含一个汉字", icon: "none" });
+      return
+    };
+    let regeX1 = /^1[3456789]\d{9}$/;
+    let regex2 = /^((0\d{2,3})-)?(\d{7,8})$/;
+    if (regeX1.test(info.contactMobile) == false && regex2.test(info.contactMobile) == false) {
+      Taro.showToast({ title: "请填写正确的联系电话", icon: "none" });
+      return
+    }
+    if (!info.businessScope) {
+      Taro.showToast({ title: "请选择主营产品", icon: "none" });
+      return
+    }
+    if (!info.intendedProject) {
+      Taro.showToast({ title: "请选择意向合作项目", icon: "none" });
+      return
+    }
+    info.societyTag = '0'
+    info.type = '1'
+    let addList = getProvince(info.province, info.city, info.area)
+    Taro.showLoading({
+      title: '保存中...',
+    })
+    addCustomer({
+      ...info,
+      ...{
+        province: addList[0],
+        city: addList[1],
+        area: addList[2],
+      }
+    })
+      .then((v) => {
+        Taro.hideLoading()
+        if (v.error.length === 0) {
+          Taro.showToast({ title: "保存成功", icon: "success" });
+          setTimeout(() => {
+            Taro.switchTab({
+              url: '/pages/enterprise/index'
+            })
+          }, 800);
+        } else {
+          Taro.showToast({ title: v.error[0].message, icon: "none" });
+        }
+      })
+      .catch((err) => {
+        Taro.hideLoading()
+        Taro.showToast({ title: "系统错误,请稍后再试", icon: "none" });
+        // console.log(err);
+      });
+  }
+
+  // 新增渠道
+  channeSubmit() {
+    const { info } = this.state
+    if (!info.name) {
+      Taro.showToast({ title: "请填写渠道名称", icon: "none" });
+      return
+    }
+    if (info.name.length > 64) {
+      Taro.showToast({ title: "渠道名称字数不超过64个", icon: "none" });
+      return
+    }
+    let regu = /[`~!#$%^&*'_[\]+=<>?:"{}|~!#¥%……&*=-@-!{}|/《》?:“”【】、;;‘’,,.。、\s+]/g;
+    if (regu.test(info.name)) {
+      Taro.showToast({ title: "渠道名称不能存在特殊符号!", icon: "none" });
+      return
+    }
+    if (!info.channelType) {
+      Taro.showToast({ title: "请选择渠道类别", icon: "none" });
+      return
+    }
+    if (info.channelType != 1) {
+
+      if (!info.province) {
+        Taro.showToast({ title: "请选择地区", icon: "none" });
+        return
+      };
+      if (/.*[\u4e00-\u9fa5]+.*$/.test(info.contacts)) {
+      } else {
+        Taro.showToast({ title: "请填写正确的联系人,且至少包含一个汉字", icon: "none" });
+        return
+      }
+      if (info.contacts.length > 32) {
+        Taro.showToast({ title: "联系人字数不超过32个", icon: "none" });
+        return
+      }
+      if (/.*[\u4e00-\u9fa5]+.*$/.test(info.position)) {
+      } else {
+        Taro.showToast({ title: "请填写正确的职位,且至少包含一个汉字", icon: "none" });
+        return
+      }
+      let regeX1 = /^1[3456789]\d{9}$/;
+      let regex2 = /^((0\d{2,3})-)?(\d{7,8})$/;
+      if (regeX1.test(info.contactMobile) == false && regex2.test(info.contactMobile) == false) {
+        Taro.showToast({ title: "请填写正确的联系电话", icon: "none" });
+        return
+      }
+      if (info.introduction.length === 0) {
+        Taro.showToast({ title: "请填写渠道简介", icon: "none" });
+        return
+      }
+    }
+    let addList = getProvince(info.province, info.city, info.area)
+    Taro.showLoading({
+      title: '保存中...',
+    })
+    addChannel({
+      ...info,
+      ...{
+        province: addList[0],
+        city: addList[1],
+        area: addList[2],
+      }
+    })
+      .then((v) => {
+        if (v.error.length === 0) {
+          Taro.hideLoading()
+          Taro.showToast({ title: "保存成功", icon: "success" });
+          setTimeout(() => {
+            Taro.switchTab({
+              url: '/pages/enterprise/index'
+            })
+          }, 800);
+        } else {
+          Taro.showToast({ title: v.error[0].message, icon: "none" });
+        }
+      })
+      .catch((err) => {
+        Taro.hideLoading()
+        Taro.showToast({ title: "系统错误,请稍后再试", icon: "none" });
+      });
+  }
+
+  toggleAddressPicker(e, params) {
+    const { info } = this.state
+    if (params) {
+      this.setState({
+        pickerShow: false,
+        info: Object.assign(info, {
+          province: e.province,
+          city: e.city,
+          area: e.area,
+        })
+      })
+    } else {
+      this.setState({
+        pickerShow: false
+      })
+    }
+  }
+
+  render() {
+    const { info, isOpened, pickerShow, isProject, checkOptions, channelTypeList, channe } = this.state;
+    return (
+      <View className="addEnterprise">
+        <MessageNoticebar />
+        {
+          this.$instance.router.params.type == "1" &&
+          <View className="form">
+            <AtInput
+              succes
+              required
+              name='name'
+              title='公司名称'
+              type='text'
+              placeholder='请填写公司名称'
+              value={info.name}
+              onChange={e => {
+                this.setState({
+                  info: Object.assign(info, {
+                    name: e
+                  })
+                })
+              }}
+            >
+              <View onClick={this.checkUserName}>验证</View>
+            </AtInput>
+            <AtInput
+              required
+              name='orgCode'
+              title='统一社会信用代码'
+              type='text'
+              placeholder='请填写统一社会信用代码'
+              value={info.orgCode}
+              onChange={e => {
+                this.setState({
+                  info: Object.assign(info, {
+                    orgCode: e
+                  })
+                })
+              }}
+            />
+            <View className="aitem">
+              <View className="atit">
+                <Text className="atip">*</Text>
+                省-市-区
+              </View>
+              <View className={!!info.province ? "avals" : "aval"} onClick={() => { this.setState({ pickerShow: true }) }}>
+                {!!info.province ? (info.province || "") + (!info.city ? "" : "-") + (info.city || "") + (!info.area ? "" : "-") + (info.area || "") : "点击选择"}
+              </View>
+              <AddressPicker
+                pickerShow={pickerShow}
+                onHandleToggleShow={this.toggleAddressPicker.bind(this)}
+              />
+            </View>
+            <AtInput
+              required
+              name='contacts'
+              title='联系人'
+              type='text'
+              placeholder='请填写联系人名称'
+              value={info.contacts}
+              onChange={e => {
+                this.setState({
+                  info: Object.assign(info, {
+                    contacts: e
+                  })
+                })
+              }}
+            />
+            <AtInput
+              required
+              name='position'
+              title='职位'
+              type='text'
+              placeholder='请填写联系人职位'
+              value={info.position}
+              onChange={e => {
+                this.setState({
+                  info: Object.assign(info, {
+                    position: e
+                  })
+                })
+              }}
+            />
+            <AtInput
+              required
+              name='contactMobile'
+              title='联系电话'
+              type='number'
+              placeholder='请填写联系人电话'
+              value={info.contactMobile}
+              onChange={e => {
+                this.setState({
+                  info: Object.assign(info, {
+                    contactMobile: e
+                  })
+                })
+              }}
+            />
+            <AtInput
+              required
+              name='businessScope'
+              title='主营产品/服务'
+              type='text'
+              placeholder='请用,符号隔开关键词'
+              value={info.businessScope}
+              onChange={e => {
+                this.setState({
+                  info: Object.assign(info, {
+                    businessScope: e
+                  })
+                })
+              }}
+            />
+            <View className="aitem">
+              <View className="atit">
+                <Text className="atip">*</Text>
+                意向合作项目
+              </View>
+              <View className={!!info.intendedProject ? "avals" : "aval"}
+                onClick={() => {
+                  this.getBusinessProjectByName("")
+                  this.setState({
+                    isProject: true
+                  })
+                }}>{!!info.intendedProject ? info.intendedProject : "点击选择"}</View>
+            </View>
+
+            <View className="bottom">
+              <AtButton type='primary' onClick={this.submit}>保存</AtButton>
+              {/* <AtButton type='secondary' size='small'>取消</AtButton> */}
+            </View>
+          </View>
+        }
+        {
+          this.$instance.router.params.type == "2" &&
+          <View className="form">
+            <AtInput
+              succes
+              required
+              name='name'
+              title='渠道名称'
+              type='text'
+              placeholder='请填写渠道名称'
+              value={info.name}
+              onChange={e => {
+                this.setState({
+                  info: Object.assign(info, {
+                    name: e
+                  })
+                })
+              }}
+            >
+              <View onClick={this.checkUserName}>验证</View>
+            </AtInput>
+
+
+            <View className="aitem">
+              <View className="atit">
+                <Text className="atip">*</Text>
+                渠道类别
+              </View>
+              <Picker
+                value={this.state.selChannelType}
+                range={channelTypeList} rangeKey='title' mode='selector'
+                onChange={(e) => {
+                  this.setState({
+                    channe: channelTypeList[e.detail.value].title,
+                    selChannelType: e.detail.value,
+                    info: Object.assign(info, {
+                      channelType: channelTypeList[e.detail.value].id,
+                    })
+                  })
+                }}>
+                <View className={!!channe ? "avals" : "aval"} style={{ width: "233px" }}>
+                  {!!channe ? channe : "请选择"}
+                </View>
+              </Picker>
+            </View>
+            {
+              !!info.channelType && info.channelType != 1 &&
+              <View>
+                <View className="aitem">
+                  <View className="atit">
+                    <Text className="atip">*</Text>
+                    省-市-区
+                  </View>
+                  <View className={!!info.province ? "avals" : "aval"} onClick={() => { this.setState({ pickerShow: true }) }}>
+                    {!!info.province ? (info.province || "") + (!info.city ? "" : "-") + (info.city || "") + (!info.area ? "" : "-") + (info.area || "") : "点击选择"}
+                  </View>
+                  <AddressPicker
+                    pickerShow={pickerShow}
+                    onHandleToggleShow={this.toggleAddressPicker.bind(this)}
+                  />
+                </View>
+                <AtInput
+                  required
+                  name='contacts'
+                  title='联系人'
+                  type='text'
+                  placeholder='请填写联系人名称'
+                  value={info.contacts}
+                  onChange={e => {
+                    this.setState({
+                      info: Object.assign(info, {
+                        contacts: e
+                      })
+                    })
+                  }}
+                />
+                <AtInput
+                  required
+                  name='position'
+                  title='职位'
+                  type='text'
+                  placeholder='请填写联系人职位'
+                  value={info.position}
+                  onChange={e => {
+                    this.setState({
+                      info: Object.assign(info, {
+                        position: e
+                      })
+                    })
+                  }}
+                />
+                <AtInput
+                  required
+                  name='contactMobile'
+                  title='联系电话'
+                  type='number'
+                  placeholder='请填写联系人电话'
+                  value={info.contactMobile}
+                  onChange={e => {
+                    this.setState({
+                      info: Object.assign(info, {
+                        contactMobile: e
+                      })
+                    })
+                  }}
+                />
+                <View className="aitem" style={{ alignItems: "flex-start" }}>
+                  <View className="atit">
+                    <Text className="atip">*</Text>
+                    渠道简介
+                  </View>
+                  <View className="avals">
+                    <AtTextarea
+                      value={info.introduction}
+                      onChange={e => {
+                        this.setState({
+                          info: Object.assign(info, {
+                            introduction: e
+                          })
+                        })
+                      }}
+                      maxLength={200}
+                      placeholder='请填写渠道简介'
+                    />
+                  </View>
+                </View>
+              </View>
+            }
+            <View className="bottom">
+              <AtButton type='primary' onClick={this.channeSubmit}>保存</AtButton>
+              {/* <AtButton type='secondary' size='small'>取消</AtButton> */}
+            </View>
+          </View>
+        }
+        <AtModal
+          isOpened={isOpened}
+          title='提醒'
+          confirmText='确认'
+          onClose={() => { this.setState({ isOpened: false, }) }}
+          onConfirm={() => { this.setState({ isOpened: false }) }}
+          content='企业客户已存在!请在“客户管理-企业客户-企业客户查询”输入企业全称查询所属人信息'
+        />
+        <AtModal
+          isOpened={isProject}
+          closeOnClickOverlay={false}
+        >
+          <AtModalHeader>请选择项目</AtModalHeader>
+          <AtModalContent>
+            {/* <AtSearchBar
+              placeholder="请输入项目名称"
+              showActionButton
+              value={this.state.value}
+              onChange={this.onSearchChange}
+              onActionClick={() => {
+                this.onSearchChange(this.state.value, false);
+              }}
+              onConfirm={() => {
+                this.onSearchChange(this.state.value, false);
+              }}
+              onClear={() => {
+                this.setState({
+                  value: "",
+                  options: [],
+                  checkOptions: [],
+                });
+              }}
+            /> */}
+            <AtCheckbox
+              options={this.state.options}
+              selectedList={checkOptions}
+              onChange={e => {
+                this.setState({
+                  checkOptions: e,
+                })
+              }}
+            />
+          </AtModalContent>
+          <AtModalAction>
+            {/* <Button type='secondary' onClick={() => { this.setState({ isProject: false, }) }}>取消</Button> */}
+            <Button type='primary'
+              onClick={() => {
+                this.setState({
+                  isProject: false,
+                  info: Object.assign(info, {
+                    intendedProject: checkOptions.toString(),
+                  }),
+                })
+              }}>确定</Button>
+          </AtModalAction>
+        </AtModal>
+
+      </View >
+    );
+  }
+}
+
+export default AddEnterprise;

+ 70 - 0
src/pages/addEnterprise/index.less

@@ -0,0 +1,70 @@
+.addEnterprise {
+  .form {
+    padding-right: 32px;
+    padding-bottom: 50px;
+
+    .aitem {
+      position: relative;
+      display: flex;
+      flex-direction: row;
+      align-items: center;
+      padding: 24px 32px 24px 0;
+      margin-left: 32px;
+      border-bottom: 1px;
+
+      .atit {
+        width: 172px;
+        margin-right: 16px;
+
+        .atip {
+          display: inline-block;
+          margin-right: 8rpx;
+          color: #FF4949;
+          font-size: 28rpx;
+          font-family: SimSun, sans-serif;
+          line-height: 1;
+          content: "*";
+        }
+      }
+
+      .aval {
+        color: #CCC;
+        display: flex;
+        flex: 1;
+      }
+
+      .avals {
+        color: #000;
+        display: flex;
+        flex: 1;
+      }
+
+    }
+
+    .aitem::after {
+      content: '';
+      position: absolute;
+      -webkit-transform-origin: center;
+      -ms-transform-origin: center;
+      transform-origin: center;
+      -webkit-box-sizing: border-box;
+      box-sizing: border-box;
+      pointer-events: none;
+      top: -50%;
+      left: -50%;
+      right: -50%;
+      bottom: -50%;
+      border: 0 solid #d6e4ef;
+      -webkit-transform: scale(0.5);
+      -ms-transform: scale(0.5);
+      transform: scale(0.5);
+      border-bottom-width: 1PX;
+    }
+
+    .bottom{
+      margin-left: 32px;
+      margin-top: 80px;
+    }
+
+  }
+}

+ 63 - 21
src/pages/applyDepart/enterprise.jsx

@@ -4,6 +4,7 @@ import {
   getUserByName,
   getOrderByUid,
   getRestrictProjectUser,
+  checkUserArchives,
 } from "../../utils/servers/servers";
 import { AtSearchBar, AtListItem, AtButton, AtIcon } from "taro-ui";
 import "taro-ui/dist/style/components/search-bar.scss";
@@ -177,6 +178,65 @@ class Enterprise extends Component {
       });
   }
 
+  checkUserArchives(v) {
+
+    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) {
+        Taro.showToast({
+          title: "该企业已在公出列表中",
+          icon: 'none'
+        })
+        return
+      }
+    }
+
+    if (this.props.type == 1 || this.props.type == 2) {
+      list.push(v)
+      this.setState({
+        newList: list
+      })
+      return
+    }
+
+    checkUserArchives({
+      uid: v.id
+    })
+      .then((msg) => {
+        if (msg.error.length === 0) {
+          if (msg.data) {
+            list.push(v)
+            this.setState({
+              newList: list
+            })
+          } else {
+            Taro.showToast({
+              title: "请先完善客户档案,才可发起公出",
+              icon: 'none'
+            })
+          }
+        } else {
+          Taro.showToast({
+            title: msg.error[0].message,
+            icon: "none",
+          });
+        }
+      })
+      .catch(() => {
+        this.setState({
+          listState: "RELOAD",
+        });
+      });
+  }
+
   render() {
     return (
       <>
@@ -309,27 +369,9 @@ 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) {
-                        Taro.showToast({
-                          title: "该企业已在公出列表中",
-                          icon: 'none'
-                        })
-                        return
-                      }
-                    }
-                    list.push(v)
-                    this.setState({
-                      newList: list
-                    })
+
+                    this.checkUserArchives(v)
+
                     // Taro.eventCenter.trigger("enterprise", v);
                   }}
                 />

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

@@ -29,15 +29,18 @@ class Result extends Component {
       <View className='result'>
         <View className='resultIcon'>
           {
-            this.props.isShow
-              ? <Icon size='80' type='warn' color='#ff9900' />
-              : <Icon size='80' type='success' />
+            <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>申请成功{!this.props.isShow && ",可以打卡了!"}</View>
+          <View>申请成功
+            {/* {!this.props.isShow && ",可以打卡了!"} */}
+          </View>
           {
-            !this.props.isShow &&
+            // !this.props.isShow &&
             <View className='resultError'>
               {
                 this.props.resultState === 0 ?
@@ -51,28 +54,26 @@ class Result extends Component {
             </View>
           }
         </View>
-        {
+        {/* {
           this.props.isShow && this.props.type != 1 &&
           <View className="resultTips">公出他人企业,需跟单人员“
             {this.props.tipList.toString()}
             ”审核同意,才可以打卡!!!</View>
-        }
-        {/* {
-          this.props.isShow && this.props.type == 1 &&
-          <View className="resultTips">已发出公出申请!待“
-            {this.props.tipList.toString()}
-            ”审核通过,方可打卡!</View>
         } */}
+        {
+          // this.props.isShow && this.props.type == 1 &&
+          <View className="resultTips">已发出公出申请!待审核通过,方可打卡!</View>
+        }
         <View className='resultOperation'>
           <AtButton circle onClick={this.determine}>
             再次发起
           </AtButton>
-          {
+          {/* {
             (!this.props.isShow || this.props.type == 1) &&
             <AtButton circle type='primary' onClick={this.punchClock}>
               前往打卡
             </AtButton>
-          }
+          } */}
           <AtButton type='secondary' circle onClick={() => {
             Taro.navigateTo({
               url: '/pages/egressDetails/index?id=' + this.props.resultId

+ 473 - 211
src/pages/customerProfile/index.jsx

@@ -26,11 +26,12 @@ import "taro-ui/dist/style/components/icon.scss";
 import "taro-ui/dist/style/components/textarea.scss";
 import "taro-ui/dist/style/components/modal.scss";
 import "taro-ui/dist/style/components/timeline.scss";
-import "taro-ui/dist/style/components/calendar.scss";
+import "taro-ui/dist/style/components/calendar.scss"; 2
 import "taro-ui/dist/style/components/input.scss";
 import "taro-ui/dist/style/components/checkbox.scss";
 import MessageNoticebar from "../../components/common/messageNoticebar";
-import { industry } from '../../utils/tools/config';
+import { industry, channelTypeList } from '../../utils/tools/config';
+import { getChannel } from "../../utils/tools";
 import Superior from "../../components/common/superior";
 
 
@@ -50,8 +51,8 @@ class CustomerProfile extends Component {
       userList: [],
       options: [],
       checkOptions: [],
-
       isSuperior: false,
+      channe: {},
     };
     this.queryByUidAll = this.queryByUidAll.bind(this);
     this.update = this.update.bind(this);
@@ -68,6 +69,34 @@ class CustomerProfile extends Component {
   componentDidShow() {
 
   }
+
+  onShareAppMessage() {
+    this.limitUser();
+    return {
+      title: "客户档案",
+      path: "pages/customerProfile/index?id=" + this.$instance.router.params.id + "&signBills=" + this.$instance.router.params.signBills,
+    };
+  }
+
+  // onShareAppMessage() {
+  //   this.limitUser();
+  //   if (!this.isLogin()) {
+  //     return {
+  //       title: '登录',
+  //       path: '/pages/login/index', // 登录页面的路径
+  //     }
+  //   } else {
+  //     return {
+  //       title: '客户档案',
+  //       path: "pages/customerProfile/index?id=" + this.$instance.router.params.id + "&signBills=" + this.$instance.router.params.signBills + "&scene=1007", // 假设的分享路径
+  //     }
+  //   }
+  // }
+
+  isLogin() {
+    return !!Taro.getStorageSync('userInfor');
+  }
+
   // 客户档案详情
   queryByUidAll() {
     queryByUidAll({
@@ -79,7 +108,16 @@ class CustomerProfile extends Component {
             dtails: v.data
           })
         } else {
-          Taro.showToast({ title: v.error[0].message, icon: "none" });
+          setTimeout(() => {
+            Taro.navigateBack({
+              delta: 1
+            })
+          }, 1800);
+          Taro.showToast({
+            title: v.error[0].message,
+            icon: "none",
+            duration: 1800,
+          });
         }
       })
       .catch((err) => {
@@ -98,6 +136,9 @@ class CustomerProfile extends Component {
       { key: "financialData", value: "请填写财务数据" },
       { key: "earlyCommunication", value: "请填写前期沟通" },
       { key: "interviewIdeas", value: "请填写面谈思路及目的" },
+      { key: "interviewDistribution", value: "请填写主要面谈人及分工" },
+      { key: "enterpriseCount", value: "请填写覆盖企业数" },
+      { key: "channelIndicators", value: "请填写渠道考核指标" },
     ]
     if (!info.id) {
       delete info.id
@@ -113,7 +154,16 @@ class CustomerProfile extends Component {
           }
         }
         return
+      } else if (info[i] == 0) {
+        if (i == "channelType") {
+          Taro.showToast({
+            title: "请选择渠道类型",
+            icon: "none",
+          });
+          return
+        }
       }
+
     }
     updateUserDate(upType, info).then((v) => {
       if (v.error.length === 0) {
@@ -260,13 +310,6 @@ class CustomerProfile extends Component {
     })
   }
 
-  onShareAppMessage() {
-    this.limitUser();
-    return {
-      title: "客户档案",
-      path: "pages/customerProfile/index?id=" + this.$instance.router.params.id + "&signBills=" + this.$instance.router.params.signBills,
-    };
-  }
 
   render() {
     const { dtails, upType, info, obj, userList } = this.state;
@@ -275,9 +318,6 @@ class CustomerProfile extends Component {
         <MessageNoticebar />
         <View
           className="titleContent"
-          style={{
-            padding: Object.keys(dtails).length === 0 ? "0 20px" : "0px 0px",
-          }}
         >
           {Object.keys(dtails).length === 0 ? (
             <Skeleton
@@ -334,202 +374,349 @@ class CustomerProfile extends Component {
                 <View className="time">{dtails.createTime}</View>
               </View>
 
-              <View className="first">
-                <View className="tit">
-                  企业所属行业及主要产品
-                  {
-                    dtails.myUser == 1 &&
-                    <View className="up"
-                      onClick={e => {
-                        e.stopPropagation()
-                        this.setState({
-                          upType: 0,
-                          isOpened: true,
-                          info: {
-                            uid: this.$instance.router.params.id,
-                            industry: dtails.industry,
-                            businessScope: dtails.businessScope,
-                          },
-                          sector: {
-                            id: dtails.industry,
-                            title: dtails.industryName
-                          }
-                        })
-                      }}
-                    >修改</View>
-                  }
-                </View>
-                <View className="val">行业:{dtails.industryName}</View>
-                <View className="val">主营产品/服务:{dtails.businessScope}</View>
-                <View className="tit">
-                  意向合作项目
-                  {
-                    dtails.myUser == 1 &&
-                    <View className="up"
-                      onClick={e => {
-                        e.stopPropagation()
-                        this.getBusinessProjectByName()
-                        this.setState({
-                          upType: 5,
-                          isOpened: true,
-                          info: {
-                            uid: this.$instance.router.params.id,
-                            intendedProject: dtails.intendedProject,
-                          },
-                          checkOptions: !!dtails.intendedProject ? dtails.intendedProject.split(",") : []
-                        })
-                      }}
-                    >修改</View>
-                  }
-                </View>
-                <View className="val">{dtails.intendedProject || "无"}</View>
-                <View className="tit">
-                  <Text>
-                    联系人
-                    <Text className="txt">(面谈人)</Text>
-                  </Text>
-                  {
-                    dtails.myUser == 1 &&
-                    <View className="up"
-                      onClick={e => {
-                        e.stopPropagation()
-                        this.getUserList();
-                        this.setState({
-                          isAdd: true,
-                          obj: {
-                            uid: this.$instance.router.params.id,
-                            name: "",
-                            position: "",
-                            department: "",
-                            mobile: "",
-                          }
-                        })
-                      }}
-                    >新增</View>
-                  }
-                </View>
-                {
-                  !!dtails.contactList && dtails.contactList.map((v, k) =>
-                    <View className="val" key={k}>{v.name}&nbsp;&nbsp;{v.position}&nbsp;&nbsp;{v.department}&nbsp;&nbsp;{v.mobile}</View>
-                  )
-                }
-              </View>
-
-              <View className="two">
-                <View className="title">面谈企业情况</View>
-                <View className="tit">
-                  <Text>
-                    知识产权情况
-                    <Text className="txt">(专利信息、标准、专利、软著)</Text>
-                  </Text>
-                  {
-                    dtails.myUser == 1 &&
-                    <View className="up"
-                      onClick={e => {
-                        e.stopPropagation()
-                        this.setState({
-                          upType: 1,
-                          isOpened: true,
-                          info: {
-                            uid: this.$instance.router.params.id,
-                            id: dtails.id,
-                            inventionPatentCount: dtails.inventionPatentCount || 0,
-                            utilityModelCount: dtails.utilityModelCount || 0,
-                            appearancePatentCount: dtails.appearancePatentCount || 0,
-                            softwareWorksCount: dtails.softwareWorksCount || 0,
-                            otherCount: dtails.otherCount || 0,
-                          }
-                        })
-                      }}
-                    >修改</View>
-                  }
-                </View>
-                <View className="val">
-                  专利&nbsp;<Text className="num">{dtails.patentCount || 0}</Text>&nbsp;&nbsp;&nbsp;
-                  其中发明专利&nbsp;<Text className="num">{dtails.inventionPatentCount || 0}</Text>&nbsp;&nbsp;&nbsp;
-                  实用新型&nbsp;<Text className="num">{dtails.utilityModelCount || 0}</Text>&nbsp;&nbsp;&nbsp;
-                  外观设计&nbsp;<Text className="num">{dtails.appearancePatentCount || 0}</Text>&nbsp;&nbsp;&nbsp;
-                  软著&nbsp;<Text className="num">{dtails.softwareWorksCount || 0}</Text>&nbsp;&nbsp;&nbsp;
-                  其他类型&nbsp;<Text className="num">{dtails.otherCount || 0}</Text>&nbsp;&nbsp;&nbsp;
-                </View>
-                <View className="tit">
-                  <Text>
-                    财务数据
-                    <Text className="txt">(包括营收、税收、资产、研发费用等)</Text>
-                  </Text>
-                  {
-                    dtails.myUser == 1 &&
-                    <View className="up"
-                      onClick={e => {
-                        e.stopPropagation()
-                        this.setState({
-                          upType: 2,
-                          isOpened: true,
-                          info: {
-                            uid: this.$instance.router.params.id,
-                            id: dtails.id,
-                            financialData: dtails.financialData,
-                          }
-                        })
-                      }}
-                    >修改</View>
-                  }
-                </View>
-                <View className="val">{dtails.financialData || "无"}</View>
-                <View className="tit">
-                  <Text>
-                    前期沟通
-                    <Text className="txt">(客户的难处、需求)</Text>
-                  </Text>
-                  {
-                    dtails.myUser == 1 &&
-                    <View className="up"
-                      onClick={e => {
-                        e.stopPropagation()
-                        this.setState({
-                          upType: 3,
-                          isOpened: true,
-                          info: {
-                            uid: this.$instance.router.params.id,
-                            id: dtails.id,
-                            earlyCommunication: dtails.earlyCommunication,
-                          }
-                        })
-                      }}
-                    >修改</View>
-                  }
-                </View>
-                <View className="val">{dtails.earlyCommunication || "无"}</View>
-                <View className="tit">
-                  <Text>
-                    面谈思路及目的
-                  </Text>
-                  {
-                    dtails.myUser == 1 &&
-                    <View className="up"
-                      onClick={e => {
-                        e.stopPropagation()
-                        this.setState({
-                          upType: 4,
-                          isOpened: true,
-                          info: {
-                            uid: this.$instance.router.params.id,
-                            id: dtails.id,
-                            interviewIdeas: dtails.interviewIdeas,
-                          }
-                        })
-                      }}
-                    >修改</View>
-                  }
-                </View>
-                <View className="val">{dtails.interviewIdeas || "无"}</View>
-              </View>
+              {
+                dtails.newChannel == 1
+                  ?
+                  <View className="first">
+                    <View className="tit">
+                      已知渠道情况
+                      {
+                        dtails.myUser == 1 &&
+                        <View className="up"
+                          onClick={e => {
+                            e.stopPropagation()
+                            this.setState({
+                              upType: 7,
+                              isOpened: true,
+                              info: {
+                                uid: this.$instance.router.params.id,
+                                channelType: dtails.channelType,
+                                enterpriseCount: dtails.enterpriseCount,
+                                channelIndicators: dtails.channelIndicators,
+                              },
+                              channe: {
+                                id: dtails.channelType,
+                                title: getChannel(dtails.channelType)
+                              }
+                            })
+                          }}
+                        >修改</View>
+                      }
+                    </View>
+                    <View className="val">渠道类别:{getChannel(dtails.channelType)}</View>
+                    <View className="val">渠道企业数:{dtails.enterpriseCount}</View>
+                    <View className="val">渠道考核指标:{dtails.channelIndicators}</View>
+                    <View className="tit">
+                      <Text>
+                        联系人
+                        <Text className="txt">(面谈人)</Text>
+                      </Text>
+                      {
+                        dtails.myUser == 1 &&
+                        <View className="up"
+                          onClick={e => {
+                            e.stopPropagation()
+                            this.getUserList();
+                            this.setState({
+                              isAdd: true,
+                              obj: {
+                                uid: this.$instance.router.params.id,
+                                name: "",
+                                position: "",
+                                department: "",
+                                mobile: "",
+                              }
+                            })
+                          }}
+                        >新增</View>
+                      }
+                    </View>
+                    {
+                      !!dtails.contactList && dtails.contactList.map((v, k) =>
+                        <View className="val" key={k}>{v.name}&nbsp;&nbsp;{v.position}&nbsp;&nbsp;{v.department}&nbsp;&nbsp;{v.mobile}</View>
+                      )
+                    }
+                  </View>
+                  :
+                  <View className="first">
+                    <View className="tit">
+                      企业所属行业及主要产品
+                      {
+                        dtails.myUser == 1 &&
+                        <View className="up"
+                          onClick={e => {
+                            e.stopPropagation()
+                            this.setState({
+                              upType: 0,
+                              isOpened: true,
+                              info: {
+                                uid: this.$instance.router.params.id,
+                                industry: dtails.industry,
+                                businessScope: dtails.businessScope,
+                              },
+                              sector: {
+                                id: dtails.industry,
+                                title: dtails.industryName
+                              }
+                            })
+                          }}
+                        >修改</View>
+                      }
+                    </View>
+                    <View className="val">行业:{dtails.industryName}</View>
+                    <View className="val">主营产品/服务:{dtails.businessScope}</View>
+                    <View className="tit">
+                      意向合作项目
+                      {
+                        dtails.myUser == 1 &&
+                        <View className="up"
+                          onClick={e => {
+                            e.stopPropagation()
+                            this.getBusinessProjectByName()
+                            this.setState({
+                              upType: 5,
+                              isOpened: true,
+                              info: {
+                                uid: this.$instance.router.params.id,
+                                intendedProject: dtails.intendedProject,
+                              },
+                              checkOptions: !!dtails.intendedProject ? dtails.intendedProject.split(",") : []
+                            })
+                          }}
+                        >修改</View>
+                      }
+                    </View>
+                    <View className="val">{dtails.intendedProject || "无"}</View>
+                    <View className="tit">
+                      <Text>
+                        联系人
+                        <Text className="txt">(面谈人)</Text>
+                      </Text>
+                      {
+                        dtails.myUser == 1 &&
+                        <View className="up"
+                          onClick={e => {
+                            e.stopPropagation()
+                            this.getUserList();
+                            this.setState({
+                              isAdd: true,
+                              obj: {
+                                uid: this.$instance.router.params.id,
+                                name: "",
+                                position: "",
+                                department: "",
+                                mobile: "",
+                              }
+                            })
+                          }}
+                        >新增</View>
+                      }
+                    </View>
+                    {
+                      !!dtails.contactList && dtails.contactList.map((v, k) =>
+                        <View className="val" key={k}>{v.name}&nbsp;&nbsp;{v.position}&nbsp;&nbsp;{v.department}&nbsp;&nbsp;{v.mobile}</View>
+                      )
+                    }
+                  </View>
+              }
+              {
+                dtails.newChannel == 1
+                  ?
+                  <View className="two">
+                    <View className="title">面谈前渠道情况</View>
+                    <View className="tit">
+                      <Text>
+                        面谈项目
+                      </Text>
+                      {
+                        dtails.myUser == 1 &&
+                        <View className="up"
+                          onClick={e => {
+                            e.stopPropagation()
+                            this.getBusinessProjectByName()
+                            this.setState({
+                              upType: 5,
+                              isOpened: true,
+                              info: {
+                                uid: this.$instance.router.params.id,
+                                intendedProject: dtails.intendedProject,
+                              },
+                              checkOptions: !!dtails.intendedProject ? dtails.intendedProject.split(",") : []
+                            })
+                          }}
+                        >修改</View>
+                      }
+                    </View>
+                    <View className="val">{dtails.intendedProject || "无"}</View>
+                    <View className="tit">
+                      <Text>
+                        面谈思路及目的
+                      </Text>
+                      {
+                        dtails.myUser == 1 &&
+                        <View className="up"
+                          onClick={e => {
+                            e.stopPropagation()
+                            this.setState({
+                              upType: 4,
+                              isOpened: true,
+                              info: {
+                                uid: this.$instance.router.params.id,
+                                id: dtails.id,
+                                interviewIdeas: dtails.interviewIdeas,
+                              }
+                            })
+                          }}
+                        >修改</View>
+                      }
+                    </View>
+                    <View className="val">{dtails.interviewIdeas || "无"}</View>
+                    <View className="tit">
+                      <Text>
+                        我方主要面谈人及分工
+                      </Text>
+                      {
+                        dtails.myUser == 1 &&
+                        <View className="up"
+                          onClick={e => {
+                            e.stopPropagation()
+                            this.setState({
+                              upType: 6,
+                              isOpened: true,
+                              info: {
+                                uid: this.$instance.router.params.id,
+                                id: dtails.id,
+                                interviewDistribution: dtails.interviewDistribution,
+                              }
+                            })
+                          }}
+                        >修改</View>
+                      }
+                    </View>
+                    <View className="val">{dtails.interviewDistribution || "无"}</View>
+                  </View>
+                  :
+                  <View className="two">
+                    <View className="title">面谈企业情况</View>
+                    <View className="tit">
+                      <Text>
+                        知识产权情况
+                        <Text className="txt">(专利信息、标准、专利、软著)</Text>
+                      </Text>
+                      {
+                        dtails.myUser == 1 &&
+                        <View className="up"
+                          onClick={e => {
+                            e.stopPropagation()
+                            this.setState({
+                              upType: 1,
+                              isOpened: true,
+                              info: {
+                                uid: this.$instance.router.params.id,
+                                id: dtails.id,
+                                inventionPatentCount: dtails.inventionPatentCount || 0,
+                                utilityModelCount: dtails.utilityModelCount || 0,
+                                appearancePatentCount: dtails.appearancePatentCount || 0,
+                                softwareWorksCount: dtails.softwareWorksCount || 0,
+                                otherCount: dtails.otherCount || 0,
+                              }
+                            })
+                          }}
+                        >修改</View>
+                      }
+                    </View>
+                    <View className="val">
+                      专利&nbsp;<Text className="num">{dtails.patentCount || 0}</Text>&nbsp;&nbsp;&nbsp;
+                      其中发明专利&nbsp;<Text className="num">{dtails.inventionPatentCount || 0}</Text>&nbsp;&nbsp;&nbsp;
+                      实用新型&nbsp;<Text className="num">{dtails.utilityModelCount || 0}</Text>&nbsp;&nbsp;&nbsp;
+                      外观设计&nbsp;<Text className="num">{dtails.appearancePatentCount || 0}</Text>&nbsp;&nbsp;&nbsp;
+                      软著&nbsp;<Text className="num">{dtails.softwareWorksCount || 0}</Text>&nbsp;&nbsp;&nbsp;
+                      其他类型&nbsp;<Text className="num">{dtails.otherCount || 0}</Text>&nbsp;&nbsp;&nbsp;
+                    </View>
+                    <View className="tit">
+                      <Text>
+                        财务数据
+                        <Text className="txt">(包括营收、税收、资产、研发费用等)</Text>
+                      </Text>
+                      {
+                        dtails.myUser == 1 &&
+                        <View className="up"
+                          onClick={e => {
+                            e.stopPropagation()
+                            this.setState({
+                              upType: 2,
+                              isOpened: true,
+                              info: {
+                                uid: this.$instance.router.params.id,
+                                id: dtails.id,
+                                financialData: dtails.financialData,
+                              }
+                            })
+                          }}
+                        >修改</View>
+                      }
+                    </View>
+                    <View className="val">{dtails.financialData || "无"}</View>
+                    <View className="tit">
+                      <Text>
+                        前期沟通
+                        <Text className="txt">(客户的难处、需求)</Text>
+                      </Text>
+                      {
+                        dtails.myUser == 1 &&
+                        <View className="up"
+                          onClick={e => {
+                            e.stopPropagation()
+                            this.setState({
+                              upType: 3,
+                              isOpened: true,
+                              info: {
+                                uid: this.$instance.router.params.id,
+                                id: dtails.id,
+                                earlyCommunication: dtails.earlyCommunication,
+                              }
+                            })
+                          }}
+                        >修改</View>
+                      }
+                    </View>
+                    <View className="val">{dtails.earlyCommunication || "无"}</View>
+                    <View className="tit">
+                      <Text>
+                        面谈思路及目的
+                      </Text>
+                      {
+                        dtails.myUser == 1 &&
+                        <View className="up"
+                          onClick={e => {
+                            e.stopPropagation()
+                            this.setState({
+                              upType: 4,
+                              isOpened: true,
+                              info: {
+                                uid: this.$instance.router.params.id,
+                                id: dtails.id,
+                                interviewIdeas: dtails.interviewIdeas,
+                              }
+                            })
+                          }}
+                        >修改</View>
+                      }
+                    </View>
+                    <View className="val">{dtails.interviewIdeas || "无"}</View>
+                  </View>
+              }
             </View>
           )}
         </View>
 
         <AtModal
           isOpened={this.state.isOpened}
+          onClose={() => {
+            this.setState({
+              isOpened: false
+            })
+          }}
         >
           <AtModalHeader>信息修改</AtModalHeader>
           <AtModalContent>
@@ -653,7 +840,7 @@ class CustomerProfile extends Component {
                     })
                   }}
                   maxLength={200}
-                  placeholder='请填写~'
+                  placeholder='请填写财务数据~'
                 />
               </View>
             }
@@ -671,7 +858,7 @@ class CustomerProfile extends Component {
                     })
                   }}
                   maxLength={200}
-                  placeholder='请填写~'
+                  placeholder='请填写前期沟通~'
                 />
               </View>
             }
@@ -689,7 +876,7 @@ class CustomerProfile extends Component {
                     })
                   }}
                   maxLength={200}
-                  placeholder='请填写~'
+                  placeholder='请填写面谈思路及目的~'
                 />
               </View>
             }
@@ -710,6 +897,76 @@ class CustomerProfile extends Component {
                 />
               </View>
             }
+            {
+              upType == 6 &&
+              <View>
+                <View className='selectTitle'>我方主要面谈人及分工</View>
+                <AtTextarea
+                  value={info.interviewDistribution || ""}
+                  onChange={e => {
+                    this.setState({
+                      info: Object.assign(info, {
+                        interviewDistribution: e,
+                      }),
+                    })
+                  }}
+                  maxLength={200}
+                  placeholder='请填写我方主要面谈人及分工~'
+                />
+              </View>
+            }
+            {
+              upType == 7 &&
+              <View>
+                <View className='selectTitle' style={{ height: "30px" }}>
+                  渠道类别:
+                  <Picker
+                    value={this.state.channe.id}
+                    range={channelTypeList} rangeKey='title' mode='selector'
+                    onChange={(e) => {
+                      this.setState({
+                        channe: channelTypeList[e.detail.value],
+                        info: Object.assign(info, {
+                          channelType: channelTypeList[e.detail.value].id,
+                        })
+                      })
+                    }}>
+                    <View style={{ marginBottom: "10px", width: "160px", color: !this.state.channe.title && "#CCCCCC" }}>
+                      {!this.state.channe.title ? "请选择" : this.state.channe.title}
+                    </View>
+                  </Picker>
+                </View>
+                <View className='selectTitle' style={{ height: "30px" }}>
+                  覆盖企业数:
+                  <Input
+                    style={{ width: "50%" }}
+                    type='number'
+                    placeholder='请填写个数'
+                    value={info.enterpriseCount}
+                    onInput={e => {
+                      this.setState({
+                        info: Object.assign(info, {
+                          enterpriseCount: e.detail.value,
+                        })
+                      })
+                    }}
+                  />
+                </View>
+                <View className='selectTitle' >渠道考核指标</View>
+                <AtTextarea
+                  value={info.channelIndicators || ""}
+                  onChange={e => {
+                    this.setState({
+                      info: Object.assign(info, {
+                        channelIndicators: e,
+                      }),
+                    })
+                  }}
+                  maxLength={200}
+                  placeholder='请填写渠道考核指标~'
+                />
+              </View>
+            }
           </AtModalContent>
           <AtModalAction>
             <Button type='secondary' onClick={() => { this.setState({ isOpened: false }) }}>取消</Button>
@@ -719,16 +976,21 @@ class CustomerProfile extends Component {
 
         <AtModal
           isOpened={this.state.isAdd}
+          onClose={() => {
+            this.setState({
+              isAdd: false
+            })
+          }}
         >
           <AtModalHeader>联系人</AtModalHeader>
           <AtModalContent>
             {
               userList.map((item) =>
                 <View key={item.id} className="additem">
-                  <Text className="txt">{item.name || ""}</Text>
-                  <Text className="txt">{item.position || ""}</Text>
-                  <Text className="txt">{item.department || ""}</Text>
-                  <Text className="mobile">{item.mobile || ""}</Text>
+                  <Text className="txt">{item.name || " "}</Text>
+                  <Text className="txt">{item.position || " "}</Text>
+                  <Text className="txt">{item.department || " "}</Text>
+                  <Text className="mobile">{item.mobile || " "}</Text>
                   <View
                     className={item.major == 1 ? "bts" : "bt"}
                     onClick={() => {

+ 4 - 1
src/pages/customerProfile/index.less

@@ -130,6 +130,7 @@
 
       .val {
         font-size: 26px;
+        margin-bottom: 5px;
 
         .num {
           font-weight: bolder;
@@ -146,8 +147,10 @@
 
 .selectTitle {
   font-weight: bolder;
-  margin-bottom: 5px;
+  margin-bottom: 10px;
   font-size: 28px;
+  display: flex;
+  flex-direction: row;
 }
 
 .additem {

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

@@ -1,6 +1,6 @@
 import React, { Component } from "react";
 import { View, Text, Icon } from "@tarojs/components";
-import { getUserByName, getOrderByUid } from "../../utils/servers/servers";
+import { getUserByName, getOrderByUid, checkUserArchives } from "../../utils/servers/servers";
 
 import { AtSearchBar, AtPagination, AtListItem, AtIcon, AtButton } from "taro-ui";
 
@@ -138,13 +138,72 @@ class Enterprise extends Component {
       });
   }
 
+  checkUserArchives(v) {
+
+    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) {
+        Taro.showToast({
+          title: "该企业已在公出列表中",
+          icon: 'none'
+        })
+        return
+      }
+    }
+
+    if (this.props.type == 1 || this.props.type == 2) {
+      list.push(v)
+      this.setState({
+        newList: list
+      })
+      return
+    }
+
+    checkUserArchives({
+      uid: v.id
+    })
+      .then((msg) => {
+        if (msg.error.length === 0) {
+          if (msg.data) {
+            list.push(v)
+            this.setState({
+              newList: list
+            })
+          } else {
+            Taro.showToast({
+              title: "请先完善客户档案,才可发起公出",
+              icon: 'none'
+            })
+          }
+        } else {
+          Taro.showToast({
+            title: msg.error[0].message,
+            icon: "none",
+          });
+        }
+      })
+      .catch(() => {
+        this.setState({
+          listState: "RELOAD",
+        });
+      });
+  }
+
   render() {
     return (
       <>
         <AtSearchBar
           showActionButton
           value={this.state.value}
-          placeholder="请输入公出企业名称"
+          placeholder="请输入公出企业名称0"
           onChange={this.onChange}
           onActionClick={() => {
             this.onChange(this.state.value, false);
@@ -245,32 +304,9 @@ 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) {
-                        Taro.showToast({
-                          title: "该企业已在公出列表中",
-                          icon: 'none'
-                        })
-                        return
-                      }
-                    }
-                    list.push(v)
-                    this.setState({
-                      newList: list
-                    })
-                    // this.setState({
-                    //   selectId: v.id,
-                    // });
-                    // this.getByUid(v)
-                    // this.props.onChange({ uid: v.id, nickname: v.name }, 0);
+
+                    this.checkUserArchives(v)
+
                   }}
                 >
                   <View style={{ fontSize: "15px" }}>{v.name}</View>

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

@@ -675,10 +675,11 @@ class EgressDetails extends Component {
                 </View>
               </View>
             ) : null}
-            {((current === "协单审核") ||
-              (dtails.status === 1 && current === "审核") ||
-              (dtails.publicType == 1 && current === "他人公出" && dtails.myExamine == 0) ||
-              (dtails.techStartProcess == 1 && current === "他人公出" && dtails.myExamine == 0)) &&
+            {((dtails.status === 1 && current === "协单审核" && dtails.myExamine === 0) ||
+              (dtails.status === 1 && current === "审核" && dtails.assistProcess === 0) ||
+              (dtails.status === 1 && current === "审核" && dtails.assistProcess === 1) ||
+              (dtails.myExamine === 0 && current === "他人公出" && dtails.publicType == 1) ||
+              (dtails.myExamine === 0 && current === "他人公出" && dtails.techStartProcess == 1)) &&
               <View className="item">
                 <View className="title">
                   填写审批意见

+ 0 - 1
src/pages/egressDetails/modify.jsx

@@ -5,7 +5,6 @@ import {
   AtModalAction,
   AtModalContent,
   AtButton,
-  isPublicity,
 } from "taro-ui";
 import { Button, View } from "@tarojs/components";
 import Enterprise from "./enterprise";

+ 15 - 13
src/pages/egressDetails/publicContent.jsx

@@ -1158,29 +1158,31 @@ class PublicContent extends Component {
             <View className='result'>
               <View className='resultIcon'>
                 {
-                  isShow
-                    ? <Icon size='80' type='warn' color='#ff9900' />
-                    : <Icon size='80' type='success' />
+                  <Icon size='80' type='success' />
+                  // isShow
+                  //   ? <Icon size='80' type='warn' color='#ff9900' />
+                  //   : <Icon size='80' type='success' />
                 }
               </View>
               <View className='resultTitle'>
-                <View>申请成功{!isShow && ",可以打卡了!"}</View>
+                <View>申请成功
+                  {/* {!isShow && ",可以打卡了!"} */}
+                </View>
                 <View className='resultError'></View>
               </View>
-              {
+              {/* {
                 isShow && dtails.type != 1 &&
                 <View className="resultTips">公出他人企业,需跟单人员“
                   {tipList.toString()}
                   ”审核同意,才可以打卡!!!</View>
-              }
-              {/* {
-                isShow && dtails.type == 1 &&
-                <View className="resultTips">已发出公出申请!待“
-                  {tipList.toString()}
-                  ”审核通过,方可打卡!</View>
               } */}
+              {
+                // isShow && dtails.type == 1 &&
+                <View className="resultTips">
+                  已发出公出申请!待审核通过,方可打卡!</View>
+              }
               <View className='resultOperation'>
-                {
+                {/* {
                   (!isShow || dtails.type == 1) &&
                   <AtButton circle type='primary' onClick={() => {
                     this.props.onClose();
@@ -1191,7 +1193,7 @@ class PublicContent extends Component {
                   }}>
                     前往打卡
                   </AtButton>
-                }
+                } */}
                 <AtButton type='secondary' circle onClick={() => {
                   this.props.onClose();
                   this.state.goId &&

+ 122 - 25
src/pages/enterprise/index.jsx

@@ -4,6 +4,7 @@ import { View, Picker, ScrollView, Button } from '@tarojs/components'
 import {
   selectMyUser,
   selectMyUserDetails,
+  queryUserMax,
 } from '../../utils/servers/servers';
 import dayjs from 'dayjs';
 import {
@@ -11,20 +12,21 @@ import {
   AtTabs,
   AtTabsPane,
   AtIcon,
+  AtRadio,
   AtModal,
   AtModalContent,
   AtModalAction,
-  AtTextarea
+  AtModalHeader,
+  AtTextarea,
 } from 'taro-ui';
 import { shareType, levelType } from '../../utils/tools/config';
-
 import './index.less';
 import 'taro-ui/dist/style/components/tabs.scss';
 import "taro-ui/dist/style/components/flex.scss";
 import "taro-ui/dist/style/components/action-sheet.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 "taro-ui/dist/style/components/radio.scss";
 import "taro-ui/dist/style/components/modal.scss";
 
 import List from './list';
@@ -36,20 +38,23 @@ class Enterprise extends Component {
     super(props);
     this.state = {
       typeList: [
-        { title: '我的企业' },
-        { title: '公出过的企业' }],
+        { title: '企业/渠道' },
+        { title: '公出企业/渠道' }],
       current: 0,
       list: [],
       pageNo: 1,
       listState: 'LOADING',
       starts: {},
       level: {},
-
+      isProject: false,
+      isTips: false,
+      value: "",
     }
     this.selectMyUser = this.selectMyUser.bind(this);
     this.getMyList = this.getMyList.bind(this);
     this.onSetPickerTime = this.onSetPickerTime.bind(this);
     this.onPickerHide = this.onPickerHide.bind(this);
+    this.onAdd = this.onAdd.bind(this);
   }
 
   componentDidShow() {
@@ -204,31 +209,87 @@ class Enterprise extends Component {
     })
   }
 
+  onAdd() {
+    const { value } = this.state
+    if (!value) {
+      Taro.showToast({ title: "请先选择新增企业/渠道", icon: 'none' })
+      return
+    } else if (value == "1") {
+      queryUserMax({}).then(v => {
+        if (v.error.length === 0) {
+          if (v.data == 1) {
+            this.setState({
+              isTips: true
+            })
+            return
+          }
+          this.setState({
+            isProject: false
+          })
+          Taro.navigateTo({
+            url: "/pages/addEnterprise/index?type=" + value
+          })
+        } else {
+          Taro.showToast({ title: v.error[0].message, icon: 'none' })
+        }
+      }).catch(() => {
+        Taro.hideLoading()
+        Taro.showToast({
+          title: '系统错误,请稍后再试',
+          icon: 'none'
+        })
+      })
+    }
+    else if (value == "2") {
+      this.setState({
+        isProject: false
+      })
+      Taro.navigateTo({
+        url: "/pages/addEnterprise/index?type=" + value
+      })
+    }
+  }
+
 
   render() {
+    const { isProject, isTips } = this.state
+    const isAdd = Taro.getStorageSync('userInfor').province
     return (
       <View className='indexPage' >
         <MessageNoticebar />
         <View className='searchContent'>
-          <View className='searchTop'>
-            <AtSearchBar
-              showActionButton
-              placeholder='请输入企业/渠道'
-              value={this.state.searchValue}
-              onActionClick={() => {
-                this.selectMyUser();
-              }}
-              onChange={(value) => {
-                this.setState({
-                  searchValue: value
-                })
-              }}
-              onClear={() => {
-                this.setState({
-                  searchValue: ''
-                })
-              }}
-            />
+          <View className='searchTop' style={{ display: "flex", flexDirection: "row" }}>
+            {
+              (isAdd == "21" || isAdd == "11") &&
+              <View className='sadd'
+                onClick={e => {
+                  e.stopPropagation()
+                  this.setState({
+                    isProject: true
+                  })
+                }}
+              >新增</View>
+            }
+            <View style={{ width: "100%" }}>
+              <AtSearchBar
+                showActionButton
+                placeholder='请输入企业/渠道'
+                value={this.state.searchValue}
+                onActionClick={() => {
+                  this.selectMyUser();
+                }}
+                onChange={(value) => {
+                  this.setState({
+                    searchValue: value
+                  })
+                }}
+                onClear={() => {
+                  this.setState({
+                    searchValue: ''
+                  })
+                }}
+              />
+            </View>
           </View>
           <ScrollView className={this.state.openSearch ? 'searchBottomLOL' : ''} scrollX style={{ width: '100%' }}>
             <View className='searchBottom'>
@@ -412,6 +473,42 @@ class Enterprise extends Component {
             this.onSetPickerTime(v)
           }}>
         </timePicker>
+
+
+        <AtModal
+          isOpened={isTips}
+          title='温馨提示'
+          confirmText='确认'
+          onClose={() => { this.setState({ isTips: false, }) }}
+          onConfirm={() => { this.setState({ isTips: false }) }}
+          content='不可添加!您的客户数已达最大值,可移除部分客户后添加!'
+        />
+
+        <AtModal
+          isOpened={isProject}
+          closeOnClickOverlay={false}
+        >
+          <AtModalHeader>新增企业/渠道</AtModalHeader>
+          <AtModalContent>
+            <AtRadio
+              options={[
+                { label: '新增企业', value: '1', },
+                { label: '新增渠道', value: '2' },
+              ]}
+              value={this.state.value}
+              onClick={e => {
+                this.setState({
+                  value: e
+                })
+              }}
+            />
+          </AtModalContent>
+          <AtModalAction>
+            <Button type='secondary' onClick={() => { this.setState({ isProject: false, }) }}>取消</Button>
+            <Button type='primary' onClick={this.onAdd}>确定</Button>
+          </AtModalAction>
+        </AtModal>
+
       </View>
     )
   }

+ 21 - 1
src/pages/enterprise/index.less

@@ -63,7 +63,7 @@
 
       }
 
-      .emore{
+      .emore {
         font-size: 26px;
         margin: 10px 0;
         color: #58A3FF;
@@ -97,4 +97,24 @@
   color: white;
   background: #F1662F;
 
+}
+
+.sadd {
+  -webkit-flex: none;
+  -ms-flex: none;
+  flex: none;
+  display: block;
+  margin-left: 10PX;
+  padding: 0 10PX;
+  height: 30PX;
+  color: #FFF;
+  font-size: 14PX;
+  line-height: 30PX;
+  border-radius: 4PX;
+  background-color: green;
+  -webkit-transition: margin-right 0.3s, opacity 0.3s;
+  -o-transition: margin-right 0.3s, opacity 0.3s;
+  transition: margin-right 0.3s, opacity 0.3s;
+  margin: 12px 10px;
+
 }

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

@@ -65,7 +65,7 @@ class MyList extends Component {
                     </View>
                   }
                   {
-                    (title == "我的公出" || title == "我的协单" || title === "协单审核") &&
+                    ((title == "我的公出" && !!v.assistAidName) || title == "我的协单" || title === "协单审核") &&
                     <View
                       className="select"
                       onClick={e => {

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

@@ -19,6 +19,8 @@ import 'taro-ui/dist/style/components/modal.scss';
 
 import selectIcon from '../../image/select.png';
 
+import { getCurrentPageUrl } from '../../utils/servers/utils'
+
 import './index.less'
 
 @connect(({ counter }) => ({

+ 10 - 1
src/pages/situation/index.jsx

@@ -66,7 +66,16 @@ class CustomerProfile extends Component {
             loading: false,
           })
         } else {
-          Taro.showToast({ title: v.error[0].message, icon: "none" });
+          setTimeout(() => {
+            Taro.navigateBack({
+              delta: 1
+            })
+          }, 1800);
+          Taro.showToast({
+            title: v.error[0].message,
+            icon: "none",
+            duration: 1800,
+          });
         }
       })
       .catch((err) => {

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

@@ -221,3 +221,28 @@ export const getUserSuperEvaluate = (postData = {}) => {
 export const addUserSuperEvaluate = (postData = {}) => {
   return HTTPREQUEST.post('/api/admin/userSuperEvaluate/add', postData)
 }
+
+// 是否完成客户档案
+export const checkUserArchives = (postData = {}) => {
+  return HTTPREQUEST.get('/api/admin/release/checkUserArchives', postData)
+}
+
+// 公司名称验证
+export const checkUserName = (postData = {}) => {
+  return HTTPREQUEST.get('/api/admin/customer/checkUserName', postData)
+}
+
+// 新增客户
+export const addCustomer = (postData = {}) => {
+  return HTTPREQUEST.post('/api/admin/customer/addCustomer', postData)
+}
+
+// 新增渠道
+export const addChannel = (postData = {}) => {
+  return HTTPREQUEST.post('/api/admin/customer/addChannel', postData)
+}
+
+// 是否最大客户数判断
+export const queryUserMax = (postData = {}) => {
+  return HTTPREQUEST.get('/api/admin/customer/queryUserMax', postData)
+}

+ 1 - 1
src/utils/servers/utils.js

@@ -5,7 +5,7 @@ import { login } from '../../utils/servers/servers'
  */
 export const getCurrentPageUrl = () => {
   let pages = Taro.getCurrentPages()
-  let currentPage = pages[pages.length - 1]
+  let currentPage = pages[pages.length - 2]
   let url = currentPage.route
   return url
 };

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 0
src/utils/tools/city.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 13395 - 1
src/utils/tools/config.js


+ 43 - 1
src/utils/tools/index.js

@@ -1,4 +1,4 @@
-import { clockState, clockJournalState, industry } from './config';
+import { clockState, clockJournalState, industry, channelTypeList, addressList } from './config';
 import dayjs from "dayjs";
 import Taro from "@tarojs/taro";
 
@@ -306,4 +306,46 @@ export const getIndustryType = (val) => {
     }
   })
   return theType;
+}
+
+// 渠道类别
+export const getChannel = (val) => {
+  let theType = "";
+  channelTypeList.map(function (item) {
+    if (item.id == val) {
+      theType = item.title
+    }
+  })
+  return theType;
+}
+
+export const getProvince = (p, c, a) => {
+  let province = !!p && p.slice(0, 2)
+  let city = c
+  let area = !!a && a.slice(0, 2)
+  let pid = "";
+  let cid = ""
+  let aid = ""
+  if (!!province) {
+    addressList.map(function (i) {
+      if (i.name.slice(0, 2) == province) {
+        pid = i.id
+        if (!!city && i.cityList.length > 0) {
+          i.cityList.map(function (j) {
+            if (j.name == city) {
+              cid = j.id
+              if (!!area && j.areaList.length > 0) {
+                j.areaList.map(function (k) {
+                  if (k.name.slice(0, 2) == area) {
+                    aid = k.id
+                  }
+                })
+              }
+            }
+          })
+        }
+      }
+    })
+  }
+  return [pid, cid || pid, aid || cid || pid]
 }