zhangtao
laozt 1 year ago
parent 1701f748a4
commit 6ada751bb7

@ -338,7 +338,9 @@ export default {
}, },
// //
quhuadizhi(district) { quhuadizhi(district) {
this.option = district; // console.log(">>>>>>>>");
// console.log(district);
// console.log(">>>>>>>>");
}, },
// //
componendDistrict(district) { componendDistrict(district) {

@ -11,12 +11,14 @@
<el-cascader <el-cascader
size="small" size="small"
v-model="district" v-model="district"
:options="compartment" :options="treeData"
:show-all-levels="false" :show-all-levels="false"
:disabled="isNoneDivision" :disabled="isNoneDivision"
:props="props" :props="props"
@change="getData" @change="getData"
v-if="isShow"
></el-cascader> ></el-cascader>
<el-input v-model="text" placeholder="" :disabled="!isShow" v-else />
</div> </div>
</template> </template>
<script> <script>
@ -26,7 +28,10 @@ export default {
return { return {
// //
district: "", district: "",
compartment: [], treeData: [],
text: null,
compartment: [], //
isShow: true,
isNoneDivision: false, isNoneDivision: false,
props: { props: {
checkStrictly: true, checkStrictly: true,
@ -53,10 +58,9 @@ export default {
}, },
methods: { methods: {
onClear() { onClear() {
this.district = "" this.district = "";
}, },
treeList() { treeList() {
// if (this.dept.parentId == 0 || this.dept.leader == "admin") {
let treeData = JSON.parse(localStorage.getItem("TREE_DATA")); let treeData = JSON.parse(localStorage.getItem("TREE_DATA"));
treeData.forEach((value, index) => { treeData.forEach((value, index) => {
this.compartment.push({ this.compartment.push({
@ -73,7 +77,28 @@ export default {
}); });
} }
}); });
// }
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); this.$emit("quhuadizhi", this.compartment);
}, },
getData(e) { getData(e) {

Loading…
Cancel
Save