795 lines
26 KiB
JavaScript
795 lines
26 KiB
JavaScript
|
||
var tabId;
|
||
function saveclient() {
|
||
//当tab点击4,5,6时,save事件调用check方法,会报js内部错位,此时也没什么可验证的,就舍去了验证步骤
|
||
if (tabId != "4" && tabId != "5" && tabId != "6") {
|
||
if (!checkSubmitData()) {
|
||
return false;
|
||
}
|
||
}
|
||
|
||
var data = $("#clientEditForm").serialize();
|
||
data += "&CustomerNature1=" + $("#CustomerNature1").val();
|
||
data += "&CustomerNature2=" + $("#CustomerNature2").val();
|
||
|
||
var TradingInstType = $('#TradingInstType').val();
|
||
if (Array.isArray(TradingInstType)) {
|
||
data += "&TradingInstType=" + TradingInstType.reduce((acc, cur) => acc | parseInt(cur), 0);
|
||
}
|
||
data += "&MetaDic[同一主体]=" + $("#ActualSubject").val().join();
|
||
|
||
var ajaxopt = {
|
||
type: "Post",
|
||
url: "/client/clientEditJson?enid=" + page.EncryptId + (page.id === 0 ? "&isnew=true" : ""),
|
||
data: data,
|
||
dataType: "json",
|
||
success: function (res) {
|
||
if (res.success) {
|
||
window.parent.showmiddlemessage("成功更新本条数据");
|
||
window.parent.reloadclient2();
|
||
window.location.href = "/client/clientedit?enid=" + res.obj.EncryptId + "&tabId=" + tabId;
|
||
}
|
||
else {
|
||
alert(res.msg);
|
||
}
|
||
},
|
||
error: function (msg) {
|
||
alert("error:" + msg);
|
||
}
|
||
}
|
||
|
||
var nameVal = $("#Name").val();
|
||
var nameHidden = $("#NameHidden").val();
|
||
var creditRatingId = $("#CreditRatingId").val();
|
||
//var creditRatingIdHidden = $("#CreditRatingIdHidden").val();
|
||
|
||
//申万所有信息修改均会重新审批,不需要提示
|
||
if (nameVal !== nameHidden && (page.ProcessStatus === "已开户" || page.ProcessStatus === "已休眠" || page.ProcessStatus === "已销户")
|
||
&& page.ClientApprovalProcessCount > 0 && !page.IsShenWan) {
|
||
main.confirm("修改姓名后该用户需要重新审批,确认修改?", main.ajax.bind(null, ajaxopt));
|
||
}
|
||
else {
|
||
main.ajax(ajaxopt);
|
||
}
|
||
}
|
||
|
||
function checkSubmitData() {
|
||
|
||
if (!$('#Name').val().trim()) {
|
||
main.alert("客户名称 必须填写");
|
||
return false;
|
||
}
|
||
|
||
if (!$("#EvaluateDate").parent().is(":hidden") && !$("#EvaluateDate").prop("disabled")) {
|
||
var EvaluateDate = $("#EvaluateDate").val();
|
||
let regTime = /^[0-9]{4}-[0-1]?[0-9]{1}-[0-3]?[0-9]{1}$/;
|
||
if (!regTime.test(EvaluateDate) && EvaluateDate != "") {
|
||
main.message("请输入正确的评估日期格式");
|
||
return false;
|
||
}
|
||
}
|
||
|
||
if (!$("#ProtocolSignDate").parent().is(":hidden") && !$("#ProtocolSignDate").prop("disabled")) {
|
||
var ProtocolSignDate = $("#ProtocolSignDate").val();
|
||
let regTime = /^[0-9]{4}-[0-1]?[0-9]{1}-[0-3]?[0-9]{1}$/;
|
||
if (ProtocolSignDate != "" && !regTime.test(ProtocolSignDate)) {
|
||
main.message("请输入正确的协议签署日期格式");
|
||
return false;
|
||
}
|
||
}
|
||
|
||
return true;
|
||
}
|
||
|
||
function createbankcard() {
|
||
var URL = "/bankcard/bankcardEdit/?rid=" + page.id;
|
||
|
||
main.infopage("创建银行卡", URL,
|
||
{
|
||
end: function () {
|
||
refreshbankcard();
|
||
}
|
||
});
|
||
}
|
||
|
||
function createclientduty() {
|
||
var url = "/clientduty/clientdutyEdit/?rid=" + page.id;
|
||
main.open("新增客户人员", url,
|
||
{
|
||
area: ['700px', '80%'],
|
||
end: function () {
|
||
refreshclientduty();
|
||
}
|
||
});
|
||
}
|
||
|
||
$(function () {
|
||
|
||
//$('#LicenseCode').after('<span style="color:red">*</span>');
|
||
|
||
$(".datepicker").datepicker({ changeMonth: true, changeYear: true, showButtonPanel: true, showOtherMonths: true, selectOtherMonths: true });
|
||
const fp = flatpickr(".form_datetime", {
|
||
enableTime: true, dateFormat: "Y-m-d H:i",
|
||
allowInput: true, time_24hr: true
|
||
});
|
||
refreshbankcard();
|
||
refreshClientFiles();
|
||
refreshclientduty();
|
||
//refreshSuitablyClientFiles();
|
||
changeTypeValue();
|
||
changeClientType(true);
|
||
$(".form-group").removeClass("col-md-6");
|
||
|
||
var clientlevel = $("#LevelId option:selected").text();
|
||
$("#Level").val(clientlevel);
|
||
|
||
$(".tab-link").click(function (e) {
|
||
if (page.id <= 0) {
|
||
main.message("请先保存客户基本信息");
|
||
return;
|
||
}
|
||
|
||
e.preventDefault()
|
||
$(this).tab('show')
|
||
});
|
||
|
||
//$("#tab" + page.TabEditId).click();
|
||
getTab(page.TabEditId);
|
||
|
||
$("#IsEvaluate").change(function () {
|
||
});
|
||
$("#IsEvaluate").trigger("change");
|
||
|
||
initEvent();
|
||
|
||
SetAceDropDown(false);
|
||
|
||
if (page.id <= 0) {
|
||
$("#Number").prop("disabled", false);
|
||
}
|
||
|
||
$("#QuestionnaireScore").blur(function () {
|
||
var score = this.value;
|
||
if (score > 70) {
|
||
$("#AppropriatenessDegree").val(5);
|
||
$("#RiskServiceDegree").val(5);
|
||
}
|
||
else if (score > 40 && score <= 70) {
|
||
$("#AppropriatenessDegree").val(4);
|
||
$("#RiskServiceDegree").val(4);
|
||
}
|
||
else if (score > 30 && score <= 40) {
|
||
$("#AppropriatenessDegree").val(3);
|
||
$("#RiskServiceDegree").val(3);
|
||
}
|
||
else if (score > 20 && score <= 30) {
|
||
$("#AppropriatenessDegree").val(2);
|
||
$("#RiskServiceDegree").val(2);
|
||
}
|
||
else {
|
||
$("#AppropriatenessDegree").val(1);
|
||
$("#RiskServiceDegree").val(1);
|
||
}
|
||
});
|
||
|
||
$("#chkBookRadio").change(function () {
|
||
if ($("#chkBookRadio").is(':checked')) {
|
||
$("#divBookTime").css('display', "inline-block");
|
||
}
|
||
else {
|
||
$("#divBookTime").css('display', "none");
|
||
}
|
||
});
|
||
|
||
fileTypeChange();
|
||
if (!page.IsProduct) {
|
||
$("#fileType option[value='代签产品附件(PDF)']").remove();
|
||
}
|
||
if (!page.IsSecuritiesEnvironment) {
|
||
$('#AccessRule').parent().hide();
|
||
}
|
||
if (page.ActualSubject.length) {
|
||
$("#ActualSubject").val(page.ActualSubject).selectpicker('refresh');
|
||
}
|
||
});
|
||
|
||
function initEvent() {
|
||
var maxAllowedContentLength = maxRequestLength * 1024;
|
||
$('#uploadfile').fileupload({
|
||
dataType: 'json',
|
||
url: "/client/UploadFiles?clientId=" + page.EncryptId,
|
||
replaceFileInput: false,
|
||
start: function (e) {
|
||
$('#submitBtn').off('click');
|
||
},
|
||
singleFileUploads: false,
|
||
add: function (e, data) {
|
||
$('.progress .progress-bar').css('width', '0%');
|
||
$('.progress .progress-bar').text('0%');
|
||
|
||
$('#submitBtn').off('click');
|
||
$('#submitBtn').click(function () {
|
||
var totalSize = 0;
|
||
for (var i = 0; i < data.files.length; i++) {
|
||
totalSize += data.files[i].size;
|
||
}
|
||
//if (!check("notes", 5)) {
|
||
// return;
|
||
//}AccessRule
|
||
if (page.IsSecuritiesEnvironment) {
|
||
checkFiles(data.files);
|
||
}
|
||
if (totalSize > maxAllowedContentLength) {
|
||
var maxSize = getFileMaxSize(maxRequestLength);
|
||
main.alert("文件过大,请勿传输超过" + maxSize + "文件")
|
||
} else {
|
||
data.submit();
|
||
}
|
||
});
|
||
},
|
||
progressall: function (e, data) {
|
||
var progress = parseInt(data.loaded / data.total * 100, 10);
|
||
$('.progress .progress-bar').css(
|
||
'width',
|
||
progress + '%'
|
||
);
|
||
$('.progress .progress-bar').text(progress + '%');
|
||
},
|
||
|
||
done: function (e, data) {
|
||
$('.progress .progress-bar').text("done");
|
||
if (!data.result.success) {
|
||
main.message(data.result.msg);
|
||
}
|
||
else {
|
||
window.location.href = "/client/clientEdit?enid=" + page.EncryptId + "&tabId=5";
|
||
}
|
||
|
||
}
|
||
});
|
||
|
||
$('#uploadfile').bind('fileuploadsubmit', function (e, data) {
|
||
var fileType = $("#fileType").val();
|
||
var isSuitably = fileType == "Suitably";
|
||
var isBookRadio = fileType == "BookRadio";
|
||
var bookTime = $("#BookTime").val();
|
||
var optDate = $("#OptDateTime").val();
|
||
var signDate = $("#DatesignDate").val();
|
||
var protocolNumber = $("#protocolNumber").val();
|
||
var mainProtocolNumber = $("#mainProtocolNumber").val();
|
||
var sideProtocolNumber = $("#sideProtocolNumber").val();
|
||
var signType = $("#signType").val();
|
||
var reportorRole = $("#reportorRole").val();
|
||
|
||
|
||
data.formData = {
|
||
fileDesc: $("#fileDesc").val().trim(),
|
||
OptDateTime: optDate, isSuitably: isSuitably,
|
||
isBookRadio: isBookRadio, bookTime: bookTime,
|
||
fileType: fileType, signDate: signDate, protocolNumber: protocolNumber,
|
||
mainProtocolNumber: mainProtocolNumber, sideProtocolNumber: sideProtocolNumber,
|
||
signType:signType, reportorRole: reportorRole,
|
||
fileTypeName: fileType, optDate: optDate
|
||
}; //如果需要额外添加参数可以在这里添加
|
||
});
|
||
}
|
||
|
||
function getFileMaxSize(length) {
|
||
var units = ["M", "G", "T"];
|
||
var unit = "K";
|
||
for (var i = 0; length > 1024 && i < units.length; i++) {
|
||
length = length / 1024;
|
||
unit = units[i];
|
||
}
|
||
return parseInt(length) + unit;
|
||
}
|
||
|
||
function getTab(id) {
|
||
//check
|
||
//if (!tabId) {
|
||
// tabId = '1';
|
||
//}
|
||
//if (id > tabId) {
|
||
// var index = tabId
|
||
// for (; index < id; index++) {
|
||
// switch (index + '') {
|
||
// case '1':
|
||
// if (!check("info",1)) {
|
||
// return;
|
||
// }
|
||
// break;
|
||
// case '2':
|
||
// if (!check("investment-risk-info",2)) {
|
||
// return;
|
||
// }
|
||
// break;
|
||
// case '3':
|
||
// //if (!check("suitably")) {
|
||
// //return;
|
||
// //}
|
||
// break;
|
||
// default: break;
|
||
// }
|
||
// }
|
||
//}
|
||
//color
|
||
|
||
printFlowPoint(id);
|
||
|
||
//onclick
|
||
$("#tab" + id).click();
|
||
tabId = id;
|
||
}
|
||
|
||
//function check(DivId, tabIndex) {
|
||
// var pass = true;
|
||
// var selector = "#" + DivId +" input[data-val-required]"
|
||
// var Requried = $(selector);
|
||
// Requried.each(function () {
|
||
// if (!this.value || this.value == "") {
|
||
// pass = false;
|
||
// }
|
||
// });
|
||
// if (!pass) {
|
||
// main.alert("请将第" + tabIndex + "步必填字段填写完全!");
|
||
// }
|
||
// if (pass) {
|
||
// selector = "#" + DivId + " input[required]"
|
||
// Requried = $(selector);
|
||
// Requried.each(function () {
|
||
// if (!this.value || this.value == "") {
|
||
// pass = false;
|
||
// }
|
||
// });
|
||
// if (!pass) {
|
||
// main.alert("请将必填字段填写完全!");
|
||
// }
|
||
// }
|
||
// return pass;
|
||
//}
|
||
|
||
function printFlowPoint(id) {
|
||
if (!id) {
|
||
id = 1;
|
||
}
|
||
var curId = id;
|
||
if (page.ProcessStatus && page.ProcessStatus != "未提交") {
|
||
id = 7;
|
||
}
|
||
var DivId = "";
|
||
for (var i = 1; i < id; i++) {
|
||
DivId = "#flowPoint" + i;
|
||
$(DivId).addClass("for-cur");
|
||
$(DivId + " em i").show();
|
||
$(DivId + " em span").hide();
|
||
$(DivId + " strong").css("font-size", "14px");
|
||
$(DivId + " strong").css("color", "#14937A");
|
||
}
|
||
for (var i = 6; i > id; i--) {
|
||
DivId = "#flowPoint" + i;
|
||
$(DivId).removeClass("for-cur");
|
||
$(DivId + " em i").hide();
|
||
$(DivId + " em span").show();
|
||
$(DivId + " strong").css("font-size", "14px");
|
||
$(DivId + " strong").css("color", "black");
|
||
}
|
||
DivId = "#flowPoint" + curId;
|
||
$(DivId).addClass("for-cur");
|
||
$(DivId + " em i").hide();
|
||
$(DivId + " em span").show();
|
||
$(DivId + " strong").css("font-size", "16px");
|
||
$(DivId + " strong").css("color", "#14937A");
|
||
}
|
||
|
||
function flowNext() {
|
||
if (!tabId) {
|
||
tabId = '1';
|
||
}
|
||
if (tabId != '6') {
|
||
getTab(Number(tabId) + 1);
|
||
} else {
|
||
main.message("已到达最后一步,无法下一步")
|
||
}
|
||
}
|
||
|
||
function flowBack() {
|
||
if (!tabId) {
|
||
tabId = '1';
|
||
}
|
||
if (tabId != '1') {
|
||
getTab(Number(tabId) - 1);
|
||
} else {
|
||
main.message("已到达第一步,无法上一步")
|
||
}
|
||
}
|
||
|
||
function refreshbankcard() {
|
||
var opt = {
|
||
url: "/bankcard/bankcardEditPopInner?d=" + new Date(),
|
||
data: { rid: page.id },
|
||
dataType: "Html",
|
||
success: function (data) {
|
||
$("#divbankcardEditPopInner").html(data);
|
||
}
|
||
};
|
||
main.ajax(opt);
|
||
}
|
||
|
||
function refreshclientduty() {
|
||
var opt = {
|
||
url: "/clientduty/clientdutyEditPopInner?d=" + new Date(),
|
||
data: { rid: page.id },
|
||
dataType: "Html",
|
||
success: function (data) {
|
||
$("#divclientdutyEditPopInner").html(data);
|
||
//$(".datepicker").prop("disabled", false);
|
||
//$(".datepicker").prop("readonly", false);
|
||
}
|
||
};
|
||
main.ajax(opt);
|
||
}
|
||
|
||
function refreshClientFiles() {
|
||
var fileType = $("#fileTypeForSearch").val();
|
||
var fileName = $("#fileNameForSearch").val();
|
||
var fileDate = $("#DatefileDate").val();
|
||
|
||
var opt = {
|
||
url: "/client/ClientFilesEditPopInner?d=" + new Date(),
|
||
data: { clientId: page.EncryptId, clientType: "clientEdit", fileType: fileType, fileName: fileName, fileDate: fileDate },
|
||
dataType: "Html",
|
||
success: function (data) {
|
||
$("#divClientFilesEditPopInner").html(data);
|
||
//$(".datepicker").prop("disabled", false);
|
||
//$(".datepicker").prop("readonly", false);
|
||
}
|
||
};
|
||
main.ajax(opt);
|
||
}
|
||
|
||
function ClientOperationHistory() {
|
||
main.open("操作历史", "/client/ClientOperationHistory?id=" + page.id);
|
||
}
|
||
function submitProcess() {
|
||
|
||
var opt = {
|
||
url: "/AccountOpeningProcess/SubmitProcess",
|
||
async: false,
|
||
data: { clientId: page.id },
|
||
success: function (res) {
|
||
if (res.success === true) {
|
||
main.message(res.msg);
|
||
try {
|
||
window.parent.reloadclient2();
|
||
} catch (e) {
|
||
//
|
||
}
|
||
} else {
|
||
main.message(res.msg);
|
||
}
|
||
},
|
||
error: function (res) {
|
||
main.message('提交失败');
|
||
}
|
||
};
|
||
main.ajax(opt);
|
||
}
|
||
|
||
function changeLevel() {
|
||
var clientlevel = $("#LevelId option:selected").text();
|
||
$("#Level").val(clientlevel);
|
||
}
|
||
|
||
function clientTypeInitData(isInitial) {
|
||
$("#RegisteredCapital").prev().html("注册资本(万元)");
|
||
$("#RegisteredCapital").prop("disabled", false);
|
||
$("#RegisteredAddress").prop("disabled", false);
|
||
}
|
||
|
||
function DisabledAdminFullName() {
|
||
if ($("#ClientType").val() === "产品") {
|
||
$("#AdminFullName").prop("disabled", false);
|
||
}
|
||
else {
|
||
$("#AdminFullName").prop("disabled", true);
|
||
}
|
||
}
|
||
|
||
function DisabledAdminRegisteredNum() {
|
||
if (($("#ClientType").val() === "机构" && $("#BusinessType").val() === "私募管理人")
|
||
|| $("#ClientType").val() === "产品") {
|
||
$("#AdminRegisteredNum").prop("disabled", false);
|
||
}
|
||
else {
|
||
$("#AdminRegisteredNum").prop("disabled", true);
|
||
}
|
||
}
|
||
|
||
function ClearAdminInfo() {
|
||
if (!(($("#ClientType").val() === "产品") || ($("#ClientType").val() === "机构" && $("#BusinessType").val() === "私募管理人"))) {
|
||
//清除管理人数据
|
||
$("#AdminRegisteredNum").val("");
|
||
}
|
||
|
||
if (!($("#ClientType").val() === "产品")) {
|
||
//清除管理人数据
|
||
$("#AdminFullName").val("");
|
||
}
|
||
}
|
||
|
||
function changeClientType(isInitial) {
|
||
clientTypeInitData(isInitial);
|
||
|
||
if ($("#ClientType").val() === "机构") {
|
||
$("#InstitutionalAttributesDropDownArea").removeClass("hide");
|
||
$("#InstitutionalAttributesInputArea").addClass("hide");
|
||
}
|
||
else {
|
||
$("#InstitutionalAttributesDropDownArea").addClass("hide");
|
||
$("#InstitutionalAttributesInputArea").removeClass("hide");
|
||
}
|
||
|
||
if ($("#ClientType").val() === "自然人") {
|
||
$('#CustomerNature').empty();
|
||
$('#CustomerNature').append("<option value='10'>自然人</option>");
|
||
$('#CustomerNature').append("<option value='12'>其他</option>");
|
||
$("#CustomerNature").trigger("chosen:updated");
|
||
$("#ProductNumber").val("");
|
||
$("#ProductNumber").prop("disabled", true);
|
||
$("#ProductName").val("");
|
||
$("#ProductName").prop("disabled", true);
|
||
$("#RegisteredCapital").val("");
|
||
$("#RegisteredCapital").prop("disabled", true);
|
||
$("#RegisteredAddress").val("");
|
||
$("#RegisteredAddress").prop("disabled", true);
|
||
}
|
||
else if ($("#ClientType").val() === "机构") {
|
||
$('#CustomerNature').empty();
|
||
$('#CustomerNature').append("<option value='1'>期货风险管理子公司</option>");
|
||
$('#CustomerNature').append("<option value='2'>证券公司</option>");
|
||
$('#CustomerNature').append("<option value='3'>保险公司</option>");
|
||
$('#CustomerNature').append("<option value='4'>公募基金</option>");
|
||
$('#CustomerNature').append("<option value='5'>私募基金</option>");
|
||
$('#CustomerNature').append("<option value='6'>商业银行</option>");
|
||
$('#CustomerNature').append("<option value='7'>投资公司</option>");
|
||
$('#CustomerNature').append("<option value='8' selected='true'>产业客户</option>");
|
||
$('#CustomerNature').append("<option value='12'>其他</option>");
|
||
$("#CustomerNature").trigger("chosen:updated");
|
||
$("#ProductNumber").val("");
|
||
$("#ProductNumber").prop("disabled", true);
|
||
$("#ProductName").val("");
|
||
$("#ProductName").prop("disabled", true);
|
||
$("#AdminFullName").prop("disabled", true);
|
||
$("#AdminRegisteredNum").prop("disabled", true);
|
||
}
|
||
else {
|
||
//类型:产品
|
||
$('#CustomerNature').empty();
|
||
$('#CustomerNature').append("<option value='2'>证券公司</option>");
|
||
$('#CustomerNature').append("<option value='3'>保险公司</option>");
|
||
$('#CustomerNature').append("<option value='4'>公募基金</option>");
|
||
$('#CustomerNature').append("<option value='5'>私募基金</option>");
|
||
$('#CustomerNature').append("<option value='6'>商业银行</option>");
|
||
$('#CustomerNature').append("<option value='12'>其他</option>");
|
||
$("#CustomerNature").trigger("chosen:updated");
|
||
if ($("#ClientType").val() === "产品") {
|
||
$("#ProductNumber").prop("disabled", false);
|
||
$("#ProductName").prop("disabled", false);
|
||
}
|
||
$("#RegisteredCapital").prev().html(page.IsHaiTong ? "产品规模(元)" : "产品规模(万元)");
|
||
//$("#Remark").val("注:若客户类别为“产品”,则“注册资本”显示为“产品规模”");
|
||
}
|
||
|
||
DisabledAdminRegisteredNum();
|
||
DisabledAdminFullName();
|
||
ClearAdminInfo();
|
||
}
|
||
|
||
function changeBusinessType() {
|
||
$.ajax({
|
||
type: "Post",
|
||
url: "/client/GetCustomerNaturesByBusinessType",
|
||
data: { name: $("#BusinessType").val() },
|
||
success: function (data) {
|
||
var customerNature1 = data == undefined || data == "" ? "" : data.split(',')[0];
|
||
var customerNature2 = data == undefined || data == "" ? "" : data.split(',')[1];
|
||
$("#CustomerNature1").val(customerNature1);
|
||
$("#CustomerNature2").val(customerNature2);
|
||
DisabledAdminRegisteredNum();
|
||
DisabledAdminFullName();
|
||
ClearAdminInfo();
|
||
}
|
||
});
|
||
}
|
||
|
||
$("#RegisteredCapital").change(function () {
|
||
var value = $("#RegisteredCapital").val();
|
||
$("#RegisteredCapital").attr("title", value);
|
||
});
|
||
$("#PostalAddress").change(function () {
|
||
var value = $("#PostalAddress").val();
|
||
$("#PostalAddress").attr("title", value);
|
||
});
|
||
$("#RegisteredAddress").change(function () {
|
||
var value = $("#RegisteredAddress").val();
|
||
$("#RegisteredAddress").attr("title", value);
|
||
|
||
});
|
||
function deleteclient(encryptId) {
|
||
if (confirm("确定删除吗?")) {
|
||
$.ajax({
|
||
type: "Post",
|
||
url: "/client/Deleteclient",
|
||
data: { id: encryptId, d: new Date() },
|
||
success: function (data) {
|
||
showmiddlemessage(data.obj.obj);
|
||
if (data.success == true) {
|
||
window.parent.location = window.parent.location;
|
||
window.close();
|
||
}
|
||
},
|
||
error: function (msg) {
|
||
alert("error:" + msg);
|
||
}
|
||
});
|
||
}
|
||
}
|
||
|
||
function changeTypeValue() {
|
||
}
|
||
|
||
function changeAppropriatenessDegree() {
|
||
$("#RiskServiceDegree").val($("#AppropriatenessDegree").val());
|
||
}
|
||
|
||
function resetPassword() {
|
||
var opt = {
|
||
url: "/client/ResetPassword",
|
||
async: false,
|
||
data: { clientId: page.id },
|
||
success: function (res) {
|
||
if (res.success === true) {
|
||
main.message(res.msg);
|
||
} else {
|
||
main.message(res.msg);
|
||
}
|
||
},
|
||
error: function (res) {
|
||
main.message('操作失败');
|
||
}
|
||
};
|
||
main.ajax(opt);
|
||
}
|
||
|
||
function fileTypeChange() {
|
||
var fileType = $("#fileType").val();
|
||
$("#uploadfile").attr("multiple", true)
|
||
$("#uploadfileButton").attr("multiple", true)
|
||
$("#DatesignDate").val("");
|
||
$("#fileDesc").val("");
|
||
$("#protocolNumber").val("");
|
||
$("#divBookTime").hide();
|
||
$("#divSignDate").hide();
|
||
$("#divProtocolNumber").hide();
|
||
$("#divMainProtocolNumber").hide();
|
||
$("#divSideProtocolNumber").hide();
|
||
$("#divSignType").hide();
|
||
$("#divReportorRole").hide();
|
||
$("#tips").hide();
|
||
|
||
$("#DatesignDate").attr("required", false);
|
||
$("#fileDesc").attr("required", false);
|
||
$("#OptDateTime").attr("required", true);
|
||
$("#BookTime").attr("required", false);
|
||
$("#protocolNumber").attr("required", false);
|
||
$("#mainProtocolNumber").attr("required", false);
|
||
$("#sideProtocolNumber").attr("required", false);
|
||
$("#signType").attr("required", false);
|
||
$("#reportorRole").attr("required", false);
|
||
|
||
switch (fileType) {
|
||
|
||
case "适应性文件":
|
||
|
||
break;
|
||
case "双录视频文件":
|
||
$("#divBookTime").show();
|
||
$("#BookTime").attr("required", true);
|
||
break;
|
||
case "主协议附件(PDF)":
|
||
$("#fileupload").attr("multiple", false)
|
||
$("#divSignDate").show();
|
||
$("#divProtocolNumber").show();
|
||
$("#divSignType").show();
|
||
$("#divReportorRole").show();
|
||
$("#DatesignDate").attr("required", true);
|
||
$("#protocolNumber").attr("required", true);
|
||
$("#signType").attr("required", true);
|
||
$("#reportorRole").attr("required", true);
|
||
$("#tips").show();
|
||
//todo Get SignType
|
||
break;
|
||
case "补充协议附件(PDF)":
|
||
$("#fileupload").attr("multiple", false)
|
||
$("#divSignDate").show();
|
||
$("#divProtocolNumber").show();
|
||
$("#divMainProtocolNumber").show();
|
||
$("#DatesignDate").attr("required", true);
|
||
$("#protocolNumber").attr("required", true);
|
||
$("#mainProtocolNumber").attr("required", true);
|
||
$("#tips").show();
|
||
//todo Get MainProtocolNumber
|
||
break;
|
||
case "履约协议附件(PDF)":
|
||
$("#fileupload").attr("multiple", false)
|
||
$("#divSignDate").show();
|
||
$("#divProtocolNumber").show();
|
||
$("#divMainProtocolNumber").show();
|
||
$("#divSideProtocolNumber").show();
|
||
$("#DatesignDate").attr("required", true);
|
||
$("#protocolNumber").attr("required", true);
|
||
$("#mainProtocolNumber").attr("required", true);
|
||
$("#tips").show();
|
||
getSideProtocols();
|
||
break;
|
||
case "代签产品附件(PDF)":
|
||
$("#fileupload").attr("multiple", false)
|
||
$("#divSignDate").show();
|
||
$("#divProtocolNumber").show();
|
||
$("#divMainProtocolNumber").show();
|
||
$("#DatesignDate").attr("required", "true");
|
||
$("#protocolNumber").attr("required", "true");
|
||
$("#mainProtocolNumber").attr("required", "true");
|
||
$("#tips").show();
|
||
break;
|
||
default: break;
|
||
}
|
||
}
|
||
|
||
function checkFiles(files) {
|
||
|
||
var fileType = $("#fileType").val();
|
||
var list = ["主协议附件(PDF)", "补充协议附件(PDF)", "履约协议附件(PDF)", "代签产品附件(PDF)"];
|
||
if (fileType in list) {
|
||
for (var i = 0; i < data.files.length; i++) {
|
||
if (files[i].size > maxAnnexLength) {
|
||
main.alert("主协议附件,补充协议附件,履约预付金附件,代签产品附件 单个附件大小不可以超过30M")
|
||
}
|
||
if (files[i].type != "application/pdf") {
|
||
main.alert("主协议附件,补充协议附件,履约预付金附件,代签产品附件 只能上传pdf文档");
|
||
}
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
function getSideProtocols() {
|
||
var data = $("#mainProtocolNumber").val();
|
||
$("#sideProtocolNumber").empty();
|
||
if (data) {
|
||
main.post("/client/getSideProtocols", { mainProtocol: data }).done(function (res) {
|
||
if (res) {
|
||
for (var i = 0; i < res.length; i++) {
|
||
htmlstr = "<option value='" + res[i] + "'>" + res[i] + "</option>";
|
||
$("#sideProtocolNumber").append(htmlstr);
|
||
}
|
||
} else {
|
||
htmlstr = "<option value=''>----</option>";
|
||
$("#sideProtocolNumber").append(htmlstr);
|
||
}
|
||
});
|
||
}
|
||
|
||
}
|
||
|
||
function Upload() {
|
||
$("#modalFileUpload").modal('show');
|
||
$("#Content").width("560px");
|
||
$("#uploadfile").show();
|
||
$("#uploadfileButton").hide();
|
||
}
|
||
|
||
function openclientfileaudit() {
|
||
var url = "/client/ClientFilesAudit/?clientId=" + page.id + "&isApproval=false";
|
||
window.open(url, '_blank').location;
|
||
} |