Browse Source

寄件详情

sunChengjie 11 months ago
parent
commit
7f608c0e33
5 changed files with 193 additions and 275 deletions
  1. 23 0
      src/api/index.js
  2. 7 1
      src/pages/express.vue
  3. 5 34
      src/pages/logisticslist.vue
  4. 155 237
      src/pages/mailInfo.vue
  5. 3 3
      src/pages/search.vue

+ 23 - 0
src/api/index.js

@@ -57,6 +57,25 @@ export function getListByUser(data) {
     })
 }
 
+// 我的寄件-外部件-详情
+export function findWithoutInfoById(data) {
+    return request({
+        url: '/tianzong/client/without/findWithoutInfoById',
+        method: 'post',
+        data: data,
+        emulateJSON: true
+    })
+}
+// 我的寄件-内部件-详情
+export function findInsideInfoById(data) {
+    return request({
+        url: '/tianzong/client/inside/findInsideInfoById',
+        method: 'post',
+        data: data,
+        emulateJSON: true
+    })
+}
+
 // 我的收件- 收件
 export function getExpressByUser(data) {
     return request({
@@ -121,3 +140,7 @@ export function forgetPassword(data) {
 
 
 
+
+
+
+

+ 7 - 1
src/pages/express.vue

@@ -213,7 +213,13 @@ export default {
 		this.geLogisticsListAPIList()
 	},
 	async mounted() {
-		this.SendInfoValue = await getSendInfo({ userId: localStorage.getItem("userId") })
+		const res = await getSendInfo({ userId: localStorage.getItem("userId") })
+		if (res.code == 444) {
+			Toast(res.msg)
+		} else {
+			this.SendInfoValue = res
+		}
+
 		console.log(this.SendInfoValue, 'this.SendInfoValue')
 	},
 	methods: {

+ 5 - 34
src/pages/logisticslist.vue

@@ -13,34 +13,16 @@
 				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="listinfo" @click="mailDetail(item)">
 							<div class="list_top">
 								<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>
-								<!-- <p>
-							<template v-if="item.sendSt == 0">待审核</template>
-							<template v-if="item.sendSt == 1">待揽件</template>
-							<template v-if="item.sendSt == 3">待寄件</template>
-							<template v-if="item.sendSt == 4">已寄出</template>
-							<template v-if="item.sendSt == 7">审核拒绝</template>
-							<template v-if="item.sendSt == 8">已取消</template>
-							<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>
 					<template v-if="!refreshLoading && mailList.length > 0">
@@ -148,22 +130,11 @@ export default {
 		},
 
 		//寄件详情
-		mailDetail(id) {
-			this.$router.push({ path: '/MailInfo', query: { id: id } })
+		mailDetail(item) {
+			this.$router.push({ path: '/MailInfo', query: { mailDetail: item } })
 		},
-		//复制
-		copyLink(id) {
-			let _this = this;
-			let clipboard = new this.clipboard("#fz" + id);
-			clipboard.on('success', function () {
-				//window.console.log('00')
-			});
-			clipboard.on('error', function () {
-				_this.$toast("复制失败")
-			});
-		},
-		//寄件查询
 
+		//寄件查询
 		tab(obj) {//外部件、内部件切换
 			this.index = obj
 			if (this.index == 1) {

+ 155 - 237
src/pages/mailInfo.vue

@@ -1,283 +1,201 @@
 <template>
 	<div>
-		<!-- <van-nav-bar
-		  :title="titlename"
-		  left-text="返回"
-		  left-arrow
-		  @click-left="onClickLeft"
-		/> -->
 		<back :title="titlename"></back>
 		<div class="content">
-			<p>寄件查询</p>
 			<div class="jjlist">
 				<div class="listinfo">
 					<div class="list_top">
 						<div class="list_top_left">
 							<img src="../assets/images/ad_icon1.png" alt="">
-							<div>
-								<p><template v-if="expressInfo.expressInfo == 1">顺丰</template>
-								<template v-if="expressInfo.expressInfo == 2">中通</template>
-								<template v-if="expressInfo.expressInfo == 3">DHL</template>
-								<template v-if="expressInfo.expressInfo == 4">EMS</template>
-								<template v-if="expressInfo.expressInfo == 5">同城</template>
-								<template v-if="expressInfo.expressInfo == 6">京东</template>	{{expressInfo.expressNo}}</p>
-								<p>{{expressInfo.sender}} {{expressInfo.senderPhone}}</p>
-								<p>{{expressInfo.recordDate|dateFormat}}</p>
+
+							<div v-if="mailDetail.type == 1">
+								<p>{{ ObjectVlaue.withoutOrder }}</p>
+								<p>{{ ObjectVlaue.addresseeName }} {{ ObjectVlaue.addresseePhone }}</p>
+								<p>{{ ObjectVlaue.addresseeProvince }} {{ ObjectVlaue.addresseeCity
+									}} {{ ObjectVlaue.addresseeCounty }}</p>
+							</div>
+							<div v-if="mailDetail.type == 2">
+								<p>{{ ObjectVlaue.inside_num }}</p>
+								<p>{{ ObjectVlaue.addressee_name }} {{ ObjectVlaue.addressee_phone }}</p>
+								<p>{{ ObjectVlaue.create_time }} </p>
 							</div>
 						</div>
-						<p>
-							<template v-if="expressInfo.auditSt == 1">审核中</template>
-							<template v-if="expressInfo.auditSt == 2">审核通过</template>
-							<template v-if="expressInfo.auditSt == 3">审核拒绝</template>
-						</p>
 					</div>
-					<!-- <div class="fast">
-						<p @click="showTxm">条形码</p>
-					</div> -->
 				</div>
 			</div>
-			<div class="info">
-				<img style="margin: 0 auto;display: block;" id="barcode"/>
-
-				<p>秘钥:{{expressInfo.collectKey}}</p>
-				<p>部门:{{expressInfo.costCenterName}}</p>
-				<!-- <p>座位:{{expressInfo.sendSeat}}</p> -->
-				<!-- <p>智能柜:{{expressInfo.cabinet}}</p> -->
-				<p>快件类型:{{expressInfo.expressType}}</p>
-				<p>收件人:{{expressInfo.receiver}}</p>
-				<p>收件人手机:{{expressInfo.receiverPhone}}</p>
-				<p>收件人地址:{{expressInfo.receiveAddress}}</p>
-				<!-- <p>是否私人件:<template v-if="expressInfo.mainType == '个人件'">是</template><template v-else>否</template>
-				</p>
-				<p>是否问题件:{{expressInfo.isProblem}}</p>
-				<p>是否已派件:<template v-if="expressInfo.expressStatus == 1">否</template><template v-if="expressInfo.expressStatus == 2">是</template>
-				</p> -->
-				<p>备注:{{expressInfo.remark}}</p>
-				<img style="width: 4rem;height: 4rem;margin: 0 auto;display: block;" id="image" :src="qrcode">
-				<div class="pjinfo" v-for="item in routeList">
-					<p>{{item.acceptTime}} 【{{item.remark}}】 {{item.acceptAddress}}</p>
-				</div>
+			<div class="info" v-if="mailDetail.type == 1">
+				<img style="margin: 0 auto;display: block;" id="barcode" />
+				<p>部门:{{ ObjectVlaue.addresseeAddress }}</p>
+				<p>收件人:{{ ObjectVlaue.addresseeName }}</p>
+				<p>收件人手机:{{ ObjectVlaue.addresseePhone }}</p>
+				<p>快件类型:{{ ObjectVlaue.expressType === 1 ? '文件' : '物品' }}</p>
+				<p>数量:{{ ObjectVlaue.expressNum }}</p>
+				<p>重量:{{ ObjectVlaue.expressWeight }}</p>
+				<p>省:{{ ObjectVlaue.addresseeProvince }}</p>
+				<p>市:{{ ObjectVlaue.addresseeCity }}</p>
+				<p>区:{{ ObjectVlaue.addresseeCounty }}</p>
+				<p>备注:{{ ObjectVlaue.expressRemark }}</p>
+			</div>
+			<div class="info" v-if="mailDetail.type == '2'">
+				<img style="margin: 0 auto;display: block;" id="barcode" />
+				<p>部门:{{ ObjectVlaue.addressee_dept_name }}</p>
+				<p>收件人:{{ ObjectVlaue.addressee_name }}</p>
+				<p>收件人手机:{{ ObjectVlaue.addressee_phone }}</p>
+				<p>创建时间{{ ObjectVlaue.create_time }}</p>
+				<p>快件类型:{{ ObjectVlaue.express_type === 1 ? '文件' : '物品' }}</p>
+				<p>座位:{{ ObjectVlaue.addressee_seat_no }}</p>
+				<p>备注:{{ ObjectVlaue.express_remark }}</p>
 			</div>
-			<van-popup v-model="txmShow">
-				<van-image width="380" height="250" :src="txmUrl" />
-			</van-popup>
 		</div>
 	</div>
 </template>
 
 <script>
-	import JsBarcode from 'jsbarcode'
-	import QRCode from 'qrcode'
-	import {Toast,Dialog} from 'vant'
-	export default {
-		data() {
-			return {
-				titlename: "查快递",
-				userId:'',
-				id:'',
-				expressInfo:{},
-				qrcode:"",
-				routeList:[],//路由信息
-				txmShow:false,
-				txmUrl:''
-			}
-		},
-		created:function(){
-			this.isLogin();
-			this.userId = localStorage.getItem("userId");
-			//获取参数
-			this.id = this.$route.query.id
-			this.getData();
+import { Toast, Dialog } from 'vant'
+import { findWithoutInfoById, findInsideInfoById } from '../api/index'
+export default {
+	data() {
+		return {
+			titlename: "查快递",
+			item: {},
+			mailDetail: {},//传过来的数据
+			id: '',
+			ObjectVlaue: {}
+		}
+	},
+	created: function () {
+		this.mailDetail = this.$route.query.mailDetail
+		this.id = this.mailDetail.id
+	},
+	mounted() {
+		if (this.mailDetail.type === '1') {
+			this.getFindWithoutInfoById()
+		} else if (this.mailDetail.type === '2') {
+			this.getFindInsideInfoById()
+		}
+	},
+	methods: {
+		async getFindWithoutInfoById() {
+			const res = await findWithoutInfoById({ id: this.id })
+			this.ObjectVlaue = res.floorInfoById
+			console.log(res)
 		},
-		methods:{
-			showTxm(){
-				// if(this.expressInfo.expressInfo == 2){
-				// 	window.location.href = this.txmUrl;
-				// }else{
-				// 	this.txmShow = true;
-				// }
-				//无需判断
-				this.txmShow = true;
-			},
-			makeQRCode(obj) {
-			    QRCode.toDataURL(obj).then(imgData => {
-			        if(imgData) {
-			           //console.log(imgData)
-					   this.qrcode=imgData
-			        }
-			    });
-			},
-			makeBarcode(obj){
-				JsBarcode("#barcode",obj, {
-					format: "CODE128", //选择要使用的条形码类型
-					width: 2, //设置条之间的宽度
-					height: 60, //高度
-					displayValue: true, //是否在条形码下方显示文字
-					text: obj, //覆盖显示的文本
-					//fontOptions: "bold italic", //使文字加粗体或变斜体
-					//font: "fantasy", //设置文本的字体
-					textAlign: "center", //设置文本的水平对齐方式
-					textPosition: "top", //设置文本的垂直位置
-					textMargin: 1, //设置条形码和文本之间的间距
-					fontSize: 16, //设置文本的大小
-					//background: "#eee", //设置条形码的背景
-					lineColor: "black", //设置条和文本的颜色。
-					margin: 2 //设置条形码周围的空白边距
-				});
-			},
-			onClickLeft(){
-			  this.$router.push({path:"/Search",query:{type:1}})
-			},
-			getData(){
-				Toast.loading({
-				    message: '加载中...',
-				    forbidClick: true,
-				    duration:0
-				});
-				this.$http.post(this.$store.state.host+"/sendMail/getMailDetailById.do",{id:this.id},{emulateJSON:true})
-					.then(res=>{
-						//发送成功
-						if(res.body.msg=='success'){
-							this.expressInfo = res.body.mailInfo
-							this.txmUrl = this.$store.state.host + "/" + res.body.mailInfo.sheetPdfPath
-							this.makeQRCode(this.expressInfo.expressNo)
-							this.makeBarcode(this.expressInfo.expressNo)
-							this.getMailRoute()
-						}
-						Toast.clear()
-				},res=>{
-						 //发送失败
-					Toast("网络错误!")
-				})
-				Toast.clear()
-			},
-			//查询快递路由信息
-			getMailRoute(){
-				Toast.loading({
-				    message: '加载中...',
-				    forbidClick: true,
-				    duration:0
-				});
-				this.$http.post(this.$store.state.host+"/mailRoute/getMailRoute.do",{expressInfo:this.expressInfo.expressInfo,
-				expressNo:this.expressInfo.expressNo},{emulateJSON:true})
-					.then(res=>{
-						//发送成功
-						if(res.body.msg=='success'){
-							this.routeList = res.body.routeList
-							//console.log(res.body)
-						}
-						Toast.clear()
-				},res=>{
-						 //发送失败
-					Toast("网络错误!")
-				})
-				Toast.clear()
-			}
+		async getFindInsideInfoById() {
+			const res = await findInsideInfoById({ id: this.id })
+			this.ObjectVlaue = res.floorInfoById
+			console.log(res)
 		}
 	}
+}
 </script>
 
 <style scoped lang="less">
-	.content {
-		padding: .2rem .33rem;
+.content {
+	padding: .2rem .33rem;
+	font-size: .3rem;
+
+	>p {
 		font-size: .3rem;
-		>p{
-			font-size: .3rem;
-			text-align: center;
-			margin-bottom: .2rem;
+		text-align: center;
+		margin-bottom: .2rem;
+	}
+
+	.info {
+		padding: .4rem;
+		background: white;
+		line-height: 200%;
+		color: #666666;
+
+		.pjinfo {
+			margin-top: .1rem;
+			border-top: .01rem solid #f0efef;
+			padding-top: .1rem;
 		}
-		.info {
-			padding: .4rem;
+	}
+
+	.jjlist {
+		font-size: .3rem;
+		color: #999999;
+
+		.listinfo {
 			background: white;
-			line-height: 200%;
-			color: #666666;
+			padding: .33rem .33rem .2rem;
+			border-radius: .05rem;
+			margin-bottom: .2rem;
+			position: relative;
 
-			.pjinfo {
-				margin-top: .1rem;
-				border-top: .01rem solid #f0efef;
-				padding-top: .1rem;
-			}
-		}
+			.list_top {
+				display: flex;
+				justify-content: space-between;
 
-		.jjlist {
-			font-size: .3rem;
-			color: #999999;
+				.list_top_left {
+					img {
+						display: inline-block;
+						width: .9rem;
+						height: .9rem;
+						position: relative;
+						top: -.1rem;
+					}
 
-			.listinfo {
-				background: white;
-				padding: .33rem .33rem .2rem;
-				border-radius: .05rem;
-				margin-bottom: .2rem;
-				position: relative;
-				.list_top {
-					display: flex;
-					justify-content: space-between;
+					div {
+						width: 4rem;
+						margin-left: .2rem;
+						display: inline-block;
+						line-height: 150%;
 
-					.list_top_left {
-						img {
-							display: inline-block;
-							width: .9rem;
-							height: .9rem;
-							position: relative;
-							top: -.1rem;
+						p:nth-of-type(1) {
+							font-size: .3rem;
+							font-weight: bold;
+							color: #333;
 						}
 
-						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: .2rem;
-							}
+						p:nth-of-type(3) {
+							font-size: .2rem;
 						}
 					}
+				}
 
-					>p {
-						font-size: .24rem;
-						color: #f5693d;
-						font-weight: bold;
-					}
+				>p {
+					font-size: .24rem;
+					color: #f5693d;
+					font-weight: bold;
 				}
-                .fast{
-				  //background: url(../assets/images/status.png) no-repeat center;
-				  background-color: #00c4b8;
-				  background-size: 100% 100%;
-				  color: white;
-				  position: absolute;
-				  bottom: 0px;
-				  right: 0px;
-				  width: 1.1rem;
-				  height: .5rem;
-				  text-align: center;
-				  line-height: .5rem;
-				  font-size: .2rem;
-			  }				
-				
 			}
+
+			.fast {
+				//background: url(../assets/images/status.png) no-repeat center;
+				background-color: #00c4b8;
+				background-size: 100% 100%;
+				color: white;
+				position: absolute;
+				bottom: 0px;
+				right: 0px;
+				width: 1.1rem;
+				height: .5rem;
+				text-align: center;
+				line-height: .5rem;
+				font-size: .2rem;
+			}
+
 		}
 	}
-	
-	/deep/ .van-nav-bar__content{
-	    .van-nav-bar__title{
-	      font-size: 16px;
-	    }
-	  }
-	/deep/.van-icon-arrow-left::before{
-	  color: #333;
-	  font-size: 16px;
-	}
-	/deep/.van-nav-bar__text{
-	  color: #333 !important;
-	  font-size: 16px;
+}
+
+/deep/ .van-nav-bar__content {
+	.van-nav-bar__title {
+		font-size: 16px;
 	}
+}
+
+/deep/.van-icon-arrow-left::before {
+	color: #333;
+	font-size: 16px;
+}
+
+/deep/.van-nav-bar__text {
+	color: #333 !important;
+	font-size: 16px;
+}
 </style>

+ 3 - 3
src/pages/search.vue

@@ -8,7 +8,7 @@
 				<van-pull-refresh v-model="refreshLoading" @refresh="onRefresh">
 					<div class="sjlist" v-for="item in expressList">
 						<div class="listinfo">
-							<div class="list_top" @click="mailDetail(item.id)">
+							<div class="list_top" @click="mailDetail(item)">
 								<div class="list_top_left">
 									<img src="../assets/images/ad_icon1.png" alt="">
 									<div>
@@ -108,8 +108,8 @@ export default {
 				this.noData = false;
 			}
 		},
-		mailDetail(id) {
-			// this.$router.push({ path: '/MailInfo', query: { id: id } })
+		mailDetail(item) {
+			this.$router.push({ path: '/MailInfo', query: { item: item } })
 		}
 
 	}