|
@@ -106,19 +106,15 @@
|
|
|
data: function() {
|
|
|
return {
|
|
|
list: [],
|
|
|
- tagTypes: [],
|
|
|
Adscriptions: [],
|
|
|
tmpAdscriptions: [],
|
|
|
AdscriptionsType:[],
|
|
|
AdscriptionsOwnTo:[],
|
|
|
- tagTypesList: [],
|
|
|
searched: false,
|
|
|
filter: {
|
|
|
- tagType: [], //标签类型
|
|
|
templateType: '', //模板类型
|
|
|
ownTo: '', //属于科室、慢病
|
|
|
tagAdscription: '', //标签归属
|
|
|
- tagSysName: '', //标签系统名称
|
|
|
},
|
|
|
currentPage: 1,
|
|
|
pageSize: 10,
|
|
@@ -163,11 +159,12 @@
|
|
|
this.Adscriptions = this.tmpAdscriptions
|
|
|
}
|
|
|
if((newVal+'') != preVal){
|
|
|
+
|
|
|
if(newVal == 1){
|
|
|
- this.AdscriptionsOwnTo = this.deptAndDisInfo.deptDTOS
|
|
|
+ this.AdscriptionsOwnTo = this.deptAndDisInfo.deptDTOS;
|
|
|
this.filter.ownTo = ''
|
|
|
}else if(newVal == 2){
|
|
|
- this.AdscriptionsOwnTo = this.deptAndDisInfo.disDTOS
|
|
|
+ this.AdscriptionsOwnTo = this.deptAndDisInfo.disDTOS;
|
|
|
this.filter.ownTo = ''
|
|
|
}else{
|
|
|
this.AdscriptionsOwnTo = []
|
|
@@ -179,7 +176,16 @@
|
|
|
beforeRouteEnter(to, from, next) {
|
|
|
next(vm => {
|
|
|
//const pm = to.param;
|
|
|
- Object.assign(vm, to.params);
|
|
|
+ const flt = to.params.filter;
|
|
|
+ vm.currentPage = to.params.currentPage;
|
|
|
+ vm.deptAndDisInfo = JSON.parse(localStorage.getItem('deptDis')||null);
|
|
|
+ if(flt){
|
|
|
+ vm.filter.templateType = flt.templateType;
|
|
|
+ setTimeout(function(){
|
|
|
+ vm.filter.tagAdscription = flt.tagAdscription;
|
|
|
+ vm.filter.ownTo = flt.ownTo;
|
|
|
+ });
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
@@ -197,28 +203,19 @@
|
|
|
this.AdscriptionsType = templateType
|
|
|
return api.getDropList().then((res) =>{
|
|
|
if(res.data.code === '0') {
|
|
|
- this.tagTypes = res.data.data[6];
|
|
|
this.Adscriptions = res.data.data[4];
|
|
|
this.tmpAdscriptions = res.data.data[4];
|
|
|
localStorage.setItem('typeLis',JSON.stringify(res.data.data[4]))
|
|
|
- for (var i = 0; i < this.tagTypes.length; i++) {
|
|
|
- this.tagTypesList.push(this.tagTypes[i].val)
|
|
|
- }
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- getDataList() {
|
|
|
- const param = this.getFilterItems();
|
|
|
+ getDataList(isTurnPage) {
|
|
|
+ const param = this.getFilterItems(isTurnPage);
|
|
|
this.searched = true;
|
|
|
api.getModuleInfoList(param).then((res) => {
|
|
|
if(res.data.code == 0){
|
|
|
- const list = res.data.data.records
|
|
|
+ const list = res.data.data.records;
|
|
|
for (var i = 0; i < list.length; i++) {
|
|
|
- for (var j = 0; j < this.tagTypes.length; j++) {
|
|
|
- if(list[i].tagType === this.tagTypes[j].val) {
|
|
|
- list[i].tagTypeCn = this.tagTypes[j].name;
|
|
|
- }
|
|
|
- }
|
|
|
for (var z = 0; z < this.Adscriptions.length; z++) {
|
|
|
if(list[i].type === this.Adscriptions[z].val) {
|
|
|
list[i].typeCn = this.Adscriptions[z].name
|
|
@@ -274,9 +271,17 @@
|
|
|
},
|
|
|
currentChange(next) {
|
|
|
this.currentPage = next;
|
|
|
- this.getDataList();
|
|
|
+ this.getDataList(true);
|
|
|
},
|
|
|
- getFilterItems() {
|
|
|
+ getFilterItems(isTurnPage) {
|
|
|
+ //翻页时筛选条件没点确定则清空
|
|
|
+ if(isTurnPage&&!this.searched){
|
|
|
+ this.filter={
|
|
|
+ templateType: '', //模板类型
|
|
|
+ ownTo: '', //属于科室、慢病
|
|
|
+ tagAdscription: '', //标签归属
|
|
|
+ };
|
|
|
+ };
|
|
|
const param = {
|
|
|
current: this.currentPage,
|
|
|
size: this.pageSize,
|
|
@@ -304,19 +309,20 @@
|
|
|
resolve();
|
|
|
}).catch(() => {});
|
|
|
},
|
|
|
+ clearfilter(){
|
|
|
+ this.filter={
|
|
|
+ templateType: '', //模板类型
|
|
|
+ ownTo: '', //属于科室、慢病
|
|
|
+ tagAdscription: '', //标签归属
|
|
|
+ };
|
|
|
+ },
|
|
|
showDelDialog(id,type){
|
|
|
this.showConfirmDialog('是否删除该标签?',()=>{
|
|
|
api.delTemplate({ids:id,type:type}).then((res)=>{
|
|
|
if(res.data.code=='0'){
|
|
|
if(!this.searched){
|
|
|
//未点确认时清空搜索条件
|
|
|
- this.filter={
|
|
|
- tagType: [], //标签类型
|
|
|
- templateType: '', //模板类型
|
|
|
- ownTo: '', //属于科室、慢病
|
|
|
- tagAdscription: '', //标签归属
|
|
|
- tagSysName: '', //标签系统名称
|
|
|
- };
|
|
|
+ this.clearfilter();
|
|
|
}
|
|
|
if(this.list.length==1){
|
|
|
//当前在最后一页且只有一条数据时,删除后跳到前一页
|