|
@@ -90,8 +90,16 @@
|
|
|
plain
|
|
|
icon="el-icon-circle-plus"
|
|
|
:disabled="multipleSelection.length==0"
|
|
|
- @click="batchImportVisible = true"
|
|
|
+ @click="dataSync"
|
|
|
>数据同步</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ plain
|
|
|
+ icon="el-icon-circle-plus"
|
|
|
+ :disabled="multipleSelection.length==0"
|
|
|
+ @click="handleBatchEnabledFace"
|
|
|
+ >人脸授权</el-button>
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
size="small"
|
|
@@ -112,7 +120,7 @@
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
<el-table-column prop="id" label="序号" width="100"></el-table-column>
|
|
|
<el-table-column prop="companyName" label="企业" width="180"></el-table-column>
|
|
|
- <el-table-column prop="faceImageUrl" label="人员照片" width="110">
|
|
|
+ <el-table-column prop="faceImageUrl" label="人员照片" width="110" fixed="left">
|
|
|
<template slot-scope="{row}">
|
|
|
<a :href="row.faceImageUrl" target="_blank">
|
|
|
<el-avatar
|
|
@@ -123,7 +131,7 @@
|
|
|
</a>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="name" label="姓名" width="150"></el-table-column>
|
|
|
+ <el-table-column prop="name" label="姓名" width="150" fixed="left"></el-table-column>
|
|
|
<el-table-column prop="phone" label="手机号" width="180"></el-table-column>
|
|
|
<el-table-column prop="idCard" label="身份证" width="200"></el-table-column>
|
|
|
<el-table-column prop="openId" label="是否绑定公众号" width="180">
|
|
@@ -186,21 +194,29 @@
|
|
|
<el-table-column prop="position3" :label="position3" width="180"></el-table-column>
|
|
|
<el-table-column prop="position4" :label="position4" width="180"></el-table-column>
|
|
|
<el-table-column prop="position5" :label="position5" width="180"></el-table-column>-->
|
|
|
- <el-table-column label="操作" width="450" fixed="right">
|
|
|
+ <el-table-column label="操作" width="290" fixed="right">
|
|
|
<template slot-scope="{row}">
|
|
|
- <el-button size="mini" type="warning" @click="handleEdit(row)">编辑</el-button>
|
|
|
- <el-button size="mini" type="danger" @click="handleDelete(row)">删除</el-button>
|
|
|
- <el-button size="mini" type="success" @click="bindDevice(row)">绑定设备</el-button>
|
|
|
- <span v-if="row.faceBound">
|
|
|
-    
|
|
|
- <el-button size="mini" type="success" disabled="true" @click="uploadData(row)">上传数据</el-button>
|
|
|
- </span>
|
|
|
- <span v-if="!row.faceBound">
|
|
|
-    
|
|
|
- <el-button size="mini" type="success" @click="uploadData(row)">上传数据</el-button>
|
|
|
- </span>
|
|
|
-    
|
|
|
- <el-button size="mini" type="info" @click="showBound(row)">已绑定设备</el-button>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-button size="mini" type="warning" @click="handleEdit(row)">编辑</el-button>
|
|
|
+ <el-button size="mini" type="danger" @click="handleDelete(row)">删除</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-button size="mini" type="success" @click="bindDevice(row)">绑定设备</el-button>
|
|
|
+ <span v-if="row.faceBound != null && row.faceBound">
|
|
|
+    
|
|
|
+ <el-button size="mini" type="success" :disabled="true" @click="uploadData(row)">上传数据</el-button>
|
|
|
+ </span>
|
|
|
+ <span v-if="row.faceBound != null && !row.faceBound">
|
|
|
+    
|
|
|
+ <el-button size="mini" type="success" @click="uploadData(row)">上传数据</el-button>
|
|
|
+ </span>
|
|
|
+    
|
|
|
+ <el-button size="mini" type="info" @click="showBound(row)">已绑定设备</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -291,7 +307,6 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<!--批量导入E-->
|
|
|
-
|
|
|
<!-- 批量绑定设备 -->
|
|
|
<el-dialog
|
|
|
title="绑定设备"
|
|
@@ -466,7 +481,7 @@ export default {
|
|
|
},
|
|
|
handleDelete(record) {
|
|
|
var self = this;
|
|
|
-
|
|
|
+ self.loading = true;
|
|
|
self
|
|
|
.$confirm("是否确认删除?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
@@ -476,7 +491,7 @@ export default {
|
|
|
.then(() => {
|
|
|
personInfoApi.remove(record.id).then(function(response) {
|
|
|
var jsonData = response.data;
|
|
|
-
|
|
|
+ self.loading = false;
|
|
|
if (jsonData.result) {
|
|
|
// var index = self.tableData.indexOf(record);
|
|
|
// self.tableData.splice(index, 1);
|
|
@@ -488,11 +503,14 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ self.loading = false;
|
|
|
});
|
|
|
},
|
|
|
handleBatchDelete() {
|
|
|
var self = this;
|
|
|
-
|
|
|
+ self.loading = true;
|
|
|
var idList = this.multipleSelection.map(record => {
|
|
|
return record.id;
|
|
|
});
|
|
@@ -502,18 +520,23 @@ export default {
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
- personInfoApi.batchRemove(idList).then(function(response) {
|
|
|
- var jsonData = response.data;
|
|
|
-
|
|
|
- if (jsonData.result) {
|
|
|
- self.changePage(self.pageIndex);
|
|
|
+ personInfoApi
|
|
|
+ .batchRemove(idList)
|
|
|
+ .then(function(response) {
|
|
|
+ var jsonData = response.data;
|
|
|
+ self.loading = false;
|
|
|
+ if (jsonData.result) {
|
|
|
+ self.changePage(self.pageIndex);
|
|
|
|
|
|
- self.$message({
|
|
|
- type: "success",
|
|
|
- message: "删除成功!"
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+ self.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ self.loading = false;
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
onDetailModalClose(refreshed) {
|
|
@@ -625,7 +648,6 @@ export default {
|
|
|
formData.append("id", row.id);
|
|
|
if ("face" == type) {
|
|
|
personInfoApi.enabledFace(formData);
|
|
|
- row.faceBound = false;
|
|
|
} else if ("card" == type) {
|
|
|
personInfoApi.enabledCard(formData);
|
|
|
} else if ("app" == type) {
|
|
@@ -681,25 +703,29 @@ export default {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
- }).then(() => {
|
|
|
- personInfoApi.dataSync(idList).then(function(response) {
|
|
|
- var jsonData = response.data;
|
|
|
- self.loading = false;
|
|
|
- if (jsonData.result) {
|
|
|
- self.changePage(self.pageIndex);
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ personInfoApi.dataSync(idList).then(function(response) {
|
|
|
+ var jsonData = response.data;
|
|
|
+ self.loading = false;
|
|
|
+ if (jsonData.result) {
|
|
|
+ self.changePage(self.pageIndex);
|
|
|
|
|
|
- self.$message({
|
|
|
- type: "success",
|
|
|
- message: "同步成功!"
|
|
|
- });
|
|
|
- } else {
|
|
|
- self.$message({
|
|
|
- type: "warning",
|
|
|
- message: jsonData.message
|
|
|
- });
|
|
|
- }
|
|
|
+ self.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "同步成功!"
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ self.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: jsonData.message
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ self.loading = false;
|
|
|
});
|
|
|
- });
|
|
|
},
|
|
|
handleBatchBoundDevice() {
|
|
|
//批量同步人脸
|
|
@@ -740,6 +766,37 @@ export default {
|
|
|
var self = this;
|
|
|
self.batchBoundDevice = false;
|
|
|
self.boundDeviceId = "";
|
|
|
+ },
|
|
|
+ handleBatchEnabledFace() {
|
|
|
+ //批量人脸授权
|
|
|
+ var self = this;
|
|
|
+ self.loading = true;
|
|
|
+
|
|
|
+ let boundDeviceId = self.boundDeviceId;
|
|
|
+
|
|
|
+ var idList = this.multipleSelection.map(record => {
|
|
|
+ return record.id;
|
|
|
+ });
|
|
|
+ var formData = new FormData();
|
|
|
+
|
|
|
+ formData.append("ids", idList);
|
|
|
+
|
|
|
+ personInfoApi.enabledFaceList(idList).then(function(response) {
|
|
|
+ var jsonData = response.data;
|
|
|
+ self.loading = false;
|
|
|
+ if (jsonData.result) {
|
|
|
+ self.changePage(self.pageIndex);
|
|
|
+ self.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "授权成功!"
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ self.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: jsonData.message
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
async mounted() {
|