Browse Source

fix:增加回显和一级选择

shibei_master
123456 3 years ago
parent
commit
4b930a0646
  1. 36
      src/views/modules/plugins/stats/factagencyuserhousedaily.vue

36
src/views/modules/plugins/stats/factagencyuserhousedaily.vue

@ -17,13 +17,13 @@
>
</el-option>
</el-select> -->
<el-cascader
v-model.trim="dataForm.agencyId"
:options="optionsA"
ref="cascaderUnit"
:props="{ expandTrigger: 'hover',children:'subAgencyList',label:'agencyName',value:'agencyId' }"
@change="handleChange"
clearable>
<el-cascader ref="cascaderUnit" v-model.trim="dataForm.agencyId" :options="optionsA" :props="{ checkStrictly: true, expandTrigger: 'hover', emitPath: false,children:'subAgencyList',label:'agencyName',value:'agencyId'}">
<template slot-scope="{ node, data }">
<div @click="cascaderClick(data)">
<span>{{ data.agencyName }}</span>
<span v-if="!node.isLeaf"> ({{ data.subAgencyList.length }}) </span>
</div>
</template>
</el-cascader>
</el-form-item>
<el-form-item label="入黑名单时间"
@ -90,7 +90,7 @@ export default {
timeRange: '',
dataForm: {
id: ''
}
},
}
},
components: {
@ -98,7 +98,7 @@ export default {
},
created () {
this.getGridList()
this.getValiheList()
// this.getValiheList()
},
watch: {
timeRange (val) {
@ -112,15 +112,13 @@ export default {
}
},
methods: {
handleChange(value){
console.log(value[1])
const checkedNodes = this.$refs['cascaderUnit'].getCheckedNodes()
console.log(checkedNodes) //
if(Array.isArray(value) && value.length > 0){
this.dataForm.agencyId = value[1]
}else{
this.dataForm.agencyId = null
}
cascaderClick (nodeData) {
this.dataForm.agencyId = nodeData.agencyId;
this.dataForm.level = nodeData.level
this.$refs.cascaderUnit.checkedValue = nodeData.agencyId;
this.$refs.cascaderUnit.computePresentText();
this.$refs.cascaderUnit.toggleDropDownVisible(false);
},
getGridList() {
const { user } = this.$store.state
@ -133,6 +131,8 @@ export default {
console.log('获取查询详情成功', res.data)
// this.optionsA = res.data
this.optionsA.push(res.data)
this.dataForm.agencyId = res.data.agencyId
this.dataForm.level = res.data.level
}
})
.catch(() => {

Loading…
Cancel
Save