Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. $(function(){
  2. $("#buttonhere").html("<button type='button' onclick='sync()'>同步</button>");
  3. })
  4.  
  5. function sync(){
  6. $.ajax({
  7. url:'/weaverjn/qiluzhiyao/utils/it.jsp',
  8. type:'post',
  9. data:{
  10. EQUIPMENT_NO:$("#field16987").val(),
  11. ASSET_NO:$("#field16984").val(),
  12. billid:$("#billid").val()
  13. },
  14. beforeSend:function(){
  15. try{
  16. e8showAjaxTips('同步中...',true);
  17. }catch(e){}
  18. },
  19. complete:function(){
  20. e8showAjaxTips('',false);
  21. },
  22. success:function(data){
  23. if(data==0){
  24. top.Dialog.alert("同步成功");
  25. window.location.reload();
  26. }else if(data==1){
  27. top.Dialog.alert("更新失败");
  28. }else if(data==2){
  29. top.Dialog.alert("获取数据失败");
  30. }else if(data==3){
  31. top.Dialog.alert("设备号或资产号为空");
  32. }
  33. }
  34. });
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement