sunChengjie 11 months ago
parent
commit
3d687e91eb
4 changed files with 77 additions and 67 deletions
  1. 2 2
      src/api/index.js
  2. 6 5
      src/pages/express.vue
  3. 65 60
      src/pages/inexpress.vue
  4. 4 0
      src/pages/mailInfo.vue

+ 2 - 2
src/api/index.js

@@ -40,7 +40,7 @@ export function saveInternal(data) {
 // 寄件-内部件-收件人
 export function getUserByName(data) {
     return request({
-        url: '/tianzong/user/getUserByName',
+        url: '/tianzong/client/user/getUserByName',
         method: 'post',
         data: data,
         emulateJSON: true
@@ -128,7 +128,7 @@ export function getWxConfig(data) {
 //快递公司
 export function geLogisticsList(data) {
     return request({
-        url: '/tianzong/set/geLogisticsList',
+        url: '/tianzong/client/express/company/list',
         method: 'post',
         data: data,
         emulateJSON: true

+ 6 - 5
src/pages/express.vue

@@ -50,7 +50,7 @@
 			<van-popup v-model="showPicker" position="bottom">
 				<van-picker show-toolbar :columns="columns" @confirm="onConfirm" @cancel="showPicker = false">
 					<template v-slot:option="slotProps">
-						{{ slotProps.expressCompany }}
+						{{ slotProps.expresCompanyName }}
 					</template>
 				</van-picker>
 			</van-popup>
@@ -297,18 +297,19 @@ export default {
 		},
 		// 快递公司
 		async geLogisticsListAPIList() {
-			const res = await geLogisticsList({ page: 1, limit: 30 })
-			this.columns = res.data.map((item) => {
+			const res = await geLogisticsList({})
+			console.log(res, '======================')
+			this.columns = res.list.map((item) => {
 				return {
 					id: item.id,
-					expressCompany: item.expressCompany
+					expresCompanyName: item.expresCompanyName
 				}
 			})
 		},
 		// 选择快递公司
 		onConfirm(e) {
 			console.log(e, '=============')
-			this.expressInfoShow = e.expressCompany
+			this.expressInfoShow = e.expresCompanyName
 			this.expressInfo = e.id
 			this.showPicker = false
 		},

+ 65 - 60
src/pages/inexpress.vue

@@ -3,6 +3,8 @@
 		<div class="jjinfo">
 			<van-field :value="recipientsName" @focus="onFocus" name="phone" label="收件人姓名" placeholder="请输入收件人姓名"
 				:rules="[{ required: true }]" />
+			<van-field :value="recipientsPhone" @focus="onFocusPhone" name="phone" label="收件人手机号"
+				placeholder="请输入手机号后四位" :rules="[{ required: true }]" />
 			<van-field :value="groupValue.departmentName" readonly name="phone" label="收件人部门" placeholder="自动填充" />
 			<van-field :value="groupValue.seatNo" readonly name="phone" label="收件人座位" placeholder="自动填充" />
 		</div>
@@ -70,42 +72,42 @@
 		<van-popup v-model="wpshow" position="bottom">
 			<van-picker title="物品类型" show-toolbar :columns="wplist" @confirm="onConfirm1" @cancel="wpshow = false" />
 		</van-popup>
-		<!-- 弹窗内部类型 -->
-		<van-popup v-model="wpshow2" position="bottom">
-			<van-picker title="选择" show-toolbar :columns="innerlist" @confirm="onConfirm11" @cancel="wpshow2 = false" />
-		</van-popup>
 
-		<!-- 弹窗付款方式 -->
-		<van-popup v-model="priceshow" position="bottom">
-			<van-picker title="付款方式" show-toolbar :columns="pricelist" @confirm="onConfirm2"
-				@cancel="priceshow = false" />
-		</van-popup>
 
-		<!-- 城市选择 -->
-		<van-popup v-model="areashow" position="bottom">
-			<van-area :area-list="areaList" @confirm="onConfirm3" @cancel="areashow = false" />
-		</van-popup>
-		<!-- 输入后弹出 -->
+
+		<!-- 姓名输入后弹出 -->
 		<van-popup v-model="nameShowA" :style="{ height: '100%', width: '100%', }">
 			<div style="display: flex; justify-content: space-between;">
 				<van-search style="width: 100%;" @search="searchCrux" v-model="searchKey" placeholder="请输入搜索关键词" />
-				<!-- <van-icon style="margin-top: 15px; margin-right: 10px" @click="searchCrux" name="search" color="#1989fa"
-					size="20" /> -->
 			</div>
 			<div style="height: calc(100vh - 105px); overflow-y: auto; padding: 0 20px;">
 				<van-cell-group class="vanPopup" @click="onGroup(item)" v-for="(item, index) in searchNameList"
 					:key="index" inset>
-					<!-- <van-cell :value="item.phone" /> -->
-					<van-cell :value="item.name" />
-					<van-cell :value="item.departmentName" />
-					<van-cell :value="item.seatNo" />
-					<van-cell title="收件人userID" :value="item.userId" style="display: none;" />
+					<van-cell :value="item.departmentName">{{ item.name }}- {{ item.departmentName }} - {{ item.seatNo
+						}}</van-cell>
 				</van-cell-group>
 			</div>
 			<van-button class="goback" @click="nameShowA = false" type="info">
 				退出
 			</van-button>
 		</van-popup>
+		<!-- 手机号输入后弹出 -->
+		<van-popup v-model="nameShowB" :style="{ height: '100%', width: '100%', }">
+			<div style="display: flex; justify-content: space-between;">
+				<van-search style="width: 100%;" @search="searchCruxPhone" v-model="searchKeyPhone"
+					placeholder="请输入手机后四位" />
+			</div>
+			<div style="height: calc(100vh - 105px); overflow-y: auto; padding: 0 20px;">
+				<van-cell-group class="vanPopup" @click="onGroupPhone(item)"
+					v-for="(item, index) in searchNameListPhone" :key="index" inset>
+					<van-cell :value="item.departmentName">{{ item.name }}- {{ item.departmentName }} - {{ item.seatNo
+						}}</van-cell>
+				</van-cell-group>
+			</div>
+			<van-button class="goback" @click="nameShowB = false" type="info">
+				退出
+			</van-button>
+		</van-popup>
 	</div>
 </template>
 
@@ -124,18 +126,9 @@ export default {
 			stepper: '',//件数
 			Kilogram: '',//重量
 			max: '',
-			priceshow: false,//付款类型弹窗显示
-			pricelist: ["自费", "月结"],
-			addshow: false,
 			name: "",
 			phone: "",
-			telPhone: "",
-			city: "",
-			address: "",
-			areashow: false,
 			index: "",
-			title: "",
-			jjname: "",
 			jjadd: "",
 			sjname: "",
 			sjadd: "",
@@ -153,8 +146,6 @@ export default {
 			mainType: '',
 			jjaddress: '',//寄件个人地址
 			dsList: [],//代收人列表
-			dsnameshow: false,
-			dsname: '',
 			userId: "",
 			sjInfo: {},
 			declaredValue: '',
@@ -172,12 +163,16 @@ export default {
 			// vanListLoading: false,
 			// finished: false,
 			// searchResults: [],
-			searchKey: '',//搜索结果
+			searchKey: '',//姓名搜索结果
+			searchKeyPhone: '',//手机搜索结果
 			recipientsName: '',//收件人姓名
+			recipientsPhone: '',//收件人手机号
 			recipientsDoor: '',//部门
 			recipientsSet: '',//座位
-			nameShowA: false,  // 手机号点击聚焦
+			nameShowA: false,  // 姓名点击聚焦
+			nameShowB: false,  // 手机号点击聚焦
 			searchNameList: [],//搜索后的数据
+			searchNameListPhone: [],//手机号搜索后的数据
 			groupValue: {},//点击后的数据
 		}
 	},
@@ -187,25 +182,55 @@ export default {
 	},
 	methods: {
 
-		// 手机号点击聚焦
+		//姓名点击聚焦
 		onFocus() {
 			this.nameShowA = true
 		},
+		// 手机号点击聚焦
+		onFocusPhone() {
+			this.nameShowB = true
+		},
 		// 搜索关键
 		async searchCrux() {
 			const res = await getUserByName({ NAME: this.searchKey })
-			if (res.msg == 'success') {
-				this.searchNameList = res.userByName
+			if (res.userByName != '' && res.userByName != undefined && res.userByName != null) {
+				if (res.msg == 'success') {
+					this.searchNameList = res.userByName
+				}
+			} else {
+				Toast('没有此数据')
 			}
 		},
+		// 手机号搜索关键
+		async searchCruxPhone() {
+			if (!/^\d{4}$/.test(this.searchKeyPhone)) {
+				return Toast('请输入手机号后四位')
+			}
+			const res = await getUserByName({ PHONE: this.searchKeyPhone })
+			if (res.userByName != '' && res.userByName != undefined && res.userByName != null) {
+				if (res.msg == 'success') {
+					this.searchNameListPhone = res.userByName
+				}
+			} else {
+				Toast('没有此数据')
+			}
+
+		},
 
 		// 点击回显
 		onGroup(value) {
 			this.groupValue = value
 			this.recipientsName = value.name
-			// this.maney
+			this.recipientsPhone = value.phone
 			this.nameShowA = false
 		},
+		// 手机号点击回显
+		onGroupPhone(value) {
+			this.groupValue = value
+			this.recipientsName = value.name
+			this.recipientsPhone = value.phone
+			this.nameShowB = false
+		},
 
 		// 选择快递公司
 		onConfirm(e) {
@@ -236,28 +261,8 @@ export default {
 			this.innerType = e
 			this.wpshow2 = false
 		},
-		// 选择付款方式确定
-		onConfirm2(e) {//确定
-			this.pricetype = e
-			this.priceshow = false
-		},
-		// 填写地址确定
-		onConfirm3(e) {//确定
-			this.city = e[0].name + ' ' + e[1].name + ' ' + e[2].name
-			this.areashow = false
-		},
-		// 寄件地址1与收件地址2
-		addtype(obj) {
-			this.index = obj
-			if (obj == 1) {
-				this.title = "寄件地址"
-			}
-			if (obj == 3) {
-				this.title = "内部收件地址"
-			}
-			this.addshow = true
-			this.onSearch()
-		},
+
+
 		// 地址簿跳转
 		link(obj) {
 			this.$router.push({ path: '/Inaddressbook', query: { active: obj } })

+ 4 - 0
src/pages/mailInfo.vue

@@ -22,6 +22,7 @@
 					</div>
 				</div>
 			</div>
+			<!-- 外部 -->
 			<div class="info" v-if="mailDetail.type == 1">
 				<img style="margin: 0 auto;display: block;" id="barcode" />
 				<p>部门:{{ ObjectVlaue.sendDeptName }}</p>
@@ -33,6 +34,7 @@
 				<p>省:{{ ObjectVlaue.addresseeProvince }}</p>
 				<p>市:{{ ObjectVlaue.addresseeCity }}</p>
 				<p>区:{{ ObjectVlaue.addresseeCounty }}</p>
+				<p>授权码:{{ ObjectVlaue.verificationCode == '' ? '无' : ObjectVlaue.verificationCode }}</p>
 				<p>备注:{{ ObjectVlaue.expressRemark }}</p>
 			</div>
 			<div class="info" v-if="mailDetail.type == '2'">
@@ -67,7 +69,9 @@ export default {
 		this.id = this.mailDetail.id
 	},
 	mounted() {
+
 		if (this.mailDetail.type === '1') {
+			// 外部
 			this.getFindWithoutInfoById()
 		} else if (this.mailDetail.type === '2') {
 			this.getFindInsideInfoById()