|
@@ -446,7 +446,7 @@
|
|
<button class="btn btn-lg btn-success" onclick = "cl_openidA4photos(1,1)">打开高拍仪</button>
|
|
<button class="btn btn-lg btn-success" onclick = "cl_openidA4photos(1,1)">打开高拍仪</button>
|
|
<button class="btn btn-lg btn-warning" onclick = "cl_closeidA4photos()">关闭高拍仪</button>
|
|
<button class="btn btn-lg btn-warning" onclick = "cl_closeidA4photos()">关闭高拍仪</button>
|
|
<button class="btn btn-lg btn-info" onclick="cl_takePhotos()">拍照</button>
|
|
<button class="btn btn-lg btn-info" onclick="cl_takePhotos()">拍照</button>
|
|
- <button class="btn btn-lg btn-warning" onclick="submitHandler()">提交并关闭</button>
|
|
|
|
|
|
+ <button class="btn btn-lg btn-warning" onclick="submit()">提交并关闭</button>
|
|
<!--<button class="btn btn-lg btn-info">拍照</button>
|
|
<!--<button class="btn btn-lg btn-info">拍照</button>
|
|
<button class="btn btn-lg btn-success">上传</button>
|
|
<button class="btn btn-lg btn-success">上传</button>
|
|
<button class="btn btn-lg btn-warning">重置</button><button class="btn btn-lg btn-info">拍照</button>
|
|
<button class="btn btn-lg btn-warning">重置</button><button class="btn btn-lg btn-info">拍照</button>
|
|
@@ -509,12 +509,12 @@
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- function submitHandler() {
|
|
|
|
|
|
+ function submit() {
|
|
if ($.validate.form()) {
|
|
if ($.validate.form()) {
|
|
var creditCode = $('#creditCode').val()
|
|
var creditCode = $('#creditCode').val()
|
|
console.log(creditCode)
|
|
console.log(creditCode)
|
|
$.operate.save( prefix+"/add", $('#form-file-add').serialize(),function(){
|
|
$.operate.save( prefix+"/add", $('#form-file-add').serialize(),function(){
|
|
- window.location.href="/rlzy/print/"+creditCode
|
|
|
|
|
|
+ window.location.href="/rlzy/print/secound/13"
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
@@ -552,7 +552,7 @@
|
|
$("#idcard1").attr('style','color: red;font-size: 12px;display: block')
|
|
$("#idcard1").attr('style','color: red;font-size: 12px;display: block')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- var formFileLg = document.querySelector("#formFileLg")
|
|
|
|
|
|
+ /*var formFileLg = document.querySelector("#formFileLg")
|
|
formFileLg.onchange = function () {
|
|
formFileLg.onchange = function () {
|
|
var formData = new FormData()
|
|
var formData = new FormData()
|
|
formData.append("file",document.getElementById("formFileLg").files[0])
|
|
formData.append("file",document.getElementById("formFileLg").files[0])
|
|
@@ -569,7 +569,7 @@
|
|
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
</script>
|
|
</script>
|
|
<script th:inline="javascript">
|
|
<script th:inline="javascript">
|
|
|
|
|
|
@@ -675,6 +675,21 @@
|
|
if (code == 0) {
|
|
if (code == 0) {
|
|
Toast('res', '拍照成功');
|
|
Toast('res', '拍照成功');
|
|
addImage(image);
|
|
addImage(image);
|
|
|
|
+ var formData = getFileFromBase64(image,"人力资源设立.jpg");
|
|
|
|
+
|
|
|
|
+ $.ajax({
|
|
|
|
+ type: "post",
|
|
|
|
+ url: ctx + "common/upload",
|
|
|
|
+ data: formData,
|
|
|
|
+ cache: false,
|
|
|
|
+ contentType: false,
|
|
|
|
+ processData: false,
|
|
|
|
+ dataType: 'json',
|
|
|
|
+ success: function (result) {
|
|
|
|
+ console.log(result)
|
|
|
|
+ $('#baseFile').val(result.fileName)
|
|
|
|
+ }
|
|
|
|
+ });
|
|
} else if (code == -1) {
|
|
} else if (code == -1) {
|
|
Toast('errs', '摄像头未打开拍照失败');
|
|
Toast('errs', '摄像头未打开拍照失败');
|
|
} else {
|
|
} else {
|
|
@@ -687,6 +702,24 @@
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function getFileFromBase64 (data,fileName) {
|
|
|
|
+ var _base64 = "data:image/jpeg;base64," + data;
|
|
|
|
+ const dataArr = _base64.split(",");
|
|
|
|
+ const byteString = atob(dataArr[1]);
|
|
|
|
+ const options = {
|
|
|
|
+ type: "image/jpeg",
|
|
|
|
+ endings: "native"
|
|
|
|
+ };
|
|
|
|
+ const u8Arr = new Uint8Array(byteString.length);
|
|
|
|
+ for (let i = 0; i < byteString.length; i++) {
|
|
|
|
+ u8Arr[i] = byteString.charCodeAt(i);
|
|
|
|
+ }
|
|
|
|
+ let formData = new FormData();
|
|
|
|
+ let fileOfBlob = new File([u8Arr], fileName, options);//返回文件流
|
|
|
|
+ formData.append("file", fileOfBlob);
|
|
|
|
+ return formData
|
|
|
|
+ }
|
|
|
|
+
|
|
function goBack() {
|
|
function goBack() {
|
|
history.go(-2);
|
|
history.go(-2);
|
|
}
|
|
}
|