|
|
@ -11,10 +11,7 @@ |
|
|
<div class="container"> |
|
|
<div class="container"> |
|
|
<div class="handle-box"> |
|
|
<div class="handle-box"> |
|
|
<el-input placeholder="公告标题" class="handle-input mr10" v-model="query.title"></el-input> |
|
|
<el-input placeholder="公告标题" class="handle-input mr10" v-model="query.title"></el-input> |
|
|
<el-select placeholder="发布人员" class="handle-select mr10" v-model="query.auditID"> |
|
|
<el-input placeholder="发布人员ID" class="handle-input mr10" v-model="query.auditID"></el-input> |
|
|
<el-option key="1" label="广东省" value="广东省"></el-option> |
|
|
|
|
|
<el-option key="2" label="湖南省" value="湖南省"></el-option> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
<el-date-picker |
|
|
<el-date-picker |
|
|
class="mr10" |
|
|
class="mr10" |
|
|
v-model="query.time" |
|
|
v-model="query.time" |
|
|
@ -27,7 +24,8 @@ |
|
|
align="right" |
|
|
align="right" |
|
|
> |
|
|
> |
|
|
</el-date-picker> |
|
|
</el-date-picker> |
|
|
<el-button type="primary" icon="el-icon-search" @click="handleSearch">搜索</el-button> |
|
|
<el-button type="primary" icon="el-icon-search" @click="getData">搜索</el-button> |
|
|
|
|
|
<el-button type="primary" @click="handleEdit(0)">新增通知公告</el-button> |
|
|
</div> |
|
|
</div> |
|
|
<el-table |
|
|
<el-table |
|
|
:data="tableData" |
|
|
:data="tableData" |
|
|
@ -35,28 +33,21 @@ |
|
|
class="table" |
|
|
class="table" |
|
|
ref="multipleTable" |
|
|
ref="multipleTable" |
|
|
header-cell-class-name="table-header" |
|
|
header-cell-class-name="table-header" |
|
|
@selection-change="handleSelectionChange" |
|
|
|
|
|
> |
|
|
> |
|
|
<el-table-column prop="id" label="序号" width="55" align="center"></el-table-column> |
|
|
<el-table-column prop="id" label="序号" width="55" align="center"></el-table-column> |
|
|
<el-table-column prop="name" label="发布日期" :formatter="formatDate"></el-table-column> |
|
|
<el-table-column prop="name" label="发布日期" :formatter="formatDate"></el-table-column> |
|
|
<el-table-column label="公告标题" prop="name"></el-table-column> |
|
|
<el-table-column label="公告标题" prop="name"></el-table-column> |
|
|
<el-table-column prop="address" label="法人名称"></el-table-column> |
|
|
<el-table-column label="发布人员" prop="name"></el-table-column> |
|
|
<el-table-column label="意见内容" prop="name"></el-table-column> |
|
|
|
|
|
<el-table-column label="回复人员" prop="name"></el-table-column> |
|
|
|
|
|
<el-table-column label="操作" width="280" align="center"> |
|
|
<el-table-column label="操作" width="280" align="center"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<el-button |
|
|
<el-button |
|
|
type="text" |
|
|
type="text" |
|
|
@click="handleEdit(scope.$index, scope.row)" |
|
|
@click="handleEdit(1, scope.row)" |
|
|
>资料查看</el-button> |
|
|
>公告内容</el-button> |
|
|
<el-button |
|
|
<el-button |
|
|
type="text" |
|
|
type="text" |
|
|
@click="handleDelete(scope.$index, scope.row)" |
|
|
@click="handleDelete(scope.$index, scope.row)" |
|
|
>查看附件</el-button> |
|
|
>删除公告</el-button> |
|
|
<el-button |
|
|
|
|
|
type="text" |
|
|
|
|
|
@click="handleDelete(scope.$index, scope.row)" |
|
|
|
|
|
>回复内容</el-button> |
|
|
|
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
|
@ -73,27 +64,26 @@ |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<!-- 编辑弹出框 --> |
|
|
<!-- 编辑弹出框 --> |
|
|
<el-dialog title="编辑" :visible.sync="editVisible" width="30%"> |
|
|
<el-dialog title="通知公告配置" :visible.sync="editVisible" width="40%"> |
|
|
<el-form ref="form" :model="form" label-width="70px"> |
|
|
<el-form ref="form" :model="form" :rules="rules"> |
|
|
<el-form-item label="用户名"> |
|
|
<el-form-item label="公告标题" prop="title" class="form_item"> |
|
|
<el-input v-model="form.name"></el-input> |
|
|
<el-input v-model="form.title" placeholder="请输入公告标题"></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="地址"> |
|
|
<el-form-item label="公告内容" prop="content" class="form_item"> |
|
|
<el-input v-model="form.address"></el-input> |
|
|
<el-input v-model="form.content" type="textarea" :rows="2" placeholder="请输入公告内容"></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<span slot="footer" class="dialog-footer"> |
|
|
<span slot="footer" class="dialog-footer"> |
|
|
<el-button @click="editVisible = false">取 消</el-button> |
|
|
<el-button @click="editVisible = false">取 消</el-button> |
|
|
<el-button type="primary" @click="saveEdit">确 定</el-button> |
|
|
<el-button type="primary" @click="setNotice">确 定</el-button> |
|
|
</span> |
|
|
</span> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { getNoticeList } from '../../../api/index'; |
|
|
import { getNoticeList ,setNotice} from '../../../api/index'; |
|
|
export default { |
|
|
export default { |
|
|
name: 'basetable', |
|
|
|
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
query: { |
|
|
query: { |
|
|
@ -103,14 +93,23 @@ export default { |
|
|
limit: 10, |
|
|
limit: 10, |
|
|
time:'' |
|
|
time:'' |
|
|
}, |
|
|
}, |
|
|
|
|
|
noticeType:0, |
|
|
|
|
|
form:{ |
|
|
|
|
|
id:'', |
|
|
|
|
|
title:'', |
|
|
|
|
|
content:'' |
|
|
|
|
|
}, |
|
|
|
|
|
rules:{ |
|
|
|
|
|
title: [ |
|
|
|
|
|
{ required: true, message: '请输入公告标题', trigger: 'blur' }, |
|
|
|
|
|
], |
|
|
|
|
|
content: [ |
|
|
|
|
|
{ required: true, message: '请输入公告内容', trigger: 'blur' }, |
|
|
|
|
|
], |
|
|
|
|
|
}, |
|
|
tableData: [], |
|
|
tableData: [], |
|
|
multipleSelection: [], |
|
|
|
|
|
delList: [], |
|
|
|
|
|
editVisible: false, |
|
|
editVisible: false, |
|
|
pageTotal: 0, |
|
|
pageTotal: 0, |
|
|
form: {}, |
|
|
|
|
|
idx: -1, |
|
|
|
|
|
id: -1, |
|
|
|
|
|
pickerOptions: { |
|
|
pickerOptions: { |
|
|
shortcuts: [ |
|
|
shortcuts: [ |
|
|
{ |
|
|
{ |
|
|
@ -148,6 +147,20 @@ export default { |
|
|
this.getData(); |
|
|
this.getData(); |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
//设置通知公告配置 |
|
|
|
|
|
setNotice(){ |
|
|
|
|
|
this.$refs["form"].validate((valid) => { |
|
|
|
|
|
if (valid) { |
|
|
|
|
|
if (this.noticeType==0) { |
|
|
|
|
|
setNotice(this.form).then(res=>{ |
|
|
|
|
|
console.info(res) |
|
|
|
|
|
}) |
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
//时间戳转换时间 |
|
|
//时间戳转换时间 |
|
|
formatDate(row,colnum){ |
|
|
formatDate(row,colnum){ |
|
|
return moment(row[colnum.create_time]).format('YYYY-MM-DD HH:mm:ss') |
|
|
return moment(row[colnum.create_time]).format('YYYY-MM-DD HH:mm:ss') |
|
|
@ -160,11 +173,6 @@ export default { |
|
|
this.pageTotal = res.pageTotal ; |
|
|
this.pageTotal = res.pageTotal ; |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
// 触发搜索按钮 |
|
|
|
|
|
handleSearch() { |
|
|
|
|
|
this.$set(this.query, 'pageIndex', 1); |
|
|
|
|
|
this.getData(); |
|
|
|
|
|
}, |
|
|
|
|
|
// 删除操作 |
|
|
// 删除操作 |
|
|
handleDelete(index, row) { |
|
|
handleDelete(index, row) { |
|
|
// 二次确认删除 |
|
|
// 二次确认删除 |
|
|
@ -177,22 +185,15 @@ export default { |
|
|
}) |
|
|
}) |
|
|
.catch(() => {}); |
|
|
.catch(() => {}); |
|
|
}, |
|
|
}, |
|
|
// 多选操作 |
|
|
|
|
|
handleSelectionChange(val) { |
|
|
|
|
|
this.multipleSelection = val; |
|
|
|
|
|
}, |
|
|
|
|
|
// 编辑操作 |
|
|
// 编辑操作 |
|
|
handleEdit(index, row) { |
|
|
handleEdit(type,id) { |
|
|
this.idx = index; |
|
|
if (type==1) { |
|
|
this.form = row; |
|
|
this.form.id=id |
|
|
|
|
|
this.getNoticeFind() |
|
|
|
|
|
} |
|
|
|
|
|
this.noticeType=type |
|
|
this.editVisible = true; |
|
|
this.editVisible = true; |
|
|
}, |
|
|
}, |
|
|
// 保存编辑 |
|
|
|
|
|
saveEdit() { |
|
|
|
|
|
this.editVisible = false; |
|
|
|
|
|
this.$message.success(`修改第 ${this.idx + 1} 行成功`); |
|
|
|
|
|
this.$set(this.tableData, this.idx, this.form); |
|
|
|
|
|
}, |
|
|
|
|
|
// 分页导航 |
|
|
// 分页导航 |
|
|
handlePageChange(val) { |
|
|
handlePageChange(val) { |
|
|
this.$set(this.query, 'page', val); |
|
|
this.$set(this.query, 'page', val); |
|
|
@ -231,4 +232,16 @@ export default { |
|
|
width: 40px; |
|
|
width: 40px; |
|
|
height: 40px; |
|
|
height: 40px; |
|
|
} |
|
|
} |
|
|
|
|
|
.form_item{ |
|
|
|
|
|
margin-bottom: 25px; |
|
|
|
|
|
} |
|
|
|
|
|
.form_item >>>.el-input { |
|
|
|
|
|
width: 80%; |
|
|
|
|
|
} |
|
|
|
|
|
.form_item >>>.el-textarea{ |
|
|
|
|
|
width: 80%; |
|
|
|
|
|
} |
|
|
|
|
|
.form_item >>>.el-form-item__error{ |
|
|
|
|
|
left: 75px; |
|
|
|
|
|
} |
|
|
</style> |
|
|
</style> |
|
|
|