Bläddra i källkod

新增跟进记录

zhaoxiaohai 3 år sedan
förälder
incheckning
dd695a14f1

+ 36 - 3
packageA/setclient/modules/trace/add/index.js

@@ -1,11 +1,13 @@
 const _Http = getApp().globalData.http;
 const _Http = getApp().globalData.http;
 Page({
 Page({
     data: {
     data: {
+        isNew: false, //是否为新增
         ownerid: null,
         ownerid: null,
         ownertable: null,
         ownertable: null,
-        sys_datafollowupid: 0,
+        sys_datafollowupid: 0, //数据ID
         type: "",
         type: "",
         content: "",
         content: "",
+        user: {}, //联系人
         actions: [{
         actions: [{
             name: "上门拜访"
             name: "上门拜访"
         }, {
         }, {
@@ -22,7 +24,28 @@ Page({
             this.setData({
             this.setData({
                 ...options
                 ...options
             })
             })
-        }
+        };
+        if (!options.sys_datafollowupid) this.initTemplate();
+    },
+    /* 初始化模板 */
+    initTemplate() {
+        _Http.basic({
+            "id": 20220930121601,
+            content: {
+                type: this.data.type,
+                content: this.data.content,
+                ownerid: this.data.ownerid,
+                ownertable: this.data.ownertable,
+                sys_datafollowupid: this.data.sys_datafollowupid
+            }
+        }).then(res => {
+            console.log("新增初始化模板", res)
+
+            this.setData({
+                sys_datafollowupid: res.data.sys_datafollowupid,
+                isNew: true
+            })
+        })
     },
     },
     openSelect() {
     openSelect() {
         this.setData({
         this.setData({
@@ -48,8 +71,18 @@ Page({
         })
         })
     },
     },
     selectUser() {
     selectUser() {
+        let result = this.data.user.userid ? [this.data.user.userid] : [];
         wx.navigateTo({
         wx.navigateTo({
-            url: `/packageA/group/index?ownertable=${this.data.ownertable}&ownerid=${this.data.ownerid}&radio`,
+            url: `/packageA/group/select?data=${JSON.stringify({
+                    ownertable:this.data.ownertable,
+                    ownerid:this.data.ownerid
+                })}&radio=true&obj=true&result=${result}`,
+        })
+    },
+    handelSubmit(arr) {
+        wx.navigateBack();
+        this.setData({
+            user: arr[0]
         })
         })
     },
     },
     submit() {
     submit() {

+ 2 - 2
packageA/setclient/modules/trace/add/index.wxml

@@ -1,5 +1,5 @@
 <view class="box">
 <view class="box">
-    <view class="title">记录跟进内容</view>
+    <view class="title"><text style="color: red; margin-right: 8rpx;">*</text>记录跟进内容</view>
     <view class="content">
     <view class="content">
         <textarea class="textarea" placeholder='请填写' value="{{content}}" bindinput='onInput' />
         <textarea class="textarea" placeholder='请填写' value="{{content}}" bindinput='onInput' />
         <view class="upload">
         <view class="upload">
@@ -19,7 +19,7 @@
     <navigator url="#" bindtap="selectUser">
     <navigator url="#" bindtap="selectUser">
         <view>
         <view>
             <view class="label">跟进客户联系人</view>
             <view class="label">跟进客户联系人</view>
-            <view class="text">请选择</view>
+            <view class="text">{{user.name||"请选择"}}</view>
             <text class="iconfont icon-a-wodetiaozhuan" />
             <text class="iconfont icon-a-wodetiaozhuan" />
         </view>
         </view>
     </navigator>
     </navigator>