123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
- <script type="text/javascript">
- var update_load = function(id){
-
- $.ajax({
- type: "post",//使用get方法访问后台
- dataType: "json",//返回json格式的数据
- url: "houseRepairAction_findById",//要访问的后台地址
- data: "houseRepair.id="+id,//要发送的数据
- complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
- success: function(msg){
- $("#id_update").val(msg.obj.id);
- $("#id_materialFile_update").val(msg.obj.id);
- $("#name_update").val(msg.obj.name);
- $("#idCard_update").val(msg.obj.idCard);
- $("#phone_update").val(msg.obj.phone);
- $("#address_update").val(msg.obj.address);
- $("#developerDeadline_update").val(dealDate(msg.obj.house.developerDeadline));
- $("#reportTime_update").val(msg.obj.reportTime);
- $("#problem_update").val(msg.obj.problem);
- $("#repairPeople_update").val(msg.obj.repairPeople);
- $("#repairPeoplePhone_update").val(msg.obj.repairPeoplePhone);
- $("#repairCategory_update").val(msg.obj.repairCategory);
-
- for(var i=0;i< msg.obj.materialFile.length;i++){
- 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>");
- $("#materialFile_update_file").append ($image);
- }
- }
- });
-
- $("#materialFile_update").change(function(){
- $("#materialFileUpdateForm").form('submit',{
- url : whzl.basePath+'/houseRepairAction_addUploadFile',
- success: function(result){
- $("#materialFile_update").attr("value","");
- $.ajax({
- type: "post",
- dataType: "json",//返回json格式的数据
- url: "houseRepairAction_findById",
- data: "houseRepair.id="+id,
- success: function(msg){
- $("#materialFile_update_file").children('div').remove();
- for(var i=0;i< msg.obj.materialFile.length;i++){
- 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>");
- $("#materialFile_update_file").append ($image);
- }
- }
- });
- }
- });
- });
- }
- </script>
- <div class="easyui-tabs" id="tabs_update">
- <div title="维修信息" id="info_update">
- <form id="updateHouseRepairForm" method="post">
- <table class="mytable" style="width:100%;">
- <tr>
- <th width="20%">身份证号</th>
- <td width="30%">
- <input type="text" id="idCard_update" readonly="readonly" name="houseRepair.idCard">
- </td>
- <th width="20%">保障人员姓名</th>
- <td width="30%">
- <input type="hidden" id="id_update" name="houseRepair.id">
- <input class="easyui-validatebox" type="text" id="name_update" name="houseRepair.name" >
- </td>
-
-
- </tr>
-
- <tr>
- <th>联系电话</th>
- <td>
- <input type="text" id="phone_update" name="houseRepair.phone">
- </td>
- <th>故障类别</th>
- <td>
- <select name="houseRepair.repairCategory" id="repairCategory_update" class="easyui-validatebox" required="true" style="width: 172px">
- <option value="">请选择</option>
- </select>
- </td>
- </tr>
-
- <tr>
- <th>房源地址</th>
- <td colspan="3">
- <input type="text" id="address_update" readonly="readonly" name="houseRepair.address" style="width: 513px">
- </td>
- </tr>
-
- <tr>
- <th>保修期至</th>
- <td>
- <input class="easyui-validatebox" readonly="readonly" id="developerDeadline_update" name="houseRepair.house.developerDeadline">
- </td>
-
- <th>报修时间</th>
- <td>
- <input type="text" id="reportTime_update" name="houseRepair.reportTime" class="easyui-datebox" value="new Date()" readonly="readonly">
- </td>
- </tr>
- <tr>
- <th>报修人</th>
- <td>
- <input type="text" id="repairPeople_update" name="houseRepair.repairPeople" value="${user.fullName}">
- </td>
-
- <th>报修人联系电话</th>
- <td>
- <input type="text" id="repairPeoplePhone_update" name="houseRepair.repairPeoplePhone" value="${user.phone}">
- </td>
- </tr>
-
- <tr>
- <th>故障说明</th>
- <td colspan="3">
- <textarea rows="3" style="width: 513px" id="problem_update" name="houseRepair.problem"></textarea>
- </td>
- </tr>
-
- </table>
- </form>
- </div>
- <div title="故障照片" id="photo_update">
- <form id="materialFileUpdateForm" method="post" enctype="multipart/form-data">
- <table class="mytable" style="width: 100%;" id="materialFile_table">
- <tr >
- <th width = "20%">维修故障图片上传</th>
- <td width = "80%">
- <!--<span id="materialFile_update_file">
- <input type="hidden" id="id_materialFile_update" name="houseRepair.id" />
- <input type="button" value="上传" onclick="materialFile_update.click()">
- <input type="file" accept="image/gif, image/jpeg" multiple name="materialFile" id="materialFile_update" class="easyui-validatebox" style="float:left; width:0px" >
- </span>-->
- <div>
- <input type="hidden" id="id_materialFile_update" name="houseRepair.id" />
- <input type="button" value="上传" onclick="materialFile_update.click()">
- <input type="file" accept="image/gif, image/jpeg" multiple name="materialFile" id="materialFile_update" class="easyui-validatebox" style="float:left; width:0px" >
- </div>
- </td>
- </tr>
- <tr>
- <td colspan="2" height=110 id="materialFile_update_file">
- <!-- <span />-->
- </td>
- </tr>
- </table>
- </form>
- </div>
- </div>
|