瀏覽代碼

线索跟进支持评论

xiaohaizhao 1 年之前
父節點
當前提交
ce0e0d7856

+ 68 - 90
packageA/publicClue/modules/follow/follow.js

@@ -18,7 +18,7 @@ Component({
             type: Boolean,
             type: Boolean,
             value: false
             value: false
         },
         },
-        expenseBreakdown:{
+        expenseBreakdown: {
             type: Boolean,
             type: Boolean,
         }
         }
     },
     },
@@ -33,27 +33,48 @@ Component({
             pageTotal: 1,
             pageTotal: 1,
             pageSize: 20,
             pageSize: 20,
             total: null,
             total: null,
-            where: {},
-            sort: [{
-                reversed: 0,
-                sorted: 1,
-                sortid: 84,
-                sortname: "默认"
-            }]
+            where: {
+                condition: ""
+            }
         },
         },
+        showSearch: false,
+        focus: false,
+        condition: "",
         poputShow: false,
         poputShow: false,
-        showWhere: '所有日期',
         followList: [],
         followList: [],
-        timeRangeShow: false,
-        whereType: {
-            value: "start",
-            list: {
-                "start": "",
-                "end": ""
-            }
-        }
     },
     },
     methods: {
     methods: {
+        toSearch() {
+            if (this.data.showSearch && this.data.content.where.condition) {
+                this.data.content.where.condition = '';
+                this.getList(this.data.sat_orderclueid, true);
+            } else if (this.data.condition) {
+                this.data.content.where.condition = this.data.condition;
+                this.setData({
+                    condition: this.data.condition
+                })
+                this.getList(this.data.sat_orderclueid, true);
+            }
+            this.setData({
+                showSearch: !this.data.showSearch
+            })
+            setTimeout(() => {
+                this.setData({
+                    focus: this.data.showSearch
+                })
+            }, 300)
+        },
+        onChange({
+            detail
+        }) {
+            this.data.condition = detail;
+        },
+        onSearch({
+            detail
+        }) {
+            this.data.content.where.condition = detail;
+            this.getList(this.data.sat_orderclueid, true)
+        },
         getList(id, init = false) {
         getList(id, init = false) {
             let content = this.data.content;
             let content = this.data.content;
             if (init) content.pageNumber = 1;
             if (init) content.pageNumber = 1;
@@ -63,7 +84,6 @@ Component({
                 content
                 content
             }).then(res => {
             }).then(res => {
                 console.log('线索跟进', res);
                 console.log('线索跟进', res);
-
                 if (this.data.isshowsalesfeesamount) res.data = res.data.map(v => {
                 if (this.data.isshowsalesfeesamount) res.data = res.data.map(v => {
                     v.showsalesfeesamount = CNY(v.salesfeesamount)
                     v.showsalesfeesamount = CNY(v.salesfeesamount)
                     return v
                     return v
@@ -75,18 +95,12 @@ Component({
                     "content.total": res.total,
                     "content.total": res.total,
                     sat_orderclueid: id
                     sat_orderclueid: id
                 })
                 })
-                setTimeout(() => {
-                    res.data.forEach(v => {
-                        if (v.attinfo.length) this.selectComponent(`#Yl_Files${v.rowindex}`).handleFiles(v.attinfo, true)
-                    })
-                }, 50)
             })
             })
         },
         },
         viewFiles(e) {
         viewFiles(e) {
             const {
             const {
                 item
                 item
             } = e.currentTarget.dataset;
             } = e.currentTarget.dataset;
-            console.log(item)
             this.setData({
             this.setData({
                 poputShow: true
                 poputShow: true
             })
             })
@@ -98,67 +112,6 @@ Component({
             })
             })
             this.selectComponent("#Yl_Files").initData()
             this.selectComponent("#Yl_Files").initData()
         },
         },
