dedsudiyu 1 год назад
Родитель
Сommit
b6ffb9cb76

+ 10 - 2
src/api/chemicalManage/index.js

@@ -185,13 +185,21 @@ export function chemicalCabinetGetDoorList(query) {
   })
 }
 //化学品柜-业务类型下拉列表
-export function chemicalCabinetLockTypeList(query) {
+export function chemicalLockLogLockTypeList(query) {
   return request({
-    url: '/chemical/cabinet/lockTypeList',
+    url: '/chemical/lockLog/lockTypeList',
     method: 'get',
     params: query
   })
 }
+//化学品柜-开门记录
+export function chemicalLockLogLockList(data) {
+  return request({
+    url: '/chemical/lockLog/list',
+    method: 'post',
+    data: data
+  })
+}
 //化学品柜-化学品-列表
 export function chemicalStockStockUse(data) {
   return request({

+ 69 - 61
src/views/chemicalManage/basicManagement/chemicalsCabinetManage/infoPage.vue

@@ -14,7 +14,7 @@
              v-for="(item,index) in leftDataList" :key="index">
           <div class="for-title-box">
             <p>{{item.doorName}}</p>
-            <p>{{item.openOrClose?'已开启':'已关闭'}}</p>
+            <p :class="item.openOrClose?'open-p':''">{{item.openOrClose?'已开启':'已关闭'}}</p>
           </div>
           <div class="for-num-box">
             <p>化学品数量:{{item.stockNum}}</p>
@@ -41,21 +41,21 @@
                 end-placeholder="开门时间"
               ></el-date-picker>
             </el-form-item>
-            <el-form-item label="" prop="state">
-              <el-date-picker
-                :clearable="false"
-                v-model="dateRangeB"
-                size="small"
-                style="width: 215px"
-                value-format="yyyy-MM-dd"
-                type="daterange"
-                range-separator="-"
-                start-placeholder="关门时间"
-                end-placeholder="关门时间"
-              ></el-date-picker>
-            </el-form-item>
-            <el-form-item label="" prop="queryParamsData2">
-              <el-select v-model="queryParams.queryParamsData2" placeholder="请选择业务类型" style="width: 160px">
+            <!--<el-form-item label="" prop="state">-->
+              <!--<el-date-picker-->
+                <!--:clearable="false"-->
+                <!--v-model="dateRangeB"-->
+                <!--size="small"-->
+                <!--style="width: 215px"-->
+                <!--value-format="yyyy-MM-dd"-->
+                <!--type="daterange"-->
+                <!--range-separator="-"-->
+                <!--start-placeholder="关门时间"-->
+                <!--end-placeholder="关门时间"-->
+              <!--&gt;</el-date-picker>-->
+            <!--</el-form-item>-->
+            <el-form-item label="" prop="operationType">
+              <el-select v-model="queryParams.operationType" placeholder="请选择业务类型" style="width: 160px">
                 <el-option
                   v-for="item in lockTypeList"
                   :key="item.type"
@@ -64,15 +64,14 @@
                 />
               </el-select>
             </el-form-item>
-            <el-form-item label="" prop="queryParamsData2">
-              <el-select v-model="queryParams.queryParamsData2" placeholder="请选择认证方式" style="width: 160px">
-                <el-option
-                  v-for="item in optionsB"
-                  :key="item.type"
-                  :label="item.typeName"
-                  :value="item.type"
-                />
-              </el-select>
+            <el-form-item label="" prop="searchValue">
+              <el-input
+                maxlength="10"
+                v-model="queryParams.searchValue"
+                placeholder="操作人/双人认证"
+                clearable
+                style="width:215px;"
+              />
             </el-form-item>
             <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
             <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
@@ -80,13 +79,25 @@
         </div>
         <div class="page-content-box">
           <el-table class="table-box" border :data="dataList">
-            <el-table-column label="开门时间" prop="name" show-overflow-tooltip/>
-            <el-table-column label="关门时间" prop="content" width="180" show-overflow-tooltip/>
-            <el-table-column label="开门时长" prop="content" width="120" show-overflow-tooltip/>
-            <el-table-column label="业务类型" prop="content" width="120" show-overflow-tooltip/>
-            <el-table-column label="操作人" prop="content" width="100" show-overflow-tooltip/>
-            <el-table-column label="双人认证" prop="content" width="180" show-overflow-tooltip/>
-            <el-table-column label="返回结果" prop="content" width="150" show-overflow-tooltip/>
+            <el-table-column label="开门时间" prop="name" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <span>{{ parseTime(scope.row.openTime,"{y}-{m}-{d} {h}:{i}") }}</span>
+              </template>
+            </el-table-column>
+            <!--<el-table-column label="关门时间" prop="content" width="180" show-overflow-tooltip/>-->
+            <!--<el-table-column label="开门时长" prop="content" width="120" show-overflow-tooltip/>-->
+            <el-table-column label="业务类型" prop="operationTypeStr" width="120" show-overflow-tooltip/>
+            <el-table-column label="操作人" prop="createByName" width="140" show-overflow-tooltip/>
+            <el-table-column label="双人认证" prop="content" width="180" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <span>{{ scope.row.oneUserName}} - {{ scope.row.twoUserName}}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="返回结果" prop="isSuccessOpen" width="150" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <span>{{ scope.row.isSuccessOpen?'开门成功':(!scope.row.isSuccessOpen?'开门失败':'--')}}</span>
+              </template>
+            </el-table-column>
           </el-table>
           <pagination :page-sizes="[20, 30, 40, 50]"
                       v-show="total>0"
@@ -102,7 +113,7 @@
 </template>
 
 <script>
-  import { chemicalCabinetGetDoorList,chemicalCabinetLockTypeList } from '@/api/chemicalManage'
+  import { chemicalCabinetGetDoorList,chemicalLockLogLockTypeList,chemicalLockLogLockList } from '@/api/chemicalManage'
   export default {
     name: 'infoPage',
     props:{
@@ -119,17 +130,15 @@
         queryParams:{
           page:1,
           pageSize:20,
-          queryParamsData1 :null,
-          queryParamsData2 :null,
+          operationType :null,
+          searchValue :null,
         },
         //时间数据
         dateRangeA:[],
         //时间数据
         dateRangeB:[],
         //列表数据
-        dataList:[
-          {name:"1"},
-        ],
+        dataList:[],
         //数据数量
         total:0,
       }
@@ -149,7 +158,7 @@
             this.getList();
           }
         });
-        chemicalCabinetLockTypeList({}).then(response => {
+        chemicalLockLogLockTypeList({}).then(response => {
           this.$set(this,'lockTypeList',response.data);
         });
       },
@@ -157,7 +166,7 @@
       leftCheck(index){
         if (this.checkType != index){
           this.$set(this,'checkType',index);
-          this.getList();
+          this.resetQuery();
         }
       },
       //查询按钮
@@ -172,29 +181,30 @@
         this.$set(this,'queryParams',{
           page:1,
           pageSize:20,
-          queryParamsData1 :null,
-          queryParamsData2 :null,
+          operationType :null,
+          searchValue :null,
         });
         this.getList();
       },
       //获取数据列表
       getList(){
         let obj = JSON.parse(JSON.stringify(this.queryParams))
+        obj.doorId = this.leftDataList[this.checkType].doorId
         if(this.dateRangeA[0]){
-          obj.startTimeA = this.dateRangeA[0]+'T00:00:00'
-          obj.endTimeA = this.dateRangeA[1]+'T23:59:59'
-        }else{
-          obj.startTimeA = "";
-          obj.endTimeA = "";
-        }
-        if(this.dateRangeB[0]){
-          obj.startTimeB = this.dateRangeB[0]+'T00:00:00'
-          obj.endTimeB = this.dateRangeB[1]+'T23:59:59'
+          obj.openTime = this.dateRangeA[0]+'T00:00:00'
+          obj.openEndTime = this.dateRangeA[1]+'T23:59:59'
         }else{
-          obj.startTimeB = "";
-          obj.endTimeB = "";
+          obj.openTime = "";
+          obj.openEndTime = "";
         }
-        getListFunction(obj).then(response => {
+        // if(this.dateRangeB[0]){
+        //   obj.startTimeB = this.dateRangeB[0]+'T00:00:00'
+        //   obj.endTimeB = this.dateRangeB[1]+'T23:59:59'
+        // }else{
+        //   obj.startTimeB = "";
+        //   obj.endTimeB = "";
+        // }
+        chemicalLockLogLockList(obj).then(response => {
           this.$set(this,'dataList',response.data.records);
           this.$set(this,'total',response.data.total);
         });
@@ -233,12 +243,6 @@
         border-right:1px dashed #dedede;
         .for-left-check-box{
           background: rgba(1,131,250,0.2)!important;
-          .for-title-box{
-            p:nth-child(2){
-              border:1px solid #0183FA!important;;
-              color:#0183FA!important;;
-            }
-          }
         }
         .for-left-max-box{
           cursor: pointer;
@@ -263,9 +267,13 @@
               text-align: center;
               font-size:12px;
               border-radius:6px;
-              border:1px solid #E0E0E0;
+              border:1px solid #666;
               color:#666;
             }
+            .open-p{
+              border:1px solid #0183FA!important;;
+              color:#0183FA!important;;
+            }
           }
           .for-num-box{
             padding:0 15px;