Bläddra i källkod

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@464 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d

administrator 11 år sedan
förälder
incheckning
936f20244b

+ 17 - 1
src/main/webapp/resources/js/index/app.js

@@ -454,7 +454,23 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ui.
 			inquiryItem.replies.splice(stepIndex, 1);
 		};
 		
-		$scope.onReplyClick = function() {
+		$scope.openDatePicker = function($event, item, openParam) {
+			$event.preventDefault();
+		    $event.stopPropagation();
+		    item[openParam] = !item[openParam];
+		};
+		
+		$scope.isValid = function(item, withSteps) {
+			var bool = item.replies && item.replies[0].price > 0;
+			if(!withSteps || !bool)
+				return bool;
+			angular.forEach(item.replies, function(r, i){
+				bool = (i > 0 ? r.qty : 1) && r.price;
+			});
+			return bool;
+		};
+		
+		$scope.onReplyClick = function(item) {
 			
 		};
 	});

+ 44 - 38
src/main/webapp/resources/tpl/index/sale/inquiry.html

@@ -127,7 +127,8 @@
 						class="tm-h">6</em></a></li>
 				<li><a ui-sref="sale.change"><span>变更中</span><em
 						class="tm-h">2</em></a></li>
-				<li><a ui-sref="sale.notice"><span>待发货</span><em class="tm-h">0</em></a></li>
+				<li><a ui-sref="sale.notice"><span>待发货</span><em
+						class="tm-h">0</em></a></li>
 				<li><a href="#"><span>退货中</span><em class="tm-h">0</em></a></li>
 			</ul>
 		</div>
@@ -136,17 +137,18 @@
 		<thead>
 			<tr class="header">
 				<th>商品</th>
-				<th width="280">报价要求</th>
 				<th width="90"><span class="text-default">≥</span>分段数</th>
 				<th width="90">价格</th>
+				<th width="80">最小订购</th>
+				<th width="80">最小包装</th>
 				<th width="120">有效期</th>
-				<th width="60">操作</th>
+				<th width="75">操作</th>
 			</tr>
 			<tr class="sep-row">
-				<td colspan="6"></td>
+				<td colspan="7"></td>
 			</tr>
 			<tr class="toolbar toolbar-top">
-				<td colspan="6">
+				<td colspan="7">
 					<div>
 						<label><input type="checkbox" class="selector select_all"
 							ng-model="selectAll">全选</label> <a href="javascript:void(0)"
@@ -155,7 +157,7 @@
 				</td>
 			</tr>
 			<tr class="sep-row">
-				<td colspan="6"></td>
+				<td colspan="7"></td>
 			</tr>
 		</thead>
 		<tbody ng-repeat="inquiryItem in $data">
@@ -170,7 +172,7 @@
 							class="text-num" ng-bind="inquiryItem.inquiry.code" href="#"></a></span>
 					</div>
 				</td>
-				<td colspan="2"><a href="#"
+				<td colspan="3"><a href="#"
 					ng-bind="inquiryItem.inquiry.enterprise.enName"></a></td>
 				<td class="text-right" colspan="2" class="order-sum"><span
 					class="text-inverse text-bold"
@@ -194,28 +196,7 @@
 					<div class="text-muted" title="{{inquiryItem.product.spec}}"
 						ng-bind="inquiryItem.product.spec"></div>
 				</td>
-				<td>
-					<div ng-show="!inquiryItem.$editing">最小订购量:</div>
-					<div style="margin: 0 auto" ng-show="inquiryItem.$editing">
-						<form class="form-horizontal">
-							<div class="form-group form-group-xs">
-								<label class="col-sm-5 control-label">最小订购量:</label>
-								<div class="col-sm-5">
-									<input type="text" class="form-control input-xs"
-										ng-model="inquiryItem.minOrderQty">
-								</div>
-							</div>
-							<div class="form-group form-group-xs">
-								<label class="col-sm-5 control-label">最小包装量:</label>
-								<div class="col-sm-5">
-									<input type="text" class="form-control input-xs"
-										ng-model="inquiryItem.minPackQty">
-								</div>
-							</div>
-						</form>
-					</div>
-				</td>
-				<td class="text-center br-l">
+				<td class="text-center">
 					<div ng-show="!inquiryItem.$editing">
 						<div ng-repeat="reply in inquiryItem.replies">
 							<span ng-bind="reply.lapQty"></span>
@@ -261,10 +242,33 @@
 					</div>
 				</td>
 				<td class="text-center br-l">
-					<div ng-show="!inquiryItem.$editing" ng-init="parseDate(inquiryItem)">
+					<div ng-show="!inquiryItem.$editing">
+						<span ng-bind="inquiryItem.minOrderQty"></span> <span
+							ng-show="inquiryItem.minOrderQty == null" class="text-muted">-</span>
+					</div>
+					<div ng-show="inquiryItem.$editing">
+						<input type="text" class="form-control input-xs"
+							ng-model="inquiryItem.minOrderQty" placeholder="最小订购">
+					</div>
+				</td>
+				<td class="text-center br-l">
+					<div ng-show="!inquiryItem.$editing">
+						<span ng-bind="inquiryItem.minPackQty"></span> <span
+							ng-show="inquiryItem.minPackQty == null" class="text-muted">-</span>
+					</div>
+					<div ng-show="inquiryItem.$editing">
+						<input type="text" class="form-control input-xs"
+							ng-model="inquiryItem.minPackQty" placeholder="最小包装">
+					</div>
+				</td>
+				<td class="text-center br-l">
+					<div ng-show="!inquiryItem.$editing"
+						ng-init="parseDate(inquiryItem)">
 						<div ng-show="inquiryItem.vendFromDate">
-							<span class="text-muted">从 </span><span ng-bind="inquiryItem.vendFromDate | date:'yyyy-MM-dd'"></span>
-							<span class="text-muted">到 </span><span ng-bind="inquiryItem.vendToDate | date:'yyyy-MM-dd'"></span>
+							<span class="text-muted">从 </span><span
+								ng-bind="inquiryItem.vendFromDate | date:'yyyy-MM-dd'"></span> <span
+								class="text-muted">到 </span><span
+								ng-bind="inquiryItem.vendToDate | date:'yyyy-MM-dd'"></span>
 						</div>
 						<div ng-show="!inquiryItem.vendFromDate">
 							<span class="text-muted">-</span>
@@ -278,10 +282,10 @@
 								min-date="inquiry.date" ng-required="true" current-text="今天"
 								clear-text="清除" close-text="关闭"
 								datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
-								ng-focus="openDatePicker($event, inquiryItem)"> <span
+								ng-focus="openDatePicker($event, inquiryItem, '$fromOpened')"> <span
 								class="input-group-btn">
 								<button type="button" class="btn btn-default"
-									ng-click="openDatePicker($event, inquiryItem)">
+									ng-click="openDatePicker($event, inquiryItem, '$fromOpened')">
 									<i class="fa fa-calendar"></i>
 								</button>
 							</span>
@@ -293,10 +297,10 @@
 								min-date="inquiry.date" ng-required="true" current-text="今天"
 								clear-text="清除" close-text="关闭"
 								datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
-								ng-focus="openDatePicker($event, inquiryItem)"> <span
+								ng-focus="openDatePicker($event, inquiryItem, '$toOpened')"> <span
 								class="input-group-btn">
 								<button type="button" class="btn btn-default"
-									ng-click="openDatePicker($event, inquiryItem)">
+									ng-click="openDatePicker($event, inquiryItem, '$toOpened')">
 									<i class="fa fa-calendar"></i>
 								</button>
 							</span>
@@ -311,9 +315,11 @@
 						<div>
 							<a ng-click="inquiryItem.$editing=!inquiryItem.$editing">取消</a>
 						</div>
-						<br>
 						<div>
-							<a ng-click="onReplyClick(inquiryItem)" class="text-inverse">确认报价</a>
+							<button ng-click="onReplyClick(inquiryItem)" ng-disabled="!isValid(inquiryItem)" class="btn btn-link btn-xs text-default">保存</button>
+						</div>
+						<div>
+							<button ng-click="onReplyClick(inquiryItem)" ng-disabled="!isValid(inquiryItem, true)" class="btn btn-link btn-xs text-inverse">保存并<br>确认报价</button>
 						</div>
 					</div>
 				</td>