Browse Source

基本全部完成

sunChengjie 1 year ago
parent
commit
31ab633612
6 changed files with 372 additions and 444 deletions
  1. 19 0
      src/api/index.js
  2. 1 1
      src/pages/express.vue
  3. 18 4
      src/pages/inexpress.vue
  4. 215 213
      src/pages/logisticslist.vue
  5. 11 4
      src/pages/my.vue
  6. 108 222
      src/pages/personinfomation.vue

+ 19 - 0
src/api/index.js

@@ -67,5 +67,24 @@ export function getExpressByUser(data) {
     })
 }
 
+// 我的-个人信息
+export function getUserByUserId(data) {
+    return request({
+        url: '/tianzong/client/user/getUserByUserId',
+        method: 'post',
+        data: data,
+        emulateJSON: true
+    })
+}
+// 我的-修改个人信息
+export function UserUpdate(data) {
+    return request({
+        url: '/tianzong/client/user/update',
+        method: 'post',
+        data: data,
+        emulateJSON: true
+    })
+}
+
 
 

+ 1 - 1
src/pages/express.vue

@@ -619,7 +619,7 @@ export default {
 				expressRemark: this.bz,//快递备注
 				expressWeight: this.stepper,//公斤
 				expressPrice: this.declaredValue,//价值
-				addressee_phone: this.elvenPhone,//收件人手机号
+				phone: this.elvenPhone,//收件人手机号
 			}
 			const res = await saveMailDo({ ...parmas })
 			if (res.msg == 'success') {

+ 18 - 4
src/pages/inexpress.vue

@@ -195,14 +195,17 @@
 						color="#1989fa" size="20" />
 				</div>
 
-				<van-cell-group @click="onGroup(item)" v-for="(item, index) in searchNameList" :key="index" inset
-					style="border-bottom: 1px solid #ccc; margin-bottom: 10px ; ">
+				<van-cell-group class="vanPopup" @click="onGroup(item)" v-for="(item, index) in searchNameList"
+					:key="index" inset>
 					<van-cell title="收件人姓名" :value="item.name" />
 					<van-cell title="部门" :value="item.departmentName" />
 					<van-cell title="座位" :value="item.seatNo" />
 					<van-cell title="收件人userID" :value="item.userId" style="display: none;" />
+					<!-- <div style="height: 1px; color: #1f1f1f; width: 100%; background-color: #ccc;"></div> -->
 				</van-cell-group>
 
+
+
 				<div style="height: 60px; width: 100%; background-color: #fff;"></div>
 
 				<van-button class="goback" @click="nameShowA = false" type="info">
@@ -665,6 +668,17 @@ export default {
 </script>
 
 <style scoped lang="less">
+.vanPopup {
+
+	border-bottom: 1px solid #ccc;
+	padding: 12px 0;
+	border-radius: 0px;
+
+	.van-cell {
+		padding: 0;
+	}
+}
+
 .content {
 	.jjinfo {
 		font-size: .24rem;
@@ -742,7 +756,7 @@ export default {
 		padding: .3rem 0px;
 		width: 6.84rem;
 		background: white;
-		border-radius: .05rem;
+		// border-radius: .05rem;
 		margin: 0rem auto .2rem;
 
 		/deep/.van-cell {
@@ -781,7 +795,7 @@ export default {
 			background: white;
 
 			padding: .3rem .3rem;
-			border-radius: .05rem;
+			// border-radius: .05rem;
 
 			.type_wp {
 				display: flex;

+ 215 - 213
src/pages/logisticslist.vue

@@ -2,46 +2,35 @@
 	<div>
 		<back :title="titlename"></back>
 		<div class="content">
-
-			<van-search v-model="value" @search="onSearch" placeholder="请输入运单号" />
-			<!-- table切换 -->
 			<div class="tab">
 				<div>
 					<p @click="tab(1)" :class="[index == 1 ? 'active' : '']">外部件</p>
 					<p @click="tab(2)" :class="[index == 2 ? 'active' : '']">内部件</p>
 				</div>
 			</div>
-			<!-- 按天按月 -->
-			<div class="change">
-				<div class="time">
-					<p @click="changetimeNew()" class="timeactive">日期筛选</p>
-					<!-- <p @click="changetime(1)" :class="[time==1?'timeactive':'']">按月</p>
-			<p @click="changetime(2)" :class="[time==2?'timeactive':'']">按天</p> -->
-				</div>
-				<div class="datapicker">
-					<p @click="showPicker = true">{{ timevalue }}</p>
-				</div>
-			</div>
 			<!-- 订单列表 -->
-			<div class="jjlist" v-for="item in mailList">
-				<div class="listinfo">
-					<div class="list_top" @click="mailDetail(item.id)">
-						<div class="list_top_left">
-							<img src="../assets/images/ad_icon1.png" alt="">
-							<div>
-								<p>寄件号 {{ item.orderId }}</p>
-								<p><template v-if="item.expressInfo == 1">顺丰</template>
-									<template v-if="item.expressInfo == 2">中通</template>
-									<template v-if="item.expressInfo == 3">DHL</template>
-									<template v-if="item.expressInfo == 4">EMS</template>
-									<template v-if="item.expressInfo == 5">同城</template>
-									<template v-if="item.expressInfo == 6">京东</template> {{ item.expressNo }}
-								</p>
-								<p><span>收</span>收件人 {{ item.name }} {{ item.phone }}</p>
-								<p>{{ item.province }} {{ item.city }} {{ item.county }}</p>
-							</div>
-						</div>
-						<p>
+			<div class="batch_box" @scroll.passive="getScroll($event)"
+				style=" height: calc(100vh - 18vh);overflow-y: auto;">
+				<van-pull-refresh v-model="refreshLoading" @refresh="onRefresh">
+					<div class="jjlist" v-for="item in mailList">
+						<div class="listinfo">
+							<div class="list_top">
+								<div class="list_top_left">
+									<img src="../assets/images/ad_icon1.png" alt="">
+									<div>
+										<p>寄件号 {{ item.orderId }}</p>
+										<!-- <p><template v-if="item.expressInfo == 1">顺丰</template>
+<template v-if="item.expressInfo == 2">中通</template>
+<template v-if="item.expressInfo == 3">DHL</template>
+<template v-if="item.expressInfo == 4">EMS</template>
+<template v-if="item.expressInfo == 5">同城</template>
+<template v-if="item.expressInfo == 6">京东</template> {{ item.expressNo }}
+</p> -->
+										<p><span>收</span>收件人 {{ item.name }} {{ item.phone }}</p>
+										<p>{{ item.province }} {{ item.city }} {{ item.county }}</p>
+									</div>
+								</div>
+								<!-- <p>
 							<template v-if="item.sendSt == 0">待审核</template>
 							<template v-if="item.sendSt == 1">待揽件</template>
 							<template v-if="item.sendSt == 3">待寄件</template>
@@ -51,52 +40,26 @@
 							<template v-if="item.sendSt == 10">派送中</template>
 							<template v-if="item.sendSt == 11">已签收</template>
 							<template v-if="item.sendSt == 12">拒签</template>
-						</p>
-					</div>
-				</div>
-			</div>
-			<!-- <div class="list">
-
-				
-				<div class="logistics" v-for="item in mailList">
-					<div class="logistics_top">
-						<p>订单号:<span :id="'copytkl' + item.orderId">{{ item.orderId }}</span></p>
-						<img :id="'fz' + item.orderId" @click="copyLink(item.orderId)" data-clipboard-action="copy"
-							:data-clipboard-target="'#copytkl' + item.orderId" src="../assets/images/2022copy.png"
-							alt="">
-					</div>
-					<div class="logistics_center">
-						<div>
-							<p>{{ item.sendCity }}</p>
-							<p>{{ item.sender }}</p>
+						</p> -->
+							</div>
+
 						</div>
-						<div>
-							<img v-if="item.sendSt == '待揽件'" src="../assets/images/j_ico01.png" alt="">
-							<img v-if="item.sendSt == '已揽收'" src="../assets/images/j_ico01.png" alt="">
-							<img v-if="item.sendSt == '派送中'" src="../assets/images/j_ico02.png" alt="">
-							<img v-if="item.sendSt == '已签收'" src="../assets/images/j_ico03.png" alt="">
-							<img v-if="item.sendSt == '已退回'" src="../assets/images/j_ico04.png" alt="">
-							<p>{{ item.sendSt }}</p>
+					</div>
+					<!-- <template v-if="!refreshLoading && expressList.length > 0">
+						<div class="bottom_text" v-if="loading">
+							加载中...
 						</div>
-						<div>
-							<p>{{ item.receiveCity }}</p>
-							<p>{{ item.receiver }}</p>
+						<div class="bottom_text" v-else-if="noData">
+							已经到底啦...
 						</div>
-					</div>
-				</div>
-			</div> -->
-			<!-- 日历选择 -->
-			<van-calendar color="#00c4b8" v-model:show="showPicker" type="range" :min-date="minDate" :max-date="maxDate"
-				@confirm="onConfirm" />
-			<!-- 时间选择 -->
-			<!-- <van-popup v-model:show="showPicker" position="bottom">
-				<van-datetime-picker :type="showPickertype" :max-date="maxDate" @confirm="onConfirm"
-					@cancel="showPicker = false" />
-			</van-popup> -->
-			<!-- <tabbar></tabbar> -->
+					</template>
+					<template v-if="expressList.length === 0">
+						<div class="bottom_text">数据为空!</div>
+					</template> -->
+				</van-pull-refresh>
+			</div>
 		</div>
 	</div>
-
 </template>
 
 <script>
@@ -108,7 +71,7 @@ export default {
 			titlename: "我的寄件",
 			expressType: '外部件',
 			userId: '',
-			mailList: "",
+			mailList: [],
 			index: 1,
 			time: 1,
 			value: "",
@@ -122,7 +85,9 @@ export default {
 			pageSize: {
 				page: 1,
 				limit: 10
-			}
+			},
+			refreshLoading: false, // 刷新loading
+			noData: false, // 没有更多数据
 		}
 	},
 	created: function () {
@@ -131,14 +96,63 @@ export default {
 		this.getmailList();
 	},
 	methods: {
+		// 刷新	
+		async onRefresh() {
+			this.pageSize.page = 1;
+			this.pageSize.limit = 10;
+			this.refreshLoading = true;
+			await this.getmailList(true)
+			this.refreshLoading = false
+		},
+		// 滚动事件
+		getScroll(event) {
+			let scrollBottom =
+				event.target.scrollHeight -
+				event.target.scrollTop -
+				event.target.clientHeight;
+			// 距离底部20px以内 && 还有数据 && 没有正在加载中
+			if (scrollBottom <= 20 && !this.noData && !this.loading) {
+				this.pageSize.page += 1;
+				this.getmailList();
+			}
+		},
+		// 获取数据
+		async getmailList(isClear) {
+			this.loading = true
+			Toast.loading({
+				message: '加载中...',
+				forbidClick: true,
+				duration: 0
+			});
+			let parmas = {
+				expressNo: this.value,
+				startTime: this.startTime,
+				endTime: this.endTime,
+				type: this.index,
+
+			}
+			const res = await getListByUser({ ...this.pageSize, ...parmas })
+			let expressListA = res.data
+			Toast.clear()
+
+			if (isClear) {
+				this.mailList = expressListA
+			} else {
+				this.mailList.push(...expressListA)
+			}
+
+			this.loading = false
+			if (this.pageSize.page * this.pageSize.limit >= res.count) {
+				this.noData = true;
+			} else {
+				this.noData = false;
+			}
+		},
+
 		//寄件详情
 		mailDetail(id) {
 			this.$router.push({ path: '/MailInfo', query: { id: id } })
 		},
-		//单号搜索
-		onSearch(val) {
-			this.getmailList();
-		},
 		//复制
 		copyLink(id) {
 			let _this = this;
@@ -151,24 +165,7 @@ export default {
 			});
 		},
 		//寄件查询
-		async getmailList() {
-			// Toast.loading({
-			// 	message: '加载中...',
-			// 	forbidClick: true,
-			// 	duration: 0
-			// });
 
-			let parmas = {
-				expressNo: this.value,
-				startTime: this.startTime,
-				endTime: this.endTime,
-				type: this.index,
-
-			}
-			const res = await getListByUser({ ...this.pageSize, ...parmas })
-			this.mailList = res.data
-			console.log(res, 'res')
-		},
 		tab(obj) {//外部件、内部件切换
 			this.index = obj
 			if (this.index == 1) {
@@ -177,6 +174,11 @@ export default {
 			if (this.index == 2) {
 				this.expressType = '内部件'
 			}
+			this.mailList = []
+			this.pageSize = {
+				page: 1,
+				limit: 10
+			}
 			this.getmailList();
 		},
 		changetime(obj) {//选择按月份、按天数
@@ -228,125 +230,10 @@ export default {
 </script>
 
 <style lang="less" scoped="">
-.jjlist {
-	font-size: .3rem;
-	color: #999999;
-
-	.listinfo {
-		background: white;
-		padding: .33rem .33rem .2rem;
-		border-radius: .05rem;
-		margin-bottom: .2rem;
-		position: relative;
-
-		.list_top {
-			display: flex;
-			justify-content: space-between;
-
-			.list_top_left {
-				img {
-					display: inline-block;
-					width: .9rem;
-					height: .9rem;
-					position: relative;
-					top: -.3rem;
-				}
-
-				div {
-					width: 4rem;
-					margin-left: .2rem;
-					display: inline-block;
-					line-height: 150%;
-
-					p:nth-of-type(1) {
-						font-size: .3rem;
-						font-weight: bold;
-						color: #333;
-					}
-
-					p:nth-of-type(3) {
-						font-size: .24rem;
-						color: #333;
-
-						span {
-							width: .37rem;
-							height: .37rem;
-							color: white;
-							border-radius: 50%;
-							background: #cc9a09;
-							display: inline-block;
-							text-align: center;
-							line-height: .37rem;
-							margin-right: .1rem;
-						}
-					}
-
-					p:nth-of-type(4) {
-						font-size: .2rem;
-					}
-				}
-			}
-
-			>p {
-				font-size: .24rem;
-				color: #f5693d;
-				font-weight: bold;
-			}
-		}
-
-		.list_bot {
-			text-align: right;
-			border-top: .01rem solid #ededed;
-			padding-top: .2rem;
-
-			p {
-				display: inline-block;
-				font-size: .24rem;
-				padding: .16rem .4rem;
-				border-radius: .05rem;
-			}
-
-			p:nth-of-type(1) {
-				border: .01rem solid #263fbf;
-				color: #263fbf;
-			}
-
-			p:nth-of-type(2) {
-				border: .01rem solid #408cc7;
-				color: #408cc7;
-			}
-
-			p:nth-of-type(3) {
-				border: .01rem solid #d5a43c;
-				color: #d5a43c;
-			}
-
-			p:nth-of-type(4) {
-				border: .01rem solid #e24444;
-				color: #e24444;
-			}
-		}
-
-		.fast {
-			background: url(../assets/images/status.png) no-repeat center;
-			background-size: 100% 100%;
-			color: white;
-			position: absolute;
-			bottom: 0px;
-			right: 0px;
-			width: 1rem;
-			height: .4rem;
-			text-align: center;
-			line-height: .4rem;
-			font-size: .2rem;
-		}
-	}
-}
-
 .content {
 	font-size: .3rem;
 	//padding: .33rem;
-	padding: .33rem .33rem 1.2rem;
+	// padding: .33rem .33rem 1.2rem;
 
 	/deep/.van-search {
 		padding: 0px;
@@ -381,6 +268,121 @@ export default {
 		}
 	}
 
+	.jjlist {
+		font-size: .3rem;
+		color: #999999;
+
+		.listinfo {
+			background: white;
+			padding: .33rem .33rem .2rem;
+			border-radius: .05rem;
+			margin-bottom: .2rem;
+			position: relative;
+
+			.list_top {
+				display: flex;
+				justify-content: space-between;
+
+				.list_top_left {
+					img {
+						display: inline-block;
+						width: .9rem;
+						height: .9rem;
+						position: relative;
+						top: -.3rem;
+					}
+
+					div {
+						width: 4rem;
+						margin-left: .2rem;
+						display: inline-block;
+						line-height: 150%;
+
+						p:nth-of-type(1) {
+							font-size: .3rem;
+							font-weight: bold;
+							color: #333;
+						}
+
+						p:nth-of-type(3) {
+							font-size: .24rem;
+							color: #333;
+
+							span {
+								width: .37rem;
+								height: .37rem;
+								color: white;
+								border-radius: 50%;
+								background: #cc9a09;
+								display: inline-block;
+								text-align: center;
+								line-height: .37rem;
+								margin-right: .1rem;
+							}
+						}
+
+						p:nth-of-type(4) {
+							font-size: .2rem;
+						}
+					}
+				}
+
+				>p {
+					font-size: .24rem;
+					color: #f5693d;
+					font-weight: bold;
+				}
+			}
+
+			.list_bot {
+				text-align: right;
+				border-top: .01rem solid #ededed;
+				padding-top: .2rem;
+
+				p {
+					display: inline-block;
+					font-size: .24rem;
+					padding: .16rem .4rem;
+					border-radius: .05rem;
+				}
+
+				p:nth-of-type(1) {
+					border: .01rem solid #263fbf;
+					color: #263fbf;
+				}
+
+				p:nth-of-type(2) {
+					border: .01rem solid #408cc7;
+					color: #408cc7;
+				}
+
+				p:nth-of-type(3) {
+					border: .01rem solid #d5a43c;
+					color: #d5a43c;
+				}
+
+				p:nth-of-type(4) {
+					border: .01rem solid #e24444;
+					color: #e24444;
+				}
+			}
+
+			.fast {
+				background: url(../assets/images/status.png) no-repeat center;
+				background-size: 100% 100%;
+				color: white;
+				position: absolute;
+				bottom: 0px;
+				right: 0px;
+				width: 1rem;
+				height: .4rem;
+				text-align: center;
+				line-height: .4rem;
+				font-size: .2rem;
+			}
+		}
+	}
+
 	.change {
 		color: #00c4b8;
 		margin-bottom: .3rem;

+ 11 - 4
src/pages/my.vue

@@ -11,8 +11,8 @@
 			</template>
 
 			<div>
-				<!-- <p>姓名:{{user.name}}</p> -->
-				<!-- <p>{{user.phone}}</p> -->
+				<p>姓名:{{ user.name }}</p>
+				<p>{{ user.phone }}</p>
 			</div>
 			<img style="width: 100%;border-radius: 0px;margin-top: .4rem;" src="../assets/images/my_banner.png" alt="">
 		</div>
@@ -55,11 +55,12 @@
 </template>
 
 <script>
+import { getUserByUserId } from '../api/index'
 export default {
 	data() {
 		return {
 			userId: "",
-			user: [],
+			user: {},
 			headimgurl: '',
 			notReadNo: '',//未查看数量(意见建议)
 		};
@@ -67,11 +68,17 @@ export default {
 	created: function () {
 		this.isLogin();
 		this.userId = localStorage.getItem("userId");
-		this.getUser();
+		// this.getUser();
 		this.headimgurl = localStorage.getItem('headimgurl');
 		this.getSuggestList();
+		this.getUserByUserIdAPI()
 	},
 	methods: {
+		async getUserByUserIdAPI() {
+			const res = await getUserByUserId({ id: localStorage.getItem("userId") })
+			this.user = res.userInfo
+			console.log(res, 'res')
+		},
 		//跳转
 		getSuggestList() {
 			this.$http.post(this.$store.state.host + "/solic/getSuggestList.do", {

+ 108 - 222
src/pages/personinfomation.vue

@@ -3,243 +3,129 @@
 		<back :title="titlename"></back>
 		<!-- 表单 -->
 		<van-form @submit="onSubmit">
-		  <van-field v-model="user.name" class="m" name="中文名" label="中文名" placeholder="请填写中文名" :rules="[{ required: false}]"/>
-		  <van-field v-model="user.englishName" type="" name="英文名" label="英文名" placeholder="请填写英文名" :rules="[{ required: false}]"/>
-		  <van-field v-model="user.email" class="m" type="" name="邮箱地址" label="邮箱地址" placeholder="请填写邮箱地址" :rules="[{ required: false}]"/>
-		  <van-field v-model="user.phone" class="m" type="number" name="手机号" label="手机号" placeholder="请填写手机号" :rules="[{ required: false}]"/>
-		  <van-field v-model="user.stationNum" type="" name="工号" label="工号" placeholder="请填写工号" :rules="[{ required: false}]"/>
-		  <van-field v-model="user.company" class="m" type="" readonly name="公司" label="公司" placeholder="公司" :rules="[{ required: false}]"/>
-		  <van-field v-model="user.department" readonly @click="show=true" class="m" type="" name="部门" label="部门" placeholder="请选择部门" :rules="[{ required: false}]"/>
-		  <!-- 弹窗物品类型 -->
-		  <van-popup v-model="show" position="bottom">
-		    <van-picker title="选择部门" show-toolbar value-key="department" :columns="departmenList" @confirm="onConfirm" @cancel="show=false"/>
-		  </van-popup>
-
-      <!--上司部门-->
-      <van-field v-model="user.leaderDepartment" readonly @click="show2=true" class="m" type="" name="上司部门" label="上司部门" placeholder="请选择上司部门" :rules="[{ required: false}]"/>
-      <van-popup v-model="show2" position="bottom">
-        <van-picker title="选择上司部门" show-toolbar value-key="department" :columns="departmenList"  @confirm="onConfirm2" @cancel="show2=false"/>
-      </van-popup>
-
-      <!--上司姓名-->
-      <van-field v-model="user.leaderName" readonly @click="show3=true" class="m" type="" name="上司" label="上司" placeholder="请选择上司" :rules="[{ required: false}]"/>
-      <van-popup v-model="show3" position="bottom">
-        <van-picker title="选择上司" show-toolbar value-key="name" :columns="leaderList"  @confirm="onConfirm3" @cancel="show3=false"/>
-      </van-popup>
-
-
-
-
-		  <van-field v-model="user.costCenterName" readonly class="m" type="" name="成本中心" label="成本中心" placeholder="请填写成本中心" :rules="[{ required: false}]"/>
-		  <van-field v-model="user.build" type="" name="幢/座" label="幢/座" placeholder="请填写幢/座" :rules="[{ required: false}]"/>
-		  <van-field v-model="user.floor" type="" name="楼层" label="楼层" placeholder="请填写楼层" :rules="[{ required: false}]"/>
-		  <van-field v-model="user.seat" type="" name="座位" label="座位" placeholder="请填写座位" :rules="[{ required: false}]"/>
-		  <van-field v-model="user.remark" type="" name="备注" label="备注" placeholder="请填写备注" :rules="[{ required: false}]"/>
-		  <div style="margin: 16px;">
-		    <van-button round block type="info" native-type="submit">保存</van-button>
-		  </div>
+			<van-field v-model="user.name" class="m" name="NAME" label="中文名" placeholder="请填写中文名"
+				:rules="[{ required: false }]" />
+			<van-field v-model="user.email" class="m" name="EMAIL" label="邮箱地址" placeholder="请填写邮箱地址"
+				:rules="[{ required: false }]" />
+			<van-field v-model="user.phone" class="m" type="number" name="PHONE" label="手机号" placeholder="请填写手机号"
+				:rules="[{ required: false }]" />
+			<van-field v-model="user.company" class="m" readonly label="公司" placeholder="公司"
+				:rules="[{ required: false }]" />
+			<van-field v-model="user.departmentName" readonly class="m" label="部门" placeholder="请选择部门"
+				:rules="[{ required: false }]" />
+			<van-field v-model="user.seatNo" readonly label="座位" placeholder="请填写座位" :rules="[{ required: false }]" />
+
+			<!-- <van-field v-model="user.englishName" type="" name="英文名" label="英文名" placeholder="请填写英文名"
+				:rules="[{ required: false }]" /> -->
+			<!-- <van-field v-model="user.stationNum" type="" name="工号" label="工号" placeholder="请填写工号"
+				:rules="[{ required: false }]" /> -->
+			<!-- 弹窗物品类型 -->
+			<!-- <van-popup v-model="show" position="bottom">
+				<van-picker title="选择部门" show-toolbar value-key="department" :columns="departmenList"
+					@confirm="onConfirm" @cancel="show = false" />
+			</van-popup> -->
+			<!--上司部门-->
+			<!-- <van-field v-model="user.leaderDepartment" readonly @click="show2 = true" class="m" type="" name="上司部门"
+				label="上司部门" placeholder="请选择上司部门" :rules="[{ required: false }]" />
+			<van-popup v-model="show2" position="bottom">
+				<van-picker title="选择上司部门" show-toolbar value-key="department" :columns="departmenList"
+					@confirm="onConfirm2" @cancel="show2 = false" />
+			</van-popup> -->
+			<!--上司姓名-->
+			<!-- <van-field v-model="user.leaderName" readonly @click="show3 = true" class="m" type="" name="上司" label="上司"
+				placeholder="请选择上司" :rules="[{ required: false }]" />
+			<van-popup v-model="show3" position="bottom">
+				<van-picker title="选择上司" show-toolbar value-key="name" :columns="leaderList" @confirm="onConfirm3"
+					@cancel="show3 = false" />
+			</van-popup> -->
+			<!-- <van-field v-model="user.costCenterName" readonly class="m" type="" name="成本中心" label="成本中心"
+				placeholder="请填写成本中心" :rules="[{ required: false }]" /> -->
+			<!-- <van-field v-model="user.build" type="" name="幢/座" label="幢/座" placeholder="请填写幢/座"
+				:rules="[{ required: false }]" /> -->
+			<!-- <van-field v-model="user.floor" type="" name="楼层" label="楼层" placeholder="请填写楼层"
+				:rules="[{ required: false }]" /> -->
+			<!-- <van-field v-model="user.remark" type="" name="备注" label="备注" placeholder="请填写备注"
+				:rules="[{ required: false }]" /> -->
+			<div style="margin: 16px;">
+				<van-button round block type="info" native-type="submit">保存</van-button>
+			</div>
 		</van-form>
 	</div>
 </template>
 
 <script>
-	import { Form,Toast,Field } from 'vant'
-	export default{
-		data(){
-			return {
-				titlename:"个人信息",
-				user:{},
-				userId:'',
-				departmenList:[],
-        leaderList:[],
-				show:false,
-        show2:false,
-        show3:false,
-			}
-		},
-		created:function() {
-			this.userId = localStorage.getItem("userId");
-			this.getUser();
+import { Form, Toast, Field } from 'vant'
+import { getUserByUserId, UserUpdate } from '../api/index'
+export default {
+	data() {
+		return {
+			titlename: "个人信息",
+			user: {},
+			userId: '',
+			departmenList: [],
+			leaderList: [],
 
-			this.getDepartmentList();
+		}
+	},
+	created: function () {
+		this.getUserByUserIdAPI()
+	},
+	methods: {
+		// 获取信息 
+		async getUserByUserIdAPI() {
+			const res = await getUserByUserId({ id: localStorage.getItem("userId") })
+			this.user = res.userInfo
+			console.log(res, 'res')
 		},
-		methods:{
-			onConfirm(e){//确定
-				this.isLogin();
-				this.user.department=e.department;
-				this.user.costCenterName=e.costCenter;
-				this.show=false;
-			},
-      onConfirm2(e){//上司部门确定
-      	this.isLogin();
-      	this.user.leaderDepartment=e.department;//绑定上司部门
-        this.user.leader='';//清除上司名字  PS:为了防止有人选完上司又重新选了个部门
-        console.log("上司部门:"+ this.user.leaderDepartment)
-        this.getLeaderList();
-      	this.show2=false;
-      },
-      onConfirm3(e){//上司确定
-      	this.isLogin();
-      	this.user.leaderDepartment=e.department;
-        this.user.leader=''
-        console.log("上司部门:"+ this.user.leaderDepartment)
-        this.getLeaderList();
-      	this.show2=false;
-      },
-      getLeaderList(){
-        this.$http.post(this.$store.state.host+"/personal/getLeaderList.do",{leaderDepartment:this.user.leaderDepartment,
-        },{emulateJSON:true})
-        	.then(res=>{
-        	    //发送成功
-        	    if(res.body.msg=='success'){
-        			this.leaderList = res.body.employeeList
-              console.log("1"+ this.user.leaderDepartment)
-        	    }
-        },res=>{
-        	     //发送失败
-        })
-      },
-
-			onSubmit(){
-				if(this.user.name == '' || this.user.name == undefined){
-					Toast('请填写中文名')
-					return
-				}
-
-				if(this.user.englishName == undefined){
-					this.user.englishName = ''
-				}
-
-				if(this.user.email == '' || this.user.email == undefined){
-					Toast('请填写邮箱地址')
-					return
-				}
 
-				let regEmail = new RegExp(this.$store.state.regEmail)
-				if(!regEmail.test(this.user.email)){
-					Toast('邮箱格式不正确')
-					return
-				}
 
-				if(this.user.phone == '' || this.user.phone == undefined){
-					Toast('请填写手机号')
-					return
-				}
-
-				let regPhone = new RegExp(this.$store.state.regPhone)
-				if(!regPhone.test(this.user.phone)){
-					Toast('手机号格式不正确')
-					return
-				}
-
-				if(this.user.stationNum == undefined){
-					this.user.stationNum = ''
-				}
-
-				if(this.user.company == '' || this.user.company == undefined){
-					Toast('请填写公司')
-					return
-				}
-
-				if(this.user.department == '' || this.user.department == undefined){
-					Toast('请选择部门')
-					return
-				}
-
-				if(this.user.costCenterName == '' || this.user.costCenterName == undefined){
-					Toast('请选择成本中心')
-					return
-				}
+		async onSubmit(value) {
+			const res = await UserUpdate({ ...value })
+			if (res.msg == 'success') {
+				Toast('修改成功')
+				this.$router.push('/My')
+			}
+			console.log(res)
+		},
 
-				if(this.user.build == undefined){
-					this.user.build = ''
-				}
+	}
+}
+</script>
 
-				if(this.user.floor == undefined){
-					this.user.floor = ''
-				}
+<style lang="less" scoped>
+/deep/.van-form {
+	.van-button--info {
+		background-color: #00c4b8;
+		border: 1px solid #00c4b8;
+		border-radius: 5px;
+	}
 
-				if(this.user.seat == undefined){
-					this.user.seat = ''
-				}
+	.m .van-field__label::before {
+		content: "*";
+		color: red;
+	}
 
-				if(this.user.remark == undefined){
-					this.user.remark = ''
-				}
+	.van-cell {
+		font-size: .26rem;
+	}
 
-				this.$http.post(this.$store.state.host+"/personal/savePersonalInfo.do",{userId:this.userId,
-				name:this.user.name,
-				englishName:this.user.englishName,
-				email:this.user.email,
-				phone:this.user.phone,
-				stationNum:this.user.stationNum,
-				company:this.user.company,
-				department:this.user.department,
-				costCenterName:this.user.costCenterName,
-				build:this.user.build,
-				floor:this.user.floor,
-				seat:this.user.seat,
-				remark:this.user.remark
-				},{emulateJSON:true})
-					.then(res=>{
-					    //发送成功
-					    if(res.body.msg=='success'){
-							Toast("保存成功");
-							let that = this;
-							setTimeout(function(){
-								that.$router.push({path:'/My'})
-							},500)
-					    }
-				},res=>{
-					     //发送失败
-				})
-			},
-			getDepartmentList(){
-				this.$http.post(this.$store.state.host+"/personal/getDepartmentList.do",{userId:this.userId,
-				},{emulateJSON:true})
-					.then(res=>{
-						//console.log(res.body)
-					    //发送成功
-					    if(res.body.msg=='success'){
-							this.departmenList = res.body.departmenList
-					    }
-				},res=>{
-					     //发送失败
-				})
-			}
+	.textarea {
+		font-size: .26rem;
+		padding: 10px 16px;
+		color: #646566;
+
+		textarea {
+			width: 98%;
+			height: 150px;
+			border-color: #e5e5e5;
+			color: #999999;
+			margin-top: 16px;
+			padding: 10px 1%;
 		}
 	}
-</script>
+}
 
-<style lang="less" scoped>
-	/deep/.van-form{
-	  .van-button--info{
-	    background-color: #00c4b8;
-	    border: 1px solid #00c4b8;
-	    border-radius: 5px;
-	  }
-	  .m .van-field__label::before{
-		  content:"*";
-		  color: red;
-	  }
-	  .van-cell{
-	    font-size: .26rem;
-	    }
-	  .textarea{
-	    font-size: .26rem;
-	    padding: 10px 16px;
-	    color: #646566;
-	    textarea{
-	      width: 98%;
-	      height: 150px;
-	      border-color: #e5e5e5;
-	      color: #999999;
-	      margin-top: 16px;
-	      padding: 10px 1%;
-	    }
-	  }
-	}
-	/deep/.van-field__control{
-	  text-align: right;
-	}
+/deep/.van-field__control {
+	text-align: right;
+}
 </style>