<template>
|
<div class="list">
|
<header>
|
<div class="header-content">
|
<div class="search">
|
<span>筛选条件:</span>
|
<el-input placeholder="请输入内容" v-model="context"></el-input>
|
<div class="findBtn">
|
<el-button type="primary" @click="setTableData">查询</el-button>
|
</div>
|
</div>
|
</div>
|
</header>
|
<main>
|
<div class="main-content">
|
<!-- 数据展示 -->
|
<el-table
|
border
|
stripe
|
ref="multipleTable"
|
:header-cell-style="{
|
'background':'#F5F5F5',
|
'font-weight': '650',
|
'line-height': '45px',
|
}"
|
:row-class-name="tableRowClassName"
|
:data="list"
|
style="width: 100%"
|
>
|
<el-table-column type="selection" min-width="5"> </el-table-column>
|
<el-table-column prop="writCode" label="文书编号" min-width="100">
|
</el-table-column>
|
<el-table-column prop="writTypeName" label="文书种类" min-width="180">
|
</el-table-column>
|
<el-table-column prop="categoryName" label="违法类型" min-width="80">
|
</el-table-column>
|
<el-table-column prop="eventCode" label="事件编号" min-width="100">
|
</el-table-column>
|
<el-table-column prop="sendTime" label="文书发放时间" min-width="120">
|
</el-table-column>
|
<el-table-column prop="limitTime" label="文书限定时间" min-width="120">
|
</el-table-column>
|
<el-table-column
|
prop="sendContent"
|
label="文书发放内容"
|
min-width="110"
|
>
|
</el-table-column>
|
<el-table-column
|
prop="rectifyTime"
|
label="实际整改时间"
|
min-width="120"
|
>
|
</el-table-column>
|
<el-table-column
|
prop="rectifySituation"
|
label="整改情况"
|
min-width="110"
|
>
|
</el-table-column>
|
|
<el-table-column
|
prop="state"
|
:formatter="formatSate"
|
label="状态"
|
min-width="60"
|
>
|
</el-table-column>
|
|
<el-table-column prop="operation" label="操作" min-width="150">
|
<template slot-scope="scope">
|
<div class="operation">
|
<span v-if="!scope.row.value" @click="handleEdit(scope.row)"
|
>下发文书</span
|
>
|
<span v-if="scope.row.value" @click="handleView(scope.row)"
|
>查看</span
|
>
|
<span class="line">|</span>
|
<span @click="handleDelete(scope.row)">删除文书</span>
|
</div>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
|
<!-- tools -->
|
<div class="tools">
|
<div class="funs"></div>
|
<div class="pagination">
|
<el-pagination
|
background
|
:current-page="currentPage"
|
layout="prev, pager, next"
|
:total="totalNum"
|
:page-size="pageSize"
|
@current-change="changeCurrentPage"
|
@prev-click="handlePrev"
|
@next-click="handleNext"
|
>
|
</el-pagination>
|
</div>
|
</div>
|
</main>
|
<footer>
|
<!-- 下发文书 -->
|
<el-dialog
|
title="下发文书"
|
:visible.sync="dialogCreate"
|
v-if="dialogCreate"
|
width="80%"
|
:before-close="handleClose"
|
>
|
<component
|
:is="componentName"
|
:writ="writ"
|
@closeDialog="handleCallBack"
|
></component>
|
</el-dialog>
|
</footer>
|
</div>
|
</template>
|
<script>
|
import { createNamespacedHelpers } from "vuex";
|
const { mapActions } = createNamespacedHelpers("writ");
|
|
import InquestRecordEdit from "../components/inquest_record/edit.vue";
|
import NotificationEdit from "../components/instruct_notification/edit.vue";
|
|
export default {
|
components: {
|
InquestRecordEdit,
|
NotificationEdit,
|
},
|
data() {
|
return {
|
dialogCreate: false,
|
context: null,
|
options: [
|
{
|
value: null,
|
label: "全部",
|
},
|
{
|
value: 1,
|
label: "在线",
|
},
|
{
|
value: 0,
|
label: "离线",
|
},
|
],
|
list: [],
|
totalNum: 0,
|
pageSize: 10,
|
currentPage: 1,
|
renderFlag: false,
|
writ: {},
|
componentName: "",
|
};
|
},
|
created() {
|
this.setTableData();
|
},
|
methods: {
|
...mapActions(["getWritList", "updateWrit", "deleteWrit"]),
|
|
handleEdit(row) {
|
this.writ = row;
|
this.setComponent(row);
|
this.dialogCreate = true;
|
},
|
handleView(row) {
|
this.writ = row;
|
this.setComponent(row);
|
this.dialogCreate = true;
|
},
|
setComponent(row, isEdit) {
|
switch (row.templateCode) {
|
case "inquest_record":
|
this.componentName = InquestRecordEdit;
|
break;
|
case "instruct_to_correct_notification":
|
this.componentName = NotificationEdit;
|
break;
|
}
|
},
|
handleDelete(row) {
|
this.$confirm("确认删除?").then((_) => {
|
console.log(row)
|
this.deleteWrit(row.baseCaseId).then((res) => {
|
this.$message({
|
type: "success",
|
message: "删除成功!",
|
});
|
this.setTableData();
|
});
|
});
|
},
|
|
handleCallBack(e) {
|
this.currentPage = 1;
|
this.dialogCreate = false;
|
this.setTableData();
|
},
|
formatSate(row, column) {
|
return row.value ? "已下发" : "未下发";
|
},
|
|
// 设置表格斑马纹
|
tableRowClassName({ row, rowIndex }) {
|
if ((rowIndex + 1) % 2 === 0) {
|
return "warning-row";
|
} else {
|
return "success-row";
|
}
|
},
|
// 弹窗关闭
|
handleClose(done) {
|
this.$confirm("确认关闭?").then((_) => {
|
this.dialogCreate = false;
|
done();
|
});
|
},
|
// 设置tableData
|
setTableData() {
|
const { currentPage, pageSize, context } = this;
|
this.getWritList({
|
currentPage,
|
pageSize,
|
keyword: context,
|
}).then((res) => {
|
this.list = res.records;
|
this.totalNum = res.total;
|
});
|
},
|
handleStateChange(e) {
|
this.setTableData();
|
},
|
// 当前页改变触发事件
|
changeCurrentPage(page) {
|
this.currentPage = page;
|
this.setTableData();
|
},
|
// 上一页点击事件
|
handlePrev(page) {
|
this.currentPage = page;
|
this.setTableData();
|
},
|
// 下一页点击事件
|
handleNext(page) {
|
this.currentPage = page;
|
this.setTableData();
|
},
|
},
|
};
|
</script>
|
<style lang="scss" scoped>
|
.list {
|
text-align: left;
|
padding: 10px 20px;
|
color: #4b9bb7;
|
border: 1px solid #ccc;
|
header {
|
background-color: white;
|
|
.header-content {
|
padding: 0;
|
display: flex;
|
line-height: 100px;
|
justify-content: space-between;
|
align-items: center;
|
|
.search {
|
display: flex;
|
justify-content: flex-start;
|
|
span {
|
flex: 1;
|
}
|
|
.el-input {
|
flex: 2;
|
color: #1d3f57;
|
|
&::v-deep .el-input__inner {
|
background-color: #fff;
|
//border: 1px solid #17324c;
|
}
|
}
|
}
|
}
|
}
|
|
main {
|
background-color: #fff;
|
margin-top: 20px;
|
padding-bottom: 50px;
|
|
.main-title {
|
line-height: 60px;
|
padding: 10px 20px;
|
}
|
|
.tools {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
padding: 0 20px;
|
|
.funs {
|
display: flex;
|
|
.funsItem {
|
line-height: 28px;
|
display: flex;
|
align-items: center;
|
//border: 1px solid #17324c;
|
border-radius: 4px;
|
font-size: 12px;
|
margin-left: 10px;
|
|
.el-checkbox {
|
width: 80px;
|
padding: 0 10px;
|
}
|
|
.el-select {
|
width: 120px;
|
}
|
|
&::v-deep .el-input__inner {
|
border: none;
|
// background-color: #09152f;
|
}
|
|
&:hover {
|
border: 1px solid #4b9bb7;
|
}
|
|
&:hover .el-checkbox {
|
color: #4b9bb7;
|
}
|
}
|
}
|
|
.pagination {
|
margin-top: 50px;
|
display: flex;
|
line-height: 50px;
|
justify-content: center;
|
|
.el-pagination {
|
&::v-deep li,
|
&::v-deep .btn-prev,
|
&::v-deep .btn-next {
|
// background-color: #071f39;
|
color: #4b9bb7;
|
}
|
|
&::v-deep .active {
|
background-color: #409eff;
|
color: #fff;
|
}
|
}
|
}
|
}
|
// &::v-deep .warning-row {
|
// background-color: #06122c;
|
// }
|
|
// &::v-deep .success-row {
|
// background-color: #071f39;
|
// }
|
|
.operationBox {
|
display: flex;
|
}
|
|
.el-divider {
|
background-color: #4b9bb7;
|
}
|
.el-table {
|
// color: #4b9bb7;
|
// font-size: 10px;
|
.operation {
|
display: flex;
|
|
.line {
|
padding: 0 5px;
|
}
|
color: var(--operation-color);
|
span:hover {
|
cursor: pointer;
|
}
|
}
|
}
|
}
|
// 设置dialog样式
|
::v-deep .el-dialog__body {
|
background-color: #fff;
|
// color: #000;
|
}
|
|
::v-deep .el-dialog__header {
|
// background-color: #06122c !important;
|
color: #fff;
|
}
|
}
|
.headerContent {
|
padding: 0 40px;
|
display: flex;
|
line-height: 100px;
|
justify-content: space-between;
|
align-items: center;
|
|
.search {
|
display: flex;
|
justify-content: flex-start;
|
|
span {
|
flex: 1;
|
}
|
|
.el-input {
|
flex: 2;
|
color: #1d3f57;
|
}
|
}
|
}
|
|
.findBtn {
|
line-height: 100px;
|
margin-left: 15px;
|
display: flex;
|
align-items: center;
|
margin-top: -2px;
|
|
.el-button {
|
padding: 12px 25px;
|
//border-radius: 20px;
|
}
|
}
|
</style>
|