修改上传附件bug
parent
94d34d5e6f
commit
db4fb6986f
|
@ -58,9 +58,11 @@
|
||||||
// };
|
// };
|
||||||
|
|
||||||
var result = 0;
|
var result = 0;
|
||||||
|
var check = 0;
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
generateFileupload('icon');
|
|
||||||
|
generateFileupload2('icon');
|
||||||
|
|
||||||
$("input[name='costCompanyManageTaxExclude']").change(function () {
|
$("input[name='costCompanyManageTaxExclude']").change(function () {
|
||||||
digitalSelf("costCompanyManageTaxExclude", "input[name='costCompanyManageTaxExclude']");
|
digitalSelf("costCompanyManageTaxExclude", "input[name='costCompanyManageTaxExclude']");
|
||||||
|
@ -202,6 +204,10 @@ $(function () {
|
||||||
$("#collaboratorUrl").val($("#collaboratorUrl_span").text());
|
$("#collaboratorUrl").val($("#collaboratorUrl_span").text());
|
||||||
|
|
||||||
checkIfFillIn();
|
checkIfFillIn();
|
||||||
|
if (check === 1) {
|
||||||
|
$("#saveApprove").attr('disabled', false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var dataIncome = collectData("am-modal-prompt-input-income");
|
var dataIncome = collectData("am-modal-prompt-input-income");
|
||||||
if (dataIncome.length <= 5) {
|
if (dataIncome.length <= 5) {
|
||||||
|
@ -334,7 +340,9 @@ function checkIfFillIn() {
|
||||||
var startTime = $("#startDateBudget").val();
|
var startTime = $("#startDateBudget").val();
|
||||||
var endTime = $("#endDateBudget").val();
|
var endTime = $("#endDateBudget").val();
|
||||||
var underwrittenMode = $("#underwrittenModeBudget").val();
|
var underwrittenMode = $("#underwrittenModeBudget").val();
|
||||||
|
var cooperateType = $("#cooperateTypeBudget").val();
|
||||||
var collaborator = $("#collaboratorBudget").val();
|
var collaborator = $("#collaboratorBudget").val();
|
||||||
|
var collaboratorUrl = $("#collaboratorUrlBudget").val();
|
||||||
var advanceInterestAmount = $("#advanceInterestAmountBudget").val();
|
var advanceInterestAmount = $("#advanceInterestAmountBudget").val();
|
||||||
var advancePeakAmount = $("#advancePeakAmountBudget").val();
|
var advancePeakAmount = $("#advancePeakAmountBudget").val();
|
||||||
var contractAmount = $("#contractAmountBudget").val();
|
var contractAmount = $("#contractAmountBudget").val();
|
||||||
|
@ -394,12 +402,18 @@ function checkIfFillIn() {
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if (underwrittenMode == 1 && (collaborator == undefined || collaborator.length <= 0)) {
|
if (cooperateType == 1 && (collaborator == undefined || collaborator.length <= 0 )) {
|
||||||
window.confirm('合作对象不能为空');
|
window.confirm('合作对象不能为空');
|
||||||
check = 1;
|
check = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cooperateType == 1 && (collaboratorUrl == undefined || collaboratorUrl.length <= 0 )) {
|
||||||
|
window.confirm('合作对象附件不能为空');
|
||||||
|
check = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (underwrittenMode > 2 && (advanceInterestAmount == undefined || advanceInterestAmount.length <= 0)) {
|
if (underwrittenMode > 2 && (advanceInterestAmount == undefined || advanceInterestAmount.length <= 0)) {
|
||||||
window.confirm('垫资利息不能为空');
|
window.confirm('垫资利息不能为空');
|
||||||
|
|
|
@ -1575,6 +1575,66 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var generateFileupload2 = 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
|
||||||
|
$("#collaboratorUrlBudget").val(data.result.data.url);
|
||||||
|
$("#collaboratorUrl_span").text(data.result.data.url);
|
||||||
|
$("#collaboratorUrl_check").text("已上传");
|
||||||
|
// 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
var generateFileupload = function (name) {
|
var generateFileupload = function (name) {
|
||||||
var progressArea = $("#progress-area-" + name);//div
|
var progressArea = $("#progress-area-" + name);//div
|
||||||
var progressText = $("#progress-text-" + name);//进度条提示
|
var progressText = $("#progress-text-" + name);//进度条提示
|
||||||
|
|
Loading…
Reference in New Issue