wangyingjie 2 лет назад
Родитель
Сommit
c5688ee1f8

+ 1103 - 240
package-basic-data/pages/customer-follow-up/customer-follow-up.js

@@ -1,39 +1,78 @@
-const app = getApp();
 const api = require('../../../utils/api.js');
 const Constants = require('../../../utils/Constants.js');
 const util = require('../../../utils/util.js')
+const common = require('../../../utils/common');
+const config = require('../../../config/config.js'); 
+const app = getApp();
 Page({
 
-  /** 
+  /**
    * 页面的初始数据
    */
   data: {
+
+    jobIds: [-101, -102], //销售顾问 设计师    -2022/08/20 于继渤
+    checked_1: false,
+    checked_2: false,
+    checked_3: false,
+    checked_4: false,
+    checked_5: false,
+    checked_6: false,
+    checked_7: false,
+    checked_8: false,
+    //数量
+    quantity_1: '0',
+    quantity_2: '0',
+    quantity_3: '0',
+    quantity_4: '0',
+    quantity_5: '0',
+    quantity_6: '0',
+    quantity_7: '0',
+    quantity_8: '0',
+    show: false,
+
     form: {
       CustomerName: '', //客户名称
-      reportUserName: '', //业务员
-      NextFollowPlan: '', //下次跟进计划
-      NextFollowTime: '', //下次跟进时间
+      CustomerPhone: '', //客户电话
+      AddressName: '', //住址
+      AddressNo: '', //门牌号
+      CustomerIntentionsName: '', //客户意向
+      CompetitionBrand: '', //竞品品牌
+      FollowUpContent: '', //跟进内容
+      NextFollowUpPlan: '', //下次跟进计划
+      InviteResult: '', //邀约结果
+      NextFollowTime: '', //提醒时间
+      InviteTime: '', //邀约到店时间
+      DesignUser: '', //设计师
+      DesignUserId: 0, //设计师
+      FollowTypeName: '', //跟进方式
+      loseReasonIds: [],//流失原因
+      OtherName: '其他',
+      addressArea: {
+        province: '',
+        city: '',
+        district: '',
+        // name: ''
+      },
+      competitionBrandFlag: false,
+
     },
-    customerName: '刘总',
-    staffName: '马凯',
-    selectPeriodvalue: '',
-    startChecked: false,
-    selectPeriodFlg: false,
-    dayWeekFlg: true,
-    stepper: 0,
-    skipSaturday: false,
-    skipSunday: false,
-    mess: '请选择',
-    weekValueitem: '',
-    vMonday: false,
-    vThuesday: false,
-    vWednesday: false,
-    vThursday: false,
-    vFriday: false,
-    vSaturday: false,
-    vSunday: false,
-    strLength: 0,
     minDate: new Date().getTime(),
+    activeNames: [],
+    activeNameOthers: [],
+    radio_follow_up: '1',
+    customerIntentionsFlag: false,
+    inviteFollowTypeFlag: false,
+    inviteResultFlag: false,
+    followTypeFlag: false,
+    designFlag: false,
+    otherFlag: false,
+    //提醒时间
+    nextFollowTimeFlag: true,
+    //邀约到店时间
+    inviteTimeFlag: true,
+
+    inviteTimeSearch: new Date().getTime() + 100,
     nextFollowTimeSearch: new Date().getTime() + 100,
     formatter(type, value) {
       if (type === 'year') {
@@ -53,165 +92,425 @@ Page({
       }
       return value;
     },
+    fileList: [], //图片
   },
 
   /**
-   * 生命周期函数--监听页面加载
+   * 生命周期函数--监听页面显示
    */
-  onLoad: function (options) {
-    let form = this.data.form
-    form.reportUserName = app.globalData.user.userName
-    form.reportUser = app.globalData.user.userId
-    form.orgName = app.globalData.user.jobName
-    form.orgId = app.globalData.user.jobId
-    let item = JSON.parse(decodeURIComponent(options.item))
-    form.CustomerName = item.customerName
-    form.CustomerId = item.customerId
-    form.FollowId = item.followId //跟进ID
-    form.saleStatus = item.saleStatus//客成状态
-    this.setData({
-      form
-    })
-  },
+  onShow: function () {
 
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady: function () {
+    const location = chooseLocation.getLocation();
+    if (location) {
+      if (!location.province && !location.city) {
+        wx.showToast({
+          title: '地址无效',
+          duration: 2000
+        })
+        return;
+      }
+      //直辖市省变更(去掉市)
+      let provinceTemp = util.updateProvince(location)
+      location.province = provinceTemp ? provinceTemp : location.province
+      location.district =  location.district == undefined ? '' : location.district
+      let temp = this.data.form;
+      // 小区或POI
+      temp['addressName'] = location.name;
+      temp['addressFull'] = location.address + location.name; //全路径
+      temp['addressGcj02'] = {
+        latitude: location.latitude,
+        longitude: location.longitude
+      };
+      // 行政区划
+      temp['addressArea'] = {
+        province: location.province,
+        city: location.city,
+        district: location.district == undefined || !location.district? location.city : location.district,
+      }
+      this.setData({
+        form: temp,
+      })
+    }
 
   },
-  //下次跟进时间
-  onChangePickDate() {
-    this.setData({
-      show: true
-    })
-  },
   /**
-   * @desc : 选择业务员
-   * @author : 于继渤
-   * @date : 2022/5/26 12:16
+   * 生命周期函数--监听页面卸载
    */
-  openStaffDropdown() {
-    this.setData({
-      staffFlag: true
-    })
-
+  onUnload: function () {
+    // 页面卸载时设置插件选点数据为null,防止再次进入页面,geLocation返回的是上次选点结果
+    chooseLocation.setLocation(null);
   },
   /**
-   * @desc : 下拉单选确认事件
+   * @desc : 调取企业微信会话
+   * @date : 2022/5/18 15:49
    * @author : 于继渤
-   * @date : 2022/5/26 12:16
    */
-  singleSearchAll(e) {
-    let form = this.data.form
-    form.reportUserName = e.detail.name
-    form.reportUser = e.detail.id
-    this.setData({
-      form
-    })
+  openWeChat(e) {
+    let designuser = e.currentTarget.dataset.designuser
+    let qvChatId = this.data.form.qvChatId
+    let that = this
+    let qvexternaluserid = e.currentTarget.dataset.qvexternaluserid
+    let qvuserid = e.currentTarget.dataset.qvuserid
+    let staffqvuserid = e.currentTarget.dataset.staffqvuserid
+    let customerId = e.currentTarget.dataset.customerid
+    let CustomerName = e.currentTarget.dataset.customername
+    if (designuser == '' && qvChatId == null) {
+      wx.showToast({
+        title: '请选择设计师',
+        image: '/static/image/warning.png',
+        duration: 1000
+      })
+      return
+    }
+    if (qvexternaluserid == null || qvexternaluserid == undefined) {
+      wx.showToast({
+        title: '与该客户非好友关系',
+        image: '/static/image/warning.png',
+        duration: 1000
+      })
+      return
+    }
+    if (!app.globalData.SystemInfo.environment) {
+      wx.showToast({
+        title: '请在企业微信模式下运行',
+        icon: 'none'
+      })
+      return
+    }
+    if (qvChatId == null && qvChatId == undefined) {
+      wx.qy.openEnterpriseChat({
+        // 注意:userIds和externalUserIds至少选填一个,且userIds+externalUserIds总数不能超过2000,如果externalUserIds有微信联系人,则总数不能超过40人。
+        userIds: qvuserid + ';' + staffqvuserid + ';', //参与会话的企业成员列表,格式为userid1;userid2;...,用分号隔开。
+        // 参与会话的外部联系人列表,格式为userId1;userId2;…,用分号隔开。
+        externalUserIds: qvexternaluserid,
+        groupName: '讨论组' + '-' + CustomerName, // 必填,会话名称。单聊时该参数传入空字符串""即可。
+        chatId: "", //新建会话时,chatId必须为空串
+        success: function (res) {
+          // 回调
+          var chatId = res.chatId; //返回chatId仅在企业微信3.0.36及以后版本支持;
+          let param = {}
+          param.qvChatId = chatId
+          param.customerId = customerId
+          api.request(Constants.SALE_CUSTOMER_API + 'update_customer_qvChatId', 'POST', param).then(res => {
+            if (res.data.code === 200) {
+              let form = that.data.form
+              form.qvChatId = chatId
+              that.setData({
+                form: form
+              })
+            }
+          })
+        },
+        fail: function (res) {
+          // 失败处理
+          wx.showToast({
+            title: res.data,
+            icon: 'none'
+          })
+        }
+      });
+    } else {
+      wx.qy.openEnterpriseChat({
+        // 注意:userIds和externalUserIds至少选填一个,且userIds+externalUserIds总数不能超过2000,如果externalUserIds有微信联系人,则总数不能超过40人。
+        userIds: '', //参与会话的企业成员列表,格式为userid1;userid2;...,用分号隔开。
+        // 参与会话的外部联系人列表,格式为userId1;userId2;…,用分号隔开。
+        externalUserIds: '',
+        groupName: '' + '-' + CustomerName, // 必填,会话名称。单聊时该参数传入空字符串""即可。
+        chatId: qvChatId, //新建会话时,chatId必须为空串
+        success: function (res) {
+          // 回调
+          var chatId = res.chatId; //返回chatId仅在企业微信3.0.36及以后版本支持;
+        },
+        fail: function (res) {
+          // 失败处理
+          wx.showToast({
+            title: res.data,
+            icon: 'none'
+          })
+        }
+      });
+    }
+
   },
   /**
-   * @desc : 下拉单选关闭事件
-   * @author : 于继渤
-   * @date : 2022/5/26 12:16
+   * 小程序地图调用
    */
-  singleCloseAll(e) {},
+  onClickWxchartAddress() {
+    // if (this.data.EditFlag) {
+    //   return
+    // }
+    // 跳转新建地图实例
+    common.onClickWxchartAddress();
+  },
   /**
-   * 下次跟进时间
-   * @param {} e 
+   * 联系电话 拨打
    */
-  onConfirmChooseDate(e) {
-    let form = this.data.form
-    form.NextFollowTime = util.formatDataTime(new Date(this.data.nextFollowTimeSearch))
-    this.setData({
-      form: form,
-      show: false
+  onClickphone(e) {
+    let telephone = e.currentTarget.dataset.telephone
+    // 拨打电话
+    wx.makePhoneCall({
+      phoneNumber: telephone,
     })
   },
-    /**
-   * 下次跟进时间关闭
-   * @param {} e 
-   */
-  onCloseChooseDate() {
-    this.setData({
-      show: false
+
+  onnavigateToAddCustomer: function (e) {
+    if (!app.globalData.SystemInfo.environment) {
+      wx.showToast({
+        title: '请在企业微信模式下运行',
+        icon: 'none'
+      })
+      return
+    }
+    wx.qy.navigateToAddCustomer({
+      success: (res) => {
+      },
+      fail: (res) => {
+      },
+      complete: (res) => {
+      }
     })
+
   },
-  /**
-   * @desc : 标识日期变化事件
-   * @author : 秦祺
-   * @date : 2022/5/26 17:16
-   */
-  changeDate(e) {
-    let key = e.currentTarget.dataset.key
-    //量尺时间
-    if (key === 'nextFollowTime') {
-      this.setData({
-        nextFollowTimeSearch: e.detail
+  /* 上传方法 */
+  afterRead(event) {
+    const _this = this;
+    const {
+      file
+    } = event.detail;
+    file.forEach(res => {
+      // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
+      wx.uploadFile({
+        url: `${config.server_add}:${config.server_port}` + '/basic-server/file/upload',
+        filePath: res.path,
+        name: 'file',
+        formData: {
+          'folder': 't_csm_follow/annex_paths'
+        },
+        header: {
+          'Authorization': 'Bearer ' + app.globalData.token
+        },
+        success(res) {
+          res.data = JSON.parse(res.data)
+          if (res.data.code === 200) {
+            let arr = _this.data.fileList;
+            arr.push({
+              url: res.data.data.absolutelyPath,
+              FilePath: res.data.data.relativePath,
+              deletable: true
+            })
+            _this.setData({
+              fileList: arr
+            })
+          }
+        },
       })
-    }
+    })
   },
+
   /**
-   * 下次跟进计划
-   * @param {} event 
+   * 删除图片
    */
-  onMeasureRemarksChange(event) {
-    let form = this.data.form
-    form.NextFollowPlan = event.detail
-    // strLength = event.detail.value.length
+  deleteImg(e) {
+    let index = e.detail.index;
+    let arr = this.data.fileList;
+    arr.splice(index, 1);
     this.setData({
-      form: form,
-      // strLength
+      fileList: arr
     })
   },
   /**
-   * 保存
-   * 
+   * 获取意向品类数据源
+   */
+  getGoodsSpecs() {
+    let param = {
+      dataSourceCode: "商品规格分类"
+    }
+    param.cpId = app.globalData.user.cpId
+    api.request(Constants.BASIC_COMMON_API + 'get_wx_init_data', 'POST', param).then(res => {
+      if (res.data.code === 200) {
+        let specsList = []
+        specsList = res.data.data
+        if (this.data.EditFlag) { //编辑的时候进
+          let itemList = this.data.item.intentionInfo
+          // 把数据库里的选择 赋值到控件上  编辑进
+          //todo 其他分类特殊 
+          specsList.forEach(function (item) {
+            item.quantity = 0
+            item.checked = false
+            item.other = false
+            if (itemList) {
+              itemList.forEach(element => {
+                if (item.id === element.specsId) {
+                  item.quantity = element.count
+                  item.checked = element.value
+                }
+                if ((item.name == "其他分类") && element.other) { //其他品类
+                  item.other = element.other
+                  item.quantity = element.count
+                  item.checked = element.value
+                  item.id = element.specsId
+                  item.name = element.specsName
+                }
+              });
+            }
+          });
+        }
+        this.setData({
+          specsList
+        })
+      }
+    })
+  },
+  /**
+   * 提交保存
    */
   submit() {
-      return
+    let onRadio_Follow_Up = this.data.onRadio_Follow_Up
     let result = this.checkForm();
+    let specsList = this.data.specsList
+    let specsList_ = []
+    if (specsList) {
+      specsList.forEach(function (item) {
+        if (item.checked) {
+          specsList_.push({
+            "specsId": item.id,
+            "specsName": item.name,
+            "count": item.quantity,
+            "value": item.checked,
+            "other": item.other ? item.other : false
+          })
+        }
+      });
+    }
     if (result.flag) {
       let param = {}
+      param.ascpId = app.globalData.user.ascpId
+      param.sale1Id = app.globalData.user.sale1Id
+      param.sale2Id = app.globalData.user.sale2Id
+      if (this.data.radio_follow_up == '1') {
+        param.followStatus = '跟进状态-跟进' //跟进状态 
+        param.followType = '跟进方式-' + this.data.form.FollowTypeName //跟进方式 
+      } else if (this.data.radio_follow_up == '3') {
+        param.followStatus = '跟进状态-邀约' //跟进状态 
+        param.followType = '跟进方式-微信' //跟进方式 
+      } else if (this.data.radio_follow_up == '5') {
+        param.followStatus = '跟进状态-约尺' //跟进状态 
+        param.followType = '跟进方式-上门' //跟进方式 
+      }
       param.customerId = this.data.form.CustomerId //客户名称 
-      param.followId = this.data.form.FollowId //跟进ID
-      param.followUser = this.data.form.reportUser //跟进人
-      param.nextFollowPlan = this.data.form.NextFollowPlan //下次跟进计划
-      param.nextFollowTime = this.data.form.NextFollowTime //下次跟进时间
-      param.xxlJobId = 1 //提醒中间件ID
-      param.cpId = app.globalData.user.cpId //所属公司
-      param.planType = 0
-      param.saleStatus = this.data.form.saleStatus //客成状态
+      param.customerPhone = this.data.form.CustomerPhone //客户电话
+      param.customerName = this.data.form.CustomerName //客户名称
+      param.addressName = this.data.form.addressName //客户地址
+      param.addressNo = this.data.form.AddressNo //门牌号
+      if (this.data.form.addressArea != null) {
+        param.addressFull = (this.data.form.addressArea.province + this.data.form.addressArea.city + this.data.form.addressArea.district + this.data.form.addressName + this.data.form.AddressNo) ? (this.data.form.addressArea.province + this.data.form.addressArea.city + this.data.form.addressArea.district + this.data.form.addressName + this.data.form.AddressNo) : '' //全路径
+        //  param.addressFull = this.data.form.addressFull + this.data.form.AddressNo //全路径
+        param.addressArea = this.data.form.addressArea //行政规划 省市区
+        param.addressGcj02 = this.data.form.addressGcj02
+      }
+
+      param.followData = this.data.form.FollowUpContent //跟进内容
+      param.nextFollowPlan = this.data.form.NextFollowUpPlan //下次跟进计划
+
+      if (this.data.radio_follow_up != 1) {
+        let InviteResult = this.data.form.InviteResult
+        if ((InviteResult == '接受邀约') && (InviteResult != '')) {
+          param.inviteResult = '邀约结果-接受'
+        } else if ((InviteResult == '拒绝邀约') && (InviteResult != '')) {
+          param.inviteResult = '邀约结果-拒绝'
+        }
+      } //邀约结果
+      param.designUser = this.data.form.DesignUserId //设计师 
+      if (this.data.radio_follow_up != 5) {
+        param.intention = '客户意向-' + this.data.form.CustomerIntentionsName //客户意向
+      }
+      //客户意向是放入公海时,客成状态改为公海
+      if (this.data.form.CustomerIntentionsName == '放入公海') {
+        param.saleStatus = '客成状态-公海'
+      }
+      //客户意向是流失时,客成状态改为流失
+      else if (this.data.form.CustomerIntentionsName == '已流失') {
+        param.saleStatus = '客成状态-流失'
+      }
+      //如果原来客户为公海或流失,跟进之后为潜客
+      else if (this.data.form.saleStatus == '客成状态-公海' || this.data.form.saleStatus == '客成状态-流失') {
+        param.saleStatus = '客成状态-潜客'
+      }
+      else {
+        param.saleStatus = this.data.form.saleStatus
+      }
+      param.competitiveBrands = this.data.form.CompetitionBrand //竞品品牌  
+      param.loseReasonIds = this.data.form.loseReasonIds //流失原因
+      param.inviteTime = this.data.form.InviteTime ? (this.data.form.InviteTime.length == 16 ? this.data.form.InviteTime + ":00" : this.data.form.InviteTime) : '' //邀约到店时间  
+      param.nextFollowTime = this.data.form.NextFollowTime ? (this.data.form.NextFollowTime.length == 16 ? this.data.form.NextFollowTime + ":00" : this.data.form.NextFollowTime) : '' //提醒时间  
+      param.cpId = app.globalData.user.cpId
+      param.followOrg = app.globalData.user.orgId
+      let fileList_ = this.data.fileList
+      let fileList = []
+      fileList_.forEach(item => {
+        fileList.push(item.FilePath)
+      })
+      // 跟进附件 20220613
+      param.annexPaths = {
+        annexPaths: fileList
+      }
+      param.intentionInfo = specsList_
       this.setData({
         loading: true,
-        loadingButtonFlag: true,
+        loadingButtonFlag: true  //防止重复点击
       })
-      api.request(Constants.SALE_CUSTOMERFOLLOW_PLAN_API + 'insert', 'POST', param).then(res => {
-        if (res.data.code === 200) {
-          wx.showToast({
-            title: '保存成功',
-            image: '/static/image/success.png',
-            duration: 1000
-          })
-          var pages = getCurrentPages();
-          var prevPage = pages[pages.length - 2];
+      if (this.data.EditFlag) { //true 编辑update  false 为新建 insert 
+        param.followId = this.data.form.FollowId
+        api.request(Constants.SALE_CUSTOMERFOLLOW_API + 'update', 'POST', param).then(res => {
 
-          prevPage.setData({
-            selectflag: true
-          })
-          setTimeout(function () {
-            wx.navigateBack({
-              delta: 1
+          if (res.data.code === 200) {
+            wx.showToast({
+              title: '保存成功',
+              image: '/static/image/success.png',
+              duration: 1000
             })
-          }, 1500)
-        } else {
-       
-          this.setData({
-            loading: false,
-            loadingButtonFlag: false
-          })
-        }
-      })
+            var pages = getCurrentPages();
+            var prevPage = pages[pages.length - 2];
+            setTimeout(function () {
+              wx.navigateBack({
+                delta: 1
+              })
+            }, 1500)
+          } else {
+            this.setData({
+              loading: false,
+              loadingButtonFlag: false,
+            })
+          }
+        })
+      } else {
+        api.request(Constants.SALE_CUSTOMERFOLLOW_API + 'insert', 'POST', param).then(res => {
+          if (res.data.code === 200) {
+            wx.showToast({
+              title: '保存成功',
+              image: '/static/image/success.png',
+              duration: 1000
+            })
+            var pages = getCurrentPages();
+            var prevPage = pages[pages.length - 2];
+
+            prevPage.setData({
+              selectflag: true
+            })
+            setTimeout(function () {
+              wx.navigateBack({
+                delta: 1
+              })
+            }, 1500)
+          } else {
+            this.setData({
+              loading: false,
+              loadingButtonFlag: false,
+            })
+          }
+        })
+      }
+
     } else {
       wx.showToast({
         title: result.msg,
@@ -219,170 +518,734 @@ Page({
         duration: 1000
       })
       this.setData({
-        loading: false,
-        loadingButtonFlag: false
+        loading: false
       })
     }
-
+  },
+  /**
+   * 跟进内容
+   * @param {} event 
+   */
+  onFollowUpContentChange(event) {
+    let form = this.data.form
+    form.FollowUpContent = event.detail
+    this.setData({
+      form: form
+    })
+  },
+  /**
+   * 客户地址
+   * @param {*} event 
+   */
+  onAddressNameChange(event) {
+    let form = this.data.form
+    form.AddressName = event.detail
+    this.setData({
+      form: form
+    })
+  },
+  /**
+   * 门牌号
+   * @param {*} event 
+   */
+  onAddressNoChange(event) {
+    let form = this.data.form
+    form.AddressNo = event.detail
+    this.setData({
+      form: form
+    })
+  },
+  /**
+   * 竞品品牌
+   * @param {*} event 
+   */
+  onCompetitionBrandChange(event) {
+    let form = this.data.form
+    form.CompetitionBrand = event.detail
+    this.setData({
+      form: form
+    })
+  },
+  /**
+   * 下次跟进计划
+   * @param {} event 
+   */
+  onNextFollowUpPlanChange(event) {
+    let form = this.data.form
+    form.NextFollowUpPlan = event.detail
+    this.setData({
+      form: form
+    })
   },
   /* 表单校验 */
   checkForm() {
-    if (!this.data.form.NextFollowTime) {
+    if (!this.data.form.CustomerName) {
       return {
         flag: false,
-        msg: '下次跟进时间为空'
+        msg: '客户名称为空'
       };
     }
+    if(!this.data.form.noTelephone){
+      if ( !this.data.form.CustomerPhone) {
+        return {
+          flag: false,
+          msg: '联系电话为空'
+        };
+      }
+      if (!util.isPoneAvailable(this.data.form.CustomerPhone)) {
+        return {
+          flag: false,
+          msg: '电话格式不正确'
+        };
+      }
+    }
+   
+    if (!this.data.form.FollowUpContent) {
+      return {
+        flag: false,
+        msg: '跟进内容为空'
+      };
+    }
+  
+    //日常跟进
+    if (this.data.radio_follow_up == 1) {
+      if (!this.data.form.CustomerIntentionsName) {
+        return {
+          flag: false,
+          msg: '客户意向为空'
+        };
+      }
+      if (this.data.form.CustomerIntentionsName == '已流失' && this.data.form.loseReasonIds.length == 0) {
+        return {
+          flag: false,
+          msg: '流失原因为空'
+        };
+      }
+      if (!this.data.form.FollowTypeName) {
+        return {
+          flag: false,
+          msg: '跟进方式为空'
+        };
+      }
+      if (!this.data.form.NextFollowTime && this.data.form.CustomerIntentionsName != '已流失') {
+        return {
+          flag: false,
+          msg: '提醒时间为空'
+        };
+      }
+    } else if (this.data.radio_follow_up == 3) {
+      if (!this.data.form.InviteResult) {
+        return {
+          flag: false,
+          msg: '邀约结果为空'
+        };
+      }
+      if (this.data.form.InviteResult == '接受邀约' && !this.data.form.InviteTime) {
+        return {
+          flag: false,
+          msg: '邀约到店时间为空'
+        };
+      }
+      if (this.data.form.InviteResult == '拒绝邀约' && !this.data.form.NextFollowTime) {
+        return {
+          flag: false,
+          msg: '提醒时间为空'
+        };
+      }
+      if (!this.data.form.CustomerIntentionsName) {
+        return {
+          flag: false,
+          msg: '客户意向为空'
+        };
+      }
+      if (this.data.form.CustomerIntentionsName == '已流失' && this.data.form.loseReasonIds.length == 0) {
+        return {
+          flag: false,
+          msg: '流失原因为空'
+        };
+      }
+    } else if (this.data.radio_follow_up == 5) {
+      if (!this.data.form.DesignUser) {
+        return {
+          flag: false,
+          msg: '设计师为空'
+        };
+      }
+      if (!this.data.form.InviteResult) {
+        return {
+          flag: false,
+          msg: '邀约结果为空'
+        };
+      }
+      if (this.data.form.InviteResult == '接受邀约' && !this.data.form.InviteTime) {
+        return {
+          flag: false,
+          msg: '服务时间为空'
+        };
+      }
+      if (this.data.form.InviteResult == '拒绝邀约' && !this.data.form.NextFollowTime) {
+        return {
+          flag: false,
+          msg: '提醒时间为空'
+        };
+      }
+    }
+
     return {
       flag: true,
       msg: '表单校验通过'
     }
   },
 
-
-
-
-
-
-
-
-
-
+    /**
+   * 客户名称
+   * @param {*} event 
+   */
+  onCustomerNameChange(event) {
+    let form = this.data.form
+    form.CustomerName = event.detail
+    this.setData({
+      form: form
+    })
+  },
   /**
-   * 下面的代码着实不到是干嘛的,但是也没敢删除 视图上也有相应事件
-   * 
+   * 跟进方式单选
+   * @param {} event 
    */
-  setDayMessage(e) {
-    let mess = ""
-    if (this.data.vMonday) {
-      mess += "周一,"
-    }
-    if (this.data.vThuesday) {
-      mess += "周二,"
-    }
-    if (this.data.vWednesday) {
-      mess += "周三,"
-    }
-    if (this.data.vThursday) {
-      mess += "周四,"
-    }
-    if (this.data.vFriday) {
-      mess += "周五,"
-    }
-    if (this.data.vSaturday) {
-      mess += "周六,"
-    }
-    if (this.data.vSunday) {
-      mess += "周天,"
+  onRadio_Follow_Up(event) {
+    if (this.data.EditFlag) { //编辑界面 不让修改跟进方式
+      return
     }
     this.setData({
-      mess: mess
-    })
+      radio_follow_up: event.detail,
+    });
   },
-  clickvMonday(e) {
+  /**
+   * 客户意向
+   */
+  showCustomerIntentionsPopup() {
     this.setData({
-      vMonday: !this.data.vMonday
-    })
-    this.setDayMessage()
+      customerIntentionsFlag: true
+    });
   },
-  clickvThuesday(e) {
+  /**
+   * 邀约进店的客户意向
+   */
+  showCustomerIntentionsPopupInvite() {
     this.setData({
-      vThuesday: !this.data.vThuesday
-    })
-    this.setDayMessage()
+      inviteFollowTypeFlag: true
+    });
   },
-  clickvWednesday(e) {
+  /**
+   * 流失原因
+   */
+  showLoseReason() {
     this.setData({
-      vWednesday: !this.data.vWednesday
-    })
+      loseReasonFlag: true
+    });
+  },
+  /**
+ * @desc : 下拉多选确定
+ * @author : 于继渤
+ * @date : 2022/5/26 12:16
+ */
+  mutiSearchAll(e) {
+    let id = e.currentTarget.id
+    let form = this.data.form
+    if (id === 'loseReason') {
+      form.loseReasonIds = e.detail.idList
+      form.loseReasonNames = e.detail.names
+      this.setData({
+        loseReasonFlag: false,
+        form: form
+      })
+    }
 
-    this.setDayMessage()
   },
-  clickvThursday(e) {
+  /**
+ * @desc : 下拉多选关闭
+ * @author : 于继渤
+ * @date : 2022/5/26 12:16
+ */
+  muticloseAll(e) {
+    let id = e.currentTarget.id
+    if (id === 'loseReason') {
+      this.setData({
+        loseReasonFlag: false
+      })
+    }
+  },
+  /**
+   * 邀约结果
+   */
+  showInviteResultPopup() {
     this.setData({
-      vThursday: !this.data.vThursday
-    })
-
-    this.setDayMessage()
+      inviteResultFlag: true
+    });
   },
-  clickvFriday(e) {
+  /**
+   * 跟进方式
+   */
+  showFollowTypePopup() {
     this.setData({
-      vFriday: !this.data.vFriday
-    })
-    this.setDayMessage()
+      followTypeFlag: true
+    });
   },
-  clickvSaturday(e) {
+  /**
+   * 设计师
+   */
+  showDesignPopup() {
     this.setData({
-      vSaturday: !this.data.vSaturday
-    })
-    this.setDayMessage()
+      designFlag: true
+    });
   },
-  clickvSunday(e) {
+
+  /**
+   *手风琴 复选框 数据源监听事件
+   */
+  onDataChange(e) {
     this.setData({
-      vSunday: !this.data.vSunday
+      specsList: e.detail.dataList
     })
-    this.setDayMessage()
   },
-  clickWeekValue(e) {
+  //组件单选确定
+  mutiSearch(e) {
+    let id = e.target.id
+    let form = this.data.form
+    if (id === 'customerIntentions') {
+      form.CustomerIntentionsName = e.detail.name
+    }
+    if (id === 'followType') {
+      form.FollowTypeName = e.detail.name
+
+    }
+    if (id === 'other') {
+      let specsList = this.data.specsList
+      specsList[this.data.otherIndex].id = e.detail.id
+      specsList[this.data.otherIndex].name = e.detail.name
+      this.setData({
+        specsList
+      })
+    }
+    if (id === 'staff') {
+      form.DesignUser = e.detail.name
+      form.DesignUserId = e.detail.id
+      form.staffQvUserId = e.detail.qvUserid
+    }
+    //邀约结果
+    if (id === 'inviteResult') {
+      form.InviteResult = e.detail.name
+    }
     this.setData({
-      weekValueitem: e.target.dataset.item
+      form: form
+    })
+
+    if (form.CustomerIntentionsName == '已流失') {
+      this.setData({
+        competitionBrandFlag: true,
+        nextFollowTimeFlag: false,
+      })
+    } else if (form.CustomerIntentionsName == '放入公海') {
+      this.setData({
+        nextFollowTimeFlag: false,
+      })
+    } else {
+      this.setData({
+        competitionBrandFlag: false,
+        nextFollowTimeFlag: true,
+      })
+    }
+
+    if (form.InviteResult == '接受邀约') {
+      this.setData({
+        nextFollowTimeFlag: false,
+        inviteTimeFlag: true,
+      })
+    } else if (form.InviteResult == '拒绝邀约') {
+      this.setData({
+        nextFollowTimeFlag: true,
+        inviteTimeFlag: false,
+      })
+    }
+  },
+
+  /** 
+   * 通过cpid 外部联系人userid 查询客户
+   * @param {*} cpid 
+   */
+  getCurExternalContact(cpid) {
+    let that = this
+    // 需要从特定入口进入页面才可调用 
+    // 获取当前外部联系人userid
+    wx.qy.getCurExternalContact({
+      success: function (res) {
+        var userId = res.userId //返回当前外部联系人userId
+
+        let param = {
+          qvExternalUserid: userId,
+          cpId: cpid,
+        }
+        api.request(Constants.SALE_CUSTOMER_API + 'select_customer_detail', 'POST', param).then(res => {
+          if (res.data.code === 200) {
+            let form = that.data.form || {}
+            let item = res.data.data
+            form.CustomerId = item.customerId
+            form.CustomerName = item.customerName
+            form.CustomerPhone = item.customerPhone
+            form.addressName = item.addressName
+            form.addressArea = item.addressArea
+            form.AddressNo = item.addressNo
+            form.addressFull = item.addressFull
+            form.qvExternalUserid = item.qvExternalUserid
+            form.qvChatId = item.qvChatId
+            form.qvUserid = app.globalData.user.qvUserid
+            form.saleStatus = item.saleStatus
+            form.noTelephone = false;
+            if (form.qvExternalUserid && !form.CustomerPhone) {
+              form.noTelephone = true;
+            }
+            that.setData({
+              form: form,
+              loading: false,
+            })
+          }
+        })
+      },
+      fail: function (res) {
+      }
+    });
+  },
+
+  /**
+   * 解密当前用户信息数据后 返回改用户的cpid
+   * @param {*} e 
+   */
+  onBindGetEnterpriseUserInfo: function (e) {
+    let that = this
+    wx.qy.getEnterpriseUserInfo({
+      success: function (res) {
+        let param = {
+          encrypted: res.encryptedData,
+          sessionKey: app.globalData.code_to_session.session_key,
+          iv: res.iv,
+        }
+        api.request(Constants.SALE_CUSTOMER_API + 'wx_decrypt_customer_return_cpid', 'POST', param).then(res => {
+          if (res.data.code === 200) {
+            let cpid = res.data.data;
+            that.getCurExternalContact(cpid);
+          }
+        })
+      },
+      fail: function (res) {
+      }
     })
-    weekValue[e.target.dataset.item] = true
   },
 
-  setMessage() {
-    let mess = "每隔" + this.data.stepper + "天重复"
-    if (this.data.skipSaturday) {
-      mess += ",跳过周六重复"
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    if (app.globalData.user == undefined) { //如果 user为空 跳回登录页再重新进入本页面获取
+      wx.reLaunch({
+        url: 'pages/login/login?loginType=5',
+      })
+      return
     }
-    if (this.data.skipSunday) {
-      mess += ",跳过周天重复"
+
+    let customerfollowup = wx.getStorageSync('customer-follow-up')
+
+    if (options.customerFlag === "true") { //客户详细界面过来的进
+      // let item = JSON.parse(options.item)
+      let item = JSON.parse(decodeURIComponent(options.item))
+      let form = this.data.form
+      form.CustomerId = item.customerId
+      form.CustomerName = item.customerName
+      form.CustomerPhone = item.customerPhone
+      form.addressName = item.addressName
+      form.addressArea = item.addressArea
+      form.AddressNo = item.addressNo
+      form.FollowUpContent = item.followData
+      form.CustomerIntentionsName = item.intention
+      form.FollowTypeName = item.followType
+      form.NextFollowUpPlan = item.nextFollowPlan
+      form.NextFollowTime = item.nextFollowTime
+      form.InviteResult = item.inviteResult
+      form.InviteTime = item.inviteTime
+      form.qvExternalUserid = item.qvExternalUserid
+      form.noTelephone = false;
+      if (form.qvExternalUserid && !form.CustomerPhone) {
+        form.noTelephone = true;
+      }
+      let radio_follow_up = ''
+      if (item.followStatus == "跟进状态-跟进") {
+        radio_follow_up = '1'
+      }
+      if (item.followStatus == "跟进状态-邀约") {
+        radio_follow_up = '3'
+      }
+      if (item.followStatus == "跟进状态-约尺") {
+        radio_follow_up = '5'
+      }
+      this.setData({
+        form: form,
+        radio_follow_up,
+        fileList: item.annexPaths ? item.annexPaths.annexPaths : [],
+        customerFlag: options.customerFlag
+      })
     }
+    if (options.flg === "true") { //ture 为编辑  false 为新建 
+      // let item = JSON.parse(options.item)
+      let item = JSON.parse(decodeURIComponent(options.item))
+      let form = this.data.form
+      form.CustomerId = item.customerId
+      form.CustomerName = item.customerName
+      form.CustomerPhone = item.customerPhone
+      form.addressName = item.addressName
+      form.addressArea = item.addressArea
+      form.AddressNo = item.addressNo
+      form.addressFull = item.addressFull
+      form.CustomerIntentionsName = item.intentionName
+      form.CompetitionBrand = item.competitiveBrands
+      form.FollowTypeName = item.followTypeName
+      form.FollowUpContent = item.followData
+      form.NextFollowUpPlan = item.nextFollowPlan
+      form.NextFollowTime = item.nextFollowTime
+      form.saleStatus = item.saleStatus
+      if (item.inviteResult) {
+        if (item.inviteResult == '邀约结果-接受') {
+          form.InviteResult = '接受邀约'
+        } else if (item.inviteResult == '邀约结果-拒绝') {
+          form.InviteResult = '拒绝邀约'
+        }
+      }
+      form.InviteTime = item.inviteTime
+      form.DesignUserId = item.designUser
+      form.DesignUser = item.designName
+      form.FollowId = item.followId
+      form.qvExternalUserid = item.qvExternalUserid
+      form.qvChatId = item.qvChatId
+      form.qvUserid = app.globalData.user.qvUserid
+      form.noTelephone = false;
+      if (form.qvExternalUserid && !form.CustomerPhone) {
+        form.noTelephone = true;
+      }
+      let fileList = options.fileList ? JSON.parse(options.fileList) : []
+      let radio_follow_up = ''
+
+      if (item.followStatus == "跟进状态-跟进") {
+        radio_follow_up = '1'
+      }
+      if (item.followStatus == "跟进状态-邀约") {
+        radio_follow_up = '3'
+      }
+      if (item.followStatus == "跟进状态-约尺") {
+        radio_follow_up = '5'
+      }
+      this.setData({
+        form: form,
+        item,
+        EditFlag: true,
+        radio_follow_up,
+        fileList
+      })
+    } else if (options.flg === "false") {
+      // let item = JSON.parse(options.item)
+      let item = JSON.parse(decodeURIComponent(options.item))
+      let form = this.data.form
+      form.CustomerId = item.customerId
+      form.CustomerName = item.customerName
+      form.CustomerPhone = item.customerPhone
+      form.addressName = item.addressName
+      form.addressArea = item.addressArea
+      form.AddressNo = item.addressNo
+      form.addressFull = item.addressFull
+      form.qvExternalUserid = item.qvExternalUserid
+      form.qvChatId = item.qvChatId
+      form.qvUserid = app.globalData.user.qvUserid
+      form.saleStatus = item.saleStatus
+      form.noTelephone = false;
+      if (form.qvExternalUserid && !form.CustomerPhone) {
+        form.noTelephone = true;
+      }
+      this.setData({
+        form: form,
+      })
+    } else {
+      this.getCurExternalContact(app.globalData.user.cpId)
+    }
+    this.getGoodsSpecs()
+  },
+
+  /**
+     * 加载数据
+     * @param {*} options 
+     */
+  initData(options) {
+    // 清除登录信息 user
+    app.globalData.user = null;
     this.setData({
-      mess: mess
+      loading: true,
+    })
+    let param = {
+      corpid: config.corpid, //'ww796c5d1684937b2f', //先用集团的id
+      corpsecret: config.corpsecret,//'19mqS_rUn8YzK47LUmjIDEl6PAx1gcn9v0BRIbEAJXU', //集团
+    }
+    //校验企业id和应用corpsecret是否正确
+    app.qy_login_is_true(param).then(res => {
+      //  解密当前用户信息数据后 返回改用户的cpid
+      // 在查询客户信息
+      this.onBindGetEnterpriseUserInfo();
     })
   },
-  onChangeSunday(e) {
+  /**
+   * 提醒时间展开
+   * 
+   */
+  onChangePickDate() {
     this.setData({
-      skipSunday: e.detail
+      show: true,
+      nextFollowTimeSearch: new Date().getTime() + 100
     })
-    this.setMessage()
   },
-  onChangeSaturday(e) {
+  /**
+   * 提醒时间
+   * @param {} e 
+   */
+  onConfirmChooseDate(e) {
+    let form = this.data.form
+    form.NextFollowTime = util.formatDataTime(new Date(this.data.nextFollowTimeSearch))
     this.setData({
-      skipSaturday: e.detail
+      form: form,
+      show: false
     })
-    this.setMessage()
   },
-  onChangeStepper(e) {
+  /**
+   * 提醒时间关闭
+   * 
+   */
+  onCloseChooseDate() {
     this.setData({
-      stepper: e.detail
+      show: false
     })
-    this.setMessage()
 
+
+  },
+  /**
+   * 页面取消
+   */
+  cancle() {
+    wx.navigateBack({
+      delta: -1
+    });
+  },
+  /**
+   * 邀约到店时间展示
+   */
+  onChangePickDate_Month() {
+    this.setData({
+      show_Month: true
+    })
   },
-  clickDay(e) {
+  /**
+   * 邀约到店时间关闭
+   */
+  onCloseChooseDate_Month() {
     this.setData({
-      dayWeekFlg: true,
-      mess: '请选择'
+      show_Month: false
     })
   },
-
-  clickWeek(e) {
+  /**
+   * 邀约到店时间确定
+   */
+  onConfirmChooseDate_Month() {
+    let form = this.data.form
+    form.InviteTime = util.formatDataTime(new Date(this.data.inviteTimeSearch))
     this.setData({
-      dayWeekFlg: false,
-      mess: '请选择'
+      form: form,
+      show_Month: false
     })
   },
 
-  selectPeriodOk(e) {
+  /**
+   * @desc : 标识日期变化事件
+   * @author : 秦祺
+   * @date : 2022/5/26 17:16
+   */
+  changeDate(e) {
+    let key = e.currentTarget.dataset.key
+    if (key === 'inviteTime') {
+      this.setData({
+        inviteTimeSearch: e.detail
+      })
+    }
+    //提醒时间
+    if (key === 'nextFollowTime') {
+      this.setData({
+        nextFollowTimeSearch: e.detail
+      })
+    }
+
+  },
+
+  /**
+   * 客户名称跳转客户详细
+   */
+  test01(e) {
+    if (this.data.customerFlag) {
+      return
+    }
+    wx.navigateTo({
+      url: '/package3/pages/customer/detail/detail?ID=' + JSON.stringify(e.currentTarget.dataset.item.CustomerId),
+    })
+  },
+  /**
+   * 意向品类勾选
+   * @param {*} event 
+   */
+  checkBoxChange(event) {
+    this.setData({
+      result: event.detail,
+    });
+  },
+  /**
+* @desc : 联系电话输入事件
+* @author : 于继渤
+* @date : 2022/5/24 12:16
+*/
+  changeCustomerFormFieldPhone(e) {
+    let key = e.detail.currentTarget.dataset.key
+    let form = this.data.form
+    form.CustomerPhone = e.detail.detail
     this.setData({
-      selectPeriodFlg: false
+      form: form
     })
   },
-  selectPeriodCancel(e) {
+  /**
+   * 输入框 文字改变监听事件
+   */
+  fieldChange(e) {
+    let form = this.data.form
+    let type = e.currentTarget.dataset.key
+    if (type === "name") {
+      form.customerName = e.detail
+    }
+    if (type === "tephone") {
+      form.CustomerPhone = e.detail
+    }
+    if (type === "address") {
+      form.addressName = e.detail
+    }
+    if (type === "result") {
+      form.AddressNo = e.detail
+    }
+    if (type === "ortherName") {
+      form.ortherName = e.detail
+    }
+    if (type === "ortherPhone") {
+      form.ortherPhone = e.detail
+    }
     this.setData({
-      selectPeriodFlg: false
+      form: form
     })
   },
 })

+ 3 - 3
package-basic-data/pages/customer-follow-up/customer-follow-up.json

@@ -1,4 +1,4 @@
 {
-    "usingComponents": {},
-    "navigationBarTitleText": "跟进任务"
-  }
+  "usingComponents": {},
+  "navigationBarTitleText": "新增跟进"
+}

+ 473 - 91
package-basic-data/pages/customer-follow-up/customer-follow-up.wxml

@@ -4,117 +4,463 @@
 <view style="display:none">{{wxmlUtil.setNumberOfDecimalPlacesAmount(numberOfDecimalPlacesAmount)}}</view>
 
 <loading wx:if="{{loading}}" loadingName="加载中" backgroundColor="#f2f2f2;" opacity="0.8"></loading>
+<view style="padding-top: 21rpx;">
 
+  <van-cell-group>
+    <!-- 单据信息 -->
+    <view>
 
-<view class="table-show">
-  <view class="table-show-detail">
 
-    <van-cell-group>
-      <!-- 单据信息 -->
-      <view>
-        <van-field label="客户" data-index="{{index}}" label-class="red-label" readonly value="{{ form.CustomerName }}"
-          is-link data-key="customerName" input-align="left" maxlength="200" placeholder="请选择" border="{{ false }}"
-          bind:blur="changeField" />
+      <view class="dk-card-outer-class" style="border-radius: 15rpx;">
+        <view class="dk-card-class">
+          <van-radio-group value="{{ radio_follow_up }}"
+            style="display:flex;background:white; padding-left: 40rpx;border-radius: 15rpx;"
+            bind:change="onRadio_Follow_Up">
+            <view style="flex: 1;">
+              <van-radio name="1" style="margin: 5vw;font-size: 14px; font-weight: bold;" checked-color="#1B365D">日常跟进
+              </van-radio>
+            </view>
+            <view style="flex: 1;">
+              <van-radio name="3" style="margin: 5vw;font-size: 14px; font-weight: bold;" checked-color="#1B365D">邀约进店
+              </van-radio>
+            </view>
+            <view style="flex: 1;">
+              <van-radio name="5" style="margin: 5vw;font-size: 14px; font-weight: bold;" checked-color="#1B365D">预约量尺
+              </van-radio>
+            </view>
+          </van-radio-group>
+        </view>
 
-        <van-field label="业务员" data-index="{{index}}" readonly value="{{ form.reportUserName }}" is-link
-          data-key="staffName" input-align="left" maxlength="200" placeholder="请选择" border="{{ false }}"
-          catchtap="openStaffDropdown" />
+      </view>
 
-        <van-field rows="5" autosize label="下次跟进计划" value="{{form.NextFollowPlan}}" type="textarea" maxlength="1000"
-          placeholder="请输入下次跟进计划" show-word-limit input-class="input-class" bind:change="onMeasureRemarksChange" border="{{false}}"/>
 
-   
+      <view class="dk-card-outer-class">
+        <view class="dk-card-class">
+          <!-- 日常跟进 -->
+          <view wx:if="{{radio_follow_up == 1}}">
+            <!-- 客户名称 EditFlag-->
+            <!-- <van-cell title-class="red-label" title="客户名称" value="" title-width="101px" use-label-slot
+              value-class="valueName-class" border="{{false}}">
+              <view Cell Slot="use-label-slot" style="text-align: left;width: 50%;color:#1B365D; white-space:nowrap"
+                catchtap="test01" data-item="{{form}}">{{ form.CustomerName }}</view>
+              <view Cell Slot="right-icon" style="text-align: right;width: 50%; ">
+                <view catchtap="onChooseCustomerClear" style="justify-content: space-between;flex-flow: row nowrap;">
 
-        <van-field   readonly="{{ true }}"label-width="29%"  label-class="red-label" value="{{ form.NextFollowTime }}"  input-align="left"   label="下次跟进时间" placeholder="请选择下次跟进时间"  
-                    border="{{ false }}"  catchtap="onChangePickDate"  is-link  value-class="PickDate_Month"/>
-      </view>
-    </van-cell-group>
+                  <view catchtap="onnavigateToAddCustomer" slot="button" style="text-align: right; "
+                    wx:if="{{!form.qvExternalUserid}}">
+                    <view style="justify-content: flex-end;flex-flow: row nowrap;display: flex;">
+                      <view>
+                        <image src="../../../../static/image/wx.png" style="width:38rpx;height:38rpx;" />
+                      </view>
+                    </view>
+                  </view>
 
-  </view>
 
-</view>
+                </view>
+              </view>
+            </van-cell> -->
+            <van-field label="客户名称" data-index="{{index}}" label-class="red-label" value="{{ form.CustomerName }}" data-key="customerName" input-align="left" maxlength="50" placeholder="请输入客户名称" border="{{ false }}" bind:change="onCustomerNameChange" use-button-slot>
+          <view slot="button" style="text-align: right; ">
+            <view catchtap="onChooseCustomerClear" style="justify-content: space-between;flex-flow: row nowrap;display: flex;">
+              <view style="width: 10rpx;"></view>
+              <view catchtap="onnavigateToAddCustomer" slot="button" style="text-align: right; ">
+                <view style="justify-content: flex-end;flex-flow: row nowrap;display: flex;">
+                  <view>
+                    <image src="/static/image/wx.png" style="width:38rpx;height:38rpx;" />
+                  </view>
+                </view>
+              </view>
+            </view>
+          </view>
+        </van-field>
+            <!-- 联系电话 -->
+            <!-- <van-field label="联系电话" data-index="{{index}}" disabled="{{EditFlag}}" label-class="red-label"
+              copyValue="{{form.CustomerPhone}}" value="{{ form.CustomerPhone }}" data-key="tephone" input-align="left"
+              maxlength="50" placeholder="请输入联系电话" border="{{ false }}" bind:blur="changeField"
+              bind:click-icon="onClickphone" use-button-slot type="number" bind:change="fieldChange">
+              <view slot="button" style="text-align: right; ">
+                <view catchtap="onClickphone" data-telephone="{{ form.CustomerPhone }}"
+                  style="justify-content: space-between;flex-flow: row nowrap;display: flex;">
+                  <view>
+                    <van-icon name="phone" color="#1B365D" size="38rpx" />
+                  </view>
+                </view>
+              </view>
+            </van-field> -->
 
+            <!-- 联系电话 -->
+            <dk-number-phone-input  dataKey="phone" value="{{form.CustomerPhone}}"
+              bind:changeField="changeCustomerFormFieldPhone" bind:changeFieldblur="blurCustomerPhone"
+              errorMessage="联系电话格式错误" bind:click-icon="onClickphone" labelClass="{{form.noTelephone ? '' : 'red-label'}}" rightIcon="phone" label="客户电话"
+              placeholder="请输入客户电话">
+            </dk-number-phone-input>
 
-<!-- 抽屉 -->
-<van-popup show="{{selectPeriodFlg}}" position="bottom" bind:close="onClose" custom-style="height:50%;width:100%">
-  <view style="display: flex;justify-content: space-between;align-items: center;">
-    <view style="text-align: center;margin:10px;font-size: 14px;color: rgba(131, 128, 128, 0.705);"
-      catchtap="selectPeriodCancel">取消</view>
-    <view style="text-align: center;margin-top: 10px;margin-bottom: 10px;">周期</view>
-    <view style="text-align: center;margin:10px;font-size: 14px;" catchtap="selectPeriodOk">确定</view>
-  </view>
+            <!-- 客户地址 -->
+            <van-field catchtap="onClickWxchartAddress" readonly="{{true}}"
+              value="{{ wxmlUtil.addressToIndexOf((form.addressArea.province?form.addressArea.province:'') +  (form.addressArea.city?form.addressArea.city:'') + (form.addressArea.district?form.addressArea.district:'') + (form.addressName?form.addressName:'')) }}"
+              input-align="left" label="客户地址" placeholder="请输入客户地址" autosize border="{{false}}" bind:change="change"
+              use-button-slot>
+              <view slot="button" style="text-align: right; ">
+                <view style="justify-content: space-between;flex-flow: row nowrap;display: flex;">
+                  <view>
+                    <van-icon name="location" color="#95A8CB" size="38rpx" />
+                  </view>
+                </view>
+              </view>
+            </van-field>
 
-  <view style="width: 100%; background-color: rgba(192, 191, 191, 0.37);  height: 1rpx;"></view>
-  <view style="width: 100%; ">
-    <van-button custom-style="width:120px;margin:10px" plain type="{{dayWeekFlg?'info':'default'}}" size="small"
-      catchtap="clickDay">每天
-    </van-button>
-    <van-button custom-style="width:120px;margin:10px" plain type="{{!dayWeekFlg?'info':'default'}}" size="small"
-      catchtap="clickWeek">每周
-    </van-button>
-  </view>
+            <!-- 门牌号 -->
+            <van-field label="门牌号" data-index="{{index}}" value="{{form.AddressNo}}"
+              data-key="result" input-align="lef" maxlength="200" border="{{ false }}"
+              bind:change="onAddressNoChange" />
 
-  <view
-    style="width: 100%; height: 25px;background-color: blanchedalmond;font-size: 11px;color: lightsalmon;display: flex;align-items: center;padding-left: 15px;">
-    {{mess}}
-  </view>
+             <!-- 客户意向 -->
+             <van-field   readonly="{{ true }}" label-class="red-label" value="{{ form.CustomerIntentionsName }}" input-align="left"label-width="180rpx"  label="客户意向" placeholder="请选择"  
+                    border="{{ false }}"  data-type='CustomerIntentions'  catchtap="showCustomerIntentionsPopup"  is-link />
+            
+            <!-- 流失原因 -->
+            <view wx:if="{{competitionBrandFlag}}">
+              <van-field  readonly="{{ true }}" label-class="red-label" value="{{ form.loseReasonNames }}" input-align="left"label-width="180rpx"  label="流失原因" placeholder="请选择"  
+                    border="{{ false}}"  data-type='CustomerLoseReason'  catchtap="showLoseReason"  is-link />
+            </view>
+
+            <!-- 竞品品牌 -->
+            <view wx:if="{{competitionBrandFlag}}">
+              <van-field value="{{ form.CompetitionBrand }}" input-align="left" label="竞品品牌"
+                placeholder="请输入竞品品牌" autosize border="{{ false }}" bind:change="onCompetitionBrandChange">
+              </van-field>
+            </view>
+
+            <!-- 手风琴,复选框输入 showOtherFlag :是否显示其他分类    showFieldFlag:是否显示输入框 
+          disabledFlag:输入框是否输入 checkboxClinkFlag:box能否点动-->
+            <dk-accordion-box titleName="意向品类" dataList="{{specsList}}" bind:onDataChange="onDataChange"
+              showOtherFlag="{{true}}" showFieldFlag="{{true}}" disabledFlag="{{false}}" checkboxClinkFlag="{{true}}">
+            </dk-accordion-box>
+
+            <!-- 跟进方式 -->
+              <van-field   readonly="{{ true }}" label-class="red-label" value="{{ form.FollowTypeName }}" input-align="left"label-width="180rpx"  label="跟进方式" placeholder="请选择"  
+                    border="{{ false }}"  data-type='FollowType'  catchtap="showFollowTypePopup"  is-link />
+
+            <!-- 跟进内容 -->
+            <van-field rows="5" autosize label="跟进内容" label-class="red-label" value="{{ form.FollowUpContent }}"
+              type="textarea" maxlength="1000" placeholder="请输入跟进内容" show-word-limit input-class="input-class" 
+              bind:change="onFollowUpContentChange" border="{{false}}" />
+            <van-field rows="5" autosize label="下次跟进计划" type="textarea" maxlength="1000"
+              value="{{ form.NextFollowUpPlan }}" placeholder="请输入下次跟进计划" show-word-limit input-class="input-class"
+              bind:change="onNextFollowUpPlanChange" border="{{false}}" />
+            <!-- <van-cell is-link title-class="red-label" value-class="PickDate_Month" title-width="29%" border="{{ true }}" catchtap="onChangePickDate" title="提醒时间" value="{{form.NextFollowTime ? form.NextFollowTime :'请选择'  }}" /> -->
+         
+
+              <van-field  readonly="{{ true }}"label-width="29%"  label-class="{{nextFollowTimeFlag ? 'red-label': ''}}" value="{{ form.NextFollowTime }}" value-class="PickDate_Month" input-align="left"   label="提醒时间" placeholder="请选择提醒时间"      border="{{ false }}"   catchtap="onChangePickDate"  is-link />
+            
+
+
+            <!-- 图片 -->
+            <view style="padding-left:32rpx;padding-top:11rpx;display:flex;background: white;">
+              <view>
+                <view style="font-size:14px;color: black; margin-bottom: 10px; color: #95A8CB;">
+                  图片
+                </view>
+                <van-uploader max-count="5" accept="image" style="margin-left: 4%;" preview-size="160rpx;"
+                  file-list="{{ fileList }}" bind:delete="deleteImg" bind:after-read="afterRead" multiple="true"
+                  imageFit="aspectFit" />
+                <view style="font-size:10px;color: #95A8CB; margin-bottom: 10px;">
+                  图片最多上传5张
+                </view>
+              </view>
+            </view>
+          </view>
+
+          <!-- 邀约进店 -->
+          <view wx:if="{{radio_follow_up == 3}}">
+            <!-- 客户名称 -->
+            <!-- <van-cell title-class="red-label" title="客户名称" value="" title-width="101px" use-label-slot
+              value-class="valueName-class" border="{{false}}">
+              <view Cell Slot="use-label-slot" style="text-align: left;width: 50%; color:#1B365D;white-space:nowrap"
+                data-item="{{form}}" catchtap="test01">{{ form.CustomerName }}</view>
+              <view Cell Slot="right-icon" style="text-align: right;width: 50%; ">
+                <view catchtap="onChooseCustomerClear" style="justify-content: space-between;flex-flow: row nowrap;">
+                  <view catchtap="onnavigateToAddCustomer" slot="button" style="text-align: right; "
+                    wx:if="{{!form.qvExternalUserid}}">
+                    <view style="justify-content: flex-end;flex-flow: row nowrap;display: flex;">
+                      <view>
+                        <image src="../../../../static/image/wx.png" style="width:38rpx;height:38rpx;" />
+                      </view>
+                    </view>
+                  </view>
+                </view>
+              </view>
+            </van-cell> -->
+
+            <van-field label="客户名称" data-index="{{index}}" label-class="red-label" value="{{ form.CustomerName }}" data-key="customerName" input-align="left" maxlength="50" placeholder="请输入客户名称" border="{{ false }}" bind:change="onCustomerNameChange" use-button-slot>
+          <view slot="button" style="text-align: right; ">
+            <view catchtap="onChooseCustomerClear" style="justify-content: space-between;flex-flow: row nowrap;display: flex;">
+              <view style="width: 10rpx;"></view>
+              <view catchtap="onnavigateToAddCustomer" slot="button" style="text-align: right; ">
+                <view style="justify-content: flex-end;flex-flow: row nowrap;display: flex;">
+                  <view>
+                    <image src="/static/image/wx.png" style="width:38rpx;height:38rpx;" />
+                  </view>
+                </view>
+              </view>
+            </view>
+          </view>
+        </van-field>
+
+            <!-- 联系电话 -->
+            <!-- <van-field label="联系电话" data-index="{{index}}" disabled="{{EditFlag}}" label-class="red-label"
+              copyValue="{{form.CustomerPhone}}" value="{{ form.CustomerPhone }}"
+              data-telephone="{{ form.CustomerPhone }}" data-key="tephone" input-align="left" maxlength="50"
+              placeholder="请输入联系电话" border="{{ false }}" bind:blur="changeField" bind:click-icon="onClickphone"
+              use-button-slot type="number" bind:change="fieldChange">
+              <view slot="button" style="text-align: right; ">
+                <view catchtap="onClickphone" data-telephone="{{ form.CustomerPhone }}"
+                  style="justify-content: space-between;flex-flow: row nowrap;display: flex;">
+                  <view>
+                    <van-icon name="phone" color="#1B365D" size="38rpx" />
+                  </view>
+                </view>
+              </view>
+            </van-field> -->
+
+            <!-- 联系电话 -->
+            <dk-number-phone-input  dataKey="phone" value="{{form.CustomerPhone}}"
+              bind:changeField="changeCustomerFormFieldPhone" bind:changeFieldblur="blurCustomerPhone"
+              errorMessage="联系电话格式错误" bind:click-icon="onClickphone" labelClass="{{form.noTelephone ? '' : 'red-label'}}" rightIcon="phone" label="客户电话"
+              placeholder="请输入客户电话"></dk-number-phone-input>
+
+
+            <!-- 客户地址 -->
+            <van-field catchtap="onClickWxchartAddress" readonly="{{true}}"
+              value="{{ wxmlUtil.addressToIndexOf((form.addressArea.province?form.addressArea.province:'') +  (form.addressArea.city?form.addressArea.city:'') + (form.addressArea.district?form.addressArea.district:'') + (form.addressName?form.addressName:''))  }}"
+              input-align="left" label="客户地址" placeholder="请输入客户地址" autosize border="{{ false }}" bind:change="change"
+              use-button-slot>
+              <view slot="button" style="text-align: right; ">
+                <view style="justify-content: space-between;flex-flow: row nowrap;display: flex;">
+                  <view catchtap="onClickWxchartAddress">
+                    <van-icon name="location" color="#95A8CB" size="38rpx" />
+                  </view>
+                </view>
+              </view>
+            </van-field>
+
+            <!-- 门牌号 -->
+            <van-field label="门牌号"  data-index="{{index}}" value="{{form.AddressNo}}"
+              data-key="result" border="{{ false }}" bind:change="onAddressNoChange" />
+      
+
+                <!-- 邀约结果 -->
+             <van-field   readonly="{{ true }}" label-class="red-label" value="{{ form.InviteResult }}" input-align="left"label-width="180rpx"  label="邀约结果" placeholder="请选择"  
+                    border="{{ false }}"  data-type='InviteResult'  catchtap="showInviteResultPopup"  is-link />
+
+            <!-- 邀约到店时间 -->
+              <van-field  readonly="{{ true }}"label-width="29%"  label-class="{{inviteTimeFlag ? 'red-label': ''}}" value="{{ form.InviteTime }}" value-class="PickDate_Month" input-align="left"   label="邀约到店时间" placeholder="请选择"      border="{{ false }}"   catchtap="onChangePickDate_Month"  is-link />
+
+            <!-- 客户意向 -->
+              <van-field   readonly="{{ true }}" label-class="red-label" value="{{ form.CustomerIntentionsName }}" input-align="left"label-width="180rpx"  label="客户意向" placeholder="请选择"  
+                    border="{{ false }}"  data-type='CustomerIntentions'  catchtap="showCustomerIntentionsPopupInvite"  is-link />
+            
+            <!-- 流失原因 -->
+              <view wx:if="{{competitionBrandFlag}}">
+              <van-field  readonly="{{ true }}" label-class="red-label" value="{{ form.loseReasonNames }}" input-align="left"label-width="180rpx"  label="流失原因" placeholder="请选择"  
+                    border="{{ false}}"  data-type='CustomerLoseReason'  catchtap="showLoseReason"  is-link />
+            </view>
+
+            <!-- 竞品品牌 -->
+            <view wx:if="{{competitionBrandFlag}}">
+              <van-field value="{{ form.CompetitionBrand }}" input-align="left" label="竞品品牌"
+                placeholder="请输入竞品品牌" autosize border="{{ false }}" bind:change="onCompetitionBrandChange">
+              </van-field>
+            </view>
+
+            <!-- 跟进内容 -->
+            <van-field rows="5" autosize label="跟进内容" label-class="red-label" value="{{ form.FollowUpContent }}"
+              type="textarea" maxlength="1000" placeholder="请输入跟进内容" show-word-limit input-class="input-class"
+              bind:change="onFollowUpContentChange" border="{{false}}" />
+            <van-field rows="5" autosize label="下次跟进计划" type="textarea" maxlength="1000"
+              value="{{ form.NextFollowUpPlan }}" placeholder="请输入下次跟进计划" show-word-limit input-class="input-class"
+              bind:change="onNextFollowUpPlanChange" border="{{false}}" />
+            <!-- 提醒时间 -->
+            <!-- <van-cell is-link title-class="red-label" value-class="PickDate_Month" title-width="29%" border="{{ true }}" catchtap="onChangePickDate" title="提醒时间" value="{{form.NextFollowTime ? form.NextFollowTime :'请选择'  }}" /> -->
+         
+            <van-field  readonly="{{ true }}"label-width="29%"  label-class="{{nextFollowTimeFlag ? 'red-label': ''}}" value="{{ form.NextFollowTime }}" value-class="PickDate_Month" input-align="left"   label="提醒时间" placeholder="请选择提醒时间"      border="{{ false }}"   catchtap="onChangePickDate"  is-link />
+            
+
+            <!-- 图片 -->
+            <view style="padding-left:32rpx;padding-top:11rpx;display:flex;background: white;">
+              <view>
+                <view style="font-size:14px;color: black; margin-bottom: 10px; color: #95A8CB;">
+                  图片
+                </view>
+                <van-uploader max-count="5" accept="image" style="margin-left: 4%;" preview-size="160rpx;"
+                  file-list="{{ fileList }}" bind:after-read="afterRead" multiple="true" imageFit="aspectFit" />
+                <view style="font-size:10px;color: #95A8CB; margin-bottom: 10px;">
+                  图片最多上传5张
+                </view>
+              </view>
+            </view>
+          </view>
+
+          <!-- 预约量尺 -->
+          <view wx:if="{{radio_follow_up == 5}}">
+            <!-- 客户名称 -->
+            <!-- <van-cell title-class="red-label" title="客户名称" value="" title-width="101px" use-label-slot
+              value-class="valueName-class" border="{{false}}">
+              <view Cell Slot="use-label-slot" style="text-align: left;width: 50%;color:#1B365D;white-space:nowrap"
+                data-item="{{form}}" catchtap="test01">{{ form.CustomerName }}</view>
+              <view Cell Slot="right-icon" style="text-align: right;width: 50%; ">
+                <view catchtap="onChooseCustomerClear" style="justify-content: space-between;flex-flow: row nowrap;">
+                  <view catchtap="onnavigateToAddCustomer" slot="button" style="text-align: right; "
+                    wx:if="{{!form.qvExternalUserid}}">
+                    <view style="justify-content: flex-end;flex-flow: row nowrap;display: flex;">
+                      <view>
+                        <image src="../../../../static/image/wx.png" style="width:38rpx;height:38rpx;" />
+                      </view>
+                    </view>
+                  </view>
+                </view>
+              </view>
+            </van-cell> -->
+            <van-field label="客户名称" data-index="{{index}}" label-class="red-label" value="{{ form.CustomerName }}" data-key="customerName" input-align="left" maxlength="50" placeholder="请输入客户名称" border="{{ false }}" bind:change="onCustomerNameChange" use-button-slot>
+          <view slot="button" style="text-align: right; ">
+            <view catchtap="onChooseCustomerClear" style="justify-content: space-between;flex-flow: row nowrap;display: flex;">
+              <view style="width: 10rpx;"></view>
+              <view catchtap="onnavigateToAddCustomer" slot="button" style="text-align: right; ">
+                <view style="justify-content: flex-end;flex-flow: row nowrap;display: flex;">
+                  <view>
+                    <image src="/static/image/wx.png" style="width:38rpx;height:38rpx;" />
+                  </view>
+                </view>
+              </view>
+            </view>
+          </view>
+        </van-field> 
+            
+            <!-- 联系电话 -->
+            <!-- <van-field label="联系电话" data-index="{{index}}" label-class="red-label" disabled="{{EditFlag}}"
+              copyValue="{{form.CustomerPhone}}" value="{{ form.CustomerPhone }}"
+              data-telephone="{{ form.CustomerPhone }}" data-key="tephone" input-align="left" maxlength="50"
+              placeholder="请输入联系电话" border="{{ false }}" bind:blur="changeField" bind:click-icon="onClickphone"
+              use-button-slot type="number" bind:change="fieldChange">
+              <view slot="button" style="text-align: right; ">
+                <view catchtap="onClickphone" data-telephone="{{ form.CustomerPhone }}"
+                  style="justify-content: space-between;flex-flow: row nowrap;display: flex;">
+                  <view>
+                    <van-icon name="phone" color="#1B365D" size="38rpx" />
+                  </view>
+                </view>
+              </view>
+            </van-field> -->
+
+
+            <!-- 联系电话 -->
+            <dk-number-phone-input  dataKey="phone" value="{{form.CustomerPhone}}"
+              bind:changeField="changeCustomerFormFieldPhone" bind:changeFieldblur="blurCustomerPhone"
+              errorMessage="联系电话格式错误" bind:click-icon="onClickphone" labelClass="{{form.noTelephone ? '' : 'red-label'}}" rightIcon="phone" label="客户电话"
+              placeholder="请输入客户电话">
+            </dk-number-phone-input>
+
+
+            <!-- 客户地址 -->
+            <van-field catchtap="onClickWxchartAddress" readonly="{{true}}"
+              value="{{ wxmlUtil.addressToIndexOf((form.addressArea.province?form.addressArea.province:'') +  (form.addressArea.city?form.addressArea.city:'') + (form.addressArea.district?form.addressArea.district:'') + (form.addressName?form.addressName:''))  }}"
+              input-align="left" label="客户地址" placeholder="请输入客户地址" autosize border="{{ false }}" bind:change="change"
+              use-button-slot>
+              <view slot="button" style="text-align: right; ">
+                <view style="justify-content: space-between;flex-flow: row nowrap;display: flex;">
+                  <view>
+                    <van-icon name="location" color="#95A8CB" size="38rpx" />
+                  </view>
+                </view>
+              </view>
+            </van-field>
+            <van-field label="门牌号" data-index="{{index}}" value="{{form.AddressNo}}"
+              data-key="result" input-align="lef" maxlength="200" border="{{ false }}"
+              bind:change="onAddressNoChange" />
+
+            <!-- 设计师 -->
+            <view style="display: flex;">
+              <view style="flex: 1;">   
+             <van-field   readonly="{{ true }}" label-class="red-label" value="{{ form.DesignUser }}" input-align="left"label-width="180rpx"  label="设计师" placeholder="请选择"  
+                    border="{{ false }}"  data-type='DesignUser'  catchtap="showDesignPopup"  is-link />
+              </view>
+              <view slot="button" style="text-align:right;align-self:center;margin: 3vw;">
+                <view catchtap="openWeChat" style="justify-content: space-between;flex-flow: row nowrap;display: flex;"
+                  data-qvExternalUserid="{{form.qvExternalUserid}}" data-qvUserid="{{form.qvUserid}}"
+                  data-staffQvUserId="{{form.staffQvUserId}}" data-customerId="{{form.CustomerId}}"
+                  data-customerName="{{form.CustomerName}}" data-designUser="{{form.DesignUser}}">
+                  <!-- <view style="padding-right: 15rpx;">
+              <van-icon name="/static/image/wechat.png" color="#00C800" size="38rpx" />
+            </view> -->
+                  <view style="color: #00C800;font-size: 25rpx;">
+                    服务群
+                  </view>
+                </view>
+              </view>
+            </view>
+
+            <!-- 邀约结果 -->
+            <van-field   readonly="{{ true }}" label-class="red-label" value="{{ form.InviteResult }}" input-align="left"label-width="180rpx"  label="邀约结果" placeholder="请选择"  
+                    border="{{ false }}"  data-type='InviteResult'  catchtap="showInviteResultPopup"  is-link />
+      
+
+            <!-- 服务时间 -->
+            <van-field  readonly="{{ true }}"label-width="29%"  label-class="{{inviteTimeFlag ? 'red-label': ''}}" value="{{ form.InviteTime }}" value-class="PickDate_Month" input-align="left"   label="服务时间" placeholder="请选择"      border="{{ false }}"   catchtap="onChangePickDate_Month"  is-link />
+
+            <!-- 跟进内容 -->
+            <van-field rows="5" autosize label="跟进内容" label-class="red-label" type="textarea"
+              value="{{ form.FollowUpContent }}" maxlength="1000" placeholder="请输入跟进内容" 
+              input-class="input-class" bind:change="onFollowUpContentChange" border="{{false}}" />
+            <van-field rows="5" autosize label="下次跟进计划" type="textarea" value="{{ form.NextFollowUpPlan }}"
+              maxlength="1000" placeholder="请输入下次跟进计划"  input-class="input-class"
+              bind:change="onNextFollowUpPlanChange" border="{{false}}" />
+            <!-- <van-cell is-link title-class="red-label" value-class="PickDate_Month" title-width="29%" border="{{ true }}" catchtap="onChangePickDate" title="提醒时间" value="{{form.NextFollowTime ? form.NextFollowTime :'请选择'  }}" /> -->
+   
+            <van-field  readonly="{{ true }}"label-width="29%"  label-class="{{nextFollowTimeFlag ? 'red-label': ''}}" value="{{ form.NextFollowTime }}" value-class="PickDate_Month" input-align="left"   label="提醒时间" placeholder="请选择提醒时间"      border="{{ false }}"   catchtap="onChangePickDate"  is-link />
+            
+          </view>
+        </view>
 
-  <view wx:if="{{dayWeekFlg}}">
-    <van-cell title="间隔天数" border="{{true}}">
-      <view Slot="value">
-        <van-stepper integer="{{true}}" value="{{ stepper }}" bind:change="onChangeStepper" />
-      </view>
-    </van-cell>
-    <van-cell title="跳过周六" border="{{true}}">
-      <view Slot="value">
-        <van-switch checked="{{ skipSaturday }}" bind:change="onChangeSaturday" size="20px" />
-      </view>
-    </van-cell>
-    <van-cell title="跳过周日" border="{{true}}">
-      <view Slot="value">
-        <van-switch checked="{{ skipSunday }}" bind:change="onChangeSunday" size="20px" />
       </view>
-    </van-cell>
-  </view>
 
-  <view wx:if="{{!dayWeekFlg}}">
-    <van-button custom-style="width:46%;margin:2%" data-item="周一" plain type="{{vMonday?'info':'default'}}" size="small"
-      catchtap="clickvMonday">周一
-    </van-button>
-    <van-button custom-style="width:44%;margin:2%" data-item="周二" plain type="{{vThuesday?'info':'default'}}"
-      size="small" catchtap="clickvThuesday">周二
-    </van-button>
-    <van-button custom-style="width:46%;margin:2%" data-item="周三" plain type="{{vWednesday?'info':'default'}}"
-      size="small" catchtap="clickvWednesday">周三
-    </van-button>
-    <van-button custom-style="width:44%;margin:2%" data-item="周四" plain type="{{vThursday?'info':'default'}}"
-      size="small" catchtap="clickvThursday">周四
-    </van-button>
-    <van-button custom-style="width:46%;margin:2%" data-item="周五" plain type="{{vFriday?'info':'default'}}" size="small"
-      catchtap="clickvFriday">周五
-    </van-button>
-    <van-button custom-style="width:44%;margin:2%" data-item="周六" plain type="{{vSaturday?'info':'default'}}"
-      size="small" catchtap="clickvSaturday">周六
-    </van-button>
-    <van-button custom-style="width:44%;margin:2%" data-item="周天" plain type="{{vSunday?'info':'default'}}" size="small"
-      catchtap="clickvSunday">周天
-    </van-button>
+    </view>
+  </van-cell-group>
+  <view style="height:100px;">
   </view>
 
-</van-popup>
+  <!--  保存 -->
+  <!-- <view style="background:#f8f9fd;position:fixed;bottom:0;padding-bottom:20rpx;width:90%;margin-left:5%;border-top:2rpx solid #efefef;z-index:2">
+    <view style="display:flex;justify-content: space-around;width:100%;">
+      <view style="width:247rpx;height:88rpx; ">
+        <van-button custom-style="height:80rpx;width:100%;border-radius: 15rpx;border:1px solid #1B365D;color:#1B365D;" plain loading="{{loading}}" bind:click="cancle">取消
+        </van-button>
+      </view>
+      <view style="width:50%;height:80rpx; ">
+        <van-button color="#1B365D" custom-style="height:80rpx;width:100%;border-radius: 15rpx;" loading="{{loading}}" bind:click="submit" type="info">保存
+        </van-button>
+      </view>
+    </view>
+  </view> -->
 
-<!--  保存 -->
-<view style="background:#f8f9fd;position:fixed;bottom:0;padding-bottom:20rpx;width:90%;margin-left:5%;border-top:2rpx solid #efefef;z-index:2">
-  <view style="display:flex;justify-content: space-around;width:100%;">
-    <view style="width:640rpx;height:88rpx;">
-      <van-button color="#1B365D" custom-style="height:80rpx;width:100%;border-radius: 15rpx;"loading="{{loadingButtonFlag}}" disabled="{{loadingButtonFlag}}"bind:click="submit" type="info">保存
-      </van-button>
+  <view class="botton-class">
+    <view style="padding:40rpx 34rpx 61rpx 43rpx; display: flex; ">
+      <view style="width:247rpx;height:88rpx; ">
+        <van-button custom-style="height:80rpx;width:100%;border-radius: 15rpx;border:1px solid #1B365D;color:#1B365D;"
+          plain disabled="{{loadingButtonFlag}}" loading="{{loadingButtonFlag}}"bind:click="cancle">取消
+        </van-button>
+      </view>
+      <view style="width:50%;height:80rpx; margin-left: 35px;">
+        <van-button color="#1B365D" custom-style="height:80rpx;width:100%;border-radius: 15rpx;" 
+          bind:click="submit"disabled="{{loadingButtonFlag}}" loading="{{loadingButtonFlag}}"type="info">保存
+        </van-button>
+      </view>
     </view>
   </view>
-
 </view>
+<!-- dialog -->
+<van-dialog id="van-dialog" />
 
-<!-- 下次跟进时间 -->
+<!-- 提醒时间 -->
 <van-popup position="bottom" show="{{ show }}" data-key="nextFollowTime" bind:close="onCloseChooseDate" class="popup"
   style="width:100%">
   <view style="display:flex;justify-content: space-around;height:80rpx;">
@@ -128,6 +474,42 @@
     formatter="{{formatter}}" />
 </van-popup>
 
-<!-- 业务员 -->
-<dk-single-dropdown-item show="{{staffFlag}}" id='staff' typeName='staff' bind:muticommit='singleSearchAll'
-  bind:muticlose='singleCloseAll'></dk-single-dropdown-item>
+<!-- 邀请时间 -->
+<van-popup show="{{ show_Month }}" position="bottom" bind:close="onCloseChooseDate_Month" data-key="inviteTime"
+  class="popup" style="width:100%">
+  <view style="display:flex;justify-content: space-around;height:80rpx;">
+    <view style="width:45%;text-align: left;color:#b6b6b6;line-height:80rpx;" data-key="inviteTime"
+      catchtap="onCloseChooseDate_Month">取消</view>
+    <view style="width:45%;text-align: right;color:#1989fa;line-height:80rpx;" data-key="inviteTime"
+      catchtap="onConfirmChooseDate_Month">确定</view>
+  </view>
+  <van-datetime-picker min-date="{{ minDate }}" show-toolbar="{{false}}" bindonlyinput="changeDate"
+    data-key="inviteTime" data-index="0" type="datetime" loading="{true}" value="{{ inviteTimeSearch }}"
+    formatter="{{formatter}}" />
+</van-popup>
+
+
+<!-- 邀约结果 -->
+<dk-single-dropdown-item show="{{inviteResultFlag}}"
+  content="{{form.InviteResult =='邀约结果-接受'?'接受邀约':(form.InviteResult =='邀约结果-拒绝'?'拒绝邀约':'' )}}" id='inviteResult'
+  typeName='inviteResult' bind:muticommit='mutiSearch' bind:muticlose='muticlose'></dk-single-dropdown-item>
+<!-- 客户意向 -->
+<dk-single-dropdown-item show="{{customerIntentionsFlag}}" content="{{form.CustomerIntentionsName}}"
+  id='customerIntentions' typeName='customerIntentions' bind:muticommit='mutiSearch' bind:muticlose='muticlose'>
+</dk-single-dropdown-item>
+
+<!-- 邀约进店的客户意向 -->
+<dk-single-dropdown-item show="{{inviteFollowTypeFlag}}" content="{{form.CustomerIntentionsName}}" choooseFlg="true"
+  id='customerIntentions' typeName='customerIntentions' bind:muticommit='mutiSearch' bind:muticlose='muticlose'>
+</dk-single-dropdown-item>
+
+<!-- 跟进方式 -->
+<dk-single-dropdown-item show="{{followTypeFlag}}" content="{{form.FollowTypeName}}" id='followType'
+  typeName='followType' bind:muticommit='mutiSearch' bind:muticlose='muticlose'></dk-single-dropdown-item>
+
+<!-- 设计师 -->
+<dk-single-dropdown-item show="{{designFlag}}" jobIds="{{jobIds}}" contentID="{{form.DesignUserId}}" id='staff' typeName='staff'
+  bind:muticommit='mutiSearch' bind:muticlose='muticlose'></dk-single-dropdown-item>
+
+  <!-- 流失原因多选 -->
+<dk-muti-dropdown-item show="{{loseReasonFlag}}" docName="流失原因" id='loseReason' typeName='loseReason' bind:muticommit='mutiSearchAll' bind:muticlose='muticloseAll'></dk-muti-dropdown-item>

+ 60 - 75
package-basic-data/pages/customer-follow-up/customer-follow-up.wxss

@@ -1,75 +1,60 @@
-.wyi {
-    border-style: groove;
-    flex: 1;
-    text-align: center;
-    margin: 1px;
-    border-radius: 1px;
-  }
-  
-  .add {
-    border-color: #FF9800
-  }
-  
-  .main-class {
-    margin-top: 1px;
-  }
-  
-  .oas-status {
-    width: 100%;
-    font-size: 26rpx;
-  }
-  
-  .table {
-    width: 94%;
-    padding: 10px;
-    margin-bottom: 10px;
-  }
-  
-  .table-row {
-    display: flex;
-    width: 100%;
-    flex-direction: row;
-    justify-content: space-between;
-  }
-  
-  .oas-title {
-    width: 87%;
-    font-size: 15px;
-  }
-  
-  .popup-top-item {
-    width: 100%;
-  }
-  .popup-top {
-    position: fixed;
-    width: 100%;
-    top: 0;
-    display: flex;
-    align-items: center; 
-  }
-  .input-class{
-    text-align: left !important;
-    height: 100px !important;
-  }
-  .van-field__label{
-    color: #95A8CB !important;
-    font-size: 14px !important;
-  }
-  .van-field__placeholder{
-    color: #95A8CB !important;
-    font-size: 12px !important;
-  }
-  /* 列表展示 */
-  .table-show{
-    margin: 10px 32rpx 10px 32rpx;
-    margin-top: 10px;
-    box-shadow:2px 2px 5px #e5e5e6;
-    border-radius: 15rpx;
-  }
-  /* 列表展示 */
-  .table-show-detail{
-    background: #FFFFFF;
-    box-shadow: 0rpx 10rpx 20rpx rgba(225, 229, 238, 0.6);
-    border-radius: 15rpx;
-    padding:2rpx;
-  }
+page {
+  background: #F5F5F5;
+}
+
+.input-class{
+  text-align: left !important;
+  height: 70px !important;
+  color: #1B365D !important;
+}
+/* .PickDate_Month{
+  text-align: left !important;
+
+} */
+
+.oas-status{ 
+  color: #1989fa; 
+}
+.valueName-class{
+  width: 100%;display: flex;
+}
+.van-field__label{
+  color:#1B365D !important;
+ 
+}
+.van-field__placeholder{
+  color: #95A8CB !important;
+}
+.van-cell__value{
+  color: #95A8CB !important;
+}
+.van-icon van-icon-arrow{
+  color: #95A8CB !important;
+}
+.van-field__input{
+  color: #1B365D !important;
+}
+/* 列表展示 */
+.table-show{
+  margin: 0px 32rpx 10px 32rpx;
+  border-radius: 15rpx;
+  box-shadow:2px 2px 5px #e5e5e6;
+}
+/* 列表展示 */
+.table-show-detail{
+  background: #FFFFFF;
+  box-shadow: 0rpx 10rpx 20rpx rgba(225, 229, 238, 0.6);
+  border-radius: 15rpx;
+  padding: 32rpx;
+}
+.botton-class{
+  background:#fff;
+  position:fixed;
+  bottom:0;
+  width:100%;
+  height: 182rpx; 
+  border-top:1px solid #efefef;
+  z-index: 7;
+  box-shadow: 0px -8rpx 24rpx rgba(0, 16, 39, 0.1);
+  border-radius: 30rpx 30rpx 0rpx 0rpx;
+}

+ 2 - 4
package-basic-data/pages/customer-follow-up/follow-up-tasks/follow-up-tasks.js

@@ -60,11 +60,9 @@ Page({
    */
   onLoad: function (options) {
     let form = this.data.form
-    form.reportUserName = app.globalData.user.userName
-    form.reportUser = app.globalData.user.userId
-    form.orgName = app.globalData.user.jobName
-    form.orgId = app.globalData.user.jobId
+     
     let item = JSON.parse(decodeURIComponent(options.item))
+    form = item
     form.CustomerName = item.customerName
     form.CustomerId = item.customerId
     form.FollowId = item.followId //跟进ID

+ 8 - 17
package-basic-data/pages/customer-list/customer-list.js

@@ -772,30 +772,21 @@ Page({
     })
   },
 
-  /**
-   * 客户跟进
-   */
   follow() {
-    // 临时存储的,不要删除 和从企业微信工具栏的方式进来不一样
-    wx.setStorageSync('customer-follow-up', 0)
-
-    this.setData({
-      showShare: false
-    })
     wx.navigateTo({
-      url: '/package3/pages/customer-follow-up/add/add?flg=false' + '&item=' + encodeURIComponent(JSON.stringify(this.data.onclikItem)),
-    })
+    url: '/package-basic-data/pages/customer-follow-up/customer-follow-up' ,
+  }) 
   },
-  /**
-   * 跟进任务
-   */
-  followtask(e) {
+  followtask() {
     this.setData({
       showShare: false
     })
     wx.navigateTo({
-      url: '/package3/pages/follow-up-tasks/follow-up-tasks?item=' + encodeURIComponent(JSON.stringify(this.data.onclikItem)),
-    })
+      // url: '/package-basic-data/pages/follow-up-tasks/follow-up-tasks',
+      url: '/package-basic-data/pages/customer-follow-up/follow-up-tasks/follow-up-tasks' ,
+    
+      
+    }) 
   },
   /**
    * @desc : 跳转预算报价新建

+ 8 - 6
package-basic-data/pages/customer-reception/add/add.js

@@ -201,13 +201,15 @@ Page({
    * @param {} event 
    */
   onRadio_Follow_Up(event) {
-    if (this.data.form.customerName == '无联系人' || this.data.type == 'add') {
-      this.setData({
-        radio_follow_up: event.detail,
-      });
-    }
+    // if (this.data.form.customerName == '无联系人' || this.data.type == 'add') {
+    //   this.setData({
+    //     radio_follow_up: event.detail,
+    //   });
+    // }
 
-  
+    this.setData({
+      radio_follow_up: event.detail,
+    });
   },
 
   /**