Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

billisme 4 éve
szülő
commit
e4460fd84f

+ 17 - 0
src/api/enterprise/staff.js

@@ -48,3 +48,20 @@ export const update = (row) => {
   })
 }
 
+export const pushUserFace = (row) => {
+  return request({
+    url: '/api/cyzh-enterprise/staff/pushUserFace',
+    method: 'post',
+    data: row
+  })
+}
+
+export const pushUserFaceBatch = (ids) => {
+  return request({
+    url: '/api/cyzh-enterprise/staff/pushUserFaceBatch',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}

+ 156 - 0
src/components/staff/review-staff.vue

@@ -0,0 +1,156 @@
+<template>
+  <basic-container>
+    <avue-form :option="option" v-model="reviewDetail">
+      <template slot-scope="scope" slot="face">
+        <el-image :src="reviewDetail.face" style="width:180px; height:180px" alt="" :preview-src-list="reviewDetail.face"></el-image>
+      </template>
+      <template slot-scope="scope" slot="sex">
+        <!--<span>{{reviewDetail.$sex}}</span>-->
+        <el-input placeholder="未选择性别" :disabled="true" v-model="reviewDetail.$sex"></el-input>
+      </template>
+    </avue-form>
+     <div>
+       <el-row>
+         <el-col span="24" align="right">
+           <el-button type="warning" icon="el-icon-edit" size="small" @click="reviewauditStatus(0)">待审核</el-button>
+           <el-button type="primary" icon="el-icon-check" size="small" @click="reviewauditStatus(1)">通过</el-button>
+           <el-button type="info" icon="el-icon-delete" size="small" @click="reviewauditStatus(2)">不通过</el-button>
+         </el-col>
+       </el-row>
+     </div>
+  </basic-container>
+</template>
+
+<script>
+  import {getList, getDetail, add, update, remove} from "@/api/enterprise/staff";
+  export default {
+    props: {
+      reviewDetail: {},
+      url: '',
+      reviewVisible: ''
+    },
+    data() {
+      return {
+        option:{
+          menuBtn: false,
+          group:[
+            {
+              icon:'el-icon-user',
+              label: '个人信息认证',
+              // collapse:false,
+              prop: 'group1',
+              column: [{
+                label: '姓名',
+                prop: 'realName',
+                placeholder: "未提交姓名",
+                readonly: true
+                // disabled: true
+              },{
+                label: '性别',
+                prop: 'sex',
+                placeholder: "未选择性别",
+                formslot: true,
+                readonly: true,
+                // disabled: true
+              },{
+                label: '身份证号',
+                prop: 'idcard',
+                placeholder: "未输入有效的身份证号",
+                readonly: true
+                // disabled: true
+              },{
+                label: '手机号',
+                prop: 'phone',
+                placeholder: "未输入有效的手机号",
+                readonly: true
+                // disabled: true
+              },{
+                label: '脸部信息',
+                prop: 'face',
+                type: 'upload',
+                listType: 'picture-img',
+                // listType: 'picture-card',
+                // alone: true,
+                formslot: true,
+                // placeholder: "未采集脸部信息",
+                // readonly: true
+                disabled: true
+              }]
+            },{
+              icon:'el-icon-office-building',
+              label: '企业信息认证',
+              // arrow:false,
+              prop: 'group2',
+              column: [{
+                label: '公司园区',
+                prop: 'agencyName',
+                placeholder: "未选择公司园区",
+                readonly: true
+              },{
+                label: '园区区域',
+                prop: 'residentialName',
+                placeholder: "未选择园区区域",
+                readonly: true
+              },{
+                label: '所属企业',
+                prop: 'enterpriseName',
+                placeholder: "未输入企业名称",
+                readonly: true
+              }]
+            },{
+              icon:'el-icon-chat-line-square',
+              label: '其他信息',
+              // arrow:false,
+              prop: 'group2',
+              column: [{
+                label: '备注',
+                prop: 'remarks',
+                type: "textarea",
+                maxRows: 4,
+                minRows: 2
+              }]
+            }
+          ]
+        }
+      }
+    },
+    methods: {
+      reviewauditStatus(auditStatus, loading ){
+        this.reviewDetail.auditStatus = auditStatus;
+
+        update(this.reviewDetail).then(() => {
+          this.reviewVisible = false;
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          this.$emit('visibleemit', this.reviewVisible);
+          // done();
+        }, error => {
+          this.$message({
+            type: "error",
+            message: "操作失败!"
+          })
+          loading();
+          console.log(error);
+        });
+
+
+        // this.$emit('reviewemit', this.reviewDetail);
+      }
+
+    }
+  }
+
+</script>
+
+<style scoped>
+
+</style>
+
+
+
+
+
+
+

+ 66 - 0
src/components/staff/staffDetail.vue

@@ -0,0 +1,66 @@
+<template>
+  <basic-container>
+    <avue-detail :option="option" v-model="detailForm">
+    </avue-detail>
+  </basic-container>
+</template>
+
+<script>
+  export default {
+    props: {
+      detailForm: {},
+    },
+    data() {
+      return {
+        option:{
+          group:[
+            {
+              icon:'el-icon-user',
+              label: '个人信息',
+              prop: 'group1',
+              column: [{
+                label: '姓名',
+                prop: 'realName',
+                span: 12
+              },{
+                label: '性别',
+                prop: 'gender',
+                span: 12
+              },{
+                label: '身份证号',
+                prop: 'idcard',
+                span: 12
+              },{
+                label: '手机号',
+                prop: 'phone',
+                span: 12
+              }]
+            },{
+              icon:'el-icon-office-building',
+              label: '企业信息',
+              prop: 'group2',
+              column: [{
+                label: '公司园区',
+                prop: 'agencyName',
+                span: 12
+              },{
+                label: '园区区域',
+                prop: 'residentialName',
+              },{
+                label: '所属企业',
+                prop: 'enterpriseName',
+                span: 12
+              }]
+            }
+          ]
+        }
+      }
+    }
+  }
+
+</script>
+
+<style scoped>
+
+</style>
+

+ 98 - 1
src/views/enterprise/staff.vue

@@ -26,27 +26,82 @@
                    v-if="permission.staff_delete"
                    @click="handleDelete">删 除
         </el-button>
+        <cy-excel-import :flag="3" file-name="员工信息导入模板" @success="onLoad(page)"></cy-excel-import>
+        <el-button type="success"
+                   size="small"
+                   icon="el-icon-sort-down"
+                   plain
+                   @click="handleBatchPushUserFace">批量下发人脸
+        </el-button>
       </template>
+
+      <template slot="menu" slot-scope="scope">
+        <el-button type="text" size="small" icon="el-icon-setting">
+          <el-dropdown>
+            <span class="el-dropdown-link">
+              操作<i class="el-icon-arrow-down el-icon--right"></i>
+            </span>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item divided v-if="permission.staff_view" @click.native="detail(scope.row)" icon="el-icon-view">查看
+              </el-dropdown-item>
+              <el-dropdown-item divided v-if="permission.staff_edit" @click.native="edit(scope.row)" icon="el-icon-edit">编辑
+              </el-dropdown-item>
+              <el-dropdown-item style="color: limegreen" divided v-if="!!scope.row.face && scope.row.auditStatus == 1" @click.native="pushUserFaceToDevice(scope.row)" icon="el-icon-sort-down">人脸下发
+              </el-dropdown-item>
+              <el-dropdown-item divided icon="el-icon-s-order" @click.native="reviewHandler(scope.row)" :class=" [scope.row.auditStatus === 0 ? '' : 'recheck']">{{scope.row.auditStatus===0?'审核':'重审'}}</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+        </el-button>
+        <!--<el-button icon="el-icon-s-order" type="text" @click="reviewHandler(scope.row)">审核</el-button>-->
+      </template>
+
       <template slot="auditStatus" slot-scope="scope">
         <el-tag v-if="scope.row.auditStatus===0" type="info">待审核</el-tag>
         <el-tag v-if="scope.row.auditStatus===1" type="success">审核通过</el-tag>
         <el-tag v-if="scope.row.auditStatus===2" type="danger">审核不通过</el-tag>
       </template>
     </avue-crud>
+
+    <el-dialog :modal-append-to-body="false" title = "员工信息审核" :visible.sync = "reviewVisible" width="60%"
+               :close-on-click-modal="false" >
+      <review-staff :reviewDetail="reviewDetail" @visibleemit="visibleUpdate"></review-staff>
+    </el-dialog>
+
+    <el-dialog :append-to-body="true" :close-on-click-modal="false" :modal-append-to-body="false" :visible.sync="editVisible"
+               title="编辑" width="60%">
+      <avue-form v-model="editForm" :option="option" @submit="submitEnterprisestaff"></avue-form>
+    </el-dialog>
+
+    <el-dialog :append-to-body="true" :close-on-click-modal="false" :modal-append-to-body="false" :visible.sync="detailVisible"
+               title="详情" width="60%">
+      <staff-detail :detailForm="detailForm"></staff-detail>
+      <!--<avue-detail :option="option" v-model="detailForm"></avue-detail>-->
+    </el-dialog>
+
   </basic-container>
 </template>
 
 <script>
-  import {getList, getDetail, add, update, remove} from "@/api/enterprise/staff";
+  import {getList, getDetail, add, update, remove, pushUserFace, pushUserFaceBatch} from "@/api/enterprise/staff";
   import {mapGetters} from "vuex";
   import {validatedEmail, validatePhone} from "../../util/validator";
+  import StaffDetail from "../../components/staff/staffDetail";
+  import ReviewStaff from "../../components/staff/review-staff";
 
   export default {
+    components: {ReviewStaff, StaffDetail},
     data() {
       return {
         form: {},
         query: {},
         loading: true,
+        reviewVisible: false,
+        reviewDetail: {},
+        editVisible: false,
+        editForm: {},
+        detailVisible: false,
+        detailForm: {},
+        forbidden: false,
         page: {
           pageSize: 10,
           currentPage: 1,
@@ -458,6 +513,48 @@
       }
     },
     methods: {
+      handleBatchPushUserFace() {
+        if (this.selectionList.length === 0) {
+          this.$message.warning("请选择至少一条数据");
+          return;
+        }
+        pushUserFaceBatch(this.ids).then(() => {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+        })
+      },
+      visibleUpdate(data) {
+        this.reviewVisible = data;
+        this.onLoad(this.page);
+      },
+      detail(row) {
+        this.detailForm = row;
+        this.detailForm['gender'] = row.$sex;
+        this.detailVisible = true;
+      },
+      edit(row) {
+        this.editForm = row;
+        this.editVisible = true;
+      },
+      pushUserFaceToDevice(row){
+        //下发人脸到测温系统和设备
+        pushUserFace(row).then(res => {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+        })
+
+      },
+      reviewHandler(row) {
+        debugger
+        this.reviewDetail = row;
+        this.reviewVisible = true;
+        // debugger
+        this.url = row.face;
+      },
       rowSave(row, done, loading) {
         if(row.$enterpriseId){
           row.enterpriseName = row.$enterpriseId;