|
楼主 |
发表于 2015-8-13 12:07:33
|
显示全部楼层
Model.prototype.searchBtnClick = function(event) {
var mealType, orderStatus, mealTime;
var orderListData = this.comp('orderListData');
var searchData = this.comp('searchData');
var typeData = this.comp('typeData');
var statusData = this.comp('statusData');
var mealData = this.comp('mealData');
alert(searchData.val('dateF'));
if (searchData.val('dateF') === null || searchData.val('dateF') === "") {
//alert('请输入订单日期');
this.comp('messageDialog1').show();
return;
}
//mealType
if (typeData.val('ZDH') == null || typeData.val('ZDH') == '') {
mealType = '';
} else {
mealType = typeData.val('ZDH');
}
//orderStatus
if (statusData.val('ZDH') == null || statusData.val('ZDH') == '') {
orderStatus = '';
} else {
orderStatus = statusData.val('ZDH');
}
//mealTime
if (mealData.val('ZDH') == null || mealData.val('ZDH') == '') {
mealTime = '';
} else {
mealTime = mealData.val('ZDH');
}
//调用action
var params = new biz.Request.ActionParam();
params.setString("mealType", mealType);
params.setString("orderStatus", orderStatus);
params.setString("mealTime", mealTime);
params.setString("stbh", this.comp('stbhData').val('stbh'));
params.setString("cardId", searchData.val('cardId'));
params.setDate("orderDate", justep.Date.fromString(searchData.val('dateF'), 'yyyy-MM-dd'));
// if (searchData.val('dateT') !== null && searchData.val('dateT') !== "") {
// params.setDate("dateT", justep.Date.fromString(searchData.val('dateT'), 'yyyy-MM-dd'));
// }
params.setString("orderId", searchData.val('orderId'));
biz.Request.sendBizRequest({
"context" : this.getContext(),
"action" : "queryOrderList",
"parameters" : params,
"callback" : function(resultData) {
resultData.ignoreError = false;
if (resultData.state) {
//alert(JSON.stringify(resultData.response));
orderListData.loadData(resultData.response);
//this.comp('contents2').to(1);
} else {
alert("shi bai");
}
}
});
}; |
|