Commit 1a0dc223 authored by houyu's avatar houyu

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

parent c8122c04
...@@ -340,8 +340,7 @@ ...@@ -340,8 +340,7 @@
// 返回图片的二进制数据 // 返回图片的二进制数据
// return canvas.toDataURL("image/png"); // return canvas.toDataURL("image/png");
const imgUrl = canvas.toDataURL("image/png") const imgUrl = canvas.toDataURL("image/png")
console.log(imgUrl); return imgUrl;
document.getElementById("img2").setAttribute('src', imgUrl)
//const a = document.createElement('a') //const a = document.createElement('a')
//a.src = imgUrl //a.src = imgUrl
<%--a.setAttribute('download', `chart-download-${name}`)--%> <%--a.setAttribute('download', `chart-download-${name}`)--%>
...@@ -353,9 +352,29 @@ ...@@ -353,9 +352,29 @@
width: 790, width: 790,
height: 790, height: 790,
scale: 1 scale: 1
}).then(x => { }).then(img => {
console.log(x); 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> </script>
...@@ -433,6 +452,5 @@ ...@@ -433,6 +452,5 @@
</td> </td>
</tr> </tr>
</table> </table>
<img src="" id="img2">
</body> </body>
</html> </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