houseRepairAdd.jsp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <script type="text/javascript">
  3. var getObjectURL = function (file) {
  4. var url = null;
  5. if (window.createObjectURL != undefined) {
  6. url = window.createObjectURL(file);
  7. } else if (window.URL != undefined) {
  8. url = window.URL.createObjectURL(file);
  9. } else if (window.webkitURL != undefined) {
  10. url = window.webkitURL.createObjectURL(file);
  11. }
  12. return url;
  13. }
  14. //本地预览故障照片
  15. $(function () {
  16. $("#materialFile_add").change(function(){
  17. alert(132)
  18. var obj = document.getElementById('materialFile_add') ;
  19. if(imageFormat(obj)){
  20. $("#materialFile_add_file").children('div').remove();
  21. for(var i=0;i<this.files.length;i++){
  22. //var $image = $("<div style='width: 100px;height: 40px;float:left;'><a href='" + getObjectURL(this.files[i]) + "' rel='lightbox[materialFile_add]'><img src='" + getObjectURL(this.files[i]) + "' width='100' height='40' /></a></div>");
  23. var $image = $("<div style='width: 120px;height: 80px;float:left;'><a href='" + getObjectURL(this.files[i]) + "' rel='lightbox[materialFile_add]'><img src='" + getObjectURL(this.files[i]) + "' width='120' height='80'/></a><img src='images/de.png' id='img" + i + "' onclick='removeImg1(" + i + ")' width='15' height='15' style='float: right;position: relative;top: -77px;right: 2px; cursor:pointer;'></div>");
  24. $("#materialFile_add_file").append ($image);
  25. }
  26. }
  27. })
  28. });
  29. var removeImg1=function(id){
  30. $("#img" + id).parent().remove();
  31. }
  32. //从租房合同中获取基本信息
  33. function addHouseRepairFromLeaseContract(){
  34. $('#contractDialog').dialog({
  35. buttons : [{
  36. text : '确定',
  37. iconCls : 'icon-ok',
  38. handler : function(){
  39. var leaseContractId = selectId_submit();
  40. $("#leaseContractId_add").val(leaseContractId);
  41. $("#contractDialog").dialog("close");
  42. }
  43. },{
  44. text : '取消',
  45. iconCls : 'icon-cancel',
  46. handler : function(){
  47. $("#contractDialog").dialog("close");
  48. }
  49. }],
  50. onLoad : function(){
  51. select_load1();
  52. }
  53. });
  54. }
  55. //根据房屋id号获取信息
  56. function addHouseRepairFromHouse(){
  57. $("#addHouseDialog").dialog({
  58. buttons : [{
  59. text : '确定',
  60. iconCls : 'icon-ok',
  61. handler : function(){
  62. var houseIds = house_select_submit();
  63. $.ajax({
  64. type: "post",//使用get方法访问后台
  65. dataType: "json",//返回json格式的数据
  66. url: "houseAction_findById",//要访问的后台地址
  67. data: "house.id="+houseIds,//要发送的数据
  68. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  69. success: function(msg){//msg为返回的数据,在这里做数据绑定
  70. $("#name_add").val(msg.obj.lessee);
  71. $("#idCard_add").val(msg.obj.lesseeId);
  72. $("#phone_add").val(msg.obj.lesseeTel);
  73. $("#houseId_add").val(msg.obj.id);
  74. $("#houseAddress_add").val(msg.obj.address);
  75. $("#developerDeadline_add").datebox('setValue', dealDate(msg.obj.developerDeadline));
  76. $("#addHouseDialog").dialog("close");
  77. if(msg.obj.decorationId!=undefined){
  78. $.ajax({
  79. type: "post",//使用get方法访问后台
  80. dataType: "json",//返回json格式的数据
  81. url: "decorationAction_findById",//要访问的后台地址
  82. data: "decoration.id="+msg.obj.decorationId,//要发送的数据
  83. complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
  84. success: function(msg2){
  85. $("#decorationId_houseRepairAdd").val(msg2.obj.id);
  86. $("#decorationName_houseRepairAdd").val(msg2.obj.name);
  87. $("#dm_parlor_houseRepairAdd").val(msg2.obj.dm_parlor);
  88. $("#qm_parlor_houseRepairAdd").val(msg2.obj.qm_parlor);
  89. $("#xdd_parlor_houseRepairAdd").val(msg2.obj.xdd_parlor);
  90. $("#dm_kitchen_houseRepairAdd").val(msg2.obj.dm_kitchen);
  91. $("#qm_kitchen_houseRepairAdd").val(msg2.obj.qm_kitchen);
  92. $("#dd_kitchen_houseRepairAdd").val(msg2.obj.dd_kitchen);
  93. $("#cg_kitchen_houseRepairAdd").val(msg2.obj.cg_kitchen);
  94. $("#yyj_kitchen_houseRepairAdd").val(msg2.obj.yyj_kitchen);
  95. $("#rqz_kitchen_houseRepairAdd").val(msg2.obj.rqz_kitchen);
  96. $("#xcp_kitchen_houseRepairAdd").val(msg2.obj.xcp_kitchen);
  97. $("#slt_kitchen_houseRepairAdd").val(msg2.obj.slt_kitchen);
  98. $("#xdd_kitchen_houseRepairAdd").val(msg2.obj.xdd_kitchen);
  99. $("#rqrsq_kitchen_houseRepairAdd").val(msg2.obj.rqrsq_kitchen);
  100. $("#dm_bathroom_houseRepairAdd").val(msg2.obj.dm_bathroom);
  101. $("#qm_bathroom_houseRepairAdd").val(msg2.obj.qm_bathroom);
  102. $("#dd_bathroom_houseRepairAdd").val(msg2.obj.dd_bathroom);
  103. $("#yb_bathroom_houseRepairAdd").val(msg2.obj.yb_bathroom);
  104. $("#hs_bathroom_houseRepairAdd").val(msg2.obj.hs_bathroom);
  105. $("#mt_bathroom_houseRepairAdd").val(msg2.obj.mt_bathroom);
  106. $("#xlp_bathroom_houseRepairAdd").val(msg2.obj.xlp_bathroom);
  107. $("#xdd_bathroom_houseRepairAdd").val(msg2.obj.xdd_bathroom);
  108. $("#tzm_houseRepairAdd").val(msg2.obj.tzm);
  109. }
  110. })
  111. }
  112. }
  113. });
  114. }
  115. }],
  116. onLoad : function(){
  117. //house_select_load('&house.houseState=5');
  118. house_select_load();
  119. }
  120. });
  121. }
  122. </script>
  123. <div class="easyui-tabs" id="tabs_add">
  124. <div title="维修信息" id="info_add">
  125. <table class="mytable" style="width: 100%;" >
  126. <tr>
  127. <th>
  128. <a href="javascript:addHouseRepairFromHouse();" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">从房源中选择</a>
  129. </th>
  130. </tr>
  131. </table>
  132. <form id="addHouseRepairForm" method="post">
  133. <table class="mytable" style="width:100%;">
  134. <tr>
  135. <th width="20%">身份证号</th>
  136. <td width="30%">
  137. <input type="text" id="idCard_add" name="houseRepair.idCard">
  138. </td>
  139. <th width="20%">保障人员姓名</th>
  140. <td width="30%">
  141. <input class="easyui-validatebox" type="text" id="name_add" name="houseRepair.name">
  142. <input type="hidden" id="houseId_add" name="houseRepair.houseId" />
  143. </td>
  144. </tr>
  145. <tr>
  146. <th>联系电话</th>
  147. <td>
  148. <input type="text" id="phone_add" name="houseRepair.phone">
  149. </td>
  150. <th>故障类别</th>
  151. <td>
  152. <select name="houseRepair.repairCategory" id="repairCategory_add" class="easyui-validatebox" required="true" style="width:172px">
  153. <option value="">请选择</option>
  154. </select>
  155. </td>
  156. </tr>
  157. <tr>
  158. <th>小区地址</th>
  159. <td colspan="3">
  160. <input class="easyui-validatebox" readonly="readonly" id="houseAddress_add" name="houseRepair.address" style="width:513">
  161. </td>
  162. </tr>
  163. <tr>
  164. <th>保修期至</th>
  165. <td>
  166. <input class="easyui-datebox" id="developerDeadline_add" name="houseRepair.developerDeadline">
  167. </td>
  168. <th>报修时间</th>
  169. <td>
  170. <input type="text" id="reportTime_add" name="houseRepair.reportTime" class="easyui-datebox" value="new Date()" readonly="readonly">
  171. </td>
  172. </tr>
  173. <tr>
  174. <th>报修人</th>
  175. <td>
  176. <input type="text" id="repairPeople_add" name="houseRepair.repairPeople">
  177. </td>
  178. <th>报修人联系电话</th>
  179. <td>
  180. <input type="text" id="repairPeoplePhone_add" name="houseRepair.repairPeoplePhone">
  181. </td>
  182. </tr>
  183. <tr>
  184. <th>故障说明</th>
  185. <td colspan="3">
  186. <textarea rows="3" style="width: 513" id="problem_add" name="houseRepair.problem" class="easyui-validatebox" required="true" ></textarea>
  187. </td>
  188. </tr>
  189. </table>
  190. </form>
  191. </div>
  192. <div title="故障照片" id="photo_add">
  193. <form id="materialFileAddForm" method="post" enctype="multipart/form-data">
  194. <table class="mytable" style="width: 100%;">
  195. <tr>
  196. <th width="20%">上传附件</th>
  197. <td width="80%">
  198. <div >
  199. <input type="hidden" id="id_materialFile" name="houseRepair.id" />
  200. <input type="file" accept="image/gif, image/jpeg" multiple name="materialFile" id="materialFile_add" class="easyui-validatebox" style="float:left; width:0px"/>
  201. <input type="button" value="上传" onclick="materialFile_add.click()">
  202. </div>
  203. </td>
  204. </tr>
  205. <tr>
  206. <td colspan="2" id="materialFile_add_file" height=110>
  207. </td>
  208. </tr>
  209. </table>
  210. </form>
  211. </div>
  212. <!-- <div title="装修清单" id="decoration_add">
  213. <form id="addDecorationFormFromHouseRepair" method="post">
  214. <table class="mytable" style="width: 100%;">
  215. <tr>
  216. <th>清单名称</th>
  217. <td colspan="3">
  218. <input type="hidden" id="decorationId_houseRepairAdd" name="decoration.id" value="0"/>
  219. <input type="text" id="decorationName_houseRepairAdd" name="decoration.name" style="width: 500px;" class="easyui-validatebox" />
  220. </td>
  221. </tr>
  222. <tr>
  223. <th colspan="4">一:客厅、卧室、阳台</th>
  224. </tr>
  225. <tr>
  226. <th>地面:</th>
  227. <td colspan="3"><input type="text" id="dm_parlor_houseRepairAdd" name="decoration.dm_parlor" style="width: 500px;"/></td>
  228. </tr>
  229. <tr>
  230. <th width="20%">墙面:</th>
  231. <td width="30%"><input type="text" id="qm_parlor_houseRepairAdd" name="decoration.qm_parlor"/></td>
  232. <th width="20%">吸顶灯:</th>
  233. <td width="30%"><input type="text" id="xdd_parlor_houseRepairAdd" name="decoration.xdd_parlor"/></td>
  234. </tr>
  235. <tr>
  236. <th colspan="4">二:厨房</th>
  237. </tr>
  238. <tr>
  239. <th>地面:</th>
  240. <td><input type="text" id="dm_kitchen_houseRepairAdd" name="decoration.dm_kitchen"/></td>
  241. <th>墙面:</th>
  242. <td><input type="text" id="qm_kitchen_houseRepairAdd" name="decoration.qm_kitchen"/></td>
  243. </tr>
  244. <tr>
  245. <th>吊顶:</th>
  246. <td><input type="text" id="dd_kitchen_houseRepairAdd" name="decoration.dd_kitchen"/></td>
  247. <th>橱柜:</th>
  248. <td><input type="text" id="cg_kitchen_houseRepairAdd" name="decoration.cg_kitchen"/></td>
  249. </tr>
  250. <tr>
  251. <th>油烟机:</th>
  252. <td><input type="text" id="yyj_kitchen_houseRepairAdd" name="decoration.yyj_kitchen"/></td>
  253. <th>燃气灶:</th>
  254. <td><input type="text" id="rqz_kitchen_houseRepairAdd" name="decoration.rqz_kitchen"/></td>
  255. </tr>
  256. <tr>
  257. <th>洗菜盆:</th>
  258. <td><input type="text" id="xcp_kitchen_houseRepairAdd" name="decoration.xcp_kitchen"/></td>
  259. <th>水龙头:</th>
  260. <td><input type="text" id="slt_kitchen_houseRepairAdd" name="decoration.slt_kitchen"/></td>
  261. </tr>
  262. <tr>
  263. <th>吸顶灯:</th>
  264. <td><input type="text" id="xdd_kitchen_houseRepairAdd" name="decoration.xdd_kitchen"/></td>
  265. <th>燃气热水器:</th>
  266. <td><input type="text" id="rqrsq_kitchen_houseRepairAdd" name="decoration.rqrsq_kitchen"/></td>
  267. </tr>
  268. <tr>
  269. <th colspan="4">三:卫生间</th>
  270. </tr>
  271. <tr>
  272. <th>地面:</th>
  273. <td><input type="text" id="dm_bathroom_houseRepairAdd" name="decoration.dm_bathroom"/></td>
  274. <th>墙面:</th>
  275. <td><input type="text" id="qm_bathroom_houseRepairAdd" name="decoration.qm_bathroom"/></td>
  276. </tr>
  277. <tr>
  278. <th>吊顶:</th>
  279. <td><input type="text" id="dd_bathroom_houseRepairAdd" name="decoration.dd_bathroom"/></td>
  280. <th>浴霸:</th>
  281. <td><input type="text" id="yb_bathroom_houseRepairAdd" name="decoration.yb_bathroom"/></td>
  282. </tr>
  283. <tr>
  284. <th>花洒:</th>
  285. <td><input type="text" id="hs_bathroom_houseRepairAdd" name="decoration.hs_bathroom"/></td>
  286. <th>马桶:</th>
  287. <td><input type="text" id="mt_bathroom_houseRepairAdd" name="decoration.mt_bathroom"/></td>
  288. </tr>
  289. <tr>
  290. <th>立柱洗脸盆:</th>
  291. <td><input type="text" id="xlp_bathroom_houseRepairAdd" name="decoration.xlp_bathroom"/></td>
  292. <th>吸顶灯:</th>
  293. <td><input type="text" id="xdd_bathroom_houseRepairAdd" name="decoration.xdd_bathroom"/></td>
  294. </tr>
  295. <tr>
  296. <th>四、套装门</th>
  297. <td colspan="3"><input type="text" id="tzm_houseRepairAdd" name="decoration.tzm" style="width: 500px"/></td>
  298. </tr>
  299. </table>
  300. </form>
  301. </div>-->
  302. </div>