Forráskód Böngészése

添加接受或拒绝弹框

wkw 6 hónapja
szülő
commit
00d93fc305
2 módosított fájl, 300 hozzáadás és 34 törlés
  1. 142 13
      src/components/messageCom/messageCom.vue
  2. 158 21
      src/views/message/index.vue

+ 142 - 13
src/components/messageCom/messageCom.vue

@@ -141,12 +141,10 @@
 							</div>
 							<!-- 预览简历 -->
 							<div class="message-box-l-con inv-style" v-if="item.content && item.messageType === 10">
-								<template v-if="userType == 1">{{ item.content }}</template>
-								<template v-else>
-									<view class="flex align-center" @click="previewResume(item.content)">
-										点击预览附件简历
-									</view>
+								<template v-if="item.userType == 1">
+									<view class="flex align-center" @click="previewResume(item.content)">点击预览附件简历</view>
 								</template>
+								<template v-else>{{ item.content }}</template>
 							</div>
 							<!-- 面试邀约消息 -->
 							<div class="message-box-l-con inv-style" v-if="item.content && item.messageType === 99">
@@ -162,7 +160,7 @@
 						<!-- 我发的消息 -->
 						<div class="message-boxs message-box-r flex flex-wrap" v-else>
 							<!-- 文字消息 -->
-							<div class="message-box-r-con" v-if="item.messageType==1 || item.messageType==10">
+							<div class="message-box-r-con" v-if="item.messageType==1">
 								{{item.content}}
 							</div>
 							<div class="message-box-r-con flex align-center" v-if="item.messageType==20">
@@ -233,7 +231,7 @@
 							</div>
 							<!-- 简历预览 -->
 							<div class="message-box-r-con invitation" v-if="item.content && item.messageType === 10">
-								<template v-if="userType == 1">
+								<template v-if="item.userType == 1">
 									<view class="flex align-center" @click="previewResume(item.content)">点击预览附件简历</view>
 								</template>
 								<template v-else>{{ item.content }}</template>
@@ -354,6 +352,71 @@
 					</span>
 				</template>
 			</el-dialog>
+			<!-- 面试邀约弹窗 -->
+			<el-dialog v-model="showBtn" title="面试邀约" width="15%" :close-on-click-modal="false">
+				<div class="avatorm flex justify-center">
+					<div class="avatorm-box flex justify-center">
+						<!-- 用户头像 -->
+						<template v-if="recordInfo.userEntity && recordInfo.userEntity.avatar">
+							<img :src="recordInfo.userEntity.avatar" class="avatar-img" alt="">
+						</template>
+						<template v-else>
+							<img src="/default.jpg" class="avatar-img" alt="">
+						</template>
+
+						<!-- HR头像 -->
+						<template v-if="recordInfo.hr && recordInfo.hr.hrImg">
+							<img :src="recordInfo.hr.hrImg" class="avatar-img" alt="">
+						</template>
+						<template v-else>
+							<img src="/default.jpg" class="avatar-img" alt="">
+						</template>
+					</div>
+				</div>
+				<div class="avatorm flex justify-center" style="margin-top: 10px;">
+					<div class="avatorm-box">
+						<div class="avatorm-box-item flex">
+							<div class="avatorm-box-item-t">面试岗位:</div>
+							<div class="avatorm-box-item-r">{{ recordInfo.postPush ?
+								recordInfo.postPush.ruleClassifyName : '未知'
+								}}</div>
+						</div>
+
+						<div class="avatorm-box-item flex" v-if="recordInfo">
+							<div class="avatorm-box-item-t">面试时间:</div>
+							<div class="avatorm-box-item-r">
+								{{ recordInfo.interviewDateTime && recordInfo.interviewDateTime.substring(0, 10) || ''
+								}}
+								{{ recordInfo.detailTime }}
+							</div>
+						</div>
+
+						<div class="avatorm-box-item flex map-item">
+							<div class="avatorm-box-item-t">面试地点:</div>
+							<div class="avatorm-box-item-r">
+								{{ recordInfo.detailedAddress }}
+								<i class="iconfont icon-map" style="color: #016BF6; margin-left: 5px;"></i>
+							</div>
+						</div>
+
+						<div class="avatorm-box-item flex">
+							<div class="avatorm-box-item-t">面试备注:</div>
+							<div class="avatorm-box-item-r">
+								{{ recordInfo.remarks ? recordInfo.remarks : '暂无' }}
+							</div>
+						</div>
+					</div>
+				</div>
+				<div class="avatorm flex justify-center" v-if="recordInfo.company">
+					<div class="avatorm-box flex justify-center" style="margin-top: 10px;margin-bottom: 20px;">
+						来自 {{ recordInfo.company.companyAllName || recordInfo.company.companyName }} 的面试邀请,是否接受?
+					</div>
+				</div>
+				<template #footer>
+					<el-button @click="coleInterView(2)">拒绝</el-button>
+					<el-button type="primary" @click="coleInterView(1)">同意</el-button>
+				</template>
+			</el-dialog>
 		</el-dialog>
 		<!-- 附件列表 -->
 		<AttachmentSelectDialog @closePostPush="closePostPush" @select="selectItem" v-if="showDialog" :showDialog="showDialog" />
