Selaa lähdekoodia

卖家中心-求购询价

liusw 8 vuotta sitten
vanhempi
commit
a6bb5a942c

+ 9 - 3
src/main/webapp/resources/js/vendor/app.js

@@ -1,4 +1,4 @@
-define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'common/query/brand', 'common/query/kind', 'common/query/component', 'common/query/goods', 'common/query/rate','common/query/cart', 'common/query/order', 'common/query/address', 'common/query/invoice', 'common/query/property', 'common/query/kindAdvice', 'common/query/propertyAdvice', 'common/query/return' , 'common/query/change', 'common/query/logistics', 'ui.router', 'ui-bootstrap', 'ui-form', 'ui-jquery','angular-toaster', 'ngDraggable', 'angular-sanitize', 'ngTable', 'dynamicInput', 'jquery-imagezoom', 'file-upload', 'file-upload-shim', 'common/query/urlencryption' , 'common/query/purchase', 'common/query/vendor', 'common/query/goods', 'common/query/bankTransfer', 'common/query/enterprise', 'common/query/bill', 'common/query/receipt', 'common/query/collection', 'common/query/express', 'common/query/bankInfo','common/query/charge', 'common/query/statistics', 'common/query/currency', 'jquery-chart', 'common/query/responseLogistics', 'common/query/goodsPrice', 'common/query/address' , 'common/query/search', 'common/query/urlencryption', 'common/query/releaseProInfo', 'common/query/makerDemand', 'common/query/afterSale', 'common/query/messageBoard', 'common/query/logistics', 'common/query/storeInfo', 'common/query/recommendation', 'common/query/user', 'common/query/logisticsPort', 'common/query/cms', 'common/query/material', 'common/query/storeCms', 'common/query/productImport', 'common/query/stockInOut', 'common/module/store_recommend_product', 'common/module/chat_web_module', 'common/query/standardPutOnAdmin', 'common/query/storeViolations', 'common/query/internalMessage', 'common/query/installments'], function(angularAMD) {
+define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'common/query/brand', 'common/query/kind', 'common/query/component', 'common/query/goods', 'common/query/rate','common/query/cart', 'common/query/order', 'common/query/address', 'common/query/invoice', 'common/query/property', 'common/query/kindAdvice', 'common/query/propertyAdvice', 'common/query/return' , 'common/query/change', 'common/query/logistics', 'ui.router', 'ui-bootstrap', 'ui-form', 'ui-jquery','angular-toaster', 'ngDraggable', 'angular-sanitize', 'ngTable', 'dynamicInput', 'jquery-imagezoom', 'file-upload', 'file-upload-shim', 'common/query/urlencryption' , 'common/query/purchase', 'common/query/vendor', 'common/query/goods', 'common/query/bankTransfer', 'common/query/enterprise', 'common/query/bill', 'common/query/receipt', 'common/query/collection', 'common/query/express', 'common/query/bankInfo','common/query/charge', 'common/query/statistics', 'common/query/currency', 'jquery-chart', 'common/query/responseLogistics', 'common/query/goodsPrice', 'common/query/address' , 'common/query/search', 'common/query/urlencryption', 'common/query/releaseProInfo', 'common/query/makerDemand', 'common/query/afterSale', 'common/query/messageBoard', 'common/query/logistics', 'common/query/storeInfo', 'common/query/recommendation', 'common/query/user', 'common/query/logisticsPort', 'common/query/cms', 'common/query/material', 'common/query/storeCms', 'common/query/productImport', 'common/query/stockInOut', 'common/module/store_recommend_product', 'common/module/chat_web_module', 'common/query/standardPutOnAdmin', 'common/query/storeViolations', 'common/query/internalMessage', 'common/query/installments','common/query/seekPurchase'], function(angularAMD) {
 	'use strict';
 	/**
 	 * 自定义Array对象的属性last 方法
@@ -8,7 +8,7 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 		return this.length > 0 ? this[this.length - 1] : null;
 	};
 
-	var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ng.local', 'ui.form', 'ui.jquery', 'toaster', 'ngDraggable', 'tool.directives', 'ngSanitize', 'common.query.kind', 'common.services', 'brandServices', 'componentServices', 'goodsServices',  'rateServices','cartServices', 'orderServices', 'addressServices', 'invoiceServices', 'common.query.propertyAdvice', 'propertyServices', 'returnServices' , 'changeServices',  'logisticsServices', 'common.query.kindAdvice', 'ngTable', 'ngDynamicInput', 'common.directives', 'angularFileUpload', 'urlencryptionServices', 'purchaseServices', 'vendorServices', 'goodsServices', 'bankTransfer', 'common.query.enterprise', 'billServices', 'receiptServices', 'collection', 'expressServices', 'bankInfo','Charge', 'statisticsServices', 'currencyService', 'responseLogisticsService', 'PriceServices', 'addressServices', 'searchService', 'urlencryptionServices', 'ReleaseProductByBatchService', 'makerDemand', 'afterSaleService', 'messageBoardServices', 'logisticsServices', 'table.directives', 'storeInfoServices', 'recommendation', 'common.query.user', 'logisticsPortService', 'cmsService', 'materialServices', 'StoreCmsServices', 'productImportModule', 'stockInOutModule', 'StoreCmsModule', 'WebChatModule', 'StandardPutOnAdminModule', 'StoreViolationsServices', 'internalMessageServices', 'installmentServices']);
+	var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ng.local', 'ui.form', 'ui.jquery', 'toaster', 'ngDraggable', 'tool.directives', 'ngSanitize', 'common.query.kind', 'common.services', 'brandServices', 'componentServices', 'goodsServices',  'rateServices','cartServices', 'orderServices', 'addressServices', 'invoiceServices', 'common.query.propertyAdvice', 'propertyServices', 'returnServices' , 'changeServices',  'logisticsServices', 'common.query.kindAdvice', 'ngTable', 'ngDynamicInput', 'common.directives', 'angularFileUpload', 'urlencryptionServices', 'purchaseServices', 'vendorServices', 'goodsServices', 'bankTransfer', 'common.query.enterprise', 'billServices', 'receiptServices', 'collection', 'expressServices', 'bankInfo','Charge', 'statisticsServices', 'currencyService', 'responseLogisticsService', 'PriceServices', 'addressServices', 'searchService', 'urlencryptionServices', 'ReleaseProductByBatchService', 'makerDemand', 'afterSaleService', 'messageBoardServices', 'logisticsServices', 'table.directives', 'storeInfoServices', 'recommendation', 'common.query.user', 'logisticsPortService', 'cmsService', 'materialServices', 'StoreCmsServices', 'productImportModule', 'stockInOutModule', 'StoreCmsModule', 'WebChatModule', 'StandardPutOnAdminModule', 'StoreViolationsServices', 'internalMessageServices', 'installmentServices','seekPurchaseServices']);
 	//初始化,启动时载入app
 	app.init = function() {
 		angularAMD.bootstrap(app);
@@ -48,7 +48,13 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 			title: '物流信息',
 			controllerUrl: 'app/controllers/forstore/vendor_logistics_ctrl',
 			controller: 'vendorLogisticsCtrl'
-		})).state('vendor_query_logistics', angularAMD.route({
+		})).state('seekPurchase', angularAMD.route({
+      url: '/seek',
+      templateUrl: 'static/view/vendor/forstore/seekPurchase.html',
+      title: '求购询价',
+      controllerUrl: 'app/controllers/forstore/seek_purchase_ctrl',
+      controller: 'seekPurchaseCtrl'
+    })).state('vendor_query_logistics', angularAMD.route({
             url: '/logistics/query/:purchaseid',
             templateUrl: 'static/view/vendor/forstore/query_logistics.html',
             title: '查询物流',

+ 80 - 1
src/main/webapp/resources/js/vendor/controllers/forstore/seek_purchase_ctrl.js

@@ -1,6 +1,85 @@
 define(['app/app'], function(app) {
-    app.register.controller('seekPurchaseCtrl', ['$scope', '$rootScope', '$stateParams','$state', 'toaster','Rate','Order','BaseService','ngTableParams', function ($scope, $rootScope, $stateParams, $state, toaster, Rate, Order, BaseService, ngTableParams) {
+    app.register.controller('seekPurchaseCtrl', ['$scope', '$rootScope', '$stateParams','$state', 'toaster','Rate','seekPurchase','BaseService','ngTableParams', function ($scope, $rootScope, $stateParams, $state, toaster, Rate, seekPurchase, BaseService, ngTableParams) {
         $scope.title = '求购询价';
         $rootScope.active = 'vendor_seek_purchase';
+        $scope.seekPurchaseRate = {};
+
+        // 获取当前卖家求购成交率
+        seekPurchase.getSeekPurchaseRate(function(data) {
+          $scope.seekPurchaseRate = data;
+        }, function(response) {
+          toaster.pop('error', '错误', response.data);
+        });
+
+        // 获取当前卖家的求购列表
+        seekPurchase.getVendorSeekPageInfo(function(data) {
+          $scope.seekPurchases = data.content ;
+        }, function(response) {
+          toaster.pop('error', '错误', response.data);
+        });
+
+      // 打开日期选择框
+      $scope.openDatePicker = function ($event, item, openParam,status) {
+        if (status != null) {
+          if (status == 1) {
+            if ($scope.startDate != null) {
+              return;
+            }
+          }
+          if (status == 2) {
+            if ($scope.endDate != null) {
+              return;
+            }
+          }
+        }
+        $event.preventDefault();
+        $event.stopPropagation();
+        item[openParam] = !item[openParam];
+        if (openParam == 'startDateOpen'){
+          if (item['endDateOpen']){
+            item['endDateOpen'] = !item['endDateOpen'];
+          }
+        } else if(openParam == 'endDateOpen'){
+          if (item['startDateOpen']){
+            item['startDateOpen'] = !item['startDateOpen'];
+          }
+        }
+      };
+      $scope.changeEndDate = function () {
+        if ($scope.condition.endDateOpen) {
+          $scope.endDate = $scope.endDate.toString().replace(/[0-9]{2}:[0-9]{2}:[0-9]{2}/g, '23:59:59');//;'23.59';//DateUtil.yyyyMmDd($scope.endDate.getTime() + 86399000);
+          $scope.endDate = new Date(formatDateTime(new Date($scope.endDate.toString())));
+        }
+        $scope.vaildDate(false);
+      };
+      $scope.vaildDate = function (isStart) {
+        if ($scope.endDate !== null && $scope.startDate>$scope.endDate){
+          if (isStart){
+            alert("开始日期大于结束日期,请重新输入!");
+            $scope.startDate = null;
+          } else {
+            alert("开始日期大于结束日期,请重新输入!");
+            $scope.endDate = null;
+          }
+        }
+      };
+      var formatDateTime = function (date) {
+        var y = date.getFullYear();
+        var m = date.getMonth() + 1;
+        m = m < 10 ? ('0' + m) : m;
+        var d = date.getDate();
+        d = d < 10 ? ('0' + d) : d;
+        var h = date.getHours();
+        var minute = date.getMinutes();
+        var sec = date.getSeconds();
+        minute = minute < 10 ? ('0' + minute) : minute;
+        return y + '-' + m + '-' + d+' '+h+':'+minute+':'+sec;
+      };
+      // 选择查找日期
+      $scope.onDateCondition = function () {
+        $scope.param.page = 1;
+        $scope.orderTableParams.page(1);
+        $scope.orderTableParams.reload();
+      };
     }]);
 });