Explorar o código

Merge remote-tracking branch 'origin/master'

Administrator %!s(int64=7) %!d(string=hai) anos
pai
achega
0cff4bb631

+ 4 - 1
src/main/java/com/uas/platform/b2b/controller/AddPartnerController.java

@@ -155,7 +155,10 @@ public class AddPartnerController {
 	public ModelMap agreeRequest(@PathVariable("id") Long id) throws Exception {
 		ModelMap map = new ModelMap();
 		String result = AccountUtils.acceptRequest(id, SystemSession.getUser().getUserTel(), "b2b");
-		map.put("result", result);
+		JSONObject jsonObject = JSON.parseObject(result);
+		map.put("success", jsonObject.get("success"));
+		map.put("result", jsonObject.get("data"));
+		map.put("error", jsonObject.get("error"));
 		return map;
 	}
 

+ 1 - 1
src/main/java/com/uas/platform/b2b/service/impl/ErpProdIODetailServiceImpl.java

@@ -286,7 +286,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
     private List<ErpProdIODetail> getSaleReturns(StringBuffer distributes, ApcheckKeyWord keyword, Long fromDate, Long endDate, Long enUU) {
         StringBuffer sql = new StringBuffer("select purc$return.pr_code as inoutno, pr_date as pidate, pr_rate as rate, pr_receivecode as receivecode, " +
                 "pr_receivename as receivename, '客户采购验退单' as piclass, 'purc$returnitem' as sourcetable, pu_code as ordercode, pd_number as orderdetno, " +
-                "pri_number as detno, (-(1) * pri_qty ) as qty, pri_orderprice as orderprice, pr_currency as pi_currency, pri_taxrate as taxrate, " +
+                "pri_number as detno, (-(1) * pri_qty ) as qty, pri_orderprice as orderprice, pr_currency as currency, pri_taxrate as taxrate, " +
                 "pri_whname as whname, purc$returnitem.pr_code as prodcode, purc$returnitem.pr_spec as prodspec, purc$returnitem.pr_title as prodtitle, " +
                 "pri_ycheckqty as ycheckqty, ((-(1) * pri_qty ) - coalesce(pri_ycheckqty, 0)) as thischeckqty, pr_enuu as custuu, pr_venduu as enuu, " +
                 "pri_id as sourceid, pr_sendcode as sendcode, pd_factory as factory, en_name custname from purc$return " +

+ 1 - 0
src/main/webapp/resources/css/index.css

@@ -3121,6 +3121,7 @@ input.ng-invalid.ng-dirty,textarea.ng-invalid.ng-dirty {
 }
 .modal-content{
 	margin-top: 90px;
+	border: none;
 }
 .erweima-tk{
 	position: absolute;

+ 101 - 6
src/main/webapp/resources/js/index/app.js

@@ -23,7 +23,31 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         return httpInterceptor;
     }]);
     app.config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) {
-        $stateProvider.state('sale', {
+        $stateProvider.state('index', {
+            url: "/index",
+            views: {
+                "left-view": {
+                    templateUrl: "static/tpl/index/common/leftAll.html",
+                    controller: 'LeftCtrl'
+                },
+                "right-view": {
+                    templateUrl: "static/tpl/index/home/right.html",
+                    controller: 'RightCtrl'
+                }
+            }
+        }).state('home', {
+            url: "/",
+            views: {
+                "left-view": {
+                    templateUrl: "static/tpl/index/common/leftAll.html",
+                    controller: 'LeftCtrl'
+                },
+                "right-view": {
+                    templateUrl: "static/tpl/index/home/right.html",
+                    controller: 'RightCtrl'
+                }
+            }
+        }).state('sale', {
             url: "/sale",
             views: {
                 "left-view": {
@@ -775,7 +799,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             templateUrl: "static/tpl/index/sale/vendorPerformanceAssess_detail.html",
             controller: 'VendorPerformanceAssessDetailCtrl'
         });
-        $urlRouterProvider.otherwise('sale/pubinquiry');
+        $urlRouterProvider.otherwise('/index');
     }]);
 
 
@@ -15553,7 +15577,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
     /**
      * 建立合作关系申请 (新的合作伙伴)
      */
-    app.controller('NewPartnerCtrl', ['$scope', 'AddPartnerMyRequest', 'toaster', 'BaseService', 'ngTableParams', 'AddPartner', '$timeout', '$rootScope', 'VendorInfo', '$window', function ($scope, AddPartnerMyRequest, toaster, BaseService, ngTableParams, AddPartner, $timeout, $rootScope, VendorInfo, $window) {
+    app.controller('NewPartnerCtrl', ['$scope', 'AddPartnerMyRequest', 'toaster', 'BaseService', 'ngTableParams', 'AddPartner', '$timeout', '$rootScope', 'VendorInfo', '$window', '$modal',
+        function ($scope, AddPartnerMyRequest, toaster, BaseService, ngTableParams, AddPartner, $timeout, $rootScope, VendorInfo, $window, $modal) {
         BaseService.scrollBackToTop();
         $scope.status = "partner";
         $scope.active = 'all'; // 所有申请记录
@@ -15690,12 +15715,25 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             AddPartner.agreeRequest({id: id}, {}, function (data) {
                 if (data.success) {
                     toaster.pop('success', '提示', '操作成功');
+                   if (data.result) {
+                       //选择打印模板
+                       var modalInstance = $modal.open({
+                           templateUrl: 'static/tpl/index/baseInfo/modal/partnership_modal.html',
+                           controller: 'PartnerShipCtrl',
+                           resolve: {
+                               PartnerShipInfo: function () {
+                                   return data.result;
+                               }
+                           }
+                       });
+                       modalInstance.result.then(function () {
+                           window.location.reload();
+                       });
+                   }
                 }
                 if (data.error) {
                     toaster.pop('error', '提示', '操作失败');
                 }
-                // $scope.tableParams.reload();
-                $window.location.reload();
             }, function (response) {
                 toaster.pop('error', '提示', response.data);
             });
@@ -15790,7 +15828,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 if (data.success) {
                     toaster.pop('success', '提示', data.success);
                 }
-                // $scope.tableParams.page(1);
                 $scope.tableParams.reload();
             }, function (response) {
                 toaster.pop('error', '提示', response.data);
@@ -15798,6 +15835,64 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         }
     }]);
 
+    /**
+     * 同意申请后续操作
+     */
+    app.controller('PartnerShipCtrl', ['$scope', 'PartnerShipInfo', '$modalInstance', 'AddPartner', 'toaster',
+        function($scope, PartnerShipInfo, $modalInstance, AddPartner, toaster) {
+            $scope.partInfo = PartnerShipInfo;
+
+            // 添加为服务商
+            $scope.addServicer = function (vendUID) {
+                AddPartner.addServicer({businessCode: vendUID}, {}, function (data) {
+                    if (data.success) {
+                        toaster.pop('success', '提示', data.success);
+                        $scope.tableParams.reload();
+                    }
+                    if (data.error) {
+                        toaster.pop('error', '提示', data.error);
+                    }
+                }, function (response) {
+                    toaster.pop('error', '失败', response.data);
+                })
+            };
+
+            // 添加客户
+            $scope.addCust = function (vendUID) {
+                AddPartner.addCust({businessCode: vendUID}, {}, function (data) {
+                    if (data.success) {
+                        toaster.pop('success', '提示', data.success);
+                        $scope.tableParams.reload();
+                    }
+                    if (data.error) {
+                        toaster.pop('error', '提示', data.error);
+                    }
+                }, function (response) {
+                    toaster.pop('error', '失败', response.data);
+                })
+            };
+
+            // 添加为供应商
+            $scope.addSupplier = function (vendUID) {
+                AddPartner.addSupplier({businessCode: vendUID}, {}, function (data) {
+                    if (data.success) {
+                        toaster.pop('success', '提示', data.success);
+                        $scope.tableParams.reload();
+                    }
+                    if (data.error) {
+                        toaster.pop('error', '提示', data.error);
+                    }
+                }, function (response) {
+                    toaster.pop('error', '失败', response.data);
+                })
+            };
+
+            // 关闭
+            $scope.close = function() {
+                $modalInstance.close();
+            }
+        }]);
+
     /**
      * 建立合作关系处理申请
      */

+ 53 - 0
src/main/webapp/resources/tpl/index/baseInfo/modal/partnership_modal.html

@@ -0,0 +1,53 @@
+<style>
+    .bomb-box .box01 {
+        height: 360px !important;
+    }
+    .per-data ul li input{
+        width: 340px !important;
+    }
+    .perBtn a {
+        margin-left: 30px;
+    }
+    .bomb-box .box01 ul li span{
+        float: left;
+        color: #959595;
+        line-height: 33px;
+        width: 215px;
+        display: inline-block;
+        margin-left: 10px;
+        font-size: 14px;
+    }
+    .bomb-box {
+        font-family: "Microsoft YaHei", "Hiragino Sans GB";
+        font-size: 16px;
+    }
+</style>
+<link rel="stylesheet" href="static/css/add.css " />
+<!--B2B商务账号设置-个人信息-->
+<div class="bomb-box">
+    <div class="box01 box">
+        <p ng-bind="partInfo.custName"></p>
+        <form class="per-data per" name="contactInfo" id="contactInfo">
+            <ul class="text-left">
+                <li>
+                    <em>企业名称</em><span ng-bind="partInfo.custName"></span>
+                </li>
+                <li>
+                    <em>企业UU</em><span ng-bind="partInfo.custSpaceUU"></span>
+                </li>
+                <li>
+                    <em>联系人</em><span ng-bind="partInfo.custUserName"></span>
+                </li>
+                <li>
+                    <em>联系方式</em><span ng-bind="partInfo.custUserTel"></span>
+                </li>
+                <li class="per-btn perBtn">
+                    <a class="btn-success" ng-click="addSupplier(partInfo.custUID)">添加供应商</a>
+                    <a class="btn-success" ng-click="addServicer(partInfo.custUID)">添加服务商</a>
+                    <a class="btn-success" ng-click="addCust(partInfo.custUID)">添加客户</a>
+                    <a class="btn-danger" ng-click="close()">关闭</a>
+                </li>
+            </ul>
+        </form>
+    </div>
+</div>

+ 1 - 1
src/main/webapp/resources/tpl/index/baseInfo/mySupplier.html

@@ -42,7 +42,7 @@
 			<div class="pane-header">
 				客户分配用户资料 (共<span ng-bind="custInfos.length || 0"></span>个)<span class="f16" style="margin-left: 120px;"ng-bind="custInfo.myEnterprise.enName"></span>
 			</div>
-				<table class="table table-hover"
+				<table class="table table-hover">
 					<thead>
 						<tr class="header">
 							<th class="text-center" width="90">用户UU</th>

+ 1 - 1
src/main/webapp/resources/tpl/index/common/header.html

@@ -208,7 +208,7 @@
 				<a ng-click="b2cLink('/supplier')">供应商</a>
 			</li>
 			<li>
-				<a ui-sref="sale.pubinquiry" class="active">B2B商务</a>
+				<a ui-sref="home" class="active">B2B商务</a>
 				<img class="new-animate" src="static/img/all/hot.png" alt="">
 			</li>
 			<li>

+ 3 - 3
src/main/webapp/resources/tpl/index/common/leftAll.html

@@ -55,6 +55,6 @@
 	</div>
 </div>
 <!--应收宝-->
-<div class="jk">
-	<img src="static/img/home/jingkong.png">
-</div>
+<!--<div class="jk">-->
+	<!--<img src="static/img/home/jingkong.png">-->
+<!--</div>-->