confirmationBeforeFaceBrushSubmit
This commit is contained in:
parent
a75ea367b8
commit
7273dbc35a
|
@ -2,10 +2,10 @@
|
|||
<div class="faceLoginWrap">
|
||||
<div style="height: 500px;">
|
||||
<div class="video-box">
|
||||
<video id="video" width="500" height="500" preload autoplay loop muted></video>
|
||||
<canvas id="canvas" width="500" height="500"></canvas>
|
||||
<video id="video" width="600" preload autoplay loop muted></video>
|
||||
<canvas id="canvas" width="600" height="500"></canvas>
|
||||
</div>
|
||||
<canvas id="screenshotCanvas" width="500" height="500"></canvas>
|
||||
<canvas id="screenshotCanvas" width="600" height="500"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -132,7 +132,7 @@
|
|||
if(res.data.access){
|
||||
let item= {name:res.data.name,token:res.data.access};
|
||||
that.$emit('func',item);
|
||||
that.$message.success("身份认证成功!");
|
||||
// that.$message.success("身份认证成功!");
|
||||
this.closeCamera();
|
||||
}else{
|
||||
that.uploadLock = false;
|
||||
|
@ -165,7 +165,6 @@
|
|||
beforeDestroy() {
|
||||
let video = document.getElementById('video');
|
||||
let stream = video.srcObject;
|
||||
// console.log(stream);
|
||||
let tracks = stream.getTracks();
|
||||
tracks.forEach(track => {
|
||||
track.stop()
|
||||
|
@ -188,8 +187,7 @@
|
|||
.video-box {
|
||||
margin: auto;
|
||||
position: relative;
|
||||
width: 500px;
|
||||
height: 500px;
|
||||
width: 600px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
|
|
@ -365,6 +365,7 @@
|
|||
//首件审批
|
||||
handleSelectclick(scope,index){
|
||||
let that = this;
|
||||
debugger;
|
||||
this.reviewVisible = true;
|
||||
that.planId = scope.row.id;
|
||||
that.leader_1 = scope.row.leader_1_?scope.row.leader_1_.name:null;
|
||||
|
@ -479,6 +480,8 @@
|
|||
that.checkParams = params;
|
||||
that.limitedUserCheck = true;
|
||||
},
|
||||
|
||||
//人脸识别获取人员信息后
|
||||
checkSubmit(data){
|
||||
let that =this;
|
||||
let id = that.checkParams.id;
|
||||
|
@ -486,26 +489,35 @@
|
|||
params.is_testok = that.checkParams.is_testok;
|
||||
params.record_data = that.checkParams.record_data;
|
||||
params.token = data.token;
|
||||
let text = '确定以操作员'+data.name+'身份提交?';
|
||||
if(data.token!==''&&data.token!==null&&data.token!==undefined) {
|
||||
putTestRecordItem(id, params).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
subTestRecordItem(id, params).then((res) => {
|
||||
debugger;
|
||||
that.limitedUserCheck = false;
|
||||
if (res.code >= 200) {
|
||||
that.recordVisible = false;
|
||||
that.getTableData();
|
||||
}else{
|
||||
that.$message.error(res.msg)
|
||||
}
|
||||
}).catch(()=>{
|
||||
that.limitedUserCheck = false;
|
||||
});
|
||||
} else {
|
||||
that.$message.error(res.msg)
|
||||
}
|
||||
}).catch((err) => {
|
||||
that.$message.error(err);
|
||||
this.$confirm(text, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
putTestRecordItem(id, params).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
subTestRecordItem(id, params).then((res) => {
|
||||
debugger;
|
||||
that.limitedUserCheck = false;
|
||||
if (res.code >= 200) {
|
||||
that.recordVisible = false;
|
||||
that.getTableData();
|
||||
}else{
|
||||
that.$message.error(res.msg)
|
||||
}
|
||||
}).catch(()=>{
|
||||
that.limitedUserCheck = false;
|
||||
});
|
||||
} else {
|
||||
that.$message.error(res.msg)
|
||||
}
|
||||
}).catch((err) => {
|
||||
that.$message.error(err);
|
||||
});
|
||||
}).catch(() => {
|
||||
that.limitedUserCheck = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1544,33 +1544,40 @@
|
|||
params.is_testok = that.params.is_testok;
|
||||
params.record_data = that.params.record_data;
|
||||
params.token = data.token;
|
||||
let text = '确定以操作员'+data.name+'身份提交?';
|
||||
if (data.token !== '' && data.token !== null && data.token !== undefined) {
|
||||
putTestRecordItem(id, params).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
subTestRecordItem(id, params).then((res) => {
|
||||
debugger;
|
||||
that.limitedPhoto = false;
|
||||
if (res.code >= 200) {
|
||||
that.recordVisible = false;
|
||||
that.limitedReview = false;
|
||||
that.limitedCheckRecord = false;
|
||||
that.getList();
|
||||
that.getList2();
|
||||
that.getList1();
|
||||
that.getList3();
|
||||
that.refreshRecord();
|
||||
} else {
|
||||
that.$message.error(res.msg)
|
||||
}
|
||||
}).catch(() => {
|
||||
that.limitedPhoto = false;
|
||||
});
|
||||
} else {
|
||||
that.$message.error(res.msg)
|
||||
}
|
||||
}).catch((err) => {
|
||||
that.$message.error(err);
|
||||
this.$confirm(text, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
that.limitedPhoto = false;
|
||||
putTestRecordItem(id, params).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
subTestRecordItem(id, params).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
that.recordVisible = false;
|
||||
that.limitedReview = false;
|
||||
that.limitedCheckRecord = false;
|
||||
that.getList();
|
||||
that.getList2();
|
||||
that.getList1();
|
||||
that.getList3();
|
||||
that.refreshRecord();
|
||||
} else {
|
||||
that.$message.error(res.msg)
|
||||
}
|
||||
}).catch(() => {});
|
||||
} else {
|
||||
that.$message.error(res.msg)
|
||||
}
|
||||
}).catch((err) => {
|
||||
that.$message.error(err);
|
||||
});
|
||||
}).catch(() => {
|
||||
that.limitedPhoto = false;
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -1220,9 +1220,10 @@
|
|||
getMsgFormSon(data) {
|
||||
let that = this;
|
||||
that.operationData.user = data.name;
|
||||
let text = '确定以操作员'+data.name+'身份提交?';
|
||||
if (data.token !== '' && data.token !== null && data.token !== undefined) {
|
||||
if (that.inputData == "") {
|
||||
that.$confirm("没有消耗物料确定提交吗?", "提示", {
|
||||
that.$confirm("没有消耗物料,"+text, "提示", {
|
||||
confirmButtonText: "确认",
|
||||
cancelButtonText: "取消",
|
||||
type: "error",
|
||||
|
@ -1241,16 +1242,26 @@
|
|||
that.limitedPhoto = false;
|
||||
});
|
||||
} else {
|
||||
submitOperation(that.id,{token:data.token}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
that.$router.push({name: "operation"});
|
||||
that.$message.success("操作提交成功!");
|
||||
}else{
|
||||
that.$message.error(res.msg)
|
||||
}
|
||||
}).catch((err) => {
|
||||
that.$message.error(err);
|
||||
this.$confirm(text, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
that.limitedPhoto = false;
|
||||
submitOperation(that.id,{token:data.token}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
that.$router.push({name: "operation"});
|
||||
that.$message.success("操作提交成功!");
|
||||
}else{
|
||||
that.$message.error(res.msg)
|
||||
}
|
||||
}).catch((err) => {
|
||||
that.$message.error(err);
|
||||
});
|
||||
}).catch(() => {
|
||||
that.limitedPhoto = false;
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -288,16 +288,27 @@
|
|||
<el-button type="primary" @click="putins">确 定</el-button>
|
||||
</div>
|
||||
</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>
|
||||
</template>
|
||||
<script>
|
||||
// import {getOrderList} from "@/api/sam";
|
||||
import checkPermission from "@/utils/permission";
|
||||
import {getWarehouseList} from "@/api/inm";
|
||||
import { getrecordformList, getrffieldList} from "@/api/mtm";
|
||||
// import {genTree} from "@/utils";
|
||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||
import customForm from "@/components/customForm/index";
|
||||
import faceLogin from '@/components/faceLogin/review.vue';
|
||||
import {
|
||||
getwproductList,
|
||||
wproductTest,
|
||||
|
@ -315,12 +326,12 @@
|
|||
|
||||
const defaultetestitem = {};
|
||||
export default {
|
||||
components: {Pagination, customForm},
|
||||
components: {Pagination, customForm,faceLogin},
|
||||
data() {
|
||||
return {
|
||||
testitem: defaultetestitem,
|
||||
form: {remark: "", warehouse: ""},
|
||||
form1: {},
|
||||
submitForm: {},
|
||||
wproductList: {
|
||||
count: 0,
|
||||
},
|
||||
|
@ -372,11 +383,13 @@
|
|||
recordList: [],
|
||||
recordformList: [],
|
||||
recordform: null,
|
||||
submitFormId: null,
|
||||
fifo_detail: "",
|
||||
listQueryrecordform: {
|
||||
page: 0,
|
||||
},
|
||||
hasPicture: false,
|
||||
limitedPhoto: false,
|
||||
outerVisible: false,
|
||||
innerVisible: false,
|
||||
dialogFormVisible: false,
|
||||
|
@ -680,12 +693,12 @@
|
|||
|
||||
//记录提交检查项目
|
||||
recordSubmit(value) {
|
||||
let that = this;
|
||||
let id = value.id;
|
||||
let params = {};
|
||||
params.record_data = value.record_data;
|
||||
params.is_testok = value.is_testok;
|
||||
putTestRecordItem(id, params)
|
||||
// let that = this;
|
||||
this.submitFormId = value.id;
|
||||
this.submitForm.record_data = value.record_data;
|
||||
this.submitForm.is_testok = value.is_testok;
|
||||
this.limitedPhoto = true;
|
||||
/*putTestRecordItem(id, params)
|
||||
.then((res) => {
|
||||
if (res.code >= 200) {
|
||||
subTestRecordItem(id, params).then((res) => {
|
||||
|
@ -704,7 +717,7 @@
|
|||
})
|
||||
.catch((err) => {
|
||||
this.$message.error(err);
|
||||
});
|
||||
});*/
|
||||
},
|
||||
|
||||
//第一次保存提交检查项目
|
||||
|
@ -712,6 +725,55 @@
|
|||
this.outerVisible = 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>
|
||||
|
|
Loading…
Reference in New Issue