dedsudiyu 2 years ago
parent
commit
c0fb5d92c1

+ 8 - 0
src/api/laboratory/subject.js

@@ -343,3 +343,11 @@ export function getOpenDoorApply(id) {
     method: 'get',
   })
 }
+
+//获取实验室详情位置灯数据
+export function subjectVo(id) {
+  return request({
+    url: '/laboratory/subject/vo/'+id,
+    method: 'get',
+  })
+}

+ 7 - 16
src/views/comprehensive/laboratoryManagement/accessAuthorization/addPage.vue

@@ -49,7 +49,7 @@
       <el-form-item label="安全责任人:" prop="laboratoryId">
         <!--<p style="line-height:40px;">{{name?name:'请选择实验室'}}</p>-->
         <p style="line-height:40px;" v-if="!nameList[0]">请选择实验室</p>
-        <p style="line-height:40px;" v-if="nameList[0]"><span v-for="(item,index) in nameList">{{index!=0?','+item.name:item.name}}</span></p>
+        <p style="line-height:40px;" v-if="nameList[0]"><span v-for="(item,index) in nameList">{{index!=0?','+item:item}}</span></p>
       </el-form-item>
     </el-form>
     <div class="bottom-button-box">
@@ -61,7 +61,7 @@
 
 <script>
 import { subjectList,selectUserListByName } from "@/api/laboratory/approval";
-import { subjectInfo,openDoorApply } from "@/api/laboratory/subject";
+import { subjectVo,openDoorApply } from "@/api/laboratory/subject";
   export default {
     name: "addPage",
     data(){
@@ -126,20 +126,11 @@ import { subjectInfo,openDoorApply } from "@/api/laboratory/subject";
       //实验室选中
       userChange(data){
         let self = this;
-        subjectInfo(data,0).then(response => {
-          this.text = response.data.deptName + '-' + response.data.subAddrr.buildName + '-' + response.data.subAddrr.floorName +'-'+ response.data.subAddrr.room
-          let list = response.data.safeUserNameAdminPhone.split(',');
-          let listData = [];
-          for(let i=0;i<list.length;i++){
-            let newList = list[i].split('@');
-            let obj = {
-              id:newList[1],
-              name:newList[0]
-            };
-            listData.push(obj);
-          }
-          this.$set(this,'nameList',listData);
-          this.$set(this.newObj,'position',response.data.subAddrr.buildName + '-' + response.data.subAddrr.floorName +'-'+ response.data.subAddrr.room);
+        subjectVo(data,0).then(response => {
+          this.text = response.data.deptName + '-' + response.data.buildName + '-' + response.data.floorName +'-'+ response.data.roomName
+          let list = response.data.safeUserNames.split(',');
+          this.$set(this,'nameList',list);
+          this.$set(this.newObj,'position',response.data.buildName + '-' + response.data.floorName +'-'+ response.data.roomName);
           this.$set(this.newObj,'college',response.data.deptName);
           this.$set(this.newObj,'subjectName',response.data.name);
           this.$set(this.newObj,'subjectId',response.data.id);

+ 7 - 16
src/views/studentViews/accessAuthorization/addPage.vue

@@ -49,7 +49,7 @@
       <el-form-item label="安全责任人:" prop="laboratoryId">
         <!--<p style="line-height:40px;">{{name?name:'请选择实验室'}}</p>-->
         <p style="line-height:40px;" v-if="!nameList[0]">请选择实验室</p>
-        <p style="line-height:40px;" v-if="nameList[0]"><span v-for="(item,index) in nameList">{{index!=0?','+item.name:item.name}}</span></p>
+        <p style="line-height:40px;" v-if="nameList[0]"><span v-for="(item,index) in nameList">{{index!=0?','+item:item}}</span></p>
       </el-form-item>
     </el-form>
     <div class="bottom-button-box">
@@ -61,7 +61,7 @@
 
 <script>
 import { subjectList,selectUserListByName } from "@/api/laboratory/approval";
-import { subjectInfo } from "@/api/laboratory/subject";
+import { subjectVo } from "@/api/laboratory/subject";
 import { openDoorApply } from "@/api/studentApi/accessAuthorization/index";
   export default {
     name: "addPage",
@@ -127,20 +127,11 @@ import { openDoorApply } from "@/api/studentApi/accessAuthorization/index";
       //实验室选中
       userChange(data){
         let self = this;
-        subjectInfo(data,0).then(response => {
-          this.text = response.data.deptName + '-' + response.data.subAddrr.buildName + '-' + response.data.subAddrr.floorName +'-'+ response.data.subAddrr.room
-          let list = response.data.safeUserNameAdminPhone.split(',');
-          let listData = [];
-          for(let i=0;i<list.length;i++){
-            let newList = list[i].split('@');
-            let obj = {
-              id:newList[1],
-              name:newList[0]
-            };
-            listData.push(obj);
-          }
-          this.$set(this,'nameList',listData);
-          this.$set(this.newObj,'position',response.data.subAddrr.buildName + '-' + response.data.subAddrr.floorName +'-'+ response.data.subAddrr.room);
+        subjectVo(data,0).then(response => {
+          this.text = response.data.deptName + '-' + response.data.buildName + '-' + response.data.floorName +'-'+ response.data.roomName
+          let list = response.data.safeUserNames.split(',');
+          this.$set(this,'nameList',list);
+          this.$set(this.newObj,'position',response.data.buildName + '-' + response.data.floorName +'-'+ response.data.roomName);
           this.$set(this.newObj,'college',response.data.deptName);
           this.$set(this.newObj,'subjectName',response.data.name);
           this.$set(this.newObj,'subjectId',response.data.id);