Ver código fonte

消息中心添加求职者和企业方常用短语

corn 6 meses atrás
pai
commit
0de6a98e34
1 arquivos alterados com 349 adições e 1 exclusões
  1. 349 1
      src/views/message/message.vue

+ 349 - 1
src/views/message/message.vue

@@ -4,8 +4,15 @@
 			<el-table v-loading="tableDataLoading" :data="tableData.list">
 				<el-table-column prop="id" label="编号" width="80">
 				</el-table-column>
-				<el-table-column prop="title" label="标题">
+				<el-table-column prop="userName" label="用户名" width="160">
+					<template slot-scope="scope">
+						<div style="color: #0066CC;cursor: pointer;" @click="updataDetails(scope.row.userId)">
+							{{scope.row.userName}}
+						</div>
+					</template>
 				</el-table-column>
+				<el-table-column prop="title" label="标题">
+				</el-table-column>	
 				<el-table-column prop="content" label="内容">
 				</el-table-column>
 				<el-table-column prop="createAt" label="创建时间" width="160">
@@ -257,6 +264,92 @@
 				</el-pagination>
 			</div>
 		</el-tab-pane>
+		<el-tab-pane label="求职者常用短语" name="erMessage">
+			<el-button style="margin:10px;" size="mini" type="primary" icon="document"
+				:disabled="!isAuth('message:add')" @click="erMessageAdd(0)">添加
+			</el-button>
+			<el-table v-loading="tableDataLoading" :data="tableData.list">
+				<el-table-column prop="id" label="编号" width="80">
+				</el-table-column>
+				<el-table-column prop="title" label="消息标题">
+				</el-table-column>
+				<el-table-column prop="content" label="消息内容">
+				</el-table-column>
+				<el-table-column prop="createAt" label="创建时间" width="160">
+				</el-table-column>
+				<el-table-column label="操作" prop="id" width="200" fixed='right' align="center">
+					<template slot-scope="scope">
+						<el-button size="mini" type="primary" :disabled="!isAuth('positionList:update')" style="margin: 5px;"
+							@click="erMessageAdd(1,scope.row)">修改
+						</el-button>
+						<el-button size="mini" type="danger" :disabled="!isAuth('positionList:delete')" style="margin: 5px;"
+							@click="erMessageDelete(scope.row)">删除
+						</el-button>
+					</template>
+				</el-table-column>
+			</el-table>
+			<div style="text-align: center;margin-top: 10px;">
+				<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+					:page-sizes="[10, 20, 30, 40]" :page-size="limit" :current-page="page"
+					layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalCount">
+				</el-pagination>
+			</div>
+		</el-tab-pane>
+		<el-tab-pane label="企业方常用短语" name="eeMessage">
+			<el-button style="margin:10px;" size="mini" type="primary" icon="document"
+				:disabled="!isAuth('message:add')" @click="eeMessageAdd(0)">添加
+			</el-button>
+			<el-table v-loading="tableDataLoading" :data="tableData.list">
+				<el-table-column prop="id" label="编号" width="80">
+				</el-table-column>
+				<el-table-column prop="title" label="消息标题">
+				</el-table-column>
+				<el-table-column prop="content" label="消息内容">
+				</el-table-column>
+				<el-table-column prop="createAt" label="创建时间" width="160">
+				</el-table-column>
+				<el-table-column label="操作" prop="id" width="200" fixed='right' align="center">
+					<template slot-scope="scope">
+						<el-button size="mini" type="primary" :disabled="!isAuth('positionList:update')" style="margin: 5px;"
+							@click="eeMessageAdd(1,scope.row)">修改
+						</el-button>
+						<el-button size="mini" type="danger" :disabled="!isAuth('positionList:delete')" style="margin: 5px;"
+							@click="eeMessageDelete(scope.row)">删除
+						</el-button>
+					</template>
+				</el-table-column>
+			</el-table>
+			<div style="text-align: center;margin-top: 10px;">
+				<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+					:page-sizes="[10, 20, 30, 40]" :page-size="limit" :current-page="page"
+					layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalCount">
+				</el-pagination>
+			</div>
+		</el-tab-pane>
+		<!-- 添加、修改求职者常用短语 -->
+		<el-dialog :title="titles" :visible.sync="dialogFormVisible9" center>
+			<div style="margin-bottom: 10px;">
+				<span style="width: 200px;display: inline-block;text-align: right;">消息内容:</span>
+				<el-input style="width:50%;" v-model="content" type="text" placeholder="请输入消息内容"></el-input>
+			</div>
+
+			<div slot="footer" class="dialog-footer">
+				<el-button @click="dialogFormVisible9 = false">取 消</el-button>
+				<el-button type="primary" @click="addErMessage()">确 定</el-button>
+			</div>
+		</el-dialog>
+		<!-- 添加、修改企业方常用短语 -->
+		<el-dialog :title="titles" :visible.sync="dialogFormVisible10" center>
+			<div style="margin-bottom: 10px;">
+				<span style="width: 200px;display: inline-block;text-align: right;">消息内容:</span>
+				<el-input style="width:50%;" v-model="content" type="text" placeholder="请输入消息内容"></el-input>
+			</div>
+
+			<div slot="footer" class="dialog-footer">
+				<el-button @click="dialogFormVisible10 = false">取 消</el-button>
+				<el-button type="primary" @click="addEeMessage()">确 定</el-button>
+			</div>
+		</el-dialog>
 		<!-- <el-tab-pane label="消息推送" name="seventh">
 			<div style="float: right;margin-right:2%;">
 				<el-button style='margin: 10px 0;' :disabled="!isAuth('message:push')" size="mini" type="primary"
