fix:调整劳务管理模块中人员录入的vueCropper以及添加管理人员和临时人员的海康设备判断以及
This commit is contained in:
parent
cea8ecc1e6
commit
33dc504ffb
@ -1046,6 +1046,7 @@
|
||||
:autoCropHeight="cropperOption.autoCropHeight"
|
||||
:outputSize="1"
|
||||
:maxImgSize="300"
|
||||
:centerBox="true"
|
||||
mode="contain"
|
||||
:autoCrop="true"
|
||||
></vueCropper>
|
||||
|
||||
@ -964,6 +964,7 @@
|
||||
:autoCropHeight="cropperOption.autoCropHeight"
|
||||
:outputSize="1"
|
||||
:maxImgSize="300"
|
||||
:centerBox="true"
|
||||
mode="contain"
|
||||
:autoCrop="true"
|
||||
></vueCropper>
|
||||
|
||||
@ -507,6 +507,7 @@
|
||||
:autoCropHeight="cropperOption.autoCropHeight"
|
||||
:outputSize="1"
|
||||
:maxImgSize="300"
|
||||
:centerBox="true"
|
||||
mode="contain"
|
||||
:autoCrop="true"
|
||||
></vueCropper>
|
||||
|
||||
@ -2318,6 +2318,7 @@
|
||||
:autoCropHeight="cropperOption.autoCropHeight"
|
||||
:outputSize="1"
|
||||
:maxImgSize="300"
|
||||
:centerBox="true"
|
||||
mode="contain"
|
||||
:autoCrop="true"
|
||||
></vueCropper>
|
||||
|
||||
@ -2009,8 +2009,11 @@
|
||||
:outputType="cropperOption.outputType"
|
||||
:autoCropWidth="cropperOption.autoCropWidth"
|
||||
:autoCropHeight="cropperOption.autoCropHeight"
|
||||
:outputSize="1"
|
||||
:maxImgSize="300"
|
||||
:centerBox="true"
|
||||
mode="contain"
|
||||
:autoCrop="true"
|
||||
:fixedBox="true"
|
||||
></vueCropper>
|
||||
<!-- </vue-scroll> -->
|
||||
</div>
|
||||
@ -2190,6 +2193,7 @@ import {
|
||||
importImgDataApi,
|
||||
xmglXzHikvisionSyncGetNewestList,
|
||||
xmglXzHikvisionSyncRetryAPI,
|
||||
checkfaceHikvisionApi,
|
||||
} from "@/assets/js/api/laborPerson";
|
||||
import { selectUserDevAuthorityByUserIdApi } from "@/assets/js/api/configManage";
|
||||
import { getProjectConfigListApi } from "@/assets/js/api/project.js";
|
||||
@ -2358,7 +2362,7 @@ export default {
|
||||
enterpriseTypeId: "",
|
||||
enterpriseTypeList: [],
|
||||
cropperOption: {
|
||||
outputType: "png",
|
||||
outputType: "jpeg",
|
||||
img: "",
|
||||
autoCropWidth: 300, // 默认生成截图框宽度
|
||||
autoCropHeight: 360, // 默认生成截图框高度
|
||||
@ -2501,14 +2505,32 @@ export default {
|
||||
handleUpload(fileData, type) {
|
||||
const file = fileData.file;
|
||||
// 压缩图片
|
||||
lrz(file, { quality: 1 }).then((result) => {
|
||||
// lrz(file, { quality: 1 }).then((result) => {
|
||||
const formData = new FormData();
|
||||
formData.append("files", result.file);
|
||||
// formData.append("files", result.file);
|
||||
// formData.append("files", result.file, image.jpg);
|
||||
formData.append("files", file, "image.jpg");
|
||||
|
||||
// 图片上传
|
||||
apiUploadImage(formData).then((res) => {
|
||||
if (res.code == 200 || res.status == "SUCCESS") {
|
||||
|
||||
const imgInfo = res.data[0];
|
||||
|
||||
if (
|
||||
imgInfo.fileInfo.contentType != "image/jpeg" &&
|
||||
imgInfo.fileInfo.contentType != "image/jpg"
|
||||
// file.type != "image/png"
|
||||
) {
|
||||
this.$message.error(this.$t("请上传jpg格式图片")); //"请上传jpg、jpeg格式图片"
|
||||
return false;
|
||||
}
|
||||
let imgSize = Number(imgInfo.fileInfo.size / 1024);
|
||||
console.log(11111111, imgSize);
|
||||
if (imgSize <= 10 || imgSize >= 200) {
|
||||
this.$message.error("文件大小不能超过200kb小于10kb,请重新上传!");
|
||||
return false;
|
||||
}
|
||||
switch (type) {
|
||||
case "idCardAvatar": // 身份证头像
|
||||
this.personForm.idCardBigPhotoUrl = imgInfo.imageUrl;
|
||||
@ -2517,9 +2539,31 @@ export default {
|
||||
];
|
||||
break;
|
||||
case "livesFace": // 现场采集人脸
|
||||
if(this.isIscDevice){
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '图片检测中',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.5)'
|
||||
});
|
||||
|
||||
let data = {fileUrl: imgInfo.imageUrl}
|
||||
checkfaceHikvisionApi(data).then((res) => {
|
||||
if(res.code == 200 && res.result.checkType == "1"){
|
||||
this.cropperOption.img =
|
||||
this.$store.state.FILEURL + imgInfo.imageUrl;
|
||||
this.cropperDialog = true;
|
||||
}else{
|
||||
this.$message.error(res.result.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close();
|
||||
})
|
||||
}else{
|
||||
this.cropperOption.img =
|
||||
this.$store.state.FILEURL + imgInfo.imageUrl;
|
||||
this.cropperDialog = true;
|
||||
}
|
||||
// let imgStatus = result.file.size / 1024 < 500
|
||||
// if (!imgStatus) {
|
||||
// this.cropperOption.img =
|
||||
@ -2536,7 +2580,7 @@ export default {
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
// });
|
||||
},
|
||||
changePeople(val) {},
|
||||
issuePersonFn() {
|
||||
@ -3529,6 +3573,12 @@ export default {
|
||||
this.$message.error(this.$t("message.laborMange.hint8")); //"请上传jpg、jpeg格式图片"
|
||||
return false;
|
||||
}
|
||||
let imgSize = Number(file.size / 1024);
|
||||
console.log(11111111, imgSize);
|
||||
if (imgSize <= 10 || imgSize >= 200) {
|
||||
this.$message.error("文件大小不能超过200kb小于10kb,请重新上传!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
let fileType = file.type.split("/")[0];
|
||||
if (fileType == "image") {
|
||||
@ -3641,9 +3691,30 @@ export default {
|
||||
checkFace(url) {
|
||||
checkFaceApi({ fileUrl: url }).then((res) => {
|
||||
if (res.result.checkType == 1) {
|
||||
this.personForm.fieldAcquisitionUrl = url;
|
||||
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||
this.cropperDialog = false;
|
||||
if(this.isIscDevice){
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '裁剪图片检测中',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.5)'
|
||||
});
|
||||
let data = {fileUrl: url}
|
||||
checkfaceHikvisionApi(data).then((res) => {
|
||||
if(res.code == 200 && res.result.checkType == "1"){
|
||||
this.personForm.fieldAcquisitionUrl = url;
|
||||
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||
this.cropperDialog = false;
|
||||
}else{
|
||||
this.$message.error(res.result.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close();
|
||||
})
|
||||
}else{
|
||||
this.personForm.fieldAcquisitionUrl = url;
|
||||
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||
this.cropperDialog = false;
|
||||
}
|
||||
} else {
|
||||
this.$message.error(res.result.message);
|
||||
}
|
||||
@ -3669,6 +3740,12 @@ export default {
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("aaaaa", res);
|
||||
let imgSize = Number(res.data.data[0].fileInfo.size / 1024);
|
||||
console.log('经过vueCropper裁剪后', imgSize);
|
||||
if (imgSize <= 10 || imgSize >= 200) {
|
||||
this.$message.error("图片裁剪后大小不能超过200kb小于10kb,请重新裁剪或重新上传图片!");
|
||||
return false;
|
||||
}
|
||||
if (res.data.status == "SUCCESS") {
|
||||
if (this.isSzProject == 1) {
|
||||
this.checkImgLibrary(res.data.data[0].imageUrl);
|
||||
|
||||
@ -2261,6 +2261,7 @@
|
||||
:autoCropHeight="cropperOption.autoCropHeight"
|
||||
:outputSize="1"
|
||||
:maxImgSize="300"
|
||||
:centerBox="true"
|
||||
mode="contain"
|
||||
:autoCrop="true"
|
||||
></vueCropper>
|
||||
@ -2651,7 +2652,6 @@ export default {
|
||||
attendRulesList: [],
|
||||
enterpriseTypeId: "",
|
||||
cropperOption: {
|
||||
// outputType: "png",
|
||||
outputType: "jpeg",
|
||||
img: "",
|
||||
autoCropWidth: 300, // 默认生成截图框宽度
|
||||
@ -2786,11 +2786,10 @@ export default {
|
||||
// 图片上传
|
||||
apiUploadImage(formData).then((res) => {
|
||||
if (res.code == 200 || res.status == "SUCCESS") {
|
||||
console.log("0000000000000000000000000000")
|
||||
console.log(res)
|
||||
console.log("0000000000000000000000000000")
|
||||
console.log("图片上传后",res)
|
||||
|
||||
const imgInfo = res.data[0];
|
||||
|
||||
if (
|
||||
imgInfo.fileInfo.contentType != "image/jpeg" &&
|
||||
imgInfo.fileInfo.contentType != "image/jpg"
|
||||
@ -4148,9 +4147,7 @@ export default {
|
||||
this.$message.error(this.$t("message.companyDiagram.uploadMsg")); //只能上传图片
|
||||
return false;
|
||||
} else if (type == 7) {
|
||||
console.log('11111111111111111111')
|
||||
console.log(file);
|
||||
console.log('11111111111111111111')
|
||||
console.log("判断大小以及格式之前的图片",file);
|
||||
if (
|
||||
file.type != "image/jpeg" &&
|
||||
file.type != "image/jpg"
|
||||
@ -4407,10 +4404,6 @@ export default {
|
||||
loading.close();
|
||||
})
|
||||
}else{
|
||||
// this.$message({
|
||||
// message: "非海康设备,请检查后重试!",
|
||||
// type: "error",
|
||||
// });
|
||||
this.personForm.fieldAcquisitionUrl = url;
|
||||
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||
this.cropperDialog = false;
|
||||
|
||||
@ -587,9 +587,9 @@
|
||||
size="medium"
|
||||
style="padding: 9px 20px"
|
||||
type="primary"
|
||||
v-if="titleType != 'detail'"
|
||||
>{{ $t("message.laborMange.clickOnTheUpload") }}</el-button
|
||||
>
|
||||
<!-- v-if="titleType != 'detail'" -->
|
||||
</el-upload>
|
||||
<el-upload
|
||||
action="uploadUrl"
|
||||
@ -607,9 +607,9 @@
|
||||
size="medium"
|
||||
style="padding: 9px 20px"
|
||||
type="primary"
|
||||
v-if="titleType != 'detail'"
|
||||
>{{ $t("message.laborMange.clickOnTheUpload") }}</el-button
|
||||
>
|
||||
<!-- v-if="titleType != 'detail'" -->
|
||||
</el-upload>
|
||||
</div>
|
||||
</el-col>
|
||||
@ -679,8 +679,11 @@
|
||||
:outputType="cropperOption.outputType"
|
||||
:autoCropWidth="cropperOption.autoCropWidth"
|
||||
:autoCropHeight="cropperOption.autoCropHeight"
|
||||
:outputSize="1"
|
||||
:maxImgSize="300"
|
||||
:centerBox="true"
|
||||
mode="contain"
|
||||
:autoCrop="true"
|
||||
:fixedBox="true"
|
||||
></vueCropper>
|
||||
<!-- </vue-scroll> -->
|
||||
</div>
|
||||
@ -710,6 +713,9 @@ import {
|
||||
editWorkerInfo,
|
||||
deleteWorkerInfo,
|
||||
getWorkerInfoList,
|
||||
checkfaceHikvisionApi,
|
||||
getProjectUfaceConfigInfo,
|
||||
checkFaceApi,
|
||||
} from "@/assets/js/api/laborPerson";
|
||||
import {
|
||||
IdentityCodeValid
|
||||
@ -725,11 +731,12 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isIscDevice: false, //是否是海康门禁isc设备
|
||||
//显示的文件列表
|
||||
fieldAcquisitionUrlFile: [],
|
||||
idCardBigPhotoUrlFile: [],
|
||||
cropperOption: {
|
||||
outputType: "png",
|
||||
outputType: "jpeg",
|
||||
img: "",
|
||||
autoCropWidth: 300, // 默认生成截图框宽度
|
||||
autoCropHeight: 360, // 默认生成截图框高度
|
||||
@ -809,6 +816,7 @@ export default {
|
||||
created() {
|
||||
this.projectSn = this.$store.state.projectSn;
|
||||
this.getInfoList();
|
||||
this.getConfig();
|
||||
},
|
||||
methods: {
|
||||
// 人员照片库比对
|
||||
@ -842,14 +850,41 @@ export default {
|
||||
checkFace(url) {
|
||||
checkFaceApi({ fileUrl: url }).then((res) => {
|
||||
if (res.result.checkType == 1) {
|
||||
if (this.temporaryDialog1 || this.temporaryDialog2) {
|
||||
this.personForm.fieldAcquisitionUrl = url;
|
||||
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||
this.cropperDialog = false;
|
||||
} else {
|
||||
this.addForm.fieldAcquisitionUrl = url;
|
||||
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||
this.cropperDialog = false;
|
||||
if(this.isIscDevice){
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '裁剪图片检测中',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.5)'
|
||||
});
|
||||
let data = {fileUrl: url}
|
||||
checkfaceHikvisionApi(data).then((res) => {
|
||||
if(res.code == 200 && res.result.checkType == "1"){
|
||||
if (this.temporaryDialog1 || this.temporaryDialog2) {
|
||||
this.personForm.fieldAcquisitionUrl = url;
|
||||
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||
this.cropperDialog = false;
|
||||
} else {
|
||||
this.addForm.fieldAcquisitionUrl = url;
|
||||
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||
this.cropperDialog = false;
|
||||
}
|
||||
}else{
|
||||
this.$message.error(res.result.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close();
|
||||
})
|
||||
}else{
|
||||
if (this.temporaryDialog1 || this.temporaryDialog2) {
|
||||
this.personForm.fieldAcquisitionUrl = url;
|
||||
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||
this.cropperDialog = false;
|
||||
} else {
|
||||
this.addForm.fieldAcquisitionUrl = url;
|
||||
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||
this.cropperDialog = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$message.error(res.result.message);
|
||||
@ -876,6 +911,12 @@ export default {
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("aaaaa", res);
|
||||
let imgSize = Number(res.data.data[0].fileInfo.size / 1024);
|
||||
console.log('经过vueCropper裁剪后', imgSize);
|
||||
if (imgSize <= 10 || imgSize >= 200) {
|
||||
this.$message.error("图片裁剪后大小不能超过200kb小于10kb,请重新裁剪或重新上传图片!");
|
||||
return false;
|
||||
}
|
||||
if (res.data.status == "SUCCESS") {
|
||||
if (this.isSzProject == 1) {
|
||||
this.checkImgLibrary(res.data.data[0].imageUrl);
|
||||
@ -890,14 +931,33 @@ export default {
|
||||
console.log(fileData, 111222);
|
||||
const file = fileData.file;
|
||||
// 压缩图片
|
||||
lrz(file, { quality: 1 }).then((result) => {
|
||||
// lrz(file, { quality: 1 }).then((result) => {
|
||||
const formData = new FormData();
|
||||
formData.append("files", result.file);
|
||||
// formData.append("files", result.file);
|
||||
// formData.append("files", result.file, image.jpg);
|
||||
formData.append("files", file, "image.jpg");
|
||||
|
||||
// 图片上传
|
||||
apiUploadImage(formData).then((res) => {
|
||||
if (res.code == 200 || res.status == "SUCCESS") {
|
||||
|
||||
const imgInfo = res.data[0];
|
||||
|
||||
if (
|
||||
imgInfo.fileInfo.contentType != "image/jpeg" &&
|
||||
imgInfo.fileInfo.contentType != "image/jpg"
|
||||
// file.type != "image/png"
|
||||
) {
|
||||
this.$message.error(this.$t("请上传jpg格式图片")); //"请上传jpg、jpeg格式图片"
|
||||
return false;
|
||||
}
|
||||
let imgSize = Number(imgInfo.fileInfo.size / 1024);
|
||||
console.log(11111111, imgSize);
|
||||
if (imgSize <= 10 || imgSize >= 200) {
|
||||
this.$message.error("文件大小不能超过200kb小于10kb,请重新上传!");
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case "idCardAvatar": // 身份证头像
|
||||
this.addForm.idCardBigPhotoUrl = imgInfo.imageUrl;
|
||||
@ -906,9 +966,31 @@ export default {
|
||||
];
|
||||
break;
|
||||
case "livesFace": // 现场采集人脸
|
||||
if(this.isIscDevice){
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '图片检测中',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.5)'
|
||||
});
|
||||
|
||||
let data = {fileUrl: imgInfo.imageUrl}
|
||||
checkfaceHikvisionApi(data).then((res) => {
|
||||
if(res.code == 200 && res.result.checkType == "1"){
|
||||
this.cropperOption.img =
|
||||
this.$store.state.FILEURL + imgInfo.imageUrl;
|
||||
this.cropperDialog = true;
|
||||
}else{
|
||||
this.$message.error(res.result.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close();
|
||||
})
|
||||
}else{
|
||||
this.cropperOption.img =
|
||||
this.$store.state.FILEURL + imgInfo.imageUrl;
|
||||
this.cropperDialog = true;
|
||||
}
|
||||
// let imgStatus = result.file.size / 1024 < 500
|
||||
// if (!imgStatus) {
|
||||
// this.cropperOption.img =
|
||||
@ -925,7 +1007,7 @@ export default {
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
// });
|
||||
},
|
||||
// 文件上传 之前
|
||||
handleBeforeUpload(file, type) {
|
||||
@ -946,6 +1028,12 @@ export default {
|
||||
this.$message.error(this.$t("message.laborMange.hint8")); //"请上传jpg、jpeg格式图片"
|
||||
return false;
|
||||
}
|
||||
let imgSize = Number(file.size / 1024);
|
||||
console.log(11111111, imgSize);
|
||||
if (imgSize <= 10 || imgSize >= 200) {
|
||||
this.$message.error("文件大小不能超过200kb小于10kb,请重新上传!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
@ -1063,6 +1151,18 @@ export default {
|
||||
"&codeState=" +
|
||||
this.codeState;
|
||||
},
|
||||
getConfig() {
|
||||
getProjectUfaceConfigInfo({
|
||||
projectSn: this.$store.state.projectSn,
|
||||
}).then((result) => {
|
||||
if (result.success) {
|
||||
if (result.result) {
|
||||
this.isUploadToHouse = result.result.housing ? true : false;
|
||||
this.isIscDevice = result.result.supplierType == 9 ? true : false;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//获取列表信息
|
||||
getInfoList() {
|
||||
let data = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user