|
|
@@ -3,8 +3,8 @@
|
|
|
*/
|
|
|
define(['app/app'], function(app) {
|
|
|
'use strict';
|
|
|
- app.register.controller('payCenterCtrl', ['$scope', '$rootScope', 'ngTableParams', 'BaseService', 'bankInfoService', '$filter', 'SessionService', '$modal', 'toaster', 'OrderSimpleInfo', 'Loading', 'Authority', function($scope, $rootScope, ngTableParams, BaseService, bankInfoService, $filter, SessionService, $modal, toaster, OrderSimpleInfo, Loading, Authority) {
|
|
|
- $rootScope.active = 'pay_center';
|
|
|
+ app.register.controller('buyerPayCenterCtrl', ['$scope', '$rootScope', 'ngTableParams', 'BaseService', 'bankInfoService', '$filter', 'SessionService', '$modal', 'toaster', 'OrderSimpleInfo', 'Loading', 'Authority', '$stateParams', function($scope, $rootScope, ngTableParams, BaseService, bankInfoService, $filter, SessionService, $modal, toaster, OrderSimpleInfo, Loading, Authority, $stateParams) {
|
|
|
+ $rootScope.active = 'buyer_pay_center';
|
|
|
|
|
|
document.title = '支付中心-优软商城';
|
|
|
var hideBankFilter = $filter("hideBankFilter");
|
|
|
@@ -14,6 +14,11 @@ define(['app/app'], function(app) {
|
|
|
|
|
|
$scope.status = hiStatus == null ? 'pay-history' : hiStatus;
|
|
|
|
|
|
+ // pay-info
|
|
|
+ if ($stateParams.status) {
|
|
|
+ $scope.status = $stateParams.status;
|
|
|
+ }
|
|
|
+
|
|
|
//切换银行账户信息,历史记录的状态
|
|
|
$scope.toggleStatus = function(status) {
|
|
|
if($scope.status != status) {
|
|
|
@@ -42,6 +47,12 @@ define(['app/app'], function(app) {
|
|
|
|
|
|
$scope.paytype = 'ALL';
|
|
|
|
|
|
+ // 交易方式
|
|
|
+ $scope.remitteeType = 'ALL';
|
|
|
+
|
|
|
+ // 时间域选择
|
|
|
+ $scope.dateArea = 'ALL';
|
|
|
+
|
|
|
/**
|
|
|
* 使用ngTable 获取支付记录信息
|
|
|
*/
|
|
|
@@ -61,9 +72,12 @@ define(['app/app'], function(app) {
|
|
|
if ($scope.currency && $scope.currency != 'ALL'){
|
|
|
param.currencyName = $scope.currency;
|
|
|
}
|
|
|
- if ($scope.paytype && $scope.paytype != 'ALL'){
|
|
|
- param.method = $scope.paytype;
|
|
|
+ if ($scope.remitteeType && $scope.remitteeType !== 'ALL') {
|
|
|
+ param.remitteeType = $scope.remitteeType;
|
|
|
}
|
|
|
+ // if ($scope.paytype && $scope.paytype != 'ALL'){
|
|
|
+ // param.method = $scope.paytype;
|
|
|
+ // }
|
|
|
if ($scope.startDate){
|
|
|
param.fromDate = $scope.startDate.getTime();
|
|
|
}
|
|
|
@@ -197,6 +211,7 @@ define(['app/app'], function(app) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ loadPayHistory();
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
@@ -239,6 +254,63 @@ define(['app/app'], function(app) {
|
|
|
$scope.endDate = null;
|
|
|
};
|
|
|
|
|
|
+ var _formatDate = function (date, fmt) {
|
|
|
+ if (!date) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ if (typeof date === 'string') {
|
|
|
+ date = new Date(Date.parse(date.replace(/-/g, '/')));
|
|
|
+ }
|
|
|
+ var o = {
|
|
|
+ 'M+': date.getMonth() + 1, // 月份
|
|
|
+ 'd+': date.getDate(), // 日
|
|
|
+ 'h+': date.getHours(), // 小时
|
|
|
+ 'm+': date.getMinutes(), // 分
|
|
|
+ 's+': date.getSeconds(), // 秒
|
|
|
+ 'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
|
|
|
+ 'S': date.getMilliseconds() // 毫秒
|
|
|
+ }
|
|
|
+ if (/(y+)/.test(fmt)) {
|
|
|
+ fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
|
|
|
+ }
|
|
|
+ for (var k in o) {
|
|
|
+ if (new RegExp('(' + k + ')').test(fmt)) {
|
|
|
+ fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return fmt;
|
|
|
+ }
|
|
|
+
|
|
|
+ var _getClearDay = function (date) {
|
|
|
+ return new Date(_formatDate(date, 'yyyy-MM-dd')).getTime() - 8 * 60 * 60 * 1000
|
|
|
+ }
|
|
|
+
|
|
|
+ $scope.setFilters = function (type, val) {
|
|
|
+ $scope[type] = val;
|
|
|
+ if (type == 'dateArea') {
|
|
|
+ // 时间筛选
|
|
|
+ var currentTime = _getClearDay(new Date());
|
|
|
+ var endDate = new Date(currentTime + 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000);
|
|
|
+ if (val == 'ALL' || val == 'autoMonth') {
|
|
|
+ $scope.startDate = null;
|
|
|
+ $scope.endDate = null;
|
|
|
+ } else if (val == 'oneMonth') {
|
|
|
+ $scope.startDate = new Date(currentTime - 30 * 24 * 60 * 60 * 1000);
|
|
|
+ $scope.endDate = endDate;
|
|
|
+ } else if (val == 'threeMonth') {
|
|
|
+ $scope.startDate = new Date(currentTime - 3 * 30 * 24 * 60 * 60 * 1000);
|
|
|
+ $scope.endDate = endDate;
|
|
|
+ } else if (val == 'sixMonth') {
|
|
|
+ $scope.startDate = new Date(currentTime - 6 * 30 * 24 * 60 * 60 * 1000);
|
|
|
+ $scope.endDate = endDate;
|
|
|
+ } else {
|
|
|
+ $scope.startDate = null;
|
|
|
+ $scope.endDate = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ loadPayHistory();
|
|
|
+ }
|
|
|
+
|
|
|
$scope.filterLoad = function () {
|
|
|
loadPayHistory();
|
|
|
};
|
|
|
@@ -284,27 +356,7 @@ define(['app/app'], function(app) {
|
|
|
|
|
|
//编辑账户
|
|
|
$scope.editAccount = function(data) {
|
|
|
- var modalInstance = $modal.open({
|
|
|
- templateUrl : 'static/view/common/bankInfoModal.html',
|
|
|
- controller : 'BankInfoCtrl',
|
|
|
- resolve : {
|
|
|
- account : function() {
|
|
|
- //深拷贝一份
|
|
|
- return angular.copy(data);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- modalInstance.result.then(function(account) {
|
|
|
- if(data) {
|
|
|
- $scope.accounts.splice(data.num - 1, 1, account);
|
|
|
- }else {//如果是新增。
|
|
|
- loadAccountData();
|
|
|
- }
|
|
|
-
|
|
|
- }, function() {
|
|
|
-
|
|
|
- });
|
|
|
+ $scope.showAddFrame = true;
|
|
|
};
|
|
|
|
|
|
//获取数据的方法。
|
|
|
@@ -601,219 +653,215 @@ define(['app/app'], function(app) {
|
|
|
SessionService.unset("buyCenter");
|
|
|
}
|
|
|
});
|
|
|
- }]);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- app.register.controller('BankInfoCtrl', ['$scope', '$modalInstance', 'account', 'bankInfoService', 'toaster', function($scope, $modalInstance, account, bankInfoService, toaster){
|
|
|
-
|
|
|
- /**
|
|
|
- * 目前只支持的银行
|
|
|
- * @type {string[]}
|
|
|
- */
|
|
|
- $scope.bankList = [
|
|
|
- '中国银行','中国建设银行','中国工商银行','中国农业银行','交通银行','招商银行','中国民生银行',
|
|
|
- '兴业银行','中信银行','中国光大银行','广发银行','平安银行','中国邮政储蓄银行','华夏银行','浦发银行'
|
|
|
- ];
|
|
|
-
|
|
|
- var initIndex = function () {
|
|
|
- $scope.selectIndex = -1;
|
|
|
- $scope.downIndex = 0;
|
|
|
- };
|
|
|
-
|
|
|
- $scope.getItemFocus = function() {
|
|
|
- $scope.showBankFrame = true;
|
|
|
- $scope.matchData = true;
|
|
|
- $scope.resultList = $scope.bankList;
|
|
|
- initIndex();
|
|
|
- };
|
|
|
|
|
|
- $scope.onItemBlur = function () {
|
|
|
- if ($scope.time){
|
|
|
- clearTimeout($scope.time);
|
|
|
- }
|
|
|
- $scope.time = setTimeout(function () {
|
|
|
- $scope.$apply(function () {
|
|
|
- $scope.showBankFrame = false;
|
|
|
- });
|
|
|
- }, 200);
|
|
|
- };
|
|
|
- $scope.onKeyUp = function () {
|
|
|
- var dom = document.getElementById("ulContent");
|
|
|
- console.log(event);
|
|
|
- if ($scope.showBankFrame){
|
|
|
- if(event.keyCode == 40) { //监听到按下键
|
|
|
- $scope.selectIndex ++;
|
|
|
- if ($scope.downIndex == 5){
|
|
|
- dom.scrollTop += 44;
|
|
|
- }
|
|
|
- if ($scope.downIndex <= 4){
|
|
|
- $scope.downIndex++;
|
|
|
- }
|
|
|
- if($scope.selectIndex >= $scope.resultList.length){
|
|
|
- $scope.selectIndex = 0;
|
|
|
- dom.scrollTop = 0;
|
|
|
- $scope.downIndex = 1;
|
|
|
- }
|
|
|
- $scope.account.bankname = $scope.resultList[$scope.selectIndex];
|
|
|
- // $scope.containsAttr($scope.logistics.companyName);
|
|
|
- } else if(event.keyCode == 38) { //监听到按上键
|
|
|
- $scope.selectIndex --;
|
|
|
- if ($scope.downIndex == 1){
|
|
|
- dom.scrollTop -= 44;
|
|
|
- }
|
|
|
- if ($scope.downIndex >= 2){
|
|
|
- $scope.downIndex--;
|
|
|
- }
|
|
|
- if($scope.selectIndex < 0){
|
|
|
- $scope.selectIndex = $scope.resultList.length - 1;
|
|
|
- dom.scrollTop = 2400;
|
|
|
- $scope.downIndex = 5;
|
|
|
- }
|
|
|
- $scope.account.bankname = $scope.resultList[$scope.selectIndex];
|
|
|
- // $scope.containsAttr($scope.logistics.companyName);
|
|
|
- } else if(event.keyCode == 13) { //确定键
|
|
|
- $scope.showBankFrame = false;
|
|
|
+ // 复制新增加部分
|
|
|
+ /**
|
|
|
+ * 目前只支持的银行
|
|
|
+ * @type {string[]}
|
|
|
+ */
|
|
|
+ $scope.bankList = [
|
|
|
+ '中国银行','中国建设银行','中国工商银行','中国农业银行','交通银行','招商银行','中国民生银行',
|
|
|
+ '兴业银行','中信银行','中国光大银行','广发银行','平安银行','中国邮政储蓄银行','华夏银行','浦发银行'
|
|
|
+ ];
|
|
|
+
|
|
|
+ var initIndex = function () {
|
|
|
+ $scope.selectIndex = -1;
|
|
|
+ $scope.downIndex = 0;
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.getItemFocus = function() {
|
|
|
+ $scope.showBankFrame = true;
|
|
|
+ $scope.matchData = true;
|
|
|
+ $scope.resultList = $scope.bankList;
|
|
|
+ initIndex();
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.onItemBlur = function () {
|
|
|
+ if ($scope.time){
|
|
|
+ clearTimeout($scope.time);
|
|
|
+ }
|
|
|
+ $scope.time = setTimeout(function () {
|
|
|
+ $scope.$apply(function () {
|
|
|
+ $scope.showBankFrame = false;
|
|
|
+ });
|
|
|
+ }, 200);
|
|
|
+ };
|
|
|
+ $scope.onKeyUp = function () {
|
|
|
+ var dom = document.getElementById("ulContent");
|
|
|
+ if ($scope.showBankFrame){
|
|
|
+ if(event.keyCode == 40) { //监听到按下键
|
|
|
+ $scope.selectIndex ++;
|
|
|
+ if ($scope.downIndex == 5){
|
|
|
+ dom.scrollTop += 44;
|
|
|
+ }
|
|
|
+ if ($scope.downIndex <= 4){
|
|
|
+ $scope.downIndex++;
|
|
|
+ }
|
|
|
+ if($scope.selectIndex >= $scope.resultList.length){
|
|
|
+ $scope.selectIndex = 0;
|
|
|
+ dom.scrollTop = 0;
|
|
|
+ $scope.downIndex = 1;
|
|
|
+ }
|
|
|
+ $scope.account.bankname = $scope.resultList[$scope.selectIndex];
|
|
|
+ // $scope.containsAttr($scope.logistics.companyName);
|
|
|
+ } else if(event.keyCode == 38) { //监听到按上键
|
|
|
+ $scope.selectIndex --;
|
|
|
+ if ($scope.downIndex == 1){
|
|
|
+ dom.scrollTop -= 44;
|
|
|
+ }
|
|
|
+ if ($scope.downIndex >= 2){
|
|
|
+ $scope.downIndex--;
|
|
|
+ }
|
|
|
+ if($scope.selectIndex < 0){
|
|
|
+ $scope.selectIndex = $scope.resultList.length - 1;
|
|
|
+ dom.scrollTop = 2400;
|
|
|
+ $scope.downIndex = 5;
|
|
|
+ }
|
|
|
+ $scope.account.bankname = $scope.resultList[$scope.selectIndex];
|
|
|
+ // $scope.containsAttr($scope.logistics.companyName);
|
|
|
+ } else if(event.keyCode == 13) { //确定键
|
|
|
+ $scope.showBankFrame = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.showList = function () {
|
|
|
+ $scope.showBankFrame = !$scope.showBankFrame;
|
|
|
+ $scope.matchData = true;
|
|
|
+ $scope.resultList = $scope.bankList;
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.inputBankName = function () {
|
|
|
+ $scope.showBankFrame = true;
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.fitBankToAccount = function (item) {
|
|
|
+ $scope.account.bankname = item;
|
|
|
+ $scope.showBankFrame = false;
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.account = {};
|
|
|
+
|
|
|
+ var matchArray = function () {
|
|
|
+ $scope.account.bankname = $scope.account.bankname ? $scope.account.bankname : '';
|
|
|
+ $scope.resultList = $scope.bankList.filter(function (data) {
|
|
|
+ if (data.indexOf($scope.account.bankname) >= 0){
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if ($scope.resultList.length > 0){
|
|
|
+ $scope.matchData = true;
|
|
|
+ }else{
|
|
|
+ $scope.matchData = false;
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 验证新增账户格式
|
|
|
+ * @param num
|
|
|
+ */
|
|
|
+ $scope.checkAccount = function (num) {
|
|
|
+ var size;
|
|
|
+ if (num == 1){
|
|
|
+ //验证开户银行名称
|
|
|
+ $scope.showBankFrame = true;
|
|
|
+ matchArray();
|
|
|
+ }else if(num == 2){
|
|
|
+ //验证开户支行名称
|
|
|
+ if($scope.account.branchname){
|
|
|
+ size = $scope.account.branchname.replace(/[^\x00-\xff]/g,'**').length;
|
|
|
+ if (size > 40){
|
|
|
+ $scope.branchError = true;
|
|
|
+ }else {
|
|
|
+ $scope.branchError = false;
|
|
|
+ }
|
|
|
+ var telPatt = new RegExp("^[\u2E80-\u9FFF]+$");
|
|
|
+ if (telPatt.test($scope.account.branchname)){
|
|
|
+ $scope.branchPattError = false;
|
|
|
+ }else {
|
|
|
+ $scope.branchPattError = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if(num == 3){
|
|
|
+ //验证银行账号
|
|
|
+ if ($scope.account.number){
|
|
|
+ size = $scope.account.number.replace(/[^\x00-\xff]/g,'**').length;
|
|
|
+ if (size > 30){
|
|
|
+ $scope.numberError = true;
|
|
|
+ }else {
|
|
|
+ $scope.numberError = false;
|
|
|
+ }
|
|
|
+ var numPatt = new RegExp("^[0-9]+$");
|
|
|
+ if (numPatt.test($scope.account.number)){
|
|
|
+ $scope.numberPattError = false;
|
|
|
+ }else {
|
|
|
+ $scope.numberPattError = true;
|
|
|
+ }
|
|
|
+ validateRepeat($scope.account.number);
|
|
|
+ }
|
|
|
+ }else if(num == 4){
|
|
|
+ //验证开户名称
|
|
|
+ if ($scope.account.accountname){
|
|
|
+ size = $scope.account.accountname.replace(/[^\x00-\xff]/g,'**').length;
|
|
|
+ if (size > 100){
|
|
|
+ $scope.nameError = true;
|
|
|
+ }else {
|
|
|
+ $scope.nameError = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ var validateRepeat = function (number) {
|
|
|
+ bankInfoService.getCountByNumber({type:1061, number:number}, {}, function (data) {
|
|
|
+ if (data.success){
|
|
|
+ if (data.data != 0){
|
|
|
+ $scope.repeatError = true;
|
|
|
+ }else {
|
|
|
+ $scope.repeatError = false;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ toaster.pop("info", data.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.confirm = function() {
|
|
|
+ var account = $scope.account;
|
|
|
+
|
|
|
+ if (!account){
|
|
|
+ toaster.pop('error', '请按要求填写正确的信息');
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ if (!account.bankname || !account.branchname || !account.number || !account.accountname){
|
|
|
+ toaster.pop('error', '请按要求填写正确的信息');
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ if (!$scope.matchData || $scope.branchError || $scope.branchPattError || $scope.numberError || $scope.numberPattError ||
|
|
|
+ $scope.nameError || $scope.repeatError){
|
|
|
+ toaster.pop('error', '请按要求填写正确的信息');
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+
|
|
|
+ var method = 'saveBuyPersonalBank'; //不区分个人和企业账户
|
|
|
+ bankInfoService[method].call(null, null, $scope.account, function(data) {
|
|
|
+ if (data) {
|
|
|
+ $scope.showAddFrame = false;
|
|
|
+ $scope.account = {};
|
|
|
+ $scope.account.files = null;
|
|
|
+ toaster.pop('success', '保存成功');
|
|
|
+ loadAccountData();
|
|
|
}
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
- $scope.showList = function () {
|
|
|
- $scope.showBankFrame = !$scope.showBankFrame;
|
|
|
- $scope.matchData = true;
|
|
|
- $scope.resultList = $scope.bankList;
|
|
|
- };
|
|
|
-
|
|
|
- $scope.inputBankName = function () {
|
|
|
- $scope.showBankFrame = true;
|
|
|
- };
|
|
|
-
|
|
|
- $scope.fitBankToAccount = function (item) {
|
|
|
- $scope.account.bankname = item;
|
|
|
- $scope.showBankFrame = false;
|
|
|
- };
|
|
|
-
|
|
|
- $scope.account = account;
|
|
|
- if($scope.account) {
|
|
|
- $scope.title = "修改账户";
|
|
|
- }else {
|
|
|
- $scope.title = "新增账户";
|
|
|
- $scope.account = {};
|
|
|
- }
|
|
|
-
|
|
|
- var matchArray = function () {
|
|
|
- $scope.account.bankname = $scope.account.bankname ? $scope.account.bankname : '';
|
|
|
- $scope.resultList = $scope.bankList.filter(function (data) {
|
|
|
- if (data.indexOf($scope.account.bankname) >= 0){
|
|
|
- return data;
|
|
|
- }
|
|
|
- });
|
|
|
- if ($scope.resultList.length > 0){
|
|
|
- $scope.matchData = true;
|
|
|
- }else{
|
|
|
- $scope.matchData = false;
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
- /**
|
|
|
- * 验证新增账户格式
|
|
|
- * @param num
|
|
|
- */
|
|
|
- $scope.checkAccount = function (num) {
|
|
|
- var size;
|
|
|
- if (num == 1){
|
|
|
- //验证开户银行名称
|
|
|
- $scope.showBankFrame = true;
|
|
|
- matchArray();
|
|
|
- }else if(num == 2){
|
|
|
- //验证开户支行名称
|
|
|
- if($scope.account.branchname){
|
|
|
- size = $scope.account.branchname.replace(/[^\x00-\xff]/g,'**').length;
|
|
|
- if (size > 40){
|
|
|
- $scope.branchError = true;
|
|
|
- }else {
|
|
|
- $scope.branchError = false;
|
|
|
- }
|
|
|
- var telPatt = new RegExp("^[\u2E80-\u9FFF]+$");
|
|
|
- if (telPatt.test($scope.account.branchname)){
|
|
|
- $scope.branchPattError = false;
|
|
|
- }else {
|
|
|
- $scope.branchPattError = true;
|
|
|
- }
|
|
|
- }
|
|
|
- }else if(num == 3){
|
|
|
- //验证银行账号
|
|
|
- if ($scope.account.number){
|
|
|
- size = $scope.account.number.replace(/[^\x00-\xff]/g,'**').length;
|
|
|
- if (size > 30){
|
|
|
- $scope.numberError = true;
|
|
|
- }else {
|
|
|
- $scope.numberError = false;
|
|
|
- }
|
|
|
- var numPatt = new RegExp("^[0-9]+$");
|
|
|
- if (numPatt.test($scope.account.number)){
|
|
|
- $scope.numberPattError = false;
|
|
|
- }else {
|
|
|
- $scope.numberPattError = true;
|
|
|
- }
|
|
|
- validateRepeat($scope.account.number);
|
|
|
- }
|
|
|
- }else if(num == 4){
|
|
|
- //验证开户名称
|
|
|
- if ($scope.account.accountname){
|
|
|
- size = $scope.account.accountname.replace(/[^\x00-\xff]/g,'**').length;
|
|
|
- if (size > 100){
|
|
|
- $scope.nameError = true;
|
|
|
- }else {
|
|
|
- $scope.nameError = false;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
- var validateRepeat = function (number) {
|
|
|
- bankInfoService.getCountByNumber({type:1061, number:number}, {}, function (data) {
|
|
|
- if (data.success){
|
|
|
- if (data.data != 0){
|
|
|
- $scope.repeatError = true;
|
|
|
- }else {
|
|
|
- $scope.repeatError = false;
|
|
|
- }
|
|
|
- }else {
|
|
|
- toaster.pop("info", data.message);
|
|
|
- }
|
|
|
- });
|
|
|
- };
|
|
|
-
|
|
|
- $scope.confirm = function() {
|
|
|
- var account = $scope.account;
|
|
|
-
|
|
|
- if (!account){
|
|
|
- toaster.pop('error', '请按要求填写正确的信息');
|
|
|
- return ;
|
|
|
- }
|
|
|
- if (!account.bankname || !account.branchname || !account.number || !account.accountname){
|
|
|
- toaster.pop('error', '请按要求填写正确的信息');
|
|
|
- return ;
|
|
|
- }
|
|
|
- if (!$scope.matchData || $scope.branchError || $scope.branchPattError || $scope.numberError || $scope.numberPattError ||
|
|
|
- $scope.nameError || $scope.repeatError){
|
|
|
- toaster.pop('error', '请按要求填写正确的信息');
|
|
|
- return ;
|
|
|
- }
|
|
|
-
|
|
|
- var method = 'saveBuyPersonalBank'; //不区分个人和企业账户
|
|
|
- bankInfoService[method].call(null, null, $scope.account, function(data) {
|
|
|
- toaster.pop('success', '保存成功');
|
|
|
- $modalInstance.close(data)
|
|
|
- },function (err) {
|
|
|
- toaster.pop('error', err.data || '保存信息失败');
|
|
|
- });
|
|
|
- };
|
|
|
-
|
|
|
- $scope.cancel = function() {
|
|
|
- $modalInstance.dismiss();
|
|
|
- }
|
|
|
-
|
|
|
+ },function (err) {
|
|
|
+ toaster.pop('error', err.data || '保存信息失败');
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.cancel = function() {
|
|
|
+ $scope.showAddFrame = false;
|
|
|
+ $scope.account = {};
|
|
|
+ $scope.account.files = null;
|
|
|
+ $scope.showBankFrame = false;
|
|
|
+ }
|
|
|
}]);
|
|
|
});
|