@@ -406,6 +499,8 @@
 				dialogFormVisible1: false,
 				dialogFormVisible2: false,
 				dialogFormVisible: false,
+				dialogFormVisible9: false,
+				dialogFormVisible10: false,
 				tableData: [],
 				radio: '',
 				clStatus: '',
@@ -521,6 +616,20 @@
 					this.platform1 = 1
 					this.dataSelect1()
 				}
+				if (tab._props.label == '求职者常用短语') {
+					this.page = 1
+					this.limit = 10
+					this.state = 70
+					this.platform1 = 1
+					this.dataSelect2()
+				}
+				if (tab._props.label == '企业方常用短语') {
+					this.page = 1
+					this.limit = 10
+					this.state = 80
+					this.platform1 = 1
+					this.dataSelect2()
+				}
 			},
 			// 消息推送
 			magNotice() {
@@ -701,6 +810,245 @@
 
 				})
 			},
+			// 获取求职者常用短语
+			dataSelect2() {
+				this.tableDataLoading = true
+				this.$http({
+					url: this.$http.adornUrl(`message/selectMessageByType`),
+					method: 'get',
+					params: this.$http.adornParams({
+						'page': this.page,
+						'limit': this.limit,
+						'state': this.state,
+						// 'type': this.platform1
+					})
+				}).then(({
+					data
+				}) => {
+					this.tableDataLoading = false
+					if (this.state == 70) {
+						for (var i in data.data.records) {
+							var a = data.data.records[i].content.toString()
+							var b = JSON.parse(a)
+							data.data.records[i].content = b
+							console.log('key', data.data.records[i].content)
+						}
+					}
+
+					let returnData = data.data;
+					this.tableData = returnData
+
+				})
+			},
+			// 添加/修改企业方常用短语
+			eeMessageAdd(index, row) {  // index 0 添加,1 修改
+				this.title = '企业方常用短语'
+				this.state = 80
+				if (index==1) {
+					this.id = row.id
+					this.titles = '修改常用短语'
+					this.content = row.content
+				} else {
+					this.titles = '添加常用短语'
+					this.id = ''
+					this.content = ''
+				}
+				this.dialogFormVisible10 = true
+
+			},
+			// 提交修改、添加企业方常用短语
+			addEeMessage() {
+
+				if (this.content == '') {
+					this.$notify({
+						title: '提示',
+						duration: 1800,
+						message: '请输入消息内容',
+						type: 'warning'
+					})
+					return
+				}
+
+				if (this.titles == '添加常用短语') {
+					var urls = 'message/add'
+				} else {
+					var urls = 'message/update'
+				}
+				this.$http({
+					url: this.$http.adornUrl(urls),
+					method: 'post',
+					data : this.$http.adornParams({
+						'id': this.id,
+						'content': this.content,
+						'state': 80,
+						'title': this.title
+					})
+				}).then(({
+					data
+				}) => {
+					if(data.code==0){
+						this.dialogFormVisible10 = false
+						this.$message({
+							message: '操作成功',
+							type: 'success',
+							duration: 1500,
+							onClose: () => {
+								this.dataSelect2()
+							}
+						})
+					}else{
+						this.$message({
+							message: data.msg,
+							type: 'warning',
+							duration: 1500,
+							onClose: () => {
+							}
+						})
+					}
+
+				})
+			},
+			// 删除分类
+			eeMessageDelete(row) {
+				this.$confirm(`确定删除此条信息?`, '提示', {
+					confirmButtonText: '确定',
+					cancelButtonText: '取消',
+					type: 'warning'
+				}).then(() => {
+					this.$http({
+						url: this.$http.adornUrl(`message/delete/${row.id}`),
+						method: 'get',
+					}).then(({
+						data
+					}) => {
+						if(data.code==0){
+							this.$message({
+								message: '删除成功',
+								type: 'success',
+								duration: 1500,
+								onClose: () => {
+									this.dataSelect2()
+								}
+							})
+						}else{
+							this.$message({
+								message: data.msg,
+								type: 'warning',
+								duration: 1500,
+								onClose: () => {
+								}
+							})
+						}
+
+					})
+				}).catch(() => {})
+			},
+			// 添加/修改求职者常用短语
+			erMessageAdd(index, row) {  // index 0 添加,1 修改
+				this.title = '求职者常用短语'
+				this.state = 70
+				if (index==1) {
+					this.id = row.id
+					this.titles = '修改常用短语'
+					this.content = row.content
+				} else {
+					this.titles = '添加常用短语'
+					this.id = ''
+					this.content = ''
+				}
+				this.dialogFormVisible9 = true
+
+			},
+						// 提交修改、添加服务分类
+			addErMessage() {
+
+				if (this.content == '') {
+					this.$notify({
+						title: '提示',
+						duration: 1800,
+						message: '请输入消息内容',
+						type: 'warning'
+					})
+					return
+				}
+
+				if (this.titles == '添加常用短语') {
+					var urls = 'message/add'
+				} else {
+					var urls = 'message/update'
+				}
+				this.$http({
+					url: this.$http.adornUrl(urls),
+					method: 'post',
+					data : this.$http.adornParams({
+						'id': this.id,
+						'content': this.content,
+						'state': 70,
+						'title': this.title
+					})
+				}).then(({
+					data
+				}) => {
+					if(data.code==0){
+						this.dialogFormVisible9 = false
+						this.$message({
+							message: '操作成功',
+							type: 'success',
+							duration: 1500,
+							onClose: () => {
+								this.dataSelect2()
+							}
+						})
+					}else{
+						this.$message({
+							message: data.msg,
+							type: 'warning',
+							duration: 1500,
+							onClose: () => {
+							}
+						})
+					}
+
+				})
+			},
+			// 删除求职者常用短语
+			erMessageDelete(row) {
+				this.$confirm(`确定删除此条信息?`, '提示', {
+					confirmButtonText: '确定',
+					cancelButtonText: '取消',
+					type: 'warning'
+				}).then(() => {
+					this.$http({
+						url: this.$http.adornUrl(`message/delete/${row.id}`),
+						method: 'get',
+						// params: this.$http.adornParams({
+						// 	'postPreferenceId': row.postPreferenceId
+						// })
+					}).then(({
+						data
+					}) => {
+						if(data.code==0){
+							this.$message({
+								message: '删除成功',
+								type: 'success',
+								duration: 1500,
+								onClose: () => {
+									this.dataSelect2()
+								}
+							})
+						}else{
+							this.$message({
+								message: data.msg,
+								type: 'warning',
+								duration: 1500,
+								onClose: () => {
+								}
+							})
+						}
+
+					})
+				}).catch(() => {})
+			},
 			//审核弹框
 			refuseClick(rows) {
 				this.radio = ''