提交 e8df6c45 编写于 作者: alex.zhang's avatar alex.zhang

fix bug

上级 a682ca14
...@@ -10,34 +10,58 @@ ...@@ -10,34 +10,58 @@
closable closable
:disable-transitions="false" :disable-transitions="false"
style="marginTop:10px;" style="marginTop:10px;"
@close="handleClose(item)"> @close="handleClose(item)"
{{item.name.length > 12 ? item.name.slice(0,12)+'...' : item.name}} >{{item.name.length > 12 ? item.name.slice(0,12)+'...' : item.name}}</el-tag>
</el-tag>
</div> </div>
</div> </div>
<el-row type="flex" class="btn-left"> <el-row type="flex" class="btn-left">
<el-button type="primary" size="small" @click="addFn">确定添加</el-button> <el-button type="primary" size="small" @click="addFn">确定添加</el-button>
<el-button size="small" @click="canclefn">取消</el-button> <el-button size="small" @click="canclefn">取消</el-button>
</el-row> </el-row>
</div> </div>
<div class="organization-right"> <div class="organization-right">
<el-form :inline="true" :model="formOrganization" class="demo-form-inline" > <el-form :inline="true" :model="formOrganization" class="demo-form-inline">
<el-form-item label> <el-form-item label>
<el-input style="width:200px;" size="small" v-model="formOrganization.organization" placeholder="请输入机构名称"></el-input> <el-input
style="width:200px;"
size="small"
v-model="formOrganization.organization"
placeholder="请输入机构名称"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label> <el-form-item label>
<el-input style="width:200px;" size="small" v-model="formOrganization.name" placeholder="请输入人员名称"></el-input> <el-input
style="width:200px;"
size="small"
v-model="formOrganization.name"
placeholder="请输入人员名称"
></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="small" type="primary" @click="search()">搜索</el-button> <el-button size="small" type="primary" @click="searchRefresh()">搜索</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="small" type="default" @click="searchCancel()">取消搜索</el-button> <el-button size="small" type="default" @click="searchCancel()">取消搜索</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table class="rim" ref="multipleOrganization" :data="tableOrganization" tooltip-effect="dark" @select-all="selectAllOrganization" @select="selectOrganization" > <el-table
<el-table-column type="selection" :selectable="selectableTableList" ></el-table-column> class="rim"
ref="multipleOrganization"
:data="tableOrganization"
tooltip-effect="dark"
@select-all="selectAllOrganization"
@select="selectOrganization"
>
<!-- @cell-mouse-enter="showItemToast"
@cell-mouse-leave="itemMouseOver=false"-->
<el-table-column type="selection" :selectable="selectableTableList">
<template >
<el-popover trigger="hover" placement="top">
<p>{{ "哇米诺" }}</p>
</el-popover>
</template>
</el-table-column>
<el-table-column prop="name" label="人员名称" align="center"></el-table-column> <el-table-column prop="name" label="人员名称" align="center"></el-table-column>
<el-table-column prop="department" label="所属科室" align="center"></el-table-column> <el-table-column prop="department" label="所属科室" align="center"></el-table-column>
<el-table-column prop="hospital" label="所属医院" align="center"></el-table-column> <el-table-column prop="hospital" label="所属医院" align="center"></el-table-column>
...@@ -47,15 +71,22 @@ ...@@ -47,15 +71,22 @@
<el-table-column prop="townName" label="所属街道" align="center"></el-table-column> <el-table-column prop="townName" label="所属街道" align="center"></el-table-column>
<div slot="empty"> <div slot="empty">
<div class="table-empty"> <div class="table-empty">
<img src="../../assets/image/no-content1.png"> <img src="../../assets/image/no-content1.png" />
<p>没有相关信息</p> <p>没有相关信息</p>
</div> </div>
</div> </div>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background @size-change="handleSizeOrganization" @current-change="handleCurrentOrganization" <el-pagination
:current-page="formOrganization.pageNum" :page-sizes="[10, 20, 40]" :page-size="formOrganization.pageSize" background
layout="total, sizes, prev, pager, next, jumper" :total="totalOrganization"></el-pagination> @size-change="handleSizeOrganization"
@current-change="handleCurrentOrganization"
:current-page="formOrganization.pageNum"
:page-sizes="[10, 20, 40]"
:page-size="formOrganization.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalOrganization"
></el-pagination>
</div> </div>
</div> </div>
</div> </div>
...@@ -65,18 +96,23 @@ ...@@ -65,18 +96,23 @@
import { openLoading, closeLoading } from "@/utils/utils"; import { openLoading, closeLoading } from "@/utils/utils";
import { doUpload, getFilePath } from "@/utils/qiniu-util"; import { doUpload, getFilePath } from "@/utils/qiniu-util";
import * as operationData from "@/utils/operation"; import * as operationData from "@/utils/operation";
import { getCircleProvincesReq } from '@/utils/yqrange/rangeApi'; import { getCircleProvincesReq } from "@/utils/yqrange/rangeApi";
import { moOptionBlackList, moOrgSearch, moSaveBlackList, clearBlackListCacheOrg} from '@/utils/yqrange/memberApi'; import {
moOptionBlackList,
moOrgSearch,
moSaveBlackList,
clearBlackListCacheOrg,
} from "@/utils/yqrange/memberApi";
let vm = null; let vm = null;
export default { export default {
props: { props: {
circleId: { circleId: {
type: Number | String, type: Number | String,
default: 1 default: 1,
}, },
roleType: { roleType: {
type: Number | String, type: Number | String,
default: 1 default: 1,
}, },
}, },
data() { data() {
...@@ -87,30 +123,30 @@ export default { ...@@ -87,30 +123,30 @@ export default {
const { level } = node; const { level } = node;
if (node.level == 1) { if (node.level == 1) {
let req = { let req = {
provinceId: node.data.value provinceId: node.data.value,
}; };
vm.GET("basic-data/position/cities", req).then(res => { vm.GET("basic-data/position/cities", req).then((res) => {
let newData = vm.setMoreOption(res.data.cityList, "cities"); let newData = vm.setMoreOption(res.data.cityList, "cities");
resolve(newData); resolve(newData);
}); });
} else if (node.level == 2) { } else if (node.level == 2) {
let req = { let req = {
cityId: node.data.value cityId: node.data.value,
}; };
vm.GET("basic-data/position/counties", req).then(res => { vm.GET("basic-data/position/counties", req).then((res) => {
let newData = vm.setMoreOption(res.data.countyList, "counties"); let newData = vm.setMoreOption(res.data.countyList, "counties");
resolve(newData); resolve(newData);
}); });
} else if (node.level == 3) { } else if (node.level == 3) {
let req = { let req = {
countyId: node.data.value countyId: node.data.value,
}; };
vm.GET("basic-data/position/towns", req).then(res => { vm.GET("basic-data/position/towns", req).then((res) => {
let newData = vm.setMoreOption(res.data.townList, "towns"); let newData = vm.setMoreOption(res.data.townList, "towns");
resolve(newData); resolve(newData);
}); });
} }
} },
}, },
administrativeValue: "", administrativeValue: "",
optionsRegion: [], optionsRegion: [],
...@@ -119,7 +155,7 @@ export default { ...@@ -119,7 +155,7 @@ export default {
currentOrganization: 1, currentOrganization: 1,
totalOrganization: 10, totalOrganization: 10,
pageSizeOrganization: 2, pageSizeOrganization: 2,
selectionList:[], selectionList: [],
formOrganization: { formOrganization: {
name: "", name: "",
organization: "", organization: "",
...@@ -128,10 +164,11 @@ export default { ...@@ -128,10 +164,11 @@ export default {
level: "", level: "",
chechAll: true, chechAll: true,
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10,
}, },
allSelect: [] allSelect: [],
} itemMouseOver: false,
};
}, },
created() { created() {
vm = this; vm = this;
...@@ -141,18 +178,21 @@ export default { ...@@ -141,18 +178,21 @@ export default {
// this.initRange(); // this.initRange();
//Idtype:1,内部 2.外部 //Idtype:1,内部 2.外部
vm.idType = localStorage.getItem("storageIdType"); vm.idType = localStorage.getItem("storageIdType");
this.search(); this.search();
}, },
methods: { methods: {
search() { search() {
console.log("search() enter") this.searchList();
},
searchRefresh() {
this.formOrganization.pageNum = 1;
this.searchList(); this.searchList();
}, },
searchCancel() { searchCancel() {
this.formOrganization.organization = ""; this.formOrganization.organization = "";
this.formOrganization.name = ""; this.formOrganization.name = "";
this.searchList(); this.searchRefresh();
}, },
searchList() { searchList() {
console.log("黑名单搜索 " + this.circleId); console.log("黑名单搜索 " + this.circleId);
...@@ -182,12 +222,14 @@ export default { ...@@ -182,12 +222,14 @@ export default {
}); });
}, },
clear() { clear() {
console.log("clear() enter") console.log("clear() enter");
clearBlackListCacheOrg(this.circleId) clearBlackListCacheOrg(this.circleId)
.then(()=>{ .then(() => {
this.search(); this.search();
}) })
.catch((err=>{console.log(err)})) .catch((err) => {
console.log(err);
});
}, },
// 多级地区 // 多级地区
setMoreOption(data, type) { setMoreOption(data, type) {
...@@ -216,43 +258,47 @@ export default { ...@@ -216,43 +258,47 @@ export default {
this.formOrganization.name = ""; this.formOrganization.name = "";
this.formOrganization.level = ""; this.formOrganization.level = "";
}, },
//获取地区 //获取地区
getRegionOption() { getRegionOption() {
openLoading(vm); openLoading(vm);
let idType = localStorage.getItem("storageIdType"); let idType = localStorage.getItem("storageIdType");
getCircleProvincesReq(idType).then(res => { getCircleProvincesReq(idType)
closeLoading(this); .then((res) => {
if (res.code == "000000") { closeLoading(this);
if (idType == 1) { if (res.code == "000000") {
vm.optionsRegion = operationData.setRegionOption2( if (idType == 1) {
res.data.provinceList vm.optionsRegion = operationData.setRegionOption2(
); res.data.provinceList
}else{ );
vm.optionsRegion = operationData.setRegionOption3( } else {
res.data.provinceList vm.optionsRegion = operationData.setRegionOption3(
); res.data.provinceList
);
}
vm.formOrganization.administrativeIdList.push(
vm.optionsRegion[0].value
);
vm.getOrganization();
} else {
this.$message(res.message);
} }
vm.formOrganization.administrativeIdList.push(vm.optionsRegion[0].value); })
vm.getOrganization(); .catch((err) => {
} else { this.$message.error("请求失败");
this.$message(res.message); });
}
}).catch(err => {
this.$message.error('请求失败');
});
}, },
//获取医院等级 //获取医院等级
listLevels() { listLevels() {
let req = {}; let req = {};
vm.GET("contents/courseDoctor/listLevels?sysCode=10", req).then(res => { vm.GET("contents/courseDoctor/listLevels?sysCode=10", req).then((res) => {
if (res.code == "000000") { if (res.code == "000000") {
this.organizationRank = operationData.getLevelList(res.data.list); this.organizationRank = operationData.getLevelList(res.data.list);
} else { } else {
this.organizationRank = [ this.organizationRank = [
{ {
id: "0", id: "0",
label: "全部医院等级" label: "全部医院等级",
} },
]; ];
} }
}); });
...@@ -263,7 +309,7 @@ export default { ...@@ -263,7 +309,7 @@ export default {
let administrativeIdItem = ""; let administrativeIdItem = "";
// 如果是外部用户(2),只能看到所在省份的数据 // 如果是外部用户(2),只能看到所在省份的数据
if(idType == 2){ if (idType == 2) {
let optionRegionArray = new Array(); let optionRegionArray = new Array();
optionRegionArray.push(this.optionsRegion[0].provinceId); optionRegionArray.push(this.optionsRegion[0].provinceId);
administrativeIdItem = operationData.setAdministrativeId( administrativeIdItem = operationData.setAdministrativeId(
...@@ -274,31 +320,33 @@ export default { ...@@ -274,31 +320,33 @@ export default {
let req = { let req = {
circleId: this.circleId, circleId: this.circleId,
districtIds: administrativeIdItem, districtIds: administrativeIdItem,
orgLevel:"", orgLevel: "",
member: this.formOrganization.name, member: this.formOrganization.name,
pageNo: this.formOrganization.pageNum, pageNo: this.formOrganization.pageNum,
pageSize: this.formOrganization.pageSize, pageSize: this.formOrganization.pageSize,
idType: idType, idType: idType,
roleType: this.roleType roleType: this.roleType,
}; };
openLoading(vm); openLoading(vm);
moOrgSearch(req).then(res => { moOrgSearch(req)
closeLoading(this); .then((res) => {
if (res.code == "000000") { closeLoading(this);
this.tableOrganization = res.data.orgList; if (res.code == "000000") {
this.totalOrganization = res.data.total; this.tableOrganization = res.data.orgList;
vm.initOrganizationStatus(); this.totalOrganization = res.data.total;
} else { vm.initOrganizationStatus();
this.$message(res.message); } else {
} this.$message(res.message);
}).catch(err => { }
this.$message.error('请求失败'); })
}); .catch((err) => {
this.$message.error("请求失败");
});
}, },
// 获取机构列表的机构状态(是否被选中) // 获取机构列表的机构状态(是否被选中)
initOrganizationStatus() { initOrganizationStatus() {
let tableStatus = this.tableOrganization; let tableStatus = this.tableOrganization;
tableStatus.forEach(row => { tableStatus.forEach((row) => {
if (row.status == 1 || row.status == 2) { if (row.status == 1 || row.status == 2) {
this.$nextTick(function () { this.$nextTick(function () {
this.$refs.multipleOrganization.toggleRowSelection(row); this.$refs.multipleOrganization.toggleRowSelection(row);
...@@ -312,8 +360,8 @@ export default { ...@@ -312,8 +360,8 @@ export default {
let administrativeIdItem = operationData.setAdministrativeId( let administrativeIdItem = operationData.setAdministrativeId(
this.formOrganization.administrativeIdList this.formOrganization.administrativeIdList
); );
if (administrativeIdItem == "000_0"){ if (administrativeIdItem == "000_0") {
administrativeIdItem="" administrativeIdItem = "";
} }
let idType = localStorage.getItem("storageIdType"); let idType = localStorage.getItem("storageIdType");
let req = { let req = {
...@@ -324,22 +372,24 @@ export default { ...@@ -324,22 +372,24 @@ export default {
pageNo: this.formOrganization.pageNum, pageNo: this.formOrganization.pageNum,
pageSize: this.formOrganization.pageSize, pageSize: this.formOrganization.pageSize,
idType: idType, idType: idType,
roleType: this.roleType roleType: this.roleType,
}; };
openLoading(vm); openLoading(vm);
moOrgSearch(req).then(res => { moOrgSearch(req)
closeLoading(vm); .then((res) => {
if (res.code == "000000") { closeLoading(vm);
this.tableOrganization = res.data.orgList; if (res.code == "000000") {
this.totalOrganization = res.data.total; this.tableOrganization = res.data.orgList;
vm.initOrganizationStatus(); this.totalOrganization = res.data.total;
} else { vm.initOrganizationStatus();
this.$message(res.message); } else {
} this.$message(res.message);
}).catch(err => { }
this.$message.error('请求失败'); })
}); .catch((err) => {
}, this.$message.error("请求失败");
});
},
//选择搜索机构方式 //选择搜索机构方式
searchOrganization() { searchOrganization() {
this.formOrganization.pageNum = 1; this.formOrganization.pageNum = 1;
...@@ -347,7 +397,7 @@ export default { ...@@ -347,7 +397,7 @@ export default {
if ( if (
searchForm.administrativeId == "0" && searchForm.administrativeId == "0" &&
searchForm.administrativeIdList[ searchForm.administrativeIdList[
searchForm.administrativeIdList.length - 1 searchForm.administrativeIdList.length - 1
] == "0" && ] == "0" &&
searchForm.level == "" && searchForm.level == "" &&
searchForm.name == "" searchForm.name == ""
...@@ -369,16 +419,22 @@ export default { ...@@ -369,16 +419,22 @@ export default {
handleCurrentOrganization(val) { handleCurrentOrganization(val) {
//console.log(`当前页: ${val}`); //console.log(`当前页: ${val}`);
this.formOrganization.pageNum = val; this.formOrganization.pageNum = val;
console.log("this.formOrganization.pageNum = " + this.formOrganization.pageNum) console.log(
"this.formOrganization.pageNum = " + this.formOrganization.pageNum
);
this.search(); this.search();
}, },
//机构table中勾选一页 //机构table中勾选一页
selectAllOrganization(selection) { selectAllOrganization(selection, row) {
this.selectionList = selection; this.selectionList = selection;
let setList = []; let setList = [];
let selectList = []; let selectList = [];
for (let i = 0; i < vm.tableOrganization.length; i++) { for (let i = 0; i < vm.tableOrganization.length; i++) {
if (vm.tableOrganization[i].status != 2) { if (
vm.tableOrganization[i].status != 2 &&
(vm.tableOrganization[i].roleId == null ||
vm.tableOrganization[i].roleId == 0)
) {
setList.push(vm.tableOrganization[i].id); setList.push(vm.tableOrganization[i].id);
} }
} }
...@@ -396,24 +452,26 @@ export default { ...@@ -396,24 +452,26 @@ export default {
let req = { let req = {
ids: setList, ids: setList,
circleId: this.circleId, circleId: this.circleId,
type: typeStatus type: typeStatus,
}; };
openLoading(vm); openLoading(vm);
moOptionBlackList(req).then(res => { moOptionBlackList(req)
closeLoading(vm); .then((res) => {
if (res.code == "000000") { closeLoading(vm);
this.checkToList(req.type,vm.tableOrganization) if (res.code == "000000") {
} else { this.checkToList(req.type, vm.tableOrganization); //vm.tableOrganization
this.$message(res.message); } else {
} this.$message(res.message);
}).catch(err => { }
this.$message.error('请求失败'); })
}); .catch((err) => {
this.$message.error("请求失败");
});
} }
}, },
//机构table中勾选一个 //机构table中勾选一个
selectOrganization(selection, row) { selectOrganization(selection, row) {
console.log("selectOrganization() : " + row.name) console.log("selectOrganization() : " + row.name);
this.selectionList = selection; this.selectionList = selection;
let flag = false; let flag = false;
for (let i = 0; i < selection.length; i++) { for (let i = 0; i < selection.length; i++) {
...@@ -424,19 +482,21 @@ export default { ...@@ -424,19 +482,21 @@ export default {
let req = { let req = {
ids: [row.id], ids: [row.id],
circleId: this.circleId, circleId: this.circleId,
type: flag === false ? 0 : 1 type: flag === false ? 0 : 1,
}; };
openLoading(vm); openLoading(vm);
moOptionBlackList(req).then(res => { moOptionBlackList(req)
closeLoading(vm); .then((res) => {
if (res.code == "000000") { closeLoading(vm);
this.checkToList(req.type,row) if (res.code == "000000") {
} else { this.checkToList(req.type, row);
this.$message(res.message); } else {
} this.$message(res.message);
}).catch(err => { }
this.$message.error('请求失败'); })
}); .catch((err) => {
this.$message.error("请求失败");
});
}, },
selectableTableList(row, index) { selectableTableList(row, index) {
// if (this.status4Flag == 1) { // if (this.status4Flag == 1) {
...@@ -448,37 +508,45 @@ export default { ...@@ -448,37 +508,45 @@ export default {
// return true; // return true;
}, },
// 通过check改变展示的已选中的数据列表 // 通过check改变展示的已选中的数据列表
checkToList(type,item) { checkToList(type, item) {
if (type) { if (type) {
if (Array.isArray(item)) { if (Array.isArray(item)) {
this.allSelect = this.unique([...this.allSelect,...item]) this.allSelect = this.unique([...this.allSelect, ...item]);
} else { } else {
this.allSelect.push(item) this.allSelect.push(item);
} }
} else { } else {
if (Array.isArray(item)) { if (Array.isArray(item)) {
for(var i = this.allSelect.length -1; i >= 0 ; i--){ for (var i = this.allSelect.length - 1; i >= 0; i--) {
for(let j = item.length -1; j >= 0; j--) { for (let j = item.length - 1; j >= 0; j--) {
if (this.allSelect[i] && item[j] && this.allSelect[i].id == item[j].id) { if (
this.allSelect.splice(i,1) this.allSelect[i] &&
item[j] &&
this.allSelect[i].id == item[j].id
) {
this.allSelect.splice(i, 1);
} }
} }
} }
} else { } else {
for(let i = this.allSelect.length-1; i >=0; i--) { for (let i = this.allSelect.length - 1; i >= 0; i--) {
if (this.allSelect[i].id == item.id) { if (this.allSelect[i].id == item.id) {
this.allSelect.splice(i,1) this.allSelect.splice(i, 1);
} }
} }
} }
} }
}, },
// 去重 // 去重
unique(arr) { unique(arr) {
let hashTable = {}; let hashTable = {};
let newArr = []; let newArr = [];
for(let i=0,l=arr.length;i<l;i++) { for (let i = 0, l = arr.length; i < l; i++) {
if(!hashTable[arr[i].id] && arr[i].status != 2) { if (
!hashTable[arr[i].id] &&
arr[i].status != 2 &&
(arr[i].roleId == null || arr[i].roleId == 0)
) {
hashTable[arr[i].id] = true; hashTable[arr[i].id] = true;
newArr.push(arr[i]); newArr.push(arr[i]);
} }
...@@ -487,35 +555,42 @@ export default { ...@@ -487,35 +555,42 @@ export default {
}, },
//删除已选中的tag //删除已选中的tag
handleClose(item) { handleClose(item) {
this.selectOrganization([],item) this.selectOrganization([], item);
this.$refs.multipleOrganization.toggleRowSelection(item); this.$refs.multipleOrganization.toggleRowSelection(item);
}, },
// 确定添加 // 确定添加
addFn() { addFn() {
console.log("this.allSelect = " + this.allSelect) console.log("this.allSelect = " + this.allSelect);
console.log("this.allSelect.length = " + this.allSelect.length) console.log("this.allSelect.length = " + this.allSelect.length);
if (!(this.allSelect&& this.allSelect.length)) { if (!(this.allSelect && this.allSelect.length)) {
this.$message.error('已选列表为空'); this.$message.error("已选列表为空");
return return;
} }
let params = { let params = {
circleId: this.circleId circleId: this.circleId,
} };
moSaveBlackList(params) moSaveBlackList(params)
.then(() => { .then(() => {
this.$emit('addOrg') this.$emit("addOrg");
}) })
.catch(() => { .catch(() => {
this.$message.error('保存失败,请重试'); this.$message.error("保存失败,请重试");
}) });
}, },
// 取消 // 取消
canclefn() { canclefn() {
console.log("alex do canclefn()") console.log("alex do canclefn()");
this.$emit('handleClose') this.$emit("handleClose");
} },
} showItemToast(row) {
} console.log("showItemToast() : " + row.status + ", 管理员不可加入黑名单");
if (row.roleId != null && row.roleId != 0) {
vm.$message.info("管理员不可加入黑名单");
}
this.itemMouseOver = true;
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -533,7 +608,7 @@ export default { ...@@ -533,7 +608,7 @@ export default {
.hcd { .hcd {
flex: 1; flex: 1;
overflow: hidden; overflow: hidden;
.tag-list { .tag-list {
margin-top: 20px; margin-top: 20px;
margin-bottom: 40px; margin-bottom: 40px;
display: table-caption; display: table-caption;
...@@ -544,7 +619,7 @@ export default { ...@@ -544,7 +619,7 @@ export default {
} }
} }
} }
.btn-left { .btn-left {
height: 40px; height: 40px;
margin-bottom: 20px; margin-bottom: 20px;
...@@ -560,13 +635,11 @@ export default { ...@@ -560,13 +635,11 @@ export default {
font-size: 18px; font-size: 18px;
margin-right: 2px; margin-right: 2px;
} }
} }
.organization-search { .organization-search {
margin-right: 20px; margin-right: 20px;
text-align: right; text-align: right;
} }
} }
} }
</style> </style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册