huangb 7 жил өмнө
parent
commit
49a4091772
21 өөрчлөгдсөн 3309 нэмэгдсэн , 7 устгасан
  1. 1 0
      src/main/webapp/resources/css/b2bPublic.css
  2. 170 0
      src/main/webapp/resources/css/deputyOrder/base.css
  3. 416 0
      src/main/webapp/resources/css/deputyOrder/order.css
  4. BIN
      src/main/webapp/resources/img/deputyOrder/select.png
  5. 75 0
      src/main/webapp/resources/js/common/b2bServices.js
  6. 71 0
      src/main/webapp/resources/js/common/controllers/b2bCommonCtrls.js
  7. 24 0
      src/main/webapp/resources/js/usercenter/app.js
  8. 396 0
      src/main/webapp/resources/js/usercenter/controllers/b2b/order/deputyOrderDetailCtrl.js
  9. 67 0
      src/main/webapp/resources/js/usercenter/controllers/b2b/order/deputyOrderLogCtrl.js
  10. 1 1
      src/main/webapp/resources/js/usercenter/controllers/b2b/order/purcDeputyOrderCtrl.js
  11. 91 0
      src/main/webapp/resources/js/usercenter/controllers/b2b/order/purcMakeOutOrderDetailCtrl.js
  12. 397 0
      src/main/webapp/resources/js/usercenter/controllers/b2b/order/purcNewDeputyOrderCtrl.js
  13. 60 0
      src/main/webapp/resources/view/usercenter/b2b/modal/approval_detail.html
  14. 1 1
      src/main/webapp/resources/view/usercenter/b2b/modal/uplodaByBatch.html
  15. 5 4
      src/main/webapp/resources/view/usercenter/b2b/order/deputyOrder.html
  16. 572 0
      src/main/webapp/resources/view/usercenter/b2b/order/deputyOrder_detail.html
  17. 564 0
      src/main/webapp/resources/view/usercenter/b2b/order/deputyOrder_new.html
  18. 68 0
      src/main/webapp/resources/view/usercenter/b2b/order/deputyorders_log.html
  19. 1 1
      src/main/webapp/resources/view/usercenter/b2b/order/outorder.html
  20. 317 0
      src/main/webapp/resources/view/usercenter/b2b/order/outorder_detail.html
  21. 12 0
      src/main/webapp/resources/view/usercenter/forstore/buyer_order.html

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

@@ -155,6 +155,7 @@
     padding: 0 5px;
     padding: 0 5px;
     display: inline-block;
     display: inline-block;
     color: #5078cb;
     color: #5078cb;
+    cursor: pointer;
 }
 }
 #public .tab_top ul li.down-purchase .tab_add i{
 #public .tab_top ul li.down-purchase .tab_add i{
     color: #5078cb;
     color: #5078cb;

+ 170 - 0
src/main/webapp/resources/css/deputyOrder/base.css

@@ -0,0 +1,170 @@
+@charset "utf-8";
+/* CSS Document */
+html {
+	-webkit-text-size-adjust: none;
+}
+
+body {
+	font-size: 12px;
+	color: #323232;
+	_overflow: hidden;
+	overflow-x: hidden;
+	background: #fff;
+}
+
+body, ol, table, tr, td, ul, li, dt, dd, dl, h1, h2, h3, h4, h5, h6,
+	form, input, select, textarea, p {
+	margin: 0;
+	padding: 0;
+	font-family: "微软雅黑";
+	font-size: 12px;
+	font-weight: normal;
+}
+
+li {
+	list-style-type: none;
+}
+
+img {
+	border: none;
+}
+
+a {
+	outline: none;
+	cursor: pointer;
+	text-decoration: none;
+	color: #666;
+	-webkit-transition: all .3s;
+	-moz-transition: all .3s;
+	-ms-transition: all .3s;
+	transition: all .3s;
+}
+
+a:hover {
+	text-decoration: none;
+}
+
+a, area {
+	blr: expression(this.onFocus = this.blur ());
+}
+
+:focus {
+	-moz-outline-style: none;
+}
+
+.disno {
+	display: none;
+}
+
+.disbk {
+	display: block;
+}
+
+.distb {
+	display: table;
+}
+
+.clear {
+	clear: both;
+}
+
+em, i {
+	font-style: inherit;
+}
+/*-------input--outline--middle---------*/
+input, button, select, textarea {
+	outline: none
+}
+
+input {
+	vertical-align: middle;
+	font-family: "微软雅黑";
+}
+
+button::-moz-focus-inner, input[type="reset"]::-moz-focus-inner, input[type="button"]::-moz-focus-inner,
+	input[type="submit"]::-moz-focus-inner, input[type="file"]>input[type="button"]::-moz-focus-inner
+	{
+	border: none;
+	padding: 0;
+}
+
+table {
+	border-collapse: collapse;
+	font-family: "微软雅黑";
+}
+
+@media screen and (-webkit-min-device-pixel-ratio:0) { /* chrome*/
+	.justify:after {
+		content: ".";
+		display: inline-block;
+		width: 100%;
+		overflow: hidden;
+		height: 0;
+	}
+}
+
+select {
+	-webkit-appearance: none;
+	appearance: none;
+	background: transparent;
+	-o-appearance: none;
+	-moz-appearance: none;
+	-ms-appearance: none;
+}
+/*----- clearfix///-----*/
+.clearfix {
+	*zoom: 1;
+}
+
+.clearfix:before, .clearfix:after {
+	display: table;
+	content: '';
+	line-height: 0;
+}
+
+.clearfix:after {
+	clear: both;
+}
+/*文字两侧对齐*/
+.justify {
+	text-align: justify;
+	text-justify: distribute-all-lines; /*ie6-8*/
+	text-align-last: justify; /* ie9*/
+	-moz-text-align-last: justify; /*ff*/
+	-webkit-text-align-last: justify; /*chrome 20+*/
+}
+/*超出省略号*/
+.toe {
+	word-break: keep-all;
+	white-space: nowrap;
+	overflow: hidden;
+	text-overflow: ellipsis;
+}
+
+.fl {
+	float: left;
+}
+
+.fr {
+	float: right;
+}
+.pub-com_head, .com_head {
+	width: 100%;
+	height: 35px;
+	line-height: 35px;
+	background: #5078cb;
+	border-radius: 5px 5px 0 0;
+}
+.pub-com_head span, .com_head span {
+	margin-left: 10px;
+	color: #fff;
+	font-size: 14px;
+	font-weight: bold;
+}
+.purchase .save{
+	background: #fff;
+}
+.user_content .user_right {
+	width: 1026px;
+	background: #fff;
+}

+ 416 - 0
src/main/webapp/resources/css/deputyOrder/order.css

@@ -0,0 +1,416 @@
+body {
+    background:#f5f5f5;
+}
+.warp {
+    width:100%;
+    margin:0px auto;
+}
+.content {
+    width: 1170px;
+    margin:0px auto;
+}
+.purchase {
+    margin-bottom: 20px;
+}
+.width100 {
+    width:973px;
+    max-width: 973px;
+    margin: 0 auto;
+}
+.com_title {
+    width:100%;
+    margin:0px auto;
+    height:40px;
+    line-height:40px;
+    font-size:14px;
+    color:#323232;
+    background:#f5f5f5;
+}
+.com_title font {
+    color:#3f84f6;
+}
+
+.com_head a {
+    color:#fff;
+    float:right;
+    margin-right:40px;
+}
+.search {
+    position: relative;
+}
+.search input {
+    width: 288px;
+    padding-left: 10px;
+    height:36px;
+    background: #fff;
+    float: left;
+    vertical-align: middle;
+    border:#3578ba 1px solid;
+    font-size: 14px;
+}
+.search a.seek {
+    vertical-align: middle;
+    display: inline-block;
+    line-height: 37px;
+    text-align: center;
+    height: 36px;
+    width: 85px;
+    border-left: 0;
+    background:#3578ba;
+    color:#fff;
+    text-align:center;
+    font-size:14px;
+    float: right;
+    border:#3578ba 1px solid;
+    position: absolute;
+    right:0;
+}
+.search a.seek:hover {
+    background: #1f6199;
+    color: #fff;
+}
+.purchase_list {
+    height:40px;
+    margin-bottom: 16px;
+    margin-top: 10px;
+}
+.purchase_list ul {
+    width:87%;
+    margin: 0 auto;
+    height:40px;
+    line-height:40px;
+    background: #fff;
+    border: #e8e8e8 1px solid;
+}
+.purchase_list ul li {
+    width: 100px;
+    height:40px;
+    text-align: center;
+    float: left;
+    margin-left: 25px;
+}
+.purchase_list ul li a {
+    font-size: 14px;
+    width: 100px;
+    height:40px;
+    display: inline-block;
+}
+.purchase_list ul li.active a {
+    color: #d82128;
+    border-bottom: 3px #d82128 solid;
+}
+.purchase_list ul li:hover a {
+    color: #d82128;
+    border-bottom: 3px #d82128 solid;
+}
+.purchase_list ul li a em {
+    color: #d2272d;
+}
+.purchase_list ul li.active a {
+    color: #d82128;
+}
+.purchase_btn01,.purchase_btn01 a {
+    width:104px;
+    height:40px;
+    color: #3f84f6;
+    text-align: center;
+    background:#fff;
+    display: inline-block;
+    font-size:14px;
+    line-height:40px;
+    border: #e8e8e8 1px solid;
+}
+.purchase_btn01 a:hover{
+    border:#5078cb 1px solid;
+}
+.purchase_btn01 a img {
+    vertical-align: middle;
+    margin-right: 5px;
+}
+.purchase_lists {
+    border: #e8e8e8 1px solid;
+}
+.purchase_lists dl{
+    display: none;
+}
+.purchase_lists,.purchase_lists dl {
+    width: 100%;
+    margin: 0 auto;
+    background: #fff;
+}
+.purchase_lists dl dt,.purchase_lists dl dd {
+    width: 100%;
+    margin: 0 auto;
+    border-bottom: #cfcfcf 1px dashed;
+    display: inline-block;
+}
+.purchase_lists dl dd:last-child {
+    border-bottom: none;
+}
+.purchase_lists dl dt span {
+    height: 50px;
+    line-height: 50px;
+    display: inline-block;
+}
+.purchase_lists dl dt span em {
+    margin-left: 20px;
+}
+.purchase_lists dl dd span {
+    height:90px;
+    padding: 10px 0;
+    display: inline-block;
+    line-height: 20px;
+    overflow: hidden;
+}
+.purchase_lists dl span.wid01 {
+    width:30%;
+    text-align: left;
+    padding-left: 3%;
+}
+.purchase_lists dl span.wid02 {
+    width:15%;
+}
+.purchase_lists dl span {
+    width:25%;
+    font-size: 14px;
+    float: left;
+}
+.purchase_lists dl span img {
+    vertical-align: middle;
+    margin-left: 22%;
+    margin-top: 20px;
+}
+.purchase_lists dl dd:hover {
+    border: #d32526 1px solid;
+}
+.purchase_form,.purchase_form01 {
+    width:100%;
+    margin: 0 auto;
+    background: #fff;
+    margin-top: 10px;
+    border: #e8e8e8 1px solid;
+}
+.purchase_form_margin{
+    margin-top: 0;
+}
+.purchase_form01 {
+    border: none;
+    border-bottom: #d0cfcf 1px solid;
+    width: 98%;
+}
+.com_title01 {
+    height: 50px;
+    line-height:50x;
+    width:100%;
+    margin:0 auto;
+    border-bottom:#5078cb 1px dotted;
+}
+.com_title01 a {
+    float: right;
+    color: #5078cb;
+    line-height: 50px;
+    margin-right: 30px;
+}
+.com_title01 a:hover{
+    color: #1f4fb2;
+}
+.com_title01 span {
+    margin-left:20px;
+    font-size: 14px;
+    line-height: 50px;
+    color: #555;
+    font-weight: bold;
+}
+.purchase_form01 ul {
+    width:100%;
+    margin: 0 auto;
+}
+.purchase_form01 ul li {
+    width: 100%;
+    height: 40px;
+    line-height: 40px;
+    margin-bottom: 20px;
+}
+.purchase_form01 ul li div {
+    width:50%;
+    float: left;
+    font-size: 14px;
+}
+.purchase_form01 ul li div em {
+    width:147px;
+    float: left;
+    margin-left: 30px;
+    line-height: 40px;
+}
+.purchase_form01 ul li div.wid100 {
+    width:100%;
+}
+.purchase_form01 ul li div.wid100 span .input01 {
+    width:695px;
+}
+.purchase_form01 ul li div span {
+    width:255px;
+    float: left;
+    display: inline-block;
+    height: 40px;
+    line-height: 40px;
+    position: relative;
+    color: #666666;
+}
+.purchase_form01 ul li .input01 {
+    width:255px;
+    border: #ccc 1px solid !important;
+    height: 34px;
+    line-height: 34px;
+    position: relative;
+    font-size: 14px;
+    top: -6px;
+    color: #666;
+}
+.purchase_form01 ul li .input01:focus {
+    border:#5078cb 1px solid !important;
+}
+.purchase_form01 ul li .time {
+    height: 32px;
+    line-height: 32px;
+    border:#5078cb 1px solid;
+    width: 135px;
+    position: relative;
+    font-size: 14px;
+    padding-left: 10px;
+    background: url("../../img/deputyOrder/time.png") no-repeat right;
+}
+.purchase_form01 ul li .has_time {
+    width:145px ;
+}
+.purchase_form01 ul li .select {
+    height: 34px;
+    line-height: 34px;
+    border:#bfbfbf 1px solid;
+    width: 146px;
+    position: relative;
+    font-size: 14px;
+    padding-left: 10px;
+    background: url("../../img/deputyOrder/select.png") no-repeat right;
+}
+.purchase_form01 ul li .select:focus{
+    border: #5078cb 1px solid;
+}
+ .purchase_xq{
+    border-bottom: #d0cfcf 1px solid;
+ }
+.purchase_xq,.purchase_xq dl {
+    width:100%;
+    margin:0 auto;
+}
+.purchase_xq dl dd,.purchase_xq dl dt {
+    width: 100%;
+    margin: 0 auto;
+    height: 50px;
+    border-bottom: #e8e8e8 1px dotted;
+}
+.purchase_xq dl span {
+    width: 10.44%;
+    font-size: 14px;
+    float: left;
+    display: inline-block;
+    height: 50px;
+    line-height: 50px;
+    text-align: center;
+}
+.purchase_xq dl span.wid01 {
+    width: 6% ;
+}
+.page {
+    width:100%;
+    margin:0 auto;
+    height:60px;
+    line-height: 60px;
+}
+.page ul{
+    margin-left: 20px;
+}
+.page ul li {
+    float: left;
+    font-size: 14px;
+    color: #999;
+    margin: 0 5px;
+}
+.page ul li a {
+    width:50px;
+    display: inline-block;
+    font-size: 14px;
+    color: #999;
+}
+.page ul li input {
+    width:24px;
+    height:24px;
+    border:#5078cb 1px solid;
+    text-align: center;
+    color: #5078cb;
+    margin: 0 10px;
+}
+.page ul li a:hover {
+    color: #5078cb;
+}
+.purchase .save {
+    width:100%;
+    height: 36px;
+    margin: 20px 0 40px 0;
+}
+.purchase .save a {
+    width:94px;
+    height: 36px;
+    display: inline-block;
+    background: #5078cb;
+    text-align: center;
+    color: #fff;
+    font-size: 14px;
+    float: right;
+    line-height: 36px;
+    margin-right: 40px;
+}
+.purchase .save a:hover {
+    background: #1f4fb2;
+}
+.purchase .save button {
+    width: 100px;
+    height: 38px;
+    display: inline-block;
+    background: #5078cb;
+    text-align: center;
+    color: #fff;
+    font-size: 14px;
+    line-height: 36px;
+    margin-right: 40px;
+    border: none;
+    border-radius: 3px;
+}
+.purchase .save button:first-child {
+    background-color: #2496f1;
+    color: #ffffff;
+}
+.purchase .save button:last-child{
+    border: solid 1px #2496f1;
+    background: #fff;
+    color: #2496f1;
+}
+.purchase .save .btn01 button, .purchase .save .btn02 button{
+    background-color: #2496f1;
+    color: #ffffff;
+}
+.purchase .save .btn03 button{
+    border: solid 1px #2496f1;
+    background: #fff;
+    color: #2496f1;
+}
+.purchase .save button:hover {
+    background: #1f4fb2;
+    color: #fff;
+}
+.purchase_xq dd input {
+    border: 1px solid #ccc !important;
+}
+.purchase_xq dd input:focus {
+    border: 1px solid blue !important;
+}

