Procházet zdrojové kódy

Merge branch 'master' of http://git.dongkesoft.com:9001/iBOSS-2.0-Mini/iboss_wx_app

dongke před 1 rokem
rodič
revize
cd3a9a9ebc

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

@@ -262,7 +262,7 @@ Page({
           formData.cusCode = item.cusCode
           formData.cusId = item.cusId
           formData.cusName = item.cusName
-          // formData.cusPhone = item.cusPhone
+          formData.cusPhone = item.cusPhone
           formData.cusFromName = item.cusFromName
           formData.cusFrom = item.cusFrom
           //处理地址
@@ -282,8 +282,7 @@ Page({
           // formData.salesChannel = item.channelId
           // formData.channelId = item.channelId
           // formData.channelName = item.channelName
-          formData.contactPhone = item.contactPhone
-          formData.contactPhone = item.contactPhone
+          formData.contactPhone = item.contactPhone 
 
           this.setData({
             formData: JSON.stringify(formData)

+ 57 - 7
package-basic-data/pages/customer-reception/measure-to/measure-to.js

@@ -311,26 +311,76 @@ Page({
       }
     })
   },
+
+  /**
+  * @desc : 查询客户信息
+  * @author : 于继渤
+  * @date : 2024/1/23 9:16
+  */
+  getCustomerData(param) {
+    let service = app.globalData['customerService']
+    return this.excute(service, param.cusId, {}).then(res => {
+      if (res.data.code == 200) {
+        if (res.data.data) {
+          let formData = JSON.parse(this.data.formData)
+          let item = res.data.data
+          formData.cusCode = item.cusCode
+          formData.cusId = item.cusId
+          formData.cusName = item.cusName
+          formData.cusPhone = item.cusPhone
+          formData.cusFromName = item.cusFromName
+          formData.cusFrom = item.cusFrom
+          //处理地址
+          formData.address = {
+            address: item.addressFull,
+            addressFull: item.addressFull,
+            addressArea: item.addressArea,
+            addressGcj02: item.addressGcj02,
+            addressName: item.addressName,
+          }
+          formData.addressArea = item.addressArea
+          formData.addressFull = item.addressFull
+          formData.addressGcj02 = item.addressGcj02
+          formData.addressName = item.addressName
+          formData.addressNo = item.addressNo
+          // 参数传过来
+          formData.staffName = param.staffName
+          formData.staffId = param.staffId
+          formData.followId = param.followId 
+
+          this.setData({
+            formData: JSON.stringify(formData)
+          })
+        }
+      }
+    });
+  },
+
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
     //接收父页面传递的参数
     let that = this
-    let item = {}
-    // 从推送消息过来的数据  
-    if (options.item) {
-      item = JSON.parse(decodeURIComponent(options.item))
-    }
+
     const eventChannel = this.getOpenerEventChannel()
     eventChannel.on('params', function (data) {
-      let item = that.data.item || item
+      let item = that.data.item
       let formData = that.setCus(JSON.parse(that.data.formData), item)
       that.setData({
         formData: formData
       })
-
     })
+
+    let item = {}
+    if (options.item) {
+      // 只有cusId 
+      item = JSON.parse(decodeURIComponent(options.item))
+      if (item.cusId) {
+        this.getCustomerData(item.cusId)
+      }
+    }
+
   },