|
|
|
@ -11,12 +11,14 @@
|
|
|
|
|
<el-cascader
|
|
|
|
|
size="small"
|
|
|
|
|
v-model="district"
|
|
|
|
|
:options="compartment"
|
|
|
|
|
:options="treeData"
|
|
|
|
|
:show-all-levels="false"
|
|
|
|
|
:disabled="isNoneDivision"
|
|
|
|
|
:props="props"
|
|
|
|
|
@change="getData"
|
|
|
|
|
v-if="isShow"
|
|
|
|
|
></el-cascader>
|
|
|
|
|
<el-input v-model="text" placeholder="" :disabled="!isShow" v-else />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
@ -26,7 +28,10 @@ export default {
|
|
|
|
|
return {
|
|
|
|
|
//区划的禁用
|
|
|
|
|
district: "",
|
|
|
|
|
compartment: [],
|
|
|
|
|
treeData: [],
|
|
|
|
|
text: null,
|
|
|
|
|
compartment: [], // 整理后
|
|
|
|
|
isShow: true,
|
|
|
|
|
isNoneDivision: false,
|
|
|
|
|
props: {
|
|
|
|
|
checkStrictly: true,
|
|
|
|
@ -52,28 +57,48 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
onClear(){
|
|
|
|
|
this.district = ""
|
|
|
|
|
onClear() {
|
|
|
|
|
this.district = "";
|
|
|
|
|
},
|
|
|
|
|
treeList() {
|
|
|
|
|
// if (this.dept.parentId == 0 || this.dept.leader == "admin") {
|
|
|
|
|
let treeData = JSON.parse(localStorage.getItem("TREE_DATA"));
|
|
|
|
|
treeData.forEach((value, index) => {
|
|
|
|
|
this.compartment.push({
|
|
|
|
|
value: value.districtCode,
|
|
|
|
|
label: value.district,
|
|
|
|
|
children: [],
|
|
|
|
|
});
|
|
|
|
|
if (value.children.length > 0) {
|
|
|
|
|
value.children.forEach((value1, index1) => {
|
|
|
|
|
this.compartment[index].children.push({
|
|
|
|
|
value: value1.countyCode,
|
|
|
|
|
label: value1.county,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
let treeData = JSON.parse(localStorage.getItem("TREE_DATA"));
|
|
|
|
|
treeData.forEach((value, index) => {
|
|
|
|
|
this.compartment.push({
|
|
|
|
|
value: value.districtCode,
|
|
|
|
|
label: value.district,
|
|
|
|
|
children: [],
|
|
|
|
|
});
|
|
|
|
|
// }
|
|
|
|
|
if (value.children.length > 0) {
|
|
|
|
|
value.children.forEach((value1, index1) => {
|
|
|
|
|
this.compartment[index].children.push({
|
|
|
|
|
value: value1.countyCode,
|
|
|
|
|
label: value1.county,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
let userInfo = JSON.parse(sessionStorage.getItem("USER_INFO"));
|
|
|
|
|
// console.log(userInfo.lawLevel);
|
|
|
|
|
// 市级
|
|
|
|
|
if (userInfo.lawLevel == "市级") {
|
|
|
|
|
this.treeData = this.compartment;
|
|
|
|
|
}
|
|
|
|
|
// 县级
|
|
|
|
|
else if (userInfo.lawLevel == "县级") {
|
|
|
|
|
this.district = userInfo.permissionCode;
|
|
|
|
|
this.treeData = this.compartment.filter(
|
|
|
|
|
(item) => item.value === this.district
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
// 镇级
|
|
|
|
|
else if (userInfo.lawLevel == "镇级") {
|
|
|
|
|
this.isShow = false;
|
|
|
|
|
this.text = userInfo.permissionDescription;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// this.district = "320582403"
|
|
|
|
|
// console.log(JSON.stringify(this.compartment));
|
|
|
|
|
this.$emit("quhuadizhi", this.compartment);
|
|
|
|
|
},
|
|
|
|
|
getData(e) {
|
|
|
|
|