BIN
src/main/webapp/resources/img/deputyOrder/select.png


+ 75 - 0
src/main/webapp/resources/js/common/b2bServices.js

@@ -2085,6 +2085,81 @@ define([ 'angular', 'common/services', 'common/utils', 'big'], function(angular,
                 }
                 }
             })
             })
         }])
         }])
+        .factory('B2bDecimalNumber', [function() {
+            return {
+//			accDiv: function (arg1, arg2) {
+//				var t1 = 0, t2 = 0, r1, r2;
+//				try {
+//					t1 = arg1.toString().split(".")[1].length
+//				} catch (e) {
+//				}
+//				try {
+//					t2 = arg2.toString().split(".")[1].length
+//				} catch (e) {
+//				}
+//				with (Math) {
+//					r1 = Number(arg1.toString().replace(".", ""))
+//					r2 = Number(arg2.toString().replace(".", ""))
+//					return accMul((r1 / r2), pow(10, t2 - t1));
+//				}
+//			},
+                // 乘法
+                accMul: function (arg1, arg2) {
+                    var m = 0, s1 = arg1.toString(), s2 = arg2.toString();
+                    try {
+                        m += s1.split(".")[1].length
+                    } catch (e) {
+                    }
+                    try {
+                        m += s2.split(".")[1].length
+                    } catch (e) {
+                    }
+                    return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m);
+                },
+                // 加法
+                accAdd: function (arg1, arg2) {
+                    var r1, r2, m;
+                    try {
+                        r1 = arg1.toString().split(".")[1].length
+                    } catch (e) {
+                        r1 = 0
+                    }
+                    try {
+                        r2 = arg2.toString().split(".")[1].length
+                    } catch (e) {
+                        r2 = 0
+                    }
+                    m = Math.pow(10, Math.max(r1, r2));
+                    return (arg1 * m + arg2 * m) / m;
+                },
+                //减法
+                Subtr: function(arg1, arg2) {
+                    var r1, r2, m, n;
+                    try {
+                        r1 = arg1.toString().split(".")[1].length
+                    } catch (e) {
+                        r1 = 0
+                    }
+                    try {
+                        r2 = arg2.toString().split(".")[1].length
+                    } catch (e) {
+                        r2 = 0
+                    }
+                    m = Math.pow(10, Math.max(r1, r2));
+                    n = (r1 >= r2) ? r1 : r2;
+                    return ((arg1 * m - arg2 * m) / m).toFixed(n);
+                }
+            };
+        }])
+        .factory('B2bDekeyValue', ['$resource', 'BaseService', function($resource, BaseService) {
+            var b2bUrl = BaseService.getB2bUrl();
+            return $resource(b2bUrl + '/deputy', {}, {
+                getValue: {
+                    url: b2bUrl + '/deputy/getKeyValue',
+                    method: 'GET',
+                },
+            })
+        }])
         .factory('B2bGetOrderInfo', ['$resource', 'BaseService', function($resource, BaseService) {
         .factory('B2bGetOrderInfo', ['$resource', 'BaseService', function($resource, BaseService) {
             var b2bUrl = BaseService.getB2bUrl();
             var b2bUrl = BaseService.getB2bUrl();
             return $resource(b2bUrl + '/deputyOrder/info/nosearch', {}, {
             return $resource(b2bUrl + '/deputyOrder/info/nosearch', {}, {

+ 71 - 0
src/main/webapp/resources/js/common/controllers/b2bCommonCtrls.js

@@ -301,5 +301,76 @@ define([ 'app/app' ], function(app) {
             $modalInstance.dismiss();
             $modalInstance.dismiss();
         };
         };
     }]);
     }]);
+    /**
+     * 查询代采定单在信扬中的审批情况
+     *
+     */
+    app.controller('ViewApprovalDetailCtrl', ['$scope', 'toaster', '$modalInstance', 'B2bDeputyOrder', 'BaseService', 'ngTableParams', 'uu', 'salecode', function ($scope, toaster, $modalInstance, DeputyOrder, BaseService, ngTableParams, uu, salecode) {
+        DeputyOrder.approve({uu: uu, code: salecode}, {}, function (data) {
+            $scope.nodes = data.nodes;
+            $scope.process = data.process;
+            if(data.error) {
+                toaster.pop('error', '提示', data.error);
+            }
+        }, function (response) {
+            toaster.pop('error', '提示', '暂未获取到相关单据的信息');
+        });
+
+        $scope.cancel = function () {
+            $modalInstance.dismiss();
+        };
+
+        $scope.select = function (company) { // 直接选择
+            $modalInstance.close(company);
+        }
+    }]);
+
+    /**
+     * 代采订单批量导入
+     */
+    app.controller('DeputyOrderUploadCtrl', ['$scope', 'toaster', '$upload', '$modalInstance', function ($scope, toaster, $upload, $modalInstance) {
+        // 通过excel批量上传物料
+        $scope.result = null;
+        $scope.upload = function () {
+            var file = $scope.myFiles[0];
+            $upload.upload({
+                url: 'deputyOrder/release/excel',
+                file: file,
+                method: 'POST'
+            }).success(function (data) {
+                $scope.result = data;
+                $scope.success = $scope.result.success;
+                $scope.total = $scope.result.total;
+                $scope.alters = $scope.result.alters;
+            }).error(function (response) {
+                toaster.pop('error', response.data || response);
+            });
+        };
+
+        // 查看范例
+        $scope.showImg = function () {
+            var src = "static/img/eg/uploadByBatch_example.png", box = $('#image-box');
+            box.show();
+            box.find('img').attr('src', src);
+            box.find('a').click(function () {
+                box.hide();
+            });
+            box.dblclick(function () {
+                box.hide();
+            });
+        };
+
+        // 下载模板
+        $scope.download = function () {
+            window.location.href = 'deputyOrder/upload/template';
+        };
+
+        $scope.enSure = function () {
+            $modalInstance.close($scope.result.items);
+        }
 
 
+        $scope.cancel = function () {
+            $modalInstance.dismiss();
+        }
+    }]);
 });
 });

+ 24 - 0
src/main/webapp/resources/js/usercenter/app.js

@@ -516,12 +516,36 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
             templateUrl: "static/view/usercenter/b2b/order/deputyOrder.html",
             templateUrl: "static/view/usercenter/b2b/order/deputyOrder.html",
             controller: 'PurcDeputyOrderCtrl',
             controller: 'PurcDeputyOrderCtrl',
             controllerUrl: 'app/controllers/b2b/order/purcDeputyOrderCtrl'
             controllerUrl: 'app/controllers/b2b/order/purcDeputyOrderCtrl'
