|
@@ -1,12 +1,21 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
|
|
|
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" l @submit.native.prevent>
|
|
|
<el-form-item label="日报时间" prop="dailyTime">
|
|
|
<el-date-picker clearable v-model="queryParams.dailyTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择日报时间"></el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="日报标题" prop="dailyTitle">
|
|
|
<el-input v-model="queryParams.dailyTitle" placeholder="请输入日报标题" clearable @keyup.enter.native="handleQuery" />
|
|
|
</el-form-item>
|
|
|
+ <el-form-item prop="deptId">
|
|
|
+ <template slot="label">
|
|
|
+ <span @click="changeQueryType" v-if="queryParams.deptName === 0">本级及下级</span>
|
|
|
+ <span @click="changeQueryType" v-if="queryParams.deptName === 1">只查询本级</span>
|
|
|
+ </template>
|
|
|
+ <treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
|
|
|
+ placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
|
|
|
+ <el-input v-model="queryParams.deptName" v-if="false"/>
|
|
|
+ </el-form-item>
|
|
|
<!--<el-form-item label="部门名称" prop="deptName">
|
|
|
<el-input
|
|
|
v-model="queryParams.deptName"
|
|
@@ -121,8 +130,18 @@
|
|
|
|
|
|
<script>
|
|
|
import { listDaily, getDaily, delDaily, addDaily, updateDaily } from '@/api/data/generalbusiness/daily/daily';
|
|
|
+import {treeselect} from "@/api/system/dept";
|
|
|
+import Treeselect from "@riophae/vue-treeselect";
|
|
|
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
+import deptselector from '@/views/components/deptselector.vue'
|
|
|
+import fileUpload from '@/views/components/FileUpload/index.vue'
|
|
|
|
|
|
export default {
|
|
|
+ components:{
|
|
|
+ Treeselect,
|
|
|
+ deptselector,
|
|
|
+ fileUpload
|
|
|
+ },
|
|
|
name: 'Daily',
|
|
|
data() {
|
|
|
return {
|
|
@@ -144,6 +163,8 @@ export default {
|
|
|
title: '',
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
+ // 部门树选项
|
|
|
+ deptOptions: [],
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
@@ -155,7 +176,7 @@ export default {
|
|
|
dailyTitle: null,
|
|
|
dailyContent: null,
|
|
|
deptId: null,
|
|
|
- deptName: null,
|
|
|
+ deptName: 0,
|
|
|
createName:null
|
|
|
},
|
|
|
// 表单参数
|
|
@@ -166,8 +187,19 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.getList();
|
|
|
+ this.getTreeselect();
|
|
|
},
|
|
|
methods: {
|
|
|
+ hx(node) {
|
|
|
+ this.form.deptId = node.id
|
|
|
+ this.form.deptName = node.label
|
|
|
+ },
|
|
|
+ /** 查询部门下拉树结构 */
|
|
|
+ getTreeselect() {
|
|
|
+ treeselect().then(response => {
|
|
|
+ this.deptOptions = response.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
/** 查询日报列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
@@ -208,6 +240,7 @@ export default {
|
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
+ this.queryParams.deptName = 0;
|
|
|
this.resetForm('queryForm');
|
|
|
this.handleQuery();
|
|
|
},
|
|
@@ -276,6 +309,10 @@ export default {
|
|
|
},
|
|
|
`daily_${new Date().getTime()}.xlsx`
|
|
|
);
|
|
|
+ },
|
|
|
+ // 点击按钮修改是否只查询本级部门用户
|
|
|
+ changeQueryType() {
|
|
|
+ this.queryParams.deptName = this.queryParams.deptName === 0 ? 1 : 0;
|
|
|
}
|
|
|
}
|
|
|
};
|