@@ -410,6 +473,7 @@
 		},
 		data() {
 			return {
+				showBtn: false,
 				showDialog: false,
 				miamshi: {
 					hrPhone: '', //手机号
@@ -481,7 +545,9 @@
 				], //操作图片
 				jobList: [],
 				isShowCommon: false, //是否显示常用语
-				changYongList: []
+				changYongList: [],
+				recordInfo: {},//面试邀请信息
+				recordsInter: ''
 			}
 		},
 		computed: {
@@ -502,6 +568,10 @@
 				this.czList[3].name = '发简历'
 				//获取岗位信息
 				this.getPostPushInfo(this.postPushId)
+				// 获取用户是否有面试记录
+				this.recordsInter = setInterval(() => {
+					this.getInterviewList()
+				}, 3000)
 			} else {
 				this.czList[3].name = '求简历'
 				this.czList.push({
@@ -519,6 +589,58 @@
 			}, 1000);
 		},
 		methods: {
+			//拒绝或者接受面试邀请
+			coleInterView(type) {
+				ElMessageBox.alert(type == 2 ? '确认拒绝该面试邀请吗?' : '确定接受该面试邀请', '提示', {
+					confirmButtonText: '确认',
+					showCancelButton: true,
+					callback: (res) => {
+						if (res == 'confirm') { //确认
+							let data = {
+								recordId: this.recordInfo.recordId,
+								type: type
+							}
+							this.$Request.get('/app/interviewRecord/userUpdateInter', {
+								params: data
+							}).then(res => {
+								if (res.code == 0) {
+									ElMessage({
+										message: type == 1 ? '已接受' : '已拒绝',
+										type: type == 1 ? 'success' : 'error',
+										duration: 1500,
+										offset: this.screenHeight / 2
+									})
+									if (type == 1) {
+										this.sendMessage(97, res.data)
+									} else {
+										this.sendMessage(96, res.data)
+									}
+									this.getCHarList()
+									this.getStatusInfo()
+								}
+							})
+						}
+					}
+				})
+			},
+			// 获取用户是否有面试记录
+			getInterviewList() {
+				let data = {
+					status: 1,
+					postPushId: this.postPushId
+				}
+				this.$Request.get("/app/interviewRecord/interviewList", { params: data }).then(res => {
+					if (res.code == 0) {
+						if ((res.data.records).length > 0) {
+							this.recordInfo = res.data.records[0]
+							this.showBtn = true;
+						} else {
+							this.recordInfo = {}
+							this.showBtn = false;
+						}
+					}
+				})
+			},
 			previewResume(attachmentAddress) {
 				const isFileLink = /^https?:\/\/.+\.(pdf|doc|docx|xls|xlsx)$/i.test(attachmentAddress);
 				if (!isFileLink) {
@@ -921,7 +1043,7 @@
 						this.content = ''
 						//获取聊天记录
 						this.getCHarList()
-					}, 50)
+					}, 100)
 				} else { //如果不是,那么就重新连接
 					this.initScoket()
 				}
