Commit 7df3f72d by 李宁

1

1 parent c6726567
......@@ -18,6 +18,9 @@ Vue.component('Pagination', Pagination)
Vue.component('CascadingRegionSelector', CascadingRegionSelector)
Vue.component('ThreeLevelRegionSelector', ThreeLevelRegionSelector)
import addressData from '@/assets/js/stores/addressData'
Vue.prototype.addressStoreData = addressData
Vue.config.productionTip = false
new Vue({
......
......@@ -310,31 +310,6 @@
</template>
<script>
// 地区数据
const regionOptions = [
{
name: '江苏省',
children: [
{
name: '南京市',
children: [
{ name: '玄武区' },
{ name: '秦淮区' },
{ name: '建邺区' },
{ name: '鼓楼区' },
{ name: '浦口区' },
{ name: '栖霞区' },
{ name: '雨花台区' },
{ name: '江宁区' },
{ name: '六合区' },
{ name: '溧水区' },
{ name: '高淳区' }
]
}
]
}
]
// 模拟网格数据
const mockGrids = [
{
......@@ -422,7 +397,7 @@ export default {
selectedGrid: '',
selectedInstaller: '',
selectedSales: '',
regionOptions,
regionOptions: '',
grids: mockGrids,
installers: mockInstallers,
salesPersons: mockSalesPersons,
......@@ -440,6 +415,9 @@ export default {
activeTab: 'installers'
}
},
created(){
this.regionOptions = this.addressStoreData
},
computed: {
filteredGrids() {
let result = this.grids
......
......@@ -79,7 +79,7 @@
<div class="filter-actions">
<el-button size="small" @click="handleFilter">
<i class="el-icon-filter"></i>
确定
查询
</el-button>
<el-button size="small" @click="handleExport" type="default">
<i class="el-icon-download"></i>
......@@ -123,7 +123,7 @@
/>
</el-col>
<el-col :span="4">
<el-col :span="3">
<el-select
v-model="selectedStatus"
placeholder="选择状态"
......@@ -139,7 +139,7 @@
</el-select>
</el-col>
<el-col :span="4">
<el-col :span="3">
<el-select
v-model="selectedTag"
placeholder="商机标签"
......@@ -159,16 +159,48 @@
<div class="filter-content" style="margin-top: 20px;">
<el-row :gutter="24">
<el-col :span="4">
<el-col :span="3" v-if="addressStore.cityArr.length>0">
<el-select
v-model="selectedRegion"
placeholder="选择区域"
clearable
>
<el-option label="全部区域" value="all"></el-option>
<el-option label="玄武区" value="玄武区"></el-option>
<el-option label="秦淮区" value="秦淮区"></el-option>
<el-option label="建邺区" value="建邺区"></el-option>
v-model="addressStore.city"
placeholder="选择地市"
@change="cityChange"
:disabled="getData.city!=''"
clearable>
<el-option
v-for="item in addressStore.cityArr"
:key="item.value"
:label="item.name"
:value="item.value"
></el-option>
</el-select>
</el-col>
<el-col :span="3" v-if="addressStore.countyArr.length>0">
<el-select
v-model="addressStore.county"
placeholder="选择区县"
@change="countyChange"
:disabled="getData.county!=''"
clearable>
<el-option
v-for="item in addressStore.countyArr"
:key="item.value"
:label="item.name"
:value="item.value"
></el-option>
</el-select>
</el-col>
<el-col :span="3" v-if="addressStore.gridArr.length>0">
<el-select
v-model="addressStore.grid"
placeholder="选择网格"
:disabled="getData.grid!=''"
clearable>
<el-option
v-for="item in addressStore.gridArr"
:key="item.value"
:label="item.name"
:value="item.value"
></el-option>
</el-select>
</el-col>
</el-row>
......@@ -438,6 +470,26 @@ export default {
name: 'OpportunityManagement',
data() {
return {
addressStore:{
city: '',
cityName: '',
cityArr: this.addressStoreData,
county: '',
countyName: '',
countyArr: [],
grid: '',
gridName: '',
gridArr: []
},
getData:{
city: '',
cityName: '',
county: '',
countyName: '',
grid: '',
gridName: '',
},
loading: false,
statusMap,
opportunityTags,
......@@ -479,6 +531,9 @@ export default {
pageSize: 20,
}
},
created(){
this.setAddressShow()
},
computed: {
...mapGetters(['user']),
// 根据用户权限过滤商机数据
......@@ -584,6 +639,59 @@ export default {
}
},
methods: {
setAddressShow(){
let ad = this.addressStore
let gd = this.getData
if(gd.city){
ad.city = gd.city
ad.cityArr.forEach(item=>{
if(item.value == ad.city){
ad.countyArr = item.children
}
})
if(gd.county){
ad.county = gd.county
ad.countyArr.forEach(item=>{
if(item.value == ad.county){
ad.gridArr = item.children
}
})
if(ad.gridArr.length == 1){
gd.grid = 'moren'
}
if(gd.grid){
ad.grid = gd.grid
}
}
}
},
cityChange(value){
let ad = this.addressStore
ad.city = value
ad.county = ''
ad.grid = ''
ad.cityArr.forEach(item=>{
if(item.value == ad.city){
ad.countyArr = item.children
}
})
},
countyChange(value){
let ad = this.addressStore
ad.county = value
ad.grid = ''
ad.countyArr.forEach(item=>{
if(item.value == ad.county){
ad.gridArr = item.children
}
})
},
getStatusType(status) {
const typeMap = {
'assigned': 'info',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!