diff --git a/EuroTran/WebApp/Scripts/pages/ShowEasy/VenueMaintain_Upd.js b/EuroTran/WebApp/Scripts/pages/ShowEasy/VenueMaintain_Upd.js index 3968d00..5e108e1 100644 --- a/EuroTran/WebApp/Scripts/pages/ShowEasy/VenueMaintain_Upd.js +++ b/EuroTran/WebApp/Scripts/pages/ShowEasy/VenueMaintain_Upd.js @@ -124,12 +124,12 @@ var fnPageInit = function () { } }), - - //國家下拉選單 - fnSetCountryValueDrop = function (RegionID) { - return g_api.ConnectLite(canDo.ProgramId, "GetCountry", - { RegionID: $("#RegionID").val() }, //依據所選擇的洲別顯示相對應的國家選單 + + //國家下拉選單 + fnSetCountryValueDrop = function (RegionID) { + return g_api.ConnectLite(canDo.ProgramId, "GetCountry", + { RegionID: $("#RegionID").val() }, //依據所選擇的洲別顯示相對應的國家選單 function (res) { if (res.RESULT) { var saList = res.DATA.rel; @@ -142,60 +142,57 @@ var fnPageInit = function () { }); }, - //城市下拉選單 - fnSetCityValueDrop = function (CountryID) { - return g_api.ConnectLite(canDo.ProgramId, "GetCity", - { CountryID: $("#CountryID").val() }, //依據所選擇的國家顯示相對應的城市選單 - function (res) { - if (res.RESULT) { - var saList = res.DATA.rel; - $('#CityID').html(createOptions(saList, 'CityID', 'CityName', true)).on('change', function () { - if ($('#CityID').val()) { - fnSetOrderByValueDrop(); //若CityID改變,觸發OrderByValue選單 - } - }); - } - }); + //城市下拉選單 + fnSetCityValueDrop = function (CountryID) { + return g_api.ConnectLite(canDo.ProgramId, "GetCity", + { CountryID: $("#CountryID").val() }, //依據所選擇的國家顯示相對應的城市選單 + function (res) { + if (res.RESULT) { + var saList = res.DATA.rel; + $('#CityID').html(createOptions(saList, 'CityID', 'CityName', true)).on('change', function () { + if ($('#CityID').val()) { + fnSetOrderByValueDrop(); //若CityID改變,觸發OrderByValue選單 + } + }); + } + }); }, - //洲別下拉選單 - fnSetRegionValueDrop = function () { - return g_api.ConnectLite(canDo.ProgramId, "GetRegion", {}, - function (res) { - if (res.RESULT) { - var regionList = res.DATA.rel;; - $('#RegionID').html(createOptions(regionList, 'RegionID', 'RegionName', true)).on('change', function () { + //洲別下拉選單 + fnSetRegionValueDrop = function () { + return g_api.ConnectLite(canDo.ProgramId, "GetRegion", {}, + function (res) { + if (res.RESULT) { + var regionList = res.DATA.rel;; + $('#RegionID').html(createOptions(regionList, 'RegionID', 'RegionName', true)).on('change', function () { if ($('#RegionID').val()) { fnSetCountryValueDrop(); //若RegionID改變,觸發國家選單 } }); - } - }); + } + }); }, - fnSetOrderByValueDrop = function () { - return g_api.ConnectLite(canDo.ProgramId, canDo._api.getcout, { CityID: $("#CityID").val()}, - function (res) { - if (res.RESULT) { - - 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); - } - } - }); - }, - - + fnSetOrderByValueDrop = function () { + return g_api.ConnectLite(canDo.ProgramId, canDo._api.getcout, { CityID: $("#CityID").val() }, + function (res) { + if (res.RESULT) { + 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); \ No newline at end of file