| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691 |
- <!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>
- .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;
- }
- .industry_name_show {
- display: block;
- }
- .industry_name_hide {
- display: none;
- }
- </style>
- </head>
- <body layout:fragment="content">
- <article class="page-container">
- <form class="form form-horizontal" id="form-projectApplication-edit">
- <input type="hidden" th:name="id" th:id="id" th:value="${projectApply.id}"/>
- <input type="hidden" th:name="declaration_id" th:id="declaration_id" th:value="${projectApply.declaration_id}"/>
- <input type="hidden" th:name="companyInfo.company_id" th:id="companyId" th:value="${projectApply.company_id}"/>
- <input type="hidden" th:name="isDraft" th:id="isDraft" th:value="0"/>
- <div class="baseInfo">
- <div class="line">企业基本情况</div>
- <div id="companyInfo">
- <!-- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red"></span>申请企业:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <input type="text" readonly="readonly" style="width:48%" required placeholder="点击查找按钮查找公司"
- maxlength="45" class="input-text readonly" id="company_name" th:name="company_name" th:value="${companyName}"/>
- <a class="btn btn-primary" style="margin-top:0px;" th:onclick="'javascript:open_dialog(\'查找公司\',\'/build/contract/selectCompany\',\'800\',\'500\');'">
- <i class="Hui-iconfont"></i>查找</a>
- </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-4">
- <input type="text" class="input-text" th:value="${companyInfo.company_name}"
- th:name="companyInfo.company_name"/>
- <input type="hidden" th:value="${companyInfo.id}" th:name="companyInfo.id"/>
- </div>
- <label class="form-label col-xs-4 col-sm-2"> 统一社会信用代码:</label>
- <div class="formControls col-xs-8 col-sm-4">
- <input type="text" class="input-text" th:name="companyInfo.uscc" th:value="${companyInfo.uscc}"
- hidden/>
- <span>[[${companyInfo.uscc}]]</span>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red"></span>所属行业:</label>
- <div class="formControls col-xs-8 col-sm-4">
- <span class="select-box">
- <select class="select" th:name="companyInfo.industry_code" id="industryTypeList">
- <option value="">--请选择--</option>
- <option value="" th:each="item : ${industryTypeList}" th:value="${item.value}"
- th:selected="${companyInfo.industry_code==item.value}"
- th:text="${item.name}">
- </option>
- </select>
- </span>
- </div>
- <label class="form-label col-xs-4 col-sm-2"> 组织机构代码:</label>
- <div class="formControls col-xs-8 col-sm-4">
- <input type="hidden" th:name="companyInfo.organization_code"
- th:value="${companyInfo.organization_code}"/>
- <span th:value="${companyInfo.organization_code}">[[${companyInfo.organization_code}]]</span>
- </div>
- <!--<label class="form-label col-xs-4 col-sm-2"> 所属行业:</label>
- <div class="formControls col-xs-8 col-sm-4">
- <input type="text" class="input-text"th:value="${companyInfo.industry_code}" th:name="companyInfo.industry_code" />
- </div>-->
- </div>
- <div class="row cl" id="industry"
- th:class="${companyInfo.industry_name!=null&&companyInfo.industry_name!=''&&companyInfo.industry_code=='Empty'}?'industry_name_show row cl':'industry_name_hide row cl'">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red"></span>其它行业:</label>
- <div class="formControls col-xs-8 col-sm-3">
- <input type="text" class="input-text" value="" th:id="industry_name"
- th:name="companyInfo.industry_name"
- th:value="${companyInfo.industry_name}"
- placeholder="请输入所属行业"/>
- </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-4">
- <input type="text" class="input-text" th:value="${companyInfo.registration_address}"
- th:name="companyInfo.registration_address"/>
- </div>
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red"></span>注册资金:</label>
- <div class="formControls col-xs-4 col-sm-1">
- <span class="select-box">
- <select class="select" th:name="companyInfo.currency_unit" id="currency_unit">
- <!-- <option value="">--请选择货币单位--</option> -->
- <option th:selected="${companyInfo.currency_unit==item.id}" th:each="item : ${currencyList}"
- th:value="${item.id}" th:text="${item.name}"/>
- </select>
- </span>
- </div>
- <div class="formControls col-xs-6 col-sm-2">
- <input type="text" class="input-text" th:id="registration_capital"
- th:name="companyInfo.registration_capital" th:value="${companyInfo.registration_capital}"/>
- </div>
- <div class="col-xs-4 col-sm-1">(万元)</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-4">
- <input type="text" class="input-text" th:value="${companyInfo.legal_representative}"
- th:name="companyInfo.legal_representative"/>
- </div>
- <label class="form-label col-xs-4 col-sm-2"> 联系人姓名:</label>
- <div class="formControls col-xs-8 col-sm-4">
- <input type="text" class="input-text" th:value="${companyInfo.contact}"
- th:name="companyInfo.contact"/>
- </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-4">
- <input type="text" class="input-text" th:value="${companyInfo.lr_position}"
- th:name="companyInfo.lr_position"/>
- </div>
- <label class="form-label col-xs-4 col-sm-2"> 联系人职务:</label>
- <div class="formControls col-xs-8 col-sm-4">
- <input type="text" class="input-text" th:value="${companyInfo.contact_position}"
- th:name="companyInfo.contact_position"/>
- </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-4">
- <input type="text" class="input-text" th:value="${companyInfo.lr_phone}"
- th:name="companyInfo.lr_phone"/>
- </div>
- <label class="form-label col-xs-4 col-sm-2"> 联系人手机:</label>
- <div class="formControls col-xs-8 col-sm-4">
- <input type="text" class="input-text" th:value="${companyInfo.contact_phone}"
- th:name="companyInfo.contact_phone"/>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"> 总资产:</label>
- <div class="formControls col-xs-4 col-sm-1">
- <!--<input type="hidden" class="input-text" th:value="${companyInfo.total_assets_currency_unit}" name="companyInfo.total_assets_currency_unit" id="total_assets_currency_unit"/>-->
- <span class="select-box">
- <select class="select" th:name="companyInfo.total_assets_currency_unit">
- <!-- <option value="">--请选择货币单位--</option> -->
- <option th:selected="${companyInfo.total_assets_currency_unit==item.id}"
- th:each="item : ${currencyList}"
- th:value="${item.id}" th:text="${item.name}"/>
- </select>
- </span>
- </div>
- <div class="formControls col-xs-6 col-sm-2">
- <input type="text" class="input-text" th:id="total_assets" th:value="${companyInfo.total_assets}"
- th:name="companyInfo.total_assets"/>
- </div>
- <div class="col-xs-4 col-sm-1">(万元)</div>
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red"></span>固定资产净值:</label>
- <div class="formControls col-xs-4 col-sm-1">
- <span class="select-box">
- <select class="select" th:name="companyInfo.fixed_assets_currency_unit">
- <!-- <option value="">--请选择货币单位--</option> -->
- <option th:selected="${companyInfo.fixed_assets_currency_unit==item.id}"
- th:each="item : ${currencyList}" th:value="${item.id}" th:text="${item.name}"/>
- </select>
- </span>
- </div>
- <div class="formControls col-xs-6 col-sm-2">
- <input type="text" class="input-text" th:id="fixed_assets" th:value="${companyInfo.fixed_assets}"
- th:name="companyInfo.fixed_assets"/>
- </div>
- <div class="col-xs-4 col-sm-1">(万元)</div>
- </div>
- </div>
- <div class="line">企业经营情况</div>
- <table class="table table-border table-bordered table-bg table-hover" id="operationsInfoTb">
- <thead>
- <tr class="text-c">
- <th>年份</th>
- <th th:each="item,iterStat: ${operationsInfo}">
- [[${item.year}]] 年
- <input type="hidden" th:value="${item.year}"
- th:name="${'operationsInfo['+iterStat.index+'].year'}"/>
- <input type="hidden" th:value="${item.id}" th:name="${'operationsInfo['+iterStat.index+'].id'}"/>
- </th>
- </tr>
- </thead>
- <tbody>
- <tr class="text-c">
- <td>营业收入(万元)</td>
- <td th:each="item,iterStat: ${operationsInfo}">
- <input type="hidden" th:value="${item.cid}" th:name="${'operationsInfo['+iterStat.index+'].cid'}"/>
- <input type="text" class="input-text number" th:value="${item.operation_income}"
- th:name="${'operationsInfo['+iterStat.index+'].operation_income'}"/>
- </td>
- </tr>
- <tr class="text-c">
- <td>其中:产品销售收入(万元)</td>
- <td th:each="item,iterStat: ${operationsInfo}">
- <input type="text" class="input-text number" th:value="${item.sales_income}"
- th:name="${'operationsInfo['+iterStat.index+'].sales_income'}"/>
- </td>
- </tr>
- <tr class="text-c">
- <td>加工收入(万元)</td>
- <td th:each="item,iterStat: ${operationsInfo}"><input type="text" class="input-text number"
- th:value="${item.processing_income}"
- th:name="${'operationsInfo['+iterStat.index+'].processing_income'}"/>
- </td>
- </tr>
- <tr class="text-c">
- <td>入库税金(万元)</td>
- <td th:each="item,iterStat: ${operationsInfo}"><input type="text" class="input-text number"
- th:value="${item.storage_tax}"
- th:name="${'operationsInfo['+iterStat.index+'].storage_tax'}"/>
- </td>
- </tr>
- <tr class="text-c">
- <td>其中:增值税(万元)</td>
- <td th:each="item,iterStat: ${operationsInfo}"><input type="text" class="input-text number"
- th:value="${item.added_value_tax}"
- th:name="${'operationsInfo['+iterStat.index+'].added_value_tax'}"/>
- </td>
- </tr>
- <!--<tr class="text-c">
- <td>营业税(万元)</td>
- <td th:each="item,iterStat: ${operationsInfo}"><input type="text" class="input-text number"
- th:value="${item.business_tax}"
- th:name="${'operationsInfo['+iterStat.index+'].business_tax'}"/>
- </td>
- </tr>-->
- <tr class="text-c">
- <td>企业所得税(万元)</td>
- <td th:each="item,iterStat: ${operationsInfo}"><input type="text" class="input-text number"
- th:value="${item.corporate_income_tax}"
- th:name="${'operationsInfo['+iterStat.index+'].corporate_income_tax'}"/>
- </td>
- </tr>
- </tbody>
- </table>
- <div class="row cl">
- <div class="formControls col-xs-8 col-sm-4">
- <input id="isStatement" name="is_statement" type="checkbox"
- th:checked="${projectApply.is_statement}"/><strong style="color:red;">
- 本企业声明:本企业保证以上信息真实无误!</strong>
- </div>
- </div>
- <div class="line">项目申报类别 <a th:href="${instructionUrl} " target="_blank" style="color: #5b98dd;"> 下载</a></div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red"></span><span class="c-red"></span>类型:</label>
- <div class="formControls col-xs-8 col-sm-4">
- <span class="select-box">
- <select class="select" th:name="is_application" id="is_application" onChange="changeType(this)">
- <option value="">-- 全部 --</option>
- <option value="1">申请类</option>
- <option value="0">奖励类</option>
- </select>
- </span>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red"></span>项目大类:</label>
- <div class="formControls col-xs-8 col-sm-4">
- <span class="select-box">
- <select class="select" th:name="project_type" id="project_type" onChange="changeType(this)">
- <!-- <option value="" >-- 请选择申报项目种类 --</option> -->
- <!--<option th:each="item : ${projectTypeList}" th:value="${item.id}"
- th:text="${item.type_name}" th:if = "${projectApply.project_type}==${item.id}">
- </option>-->
- <option th:each="item : ${projectTypeList}" th:value="${item.id}"
- th:text="${item.type_name}" th:selected="${projectApply.project_type}==${item.id}">
- </option>
- </select>
- </span>
- </div>
- <label class="form-label col-xs-4 col-sm-2">
- <i class="Hui-iconfont Hui-iconfont-help" id="tips" title="" hidden></i>
- <span class="c-red"></span>项目小类:
- </label>
- <div class="formControls col-xs-8 col-sm-4">
- <!--<input readonly="readonly" type="text" class="input-text" th:id="project_name" th:name="project_name" th:value="${projectApply.project_name}"/>-->
- <span class="select-box">
- <input type="hidden" th:id="project_name" th:name="project_name"
- th:value="${projectApply.project_name}"/>
- <select class="select" th:name="project_id" th:id="project_id" onChange="changeProject(this)">
- <option th:each="item : ${projectNameList}" th:value="${item.id}"
- th:text="${item.project_name}" th:selected="${projectApply.project_id}==${item.id}">
- </option>
- </select>
- </span>
- <input type="hidden" th:id="project_id" th:name="project_id" th:value="${projectApply.project_id}"/>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red"></span>项目名称:</label>
- <div class="formControls col-xs-8 col-sm-4">
- <input type="text" class="input-text" th:name="customize_name" id="customize_name" th:value="${projectApply.customize_name}">
- </div>
- </div>
- <div class="row cl">
- <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
- <a class="btn btn-primary radius" onclick="createFile();" > 保存 </a>
- <button onClick="removeIframe();" class="btn btn-default radius" type="button"> 取消 </button>
- </div>
- </div>
- </div>
- <div style="display: none" id="applyFile">
- <div class="line">流程信息</div>
- <div class="row cl">
- <div class="col-xs-8 col-sm-9 col-xs-offset-2 col-sm-offset-1">
- <table class="table table-border table-bordered table-bg table-hover processTb">
- <thead>
- <tr class="text-c">
- <th>时间</th>
- <!-- <th>审核状态</th> -->
- <th>部门</th>
- <th>操作人</th>
- <th>操作</th>
- <th>审核意见</th>
- <!--<th>查看意见</th>-->
- </tr>
- </thead>
- <tbody>
- <tr class="text-c" th:each="model,iterStat:${approvalList}" th:object="${model}">
- <td th:text="*{create_time}"></td>
- <!-- <td th:text="*{before_approvalstatus_str}"></td> -->
- <td th:text="*{department}"></td>
- <td th:text="*{create_name}"></td>
- <td th:text="*{oper_type}"></td>
- <td class="viewComment" th:data="*{approval_comment}" th:text="*{approval_comment}"></td>
- <!--<td><a th:if="*{approval_comment} != null and *{approval_comment} != ''" class="viewComment" th:data="*{approval_comment}">查看</a></td>-->
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <div class="line">申报材料</div>
- <div class="row cl" id="applyMaterials">
- <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-1">
- <table class="table table-border table-bordered table-bg table-hover">
- <thead>
- <tr class="text-c">
- <th width="10%">序号</th>
- <th>附件</th>
- <th>申请材料</th>
- </tr>
- </thead>
- <tbody>
- <tr class="text-c" th:each="model,iterStat:${applyMaterials}" th:object="${model}">
- <td th:text="${iterStat.index+1}"></td>
- <td>
- <div th:if="*{templateFile.file_url}">
- <a th:href="${fileUrl} + *{templateFile.file_url}" target="_blank" style="color: #5b98dd;">[[*{templateFile.file_name}]]</a>
- </div>
- <div th:unless="*{templateFile.file_url}">
- <span>[[*{templateFile.file_name}]]</span>
- </div>
- </td>
- <td class="td_material">
- <input type="hidden" th:name="${'applyMaterials['+iterStat.index+'].id'}" th:value="*{id}"/>
- <input class="uploadFileTemplateId" type="hidden"
- th:name="${'applyMaterials['+iterStat.index+'].template_id'}"
- th:value="*{template_id}"/>
- <th:block th:if="*{fileDown}">
- <input class="uploadFileName input-text" name="uploadFileName"
- th:value="*{fileDown.file_name}" readonly="readonly" type="text"
- th:onclick="'javascript:addFile(\'添加文件\',\'/stockLand/addApplyFile/1/'+*{template_id}+'\',\'800\',\'350\');'"/>
- <input class="uploadFileId" type="hidden"
- th:name="${'applyMaterials['+iterStat.index+'].fileDown.file_id'}"
- th:value="*{fileDown.file_id}"/>
- <!--<input class="uploadFileContent" type="hidden" th:name="${'applyMaterials['+iterStat.index+'].content'}" value="annex_template"/>-->
- </th:block>
- <th:block th:unless="*{fileDown}">
- <input class="uploadFileName input-text" name="uploadFileName" readonly="readonly"
- type="text"
- th:onclick="'javascript:addFile(\'添加文件\',\'/stockLand/addApplyFile/1/'+*{template_id}+'\',\'800\',\'350\');'"/>
- <input class="uploadFileId" type="hidden"
- th:name="${'applyMaterials['+iterStat.index+'].fileDown.file_id'}"/>
- <!--<input class="uploadFileContent" type="hidden" th:name="${'applyMaterials['+iterStat.index+'].content'}" value="annex_template"/>-->
- </th:block>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <div class="row cl">
- <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
- <a class="btn btn-primary radius" onclick="saveDraft(1)"> 保存草稿 </a>
- <a class="btn btn-primary radius" onclick="saveDraft(0)"> 提交 </a>
- <button onClick="removeIframe();" class="btn btn-default radius" type="button"> 取消 </button>
- <a class="btn btn-primary radius" onclick="returnNext();" > 返回上一步 </a>
- </div>
- </div>
- </div>
- </form>
- </article>
- <script type="text/javascript" th:src="@{/js/company/project_application/apply_edit.js}"></script>
- <script th:inline="javascript">
- var fileUrl = [[${fileUrl}]];
- $(function () {
- $("#applyFile").show();
- $(".baseInfo").hide();
- $("#operationsInfoTb").find(".number").each(function (i, item) {
- $(this).rules('add', {
- required: true,
- min: 0,
- max: 999999999.999999,
- isFloat: true,
- isFloat6Fn: true
- });
- });
- });
- $("#industryTypeList").change(function () {
- if ($('#industryTypeList option:selected').val() == "Empty") {
- $("#industry").show()
- } else {
- $("#industry").hide()
- }
- });
- function saveDraft(isDraft) {
- $("#isDraft").val(isDraft);
- submit();
- }
- /**
- * 取消
- */
- function removeIframe() {
- var index = parent.layer.getFrameIndex(window.name);
- parent.layer.close(index);
- }
- function changeType(obj) {
- $.ajax({
- url: pagePath + "/project/getProjectByType",
- type: "get",
- data: {
- 'type': $("#project_type").val(),
- 'isApplication': $("#is_application").val()
- },
- dataType: "json",
- success: function (result) {
- if (result.success) {
- var projects = result.obj;
- if (projects.length > 0) {
- $("#project_id").find("option").remove();
- var options = '';
- for (var i = 0; i < projects.length; i++) {
- if(i == 0){
- $("#project_name").val(projects[i].project_name);
- }
- options += '<option value="' + projects[i].id + '">' + projects[i].project_name + '</option>';
- }
- $("#project_id").append(options);
- //获取材料模板
- // getTemplateFiles(null, projects[0].id);
- weatherTips()
- }
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- function changeProject(obj) {
- var pName = $.trim($(obj).find("option:selected").text());
- $("#project_name").val(pName);
- // getTemplateFiles(obj);
- weatherTips()
- }
- function weatherTips(){
- var text = $("#project_id").find("option:selected").text();
- if(text == "鼓励企业创新发展(1)"){
- $("#tips").attr("title","获评企国家、省工业企业质量标杆的。");
- $("#tips").show();
- }else if(text == "鼓励企业创新发展(2)"){
- $("#tips").attr("title","获评省自主工业品牌50强的。");
- $("#tips").show();
- }else if(text == "鼓励企业创新发展(3)"){
- $("#tips").attr("title","获得国家级单项冠军示范企业、培育企业、单项冠军产品企业称号。");
- $("#tips").show();
- }else if(text == "鼓励企业创新发展(4)"){
- $("#tips").attr("title","获得国家级专精特新小巨人企业、省专精特新企业(含省专精特新产品企业、科技小巨人企业、隐形冠军企业、隐形小巨人企业)、市专精特新企业称号的。");
- $("#tips").show();
- }else if(text == "鼓励企业创新发展(5)"){
- $("#tips").attr("title","列入省重点推广应用目录的新产品新技术、省重点技术创新导向性计划奖励项目的。");
- $("#tips").show();
- }else if(text == "鼓励企业创新发展(6)"){
- $("#tips").attr("title","获评中国优秀工业设计奖(产品设计)金奖、优秀奖产品,获评省工业设计产品金奖、银奖、铜奖的产品。");
- $("#tips").show();
- }else{
- $("#tips").hide();
- }
- }
- function getTemplateFiles(obj, pid) {
- var projectId = 0;
- if (pid) {
- projectId = pid;
- } else {
- projectId = $(obj).val();
- }
- $.ajax({
- url: pagePath + "/project/getProjectMaterials",
- type: "get",
- data: {
- 'id': projectId
- },
- dataType: "json",
- success: function (result) {
- if (result.success) {
- var applyMaterials = result.obj.applyMaterials;
- if (applyMaterials.length > 0) {
- $("#applyMaterials").find("tbody tr").remove();
- for (var i = 0; i < applyMaterials.length; i++) {
- var file = applyMaterials[i].templateFile;
- var tr = '<tr class="text-c" >';
- //编号
- tr += '<td class="index" > ' + (i + 1) + ' </td>';
- //模板
- tr += '<td class ="templateFile">'
- if (file && file.file_url) {
- url = fileUrl + file.file_url;
- tr += '<a href="' + url + '" target="_blank">' + file.file_name + '</a>';
- }
- tr += '</td>';
- //上传文件
- tr += '<td>';
- tr += '<input class="uploadFileTemplateId" type="hidden" name="applyMaterials[' + i + '].fileDown.file_id" value="' + applyMaterials[i].template_id + '"/>';
- tr += '<input class="uploadFileName input-text" name="uploadFileName" readonly="readonly" type="text" onclick="javascript:addFile(\'添加文件\',\'/stockLand/addApplyFile/1/' + applyMaterials[i].template_id + '\',\'800\',\'350\');"/>';
- tr += '<input class="uploadFileId" type="hidden" name="applyMaterials[' + i + '].fileDown.file_id" />';
- tr += '</td>';
- $("#applyMaterials").find("tbody").append(tr);
- }
- }
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- /**
- * 保存信息,生产附件1、3、4
- */
- function createFile() {
- if ($("#form-projectApplication-edit").valid()) {
- var valid = true;
- if (!$("#isStatement").is(":checked")) {
- errorMessage('请勾选企业声明!');
- valid = false;
- }
- if (!valid) {
- return false;
- }
- } else {
- return false;
- }
- //提交
- $("#form-projectApplication-edit").ajaxSubmit({
- type: 'post',
- url: pagePath + "/projectApplication/createFile",
- dataType: "json",
- success: function (data) {
- if (data.success) {
- // $("#id").val(data.obj.draftId);
- var applyMaterials = data.obj.fileDowns;
- console.log(applyMaterials);
- var baseFileUrl = data.obj.file_url;
- console.log(baseFileUrl);
- if(applyMaterials.length > 0){
- $("#applyMaterials").find("tbody tr").remove();
- for(var i=0;i< applyMaterials.length; i++){
- var file = applyMaterials[i];
- var tr = '<tr class="text-c" >';
- //编号
- tr +='<td class="index" > '+(i+1)+' </td>';
- //附件
- tr += '<td class ="templateFile">';
- if(baseFileUrl && file.file_url){
- tr += '<a href="'+baseFileUrl + file.file_url+'" target="_blank" style="color: #5b98dd;">'+file.file_name+'</a>';
- }else{
- tr += '<span>'+file.file_name+'</span>';
- }
- tr += '</td>';
- //上传文件
- if (file.download_uri){
- tr += '<td>';
- tr += '<input class="uploadFileTemplateId" type="hidden" name="applyMaterials['+i+'].template_id" value="'+file.file_id+'"/>';
- tr += '<input class="uploadFileName input-text" name="uploadFileName" readonly="readonly" type="text" onclick="javascript:addFile(\'添加文件\',\'/stockLand/addApplyFile/1/'+file.file_id+'\',\'800\',\'350\');"/>';
- tr += '<input class="uploadFileId" type="hidden" name="applyMaterials['+i+'].fileDown.file_id" />';
- tr += '</td>';
- }
- else {
- tr += '<td>';
- tr += '<input class="uploadFileTemplateId" type="hidden" name="applyMaterials['+i+'].template_id" value="'+file.file_id+'"/>';
- tr += '<input class="uploadFileContent" type="hidden" name="applyMaterials['+i+'].content" value="annex_template"/>';
- tr += '<input class="uploadFileName input-text" name="uploadFileName" readonly="readonly" type="text" onclick="javascript:addFile(\'添加文件\',\'/stockLand/addApplyFile/1/'+file.file_id+'\',\'800\',\'350\');"/>';
- tr += '<input class="uploadFileId" type="hidden" name="applyMaterials['+i+'].fileDown.file_id" />';
- tr += '</td>';
- }
- $("#applyMaterials").find("tbody").append(tr);
- }
- }else{
- $("#applyMaterials").find("tbody tr").remove();
- }
- $("#applyFile").show();
- $(".baseInfo").hide();
- } else {
- errorMessage(data.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- return false;
- }
- function returnNext() {
- $("#applyFile").hide();
- $(".baseInfo").show();
- }
- //查看完整意见
- $(".viewComment").on("click", function () {
- layer.alert(
- $(this).attr('data'),
- {area: ['800px', '500px']}
- )
- });
- </script>
- </body>
- </html>
|