add.jsp 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@ taglib prefix="s" uri="/struts-tags" %>
  3. <form id="addDecorationAcceptanceForm" method="post" enctype="multipart/form-data">
  4. <div class="easyui-tabs" id="tabs_update">
  5. <div title="验收信息" id="ysxx_update">
  6. <table class="mytable" style="width: 100%;">
  7. <tr>
  8. <th colspan="4">
  9. <a href="javascript:changeRenovationContract('add');" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">选择合同</a>
  10. </th>
  11. </tr>
  12. <tr>
  13. <th width="20%">合同编号</th>
  14. <td width="30%">
  15. <span id="number_add"></span>
  16. </td>
  17. <th width="20%">合同名称</th>
  18. <td width="30%">
  19. <span id="name_add"></span>
  20. <input type="hidden" name="decorationAcceptance.renovationContract.id" id="renovationContractId_add">
  21. </td>
  22. </tr>
  23. <tr>
  24. <th>合同时间</th>
  25. <td>
  26. <span id="contractDate_add"></span>
  27. </td>
  28. <th>合同金额</th>
  29. <td>
  30. <span id="money_add"></span>
  31. </td>
  32. </tr>
  33. <tr>
  34. <th>装修单位</th>
  35. <td colspan="3">
  36. <span id="company_add"></span>
  37. </td>
  38. </tr>
  39. <tr>
  40. <th>装修内容</th>
  41. <td colspan="3">
  42. <span id="content_add"></span>
  43. </td>
  44. </tr>
  45. <tr>
  46. <th>验收时间</th>
  47. <td>
  48. <input class="easyui-datebox" id="acceptanceDate_add" name="decorationAcceptance.acceptanceDate" required="true" >
  49. </td>
  50. <th>验收人</th>
  51. <td>
  52. <input class="easyui-validatebox" id="acceptance_add" name="decorationAcceptance.acceptance" required="true" >
  53. </td>
  54. </tr>
  55. <tr>
  56. <th>审计金额</th>
  57. <td>
  58. <input class="easyui-numberbox" id="auditMoney_add" name="decorationAcceptance.auditMoney" required="true" >
  59. </td>
  60. <th>审计人</th>
  61. <td>
  62. <input class="easyui-validatebox" id="auditUser_add" name="decorationAcceptance.auditUser" required="true" >
  63. </td>
  64. </tr>
  65. <tr>
  66. <th>审计时间</th>
  67. <td colspan="3">
  68. <input class="easyui-datebox" id="auditDate_add" name="decorationAcceptance.auditDate" required="true" >
  69. </td>
  70. </tr>
  71. <tr>
  72. <th>备注</th>
  73. <td colspan="3">
  74. <textarea rows="5" cols="" style="width: 100%" name="decorationAcceptance.remark"></textarea>
  75. </td>
  76. </tr>
  77. </table>
  78. </div>
  79. <div title="附件上传" id="ysxx_add">
  80. <table class="mytable" style="width: 100%;">
  81. <tr>
  82. <th width="20%">验收文件</th>
  83. <td width="80%">
  84. <span id="acceptanceFile_add_file">
  85. <input type="button" value="上传" onclick="acceptanceFile_add.click()">
  86. <input type="file" multiple name="acceptanceFile" id="acceptanceFile_add" class="easyui-validatebox" style="float:left;width:0px">
  87. </span>
  88. </td>
  89. </tr>
  90. </table>
  91. </div>
  92. </div>
  93. </form>
  94. <script type="text/javascript">
  95. var getObjectURL = function (file) {
  96. var url = null;
  97. if (window.createObjectURL != undefined) {
  98. url = window.createObjectURL(file);
  99. } else if (window.URL != undefined) {
  100. url = window.URL.createObjectURL(file);
  101. } else if (window.webkitURL != undefined) {
  102. url = window.webkitURL.createObjectURL(file);
  103. }
  104. return url;
  105. }
  106. //本地预览故障照片
  107. $(function () {
  108. $("#acceptanceFile_add").change(function(){
  109. var obj = document.getElementById("acceptanceFile_add");
  110. if(imageFormat(obj)){
  111. $("#acceptanceFile_add_file").children('div').remove();
  112. for(var i=0;i<this.files.length;i++){
  113. var $image = $("<div style='width: 120px;height: 80px;float:left;'><a href='" + getObjectURL(this.files[i]) + "' rel='lightbox[acceptanceFile_add]'><img src='" + getObjectURL(this.files[i]) + "' width='120' height='80'/></a></div>");
  114. $("#acceptanceFile_add_file").append ($image);
  115. }
  116. }
  117. });
  118. });
  119. var removeImg1=function(id){
  120. $("#img" + id).parent().remove();
  121. }
  122. </script>