@@ -959,6 +1081,14 @@
 				if (type == 24) { //刷新
 					data.content = '刷新';
 				}
+				if (type == 96) { //拒绝面试邀约
+					data.content = '已拒绝面试邀请';
+					data.recordId = url
+				}
+				if (type == 97) { //同意面试邀约
+					data.content = '已接受面试邀请';
+					data.recordId = url
+				}
 				if (type == 99) { //面试邀约
 					data.content = '一份面试邀约';
 				}
@@ -973,7 +1103,7 @@
 						this.content = ''
 						//获取聊天记录
 						this.getCHarList()
-					}, 50)
+					}, 100)
 				} else { //如果不是,那么就重新连接
 					this.initScoket()
 				}
@@ -1259,9 +1389,8 @@
 			},
 			//关闭弹窗的回调
 			closeShow() {
-				// if (this.webSco) {
-				// 	this.webSco.close()
-				// }
+				clearInterval(this.recordsInter)
+				this.recordsInter = null
 				//给父组件传递值关闭该组件
 				this.show = false
 				this.$emit('closeMeg', this.show)

+ 158 - 21
src/views/message/index.vue

@@ -372,14 +372,12 @@
 									</div>
 									<!-- 预览简历 -->
 									 <div class="message-box-l-con inv-style" v-if="item.content && item.messageType === 10">
-										<template v-if="userType == 1">{{ item.content }}</template>
-										<template v-else>
+										<template v-if="item.userType == 1">
 											<view class="flex align-center" @click="previewResume(item.content)">
-												点击预览附件简历
-											</view>
+												点击预览附件简历</view>
 										</template>
+										<template v-else>{{ item.content }}</template>
 									 </div>
-									<!-- 面试邀约消息 -->
 									<div class="message-box-l-con inv-style" v-if="item.content && item.messageType === 99">您收到了{{ item.content }}</div>
 									<!-- 面试拒绝或同意 -->
 									<div class="message-box-l-con inv-style" v-if="item.content && (item.messageType === 96 || item.messageType === 97)">{{ item.content }}</div>
@@ -462,7 +460,7 @@
 									</div>
 									<!-- 简历预览 -->
 									<div class="message-box-r-con invitation" v-if="item.content && item.messageType === 10">
-										<template v-if="userType == 1">
+										<template v-if="item.userType == 1">
 											<view class="flex align-center" @click="previewResume(item.content)">点击预览附件简历</view>
 										</template>
 										<template v-else>{{ item.content }}</template>
@@ -488,8 +486,7 @@
 					<div class="content-r-msg-btom flex align-center justify-center">
 						<div class="content-r-msg-btoms">
 							<div class="message-btom-content">
-								<el-input @keyup.enter.prevent="sendMessage(1)" style="margin-top: 10px;" resize="none"
-									:input-style="inputStyles" v-model="content" :autosize="{ minRows: 3, maxRows: 3 }"
+								<el-input @keyup.enter.prevent="sendMessage(1)" style="margin-top: 10px;" resize="none" v-model="content" :autosize="{ minRows: 3, maxRows: 3 }"
 									type="textarea" placeholder="请输入内容" />
 							</div>
 							<div class="message-btom-btn flex align-center justify-between">
@@ -604,6 +601,69 @@
 				<el-button type="primary" @click="downloadResume">下载简历</el-button>
 			</template>
 		</el-dialog>
+		<!-- 面试邀约弹窗 -->
+		<el-dialog v-model="showBtn" title="面试邀约" width="15%" :close-on-click-modal="false">
+			<div class="avatorm flex justify-center">
+				<div class="avatorm-box flex justify-center">
+					<!-- 用户头像 -->
+					<template v-if="recordInfo.userEntity && recordInfo.userEntity.avatar">
+						<img :src="recordInfo.userEntity.avatar" class="avatar-img" alt="">
+					</template>
+					<template v-else>
+						<img src="/default.jpg" class="avatar-img" alt="">
+					</template>
+
+					<!-- HR头像 -->
+					<template v-if="recordInfo.hr && recordInfo.hr.hrImg">
+						<img :src="recordInfo.hr.hrImg" class="avatar-img" alt="">
+					</template>
+					<template v-else>
+						<img src="/default.jpg" class="avatar-img" alt="">
+					</template>
+				</div>
+			</div>
+			<div class="avatorm flex justify-center" style="margin-top: 10px;">
+				<div class="avatorm-box">
+					<div class="avatorm-box-item flex">
+						<div class="avatorm-box-item-t">面试岗位:</div>
+						<div class="avatorm-box-item-r">{{ recordInfo.postPush ? recordInfo.postPush.ruleClassifyName : '未知'
+							}}</div>
+					</div>
+
+					<div class="avatorm-box-item flex" v-if="recordInfo">
+						<div class="avatorm-box-item-t">面试时间:</div>
+						<div class="avatorm-box-item-r">
+							{{ recordInfo.interviewDateTime && recordInfo.interviewDateTime.substring(0, 10) || '' }}
+							{{ recordInfo.detailTime }}
+						</div>
+					</div>
+
+					<div class="avatorm-box-item flex map-item">
+						<div class="avatorm-box-item-t">面试地点:</div>
+						<div class="avatorm-box-item-r">
+							{{ recordInfo.detailedAddress }}
+							<i class="iconfont icon-map" style="color: #016BF6; margin-left: 5px;"></i>
+						</div>
+					</div>
+
+					<div class="avatorm-box-item flex">
+						<div class="avatorm-box-item-t">面试备注:</div>
+						<div class="avatorm-box-item-r">
+							{{ recordInfo.remarks ? recordInfo.remarks : '暂无' }}
+						</div>
+					</div>
+				</div>
+			</div>
+			<div class="avatorm flex justify-center" v-if="recordInfo.company">
+				<div class="avatorm-box flex justify-center" style="margin-top: 10px;margin-bottom: 20px;">
+					来自 {{ recordInfo.company.companyAllName || recordInfo.company.companyName }} 的面试邀请,是否接受?
+				</div>
+			</div>
+			<template #footer>
+				<el-button @click="coleInterView(2)">拒绝</el-button>
+				<el-button type="primary" @click="coleInterView(1)">同意</el-button>
+			</template>
+		</el-dialog>
 		<!-- 附件列表 -->
 		<AttachmentSelectDialog @closePostPush="closePostPush" @select="selectItem" v-if="showDialog" :showDialog="showDialog" />
 	</div>
@@ -715,8 +775,7 @@
 				jobList:[],
 				isShowCommon:false, //是否显示常用语
 				changYongList:[],
-				webSocketState:false,
-				webSco:null,
+				webSocketState: false,
 				conversationInfo: {},
 				resumesStatusMap: {
 					0: '离职-随时到岗',
@@ -726,7 +785,10 @@
 					4:'实习'
 				},
 				activeName: 'all',
-
+				recordInfo:{},//面试邀请信息
+				showBtn:false,
+				recordsInter: '',
+				time:null
 			}
 		},
 		computed: {
@@ -744,17 +806,58 @@
 				return /<[^>]+>/.test(str);
 			}
 		},
