|
|
|
|
@ -16,11 +16,11 @@
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="is_search">
|
|
|
|
|
<el-select style="width:200px" clearable @clear="clearCatalog" v-model="select.catalog_name" placeholder="请选择目录">
|
|
|
|
|
<el-select style="width:200px" clearable @clear="clearCatalog" v-model="select.catalog_name"
|
|
|
|
|
placeholder="请选择目录">
|
|
|
|
|
<el-option value="">
|
|
|
|
|
<el-tree :default-checked-keys="checkArr" :check-strictly="true" @check="getSelectedNodes"
|
|
|
|
|
:data="catalogList" show-checkbox node-key="id" ref="tree" highlight-current
|
|
|
|
|
:props="defaultProps">
|
|
|
|
|
<el-tree @node-click="getSelectedNodes" :data="catalogList" node-key="id" ref="tree"
|
|
|
|
|
highlight-current :props="defaultProps">
|
|
|
|
|
</el-tree>
|
|
|
|
|
</el-option>
|
|
|
|
|
|
|
|
|
|
@ -41,15 +41,15 @@
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<el-date-picker style="width:250px" @change="changeStart" v-model="select.startRange" type="daterange"
|
|
|
|
|
format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期"
|
|
|
|
|
end-placeholder="">
|
|
|
|
|
<el-date-picker popper-class="pickerTime" :picker-options="pickerOptions" style="width:250px"
|
|
|
|
|
@change="changeStart" v-model="select.startRange" type="daterange" format="yyyy-MM-dd"
|
|
|
|
|
value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<el-date-picker style="width:250px" @change="changeEnd" v-model="select.endRange" type="daterange"
|
|
|
|
|
format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="结束日期"
|
|
|
|
|
end-placeholder="">
|
|
|
|
|
<el-date-picker popper-class="pickerTime" :picker-options="pickerOptions" style="width:250px"
|
|
|
|
|
@change="changeEnd" v-model="select.endRange" type="daterange" format="yyyy-MM-dd"
|
|
|
|
|
value-format="yyyy-MM-dd" range-separator="至" start-placeholder="结束日期" end-placeholder="">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
@ -59,7 +59,7 @@
|
|
|
|
|
<el-button type="primary" size="small" @click="resetSearch">重置</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<el-button type="primary" size="small" @click="editIndex('add')">新增</el-button>
|
|
|
|
|
<el-button type="primary" size="small" v-if="!is_search" @click="editIndex('add')">新增</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@ -125,6 +125,24 @@
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:link_id>
|
|
|
|
|
<el-table-column align='center' label="来源文档" width="120" header-align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<div style="color:#b3241d;cursor: pointer;text-decoration: underline;" v-if="scope.row.link_id" @click="showIndex('show',scope.row.link_id)">
|
|
|
|
|
查看
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:next_link_id>
|
|
|
|
|
<el-table-column align='center' label="延续文档" width="120" header-align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<div style="color:#b3241d;cursor: pointer;text-decoration: underline;" v-if="scope.row.next_link_id" @click="showIndex('show',scope.row.next_link_id)">
|
|
|
|
|
查看
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-slot:btns>
|
|
|
|
|
@ -147,16 +165,13 @@
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<add-record ref="addRecord" @refresh="getRefresh"></add-record>
|
|
|
|
|
<addRecordLink ref="addRecordLink" @refresh="getList"></addRecordLink>
|
|
|
|
|
<add-record ref="addRecord" @refresh="getList"></add-record>
|
|
|
|
|
<show-record ref="showRecord"></show-record>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import addRecord from './components/addRecord.vue';
|
|
|
|
|
import addRecordLink from './components/addRecordLink.vue';
|
|
|
|
|
|
|
|
|
|
import showRecord from './components/showRecord.vue';
|
|
|
|
|
import {
|
|
|
|
|
index,
|
|
|
|
|
@ -166,11 +181,94 @@
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
addRecord,
|
|
|
|
|
addRecordLink,
|
|
|
|
|
showRecord
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
pickerOptions: {
|
|
|
|
|
shortcuts: [{
|
|
|
|
|
text: '最近一周',
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: '最近一个月',
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: '最近三个月',
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: '最近半年',
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 180);
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: '最近一年',
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 365);
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: '本年度',
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
const currentYear = new Date().getFullYear();
|
|
|
|
|
const firstDayOfYear = new Date(currentYear, 0, 1);
|
|
|
|
|
const lastDayOfYear = new Date(currentYear, 11, 31);
|
|
|
|
|
start.setTime(firstDayOfYear);
|
|
|
|
|
end.setTime(lastDayOfYear)
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: '本月度',
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
const currentYear = start.getFullYear();
|
|
|
|
|
const month = start.getMonth() + 1;
|
|
|
|
|
const firstDayOfMonth = new Date(currentYear, start.getMonth(), 1);
|
|
|
|
|
const lastDayOfMonth = new Date(currentYear, month, 0);
|
|
|
|
|
start.setTime(firstDayOfMonth);
|
|
|
|
|
end.setTime(lastDayOfMonth);
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: '本周',
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
const date = new Date();
|
|
|
|
|
const today = new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
|
|
|
const firstDay = new Date(today);
|
|
|
|
|
const lastDay = new Date(today);
|
|
|
|
|
const diff = 1 - today.getDay();
|
|
|
|
|
firstDay.setDate(today.getDate() + diff); // 获取本周第一天的日期
|
|
|
|
|
lastDay.setDate(today.getDate() + (6 - today.getDay() + 1)); // 获取本周最后一天的日期
|
|
|
|
|
start.setTime(firstDay);
|
|
|
|
|
end.setTime(lastDay);
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
}
|
|
|
|
|
}]
|
|
|
|
|
},
|
|
|
|
|
select: {
|
|
|
|
|
title: '',
|
|
|
|
|
table_name: 'records',
|
|
|
|
|
@ -201,7 +299,7 @@
|
|
|
|
|
tagList: [],
|
|
|
|
|
nowDate: '',
|
|
|
|
|
is_search: false,
|
|
|
|
|
checkArr: [],
|
|
|
|
|
|
|
|
|
|
statusList: [{
|
|
|
|
|
id: 0,
|
|
|
|
|
name: '正常',
|
|
|
|
|
@ -249,6 +347,18 @@
|
|
|
|
|
label: '状态',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: 120
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: 'link_id',
|
|
|
|
|
label: '来源文档',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: 120
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
prop: 'next_link_id',
|
|
|
|
|
label: '延续文档',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: 120
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
@ -271,6 +381,7 @@
|
|
|
|
|
created() {
|
|
|
|
|
//
|
|
|
|
|
this.nowDate = this.$moment().format("YYYY-MM-DD")
|
|
|
|
|
this.startDate = this.$moment('1900-01-01').format("YYYY-MM-DD")
|
|
|
|
|
this.stateObj = state.state
|
|
|
|
|
this.is_search = false
|
|
|
|
|
if (this.$route.query.searchTitle) {
|
|
|
|
|
@ -278,11 +389,12 @@
|
|
|
|
|
this.is_search = true
|
|
|
|
|
}
|
|
|
|
|
if (this.$route.query.dateTotal) {
|
|
|
|
|
this.select.endRange = [this.nowDate, this.nowDate]
|
|
|
|
|
this.select.endRange = [this.startDate, this.nowDate]
|
|
|
|
|
this.select.status = 0
|
|
|
|
|
this.is_search = true
|
|
|
|
|
}
|
|
|
|
|
// this.getCatalogList()
|
|
|
|
|
// 分辨是有下级的 还是直接显示列表
|
|
|
|
|
if (this.$route.path) {
|
|
|
|
|
let path = this.$route.path.split("_")
|
|
|
|
|
this.select.catalog_id = path[1]
|
|
|
|
|
@ -310,18 +422,23 @@
|
|
|
|
|
this.myHeight = e + 37
|
|
|
|
|
},
|
|
|
|
|
getSelectedNodes(data, node) {
|
|
|
|
|
console.log("data", data)
|
|
|
|
|
this.$refs.tree.setCheckedKeys([]); // 删除所有选中节点
|
|
|
|
|
this.$refs.tree.setCheckedNodes([data]); // 选中已选中节点
|
|
|
|
|
console.log("data", data, node)
|
|
|
|
|
if (data.children && data.children.length > 0) {
|
|
|
|
|
// node.disabled = true
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
// this.$refs.tree.setCheckedKeys([]); // 删除所有选中节点
|
|
|
|
|
// this.$refs.tree.setCheckedNodes([data]); // 选中已选中节点
|
|
|
|
|
this.select.catalog_id = data.id
|
|
|
|
|
this.select.catalog_name = data.name
|
|
|
|
|
this.$refs.tree.setCurrentKey(data.id)
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
},
|
|
|
|
|
clearCatalog(e){
|
|
|
|
|
this.select.catalog_id = ''
|
|
|
|
|
this.select.catalog_name = ''
|
|
|
|
|
this.checkArr = []
|
|
|
|
|
this.$refs.tree.setCheckedKeys([]);
|
|
|
|
|
},
|
|
|
|
|
clearCatalog(e) {
|
|
|
|
|
this.select.catalog_id = ''
|
|
|
|
|
this.select.catalog_name = ''
|
|
|
|
|
|
|
|
|
|
this.$refs.tree.setCurrentKey(null)
|
|
|
|
|
},
|
|
|
|
|
toUrl(item) {
|
|
|
|
|
let path = ''
|
|
|
|
|
@ -413,14 +530,13 @@
|
|
|
|
|
this.select.area_id = []
|
|
|
|
|
this.select.tag_id = []
|
|
|
|
|
this.select.startRange = []
|
|
|
|
|
this.select.endRange = []
|
|
|
|
|
if(this.is_search){
|
|
|
|
|
this.select.catalog_id = ''
|
|
|
|
|
this.select.catalog_name = ''
|
|
|
|
|
this.checkArr = []
|
|
|
|
|
this.$refs.tree.setCheckedKeys([]);
|
|
|
|
|
}else{
|
|
|
|
|
this.select.title = ''
|
|
|
|
|
this.select.endRange = []
|
|
|
|
|
if (this.is_search) {
|
|
|
|
|
this.select.catalog_id = ''
|
|
|
|
|
this.select.catalog_name = ''
|
|
|
|
|
this.$refs.tree.setCurrentKey(null)
|
|
|
|
|
} else {
|
|
|
|
|
this.select.title = ''
|
|
|
|
|
}
|
|
|
|
|
// this.select.catalog_id = ''
|
|
|
|
|
this.getList()
|
|
|
|
|
@ -439,21 +555,6 @@
|
|
|
|
|
this.select.endRange = ''
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
getRefresh(bol, id) {
|
|
|
|
|
|
|
|
|
|
if (bol) {
|
|
|
|
|
console.log('getRefresh', bol, id)
|
|
|
|
|
// if(this.select.catalog_id){
|
|
|
|
|
// this.$refs.addRecord.setCatalogId(this.select.catalog_id)
|
|
|
|
|
// }
|
|
|
|
|
this.$refs.addRecordLink.type = 'add'
|
|
|
|
|
this.$refs.addRecordLink.setLinkId(id)
|
|
|
|
|
this.$refs.addRecordLink.setList(this.catalogList, this.areaList, this.tagList)
|
|
|
|
|
this.$refs.addRecordLink.setCheck(this.select.catalog_id)
|
|
|
|
|
this.$refs.addRecordLink.isShow = true
|
|
|
|
|
}
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
async getList() {
|
|
|
|
|
const res = await index({
|
|
|
|
|
page_size: this.select.page_size,
|
|
|
|
|
@ -541,8 +642,9 @@
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
::v-deep .el-checkbox__input .el-checkbox__inner {
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep .el-checkbox__input .el-checkbox__inner {
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|