feedback_append.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. <!DOCTYPE HTML>
  2. <html xmlns:th="http://www.thymeleaf.org"
  3. xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  4. layout:decorate="~{admin/common/common}">
  5. <head>
  6. <title>添加</title>
  7. <style>
  8. multiple:hover .dropdown-clear-all, .dropdown-single:hover .dropdown-clear-all {
  9. display: none;
  10. }
  11. .line {
  12. display: block;
  13. text-align: left;
  14. background-color: #fff;
  15. color: #333;
  16. border-bottom: 1px solid #0a6999;
  17. border-color: #fff;
  18. border-bottom: 1px solid #0a6999;
  19. margin-top: 10px;
  20. vertical-align: middle;
  21. padding: 4px 12px;
  22. height: 31px;
  23. line-height: 31px;
  24. font-size: 14px;
  25. font-weight: bold;
  26. }
  27. </style>
  28. </head>
  29. <body layout:fragment="content">
  30. <article class="page-container">
  31. <form class="form form-horizontal">
  32. <div class="line">基本信息 <span style="float:right">项目来源:[[${data?.resource}]]</span></div>
  33. <div class="row cl">
  34. <label class="form-label col-xs-4 col-sm-2">项目标题:</label>
  35. <div class="formControls col-xs-4 col-sm-2">
  36. <p>[[${data?.title}]]</p>
  37. </div>
  38. <label class="form-label col-xs-2 col-sm-2">项目阶段:</label>
  39. <div class="formControls col-xs-4 col-sm-2">
  40. <p>[[${data?.process_stage_desc}]]</p>
  41. </div>
  42. </div>
  43. <div class="row cl">
  44. <label class="form-label col-xs-4 col-sm-2">项目用地:</label>
  45. <div class="formControls col-xs-8 col-sm-2">
  46. <p>[[${data?.location}]]</p>
  47. </div>
  48. <label class="form-label col-xs-2 col-sm-2">项目状态:</label>
  49. <div class="formControls col-xs-4 col-sm-2">
  50. <p>[[${data?.approve_status_desc}]]</p>
  51. </div>
  52. </div>
  53. <div class="row cl">
  54. <label class="form-label col-xs-4 col-sm-2"><span>项目介绍:</span></label>
  55. <div class="formControls col-xs-8 col-sm-9">
  56. <div th:utext="${data.content}">
  57. </div>
  58. </div>
  59. </div>
  60. <div class="row cl">
  61. <label class="form-label col-xs-4 col-sm-2"><span>附件:</span></label>
  62. <div class="formControls col-xs-8 col-sm-9">
  63. <!-- <div id="fileListPre" class="uploader-list">-->
  64. <!-- <th:block th:unless="${data.fileDown==null || data.fileDown.file_url== null}">-->
  65. <!-- <a style="color: #0c80fe;" th:href="${fileUrl} + ${data.fileDown.file_url}" target="_blank">[[${data.fileDown.file_name}]]</a>-->
  66. <!-- </th:block>-->
  67. <!-- </div>-->
  68. <div class="uploader-list">
  69. <th:block th:unless="${data.fileList==null}"
  70. th:each="item,itemStat: ${data.fileList}">
  71. <p><a style="color: #0c80fe;" th:href="${fileUrl} + ${item.file_url}" target="_blank">[[${item.file_name}]]</a>
  72. </p>
  73. </th:block>
  74. </div>
  75. </div>
  76. </div>
  77. <div class="line">项目信息补充</div>
  78. <div class="row cl">
  79. <label class="form-label col-xs-4 col-sm-2"><span>补充信息:</span></label>
  80. <div class="formControls col-xs-8 col-sm-9">
  81. <div th:utext="${data.supplement}">
  82. </div>
  83. </div>
  84. </div>
  85. <div class="row cl">
  86. <label class="form-label col-xs-4 col-sm-2"><span>补充附件:</span></label>
  87. <div class="formControls col-xs-8 col-sm-9">
  88. <div class="uploader-list">
  89. <th:block th:unless="${data.supplement_file==null || data.supplement_file.file_url== null}">
  90. <a style="color: #0c80fe;" th:href="${fileUrl} + ${data.supplement_file.file_url}"
  91. target="_blank">[[${data.supplement_file.file_name}]]</a>
  92. </th:block>
  93. </div>
  94. </div>
  95. </div>
  96. </form>
  97. <form class="form form-horizontal" id="form-add">
  98. <input hidden th:name="id" th:value="${data.id}"/>
  99. <div th:if="*{canAsk}" th:each="item,itemStat: ${consulDepartmentList}">
  100. <div class="line">[[${item.name}]]</div>
  101. <div class="row cl">
  102. <label class="form-label col-xs-4 col-sm-2"></label>
  103. <div class="formControls col-xs-8 col-sm-9">
  104. <input th:checked="${item.isDefault}" th:disabled="${item.isDefault}" type="checkbox"
  105. th:name="'defaultList['+${itemStat.index}+']'" th:value="${item.id}">要求反馈意见
  106. </div>
  107. </div>
  108. <div class="row cl" th:id=" 'department'+${item.id}">
  109. <label class="form-label col-xs-4 col-sm-2"></label>
  110. <div class="formControls col-xs-8 col-sm-9">
  111. <div><i class="Hui-iconfont" style="cursor: pointer;"
  112. th:onclick="'javascript:addFileLine(\''+'department'+${item.id}+'\')'">&#xe600; 添加</i></div>
  113. <table class="table table-border table-bordered table-bg table-hover ">
  114. <thead>
  115. <tr class="text-c">
  116. <th>咨询问题</th>
  117. <th>操作</th>
  118. </tr>
  119. </thead>
  120. <tbody class="add_file_line" th:id="'tbody_department'+${item.id}">
  121. <!--<tr class="text-c" th:unless="${landSupplyCons.isDefault}"-->
  122. <!--<tr class="text-c"
  123. th:each="landSupplyCons,landSupplyConsStat: ${industrialLandSupplyConsultationList}"
  124. th:if="*{item.id+''==landSupplyCons.department_id}"
  125. th:unless="${landSupplyCons.consultation == '请反馈明确意见'}"
  126. >-->
  127. <tr class="text-c"
  128. th:each="landSupplyCons,landSupplyConsStat: ${industrialLandSupplyConsultationList}"
  129. th:if="*{item.id+''==landSupplyCons.department_id}"
  130. >
  131. <td class="td_material">
  132. <input type="text" class="input-text consultation" placeholder="请输入咨询的问题"
  133. th:name="'consultationList[1'+${landSupplyConsStat.index}+${itemStat.index}+'].consultation'"
  134. th:value="${landSupplyCons.consultation}" readonly="readonly"/>
  135. <input class="department_id" type="hidden"
  136. th:name="'consultationList[1'+${landSupplyConsStat.index}+${itemStat.index}+'].department_id'"
  137. th:value="${item.id}"/>
  138. <input type="hidden"
  139. th:name="'consultationList[1'+${landSupplyConsStat.index}+${itemStat.index}+'].id'"
  140. th:value="${landSupplyCons.id}"/>
  141. </td>
  142. <td class="icon_font">
  143. <!--<i class='Hui-iconfont' onclick='removeLine(this)'>&#xe6a1; 删除</i>-->
  144. </td>
  145. </tr>
  146. </tbody>
  147. </table>
  148. </div>
  149. </div>
  150. </div>
  151. <div class="row cl text-c" style="margin-top: 15px; background-color: white">
  152. <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
  153. <a onclick="save()" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe632;</i>提交 </a>
  154. <a onClick="removeIframe();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</a>
  155. </div>
  156. </div>
  157. </form>
  158. </article>
  159. <script type="text/javascript" th:src="@{/h-ui/lib/webuploader/0.1.5/webuploader.min.js}"></script>
  160. <script th:inline="javascript">
  161. //取消
  162. function removeIframe() {
  163. var index = parent.layer.getFrameIndex(window.name);
  164. parent.layer.close(index);
  165. }
  166. function save() {
  167. state = "0";
  168. $("#form-add").ajaxSubmit({
  169. type: 'post',
  170. url: pagePath + "/land_supply/feedback_append",
  171. dataType: "json",
  172. data: {
  173. state: state
  174. },
  175. success: function (data) {
  176. if (data.success) {
  177. succeedMessage(data.message);
  178. setTimeClose();
  179. } else {
  180. // $(form).find(":submit").attr("disabled", false);
  181. errorMessage(data.message);
  182. }
  183. },
  184. error: function () {
  185. errorMessage('系统错误!');
  186. }
  187. });
  188. }
  189. var consulDepartmentList = [[${consulDepartmentList}]];
  190. var index = consulDepartmentList.length;
  191. function addFileLine(divId) {
  192. var length = index;
  193. if ($("#" + divId).find('.add_file_line>tr').length > 0) {
  194. var html = "<i class='Hui-iconfont' onclick='removeLine(this)'>&#xe6a1; 删除</i>";
  195. $("#" + divId).find(".add_file_line tr:eq(0)").clone().insertAfter($("#" + divId).find('.add_file_line>tr').eq(-1))
  196. .find(".consultation").removeAttr("name").attr("name", "consultationList[" + length + "].consultation").val("").end()
  197. .find(".department_id").removeAttr("name").attr("name", "consultationList[" + length + "].department_id").end()
  198. .find(".consultation").removeAttr("readonly").end()
  199. .find(".icon_font").html(html).end();
  200. } else {
  201. var str = "";
  202. str += "<tr class='text-c'>"
  203. str += "<td class='td_material'>"
  204. str += "<input type='text' class='input-text consultation' placeholder='请输入咨询的问题' name='consultationList[" + length + "].consultation'/>"
  205. str += "<input class='department_id' type='hidden' value='" + divId.split("department")[1] + "' name='consultationList[" + length + "].department_id' />"
  206. str += "</td>"
  207. str += "<td class='icon_font'><i class='Hui-iconfont' onclick='removeLine(this)'>&#xe6a1; 删除</i>"
  208. str += "</td>"
  209. str += "</tr>"
  210. $("#tbody_" + divId).html(str);
  211. }
  212. $('#layui-layer2').height(48);
  213. index++;
  214. }
  215. // function addFileLine(divId) {
  216. // // var length = $("#" + divId).find(".add_file_line tr").length;
  217. // var length = index;
  218. // var html = "<i class='Hui-iconfont' onclick='removeLine(this)'>&#xe6a1;</i>";
  219. // $("#" + divId).find(".add_file_line tr:eq(0)").clone().insertAfter($("#" + divId).find('.add_file_line>tr').eq(-1))
  220. // .find(".consultation").removeAttr("name").attr("name", "consultationList[" + length + "].consultation").val("").end()
  221. // .find(".department_id").removeAttr("name").attr("name", "consultationList[" + length + "].department_id").end()
  222. // .find(".icon_font").html(html).end();
  223. // $('#layui-layer2').height(48);
  224. // index++;
  225. // }
  226. // function addFileLine(divId) {
  227. // var length = $("#" + divId).find(".add_file_line tr").length;
  228. // var html = "<i class='Hui-iconfont' onclick='removeLine(this)'>&#xe6a1;</i>";
  229. // $("#" + divId).find(".add_file_line tr:eq(0)").clone().insertAfter($("#" + divId).find('.add_file_line>tr').eq(-1))
  230. // .find(".consultation").removeAttr("name").attr("name", divId + "[" + length + "].consultation").val("").end()
  231. // .find(".department_id").removeAttr("name").attr("name", divId + "[" + length + "].department_id").end()
  232. // .find(".icon_font").html(html).end();
  233. // $('#layui-layer2').height(48);
  234. // }
  235. function removeLine(obj) {
  236. if ($(obj).parent().parent().siblings().length < 1) {
  237. $(obj).parent().parent().parent().parent().parent().siblings('.cl').children('.formControls').children('input')[0].checked = false
  238. } else {
  239. let canChecked = false
  240. $(obj).parent().parent().siblings().each(function (index, item) {
  241. if ($(this).children('.td_material').children('.consultation')[0].attr(value != '')) {
  242. canChecked = true
  243. }
  244. })
  245. $(obj).parent().parent().parent().parent().parent().siblings('.cl').children('.formControls').children('input')[0].checked = canChecked
  246. }
  247. $(obj).parent().parent().remove();
  248. }
  249. $(document).ready(function () {
  250. $('input[name^="consultationList"]').blur(function () {
  251. console.log('blur事件触发')
  252. $('input[name^="consultationList"]').each(function (index, item) {
  253. if (item.value) {
  254. console.log('输入框内有值')
  255. $(this).parent().parent().parent().parent().parent().siblings('.cl').children('.formControls').children('input')[0].checked = true
  256. // let defaultIndex = 'defaultList[' + item.name.split('.')[0].split('')[item.name.split('.')[0].split('').length-2] + ']'
  257. // $('input[name^="defaultList"]').each(function(vindex,vitem){
  258. // if (vitem.name == defaultIndex) {
  259. // vitem.checked = true
  260. // }
  261. // })
  262. } else {
  263. if ($(this).parent().parent().siblings().length < 1) {
  264. console.log('同级元素少于一个')
  265. $(this).parent().parent().parent().parent().parent().siblings('.cl').children('.formControls').children('input')[0].checked = false
  266. } else {
  267. console.log('同级元素大于一个要判断是否为空')
  268. let canChecked = false
  269. $(this).parent().parent().siblings().each(function (index, item) {
  270. if ($(this).children('.td_material').children('.consultation')[0].attr(value != '')) {
  271. canChecked = true
  272. }
  273. })
  274. $(this).parent().parent().parent().parent().parent().siblings('.cl').children('.formControls').children('input')[0].checked = canChecked
  275. }
  276. }
  277. })
  278. })
  279. })
  280. </script>
  281. </body>
  282. </html>