Browse Source

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

dedsudiyu 1 year ago
parent
commit
bc2dec12d7

+ 8 - 0
src/api/chemicalManage/index.js

@@ -160,6 +160,14 @@ export function chemicalStockGetStockByDoorId(query) {
     params: query
   })
 }
+//化学品柜-智能锁
+export function iotDeviceFindByType(data) {
+  return request({
+    url: '/iot/device/findByType',
+    method: 'post',
+    data: data
+  })
+}
 //化学品柜-删除
 export function chemicalCabinetDelete(data) {
   return request({

+ 25 - 8
src/views/chemicalManage/basicManagement/chemicalsCabinetManage/addPage.vue

@@ -170,7 +170,12 @@
 <script>
   import { getDeptDropList, systemUserSelect } from '@/api/commonality/permission'
   import { laboratorySubRelInfoGetRelList } from '@/api/commonality/noPermission'
-  import { chemicalCabinetAdd, chemicalCabinetUpdate, chemicalStockGetStockByDoorId } from '@/api/chemicalManage'
+  import {
+    chemicalCabinetAdd,
+    chemicalCabinetUpdate,
+    chemicalStockGetStockByDoorId,
+    iotDeviceFindByType
+  } from '@/api/chemicalManage'
   export default {
     name: 'addPage',
     props:{
@@ -197,11 +202,7 @@
           {label:'智能锁',value:'2'},
           {label:'钥匙柜',value:'3'},
         ],
-        lockOptions:[
-          {lockName:'智能锁1',lockId:'1',lockNum:'00001'},
-          {lockName:'智能锁2',lockId:'2',lockNum:'00002'},
-          {lockName:'智能锁3',lockId:'3',lockNum:'00003'},
-        ],
+        lockOptions:[],
         keyCabinetOptions:[
           {lockName:'钥匙柜名称1',lockId:'1',lockNum:'00001'},
           {lockName:'钥匙柜名称2',lockId:'2',lockNum:'00002'},
@@ -289,6 +290,8 @@
         let self=this;
         if(this.propsData.cabinetId){
           this.$set(this,'newData',this.propsData);
+          //智能锁
+          this.iotDeviceFindByType(this.newData.subId);
           this.subOptions=[{subId:this.newData.subId,subName:this.newData.subName,}]
           this.newData.cabinetDoorVoList.forEach(function(item) {
             //管理员
@@ -307,7 +310,7 @@
               })
               item.cabinetLockList=list
               item.cabinetLockListArr=item.cabinetLockVoList
-              self.lockOptions=item.cabinetLockVoList
+              //self.lockOptions=item.cabinetLockVoList
             }
             //钥匙柜
             if (item.unlockingMethod=='3'){
@@ -443,7 +446,7 @@
             }
             if (this.subOptions[i].twoSafeId){
               list.push(this.subOptions[i].twoSafeId)
-              list2.push({userId:this.subOptions[i].twoSafeId,userName:this.subOptions[i].twoSafeId})
+              list2.push({userId:this.subOptions[i].twoSafeId,userName:this.subOptions[i].twoSafeName})
             }
           }
         }
@@ -456,6 +459,7 @@
           this.newData.cabinetDoorModelList[b].cabinetAdminModelListArr=list2
         }
         this.laboratorySubRelInfoGetRelList();
+        this.iotDeviceFindByType(this.newData.subId);
       },
       //人员选中触发
       userSelectClick(data){
@@ -493,6 +497,18 @@
       unlockingMethodChange(data){
         data.cabinetLockList=[];
       },
+      //查询智能锁列表
+      iotDeviceFindByType(subId){
+        iotDeviceFindByType({subjectId:subId,typeKeyList:['cabinetLock']}).then(response => {
+          if (response.data[0]){
+            let list=[];
+            response.data.forEach(function(item) {
+              list.push({lockName:item.deviceName,lockId:item.id,lockNum:item.deviceNo})
+            })
+            this.$set(this, 'lockOptions', list)
+          }
+        });
+      },
       //智能锁选中触发
       lockChange(data){
          let list=[];//智能锁临时存储
@@ -504,6 +520,7 @@
            }
          }
          data.cabinetLockListArr=list;
+         this.$forceUpdate()
       },
       //钥匙柜选中触发
       cabinetLockChange(data){

+ 1 - 1
src/views/chemicalManage/basicManagement/chemicalsCabinetManage/index.vue

@@ -29,7 +29,7 @@
               v-model="queryParams.searchValue"
               placeholder="化学品柜名/实验室/姓名/联系方式"
               clearable
-              style="width: 240px"
+              style="width: 260px"
             />
           </el-form-item>
           <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>

+ 14 - 13
src/views/chemicalManage/earlyWarningEvent/infoPage.vue

@@ -49,7 +49,7 @@
         <!--列表 化学品1化学品违规带离。2超时未归还-->
         <div v-if="infoData.chemicalWarnType==1 || infoData.chemicalWarnType==2">
           <div class="text-max-box">
-            <div class="text-left-box">
+            <div class="text-center-box">
               <p style="width:96px;">化学品名称:</p>
               <p>{{infoData.chemicalName}}</p>
             </div>
@@ -96,16 +96,16 @@
         <div class="table-max-big-box" v-if="infoData.chemicalWarnType==5">
           <el-table class="table-box" v-loading="loading" border :data="infoData.chemicalOverdueStockList">
             <el-table-column label="化学品名称" prop="chemicalName"  show-overflow-tooltip/>
-            <el-table-column label="CAS" prop="casNum"  show-overflow-tooltip/>
-            <el-table-column label="类别" prop="chemicalCategory"  show-overflow-tooltip/>
-            <el-table-column label="纯度" prop="chemicalPurity"  show-overflow-tooltip/>
-            <el-table-column label="规格" prop="normsNum"   show-overflow-tooltip/>
-            <el-table-column label="数量" prop="applyNum"   show-overflow-tooltip/>
-            <el-table-column label="归属人" prop="belongName"   show-overflow-tooltip/>
-            <el-table-column label="学院" prop="deptName"   show-overflow-tooltip/>
-            <el-table-column label="实验室" prop="subName"   show-overflow-tooltip/>
-            <el-table-column label="类型" prop="source"   show-overflow-tooltip/>
-            <el-table-column label="创建时间" prop="createTime"   show-overflow-tooltip>
+            <el-table-column label="CAS" prop="casNum" width="180"  show-overflow-tooltip/>
+            <el-table-column label="类别" prop="chemicalCategory" width="180" show-overflow-tooltip/>
+            <el-table-column label="纯度" prop="chemicalPurity" width="180"  show-overflow-tooltip/>
+            <el-table-column label="规格" prop="normsNum"  width="180"  show-overflow-tooltip/>
+            <el-table-column label="数量" prop="applyNum"  width="180" show-overflow-tooltip/>
+            <el-table-column label="归属人" prop="belongName" width="220"  show-overflow-tooltip/>
+            <el-table-column label="学院" prop="deptName" width="220"  show-overflow-tooltip/>
+            <el-table-column label="实验室" prop="subName" width="220"  show-overflow-tooltip/>
+            <el-table-column label="类型" prop="source" width="220"  show-overflow-tooltip/>
+            <el-table-column label="创建时间" prop="createTime" width="220"  show-overflow-tooltip>
               <template slot-scope="scope">
                 <span>{{ parseTime(scope.row.createTime,"{y}-{m}-{d} {h}:{i}") }}</span>
               </template>
@@ -241,14 +241,15 @@
     },
     created(){
       this.initialize();
-      this.$set(this,'infoData',this.propsData);
-      this.$set(this.infoDataForm,'noticeId',this.propsData.noticeId);
+
     },
     mounted(){
     },
     methods:{
       //初始化
       initialize(){
+        this.$set(this,'infoData',this.propsData);
+        this.$set(this.infoDataForm,'noticeId',this.propsData.noticeId);
       },
       // 返回按钮
       backPage(){

+ 26 - 9
src/views/chemicalManage/inventoryManagement/savePending/addPage.vue

@@ -39,8 +39,8 @@
           </div>
         </div>
         <div class="form-item-box">
-          <el-form-item label="用途:" prop="data5" label-width="80px">
-            <el-input v-model="newData.applyReason" placeholder="请输入用途" maxLength="100" style="width:348px;"></el-input>
+          <el-form-item label="归属人:" prop="applyUserId" label-width="80px">
+            <el-input v-model="newData.applyUserAll" placeholder="请输入归属人" maxLength="20" style="width:350px;"></el-input>
           </el-form-item>
           <div class="form-item-text-box">
             <p>非管控液体已存储量:</p>
@@ -52,9 +52,10 @@
           </div>
         </div>
         <div class="form-item-box">
-          <el-form-item label="归属人:" prop="applyUserId" label-width="80px">
-            <el-input v-model="newData.applyUserAll" placeholder="请输入归属人" maxLength="20" style="width:350px;"></el-input>
+          <el-form-item label="用途:" prop="data5" label-width="80px">
+            <el-input v-model="newData.applyReason" placeholder="请输入用途" maxLength="100" style="width:348px;"></el-input>
           </el-form-item>
+
           <div class="form-check-max-box">
             <div class="form-check-box" @click="checkButton">
               <div class="form-check" :class="newData.data3?'form-check-a':''">
@@ -164,7 +165,7 @@
                 </el-input-number>
               </template>
             </el-table-column>
-            <el-table-column label="操作" prop="content" width="80" show-overflow-tooltip>
+            <el-table-column label="操作" prop="content" width="80" show-overflow-tooltip v-if="!newData.waitId">
               <template slot-scope="scope">
                 <div class="table-button-box">
                   <p class="table-button-null"></p>
@@ -263,6 +264,8 @@
         },
         // 化学品列表
         chemicalsOptions:[],
+        // 化学品列表临时存储
+        chemicalsOptionsArr:[],
         // 实验室列表
         subOptions:[],
         // 人员列表
@@ -389,6 +392,9 @@
       },
       //添加化学品
       addButton(){
+        if (this.newData.hxpStockWaitModelList){
+          this.$set(this,'chemicalsOptions',this.newData.hxpStockWaitModelList);
+        }
         this.$set(this,'savePendingDialogType',true);
       },
       //关闭弹窗
