|
|
@@ -1,12 +1,9 @@
|
|
|
<template>
|
|
|
<div class="user-management-container">
|
|
|
- <el-row :gutter="20" type="flex">
|
|
|
- <el-col :span="6">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="5" :xs="24">
|
|
|
<div class="head-container" style="margin-bottom: 5px">
|
|
|
<el-input v-model="filterText" placeholder="输入关键字进行过滤" />
|
|
|
- <el-button icon="el-icon-plus" style="margin-top: 10px" type="primary" @click="getCheckedNodes($event)">
|
|
|
- 添加区域
|
|
|
- </el-button>
|
|
|
<el-tree
|
|
|
ref="tree"
|
|
|
class="filter-tree"
|
|
|
@@ -17,14 +14,7 @@
|
|
|
highlight-current
|
|
|
node-key="id"
|
|
|
:props="defaultProps"
|
|
|
- @node-click="handleNodeClick">
|
|
|
- <span slot-scope="{ node }" class="custom-tree-node">
|
|
|
- <span>{{ node.label }}</span>
|
|
|
- <span>
|
|
|
- <i class="el-icon-more"></i>
|
|
|
- </span>
|
|
|
- </span>
|
|
|
- </el-tree>
|
|
|
+ @node-click="handleNodeClick" />
|
|
|
<!-- <el-tree ref="tree" :data="deptOptions" node-key="id"
|
|
|
:filter-node-method="filterNode" :props="defaultProps"
|
|
|
@node-click="handleNodeClick" /> -->
|
|
|
@@ -32,40 +22,65 @@
|
|
|
<!-- <div class="buttons">
|
|
|
<el-button @click="getCheckedNodes($event)">添加区域</el-button>
|
|
|
</div> -->
|
|
|
+ <vab-query-form-left-panel :span="2">
|
|
|
+ <el-button icon="el-icon-plus" type="primary" @click="getCheckedNodes($event)">添加区域</el-button>
|
|
|
+ </vab-query-form-left-panel>
|
|
|
</el-col>
|
|
|
- <el-col :span="18">
|
|
|
+ <el-col :span="19" :xs="27">
|
|
|
<vab-query-form>
|
|
|
- <vab-query-form-left-panel :span="18">
|
|
|
+ <vab-query-form-left-panel :span="20">
|
|
|
<el-form :inline="true" :model="queryForm" @submit.native.prevent>
|
|
|
<el-form-item style="letter-spacing: 12px">
|
|
|
<el-input v-model.trim="queryForm.custCode" clearable placeholder="客户编码" />
|
|
|
</el-form-item>
|
|
|
+
|
|
|
+
|
|
|
<el-form-item>
|
|
|
<el-input v-model.trim="queryForm.custName" clearable placeholder="客户名称" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-input v-model.trim="queryForm.custIndustry" clearable placeholder="客户行业" />
|
|
|
+
|
|
|
+ <el-form-item label="" prop="custIndustry">
|
|
|
+ <el-select v-model="custIndustry" placeholder="请选择客户行业" style="width: 100%">
|
|
|
+ <el-option
|
|
|
+ v-for="item in industryOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.value"
|
|
|
+ :value="item.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item style="margin-right: 5px">
|
|
|
+ <el-button icon="el-icon-search" type="primary" @click="queryData">查询</el-button>
|
|
|
+ <el-button icon="el-icon-refresh-right" @click="reset">重置</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
+ <vab-query-form-left-panel :span="15">
|
|
|
+ <el-button icon="el-icon-plus" type="primary" @click="handleEdit($event)">添加</el-button>
|
|
|
+ </vab-query-form-left-panel>
|
|
|
</vab-query-form-left-panel>
|
|
|
- <vab-query-form-right-panel :span="6">
|
|
|
- <el-button icon="el-icon-search" type="primary" @click="queryData">查询</el-button>
|
|
|
- <el-button icon="el-icon-plus" type="primary" @click="handleEdit($event)">添加</el-button>
|
|
|
+ <vab-query-form-right-panel :span="29">
|
|
|
+ <el-button icon="el-icon-download" />
|
|
|
+ <table-tool :check-list.sync="checkList" :columns="columns" />
|
|
|
</vab-query-form-right-panel>
|
|
|
</vab-query-form>
|
|
|
-
|
|
|
<el-table
|
|
|
v-loading="listLoading"
|
|
|
border
|
|
|
:data="list"
|
|
|
- height="calc(100% - 52px - 43px)"
|
|
|
- style="width: 100%"
|
|
|
+ style="width: 100%; height: 500px"
|
|
|
@selection-change="setSelectRows">
|
|
|
- <el-table-column align="center" show-overflow-tooltip type="selection" />
|
|
|
- <el-table-column align="center" label="省份" prop="distName" show-overflow-tooltip />
|
|
|
- <el-table-column align="center" label="客户数量" prop="count" show-overflow-tooltip />
|
|
|
- <el-table-column align="center" label="创建人" prop="createdName" show-overflow-tooltip />
|
|
|
- <el-table-column align="center" label="创建时间" prop="createdTime" show-overflow-tooltip />
|
|
|
+ <el-table-column
|
|
|
+ v-for="(item, index) in finallyColumns"
|
|
|
+ :key="index"
|
|
|
+ align="center"
|
|
|
+ :label="item.label"
|
|
|
+ :prop="item.prop"
|
|
|
+ show-overflow-tooltip
|
|
|
+ :sortable="item.sortable"
|
|
|
+ :width="item.width">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <span>{{ row[item.prop] }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column align="center" label="操作" show-overflow-tooltip width="85">
|
|
|
<template #default="{ row }">
|
|
|
<el-button type="text" @click="handleEdit(row)">编辑</el-button>
|
|
|
@@ -96,10 +111,10 @@
|
|
|
import Edit from './components/RegionEdit'
|
|
|
import RegEdit from './components/RegEdit'
|
|
|
import regionApi from '@/api/base/region/region'
|
|
|
-
|
|
|
+ import TableTool from '@/components/table/TableTool'
|
|
|
export default {
|
|
|
name: 'Distr',
|
|
|
- components: { Edit, RegEdit },
|
|
|
+ components: { Edit, RegEdit, TableTool },
|
|
|
data() {
|
|
|
return {
|
|
|
current: '',
|
|
|
@@ -109,6 +124,7 @@
|
|
|
total: 0,
|
|
|
selectRows: '',
|
|
|
filterText: '',
|
|
|
+ custIndustry: '', // 客户行业 (没数据)
|
|
|
queryForm: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
@@ -122,6 +138,24 @@
|
|
|
},
|
|
|
treeDefaultExpandAll: true,
|
|
|
regionId: 0,
|
|
|
+ industryOptions: [], //客户行业
|
|
|
+
|
|
|
+ checkList: [],
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ label: '省份',
|
|
|
+ width: '100px',
|
|
|
+ prop: 'distName',
|
|
|
+ sortable: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '客户数量',
|
|
|
+ width: 'auto',
|
|
|
+ prop: 'count',
|
|
|
+ sortable: false,
|
|
|
+ disableCheck: true,
|
|
|
+ },
|
|
|
+ ],
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -129,6 +163,10 @@
|
|
|
height() {
|
|
|
return this.$baseTableHeight(10)
|
|
|
},
|
|
|
+ finallyColumns() {
|
|
|
+ console.log('finallyColums')
|
|
|
+ return this.columns.filter((item) => this.checkList.includes(item.label))
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
filterText(val) {
|
|
|
@@ -138,8 +176,25 @@
|
|
|
created() {
|
|
|
this.fetchData()
|
|
|
this.getRegion()
|
|
|
+ this.getOptions()
|
|
|
},
|
|
|
methods: {
|
|
|
+ reset() {
|
|
|
+ this.queryForm = {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ custCode: '',
|
|
|
+ custName: '',
|
|
|
+ custIndustry: '',
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getOptions() {
|
|
|
+ Promise.all([this.getDicts('CustomerIndustry')])
|
|
|
+ .then(([industry]) => {
|
|
|
+ this.industryOptions = industry.data.values || []
|
|
|
+ })
|
|
|
+ .catch((err) => console.log(err))
|
|
|
+ },
|
|
|
async getRegion() {
|
|
|
const { data: data } = await regionApi.getRegion({})
|
|
|
var first_id = data.list[0].id
|
|
|
@@ -211,9 +266,11 @@
|
|
|
this.fetchData()
|
|
|
},
|
|
|
queryData() {
|
|
|
+ console.log('ffff')
|
|
|
this.queryForm.pageNum = 1
|
|
|
this.fetchData()
|
|
|
},
|
|
|
+
|
|
|
async fetchData() {
|
|
|
this.listLoading = true
|
|
|
const {
|
|
|
@@ -226,18 +283,29 @@
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
|
-<style lang="scss" scoped>
|
|
|
- $base: '.user-management';
|
|
|
- #{$base}-container {
|
|
|
- > .el-row {
|
|
|
- height: calc(100vh - 60px - 50px - 12px * 2 - 40px - 24px);
|
|
|
- }
|
|
|
- .head-container {
|
|
|
- height: calc(100% - 5px);
|
|
|
- .el-tree {
|
|
|
- height: calc(100% - 74px);
|
|
|
- overflow-y: auto;
|
|
|
- }
|
|
|
- }
|
|
|
+<style>
|
|
|
+ .el-tree-node:focus > .el-tree-node__content {
|
|
|
+ /*设置选中的样式 */
|
|
|
+ background-color: #dde9ff !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-tree-node__content:hover {
|
|
|
+ /*设置鼠标飘过的颜色 */
|
|
|
+ background: #eaf9ff !important;
|
|
|
+ color: #007bff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
|
|
|
+ /*current选中的样式 */
|
|
|
+ color: #4d95fd;
|
|
|
+ font-weight: bold;
|
|
|
+ background-color: #dde9ff !important;
|
|
|
+ }
|
|
|
+ .el-form-item__content {
|
|
|
+ margin-right: 3px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .vab-query-form[data-v-64063760] .el-form-item:first-child .el-form-item--small {
|
|
|
+ margin: 0 10px 10px 0 !important;
|
|
|
}
|
|
|
</style>
|