-        changeIsdesc() {
-            this.setData({
-                "content.sort[0].reversed": this.data.content.sort[0].reversed == 1 ? 0 : 1
-            });
-            this.getList(this.data.sat_orderclueid, true)
-        },
-        /* 打开选择时间 */
-        openSelectDate() {
-            this.setData({
-                timeRangeShow: true
-            })
-        },
-        /* 确定时间范围 */
-        determineScope() {
-            const {
-                list
-            } = this.data.whereType;
-            this.setData({
-                "content.where": list,
-                showWhere: list.start + '~' + list.end,
-                timeRangeShow: false
-            });
-            this.getList(this.data.sat_orderclueid, true);
-        },
-        /* 得到选择时间 */
-        getDate({
-            detail
-        }) {
-            let obj = this.data.whereType;
-            obj.list[obj.value] = detail;
-            this.setData({
-                whereType: obj
-            })
-        },
-        /* 选择日期类型 */
-        selectDateType(e) {
-            const {
-                name
-            } = e.target.dataset;
-            this.setData({
-                "whereType.value": name
-            })
-        },
-        /* 查看所有日期 */
-        toSeeAll() {
-            this.setData({
-                showWhere: "所有日期"
-            })
-            this.timeRangeClose();
-            this.getList(this.data.sat_orderclueid, true);
-        },
-        /* 关闭时间范围选择 */
-        timeRangeClose() {
-            this.setData({
-                timeRangeShow: false,
-                "content.where": {
-                    "start": "",
-                    "end": ""
-                }
-            })
-        },
         deleteItem(e) {
         deleteItem(e) {
             const {
             const {
                 item
                 item
@@ -198,11 +151,6 @@ Component({
                 this.setData({
                 this.setData({
                     followList: res.data,
                     followList: res.data,
                 });
                 });
-                setTimeout(() => {
-                    res.data.forEach(v => {
-                        if (v.attinfo.length) this.selectComponent(`#Yl_Files${v.rowindex}`).handleFiles(v.attinfo, true)
-                    })
-                }, 50)
                 delete(_Http.changeItem)
                 delete(_Http.changeItem)
             })
             })
         },
         },
@@ -232,5 +180,35 @@ Component({
                 })
                 })
             }.bind(this)
             }.bind(this)
         },
         },
+        comment(e) {
+            let page = this.selectComponent('#' + e.currentTarget.id);
+            page.setData({
+                show: !page.data.show
+            })
+        },
+        updateCommentList({
+            detail
+        }) {
+            console.log("detail", detail)
+            detail.pageSize = 99999;
+            _Http.basic({
+                "id": 20240920092204,
+                content: detail
+            }).then(res => {
+                console.log("更新评论列表", res)
+                if (res.code == 1) {
+                    let idName = detail.ownertable + 'id';
+                    const index = this.data.followList.findIndex(v => v[idName] == detail.ownerid)
+                    if (index != -1) {
+                        let item = this.data.followList[index];
+                        item.commentqty = res.total == 0 ? 0 : res.data[0].totalqty;
+                        item.comment = res.data;
+                        this.setData({
+                            [`followList[${index}]`]: item
+                        })
+                    }
+                }
+            })
+        }
     }
     }
 })
 })

+ 2 - 1
packageA/publicClue/modules/follow/follow.json

@@ -1,6 +1,7 @@
 {
 {
     "component": true,
     "component": true,
     "usingComponents": {
     "usingComponents": {
-        "My_datePicker": "/components/My_datePicker/index"
+        "My_datePicker": "/components/My_datePicker/index",
+        "commentList": "/pages/trace/comment/list"
     }
     }
 }
 }

+ 38 - 51
packageA/publicClue/modules/follow/follow.scss

@@ -1,31 +1,11 @@
 @import "../../../../pages/submission/wxss/detePicker.scss";
 @import "../../../../pages/submission/wxss/detePicker.scss";
+@import "../../../setclient/modules/address/head.scss";
 
 
-.filtrate {
-    display: flex;
-    justify-content: space-between;
-    width: 100vw;
-    height: 90rpx;
-    padding: 0 30rpx;
-    box-sizing: border-box;
-
-    .date {
-        display: flex;
-        align-items: center;
-        font-size: 28rpx;
-        font-family: PingFang SC-Regular, PingFang SC;
-        color: #333333;
-    }
-
-    .sort {
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        height: 90rpx;
-        width: 90rpx;
-    }
+.custom-class {
+    --search-background-color: #fff !important;
+    padding-right: 10rpx !important;
 }
 }
 
 
