Browse Source

Onsite展會修改

Dev
alina 2 years ago
parent
commit
a69d74e9a4
  1. 29
      EuroTran/WebApp/Page/ShowEasy/ONSiteMaintain_Upd.html
  2. 115
      EuroTran/WebApp/Scripts/pages/ShowEasy/ONSiteMaintain_Upd.js

29
EuroTran/WebApp/Page/ShowEasy/ONSiteMaintain_Upd.html

@ -329,8 +329,8 @@
<input type="text" class="form-control w200p" name="ExhibitionNames" id="ExhibitionNames" disabled>
</td>
<td>
<button type="button" class="btn btn-success" id="btnQryExhibition" data-toggle="modal" data-target="#Exhibition"><i class="fa fa-search"></i></button>
<!--<button type="button" class="btn btn-success" id="btnQryExhibition" data-toggle="modal" data-target="#Exhibition"><i class="fa fa-search"></i></button>-->
<button type="button" class="btn btn-success" id="btnQryExhibition"><i class="fa fa-search"></i></button>
</td>
</tr>
</table>
@ -794,27 +794,6 @@
</div>
</div>
<div class="row">
<label class="col-sm-2 control-label" for="input-Default">
</label>
<div class="col-sm-2">
</div>
<label class="col-sm-2 control-label" for="input-Default">
</label>
<div class="col-sm-4">
<button type="button" class="btn-custom blue" id="btnSurveyAllCheck">全部勾選</button>
<button type="button" class="btn-custom blue" id="btnSurveyAllClear">全部取消</button>
</div>
</div>
<div id="content-box-view">
@ -879,7 +858,7 @@
</div>-->
<!-- 展會列表 -->
<div class="modal fade" id="Exhibition" tabindex="-1" role="dialog" aria-labelledby="ExhibitionModalLabel" aria-hidden="true">
<div class="modal fade" id="ExhibitionPop" tabindex="-1" role="dialog" aria-labelledby="ExhibitionModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content" style="width:700px;">
<div class="modal-header">
@ -904,7 +883,7 @@
<select class="form-control w100p" id="SubCategoryIDPop" name="SubCategoryIDPop"></select>
</div>
<div class="col-sm-2">
<button type="button" class="btn-custom blue" id="btnQryExhibition">查詢</button>
<button type="button" class="btn-custom blue" id="btnQryExhibitionPop">查詢</button>
</div>
</div>

115
EuroTran/WebApp/Scripts/pages/ShowEasy/ONSiteMaintain_Upd.js

