Переглянути джерело

Merge branch 'master' of http://192.168.1.43:3000/v3/v3-lab-web

dedsudiyu 10 місяців тому
батько
коміт
3646b31486

+ 29 - 5
src/views/chemicalManage/basicManagement/chemicalsCabinetManage/addPage.vue

@@ -302,15 +302,18 @@
         safeIdList:[],
         //过滤柜锁
         filterCabinetLock:[],
+        //存储编辑的时候返回的智能锁
+        editLockList:[],
       }
     },
     created(){
-      this.initialize();
+
     },
     mounted(){
       let self=this;
+      this.initialize();
       this.getDeptDropList();
-      this.chemicalCabinetGetLockList();
+
 
     },
     methods:{
@@ -318,6 +321,7 @@
       initialize(){
         let self=this;
         if(this.propsData.cabinetId){
+
           let obj = JSON.parse(JSON.stringify(this.propsData))
           let newData = {
             cabinetId:obj.cabinetId,
@@ -344,6 +348,7 @@
             if(item.cabinetLockVoList){
               item.cabinetLockVoList.forEach((bigItem)=>{
                 minObj.cabinetLockList.push(bigItem.lockId)
+                this.editLockList.push(bigItem.lockId)
               })
             }
             if(item.cabinetAdminVoList){
@@ -363,7 +368,11 @@
           })
           this.subOptions=[{subId:obj.subId,subName:obj.subName,}]
           this.$set(this,'newData',newData);
-          this.iotDeviceFindByType(this.newData.subId);
+          this.chemicalCabinetGetLockList(this.newData.cabinetId);
+
+
+        }else{
+          this.chemicalCabinetGetLockList('');
         }
       },
       // 返回按钮
@@ -454,9 +463,12 @@
         })
       },
       //化学品柜-过滤柜锁
-      chemicalCabinetGetLockList(){
-        chemicalCabinetGetLockList({}).then(response => {
+      chemicalCabinetGetLockList(cabinetId){
+        chemicalCabinetGetLockList({cabinetId:cabinetId}).then(response => {
           this.$set(this, 'filterCabinetLock', response.data)
+          if (this.newData.cabinetId){
+            this.iotDeviceFindByType(this.newData.subId);
+          }
         });
       },
       //查询学院列表
@@ -590,6 +602,18 @@
             list.push({lockName:item.deviceName,lockId:item.id,lockNum:item.deviceNo})
           })
           this.$set(this, 'lockOptions', list)
+
+          if (this.newData.cabinetId){
+            let editLockListArr = Array.from(new Set(this.editLockList));
+            this.lockOptions.forEach(v => {
+              v.disabled = false
+              editLockListArr.forEach(item=>{
+                if (item ==v.lockId){
+                  v.disabled = true
+                }
+              })
+            })
+          }
         });
       },
       //智能锁选中触发

+ 1 - 1
src/views/chemicalManage/inventoryManagement/savePending/addPage.vue

@@ -665,7 +665,7 @@
       },
       //通过当前用户id查询所属课题组
       systemTopicTopicList(userId){
-        systemTopicTopicList({"userByAffiliation":userId}).then(response => {
+        systemTopicTopicList({"userByAffiliation":userId,pageSize:-1}).then(response => {
           if (response.data.records[0]){
             this.$set(this.newData,'topicGroupId',response.data.records[0].id);
             this.$set(this.newData,'topicGroupName',response.data.records[0].topicName);

+ 1 - 1
src/views/chemicalManage/purchaseManage/purchaseRegister/addPage.vue

@@ -648,7 +648,7 @@
       },
       //通过当前用户id查询所属课题组
       systemTopicTopicList(userId){
-        systemTopicTopicList({"userByAffiliation":userId}).then(response => {
+        systemTopicTopicList({"userByAffiliation":userId,pageSize:-1}).then(response => {
           if (response.data.records[0]){
             this.$set(this.newData,'topicGroupId',response.data.records[0].id);
             this.$set(this.newData,'topicGroupName',response.data.records[0].topicName);