confirmationBeforeFaceBrushSubmit

This commit is contained in:
shijing 2022-04-29 11:17:01 +08:00
parent a75ea367b8
commit 7273dbc35a
5 changed files with 162 additions and 72 deletions

View File

@ -2,10 +2,10 @@
<div class="faceLoginWrap"> <div class="faceLoginWrap">
<div style="height: 500px;"> <div style="height: 500px;">
<div class="video-box"> <div class="video-box">
<video id="video" width="500" height="500" preload autoplay loop muted></video> <video id="video" width="600" preload autoplay loop muted></video>
<canvas id="canvas" width="500" height="500"></canvas> <canvas id="canvas" width="600" height="500"></canvas>
</div> </div>
<canvas id="screenshotCanvas" width="500" height="500"></canvas> <canvas id="screenshotCanvas" width="600" height="500"></canvas>
</div> </div>
</div> </div>
</template> </template>
@ -132,7 +132,7 @@
if(res.data.access){ if(res.data.access){
let item= {name:res.data.name,token:res.data.access}; let item= {name:res.data.name,token:res.data.access};
that.$emit('func',item); that.$emit('func',item);
that.$message.success("身份认证成功!"); // that.$message.success("身份认证成功!");
this.closeCamera(); this.closeCamera();
}else{ }else{
that.uploadLock = false; that.uploadLock = false;
@ -165,7 +165,6 @@
beforeDestroy() { beforeDestroy() {
let video = document.getElementById('video'); let video = document.getElementById('video');
let stream = video.srcObject; let stream = video.srcObject;
// console.log(stream);
let tracks = stream.getTracks(); let tracks = stream.getTracks();
tracks.forEach(track => { tracks.forEach(track => {
track.stop() track.stop()
@ -188,8 +187,7 @@
.video-box { .video-box {
margin: auto; margin: auto;
position: relative; position: relative;
width: 500px; width: 600px;
height: 500px;
text-align: center; text-align: center;
} }

View File

@ -365,6 +365,7 @@
//首件审批 //首件审批
handleSelectclick(scope,index){ handleSelectclick(scope,index){
let that = this; let that = this;
debugger;
this.reviewVisible = true; this.reviewVisible = true;
that.planId = scope.row.id; that.planId = scope.row.id;
that.leader_1 = scope.row.leader_1_?scope.row.leader_1_.name:null; that.leader_1 = scope.row.leader_1_?scope.row.leader_1_.name:null;
@ -479,6 +480,8 @@
that.checkParams = params; that.checkParams = params;
that.limitedUserCheck = true; that.limitedUserCheck = true;
}, },
//人脸识别获取人员信息后
checkSubmit(data){ checkSubmit(data){
let that =this; let that =this;
let id = that.checkParams.id; let id = that.checkParams.id;
@ -486,26 +489,35 @@
params.is_testok = that.checkParams.is_testok; params.is_testok = that.checkParams.is_testok;
params.record_data = that.checkParams.record_data; params.record_data = that.checkParams.record_data;
params.token = data.token; params.token = data.token;
let text = '确定以操作员'+data.name+'身份提交?';
if(data.token!==''&&data.token!==null&&data.token!==undefined) { if(data.token!==''&&data.token!==null&&data.token!==undefined) {
putTestRecordItem(id, params).then((res) => { this.$confirm(text, '提示', {
if (res.code >= 200) { confirmButtonText: '确定',
subTestRecordItem(id, params).then((res) => { cancelButtonText: '取消',
debugger; type: 'warning'
that.limitedUserCheck = false; }).then(() => {
if (res.code >= 200) { putTestRecordItem(id, params).then((res) => {
that.recordVisible = false; if (res.code >= 200) {
that.getTableData(); subTestRecordItem(id, params).then((res) => {
}else{ debugger;
that.$message.error(res.msg) that.limitedUserCheck = false;
} if (res.code >= 200) {
}).catch(()=>{ that.recordVisible = false;
that.limitedUserCheck = false; that.getTableData();
}); }else{
} else { that.$message.error(res.msg)
that.$message.error(res.msg) }
} }).catch(()=>{
}).catch((err) => { that.limitedUserCheck = false;
that.$message.error(err); });
} else {
that.$message.error(res.msg)
}
}).catch((err) => {
that.$message.error(err);
});
}).catch(() => {
that.limitedUserCheck = false;
}); });
} }
}, },

View File

@ -1544,33 +1544,40 @@
params.is_testok = that.params.is_testok; params.is_testok = that.params.is_testok;
params.record_data = that.params.record_data; params.record_data = that.params.record_data;
params.token = data.token; params.token = data.token;
let text = '确定以操作员'+data.name+'身份提交?';
if (data.token !== '' && data.token !== null && data.token !== undefined) { if (data.token !== '' && data.token !== null && data.token !== undefined) {
putTestRecordItem(id, params).then((res) => { this.$confirm(text, '提示', {
if (res.code >= 200) { confirmButtonText: '确定',
subTestRecordItem(id, params).then((res) => { cancelButtonText: '取消',
debugger; type: 'warning'
that.limitedPhoto = false; }).then(() => {
if (res.code >= 200) { that.limitedPhoto = false;
that.recordVisible = false; putTestRecordItem(id, params).then((res) => {
that.limitedReview = false; if (res.code >= 200) {
that.limitedCheckRecord = false; subTestRecordItem(id, params).then((res) => {
that.getList(); if (res.code >= 200) {
that.getList2(); that.recordVisible = false;
that.getList1(); that.limitedReview = false;
that.getList3(); that.limitedCheckRecord = false;
that.refreshRecord(); that.getList();
} else { that.getList2();
that.$message.error(res.msg) that.getList1();
} that.getList3();
}).catch(() => { that.refreshRecord();
that.limitedPhoto = false; } else {
}); that.$message.error(res.msg)
} else { }
that.$message.error(res.msg) }).catch(() => {});
} } else {
}).catch((err) => { that.$message.error(res.msg)
that.$message.error(err); }
}).catch((err) => {
that.$message.error(err);
});
}).catch(() => {
that.limitedPhoto = false;
}); });
} }
}, },

View File

@ -1220,9 +1220,10 @@
getMsgFormSon(data) { getMsgFormSon(data) {
let that = this; let that = this;
that.operationData.user = data.name; that.operationData.user = data.name;
let text = '确定以操作员'+data.name+'身份提交?';
if (data.token !== '' && data.token !== null && data.token !== undefined) { if (data.token !== '' && data.token !== null && data.token !== undefined) {
if (that.inputData == "") { if (that.inputData == "") {
that.$confirm("没有消耗物料确定提交吗?", "提示", { that.$confirm("没有消耗物料"+text, "提示", {
confirmButtonText: "确认", confirmButtonText: "确认",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "error", type: "error",
@ -1241,16 +1242,26 @@
that.limitedPhoto = false; that.limitedPhoto = false;
}); });
} else { } else {
submitOperation(that.id,{token:data.token}).then((res) => { this.$confirm(text, '提示', {
if (res.code === 200) { confirmButtonText: '确定',
that.$router.push({name: "operation"}); cancelButtonText: '取消',
that.$message.success("操作提交成功!"); type: 'warning'
}else{ }).then(() => {
that.$message.error(res.msg) that.limitedPhoto = false;
} submitOperation(that.id,{token:data.token}).then((res) => {
}).catch((err) => { if (res.code === 200) {
that.$message.error(err); that.$router.push({name: "operation"});
that.$message.success("操作提交成功!");
}else{
that.$message.error(res.msg)
}
}).catch((err) => {
that.$message.error(err);
});
}).catch(() => {
that.limitedPhoto = false;
}); });
} }
} }
}, },

View File

@ -288,16 +288,27 @@
<el-button type="primary" @click="putins"> </el-button> <el-button type="primary" @click="putins"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<!--操作人员确认-->
<el-dialog :visible.sync="limitedPhoto" @close="closeCamera" id="loginFaceWrap">
<div style="font-size: 28px;color: #333333;text-align: center;font-weight: bold;">操作人员确认</div>
<div class="testTracking">
<faceLogin
v-if="limitedPhoto"
ref="faceTracking"
name="faceLogin"
@func="getMsgFormSon"
></faceLogin>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
// import {getOrderList} from "@/api/sam";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
import {getWarehouseList} from "@/api/inm"; import {getWarehouseList} from "@/api/inm";
import { getrecordformList, getrffieldList} from "@/api/mtm"; import { getrecordformList, getrffieldList} from "@/api/mtm";
// import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import customForm from "@/components/customForm/index"; import customForm from "@/components/customForm/index";
import faceLogin from '@/components/faceLogin/review.vue';
import { import {
getwproductList, getwproductList,
wproductTest, wproductTest,
@ -315,12 +326,12 @@
const defaultetestitem = {}; const defaultetestitem = {};
export default { export default {
components: {Pagination, customForm}, components: {Pagination, customForm,faceLogin},
data() { data() {
return { return {
testitem: defaultetestitem, testitem: defaultetestitem,
form: {remark: "", warehouse: ""}, form: {remark: "", warehouse: ""},
form1: {}, submitForm: {},
wproductList: { wproductList: {
count: 0, count: 0,
}, },
@ -372,11 +383,13 @@
recordList: [], recordList: [],
recordformList: [], recordformList: [],
recordform: null, recordform: null,
submitFormId: null,
fifo_detail: "", fifo_detail: "",
listQueryrecordform: { listQueryrecordform: {
page: 0, page: 0,
}, },
hasPicture: false, hasPicture: false,
limitedPhoto: false,
outerVisible: false, outerVisible: false,
innerVisible: false, innerVisible: false,
dialogFormVisible: false, dialogFormVisible: false,
@ -680,12 +693,12 @@
//记录提交检查项目 //记录提交检查项目
recordSubmit(value) { recordSubmit(value) {
let that = this; // let that = this;
let id = value.id; this.submitFormId = value.id;
let params = {}; this.submitForm.record_data = value.record_data;
params.record_data = value.record_data; this.submitForm.is_testok = value.is_testok;
params.is_testok = value.is_testok; this.limitedPhoto = true;
putTestRecordItem(id, params) /*putTestRecordItem(id, params)
.then((res) => { .then((res) => {
if (res.code >= 200) { if (res.code >= 200) {
subTestRecordItem(id, params).then((res) => { subTestRecordItem(id, params).then((res) => {
@ -704,7 +717,7 @@
}) })
.catch((err) => { .catch((err) => {
this.$message.error(err); this.$message.error(err);
}); });*/
}, },
//第一次保存提交检查项目 //第一次保存提交检查项目
@ -712,6 +725,55 @@
this.outerVisible = false; this.outerVisible = false;
this.innerVisible = false; this.innerVisible = false;
}, },
//获取人脸数据
getMsgFormSon(data) {
let that = this;
let text = '确定以操作员'+data.name+'身份提交?';
if (data.token !== '' && data.token !== null && data.token !== undefined) {
this.$confirm(text, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
that.limitedPhoto = false;
putTestRecordItem(this.submitFormId, that.submitForm)
.then((res) => {
if (res.code >= 200) {
subTestRecordItem(this.submitFormId, that.submitForm).then((res) => {
if (res.code >= 200) {
that.innerVisible = false;
that.limitedReview = false;
that.limitedCheckRecord = false;
this.getList();
this.getList1();
that.refreshRecord();
}
});
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
this.$message.error(err);
});
}).catch(() => {
that.limitedPhoto = false;
});
}
},
/*关闭相机*/
closeCamera() {
this.$refs.faceTracking.closeCamera();
let video = document.getElementById('video');
let stream = video.srcObject;
let tracks = stream.getTracks();
tracks.forEach(track => {
track.stop()
});
video.srcObject = null;
},
}, },
}; };
</script> </script>