@ -10,6 +10,7 @@ var saRegionList = [];
var copyFlag = null;
var oTWCity = [];
var oTruck = [];
var selExhibition = [];
var fnPageInit = function () {
var sLang = g_ul.GetLang(),
canDo = new CanDo({
@ -443,6 +444,27 @@ var fnPageInit = function () {
});
//綁定展會查詢事件部分
$('#btnQryExhibition').unbind('click').click(function () {
$("#MainCategoryIDPop").val("");
$("#SubCategoryIDPop").val(""),
$("#ExhibitionNamePop").val(""),
selExhibition = [];
$.whenArray([fnGetExhibitionList()]).done(function (res) {
//把需要的選上
$('#jsExhibitionGrid').find('[type=checkbox]').each(function () {
if ($("#ExhibitionID").val().indexOf($(this).attr("ExhibitionID")) > -1) {
//this.checked = true;
$(this).click();
}
});
$("#jsExhibitionGrid").find('#SelectAll')[0].checked = false;
$('#ExhibitionPop').modal('toggle');
});
});
//基本資訊儲存
$('#btnSaveBasic').click(function () {
if (!$.isEmptyObject(canDo.UE_Editor)) {
@ -553,7 +575,6 @@ var fnPageInit = function () {
});
$('#jsOrderQuertionGrid [data-input]').on('change click', function () {
// debugger;
var sId = $(this).attr('data-value') * 1,
sVal = this.value;
@ -1665,16 +1686,6 @@ var fnPageInit = function () {
$('#btnQrySurvey').unbind('click').click(function () {
fnGetSurveyQustionList();
});
$('#btnSurveyAllCheck').unbind('click').click(function () {
$('#jsSurveyQustionGrid').find('[type=checkbox]').each(function () {
this.checked = true;
});
});
$('#btnSurveyAllClear').unbind('click').click(function () {
$('#jsSurveyQustionGrid').find('[type=checkbox]:checked').each(function () {
this.checked = false;
});
});
$("#jsSurveyQustionGrid").jsGrid({
width: "100%",
@ -1689,7 +1700,26 @@ var fnPageInit = function () {
},
fields: [
{
width: 30, sorting: false, align: "center",
width: 50, sorting: false, align: "center",
headerTemplate: function () {
return [$("<input>", {
id: 'SelectAll',
type: 'checkbox', click: function () {
if (this.checked) {
$("#jsSurveyQustionGrid").find('[type=checkbox]').each(function () {
this.checked = true;
});
}
else {
$("#jsSurveyQustionGrid").find('[type=checkbox]:checked').each(function () {
this.checked = false;
});
}
}
}), $('<label />', { for: 'SelectAll', 'html': '全選' })]
},
itemTemplate: function (value, item) {
return $("<input>", {
type: 'checkbox', click: function (e) {
@ -1951,12 +1981,14 @@ var fnPageInit = function () {
},
//初始化展覽問題列表的Gird
fnInitExhibitionGrid = function () {
var saLastData = [],
KeyCol = "ExhibitionID";
//展覽主,子類別綁定
setExhibCategory("MainCategoryIDPop", "Y");
setExhibCategory("SubCategoryIDPop", "N");
//綁定訂單問題事件部分
$('#btnQryExhibition').unbind('click').click(function () {
//綁定展會查詢事件部分
$('#btnQryExhibitionPop').unbind('click').click(function () {
fnGetExhibitionList();
});
@ -1973,18 +2005,54 @@ var fnPageInit = function () {
},
fields: [
{
width: 30, sorting: false, align: "center",
width: 50, sorting: false, align: "center",
headerTemplate: function () {
return [$("<input>", {
id: 'SelectAll',
type: 'checkbox', click: function () {
if (this.checked) {
$("#jsExhibitionGrid").find('[type=checkbox]').each(function () {
this.checked = true;
});
$.each(saLastData, function (idx, _item) {
selExhibition = Jsonremove(selExhibition, KeyCol, _item[KeyCol]);
selExhibition.push(_item);
});
}
else {
$("#jsExhibitionGrid").find('[type=checkbox]:checked').each(function () {
this.checked = false;
});
$.each(saLastData, function (idx, _item) {
selExhibition = Jsonremove(selExhibition, KeyCol, _item[KeyCol]);
});
}
}
}), $('<label />', { for: 'SelectAll', 'html': '全選' })]
},
itemTemplate: function (value, item) {
return $("<input>", {
type: 'checkbox', click: function (e) {
e.stopPropagation();
},
if (this.checked) {
selExhibition = Jsonremove(selExhibition, KeyCol, item[KeyCol]);
selExhibition.push(item);
}
else {
selExhibition = Jsonremove(selExhibition, KeyCol, item[KeyCol]);
$("#jsExhibitionGrid").find('#SelectAll')[0].checked = false;
}
}
, checked: Jsonget(selExhibition, KeyCol, item[KeyCol])[0] != undefined // ($("#ExhibitionID").val().indexOf(item.ExhibitionID) > -1 ? true : false)
,
"ExhibitionID": item.ExhibitionID,
"ExhibitionName": item.ExhibitionName
});
}
},
{ name: "ExhibitionNo", title: '展覽號碼', editing: false, align: "left", width: 80 },
/*{ name: "ExhibitionNo", title: '展覽號碼', editing: false, align: "left", width: 80 },*/
{ name: "ExhibitionName", title: '展覽名稱', editing: false, align: "left", width: 250 },
{ name: "AbbreviatedName", title: '展覽簡稱', editing: false, align: "left", width: 100 }
],
@ -1994,6 +2062,7 @@ var fnPageInit = function () {
fnGetExhibitionList(args);
}
else {
saLastData = args.PopData.data;
return args.PopData;
}
},
@ -2009,19 +2078,17 @@ var fnPageInit = function () {
$('#ExhibitionOK').click(function () {
$('#ExhibitionNames').val("");
$('#ExhibitionID').val("");
if ($('#jsExhibitionGrid').find('[type=checkbox]:checked').length > 0) {
if (selExhibition.length > 0) {
var saExhibition = [];
var sExhibition = '';
$('#jsExhibitionGrid').find('[type=checkbox]:checked').each(function () {
saExhibition.push($(this).attr("ExhibitionID"));
sExhibition += $(this).attr("ExhibitionName")+";";
});
selExhibition.forEach(function (item) {
saExhibition.push(item.ExhibitionID);
sExhibition += item.ExhibitionName + ";";
})
$('#ExhibitionNames').val(sExhibition);
$("#ExhibitionNames").attr("title", sExhibition);
$('#ExhibitionID').val(JSON.stringify(saExhibition));
};
});
},

Loading…
Cancel
Save