zhaoxiaohai преди 3 години
родител
ревизия
ce62b2dc49

+ 26 - 28
packageA/publicClue/detail.js

@@ -51,7 +51,6 @@ Page({
         this.getDetail();
     },
     getDetail() {
-        console.log(111);
         _Http.basic({
             "classname": "webmanage.saletool.orderclue.publicclue.PublicClue",
             "method": "selectDetail",
@@ -66,7 +65,6 @@ Page({
                 title: res.msg,
                 icon: "none"
             });
-            console.log(res.data.createBy);
             this.setData({
                 detail: res.data,
                 briefs: [{
@@ -88,10 +86,6 @@ Page({
                     {
                         label: '分配状态',
                         value: res.data.allocationstatus
-                    },
-                    {
-                        label: '跟进状态',
-                        value: res.data.status
                     }
                 ],
                 list1: [{
@@ -127,10 +121,6 @@ Page({
                     {
                         label: '分配状态',
                         value: res.data.allocationstatus
-                    },
-                    {
-                        label: '跟进状态',
-                        value: res.data.status
                     }
                 ],
                 list2: [{
@@ -174,13 +164,20 @@ Page({
                 arr = this.data.tabbarList.filter(item => {
                     return item.label != '编辑' && item.label != '撤回'
                 })
+            };
+
+            /* 更新列表中状态 */
+            let page = getCurrentPages().find(v => v.__route__ == 'packageA/publicClue/index');
+            if (page) {
+                let index = page.data.list.findIndex(v => v.sat_orderclueid == res.data.sat_orderclueid);
+                if (index != -1) page.setData({
+                    [`list[${index}].status`]: res.data.status
+                })
             }
-            console.log(arr);
             this.setData({
                 tabbarList: arr
             })
             this.getTags();
-            this.getGroup();
             this.partialRenewal();
         })
     },
@@ -197,10 +194,6 @@ Page({
     getTags() {
         this.selectComponent("#Tags").getTags();
     },
-    //更新团队成员
-    getGroup() {
-        this.selectComponent("#Group").getList();
-    },
     //局部数据更新 tabs
     partialRenewal(init = false) {
         let id = this.data.detail.sat_orderclueid;
@@ -242,7 +235,8 @@ Page({
     tabbarOnClick({
         detail
     }) {
-        let data = this.data.detail;
+        let data = this.data.detail,
+            that = this;
         switch (detail.label) {
             case "编辑":
                 wx.navigateTo({
@@ -263,12 +257,16 @@ Page({
                             }
                         }).then(res => {
                             wx.showToast({
-                                title: res.msg == '成功' ? `已作废该线索` : res.msg,
+                                title: res.msg == '成功' ? `操作成功` : res.msg,
                                 icon: "none"
                             });
-                            if (res.msg == '成功') {
-                                this.getDetail()
-                            }
+                            setTimeout(() => {
+                                let pages = getCurrentPages(),
+                                    page = pages[pages.length - 2];
+                                if (page.getList) page.setData({
+                                    list: page.data.list.filter(v => v.sat_orderclueid != that.data.detail.sat_orderclueid)
+                                })
+                            }, 300)
                         })
                     }
                 })
@@ -287,13 +285,13 @@ Page({
                                 "sat_orderclueid": this.data.detail.sat_orderclueid
                             }
                         }).then(res => {
-                            wx.showToast({
-                                title: res.msg == '成功' ? `已撤回该线索` : res.msg,
-                                icon: "none"
-                            });
-                            if (res.msg == '成功') {
-                                this.getDetail()
-                            }
+                            setTimeout(() => {
+                                wx.showToast({
+                                    title: res.msg == '成功' ? `操作成功` : res.msg,
+                                    icon: "none"
+                                });
+                            }, 1000)
+                            if (res.msg == '成功') this.getDetail()
                         })
                     }
                 })

+ 1 - 3
packageA/publicClue/detail.wxml

@@ -3,9 +3,7 @@
     <Yl-tags id="Tags" add ownertable='sat_orderclue' ownerid='{{detail.sat_orderclueid}}' />
 </view>
 <!-- 简介 -->
-<Yl_Detail list="{{briefs}}">
-    <Yl-group slot='bottom' id='Group' add ownertable='sat_orderclue' ownerid='{{detail.sat_orderclueid}}' />
-</Yl_Detail>
+<Yl_Detail list="{{briefs}}" />
 <view style="height: 20rpx;" />
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
     <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />

+ 26 - 5
packageA/publicClue/modules/follow/follow.js

@@ -10,9 +10,15 @@ Component({
             pageNumber: 1,
             pageTotal: 1,
             total: null,
-            isdesc: 1,
-            where: {}
+            where: {},
+            sort: [{
+                reversed: 1,
+                sorted: 1,
+                sortid: 84,
+                sortname: "默认"
+            }]
         },
+        poputShow: false,
         showWhere: '所有日期',
         followList: [],
         timeRangeShow: false,
@@ -30,8 +36,7 @@ Component({
             if (init) content.pageNumber = 1;
             content.sat_orderclueid = id;
             _Http.basic({
-                "classname": "webmanage.saletool.orderclue.publicclue.PublicClue",
-                "method": "getFollowList",
+                id: 20221101094602,
                 content
             }).then(res => {
                 console.log('线索跟进', res);
@@ -44,9 +49,25 @@ Component({
                 })
             })
         },
+        viewFiles(e) {
+            const {
+                item
+            } = e.currentTarget.dataset;
+            console.log(item)
+            this.setData({
+                poputShow: true
+            })
+            this.selectComponent("#Yl_Files").handleFiles(item.attinfo,true)
+        },
+        onClosePoput() {
+            this.setData({
+                poputShow: false
+            })
+            this.selectComponent("#Yl_Files").initData()
+        },
         changeIsdesc() {
             this.setData({
-                "content.isdesc": this.data.content.isdesc == 1 ? 0 : 1
+                "content.sort[0].reversed": this.data.content.sort[0].reversed == 1 ? 0 : 1
             });
             this.getList(this.data.sat_orderclueid, true)
         },

+ 11 - 0
packageA/publicClue/modules/follow/follow.scss

@@ -1,4 +1,5 @@
 @import "../../../../pages/submission/wxss/detePicker.scss";
+
 .filtrate {
     display: flex;
     justify-content: space-between;
@@ -35,6 +36,8 @@
     white-space: pre-wrap;
 
     .time {
+        display: flex;
+        justify-content: space-between;
         height: 34rpx;
         font-size: 24rpx;
         font-family: PingFang SC-Regular, PingFang SC;
@@ -64,4 +67,12 @@
     }
 
 
+}
+
+.head {
+    height: 80rpx;
+    line-height: 80rpx;
+    text-align: center;
+    width: 100%;
+    border-bottom: 1rpx solid #ddd;
 }

+ 12 - 4
packageA/publicClue/modules/follow/follow.wxml

@@ -3,11 +3,14 @@
         <van-icon style="margin-left: 8rpx;" name="arrow-down" />
     </view>
     <view class="sort" bindtap="changeIsdesc">
-        <text class="iconfont {{ content.isdesc==1?'icon-jiangxu':'icon-shengxu1' }}" />
+        <text class="iconfont {{ content.sort[0].reversed==1?'icon-jiangxu':'icon-shengxu1' }}" />
     </view>
 </view>
 <navigator url="#" class="box" wx:for="{{followList}}">
-    <view class="time">{{item.createdate}}</view>
+    <view class="time">
+        <text>{{item.createdate}}</text>
+        <text wx:if="{{item.attinfo.length}}" style="color: #085CDF; font-size: 24rpx;" catchtap="viewFiles" data-item="{{item}}">查看附件</text>
+    </view>
     <view class="content">由经销商端<text style="color: var(--warning);"> {{item.createby}} </text>开始跟进<block wx:if="{{item.followupmode}}">,跟进方式:<text>{{item.followupmode}}</text></block>
         <block wx:if="{{item.logtype}}">,跟进结果:<text>{{item.logtype}}</text></block>
         <block wx:if="{{item.content}}">,跟进内容:</block>
@@ -16,7 +19,6 @@
 </navigator>
 <My_empty wx:if="{{followList.length==0}}" />
 <view style="height: 140rpx;" />
-
 <van-action-sheet show="{{ timeRangeShow }}" bind:close='timeRangeClose' z-index='9999'>
     <view class="detePickerHeader">
         <text catchtap="toSeeAll">所有日期</text>
@@ -33,4 +35,10 @@
         <text catchtap="determineScope">确定</text>
     </view>
     <My_datePicker bind:getDate='getDate' />
-</van-action-sheet>
+</van-action-sheet>
+
+<van-popup show="{{ poputShow }}" round position="bottom" custom-style="min-height:70%;max-height:100%" bind:close="onClosePoput">
+    <view class="head">查看附件</view>
+    <Yl_Files id="Yl_Files" />
+    <view style="height: 130rpx;" />
+</van-popup>

+ 4 - 3
packageA/saleClue/addFollow.js

@@ -59,6 +59,7 @@ Page({
         this.setData({
             loading: true
         })
+        content.logtype = '跟进';
         _Http.basic({
             id: "20221208100602",
             content
@@ -77,9 +78,9 @@ Page({
                 title: '保存成功!',
             })
             setTimeout(() => {
-                let page = getCurrentPages().find(v => v.__route__ == 'packageA/saleClue/detail').selectComponent("#follow");
-                page.getList(page.data.sat_orderclueid, true)
-                console.log(page.getList)
+                let page = getCurrentPages().find(v => v.__route__ == 'packageA/saleClue/detail');
+                page.selectComponent("#follow").getList(page.data.sat_orderclueid, true);
+                page.getDetail();
                 wx.navigateBack();
             }, 300)
         })

+ 13 - 6
packageA/saleClue/addFollow.wxml

@@ -17,13 +17,20 @@
 
     <view style="display: flex;justify-content: space-between;align-items: center;width: 690rpx; margin: 20rpx auto 0;">
         <view class="label" style="margin: 0;">附件:</view>
-        <My_upload accept='file' binduploadCallback="insertImgEdit">
-            <navigator url="#" class="but">
-                <van-icon name="plus" />
-            </navigator>
-        </My_upload>
+        <view>
+            <My_upload accept='media' binduploadCallback="insertImgEdit">
+                <navigator url="#" class="but">
+                    <van-icon name="photo-o" />
+                </navigator>
+            </My_upload>
+            <My_upload accept='file' binduploadCallback="insertImgEdit">
+                <navigator url="#" class="but">
+                    <van-icon name="description" />
+                </navigator>
+            </My_upload>
+        </view>
     </view>
-    <Yl_Files detele id="Yl_Files" />
+    <Yl_Files delete id="Yl_Files" />
 </view>
 <view style="height: 140rpx;" />
 

+ 32 - 55
packageA/saleClue/detail.js

@@ -18,25 +18,6 @@ Page({
             num: 132
         }],
         tabbarList: [{
-            icon: "icon-bianji",
-            label: "编辑"
-        }, {
-            icon: "icon-genjin",
-            label: "跟进"
-        }, {
-            icon: "icon-genjin",
-            label: "无效"
-        }, {
-            icon: "icon-dibu-zhuanhuan",
-            label: "转化"
-        }, {
-            icon: "icon-dibu-zhuanhuan",
-            label: "转移"
-        }, {
-            icon: "icon-dibu-jieshu",
-            label: "作废"
-        }],
-        oldtabbarList: [{
             icon: "icon-genjin",
             label: "跟进"
         }, {
@@ -63,7 +44,6 @@ Page({
         this.getDetail();
     },
     getDetail() {
-        console.log(111);
         _Http.basic({
             "classname": "saletool.orderclue.web.orderclue",
             "method": "selectDetail",
@@ -78,7 +58,6 @@ Page({
                 title: res.msg,
                 icon: "none"
             });
-            console.log(res.data.createBy);
             this.setData({
                 detail: res.data,
                 briefs: [{
@@ -177,25 +156,23 @@ Page({
                 }],
                 tabsList: this.data.tabsList,
             });
-            let arr = this.data.oldtabbarList
-            if (res.data.status != '待跟进' && res.data.status != '跟进中') {
-                arr = []
+            /* 更新列表中状态 */
+            let page = getCurrentPages().find(v => v.__route__ == 'packageA/saleClue/index');
+            if (page) {
+                let index = page.data.list.findIndex(v => v.sat_orderclueid == res.data.sat_orderclueid);
+                console.log("列表中位置", index)
+                if (index != -1) page.setData({
+                    [`list[${index}].status`]: res.data.status
+                })
             }
-            this.setData({
-                tabbarList: arr
+            if (res.data.status != '待跟进' && res.data.status != '跟进中') this.setData({
+                tabbarList: []
             })
             this.getTags();
             this.getGroup();
             this.partialRenewal();
         })
     },
-    /*跟进提交*/
-    endFollow({
-        detail
-    }) {
-        this.getDetail()
-        this.selectComponent('#follow').getList(this.data.detail.sat_orderclueid, true)
-    },
     //tabs 切换
     tabsChange({
         detail
@@ -254,7 +231,8 @@ Page({
     tabbarOnClick({
         detail
     }) {
-        let data = this.data.detail;
+        let data = this.data.detail,
+            that = this;
         switch (detail.label) {
             case "编辑":
                 wx.navigateTo({
@@ -271,26 +249,26 @@ Page({
                         if (confirm) _Http.basic({
                             "id": 20221123193702,
                             "content": {
-                                "sat_orderclueids": [this.data.detail.sat_orderclueid]
+                                "sat_orderclueids": [that.data.detail.sat_orderclueid]
                             }
                         }).then(res => {
                             wx.showToast({
-                                title: res.msg == '成功' ? `已作废该线索` : res.msg,
+                                title: res.msg == '成功' ? `操作成功` : res.msg,
                                 icon: "none"
                             });
-                            if (res.msg == '成功') {
-                                wx.navigateBack()
-                                getCurrentPages().forEach(v => {
-                                    if (v.__route__ == "packageA/saleClue/index") {
-                                        v.getList(true)
-                                    }
+                            setTimeout(() => {
+                                let pages = getCurrentPages(),
+                                    page = pages[pages.length - 2];
+                                if (page.getList) page.setData({
+                                    list: page.data.list.filter(v => v.sat_orderclueid != that.data.detail.sat_orderclueid)
                                 })
-                            }
+                            }, 300)
                         })
                     }
                 })
                 break;
             case "无效":
+
                 wx.showModal({
                     title: '提示',
                     content: `是否设置该线索为"无效"状态,确定后无法撤销!`,
@@ -300,25 +278,24 @@ Page({
                         if (confirm) _Http.basic({
                             id: "20221208100602",
                             "content": {
-                                "sat_orderclueid": this.data.detail.sat_orderclueid,
+                                "sat_orderclueid": that.data.detail.sat_orderclueid,
+                                sat_ordercluefollowuplogid: 0,
                                 "content": "",
                                 "followupmode": "",
                                 "logtype": "无效",
                                 "competitor": ""
                             }
                         }).then(res => {
-                            wx.showToast({
-                                title: res.msg == '成功' ? `已无效该线索` : res.msg,
-                                icon: "none"
-                            });
                             if (res.msg == '成功') {
-                                wx.navigateBack()
-                                getCurrentPages().forEach(v => {
-                                    if (v.__route__ == "packageA/saleClue/index") {
-                                        v.getList(true)
-                                    }
-                                })
+                                that.getDetail();
+                                that.selectComponent("#follow").getList(that.data.detail.sat_orderclueid, true)
                             }
+                            setTimeout(() => {
+                                wx.showToast({
+                                    title: res.msg == '成功' ? `操作成功` : res.msg,
+                                    icon: "none"
+                                });
+                            }, 1000)
                         })
                     }
                 })
@@ -330,7 +307,7 @@ Page({
                 break;
             case "跟进":
                 wx.navigateTo({
-                    url: `/packageA/saleClue/addFollow?sat_orderclueid=`+this.data.detail.sat_orderclueid
+                    url: `/packageA/saleClue/addFollow?sat_orderclueid=` + this.data.detail.sat_orderclueid
                 })
                 break;
             case "更换负责人":

+ 1 - 3
packageA/saleClue/detail.wxml

@@ -14,7 +14,5 @@
     <Trace slot='跟进动态' id='Trace' ownertable='sat_orderclue' ownerid='{{detail.sat_orderclueid}}' />
     <view style="height: 140rpx;" />
 </Yl_FunTabs>
-
-
 <!-- 底部 -->
-<Yl_Tabbar list='{{tabbarList}}' bind:callback="tabbarOnClick" />
+<Yl_Tabbar wx:if="{{tabbarList.length!=0}}" list='{{tabbarList}}' bind:callback="tabbarOnClick" />