Browse Source

客户应付发票

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@614 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
suntg 11 years ago
parent
commit
be954d842b

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

@@ -147,6 +147,10 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ui.
 					templateUrl : "static/tpl/index/fa/right.html"
 				}
 			}
+		}).state('fa.apBill', {
+			url : "/apBill",
+			templateUrl : "static/tpl/index/fa/apBill.html",
+			controller: 'SaleApBillCtrl'
 		});
 	});
 	
@@ -1099,6 +1103,68 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ui.
 		
 	});
 	
+	/**
+	 * 客户应付发票
+	 */
+	app.controller('SaleApBillCtrl', function($scope, $rootScope, $filter, PurcApBill, ngTableParams, toaster, BaseService, Symbol){
+		$rootScope.active = 'apBill';
+		$scope.active = 'all';
+		$scope.agreedText = '全部';
+		$scope.dateZoneText = '一个月内';
+		$scope.condition = {dateZone: 1};
+		$scope.currency = Symbol.currency;//将币别转化为对应的符号
+		$scope.changeAgreed = function(agreed) {
+			$scope.condition.agreed = agreed;
+			$scope.agreedText = typeof agreed == 'undefined' ? '全部' : (agreed == 1 ? '已同意' : '不同意');
+			$scope.condition.$agreedOpen = false;
+		};
+		$scope.changeDateZone = function(zone) {
+			$scope.condition.dateZone = zone;
+			$scope.dateZoneText = typeof zone == 'undefined' ? '半年前' : (zone == 1 ? '一个月内' : '半年内');
+			$scope.condition.$dateZoneOpen = false;
+		};
+		$scope.setActive = function(state) {
+			if($scope.active != state) {
+				$scope.active = state;
+				if($scope.tableParams.page() == 1)
+					$scope.tableParams.reload();
+				else
+					$scope.tableParams.page(1);
+			}
+		};
+		var getService = function() {
+			return PurcApBill;
+		};
+		
+		$scope.tableParams = new ngTableParams({
+			page : 1, 
+			count : 5,
+			sorting: {
+                date: 'desc' 
+            }
+		}, {
+			total : 0, 
+			counts: [5, 10, 25, 50],
+			getData : function($defer, params) {
+				$scope.loading = true;
+				getService()[getState($scope.active)].call(null, BaseService.parseParams(params.url()), function(page){
+					$scope.loading = false;
+					if(page) {
+						params.total(page.totalElements);
+						$defer.resolve(page.content);
+					}
+				});
+			}
+		});
+		
+		$scope.openDatePicker = function($event, item, openParam) {
+			$event.preventDefault();
+		    $event.stopPropagation();
+		    item[openParam] = !item[openParam];
+		};
+		
+	});
+	
 	/**
 	 * 计算时间差
 	 */

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

