Pārlūkot izejas kodu

合作伙伴申请同意请求增加当前数据后续操作处理

hejq 7 gadi atpakaļ
vecāks
revīzija
e4c8b4d16d

+ 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 " +

+ 75 - 4
src/main/webapp/resources/js/index/app.js

@@ -15553,7 +15553,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 +15691,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 +15804,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 +15811,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();
+            }
+        }]);
+
     /**
      * 建立合作关系处理申请
      */

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

@@ -0,0 +1,48 @@
+<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: 18px;
+        width: 215px;
+        display: inline-block;
+        margin-left: 10px;
+    }
+</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>