zhaoxiaohai 3 лет назад
Родитель
Сommit
931dea43ff

+ 164 - 170
packageA/publicClue/addClue.js

@@ -5,164 +5,162 @@ Page({
     data: {
     data: {
         showAll: false,
         showAll: false,
         form: [{
         form: [{
-                label: "客户(企业)",
-                error: false,
-                errMsg: "",
-                type: "label",
-                value: "",
-                placeholder: "客户(企业)",
-                valueName: "enterprisename",
-                checking: "base",
-                slot: "info",
-                required: false
-            }, {
-                label: "联系人",
-                error: false,
-                errMsg: "",
-                type: "label",
-                value: "",
-                placeholder: "联系人",
-                valueName: "name",
-                checking: "base",
-                required: false
-            }, {
-                label: "手机号码",
-                error: false,
-                checking: "phone",
-                errMsg: "",
-                type: "number",
-                value: "",
-                placeholder: "手机号码",
-                valueName: "phonenumber", //绑定的字段名称
-                required: true, //必填
-            }, {
-                label: "省市县",
-                error: false,
-                errMsg: "",
-                type: "region",
-                value: "",
-                placeholder: "省市县",
-                valueName: "region",
-                checking: "base",
-                required: false
-            }, {
-                label: "详细地址",
-                error: false,
-                errMsg: "",
-                type: "label",
-                value: "",
-                placeholder: "详细地址",
-                valueName: "address",
-                checking: "base",
-                required: false
-            }, {
-                label: "项目名称",
-                error: false,
-                errMsg: "",
-                type: "textarea",
-                value: "",
-                placeholder: "项目名称",
-                valueName: "projectname",
-                checking: "base",
-                required: false
-            }, {
-                label: "项目规模",
-                error: false,
-                errMsg: "",
-                type: "textarea",
-                value: "",
-                placeholder: "请填写建筑面积(㎡)/吨位(t)",
-                valueName: "scale",
-                checking: "base",
-                required: false
-            }, {
-                label: "总投资额(百万)",
-                error: false,
-                errMsg: "",
-                type: "digit",
-                value: "",
-                placeholder: "请填写金额",
-                valueName: "totalinvestment",
-                checking: "base",
-                required: false
-            }, {
-                label: "造价(百万)",
-                error: false,
-                errMsg: "",
-                type: "digit",
-                value: "",
-                placeholder: "请填写金额",
-                valueName: "costofconstruction",
-                checking: "base",
-                required: false
-            }, {
-                label: "预计开工时间",
-                error: false,
-                errMsg: "",
-                type: "date",
-                fields: "month",
-                value: "",
-                placeholder: "预计开工时间",
-                valueName: "begdate_due",
-                checking: "base",
-                required: false
-            }, {
-                label: "预计完工时间",
-                error: false,
-                errMsg: "",
-                type: "date",
-                fields: "month",
-                value: "",
-                placeholder: "预计完工时间",
-                valueName: "enddate_due",
-                checking: "base",
-                required: false
-            },
-            {
-                label: "市场活动",
-                error: false,
-                errMsg: "",
-                type: "route",
-                url: "/packageA/select/selectActivity/index",
-                value: "",
-                radio: true,
-                params: {
-                    "id": 20221101095102,
-                    "content": {
-                        nocache: true,
-                        'isAll': 0,
-                        "where": {
-                            'condition': '',
-                            "unend": 1
-                        }
+            label: "客户(企业)",
+            error: false,
+            errMsg: "",
+            type: "label",
+            value: "",
+            placeholder: "客户(企业)",
+            valueName: "enterprisename",
+            checking: "base",
+            slot: "info",
+            required: false
+        }, {
+            label: "联系人",
+            error: false,
+            errMsg: "",
+            type: "label",
+            value: "",
+            placeholder: "联系人",
+            valueName: "name",
+            checking: "base",
+            required: false
+        }, {
+            label: "手机号码",
+            error: false,
+            checking: "phone",
+            errMsg: "",
+            type: "number",
+            value: "",
+            placeholder: "手机号码",
+            valueName: "phonenumber", //绑定的字段名称
+            required: true, //必填
+        }, {
+            label: "省市县",
+            error: false,
+            errMsg: "",
+            type: "region",
+            value: "",
+            placeholder: "省市县",
+            valueName: "region",
+            checking: "base",
+            required: false
+        }, {
+            label: "详细地址",
+            error: false,
+            errMsg: "",
+            type: "label",
+            value: "",
+            placeholder: "详细地址",
+            valueName: "address",
+            checking: "base",
+            required: false
+        }, {
+            label: "项目名称",
+            error: false,
+            errMsg: "",
+            type: "textarea",
+            value: "",
+            placeholder: "项目名称",
+            valueName: "projectname",
+            checking: "base",
+            required: false
+        }, {
+            label: "项目规模",
+            error: false,
+            errMsg: "",
+            type: "textarea",
+            value: "",
+            placeholder: "请填写建筑面积(㎡)/吨位(t)",
+            valueName: "scale",
+            checking: "base",
+            required: false
+        }, {
+            label: "总投资额(百万)",
+            error: false,
+            errMsg: "",
+            type: "digit",
+            value: "",
+            placeholder: "请填写金额",
+            valueName: "totalinvestment",
+            checking: "base",
+            required: false
+        }, {
+            label: "造价(百万)",
+            error: false,
+            errMsg: "",
+            type: "digit",
+            value: "",
+            placeholder: "请填写金额",
+            valueName: "costofconstruction",
+            checking: "base",
+            required: false
+        }, {
+            label: "预计开工时间",
+            error: false,
+            errMsg: "",
+            type: "date",
+            fields: "month",
+            value: "",
+            placeholder: "预计开工时间",
+            valueName: "begdate_due",
+            checking: "base",
+            required: false
+        }, {
+            label: "预计完工时间",
+            error: false,
+            errMsg: "",
+            type: "date",
+            fields: "month",
+            value: "",
+            placeholder: "预计完工时间",
+            valueName: "enddate_due",
+            checking: "base",
+            required: false
+        }, {
+            label: "市场活动",
+            error: false,
+            errMsg: "",
+            type: "route",
+            url: "/packageA/select/selectActivity/index",
+            value: "",
+            params: {
+                "id": 20221101095102,
+                "content": {
+                    nocache: true,
+                    isAll: 0,
+                    "where": {
+                        'condition': '',
+                        "unend": 1
                     }
                     }
-                },
-                query: "&radio=true&idname=sat_campaignid&=showName=campaign_name",
-                placeholder: "选择市场活动",
-                checking: "base",
-                required: false
-            }, {
-                label: "来源",
-                error: false,
-                errMsg: "",
-                type: "label",
-                value: "",
-                placeholder: "来源",
-                valueName: "cluesource",
-                checking: "base",
-                required: false
-            }, {
-                label: "线索概括",
-                error: false,
-                errMsg: "",
-                type: "label",
-                value: "",
-                placeholder: "线索概括",
-                valueName: "notes",
-                checking: "base",
-                required: false
-            }
-        ],
+                }
+            },
+            query: "&radio=true",
+            placeholder: "选择市场活动",
+            valueName: "campaign_name",
+            checking: "base",
+            required: false
+        }, {
+            label: "来源",
+            error: false,
+            errMsg: "",
+            type: "label",
+            value: "",
+            placeholder: "来源",
+            valueName: "cluesource",
+            checking: "base",
+            required: false
+        }, {
+            label: "线索概括",
+            error: false,
+            errMsg: "",
+            type: "label",
+            value: "",
+            placeholder: "线索概括",
+            valueName: "notes",
+            checking: "base",
+            required: false
+        }],
         "content": {
         "content": {
             "sat_orderclueid": 0,
             "sat_orderclueid": 0,
             "enterprisename": "",
             "enterprisename": "",
@@ -204,7 +202,9 @@ Page({
                 form: this.data.form.map(v => {
                 form: this.data.form.map(v => {
                     if (v.valueName != 'region') {
                     if (v.valueName != 'region') {
                         if (v.valueName == 'campaign_name') {
                         if (v.valueName == 'campaign_name') {
-                            v.value = [data[v.valueName]]
+                            v.value = data[v.valueName] ? [data[v.valueName],
+                                [data.sat_campaignid]
+                            ] : ""
                         } else {
                         } else {
                             v.value = data[v.valueName];
                             v.value = data[v.valueName];
                         }
                         }
@@ -248,18 +248,12 @@ Page({
             ...this.data.content,
             ...this.data.content,
             ...this.selectComponent("#Form").submit()
             ...this.selectComponent("#Form").submit()
         };
         };
-        console.log(content);
-        if (content.campaign_name && content.campaign_name.length > 1) {
-            content.sat_campaignid = content.campaign_name[1][0]
-        }
-        content.sat_orderclueid = this.data.content.sat_orderclueid
-
-        if (content.region.length > 0) {
-            content.city = content.region[1]
-            content.county = content.region[2]
-            content.province = content.region[0]
-        }
-
+        content.sat_campaignid = content.campaign_name ? content.campaign_name[1][0] : 0;
+        content.city = content.region[1] || "";
+        content.county = content.region[2] || "";
+        content.province = content.region[0] || "";
+        delete(content.region)
+        delete(content.campaign_name)
         _Http.basic({
         _Http.basic({
             "id": "20221205162402",
             "id": "20221205162402",
             content
             content

+ 28 - 25
packageA/publicClue/distribution.js

@@ -1,4 +1,6 @@
-const { getCurrentPage } = require("../../miniprogram_npm/@vant/weapp/common/utils");
+const {
+    getCurrentPage
+} = require("../../miniprogram_npm/@vant/weapp/common/utils");
 
 
 const _Http = getApp().globalData.http;
 const _Http = getApp().globalData.http;
 Page({
 Page({
@@ -11,19 +13,19 @@ Page({
                 "nocache": true,
                 "nocache": true,
                 "pageNumber": 1,
                 "pageNumber": 1,
                 "pageSize": 20,
                 "pageSize": 20,
-                "sat_orderclueid":'',
+                "sat_orderclueid": '',
                 "where": {
                 "where": {
                     "condition": ""
                     "condition": ""
                 }
                 }
             },
             },
         },
         },
-        detail:{}
+        detail: {}
     },
     },
     onLoad(options) {
     onLoad(options) {
         let data = JSON.parse(options.data)
         let data = JSON.parse(options.data)
         this.setData({
         this.setData({
             detail: data,
             detail: data,
-            'params.content.sat_orderclueid':data.sat_orderclueid
+            'params.content.sat_orderclueid': data.sat_orderclueid
         })
         })
         this.getList();
         this.getList();
     },
     },
@@ -59,33 +61,34 @@ Page({
                     classname: "webmanage.saletool.orderclue.publicclue.PublicClue",
                     classname: "webmanage.saletool.orderclue.publicclue.PublicClue",
                     "method": this.data.detail.cluetype == '经销商' ? 'matchAgent' : 'matchAgent_Sales',
                     "method": this.data.detail.cluetype == '经销商' ? 'matchAgent' : 'matchAgent_Sales',
                     "content": {
                     "content": {
-                        matchlist: [
-                            {
-                                sat_orderclueid: this.data.detail.sat_orderclueid,
-                                [this.data.detail.cluetype == '经销商' ? 'sa_agentsid' : 'hrid']:item.hrid
-                            }
-                        ]
+                        matchlist: [{
+                            sat_orderclueid: this.data.detail.sat_orderclueid,
+                            [this.data.detail.cluetype == '经销商' ? 'sa_agentsid' : 'hrid']: item.hrid
+                        }]
                     }
                     }
                 }).then(res => {
                 }).then(res => {
-                    console.log(res)
+                    console.log("分配线索", res)
                     wx.showToast({
                     wx.showToast({
                         title: res.msg == '成功' ? '分配成功' : res.msg,
                         title: res.msg == '成功' ? '分配成功' : res.msg,
-                        icon: "none"
+                        icon: "none",
+                        mask: true
                     });
                     });
                     if (res.msg != '成功') return;
                     if (res.msg != '成功') return;
-                    wx.navigateBack()
-                    getCurrentPages().forEach(v => {
-                        if(v.__route__=="packageA/publicClue/index") {
-                            v.getList(true)
-                        } else if(v.__route__=="packageA/publicClue/detail") {
-                            wx.navigateBack()
-                            getCurrentPages().forEach(v => {
-                                if(v.__route__=="packageA/publicClue/index") {
-                                    v.getList(true)
-                                }
-                            })
-                        } 
-                    })
+                    setTimeout(() => {
+                        getCurrentPages().forEach(v => {
+                            if (v.__route__ == "packageA/publicClue/index") {
+                                v.getList(true)
+                            } else if (v.__route__ == "packageA/publicClue/detail") {
+                                wx.navigateBack()
+                                getCurrentPages().forEach(v => {
+                                    if (v.__route__ == "packageA/publicClue/index") {
+                                        v.getList(true)
+                                    }
+                                })
+                            }
+                        })
+                        wx.navigateBack()
+                    }, 500)
                 })
                 })
             }
             }
         })
         })

+ 0 - 11
packageA/publicClue/modules/list/list.js

@@ -10,17 +10,6 @@ Component({
     options: {
     options: {
         addGlobalClass: true
         addGlobalClass: true
     },
     },
-
-    /**
-     * 组件的初始数据
-     */
-    data: {
-
-    },
-
-    /**
-     * 组件的方法列表
-     */
     methods: {
     methods: {
         distribution({
         distribution({
             currentTarget
             currentTarget

+ 3 - 3
packageA/saleClue/addClue.js

@@ -178,9 +178,9 @@ Page({
                 form: this.data.form.map(v => {
                 form: this.data.form.map(v => {
                     if (v.valueName != 'region') {
                     if (v.valueName != 'region') {
                         if (v.valueName == 'campaign_name') {
                         if (v.valueName == 'campaign_name') {
-                            v.value = [data[v.valueName],
+                            v.value = data[v.valueName] ? [data[v.valueName],
                                 [data.sat_campaignid]
                                 [data.sat_campaignid]
-                            ]
+                            ] : ""
                         } else {
                         } else {
                             v.value = data[v.valueName] || "";
                             v.value = data[v.valueName] || "";
                         }
                         }
@@ -226,7 +226,7 @@ Page({
             ...this.data.content,
             ...this.data.content,
             ...this.selectComponent("#Form").submit()
             ...this.selectComponent("#Form").submit()
         };
         };
-        content.sat_campaignid = content.campaign_name[1][0] || 0;
+        content.sat_campaignid = content.campaign_name ? content.campaign_name[1][0] : 0;
         content.city = content.region[1] || "";
         content.city = content.region[1] || "";
         content.county = content.region[2] || "";
         content.county = content.region[2] || "";
         content.province = content.region[0] || "";
         content.province = content.region[0] || "";

+ 13 - 9
packageA/saleClue/detail.js

@@ -408,6 +408,7 @@ Page({
     },
     },
     /* 确认无效 */
     /* 确认无效 */
     invalidItem() {
     invalidItem() {
+        let that = this;
         _Http.basic({
         _Http.basic({
             id: "20221208100602",
             id: "20221208100602",
             "content": {
             "content": {
@@ -419,23 +420,24 @@ Page({
                 "competitor": ""
                 "competitor": ""
             }
             }
         }).then(res => {
         }).then(res => {
-            if (res.msg == '成功') {
+            console.log("无效", res)
+            wx.showToast({
+                title: res.msg == '成功' ? `操作成功` : res.msg,
+                icon: "none",
+                mask: true
+            });
+            if (res.msg == '成功') setTimeout(() => {
                 this.getDetail();
                 this.getDetail();
                 this.selectComponent("#follow").getList(that.data.detail.sat_orderclueid, true)
                 this.selectComponent("#follow").getList(that.data.detail.sat_orderclueid, true)
                 this.onCancel()
                 this.onCancel()
                 this.setData({
                 this.setData({
                     invalidreason: ""
                     invalidreason: ""
                 })
                 })
-            }
-            setTimeout(() => {
-                wx.showToast({
-                    title: res.msg == '成功' ? `操作成功` : res.msg,
-                    icon: "none"
-                });
-            }, 1000)
+            }, 300)
         })
         })
     },
     },
     deleteItem() {
     deleteItem() {
+        let that = this;
         _Http.basic({
         _Http.basic({
             "id": 20221123193702,
             "id": 20221123193702,
             "content": {
             "content": {
@@ -451,11 +453,13 @@ Page({
             this.setData({
             this.setData({
                 deletereason: ""
                 deletereason: ""
             })
             })
+            that.getDetail();
             setTimeout(() => {
             setTimeout(() => {
                 let pages = getCurrentPages(),
                 let pages = getCurrentPages(),
                     page = pages[pages.length - 2];
                     page = pages[pages.length - 2];
                 if (page.getList) page.setData({
                 if (page.getList) page.setData({
-                    list: page.data.list.filter(v => v.sat_orderclueid != that.data.detail.sat_orderclueid)
+                    list: page.data.list.filter(v => v.sat_orderclueid != that.data.detail.sat_orderclueid),
+                    "content.total": page.data.content.total - 1,
                 })
                 })
             }, 300)
             }, 300)
         })
         })