@@ -136,6 +136,9 @@ define([ 'ngResource' ], function() {
 	}).factory('PurcMRB', function($resource) {
 		return $resource('sale/MRB/:id', {}, {
 		});
+	}).factory('PurcApBill', function($resource) {
+		return $resource('sale/apBill/:id', {}, {
+		});
 	}).factory('PurcOrderItemHis', function($resource) {
 		return $resource('sale/orders/history/items', {}, {
 			getTodo: {

+ 284 - 0
src/main/webapp/resources/tpl/index/fa/apBill.html

@@ -0,0 +1,284 @@
+<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;
+	font-size: 15px;
+	font-weight: bold;
+	color: #CC0000;
+}
+
+.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="bill in $data">
+		<tr class="order-hd">
+			<td class="first">
+				<div class="order-main">
+					<span> <input type="checkbox" class="selector"
+						ng-model="bill.$selected">
+					</span> <span class="text-num text-bold" title="{{bill.date | date: 'yyyy年MM月dd日 hh:mm'}}"
+						ng-bind="bill.date | date:'yyyy-MM-dd'"></span> <span>流水号:<a
+						class="text-num" ng-bind="bill.code" href="#"></a></span>
+				</div>
+			</td>
+			<td colspan="3"><a title="客户名称" href="#"
+				ng-bind="bill.enterprise.enName"></a></td>
+			<td colspan="1" class="order-sum">
+				<span title="票据总额">
+					<span class="text-num" ng-bind="bill.apAmount | currency: currency(bill.currency)"></span>
+				</span>
+			</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 bill.items">
+			<td class="product">
+				<div class="text-num text-bold">
+					<a href="#" ng-bind="item.product.code"></a>
+				</div>
+				<div>
+					<a href="#" ng-bind="item.product.title"></a>
+				</div>
+				<div class="text-muted" title="{{item.product.spec}}"
+					ng-bind="item.product.spec"></div>
+			</td>
+			<td class="text-center">
+				<div class="text-num"
+					title="{{item.price}}" ng-bind="item.price | currency: currency(bill.currency)"></div>
+				<div>&nbsp;</div>
+				<div class="text-muted"
+					title="{{'税率:' + item.taxrate + '%'}}" ng-bind="'税率:' + item.taxrate + '%'">
+					税率:<span class="text-num" ng-bind="item.taxrate"></span>%
+				</div>
+			</td>
+			<td class="text-center">
+				<div class="text-num"
+					title="{{item.qty}}" ng-bind="item.qty"></div>
+				<div class="text-muted" ng-bind="item.product.unit"></div>
+			</td>
+			<td class="text-center br-l">
+				<div class="text-num text-bold"
+					ng-bind="item.apAmount | currency: currency(bill.currency)"></div>
+				<div>&nbsp;</div>
+				<div class="text-muted">
+					税金:<span class="text-num"
+					ng-bind="item.taxAmount | currency: currency(bill.currency)"></span>
+				</div>
+			</td>
+			<td class="br-l" colspan="2">
+				<div>单据编号:<a href="#" ng-bind="item.orderCode"></a></div>
+				<div>
+					第 <span ng-bind="item.orderDetno"></span> 行
+					&nbsp;&nbsp;&nbsp;&nbsp;数量:<span ng-bind="item.thisvoQty"></span>
+				</div>
+				<div class="text-muted">单据金额:<span ng-bind="item.amount | currency: currency(bill.currency)"></span></div>
+			</td>
+		</tr>
+	</tbody>
+</table>
+</div>

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

@@ -4,6 +4,14 @@
 			class="glyphicon glyphicon-home icon-left"></span>对账</a>
 	</div>
 </div>
+<div class="left-nav">
+	<div class="nav-label">
+		<i></i>财务对账
+	</div>
+	<ul class="list-unstyled">
+		<li ng-class="{'active': active=='apBill'}"><a ui-sref="fa.apBill">客户应付发票</a></li>
+	</ul>
+</div>
 <div class="left-nav">
 	<div class="nav-label">
 		<i></i>增值服务
@@ -17,7 +25,7 @@
 </div>
 <div class="left-nav">
 	<div class="nav-label">
-		<i></i>财务对账
+		<i></i>自定义菜单
 	</div>
 	<ul class="list-unstyled">
 		<li ng-class="{'active': active=='apbill'}"><a ui-sref="fa.apbill">客户应付发票</a></li>

+ 1 - 0
src/main/webapp/resources/tpl/index/fa/right.html

@@ -0,0 +1 @@
+<div ui-view class="sale-view"></div>

+ 2 - 2
src/main/webapp/resources/tpl/index/qc/MRB.html

@@ -252,8 +252,8 @@
 				</div>
 			</td>
 			<td>
-				<div class="text-success">合  格:<span ng-bind="MRB.okQty"></span></div>
-				<div class="text-danger">不合格:<span ng-bind="MRB.ngQty"></span></div>
+				<div class="text-success text-bold">合  格:<span ng-bind="MRB.okQty"></span></div>
+				<div class="text-danger text-bold">不合格:<span ng-bind="MRB.ngQty"></span></div>
 			</td>
 			<td class="text-center br-l">
 				<div class="label label-primary"

+ 1 - 1
src/main/webapp/resources/tpl/index/qc/badIn.html

@@ -247,7 +247,7 @@
 					title="{{item.orderPrice}}" ng-bind="item.orderPrice | currency: currency(badIn.currency)"></div>
 			</td>
 			<td class="text-center">
-				<div class="text-num"
+				<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>

+ 1 - 1
src/main/webapp/resources/tpl/index/qc/badOut.html

@@ -247,7 +247,7 @@
 					title="{{item.orderPrice}}" ng-bind="item.orderPrice | currency: currency(badOut.currency)"></div>
 			</td>
 			<td class="text-center">
-				<div class="text-num"
+				<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>

+ 1 - 1
src/main/webapp/resources/tpl/index/sale/accept.html

@@ -247,7 +247,7 @@
 					title="{{item.orderPrice}}" ng-bind="item.orderPrice | currency: currency(accept.currency)"></div>
 			</td>
 			<td class="text-center">
-				<div class="text-num"
+				<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>

+ 1 - 1
src/main/webapp/resources/tpl/index/sale/returns.html

@@ -247,7 +247,7 @@
 					title="{{item.orderPrice}}" ng-bind="item.orderPrice | currency: currency(returns.currency)"></div>
 			</td>
 			<td class="text-center">
-				<div class="text-num"
+				<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>