|
|
@ -118,29 +118,36 @@ var fnPageInit = function () { |
|
|
|
$('#VenueID').prop('disabled', true); |
|
|
|
postArray.push(pargs._getOne()); |
|
|
|
} |
|
|
|
postArray.push(fnSetRegionIDdrop(), fnCountryDrop(), fnSetCityValueDrop(), fnSetOrderByValueDrop()); |
|
|
|
postArray.push(fnSetRegionIDdrop()); |
|
|
|
$.whenArray(postArray).done(function (res) { |
|
|
|
if (pargs.action === 'upd' && res[0].RESULT) { |
|
|
|
var oRes = res[0].DATA.rel; |
|
|
|
pargs._setFormVal(oRes); |
|
|
|
} |
|
|
|
}); |
|
|
|
$('#CountryID').select2(); |
|
|
|
$('#CityID').select2(); |
|
|
|
|
|
|
|
} |
|
|
|
}), |
|
|
|
|
|
|
|
|
|
|
|
//國家下拉選單
|
|
|
|
fnCountryDrop = function (RegionID) { |
|
|
|
return g_api.ConnectLite(canDo.ProgramId, "GetCountry", |
|
|
|
{ RegionID: $("#RegionID").val() }, //依據所選擇的洲別顯示相對應的國家選單
|
|
|
|
return g_api.ConnectLite(canDo.ProgramId, "GetCountry", { |
|
|
|
RegionID: $('#RegionID').val() |
|
|
|
}, //依據所選擇的洲別顯示相對應的國家選單
|
|
|
|
function (res) { |
|
|
|
if (res.RESULT) { |
|
|
|
var saList = res.DATA.rel; |
|
|
|
$('#CountryID').html(createOptions(saList, 'CountryID', 'CountryName', true)).on('change', function () { |
|
|
|
if ($('#CountryID').val()) { |
|
|
|
fnSetCityValueDrop(); //若CountryID改變,觸發City選單
|
|
|
|
} |
|
|
|
}); |
|
|
|
if (saList.length > 0) { |
|
|
|
$('#CountryID').html(createOptions(saList, 'CountryID', 'CountryName', true)).on('change', function () { |
|
|
|
$('#CityID').empty(); |
|
|
|
$('#OrderByValue').empty(); |
|
|
|
if ($('#CountryID').val()) { |
|
|
|
fnSetCityValueDrop(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
@ -153,6 +160,7 @@ var fnPageInit = function () { |
|
|
|
if (res.RESULT) { |
|
|
|
var saList = res.DATA.rel; |
|
|
|
$('#CityID').html(createOptions(saList, 'CityID', 'CityName', true)).on('change', function () { |
|
|
|
$('#OrderByValue').empty(); |
|
|
|
if ($('#CityID').val()) { |
|
|
|
fnSetOrderByValueDrop(); //若CityID改變,觸發OrderByValue選單
|
|
|
|
} |
|
|
@ -168,6 +176,9 @@ var fnPageInit = function () { |
|
|
|
if (res.RESULT) { |
|
|
|
var regionList = res.DATA.rel;; |
|
|
|
$('#RegionID').html(createOptions(regionList, 'RegionID', 'RegionName', true)).on('change', function () { |
|
|
|
$('#CountryID').empty(); |
|
|
|
$('#CityID').empty(); |
|
|
|
$('#OrderByValue').empty(); |
|
|
|
if ($('#RegionID').val()) { |
|
|
|
fnCountryDrop(); //若RegionID改變,觸發國家選單
|
|
|
|
} |
|
|
@ -184,16 +195,14 @@ var fnPageInit = function () { |
|
|
|
var iCount = res.DATA.rel; |
|
|
|
if (canDo.action === 'add') { |
|
|
|
iCount++; |
|
|
|
console.log('排序' + iCount); |
|
|
|
} |
|
|
|
$('#OrderByValue').html(createOptions(iCount)); |
|
|
|
if (canDo.action === 'add') { |
|
|
|
$('#OrderByValue').val(iCount); |
|
|
|
console.log('OrderByValue' + OrderByValue); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
require(['base', 'cando'], fnPageInit); |
|
|
|
require(['base', 'cando', 'select2'], fnPageInit); |
xxxxxxxxxx