Преглед изворни кода

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

suntg пре 11 година
родитељ
комит
3e7aceac74

+ 16 - 0
src/main/java/com/uas/platform/b2b/controller/SaleNoticeController.java

@@ -166,5 +166,21 @@ public class SaleNoticeController {
 			logger.log("客户送货提醒", "给同一客户多个送货提醒填写数量并确认发货", send.sendDescription(), null, send.getId());
 		return new ResponseEntity<String>(HttpStatus.OK);
 	}
+	
+	/**
+	 * 作为卖家,查看送货单
+	 * 
+	 * @param params
+	 * @return
+	 */
+	@RequestMapping(value = "/sends", method = RequestMethod.GET)
+	@ResponseBody
+	public Page<SaleSend> getSaleSends(PageParams params) {
+		logger.log("发货单", "查看全部的送货单");
+		PageInfo info = new PageInfo(params);
+		// 我作为卖家,把我的企业ID作为供应商ID传入
+		info.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
+		return purchaseNoticeService.findSendsByPageInfo(info);
+	}
 
 }

+ 2 - 1
src/main/java/com/uas/platform/b2b/model/PurchaseInquiry.java

@@ -6,6 +6,7 @@ import java.util.Set;
 
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
+import javax.persistence.ConstraintMode;
 import javax.persistence.Entity;
 import javax.persistence.FetchType;
 import javax.persistence.ForeignKey;
