Просмотр исходного кода

后管添加默认招呼呀配置

yuan 5 месяцев назад
Родитель
Сommit
f6fc5c3cbb
1 измененных файлов с 328 добавлено и 0 удалено
  1. 328 0
      src/views/message/message.vue

+ 328 - 0
src/views/message/message.vue

@@ -326,6 +326,68 @@
 				</el-pagination>
 			</div>
 		</el-tab-pane>
+		<el-tab-pane label="求职方默认招呼语" name="erNewMessage">
+			<el-button style="margin:10px;" size="mini" type="primary" icon="document"
+				:disabled="!isAuth('message:add')" @click="erNewMessageAdd(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="erNewMessageAdd(1,scope.row)">修改
+						</el-button>
+						<el-button size="mini" type="danger" :disabled="!isAuth('positionList:delete')" style="margin: 5px;"
+							@click="erNewMessageDelete(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="eeNewMessage">
+			<el-button style="margin:10px;" size="mini" type="primary" icon="document"
+				:disabled="!isAuth('message:add')" @click="eeNewMessageAdd(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="eeNewMessageAdd(1,scope.row)">修改
+						</el-button>
+						<el-button size="mini" type="danger" :disabled="!isAuth('positionList:delete')" style="margin: 5px;"
+							@click="eeNewMessageDelete(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;">
@@ -350,6 +412,30 @@
 				<el-button type="primary" @click="addEeMessage()">确 定</el-button>
 			</div>
 		</el-dialog>
+		<!-- 添加、修改求职者默认招呼语 -->
+		<el-dialog :title="titles" :visible.sync="dialogFormVisible11" 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="dialogFormVisible11 = false">取 消</el-button>
+				<el-button type="primary" @click="addErNewMessage()">确 定</el-button>
+			</div>
+		</el-dialog>
+		<!-- 添加、修改企业方默认招呼语 -->
+		<el-dialog :title="titles" :visible.sync="dialogFormVisible12" 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="dialogFormVisible12 = false">取 消</el-button>
+				<el-button type="primary" @click="addEeNewMessage()">确 定</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"
@@ -501,6 +587,8 @@
 				dialogFormVisible: false,
 				dialogFormVisible9: false,
 				dialogFormVisible10: false,
+				dialogFormVisible11: false,
+				dialogFormVisible12: false,
 				tableData: [],
 				radio: '',
 				clStatus: '',
@@ -630,6 +718,20 @@
 					this.platform1 = 1
 					this.dataSelect2()
 				}
+				if (tab._props.label == '求职方默认招呼语') {
+					this.page = 1
+					this.limit = 10
+					this.state = 90
+					this.platform1 = 1
+					this.dataSelect2()
+				}
+				if (tab._props.label == '企业方默认招呼语') {
+					this.page = 1
+					this.limit = 10
+					this.state = 100
+					this.platform1 = 1
+					this.dataSelect2()
+				}
 			},
 			// 消息推送
 			magNotice() {
@@ -840,6 +942,232 @@
 
 				})
 			},
+			// 添加/修改求职方默认招呼语
+			erNewMessageAdd(index, row) {  // index 0 添加,1 修改
+				this.title = '求职方默认招呼语'
+				this.state = 90
+				if (index==1) {
+					this.id = row.id
+					this.titles = '修改默认招呼语'
+					this.content = row.content
+				} else {
+					this.titles = '添加默认招呼语'
+					this.id = ''
+					this.content = ''
+				}
+				this.dialogFormVisible11 = true
+
+			},
+			// 提交修改、添加求职方默认招呼语
+			addErNewMessage() {
+
+				if (this.content == '') {
+					this.$notify({
+						title: '提示',
+						duration: 1800,
+						message: '请输入消息内容',
+						type: 'warning'
+					})
+					return
+				}
+				if (this.content.indexOf('【')!=-1 && this.content.indexOf('】')==-1
+					|| this.content.indexOf('【')==-1 && this.content.indexOf('】')!=-1) {
+					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': 90,
+						'title': this.title
+					})
+				}).then(({
+					data
+				}) => {
+					if(data.code==0){
+						this.dialogFormVisible11 = false
+						this.$message({
+							message: '操作成功',
+							type: 'success',
+							duration: 1500,
+							onClose: () => {
+								this.dataSelect2()
+							}
+						})
+					}else{
+						this.$message({
+							message: data.msg,
+							type: 'warning',
+							duration: 1500,
+							onClose: () => {
+							}
+						})
+					}
+
+				})
+			},
+			// 删除求职方默认招呼语
+			eeNewMessageDelete(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(() => {})
+			},
+			// 添加/修改企业方默认招呼语
+			eeNewMessageAdd(index, row) {  // index 0 添加,1 修改
+				this.title = '企业方默认招呼语'
+				this.state = 100
+				if (index==1) {
+					this.id = row.id
+					this.titles = '修改默认招呼语'
+					this.content = row.content
+				} else {
+					this.titles = '添加默认招呼语'
+					this.id = ''
+					this.content = ''
+				}
+				this.dialogFormVisible12 = true
+
+			},
+			// 提交修改、添加企业方默认招呼语
+			addEeNewMessage() {
+
+				if (this.content == '') {
+					this.$notify({
+						title: '提示',
+						duration: 1800,
+						message: '请输入消息内容',
+						type: 'warning'
+					})
+					return
+				}
+				if (this.content.indexOf('【')!=-1 && this.content.indexOf('】')==-1
+					|| this.content.indexOf('【')==-1 && this.content.indexOf('】')!=-1) {
+					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': 100,
+						'title': this.title
+					})
+				}).then(({
+					data
+				}) => {
+					if(data.code==0){
+						this.dialogFormVisible12 = false
+						this.$message({
+							message: '操作成功',
+							type: 'success',
+							duration: 1500,
+							onClose: () => {
+								this.dataSelect2()
+							}
+						})
+					}else{
+						this.$message({
+							message: data.msg,
+							type: 'warning',
+							duration: 1500,
+							onClose: () => {
+							}
+						})
+					}
+
+				})
+			},
+			// 删除企业方默认招呼语
+			eeNewMessageDelete(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(() => {})
+			},
 			// 添加/修改企业方常用短语
 			eeMessageAdd(index, row) {  // index 0 添加,1 修改
 				this.title = '企业方常用短语'