+		beforeDestroy() {
+			clearInterval(this.recordsInter)
+			this.recordsInter = null
+			clearInterval(this.time)
+			this.time = null
+			removeSocketListener(this.msgCallback)
+		},
 		mounted() {
 			this.screenHeight = window.innerHeight
 			this.userId = localStorage.getItem('userId')
 			this.getMsgList()
 			this.getweiduMsg()
-			this.getChatList()
-			setTimeout(() => {
-				this.getChangYong();
-			}, 1000);
+			// 获取左侧列表
+			this.time = setInterval(() => {
+				this.getChatList();
+			}, 3000)
 		},
 		methods: {
+			//拒绝或者接受面试邀请
+			coleInterView(type) {
+				ElMessageBox.alert(type == 2 ? '确认拒绝该面试邀请吗?' : '确定接受该面试邀请', '提示', {
+					confirmButtonText: '确认',
+					showCancelButton: true,
+					callback: (res) => {
+						if (res == 'confirm') { //确认
+							let data = {
+								recordId: this.recordInfo.recordId,
+								type: type
+							}
+							this.$Request.get('/app/interviewRecord/userUpdateInter', {
+								params: data
+							}).then(res => {
+								if (res.code == 0) {
+									ElMessage({
+										message: type == 1 ? '已接受' : '已拒绝',
+										type: type == 1 ? 'success' : 'error',
+										duration: 1500,
+										offset: this.screenHeight / 2
+									})
+									if (type == 1) {
+										this.sendMessage(97, res.data)
+									} else {
+										this.sendMessage(96, res.data)
+									}
+									this.getCHarList()
+									this.getStatusInfo()
+								}
+							})
+						}
+					}
+				})
+			},
 			previewResume(attachmentAddress){
 				const isFileLink = /^https?:\/\/.+\.(pdf|doc|docx|xls|xlsx)$/i.test(attachmentAddress);
 				if (!isFileLink) {
@@ -1096,7 +1199,6 @@
 						}
 					}
 				});