-
 .trace-box {
 .trace-box {
     background-color: #ffffff;
     background-color: #ffffff;
     margin-bottom: 20rpx;
     margin-bottom: 20rpx;
@@ -104,39 +84,46 @@
         box-sizing: border-box;
         box-sizing: border-box;
         padding: 0 30rpx;
         padding: 0 30rpx;
         border-top: 1px solid #DDDDDD;
         border-top: 1px solid #DDDDDD;
+        display: flex;
 
 
-        .bottom-date {
-            font-size: 24rpx;
-            font-family: PingFang SC-Regular, PingFang SC;
-            color: #999999;
-        }
-
-        .but {
-            display: flex;
+        navigator {
+            padding: 0 20rpx;
+            line-height: 70rpx;
 
 
-            navigator {
-                padding: 0 20rpx;
-                line-height: 70rpx;
+            .iconfont {
+                font-size: 28rpx;
+                color: #999999;
+                margin-right: 8rpx;
+            }
 
 
-                .iconfont {
-                    font-size: 28rpx;
-                    color: #999999;
-                    margin-right: 8rpx;
-                }
+            font-size: 24rpx;
+            font-family: PingFang SC-Regular,
+            PingFang SC;
+            color: #333333;
+        }
 
 
-                font-size: 24rpx;
-                font-family: PingFang SC-Regular,
-                PingFang SC;
-                color: #333333;
-            }
+        .comment {
+            padding: 0 10rpx;
+            margin-left: -10rpx;
         }
         }
     }
     }
 }
 }
 
 
-.head {
-    height: 80rpx;
-    line-height: 80rpx;
-    text-align: center;
-    width: 100%;
-    border-bottom: 1rpx solid #ddd;
+.createdate {
+    display: flex;
+    align-items: center;
+    font-size: 24rpx;
+    color: #3874F6;
+    margin-bottom: 20rpx;
+}
+
+.createdate::before {
+    content: '';
+    display: inline-block;
+    width: 16rpx;
+    height: 16rpx;
+    border-radius: 50%;
+    border: 4rpx solid #3874F6;
+    box-sizing: border-box;
+    margin-right: 8rpx;
 }
 }

+ 32 - 39
packageA/publicClue/modules/follow/follow.wxml

@@ -1,13 +1,23 @@
-<view class="filtrate">
-    <view class="date" bindtap="openSelectDate">{{showWhere}}
-        <van-icon style="margin-left: 8rpx;" name="arrow-down" />
+<view class="head">
+    <view class="count">
+        总共{{content.total}}个
     </view>
     </view>
-    <view class="sort" bindtap="changeIsdesc">
-        <text class="iconfont {{ content.sort[0].reversed==1?'icon-jiangxu':'icon-shengxu1' }}" />
+    <view class="expand">
+        <van-search wx:if="{{showSearch}}" custom-class='custom-class' focus='{{focus}}' value="{{ condition }}" shape="round" bind:change='onChange' bind:search='onSearch' bind:clear='onSearch' placeholder="业务员、跟进内容" background='#F4F5F7' />
+        <navigator url="#" class="but" bindtap="toSearch">
+            <van-icon name="search" />
+        </navigator>
+        <navigator wx:if="{{disabled}}" url="#" class="but" bindtap="toAdd">
+            <van-icon name="plus" />
+        </navigator>
     </view>
     </view>
 </view>
 </view>
-<view class="trace-box" wx:for="{{followList}}" wx:key="sys_datafollowupid">
+
+<view class="trace-box" wx:for="{{followList}}" wx:key="sat_ordercluefollowuplogid">
     <view class="item" data-item="{{item}}">
     <view class="item" data-item="{{item}}">
+        <view class="createdate">
+            {{item.createdate}}
+        </view>
         <view class="user">
         <view class="user">
             <view class="portrait">
             <view class="portrait">
                 {{item.createby[0]}}
                 {{item.createby[0]}}
