-
Notifications
You must be signed in to change notification settings - Fork 2
/
order_view_datail.php
173 lines (149 loc) · 5.08 KB
/
order_view_datail.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<?php
/*
* @auther lion
* @date 2013-2-5
*/
require_once 'class/supplier.class.php';
require_once 'class/supplier_service.class.php';
require_once 'class/order_goods.class.php';
require_once 'class/order_service.class.php';
require_once 'class/code_names.class.php';
$supplier_service=new SupplierService();
$order = unserialize ( $_SESSION ['order'] );
$id = $order->id;
$order_number = $order->order_number;
$supplier_id = $order->supplier_id;
$supplier=$supplier_service->getSupplierById($supplier_id);
$supplier_name=$supplier->supplier_name;
$status = $order->status;
$note = $order->note;
unset ( $_SESSION ["order"] );
$_SESSION ['id'] = $id;
$order_service=new OrderService();
$array_order_goods=$order_service->getGoodsByOrderId($id);
?>
<div class="span12" style="margin-left: auto;margin-right: auto;">
<h3 style="float:left">采购单信息</h3>
<div style="float:right;margin-top:12px">
<a class='btn btn-primary' href='./index.php?mod=order&action=edit_get&eid=<?php echo $id?>'>修改</a>
<a class="btn" href="javascript:history.go(-1);">返回</a>
</div>
<table class="table table-bordered table-hover ">
<thead >
<tr><th colspan="4">基本信息</th>
</tr>
</thead>
<tr>
<td >采购单号</td><td ><?php echo $order_number?></td>
<td >供应商名称</td><td ><?php echo $supplier_name?></td>
</tr>
<tr >
<td >订单状态</td><td colspan="3"><?php echo CodeNames::$order_status[$status]?></td>
</tr>
<tr >
<td >备注</td><td colspan="3"><?php echo $note?></td>
</tr>
</table>
</div>
<?php
require_once 'class/sub_pages.class.php';
if(isset($_GET["p"]))
$pageCurrent=$_GET["p"];
else
$pageCurrent=1;
//每页显示的条数
$page_size=10;
//总条目数
//每次显示的页数
$sub_pages=10;
$url=sprintf("index.php?mod=order&action=detail&did=%d&p=",$id);
$array_order_goods=$order_service->getGoodsByOrderIdSubPage($pageCurrent,$page_size,$id);
$nums=$order_service->getGoodsByOrderIdCount($id);
?>
<ul class="nav nav-tabs">
<li class="active">
<a href="#">采购单商品信息</a>
</li>
<a href="#addGoods" role="button" class='btn btn-primary' data-toggle="modal" style="float: right;">添加采购单产品</a>
</ul>
<table class="table table-bordered table-striped table-hover table-condensed" >
<thead >
<tr><th >商品名称</th>
<th >商品编号</th>
<th >商品数量</th>
<th >是否缺货</th>
</tr>
</thead>
<tbody>
<?php
foreach ($array_order_goods as $order_goods){
$is_out_of_stock_name;
if($order_goods->is_out_of_stock){
$is_out_of_stock_name='是';
}else{
$is_out_of_stock_name='否';
}
echo "<tr>
<td>
<a href='./index.php?mod=goods&action=detail&did=$order_goods->goods_id'>$order_goods->goods_name</a>
</td>
<td>$order_goods->system_number</td>
<td>$order_goods->goods_number</td>
<td>$is_out_of_stock_name</td>
</tr>" ; };
?>
</tbody>
</table>
<?php
$subPages=new SubPages($page_size,$nums,$pageCurrent,$sub_pages,$url);
require_once 'class/goods.class.php';
require_once 'class/goods_service.class.php';
$goods_service=new GoodsService();
$array_goods=$goods_service->getGoodsBySupplierIdNotInOrder($supplier_id, $id);
?>
<!-- Modal -->
<div id="addGoods" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">添加供应商产品</h3>
</div>
<div class="modal-body">
<form class="form-horizontal" action="./index.php?mod=order&action=detail_post&did=<?=$id?>" method="post">
<div class="control-group">
<input name="order_id" type="hidden" value="<?=$id?>">
<table class="table table-bordered table-striped table-hover table-condensed" id="table" >
<thead >
<tr><th >商品名称</th>
<th >商品编号</th>
<th >商品数量</th>
</tr>
</thead>
<tbody>
<?php
foreach ($array_goods as $goods){
echo "<tr>
<td>
<label class='checkbox'>
<input type='checkbox' id='goods_id' name='goods_id[]' value='$goods->id'><a href='./index.php?mod=goods&action=detail&did=$goods->id'>$goods->goods_name</a>
</label>
</td>
<td>$goods->system_number</td>
<td><input class='input-small' type='text' name='goods_number[]' id='goods_number' /></td>
</tr>" ; };
?>
</tbody>
</table>
<input style="display:none" id="submit" type="submit" class="btn btn-primary" />
</div>
</form>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
<button id="save" class="btn btn-primary" data-dismiss="modal">保存</button>
</div>
</div>
<script type="text/javascript">
$('#save').click(function(){
$('#submit').click();
});
</script>