zhaoxiaohai 3 سال پیش
والد
کامیت
650bbf15b6

+ 84 - 0
packageA/setclient/modules/trace/add/index.js

@@ -0,0 +1,84 @@
+const _Http = getApp().globalData.http;
+Page({
+    data: {
+        ownerid: null,
+        ownertable: null,
+        sys_datafollowupid: 0,
+        type: "",
+        content: "",
+        actions: [{
+            name: "上门拜访"
+        }, {
+            name: "电话拜访"
+        }, {
+            name: "微信联系"
+        }, {
+            name: "QQ联系"
+        }],
+        show: false
+    },
+    onLoad(options) {
+        if (options.ownertable) {
+            this.setData({
+                ...options
+            })
+        }
+    },
+    openSelect() {
+        this.setData({
+            show: true
+        })
+    },
+    onCancel() {
+        this.setData({
+            show: false
+        })
+    },
+    onSelect({
+        detail
+    }) {
+        this.setData({
+            type: detail.name
+        })
+        this.onCancel();
+    },
+    onInput(e) {
+        this.setData({
+            content: e.detail.value
+        })
+    },
+    selectUser() {
+        wx.navigateTo({
+            url: `/packageA/group/index?ownertable=${this.data.ownertable}&ownerid=${this.data.ownerid}&radio`,
+        })
+    },
+    submit() {
+        const content = {
+            type: this.data.type,
+            content: this.data.content,
+            ownerid: this.data.ownerid,
+            ownertable: this.data.ownertable,
+            sys_datafollowupid: this.data.sys_datafollowupid
+        };
+        if (!content.content) return;
+        _Http.basic({
+            "id": 20220930121601,
+            content
+        }).then(res => {
+            console.log(res)
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            });
+            wx.showToast({
+                title: '保存成功',
+                icon: "none"
+            });
+            setTimeout(() => {
+                let pages = getCurrentPages();
+                pages[pages.length - 2].partialRenewal(true);
+                wx.navigateBack();
+            }, 500)
+        })
+    },
+})

+ 4 - 0
packageA/setclient/modules/trace/add/index.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "跟进"
+}

+ 104 - 0
packageA/setclient/modules/trace/add/index.scss

@@ -0,0 +1,104 @@
+.box {
+    width: 100vw;
+    background-color: #ffffff;
+    padding-top: 20rpx;
+    box-sizing: border-box;
+
+    .title {
+        font-size: 28rpx;
+        font-family: PingFang SC-Regular, PingFang SC;
+        color: #333333;
+        padding-left: 30rpx;
+    }
+
+    .content {
+        width: 690rpx;
+        border-radius: 8rpx;
+        border: 2rpx solid #CCCCCC;
+        margin-top: 20rpx;
+        box-sizing: border-box;
+        padding-bottom: 20rpx;
+        margin-left: 30rpx;
+        margin-bottom: 20rpx;
+
+        .textarea {
+            width: 625rpx;
+            height: 130rpx;
+            margin: 20rpx 0 20rpx 30rpx;
+        }
+
+        .upload {
+            width: 100%;
+            height: 88rpx;
+            box-sizing: border-box;
+            border-bottom: 2rpx solid #CCCCCC;
+            border-top: 2rpx solid #CCCCCC;
+            background-color: #F4F5F7;
+        }
+
+        .title {
+            margin: 20rpx 0 0 0;
+        }
+    }
+
+    navigator {
+        width: 750rpx;
+        background: #FFFFFF;
+        box-sizing: border-box;
+        padding-left: 30rpx;
+
+        >view {
+            display: flex;
+            align-items: center;
+            border-top: 2rpx solid #ccc;
+            height: 90rpx;
+            width: 100%;
+            box-sizing: border-box;
+
+            .label {
+                font-size: 28rpx;
+                font-family: PingFang SC-Regular, PingFang SC;
+                color: #666666;
+                padding-left: 20rpx;
+                width: 290rpx;
+                box-sizing: border-box;
+            }
+
+            .text {
+                flex: 1;
+                font-size: 28rpx;
+                font-family: PingFang SC-Regular, PingFang SC;
+                color: #333333;
+            }
+
+            .iconfont {
+                flex-shrink: 0;
+                margin-right: 36rpx;
+            }
+        }
+    }
+}
+
+.footer {
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+    position: fixed;
+    width: 750rpx;
+    height: 130rpx;
+    background: #FFFFFF;
+    box-shadow: 0px -4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+    bottom: 0;
+
+    .but {
+        width: 156rpx;
+        height: 90rpx;
+        background: #3874F6;
+        border-radius: 8rpx;
+        font-size: 28rpx;
+        font-family: PingFang SC-Bold, PingFang SC;
+        font-weight: bold;
+        color: #FFFFFF;
+        margin-right: 30rpx;
+    }
+}

+ 33 - 0
packageA/setclient/modules/trace/add/index.wxml

@@ -0,0 +1,33 @@
+<view class="box">
+    <view class="title">记录跟进内容</view>
+    <view class="content">
+        <textarea class="textarea" placeholder='请填写' value="{{content}}" bindinput='onInput' />
+        <view class="upload">
+
+        </view>
+        <view class="title">
+            附件列表:
+        </view>
+    </view>
+    <navigator url="#" bindtap="openSelect">
+        <view>
+            <view class="label">跟进方式</view>
+            <view class="text">{{type||"请选择"}}</view>
+            <text class="iconfont icon-a-wodetiaozhuan" />
+        </view>
+    </navigator>
+    <navigator url="#" bindtap="selectUser">
+        <view>
+            <view class="label">跟进客户联系人</view>
+            <view class="text">请选择</view>
+            <text class="iconfont icon-a-wodetiaozhuan" />
+        </view>
+    </navigator>
+</view>
+
+<van-action-sheet show="{{ show }}" actions="{{ actions }}" bind:cancel='onCancel' bind:select='onSelect' cancel-text="取消" />
+
+<view style="height: 130rpx;" />
+<view class="footer">
+    <van-button custom-class='but' disabled='{{!content}}' bindtap="submit">确定</van-button>
+</view>

+ 35 - 0
packageA/setclient/modules/trace/list/delete.js

@@ -0,0 +1,35 @@
+const _Http = getApp().globalData.http;
+
+Page({
+    data: {
+        deletereason: "",
+    },
+    onLoad(options) {
+        if (options.item) this.setData({
+            ...JSON.parse(options.item)
+        })
+    },
+    onInput(e) {
+        this.setData({
+            deletereason: e.detail.value
+        })
+    },
+    handleDetele() {
+        if(!this.data.deletereason) return;
+        _Http.basic({
+            "id": 20220930121701,
+            "content": {
+                ...this.data
+            }
+        }).then(res => {
+            console.log("删除", res);
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            });
+            wx.navigateBack();
+            const pages = getCurrentPages();
+            console.log(pages[pages.length - 2].selectComponent("#Trace").setDelete(this.data.sys_datafollowupid))
+        })
+    }
+})

+ 4 - 0
packageA/setclient/modules/trace/list/delete.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "作废原因"
+}

+ 58 - 0
packageA/setclient/modules/trace/list/delete.scss

@@ -0,0 +1,58 @@
+.box {
+    width: 100vw;
+    padding: 20rpx 30rpx;
+    background-color: #fff;
+    box-sizing: border-box;
+
+    .title {
+        font-size: 28rpx;
+        font-family: PingFang SC-Regular, PingFang SC;
+        color: #333333;
+
+        text {
+            color: #FF3B30;
+            margin-right: 8rpx;
+        }
+    }
+
+    .content {
+        width: 690rpx;
+        height: 200rpx;
+        background: #FFFFFF;
+        border-radius: 8rpx;
+        opacity: 1;
+        border: 2rpx solid #CCCCCC;
+        margin-top: 20rpx;
+        box-sizing: border-box;
+        padding: 20rpx;
+
+        textarea {
+            width: 100%;
+            height: 100%;
+        }
+    }
+}
+
+.footer {
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+    position: fixed;
+    width: 100vw;
+    height: 130rpx;
+    background: #FFFFFF;
+    box-shadow: 0px -4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
+    bottom: 0;
+
+    .custom {
+        width: 156rpx;
+        height: 90rpx;
+        background: #3874F6;
+        border-radius: 8rpx;
+        font-size: 28rpx;
+        font-family: PingFang SC-Bold, PingFang SC;
+        font-weight: bold;
+        color: #FFFFFF;
+        margin-right: 30rpx;
+    }
+}

+ 12 - 0
packageA/setclient/modules/trace/list/delete.wxml

@@ -0,0 +1,12 @@
+<view class="box">
+    <view class="title">
+        <text>*</text>请说明作废原因
+    </view>
+    <view class="content">
+        <textarea placeholder="请说明作废原因" value="{{deletereason}}" bindinput="onInput" />
+    </view>
+</view>
+
+<view class="footer">
+    <van-button custom-class='custom' deletereason disabled='{{!deletereason}}' bindtap="handleDetele">提交</van-button>
+</view>

+ 38 - 0
packageA/setclient/modules/trace/list/index.js

