|  |  |  | 
|---|
|  |  |  | <scroll-view scroll-y="true" > | 
|---|
|  |  |  | <view class="header"> | 
|---|
|  |  |  | <view class="cstmr-name"> | 
|---|
|  |  |  | <image src="../../../static/image/jiafangdanwei.png" mode="aspectFit"></image> | 
|---|
|  |  |  | <image src="../../../static/image/infoSea.png" mode="aspectFit"></image> | 
|---|
|  |  |  | <view>{{cstmr.name}}</view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="cstmr-tel">{{cstmr.tel}} | {{cstmr.addr}} | {{cstmr.director$}}</view> | 
|---|
|  |  |  | <!-- {{cstmr.tel}} | {{cstmr.addr}} | {{cstmr.director$ ? cstmr.director$ : '--'}} --> | 
|---|
|  |  |  | <view class="cstmr-tel"> | 
|---|
|  |  |  | <view class="tel-box"> | 
|---|
|  |  |  | <view>客户电话</view> | 
|---|
|  |  |  | <view >{{cstmr.tel ? cstmr.tel : '--'}}</view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="tel-box"> | 
|---|
|  |  |  | <view>客户详细地址</view> | 
|---|
|  |  |  | <view >{{cstmr.addr ? cstmr.addr : '--'}}</view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="tel-box"> | 
|---|
|  |  |  | <view>负责人</view> | 
|---|
|  |  |  | <view >{{cstmr.director$ ? cstmr.director$ : '--'}}</view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="container"> | 
|---|
|  |  |  | <view><y-title title="基本信息"></y-title></view><view></view> | 
|---|
|  |  |  | <view class="list-item1">客户代号</view><view class="list-item2">{{cstmr.uuid}}</view> | 
|---|
|  |  |  | <view class="list-item1">所属部门</view><view class="list-item2">{{cstmr.deptId$}}</view> | 
|---|
|  |  |  | <view class="list-item1">客户名称</view><view class="list-item2">{{cstmr.name}}</view> | 
|---|
|  |  |  | <view class="list-item1">客户类别</view><view class="list-item2">{{cstmr.cstmrType$}}</view> | 
|---|
|  |  |  | <view class="list-item1">省市区</view><view class="list-item2">{{cstmr.pcd$}}</view> | 
|---|
|  |  |  | <view class="list-item1">客户联系人</view><view class="list-item2">{{cstmr.contacts}}</view> | 
|---|
|  |  |  | <view class="list-item1">备注</view><view class="list-item2">{{cstmr.remarks  ? cstmr.remarks : '--'}}</view> | 
|---|
|  |  |  | <view class="list-item1">负责人</view><view class="list-item2 color-main">{{cstmr.director$}}</view> | 
|---|
|  |  |  | <view class="list-item1">区分</view><view class="list-item2">{{cstmr.type$}}</view> | 
|---|
|  |  |  | <view class="list-item1">客户关系</view><view class="list-item2">{{cstmr.rela  ? cstmr.rela : '--'}}</view> | 
|---|
|  |  |  | <view class="list-item1">详细地址</view><view class="list-item2">{{cstmr.addr}}</view> | 
|---|
|  |  |  | <view class="list-item1">电话</view><view class="list-item2 color-main">{{cstmr.tel}}</view> | 
|---|
|  |  |  | <view class="list-item1">客户代号</view><view class="list-item2">{{cstmr.uuid}}</view> | 
|---|
|  |  |  | <view class="list-item1">客户行业</view><view class="list-item2">{{cstmr.industry}}</view> | 
|---|
|  |  |  | <view class="list-item1">产品类别</view><view class="list-item2">{{cstmr.productCategory}}</view> | 
|---|
|  |  |  | <view class="list-item1">备注</view><view class="list-item2">{{cstmr.remarks  ? cstmr.remarks : '--'}}</view> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- <view class="list-item1">客户关系</view><view class="list-item2">{{cstmr.rela  ? cstmr.rela : '--'}}</view> --> | 
|---|
|  |  |  | <!-- <view class="list-item1">详细地址</view><view class="list-item2">{{cstmr.addr}}</view> --> | 
|---|
|  |  |  | <!-- <view class="list-item1">电话</view><view class="list-item2 color-main">{{cstmr.tel}}</view> --> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="container"> | 
|---|
|  |  |  | <view class="container2"> | 
|---|
|  |  |  | <view><y-title title="其他信息"></y-title></view><view></view> | 
|---|
|  |  |  | <view class="list-item1">添加人员</view><view class="list-item2 color-main">{{cstmr.createBy$}}</view> | 
|---|
|  |  |  | <view class="list-item1">添加时间</view><view class="list-item2">{{cstmr.createTime$}}</view> | 
|---|
|  |  |  | <view class="list-item1">修改人员</view><view class="list-item2">{{cstmr.updateBy$}}</view> | 
|---|
|  |  |  | <view class="list-item1">修改时间</view><view class="list-item2 color-main">{{cstmr.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 class="container2-sub"> | 
|---|
|  |  |  | <view class="sub-item"> | 
|---|
|  |  |  | <view class="list-item1">添加人员</view><view class="list-item2 color-main">{{cstmr.createBy$}}</view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="sub-item"> | 
|---|
|  |  |  | <view class="list-item1">添加时间</view><view class="list-item2">{{cstmr.createTime$}}</view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="sub-item"> | 
|---|
|  |  |  | <view class="list-item1">修改人员</view><view class="list-item2">{{cstmr.updateBy$}}</view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="sub-item"> | 
|---|
|  |  |  | <view class="list-item1">修改时间</view><view class="list-item2 color-main">{{cstmr.updateTime$}}</view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </scroll-view> | 
|---|
|  |  |  | <view class="foot"> | 
|---|
|  |  |  | <button  size="mini" type="warn" @click="del(id)">删除</button> | 
|---|
|  |  |  | <button  size="mini" type="primary" @click="edite(id)">修改</button> | 
|---|
|  |  |  | <button  size="mini" type="warn" @click="del(id)" v-show="isDel">删除</button> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <view> | 
|---|
|  |  |  | <!-- 输入框示例 --> | 
|---|
|  |  |  | <!-- 输入框示例 --> | 
|---|
|  |  |  | <!-- <view> | 
|---|
|  |  |  | <uni-popup ref="inputDialog" type="dialog"> | 
|---|
|  |  |  | <uni-popup-dialog ref="inputClose" mode="input" title="添加跟进人" value="对话框预置提示内容!" | 
|---|
|  |  |  | placeholder="请输入内容" @confirm="confirm"> | 
|---|
|  |  |  | 
|---|
|  |  |  | v-model="addFollower.follower" @input="autoLoad('follower',addFollower.follower)"></uni-combox> | 
|---|
|  |  |  | </uni-popup-dialog> | 
|---|
|  |  |  | </uni-popup> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> --> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | id: 0, | 
|---|
|  |  |  | baseUrl: '', | 
|---|
|  |  |  | cstmr: { | 
|---|
|  |  |  | id: '', | 
|---|
|  |  |  | name: '河北君邦乳业有限公司', | 
|---|
|  |  |  | tel: '15067665399', | 
|---|
|  |  |  | addr: '河北省邯郸市君邦乳业有限公司', | 
|---|
|  |  |  | cstman: '朱明忠' | 
|---|
|  |  |  | name: '', | 
|---|
|  |  |  | tel: '', | 
|---|
|  |  |  | addr: '', | 
|---|
|  |  |  | cstman: '' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | addFollower: { | 
|---|
|  |  |  | follower: '', | 
|---|
|  |  |  | 
|---|
|  |  |  | followerList: [] | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | followers: [], | 
|---|
|  |  |  | cstmrId: '' | 
|---|
|  |  |  | cstmrId: '', | 
|---|
|  |  |  | isDel: true | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onLoad(option) { | 
|---|
|  |  |  | if (option.type == 'info') { | 
|---|
|  |  |  | this.isDel = false | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.id = option.id | 
|---|
|  |  |  | this.baseUrl = uni.getStorageSync('baseUrl') | 
|---|
|  |  |  | this.init() | 
|---|
|  |  |  | this.autoLoad('follower','') | 
|---|
|  |  |  | setTimeout(()=>{ | 
|---|
|  |  |  | this.getFollowers() | 
|---|
|  |  |  | },500) | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | init() { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | del(id) { | 
|---|
|  |  |  | edite() { | 
|---|
|  |  |  | let _this = this | 
|---|
|  |  |  | uni.navigateTo({ | 
|---|
|  |  |  | url: '/pages/business/cstmr/modiCsmter', | 
|---|
|  |  |  | success: function(res) { | 
|---|
|  |  |  | res.eventChannel.emit('cstmr', { | 
|---|
|  |  |  | data: _this.cstmr | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | del(e) { | 
|---|
|  |  |  | let that = this | 
|---|
|  |  |  | var ida ; | 
|---|
|  |  |  | id = Number(id) | 
|---|
|  |  |  | ida.push(id) | 
|---|
|  |  |  | console.log(ida); | 
|---|
|  |  |  | e = Number(e) | 
|---|
|  |  |  | uni.request({ | 
|---|
|  |  |  | url: that.baseUrl + '/cstmr/delete/auth', | 
|---|
|  |  |  | url: that.baseUrl + '/cstmr/delete/one/' + e, | 
|---|
|  |  |  | header: {'token' : uni.getStorageSync('token'), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | data: ida, | 
|---|
|  |  |  | method: 'POST', | 
|---|
|  |  |  | method: 'GET', | 
|---|
|  |  |  | success(res) { | 
|---|
|  |  |  | console.log(res); | 
|---|
|  |  |  | res = res.data | 
|---|
|  |  |  | if (res.code === 200) { | 
|---|
|  |  |  | uni.navigateBack() | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 确认选择工作人 | 
|---|
|  |  |  | 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 + '/cstmr/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 = '' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 工作人列表 | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | removeFollowers(userId) { | 
|---|
|  |  |  | let that = this | 
|---|
|  |  |  | console.log(that.cstmrId); | 
|---|
|  |  |  | uni.request({ | 
|---|
|  |  |  | url: that.baseUrl + '/cstmr/followers/remove/auth', | 
|---|
|  |  |  | header:{'token':uni.getStorageSync('token')}, | 
|---|
|  |  |  | 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 | 
|---|
|  |  |  | console.log(res); | 
|---|
|  |  |  | that.getFollowers() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | 
|---|
|  |  |  | .header { | 
|---|
|  |  |  | width: auto; | 
|---|
|  |  |  | min-height: 110rpx; | 
|---|
|  |  |  | background-color: #f8f8f8; | 
|---|
|  |  |  | background-color: #fff; | 
|---|
|  |  |  | padding: 30px 20px 10px 20px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .cstmr-name { | 
|---|
|  |  |  | 
|---|
|  |  |  | height: 35rpx; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .cstmr-tel { | 
|---|
|  |  |  | min-height: 60rpx; | 
|---|
|  |  |  | line-height: 60rpx; | 
|---|
|  |  |  | font-size: 24rpx; | 
|---|
|  |  |  | color: #303133; | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .tel-box { | 
|---|
|  |  |  | margin-top: 20rpx; | 
|---|
|  |  |  | padding-right: 8rpx; | 
|---|
|  |  |  | margin-left: 10rpx; | 
|---|
|  |  |  | border-right: 1px solid #b1b3b8; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .tel-box:last-child { | 
|---|
|  |  |  | border: none | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .container { | 
|---|
|  |  |  | margin-top: 10px; | 
|---|
|  |  |  | padding: 10rpx 20rpx 0 20rpx; | 
|---|
|  |  |  | background-color: #f8f8f8; | 
|---|
|  |  |  | background-color: #fff; | 
|---|
|  |  |  | display: grid; | 
|---|
|  |  |  | grid-template-columns: 1fr 3fr; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .container:last-child { | 
|---|
|  |  |  | grid-template-columns: 5fr 5fr 2fr; | 
|---|
|  |  |  | margin-bottom: 120rpx; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .container2 { | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | flex-direction: column; | 
|---|
|  |  |  | margin-top: 10px; | 
|---|
|  |  |  | padding: 10rpx 20rpx 0 20rpx; | 
|---|
|  |  |  | background-color: #fff; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .container2-sub { | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | flex-direction: column; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .sub-item { | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .list-item1 { | 
|---|
|  |  |  | min-height: 45rpx; | 
|---|
|  |  |  | 
|---|
|  |  |  | text-indent: 30rpx; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .list-item2 { | 
|---|
|  |  |  | margin-left: 10rpx; | 
|---|
|  |  |  | min-height: 45rpx; | 
|---|
|  |  |  | line-height: 45rpx; | 
|---|
|  |  |  | color: black; | 
|---|
|  |  |  | 
|---|
|  |  |  | min-height: 100rpx; | 
|---|
|  |  |  | bottom: 0; | 
|---|
|  |  |  | margin-bottom: 0; | 
|---|
|  |  |  | background-color: #f8f8f8; | 
|---|
|  |  |  | background-color: #fff; | 
|---|
|  |  |  | border-top: 1px solid #efefef; | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | align-items: center; | 
|---|
|  |  |  | 
|---|
|  |  |  | /* 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> | 
|---|