-
 			},
 			initScoket() {
 				this.webSco = this.$socket.getSocket();
@@ -1179,7 +1281,10 @@
 				if (this.userType == 1) { //用户
 					this.byUserId = item.focusedUserId
 					this.czList[3].name = '发简历'
-
+					// 获取用户是否有面试记录
+					this.recordsInter = setInterval(() => {
+						this.getInterviewList()
+					}, 2000)
 				} else { //招聘者
 					this.byUserId = item.userId
 					this.resumesId = item.resumesId
@@ -1195,10 +1300,8 @@
 
 				//获取聊天记录
 				this.getCHarList();
-				this.getChatList();
 				//获取交换状态
 				this.getStatusInfo()
-				this.initScoket()
 				this.selectIndex = 3
 			},
 			//关闭弹窗
@@ -1206,6 +1309,24 @@
 				this.isShowEmoj = false
 				this.isShowCommon = false
 			},
+			// 获取用户是否有面试记录
+			getInterviewList() {
+				let data = {
+					status: 1,
+					postPushId: this.postPushId
+				}
+				this.$Request.get("/app/interviewRecord/interviewList", {params: data }).then(res => {
+					if (res.code == 0) {
+						if ((res.data.records).length > 0) {
+							this.recordInfo = res.data.records[0]
+							this.showBtn = true;
+						}else{
+							this.recordInfo = {}
+							this.showBtn = false;
+						}
+					}
+				})
+			},
 			// 同意简历请求并发送简历
 			sendResumesSave(resumesAttachmentId) {
 				let that = this
@@ -1346,7 +1467,7 @@
 						this.content = ''
 						//获取聊天记录
 						this.getCHarList()
-					}, 50)
+					}, 100)
 				} else { //如果不是,那么就重新连接
 					this.initScoket()
 				}
@@ -1384,6 +1505,14 @@
 				if (type == 24) { //刷新
 					data.content = '刷新';
 				}
+				if (type == 96) { //拒绝面试邀约
+					data.content = '已拒绝面试邀请';
+					data.recordId = url
+				}
+				if (type == 97) { //同意面试邀约
+					data.content = '已接受面试邀请';
+					data.recordId = url
+				}
 				if(type == 99){ //面试邀约
 					data.content = '一份面试邀约';
 				}
@@ -1398,7 +1527,7 @@
 						this.content = ''
 						//获取聊天记录
 						this.getCHarList()
-					}, 50)
+					}, 100)
 				} else { //如果不是,那么就重新连接
 					this.initScoket()
 				}
@@ -2269,4 +2398,12 @@
 		justify-content: center;
 		padding: 0 6px;
 	}
+	.avatar-img{
+		width: 50px;
+		height: 50px;
+		border-radius: 50%;
+	}
+	.avatorm-box-item{
+		line-height: 30px;
+	}
 </style>