Commit 1a0dc223 authored by houyu's avatar houyu

同步施工许可证图片ajax上传

parent c8122c04
......@@ -340,8 +340,7 @@
// 返回图片的二进制数据
// return canvas.toDataURL("image/png");
const imgUrl = canvas.toDataURL("image/png")
console.log(imgUrl);
document.getElementById("img2").setAttribute('src', imgUrl)
return imgUrl;
//const a = document.createElement('a')
//a.src = imgUrl
<%--a.setAttribute('download', `chart-download-${name}`)--%>
......@@ -353,9 +352,29 @@
width: 790,
height: 790,
scale: 1
}).then(x => {
console.log(x);
}).then(img => {
console.log(img);
$.ajax({
url : "fujiantongbu.action",
type: 'post',
dataType: 'json',
async : false,
data:{
xxylb: '${rfxm.xxylbbh}',
file : img
},
error: function(){
$.messager.alert('错误','同步施工许可证失败!');
},
success: function(data){
if(data.result){
$.messager.alert('提示','同步施工许可证成功!');
search_dxjl();
}else{
$.messager.alert('错误','同步施工许可证失败!');
}
}
});
})
}
</script>
......@@ -433,6 +452,5 @@
</td>
</tr>
</table>
<img src="" id="img2">
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment