Просмотр исходного кода

增加询价详情页面

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@8110 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 9 лет назад
Родитель
Сommit
2891aac503

+ 80 - 0
src/main/webapp/resources/js/index/app.js

@@ -181,6 +181,10 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
             url : "/purcinquirydetail",
             templateUrl : "static/tpl/index/purc/inquiry_detail.html",
             controller: 'PurcInquiryDetailCtrl'
+        }).state('purc.inquiryInfo_detail', {
+            url : "/purcinquirydetail/:id",
+            templateUrl : "static/tpl/index/purc/inquiryInfo_detail.html",
+            controller: 'PurcInquiryInfoDetailCtrl'
         }).state('purc.inquiry_unapply', {
             url : "/inquiry_unapply",
             templateUrl : "static/tpl/index/purc/inquiry_unapply.html",
@@ -3434,6 +3438,82 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 		};
 	}]);
 	
+	// 询价单明细(发出)
+	app.controller('PurcInquiryInfoDetailCtrl', ['$scope', '$stateParams', 'PurchaseInquiry','$filter', 'toaster', function($scope, $stateParams, PurchaseInquiry,$filter, toaster){
+		var loadData = function() {
+			PurchaseInquiry.detail({id: $stateParams.id}, function(data){
+				$scope.inquiry = data;
+			});
+		};
+		loadData();
+		$scope.getMinDate = function(item) {
+			return $filter('date')(item.inquiry.date, 'yyyy-MM-dd');
+		};
+		
+		$scope.addStep = function(inquiryItem) {
+			if(inquiryItem.replies.length >= 10) {
+				toaster.pop('warning', '提示', '最多支持10个分段!');
+			} else
+				inquiryItem.replies.push({});
+		};
+		
+		$scope.removeStep = function(inquiryItem, stepIndex) {
+			inquiryItem.replies.splice(stepIndex, 1);
+		};
+		
+		$scope.openDatePicker = function($event, item, openParam) {
+			$event.preventDefault();
+		    $event.stopPropagation();
+		    item[openParam] = !item[openParam];
+		};
+		
+		$scope.getHistory = function(item) {
+			if(!item.history) {
+				PurcInquiry.getHistory({itemId: item.id}, function(data){
+					item.history = data;
+				});
+			}
+		};
+		
+		$scope.isValid = function(item, withSteps) {
+			var bool = item.leadtime && item.replies && item.replies[0].price > 0;
+			if(!withSteps || !bool)
+				return bool;
+			angular.forEach(item.replies, function(r, i){
+				bool = (i > 0 ? r.lapQty : 1) && r.price;
+			});
+			return bool;
+		};
+		
+		$scope.onReplyClick = function(item, withSteps) {
+			if(item.vendFromDate instanceof Date) {
+  				item.vendFromDate = item.vendFromDate.getTime();
+  			}
+  			if(item.vendToDate instanceof Date) {
+  				item.vendToDate = item.vendToDate.getTime();
+  			}
+  			if(item.vendFromDate > item.vendToDate) {
+  				toaster.pop('warning', '警告', '有效开始日期不能超过有效截止日期');
+  				return;
+  			}
+			var replies = [];
+			angular.forEach(item.replies, function(r, i){
+				if((i > 0 ? r.lapQty : 1) || r.price)
+					replies.push(r);
+			});
+			item.replies = replies;
+			if(withSteps) {
+				PurcInquiry.reply({itemId: item.id}, item, function(){
+					toaster.pop('info', '提示', '报价成功');
+					loadData();
+				}, function(response){
+					toaster.pop('error', '报价失败', response.data);
+				});
+			}
+		};
+	}]);
+	
+	
 	// 模具询价管理 
 	app.controller('SaleInquiryMouldCtrl',['$scope', '$filter', 'PurcInquiryMould', 'ngTableParams', 'toaster', 'BaseService', '$upload', function($scope, $filter, PurcInquiryMould, ngTableParams, toaster, BaseService, $upload){
 		BaseService.scrollBackToTop();

+ 4 - 67
src/main/webapp/resources/tpl/index/purc/inquiry.html

@@ -331,69 +331,6 @@ margin-left: 55px;
 						</div>
 					</div>
 				</div>
-			<!-- 	<div class="fr toggle">
-					<a ng-click="condition.$open=!condition.$open" class="text-simple"><span ng-bind="condition.$open ? '简化筛选条件' : '更多筛选条件'"></span><i class="fa fa-fw" ng-class="{'fa-angle-up': condition.$open, 'fa-angle-down': !condition.$open}"></i></a>
-				</div> -->
-			</div>
-			<div class="more" ng-class="{'open': condition.$open}">
-				<form class="form-inline">
-					<div class="form-group ">
-						<label>日期:</label>
-						<div class="btn-group btn-menu" dropdown is-open="condition.$dateZoneOpen">
-							<button type="button" dropdown-toggle style="width: 85px;" class="btn btn-default btn-xs dropdown-toggle">
-								{{dateZoneText}}<i class="fa fa-fw fa-angle-down icon-right"></i></span>
-							</button>
-							<ul class="dropdown-menu">
-								<li><a ng-click="changeDateZone(1)">一个月内</a></li>
-								<li><a ng-click="changeDateZone(6)">半年内</a></li>
-								<li><a ng-click="changeDateZone()">半年前</a></li>
-							</ul>
-						</div>
-						<div class="form-group input-group input-group-xs input-trigger">
-							<input type="text" ng-model="condition.dateFrom"
-								   class="form-control" placeholder="从"
-								   datepicker-popup="yyyy-MM-dd" is-open="condition.$fromOpened"
-								   ng-required="true"
-								   current-text="今天" clear-text="清除" close-text="关闭"
-								   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
-								   ng-focus="openDatePicker($event, condition, '$fromOpened')">
-							<span class="input-group-btn">
-								<button type="button" class="btn btn-default"
-										ng-click="openDatePicker($event, condition, '$fromOpened')">
-									<i class="fa fa-calendar"></i>
-								</button>
-							</span>
-						</div>
-						<div class="form-group input-group input-group-xs input-trigger">
-							<input type="text" ng-model="condition.dateTo"
-								   class="form-control" placeholder="到"
-								   datepicker-popup="yyyy-MM-dd" is-open="condition.$toOpened"
-								   ng-required="true"
-								   current-text="今天" clear-text="清除" close-text="关闭"
-								   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
-								   ng-focus="openDatePicker($event, condition, '$toOpened')">
-							<span class="input-group-btn">
-								<button type="button" class="btn btn-default"
-										ng-click="openDatePicker($event, condition, '$toOpened')">
-									<i class="fa fa-calendar"></i>
-								</button>
-							</span>
-						</div>
-					</div>
-					<div class="form-group">
-						<label>采纳结果:</label>
-						<div class="btn-group btn-menu" dropdown is-open="condition.$agreedOpen">
-							<button type="button" dropdown-toggle style="width: 70px;" class="btn btn-default btn-xs dropdown-toggle">
-								{{agreedText}}<i class="fa fa-fw fa-angle-down icon-right"></i></span>
-							</button>
-							<ul class="dropdown-menu">
-								<li><a ng-click="changeAgreed()">全部</a></li>
-								<li><a ng-click="changeAgreed(1)">已采纳</a></li>
-								<li><a ng-click="changeAgreed(0)">未采纳</a></li>
-							</ul>
-						</div>
-					</div>
-				</form>
 			</div>
 		</div>
 	</div>
@@ -465,8 +402,8 @@ margin-left: 55px;
 									  ng-model="inquiryItem.$selected">
 						</span> <span class="text-num text-bold"
 									  title="{{inquiryItem.inquiry.date}}"
-									  ng-bind="::inquiryItem.inquiry.date | date:'yyyy-MM-dd'"></span> <span>流水号:<span
-						class="text-num" ng-bind="::inquiryItem.inquiry.code" target="_self"></span></span>
+									  ng-bind="::inquiryItem.inquiry.date | date:'yyyy-MM-dd'"></span> <span>流水号:<a
+						class="text-num" ng-bind="::inquiryItem.inquiry.code" target="_self" href="#/purc/purcinquirydetail/{{inquiryItem.inquiry.id}}"></a></span>
 				</div>
 			</td>
 			<td colspan="2"><span
@@ -549,7 +486,7 @@ margin-left: 55px;
 						<span ng-bind="reply.price | number:6"></span> <span
 							ng-show="reply.price == null" class="text-muted">-</span>
 					</div>
-					<div class="dropdown">
+					<!-- <div class="dropdown">
 						<a href="javascript:void(0);" class="dropdown-toggle text-default"
 						   ng-mouseover="getHistory(inquiryItem)">报价信息<i
 								class="fa fa-fw fa-angle-down"></i></a>
@@ -573,7 +510,7 @@ margin-left: 55px;
 										class="text-center text-muted">暂无报价信息</div>
 							</div>
 						</div>
-					</div>
+					</div> -->
 				</div>
 				<div style="margin: 0 auto;" ng-if="inquiryItem.$editing">
 					<div ng-repeat="reply in inquiryItem.replies">

+ 528 - 0
src/main/webapp/resources/tpl/index/purc/inquiryInfo_detail.html

@@ -0,0 +1,528 @@
+<!-- 投标单 -->
+<style>
+
+/* 标题 */
+.bid-label {
+	height: 30px;
+	margin-left: 10px;
+	margin-right: 10px;
+	background-color: #e8e8e8;
+	box-shadow: 0 0 5px #6f6f6f;
+	border-top-right-radius: 20px;
+}
+
+/* 主体 */
+.purc-bid {
+	line-height: 2;
+	font-size: 14px;
+}
+
+.purc-bid .row {
+	margin-left: 0px;
+	margin-right: 0px;
+	padding-left: 15px;
+	padding-right: 15px;
+}
+
+.bid-content {
+	background-color: #fff;
+}
+
+.bid-content>div>div {
+	margin-top: 3px;
+	margin-bottom: 3px;
+}
+
+/* 读取显示无法修改的数据 */
+.unchanged-info {
+	color: #969595;
+	overflow: hidden;
+}
+
+/* 二级标题栏 */
+.title-div {
+	font-size: 14px;
+	font-weight: 600;
+	padding-left: 30px;
+	height: 50px;
+	padding-top: 11px;
+}
+
+/* 输入框前描述 */
+.bid-desc {
+	width: 100px;
+	float: left;
+}
+
+/* 输入框 */
+.bid-input {
+	border: none;
+	border-bottom: 1px solid #323232;
+	text-align: center;
+}
+
+.bid-input:focus {
+	outline: none;
+	border-bottom: 1px solid #5078cb;
+}
+
+/* 基本信息 */
+.base-info {
+	padding-bottom: 30px;
+	padding-top: 20px;
+	margin-bottom: 0; /* 去除index中公共样式影响 */
+}
+
+/* 右下角按钮 */
+.bid-content>div {
+	background-color: #fff;
+}
+
+.bid-content>div>div>button {
+	width: 94px;
+	height: 36px;
+	font-size: 14px;
+	color: #fff;
+	border-radius: 0;
+}
+
+.bid-content>div>div.btn-bid>button {
+	background-color: #327EBE;
+}
+
+.bid-content>div>div.btn-bid>button:hover {
+	background: #3a89d1;
+	color: #fff;
+}
+/* 列表内容 */
+.tender-table {
+	padding: 0 20px;
+}
+
+.tender-table .header {
+	height: 50px;
+	background-color: #fff;
+	color: rgb(50, 50, 50);
+	border-bottom: 1px solid #327ebe;
+}
+
+.tender-table thead>tr>th:first-child, .tender-table tbody>tr>td:first-child
+	{
+	padding-left: 30px;
+}
+
+.tender-table tr {
+	height: 50px;
+	border-bottom: 1px dashed #969595;
+}
+
+.tender-table>tbody {
+	height: 100px;
+	font-size: 14px;
+	color: #323232;
+	border: 1px solid transparent;
+}
+
+.tender-table tbody tr td a {
+	color: #327ebe;
+	font-size: 12px;
+}
+
+.tender-table tbody tr td a:hover {
+	color: #D32526;
+	cursor: pointer;
+}
+
+/* 输入框 */
+.tender-input {
+	border: none;
+	width: 100px;
+}
+
+.tender-input:focus {
+	outline: none;
+}
+
+.com_head {
+	width: 100%;
+	height: 40px;
+	line-height: 42px;
+	background: url(static/img/comm_bg01.png) no-repeat center;
+	background-size: 100%;
+}
+
+.com_head span {
+	margin-left: 30px;
+	color: #000;
+	font-size: 14px;
+}
+
+.com_head a {
+	color: #327ebe;
+	float: right;
+	margin-right: 40px;
+	font-size: 14px;
+}
+
+.com_head a i {
+	margin-left: 5px;
+	line-height: 40px;
+}
+
+.com_head a:hover {
+	color: #d2272d;
+}
+
+.com_title {
+	width: 100%;
+	margin: 0px auto;
+	height: 40px;
+	line-height: 40px;
+	font-size: 14px;
+	color: #323232;
+	background: #f5f5f5;
+}
+
+.com_title font {
+	color: #327ebe;
+}
+
+.com_title01 {
+	height: 50px;
+	line-height: 50px;
+	width: 100%;
+	border-bottom: #3578ba 1px dotted;
+	border-top: #e8e8e8 1px solid;
+	margin-top: -4px;
+} /*  这里修改过 margin-top*/
+.com_title01 span {
+	margin-left: 20px;
+	font-size: 14px;
+	line-height: 50px;
+	color: #555;
+	font-weight: bold;
+}
+
+.comment-oder-list  a {
+	color: #5078cb;
+}
+
+.comment-oder-list  a:hover {
+	cursor: pointer;
+	color: #d2272d;
+}
+
+/*评标单*/
+.tender-list02 .comment-oder {
+	width: 100%;
+	margin: 0 auto;
+}
+
+.tender-list02 .comment-oder:hover {
+	border: #d32526 1px solid;
+}
+
+.tender-list02 .comment-oder-text {
+	border-bottom: #5078cb 1px solid;
+}
+
+.tender-list02 .comment-oder-text, .comment-oder-text ul {
+	width: 100%;
+	margin: 0 auto;
+	padding: 5px 0;
+	position: relative;
+}
+
+.tender-list02 .comment-oder-text i {
+	position: absolute;
+	top: -1px;
+	left: 35px;
+	width: 20px;
+	height: 20px;
+	line-height: 15px;
+	text-align: center;
+	background: #595959;
+	display: inline-block;
+	font-weight: 700;
+	font-size: 14px;
+	color: #fff;
+	border-radius: 0 0 50px 0;
+}
+
+.tender-list02 .comment-oder-text ul li {
+	width: 88%;
+	margin: 0 auto;
+	height: 30px;
+	line-height: 30px;
+}
+
+.tender-list02 .comment-oder-text ul li span {
+	width: 33.3333%;
+	float: left;
+}
+
+.tender-list02 .comment-oder-text ul li span em, .comment-oder-text ul li span b
+	{
+	font-size: 14px;
+}
+
+.tender-list02 .comment-oder-text ul li span em {
+	width: 70px;
+	display: inline-block;
+}
+
+.tender-list02 .comment-oder-text ul li span b {
+	color: #959595;
+	width: 190px;
+	display: inline-block;
+	float: right;
+	white-space: nowrap;
+	overflow: hidden;
+	text-overflow: ellipsis;
+}
+
+.tender-list02 .comment-oder-list, .comment-oder-list dl {
+	width: 100%;
+	margin: 0 auto;
+}
+
+.tender-list02 .comment-oder-list dl dt, .comment-oder-list dl dd {
+	width: 100%;
+	margin: 0 auto;
+	border-bottom: #ccc 1px dashed;
+	height: 50px;
+	line-height: 50px;
+	overflow: hidden;
+}
+
+.tender-list02 .comment-oder-list dl dt span.wid01 {
+	text-align: left;
+	padding-left: 30px;
+}
+
+.tender-list02 .comment-oder-list dl dd span.wid01 {
+	text-align: left;
+	padding-left: 30px;
+}
+
+.tender-list02 .comment-oder-list dl span {
+	font-size: 14px;
+	width: 9%;
+	float: left;
+	color: #323232 !important;
+	line-height: 50px;
+	position: relative;
+	overflow: hidden;
+}
+
+.tender-list02 .comment-oder-list dl span.wid01 {
+	width: 19%;
+}
+
+.tender-list02 .comment-oder-list dl span.wid02 {
+	width: 15%;
+}
+
+.tender-list02 .comment-oder-list dl dd span a {
+	margin-left: 15px;
+	font-size: 12px;
+}
+
+.tender-list02 .comment-oder-list dl dd:hover {
+	border-bottom: #ccc 1px dotted;
+	border-top: none;
+	border-left: none;
+	border-right: none;
+}
+
+.tender-list02 .change01 {
+	width: 16px;
+	height: 14px;
+	display: inline-block;
+	float: right;
+	line-height: 7px;
+	position: absolute;
+	top: 13px;
+}
+
+.tender-list02 .change01 i {
+	width: 100%;
+	display: inline-block;
+	height: 7px;
+	color: #000;
+}
+
+.tender-list02 .change01:hover i {
+	color: #5078cb;
+}
+
+.tender-list02 .explain {
+	width: 90%;
+	height: 30px;
+	border: none;
+	text-align: center;
+	line-height: 30px;
+}
+
+.tender-list02 .save {
+	margin-top: 30px;
+}
+
+.tender-list02 .save a {
+	width: 94px;
+	height: 36px;
+	display: inline-block;
+	background: #3578ba;
+	text-align: center;
+	color: #fff;
+	font-size: 14px;
+	float: right;
+	line-height: 36px;
+	margin-right: 40px;
+}
+
+.tender-list02 .save a:hover {
+	background: #1f4fb2;
+}
+
+.tender-list02 .com_title01, .tender-list .com_title01 {
+	margin-top: 0;
+}
+
+i, em {
+	font-style: normal;
+}
+
+.prod-number { /* 数字居右 */
+	text-align: center;
+}
+
+.tender-list02 .comment-oder-list dl dt span {
+	text-align: center;
+}
+
+.tender-list02 .comment-oder-list dl span a.active {
+	text-decoration: none;
+	color: #D32526;
+}
+</style>
+
+<div class="ng-scope">
+    <form name="bidForm">
+        <div class="purc-bid">
+            <div class="com_head"><span>报价单</span></div>
+            <div class="bid-content ng-scope">
+                <div class="title-div" style="border-bottom: 1px dashed #327ebe;">
+                    <span>基本信息</span>
+                </div>
+                <div class="row base-info">
+                    <div class="col-xs-4">
+                        <div class="bid-desc">询价单号:</div>
+                        <div class="unchanged-info">{{inquiry.code}}</div>
+                    </div>
+                    <div class="col-xs-4">
+                        <div class="bid-desc">报价日期:</div>
+                        <div class="unchanged-info">{{inquiry.date| date: 'yyyy-MM-dd'}}</div>
+                    </div>
+                    <div class="col-xs-4">
+                        <div class="bid-desc">截止日期:</div>
+                        <div class="unchanged-info">{{inquiry.endDate| date: 'yyyy-MM-dd'}}</div>
+                    </div>
+                  <!--   <div class="col-xs-12">
+                        <div class="bid-desc">收货地址:</div>
+                        <div class="unchanged-info">{{tender.shipAddress}}</div>
+                    </div> -->
+                    <div class="col-xs-12">
+                        <div class="bid-desc">备注:</div>
+                        <div class="unchanged-info">{{inquiry.remark || '无'}}</div>
+                    </div>
+                    <div class="col-xs-12">
+                        <div class="bid-desc">附件:</div>
+                        <div class="unchanged-info">{{inquiry.attach || '无'}}</div>
+                    </div>
+                </div>
+                <div class="tender-list02">
+                    <!--报价信息-->
+                    <div class="com_title01"><span>报价信息</span></div>
+                    <div class="comment-oder" ng-repeat="product in inquiry.products | orderBy : 'index'">
+                        <div class="comment-oder-text">
+                            <ul>
+                                <li class="list-unstyled">
+                                    <span><em style="width: 80px;">产品型号:</em><b title="{{product.code}}">{{product.code}}</b></span>
+                                    <span><em>产品名称:</em><b title="{{product.title}}">{{product.title}}</b></span>
+                                    <span><em>品牌:</em><b title="{{product.brand}}">{{product.brand}}</b></span>
+                                </li>
+                                <li class="list-unstyled">
+                                    <span><em style="width: 80px;">规格:</em><b>{{product.spec}}</b></span>
+                                </li>
+                            </ul>
+                            <i>{{$index + 1}}</i>
+                        </div>
+                        <div class="comment-oder-list">
+                            <dl>
+                                <dt>
+                                    <span class="wid01">报价供应商</span>
+                                    <span>币别</span>
+                                    <span>税率(% )</span>
+                                    <span class="wid02">报价信息</span>
+                                    <span>交货周期</span>
+                                    <span>最小订购</span>
+                                    <span>最小包装</span>
+                                    <span>有效期</span>
+                                    <span>操作</span>
+                                </dt>
+                                <dd ng-if="inquiry.products.inquiryItems.enterprise.length == 0">
+                                    <div style="font-size: 14px; color: #969595; text-align: center;">
+                                 	       暂无企业报价
+                                    </div>
+                                </dd>
+                                <dd ng-repeat = "inquiryItem in product.inquiryItems">
+                                    <span class="wid01">{{inquiryItem.enterprise.enName}}
+                                    </span>
+                                    <span class="prod-number">{{inquiryItem.currency}}</span>
+                                    <span class="prod-number">{{inquiryItem.taxrate || 0}}</span>
+                                    <span>
+                                    	<div class="dropdown">
+											<a href="javascript:void(0);"
+												class="dropdown-toggle text-default">报价信息<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 ::inquiryItem.replies">
+															<div ng-class="{'text-inverse': $index==0}">
+																<div class="row row-sm"
+																	ng-repeat="historyReply in historyItem.replies">
+																	<div class="col-xs-5">≥{{reply.lapQty}}</div>
+																	<div class="col-xs-5">价格{{reply.price | number:6}}</div>
+																</div>
+															</div>
+														</li>
+													</ul>
+													<div ng-show="inquiryItem.replies.length == 0"
+														class="text-center text-muted">暂无报价信息</div>
+												</div>
+											</div>
+										</div>
+                                    </span>
+                                    <span class="prod-number">{{inquiryItem.leadtime|| '无'}}</span>
+                                    <span class="prod-number">{{inquiryItem.minOrderQty|| '无'}}</span>
+                                    <span class="prod-number">{{inquiryItem.minPackQty|| '无'}}</span>
+                                    <span >{{inquiryItem.vendFromDate| date:'yyyy-MM-dd'}}-{{inquiryItem.VendToDate|date: 'yyyy-MM-dd'}}</span>
+                                    <span><a>采纳</a><a>拒绝</a></span>
+                                </dd>
+                            </dl>
+                        </div>
+                    </div>
+                </div>
+                <div class="col-xs-12" style="padding: 30px 0 0 0;">
+                    <div class="col-xs-2 pull-right btn-bid">
+                        <button class="btn"
+                                ng-disabled="bidForm.$invalid || tender.overdue == 0 || tender.result == 1"
+                                ng-click="submit(tender)">确定
+                        </button>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </form>
+</div>