Browse Source

更改门禁管理

sunyanqiang 2 years ago
parent
commit
ed5a625a65

+ 3 - 3
src/views/access/Renaccess/index.vue

@@ -53,7 +53,7 @@
             </template>
           </el-table-column>
           <!-- <el-table-column label="编号" align="center" prop="pin" width="50" /> -->
-          <el-table-column label="姓名" align="center" prop="name" width="" />
+          <el-table-column label="姓名" align="center" prop="ename"/>
           <el-table-column
             label="时间"
             align="center"
@@ -79,7 +79,7 @@
           </template>
         </el-table-column>
         <!-- <el-table-column label="编号" align="center" prop="pin" /> -->
-        <el-table-column label="姓名" align="center" prop="name" />
+        <el-table-column label="姓名" align="center" prop="ename" />
         <el-table-column
           label="时间"
           align="center"
@@ -244,7 +244,7 @@ export default {
     },
     // 获取列表
     getList(starttime, endtime, number) {
-      this.loading = true;
+      this.loading = false;
       axios
         .post(
           `http://${this.ipDi}/api/v2/transaction/get/?key=2633p84hnnlavzcy9afjcbtj1jdnega0ftscjkka6h7a`,

+ 58 - 40
src/views/access/accessControl/index.vue

@@ -7,12 +7,12 @@
       v-show="showSearch"
       label-width="68px"
     >
-    <el-form-item prop="ename">
-      <el-input
-        v-model="queryParams.ename"
-        placeholder="请输入名字"
-      ></el-input>
-    </el-form-item>
+      <el-form-item prop="ename">
+        <el-input
+          v-model="queryParams.ename"
+          placeholder="请输入名字"
+        ></el-input>
+      </el-form-item>
       <el-form-item prop="starttime">
         <el-date-picker
           clearable
@@ -35,6 +35,17 @@
         >
         </el-date-picker>
       </el-form-item>
+      <el-form-item prop="sn">
+        <el-select v-model="queryParams.sn" placeholder="请选择编号" clearable>
+          <el-option
+            v-for="item in snList"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item>
         <el-button size="btr" @click="handleQuery">搜索</el-button>
         <el-button size="btr" @click="resetQuery">重置</el-button>
@@ -76,26 +87,21 @@
       /> -->
       <el-table-column label="时间" align="center" prop="checktime">
       </el-table-column>
-      <el-table-column label="设备编号" align="center" prop="sn" />
-      <!-- <el-table-column
-        label="操作"
-        align="center"
-        class-name="small-padding fixed-width"
-        width="200"
-      >
+      <el-table-column label="设备编号" align="center" prop="sn">
         <template slot-scope="scope">
-          <el-button
-            size="btk"
-            type="text"
-            @click="handleChakan(scope.row)"
-            v-hasPermi="['grassrootsregistration:bdgldiary:edit']"
-            ><span class="chakan">查看</span></el-button
-          >
+          <span v-if="scope.row.sn == 'COIV223360001'">#19</span>
+          <!-- <span v-if="scope.row.sn=='COIV223360001'">#19</span>
+          <span v-if="scope.row.sn=='COIV223360001'">#19</span> -->
         </template>
-      </el-table-column> -->
+      </el-table-column>
     </el-table>
-    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
-      @pagination="getToat" />
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getToat"
+    />
   </div>
 </template>
 
@@ -119,17 +125,22 @@ export default {
       // 总条数
       total: 0,
       forms: {},
+      snList: [{ id: "COIV223360001", name: "#19" }],
     };
   },
   created() {
-    this.getTiem()
+    this.getTiem();
   },
   methods: {
-    getToat(){
-      if(this.queryParams.starttime&&this.queryParams.endtime){
-        this.getList(this.queryParams.starttime,this.queryParams.endtime,this.queryParams.ename);
-      }else{
-        this.getTiem()
+    getToat() {
+      if (this.queryParams.starttime && this.queryParams.endtime) {
+        this.getList(
+          this.queryParams.starttime,
+          this.queryParams.endtime,
+          this.queryParams.ename
+        );
+      } else {
+        this.getTiem();
       }
     },
     // 导出操作
@@ -161,12 +172,17 @@ export default {
         new Date(firstDay).toISOString().slice(0, 10) + " " + "00:00:00";
       var endtimes =
         new Date(lastDay).toISOString().slice(0, 10) + " " + "23:50:00";
-        this.getList(starttimes,endtimes);
+      this.getList(starttimes, endtimes);
     },
 
     handleQuery() {
-      if(this.queryParams.starttime&&this.queryParams.endtime){
-        this.getList(this.queryParams.starttime,this.queryParams.endtime,this.queryParams.ename);
+      if (this.queryParams.starttime && this.queryParams.endtime) {
+        this.getList(
+          this.queryParams.starttime,
+          this.queryParams.endtime,
+          this.queryParams.ename,
+          this.queryParams.sn
+        );
       }
     },
     // 重置
@@ -178,19 +194,21 @@ export default {
       this.queryParams.ename = "";
       this.getTiem();
     },
-    getList(starttimes,endtimes,name,) {
+    getList(starttimes, endtimes, name, sn) {
       this.loading = true;
       var formes = {};
-      formes.starttime=starttimes;
-      formes.endtime= endtimes;
-      formes.ename= name;
-      formes.pageNum= this.queryParams.pageNum;
-      formes.pageSize= this.queryParams.pageSize;
-      console.log(formes);
+      formes.startTime = starttimes;
+      formes.endTime = endtimes;
+      formes.endtime = starttimes;
+      formes.starttime = endtimes;
+      formes.ename = name;
+      formes.sn = sn;
+      formes.pageNum = this.queryParams.pageNum;
+      formes.pageSize = this.queryParams.pageSize;
       attendancerecordList(formes).then((res) => {
         this.loading = false;
         this.bdglevenList = res.rows;
-        this.total=res.total
+        this.total = res.total;
       });
       // axios
       //   .post(

+ 3 - 3
src/views/access/renInformation/index.vue

@@ -71,13 +71,13 @@
       </el-table-column>
     </el-table>
 
-    <pagination
+    <!-- <pagination
       v-show="total > 0"
       :total="total"
       :page.sync="queryParams.pageNum"
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
-    />
+    /> -->
   </div>
 </template>
   <script>
@@ -176,7 +176,7 @@ export default {
       this.ipDi=null;
     },
     getList(number) {
-      this.loading = true;
+      this.loading = false;
       axios
         .post(
           `http://${this.ipDi}/api/v2/employee/get/?key=2633p84hnnlavzcy9afjcbtj1jdnega0ftscjkka6h7a`,