Browse Source

后台增加求购管理功能

dongbw 7 years ago
parent
commit
1ce27f9e0f

+ 2 - 0
src/main/webapp/WEB-INF/views/normal/adminWithNav.html

@@ -189,6 +189,8 @@
 					class="fa fa-flag"></i><span>优质采购商</span></a></li>
 			<li class="nav-node"><a href="#/seekSalesman"><i
 					class="fa fa-flag"></i><span>求购-业务员分配</span></a></li>
+			<li class="nav-node"><a href="#/seekManage"><i
+					class="fa fa-flag"></i><span>求购信息管理</span></a></li>
 
 			<li class="nav-header">禁用信息</li>
 			<li class="nav-node"><a href="#/disable/brand"><i

+ 9 - 2
src/main/webapp/resources/js/admin/app.js

@@ -1,4 +1,4 @@
- define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ui-form', 'ngLocal', 'ngTable', 'ngSanitize', 'ngDraggable', 'common/services', 'common/directives', 'common/query/brand', 'common/query/address', 'common/query/return' , 'common/query/change' ,'common/query/component', 'common/query/order', 'common/query/purchase', 'common/query/invoice', 'common/query/property', 'common/query/kind', 'common/query/property', 'common/query/commodity', 'common/query/receipt', 'common/query/logistics' ,'angular-toaster', 'ui-jquery', 'jquery-uploadify','common/query/dateParse' , 'common/query/bankTransfer' ,'common/query/bankInfo', 'common/query/urlencryption', 'common/query/bill', 'common/query/makerDemand', 'common/query/goods', 'common/query/validtime', 'file-upload','file-upload-shim', 'common/query/slideImage', 'common/query/kindAdvice', 'common/query/responseLogistics', 'common/query/search','common/directives/dynamicInput', 'common/query/auditorMail', 'common/query/tradeBasicProperties', 'common/query/exchangeRate', 'common/query/tradeDeliveryDelayTime', 'common/query/payment', 'common/query/kindContrast', 'common/query/crawlTask', 'common/query/afterSale', 'common/query/refund', 'common/query/messageBoard', 'common/query/logisticsPort', 'common/query/storeInfo', 'common/query/cms', 'common/query/help', 'common/query/commonCount', 'common/module/store_admin_violations_module', 'common/query/internalMessage','common/query/user','common/query/secQuestion','common/query/keyWord','common/query/logUsage','common/query/seekQualityBuyer','common/query/loanApply', 'common/query/supplier', 'common/query/seekSalesman', 'common/query/b2bManage', 'common/query/adminNews'], function(angularAMD) {
+ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ui-form', 'ngLocal', 'ngTable', 'ngSanitize', 'ngDraggable', 'common/services', 'common/directives', 'common/query/brand', 'common/query/address', 'common/query/return' , 'common/query/change' ,'common/query/component', 'common/query/order', 'common/query/purchase', 'common/query/invoice', 'common/query/property', 'common/query/kind', 'common/query/property', 'common/query/commodity', 'common/query/receipt', 'common/query/logistics' ,'angular-toaster', 'ui-jquery', 'jquery-uploadify','common/query/dateParse' , 'common/query/bankTransfer' ,'common/query/bankInfo', 'common/query/urlencryption', 'common/query/bill', 'common/query/makerDemand', 'common/query/goods', 'common/query/validtime', 'file-upload','file-upload-shim', 'common/query/slideImage', 'common/query/kindAdvice', 'common/query/responseLogistics', 'common/query/search','common/directives/dynamicInput', 'common/query/auditorMail', 'common/query/tradeBasicProperties', 'common/query/exchangeRate', 'common/query/tradeDeliveryDelayTime', 'common/query/payment', 'common/query/kindContrast', 'common/query/crawlTask', 'common/query/afterSale', 'common/query/refund', 'common/query/messageBoard', 'common/query/logisticsPort', 'common/query/storeInfo', 'common/query/cms', 'common/query/help', 'common/query/commonCount', 'common/module/store_admin_violations_module', 'common/query/internalMessage','common/query/user','common/query/secQuestion','common/query/keyWord','common/query/logUsage','common/query/seekQualityBuyer','common/query/loanApply', 'common/query/supplier', 'common/query/seekSalesman', 'common/query/b2bManage', 'common/query/adminNews', 'common/query/seekPurchase'], function(angularAMD) {
 	'use strict';
 
 	 /**
@@ -8,7 +8,7 @@
 		 return this.length > 0 ? this[this.length - 1] : null;
 	 };
 
-	var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ui.form', 'ng.local', 'ngTable', 'ngSanitize', 'ngDraggable', 'common.services', 'common.directives', 'brandServices', 'addressServices', 'returnServices', 'changeServices', 'componentServices', 'orderServices', 'purchaseServices', 'invoiceServices', 'propertyServices', 'receiptServices', 'logisticsServices', 'common.query.kind', 'toaster','ui.jquery', 'commodityServices', 'dateparseServices', 'bankInfo' , 'bankTransfer', 'urlencryptionServices', 'billServices', 'makerDemand', 'goodsServices', 'validtimeServices', 'angularFileUpload', 'slideImageService', 'common.query.kindAdvice', 'responseLogisticsService', 'searchService', 'ngDynamicInput', 'ReviewerEmailInfoService', 'tradeBasicPropertiesServices', 'exchangeRateModule', 'tradeDeliveryDelayTimeModule', 'PaymentService', 'kindContrastServices', 'crawlTaskServices', 'afterSaleService', 'refundModule', 'messageBoardServices', 'logisticsPortService', 'storeInfoServices', 'cmsService', 'helpServices', 'commonCountServices', 'tool.directives', 'StoreAdminViolationsModule', 'internalMessageServices','common.query.user','secQuestionServices','keyWordServices','logUsageServices','seekQualityBuyerServices', 'loanApplyService', 'supplierServices', 'seekSalesmanServices', 'b2bManageService','adminNewsService']);
+	var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ui.form', 'ng.local', 'ngTable', 'ngSanitize', 'ngDraggable', 'common.services', 'common.directives', 'brandServices', 'addressServices', 'returnServices', 'changeServices', 'componentServices', 'orderServices', 'purchaseServices', 'invoiceServices', 'propertyServices', 'receiptServices', 'logisticsServices', 'common.query.kind', 'toaster','ui.jquery', 'commodityServices', 'dateparseServices', 'bankInfo' , 'bankTransfer', 'urlencryptionServices', 'billServices', 'makerDemand', 'goodsServices', 'validtimeServices', 'angularFileUpload', 'slideImageService', 'common.query.kindAdvice', 'responseLogisticsService', 'searchService', 'ngDynamicInput', 'ReviewerEmailInfoService', 'tradeBasicPropertiesServices', 'exchangeRateModule', 'tradeDeliveryDelayTimeModule', 'PaymentService', 'kindContrastServices', 'crawlTaskServices', 'afterSaleService', 'refundModule', 'messageBoardServices', 'logisticsPortService', 'storeInfoServices', 'cmsService', 'helpServices', 'commonCountServices', 'tool.directives', 'StoreAdminViolationsModule', 'internalMessageServices','common.query.user','secQuestionServices','keyWordServices','logUsageServices','seekQualityBuyerServices', 'loanApplyService', 'supplierServices', 'seekSalesmanServices', 'b2bManageService','adminNewsService', 'seekPurchaseServices']);
 	app.init = function() {
 		angularAMD.bootstrap(app);
 	};
@@ -660,6 +660,13 @@
             controller: 'SeekSalesmanDetailCtrl',
             controllerUrl: 'app/controllers/SeekSalesmanDetailCtrl',
             title: '求购业务员分配详情'
+        })).state('seekManage', angularAMD.route({
+            // 求购信息管理
+            url: '/seekManage',
+            templateUrl: 'static/view/admin/seek_manage.html',
+            controller: 'SeekManageCtrl',
+            controllerUrl: 'app/controllers/SeekManageCtrl',
+            title: '求购业务员分配'
         })).state('keyWord', angularAMD.route({
 			url: '/keyWord',
 			templateUrl: 'static/view/admin/keyword.html',

+ 76 - 0
src/main/webapp/resources/js/admin/controllers/SeekManageCtrl.js

@@ -0,0 +1,76 @@
+define(['app/app'], function (app) {
+  'use strict';
+  app.register.controller('SeekManageCtrl', ['$scope', 'toaster', 'BaseService','$modal','ngTableParams', '$http', 'seekPurchase',
+      function ($scope, toaster, BaseService,$modal,ngTableParams, $http, seekPurchase) {
+
+      $scope.valid = 1;
+      $scope.seekUrl = 'http://192.168.253.12:24000/';
+      seekPurchase.getSeekUrl({}, function(data) {
+          $scope.seekUrl = data.url;
+          $scope.seekUrl = 'http://10.1.51.82:24002/';
+          $scope.seekManageTableParams = new ngTableParams({
+              pageNumber: 1,
+              pageSize: 10
+          }, {
+              total: 0,
+              getData: function ($defer, params) {
+                  var param = BaseService.parseParams(params.url());
+                  param.keyword = $scope.keyword;
+                  // param.fromDate = $scope.startDate
+                  //     ? $scope.startDate.getTime() : null;
+                  // param.endDate = $scope.endDate ? $scope.endDate.getTime()
+                  //     : null;
+                  param.pageNumber = param.page;
+                  param.pageSize = param.count;
+                  param.valid = $scope.valid;
+                  $http({
+                      method: 'get',
+                      dataType: 'json',
+                      url: $scope.seekUrl + '/inquiry/public',
+                      params: param
+                  }).success(function (data) {
+                      params.total(data.totalElements);
+                      $defer.resolve(data.content);
+                  }).error(function (response) {
+                      toaster.pop('error', response);
+                  });
+              }
+          })
+      });
+
+      $scope.onSearchKeyWord = function() {
+          $scope.seekManageTableParams.page(1);
+          $scope.seekManageTableParams.reload();
+      };
+
+      $scope.onSearchValid = function(valid) {
+          $scope.valid = valid;
+          $scope.seekManageTableParams.page(1);
+          $scope.seekManageTableParams.reload();
+      };
+
+      $scope.deleteItem = function(id, valid) {
+
+          $http({
+              method: 'post',
+              dataType: 'json',
+              url: $scope.seekUrl + '/inquiry/public/deleteItem',
+              params: {
+                  id: id,
+                  valid: valid
+              }
+          }).success(function (data) {
+              if (data.success) {
+                  toaster.pop("success", "操作成功");
+              } else {
+                  toaster.pop("error", data.message);
+              }
+              $scope.seekManageTableParams.page(1);
+              $scope.seekManageTableParams.reload();
+          }).error(function (response) {
+              toaster.pop('error', response.message);
+          });
+      };
+
+  }]);
+});

+ 2 - 1
src/main/webapp/resources/js/admin/main.js

@@ -29,7 +29,8 @@ require.config({
 		'showdown' : 'lib/showdown/showdown.min',
 		'quill-core' : 'lib/quill/quill.core',
 		'quill' : 'lib/quill/quill',
-		'big': 'lib/decimal/big.min'
+		'big': 'lib/decimal/big.min',
+		'seekPurchase':'js/common/query/seekPurchase'
 	},
 	shim : {
 		'angular' : {

+ 75 - 0
src/main/webapp/resources/view/admin/seek_manage.html

@@ -0,0 +1,75 @@
+<style>
+.row {
+	margin-bottom: 10px;
+}
+table {
+	table-layout: fixed;
+	word-wrap:break-word;
+}
+
+</style>
+<div>
+	<div class="box-header well">
+		求购-信息管理
+	</div>
+	<div  class="box-content">
+		<div class="row">
+			<div class="col-sm-1">
+
+			</div>
+			<div class="col-sm-7">
+
+			</div>
+			<div class="col-sm-4">
+				<div class="input-group">
+					<input placeholder="请输入品牌/型号/类目" class="form-control ng-pristine ng-untouched ng-valid" ng-model="keyword" ng-search="onSearchKeyWord()"type="text">
+					<span class="input-group-btn">
+						<button class="btn btn-primary" type="button" ng-click="onSearchKeyWord()">搜索</button>
+					</span>
+				</div>
+			</div>
+		</div>
+		<table ng-table="seekManageTableParams"
+			class="table table-bordered table-striped table-hover" style="word-break:break-all; word-wrap:break-all;">
+			<thead>
+				<tr class="tr-default">
+					<th width="15%;" class="text-center">求购企业</th>
+					<th width="10%;" class="text-center">发布时间</th>
+					<th width="10%" class="text-center">品牌</th>
+					<th width="15%" class="text-center">物料名称</th>
+					<th width="15%" class="text-center">型号</th>
+					<th width="15%" class="text-center">规格</th>
+					<th width="5%" class="text-center">采购数量</th>
+					<th width="5%" class="text-center">已报价数量</th>
+					<th width="10%" class="text-center">截止时间</th>
+					<th width="10%" class="text-center"><select ng-change="onSearchValid(valid)" ng-model="valid">
+						<option value="1">可报价</option>
+						<option value="0">已禁用</option>
+					</select></th>
+					<th width="10%" class="text-center">操作</th>
+				</tr>
+			</thead>
+			<tbody ng-repeat="seek in $data">
+				<tr class="text-center">
+					<td><span ng-bind="seek.inquiry.enName"></span></td>
+					<td><span ng-bind="seek.date | date : 'yyyy-MM-dd HH:mm:ss'"></span></td>
+					<td><span ng-bind="seek.inbrand"></span></td>
+					<td><span ng-bind="seek.prodTitle"></span></td>
+					<td><p ng-bind="seek.cmpCode"></p></td>
+					<td><p ng-bind="seek.spec"></p></td>
+					<td><p ng-bind="seek.needquantity"></p></td>
+					<td><p ng-bind="seek.offerAmount"></p></td>
+					<td><span ng-bind="seek.endDate | date : 'yyyy-MM-dd HH:mm:ss'"></span></td>
+					<td>
+						<span ng-if="seek.valid == 1">可报价</span>
+						<span ng-if="seek.valid != 1">已禁用</span>
+					</td>
+					<td>
+						<button ng-if="seek.valid == 1" class="btn btn-sm btn-danger" ng-click="deleteItem(seek.id, 0)">禁用</button>
+						<button ng-if="seek.valid != 1" class="btn btn-sm btn-info" ng-click="deleteItem(seek.id, 1)">恢复</button>
+					</td>
+				</tr>
+			</tbody>
+		</table>
+	</div>
+</div>