@@ -32,44 +42,27 @@
             营销费用:<text style="color: #FF3B30;">{{item.showsalesfeesamount}}</text>
             营销费用:<text style="color: #FF3B30;">{{item.showsalesfeesamount}}</text>
         </view>
         </view>
     </view>
     </view>
-    <Yl_Files id="{{'Yl_Files'+item.rowindex}}" delete="{{disabled}}" strict />
+    <Yl_Files id="{{'Yl_Files'+item.rowindex}}" attinfos="{{item.attinfo}}" delete="{{disabled}}" strict />
+    <commentList id="Comment{{item.sat_ordercluefollowuplogid}}" comments='{{item.comment}}' quantity="{{item.commentqty}}" ownertable='sat_ordercluefollowuplog' ownerid='{{item.sat_ordercluefollowuplogid}}' bind:updateCommentList='updateCommentList' />
     <view class="bottom">
     <view class="bottom">
-        <view class="bottom-date">
-            {{item.createdate}}
-        </view>
-        <view class="but">
-            <navigator wx:if="{{expenseBreakdown}}" url="#" bindtap="expenseBreakdown" data-item="{{item}}" data-index="{{index}}">
-                <text class="iconfont icon-yingxiaofeiyongmingxi" />费用明细
+        <navigator url="#" class="comment" bind:tap="comment" id="Comment{{item.sat_ordercluefollowuplogid}}">
+            <text class="iconfont icon-huifu" /><text style="color: #3874F6;">评论({{item.commentqty}})</text>
+        </navigator>
+        <view style="flex: 1;" />
+        <navigator wx:if="{{expenseBreakdown}}" url="#" bindtap="expenseBreakdown" data-item="{{item}}" data-index="{{index}}">
+            <text class="iconfont icon-yingxiaofeiyongmingxi" />费用明细
+        </navigator>
+        <block wx:if="{{disabled}}">
+            <navigator url="#" bindtap="editItem" data-item="{{item}}">
+                <text class="iconfont icon-bianji" />编辑
             </navigator>
             </navigator>
-            <block wx:if="{{disabled}}">
-                <navigator url="#" bindtap="editItem" data-item="{{item}}">
-                    <text class="iconfont icon-bianji" />编辑
-                </navigator>
-                <navigator url="#" bindtap="deleteItem" data-item="{{item}}">
-                    <text class="iconfont icon-qunzu" />删除
-                </navigator>
-            </block>
-        </view>
+            <navigator url="#" bindtap="deleteItem" data-item="{{item}}">
+                <text class="iconfont icon-qunzu" />删除
+            </navigator>
+        </block>
     </view>
     </view>
 </view>
 </view>
 <My_empty wx:if="{{followList.length==0}}" />
 <My_empty wx:if="{{followList.length==0}}" />
-<van-action-sheet show="{{ timeRangeShow }}" bind:close='timeRangeClose' z-index='9999'>
-    <view class="detePickerHeader">
-        <text catchtap="toSeeAll">所有日期</text>
-        <view class="type" catchtap="selectDateType">
-            <view class="option {{whereType.value=='start'?'active-op':''}}" data-name="start">
-                <view data-name="start">开始</view>
-                <view data-name="start" class="time">{{whereType.list.start||'开始时间'}}</view>
-            </view>
-            <view class="option {{whereType.value=='end'?'active-op':''}}" data-name="end">
-                <view data-name="end">结束</view>
-                <view data-name="end" class="time">{{whereType.list.end||'结束时间'}}</view>
-            </view>
-        </view>
-        <text catchtap="determineScope">确定</text>
-    </view>
-    <My_datePicker bind:getDate='getDate' />
-</van-action-sheet>
 <van-popup show="{{ poputShow }}" round position="bottom" custom-style="min-height:70%;max-height:100%" bind:close="onClosePoput">
 <van-popup show="{{ poputShow }}" round position="bottom" custom-style="min-height:70%;max-height:100%" bind:close="onClosePoput">
     <view class="head">查看附件</view>
     <view class="head">查看附件</view>
     <Yl_Files id="Yl_Files" />
     <Yl_Files id="Yl_Files" />