|
@@ -1,5 +1,34 @@
|
|
<template>
|
|
<template>
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
+ <el-col :span="4" :xs="24">
|
|
|
|
+ <div class="head-container">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="deptName"
|
|
|
|
+ placeholder="请输入部门名称"
|
|
|
|
+ clearable
|
|
|
|
+ size="small"
|
|
|
|
+ prefix-icon="el-icon-search"
|
|
|
|
+ style="margin-bottom: 20px"
|
|
|
|
+ >
|
|
|
|
+ <el-button slot="append" @click="changeQueryType" v-if="queryParams.deptName == 0">本级及下级</el-button>
|
|
|
|
+ <el-button slot="append" @click="changeQueryType" v-if="queryParams.deptName == 1">只查询本级</el-button>
|
|
|
|
+ </el-input>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="head-container tree-scrollbar" style="height: 700px;overflow-y:auto;">
|
|
|
|
+ <el-tree
|
|
|
|
+ :data="deptOptions"
|
|
|
|
+ :props="defaultProps"
|
|
|
|
+ :expand-on-click-node="false"
|
|
|
|
+ :filter-node-method="filterNode"
|
|
|
|
+ ref="tree"
|
|
|
|
+ node-key="id"
|
|
|
|
+ :default-expanded-keys="[100]"
|
|
|
|
+ @node-click="handleNodeClick"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="20" :xs="24">
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" @submit.native.prevent>
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" @submit.native.prevent>
|
|
<el-form-item label="姓名" prop="name">
|
|
<el-form-item label="姓名" prop="name">
|
|
<el-input
|
|
<el-input
|
|
@@ -10,15 +39,15 @@
|
|
@keyup.enter.native="handleQuery"
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</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 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>
|
|
<el-form-item>
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
@@ -141,7 +170,8 @@
|
|
:limit.sync="queryParams.pageSize"
|
|
:limit.sync="queryParams.pageSize"
|
|
@pagination="getList"
|
|
@pagination="getList"
|
|
/>
|
|
/>
|
|
-
|
|
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
<!-- 添加或修改河长名录对话框 -->
|
|
<!-- 添加或修改河长名录对话框 -->
|
|
<el-dialog :title="title" :visible.sync="open" width="800px" class="form-style">
|
|
<el-dialog :title="title" :visible.sync="open" width="800px" class="form-style">
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
@@ -188,6 +218,9 @@
|
|
<treeselect v-model="form.deptId" :options="deptOptions" multiple:false :show-count="true"
|
|
<treeselect v-model="form.deptId" :options="deptOptions" multiple:false :show-count="true"
|
|
placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'"/>
|
|
placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="排序" prop="sort">
|
|
|
|
+ <el-input v-model="form.sort" placeholder="请输入排序" maxlength="50"/>
|
|
|
|
+ </el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="性别" prop="sex">
|
|
<el-form-item label="性别" prop="sex">
|
|
@@ -211,7 +244,9 @@
|
|
<el-form-item label="行政职务" prop="adminiStrativeLinJob">
|
|
<el-form-item label="行政职务" prop="adminiStrativeLinJob">
|
|
<el-input v-model="form.adminiStrativeLinJob" placeholder="请输入行政职务" maxlength="50"/>
|
|
<el-input v-model="form.adminiStrativeLinJob" placeholder="请输入行政职务" maxlength="50"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+
|
|
</el-col>
|
|
</el-col>
|
|
|
|
+
|
|
</el-row>
|
|
</el-row>
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
<el-form-item label="责任区" prop="introduction">
|
|
<el-form-item label="责任区" prop="introduction">
|
|
@@ -239,11 +274,11 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import {addLength, delLength, getLength, listLength, updateLength} from "@/api/data/digitalwater/length";
|
|
|
|
|
|
+import {addLength, delLength, getLength, listLength, updateLength,} from "@/api/data/digitalwater/length";
|
|
import {selectUserList} from "@/api/data/digitalforest/linleader/linleader";
|
|
import {selectUserList} from "@/api/data/digitalforest/linleader/linleader";
|
|
import {gridlistAll} from "@/api/data/digitalresources/grid";
|
|
import {gridlistAll} from "@/api/data/digitalresources/grid";
|
|
import Deptselector from '@/views/components/deptselector';
|
|
import Deptselector from '@/views/components/deptselector';
|
|
-import {checkPositiveDecimal, validPhoneMobile} from "@/api/rules/rules";
|
|
|
|
|
|
+import { checkNonnegativeInteger, checkPositiveDecimal, validPhoneMobile } from '@/api/rules/rules'
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
import {treeselect} from "@/api/system/dept";
|
|
import {treeselect} from "@/api/system/dept";
|
|
@@ -254,6 +289,13 @@ export default {
|
|
dicts: ['centerdata_hydroenergy_plan_rank', 'traffic_lu_job', 'farm_tian_job', 'sys_user_sex', 'forest_lin_level'],
|
|
dicts: ['centerdata_hydroenergy_plan_rank', 'traffic_lu_job', 'farm_tian_job', 'sys_user_sex', 'forest_lin_level'],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+
|
|
|
|
+ defaultProps: {
|
|
|
|
+ children: 'children',
|
|
|
|
+ label: 'label'
|
|
|
|
+ },
|
|
|
|
+ // 部门名称
|
|
|
|
+ deptName: undefined,
|
|
// 遮罩层
|
|
// 遮罩层
|
|
loading: true,
|
|
loading: true,
|
|
deptOptions: undefined,
|
|
deptOptions: undefined,
|
|
@@ -322,6 +364,10 @@ export default {
|
|
phone: [
|
|
phone: [
|
|
{required: true, message: '联系电话不能为空', trigger: 'change'},
|
|
{required: true, message: '联系电话不能为空', trigger: 'change'},
|
|
{validator: validPhoneMobile, trigger: 'blur'}
|
|
{validator: validPhoneMobile, trigger: 'blur'}
|
|
|
|
+ ],
|
|
|
|
+ sort: [
|
|
|
|
+ {required: false, },
|
|
|
|
+ {validator: checkNonnegativeInteger, trigger: 'blur'}
|
|
]
|
|
]
|
|
},
|
|
},
|
|
userList: [],
|
|
userList: [],
|
|
@@ -343,7 +389,27 @@ export default {
|
|
this.gridList = response;
|
|
this.gridList = response;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ watch: {
|
|
|
|
+ // 根据名称筛选部门树
|
|
|
|
+ deptName(val) {
|
|
|
|
+ this.$refs.tree.filter(val)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
|
|
+
|
|
|
|
+// 筛选节点
|
|
|
|
+ filterNode(value, data) {
|
|
|
|
+ if (!value) return true
|
|
|
|
+ return data.label.indexOf(value) !== -1
|
|
|
|
+ },
|
|
|
|
+ // 节点单击事件
|
|
|
|
+ handleNodeClick(data) {
|
|
|
|
+ this.queryParams.deptId = data.id;
|
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
|
+ this.getList();
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
getTreeselect() {
|
|
getTreeselect() {
|
|
treeselect().then(response => {
|
|
treeselect().then(response => {
|
|
this.deptOptions = response.data
|
|
this.deptOptions = response.data
|
|
@@ -388,6 +454,7 @@ export default {
|
|
// 表单重置
|
|
// 表单重置
|
|
reset() {
|
|
reset() {
|
|
this.form = {
|
|
this.form = {
|
|
|
|
+ sort: null,
|
|
id: null,
|
|
id: null,
|
|
userId: null,
|
|
userId: null,
|
|
name: null,
|
|
name: null,
|
|
@@ -421,7 +488,8 @@ export default {
|
|
},
|
|
},
|
|
/** 重置按钮操作 */
|
|
/** 重置按钮操作 */
|
|
resetQuery() {
|
|
resetQuery() {
|
|
- this.queryParams.deptName = 0;
|
|
|
|
|
|
+ this.deptName = undefined;
|
|
|
|
+ this.queryParams.deptName = 0
|
|
this.resetForm("queryForm");
|
|
this.resetForm("queryForm");
|
|
this.handleQuery();
|
|
this.handleQuery();
|
|
},
|
|
},
|
|
@@ -437,6 +505,7 @@ export default {
|
|
},
|
|
},
|
|
/** 新增按钮操作 */
|
|
/** 新增按钮操作 */
|
|
handleAdd() {
|
|
handleAdd() {
|
|
|
|
+
|
|
this.reset();
|
|
this.reset();
|
|
this.open = true;
|
|
this.open = true;
|
|
if (this.$route.query.type == 2) {
|
|
if (this.$route.query.type == 2) {
|
|
@@ -451,6 +520,7 @@ export default {
|
|
},
|
|
},
|
|
/** 修改按钮操作 */
|
|
/** 修改按钮操作 */
|
|
handleUpdate(row) {
|
|
handleUpdate(row) {
|
|
|
|
+
|
|
this.reset();
|
|
this.reset();
|
|
const id = row.id || this.ids
|
|
const id = row.id || this.ids
|
|
getLength(id).then(response => {
|
|
getLength(id).then(response => {
|
|
@@ -491,8 +561,8 @@ export default {
|
|
handleDelete(row) {
|
|
handleDelete(row) {
|
|
const ids = row.id || this.ids;
|
|
const ids = row.id || this.ids;
|
|
const type = this.$route.query.type;
|
|
const type = this.$route.query.type;
|
|
- this.$modal.confirm('是否确认删选中的数据项?').then(function () {
|
|
|
|
- return delLength(ids,type);
|
|
|
|
|
|
+ this.$modal.confirm('是否确认删选中的数据项?').then(function() {
|
|
|
|
+ return delLength(ids, type);
|
|
}).then(() => {
|
|
}).then(() => {
|
|
this.getList();
|
|
this.getList();
|
|
this.$modal.msgSuccess("删除成功");
|
|
this.$modal.msgSuccess("删除成功");
|
|
@@ -501,14 +571,14 @@ export default {
|
|
},
|
|
},
|
|
/** 导出按钮操作 */
|
|
/** 导出按钮操作 */
|
|
handleExport() {
|
|
handleExport() {
|
|
- if (this.$route.query.type==2){
|
|
|
|
- this.title="河长名录"
|
|
|
|
- }else if(this.$route.query.type==3){
|
|
|
|
- this.title="路长管理"
|
|
|
|
- }else if (this.$route.query.type==6){
|
|
|
|
|
|
+ if (this.$route.query.type == 2) {
|
|
|
|
+ this.title = "河长名录"
|
|
|
|
+ } else if (this.$route.query.type == 3) {
|
|
|
|
+ this.title = "路长管理"
|
|
|
|
+ } else if (this.$route.query.type == 6) {
|
|
this.title = "田长管理";
|
|
this.title = "田长管理";
|
|
- }else {
|
|
|
|
- this.title="length"
|
|
|
|
|
|
+ } else {
|
|
|
|
+ this.title = "length"
|
|
}
|
|
}
|
|
this.download('sooka-sponest-center-data/length/export', {
|
|
this.download('sooka-sponest-center-data/length/export', {
|
|
...this.queryParams
|
|
...this.queryParams
|