codeMan 3 سال پیش
والد
کامیت
d015c1544b

+ 42 - 7
packageA/publicClue/addClue.js

@@ -43,7 +43,32 @@ Page({
             placeholder: "省市县",
             valueName: "province",
             checking: "base",
-            required: true
+            required: false
+        }, {
+            label: "市场活动",
+            error: false,
+            errMsg: "",
+            type: "route",
+            url: "/packageA/select/selectActivity/index",
+            model: "#Form",
+            value: "",
+            radio: true,
+            params: {
+            "id":20221101095102,
+            "content": {
+                'isAll':0,
+                "pageNumber":1,
+                "pageSize":999999999,
+                "where": {
+                'condition':''
+                }
+            }
+            },
+            placeholder: "选择市场活动",
+            valueName: "campaign_name",
+            idName:'sat_campaignid',
+            checking: "base",
+            required: false
         }, {
             label: "详细地址",
             error: false,
@@ -105,14 +130,19 @@ Page({
                 disabled: false,
                 form: this.data.form.map(v => {
                     if (v.valueName != 'region') {
-                        v.value = data[v.valueName];
+                        if (v.valueName == 'campaign_name') {
+                            v.value = [data[v.valueName]]
+                        } else {
+                            v.value = data[v.valueName];
+                        }
                     } else {
                         v.value = data.province ? [data.province, data.city, data.county] : []
                     }
                     return v
                 }),
                 'form[0].value':data.enterprisename_customer,
-                'content.sat_orderclueid':data.sat_orderclueid
+                'content.sat_orderclueid':data.sat_orderclueid,
+                'content.sat_campaignid': data.sat_campaignid
             })
         }
     },
@@ -121,11 +151,16 @@ Page({
             ...this.data.content,
             ...this.selectComponent("#Form").submit()
         };
-        console.log(content);
+        if (content.campaign_name && !(content.campaign_name[0] instanceof Array)) {
+            content.sat_campaignid = content.campaign_name[1][0]
+        }
         content.sat_orderclueid = this.data.content.sat_orderclueid
-        content.city = content.province[1]
-        content.county = content.province[2]
-        content.province = content.province[0]
+        if (content.province.length > 0) {
+            content.city = content.province[1]
+            content.county = content.province[2]
+            content.province = content.province[0]
+        }
+        
         _Http.basic({
             "id":"20221205162402",
             content

+ 3 - 0
packageA/publicClue/detail.js

@@ -82,6 +82,9 @@ Page({
                     }, {
                         label: "来源",
                         value: res.data.cluesource
+                    }, {
+                        label: "市场活动",
+                        value: res.data.campaign_name
                     }, {
                         label: "所属经销商",
                         value: res.data.enterprisename

+ 1 - 1
packageA/publicClue/distribution.js

@@ -62,7 +62,7 @@ Page({
                         matchlist: [
                             {
                                 sat_orderclueid: this.data.detail.sat_orderclueid,
-                                [this.data.detail.cluetype == '经销商' ? 'sa_agentsid' : 'hrid']:item.sa_agentsid
+                                [this.data.detail.cluetype == '经销商' ? 'sa_agentsid' : 'hrid']:item.hrid
                             }
                         ]
                     }

+ 3 - 2
packageA/publicClue/modules/list/list.wxml

@@ -1,14 +1,15 @@
 <!--packageA/activity/modules/list/index.wxml-->
 <navigator class="offer-list" url="/packageA/publicClue/detail?sat_orderclueid={{item.sat_orderclueid}}" wx:for="{{list}}" wx:key="item.sat_orderclueid">
-    <view class="title">
+    <view class="title" wx:if="{{item.enterprisename_customer}}">
         <text class="line-1">{{item.enterprisename_customer}}</text>
     </view>
     <view class="exp line-1">省市县:{{item.province?item.province+item.city+item.county:"暂无"}}</view>
     <view class="exp line-1">联系人:<text>{{item.name}}</text></view>
     <view class="exp line-1">手机号:<text>{{item.phonenumber || '--'}}</text></view>
+    <view class="exp line-1">市场活动:{{item.campaign_name?item.campaign_name:"11"}}</view>
     <view class="exp line-1">来源:<text>{{item.cluesource ? item.cluesource : '--'}}</text></view>
     <view class="exp line-1">线索类型:<text>{{item.cluetype ? item.cluetype : '--'}}</text></view>
-    <van-button wx:if="{{item.status=='待分配'}}" custom-class='action' catchtap="distribution" data-item="{{item}}">分配</van-button>
+    <van-button wx:if="{{item.allocationstatus=='待分配'}}" custom-class='action' catchtap="distribution" data-item="{{item}}">分配</van-button>
 </navigator>
 
 <My_empty wx:if="{{list.length == 0}}" />