feat(um): 根据标的代码 基金管理人回显
This commit is contained in:
@@ -17,6 +17,10 @@
|
||||
const consSelect = ['MarketCode', 'UnderlyingInstrumentType', 'UnderlyingState', 'UnderlyingStatus', 'UpDownLimitType', 'EtfSubType'];
|
||||
|
||||
var autoUpDownLimit, autoVariety;
|
||||
var fundManagerLookupSeq = 0;
|
||||
var fundManagerLookupTimer = null;
|
||||
var fundManagerLookupXhr = null;
|
||||
var fundManagerManualEdit = false;
|
||||
|
||||
$(function () {
|
||||
|
||||
@@ -46,6 +50,12 @@ $(function () {
|
||||
lookup: ylotc.varieties
|
||||
});
|
||||
|
||||
$('#InvestAdvisorName').on('input', function () {
|
||||
fundManagerManualEdit = true;
|
||||
});
|
||||
|
||||
$('#UnderlyingCode').on('input', refreshFundManagerLookup);
|
||||
|
||||
for (var i = 1; i <= 5; i++) {
|
||||
let datas = ylotc.underlyingBlocks.filter(x => x.Group === i);
|
||||
let autoBlock = FastVue.autocomplete(document.getElementById('inputBlock' + i), {
|
||||
@@ -112,9 +122,57 @@ $(function () {
|
||||
break;
|
||||
}
|
||||
$('#editForm').removeClass("form-None form-Stock form-CommodityFutures form-CommoditySpot form-Bonds form-Fund").addClass("form-" + classType);
|
||||
refreshFundManagerLookup();
|
||||
}).trigger('change');
|
||||
});
|
||||
|
||||
function refreshFundManagerLookup() {
|
||||
var requestSeq = ++fundManagerLookupSeq;
|
||||
if (fundManagerLookupTimer) {
|
||||
clearTimeout(fundManagerLookupTimer);
|
||||
fundManagerLookupTimer = null;
|
||||
}
|
||||
if (fundManagerLookupXhr) {
|
||||
fundManagerLookupXhr.abort();
|
||||
fundManagerLookupXhr = null;
|
||||
}
|
||||
|
||||
var codeInput = $('#UnderlyingCode');
|
||||
var typeInput = $('#UnderlyingInstrumentType');
|
||||
var managerInput = $('#InvestAdvisorName');
|
||||
if (page.Model.id > 0 || !codeInput.length || !typeInput.length ||
|
||||
typeInput.val() !== 'Fund' || !codeInput.val() || !managerInput.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
var codeAtRequest = codeInput.val();
|
||||
var managerAtRequest = managerInput.val() || '';
|
||||
var manualAtRequest = fundManagerManualEdit;
|
||||
fundManagerLookupTimer = setTimeout(function () {
|
||||
fundManagerLookupTimer = null;
|
||||
fundManagerLookupXhr = $.ajax({
|
||||
url: '/underlying_manager/GetFundManager',
|
||||
method: 'GET',
|
||||
data: { code: codeAtRequest, instrumentType: 'Fund' }
|
||||
}).done(function (resp) {
|
||||
if (requestSeq !== fundManagerLookupSeq || page.Model.id > 0 ||
|
||||
$('#UnderlyingCode').val() !== codeAtRequest ||
|
||||
$('#UnderlyingInstrumentType').val() !== 'Fund' ||
|
||||
manualAtRequest || fundManagerManualEdit) {
|
||||
return;
|
||||
}
|
||||
|
||||
var result = resp && resp.obj;
|
||||
if (result && result.IsUnique && result.InvestAdvisorName) {
|
||||
managerInput.val(result.InvestAdvisorName);
|
||||
fundManagerManualEdit = false;
|
||||
}
|
||||
}).always(function () {
|
||||
fundManagerLookupXhr = null;
|
||||
});
|
||||
}, 200);
|
||||
}
|
||||
|
||||
function saveData() {
|
||||
|
||||
var data = $('#editForm').serializeObject();
|
||||
|
||||
Reference in New Issue
Block a user