add.jsp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@ taglib prefix="s" uri="/struts-tags" %>
  3. <form id="addDecorationChangeForm" method="post" enctype="multipart/form-data">
  4. <div class="easyui-tabs" id="tabs">
  5. <div title="合同信息" id="htxx_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="15%">合同编号</th>
  14. <td width="35%">
  15. <span id="number_add"></span>
  16. </td>
  17. <th width="15%">合同名称</th>
  18. <td width="35%">
  19. <span id="name_add"></span>
  20. <input type="hidden" name="decorationChange.renovationContract.id" id="renovationContractId_add">
  21. </td>
  22. </tr>
  23. <tr>
  24. <th>装修单位</th>
  25. <td colspan="3">
  26. <span id="company_add"></span>
  27. </td>
  28. </tr>
  29. <tr>
  30. <th>装修内容</th>
  31. <td colspan="3">
  32. <span id="content_add"></span>
  33. </td>
  34. </tr>
  35. <tr>
  36. <th>变更标题</th>
  37. <td colspan="3">
  38. <input class="easyui-validatebox" required="true" id="title_add" name="decorationChange.title" style="width: 100%;">
  39. </td>
  40. </tr>
  41. <tr>
  42. <th>变更描述</th>
  43. <td colspan="3">
  44. <textarea rows="4" cols="" style="width: 100%" name="decorationChange.content"></textarea>
  45. </td>
  46. </tr>
  47. <tr>
  48. <th>变更时间</th>
  49. <td>
  50. <input class="easyui-datebox" id="businessDate_add" name="decorationChange.businessDate" required="true" >
  51. </td>
  52. <th>变更人</th>
  53. <td>
  54. <input class="easyui-validatebox" id="businessUserName_add" value="${user.fullName}" name="decorationChange.businessUserName" required="true" >
  55. </td>
  56. </tr>
  57. </table>
  58. </div>
  59. <div title="附件上传" id="fjsc_add">
  60. <table class="mytable" style="width: 100%;">
  61. <tr>
  62. <th width="20%">附件</th>
  63. <td width="80%">
  64. <span id="changeFile_add_file">
  65. <input type="button" value="上传" onclick="changeFile_add.click()">
  66. <input type="file" multiple name="changeFile" id="changeFile_add" class="easyui-validatebox" style="float:left;width:0px">
  67. </span>
  68. </td>
  69. </tr>
  70. </table>
  71. </div>
  72. </div>
  73. </form>
  74. <script type="text/javascript">
  75. var getObjectURL = function (file) {
  76. var url = null;
  77. if (window.createObjectURL != undefined) {
  78. url = window.createObjectURL(file);
  79. } else if (window.URL != undefined) {
  80. url = window.URL.createObjectURL(file);
  81. } else if (window.webkitURL != undefined) {
  82. url = window.webkitURL.createObjectURL(file);
  83. }
  84. return url;
  85. }
  86. //本地预览故障照片
  87. $(function () {
  88. $("#changeFile_add").change(function(){
  89. var obj = document.getElementById("changeFile_add");
  90. if(imageFormat(obj)){
  91. $("#changeFile_add_file").children('div').remove();
  92. for(var i=0;i<this.files.length;i++){
  93. var $image = $("<div style='width: 120px;height: 80px;float:left;'><a href='" + getObjectURL(this.files[i]) + "' rel='lightbox[changeFile_add]'><img src='" + getObjectURL(this.files[i]) + "' width='120' height='80'/></a></div>");
  94. $("#changeFile_add_file").append ($image);
  95. }
  96. }
  97. });
  98. });
  99. var removeImg1=function(id){
  100. $("#img" + id).parent().remove();
  101. }
  102. </script>