No Description

brow.js 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. var id = decodeURIComponent(helper.request.queryString("id"));
  2. $(document).ready(function() {
  3. var timestamp = new Date().getTime() //获得当前的时间戳
  4. laydate.render({
  5. elem: '#giveBackTime',
  6. type: 'datetime',
  7. theme: '#249fea',
  8. trigger:'click',
  9. value: new Date(timestamp)
  10. });
  11. // if (equipmentmanagementsname == null) {
  12. // $("#equipmentmanagementsname").val('')
  13. // }
  14. // if (equipmentmanagementsid == null) {
  15. // $("#equipmentmanagementsid").val('')
  16. // }
  17. // if (Qdepartment == null) {
  18. // $("#Qdepartment").val('')
  19. // }
  20. // if (borrowpeoplec == null) {
  21. // $("#borrowpeoplec").val('')
  22. // }
  23. // if (borrowpeoplej == null) {
  24. // $("#borrowpeoplej").val('')
  25. // }
  26. // if (plandleth == null) {
  27. // $("#plandleth").val('')
  28. // }
  29. // if (beom == null) {
  30. // $("#beom").val('')
  31. // }
  32. // if (zmoney == null) {
  33. // $('#zmoney').val('')
  34. // }
  35. //保存
  36. $("#HY_save").click(function() {
  37. addValue();
  38. })
  39. })
  40. detailsL();
  41. //获取详情
  42. function detailsL() {
  43. $.ajax({
  44. type: "get",
  45. url: huayi.config.callcenter_url + "testusertypeapi/api/TestUserType/getsbtpbyid",
  46. async: true,
  47. dataType: 'json',
  48. data: {
  49. id: id,
  50. },
  51. success: function(res) {
  52. detailsList = res.data;
  53. if (res.state.toLowerCase() == 'success') {
  54. $("#equipmentmanagementsname").val(detailsList.equipmentmanagementsname)
  55. $('#equipmentmanagementsid').val(detailsList.equipmentmanagementsid)
  56. $("#Qdepartment").val(detailsList.Qdepartment)
  57. $('#borrowpeoplec').val(detailsList.borrowpeoplec)
  58. $("#borrowpeoplej").val(detailsList.borrowpeoplej)
  59. $('#plandleth').val(detailsList.plandleth)
  60. $("#beoms").val(detailsList.beoms)
  61. $("#beom").val(detailsList.beom)
  62. $('#zmoney').val(detailsList.zmoney)
  63. $('#borrowpeopleg').val(detailsList.borrowpeopleg)
  64. $('#plandleths').val(detailsList.plandleths) }
  65. }
  66. });
  67. }
  68. //添加
  69. function addValue() {
  70. $.ajax({
  71. type: "get",
  72. url: huayi.config.callcenter_url + "testusertypeapi/api/TestUserType/upquipmentmanagementlistr",
  73. async: true,
  74. dataType: 'json',
  75. data: {
  76. id: id,
  77. borrowpeopleg: $("#borrowpeopleg").val(),
  78. // plandleths: $('#plandleths').val(),
  79. Rktime:$("#giveBackTime").val(),
  80. beoms: $("#beoms").val(),
  81. },
  82. success: function(data) {
  83. if (data.state.toLowerCase() == 'success') {
  84. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  85. parent.layer.close(index); //再执行关闭
  86. layer.msg(data.message);
  87. parent.initTable();
  88. }
  89. }
  90. });
  91. }