Browse Source

修改bug

soft5566 2 years ago
parent
commit
9f01ab0ea2

+ 0 - 1
.env.production

@@ -2,5 +2,4 @@
 ENV = 'production'
 
 # base api
-# VUE_APP_BASE_API = 'https://www.靖安人家.com/hotelReservation'
 VUE_APP_BASE_API = 'https://chtech.ncjti.edu.cn/hotelReservation'

+ 2 - 1
src/api/fileInfo.js

@@ -12,9 +12,10 @@ export function getFileList(linkId) {
 export function uploadhimage(forData) {
 	const data = new FormData()
 	data.append('myFileFileName', forData.file.name)
-	data.append('myFile', forData.file)
+	data.append('files', forData.file)
 
 	return request({
+		// url: '/mhotel/loadhimage.action', 
 		url: '/file/cos/upload', 
 		method: 'post',
 		data

+ 1 - 1
src/api/residentialhostelMgr.js

@@ -209,7 +209,7 @@ export function modifyOtherConfig(param) {
 	    },
 	    {
 	      id: param[2].id,
-	      code: param[2].monthValue,
+	      code: param[2].days,
 	    }
 	  ]
 	};

+ 10 - 3
src/components/pl-upload/index.vue

@@ -91,6 +91,7 @@
 						this.refreshUploadFile()
 					} else {
 						getFileList(this.linkId).then((res) => {
+							// console.log('getImageFiles', res);
 							const tempData = res.data
 							if (typeof tempData !== 'undefined' && tempData !== '') {
 								for (var i = 0; i < tempData.length; i++) {
@@ -151,9 +152,15 @@
 				})
 				// 发起上传
 				uploadhimage(file).then((res) => {
-					console.log('1',res.data)
-					const tempData = res.data
-					self.uploadFileList.push(tempData)
+					// console.log('uploadImagesFiles', res.data)
+					// 由于后端上传图片接口返回的数据结构发生变化,需要做一下处理
+					var objData = {}
+					objData.id = ''
+					objData.linkId = ''
+					objData.name = ''
+					objData.url = res.data
+					
+					self.uploadFileList.push(objData)
 					self.fileList = self.uploadFileList
 					setTimeout(() => {
 						// console.log("附件信息",self.fileList)

+ 33 - 31
src/views/complaintMgr/index.vue

@@ -79,7 +79,7 @@
 							</el-table-column>
 							<el-table-column label="投诉时间" align="center" width="168">
 								<template slot-scope="scope">
-									<span>{{ scope.row.createDate.substring(0, scope.row.createDate.length - 2) }}</span>
+									<span>{{ scope.row.createDate | truncateDate }}</span>
 								</template>
 							</el-table-column>
 							<el-table-column label="备注" align="center" width="280">
@@ -109,11 +109,11 @@
 			<p v-if="complaint.status == 1"><label class="lbl-cls">投诉状态:</label><span style="color: #F9273F;">处理中</span></p>
 			<p v-else-if="complaint.status == 2"><label class="lbl-cls">投诉状态:</label><span style="color: #56AA2E;">处理完成</span></p>
 			<p v-else><label class="lbl-cls">投诉状态:</label><span style="color: #ccc;">已删除</span></p>
-			<p><label class="lbl-cls">投诉单号:</label> {{ complaint.bookingId }}</p>
+			<p><label class="lbl-cls">投诉单号:</label> {{ complaint.id }}</p>
 			<p><label class="lbl-cls">民宿:</label> {{ complaint.hotelName }}</p>
 			<p><label class="lbl-cls">民宿电话:</label> {{ complaint.hotelPhone }}</p>
 			<p><label class="lbl-cls">投诉人电话:</label> {{ complaint.complainPhone }}</p>
-			<p><label class="lbl-cls">订单号:</label> {{ complaint.id }}</p>
+			<p><label class="lbl-cls">订单号:</label> {{ complaint.order_num }}</p>
 			<div>
 				<h3 style="padding-top: 20px;">投诉信息</h3>
 				<p><label class="lbl-cls">标题:</label> {{ complaint.title }}</p>
@@ -121,13 +121,15 @@
 				<div class="show-imgs">
 					<div><label class="lbl-cls">图片:</label></div>
 					<div class="imgs">
-						<div v-for="(image, index) in complaint.fileInfos" :key="index">
-							<img :src="image.url" v-if="!image.url.endsWith('.mp4')"
-							 style="margin: 0 2px; border-radius: 5px;" alt="" @click="handlePictureCardPreview(image.url)" height="80px" width="80px" />
-						</div>
+						<viewer style="display: flex;">
+							<div v-for="(image, index) in complaint.fileInfos" :key="index">
+								<img :src="image.url" v-if="!image.url.endsWith('.mp4')" style="margin: 0 2px; border-radius: 5px;" alt="" height="80px"
+									width="80px" />
+							</div>
+						</viewer>
 					</div>
 				</div>
-				<p><label class="lbl-cls">投诉时间:</label> {{ complaint.createDate}}</p>
+				<p><label class="lbl-cls">投诉时间:</label> {{ complaint.createDate | truncateDate }}</p>
 				<p><label class="lbl-cls">备注:</label><el-input type="textarea" style="margin-left: 100px; margin-top: -20px; width: calc(100% - 100px);"
 						:rows="2" placeholder="暂无备注信息" v-model="complaint.remark">
 					</el-input>
@@ -138,9 +140,6 @@
 				</p>
 			</div>
 		</el-dialog>
-		<el-dialog :visible.sync="dialogVisible">
-			<img width="100%" :src="dialogImageUrl" alt="">
-		</el-dialog>
 		<el-dialog title="添加备注" custom-class="add-remarks-class" :visible.sync="dialogRemarksFormVisible" :close-on-click-modal="false">
 			<el-form :model="formRemarks">
 				<el-form-item>
@@ -208,19 +207,20 @@
 				},
 				loading: true,
 				complaint: {
-					status: 'Pending',
-					complaintNumber: '123456',
-					lodge: 'Some Lodge',
-					lodgePhone: '1234567890',
-					complainantPhone: '0987654321',
-					orderNumber: '987654321',
-					title: 'Complaint Title',
-					description: 'Complaint Description',
-					images: [],
-					complaintTime: '2022-01-01 10:00:00'
+					id: '',
+					order_num: '',
+					status: '',
+					bookingId: '',
+					hoteName: '',
+					hotelPhone: '',
+					complainantPhone: '',
+					complainPhone: '',
+					title: '',
+					content: '',
+					fileInfos: [],
+					createDate: ''
 				},
 				dialogComplaintVisible: false,
-				dialogVisible: false,
 				dialogRemarksFormVisible: false, // 添加备注
 				formRemarks: {
 					id: '',
@@ -228,6 +228,11 @@
 				}
 			}
 		},
+		filters: {
+		  truncateDate(value) {
+		    return value.substring(0, value.length - 2);
+		  }
+		},
 		created() {
 			// 检测权限
 			if (this.currentUserLevel !== 2) {
@@ -243,10 +248,6 @@
 			document.getElementsByClassName("el-pagination__jump")[0].childNodes[0].nodeValue = "跳至";
 		},
 		methods: {
-			handlePictureCardPreview(file) {
-				this.dialogImageUrl = file;
-				this.dialogVisible = true;
-			},
 			/**
 			 * 添加备注
 			 */
@@ -264,13 +265,14 @@
 			},
 			// 点击查看备注,弹出投诉详情对话框
 			handleClickRemarks(row) {
-				// console.log(row);
+				// console.log(row);				
 				this.dialogComplaintVisible = true
 
 				getXiang(row).then((res) => {
-					console.log(res.data);
+					// console.log(res.data);
 					if (res.code === 200) {
 						this.complaint = res.data
+						this.$set(this.complaint, 'order_num', row.order_num);
 					} else {
 						this.complaint = []
 						this.$message.warning('没有符合条件的数据!')
@@ -656,11 +658,11 @@
 
 	.show-imgs {
 		display: flex;
+		height: 90px;
 	}
 
 	.imgs {
 		display: flex;
-		flex-direction: row;
 		margin-left: 20px;
 	}
 
@@ -671,12 +673,12 @@
 		padding-right: 10px;
 		color: #bbb;
 	}
-	
+
 	.cancel-btn {
 		color: rgba(9, 101, 98, 1) !important;
 		border: 1px solid rgba(9, 101, 98, 1) !important;
 	}
-	
+
 	.confirm-btn {
 		border: none !important;
 		background: rgba(9, 101, 98, 1) !important;

+ 31 - 19
src/views/perimeterMgr/index.vue

@@ -150,7 +150,7 @@
 								</viewer>
 								<el-button @click="openImageUploadDialog"
 									style="margin-top: 8px; width: 150px; border: none; background: rgba(9, 101, 98, 1); color: #fff; border-radius: 5px;"
-									size="small">上传图片</el-button>
+									size="small">上传封面图片</el-button>
 								<input type="file" ref="addImageUploadInput" style="display:none" accept=".jpg,.png"
 									@change="uploadImageVideo($event, 'img')" />
 							</div>
@@ -188,7 +188,7 @@
 								</viewer>
 								<el-button @click="openImageDetailUploadDialog"
 									style="margin-top: 8px; width: 150px; border: none; background: rgba(9, 101, 98, 1); color: #fff; border-radius: 5px;"
-									size="small">上传图片</el-button>
+									size="small">上传详情图片</el-button>
 								<input type="file" ref="addImageDetailUploadInput" style="display:none" accept=".jpg,.png"
 									@change="uploadImageVideo($event, 'imgDetail')" />
 							</div>
@@ -286,10 +286,10 @@
 										style="border-radius: 5px;">
 									<img v-else :src="formModifyDialog.first_img" height="180px" width="150px" style="border-radius: 5px;">
 								</viewer>
-								<el-button
+								<el-button @click="openImageUploadDialog_modify"
 									style="margin-top: 8px; width: 150px; border: none; background: rgba(9, 101, 98, 1); color: #fff; border-radius: 5px;"
-									size="small">上传图片</el-button>
-								<input type="file" ref="addImageUploadInput" style="display:none" accept=".jpg,.png"
+									size="small">上传封面图片</el-button>
+								<input type="file" ref="modifyImageUploadInput" style="display:none" accept=".jpg,.png"
 									@change="uploadModifyImageVideo($event, 'img')" />
 							</div>
 						</div>
@@ -305,10 +305,10 @@
 									style="border-radius: 5px;">
 								<video-player v-else class="video-player vjs-custom-skin" @play="onPlayerPlay($event)" :playsinline="true"
 									:options="formModifyDialog.show_video" style="height: 180px;"></video-player>
-								<el-button @click="openVideoUploadDialog"
+								<el-button @click="openVideoUploadDialog_modify"
 									style="margin-top: 8px; width: 150px; border: none; background: rgba(9, 101, 98, 1); color: #fff; border-radius: 5px;"
 									size="small">上传视频</el-button>
-								<input type="file" ref="addVideoUploadInput" style="display:none" accept=".mp4"
+								<input type="file" ref="modifyVideoUploadInput" style="display:none" accept=".mp4"
 									@change="uploadModifyImageVideo($event, 'video')" />
 							</div>
 						</div>
@@ -324,10 +324,10 @@
 										</el-carousel-item>
 									</el-carousel>
 								</viewer>
-								<el-button
+								<el-button  @click="openImageDetailUploadDialog_modify"
 									style="margin-top: 8px; width: 150px; border: none; background: rgba(9, 101, 98, 1); color: #fff; border-radius: 5px;"
-									size="small">上传图片</el-button>
-								<input type="file" ref="addImageDetailUploadInput" style="display:none" accept=".jpg,.png"
+									size="small">上传详情图片</el-button>
+								<input type="file" ref="modifyImageDetailUploadInput" style="display:none" accept=".jpg,.png"
 									@change="uploadModifyImageVideo($event, 'imgDetail')" />
 							</div>
 						</div>
@@ -431,7 +431,7 @@
 				<el-divider></el-divider>
 				<el-row>
 					<el-col :span="24">
-						<el-tabs v-model="activeName" @tab-click="handleClick">
+						<el-tabs v-model="activeName">
 							<el-tab-pane label="产品" name="first">
 								<el-button class="export" style="margin-bottom: 10px !important;" size="small" @click="showAddProductDialog">
 									<i class="el-icon el-icon-circle-plus-outline" style="font-size: 16px;"></i>
@@ -990,10 +990,11 @@
 			document.removeEventListener('fullscreenchange', this.handleFullScreenChange);
 		},
 		methods: {
+			// 显示地图界面
 			showMapDialog() {
-				this.$set(this.zoom, 13)
+				this.zoom = 13
 
-				if (this.dialogAddVisible) {
+				if (this.dialogAddVisible && !isEmpty(this.formAddDialog.jingwei)) {
 					var t = this.formAddDialog.jingwei.split(',')
 					this.$set(this.center, 'lng', t[0])
 					this.$set(this.center, 'lat', t[1])
@@ -1001,7 +1002,7 @@
 					this.$set(this.markerPosition, 'lng', t[0])
 					this.$set(this.markerPosition, 'lat', t[1])
 
-				} else if (this.dialogModifyVisible) {
+				} else if (this.dialogModifyVisible && !isEmpty(this.formModifyDialog.jingwei)) {
 					var t = this.formModifyDialog.jingwei.split(',')
 					this.$set(this.center, 'lng', t[0])
 					this.$set(this.center, 'lat', t[1])
@@ -1012,6 +1013,7 @@
 
 				this.dialogMapVisible = true;
 			},
+			// 地图的单击,获取坐标、地址
 			handleMapClick(e) {
 				const {
 					lng,
@@ -1043,6 +1045,7 @@
 				})
 				// console.log(this.formAddDialog.jingwei);
 			},
+			// 周边类型下拉列表发生改变
 			handleTypeChange() {
 				this.get_table_data('search')
 			},
@@ -1115,9 +1118,6 @@
 				this.playering = player
 				this.full(player)
 			},
-			handleClick(tab, event) {
-				console.log(tab, event);
-			},
 			// 添加对话框单击上传封面图片
 			openImageUploadDialog() {
 				this.$refs.addImageUploadInput.click();
@@ -1130,7 +1130,19 @@
 			openImageDetailUploadDialog() {
 				this.$refs.addImageDetailUploadInput.click();
 			},
-			// 上传文件
+			// 修改对话框单击上传封面图片
+			openImageUploadDialog_modify() {
+				this.$refs.modifyImageUploadInput.click();
+			},
+			// 修改对话框单击上传视频
+			openVideoUploadDialog_modify() {
+				this.$refs.modifyVideoUploadInput.click();
+			},
+			// 修改对话框单击上传详情图
+			openImageDetailUploadDialog_modify() {
+				this.$refs.modifyImageDetailUploadInput.click();
+			},
+			// 周边新增上传文件
 			uploadImageVideo(event, imgOrVideo) {
 				const file = event.target.files[0];
 				var that = this
@@ -1418,7 +1430,7 @@
 						that.dialogDeleteVisible = false
 						that.$message.success('周边删除成功!')
 					} else {
-						that.$message.err(res.message)
+						that.$message.error(res.message)
 					}
 				})
 			},

+ 45 - 9
src/views/residentialhostelMgr/index.vue

@@ -182,15 +182,15 @@
 				</el-row>
 				<el-row>
 					<el-col :span="24">
-						<div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0px 0 20px 20px;">营业执照</div>
-						<el-form-item label="" :required="true" prop="fileUrl">
+						<div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0 0 20px 20px;">营业执照</div>
+						<el-form-item label="" :required="true" prop="fileUrl" style="margin-bottom: -10px;">
 							<pl-upload v-model="formAddHostel.fileUrl" :times="times" :linkUrl="formAddHostel.url" :limitCount="6" :type="1"></pl-upload>
 						</el-form-item>
 					</el-col>
 				</el-row>
 			</el-form>
 			<div
-				style="font-size: 18px;font-weight: 400;letter-spacing: 0px;line-height: 26.06px;color: rgba(212, 48, 48, 1);text-align: left;vertical-align: top;">
+				style="font-size: 18px;font-weight: 400;letter-spacing: 0px;line-height: 26px;color: rgba(212, 48, 48, 1);text-align: left;vertical-align: top;">
 				(注:最多可上传6张图片)</div>
 			<div slot="footer" class="dialog-footer">
 				<el-button class="add-info-cancel-btn" @click="dialogAddHostelFormVisible = false">取 消</el-button>
@@ -258,8 +258,8 @@
 				</el-row>
 				<el-row>
 					<el-col :span="24">
-						<div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0px 0 20px 20px;">营业执照</div>
-						<el-form-item label="" :required="true" prop="fileUrl">
+						<div style="font-size: 16px;font-weight: 700; color: rgba(0, 0, 0, 1); margin: 0 0 20px 20px;">营业执照</div>
+						<el-form-item label="" :required="true" prop="fileUrl" style="margin-bottom: -10px;">
 							<pl-upload v-model="formModifyHostel.fileUrl" :linkId="formModifyHostel.id" :limitCount="6" :type="1"></pl-upload>
 						</el-form-item>
 					</el-col>
@@ -438,10 +438,14 @@
 							<div style="font-size: 14px; font-weight: bold; margin: 50px 0 10px 0;">民宿预订期:</div>
 							<div style="display: flex; align-items: center;">
 								<div style="white-space: nowrap; padding-left: 30px;">可预订</div>
-								<el-select class="custom-select" v-model="otherConfig[2].monthValue" placeholder="请选择">
+								<el-input v-model="otherConfig[2].days" class="custom-input" ref="numberInput" @input="checkInput" maxlength="3"
+									placeholder="请输入天数">
+									<template slot="append">天</template>
+								</el-input>
+								<!-- <el-select class="custom-select" v-model="otherConfig[2].monthValue" placeholder="请选择">
 									<el-option v-for="item in otherConfig[2].monthOptions" :key="item.value" :label="item.label" :value="item.value">
 									</el-option>
-								</el-select>
+								</el-select> -->
 								<div>内的房间。</div>
 							</div>
 							<div style="display: flex; justify-content: flex-end; padding-top: 130px;">
@@ -1137,6 +1141,8 @@
 					value: '',
 					id: ''
 				}, {
+					days: 10
+				}, {
 					monthOptions: [{
 						value: '1',
 						label: '1个月'
@@ -1175,7 +1181,7 @@
 			this.get_towns()
 			// 民宿字典列表
 			this.getHostelListByCode(1234)
-			
+
 			this.getOtherConfig()
 		},
 		mounted() {
@@ -1183,6 +1189,22 @@
 			document.getElementsByClassName("el-pagination__jump")[0].childNodes[0].nodeValue = "跳至";
 		},
 		methods: {
+			// 检查用户的输入
+			checkInput(value) {
+				if (!/^[0-9]+$/.test(value))
+					this.otherConfig[2].days = value.replace(/\D/g, '');
+
+				if (value > 365) {
+					this.$message.warning('最长为 365 天')
+					this.otherConfig[2].days = 365;
+				}
+
+				if (value == '' || parseInt(value, 10) <= 0) {
+					this.$message.warning('最短为 1 天')
+					this.otherConfig[2].days = 1
+				}
+			},
+			// 其他配置确定按钮事件
 			handlerOtherConfig() {
 				modifyOtherConfig(this.otherConfig).then((res) => {
 					// console.log(res);
@@ -1222,7 +1244,7 @@
 									this.otherConfig[1].value = data[i].code;
 									this.otherConfig[1].id = data[i].id;
 								} else {
-									this.otherConfig[2].monthValue = data[i].code;
+									this.otherConfig[2].days = data[i].code;
 									this.otherConfig[2].id = data[i].id;
 								}
 							}
@@ -2370,4 +2392,18 @@
 		height: 40px !important;
 		line-height: 40px !important;
 	}
+
+	.custom-input {
+		width: 83px !important;
+		height: 30px !important;
+	}
+
+	.custom-input .el-input__inner {
+		width: 60px !important;
+		height: 30px !important;
+	}
+
+	.custom-input .el-input-group__append {
+		padding: 0 5px !important;
+	}
 </style>