| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304 |
- <!DOCTYPE HTML>
- <html xmlns:th="http://www.thymeleaf.org"
- xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
- layout:decorate="~{admin/common/common}">
- <head>
- <title>添加</title>
- <style>
- multiple:hover .dropdown-clear-all, .dropdown-single:hover .dropdown-clear-all {
- display: none;
- }
- .line {
- display: block;
- text-align: left;
- background-color: #fff;
- color: #333;
- border-bottom: 1px solid #0a6999;
- border-color: #fff;
- border-bottom: 1px solid #0a6999;
- margin-top: 10px;
- vertical-align: middle;
- padding: 4px 12px;
- height: 31px;
- line-height: 31px;
- font-size: 14px;
- font-weight: bold;
- }
- </style>
- </head>
- <body layout:fragment="content">
- <article class="page-container">
- <form class="form form-horizontal">
- <div class="line">基本信息 <span style="float:right">项目来源:[[${data?.resource}]]</span></div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2">项目标题:</label>
- <div class="formControls col-xs-4 col-sm-2">
- <p>[[${data?.title}]]</p>
- </div>
- <label class="form-label col-xs-2 col-sm-2">项目阶段:</label>
- <div class="formControls col-xs-4 col-sm-2">
- <p>[[${data?.process_stage_desc}]]</p>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2">项目用地:</label>
- <div class="formControls col-xs-8 col-sm-2">
- <p>[[${data?.location}]]</p>
- </div>
- <label class="form-label col-xs-2 col-sm-2">项目状态:</label>
- <div class="formControls col-xs-4 col-sm-2">
- <p>[[${data?.approve_status_desc}]]</p>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span>项目介绍:</span></label>
- <div class="formControls col-xs-8 col-sm-9">
- <div th:utext="${data.content}">
- </div>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span>附件:</span></label>
- <div class="formControls col-xs-8 col-sm-9">
- <!-- <div id="fileListPre" class="uploader-list">-->
- <!-- <th:block th:unless="${data.fileDown==null || data.fileDown.file_url== null}">-->
- <!-- <a style="color: #0c80fe;" th:href="${fileUrl} + ${data.fileDown.file_url}" target="_blank">[[${data.fileDown.file_name}]]</a>-->
- <!-- </th:block>-->
- <!-- </div>-->
- <div class="uploader-list">
- <th:block th:unless="${data.fileList==null}"
- th:each="item,itemStat: ${data.fileList}">
- <p><a style="color: #0c80fe;" th:href="${fileUrl} + ${item.file_url}" target="_blank">[[${item.file_name}]]</a>
- </p>
- </th:block>
- </div>
- </div>
- </div>
- <div class="line">项目信息补充</div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span>补充信息:</span></label>
- <div class="formControls col-xs-8 col-sm-9">
- <div th:utext="${data.supplement}">
- </div>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span>补充附件:</span></label>
- <div class="formControls col-xs-8 col-sm-9">
- <div class="uploader-list">
- <th:block th:unless="${data.supplement_file==null || data.supplement_file.file_url== null}">
- <a style="color: #0c80fe;" th:href="${fileUrl} + ${data.supplement_file.file_url}"
- target="_blank">[[${data.supplement_file.file_name}]]</a>
- </th:block>
- </div>
- </div>
- </div>
- </form>
- <form class="form form-horizontal" id="form-add">
- <input hidden th:name="id" th:value="${data.id}"/>
- <div th:if="*{canAsk}" th:each="item,itemStat: ${consulDepartmentList}">
- <div class="line">[[${item.name}]]</div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"></label>
- <div class="formControls col-xs-8 col-sm-9">
- <input th:checked="${item.isDefault}" th:disabled="${item.isDefault}" type="checkbox"
- th:name="'defaultList['+${itemStat.index}+']'" th:value="${item.id}">要求反馈意见
- </div>
- </div>
- <div class="row cl" th:id=" 'department'+${item.id}">
- <label class="form-label col-xs-4 col-sm-2"></label>
- <div class="formControls col-xs-8 col-sm-9">
- <div><i class="Hui-iconfont" style="cursor: pointer;"
- th:onclick="'javascript:addFileLine(\''+'department'+${item.id}+'\')'"> 添加</i></div>
- <table class="table table-border table-bordered table-bg table-hover ">
- <thead>
- <tr class="text-c">
- <th>咨询问题</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody class="add_file_line" th:id="'tbody_department'+${item.id}">
- <!--<tr class="text-c" th:unless="${landSupplyCons.isDefault}"-->
- <!--<tr class="text-c"
- th:each="landSupplyCons,landSupplyConsStat: ${industrialLandSupplyConsultationList}"
- th:if="*{item.id+''==landSupplyCons.department_id}"
- th:unless="${landSupplyCons.consultation == '请反馈明确意见'}"
- >-->
- <tr class="text-c"
- th:each="landSupplyCons,landSupplyConsStat: ${industrialLandSupplyConsultationList}"
- th:if="*{item.id+''==landSupplyCons.department_id}"
- >
- <td class="td_material">
- <input type="text" class="input-text consultation" placeholder="请输入咨询的问题"
- th:name="'consultationList[1'+${landSupplyConsStat.index}+${itemStat.index}+'].consultation'"
- th:value="${landSupplyCons.consultation}" readonly="readonly"/>
- <input class="department_id" type="hidden"
- th:name="'consultationList[1'+${landSupplyConsStat.index}+${itemStat.index}+'].department_id'"
- th:value="${item.id}"/>
- <input type="hidden"
- th:name="'consultationList[1'+${landSupplyConsStat.index}+${itemStat.index}+'].id'"
- th:value="${landSupplyCons.id}"/>
- </td>
- <td class="icon_font">
- <!--<i class='Hui-iconfont' onclick='removeLine(this)'> 删除</i>-->
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div class="row cl text-c" style="margin-top: 15px; background-color: white">
- <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
- <a onclick="save()" class="btn btn-primary radius"><i class="Hui-iconfont"></i>提交 </a>
- <a onClick="removeIframe();" class="btn btn-default radius" type="button"> 取消 </a>
- </div>
- </div>
- </form>
- </article>
- <script type="text/javascript" th:src="@{/h-ui/lib/webuploader/0.1.5/webuploader.min.js}"></script>
- <script th:inline="javascript">
- //取消
- function removeIframe() {
- var index = parent.layer.getFrameIndex(window.name);
- parent.layer.close(index);
- }
- function save() {
- state = "0";
- $("#form-add").ajaxSubmit({
- type: 'post',
- url: pagePath + "/land_supply/feedback_append",
- dataType: "json",
- data: {
- state: state
- },
- success: function (data) {
- if (data.success) {
- succeedMessage(data.message);
- setTimeClose();
- } else {
- // $(form).find(":submit").attr("disabled", false);
- errorMessage(data.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- var consulDepartmentList = [[${consulDepartmentList}]];
- var index = consulDepartmentList.length;
- function addFileLine(divId) {
- var length = index;
- if ($("#" + divId).find('.add_file_line>tr').length > 0) {
- var html = "<i class='Hui-iconfont' onclick='removeLine(this)'> 删除</i>";
- $("#" + divId).find(".add_file_line tr:eq(0)").clone().insertAfter($("#" + divId).find('.add_file_line>tr').eq(-1))
- .find(".consultation").removeAttr("name").attr("name", "consultationList[" + length + "].consultation").val("").end()
- .find(".department_id").removeAttr("name").attr("name", "consultationList[" + length + "].department_id").end()
- .find(".consultation").removeAttr("readonly").end()
- .find(".icon_font").html(html).end();
- } else {
- var str = "";
- str += "<tr class='text-c'>"
- str += "<td class='td_material'>"
- str += "<input type='text' class='input-text consultation' placeholder='请输入咨询的问题' name='consultationList[" + length + "].consultation'/>"
- str += "<input class='department_id' type='hidden' value='" + divId.split("department")[1] + "' name='consultationList[" + length + "].department_id' />"
- str += "</td>"
- str += "<td class='icon_font'><i class='Hui-iconfont' onclick='removeLine(this)'> 删除</i>"
- str += "</td>"
- str += "</tr>"
- $("#tbody_" + divId).html(str);
- }
- $('#layui-layer2').height(48);
- index++;
- }
- // function addFileLine(divId) {
- // // var length = $("#" + divId).find(".add_file_line tr").length;
- // var length = index;
- // var html = "<i class='Hui-iconfont' onclick='removeLine(this)'></i>";
- // $("#" + divId).find(".add_file_line tr:eq(0)").clone().insertAfter($("#" + divId).find('.add_file_line>tr').eq(-1))
- // .find(".consultation").removeAttr("name").attr("name", "consultationList[" + length + "].consultation").val("").end()
- // .find(".department_id").removeAttr("name").attr("name", "consultationList[" + length + "].department_id").end()
- // .find(".icon_font").html(html).end();
- // $('#layui-layer2').height(48);
- // index++;
- // }
- // function addFileLine(divId) {
- // var length = $("#" + divId).find(".add_file_line tr").length;
- // var html = "<i class='Hui-iconfont' onclick='removeLine(this)'></i>";
- // $("#" + divId).find(".add_file_line tr:eq(0)").clone().insertAfter($("#" + divId).find('.add_file_line>tr').eq(-1))
- // .find(".consultation").removeAttr("name").attr("name", divId + "[" + length + "].consultation").val("").end()
- // .find(".department_id").removeAttr("name").attr("name", divId + "[" + length + "].department_id").end()
- // .find(".icon_font").html(html).end();
- // $('#layui-layer2').height(48);
- // }
- function removeLine(obj) {
- if ($(obj).parent().parent().siblings().length < 1) {
- $(obj).parent().parent().parent().parent().parent().siblings('.cl').children('.formControls').children('input')[0].checked = false
- } else {
- let canChecked = false
- $(obj).parent().parent().siblings().each(function (index, item) {
- if ($(this).children('.td_material').children('.consultation')[0].attr(value != '')) {
- canChecked = true
- }
- })
- $(obj).parent().parent().parent().parent().parent().siblings('.cl').children('.formControls').children('input')[0].checked = canChecked
- }
- $(obj).parent().parent().remove();
- }
- $(document).ready(function () {
- $('input[name^="consultationList"]').blur(function () {
- console.log('blur事件触发')
- $('input[name^="consultationList"]').each(function (index, item) {
- if (item.value) {
- console.log('输入框内有值')
- $(this).parent().parent().parent().parent().parent().siblings('.cl').children('.formControls').children('input')[0].checked = true
- // let defaultIndex = 'defaultList[' + item.name.split('.')[0].split('')[item.name.split('.')[0].split('').length-2] + ']'
- // $('input[name^="defaultList"]').each(function(vindex,vitem){
- // if (vitem.name == defaultIndex) {
- // vitem.checked = true
- // }
- // })
- } else {
- if ($(this).parent().parent().siblings().length < 1) {
- console.log('同级元素少于一个')
- $(this).parent().parent().parent().parent().parent().siblings('.cl').children('.formControls').children('input')[0].checked = false
- } else {
- console.log('同级元素大于一个要判断是否为空')
- let canChecked = false
- $(this).parent().parent().siblings().each(function (index, item) {
- if ($(this).children('.td_material').children('.consultation')[0].attr(value != '')) {
- canChecked = true
- }
- })
- $(this).parent().parent().parent().parent().parent().siblings('.cl').children('.formControls').children('input')[0].checked = canChecked
- }
- }
- })
- })
- })
- </script>
- </body>
- </html>
|