|
@@ -9,15 +9,15 @@ define(['app/app'], function(app) {
|
|
|
var hideBankFilter = $filter("hideBankFilter");
|
|
var hideBankFilter = $filter("hideBankFilter");
|
|
|
|
|
|
|
|
//历史记录的状态
|
|
//历史记录的状态
|
|
|
- var hiStatus= SessionService.get('buyCenter');
|
|
|
|
|
|
|
+ var hiStatus= SessionService.getCookie("buyCenter");
|
|
|
|
|
|
|
|
$scope.status = hiStatus == null ? 'pay-history' : hiStatus;
|
|
$scope.status = hiStatus == null ? 'pay-history' : hiStatus;
|
|
|
|
|
|
|
|
- //切换银行账户信息,历史记录的的的状态
|
|
|
|
|
|
|
+ //切换银行账户信息,历史记录的状态
|
|
|
$scope.toggleStatus = function(status) {
|
|
$scope.toggleStatus = function(status) {
|
|
|
if($scope.status != status) {
|
|
if($scope.status != status) {
|
|
|
$scope.status = status;
|
|
$scope.status = status;
|
|
|
- SessionService.set('buyCenter', status);
|
|
|
|
|
|
|
+ SessionService.setCookie('buyCenter', status);
|
|
|
loadData();
|
|
loadData();
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
@@ -120,10 +120,15 @@ define(['app/app'], function(app) {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- $scope.condition = {
|
|
|
|
|
- startDateOpen: false,
|
|
|
|
|
- endDateOpen: false
|
|
|
|
|
|
|
+ $scope.condition = [];
|
|
|
|
|
+ var start = {
|
|
|
|
|
+ open : false
|
|
|
};
|
|
};
|
|
|
|
|
+ var end = {
|
|
|
|
|
+ open : false
|
|
|
|
|
+ };
|
|
|
|
|
+ $scope.condition.push(start);
|
|
|
|
|
+ $scope.condition.push(end);
|
|
|
|
|
|
|
|
// 打开日期选择框
|
|
// 打开日期选择框
|
|
|
$scope.openDatePicker = function($event, item, openParam, status) {
|
|
$scope.openDatePicker = function($event, item, openParam, status) {
|
|
@@ -141,7 +146,81 @@ define(['app/app'], function(app) {
|
|
|
}
|
|
}
|
|
|
$event.preventDefault();
|
|
$event.preventDefault();
|
|
|
$event.stopPropagation();
|
|
$event.stopPropagation();
|
|
|
- item[openParam] = !item[openParam];
|
|
|
|
|
|
|
+ openParam == 0 ? $scope.condition[1].open = false : $scope.condition[0].open = false;
|
|
|
|
|
+ item[openParam].open = !item[openParam].open;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ $scope.onDateCondition = function (bool) {
|
|
|
|
|
+ var text = '';
|
|
|
|
|
+ var datePattern = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
|
|
|
+ if (bool == 1){
|
|
|
|
|
+ text = document.getElementById("start").value;
|
|
|
|
|
+ if (text != '' && !datePattern.test(text)){
|
|
|
|
|
+ // $scope.startDate = text;
|
|
|
|
|
+ toaster.pop("info", "请输入正确开始时间格式");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (text != '' && !validateDate(text)){
|
|
|
|
|
+ // $scope.startDate = text;
|
|
|
|
|
+ toaster.pop("info", "请输入正确开始时间格式");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!$scope.startDate && text != ''){
|
|
|
|
|
+ $scope.startDate = convertTextToDate(text);
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($scope.startDate && !$scope.endDate){
|
|
|
|
|
+ var nowTime = new Date();
|
|
|
|
|
+ $scope.endDate = new Date(nowTime.getFullYear(), nowTime.getMonth(), nowTime.getDate());
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($scope.endDate && $scope.startDate.getTime() > $scope.endDate.getTime()){
|
|
|
|
|
+ $scope.endDate = new Date($scope.startDate.getTime() + 86400000);
|
|
|
|
|
+ }
|
|
|
|
|
+ }else {
|
|
|
|
|
+ text = document.getElementById("end").value;
|
|
|
|
|
+ if (text != '' && !datePattern.test(text)){
|
|
|
|
|
+ // $scope.endDate = text;
|
|
|
|
|
+ toaster.pop("info", "请输入正确结束时间格式");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (text != '' && !validateDate(text)){
|
|
|
|
|
+ // $scope.endDate = text;
|
|
|
|
|
+ toaster.pop("info", "请输入正确结束时间格式");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!$scope.endDate && text != ''){
|
|
|
|
|
+ $scope.endDate = convertTextToDate(text);
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($scope.startDate && $scope.startDate.getTime() > $scope.endDate.getTime()){
|
|
|
|
|
+ $scope.startDate = new Date($scope.endDate.getTime() - 86400000);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 将文本转化为日期
|
|
|
|
|
+ * @param value
|
|
|
|
|
+ * @returns {Date}
|
|
|
|
|
+ */
|
|
|
|
|
+ var convertTextToDate = function (value) {
|
|
|
|
|
+ var date = value;
|
|
|
|
|
+ var result = date.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);
|
|
|
|
|
+
|
|
|
|
|
+ return new Date(result[1], result[3] - 1, result[4]);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 验证日期格式是否正确
|
|
|
|
|
+ * @param value
|
|
|
|
|
+ * @returns {boolean}
|
|
|
|
|
+ */
|
|
|
|
|
+ var validateDate = function (value) {
|
|
|
|
|
+ var date = value;
|
|
|
|
|
+ var result = date.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);
|
|
|
|
|
+
|
|
|
|
|
+ if (result == null)
|
|
|
|
|
+ return false;
|
|
|
|
|
+ var d = new Date(result[1], result[3] - 1, result[4]);
|
|
|
|
|
+ return (d.getFullYear() == result[1] && (d.getMonth() + 1) == result[3] && d.getDate() == result[4]);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
var loadAccountData = function() {
|
|
var loadAccountData = function() {
|
|
@@ -149,6 +228,14 @@ define(['app/app'], function(app) {
|
|
|
$scope.bankInfoTableParams.reload();
|
|
$scope.bankInfoTableParams.reload();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ var clearHistoryParams = function () {
|
|
|
|
|
+ $scope.keyword = null;
|
|
|
|
|
+ $scope.currency = 'ALL';
|
|
|
|
|
+ $scope.paytype = 'ALL';
|
|
|
|
|
+ $scope.startDate = null;
|
|
|
|
|
+ $scope.endDate = null;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
$scope.filterLoad = function () {
|
|
$scope.filterLoad = function () {
|
|
|
loadPayHistory();
|
|
loadPayHistory();
|
|
|
};
|
|
};
|
|
@@ -225,6 +312,7 @@ define(['app/app'], function(app) {
|
|
|
var loadData = function() {
|
|
var loadData = function() {
|
|
|
switch ($scope.status) {
|
|
switch ($scope.status) {
|
|
|
case 'pay-info' :
|
|
case 'pay-info' :
|
|
|
|
|
+ clearHistoryParams();
|
|
|
loadAccountData();
|
|
loadAccountData();
|
|
|
break;
|
|
break;
|
|
|
case 'pay-history':
|
|
case 'pay-history':
|
|
@@ -235,6 +323,14 @@ define(['app/app'], function(app) {
|
|
|
loadData();
|
|
loadData();
|
|
|
|
|
|
|
|
$scope.search = function () {
|
|
$scope.search = function () {
|
|
|
|
|
+ if (!$scope.startDate && $scope.endDate){
|
|
|
|
|
+ toaster.pop("info", "请输入起始日期");
|
|
|
|
|
+ return ;
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($scope.startDate && !$scope.endDate){
|
|
|
|
|
+ toaster.pop("info", "请输入结束日期");
|
|
|
|
|
+ return ;
|
|
|
|
|
+ }
|
|
|
loadPayHistory();
|
|
loadPayHistory();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -493,6 +589,11 @@ define(['app/app'], function(app) {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ $rootScope.$on('$stateChangeStart',function(event,toState,toParams,fromState,fromParams){
|
|
|
|
|
+ if(fromState.name == 'pay_center' || toState.name == 'pay_center'){
|
|
|
|
|
+ SessionService.removeCookie("buyCenter");
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}]);
|
|
}]);
|
|
|
|
|
|
|
|
|
|
|
|
@@ -508,13 +609,6 @@ define(['app/app'], function(app) {
|
|
|
'兴业银行','中信银行','中国光大银行','广发银行','平安银行','中国邮政储蓄银行','华夏银行','浦发银行'
|
|
'兴业银行','中信银行','中国光大银行','广发银行','平安银行','中国邮政储蓄银行','华夏银行','浦发银行'
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
- // $scope.bankBlur = function () {
|
|
|
|
|
- // console.log(!$scope.account.bankname);
|
|
|
|
|
- // if (!$scope.account.bankname){
|
|
|
|
|
- // $scope.showBankFrame = true;
|
|
|
|
|
- // }
|
|
|
|
|
- // };
|
|
|
|
|
-
|
|
|
|
|
$scope.showList = function () {
|
|
$scope.showList = function () {
|
|
|
$scope.showBankFrame = !$scope.showBankFrame;
|
|
$scope.showBankFrame = !$scope.showBankFrame;
|
|
|
$scope.matchData = true;
|
|
$scope.matchData = true;
|
|
@@ -609,7 +703,7 @@ define(['app/app'], function(app) {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
var validateRepeat = function (number) {
|
|
var validateRepeat = function (number) {
|
|
|
- bankInfoService.getCountByNumber({type:1062,number:number}, {}, function (data) {
|
|
|
|
|
|
|
+ bankInfoService.getCountByNumber({type:1061, number:number}, {}, function (data) {
|
|
|
if (data.success){
|
|
if (data.success){
|
|
|
if (data.data != 0){
|
|
if (data.data != 0){
|
|
|
$scope.repeatError = true;
|
|
$scope.repeatError = true;
|
|
@@ -633,8 +727,8 @@ define(['app/app'], function(app) {
|
|
|
toaster.pop('error', '请按要求填写正确的信息');
|
|
toaster.pop('error', '请按要求填写正确的信息');
|
|
|
return ;
|
|
return ;
|
|
|
}
|
|
}
|
|
|
- if ($scope.branchError || $scope.branchPattError || $scope.numberError || $scope.numberPattError ||
|
|
|
|
|
- $scope.nameError){
|
|
|
|
|
|
|
+ if (!$scope.matchData || $scope.branchError || $scope.branchPattError || $scope.numberError || $scope.numberPattError ||
|
|
|
|
|
+ $scope.nameError || $scope.repeatError){
|
|
|
toaster.pop('error', '请按要求填写正确的信息');
|
|
toaster.pop('error', '请按要求填写正确的信息');
|
|
|
return ;
|
|
return ;
|
|
|
}
|
|
}
|