houseRepairUpdate.jsp 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <script type="text/javascript">
  3. var update_load = function(id){
  4. $.ajax({
  5. type: "post",//使用get方法访问后台
  6. dataType: "json",//返回json格式的数据
  7. url: "houseRepairAction_findById",//要访问的后台地址
  8. data: "houseRepair.id="+id,//要发送的数据
  9. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  10. success: function(msg){
  11. $("#id_update").val(msg.obj.id);
  12. $("#id_materialFile_update").val(msg.obj.id);
  13. $("#name_update").val(msg.obj.name);
  14. $("#idCard_update").val(msg.obj.idCard);
  15. $("#phone_update").val(msg.obj.phone);
  16. $("#address_update").val(msg.obj.address);
  17. $("#developerDeadline_update").val(dealDate(msg.obj.house.developerDeadline));
  18. $("#reportTime_update").val(msg.obj.reportTime);
  19. $("#problem_update").val(msg.obj.problem);
  20. $("#repairPeople_update").val(msg.obj.repairPeople);
  21. $("#repairPeoplePhone_update").val(msg.obj.repairPeoplePhone);
  22. $("#repairCategory_update").val(msg.obj.repairCategory);
  23. for(var i=0;i< msg.obj.materialFile.length;i++){
  24. var $image = $("<div style='width: 120px;height: 80px;float:left;'><a href='" + msg.obj.materialFile[i].filePath + "' rel='lightbox[materialFile_update]'><img src='" + msg.obj.materialFile[i].filePath + "' width='120' height='80'/></a><img src='images/de.png' id='img" + msg.obj.materialFile[i].id + "' onclick='removeImg(" + msg.obj.materialFile[i].id + ")' width='15' height='15' style='float: right;position: relative;top: -77px;right: 2px; cursor:pointer;'></div>");
  25. $("#materialFile_update_file").append ($image);
  26. }
  27. }
  28. });
  29. $("#materialFile_update").change(function(){
  30. $("#materialFileUpdateForm").form('submit',{
  31. url : whzl.basePath+'/houseRepairAction_addUploadFile',
  32. success: function(result){
  33. $("#materialFile_update").attr("value","");
  34. $.ajax({
  35. type: "post",
  36. dataType: "json",//返回json格式的数据
  37. url: "houseRepairAction_findById",
  38. data: "houseRepair.id="+id,
  39. success: function(msg){
  40. $("#materialFile_update_file").children('div').remove();
  41. for(var i=0;i< msg.obj.materialFile.length;i++){
  42. var $image = $("<div style='width: 120px;height: 80px;float:left;'><a href='" + msg.obj.materialFile[i].filePath + "' rel='lightbox[materialFile_update]'><img src='" + msg.obj.materialFile[i].filePath + "' width='120' height='80'/></a><img src='images/de.png' id='img" + msg.obj.materialFile[i].id + "' onclick='removeImg(" + msg.obj.materialFile[i].id + ")' width='15' height='15' style='float: right;position: relative;top: -77px;right: 2px; cursor:pointer;'></div>");
  43. $("#materialFile_update_file").append ($image);
  44. }
  45. }
  46. });
  47. }
  48. });
  49. });
  50. }
  51. </script>
  52. <div class="easyui-tabs" id="tabs_update">
  53. <div title="维修信息" id="info_update">
  54. <form id="updateHouseRepairForm" method="post">
  55. <table class="mytable" style="width:100%;">
  56. <tr>
  57. <th width="20%">身份证号</th>
  58. <td width="30%">
  59. <input type="text" id="idCard_update" readonly="readonly" name="houseRepair.idCard">
  60. </td>
  61. <th width="20%">保障人员姓名</th>
  62. <td width="30%">
  63. <input type="hidden" id="id_update" name="houseRepair.id">
  64. <input class="easyui-validatebox" type="text" id="name_update" name="houseRepair.name" >
  65. </td>
  66. </tr>
  67. <tr>
  68. <th>联系电话</th>
  69. <td>
  70. <input type="text" id="phone_update" name="houseRepair.phone">
  71. </td>
  72. <th>故障类别</th>
  73. <td>
  74. <select name="houseRepair.repairCategory" id="repairCategory_update" class="easyui-validatebox" required="true" style="width: 172px">
  75. <option value="">请选择</option>
  76. </select>
  77. </td>
  78. </tr>
  79. <tr>
  80. <th>房源地址</th>
  81. <td colspan="3">
  82. <input type="text" id="address_update" readonly="readonly" name="houseRepair.address" style="width: 513px">
  83. </td>
  84. </tr>
  85. <tr>
  86. <th>保修期至</th>
  87. <td>
  88. <input class="easyui-validatebox" readonly="readonly" id="developerDeadline_update" name="houseRepair.house.developerDeadline">
  89. </td>
  90. <th>报修时间</th>
  91. <td>
  92. <input type="text" id="reportTime_update" name="houseRepair.reportTime" class="easyui-datebox" value="new Date()" readonly="readonly">
  93. </td>
  94. </tr>
  95. <tr>
  96. <th>报修人</th>
  97. <td>
  98. <input type="text" id="repairPeople_update" name="houseRepair.repairPeople" value="${user.fullName}">
  99. </td>
  100. <th>报修人联系电话</th>
  101. <td>
  102. <input type="text" id="repairPeoplePhone_update" name="houseRepair.repairPeoplePhone" value="${user.phone}">
  103. </td>
  104. </tr>
  105. <tr>
  106. <th>故障说明</th>
  107. <td colspan="3">
  108. <textarea rows="3" style="width: 513px" id="problem_update" name="houseRepair.problem"></textarea>
  109. </td>
  110. </tr>
  111. </table>
  112. </form>
  113. </div>
  114. <div title="故障照片" id="photo_update">
  115. <form id="materialFileUpdateForm" method="post" enctype="multipart/form-data">
  116. <table class="mytable" style="width: 100%;" id="materialFile_table">
  117. <tr >
  118. <th width = "20%">维修故障图片上传</th>
  119. <td width = "80%">
  120. <!--<span id="materialFile_update_file">
  121. <input type="hidden" id="id_materialFile_update" name="houseRepair.id" />
  122. <input type="button" value="上传" onclick="materialFile_update.click()">
  123. <input type="file" accept="image/gif, image/jpeg" multiple name="materialFile" id="materialFile_update" class="easyui-validatebox" style="float:left; width:0px" >
  124. </span>-->
  125. <div>
  126. <input type="hidden" id="id_materialFile_update" name="houseRepair.id" />
  127. <input type="button" value="上传" onclick="materialFile_update.click()">
  128. <input type="file" accept="image/gif, image/jpeg" multiple name="materialFile" id="materialFile_update" class="easyui-validatebox" style="float:left; width:0px" >
  129. </div>
  130. </td>
  131. </tr>
  132. <tr>
  133. <td colspan="2" height=110 id="materialFile_update_file">
  134. <!-- <span />-->
  135. </td>
  136. </tr>
  137. </table>
  138. </form>
  139. </div>
  140. </div>