提交 1b6e2c69 编写于 作者: yi.li's avatar yi.li

选择地区优化

上级 3baf712d
...@@ -487,15 +487,13 @@ export default { ...@@ -487,15 +487,13 @@ export default {
// this.$refs.childExam.$emit("init"); // this.$refs.childExam.$emit("init");
// } // }
}, },
//地区选择操作
handleChange(value) { handleChange(value) {
// this.formInline.organization = []; //选择机构的值
this.tags = []; this.tags = [];
let node =this.$refs.cascaderRegion.getCheckedNodes()[0];//级联当前选中的值 let node =this.$refs.cascaderRegion.getCheckedNodes()[0];//级联当前选中的值
console.log('node change',node) console.log('node change',node)
//获取选中的inputValue
setTimeout(function() { setTimeout(function() {
// console.log('行政区域改变',vm.$refs["cascaderRegion"].inputValue);
vm.dialogData.region = vm.$refs["cascaderRegion"].inputValue; vm.dialogData.region = vm.$refs["cascaderRegion"].inputValue;
}, 20); }, 20);
...@@ -524,8 +522,8 @@ export default { ...@@ -524,8 +522,8 @@ export default {
vm.searchNode(vm.optionsRegion, node.data.id, newData); vm.searchNode(vm.optionsRegion, node.data.id, newData);
}); });
} }
vm.formInline.organization = []; vm.formInline.organization = [];//选择的机构
//这里需要判断当前选中项的degree是否是5,如果是5那就不需要再调接口 //这里需要判断当前选中项的degree,如果是5那就不需要再调接口
if (node.data && node.data.id && node.data.degree == 5) { if (node.data && node.data.id && node.data.degree == 5) {
let changeItemData = node.data.id; let changeItemData = node.data.id;
let subIndex = changeItemData.lastIndexOf('_'); let subIndex = changeItemData.lastIndexOf('_');
...@@ -669,8 +667,6 @@ export default { ...@@ -669,8 +667,6 @@ export default {
vm.formInline.orgId = value.slice(subIndex + 1); vm.formInline.orgId = value.slice(subIndex + 1);
vm.hospitalCnt = 1; vm.hospitalCnt = 1;
vm.formInline.organization.push(vm.formInline.orgId); vm.formInline.organization.push(vm.formInline.orgId);
// vm.hospitalCntList = res.data.list
// vm.organizationList = [];
vm.search(); vm.search();
}else { }else {
vm.formInline.selectRegionId = value; vm.formInline.selectRegionId = value;
...@@ -691,7 +687,7 @@ export default { ...@@ -691,7 +687,7 @@ export default {
} }
}); });
}, },
//获取机构-老的接口-需要 //获取机构
gethHspitalsCnt() { gethHspitalsCnt() {
let req = { let req = {
projectId: vm.projectId, projectId: vm.projectId,
...@@ -703,7 +699,7 @@ export default { ...@@ -703,7 +699,7 @@ export default {
vm.hospitalCnt = res.data.hospitalCnt; vm.hospitalCnt = res.data.hospitalCnt;
vm.hospitalCntList = res.data.list; //当前选中区域下的机构列表 vm.hospitalCntList = res.data.list; //当前选中区域下的机构列表
vm.formInline.organization = []; vm.formInline.organization = [];
vm.organizationList = [];//选择机构操作被弃用 // vm.organizationList = [];//选择机构操作被弃用
// 选中区域下只有一个机构时,所有请求中要传递机构ID added by Anndy Yang // 选中区域下只有一个机构时,所有请求中要传递机构ID added by Anndy Yang
if(vm.hospitalCntList.length == 1) { if(vm.hospitalCntList.length == 1) {
let obj = { let obj = {
...@@ -711,7 +707,7 @@ export default { ...@@ -711,7 +707,7 @@ export default {
label: vm.hospitalCntList[0].hospitalName, label: vm.hospitalCntList[0].hospitalName,
value: vm.hospitalCntList[0].hospitalId, value: vm.hospitalCntList[0].hospitalId,
}; };
vm.organizationList.push(obj); // vm.organizationList.push(obj);
vm.formInline.organization.push(vm.hospitalCntList[0].hospitalId); vm.formInline.organization.push(vm.hospitalCntList[0].hospitalId);
} }
vm.search(); // added by Anndy Yang vm.search(); // added by Anndy Yang
...@@ -789,10 +785,10 @@ export default { ...@@ -789,10 +785,10 @@ export default {
hospitalNames: vm.dialogData.organization, hospitalNames: vm.dialogData.organization,
regionNames: vm.dialogData.region, regionNames: vm.dialogData.region,
}; };
if(vm.organizationList.length == 1) { // if(vm.organizationList.length == 1) {
req.hospitalIdList = []; // req.hospitalIdList = [];
req.hospitalIdList[0] = vm.organizationList[0].value; // req.hospitalIdList[0] = vm.organizationList[0].value;
} // }
// if(req.regionNames == '全部') { // if(req.regionNames == '全部') {
//全部地区 机构只有一个情况 //全部地区 机构只有一个情况
if(vm.hospitalCntList.length == 1) { if(vm.hospitalCntList.length == 1) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册