四算概算,合作对象

master
OathK1per 2022-08-16 14:35:12 +08:00
parent 9ed0de19e4
commit 60209e41e1
8 changed files with 423 additions and 102 deletions

View File

@ -768,4 +768,16 @@ public class ProjectController extends BaseController {
return ResponseMsg.buildSuccessMsg("提交成功");
}
/**
*
*/
@RequestMapping("/downloadUrl")
@ResponseBody
public void downloadUrl(int id, HttpServletResponse response) throws Exception {
Project project = projectRepository.findOne(id);
String url = project.getCollaboratorUrl();
}
}

View File

@ -795,7 +795,7 @@ public class ProjectBudgetService {
*/
@Transactional(rollbackFor = RuntimeException.class)
public Project budgetEditSave(Project project, Project projectInDb, BudgetBean budgetBean, Admin admin, ApproveStatusEnum approveStatusEnum) {
Project p = projectService.editProject(project, projectInDb);
Project p = projectService.estimateEditProject(project, projectInDb);
p.setStatus(StatusEnum.BUDGET_ACCOUNTS.getStatus());
p.setStatusDesc(StatusEnum.BUDGET_ACCOUNTS.getStatusDesc());
p.setApproveStatusBudget(approveStatusEnum.getApproveStatus());

View File

@ -214,6 +214,57 @@ public class ProjectService {
return project;
}
public Project estimateEditProject(Project project, Project projectInDb) {
//只有如下可以修改
projectInDb.setName(project.getName());
projectInDb.setCustomer(project.getCustomer());
projectInDb.setTerminalCustomer(project.getTerminalCustomer());
projectInDb.setIndustryScenario(project.getIndustryScenario());
projectInDb.setType(project.getType());
projectInDb.setTypeDesc(TypeEnum.parseType(project.getType()).getTypeDesc());
projectInDb.setUnderwrittenMode(project.getUnderwrittenMode());
projectInDb.setUnderwrittenModeStr(UnderwrittenModeEnum.parseUnderwrittenMode(project.getUnderwrittenMode()).getUnderwrittenModeStr());
projectInDb.setCertainty(project.getCertainty());
projectInDb.setCertaintyStr(CertaintyEnum.parseCertainty(project.getCertainty()).getCertaintyStr());
projectInDb.setIsSecond(project.getIsSecond());
projectInDb.setIsSecondStr(IsSecondEnum.parseIsSecond(project.getIsSecond()).getIsSecondStr());
projectInDb.setSignType(project.getSignType());
projectInDb.setSignTypeStr(SignTypeEnum.parseSignType(project.getSignType()).getSignTypeStr());
projectInDb.setResolvePlan(project.getResolvePlan());
projectInDb.setResolvePlanStr(ResolvePlanEnum.parseResolvePlan(project.getResolvePlan()).getResolvePlanStr());
projectInDb.setCollaborator(project.getCollaborator());
projectInDb.setCollaboratorUrl(project.getCollaboratorUrl());
projectInDb.setGrossProfit(project.getGrossProfit());
projectInDb.setGrossProfitMargin(project.getGrossProfitMargin());
projectInDb.setStartDate(project.getStartDate());
projectInDb.setEndDate(project.getEndDate());
projectInDb.setContractAmount(project.getContractAmount());
projectInDb.setHuazhiProductAmount(project.getHuazhiProductAmount());
projectInDb.setHuizhiProductAmount(project.getHuizhiProductAmount());
projectInDb.setHuasanProductAmount(project.getHuasanProductAmount());
projectInDb.setZiguangOtherAmount(project.getZiguangOtherAmount());
projectInDb.setPrincipal(project.getPrincipal());
projectInDb.setContractTime(project.getContractTime());
projectInDb.setBidsTime(project.getBidsTime());
projectInDb.setAdvanceInterestAmount(project.getAdvanceInterestAmount());
projectInDb.setAdvancePeakAmount(project.getAdvancePeakAmount());
projectInDb.setMainContractCollectionTerms(project.getMainContractCollectionTerms());
projectInDb.setMainContractResolvePlan(project.getMainContractResolvePlan());
projectInDb.setCalculationCollection(project.getCalculationCollection());
projectInDb.setValueRisk(project.getValueRisk());
projectInDb.setOtherName(project.getOtherName());
projectInDb.setPlanStartStr(project.getPlanStartStr());
projectInDb.setPlanEndStr(project.getPlanEndStr());
/// projectInDb.setApproveStatusEstimate(approveStatusEnum.getApproveStatus());
projectInDb.setLastUpdateTime(new Date());
return projectInDb;
}
public Project editProject(Project project, Project projectInDb) {
//只有如下可以修改
@ -235,6 +286,7 @@ public class ProjectService {
// projectInDb.setResolvePlanStr(ResolvePlanEnum.parseResolvePlan(project.getResolvePlan()).getResolvePlanStr());
projectInDb.setCollaborator(project.getCollaborator());
projectInDb.setCollaboratorUrl(project.getCollaboratorUrl());
projectInDb.setGrossProfit(project.getGrossProfit());
projectInDb.setGrossProfitMargin(project.getGrossProfitMargin());
projectInDb.setStartDate(project.getStartDate());

View File

@ -58,6 +58,8 @@ BUDGET_PLAN_DETAIL={
var result = 0;
$(function () {
generateFileupload('icon');
$("input[name='costCompanyManageTaxExclude']").change(function () {
digitalSelf("costCompanyManageTaxExclude", "input[name='costCompanyManageTaxExclude']");
});
@ -82,6 +84,8 @@ $(function () {
$("#saveDraft").click(function () {
$("#saveDraft").attr('disabled', true);
$("#collaboratorUrl").val($("#collaboratorUrl_span").text());
checkName();
if (result == 1) {
@ -199,6 +203,8 @@ $(function () {
});
$("#saveApprove").click(function () {
$("#saveApprove").attr('disabled', true);
$("#collaboratorUrl").val($("#collaboratorUrl_span").text());
checkName();
if (result == 1) {

View File

@ -214,24 +214,18 @@
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
</div>
<div class="am-g am-form-group am-margin-top">
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span><input readonly style="text-align: right;width: 69px ;margin-bottom: 12px;" value="合作对象"></div>
<div class="am-g am-form-group am-margin-top" id="coop" <#if project.underwrittenMode! != 1>hidden</#if>>
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>合作对象</div>
<div class="am-u-sm-6 am-u-md-6">
<input readonly value="${project.collaborator!}" />
<input readonly value="${project.collaborator!}"></input>
</div>
<div class="am-form-file am-text-xs">
<button type="button" class="am-btn am-btn-primary am-btn-sm">
<i class="am-icon-cloud-upload"></i> 下载附件
<a href="${project.collaboratorUrl!}" download>
<i class="am-icon-cloud-upload"></i> 下载附件
</a>
</button>
<input id="fileupload_button_icon" type="file" name="files[]" multiple>
</div>
<!-- The global progress bar -->
<div id="progress-area-icon" class="am-margin-top-sm am-hide">
<div id="progress-text-icon" class="am-text-xs am-text-right"></div>
<div id="progress" class="am-progress am-progress-xs">
<div class="am-progress-bar" style="width: 0%"></div>
</div>
</div>
</div>
@ -2757,6 +2751,7 @@
</@defaultLayout.layout>
<script>
$(function () {
$("#subTab").find('a').on('opened.tabs.amui', function(e) {
console.log(e)

View File

@ -127,7 +127,7 @@
<div class="am-g am-form-group am-margin-top">
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>垫资模式</div>
<div class="am-u-sm-6 am-u-md-6">
<select data-am-selected id="underwrittenMode" name="underwrittenMode">
<select data-am-selected id="underwrittenMode" name="underwrittenMode" onchange="changeCheck()">
<option value="1" <#if project.underwrittenMode=1>selected</#if>>A类-不垫资(战略合作)</option>
<option value="2" <#if project.underwrittenMode=2>selected</#if>>B类-不垫资(背靠背)</option>
<option value="3" <#if project.underwrittenMode=3>selected</#if>>C类-垫资(账期覆盖)</option>
@ -137,28 +137,30 @@
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
</div>
<#-- <div class="am-g am-form-group am-margin-top">-->
<#-- <div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>合作对象</div>-->
<#-- <div class="am-u-sm-6 am-u-md-6">-->
<#-- <input type="text" class="am-input" data-validate-async data-validation-message="请输入合作对象"-->
<#-- name="collaborator" id="collaborator" placeholder="请输入合作对象" maxlength="20"-->
<#-- value="${project.collaborator!}" />-->
<#-- </div>-->
<div class="am-g am-form-group am-margin-top" id="coop" <#if project.underwrittenMode! != 1>hidden</#if>>
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>合作对象</div>
<div class="am-u-sm-6 am-u-md-6">
<input type="text" class="am-input" data-validate-async data-validation-message="请输入合作对象"
name="collaborator" id="collaborator" placeholder="请输入合作对象" maxlength="20"
value="${project.collaborator!}" />
</div>
<#-- <div class="am-form-file am-text-xs">-->
<#-- <button type="button" class="am-btn am-btn-primary am-btn-sm">-->
<#-- <i class="am-icon-cloud-upload"></i> 下载附件-->
<#-- </button>-->
<#-- <input id="fileupload_button_icon" type="file" name="files[]" multiple>-->
<#-- </div>-->
<#-- <!-- The global progress bar &ndash;&gt;-->
<#-- <div id="progress-area-icon" class="am-margin-top-sm am-hide">-->
<#-- <div id="progress-text-icon" class="am-text-xs am-text-right"></div>-->
<#-- <div id="progress" class="am-progress am-progress-xs">-->
<#-- <div class="am-progress-bar" style="width: 0%"></div>-->
<#-- </div>-->
<#-- </div>-->
<#-- </div>-->
<div class="am-form-file am-text-xs">
<button type="button" class="am-btn am-btn-primary am-btn-sm">
<i class="am-icon-cloud-upload"></i> 上传附件
</button>
<input id="file_upload_icon" type="file" name="files[]" >
<span id="collaboratorUrl_span">${project.collaboratorUrl!}</span>
<input id="collaboratorUrl" name="collaboratorUrl" type="hidden" value="${project.collaboratorUrl!}"/>
</div>
<!-- The global progress bar -->
<div id="progress-area-icon" class="am-margin-top-sm am-hide">
<div id="progress-text-icon" class="am-text-xs am-text-right"></div>
<div id="progress" class="am-progress am-progress-xs">
<div class="am-progress-bar" style="width: 0%"></div>
</div>
</div>
</div>
<div class="am-g am-form-group am-margin-top">
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>项目把握度</div>
@ -1215,6 +1217,80 @@
<script src="${base}/assets/js/project_budget_cost.js"></script>
<script src="${base}/assets/js/project_budget_cost_project_manage.js"></script>
<script src="${base}/assets/js/project_budget_plan.js"></script>
<script src="../common/jQuery-File-Upload/js/vendor/jquery.ui.widget.js"></script>
<script type="text/javascript" src="../common/jQuery-File-Upload/js/jquery.iframe-transport.js"></script>
<script type="text/javascript" src="../common/jQuery-File-Upload/js/jquery.fileupload.js"></script>
<script src="../common/jQuery-File-Upload/js/jquery.fileupload-process.js"></script>
<script src="../common/jQuery-File-Upload/js/jquery.fileupload-validate.js"></script>
<script>
var changeCheck = function () {
var underwrittenMode = $("#underwrittenMode").val();
if (underwrittenMode == 1) {
$("#coop").show();
} else {
$("#coop").hide();
}
};
var generateFileupload = function (name) {
var progressArea = $("#progress-area-" + name);//div
var progressText = $("#progress-text-" + name);//进度条提示
var progressBar = $(".am-progress-bar");//进度条
$("#file_upload_icon").fileupload({
url: "${base}/file/upload",
dataType: 'json',
maxFileSize: 50 * 1024 * 1024,
maxNumberOfFiles: 1,
start: function (e) {
progressArea.removeClass("am-hide");
progressText.removeClass("am-text-danger");
progressText.html("");
progressBar.css("width", "0%");
},
done: function (e, data) {
console.log(data);
//设置服务器返回的url
$("#collaboratorUrl").val(data.result.data.url);
$("#collaboratorUrl_span").text(data.result.data.url);
// console.log("collboratorUrl: " + $("#collaboratorUrl").val());
setTimeout(function () {
progressArea.addClass("am-hide");
}, 1500);
},
progressall: function (e, data) {
var progress = parseInt(data.loaded / data.total * 100, 10);
console.log(progress);
progressBar.css("width", progress + "%");
progressText.html(progress + "%");
},
error: function (jqXHR2, textStatus, errorThrown) {
progressArea.removeClass("am-hide");
progressText.addClass("am-text-danger");
progressText.html("imageupload error");
progressBar.css("width", "0%");
setTimeout(function () {
progressArea.addClass("am-hide");
}, 2000);
},
fail: function (jqXHR2, textStatus) {
progressArea.removeClass("am-hide");
progressText.addClass("am-text-danger");
progressText.html("imageupload fail");
progressBar.css("width", "0%");
setTimeout(function () {
progressArea.addClass("am-hide");
}, 2000);
},
processfail: function (e, data) {
var currentFile = data.files[data.index];
if (data.files.error && currentFile.error) {
parent.layer.msg(currentFile.error);
}
}
});
};
</script>
</@defaultLayout.layout>

View File

@ -87,7 +87,7 @@
<div class="am-g am-form-group am-margin-top">
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>垫资模式</div>
<div class="am-u-sm-6 am-u-md-6">
<select data-am-selected id="underwrittenMode" name="underwrittenMode">
<select data-am-selected id="underwrittenMode" name="underwrittenMode" onchange="changeCheck()">
<option value="1" >A类-不垫资(战略合作)</option>
<option value="2" >B类-不垫资(背靠背)</option>
<option value="3" >C类-垫资(账期覆盖)</option>
@ -97,28 +97,30 @@
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
</div>
<#-- <div class="am-g am-form-group am-margin-top">-->
<#-- <div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>合作对象</div>-->
<#-- <div class="am-u-sm-6 am-u-md-6">-->
<#-- <input type="text" class="am-input" data-validate-async data-validation-message="请输入合作对象"-->
<#-- name="collaborator" id="collaborator" placeholder="请输入合作对象" maxlength="20"-->
<#-- value="" />-->
<#-- </div>-->
<div class="am-g am-form-group am-margin-top" id="coop">
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>合作对象</div>
<div class="am-u-sm-6 am-u-md-6">
<input type="text" class="am-input" data-validate-async data-validation-message="请输入合作对象"
name="collaborator" id="collaborator" placeholder="请输入合作对象" maxlength="20"
value="" />
</div>
<#-- <div class="am-form-file am-text-xs">-->
<#-- <button type="button" class="am-btn am-btn-primary am-btn-sm">-->
<#-- <i class="am-icon-cloud-upload"></i> 上传附件-->
<#-- </button>-->
<#-- <input id="fileupload_button_icon" type="file" name="files[]" multiple>-->
<#-- </div>-->
<#-- <!-- The global progress bar &ndash;&gt;-->
<#-- <div id="progress-area-icon" class="am-margin-top-sm am-hide">-->
<#-- <div id="progress-text-icon" class="am-text-xs am-text-right"></div>-->
<#-- <div id="progress" class="am-progress am-progress-xs">-->
<#-- <div class="am-progress-bar" style="width: 0%"></div>-->
<#-- </div>-->
<#-- </div>-->
<#-- </div>-->
<div class="am-form-file am-text-xs">
<button type="button" class="am-btn am-btn-primary am-btn-sm">
<i class="am-icon-cloud-upload"></i> 上传附件
</button>
<input id="file_upload_icon" type="file" name="files[]" >
<span id="collaboratorUrl_span"></span>
<input id="collaboratorUrl" type="hidden" value=""/>
</div>
<!-- The global progress bar -->
<div id="progress-area-icon" class="am-margin-top-sm am-hide">
<div id="progress-text-icon" class="am-text-xs am-text-right"></div>
<div id="progress" class="am-progress am-progress-xs">
<div class="am-progress-bar" style="width: 0%"></div>
</div>
</div>
</div>
<div class="am-g am-form-group am-margin-top">
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>项目把握度</div>
@ -622,14 +624,33 @@
</div>
<script src="${base}/assets/js/project_common.js"></script>
<script src="${base}/assets/js/project_estimate.js"></script>
<script src="../common/jQuery-File-Upload/js/vendor/jquery.ui.widget.js"></script>
<script type="text/javascript" src="../common/jQuery-File-Upload/js/jquery.iframe-transport.js"></script>
<script type="text/javascript" src="../common/jQuery-File-Upload/js/jquery.fileupload.js"></script>
<script src="../common/jQuery-File-Upload/js/jquery.fileupload-process.js"></script>
<script src="../common/jQuery-File-Upload/js/jquery.fileupload-validate.js"></script>
<script>
var result = 0;
var projectNoResult = 0;
var rateResult = 0;
var check = 0;
var changeCheck = function () {
var underwrittenMode = $("#underwrittenMode").val();
if (underwrittenMode == 1) {
$("#coop").show();
} else {
$("#coop").hide();
}
};
$(function () {
generateFileupload('icon');
calIncomeAndCost();
$("#saveDraft").click(function () {
$("#collaboratorUrl").val($("#collaboratorUrl_span").text());
check = 0;
$("#saveDraft").attr('disabled',true);
checkIfFillIn();
@ -645,6 +666,8 @@
});
$("#saveApprove").click(function () {
$("#collaboratorUrl").val($("#collaboratorUrl_span").text());
check = 0;
$("#saveApprove").attr('disabled',true);
checkIfFillIn();
@ -661,6 +684,7 @@
});
function checkIfFillIn() {
var underwrittenMode = $("#underwrittenMode").val();
var startTime = $("#startDate").val();
var endTime = $("#endDate").val();
var name = $("#name").val();
@ -670,6 +694,7 @@
var industryScenario = $("#industryScenario").val();
// var mainContractCollectionTerms = $("#mainContractCollectionTerms").val();
var valueRisk = $("#valueRisk").val();
var collaborator = $("#collaborator").val();
// var principal = $("#principal").val();
// var contractTime = $("#contractTime").val();
@ -740,6 +765,12 @@
return;
}
if (underwrittenMode == 1 && (collaborator == undefined || collaborator.length <= 0 )) {
window.confirm('合作对象不能为空');
check = 1;
return;
}
if (customer == undefined || customer.length <= 0 ) {
window.confirm('客户名称不能为空');
check = 1;
@ -919,6 +950,66 @@
value = value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的
return Number(value);
}
var generateFileupload = function (name) {
var progressArea = $("#progress-area-" + name);//div
var progressText = $("#progress-text-" + name);//进度条提示
var progressBar = $(".am-progress-bar");//进度条
$("#file_upload_icon").fileupload({
url: "${base}/file/upload",
dataType: 'json',
maxFileSize: 50 * 1024 * 1024,
maxNumberOfFiles: 1,
start: function (e) {
progressArea.removeClass("am-hide");
progressText.removeClass("am-text-danger");
progressText.html("");
progressBar.css("width", "0%");
},
done: function (e, data) {
console.log(data);
//设置服务器返回的url
$("#collaboratorUrl").val(data.result.data.url);
$("#collaboratorUrl_span").text(data.result.data.url);
// console.log("collboratorUrl: " + $("#collaboratorUrl").val());
setTimeout(function () {
progressArea.addClass("am-hide");
}, 1500);
},
progressall: function (e, data) {
var progress = parseInt(data.loaded / data.total * 100, 10);
console.log(progress);
progressBar.css("width", progress + "%");
progressText.html(progress + "%");
},
error: function (jqXHR2, textStatus, errorThrown) {
progressArea.removeClass("am-hide");
progressText.addClass("am-text-danger");
progressText.html("imageupload error");
progressBar.css("width", "0%");
setTimeout(function () {
progressArea.addClass("am-hide");
}, 2000);
},
fail: function (jqXHR2, textStatus) {
progressArea.removeClass("am-hide");
progressText.addClass("am-text-danger");
progressText.html("imageupload fail");
progressBar.css("width", "0%");
setTimeout(function () {
progressArea.addClass("am-hide");
}, 2000);
},
processfail: function (e, data) {
var currentFile = data.files[data.index];
if (data.files.error && currentFile.error) {
parent.layer.msg(currentFile.error);
}
}
});
};
</script>
</@defaultLayout.layout>

View File

@ -49,7 +49,7 @@
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>项目名称</div>
<div class="am-u-sm-6 am-u-md-6">
<input type="text" class="am-input" data-validate-async data-validation-message="请输入项目名称1000字符以内"
name="name" placeholder="请输入项目名称1000字符以内" maxlength="1000"
name="name" placeholder="请输入项目名称1000字符以内" maxlength="1000" id="name"
value="${project.name!}" required/>
</div>
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
@ -97,7 +97,7 @@
<div class="am-g am-form-group am-margin-top">
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>垫资模式</div>
<div class="am-u-sm-6 am-u-md-6">
<select data-am-selected id="underwrittenMode" name="underwrittenMode">
<select data-am-selected id="underwrittenMode" name="underwrittenMode" onchange="changeCheck()">
<option value="1" <#if project.underwrittenMode=1>selected</#if>>A类-不垫资(战略合作)</option>
<option value="2" <#if project.underwrittenMode=2>selected</#if>>B类-不垫资(背靠背)</option>
<option value="3" <#if project.underwrittenMode=3>selected</#if>>C类-垫资(账期覆盖)</option>
@ -107,28 +107,30 @@
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
</div>
<#-- <div class="am-g am-form-group am-margin-top">-->
<#-- <div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>合作对象</div>-->
<#-- <div class="am-u-sm-6 am-u-md-6">-->
<#-- <input type="text" class="am-input" data-validate-async data-validation-message="请输入合作对象"-->
<#-- name="collaborator" id="collaborator" placeholder="请输入合作对象" maxlength="20"-->
<#-- value="${project.collaborator!}" />-->
<#-- </div>-->
<div class="am-g am-form-group am-margin-top" id="coop" <#if project.underwrittenMode! != 1>hidden</#if>>
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>合作对象</div>
<div class="am-u-sm-6 am-u-md-6">
<input type="text" class="am-input" data-validate-async data-validation-message="请输入合作对象"
name="collaborator" id="collaborator" placeholder="请输入合作对象" maxlength="20"
value="${project.collaborator!}" />
</div>
<#-- <div class="am-form-file am-text-xs">-->
<#-- <button type="button" class="am-btn am-btn-primary am-btn-sm">-->
<#-- <i class="am-icon-cloud-upload"></i> 上传附件-->
<#-- </button>-->
<#-- <input id="fileupload_button_icon" type="file" name="files[]" multiple>-->
<#-- </div>-->
<#-- <!-- The global progress bar &ndash;&gt;-->
<#-- <div id="progress-area-icon" class="am-margin-top-sm am-hide">-->
<#-- <div id="progress-text-icon" class="am-text-xs am-text-right"></div>-->
<#-- <div id="progress" class="am-progress am-progress-xs">-->
<#-- <div class="am-progress-bar" style="width: 0%"></div>-->
<#-- </div>-->
<#-- </div>-->
<#-- </div>-->
<div class="am-form-file am-text-xs">
<button type="button" class="am-btn am-btn-primary am-btn-sm">
<i class="am-icon-cloud-upload"></i> 上传附件
</button>
<input id="file_upload_icon" type="file" name="files[]" >
<span id="collaboratorUrl_span">${project.collaboratorUrl!}</span>
<input id="collaboratorUrl" name="collaboratorUrl" type="hidden" value="${project.collaboratorUrl!}"/>
</div>
<!-- The global progress bar -->
<div id="progress-area-icon" class="am-margin-top-sm am-hide">
<div id="progress-text-icon" class="am-text-xs am-text-right"></div>
<div id="progress" class="am-progress am-progress-xs">
<div class="am-progress-bar" style="width: 0%"></div>
</div>
</div>
</div>
<div class="am-g am-form-group am-margin-top">
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>项目把握度</div>
@ -146,7 +148,7 @@
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>行业场景应用</div>
<div class="am-u-sm-6 am-u-md-6">
<input type="text" class="am-input" data-validate-async data-validation-message="请输入行业场景应用"
name="industryScenario" placeholder="请输入行业场景应用" maxlength="20"
name="industryScenario" placeholder="请输入行业场景应用" maxlength="20" id="industryScenario"
value="${project.industryScenario!}" required/>
</div>
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
@ -156,7 +158,7 @@
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>客户名称</div>
<div class="am-u-sm-6 am-u-md-6">
<input type="text" class="am-input" data-validate-async data-validation-message="请输入客户名称1000字符以内"
name="customer" placeholder="请输入客户名称1000字符以内" maxlength="1000"
name="customer" placeholder="请输入客户名称1000字符以内" maxlength="1000" id="customer"
value="${project.customer}" required/>
</div>
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
@ -166,7 +168,7 @@
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>终端客户名称</div>
<div class="am-u-sm-6 am-u-md-6">
<input type="text" class="am-input" data-validate-async data-validation-message="请输入终端客户名称1000字符以内"
name="terminalCustomer" placeholder="请输入终端客户名称1000字符以内" maxlength="1000"
name="terminalCustomer" placeholder="请输入终端客户名称1000字符以内" maxlength="1000" id="terminalCustomer"
value="${project.terminalCustomer}" required/>
</div>
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
@ -176,7 +178,7 @@
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>合同金额</div>
<div class="am-u-sm-6 am-u-md-6">
<input type="text" class="number am-input" data-validate-async data-validation-message="请输入合同金额"
name="contractAmount" placeholder="单位(元)" maxlength="20"
name="contractAmount" placeholder="单位(元)" maxlength="20" id="contractAmount"
value="${Utils.format(project.contractAmount)}" required />
</div>
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
@ -206,7 +208,7 @@
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>华智产品金额</div>
<div class="am-u-sm-6 am-u-md-6">
<input type="text" class="number am-input" data-validation-message="华智产品金额"
name="huazhiProductAmount" placeholder="单位(元)" maxlength="20"
name="huazhiProductAmount" placeholder="单位(元)" maxlength="20" id="huazhiProductAmount"
value="${Utils.format(project.huazhiProductAmount, "0.00")}" required />
</div>
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
@ -216,7 +218,7 @@
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>汇智产品金额</div>
<div class="am-u-sm-6 am-u-md-6">
<input type="text" class="number am-input" data-validation-message="请输入汇智产品金额"
name="huizhiProductAmount" placeholder="单位(元)" maxlength="20"
name="huizhiProductAmount" placeholder="单位(元)" maxlength="20" id="huizhiProductAmount"
value="${Utils.format(project.huizhiProductAmount, "0.00")}" required />
</div>
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
@ -226,7 +228,7 @@
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>华三产品金额</div>
<div class="am-u-sm-6 am-u-md-6">
<input type="text" class="number am-input" data-validation-message="华三产品金额"
name="huasanProductAmount" placeholder="单位(元)" maxlength="20"
name="huasanProductAmount" placeholder="单位(元)" maxlength="20" id="huasanProductAmount"
value="${Utils.format(project.huasanProductAmount, "0.00")}" required />
</div>
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
@ -236,7 +238,7 @@
<div class="am-u-sm-4 am-u-md-2 am-text-right"><span style="color: red;">*</span>其他产品金额</div>
<div class="am-u-sm-6 am-u-md-6">
<input type="text" class="number am-input" data-validation-message="请输入其他产品金额"
name="ziguangOtherAmount" placeholder="单位(元)" maxlength="20"
name="ziguangOtherAmount" placeholder="单位(元)" maxlength="20" id="ziguangOtherAmount"
value="${Utils.format(project.ziguangOtherAmount, "0.00")}" required />
</div>
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
@ -334,7 +336,7 @@
<div class="am-u-sm-4 am-u-md-2 am-text-right">垫资利息</div>
<div class="am-u-sm-6 am-u-md-6">
<input type="text" class="number am-input" data-validate-async data-validation-message="请输入垫资利息"
name="advanceInterestAmount" placeholder="单位(元)" maxlength="16"
name="advanceInterestAmount" placeholder="单位(元)" maxlength="16" id="advanceInterestAmount"
value="${Utils.format(project.advanceInterestAmount)}" />
</div>
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
@ -343,7 +345,7 @@
<div class="am-u-sm-4 am-u-md-2 am-text-right">垫资峰值</div>
<div class="am-u-sm-6 am-u-md-6">
<input type="text" class="number am-input" data-validate-async data-validation-message="请输入垫资峰值"
name="advancePeakAmount" placeholder="单位(元)" maxlength="16"
name="advancePeakAmount" placeholder="单位(元)" maxlength="16" id="advancePeakAmount"
value="${Utils.format(project.advancePeakAmount)}" />
</div>
<div class="am-u-sm-2 am-u-md-4 input-msg"></div>
@ -636,14 +638,32 @@
</div>
<script src="${base}/assets/js/project_common.js"></script>
<script src="${base}/assets/js/project_estimate.js"></script>
<script src="../common/jQuery-File-Upload/js/vendor/jquery.ui.widget.js"></script>
<script type="text/javascript" src="../common/jQuery-File-Upload/js/jquery.iframe-transport.js"></script>
<script type="text/javascript" src="../common/jQuery-File-Upload/js/jquery.fileupload.js"></script>
<script src="../common/jQuery-File-Upload/js/jquery.fileupload-process.js"></script>
<script src="../common/jQuery-File-Upload/js/jquery.fileupload-validate.js"></script>
<script>
var check = 0;
var projectNoResult = 0;
var rateResult = 0;
var result = 0;
var changeCheck = function () {
var underwrittenMode = $("#underwrittenMode").val();
if (underwrittenMode == 1) {
$("#coop").show();
} else {
$("#coop").hide();
}
};
$(function () {
generateFileupload('icon');
calIncomeAndCost();
$("#saveDraft").click(function () {
$("#collaboratorUrl").val($("#collaboratorUrl_span").text());
check = 0;
$("#saveDraft").attr('disabled',true);
checkIfFillIn();
@ -658,6 +678,8 @@
$("#pmsForm").submit();
});
$("#saveApprove").click(function () {
$("#collaboratorUrl").val($("#collaboratorUrl_span").text());
check = 0;
$("#saveApprove").attr('disabled',true);
checkIfFillIn();
@ -674,6 +696,7 @@
});
function checkIfFillIn() {
var underwrittenMode = $("#underwrittenMode").val();
var startTime = $("#startDate").val();
var endTime = $("#endDate").val();
var name = $("#name").val();
@ -683,6 +706,7 @@
var industryScenario = $("#industryScenario").val();
// var mainContractCollectionTerms = $("#mainContractCollectionTerms").val();
var valueRisk = $("#valueRisk").val();
var collaborator = $("#collaborator").val();
// var incomeDeviceTaxInclude = $("#incomeDeviceTaxInclude").val();
// var incomeDeviceTaxExclude = $("#incomeDeviceTaxExclude").val();
@ -721,18 +745,18 @@
return;
}
if (projectNo.length <= 0) {
window.confirm('项目编号不能为空');
check = 1;
return;
}
checkProjectNo();
if (projectNoResult == 1) {
window.confirm('项目编号已存在');
check = 1;
return;
}
// if (projectNo.length <= 0) {
// window.confirm('项目编号不能为空');
// check = 1;
// return;
// }
//
// checkProjectNo();
// if (projectNoResult == 1) {
// window.confirm('项目编号已存在');
// check = 1;
// return;
// }
if (name.length <= 0) {
window.confirm('项目名称不能为空');
@ -747,6 +771,12 @@
return;
}
if (underwrittenMode == 1 && (collaborator == undefined || collaborator.length <= 0 )) {
window.confirm('合作对象不能为空');
check = 1;
return;
}
if (customer == undefined || customer.length <= 0 ) {
window.confirm('客户名称不能为空');
check = 1;
@ -898,6 +928,65 @@
value = value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的
return Number(value);
}
var generateFileupload = function (name) {
var progressArea = $("#progress-area-" + name);//div
var progressText = $("#progress-text-" + name);//进度条提示
var progressBar = $(".am-progress-bar");//进度条
$("#file_upload_icon").fileupload({
url: "${base}/file/upload",
dataType: 'json',
maxFileSize: 50 * 1024 * 1024,
maxNumberOfFiles: 1,
start: function (e) {
progressArea.removeClass("am-hide");
progressText.removeClass("am-text-danger");
progressText.html("");
progressBar.css("width", "0%");
},
done: function (e, data) {
console.log(data);
//设置服务器返回的url
$("#collaboratorUrl").val(data.result.data.url);
$("#collaboratorUrl_span").text(data.result.data.url);
// console.log("collboratorUrl: " + $("#collaboratorUrl").val());
setTimeout(function () {
progressArea.addClass("am-hide");
}, 1500);
},
progressall: function (e, data) {
var progress = parseInt(data.loaded / data.total * 100, 10);
console.log(progress);
progressBar.css("width", progress + "%");
progressText.html(progress + "%");
},
error: function (jqXHR2, textStatus, errorThrown) {
progressArea.removeClass("am-hide");
progressText.addClass("am-text-danger");
progressText.html("imageupload error");
progressBar.css("width", "0%");
setTimeout(function () {
progressArea.addClass("am-hide");
}, 2000);
},
fail: function (jqXHR2, textStatus) {
progressArea.removeClass("am-hide");
progressText.addClass("am-text-danger");
progressText.html("imageupload fail");
progressBar.css("width", "0%");
setTimeout(function () {
progressArea.addClass("am-hide");
}, 2000);
},
processfail: function (e, data) {
var currentFile = data.files[data.index];
if (data.files.error && currentFile.error) {
parent.layer.msg(currentFile.error);
}
}
});
};
</script>
</@defaultLayout.layout>