viewZsda.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // 修改猪舍档案
  2. function editZsda(id, from) {
  3. huimv.loadPage('zsdaRight', 'editZsda.htm', {
  4. "id" : id,
  5. "from" : from
  6. });
  7. }
  8. /**
  9. * 删除猪舍档案
  10. * @param id
  11. * @param from
  12. * @param numOfExistLq
  13. */
  14. function disableZsda(id, from, numOfExistLq) {
  15. if (numOfExistLq != "" && numOfExistLq > 0) {
  16. var errMsg = document.getElementById('errMsg');
  17. errMsg.innerHTML = "无法删除此猪舍,请先删除此猪舍下的栏期!";
  18. return;
  19. }
  20. Dialogs.alert("确定作废当前猪舍档案?", {
  21. title : '提示信息',
  22. width : 250,
  23. height : 80,
  24. top : 150,
  25. button : {
  26. ok : ['确定',function(){
  27. this.close();
  28. huimv.showProcessModel('处理数据中');
  29. jQuery.ajax({
  30. url : 'disableZsda.htm',
  31. dataType : 'json',
  32. type : 'post',
  33. cache : false,
  34. data : {"id" : id},
  35. success : function(data) {
  36. huimv.hideProcessModel();
  37. if (data.returnCode > 0) {
  38. if (from == 'list') {
  39. huimv.reloadGrid('zsdaGrid');
  40. } else if (from == 'view') {
  41. loadZsdaList();
  42. }
  43. } else {
  44. Dialogs.alert("传入参数有误!", {
  45. width : 300,
  46. height : 50
  47. });
  48. }
  49. },
  50. error : function(data) {
  51. huimv.showError(data.responseText);
  52. }
  53. });
  54. }],
  55. cancel : ['取消',function(){
  56. this.close();
  57. }]
  58. }
  59. });
  60. }