@@ -0,0 +1,38 @@
+const _Http = getApp().globalData.http;
+
+Component({
+    options: {
+        addGlobalClass: true
+    },
+    properties: {
+        list: Array,
+        ownertable: String,
+        ownerid: String,
+        changeTotal: Function
+    },
+    data: {
+
+    },
+    methods: {
+        editItem(e) {
+            const {
+                item
+            } = e.currentTarget.dataset;
+            wx.navigateTo({
+                url: `/packageA/setclient/modules/trace/add/index?ownertable=${this.data.ownertable}&ownerid=${this.data.ownerid}&content=${item.content}&type=${item.type}&sys_datafollowupid=${item.sys_datafollowupid}`,
+            });
+        },
+        deleteItem(e) {
+            const {
+                item
+            } = e.currentTarget.dataset;
+            wx.navigateTo({
+                url: `/packageA/setclient/modules/trace/list/delete?item=${JSON.stringify({
+                    "sys_datafollowupid": item.sys_datafollowupid,
+                    "ownertable": this.data.ownertable,
+                    "ownerid": this.data.ownerid
+                })}`,
+            })
+        },
+    }
+})

+ 4 - 0
packageA/setclient/modules/trace/list/index.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 96 - 0
packageA/setclient/modules/trace/list/index.scss

@@ -0,0 +1,96 @@
+.box {
+    background-color: #ffffff;
+    margin-bottom: 20rpx;
+    .item {
+        width: 100vw;
+        padding: 20rpx 30rpx;
+        box-sizing: border-box;
+        border-bottom: 1px solid #DDDDDD;
+
+        .user {
+            display: flex;
+
+            .portrait {
+                width: 80rpx;
+                height: 80rpx;
+                text-align: center;
+                line-height: 80rpx;
+                border-radius: 50%;
+                background-color: #3874F6;
+                font-size: 28rpx;
+                font-family: PingFang SC-Regular, PingFang SC;
+                color: #FFFFFF;
+                margin-right: 20rpx;
+                flex-shrink: 0;
+            }
+
+            .content {
+                .label {
+                    font-size: 30rpx;
+                    font-family: PingFang SC-Regular, PingFang SC;
+                    color: #333333;
+
+                    text {
+                        font-size: 24rpx;
+                        font-family: PingFang SC-Regular, PingFang SC;
+                        color: #999999;
+                    }
+                }
+
+                .date {
+                    font-size: 24rpx;
+                    font-family: PingFang SC-Regular, PingFang SC;
+                    color: #999999;
+                    margin-top: 6rpx;
+                }
+            }
+
+
+        }
+
+        .text {
+            width: 100%;
+            font-size: 28rpx;
+            font-family: PingFang SC-Regular, PingFang SC;
+            color: #666666;
+            word-break: break-all;
+            margin-top: 20rpx;
+        }
+
+        .type {
+            font-size: 24rpx;
+            font-family: PingFang SC-Regular, PingFang SC;
+            color: #999999;
+            margin-top: 20rpx;
+
+            text {
+                font-size: 24rpx;
+                color: #333333;
+            }
+        }
+    }
+
+    .bottom {
+        display: flex;
+        justify-content: flex-end;
+        width: 100%;
+        height: 80rpx;
+        background: #FFFFFF;
+
+        navigator {
+            padding: 0 20rpx;
+            line-height: 80rpx;
+            .iconfont {
+                font-size: 28rpx;
+                color: #999999;
+                margin-right: 8rpx;
+            }
+
+            font-size: 24rpx;
+            font-family: PingFang SC-Regular,
+            PingFang SC;
+            color: #333333;
+        }
+
+    }
+}

+ 34 - 0
packageA/setclient/modules/trace/list/index.wxml

@@ -0,0 +1,34 @@
+<view class="box" wx:for="{{list}}" wx:key="item.sys_datafollowupid">
+    <navigator url="#" class="item">
+        <view class="user">
+            <view class="portrait">
+                {{item.createby[0]}}
+            </view>
+            <view class="content">
+                <view class="label">
+                    {{item.createby}}
+                    <text>{{item.userextend[0].position}}</text>
+                </view>
+                <view class="date">
+                    {{item.createdate}}
+                </view>
+            </view>
+        </view>
+        <view class="text">
+            {{item.content}}
+        </view>
+
+        <view class="type" wx:if="{{item.type}}">
+            跟进类型:<text>{{item.type}}</text>
+        </view>
+    </navigator>
+    <view class="bottom">
+        <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>
+    </view>
+</view>
+<My_empty wx:if="{{list.length==0}}" />