28e705be by 杨威

左侧目录树数据查询接口修改

1 parent 5c6d54f8
......@@ -123,12 +123,35 @@ export default {
self.time = setTimeout(() => {
item.expand = item.expand == undefined? true:!item.expand;
// self.$emit("itemClick", item);
let source = ''
switch (this.$route.path) {
case '/add':
source = '1,2'
break;
case '/change':
source = '2'
break;
case '/panel':
source = '0,1,2'
break;
case '/modify':
source = '1'
break;
case '/search':
source = '0,1,2'
break;
default:
break;
}
//目录树的所有权类型单击时加载子节点
if (!item.children && !item.type) {
let data = {
xzqbsm:item.xzq,
djqbsm:item.djq,
djzqbsm:item.djzq,
syqlx:item.dm
syqlx:item.dm,
source:source
}
getZdDetailList(data).then((res) => {
if (res.result.length>0) {
......
......@@ -69,10 +69,8 @@ export default {
provide(){
return{
getRightTree: this.getRightTree,
getRightTreeByZrzbsm:this.getRightTreeByZrzbsm,
getTreeByS:this.getTreeByS,
getRightTreeByDzbsm:this.getRightTreeByDzbsm,
getRightTreeByHbsm:this.getRightTreeByHbsm
getTreeByBsm:this.getTreeByBsm,
getTreeByS:this.getTreeByS
}
},
data() {
......@@ -144,23 +142,10 @@ export default {
item.select = true;
}
});
if (newPath == "/zd") {
//source为3时代表时分割后的宗地信息
// if(this.$route.query.source == '3'){
// this.getTreeByS(this.$store.state.zdbsms);
// }else{
// this.getRightTree(this.$store.state.zdbsm);
// }
}else if (newPath == "/zrz") {
// this.getRightTreeByZrzbsm(this.$store.state.zrzbsm);
}else if(newPath == "/dz"){
// this.getRightTreeByDzbsm(this.$store.state.dzbsm);
}else if(newPath == "/h"){
// this.getRightTreeByHbsm(this.$store.state.hbsm);
} else if(newPath == "/viewMap"){
this.isMap = true;
} else {
if(newPath == "/search" || newPath == "/panel" || newPath == "/add" || newPath == "/change" || newPath == "/modify"){
this.getTreeList();
} else {
}
},
"$store.state.treeData":function (val) {
......@@ -226,11 +211,11 @@ export default {
this.getDic();
//刷新页面后根据不同路由获取不同树结构数据
if(this.$route.path == '/zrz'){
this.getRightTreeByZrzbsm(this.$store.state.zrzbsm)
this.getTreeByBsm(this.$store.state.zrzbsm,'zrz',this.$route.query.auth)
}else if(this.$route.path == '/zd'){
this.getRightTree(this.$store.state.zdbsm)
}else if(this.$route.path == '/dz'){
this.getRightTreeByDzbsm(this.$store.state.dzbsm)
this.getTreeByBsm(this.$store.state.dzbsm,'dz',this.$route.query.auth)
}else{
this.getTreeList();
}
......@@ -256,7 +241,6 @@ export default {
}
})
},
//请求字典数据
async getDic() {
let s = this.$store.state;
......@@ -290,18 +274,19 @@ export default {
return res.result
});
},
getRightTree(bsm) {
getTree(bsm).then((res) => {
//根据宗地bsm查询树数据
getRightTree(bsm,source) {
getTree(bsm,source).then((res) => {
if (res.success) {
this.pd = res.result;
this.$store.state.newZdbsm = '';
}
});
},
getRightTreeByZrzbsm(bsm) {
if (this.$store.state.newZdbsm != this.$store.state.oldZdbsm) {
getTreeByBsm(bsm,"zrz").then((res) => {
//根据自然幢/多幢/户bsm查询树数据
getTreeByBsm(bsm,type,source) {
if (this.$store.state.oldZdbsm == '' || this.$store.state.newZdbsm != this.$store.state.oldZdbsm) {
getTreeByBsm(bsm,type,source).then((res) => {
if (res.success) {
this.pd = res.result;
this.$store.state.treeData = res.result;
......@@ -313,29 +298,6 @@ export default {
}
},
getRightTreeByDzbsm(bsm) {
if (this.$store.state.newZdbsm != this.$store.state.oldZdbsm) {
getTreeByBsm(bsm,"dz").then((res) => {
if (res.success) {
this.pd = res.result;
this.$store.state.treeData = res.result;
this.$store.state.newZdbsm = '';
}
});
}else{
}
},
getRightTreeByHbsm(bsm) {
getTreeByBsm(bsm,"h").then((res) => {
if (res.success) {
this.pd = res.result;
this.$store.state.newZdbsm = '';
}
});
},
sortNavigation(data, selectId) {
let headTop = this.headTop;
data.forEach((item, index) => {
......
......@@ -208,7 +208,7 @@
Qlr,
Qlxz,
},
inject:['getRightTree'],
inject:['getTreeByBsm'],
data () {
return {
......@@ -290,7 +290,7 @@
registerCall(data).then(res=>{
if (res.success) {
this.$message.success("登记成功")
this.getRightTree(this.$store.state.zdbsm)
this.getTreeByBsm(this.$route.query.bsm,'dz','0,1,2')
}
})
},
......
......@@ -57,6 +57,7 @@
export default {
name: "",
components: {SearchHead},
inject:['getRightTree','getTreeByBsm'],
props: {},
data() {
return {
......@@ -123,15 +124,19 @@
case "zrz":
path = "/zrz";
this.$store.state.zrzbsm = row.glbsm;
this.getTreeByBsm(row.glbsm,row.dylx,'0,1,2');
break;
case "zd":
path = "/zd";
this.$store.state.zdbsm = row.glbsm
this.getRightTree(row.glbsm,'0,1,2');
break;
case "h":
path = "/h";
this.$store.state.hbsm = row.glbsm
this.getTreeByBsm(row.glbsm,'h','0,1,2');
type = "2";
break;
default:
break;
}
......@@ -139,7 +144,8 @@
path: path,
query: {
bsm: row.glbsm,
source: 2
source: 2,
auth:'1,2'
}
});
},
......
......@@ -72,6 +72,7 @@ import { fwsxbgbl } from "../../../../api/common";
export default {
name: "",
components: { SearchHead },
inject:['getRightTree','getTreeByBsm'],
props: {},
data() {
return {
......@@ -146,16 +147,24 @@ export default {
switch (row.dylx) {
case "zrz":
this.$store.state.zrzbsm = res.result;
this.getTreeByBsm(row.glbsm,row.dylx,'2');
path = "/zrz";
break;
case "zd":
this.$store.state.zdbsm = res.result;
this.getRightTree(row.glbsm,'2');
path = "/zd";
break;
case "dz":
this.$store.state.dzbsm = res.result;
this.getTreeByBsm(row.glbsm,row.dylx,'2');
path = "/dz";
break;
case "h":
this.$store.state.dzbsm = res.result;
this.getTreeByBsm(row.glbsm,row.dylx,'2');
path = "/h";
break;
default:
break;
}
......@@ -163,7 +172,8 @@ export default {
path: path,
query: {
bsm: res.result,
source: 2
source: 2,
auth:'2'
}
});
} else {
......
......@@ -283,7 +283,7 @@
if (res.success) {
this.$message.success("合并成功");
//更新目录树
this.getRightTree(res.result);
this.getRightTree(res.result,'2');
this.$router.push({
path: '/zd',
query: {
......
......@@ -156,7 +156,7 @@ import { insertDzjbxx } from "../../../api/dz";
export default {
name: "",
components: {},
inject:['getRightTree','getRightTreeByZrzbsm','getRightTreeByDzbsm'],
inject:['getRightTree','getTreeByBsm'],
props: {
auth: {
type: Boolean,
......@@ -276,7 +276,7 @@ export default {
.then((res) => {
console.log(res.result);
if (res.code == "200") {
this.getRightTree(this.$store.state.zdbsm);
this.getRightTree(res.result,'0,1,2');
this.$message({
message: "创建成功!",
type: "success",
......@@ -311,7 +311,7 @@ export default {
.then((res) => {
if (res.code == "200") {
//获取左侧树数据
this.getRightTreeByZrzbsm(res.result.bsm);
this.getTreeByBsm(res.result.bsm,'zrz','0,1,2');
this.$message({
message: "创建成功!",
type: "success",
......@@ -325,7 +325,8 @@ export default {
this.$router.push({
path: '/zrz', query:{
source: 1,
bsm:res.result.bsm
bsm:res.result.bsm,
auth: '0,1,2'
}
});
} else {
......@@ -348,7 +349,7 @@ export default {
insertDzjbxx(this.ruleForm2)
.then((res) => {
if (res.code == "200") {
this.getRightTreeByDzbsm(res.result.bsm);
this.getTreeByBsm(res.result.bsm,'dz','0,1,2');
this.$message({
message: "创建成功!",
type: "success",
......@@ -361,7 +362,8 @@ export default {
this.$router.push({
path: '/dz', query:{
source: 1,
bsm:res.result.bsm
bsm:res.result.bsm,
auth: '0,1,2'
}
});
} else {
......
......@@ -65,6 +65,7 @@
export default {
name: "",
components: {SearchHead},
inject:['getRightTree','getTreeByBsm'],
props: {},
data() {
return {
......@@ -129,18 +130,15 @@
handleClick(row) {
let type;name;
let path = "";
switch (row.dylx) {
case "zd":
type = "0";
name = '宗地';
this.$store.state.zdbsm = row.glbsm
path = "/zd";
break;
case "zrz":
type = "1";
name = '自然幢';
this.$store.state.zrzbsm = row.glbsm;
path = "/zrz";
break;
case "h":
......@@ -148,17 +146,19 @@
case "h1":
type = "2";
name = "户"
this.$store.state.hbsm = row.glbsm;
path = "/h";
break;
case "dz":
type = "3";
name = "多幢";
this.$store.state.dzbsm = row.glbsm;
path = "/dz";
break;
default:
break;
}
let data = {"id": row.bsm, "type": type};
this.$confirm('是否确定更正该'+name+'?', '提示', {
this.$nextTick(()=>{
this.$confirm('确定更正该'+name+'吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
......@@ -166,6 +166,28 @@
updateQsztByBsm(data)
.then((res => {
if (res.code == 200) {
switch (row.dylx) {
case "zd":
this.$store.state.zdbsm = row.glbsm;
this.getRightTree(row.glbsm,'1');
break;
case "zrz":
this.$store.state.zrzbsm = row.glbsm;
this.getTreeByBsm(row.glbsm,row.dylx,'1');
break;
case "h":
case "h0":
case "h1":
this.$store.state.hbsm = row.glbsm;
this.getTreeByBsm(row.glbsm,'h','1');
break;
case "dz":
this.$store.state.dzbsm = row.glbsm;
this.getTreeByBsm(row.glbsm,row.dylx,'1');
break;
default:
break;
}
this.$message({
type: 'success',
message: '更正成功!'
......@@ -174,7 +196,8 @@
path: path,
query: {
bsm: row.glbsm,
source: 2
source: 2,
auth:'1'
}
});
} else {
......@@ -193,6 +216,7 @@
}).catch(() => {
});
})
},
},
computed: {},
......
......@@ -60,7 +60,7 @@
export default {
name: "",
inject:['getRightTree','getRightTreeByZrzbsm','getRightTreeByDzbsm','getRightTreeByHbsm'],
inject:['getRightTree','getTreeByBsm'],
components: {SearchHead},
props: {},
data() {
......@@ -120,20 +120,21 @@
//点击办理
handleClick(row) {
let path = "";
this.$store.state.oldZdbsm = '';
switch (row.dylx) {
case "zrz":
this.$store.state.zrzbsm = row.glbsm;
this.getRightTreeByZrzbsm(row.glbsm);
this.getTreeByBsm(row.glbsm,row.dylx,'0,1,2');
path = "/zrz";
break;
case "zd":
this.$store.state.zdbsm = row.glbsm;
this.getRightTree(row.glbsm);
this.getRightTree(row.glbsm,'0,1,2');
path = "/zd";
break;
case "dz":
this.$store.state.dzbsm = row.glbsm;
this.getRightTreeByDzbsm(row.glbsm);
this.getTreeByBsm(row.glbsm,row.dylx,'0,1,2');
path = "/dz";
break;
case "h":
......@@ -141,7 +142,7 @@
case "h1":
path="/h";
this.$store.state.hbsm=row.glbsm
this.getRightTreeByHbsm(row.glbsm);
this.getTreeByBsm(row.glbsm,'h','0,1,2');
break;
default:
break;
......@@ -150,7 +151,8 @@
path: path,
query: {
bsm: row.glbsm,
source: 2
source: 2,
auth: '0,1,2'
}
});
},
......
......@@ -56,7 +56,7 @@ import layers from '@/assets/json/layers.json'
import findTask from '@/libs/map/findTask'
export default {
inject:['getRightTree','getRightTreeByZrzbsm'],
inject:['getRightTree','getTreeByBsm'],
components:{
EsriMap,
MapTools
......@@ -83,9 +83,9 @@ export default {
if(query && JSON.stringify(query) != "{}"){
//self.addGeoByBsm(query.bsm,query.type,self.viewId);
if(query.type == 'zd'){
self.getRightTree(query.bsm)
self.getRightTree(query.bsm,'0,1,2')
}else if(query.type == 'zrz'){
self.getRightTreeByZrzbsm(query.bsm);
self.getTreeByBsm(query.bsm,'zrz','0,1,2');
}
}
},500);
......
......@@ -509,7 +509,7 @@
registerCall(data).then(res => {
if (res.success) {
this.$message.success("登记成功")
this.getRightTree(this.$store.state.zdbsm)
this.getRightTree(this.$store.state.zdbsm,'0,1,2')
}
})
},
......
......@@ -414,6 +414,7 @@
Qlr,
Qlxz,
},
inject:['getTreeByBsm'],
props:{
bsm:String, //户标识码
scyclx:{
......@@ -543,7 +544,7 @@
registerCall(data).then(res=>{
if (res.success) {
this.$message.success("登记成功")
this.getRightTree(this.$store.state.zdbsm)
this.getTreeByBsm(this.$store.state.zdbsm,'h','0,1,2')
}
})
},
......
......@@ -294,7 +294,6 @@ export default {
hbj,
HCxlz,
},
inject:['getRightTree'],
props: {},
data() {
return {
......
......@@ -290,7 +290,7 @@
Qlr,
Qlxz,
},
inject:['reload','getRightTree'],
inject:['reload','getTreeByBsm'],
data () {
return {
......@@ -418,7 +418,7 @@
registerCall(data).then(res=>{
if (res.success) {
this.$message.success("登记成功")
this.getRightTree(this.$store.state.zdbsm)
this.getTreeByBsm(this.$route.query.bsm,'zrz','0,1,2')
}
})
},
......