@@ -117,7 +118,7 @@ public class PurchaseInquiry implements Serializable {
 	 * 附件
 	 */
 	@OneToMany(fetch = FetchType.EAGER)
-	@JoinColumn(name = "rel_key", foreignKey = @ForeignKey(name = "none"))
+	@JoinColumn(name = "rel_key", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
 	@Where(clause = "rel_table = 'purc$inquiry'")
 	private Set<Attach> attachs;
 

+ 9 - 10
src/main/java/com/uas/platform/b2b/model/PurchaseProofing.java

@@ -6,6 +6,7 @@ import java.util.Set;
 
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
+import javax.persistence.ConstraintMode;
 import javax.persistence.Entity;
 import javax.persistence.FetchType;
 import javax.persistence.ForeignKey;
@@ -57,13 +58,13 @@ public class PurchaseProofing implements Serializable {
 	@OneToOne(cascade = { CascadeType.MERGE })
 	@JoinColumn(name = "pp_enuu", insertable = false, updatable = false)
 	private Enterprise enterprise;
-	
+
 	/**
 	 * 买方申请人uu
 	 */
 	@Column(name = "pp_useruu")
 	private Long userUU;
-	
+
 	/**
 	 * 买方申请人
 	 */
@@ -98,7 +99,7 @@ public class PurchaseProofing implements Serializable {
 
 	@Column(name = "pp_prid")
 	private Long productId;
-	
+
 	/**
 	 * 是否收费
 	 */
@@ -122,7 +123,7 @@ public class PurchaseProofing implements Serializable {
 	 */
 	@Column(name = "pp_remark")
 	private String remark;
-	
+
 	/**
 	 * 使用范围
 	 */
@@ -132,7 +133,8 @@ public class PurchaseProofing implements Serializable {
 	/**
 	 * 打样申请明细
 	 */
-	@OneToMany(mappedBy = "proofing", cascade = { CascadeType.REFRESH, CascadeType.PERSIST, CascadeType.REMOVE, CascadeType.MERGE }, fetch = FetchType.EAGER)
+	@OneToMany(mappedBy = "proofing", cascade = { CascadeType.REFRESH,
+			CascadeType.PERSIST, CascadeType.REMOVE, CascadeType.MERGE }, fetch = FetchType.EAGER)
 	@OrderBy("number")
 	private Set<PurchaseProofingItem> proofingItems;
 
@@ -140,7 +142,7 @@ public class PurchaseProofing implements Serializable {
 	 * 附件
 	 */
 	@OneToMany(fetch = FetchType.EAGER)
-	@JoinColumn(name="rel_key", foreignKey = @ForeignKey(name = "none"))
+	@JoinColumn(name = "rel_key", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
 	@Where(clause = "rel_table = 'purc$proofing'")
 	private Set<Attach> attachs;
 
@@ -263,7 +265,7 @@ public class PurchaseProofing implements Serializable {
 	public void setScope(String scope) {
 		this.scope = scope;
 	}
-	
+
 	@JsonIgnore
 	@JSONField(serialize = false)
 	public Set<PurchaseProofingItem> getProofingItems() {
@@ -281,8 +283,5 @@ public class PurchaseProofing implements Serializable {
 	public void setAttachs(Set<Attach> attachs) {
 		this.attachs = attachs;
 	}
-	
-
-	
 
 }

+ 5 - 4
src/main/java/com/uas/platform/b2b/model/PurchaseProofingApproval.java

@@ -6,6 +6,7 @@ import java.util.Set;
 
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
+import javax.persistence.ConstraintMode;
 import javax.persistence.Entity;
 import javax.persistence.FetchType;
 import javax.persistence.ForeignKey;
@@ -140,7 +141,7 @@ public class PurchaseProofingApproval implements Serializable {
 	 * 附件
 	 */
 	@OneToMany(fetch = FetchType.EAGER)
-	@JoinColumn(name = "rel_key", foreignKey = @ForeignKey(name = "none"))
+	@JoinColumn(name = "rel_key", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
 	@Where(clause = "rel_table = 'purc$proofingapproval'")
 	private Set<Attach> attachs;
 	/**
@@ -172,7 +173,7 @@ public class PurchaseProofingApproval implements Serializable {
 	 * 附件 - 研发认定
 	 */
 	@OneToMany(fetch = FetchType.EAGER)
-	@JoinColumn(name = "rel_key", foreignKey = @ForeignKey(name = "none"))
+	@JoinColumn(name = "rel_key", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
 	@Where(clause = "rel_table = 'purc$proofingapproval_prd'")
 	private Set<Attach> prdAttachs;
 	/**
@@ -204,7 +205,7 @@ public class PurchaseProofingApproval implements Serializable {
 	 * 附件 - IQC认定
 	 */
 	@OneToMany(fetch = FetchType.EAGER)
-	@JoinColumn(name = "rel_key", foreignKey = @ForeignKey(name = "none"))
+	@JoinColumn(name = "rel_key", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
 	@Where(clause = "rel_table = 'purc$proofingapproval_pad'")
 	private Set<Attach> padAttachs;
 	/**
@@ -236,7 +237,7 @@ public class PurchaseProofingApproval implements Serializable {
 	 * 附件 - 工程认定
 	 */
 	@OneToMany(fetch = FetchType.EAGER)
-	@JoinColumn(name = "rel_key", foreignKey = @ForeignKey(name = "none"))
+	@JoinColumn(name = "rel_key", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
 	@Where(clause = "rel_table = 'purc$proofingapproval_ppd'")
 	private Set<Attach> ppdAttachs;
 	/**

+ 2 - 1
src/main/java/com/uas/platform/b2b/model/PurchaseProofingSend.java

@@ -6,6 +6,7 @@ import java.util.Set;
 
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
+import javax.persistence.ConstraintMode;
 import javax.persistence.Entity;
 import javax.persistence.FetchType;
 import javax.persistence.ForeignKey;
@@ -157,7 +158,7 @@ public class PurchaseProofingSend implements Serializable {
 	 * 附件
 	 */
 	@OneToMany(fetch = FetchType.EAGER)
-	@JoinColumn(name = "rel_key", foreignKey = @ForeignKey(name = "none"))
+	@JoinColumn(name = "rel_key", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
 	@Where(clause = "rel_table = 'purc$proofingsend'")
 	private Set<Attach> attachs;
 

+ 8 - 0
src/main/java/com/uas/platform/b2b/service/PurchaseNoticeService.java

@@ -35,6 +35,14 @@ public interface PurchaseNoticeService {
 	 * @return
 	 */
 	public Page<PurchaseNotice> findAllByPageInfo(PageInfo pageInfo);
+
+	/**
+	 * 分页查找送货单
+	 * 
+	 * @param pageInfo
+	 * @return
+	 */
+	public Page<SaleSend> findSendsByPageInfo(PageInfo pageInfo);
 	
 	/**
 	 * 分页查找送货提醒单

+ 11 - 0
src/main/java/com/uas/platform/b2b/service/impl/PurchaseNoticeServiceImpl.java

@@ -279,4 +279,15 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
 		return null;
 	}
 
+	@Override
+	public Page<SaleSend> findSendsByPageInfo(final PageInfo pageInfo) {
+		return saleSendDao.findAll(new Specification<SaleSend>() {
+
+			public Predicate toPredicate(Root<SaleSend> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
+				query.where(pageInfo.getPredicates(root, query, builder));
+				return null;
+			}
+		}, pageInfo);
+	}
+
 }

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

@@ -1202,8 +1202,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 	/**
 	 * 发货单
 	 */
-	app.controller('SaleSendCtrl', function($scope, $rootScope, $filter, PurcChange, ngTableParams, toaster, BaseService, PurcChangeHis){
-		$scope.active = 'todo';
+	app.controller('SaleSendCtrl', function($scope, $rootScope, $filter, SaleSend, ngTableParams, toaster, BaseService, PurcChangeHis){
+		$scope.active = 'all';
 		$scope.agreedText = '全部';
 		$scope.dateZoneText = '一个月内';
 		$scope.condition = {dateZone: 1};
@@ -1227,7 +1227,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 			}
 		};
 		var getService = function() {
-			return $scope.condition.dateZone ? PurcChange : PurcChangeHis;
+			return SaleSend;
 		};
 		$scope.tableParams = new ngTableParams({
 			page : 1, 
@@ -1256,20 +1256,6 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 		    item[openParam] = !item[openParam];
 		};
 		
-		$scope.onReplyClick = function(change) {
-			if(change.agreed) {
-				var reply = {id: change.id, agreed: Number(change.$agreed), replyRemark: change.replyRemark};
-				$scope.loading = true;
-				PurcChange.reply({changeId: change.id}, reply, function(){
-					$scope.loading = false;
-					toaster.pop('info', '提示', '回复成功');
-					$scope.tableParams.reload();
-				}, function(response){
-					$scope.loading = false;
-					toaster.pop('error', '回复失败', response.data);
-				});
-			}
-		};
 	});
 	
 	/**

+ 3 - 0
src/main/webapp/resources/js/index/services/Purc.js

@@ -128,6 +128,9 @@ define([ 'ngResource'], function() {
 				method: 'POST'
 			}
 		});
+	}).factory('SaleSend', function($resource) {
+		return $resource('sale/notice/sends/:id', {}, {
+		});
 	}).factory('PurcForecast', function($resource) {
 		return $resource('sale/forecast/:id', {}, {
 		});

+ 3 - 3
src/main/webapp/resources/tpl/index/fa/left.html

@@ -29,12 +29,12 @@
 	</div>
 	<ul class="list-unstyled">
 		<li ng-class="{'active': active=='apbill'}"><a ui-sref="fa.apbill">客户应付发票</a></li>
-		<li><a href="#">添加自定义菜单</a><i class="fa fa-plus icon-right"></i></li>
+		<li><a href="#">添加自定义菜单<span class="pull-right"><i class="fa fa-plus icon-right"></i></span></a></li>
 	</ul>
 </div>
 <div class="left-nav">
 	<ul class="list-unstyled">
-		<li><a href="#">问题反馈</a><i class="fa fa-bell-o icon-right"></i></li>
-		<li><a href="#">客服中心</a><i class="fa fa-headphones icon-right"></i></li>
+		<li><a href="#">问题反馈<span class="pull-right"><i class="fa fa-bell-o icon-right"></i></span></a></li>
+		<li><a href="#">客服中心<span class="pull-right"><i class="fa fa-headphones icon-right"></i></span></a></li>
 	</ul>
 </div>

+ 3 - 3
src/main/webapp/resources/tpl/index/qc/left.html

@@ -37,12 +37,12 @@
 		<i></i>自定义菜单
 	</div>
 	<ul class="list-unstyled">
-		<li><a href="#">添加自定义菜单</a><i class="fa fa-plus icon-right"></i></li>
+		<li><a href="#">添加自定义菜单<span class="pull-right"><i class="fa fa-plus icon-right"></i></span></a></li>
 	</ul>
 </div>
 <div class="left-nav">
 	<ul class="list-unstyled">
-		<li><a href="#">问题反馈</a><i class="fa fa-bell-o icon-right"></i></li>
-		<li><a href="#">客服中心</a><i class="fa fa-headphones icon-right"></i></li>
+		<li><a href="#">问题反馈<span class="pull-right"><i class="fa fa-bell-o icon-right"></i></span></a></li>
+		<li><a href="#">客服中心<span class="pull-right"><i class="fa fa-headphones icon-right"></span></i></a></li>
 	</ul>
 </div>

+ 268 - 0
src/main/webapp/resources/tpl/index/sale/send.html

@@ -0,0 +1,268 @@
+<style>
+.order-table .header>th {
+	height: 38px;
+	text-align: center;
+	background: #f5f5f5;
+	border-top: 1px solid #e8e8e8;
+	border-bottom: 1px solid #e8e8e8;
+}
+
+.order-table .sep-row {
+	height: 10px;
+}
+
+.order-table .selector {
+	vertical-align: middle;
+	margin: 0 0 2px 0;
+}
+
+.toolbar label {
+	margin-right: 10px;
+	margin-bottom: 0;
+}
+
+.toolbar .select_all {
+	margin: 0 6px 0 10px;
+	line-height: 20px;
+}
+
+.toolbar .btn {
+	-moz-border-radius: 2px;
+	margin-right: 5px;
+	border: 1px solid #dcdcdc;
+	border-radius: 2px;
+	-webkit-border-radius: 2px;
+}
+
+.order-table .order-hd {
+	background: #f5f5f5;
+	height: 40px;
+	line-height: 40px;
+}
+
+.order-table .order-hd td.first {
+	padding-left: 20px;
+}
+
+.order-table .order-hd .order-main span {
+	margin-right: 8px;
+}
+
+.order-table .order-hd .order-code {
+	font-style: normal;
+	font-family: verdana;
+}
+
+.order-table .order-hd .order-sum {
+	padding: 0 5px;
+}
+
+.order-table>tbody {
+	border: 1px solid transparent;
+}
+
+.order-table>tbody:hover {
+	border-color: #56a022;
+	border-width: 2px;
+}
+
+.order-table .operates {
+	display: none;
+}
+
+.order-table>tbody:hover .operates {
+	display: block;
+}
+
+.order-table .order-bd {
+	border-bottom: 1px solid #e6e6e6;
+}
+
+.order-table .order-bd>td {
+	padding: 10px 5px;
+	vertical-align: top;
+	position: relative;
+}
+
+.order-table .order-bd .product {
+	padding-left: 20px;
+}
+
+.input-xs,.input-group-xs>.form-control,.input-group-xs>.input-group-addon,.input-group-xs>.input-group-btn>.btn
+	{
+	height: 26px;
+	padding: 0 5px;
+	font-size: 12px;
+	line-height: 1.5;
+	border-radius: 3px;
+}
+
+.input-group-xs .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn {
+	border-top-left-radius: 0;
+	border-bottom-left-radius: 0;
+}
+
+</style>
+<div class="block">
+<div class="loading in" ng-class="{'in': loading}">
+	<i></i>
+</div>
+<div class="condition block">
+		<div class="row">
+			<div class="col-xs-4">
+				<div class="btn-group btn-group-sm btn-group-justified">
+					<div class="btn-group btn-group-sm">
+						<button type="button" class="btn btn-default btn-line"
+							ng-class="{'btn-info':active=='all'}" ng-click="setActive('all')">全部</button>
+					</div>
+				</div>
+			</div>
+			<div class="col-xs-6">
+				<div class="search">
+					<div class="form-group form-group-sm has-feedback">
+						<input type="search" class="form-control input-sm" placeholder="输入商品、客户名称或单据流水号搜索" /><span
+							class="form-control-feedback text-simple"><i
+							class="fa fa-search"></i></span>
+					</div>
+				</div>
+			</div>
+			<div class="col-xs-2 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" 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>
+			</form>
+		</div>
+	</div>
+<table class="order-table block" ng-table="tableParams">
+	<thead>
+		<tr class="header">
+			<th>商品</th>
+			<th>采购单价</th>
+			<th>验收数量</th>
+			<th width="120">入库批号</th>
+			<th width="140">单据信息</th>
+			<th width="70">操作</th>
+		</tr>
+		<tr class="sep-row">
+			<td colspan="6"></td>
+		</tr>
+		<tr class="toolbar toolbar-top">
+			<td colspan="6">
+				<div>
+					<label><input type="checkbox" class="selector select_all"
+						ng-model="selectAll">全选</label> <a href="javascript:void(0)"
+						class="btn btn-default btn-xs">批量回复</a>
+				</div> <!-- 分页 -->
+			</td>
+		</tr>
+		<tr class="sep-row">
+			<td colspan="6"></td>
+		</tr>
+	</thead>
+	<tbody ng-repeat="accept in $data">
+		<tr class="order-hd">
+			<td class="first">
+				<div class="order-main">
+					<span> <input type="checkbox" class="selector"
+						ng-model="accept.$selected">
+					</span> <span class="text-num text-bold" title="{{accept.date | date: 'yyyy年MM月dd日 hh:mm'}}"
+						ng-bind="accept.date | date:'yyyy-MM-dd'"></span> <span>流水号:<a
+						class="text-num" ng-bind="accept.code" href="#"></a></span>
+				</div>
+			</td>
+			<td colspan="3"><a title="客户名称" href="#"
+				ng-bind="accept.acceptItems[0].orderItem.order.enterprise.enName"></a></td>
+			<td colspan="1" class="order-sum">
+				<a ng-if="accept.sendCode != null" title="送货单号" href="#"> <i style="color: #CC9933;" class="fa fa-truck"></i> <span ng-bind="accept.sendCode"></span></a>
+			</td>
+			<td colspan="1" class="text-center">
+				<div class="operates">
+					<a href="#" class="text-muted" title="打印">
+						<i class="fa fa-print fa-lg fa-fw"></i>
+					</a>
+				</div>
+			</td>
+		</tr>
+		<tr class="order-bd" ng-repeat="item in accept.acceptItems">
+			<td class="product">
+				<div class="text-num text-bold">
+					<a href="#" ng-bind="item.orderItem.product.code"></a>
+				</div>
+				<div>
+					<a href="#" ng-bind="item.orderItem.product.title"></a>
+				</div>
+				<div class="text-muted" title="{{item.orderItem.product.spec}}"
+					ng-bind="item.orderItem.product.spec"></div>
+			</td>
+			<td class="text-center">
+				<div class="text-num"
+					title="{{item.orderPrice}}" ng-bind="item.orderPrice | currency: currency(accept.currency)"></div>
+			</td>
+			<td class="text-center">
+				<div class="text-num text-bold"
+					title="{{item.qty}}" ng-bind="item.qty"></div>
+				<div class="text-muted" ng-bind="item.orderItem.product.unit"></div>
+			</td>
+			<td class="text-center br-l">
+				<div class="text-num"
+					ng-bind="item.batchCode"></div>
+			</td>
+			<td class="br-l" colspan="2">
+				<div>单据编号:<a href="#" ng-bind="item.orderItem.order.code"></a></div>
+				<div>
+					第 <span ng-bind="item.orderItem.number"></span> 行
+					&nbsp;&nbsp;&nbsp;&nbsp;数量:<span ng-bind="item.orderItem.qty"></span>
+				</div>
+			</td>
+		</tr>
+	</tbody>
+</table>
+</div>