|
@@ -108,10 +108,18 @@
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
- this.systemDeptDropList();
|
|
|
- this.laboratoryClassTypeGetList();
|
|
|
- this.laboratoryClassLevelGetList();
|
|
|
- this.getList()
|
|
|
+ Promise.all([
|
|
|
+ this.laboratoryClassTypeGetList(),
|
|
|
+ this.laboratoryClassLevelGetList()
|
|
|
+ ]).then((result) => {
|
|
|
+ this.systemDeptDropList();
|
|
|
+ }).catch((error) => {
|
|
|
+ uni.showToast({
|
|
|
+ title: '数据异常,请稍候再试!',
|
|
|
+ icon: "none",
|
|
|
+ duration: 3000
|
|
|
+ });
|
|
|
+ })
|
|
|
},
|
|
|
onShow() {
|
|
|
},
|
|
@@ -154,13 +162,32 @@
|
|
|
for (let i = 0; i < data.data.length; i++) {
|
|
|
list.push(data.data[i].deptName)
|
|
|
}
|
|
|
- this.facultyArray = list;
|
|
|
- list.unshift('全部');
|
|
|
- this.facultyList = data.data;
|
|
|
- this.facultyList.unshift({
|
|
|
- deptName: "全部",
|
|
|
- deptId: ""
|
|
|
- })
|
|
|
+ if(uni.getStorageSync('subAdmin')==1){
|
|
|
+ this.facultyArray.push('我的实验室')
|
|
|
+ this.facultyList.push({
|
|
|
+ deptName: "我的实验室",
|
|
|
+ deptId: "-1"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(config.schoolId == uni.getStorageSync('user').position){
|
|
|
+ this.facultyArray.push('全部')
|
|
|
+ this.facultyList.push({
|
|
|
+ deptName: "全部",
|
|
|
+ deptId: ""
|
|
|
+ })
|
|
|
+ this.facultyArray = this.facultyArray.concat(list)
|
|
|
+ this.facultyList = this.facultyArray.concat(data.data)
|
|
|
+ }else{
|
|
|
+ this.facultyArray.push(uni.getStorageSync('userDeptName'))
|
|
|
+ this.facultyList.push({
|
|
|
+ deptName: uni.getStorageSync('userDeptName'),
|
|
|
+ deptId: uni.getStorageSync('userDeptId')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(this.facultyList[0]){
|
|
|
+ this.$set(this,'facultyIndex',0);
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
//分类下拉列表
|