@@ -400,6 +406,7 @@
         let self = this;
         let list=self.newData.hxpStockWaitModelList;
         let result=[];
+        debugger
         //每次新增时候判断一下,把新的id进行数据匹配老的数据不动
         if (self.newData.hxpStockWaitModelList[0]){
           const oldIds = self.newData.hxpStockWaitModelList.map(item => item.chemicalId)
@@ -407,11 +414,13 @@
         }else{
           result= self.dialogForm.hxpStockWaitModelList
         }
+        console.log(result)
+        console.log(self.chemicalsOptions)
         //通过化学品id获取到完成的化学品数据
         for(let i=0;i<result.length;i++) {
-          for(let b=0;b<self.chemicalsOptions.length;b++) {
-            if (result[i]==self.chemicalsOptions[b].chemicalId){
-              list.push(self.chemicalsOptions[b])
+          for(let b=0;b<self.chemicalsOptionsArr.length;b++) {
+            if (result[i]==self.chemicalsOptionsArr[b].chemicalId){
+              list.push(self.chemicalsOptionsArr[b])
             }
           }
         }
@@ -434,6 +443,14 @@
             if (!self.newData.data3){
               this.$set(this.newData,'topicGroupId','');
               this.$set(this.newData,'topicGroupName','');
+              this.$set(this.newData,'topicUserName','');
+              this.$set(this.newData,'topicUserPhone','');
+            }
+            for (let i=0;i<self.newData.hxpStockWaitModelList.length;i++){
+              if (!self.newData.hxpStockWaitModelList[i].normsNum || !self.newData.hxpStockWaitModelList[i].normsUnit || !self.newData.hxpStockWaitModelList[i].applyUnit || !self.newData.hxpStockWaitModelList[i].applyNum){
+                self.msgError('请输入['+self.newData.hxpStockWaitModelList[i].chemicalName+']规格/单位/数量!')
+                return
+              }
             }
             if (this.newData.waitId){//保存/编辑
               chemicalStockWaitUpdate(self.newData).then( response => {
@@ -514,13 +531,13 @@
       //选中化学品
       chemicalsChange(val){
         let self = this;
-
       },
       //搜索化学品
       chemicalsSelectList(query){
         if (query !== '' && query.length>1) {
           chemicalChemicalGetList({"searchValue":query}).then(response => {
             this.$set(this,'chemicalsOptions',response.data);
+            this.chemicalsOptionsArr=[...this.chemicalsOptionsArr,...response.data]
           });
 
         } else {

+ 7 - 3
src/views/chemicalManage/inventoryManagement/savePending/index.vue

@@ -19,6 +19,7 @@
           </el-form-item>
           <el-form-item label="" prop="floorId">
             <el-cascader
+              style="width: 140px"
               placeholder="请选择楼栋楼层"
               :props="{value: 'id', label: 'name',children:'buildFloorVoList',checkStrictly: true}"
               v-model="queryParams.buildIdAndfloorId"
@@ -52,7 +53,7 @@
               :clearable="false"
               v-model="dateRange"
               size="small"
-              style="width: 180px"
+              style="width: 220px"
               value-format="yyyy-MM-dd"
               type="daterange"
               range-separator="-"
@@ -65,7 +66,7 @@
               maxLength="30"
               v-model="queryParams.searchValue"
               placeholder="化学品名/CAS/编码/实验室/房间号..."
-              style="width: 200px"
+              style="width: 260px"
             />
           </el-form-item>
           <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
@@ -131,7 +132,8 @@
           </el-table-column>
           <el-table-column label="安全员" prop="oneSafeName" width="150" show-overflow-tooltip>
             <template slot-scope="scope">
-              <span>{{scope.row.oneSafeName}}-{{scope.row.oneSafePhone}} {{scope.row.twoSafeName}}-{{scope.row.twoSafePhone}}</span>
+              <span v-if="scope.row.oneSafeName">{{scope.row.oneSafeName}}-{{scope.row.oneSafePhone}}</span>
+              <span v-if="scope.row.twoSafeName">{{scope.row.twoSafeName}}-{{scope.row.twoSafePhone}}</span>
             </template>
           </el-table-column>
           <el-table-column label="入库期限" prop="createTime" width="200" show-overflow-tooltip>
@@ -148,10 +150,12 @@
                    @click="tableButton(2,scope.row)"
                 >详情</p>
                 <p class="table-button-p"
+                   v-if="scope.row.source==2 || scope.row.source==3"
                    v-hasPermiRouter="['stock:wait:edit']"
                    @click="tableButton(3,scope.row)"
                 >编辑</p>
                 <p class="table-button-p"
+                   v-if="scope.row.source==2 || scope.row.source==3"
                    v-hasPermiRouter="['stock:wait:del']"
                    @click="tableButton(4,scope.row)"
                 >删除</p>

+ 1 - 1
src/views/chemicalManage/purchaseManage/examineProcess/index.vue

@@ -297,7 +297,7 @@ import { chemicalAuditConfigAdd, chemicalAuditConfigGetConfigList } from '@/api/
       },
       //清除已选中人员
       clearEserListRight(){
-        this.userListLeft=[...this.userListLeft,...this.userListRight]
+
         this.userListRight=[]
       },
       //添加流程

+ 1 - 2
src/views/chemicalManage/purchaseManage/purchaseExamine/index.vue

@@ -83,12 +83,11 @@
                 <p class="table-button-p"
                    @click="tableButton(2,scope.row)"
                    v-hasPermiRouter="['apply:audit:detail']"
-                   v-if="!scope.row.auditFlag"
                 >详情</p>
                 <p class="table-button-p"
                    @click="tableButton(3,scope.row)"
                    v-hasPermiRouter="['apply:audit:edit']"
-                   v-if="scope.row.auditFlag"
+                   v-if="scope.row.auditFlag && scope.row.applyStatus==4"
                 >审核</p>
                 <p class="table-button-null"></p>
               </div>

+ 1 - 1
src/views/chemicalManage/purchaseManage/purchaseExamine/infoPage.vue

@@ -107,7 +107,7 @@
           <el-table-column label="审核节点" prop="auditNode" width="150" show-overflow-tooltip/>
           <el-table-column label="状态" prop="applyStatusStr" width="150" show-overflow-tooltip>
             <template slot-scope="scope">
-              <span class="auditStatusColor-A" v-if="scope.row.nodeStatus==0">{{scope.row.applyStatusStr}}</span>
+              <span class="auditStatusColor-A" v-if="scope.row.nodeStatus==0 || scope.row.nodeStatus==3">{{scope.row.applyStatusStr}}</span>
               <span class="auditStatusColor-B" v-if="scope.row.nodeStatus==1">{{scope.row.applyStatusStr}}</span>
               <span class="auditStatusColor-C" v-if="scope.row.nodeStatus==2">{{scope.row.applyStatusStr}}</span>
             </template>

+ 11 - 5
src/views/chemicalManage/purchaseManage/purchaseRegister/addPage.vue

@@ -3,7 +3,7 @@
     <div class="page-top-title-box">
       <p class="page-top-title-name-p">{{newData.id?'编辑':'申购'}}</p>
       <p class="page-top-title-out-p" @click="backPage">返回</p>
-      <p class="page-top-title-save-p" v-if="newData.applyStatus !=3 || newData.applyStatus !=6" @click="submitForm(2)">保存</p>
+      <p class="page-top-title-save-p" v-if="newData.applyStatus ==2 || newData.applyStatus ==4" @click="submitForm(2)">保存</p>
       <p class="page-top-title-submit-p" @click="submitForm(1)">提交</p>
     </div>
     <div class="content-box scrollbar-box">
@@ -185,7 +185,7 @@
             <el-table-column label="审核节点" prop="auditNode" width="150" show-overflow-tooltip/>
             <el-table-column label="状态" prop="applyStatusStr" width="150" show-overflow-tooltip>
               <template slot-scope="scope">
-                <span class="auditStatusColor-A" v-if="scope.row.nodeStatus==0">{{scope.row.applyStatusStr}}</span>
+                <span class="auditStatusColor-A" v-if="scope.row.nodeStatus==0 || scope.row.nodeStatus==3">{{scope.row.applyStatusStr}}</span>
                 <span class="auditStatusColor-B" v-if="scope.row.nodeStatus==1">{{scope.row.applyStatusStr}}</span>
                 <span class="auditStatusColor-C" v-if="scope.row.nodeStatus==2">{{scope.row.applyStatusStr}}</span>
               </template>
@@ -282,6 +282,8 @@
         },
         // 化学品列表
         chemicalsOptions:[],
+        // 化学品列表临时存储
+        chemicalsOptionsArr:[],
         // 实验室列表
         subOptions:[],
         // 人员列表
@@ -390,6 +392,9 @@
       },
       //添加化学品
       addButton(){
+        if (this.newData.hxpApplyDetailModelList){
+          this.$set(this,'chemicalsOptions',this.newData.hxpApplyDetailModelList);
+        }
         this.$set(this,'savePendingDialogType',true);
       },
       //关闭弹窗
@@ -410,9 +415,9 @@
         }
         //通过化学品id获取到完成的化学品数据
         for(let i=0;i<result.length;i++) {
-          for(let b=0;b<self.chemicalsOptions.length;b++) {
-            if (result[i]==self.chemicalsOptions[b].chemicalId){
-              list.push(self.chemicalsOptions[b])
+          for(let b=0;b<self.chemicalsOptionsArr.length;b++) {
+            if (result[i]==self.chemicalsOptionsArr[b].chemicalId){
+              list.push(self.chemicalsOptionsArr[b])
             }
           }
         }
@@ -551,6 +556,7 @@
         if (query !== '' && query.length>1) {
           chemicalChemicalGetList({"searchValue":query}).then(response => {
             this.$set(this,'chemicalsOptions',response.data);
+            this.chemicalsOptionsArr=[...this.chemicalsOptionsArr,...response.data]
           });
 
         } else {

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

@@ -98,7 +98,7 @@
           <el-table-column label="审核节点" prop="auditNode" width="150" show-overflow-tooltip/>
           <el-table-column label="状态" prop="applyStatusStr" width="150" show-overflow-tooltip>
             <template slot-scope="scope">
-              <span class="auditStatusColor-A" v-if="scope.row.nodeStatus==0">{{scope.row.applyStatusStr}}</span>
+              <span class="auditStatusColor-A" v-if="scope.row.nodeStatus==0 || scope.row.nodeStatus==3">{{scope.row.applyStatusStr}}</span>
               <span class="auditStatusColor-B" v-if="scope.row.nodeStatus==1">{{scope.row.applyStatusStr}}</span>
               <span class="auditStatusColor-C" v-if="scope.row.nodeStatus==2">{{scope.row.applyStatusStr}}</span>
             </template>