From 81b8089d94e7f9537b8f5a00b68c95a9e858e2bf Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期一, 13 十一月 2023 12:48:41 +0800
Subject: [PATCH] #

---
 pages/business/cstmr/cstmrDetails.vue |   94 +++++++++++++++++++++++++---------------------
 1 files changed, 51 insertions(+), 43 deletions(-)

diff --git a/pages/business/cstmr/cstmrDetails.vue b/pages/business/cstmr/cstmrDetails.vue
index a562b54..5179652 100644
--- a/pages/business/cstmr/cstmrDetails.vue
+++ b/pages/business/cstmr/cstmrDetails.vue
@@ -6,21 +6,25 @@
 					<image src="../../../static/image/jiafangdanwei.png" mode="aspectFit"></image>
 					<view>{{cstmr.name}}</view>
 				</view>
-				<view class="cstmr-tel">{{cstmr.tel}} | {{cstmr.addr}} | {{cstmr.director$}}</view>
+				<view class="cstmr-tel">{{cstmr.tel}} | {{cstmr.addr}} | {{cstmr.director$ ? cstmr.director$ : '--'}}</view>
 			</view>
 			<view class="container">
 				<view><y-title title="鍩烘湰淇℃伅"></y-title></view><view></view>
+				<view class="list-item1">瀹㈡埛浠e彿</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">瀹㈡埛浠e彿</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><y-title title="鍏朵粬淇℃伅"></y-title></view><view></view>
@@ -30,20 +34,24 @@
 				<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><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="primary" @click="edite(id)">淇敼</button>
 			<button  size="mini" type="warn" @click="del(id)">鍒犻櫎</button>
 		</view>
 		
-		<view>
-			<!-- 杈撳叆妗嗙ず渚� -->
+		<!-- 杈撳叆妗嗙ず渚� -->
+		<!-- <view>
 			<uni-popup ref="inputDialog" type="dialog">
 				<uni-popup-dialog ref="inputClose" mode="input" title="娣诲姞璺熻繘浜�" value="瀵硅瘽妗嗛缃彁绀哄唴瀹�!"
 					placeholder="璇疯緭鍏ュ唴瀹�" @confirm="confirm">
@@ -51,7 +59,7 @@
 						v-model="addFollower.follower" @input="autoLoad('follower',addFollower.follower)"></uni-combox>
 				</uni-popup-dialog>
 			</uni-popup>
-		</view>
+		</view> -->
 	</view>
 </template>
 
@@ -60,13 +68,12 @@
 		data() {
 			return {
 				id: 0,
-				baseUrl: '',
 				cstmr: {
 					id: '',
-					name: '娌冲寳鍚涢偊涔充笟鏈夐檺鍏徃',
-					tel: '15067665399',
-					addr: '娌冲寳鐪侀偗閮稿競鍚涢偊涔充笟鏈夐檺鍏徃',
-					cstman: '鏈辨槑蹇�'
+					name: '',
+					tel: '',
+					addr: '',
+					cstman: ''
 				},
 				addFollower: {
 					follower: '',
@@ -79,14 +86,11 @@
 		},
 		onLoad(option) { 
 			this.id = option.id
-			this.baseUrl = uni.getStorageSync('baseUrl')
 			this.init()
 			this.autoLoad('follower','')
 			setTimeout(()=>{
 				this.getFollowers()
 			},500)
-			
-			
 		},
 		methods: {
 			init() {
@@ -102,18 +106,15 @@
 					}
 				})
 			},
-			del(id) {
+			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
@@ -138,29 +139,25 @@
 			// 纭閫夋嫨宸ヤ綔浜�
 			confirm() {
 				let that = this
-				var followerId = [],
-					cstmrId = [];
-					cstmrId.push(that.cstmrId)
+				var followerId
 				var followerList = that.addFollower.followerList
 				for (var i = 0;i < followerList.length; i++) {
 					if (followerList[i].name == this.addFollower.follower) {
-						followerId.push(followerList[i].value)
+						followerId =followerList[i].value
 					}
 				}
-				console.log(followerId);
-				var followerIds = []
 				uni.request({
 					url: that.baseUrl + '/cstmr/followers/add/json',
 					header:{'token':uni.getStorageSync('token'),
 						// 'content-type':'application/x-www-form-urlencoded',
 						},
 					data: {
-						cstmrId: 921,
-						followerIdList:[59,60]},
+						cstmrId: that.cstmrId,
+						followerIds:followerId},
 					method: 'POST',
 					success(result) {
 						var res = result.data
-						console.log(res);
+						that.getFollowers()
 					}
 				})
 				this.addFollower.follower = ''
@@ -177,7 +174,6 @@
 					method: 'POST',
 					success(result) {
 						var res = result.data
-						console.log(res);
 						if (res.code === 200) {
 							var element;
 							if (type == 'follower') {
@@ -206,10 +202,12 @@
 			},
 			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
@@ -217,7 +215,7 @@
 					method:'POST',
 					success(res) {
 						res = res.data
-						console.log(res);
+						that.getFollowers()
 					}
 				})
 			}
@@ -229,7 +227,7 @@
 	.header {
 		width: auto;
 		min-height: 110rpx;
-		background-color: #f8f8f8;
+		background-color: #fff;
 		padding: 30px 20px 10px 20px;
 	}
 	.cstmr-name {
@@ -253,7 +251,7 @@
 	.container {
 		margin-top: 10px;
 		padding: 10rpx 20rpx 0 20rpx;
-		background-color: #f8f8f8;
+		background-color: #fff;
 		display: grid;
 		grid-template-columns: 1fr 3fr;
 	}
@@ -281,7 +279,7 @@
 		min-height: 100rpx;
 		bottom: 0;
 		margin-bottom: 0;
-		background-color: #f8f8f8;
+		background-color: #fff;
 		border-top: 1px solid #efefef;
 		display: flex;
 		align-items: center;
@@ -306,4 +304,14 @@
 		/* 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>
\ No newline at end of file

--
Gitblit v1.9.1