|
|
@@ -6,7 +6,18 @@ |
|
|
|
> |
|
|
|
<template #left> |
|
|
|
<van-icon name="location" color="3A80FB" size="16"/> |
|
|
|
<p style="color: #878787;margin-left: 5px">{{deptName}}</p> |
|
|
|
<p style="color: #878787;margin-left: 5px" @click="selectDept">{{deptName}}</p> |
|
|
|
<van-popup v-model="villageVisbile" round position="bottom"> |
|
|
|
<van-cascader |
|
|
|
v-model="villageValue" |
|
|
|
title="请选择所在村" |
|
|
|
:options="hcAreaInfoOption" |
|
|
|
@close="hcAreaInfoClose" |
|
|
|
@finish="hcAreaInfoFinish" |
|
|
|
active-color="#1989fa" |
|
|
|
:field-names="hcAreaInfoFieldName" |
|
|
|
/> |
|
|
|
</van-popup> |
|
|
|
</template> |
|
|
|
<template #right> |
|
|
|
<van-icon name="wap-nav" color="#000" size="18"/> |
|
|
@@ -462,7 +473,8 @@ |
|
|
|
<script> |
|
|
|
import onlineHomeIndex from "../onlineHomeIndex"; |
|
|
|
import {getInfo} from "../../api/login"; |
|
|
|
import {ListTodo} from "../../api/onlineHome/done"; |
|
|
|
import {changeDept, ListTodo} from "../../api/onlineHome/done"; |
|
|
|
import {treeselectByUser} from "../../api/homestead"; |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
onlineHomeIndex |
|
|
@@ -478,18 +490,72 @@ |
|
|
|
pageSize: 100, |
|
|
|
}, |
|
|
|
taskList:[], |
|
|
|
//省市区区级list |
|
|
|
hcAreaInfoOption: [], |
|
|
|
//省市区区级显示 |
|
|
|
villageVisbile: false, |
|
|
|
//选中的值 |
|
|
|
villageValue: "", |
|
|
|
//选中村相关信息 |
|
|
|
villageDataObj: { |
|
|
|
deptName: " ", //村名 |
|
|
|
}, |
|
|
|
hcAreaInfoFieldName: { |
|
|
|
text: "label", |
|
|
|
value: "value", |
|
|
|
children: "children", |
|
|
|
}, |
|
|
|
}; |
|
|
|
}, |
|
|
|
created() { |
|
|
|
getInfo().then(response => { |
|
|
|
console.log(response) |
|
|
|
this.deptName = response.user.deptName |
|
|
|
}); |
|
|
|
// getInfo().then(response => { |
|
|
|
// console.log(response) |
|
|
|
// this.deptName = response.user.deptName |
|
|
|
// }); |
|
|
|
treeselectByUser().then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
let content = res.data; |
|
|
|
this.hcAreaInfoOption = content; |
|
|
|
if ( |
|
|
|
this.deptName == "" || |
|
|
|
this.deptName == undefined |
|
|
|
) { |
|
|
|
this.deptName = this.$store.state.user.deptName; |
|
|
|
} else { |
|
|
|
this.deptName = this.$store.state.user.allDeptName; |
|
|
|
} |
|
|
|
} |
|
|
|
}), |
|
|
|
ListTodo(this.queryParams).then((response) => { |
|
|
|
this.taskList = response.rows |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
methods:{ |
|
|
|
villageVisbileFun() { |
|
|
|
this.villageVisbile = true; |
|
|
|
}, |
|
|
|
selectDept(){ |
|
|
|
this.villageVisbile = true; |
|
|
|
}, |
|
|
|
//关闭选择地址弹窗 |
|
|
|
hcAreaInfoClose() { |
|
|
|
this.villageVisbile = false; |
|
|
|
}, |
|
|
|
hcAreaInfoFinish({ value, selectedOptions, tabIndex }) { |
|
|
|
// 切换部门 |
|
|
|
let Depquery={"loginDeptID":value} |
|
|
|
changeDept(Depquery).then((response) => { |
|
|
|
console.log(response) |
|
|
|
if (response.code === 200) { |
|
|
|
this.$store.dispatch("GetInfo").then(() => { |
|
|
|
// this.$router.go(0); |
|
|
|
window.location.href = "/onlineHome/workbench"; |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
this.villageVisbile = false; |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|