From 9e9f472f3dd653c0e531d973d7af282c5e7c6f91 Mon Sep 17 00:00:00 2001 From: luoyang14z7 <704328506@qq.com> Date: Tue, 3 Jul 2018 17:51:01 +0800 Subject: [PATCH] devtools : add --- .../ui/static/config/devtools/devtools.js | 39 +++++++++++++++++++ .../devtools/templates/orgusertest.html | 2 +- .../config/devtools/templates/root.html | 8 ++++ 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/src/main/ui/static/config/devtools/devtools.js b/src/main/ui/static/config/devtools/devtools.js index c410bba37..79a863c89 100644 --- a/src/main/ui/static/config/devtools/devtools.js +++ b/src/main/ui/static/config/devtools/devtools.js @@ -51,6 +51,14 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) { url: '/phone_top_up', templateUrl: '/static/config/devtools/templates/phone_top_up.html', controller: 'phonetopupCtrl' + }).state('devtools.orgusertest', { + url: '/orgusertest', + templateUrl: '/static/config/devtools/templates/orgusertest.html', + controller: 'orgusertestCtrl' + }).state('devtools.aliforexcel', { + url: '/aliforexcel', + templateUrl: '/static/config/devtools/templates/aliforexcel.html', + controller: 'aliforexcelCtrl' }) }]); app.controller('devManualRefundCtrl', ['$scope', '$http', 'commonDialog', function ($scope, $http, commonDialog) { @@ -302,6 +310,37 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) { }) } }]); + app.controller('orgusertestCtrl', ['$scope', '$http', '$filter','commonDialog', function ($scope, $http, $filter,commonDialog) { + $scope.regist = function () { + + $http.post('/dev/orgusertest',{client_moniker: $scope.company}).then(function (resp) { + commonDialog.alert({title: 'SUCCESS', content:"注册成功", type: 'success'}) + }, function (resp) { + commonDialog.alert({title: 'Error', content: "商品编号已存在", type: 'Error'}) + }) + } +}]); + app.controller('aliforexcelCtrl', ['$scope', '$filter', function ($scope, $filter) { + $scope.params = {}; + var str = $filter('date')(new Date(), 'yyyyMMdd'); + var oDate = new Date(str.slice(0, 4), str.slice(4, 6) - 1, str.slice(-2)); + var oDay = oDate.getDay(); + var oNum = oDate.getDate(); + var bWeek1 =new Date(str.slice(0, 4), str.slice(4, 6) - 1, oNum-oDay-6); + var bWeek2 =new Date(str.slice(0, 4), str.slice(4, 6) - 1, oNum-oDay); + $scope.params.datefrom = bWeek1; + $scope.params.dateto = bWeek2; + $scope.Export = function () { + var params = angular.copy($scope.params); + params.datefrom = $filter('date')(params.datefrom, 'yyyy-MM-dd'); + params.dateto = $filter('date')(params.dateto, 'yyyy-MM-dd'); + var url = '/dev/aliforexcel'; + var connectSymbol = '?'; + url += connectSymbol + 'datefrom=' + params.datefrom + '&' + 'dateto=' + params.dateto; + return url; + } + + }]); return app; }); \ No newline at end of file diff --git a/src/main/ui/static/config/devtools/templates/orgusertest.html b/src/main/ui/static/config/devtools/templates/orgusertest.html index 002f27f98..909a0a792 100644 --- a/src/main/ui/static/config/devtools/templates/orgusertest.html +++ b/src/main/ui/static/config/devtools/templates/orgusertest.html @@ -21,7 +21,7 @@