+        })).state('purc_new_deputy', angularAMD.route({
+            url: "/purc/deputy/add",
+            title: '买家中心-B2b新增代采订单',
+            templateUrl: "static/view/usercenter/b2b/order/deputyOrder_new.html",
+            controller: 'PurcNewDeputyOrderCtrl',
+            controllerUrl: 'app/controllers/b2b/order/purcNewDeputyOrderCtrl'
+        })).state('purc_deputy_detail', angularAMD.route({
+            url: "/purc/deputy/:id",
+            title: '买家中心-B2b代采订单详情',
+            templateUrl: "static/view/usercenter/b2b/order/deputyOrder_detail.html",
+            controller: 'DeputyOrderDetailCtrl',
+            controllerUrl: 'app/controllers/b2b/order/deputyOrderDetailCtrl'
+        })).state('purc_deputy_log', angularAMD.route({
+            url: "/purc/deputylog",
+            title: '买家中心-B2b代采订单错误日志',
+            templateUrl: "static/view/usercenter/b2b/order/deputyorders_log.html",
+            controller: 'DeputyOrderLogCtrl',
+            controllerUrl: 'app/controllers/b2b/order/deputyOrderLogCtrl'
         })).state('purc_make_outorder', angularAMD.route({
         })).state('purc_make_outorder', angularAMD.route({
             url: "/purc/makeoutorder",
             url: "/purc/makeoutorder",
             title: '买家中心-B2b委外订单',
             title: '买家中心-B2b委外订单',
             templateUrl: "static/view/usercenter/b2b/order/outorder.html",
             templateUrl: "static/view/usercenter/b2b/order/outorder.html",
             controller: 'PurcMakeOutOrderCtrl',
             controller: 'PurcMakeOutOrderCtrl',
             controllerUrl: 'app/controllers/b2b/order/purcMakeOutOrderCtrl'
             controllerUrl: 'app/controllers/b2b/order/purcMakeOutOrderCtrl'
+        })).state('purc_outorder_detail', angularAMD.route({
+            url: "/purc/makeoutorder/:id",
+            title: '买家中心-B2b委外订单详情',
+            templateUrl: "static/view/usercenter/b2b/order/outorder_detail.html",
+            controller: 'PurcMakeOutOrderDetailCtrl',
+            controllerUrl: 'app/controllers/b2b/order/purcMakeOutOrderDetailCtrl'
         })).state('purc_purcinquiry_new', angularAMD.route({
         })).state('purc_purcinquiry_new', angularAMD.route({
 			url: "/purc/purcinquiry/:bussinessCode",
 			url: "/purc/purcinquiry/:bussinessCode",
 			templateUrl: "static/view/usercenter/b2b/Purc/purcinquiry_new.html",
 			templateUrl: "static/view/usercenter/b2b/Purc/purcinquiry_new.html",

+ 396 - 0
src/main/webapp/resources/js/usercenter/controllers/b2b/order/deputyOrderDetailCtrl.js

@@ -0,0 +1,396 @@
+/**
+ * 委外加工详细
+ *
+ * @author hejq
+ * @date 2018-06-25 17:13
+ */
+
+
+define(['app/app'], function(app) {
+	app.register.controller('DeputyOrderDetailCtrl', ['$scope', '$rootScope', 'toaster', 'B2bDeputyOrder', '$stateParams', 'ngTableParams', 'BaseService', '$modal', 'B2bDecimalNumber', 'B2bCurrentRole', 'B2bDekeyValue', function ($scope, $rootScope, toaster, DeputyOrder, $stateParams, ngTableParams, BaseService, $modal, DecimalNumber, CurrentRole, DekeyValue) {
+        BaseService.scrollBackToTop();
+        $rootScope.active = 'buyer_order';
+        // 获取当前用户是否为普通用户
+        CurrentRole.isUser({}, {}, function (data) {
+            $scope.isUser = data.isUser;
+        });
+        var loadData = function () {
+            DeputyOrder.getOrderDetail({id: $stateParams.id}, {}, function (data) {
+                $scope.deOrder = data;
+                $scope.deOrder.$editing = true;
+            }, function (response) {
+                toaster.pop('error', '提示', response.data);
+            });
+        };
+        loadData();
+        //默认采购单号不重复
+        $scope.orderCodeEnable = true;
+        // 查询历史供应商
+        DeputyOrder.hisvendors({}, function (data) {
+            $scope.hisvendors = data;
+        }, function (response) {
+            toaster.pop('error', '提示', response.data);
+        });
+
+        // 代采企业列表
+        DeputyOrder.deputyEnterprise({}, function (data) {
+            $scope.deputyEnterprises = data;
+            $scope.deOrder.deputyname = $scope.deputyEnterprises[0].deputyenname;
+            $scope.deOrder.deputyuu = $scope.deputyEnterprises[0].deputyenuu;
+            getPayMethod($scope.deOrder.deputyuu, 'paymentmethod');
+        });
+
+        var getPayMethod = function(enuu, key) {
+            // 获取我方付款支付方式默认值
+            DekeyValue.getValue({enuu: enuu, key: key}, function(data) {
+                $scope.methods = data.content;
+            });
+        }
+
+        // 更新代采企业时更新费率
+        $scope.change = function (deputyname) {
+            DeputyOrder.deputyEnterprise({}, function (data) {
+                $scope.deputyEn = data;
+                angular.forEach($scope.deputyEn, function (en) {
+                    if (deputyname == en.deputyenname) {
+                        $scope.deputyuu = en.deputyenuu;
+                        getPayMethod($scope.deputyuu, 'paymentmethod');
+                    }
+                });
+            });
+        }
+
+        // 设置付款企业信息
+        $scope.setPayComName = function() {
+            // 针对信扬客户,如果是RMB赋值默认值
+            if ($scope.deOrder.currency == 'RMB' && $scope.deOrder.deputyuu == 10044118) {
+                $scope.deOrder.paycomname = '深圳信扬国际经贸股份有限公司';
+                $scope.deOrder.paycomaddress= '深圳市前海深港合作区前湾一路1号A栋201室(入驻深圳市前海商务秘书有限公司)';
+            }
+        }
+
+        // 查找付款企业
+        $scope.dbfindPayCompany = function (deputyuu) {
+            var modalInstance = $modal.open({
+                templateUrl: 'static/tpl/index/purc/modal/payCompany.html',
+                controller: 'DbfindDeputyPayCompanyCtrl',
+                resolve: {
+                    deputyuu: function () {
+                        return deputyuu
+                    }
+                }
+            });
+
+            modalInstance.result.then(function (data) {
+                $scope.deOrder.paycomname = data.enname;
+                $scope.deOrder.paycomaddress = data.address;
+            })
+        }
+
+        // 删除明细
+        $scope.del = function (index, id) {
+            DeputyOrder.deleteProdById({id: id}, {}, function (data) {
+                if (data.success) {
+                    toaster.pop('success', '提示', data.success);
+                    $scope.deOrder.deputyOrderItems.splice(index, 1)
+                }
+                if (data.error) {
+                    toaster.pop('error', '提示', data.error);
+                }
+                $scope.deOrder.totalamount = 0;
+                $scope.deOrder.usdpayment = 0;
+                $scope.deOrder.orderamount = 0;
+                $scope.deOrder.totalpayament = 0;
+                angular.forEach($scope.deOrder.deputyOrderItems, function (item) {
+                    $scope.deOrder.totalamount += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.usdpayment += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.totalpayament += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.orderamount += DecimalNumber.accMul(item.amount, item.purcprice);
+                });
+            }, function (response) {
+                toaster.pop('error', '提示', response.data);
+            });
+        }
+
+        //增加商品
+        $scope.add = function (index) {
+            if ($scope.deOrder.deputyOrderItems[index].prodcode == null) {
+                toaster.pop('info', '提示', '请先填写商品信息');
+            } else {
+                $scope.deOrder.deputyOrderItems.push(
+                    {
+                        prodname: null,
+                        prodcode: null,
+                        prodspec: null,
+                        prodbrand: null,
+                        amount: null,
+                        unitprice: null,
+                        remark: null,
+                        orderprice: null
+                    });
+            }
+        };
+
+        // 导入商品信息
+        $scope.uplodaByBatch = function () {
+            var modalInstance = $modal.open({
+                templateUrl: 'static/view/usercenter/b2b/modal/uplodaByBatch.html',
+                controller: 'DeputyOrderUploadCtrl',
+                size: 'lg',
+                resolve: {}
+            });
+
+            modalInstance.result.then(function (data) {
+                angular.forEach(data, function (data) {
+                    $scope.deOrder.deputyOrderItems.push(data);
+                    for (var i = 0; i < $scope.deOrder.deputyOrderItems.length; i++) {
+                        if ($scope.deOrder.deputyOrderItems[i].prodname == null) { // 如果没有填写就删除这行数据
+                            $scope.deOrder.deputyOrderItems.splice(i, 1);
+                        }
+                    }
+                })
+                $scope.deOrder.totalamount = 0;
+                $scope.deOrder.usdpayment = 0;
+                $scope.deOrder.orderamount = 0;
+                $scope.deOrder.totalpayament = 0;
+                angular.forEach($scope.deOrder.deputyOrderItems, function (item) {
+                    $scope.deOrder.totalamount += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.usdpayment += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.totalpayament += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.orderamount += DecimalNumber.accMul(item.amount, item.purcprice);
+                });
+
+            }, function () {
+
+            });
+        }
+
+        //删除商品
+        $scope.delItem = function (index) {
+            $scope.deOrder.deputyOrderItems.splice(index, 1);
+        };
+        var getService = function () {
+            return DeputyOrder.getProdList;
+        };
+
+        $scope.update = function () {
+            $scope.deOrder.$editing = true;
+        }
+
+        $scope.cancel = function () {
+            $scope.deOrder.$editing = false;
+        }
+
+        // 检验订单编号是否存在
+        $scope.checkOrder = function (salecode, deputyuu) {
+            DeputyOrder.checkOrders({salecode: salecode, deputyuu: deputyuu}, {}, function (data) {
+                $scope.orderCodeEnable = true;
+                if (data.info) {
+                    toaster.pop('error', '提示', data.info);
+                    $scope.orderCodeEnable = false;
+                }
+            }, function (response) {
+                toaster.pop('error', '提示', response.data);
+            })
+        }
+
+        //计算采购单价
+        $scope.checkPrice = function (rate) {
+            $scope.deOrder.totalamount = 0;
+            $scope.deOrder.usdpayment = 0;
+            $scope.deOrder.orderamount = 0;
+            $scope.deOrder.totalpayament = 0;
+            if (rate == null) {
+                toaster.pop('info', '提示', '请先填入税率');
+            } else {
+                angular.forEach($scope.deOrder.deputyOrderItems, function (item) {
+                    item.purcprice = DecimalNumber.accMul(item.unitprice, (1 + rate / 100));
+                    $scope.deOrder.totalamount += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.usdpayment += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.totalpayament += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.orderamount += DecimalNumber.accMul(item.amount, item.purcprice);
+                });
+            }
+        }
+
+        // 获取订单总价
+        $scope.totalPrice = function () {
+            $scope.deOrder.totalamount = 0;
+            $scope.deOrder.usdpayment = 0;
+            $scope.deOrder.orderamount = 0;
+            $scope.deOrder.totalpayament = 0;
+            angular.forEach($scope.deOrder.deputyOrderItems, function (item) {
+                if(item.amount != null && item.unitprice != null && item.purcprice != null) {
+                    $scope.deOrder.totalamount += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.usdpayment += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.totalpayament += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.orderamount += DecimalNumber.accMul(item.amount, item.purcprice);
+                }
+            });
+        }
+
+        $scope.checkresult = false;
+        var checkKeyword = function () {
+            if ($scope.deOrder.madealdate == null) {
+                toaster.pop('info', '提示', '主协议签订日期未选择');
+            } else if ($scope.deOrder.madealcode == null) {
+                toaster.pop('info', '提示', '主协议签订编号未填写');
+            } else if ($scope.deOrder.tervendor == null) {
+                toaster.pop('info', '提示', '终端供应商名称未填写');
+            } else if ($scope.deOrder.vendtel == null) {
+                toaster.pop('info', '提示', '电话号码未填写');
+            } else if ($scope.deOrder.venduser == null) {
+                toaster.pop('info', '提示', '联系人未填写');
+            } else if ($scope.deOrder.shipdate == null) {
+                toaster.pop('info', '提示', '供应商发货时间未选择');
+            } else if ($scope.deOrder.goodspacking == null) {
+                toaster.pop('info', '提示', '货物包装要求未填写');
+            } else if ($scope.deOrder.deliverymethod == null) {
+                toaster.pop('info', '提示', '供应商交货方式未填写');
+            } else if ($scope.deOrder.pickupmethod == null) {
+                toaster.pop('info', '提示', '我方提货方式未填写');
+            } else if ($scope.deOrder.paymentmethod == null) {
+                toaster.pop('info', '提示', '我方付款方式未填写');
+            } else if ($scope.deOrder.pickupdate == null) {
+                toaster.pop('info', '提示', '我方提货时间未选择');
+            } else if ($scope.deOrder.currency == null) {
+                toaster.pop('info', '提示', '交易币别未选择');
+            } else if ($scope.deOrder.deputyuu == null) {
+                toaster.pop('info', '提示', '代采企业未选择');
+            } else if ($scope.deOrder.salecode == null) {
+                toaster.pop('info', '提示', '订单编号未填写');
+            } else if ($scope.deOrder.paydeldate == null) {
+                toaster.pop('info', '提示', '我方付款提货时间未选择');
+            } else if ($scope.deOrder.riskmethod == null) {
+                toaster.pop('info', '提示', '风险承担方式未填写');
+            } else if ($scope.deOrder.taxpaymentmethod == null) {
+                toaster.pop('info', '提示', '运、税费承担方式');
+            } else if ($scope.deOrder.tervendaddress == null) {
+                toaster.pop('info', '提示', '终端供应商地址未填写');
+            } else if ($scope.deOrder.companyname == null) {
+                toaster.pop('info', '提示', '公司全称(英文)未填写');
+            } else if ($scope.deOrder.requirepaydate == null) {
+                toaster.pop('info', '提示', '要求付汇日期未选择');
+            } else if ($scope.deOrder.bankname == null) {
+                toaster.pop('info', '提示', '银行名称(英文)未填写');
+            } else if ($scope.deOrder.bankaccount == null) {
+                toaster.pop('info', '提示', '银行账号未填写');
+            } else if ($scope.deOrder.bankaddress == null) {
+                toaster.pop('info', '提示', '银行地址未填写');
+            } else if ($scope.deOrder.bankcode == null) {
+                toaster.pop('info', '提示', '银行代码未填写');
+            } else if ($scope.deOrder.salepocode == null) {
+                toaster.pop('info', '提示', '合同编号未填写');
+            } else if ($scope.deOrder.legalrepresent == null) {
+                toaster.pop('info', '提示', '供应商方法定代表人未填写');
+            } else if ($scope.deOrder.paycomname == null) {
+                toaster.pop('info', '提示', '付款公司未填写');
+            } else if ($scope.deOrder.paycomaddress == null) {
+                toaster.pop('info', '提示', '付款公司地址未填写');
+            } else if ($scope.deOrder.enfax == null) {
+                toaster.pop('info', '提示', '供应商方法人电话未填写');
+            } else if ($scope.deOrder.paydate == null) {
+                toaster.pop('info', '提示', '货款支付时间未选择');
+            } else if ($scope.deOrder.paymethod == null) {
+                toaster.pop('info', '提示', '货款支付方式未填写');
+            } else if ($scope.deOrder.deliverydate == null) {
+                toaster.pop('info', '提示', '交货时间未选择');
+            } else if (!$scope.orderCodeEnable) {
+                toaster.pop('info', '提示', '采购单号重复');
+            } else if ($scope.deOrder.currency == 'USD' && $scope.deOrder.totalpayament >= 300 * 10000) {
+                toaster.pop('error', '提示', '单张订单委托采购总金额不得超过300万美金');
+            } else if ($scope.deOrder.currency == 'RMB' && $scope.deOrder.totalpayament >= 1000 * 10000) {
+                toaster.pop('error', '提示', '单张订单委托采购总金额不得超过1000万人民币');
+            } else {
+                angular.forEach($scope.deOrder.deputyOrderItems, function (orderitem, index) {
+                    if (orderitem.prodname == null) {
+                        toaster.pop('info', '提示', '订单明细第' + (index + 1) + '行产品名称未填写');
+                    } else if (orderitem.prodcode == null) {
+                        toaster.pop('info', '提示', '订单明细第' + (index + 1) + '行产品编号未填写');
+                    } else if (orderitem.prodspec == null) {
+                        toaster.pop('info', '提示', '订单明细第' + (index + 1) + '行产品规格未填写');
+                    } else if (orderitem.prodbrand == null) {
+                        toaster.pop('info', '提示', '订单明细第' + (index + 1) + '行产品品牌未填写');
+                    } else if (orderitem.amount == null) {
+                        toaster.pop('info', '提示', '订单明细第' + (index + 1) + '行数量未填写');
+                    } else if (orderitem.unitprice == null) {
+                        toaster.pop('info', '提示', '订单明细第' + (index + 1) + '行单价未填写');
+                    } else if (orderitem.purcprice == null) {
+                        toaster.pop('info', '提示', '订单明细第' + (index + 1) + '行订单单价未填写');
+                    } else {
+                        $scope.checkresult = true;
+                        $scope.isSave = true;
+                    }
+                });
+            }
+        }
+
+        // 保存
+        $scope.isSave = false;
+        $scope.save = function (status) {
+            checkKeyword();
+            if ($scope.checkresult) {
+                $scope.deOrder.totalamount = 0;
+                $scope.deOrder.usdpayment = 0;
+                $scope.deOrder.orderamount = 0;
+                $scope.deOrder.totalpayament = 0;
+                angular.forEach($scope.deOrder.deputyOrderItems, function (item) {
+                    $scope.deOrder.totalamount += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.usdpayment += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.totalpayament += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.orderamount += DecimalNumber.accMul(item.amount, item.purcprice);
+                });
+                if ($scope.deOrder.deputyOrderItems[0].prodcode == null) {
+                    toaster.pop('info', '提示', '您还未填写任何商品信息');
+                } else {
+                    $scope.deOrder.entrystatus = status;
+                    DeputyOrder.saveDeOrder({}, $scope.deOrder, function (data) {
+                        if (data.id) {
+                            toaster.pop('success', '提示', '保存成功');
+                            loadData();
+                            window.location.reload();
+                        }
+                        if (data.error) {
+                            toaster.pop('error', '提示', '保存失败');
+                        }
+                    }, function (response) {
+                        toaster.pop('error', '保存失败', response.data);
+                    });
+                }
+            }
+        }
+
+        $scope.openDatePicker = function ($event, deOrder, openParam) {
+            $event.preventDefault();
+            $event.stopPropagation();
+            deOrder[openParam] = !deOrder[openParam];
+        };
+
+        //复制采购单
+        $scope.copyorder = function (id) {
+            DeputyOrder.copyOrder({id: id}, {}, function (data) {
+                if (data.id) {
+                    toaster.pop('success', '提示', '复制生成单据成功');
+                    window.location.hash = "#/purc/deputy/" + data.id;
+                }
+                if (data.error) {
+                    toaster.pop('error', '提示', '保存失败');
+                }
+            }, function (response) {
+                toaster.pop('error', '提示', response.data);
+            });
+        }
+
+        // 删除代采订单
+        $scope.clear = function (id) {
+            DeputyOrder.clearOrder({id: id}, {}, function (data) {
+                if (data.success) {
+                    toaster.pop('success', '提示', data.success);
+                    window.location.hash = "#/purc/deputy";
+                }
+            }, function (response) {
+                toaster.pop('error', '提示', response.data);
+            });
+        }
+    }]);
+})

+ 67 - 0
src/main/webapp/resources/js/usercenter/controllers/b2b/order/deputyOrderLogCtrl.js

@@ -0,0 +1,67 @@
+/**
+ * 委外加工详细
+ *
+ * @author hejq
+ * @date 2018-06-25 17:13
+ */
+
+
+define(['app/app'], function(app) {
+	app.register.controller('DeputyOrderLogCtrl', ['$scope', '$rootScope', 'B2bDeputyOrder', 'ngTableParams', '$filter', 'BaseService', 'toaster', '$timeout', function ($scope, $rootScope, DeputyOrder, ngTableParams, $filter, BaseService, toaster, $timeout) {
+        $rootScope.active = 'buyer_order';
+        BaseService.scrollBackToTop();
+        var getService = function () {
+            return DeputyOrder.getRepetitions;
+        };
+
+        $scope.tableParams = new ngTableParams({
+            page: 1,
+            count: 20,
+            sorting: {}
+        }, {
+            total: 0,
+            counts: [5, 10, 25, 50],
+            getData: function ($defer, params) {
+                $scope.loading = true;
+                var pageParams = params.url();
+                pageParams.keyword = $scope.keyword;
+                pageParams.searchFilter = $scope.searchFilter;
+                getService().call(null, BaseService.parseParams(pageParams), function (page) {
+                    $scope.loading = false;
+                    if (page) {
+                        params.total(page.totalElement);
+                        $defer.resolve(page.content);
+                        $scope.keywordXls = angular.copy(pageParams.keyword);//保存当前取值的关键词
+                        $scope.searchFilterXls = angular.copy(pageParams.searchFilter);
+                    }
+                }, function (response) {
+                    $scope.loading = false;
+                    toaster.pop('error', '数据加载失败', response.data);
+                });
+            }
+        });
+
+        // 搜索框回车
+        $scope.onSearch = function () {
+            $scope.tableParams.page(1);
+            $scope.tableParams.reload();
+        };
+
+        //删除
+        $scope.deleteById = function (id) {
+            GetProductInfo.deleteById({id: id}, function (data) {
+                if (data.error) {
+                    toaster.pop("error", "提示", data.error);
+                } else {
+                    toaster.pop("success", "提示", "删除成功");
+                    $timeout(function () {
+                        $scope.tableParams.reload();
+                    }, 500);
+                }
+            }), function (response) {
+                toaster.pop("error", "删除失败", response.data);
+            };
+        }
+
+    }]);
+})

+ 1 - 1
src/main/webapp/resources/js/usercenter/controllers/b2b/order/purcDeputyOrderCtrl.js

@@ -258,7 +258,7 @@ define(['app/app'], function(app) {
 
 
         $scope.viewApprove = function(salecode, uu) {
         $scope.viewApprove = function(salecode, uu) {
             var modalInstance = $modal.open({
             var modalInstance = $modal.open({
-                templateUrl: 'static/tpl/index/purc/modal/approval_detail.html',
+                templateUrl: 'static/view/usercenter/b2b/modal/approval_detail.html',
                 controller: 'ViewApprovalDetailCtrl',
                 controller: 'ViewApprovalDetailCtrl',
                 resolve: {
                 resolve: {
                     uu: function () {
                     uu: function () {

+ 91 - 0
src/main/webapp/resources/js/usercenter/controllers/b2b/order/purcMakeOutOrderDetailCtrl.js

@@ -0,0 +1,91 @@
+/**
+ * 委外加工详细
+ *
+ * @author hejq
+ * @date 2018-06-25 17:13
+ */
+
+
+define(['app/app'], function(app) {
+	app.register.controller('PurcMakeOutOrderDetailCtrl', ['$scope', '$rootScope', '$stateParams', 'B2bMakeOutOrder', 'toaster', 'B2bReportService', 'BaseService', 'B2bCurrentRole', function ($scope, $rootScope, $stateParams, MakeOutOrder, toaster, ReportService, BaseService, CurrentRole) {
+        BaseService.scrollBackToTop();
+        $rootScope.active = 'buyer_order';
+        // 获取当前用户是否为普通用户
+        CurrentRole.isUser({}, {}, function (data) {
+            $scope.isUser = data.isUser;
+        });
+        var loadData = function () {
+            MakeOutOrder.getItem({id: $stateParams.id},{}, function (data) {
+                $scope.order = data;
+                var sum = $scope.order.qty * $scope.order.price;
+                $scope.order.total = sum;
+                $scope.loading = false;
+            }, function (response) {
+                toaster.pop('error', '提示', response.data);
+            });
+        };
+        loadData();
+        // 获取回复记录
+        $scope.getReply = function (item) {
+            if (!item.replies) {
+                MakeOutOrder.getReply({orderId: item.id}, function (replies) {
+                    item.replies = replies;
+                });
+            }
+        };
+        $scope.openDatePicker = function ($event, item, openParam) {
+            $event.preventDefault();
+            $event.stopPropagation();
+            item[openParam] = !item[openParam];
+        };
+
+        // 点击回复
+        $scope.onReplyClick = function (order, inverse) {
+            if (order.reply) {
+                if (!order.reply.qty || order.reply.qty < 0 || order.reply.qty > order.qty) {
+                    toaster.pop('warning', '提示', '请填写有效的回复数量!');
+                    return;
+                }
+                var reply = angular.copy(order.reply);
+                if (reply.delivery) {
+                    if (typeof reply.delivery == 'object')
+                        reply.delivery = reply.delivery.getTime();
+                } else {
+                    reply.delivery = order.delivery;
+                }
+                if (inverse && inverse == -1) reply.qty = -1 * reply.qty;// 取相反
+                $scope.loading = true;
+                MakeOutOrder.reply({orderId: order.id}, reply, function () {
+                    $scope.loading = false;
+                    toaster.pop('info', '提示', (inverse == -1 ? '撤销成功' : '回复成功'));
+                    loadData();
+                }, function (response) {
+                    $scope.loading = false;
+                    toaster.pop('error', '回复失败', response.data);
+                });
+            }
+        };
+
+        // 打开回复
+        $scope.openReply = function (order) {
+            if (!order.reply) {
+                order.reply = {
+                    qty: order.qty - (order.replyQty ? order.replyQty : 0),
+                    delivery: order.delivery
+                }
+            }
+            order.$editing = true;
+        };
+
+        // 关闭回复
+        $scope.closeReply = function (order) {
+            order.$editing = false;
+        }
+
+        // 自己委外加工订单
+        $scope.print = function (order) {
+            MakeOutOrder.printCount({id: order.id}, {});//增加打印此次
+            ReportService.print(order.enUU, 'MAKE', 'where make$outorders.ma_id =' + order.id);
+        };
+    }]);
+})

+ 397 - 0
src/main/webapp/resources/js/usercenter/controllers/b2b/order/purcNewDeputyOrderCtrl.js

@@ -0,0 +1,397 @@
+/**
+ * 新增代采订单
+ *
+ * @author hejq
+ * @date 2018-06-25 17:13
+ */
+
+
+define(['app/app'], function(app) {
+	app.register.controller('PurcNewDeputyOrderCtrl', ['$scope', '$rootScope', 'toaster', '$modal', 'B2bDeputyOrder', '$filter', 'ngTableParams', 'BaseService', 'B2bDecimalNumber', 'B2bDekeyValue', function ($scope, $rootScope, toaster, $modal, DeputyOrder, $filter, ngTableParams, BaseService, DecimalNumber, DekeyValue) {
+        BaseService.scrollBackToTop();
+        //默认采购单号不重复
+        $rootScope.active = 'buyer_order';
+        $scope.orderCodeEnable = true;
+        $scope.deOrder = {
+            code: 'DC' + $filter('date')(new Date(), 'yyMMddHHmmss_sss'),
+            entrydate: new Date(),
+            status: '在录入',
+            goodspacking: '供应商原厂包装,如外包装完好视为货物完好',
+            pickupdate: '我方自向贵公司支付货款之日起3个自然日内提货完毕',
+            riskmethod: '甲方承担',
+            taxpaymentmethod: '甲方承担',
+            deliverymethod: '供应商送货到付款采购方指定仓库',
+            totalamount: 0,
+            totalpayament: 0,
+            orderamount: 0,
+            usdpayment: 0
+        };
+
+        $scope.deOrder.deputyOrderItems = [];
+        var item = {
+            prodname: null,
+            prodcode: null,
+            prodspec: null,
+            amount: null,
+            unitprice: null,
+            purcprice: null,
+            remark: null,
+            orderprice: null,
+        };
+        $scope.deOrder.deputyOrderItems.push(item);
+
+        // 代采企业列表
+        DeputyOrder.deputyEnterprise({}, function (data) {
+            $scope.deputyEnterprises = data;
+            $scope.deOrder.deputyname = $scope.deputyEnterprises[0].deputyenname;
+            $scope.deOrder.deputyuu = $scope.deputyEnterprises[0].deputyenuu;
+            getPayMethod($scope.deOrder.deputyuu, 'paymentmethod');
+        });
+
+        var getPayMethod = function(enuu, key) {
+            // 获取我方付款支付方式默认值
+            DekeyValue.getValue({enuu: enuu, key: key}, function(data) {
+                $scope.methods = data.content;
+            });
+        }
+
+        // 更新名称时后台更改uu号
+        $scope.change = function (deputyname) {
+            DeputyOrder.deputyEnterprise({}, function (data) {
+                $scope.deputyEn = data;
+                angular.forEach($scope.deputyEn, function (en) {
+                    if (deputyname == en.deputyenname) {
+                        $scope.deputyuu = en.deputyenuu;
+                        getPayMethod($scope.deputyuu, 'paymentmethod');
+                    }
+                });
+            });
+        }
+
+        // 设置付款企业信息
+        $scope.setPayComName = function() {
+            // 针对信扬客户,如果是RMB赋值默认值
+            if ($scope.deOrder.currency == 'RMB' && $scope.deOrder.deputyuu == 10044118) {
+                $scope.deOrder.paycomname = '深圳信扬国际经贸股份有限公司';
+                $scope.deOrder.paycomaddress= '深圳市前海深港合作区前湾一路1号A栋201室(入驻深圳市前海商务秘书有限公司)';
+            }
+        }
+
+        // 查找付款企业
+        $scope.dbfindPayCompany = function (deputyuu) {
+            var modalInstance = $modal.open({
+                templateUrl: 'static/tpl/index/purc/modal/payCompany.html',
+                controller: 'DbfindDeputyPayCompanyCtrl',
+                resolve: {
+                    deputyuu: function () {
+                        return deputyuu
+                    }
+                }
+            });
+
+            modalInstance.result.then(function (data) {
+                $scope.deOrder.paycomname = data.enname;
+                $scope.deOrder.paycomaddress = data.address;
+            })
+        }
+
+        // 查询上次的关键词记录
+        $scope.getHisKeyword = function (tervendor) {
+            DeputyOrder.hisKeywords({tervendor: tervendor}, {}, function (data) {
+                $scope.deOrder.vendtel = data.vendtel;
+                $scope.deOrder.venduser = data.venduser;
+                $scope.deOrder.otherdata = data.otherdata;
+                $scope.deOrder.companyname = data.companyname;
+                $scope.deOrder.bankaccount = data.bankaccount;
+                $scope.deOrder.bankaddress = data.bankaddress;
+                $scope.deOrder.bankcode = data.bankcode;
+                $scope.deOrder.bankname = data.bankname;
+                $scope.deOrder.legalrepresent = data.legalrepresent;
+                $scope.deOrder.tervendaddress = data.tervendaddress;
+                $scope.deOrder.enfax = data.enfax;
+                $scope.deOrder.deliverymethod = data.deliverymethod;
+            }, function (response) {
+                toaster.pop('error', '提示', response.data);
+            });
+        }
+
+        // 查询历史供应商
+        DeputyOrder.hisvendors({}, function (data) {
+            $scope.hisvendors = data;
+        }, function (response) {
+            toaster.pop('error', '提示', response.data);
+        });
+
+        // 上次填写记录(不关联供应商)
+        DeputyOrder.lastKeywords({}, function (data) {
+            $scope.lastkeyowrds = data;
+            $scope.deOrder.madealdate = $scope.lastkeyowrds.madealdate;
+            $scope.deOrder.madealcode = $scope.lastkeyowrds.madealcode;
+        }, function (response) {
+            toaster.pop('error', '提示', response.data);
+        });
+
+        //增加商品
+        $scope.add = function (index) {
+            if ($scope.deOrder.deputyOrderItems[index].prodcode == null) {
+                toaster.pop('info', '提示', '请先填写商品信息');
+            } else {
+                $scope.deOrder.deputyOrderItems.push(
+                    {
+                        prodname: null,
+                        prodcode: null,
+                        prodspec: null,
+                        prodbrand: null,
+                        amount: null,
+                        unitprice: null,
+                        purcprice: null,
+                        remark: null,
+                        orderprice: null
+                    });
+            }
+        };
+        //删除商品
+        $scope.del = function (index) {
+            $scope.deOrder.deputyOrderItems.splice(index, 1);
+        };
+        // 导入商品信息
+        $scope.uplodaByBatch = function () {
+            var modalInstance = $modal.open({
+                templateUrl: 'static/view/usercenter/b2b/modal/uplodaByBatch.html',
+                controller: 'DeputyOrderUploadCtrl',
+                size: 'lg',
+                resolve: {}
+            });
+
+            modalInstance.result.then(function (data) {
+                angular.forEach(data, function (data) {
+                    $scope.deOrder.deputyOrderItems.push(data);
+                    for (var i = 0; i < $scope.deOrder.deputyOrderItems.length; i++) {
+                        if ($scope.deOrder.deputyOrderItems[i].prodname == null) { // 如果没有填写就删除这行数据
+                            $scope.deOrder.deputyOrderItems.splice(i, 1);
+                        }
+                    }
+                })
+                $scope.deOrder.totalamount = 0;
+                $scope.deOrder.usdpayment = 0;
+                $scope.deOrder.orderamount = 0;
+                $scope.deOrder.totalpayament = 0;
+                angular.forEach($scope.deOrder.deputyOrderItems, function (item) {
+                    $scope.deOrder.totalamount += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.usdpayment += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.totalpayament += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.orderamount += DecimalNumber.accMul(item.amount, item.purcprice);
+                });
+
+            }, function () {
+
+            });
+        }
+
+        // 查找供应商
+        $scope.dbfindVendor = function (deputyuu) {
+            var modalInstance = $modal.open({
+                templateUrl: 'static/tpl/index/purc/modal/purc_order_vendor.html',
+                controller: 'DbfindDeputyVendorInfoCtrl',
+                size: 'lg',
+                resolve: {
+                    deputyuu: function () {
+                        return deputyuu
+                    }
+                }
+            });
+
+            modalInstance.result.then(function (data) {
+                $scope.deOrder.customer = data.vendorEnterprise.enName;
+                $scope.deOrder.legalrepresent = data.vendorUser.userName;
+                $scope.deOrder.enaddress = data.vendorEnterprise.enAddress;
+                $scope.deOrder.usertel = data.vendorUser.userTel;
+            })
+        }
+
+        // 检验订单编号是否存在
+        $scope.checkOrder = function (salecode, deputyuu) {
+            DeputyOrder.checkOrders({salecode: salecode, deputyuu: deputyuu}, {}, function (data) {
+                $scope.orderCodeEnable = true;
+                if (data.info) {
+                    toaster.pop('error', '提示', data.info);
+                    $scope.orderCodeEnable = false;
+                }
+            }, function (response) {
+                toaster.pop('error', '提示', response.data);
+            })
+        }
+
+        //计算采购单价
+        $scope.checkPrice = function (rate) {
+            $scope.deOrder.totalamount = 0;
+            $scope.deOrder.usdpayment = 0;
+            $scope.deOrder.orderamount = 0;
+            $scope.deOrder.totalpayament = 0;
+            if (rate == null) {
+                toaster.pop('info', '提示', '请先填入税率');
+            } else {
+                angular.forEach($scope.deOrder.deputyOrderItems, function (item) {
+                    item.purcprice = DecimalNumber.accMul(item.unitprice, (1 + rate / 100));
+                    $scope.deOrder.totalamount += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.usdpayment += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.totalpayament += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.orderamount += DecimalNumber.accMul(item.amount, item.purcprice);
+                });
+            }
+        }
+
+        // 获取订单总价
+        $scope.totalPrice = function () {
+            $scope.deOrder.totalamount = 0;
+            $scope.deOrder.usdpayment = 0;
+            $scope.deOrder.orderamount = 0;
+            $scope.deOrder.totalpayament = 0;
+            angular.forEach($scope.deOrder.deputyOrderItems, function (item) {
+                if(item.amount != null && item.unitprice != null && item.purcprice != null) {
+                    $scope.deOrder.totalamount += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.usdpayment += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.totalpayament += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.orderamount += DecimalNumber.accMul(item.amount, item.purcprice);
+                }
+            });
+        }
+
+        $scope.checkresult = false;
+        var checkKeyword = function () {
+            if ($scope.deOrder.madealdate == null) {
+                toaster.pop('info', '提示', '主协议签订日期未选择');
+            } else if ($scope.deOrder.madealcode == null) {
+                toaster.pop('info', '提示', '主协议签订编号未填写');
+            } else if ($scope.deOrder.tervendor == null) {
+                toaster.pop('info', '提示', '终端供应商名称未填写');
+            } else if ($scope.deOrder.vendtel == null) {
+                toaster.pop('info', '提示', '电话号码未填写');
+            } else if ($scope.deOrder.venduser == null) {
+                toaster.pop('info', '提示', '联系人未填写');
+            } else if ($scope.deOrder.shipdate == null) {
+                toaster.pop('info', '提示', '供应商发货时间未选择');
+            } else if ($scope.deOrder.goodspacking == null) {
+                toaster.pop('info', '提示', '货物包装要求未填写');
+            } else if ($scope.deOrder.deliverymethod == null) {
+                toaster.pop('info', '提示', '供应商交货方式未填写');
+            } else if ($scope.deOrder.pickupmethod == null) {
+                toaster.pop('info', '提示', '我方提货方式未填写');
+            } else if ($scope.deOrder.paymentmethod == null) {
+                toaster.pop('info', '提示', '我方付款方式未填写');
+            } else if ($scope.deOrder.pickupdate == null) {
+                toaster.pop('info', '提示', '我方提货时间未选择');
+            } else if ($scope.deOrder.currency == null) {
+                toaster.pop('info', '提示', '交易币别未选择');
+            } else if ($scope.deOrder.deputyuu == null) {
+                toaster.pop('info', '提示', '代采企业未选择');
+            } else if ($scope.deOrder.salecode == null) {
+                toaster.pop('info', '提示', '订单编号未填写');
+            } else if ($scope.deOrder.paydeldate == null) {
+                toaster.pop('info', '提示', '我方付款提货时间未选择');
+            } else if ($scope.deOrder.riskmethod == null) {
+                toaster.pop('info', '提示', '风险承担方式未填写');
+            } else if ($scope.deOrder.taxpaymentmethod == null) {
+                toaster.pop('info', '提示', '运、税费承担方式');
+            } else if ($scope.deOrder.tervendaddress == null) {
+                toaster.pop('info', '提示', '终端供应商地址未填写');
+            } else if ($scope.deOrder.companyname == null) {
+                toaster.pop('info', '提示', '公司全称(英文)未填写');
+            } else if ($scope.deOrder.requirepaydate == null) {
+                toaster.pop('info', '提示', '要求付汇日期未选择');
+            } else if ($scope.deOrder.bankname == null) {
+                toaster.pop('info', '提示', '银行名称(英文)未填写');
+            } else if ($scope.deOrder.bankaccount == null) {
+                toaster.pop('info', '提示', '银行账号未填写');
+            } else if ($scope.deOrder.bankaddress == null) {
+                toaster.pop('info', '提示', '银行地址未填写');
+            } else if ($scope.deOrder.bankcode == null) {
+                toaster.pop('info', '提示', '银行代码未填写');
+            } else if ($scope.deOrder.salepocode == null) {
+                toaster.pop('info', '提示', '合同编号未填写');
+            } else if ($scope.deOrder.legalrepresent == null) {
+                toaster.pop('info', '提示', '供应商方法定代表人未填写');
+            } else if ($scope.deOrder.paycomname == null) {
+                toaster.pop('info', '提示', '付款公司未填写');
+            } else if ($scope.deOrder.paycomaddress == null) {
+                toaster.pop('info', '提示', '付款公司地址未填写');
+            } else if ($scope.deOrder.enfax == null) {
+                toaster.pop('info', '提示', '供应商方法人电话未填写');
+            } else if ($scope.deOrder.paydate == null) {
+                toaster.pop('info', '提示', '货款支付时间未选择');
+            } else if ($scope.deOrder.paymethod == null) {
+                toaster.pop('info', '提示', '货款支付方式未填写');
+            } else if ($scope.deOrder.deliverydate == null) {
+                toaster.pop('info', '提示', '交货时间未选择');
+            }  else if (!$scope.orderCodeEnable) {
+                toaster.pop('info', '提示', '采购单号重复');
+            } else if ($scope.deOrder.currency == 'USD' && $scope.deOrder.totalpayament >= 300 * 10000) {
+                toaster.pop('error', '提示', '单张订单委托采购总金额不得超过300万美金');
+            } else if ($scope.deOrder.currency == 'RMB' && $scope.deOrder.totalpayament >= 1000 * 10000) {
+                toaster.pop('error', '提示', '单张订单委托采购总金额不得超过1000万人民币');
+            } else {
+                angular.forEach($scope.deOrder.deputyOrderItems, function (orderitem, index) {
+                    if (orderitem.prodname == null) {
+                        toaster.pop('info', '提示', '订单明细第' + (index + 1) + '行产品名称未填写');
+                    } else if (orderitem.prodcode == null) {
+                        toaster.pop('info', '提示', '订单明细第' + (index + 1) + '行产品编号未填写');
+                    } else if (orderitem.prodspec == null) {
+                        toaster.pop('info', '提示', '订单明细第' + (index + 1) + '行产品规格未填写');
+                    } else if (orderitem.prodbrand == null) {
+                        toaster.pop('info', '提示', '订单明细第' + (index + 1) + '行产品品牌未填写');
+                    } else if (orderitem.amount == null) {
+                        toaster.pop('info', '提示', '订单明细第' + (index + 1) + '行数量未填写');
+                    } else if (orderitem.unitprice == null) {
+                        toaster.pop('info', '提示', '订单明细第' + (index + 1) + '行单价未填写');
+                    } else if (orderitem.purcprice == null) {
+                        toaster.pop('info', '提示', '订单明细第' + (index + 1) + '行订单单价未填写');
+                    } else {
+                        $scope.checkresult = true;
+                        $scope.isSave = true;
+                    }
+                })
+            };
+        }
+
+        // 保存
+        $scope.isSave = false;
+        $scope.save = function (status) {
+            $scope.deOrder.entrystatus = status;
+            checkKeyword();
+            if ($scope.checkresult) {
+                $scope.deOrder.totalamount = 0;
+                $scope.deOrder.usdpayment = 0;
+                $scope.deOrder.orderamount = 0;
+                $scope.deOrder.totalpayament = 0;
+                angular.forEach($scope.deOrder.deputyOrderItems, function (item) {
+                    $scope.deOrder.totalamount += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.usdpayment += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.totalpayament += DecimalNumber.accMul(item.amount, item.unitprice);
+                    $scope.deOrder.orderamount += DecimalNumber.accMul(item.amount, item.purcprice);
+                });
+                if ($scope.deOrder.deputyOrderItems[0].prodcode == null) {
+                    toaster.pop('info', '提示', '您还未填写任何商品信息');
+                } else {
+                    DeputyOrder.saveDeOrder({}, $scope.deOrder, function (data) {
+                        if (data.id) {
+                            toaster.pop('success', '提示', status + '成功');
+                            window.location.hash = "#/purc/deputy/" + data.id;
+                        }
+                        if (data.error) {
+                            toaster.pop('error', '提示', status + '失败');
+                        }
+                    }, function (response) {
+
+                    });
+                }
+            }
+        }
+
+        $scope.openDatePicker = function ($event, deOrder, openParam) {
+            $event.preventDefault();
+            $event.stopPropagation();
+            deOrder[openParam] = !deOrder[openParam];
+        };
+
+    }]);
+})

+ 60 - 0
src/main/webapp/resources/view/usercenter/b2b/modal/approval_detail.html

@@ -0,0 +1,60 @@
+<style>
+	.text-default{
+		color: #5078cb;
+		font-size: 14px;
+	}
+</style>
+<div class="modal-header">
+	<h3 class="modal-title">
+		<i class="fa fa-user fa-fw text-default"></i>审批流程
+	</h3>
+</div>
+<div class="modal-body">
+	<div >
+		<table width="50%" class="block table table-bordered table-striped table-hover">
+			<thead>
+				<th width="120px;" class="text-center">已处理</th>
+			</thead>
+			<tbody ng-if="nodes.length != 0">
+				<div style="overflow-y: scroll; width: 100%; max-height: 500px" >
+					<tr ng-repeat="node in nodes | orderBy : 'jn_dealTime' ">
+						<td width="80px;">
+							处理节点: <a style="text-decoration: none" ng-bind="node.jn_name"></a>
+							处理结果: <a style="text-decoration: none" ng-bind="node.jn_dealResult"></a>
+							处理时间: <a style="text-decoration: none" ng-bind="node.jn_dealTime"></a>
+						</td>
+					</tr>
+				</div>
+			<tbody>
+			<tbody ng-if="nodes.length == 0">
+				<div>
+					<tr>
+						<td width="80px;" class="text-center"><i class="fa fa-exclamation-circle"></i> 暂无相关信息</td>
+					</tr>
+				</div>
+			<tbody>
+			<thead>
+				<th width="120px;" class="text-center">待处理</th>
+			</thead>
+			<tbody ng-if="process.length != 0">
+				<div style="overflow-y: scroll; width: 100%; max-height: 500px" >
+					<tr ng-repeat="pro in process | orderBy : 'jp_id' ">
+						<td width="80px;">
+							处理节点: <a style="text-decoration: none" ng-bind="pro.jp_nodeName"></a>
+						</td>
+					</tr>
+				</div>
+			<tbody>
+			<tbody ng-if="process.length == 0">
+				<div>
+					<tr>
+						<td width="80px;" class="text-center"><i class="fa fa-exclamation-circle"></i> 暂无相关信息</td>
+					</tr>
+				</div>
+			<tbody>
+		</table>
+	</div>
+</div>
+<div class="modal-footer">
+	<button class="btn btn-default" ng-click="cancel()" type="button">取消</button>
+</div>

+ 1 - 1
src/main/webapp/resources/view/usercenter/b2b/modal/uplodaByBatch.html

@@ -13,7 +13,7 @@
 		margin-left: 10px;
 		margin-left: 10px;
 	}
 	}
 </style>
 </style>
-<div class="b2b-com-modal">
+<div class="b2b-com-modal" style="overflow: hidden;">
 	<p class="title">批量导入<i class="fa fa-close" ng-click="cancel()"></i></p>
 	<p class="title">批量导入<i class="fa fa-close" ng-click="cancel()"></i></p>
 	<div class="modal-body" style="min-height: 200px;">
 	<div class="modal-body" style="min-height: 200px;">
 		<div class="step">
 		<div class="step">

+ 5 - 4
src/main/webapp/resources/view/usercenter/b2b/order/deputyOrder.html

@@ -166,6 +166,7 @@
 		text-align: left;
 		text-align: left;
 		line-height: 25px;
 		line-height: 25px;
 		padding: 10px 20px;
 		padding: 10px 20px;
+		background: #fff;
 	}
 	}
 
 
 	.deputy-btn {
 	.deputy-btn {
@@ -216,8 +217,8 @@
 			<li ng-class="{'active': storeType=='outorder'}"><a ui-sref="purc_make_outorder">委外订单</a></li>
 			<li ng-class="{'active': storeType=='outorder'}"><a ui-sref="purc_make_outorder">委外订单</a></li>
 			<li class="down-purchase">
 			<li class="down-purchase">
 				<span class="tab_add" ng-if="!isUser">总金额: {{odersAmount| number}} </span>
 				<span class="tab_add" ng-if="!isUser">总金额: {{odersAmount| number}} </span>
-				<a class="tab_add" ui-sref="purc.newdeputy" type="button" title="新增代采订单"><i class="fa fa-plus-square fa-fw"></i>新增</a>
-				<a class="tab_add" ui-sref="purc.deputylog" type="button" title="错误日志"><i class="fa fa-file-text"></i> 错误日志</a>
+				<a class="tab_add" ui-sref="purc_new_deputy" type="button" title="新增代采订单"><i class="fa fa-plus-square fa-fw"></i>新增</a>
+				<a class="tab_add" ui-sref="purc_deputy_log" type="button" title="错误日志"><i class="fa fa-file-text"></i> 错误日志</a>
 			</li>
 			</li>
 		</ul>
 		</ul>
 	</div>
 	</div>
@@ -341,7 +342,7 @@
 		<tr>
 		<tr>
 			<td colspan="4" class="text-left">
 			<td colspan="4" class="text-left">
 				<div class="col-md-4">
 				<div class="col-md-4">
-					<div>流水号:<a ng-bind="order.code" ui-sref="purc.deputydetail({id:order.id})"></a></div>
+					<div>流水号:<a ng-bind="order.code" ui-sref="purc_deputy_detail({id:order.id})"></a></div>
 					<div>录入日期:<span ng-bind="order.entrydate| date: 'yyyy-MM-dd'"></span></div>
 					<div>录入日期:<span ng-bind="order.entrydate| date: 'yyyy-MM-dd'"></span></div>
 					<div>提交日期:<span ng-bind="order.date| date: 'yyyy-MM-dd'"></span></div>
 					<div>提交日期:<span ng-bind="order.date| date: 'yyyy-MM-dd'"></span></div>
 					<div>终端供应商:<span ng-bind="order.tervendor"></span></div>
 					<div>终端供应商:<span ng-bind="order.tervendor"></span></div>
@@ -349,7 +350,7 @@
 					<div>订单状态:<span ng-bind="order.entrystatus"></span></div>
 					<div>订单状态:<span ng-bind="order.entrystatus"></span></div>
 				</div>
 				</div>
 				<div class="col-md-3">
 				<div class="col-md-3">
-					<div>订单编号:<a ng-bind="order.salecode" ui-sref="purc.deputydetail({id:order.id})"></a></div>
+					<div>订单编号:<a ng-bind="order.salecode" ui-sref="purc_deputy_detail({id:order.id})"></a></div>
 					<div>最新付款日期:<span ng-bind="order.paydate| date: 'yyyy-MM-dd'"></span></div>
 					<div>最新付款日期:<span ng-bind="order.paydate| date: 'yyyy-MM-dd'"></span></div>
 					<div>累计付款金额:<span ng-if="!isUser" ng-bind="order.totalamount | number"></span><span ng-if="isUser">-</span></div>
 					<div>累计付款金额:<span ng-if="!isUser" ng-bind="order.totalamount | number"></span><span ng-if="isUser">-</span></div>
 				</div>
 				</div>

+ 572 - 0
src/main/webapp/resources/view/usercenter/b2b/order/deputyOrder_detail.html

@@ -0,0 +1,572 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+	<meta charset="UTF-8"/>
+	<title>代采订单02</title>
+	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
+	<meta name="Keywords" content=""/>
+	<meta name="Description" content=""/>
+	<link rel="stylesheet" href="static/css/deputyOrder/base.css"/>
+	<link rel="stylesheet" href="static/css/deputyOrder/order.css"/>
+</head>
+<body>
+<style>
+	/* 日期选择器 */
+	.date-picker {
+		padding-top: 10px;
+	}
+	.date-picker input {
+		border-radius: 0;
+		border: 1px solid #5078cb;
+		border-right: none;
+		font-size: 12px;
+	}
+	.date-picker span .btn-open {
+		color: #fff;
+		background-color: #5078cb;
+		border-radius: 0;
+		border: 1px solid #5078cb;
+		border-left: none;
+	}
+
+	/* 修改本页内btn的样式 及datepicker中的btn-success的样式 */
+	.date-picker .btn {
+		border-radius: 0;
+	}
+
+	.date-picker .btn-success {
+		background-color: #3f84f6;
+	}
+	.date-picker ul {
+		border-radius: 0;
+	}
+	.date-picker ul div:focus {
+		outline: none;
+		border-radius: 0;
+		border: none;
+	}
+	.input-group-addon {
+		background-color: inherit;
+		border: 1px solid #e1e1e1;
+		color: #888 !important;
+	}
+	.purchase_form01 ul li .dropdown-menu {
+		width: 257px;
+		height: 300px;
+	}
+	.purchase_form01 ul li .dropdown-menu span{
+		width: 14px;
+		height: 16px;
+		line-height: 20px;
+	}
+	.purchase_form01 ul li.ng-scope{
+		margin-top: 210px
+	}
+	.purchase_form01 ul li.ng-scope span{
+		width: 120px;
+		height: 50px;
+	}
+	.purchase_form01 ul li .input-group .input-group-btn .btn-sm{
+		width: 37px;
+		height: 34px;
+		z-index: 3;
+		position: absolute;
+		background: #bfbfbf;
+		border: 1px solid #bfbfbf;
+	}
+	.purchase_form01 ul li .input-group .form-control {
+		width:152px;
+		border: #bfbfbf 1px solid;
+	}
+	.purchase_form01 ul li .dropdown-menu li{
+		line-height: 30px;
+	}
+	.purchase_form01 ul li .dropdown-menu button{
+		position: relative;
+		widhth: 46px;
+		height: 30px;
+	}
+	.purchase_form01 ul li .dropdown-menu div{
+		width: 255px;
+		height: 220px;
+	}
+
+	.purchase_form01 ul li .dropdown-menu span i{
+		color: white;
+	}
+
+	.purchase_xq dd input{
+		border: none;
+		border-bottom: 1px solid #333;
+		height: 35px;
+		width: 80px;
+		font-size: 14px;
+	}
+
+	.purchase_xq dd input:focus {
+		border-bottom: 1px solid blue;
+	}
+
+	.purchase .input-group .form-control{
+		border-radius: 0px;
+		border: 1px solid #5078cb;
+	}
+
+	.purchase .input-group .input-group-btn i{
+		color: #fff;
+	}
+
+	.purchase .input-group .input-group-btn {
+		width: 37px;
+		height: 34px;
+		position: absolute;
+		right: 74px;
+	}
+	.purchase_xq dl span.wid01{
+		width: 4% !important;
+	}
+	.purchase_xq dl span.wid02{
+		width: 13% !important;
+	}
+	.purchase_xq dl span{
+		width: 9.2% !important;
+	}
+	.purchase_xq dd input{
+		width: 92%;
+	}
+	.purchase_form01 b {
+		color: red;
+	}
+	.com_title01 span{
+		margin-left: 37px;
+	}
+	.purchase_xq span button {
+		border: none;
+		background-color: #fff;
+		height: 49px;
+	}
+</style>
+<div class="warp">
+	<div class="purchase fr block user_right">
+		<form class="width100" name="order" autocomplete="off">
+			<!-- <div class="com_title">服务>采购模块><font>>代采订单</font></div>-->
+			<div class="com_head">
+				<span>代采订单</span>
+				<div class="pull-right" style="font-size: 16px">
+					<a ng-click="copyorder(deOrder.id)" title="复制生成一张新的订单,除了采购单号和合同编号不同,其他信息基本相同"><i class="fa fa-copy"></i> 复制订单</a>
+				</div>
+			</div>
+			<div class="purchase_form purchase_form_margin">
+				<!--基本信息-->
+				<div class="com_title01"><span>基本信息</span></div>
+				<div class="purchase_form01 clearfix">
+					<ul>
+						<li>
+							<div class="fl">
+								<em>流水号:</em>
+								<span ng-bind="deOrder.code"></span>
+							</div>
+							<div class="fr">
+								<em>制单日期:</em>
+								<span class="has_time" ng-bind="deOrder.entrydate| date: 'yyyy-MM-dd'"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em>状态:</em>
+								<span ng-bind="deOrder.status"></span>
+							</div>
+							<div class="fr">
+								<em>业务状态:</em>
+								<span ng-bind="deOrder.prostatus"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>主协议签订日期:</em>
+								<div class="input-group">
+									<input ng-model="deOrder.madealdate" type="text" class="form-control"
+										   placeholder="点击选择时间" datepicker-popup="yyyy-MM-dd" is-open="deOrder.$madealdate"
+										   min-date="getMinDate()" ng-required="true"
+										   current-text="今天" clear-text="清除" close-text="关闭"
+										   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+										   ng-focus="openDatePicker($event, deOrder.madealdate.$dateOpen)" readonly>
+									<span class="input-group-btn">
+										<button type="button" class="btn btn-default btn-sm"
+												ng-click="openDatePicker($event, deOrder, '$madealdate')" ng-disabled="!deOrder.$editing">
+											<i class="fa fa-calendar fa-lg"></i>
+										</button>
+									</span>
+								</div>
+							</div>
+							<div class="fr">
+								<em><b>*</b>主协议编号:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.madealcode" ng-readonly="!deOrder.$editing" ng-required="true"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>终端供应商名称:</em>
+								<span><!-- <input type="text" class="input01" ng-model="deOrder.tervendor" ng-readonly="!deOrder.$editing"> -->
+                                	 <input  ng-model="deOrder.tervendor" list="hisvendors" class="select" style="width: 200px">
+	                                    <datalist id="hisvendors">
+	                                    	 <option  ng-repeat="vendor in hisvendors" value="{{vendor.vendorname}}">{{vendor.vendorname}}</option>
+	                                    </datalist>
+                                </span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>电话:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.vendtel" ng-readonly="!deOrder.$editing" ng-required="true"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>联系人:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.venduser" ng-readonly="!deOrder.$editing" ng-required="true"></span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>供应商发货时间:</em>
+								<div class="input-group">
+									<input ng-model="deOrder.shipdate" type="text" class="form-control"
+										   placeholder="点击选择时间" datepicker-popup="yyyy-MM-dd" is-open="deOrder.$shipdate"
+										   min-date="getMinDate()" ng-required="true"
+										   current-text="今天" clear-text="清除" close-text="关闭"
+										   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+										   ng-focus="openDatePicker($event, deOrder.$dateOpen)"  ng-readonly="!deOrder.$editing">
+									<span class="input-group-btn">
+										<button type="button" class="btn btn-default btn-sm"
+												ng-click="openDatePicker($event, deOrder, '$shipdate')" ng-disabled="!deOrder.$editing">
+											<i class="fa fa-calendar fa-lg"></i>
+										</button>
+									</span>
+								</div>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>货物包装要求:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.goodspacking"  ng-readonly="!deOrder.$editing" ng-required="true"></span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>供应商交货方式:</em>
+								<span>
+                                    <input type="text" class="input01" ng-model="deOrder.deliverymethod"  ng-readonly="!deOrder.$editing" ng-required="true">
+                                </span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>我方提货方式:</em>
+								<span>
+                                    <select name="" class="select" ng-model="deOrder.pickupmethod" ng-disabled="!deOrder.$editing">
+                                        <option value="自提">自提</option>
+                                        <option value="委托第三方提货">委托第三方提货</option>
+                                        <option value="贵公司送货">贵公司送货</option>
+                                        <option value="其他">其他</option>
+                                    </select>
+                                </span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>我方付款方式:</em>
+								<span>
+                                	<input  ng-model="deOrder.paymentmethod" list="paymentmethod" class="select" style="width: 200px">
+	                                    <datalist id="paymentmethod">
+	                                    	 <option ng-repeat="me in methods | orderBy:'-weightid'" value="{{me.value}}">{{me.value}}</option>
+	                                    </datalist>
+                                </span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>我方提货时间:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.pickupdate" ng-readonly="!deOrder.$editing" ng-required="true"></span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>交易币别:</em>
+								<span>
+	                               	<select name="" class="select" ng-model="deOrder.currency" ng-init="deOrder.currency = 'USD'"
+											ng-disabled="!deOrder.$editing" ng-change="setPayComName()">
+	                                    <option value="USD">USD</option>
+	                                    <option value="RMB">RMB</option>
+	                                    <option value="HKD">HKD</option>
+	                                </select>
+                                </span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>代采企业:</em>
+								<span>
+                               		<select name="" class="select" ng-model="deOrder.deputyname" style="width: 200px" ng-change="change(deOrder.deputyname)" ng-disabled="!deOrder.$editing">
+                               		<option ng-value="'请选择代采企业'">请选择代采企业</option>
+                                    <option ng-repeat="deputyEn in deputyEnterprises" ng-selected="deputyEn.deputyenname == deOrder.deputyname">{{deputyEn.deputyenname}}</option>
+                               		</select>
+                               </span>
+							</div>
+						</li>
+					</ul>
+				</div>
+				<div class="com_title01"><span>下单明细(注:金额单位为{{deOrder.currency}})</span>
+					<a ng-click="uplodaByBatch()" ng-readonly="!deOrder.$editing">批量导入</a>
+					<span style="margin-left: 345px;">费率:<input ng-model="deOrder.rate" style="width: 80px; height: 30px; font-size: 14px; text-align: center;"> %</span>
+					<a ng-click="checkPrice(deOrder.rate)">更新订单单价</a>  </div>
+				<div class="purchase_xq clearfix">
+					<dl>
+						<dt>
+							<span class="wid01">序号</span>
+							<span class="wid02">产品名称</span>
+							<span>型号</span>
+							<span>产品规格</span>
+							<span>品牌</span>
+							<span>数量</span>
+							<span>单价</span>
+							<span>订单单价</span>
+							<span>采购总额</span>
+							<span>备注</span>
+							<span>操作</span>
+						</dt>
+						<dd ng-repeat="item in deOrder.deputyOrderItems">
+							<span class="wid01">{{$index+1}}</span>
+							<span class="wid02"><input type="text" class="text-center" ng-model="item.prodname" ng-required="true"></span>
+							<span><input type="text" class="text-center" ng-model="item.prodcode" ng-required="true"></span>
+							<span><input type="text" class="text-center" ng-model="item.prodspec" ng-required="true"></span>
+							<span><input type="text" class="text-center" ng-model="item.prodbrand" ng-required="true"></span>
+							<span><input type="text" class="text-center" ng-model="item.amount" ng-required="true" ng-change="totalPrice()"></span>
+							<span><input type="text" class="text-center" ng-model="item.unitprice" ng-init="item.unitprice=isUser?'-':item.unitprice" ng-required="true" ng-change="totalPrice()"></span>
+							<span><input type="text" class="text-center" ng-model="item.purcprice" ng-init="item.purcprice = isUser?'-':item.purcprice" ng-required="true" ng-change="totalPrice()"></span>
+							<span>{{item.unitprice * item.amount | number}}</span>
+							<span><input type="text" class="text-center" ng-model="item.remark"></span>
+							<span><button ng-click="add($index)" style="color: #1f4fb2" ng-disabled="deOrder.entrystatus == '已提交'">添加</button>
+                            	  <button ng-click="del($index, item.id)" style="color: #d32526" ng-if="item.id != null" ng-disabled="deOrder.entrystatus == '已提交'"> 删除</button>
+                            	  <button ng-click="delItem($index)" style="color: #d32526" ng-if="item.id == null" ng-disabled="deOrder.entrystatus == '已提交'"> 删除</button>
+                            </span>
+						</dd>
+					</dl>
+				</div>
+				<!--采购订单-->
+				<div class="com_title01"><span>采购订单</span></div>
+				<div class="purchase_form01 clearfix">
+					<ul>
+						<li>
+							<div class="fl">
+								<em>总价款({{deOrder.currency}}):</em>
+								<span ng-if="!isUser">{{deOrder.totalamount| number}}</span><span ng-if="isUser">-</span>
+							</div>
+							<div class="fr">
+								<em>订单总价款({{deOrder.currency}}):</em>
+								<span ng-if="!isUser">{{deOrder.orderamount| number}}</span><span ng-if="isUser">-</span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>订单编号:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.salecode" ng-required="true" ng-change="checkOrder(deOrder.salecode, deOrder.deputyuu)"></span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>我方付款提货时间:</em>
+								<div class="input-group">
+									<input ng-model="deOrder.paydeldate" type="text" class="form-control"
+										   placeholder="点击选择时间" datepicker-popup="yyyy-MM-dd" is-open="deOrder.$paydeldate"
+										   min-date="getMinDate()" ng-required="true"
+										   current-text="今天" clear-text="清除" close-text="关闭"
+										   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+										   ng-focus="openDatePicker($event, deOrder.$dateOpen)" ng-readonly="!deOrder.$editing">
+									<span class="input-group-btn">
+										<button type="button" class="btn btn-default btn-sm"
+												ng-click="openDatePicker($event, deOrder, '$paydeldate')" ng-disabled="!deOrder.$editing">
+											<i class="fa fa-calendar fa-lg"></i>
+										</button>
+									</span>
+								</div>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em>我方付款金额({{deOrder.currency}}):</em>
+								<span ng-if="!isUser">{{deOrder.totalpayament| number}}</span><span ng-if="isUser">-</span>
+							</div>
+							<div class="fr">
+								<em>我方付款日期:</em>
+								<span ng-bind="deOrder.paymentdate"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>风险承担方式:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.riskmethod" readonly ng-required="true"></span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>运、税费承担方式:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.taxpaymentmethod" readonly ng-required="true"></span>
+							</div>
+						</li>
+					</ul>
+				</div>
+				<!--付款确认书-->
+				<div class="com_title01"><span>付款确认书</span></div>
+				<div class="purchase_form01 clearfix">
+					<ul>
+						<li>
+							<div class="fl wid100">
+								<em><b>*</b>终端供应商地址:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.tervendaddress" ng-readonly="!deOrder.$editing" ng-required="true"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl wid100">
+								<em><b>*</b>公司全称(英文):</em>
+								<span><input type="text" class="input01" ng-model="deOrder.companyname" ng-readonly="!deOrder.$editing" ng-required="true"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>要求付汇日期:</em>
+								<div class="input-group">
+									<input ng-model="deOrder.requirepaydate" type="text" class="form-control"
+										   placeholder="点击选择时间" datepicker-popup="yyyy-MM-dd" is-open="deOrder.$requirepaydate"
+										   min-date="getMinDate()" ng-required="true"
+										   current-text="今天" clear-text="清除" close-text="关闭"
+										   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+										   ng-focus="openDatePicker($event, deOrder.$dateOpen)"  ng-readonly="!deOrder.$editing">
+									<span class="input-group-btn">
+										<button type="button" class="btn btn-default btn-sm"
+												ng-click="openDatePicker($event, deOrder, '$requirepaydate')" ng-disabled="!deOrder.$editing">
+											<i class="fa fa-calendar fa-lg"></i>
+										</button>
+									</span>
+								</div>
+							</div>
+							<div class="fr">
+								<em>实际付汇日期:</em>
+								<span ng-bind="deOrder.actualpaydate| date: 'yyyy-MM-dd'"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em>付款金额({{deOrder.currency}}):</em>
+								<span ng-if="!isUser">{{deOrder.usdpayment| number}}</span><span ng-if="isUser">-</span>
+							</div>
+							<div class="fr">
+								<em>实际付款金额({{deOrder.currency}}):</em>
+								<span ng-if="!isUser" ng-bind="deOrder.actusdpayment | number"></span><span ng-if="isUser">-</span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>银行名称(英文):</em>
+								<span><input type="text" class="input01" ng-model="deOrder.bankname"  ng-readonly="!deOrder.$editing" ng-required="true"></span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>银行账号:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.bankaccount"  ng-readonly="!deOrder.$editing" ng-required="true"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl wid100">
+								<em><b>*</b>银行地址(英文):</em>
+								<span><input type="text" class="input01" ng-model="deOrder.bankaddress"  ng-readonly="!deOrder.$editing" ng-required="true"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>银行代码:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.bankcode"  ng-readonly="!deOrder.$editing" ng-required="true"></span>
+							</div>
+							<div class="fr">
+								<em>其它相关资料:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.otherdata"  ng-readonly="!deOrder.$editing"></span>
+							</div>
+						</li>
+					</ul>
+				</div>
+				<!--买卖合同-->
+				<div class="com_title01"><span>买卖合同</span></div>
+				<div class="purchase_form01 clearfix">
+					<ul>
+						<li>
+							<div class="fl">
+								<em><b>*</b>合同编号: </em>
+								<span><input type="text" class="input01" ng-model="deOrder.salepocode" ng-readonly="!deOrder.$editing" ng-required="true"></span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>供应商方法定代表人: </em>
+								<span><input type="text" class="input01" ng-model="deOrder.legalrepresent"  ng-readonly="!deOrder.$editing" ng-required="true"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>付款公司: </em>
+								<span ng-if="deOrder.currency !='RMB'"><input type="text" class="input01" ng-model="deOrder.paycomname" ng-click="dbfindPayCompany(deOrder.deputyuu)" ng-required="true" ng-readonly="!deOrder.$editing" ></span>
+								<span ng-if="deOrder.currency =='RMB' && deOrder.deputyuu == 10044118"><input type="text" class="input01" ng-model="deOrder.paycomname" readonly></span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>付款公司地址:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.paycomaddress" ng-readonly="!deOrder.$editing" ng-required="true"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>供应商方法人电话: </em>
+								<span><input type="text" class="input01" ng-model="deOrder.enfax"  ng-readonly="!deOrder.$editing" ng-required="true"></span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>货款支付时间:</em>
+								<div class="input-group">
+									<input ng-model="deOrder.paydate" type="text" class="form-control"
+										   placeholder="点击选择时间" datepicker-popup="yyyy-MM-dd" is-open="deOrder.$paydate"
+										   min-date="getMinDate()" ng-required="true"
+										   current-text="今天" clear-text="清除" close-text="关闭"
+										   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+										   ng-focus="openDatePicker($event, deOrder.$dateOpen)"  ng-readonly="!deOrder.$editing">
+									<span class="input-group-btn">
+										<button type="button" class="btn btn-default btn-sm"
+												ng-click="openDatePicker($event, deOrder, '$paydate')" ng-disabled="!deOrder.$editing">
+											<i class="fa fa-calendar fa-lg"></i>
+										</button>
+									</span>
+								</div>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>货款支付方式:</em>
+								<span>
+                                    <input ng-model="deOrder.paymethod" list="paymethod" class="select" ng-disabled="!deOrder.$editing">
+                                	<datalist id="paymethod">
+                                	 	<option value="月结30天">月结30天</option>
+                                	 	<option value="全款T/T">全款T/T</option>
+                                	</datalist>
+                                </span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>交货时间:</em>
+								<div class="input-group">
+									<input ng-model="deOrder.deliverydate" type="text" class="form-control"
+										   placeholder="点击选择时间" datepicker-popup="yyyy-MM-dd" is-open="deOrder.$deliverydate"
+										   min-date="getMinDate()" ng-required="true"
+										   current-text="今天" clear-text="清除" close-text="关闭"
+										   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+										   ng-focus="openDatePicker($event, deOrder.$dateOpen)"  ng-readonly="!deOrder.$editing">
+									<span class="input-group-btn">
+										<button type="button" class="btn btn-default btn-sm"
+												ng-click="openDatePicker($event, deOrder, '$deliverydate')" ng-disabled="!deOrder.$editing">
+											<i class="fa fa-calendar fa-lg"></i>
+										</button>
+									</span>
+								</div>
+							</div>
+							<div class="fr"></div>
+						</li>
+					</ul>
+				</div>
+				<div class="save" >
+					<span ng-if="deOrder.entrystatus == '保存'" class="btn01"><button ng-click="save('已提交')" ng-disabled="isSave">提交</button></span>
+					<span ng-if="deOrder.entrystatus == '保存'" class="btn02"><button ng-click="save('保存')" ng-disabled="isSave">保存</button></span>
+					<span ng-if="deOrder.entrystatus == '保存'" class="btn03"><button ng-click="clear(deOrder.id)">删除</button></span>
+				</div>
+			</div>
+		</form>
+	</div>
+</div>
+</body>
+</html>

+ 564 - 0
src/main/webapp/resources/view/usercenter/b2b/order/deputyOrder_new.html

@@ -0,0 +1,564 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+	<meta charset="UTF-8"/>
+	<title>代采订单02</title>
+	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
+	<meta name="Keywords" content=""/>
+	<meta name="Description" content=""/>
+	<link rel="stylesheet" href="static/css/deputyOrder/base.css"/>
+	<link rel="stylesheet" href="static/css/deputyOrder/order.css"/>
+</head>
+<body>
+<style>
+	/* 日期选择器 */
+	.date-picker {
+		padding-top: 10px;
+	}
+	.date-picker input {
+		border-radius: 0;
+		border: 1px solid #5078cb;
+		border-right: none;
+		font-size: 12px;
+	}
+	.date-picker span .btn-open {
+		color: #fff;
+		background-color: #5078cb;
+		border-radius: 0;
+		border: 1px solid #5078cb;
+		border-left: none;
+	}
+
+	/* 修改本页内btn的样式 及datepicker中的btn-success的样式 */
+	.date-picker .btn {
+		border-radius: 0;
+	}
+
+	.date-picker .btn-success {
+		background-color: #3f84f6;
+	}
+	.date-picker ul {
+		border-radius: 0;
+	}
+	.date-picker ul div:focus {
+		outline: none;
+		border-radius: 0;
+		border: none;
+	}
+	.input-group-addon {
+		background-color: inherit;
+		border: 1px solid #e1e1e1;
+		color: #888 !important;
+	}
+	.purchase_form01 ul li .dropdown-menu {
+		width: 257px;
+		height: 300px;
+	}
+	.purchase_form01 ul li .dropdown-menu span{
+		width: 14px;
+		height: 16px;
+		line-height: 20px;
+	}
+	.purchase_form01 ul li.ng-scope{
+		margin-top: 210px
+	}
+	.purchase_form01 ul li.ng-scope span{
+		width: 120px;
+		height: 50px;
+	}
+	.purchase_form01 ul li .input-group .input-group-btn .btn-sm{
+		width: 37px;
+		height: 34px;
+		z-index: 3;
+		position: absolute;
+		background: #bfbfbf;
+		border: 1px solid #bfbfbf;
+	}
+	.purchase_form01 ul li .input-group .input-group-btn .btn-sm:focus{
+		background: #5078cb;
+	}
+	.purchase_form01 ul li .input-group .form-control {
+		width:146px;
+		background: #fff;
+		border: #bfbfbf 1px solid;
+	}
+	.purchase_form01 ul li .input-group .form-control:focus{
+		border: #5078cb 1px solid;
+	}
+	.purchase_form01 ul li .dropdown-menu li{
+		line-height: 30px;
+	}
+	.purchase_form01 ul li .dropdown-menu button{
+		position: relative;
+		widhth: 46px;
+		height: 30px;
+		border-color: #fff;
+	}
+	.purchase_form01 ul li .dropdown-menu div{
+		width: 255px;
+		height: 220px;
+	}
+
+	.purchase_form01 ul li .dropdown-menu span i{
+		color: white;
+	}
+
+	.purchase_xq dd input{
+		border: 1px solid #ccc;
+		height: 35px;
+		width: 80px;
+		font-size: 14px;
+	}
+
+	.purchase_xq dd input:focus {
+		border-bottom: 1px solid blue;
+	}
+
+	.purchase .input-group .form-control{
+		border-radius: 0px;
+		border: 1px solid #5078cb;
+	}
+
+	.purchase .input-group .input-group-btn i{
+		color: #fff;
+	}
+
+	.purchase .input-group .input-group-btn {
+		width: 37px;
+		height: 34px;
+		position: absolute;
+		right: 74px;
+	}
+	.purchase_xq dl span.wid01{
+		width: 4% !important;
+	}
+	.purchase_xq dl span.wid02{
+		width: 13% !important;
+	}
+	.purchase_xq dl span{
+		width: 9.2% !important;
+	}
+	.purchase_xq dd input{
+		width: 92%;
+	}
+	.purchase_form01 b {
+		color: red;
+	}
+	.com_title01 span{
+		margin-left: 37px;
+	}
+</style>
+<div class="warp">
+	<div class="purchase fr block user_right">
+		<form  name="order" autocomplete="off">
+			<!--<div class="com_title">服务>采购模块><font>>代采订单</font></div>-->
+			<div class="com_head"><span>代采订单</span></div>
+			<div class="purchase_form">
+				<!--基本信息-->
+				<div class="com_title01"><span>基本信息</span></div>
+				<div class="purchase_form01 clearfix">
+					<ul>
+						<li>
+							<div class="fl">
+								<em>流水号:</em>
+								<span ng-bind="deOrder.code"></span>
+							</div>
+							<div class="fr">
+								<em>制单日期:</em>
+								<span class="has_time" ng-bind="deOrder.entrydate| date: 'yyyy-MM-dd'"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em>状态:</em>
+								<span ng-bind="deOrder.status"></span>
+							</div>
+							<div class="fr">
+								<em>业务状态:</em>
+								<span ng-bind="deOrder.prostatus"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>主协议签订日期:</em>
+								<div class="input-group">
+									<input ng-model="deOrder.madealdate" type="text" class="form-control"
+										   placeholder="点击选择时间" datepicker-popup="yyyy-MM-dd" is-open="deOrder.$madealdate"
+										   min-date="getMinDate()" ng-required="true"
+										   current-text="今天" clear-text="清除" close-text="关闭"
+										   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+										   ng-focus="openDatePicker($event, deOrder.madealdate.$dateOpen)" readonly>
+									<span class="input-group-btn">
+										<button type="button" class="btn btn-default btn-sm"
+												ng-click="openDatePicker($event, deOrder, '$madealdate')">
+											<i class="fa fa-calendar fa-lg"></i>
+										</button>
+									</span>
+								</div>
+							</div>
+							<div class="fr">
+								<em><b>*</b>主协议编号:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.madealcode" ng-required="true"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>终端供应商名称:</em>
+								<span><!-- <input type="text" class="input01" ng-model="deOrder.tervendor"> -->
+                                	 <input  ng-model="deOrder.tervendor" list="hisvendors" class="select" style="width: 200px" ng-change="getHisKeyword(deOrder.tervendor)">
+	                                    <datalist id="hisvendors">
+	                                    	 <option ng-repeat="vendor in hisvendors" value="{{vendor.vendorname}}">{{vendor.vendorname}}</option>
+	                                    </datalist>
+                                </span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>电话:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.vendtel" ng-required="true"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>联系人:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.venduser" ng-required="true"></span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>供应商发货时间:</em>
+								<div class="input-group">
+									<input ng-model="deOrder.shipdate" type="text" class="form-control"
+										   placeholder="点击选择时间" datepicker-popup="yyyy-MM-dd" is-open="deOrder.$shipdate"
+										   min-date="getMinDate()" ng-required="true"
+										   current-text="今天" clear-text="清除" close-text="关闭"
+										   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+										   ng-focus="openDatePicker($event, deOrder.$dateOpen)" readonly>
+									<span class="input-group-btn">
+										<button type="button" class="btn btn-default btn-sm"
+												ng-click="openDatePicker($event, deOrder, '$shipdate')">
+											<i class="fa fa-calendar fa-lg"></i>
+										</button>
+									</span>
+								</div>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>货物包装要求:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.goodspacking" ng-required="true"></span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>供应商交货方式:</em>
+								<span>
+                                   <input type="text" class="input01" ng-model="deOrder.deliverymethod" ng-required="true">
+                                </span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>我方提货方式:</em>
+								<span>
+                                    <select name="" class="select" ng-model="deOrder.pickupmethod" ng-init="deOrder.pickupmethod = '自提'">
+                                        <option value="自提">自提</option>
+                                        <option value="委托第三方提货">委托第三方提货</option>
+                                        <option value="贵公司送货">贵公司送货</option>
+                                        <option value="其他">其他</option>
+                                    </select>
+                                </span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>我方付款方式:</em>
+								<span>
+                                    <input  ng-model="deOrder.paymentmethod" list="paymentmethod" class="select" style="width: 200px">
+	                                    <datalist id="paymentmethod">
+	                                    	 <option ng-repeat="me in methods | orderBy:'-weightid'" value="{{me.value}}">{{me.value}}</option>
+	                                    </datalist>
+                                </span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>我方提货时间:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.pickupdate" ng-required="true"></span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>交易币别:</em>
+								<span>
+	                               	<select name="" class="select" ng-model="deOrder.currency" ng-init="deOrder.currency = 'USD'" ng-change="setPayComName()">
+	                                    <option value="USD">USD</option>
+	                                    <option value="RMB">RMB</option>
+	                                    <option value="HKD">HKD</option>
+	                                </select>
+                                </span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>代采企业:</em>
+								<span>
+                               		<select name="" class="select" ng-model="deOrder.deputyname" style="width: 200px" ng-change="change(deOrder.deputyname)"
+											ng-options="deputyEn.deputyenname as deputyEn.deputyenname for deputyEn in deputyEnterprises">
+                               		<option value="">请选择代采企业</option>
+                               		</select>
+                               </span>
+							</div>
+						</li>
+					</ul>
+				</div>
+				<div class="com_title01"><span>下单明细(注:金额单位为{{deOrder.currency}})</span><a ng-click="uplodaByBatch()">批量导入</a>
+					<span style="margin-left: 345px;">费率:<input ng-model="deOrder.rate" style="width: 80px; height: 30px; font-size: 14px; text-align: center;"> %</span>
+					<a ng-click="checkPrice(deOrder.rate)">更新订单单价</a>
+				</div>
+				<div class="purchase_xq clearfix">
+					<dl>
+						<dt>
+							<span class="wid01">序号</span>
+							<span class="wid02">产品名称</span>
+							<span>型号</span>
+							<span>产品规格</span>
+							<span>品牌</span>
+							<span>数量</span>
+							<span>单价</span>
+							<span>订单单价</span>
+							<span>采购总额</span>
+							<span>备注</span>
+							<span>操作</span>
+						</dt>
+						<dd ng-repeat="item in deOrder.deputyOrderItems">
+							<span class="wid01">{{$index+1}}</span>
+							<span class="wid02"><input type="text" class="text-center" ng-model="item.prodname" ng-required="true"></span>
+							<span><input type="text" class="text-center" ng-model="item.prodcode" ng-required="true"></span>
+							<span><input type="text" class="text-center" ng-model="item.prodspec" ng-required="true"></span>
+							<span><input type="text" class="text-center" ng-model="item.prodbrand" ng-required="true"></span>
+							<span><input type="text" class="text-center" ng-model="item.amount" ng-required="true" ng-change="totalPrice()"></span>
+							<span><input type="text" class="text-center" ng-model="item.unitprice" ng-required="true" ng-change="totalPrice()"></span>
+							<span><input type="text" class="text-center" ng-model="item.purcprice" ng-required="true" ng-change="totalPrice()"></span>
+							<span>{{item.unitprice * item.amount | number: 2}}</span>
+							<span><input type="text" class="text-center" ng-model="item.remark"></span>
+							<span><a ng-click="add($index)" style="color: #1f4fb2">添加</a><a ng-click="del($index)" style="color: #d32526"> 删除</a></span>
+						</dd>
+					</dl>
+				</div>
+				<!--采购订单-->
+				<div class="com_title01"><span>采购订单</span></div>
+				<div class="purchase_form01 clearfix">
+					<ul>
+						<li>
+							<div class="fl">
+								<em>总价款({{deOrder.currency}}):</em>
+								<span >{{deOrder.totalamount| number:6}}</span>
+							</div>
+							<div class="fr">
+								<em>订单总价款({{deOrder.currency}}):</em>
+								<span >{{deOrder.orderamount| number:6 }}</span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>订单编号:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.salecode" ng-required="true" ng-change="checkOrder(deOrder.salecode, deOrder.deputyuu)"></span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>我方付款提货时间:</em>
+								<div class="input-group">
+									<input ng-model="deOrder.paydeldate" type="text" class="form-control"
+										   placeholder="点击选择时间" datepicker-popup="yyyy-MM-dd" is-open="deOrder.$paydeldate"
+										   min-date="getMinDate()" ng-required="true"
+										   current-text="今天" clear-text="清除" close-text="关闭"
+										   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+										   ng-focus="openDatePicker($event, deOrder.$dateOpen)" readonly>
+									<span class="input-group-btn">
+										<button type="button" class="btn btn-default btn-sm"
+												ng-click="openDatePicker($event, deOrder, '$paydeldate')">
+											<i class="fa fa-calendar fa-lg"></i>
+										</button>
+									</span>
+								</div>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em>我方付款金额({{deOrder.currency}}):</em>
+								<span >{{deOrder.totalpayament| number: 6 }}</span>
+							</div>
+							<div class="fr">
+								<em>我方付款日期:</em>
+								<span ng-bind="deOrder.paymentdate"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>风险承担方式:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.riskmethod" ng-required="true" readonly></span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>运、税费承担方式:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.taxpaymentmethod" ng-required="true" readonly></span>
+							</div>
+						</li>
+					</ul>
+				</div>
+				<!--付款确认书-->
+				<div class="com_title01"><span>付款确认书</span></div>
+				<div class="purchase_form01 clearfix">
+					<ul>
+						<li>
+							<div class="fl wid100">
+								<em><b>*</b>终端供应商地址:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.tervendaddress" ng-required="true"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl wid100">
+								<em><b>*</b>公司全称(英文):</em>
+								<span><input type="text" class="input01" ng-model="deOrder.companyname" ng-required="true"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>要求付汇日期:</em>
+								<div class="input-group">
+									<input ng-model="deOrder.requirepaydate" type="text" class="form-control"
+										   placeholder="点击选择时间" datepicker-popup="yyyy-MM-dd" is-open="deOrder.$requirepaydate"
+										   min-date="getMinDate()" ng-required="true"
+										   current-text="今天" clear-text="清除" close-text="关闭"
+										   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+										   ng-focus="openDatePicker($event, deOrder.$dateOpen)" readonly>
+									<span class="input-group-btn">
+										<button type="button" class="btn btn-default btn-sm"
+												ng-click="openDatePicker($event, deOrder, '$requirepaydate')">
+											<i class="fa fa-calendar fa-lg"></i>
+										</button>
+									</span>
+								</div>
+							</div>
+							<div class="fr">
+								<em>实际付汇日期:</em>
+								<span ng-bind="deOrder.actualpaydate"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em>付款金额({{deOrder.currency}}):</em>
+								<span>{{deOrder.usdpayment| number: 6}}</span>
+							</div>
+							<div class="fr">
+								<em>实际付款金额({{deOrder.currency}}):</em>
+								<span ng-bind="deOrder.actusdpayment| number: 6"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>银行名称(英文):</em>
+								<span><input type="text" class="input01" ng-model="deOrder.bankname" ng-required="true"></span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>银行账号:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.bankaccount" ng-required="true"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl wid100">
+								<em><b>*</b>银行地址(英文):</em>
+								<span><input type="text" class="input01" ng-model="deOrder.bankaddress" ng-required="true"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>银行代码:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.bankcode" ng-required="true"></span>
+							</div>
+							<div class="fr">
+								<em>其它相关资料:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.otherdata"></span>
+							</div>
+						</li>
+					</ul>
+				</div>
+				<!--买卖合同-->
+				<div class="com_title01"><span>买卖合同</span></div>
+				<div class="purchase_form01 clearfix">
+					<ul>
+						<li>
+							<div class="fl">
+								<em><b>*</b>合同编号: </em>
+								<span><input type="text" class="input01" ng-model="deOrder.salepocode" ng-required="true"></span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>供应商方法定代表人: </em>
+								<span><input type="text" class="input01" ng-model="deOrder.legalrepresent" ng-required="true"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>付款公司: </em>
+								<span ng-if="deOrder.currency !='RMB'"><input type="text" class="input01" ng-model="deOrder.paycomname" ng-click="dbfindPayCompany(deOrder.deputyuu)"></span>
+								<span ng-if="deOrder.currency =='RMB' && deOrder.deputyuu == 10044118"><input type="text" class="input01" ng-model="deOrder.paycomname" readonly></span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>付款公司地址:</em>
+								<span><input type="text" class="input01" ng-model="deOrder.paycomaddress" ng-required="true"></span>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>供应商方法人电话: </em>
+								<span><input type="text" class="input01" ng-model="deOrder.enfax" ng-required="true"></span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>货款支付时间:</em>
+								<div class="input-group">
+									<input ng-model="deOrder.paydate" type="text" class="form-control"
+										   placeholder="点击选择时间" datepicker-popup="yyyy-MM-dd" is-open="deOrder.$paydate"
+										   min-date="getMinDate()" ng-required="true"
+										   current-text="今天" clear-text="清除" close-text="关闭"
+										   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+										   ng-focus="openDatePicker($event, deOrder.$dateOpen)" readonly>
+									<span class="input-group-btn">
+										<button type="button" class="btn btn-default btn-sm"
+												ng-click="openDatePicker($event, deOrder, '$paydate')">
+											<i class="fa fa-calendar fa-lg"></i>
+										</button>
+									</span>
+								</div>
+							</div>
+						</li>
+						<li>
+							<div class="fl">
+								<em><b>*</b>货款支付方式:</em>
+								<span>
+                                	<input ng-model="deOrder.paymethod" list="paymethod" class="select">
+                                	<datalist id="paymethod">
+                                	 	<option value="月结30天">月结30天</option>
+                                	 	<option value="全款T/T">全款T/T</option>
+                                	</datalist>
+                                </span>
+							</div>
+							<div class="fr">
+								<em><b>*</b>交货时间:</em>
+								<div class="input-group">
+									<input ng-model="deOrder.deliverydate" type="text" class="form-control"
+										   placeholder="点击选择时间" datepicker-popup="yyyy-MM-dd" is-open="deOrder.$deliverydate"
+										   min-date="getMinDate()" ng-required="true"
+										   current-text="今天" clear-text="清除" close-text="关闭"
+										   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+										   ng-focus="openDatePicker($event, deOrder.$dateOpen)" readonly>
+									<span class="input-group-btn">
+										<button type="button" class="btn btn-default btn-sm"
+												ng-click="openDatePicker($event, deOrder, '$deliverydate')">
+											<i class="fa fa-calendar fa-lg"></i>
+										</button>
+									</span>
+								</div>
+							</div>
+							<div class="fr"></div>
+						</li>
+					</ul>
+				</div>
+				<div class="save">
+					<button ng-click="save('保存')">保存</button>
+					<button ng-click="save('已提交')">提交</button>
+				</div>
+			</div>
+		</form>
+	</div>
+</div>
+</body>
+</html>

+ 68 - 0
src/main/webapp/resources/view/usercenter/b2b/order/deputyorders_log.html

@@ -0,0 +1,68 @@
+<style>
+	.log-table .header th{
+		text-align: center;
+	}
+	.log-table tbody tr{
+		height: 60px;
+	}
+	.log-table tbody tr td{
+		border-bottom: 1px solid #e8e8e8;
+		font-size: 14px;
+		vertical-align: middle;
+	}
+	.log-table tbody tr td a{
+		color: #3f84f6;
+	}
+	.log-table.table>thead>tr>th{
+		border-bottom: none;
+		font-size: 14px;
+	}
+	.pub-com_head, .com_head {
+		width: 100%;
+		height: 35px;
+		line-height: 35px;
+		background: #5078cb;
+		border-radius: 5px 5px 0 0;
+	}
+	.pub-com_head span, .com_head span {
+		margin-left: 10px;
+		color: #fff;
+		font-size: 14px;
+		font-weight: bold;
+	}
+	.base-info {
+		box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+		-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+		-o-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+		-moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+		border-radius: 5px;
+		background: #fff;
+		width: 1026px;
+	}
+</style>
+<div class="pane base-info fr block user_right" style="height: 450px;">
+	<div class="pub-com_head">
+		<span>代采订单错误日志</span>
+	</div>
+	<div class="pane-body">
+		<table class="log-table block table"
+			   ng-table="tableParams">
+			<thead>
+			<tr class="header">
+				<th width="130">时间</th>
+				<th width="130">采购单号</th>
+				<th width="80">提示</th>
+				<th width="120">详情</th>
+			</tr>
+			</thead>
+			<tbody  ng-repeat="log in $data">
+			<tr>
+				<td class="text-center" ng-bind="::log.date | date:'yyyy-MM-dd HH:mm'"></td>
+				<td class="text-center" ng-bind="::log.code"></td>
+				<td class="text-center" ng-bind="::log.message"></td>
+				<td class="text-center"><a ui-sref="purc.deputydetail({id:log.sourceid})">查看详情>></a></td>
+			</tr>
+			</tbody>
+		</table>
+	</div>
+</div>

+ 1 - 1
src/main/webapp/resources/view/usercenter/b2b/order/outorder.html

@@ -247,7 +247,7 @@
 					<span><img src="static/img/user/images/shop_home.png"><span ng-bind="::order.enterprise.enName"></span></span>
 					<span><img src="static/img/user/images/shop_home.png"><span ng-bind="::order.enterprise.enName"></span></span>
 					<span>订单号:
 					<span>订单号:
 							<a class="text-num order-detail" ng-bind="::order.code" title="查看详情"
 							<a class="text-num order-detail" ng-bind="::order.code" title="查看详情"
-							   ui-sref="purc.outorder_detail({id:order.id})" target="_self"></a>
+							   ui-sref="purc_outorder_detail({id:order.id})" target="_self"></a>
 						</span>
 						</span>
 				</div>
 				</div>
 			</td>
 			</td>

+ 317 - 0
src/main/webapp/resources/view/usercenter/b2b/order/outorder_detail.html

@@ -0,0 +1,317 @@
+<style>
+	.base-info{
+		box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+		-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+		-o-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+		-moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+		border-radius: 5px;
+		background: #fff;
+		width: 1026px;
+	}
+	.pub-com_head span.fr {
+		margin-right: 20px;
+		color: #fff;
+		float: right;
+	}
+	.pub-com_head span.fr em {
+		margin-right: 50px;
+		font-size: 14px;
+		font-style: inherit;
+		color:#fff;
+	}
+	#order-detail-list {
+		font-size: 14px;
+		width: 1026px;
+	}
+	.pub-com_head, .com_head {
+		width: 100%;
+		height: 35px;
+		line-height: 35px;
+		background: #5078cb;
+		border-radius: 5px 5px 0 0;
+	}
+	.pub-com_head span, .com_head span {
+		margin-left: 10px;
+		color: #fff;
+		font-size: 14px;
+		font-weight: bold;
+	}
+	.pub-com_head .p-right {
+		float: right;
+	}
+	.com_title01, .title-div {
+		border-bottom: 1px dashed #3f84f6 !important;
+	}
+	.f14 {
+		font-size: 14px !important;
+	}
+	#order-detail-list .row {
+		width: 96%;
+		margin: 0 auto;
+		line-height: 30px;
+	}
+	#order-detail-list .title {
+		font-weight: inherit;
+	}
+	.base-info .title {
+		float: left;
+		width: 78px;
+		color: #999;
+		font-weight: bold;
+	}
+	#order-detail-list .content {
+		color: #323232;
+	}
+	.base-info .content {
+		float: left;
+		white-space: nowrap;
+	}
+	.bid-content>div {
+		background-color: #fff;
+	}
+	.title-div {
+		font-size: 14px;
+		font-weight: 600;
+		padding-left: 20px;
+		height: 50px;
+		padding-top: 11px;
+	}
+	.text-success {
+		color: #5078cb !important;
+	}
+	table thead th {
+		font-size: 14px;
+		color: #333;
+	}
+	table tbody td div{
+		font-size: 14px;
+		margin-bottom: 8px;
+	}
+</style>
+<link rel="stylesheet" href="static/css/b2bPublic.css">
+<div class="pane base-info fr" id="order-detail-list">
+	<div class="pub-com_head">
+		<span>委外加工单</span>
+		<div class="p-right">
+			<!-- <a ng-click="print(order)" class="pull-right text-simple"><i
+			class="fa fa-print fa-fw"></i>打印</a> -->
+		</div>
+	</div>
+	<div class="pane-body">
+		<div class="title-div" style="border-bottom: 1px dashed #3f84f6;">
+			<span class="f14">委外资料</span>&nbsp;
+		</div>
+		<div class="row row-sm item">
+			<div class="col-xs-3">
+				<span class="title">委外单号</span>
+				<div class="content" ng-bind="::order.code"></div>
+			</div>
+			<div class="col-xs-3">
+				<span class="title">日期</span>
+				<div class="content" ng-bind="::order.date | date:'yyyy-MM-dd'"></div>
+			</div>
+			<!-- 			<div class="col-xs-6">
+                            <span class="title">客户</span>
+                            <div class="content" ng-bind="::order.enterprise.enName"></div>
+                        </div> -->
+		</div>
+		<div class="row row-sm item">
+			<div class="col-xs-3">
+				<span class="title">委外类型</span>
+				<div class="content" ng-bind="::order.type"></div>
+			</div>
+			<div class="col-xs-3">
+				<span class="title">录单人</span>
+				<div class="content" ng-bind="::order.recorder"></div>
+			</div>
+			<!-- 	<div class="col-xs-3">
+                    <span class="title">审批人</span>
+                    <div class="content" ng-bind="::order.auditor"></div>
+                </div> -->
+			<div class="col-xs-3">
+				<span class="title">委外员</span>
+				<div class="content" ng-bind="::order.user.userName"></div>
+			</div>
+		</div>
+		<div class="title-div" style="border-bottom: 1px dashed #3f84f6;">
+			<span class="f14">交易信息</span>&nbsp;
+		</div>
+		<div class="row row-sm item">
+			<div class="col-xs-3">
+				<span class="title">币别</span>
+				<div class="content" ng-bind="::order.currency"></div>
+			</div>
+			<div class="col-xs-3">
+				<span class="title">汇率</span>
+				<div class="content" ng-bind="::order.rate"></div>
+			</div>
+			<div class="col-xs-6">
+				<span class="title">付款方式</span>
+				<div class="content" ng-bind="::order.payments"></div>
+			</div>
+		</div>
+		<div class="row row-sm item">
+			<div class="col-xs-3">
+				<span class="title">金额</span>
+				<div ng-if="!isUser" class="content" ng-bind="::order.total"></div><div ng-if="isUser">-</div>
+			</div>
+			<div class="col-xs-9">
+				<span class="title">交货地址</span>
+				<div class="content" ng-bind="::order.shipAddress "></div>
+				<div class="content" ng-if="!order.shipAddress ">无</div>
+			</div>
+		</div>
+		<div class="title-div" style="border-bottom: 1px dashed #3f84f6;">
+			<span class="f14">物料清单</span>&nbsp;
+		</div>
+		<div class="block">
+			<table class="block table table-default table-striped table-hover">
+				<thead>
+				<tr class="header">
+					<!--<th width="50">序号</th>-->
+					<th>物料</th>
+					<th width="80">单价</th>
+					<th width="100">数量</th>
+					<th width="120">交货日期</th>
+					<th width="180">回复状态</th>
+					<th width="100"></th>
+				</tr>
+				</thead>
+				<tbody>
+				<tr>
+					<!--<td class="text-center text-num text-bold f-16 text-success">
+                        <span >{{$index+1}}</span>
+                    </td>-->
+					<td>
+						<div class="text-num text-bold">
+							物料型号:<span ng-bind="::order.product.code"></span>
+						</div>
+						<div>
+							物料名称:<span ng-bind="::order.product.title"></span>
+						</div>
+						<div class="text-muted">
+							物料规格:<span ng-bind="::order.product.spec"></span>
+						</div>
+					</td>
+					<td class="text-center">
+						<div ng-if="!isUser" class="text-num" ng-bind="::order.price | number:6"></div>
+						<div class="text-muted">税率:{{order.taxrate || 0}}%</div>
+					</td>
+					<td class="text-center">
+						<div class="text-num" ng-bind="::order.qty"></div>
+						<div class="text-muted" ng-bind="::order.product.unit"></div>
+						<div style="margin: 0 auto" ng-if="order.$editing">
+							<input type="text" ng-model="order.reply.qty" min="0" max="{{order.qty}}"
+								   ng-init="order.reply.qty=order.qty-order.replyQty"
+								   class="form-control input-xs" placeholder="0~{{order.qty-order.replyQty}}">
+						</div>
+					</td>
+					<td class="text-center">
+						<div class="text-num"
+							 ng-bind="::order.delivery | date:'yyyy-MM-dd'"></div> <br>
+						<div style="margin: 0 auto"
+							 class="input-group input-group-xs input-trigger"
+							 ng-if="order.$editing">
+							<input type="text" ng-model="order.reply.delivery"
+								   ng-init="order.reply.delivery=parseDate(order.delivery)"
+								   class="form-control" placeholder="回复交期"
+								   datepicker-popup="yyyy-MM-dd" is-open="order.$opened"
+								   min-date="order.date" ng-required="true" current-text="今天"
+								   clear-text="清除" close-text="关闭"
+								   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+								   ng-focus="openDatePicker($event, order, '$opened')"> <span
+								class="input-group-btn">
+									<button type="button" class="btn btn-default"
+											ng-click="openDatePicker($event, order, '$opened')">
+										<i class="fa fa-calendar"></i>
+									</button>
+								</span>
+						</div>
+					</td>
+					<td>
+						<div ng-show="!order.$editing">
+							<div ng-if="!order.replyQty" class="text-muted text-center">未回复</div>
+							<div ng-if="order.replyQty > 0 && order.replyQty < order.qty">
+								<div class="progress progress-sm">
+									<div class="progress-bar progress-bar-success"
+										 ng-style="{'width': 100*order.replyQty/order.qty + '%'}">
+										<span class="sr-only"></span>
+									</div>
+								</div>
+								已回复 <span class="text-default">{{::order.replyQty}}</span> / <span>{{::order.qty}}</span>
+							</div>
+							<div ng-if="order.replyQty > 0" class="dropdown"
+								 ng-class="{'text-center': order.replyQty>=order.qty}">
+								<a href="javascript:void(0);"
+								   class="dropdown-toggle text-default"
+								   ng-mouseover="getReply(order)">回复历史<i
+										class="fa fa-fw fa-angle-down"></i></a>
+								<div class="dropdown-menu pane" style="width: 270px;">
+									<div class="pane-body">
+										<ul class="list-unstyled list-menu">
+											<li ng-repeat="reply in ::order.replies">
+												<div class="row row-sm"
+													 ng-class="{'text-inverse': $index==0}">
+													<div class="col-xs-6">
+														<span ng-if="reply.qty < 0"> 撤销</span>
+														数量 {{::reply.qty}}
+													</div>
+													<div class="col-xs-6">交期{{::reply.delivery |
+														date:'yyyy-MM-dd'}}</div>
+												</div>
+												<div class="text-muted">{{::reply.recorder}}{{::reply.date
+													| date:'yyyy-MM-dd HH:mm:ss'}}回复</div>
+											</li>
+										</ul>
+									</div>
+								</div>
+							</div>
+						</div>
+						<div style="margin: 0 auto" ng-if="order.$editing">
+							<br> <br> <input type="text"
+											 ng-model="order.reply.remark" class="form-control input-xs"
+											 placeholder="回复备注" />
+						</div>
+						<div ng-if="order.acceptQty" class="text-success text-center text-bold f14">
+							已验收:{{::order.acceptQty}}{{::order.product.unit}}
+						</div>
+						<div ng-if="order.returnQty" class="text-error text-center text-bold f14">
+							已验退:{{::order.returnQty}}{{::order.product.unit}}
+						</div>
+					</td>
+					<td class="text-center" style="position: relative ;">
+						<div ng-if="order.replyQty>=order.qty" class="block">
+							<span class="text-trans success">已回复</span>
+						</div>
+						<div ng-if="order.end" class="block">
+							<span class="text-trans warning">已结案</span>
+						</div>
+						<!-- <div
+                            ng-if="(!order.replyQty || order.replyQty<=order.qty) && !order.end">
+                            <br ng-if="order.replyQty>=order.qty">
+                            <br ng-if="order.replyQty>=order.qty">
+                            <div ng-show="!order.$editing">
+                                <a ng-click="order.$editing=!order.$editing">回复</a>
+                            </div>
+                            <div ng-if="order.$editing">
+                                <div>
+                                    <a ng-click="order.$editing=!order.$editing">取消</a>
+                                </div>
+                                <br>
+                                <div class="text-left">
+                                    <a ng-click="onReplyClick(order)" class="text-inverse">
+                                        <i class="fa fa-arrow-up"></i> 确认回复
+                                    </a>
+                                    <br>
+                                    <a ng-click="onReplyClick(order, -1)" class="text-muted" title="减去已回复数量">
+                                        <i class="fa fa-arrow-down"></i> 撤销回复</a>
+                                </div>
+                            </div>
+                        </div> -->
+					</td>
+				</tr>
+				</tbody>
+			</table>
+		</div>
+	</div>
+</div>

+ 12 - 0
src/main/webapp/resources/view/usercenter/forstore/buyer_order.html

@@ -745,9 +745,21 @@
 	.oder01 ul li.active a, .oder01 ul li.active a em {
 	.oder01 ul li.active a, .oder01 ul li.active a em {
 		color: #fff !important;
 		color: #fff !important;
 	}
 	}
+	.oder01 ul {
+		border-bottom: none;
+	}
+	.oder01 ul li.active a {
+		border: none;
+	}
 	/*/*/
 	/*/*/
 </style>
 </style>
 <div class="user_right fr">
 <div class="user_right fr">
+	<div class="com_tab" style="margin-bottom: 10px">
+		<ul class="fl" style="width: 100%">
+			<li class="active"><a ui-sref="buyer_order" href="#/order">优软商城</a></li>
+			<li><a ui-sref="purc_usercenter_order" href="#/purc/order">B2B</a></li>
+		</ul>
+	</div>
 	<!--订单中心-->
 	<!--订单中心-->
 	<div class="oder">
 	<div class="oder">
 		<div class="oder01" style="margin-bottom: 0px;">
 		<div class="oder01" style="margin-bottom: 0px;">