wangyingjie 2 anni fa
parent
commit
78b109b9b1

+ 19 - 19
app.json

@@ -32,7 +32,8 @@
                 "pages/customer-list/detail/detail",
                 "pages/customer-reception/detail/detail",
                 "pages/customer-follow-up/add/add",
-                "pages/customer-follow-up/detail/detail"
+                "pages/customer-follow-up/detail/detail",
+                "pages/customer-follow-up/follow-up-tasks/follow-up-tasks"
             ]
         },
         {
@@ -46,24 +47,23 @@
             "pages": []
         },
         {
-          "root": "package5",
-          "name": "package5",
-          "pages": [
-              "pages/purchase-order/purchase-order",
-              "pages/purchase-order/add/add",
-              "pages/purchase-order/purchase-order-detail/purchase-order-detail",
-              "pages/purchase-order/purchase-order-selection-goods/purchase-order-selection-goods",
-              "pages/purchase-order/purchase-order-sales/purchase-order-sales",
-              "pages/purchase-return/purchase-return",
-              "pages/purchase-receipt/purchase-receipt",
-              "pages/purchase-based-sales/purchase-based-sales",
-              "pages/purchase-details/purchase-details",
-              "pages/purchase-tracking/purchase-tracking",
-              "pages/supplier-list/supplier-list",
-              "pages/supplier-list/add/add"
-          ]
-      }
-        
+            "root": "package5",
+            "name": "package5",
+            "pages": [
+                "pages/purchase-order/purchase-order",
+                "pages/purchase-order/add/add",
+                "pages/purchase-order/purchase-order-detail/purchase-order-detail",
+                "pages/purchase-order/purchase-order-selection-goods/purchase-order-selection-goods",
+                "pages/purchase-order/purchase-order-sales/purchase-order-sales",
+                "pages/purchase-return/purchase-return",
+                "pages/purchase-receipt/purchase-receipt",
+                "pages/purchase-based-sales/purchase-based-sales",
+                "pages/purchase-details/purchase-details",
+                "pages/purchase-tracking/purchase-tracking",
+                "pages/supplier-list/supplier-list",
+                "pages/supplier-list/add/add"
+            ]
+        }
     ],
     "window": {
         "backgroundTextStyle": "light",

+ 388 - 0
package2/pages/customer-follow-up/follow-up-tasks/follow-up-tasks.js

@@ -0,0 +1,388 @@
+const app = getApp();
+const api = require('../../../utils/api.js');
+const Constants = require('../../../utils/Constants.js');
+const util = require('../../../utils/util.js')
+Page({
+
+  /** 
+   * 页面的初始数据
+   */
+  data: {
+    form: {
+      CustomerName: '', //客户名称
+      reportUserName: '', //业务员
+      NextFollowPlan: '', //下次跟进计划
+      NextFollowTime: '', //下次跟进时间
+    },
+    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(),
+    nextFollowTimeSearch: new Date().getTime() + 100,
+    formatter(type, value) {
+      if (type === 'year') {
+        return `${value}年`;
+      }
+      if (type === 'month') {
+        return `${value}月`;
+      }
+      if (type === 'day') {
+        return `${value}日`;
+      }
+      if (type === 'hour') {
+        return `${value}时`;
+      }
+      if (type === 'minute') {
+        return `${value}分`;
+      }
+      return value;
+    },
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  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
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+  //下次跟进时间
+  onChangePickDate() {
+    this.setData({
+      show: true
+    })
+  },
+  /**
+   * @desc : 选择业务员
+   * @author : 于继渤
+   * @date : 2022/5/26 12:16
+   */
+  openStaffDropdown() {
+    this.setData({
+      staffFlag: true
+    })
+
+  },
+  /**
+   * @desc : 下拉单选确认事件
+   * @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
+    })
+  },
+  /**
+   * @desc : 下拉单选关闭事件
+   * @author : 于继渤
+   * @date : 2022/5/26 12:16
+   */
+  singleCloseAll(e) {},
+  /**
+   * 下次跟进时间
+   * @param {} e 
+   */
+  onConfirmChooseDate(e) {
+    let form = this.data.form
+    form.NextFollowTime = util.formatDataTime(new Date(this.data.nextFollowTimeSearch))
+    this.setData({
+      form: form,
+      show: false
+    })
+  },
+    /**
+   * 下次跟进时间关闭
+   * @param {} e 
+   */
+  onCloseChooseDate() {
+    this.setData({
+      show: false
+    })
+  },
+  /**
+   * @desc : 标识日期变化事件
+   * @author : 秦祺
+   * @date : 2022/5/26 17:16
+   */
+  changeDate(e) {
+    let key = e.currentTarget.dataset.key
+    //量尺时间
+    if (key === 'nextFollowTime') {
+      this.setData({
+        nextFollowTimeSearch: e.detail
+      })
+    }
+  },
+  /**
+   * 下次跟进计划
+   * @param {} event 
+   */
+  onMeasureRemarksChange(event) {
+    let form = this.data.form
+    form.NextFollowPlan = event.detail
+    // strLength = event.detail.value.length
+    this.setData({
+      form: form,
+      // strLength
+    })
+  },
+  /**
+   * 保存
+   * 
+   */
+  submit() {
+      return
+    let result = this.checkForm();
+    if (result.flag) {
+      let param = {}
+      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 //客成状态
+      this.setData({
+        loading: 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];
+
+          prevPage.setData({
+            selectflag: true
+          })
+          setTimeout(function () {
+            wx.navigateBack({
+              delta: 1
+            })
+          }, 1500)
+        } else {
+       
+          this.setData({
+            loading: false,
+            loadingButtonFlag: false
+          })
+        }
+      })
+    } else {
+      wx.showToast({
+        title: result.msg,
+        image: '/static/image/warning.png',
+        duration: 1000
+      })
+      this.setData({
+        loading: false,
+        loadingButtonFlag: false
+      })
+    }
+
+  },
+  /* 表单校验 */
+  checkForm() {
+    if (!this.data.form.NextFollowTime) {
+      return {
+        flag: false,
+        msg: '下次跟进时间为空'
+      };
+    }
+    return {
+      flag: true,
+      msg: '表单校验通过'
+    }
+  },
+
+
+
+
+
+
+
+
+
+
+  /**
+   * 下面的代码着实不到是干嘛的,但是也没敢删除 视图上也有相应事件
+   * 
+   */
+  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 += "周天,"
+    }
+    this.setData({
+      mess: mess
+    })
+  },
+  clickvMonday(e) {
+    this.setData({
+      vMonday: !this.data.vMonday
+    })
+    this.setDayMessage()
+  },
+  clickvThuesday(e) {
+    this.setData({
+      vThuesday: !this.data.vThuesday
+    })
+    this.setDayMessage()
+  },
+  clickvWednesday(e) {
+    this.setData({
+      vWednesday: !this.data.vWednesday
+    })
+
+    this.setDayMessage()
+  },
+  clickvThursday(e) {
+    this.setData({
+      vThursday: !this.data.vThursday
+    })
+
+    this.setDayMessage()
+  },
+  clickvFriday(e) {
+    this.setData({
+      vFriday: !this.data.vFriday
+    })
+    this.setDayMessage()
+  },
+  clickvSaturday(e) {
+    this.setData({
+      vSaturday: !this.data.vSaturday
+    })
+    this.setDayMessage()
+  },
+  clickvSunday(e) {
+    this.setData({
+      vSunday: !this.data.vSunday
+    })
+    this.setDayMessage()
+  },
+  clickWeekValue(e) {
+    this.setData({
+      weekValueitem: e.target.dataset.item
+    })
+    weekValue[e.target.dataset.item] = true
+  },
+
+  setMessage() {
+    let mess = "每隔" + this.data.stepper + "天重复"
+    if (this.data.skipSaturday) {
+      mess += ",跳过周六重复"
+    }
+    if (this.data.skipSunday) {
+      mess += ",跳过周天重复"
+    }
+    this.setData({
+      mess: mess
+    })
+  },
+  onChangeSunday(e) {
+    this.setData({
+      skipSunday: e.detail
+    })
+    this.setMessage()
+  },
+  onChangeSaturday(e) {
+    this.setData({
+      skipSaturday: e.detail
+    })
+    this.setMessage()
+  },
+  onChangeStepper(e) {
+    this.setData({
+      stepper: e.detail
+    })
+    this.setMessage()
+
+  },
+  clickDay(e) {
+    this.setData({
+      dayWeekFlg: true,
+      mess: '请选择'
+    })
+  },
+
+  clickWeek(e) {
+    this.setData({
+      dayWeekFlg: false,
+      mess: '请选择'
+    })
+  },
+
+  selectPeriodOk(e) {
+    this.setData({
+      selectPeriodFlg: false
+    })
+  },
+  selectPeriodCancel(e) {
+    this.setData({
+      selectPeriodFlg: false
+    })
+  },
+})

