index.php
12.9 KB
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<?php
use yii\helpers\Url;
use app\ht\widgets\LinkPager;
use domain\trade\workorder\WorkOrderStatus;
$this->title = '工单列表';
$this->params['breadcrumbs'][] = '工单管理';
$this->params['breadcrumbs'][] = $this->title;
?>
<script src="<?= Yii::$app->request->baseUrl . "/exts/combo-select/js/jquery.combo.select.js"?>"></script>
<link rel="stylesheet" type="text/css" href="<?= Yii::$app->request->baseUrl . "/exts/combo-select/css/combo.select.css"?>" />
<style>
.btncls{margin:0 10px!important;}
.combo-select{margin-bottom: 0; width: 100%; text-align: left}
</style>
<div class="panel panel-default">
<div class="panel-body" style="overflow-y: auto">
<form action="" method="get" id="search-form" class="filter-form">
<table width="100%" class="table table-bordered">
<tbody>
<tr >
<td width="10%" class="text-right">订单编号:</td>
<td width="10%" class="text-left"><input type="text" class="form-control" name="order_no" id="order_no" value="<?php if (!empty($gets['order_no'])){ echo $gets['order_no']; } ?>"></td>
<td width="10%" class="text-right">下单时间(起):</td>
<td width="20%" class="text-left"><input type="date" class="form-control" name="time_start" id="time_start" value="<?php if (!empty($gets['time_start'])){ echo $gets['time_start']; } ?>"></td>
<td width="10%" class="text-right">下单时间(止):</td>
<td width="20%" class="text-left"><input type="date" class="form-control" name="time_end" id="time_end" value="<?php if (!empty($gets['time_end'])){ echo $gets['time_end']; } ?>"></td>
</tr>
<tr >
<td class="text-right">工程师姓名(电话):</td>
<td class="text-left"><input type="text" class="form-control" name="engineer_name" id="engineer_name" value="<?php if (!empty($gets['engineer_name'])){ echo $gets['engineer_name']; } ?>"></td>
<td class="text-right">报修城市:</td>
<td class="text-left">
<input type="text" class="form-control" name="address" id="address" value="<?php if (!empty($gets['address'])){ echo $gets['address']; } ?>" <?php if (empty($gets['is_accurate'])) { ?> style="display: none" <?php }?>>
<select class="form-control" id="selcity" name="selcity" <?php if (isset($gets['is_accurate']) && $gets['is_accurate'] == 1) { ?> style="display: none" <?php }?>>
<option value="">全部</option>
<?php foreach ($citys as $city) : ?>
<option value="<?=$city->city ?>" <?php if ($gets['selcity'] == $city->city) { echo "selected"; } ?>><?=$city->city ?></option>
<?php endforeach; ?>
</select>
<input type="checkbox" class="form-control" style="width:30px;float: left;" <?php if (isset($gets['is_accurate']) && $gets['is_accurate'] == 1) { ?>checked="checked"<?php } ?> id="chkAccurate" name="chkAccurate" value="1"/>
<span style="float: left; margin-top: 3px; margin-left: 10px;">模糊查找</span>
</td>
<td class="text-right">用工类型:</td>
<td class="text-right">
<select class="form-control" id="employ_type" name="employ_type">
<option value="" <?php if (empty($gets['employ_type'])){ echo "selected"; } ?>>全部</option>
<option value="监控安防" <?php if ($gets['employ_type'] == '监控安防'){ echo "selected"; } ?>>监控安防</option>
<option value="网络布线" <?php if ($gets['employ_type'] == '网络布线'){ echo "selected"; } ?>>网络布线</option>
<option value="设备安装" <?php if ($gets['employ_type'] == '设备安装'){ echo "selected"; } ?>>设备安装</option>
</select>
</td>
</tr>
<tr >
<td class="text-right">工单状态:</td>
<td class="text-right">
<select class="form-control" id="status" name="status">
<option value="" <?php if (empty($gets['status'])){ echo "selected"; } ?>>全部</option>
<option value="<?= WorkOrderStatus::STATUS_PICKING ?>" <?php if ($gets['status'] == WorkOrderStatus::STATUS_PICKING ){ echo "selected"; } ?>><?= WorkOrderStatus::label(WorkOrderStatus::STATUS_PICKING) ?></option>
<option value="<?= WorkOrderStatus::STATUS_FINISH ?>" <?php if ($gets['status'] == WorkOrderStatus::STATUS_FINISH ){ echo "selected"; } ?>><?= WorkOrderStatus::label(WorkOrderStatus::STATUS_FINISH) ?></option>
</select>
</td>
<td class="text-right"></td>
<td class="text-right"></td>
<td class="text-right"></td>
<td class="text-left"></td>
</tr>
<tr class="search">
<td colspan="6" class="text-center">
<button type="submit" class="btn btn-primary btncls" id="search"><i class="glyphicon glyphicon-search"></i> 查 询 </button>
<a class="btn btn-default btncls" href="<?=Url::toRoute(["/trade/work-order/index", "status" => $gets['status']])?>">重 置</a>
<a class="btn btn-success btncls" id="exportBtn" href="javascript:void(0)">导出订单报表</a>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
<ul id="countryTab" class="nav nav-tabs" style="margin-bottom: 20px">
<li <?php if (empty($gets['status'])){ echo "class=\"active\""; } ?> ><a style="padding: 10px 20px;" href="<?=Url::current(['status' => 0])?>" >全部</a></li>
<li <?php if ($gets['status'] == WorkOrderStatus::STATUS_PICKING){ echo "class=\"active\""; } ?> ><a style="padding: 10px 12px;" href="<?=Url::current(['status' => WorkOrderStatus::STATUS_PICKING])?>" ><?= WorkOrderStatus::label(WorkOrderStatus::STATUS_PICKING) ?></a></li>
<li <?php if ($gets['status'] == WorkOrderStatus::STATUS_FINISH){ echo "class=\"active\""; } ?> ><a style="padding: 10px 12px;" href="<?=Url::current(['status' => WorkOrderStatus::STATUS_FINISH])?>" ><?= WorkOrderStatus::label(WorkOrderStatus::STATUS_FINISH) ?></a></li>
</ul>
<div style="overflow-y: auto">
<?php if (!empty($orderList)) : ?>
<table class="table table-striped table-bordered" id="brand-table">
<thead>
<tr>
<th style="width:10%;">订单ID</th>
<th style="width:20%;">订单信息</th>
<th style="width:10%;">用工类型</th>
<th style="width:8%;">用工人数</th>
<th style="width:8%;">单位时间用工费用</th>
<th style="width:8%;">服务费金额</th>
<th style="width:8%;">已接单人数</th>
<th style="width:8%;">是否支付</th>
<th style="width:8%;">订单状态</th>
<th style="width:22%;">操作</th>
</tr>
</thead>
<tbody>
<?php foreach ($orderList as $order) : ?>
<tr>
<td class="text-center align-middle hqy-row-select"><?=$order['id'] ?></td>
<td >
订单编号:<span style="font-weight: bold; color: #C40000; margin-left: 10px;"><?= $order['order_no'] ?></span><br/>
下单账户姓名:<span style="font-weight: bold; margin-left: 10px;"><?= $order['realname'] ?></span><br/>
下单账户昵称:<span style="font-weight: bold; margin-left: 10px;"><?= $order['nickname'] ?></span><br/>
下单账户电话:<span style="font-weight: bold; margin-left: 10px;"><?=$order['phone'] ?></span><br/>
结算方式:<?= ($order['pay_type'] == 1) ? "按天" : "按小时" ?><br/>
用工地址:<span style="font-weight: bold; margin-left: 10px;"> <?php echo $order['address'] . "(" . $order['address_title'] . ")"; ?></span><br/>
用工开始时间:<span style="font-weight: bold; margin-left: 10px;"><?=date("Y-m-d H:i:s", $order['start_at']) ?></span><br/>
用工结束时间:<span style="font-weight: bold; margin-left: 10px;"><?=date("Y-m-d H:i:s", $order['end_at']) ?></span><br/>
订单时间:<span style="font-weight: bold; margin-left: 10px;"><?=date("Y-m-d H:i:s", $order['created_at']) ?></span><br/>
</td>
<td><?= $order['employ_type'] ?></td>
<td><?= $order['employ_num'] ?></td>
<td><?= $order['pay_unit_fee'] ?></td>
<td>
单位服务费金额:<?= $order['service_unit_fee'] ?><br/>
服务费金额:<?= $order['service_fee'] ?><br/>
实付服务费金额:<?= $order['pay_service_fee'] ?>
</td>
<td><?= $order['pickcont'] ?> 人 </td>
<td><?= ($order['has_pay'] == 1) ? "是" : "否" ?></td>
<td><?= WorkOrderStatus::label($order['status'])?></td>
<td >
<a class="btn btn-primary" style="margin: 4px;" href="<?php echo Url::toRoute(['/trade/work-order/info', 'id' => $order['id']]) ?>">查看详情</a>
<?php if (WorkOrderStatus::STATUS_PICKING == $order['status']) { ?>
<span class="btn btn-warning btn-close-workorder" style="margin: 4px;" data-id = "<?=$order['id'] ?>">关闭工单</span>
<?php } ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php else : ?>
<p class="text-center">
没有找到数据
</p>
<?php endif; ?>
</div>
<div class="panel-footer">
<div class="hqy-panel-pager">
<?= LinkPager::widget([
'pagination' => $pages,
]); ?>
<div class="clearfix"></div>
</div>
</div>
</div>
<script>
$(function(){
$('#customerName').comboSelect();
var getUrl ='<?=Url::toRoute("/trade/work-order/export-da")?>';
var filterUrl ='<?=Url::toRoute("/trade/work-order/index")?>';
$(function(){
$('#exportBtn').click(function(e){
$('#search-form').attr('action',getUrl);
$('#search-form').submit();
return false;
})
//
$('#search').click(function(e){
$('#search-form').attr('action',filterUrl);
$('#search-form').submit();
return false;
})
})
// 是否精准查找
$("#chkAccurate").change(function () {
var checked = $(this).is(':checked');
if (checked) {
$("#selcity").hide();
$("#address").show();
} else {
$("#selcity").show();
$("#address").hide();
}
})
$(".btn-close-workorder").bind("click", function () {
var id = $(this).attr("data-id");
if (id == null || id == ""){
alert("丢失标记信息,无法关闭订单");
return false;
}
if (confirm("是否确定要关闭该工单?")) {
var l = $.ladda(this);
$.ajax({
type: "post",
url: "close-work-order",
dataType:"json",
data: $.csrf({"id":id}),
success:function(msg){
if (msg['status'] == 1){
location.reload();
}else{
}
},
beforeSend: function () {
// 开始显示
l.start();
},
complete: function () {
// 取消加载提示
l.stop();
},
error:function(msg){
}
});
}
});
})
</script>