#
whycq
2023-09-09 cd5d58fadfb681f82d00f8ec7628d77a63f39d76
#
7个文件已修改
369 ■■■■■ 已修改文件
pages/business/plan/addPlan2.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/business/plan/addPlan3.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/business/plan/addPlan4.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/business/plan/addPlan5.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/business/plan/addPlan6.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/business/plan/plan.vue 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/business/plan/planDetails.vue 327 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/business/plan/addPlan2.vue
@@ -142,7 +142,7 @@
                    userId: '',
                    appleTime: '',
                    cstmrId: '',
                    planType: '立体库(货架)',
                    planType: '立体库(集成)',
                    select_2: '',
                    changeReason: '',
                    changeTime: '',
pages/business/plan/addPlan3.vue
@@ -88,7 +88,7 @@
                    userId: '',
                    appleTime: '',
                    cstmrId: '',
                    planType: '立体库(货架)',
                    planType: '四向穿梭库/两向穿梭库',
                    select_2: '',
                    changeReason: '',
                    changeTime: '',
@@ -263,7 +263,7 @@
                        that.baseFormData.userId = element.id
                    }
                }
                that.baseFormData.planType = 5
                that.baseFormData.planType = 3
                var temp 
                for (var i = 0 ; i < that.baseFormData.planNeed.length; i++) {
                    if (i == 0) {
pages/business/plan/addPlan4.vue
@@ -88,7 +88,7 @@
                    userId: '',
                    appleTime: '',
                    cstmrId: '',
                    planType: '立体库(货架)',
                    planType: '阁楼货架/钢平台',
                    select_2: '',
                    changeReason: '',
                    changeTime: '',
@@ -263,7 +263,7 @@
                        that.baseFormData.userId = element.id
                    }
                }
                that.baseFormData.planType = 5
                that.baseFormData.planType = 7
                var temp 
                for (var i = 0 ; i < that.baseFormData.planNeed.length; i++) {
                    if (i == 0) {
pages/business/plan/addPlan5.vue
@@ -88,7 +88,7 @@
                    userId: '',
                    appleTime: '',
                    cstmrId: '',
                    planType: '立体库(货架)',
                    planType: '周转容器',
                    select_2: '',
                    changeReason: '',
                    changeTime: '',
@@ -263,7 +263,7 @@
                        that.baseFormData.userId = element.id
                    }
                }
                that.baseFormData.planType = 5
                that.baseFormData.planType = 8
                var temp 
                for (var i = 0 ; i < that.baseFormData.planNeed.length; i++) {
                    if (i == 0) {
pages/business/plan/addPlan6.vue
@@ -88,7 +88,7 @@
                    userId: '',
                    appleTime: '',
                    cstmrId: '',
                    planType: '立体库(货架)',
                    planType: '平库',
                    select_2: '',
                    changeReason: '',
                    changeTime: '',
@@ -263,7 +263,7 @@
                        that.baseFormData.userId = element.id
                    }
                }
                that.baseFormData.planType = 5
                that.baseFormData.planType = 9
                var temp 
                for (var i = 0 ; i < that.baseFormData.planNeed.length; i++) {
                    if (i == 0) {
pages/business/plan/plan.vue
@@ -100,21 +100,13 @@
        },
        methods: {
            add(val) {
                switch (val) {
                    case 1:
                        uni.navigateTo({
                            url:'/pages/business/plan/addPlan',
                        })
                        break;
                    case 2:
                        uni.navigateTo({
                            url:'/pages/business/plan/addPlan2',
                        })
                        break;
                    default:
                        console.log(val);
                        break;
                let addPlan = 'addPlan'
                if (val > 1) {
                    addPlan = 'addPlan' + val
                }
                uni.navigateTo({
                    url:'/pages/business/plan/' + addPlan,
                })
            },
            toggle(type) {
                this.type = type
@@ -165,7 +157,7 @@
            getCsmtr() {
                let that = this
                uni.request({
                    url: that.baseUrl + '/cstmr/page/auth',
                    url: that.baseUrl + '/plan/page/auth',
                    header: {'token' : uni.getStorageSync('token'),},
                    data: {curr:that.curr,limit:4},
                    method:'GET',
@@ -205,7 +197,7 @@
            },
            getDetails(id) {
                uni.navigateTo({
                    url: '/pages/business/cstmr/cstmrDetails?id=' + id
                    url: '/pages/business/plan/planDetails?id=' + id
                })
            },
            // ---
pages/business/plan/planDetails.vue
@@ -1,8 +1,335 @@
<template>
    <view>
        <scroll-view scroll-y="true" >
            <view class="header">
                <view class="detl-name">
                    <image src="../../../static/image/dingdanguanli.png" mode="aspectFit"></image>
                    <view>{{detl.name}}</view>
                </view>
                <view class="detl-tel">{{detl.createBy$}} | {{detl.orderId$}} | {{detl.cstmrId$}}</view>
            </view>
            <!-- 步骤条 -->
            <view style="background-color: #FFF;margin-top: 10px;padding-top: 20px;padding-bottom: 20px;">
                <uni-steps :options="list1" :active="active" />
            </view>
            <!-- 基本信息 -->
            <view class="container">
                <view><y-title title="基本信息"></y-title></view><view></view>
                <view class="list-item1">规划单号</view><view class="list-item2">{{detl.uuid}}</view>
                <view class="list-item1">申请日期</view><view class="list-item2">{{detl.appleTime$}}</view>
                <view class="list-item1">跟踪项目</view><view class="list-item2">{{detl.orderId$}}</view>
                <view class="list-item1">客户名称</view><view class="list-item2">{{detl.cstmrId$}}</view>
                <view class="list-item1">业务员</view><view class="list-item2">{{detl.userId$}}</view>
                <view class="list-item1">审批状态</view><view class="list-item2">{{detl.settle$}}</view>
                <view class="list-item1">业务类型</view><view class="list-item2">{{detl.planType$}}</view>
            </view>
            <!-- 其他信息 -->
            <view class="container">
                <view><y-title title="其他信息"></y-title></view><view></view>
                <view class="list-item1">货物规格</view><view class="list-item2">{{detl.createBy$}}</view>
                <view class="list-item1">进叉方向</view><view class="list-item2">{{detl.createTime$}}</view>
                <view class="list-item1">修改人员</view><view class="list-item2">{{detl.updateBy$}}</view>
                <view class="list-item1">修改时间</view><view class="list-item2">{{detl.updateTime$}}</view>
            </view>
            <!-- 售前规划 -->
            <view class="container">
                <view><y-title title="跟进人"></y-title></view><view></view><view><uni-icons @click="addPerson()" type="plus" size="20" color="#55aaff"></uni-icons></view>
                <view class="list" v-for="(item,index) in followers" :key="index">
                    <view class="list-left">{{item.userName}}</view>
                    <view class="list-right"><button size="mini" style="float: right;" type="warn" @click="removeFollowers(item.userId)">移除</button></view>
                </view>
                <view class="list-none" v-show="followers.length == 0">
                    <text>暂无跟进人</text>
                </view>
            </view>
        </scroll-view>
        <view class="foot">
            <button  size="mini" type="warn" @click="del(id)">删除</button>
        </view>
        <view>
            <!-- 输入框示例 -->
            <uni-popup ref="inputDialog" type="dialog">
                <uni-popup-dialog ref="inputClose" mode="input" title="添加跟进人" value="对话框预置提示内容!"
                    placeholder="请输入内容" @confirm="confirm">
                        <uni-combox :candidates="addFollower.followers" placeholder="请选择"
                        v-model="addFollower.follower" @input="autoLoad('follower',addFollower.follower)"></uni-combox>
                </uni-popup-dialog>
            </uni-popup>
        </view>
    </view>
</template>
<script>
    export default {
        data() {
            return {
                id: 0,
                detl: {
                    id: '',
                    name: '',
                    tel: '',
                    addr: '',
                    cstman: ''
                },
                addFollower: {
                    follower: '',
                    followers: '',
                    followerList: []
                },
                followers: [],
                cstmrId: '',
                active: 0,
                list1: [{
                    title: '开始',
                    desc: ''
                }, {
                    title: '组长审核',
                    desc: ''
                }, {
                    title: '售前审核',
                    desc: ''
                }, {
                    title: '规划员审核',
                    desc: ''
                },{
                    title: '审核通过',
                    desc: ''
                }]
            }
        },
        onLoad(option) {
            this.id = option.id
            this.init()
            this.autoLoad('follower','')
            setTimeout(()=>{
                this.getFollowers()
            },500)
        },
        methods: {
            init() {
                let that = this
                uni.request({
                    url: that.baseUrl + '/plan/' + that.id +'/auth',
                    header: {'token' : uni.getStorageSync('token')},
                    method: 'GET',
                    success(res) {
                        console.log(res);
                        res = res.data
                        that.detl = res.data
                        that.active = res.data.settle
                        that.cstmrId = that.cstmr.id
                    }
                })
            },
            del(e) {
                let that = this
                e = Number(e)
                uni.request({
                    url: that.baseUrl + '/detl/delete/one/' + e,
                    header: {'token' : uni.getStorageSync('token'),
                    },
                    method: 'GET',
                    success(res) {
                        console.log(res);
                        res = res.data
                        if (res.code === 200) {
                            uni.navigateBack()
                        } else if (res.code === 403) {
                            uni.showToast({title: res.msg, icon: "none", position: 'top'})
                            setTimeout(() => {
                                uni.reLaunch({
                                    url: '../../login/login'
                                });
                            }, 1000);
                        } else {
                            uni.showToast({title: res.msg, icon: "none",position: 'top'})
                        }
                    }
                })
            },
            addPerson() {
                this.$refs.inputDialog.open()
            },
            // 确认选择工作人
            confirm() {
                let that = this
                var followerId
                var followerList = that.addFollower.followerList
                for (var i = 0;i < followerList.length; i++) {
                    if (followerList[i].name == this.addFollower.follower) {
                        followerId =followerList[i].value
                    }
                }
                uni.request({
                    url: that.baseUrl + '/detl/followers/add/json',
                    header:{'token':uni.getStorageSync('token'),
                        // 'content-type':'application/x-www-form-urlencoded',
                        },
                    data: {
                        cstmrId: that.cstmrId,
                        followerIds:followerId},
                    method: 'POST',
                    success(result) {
                        var res = result.data
                        that.getFollowers()
                    }
                })
                this.addFollower.follower = ''
            },
            // 工作人列表
            autoLoad(type,condition) {
                let that = this
                that.addFollower.followers = []
                that.addFollower.followerList = []
                uni.request({
                    url: that.baseUrl + '/user/all/get/kv',
                    header:{'token':uni.getStorageSync('token')},
                    data: {condition:condition},
                    method: 'POST',
                    success(result) {
                        var res = result.data
                        if (res.code === 200) {
                            var element;
                            if (type == 'follower') {
                                for(element of res.data) {
                                    that.addFollower.followers.push(element.name)
                                    that.addFollower.followerList.push(element)
                                }
                                return
                            }
                        }
                    }
                })
            },
            getFollowers() {
                let that = this
                uni.request({
                    url: that.baseUrl + '/detl/followers/table/auth',
                    header:{'token':uni.getStorageSync('token')},
                    data: {cstmrId:that.cstmrId},
                    method:'GET',
                    success(res) {
                        res = res.data
                        that.followers = res.data
                    }
                })
            },
            removeFollowers(userId) {
                let that = this
                uni.request({
                    url: that.baseUrl + '/cstmr/followers/remove/auth',
                    header:{
                        'token':uni.getStorageSync('token'),
                        'content-type': 'application/x-www-form-urlencoded'
                    },
                    data: {
                        cstmrId:that.cstmrId,
                        userId: userId
                        },
                    method:'POST',
                    success(res) {
                        res = res.data
                        that.getFollowers()
                    }
                })
            }
        }
    }
</script>
<style>
    .header {
        width: auto;
        min-height: 110rpx;
        background-color: #fff;
        padding: 30px 20px 10px 20px;
    }
    .detl-name {
        display: flex;
        height: 35rpx;
        line-height: 35rpx;
        text-indent: 10rpx;
        font-size: 36rpx;
        color: #606266;
    }
    .detl-name image {
        width: 35rpx;
        height: 35rpx;
    }
    .detl-tel {
        min-height: 60rpx;
        line-height: 60rpx;
        font-size: 24rpx;
        color: #303133;
    }
    .container {
        margin-top: 10px;
        padding: 10rpx 20rpx 0 20rpx;
        background-color: #fff;
        display: grid;
        grid-template-columns: 1fr 3fr;
    }
    .container:last-child {
        grid-template-columns: 5fr 5fr 2fr;
        margin-bottom: 120rpx;
    }
    .list-item1 {
        min-height: 45rpx;
        line-height: 45rpx;
        color: #909399;
        text-indent: 30rpx;
    }
    .list-item2 {
        min-height: 45rpx;
        line-height: 45rpx;
        color: black;
    }
    .color-main {
        color: #55aaff
    }
    .foot {
        position: fixed;
        width: 100%;
        min-height: 100rpx;
        bottom: 0;
        margin-bottom: 0;
        background-color: #fff;
        border-top: 1px solid #efefef;
        display: flex;
        align-items: center;
    }
    .list {
        min-height: 60rpx;
        margin-top: 20rpx;
        grid-column: 1 / 10;
        display: grid;
        grid-template-columns: 1fr 1fr;
        position: relative;
    }
    .list-left {
        min-height: 60rpx;
        line-height: 60rpx;
        padding-left: 20rpx;
        color: #55aaff
    }
    .list-right {
        min-height: 60rpx;
        line-height: 60rpx;
        /* background-color: #222; */
        padding-right: 30rpx;
    }
    .list-none {
        min-height: 60rpx;
        margin-top: 20rpx;
        text-align: center;
        /* background-color: #303133; */
        color: #b1b3b8;
        grid-column: 1 / 10;
        display: grid;
        position: relative;
    }
</style>