+ 4 - 0
package2/pages/customer-follow-up/follow-up-tasks/follow-up-tasks.json

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

+ 133 - 0
package2/pages/customer-follow-up/follow-up-tasks/follow-up-tasks.wxml

@@ -0,0 +1,133 @@
+<!-- 前台导入wxmlUtil.wxs -->
+<wxs src='/utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
+<!-- 设置金额和价格的小数位数 -->
+<view style="display:none">{{wxmlUtil.setNumberOfDecimalPlacesAmount(numberOfDecimalPlacesAmount)}}</view>
+
+<loading wx:if="{{loading}}" loadingName="加载中" backgroundColor="#f2f2f2;" opacity="0.8"></loading>
+
+
+<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" />
+
+        <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" />
+
+        <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}}"/>
+
+   
+
+        <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>
+
+</view>
+
+
+<!-- 抽屉 -->
+<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>
+
+  <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>
+
+  <view
+    style="width: 100%; height: 25px;background-color: blanchedalmond;font-size: 11px;color: lightsalmon;display: flex;align-items: center;padding-left: 15px;">
+    {{mess}}
+  </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-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: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>
+  </view>
+
+</view>
+
+<!-- 下次跟进时间 -->
+<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;">
+    <view style="width:45%;text-align: left;color:#b6b6b6;line-height:80rpx;" data-key="nextFollowTime"
+      catchtap="onCloseChooseDate">取消</view>
+    <view style="width:45%;text-align: right;color:#1989fa;line-height:80rpx;" data-key="nextFollowTime"
+      catchtap="onConfirmChooseDate">确定</view>
+  </view>
+  <van-datetime-picker min-date="{{ minDate }}" show-toolbar="{{false}}" bindonlyinput="changeDate"
+    data-key="nextFollowTime" data-index="0" type="datetime" loading="{true}" value="{{ nextFollowTimeSearch }}"
+    formatter="{{formatter}}" />
+</van-popup>
+
+<!-- 业务员 -->
+<dk-single-dropdown-item show="{{staffFlag}}" id='staff' typeName='staff' bind:muticommit='singleSearchAll'
+  bind:muticlose='singleCloseAll'></dk-single-dropdown-item>

+ 75 - 0
package2/pages/customer-follow-up/follow-up-tasks/follow-up-tasks.wxss

@@ -0,0 +1,75 @@
+.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;
+  }

+ 6 - 10
package2/pages/customer-reception/customer-reception.js

@@ -827,23 +827,19 @@ 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: '/package2/pages/customer-follow-up/customer-follow-up' ,
+  }) 
   },
   followtask() {
     this.setData({
       showShare: false
     })
     wx.navigateTo({
-      // url: '/package3/pages/follow-up-tasks/follow-up-tasks',
-      url: '/package2/pages/customer-follow-up/customer-follow-up' ,
+      // url: '/package2/pages/follow-up-tasks/follow-up-tasks',
+      url: '/package2/pages/customer-follow-up/follow-up-tasks/follow-up-tasks' ,
+    
+      
     }) 
   },
   //量尺回执