index.php
23.5 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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
<?php
use yii\helpers\Url;
use app\ht\widgets\LinkPager;
use domain\trade\RepairOrderStatus;
use common\business\SuspendOrder;
$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="order_begin" id="order_begin" value="<?php if (!empty($gets['order_begin'])){ echo $gets['order_begin']; } ?>"></td>
<td width="10%" class="text-right">下单时间(止):</td>
<td width="20%" class="text-left"><input type="date" class="form-control" name="order_end" id="order_end" value="<?php if (!empty($gets['order_end'])){ echo $gets['order_end']; } ?>"></td>
</tr>
<tr >
<td class="text-right">客户姓名:</td>
<td class="text-left"><input type="text" class="form-control" name="customer_name" id="customer_name" value="<?php if (!empty($gets['customer_name'])){ echo $gets['customer_name']; } ?>"></td>
<td class="text-right">客户电话:</td>
<td class="text-left"><input type="text" class="form-control" name="customer_phone" id="customer_phone" value="<?php if (!empty($gets['customer_phone'])){ echo $gets['customer_phone']; } ?>"></td>
<td class="text-right">设备拥有者:</td>
<td class="text-left"><input type="text" class="form-control" name="owner_name" id="owner_name" value="<?php if (!empty($gets['owner_name'])){ echo $gets['owner_name']; } ?>"></td>
</tr>
<tr >
<td class="text-right">设备类型:</td>
<td class="text-right">
<select class="form-control" id="seldevicetype" name="seldevicetype">
<option value="" <?php if (empty($gets['devicetype'])){ echo "selected"; } ?>>全部</option>
<option value="1" <?php if ($gets['devicetype'] == 1){ echo "selected"; } ?>>用户设备</option>
<option value="2" <?php if ($gets['devicetype'] == 2){ echo "selected"; } ?>>游客设备</option>
</select>
</td>
<td class="text-right">设备名称:</td>
<td class="text-right"><input type="text" class="form-control" name="repair_device_name" id="repair_device_name" value="<?php if (!empty($gets['repair_device_name'])){ echo $gets['repair_device_name']; } ?>"></td>
<td class="text-right">接单工程师:</td>
<td class="text-left">
<input type="hidden" name="order_status" id="order_status" value="<?=$gets['order_status']?>" />
<input class="form-control" name="engineer" id="engineer" value="<?=$gets['engineer']?>" autocomplete="off"/>
</td>
</tr>
<tr >
<td class="text-right">报修城市:</td>
<td class="text-left">
<input type="text" class="form-control" name="city" id="city" value="<?php if (!empty($gets['city'])){ echo $gets['city']; } ?>" <?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-left">
<select class="form-control" id="isFreeCommission" name="isFreeCommission">
<option value="" <?php if (empty($gets['isFreeCommission'])){ echo "selected"; } ?>>全部</option>
<option value="1" <?php if ($gets['isFreeCommission'] == 1){ echo "selected"; } ?>>是</option>
<option value="2" <?php if ($gets['isFreeCommission'] == 2){ echo "selected"; } ?>>否</option>
</select>
</td>
<td class="text-right">是否回访:</td>
<td class="text-left">
<select class="form-control" id="selfinished" name="selfinished">
<option value="" <?php if (empty($gets['selfinished'])){ echo "selected"; } ?>>全部</option>
<option value="1" <?php if ($gets['selfinished'] == 1){ echo "selected"; } ?>>是</option>
<option value="2" <?php if ($gets['selfinished'] == 2){ echo "selected"; } ?>>否</option>
</select>
</td>
</tr>
<tr >
<td class="text-right">客服人员:</td>
<td class="text-right">
<select class="form-control" id="customerName" name="customerName">
<option value="">全部</option>
<?php foreach ($sysUserList as $user) : ?>
<option value="<?=$user->realname ?>" <?php if ($gets['customerName'] == $user->realname) { echo "selected"; } ?>><?=$user->realname ?></option>
<?php endforeach; ?>
</select>
</td>
<td class="text-right">感谢费:</td>
<td class="text-left">
<select class="form-control" id="thankFee" name="thankFee">
<option value="" <?php if (empty($gets['thankFee'])){ echo "selected"; } ?>>全部</option>
<?php foreach($thank_fee_list as $k => $v): ?>
<option value="<?=$v['id']?>" <?php if ($gets['thankFee'] == $v['id']){ echo "selected"; } ?>><?=$v['title']?></option>
<?php endforeach;?>
</select>
</td>
<td class="text-right">报修渠道:</td>
<td class="text-left">
<select class="form-control" id="repairChannel" name="repairChannel">
<option value="" <?php if (empty($gets['repairChannel'])){ echo "selected"; } ?>>全部</option>
<?php foreach($repair_channels as $channel => $label): ?>
<option value="<?=$channel?>" <?php if ($gets['repairChannel'] == $channel){ echo "selected"; } ?>><?=$label?></option>
<?php endforeach;?>
</select>
</td>
</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/order/index", "order_status" => $gets['order_status']])?>">重 置</a>
<a class="btn btn-success btncls" id="exportBtn" href="javascript:void(0)">导出订单报表</a>
<a class="btn btn-success btncls" href="<?=Url::toRoute("/marketing/second-order/user-index")?>">二次订单分析</a>
<span><input type="checkbox" value="1" style="width: 25px;" name="chk_second_order" id="chk_second_order"> 导出二次订单</span>
<a class="btn btn-warning btncls" href="<?=Url::toRoute("/trade/order/delay")?>">异常订单 (<?= $delayOrderNum; ?>)</a>
<a class="btn btn-primary btncls" href="<?=Url::toRoute("/trade/order-consult/index")?>">电话咨询的订单</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['order_status'])){ echo "class=\"active\""; } ?> ><a style="padding: 10px 20px;" href="<?=Url::current(['uid' => $gets['uid'], 'order_status' => 0])?>" >全部</a></li>
<li <?php if ($gets['order_status'] == -1){ echo "class=\"active\""; } ?> ><a style="padding: 10px 12px;" href="<?=Url::current(['uid' => $gets['uid'], 'order_status' => '-1'])?>" >等待接单</a></li>
<li <?php if ($gets['order_status'] == RepairOrderStatus::STATUS_WAIT_DOOR){ echo "class=\"active\""; } ?> ><a style="padding: 10px 12px;" href="<?=Url::current(['uid' => $gets['uid'], 'order_status' => RepairOrderStatus::STATUS_WAIT_DOOR])?>" >等待上门</a></li>
<li <?php if ($gets['order_status'] == RepairOrderStatus::STATUS_WAIT_PRICE){ echo "class=\"active\""; } ?> ><a style="padding: 10px 12px;" href="<?=Url::current(['uid' => $gets['uid'], 'order_status' => RepairOrderStatus::STATUS_WAIT_PRICE])?>" >等待报价</a></li>
<li <?php if ($gets['order_status'] == RepairOrderStatus::STATUS_CONFIRM_PRICE){ echo "class=\"active\""; } ?> ><a style="padding: 10px 12px;" href="<?=Url::current(['uid' => $gets['uid'], 'order_status' => RepairOrderStatus::STATUS_CONFIRM_PRICE])?>" >确认报价</a></li>
<li <?php if ($gets['order_status'] == RepairOrderStatus::STATUS_WAIT_ACCEPT){ echo "class=\"active\""; } ?> ><a style="padding: 10px 12px;" href="<?=Url::current(['uid' => $gets['uid'], 'order_status' => RepairOrderStatus::STATUS_WAIT_ACCEPT])?>" >等待验收</a></li>
<li <?php if ($gets['order_status'] == RepairOrderStatus::STATUS_WAIT_PAY){ echo "class=\"active\""; } ?> ><a style="padding: 10px 12px;" href="<?=Url::current(['uid' => $gets['uid'], 'order_status' => RepairOrderStatus::STATUS_WAIT_PAY])?>" >等待支付</a></li>
<li <?php if ($gets['order_status'] == RepairOrderStatus::STATUS_WAIT_RATE){ echo "class=\"active\""; } ?> ><a style="padding: 10px 12px;" href="<?=Url::current(['uid' => $gets['uid'], 'order_status' => RepairOrderStatus::STATUS_WAIT_RATE])?>" >等待评价</a></li>
<li <?php if ($gets['order_status'] == RepairOrderStatus::STATUS_SUSPEND){ echo "class=\"active\""; } ?> ><a style="padding: 10px 12px;" href="<?=Url::current(['uid' => $gets['uid'], 'order_status' => RepairOrderStatus::STATUS_SUSPEND])?>" >挂起</a></li>
<li <?php if ($gets['order_status'] == RepairOrderStatus::STATUS_FINISH){ echo "class=\"active\""; } ?> ><a style="padding: 10px 12px;" href="<?=Url::current(['uid' => $gets['uid'], 'order_status' => RepairOrderStatus::STATUS_FINISH])?>" >已完成</a></li>
<li <?php if ($gets['order_status'] == RepairOrderStatus::STATUS_USER_CANCEL){ echo "class=\"active\""; } ?> ><a style="padding: 10px 12px;" href="<?=Url::current(['uid' => $gets['uid'], 'order_status' => RepairOrderStatus::STATUS_USER_CANCEL])?>" >用户取消</a></li>
<li <?php if ($gets['order_status'] == RepairOrderStatus::STATUS_ENGINEER_CANCEL){ echo "class=\"active\""; } ?> ><a style="padding: 10px 12px;" href="<?=Url::current(['uid' => $gets['uid'], 'order_status' => RepairOrderStatus::STATUS_ENGINEER_CANCEL])?>" >工程师取消</a></li>
<!--li <?php /*if ($gets['order_status'] == RepairOrderStatus::STATUS_USER_CLOSE){ echo "class=\"active\""; } */?> ><a style="padding: 10px 12px;" href="<?//=Url::current(['uid' => $gets['uid'], 'order_status' => RepairOrderStatus::STATUS_USER_CLOSE])?>" >用户关闭</a></li-->
<!--li <?php /*if ($gets['order_status'] == RepairOrderStatus::STATUS_ENGINEER_CLOSE){ echo "class=\"active\""; } */?> ><a style="padding: 10px 12px;" href="<?//=Url::current(['uid' => $gets['uid'], 'order_status' => RepairOrderStatus::STATUS_ENGINEER_CLOSE])?>" >工程师关闭</a></li-->
<li <?php if ($gets['order_status'] == RepairOrderStatus::STATUS_SYSTEM_CLOSE){ echo "class=\"active\""; } ?> ><a style="padding: 10px 12px;" href="<?=Url::current(['uid' => $gets['uid'], 'order_status' => RepairOrderStatus::STATUS_SYSTEM_CLOSE])?>" >系统自动关闭</a></li>
<li <?php if ($gets['order_status'] == RepairOrderStatus::STATUS_ADMIN_CLOSE){ echo "class=\"active\""; } ?> ><a style="padding: 10px 12px;" href="<?=Url::current(['uid' => $gets['uid'], 'order_status' => RepairOrderStatus::STATUS_ADMIN_CLOSE])?>" >管理员关闭</a></li>
<li <?php if ($gets['order_status'] == RepairOrderStatus::STATUS_SYSTEM_DELETE){ echo "class=\"active\""; } ?> ><a style="padding: 10px 12px;" href="<?=Url::current(['uid' => $gets['uid'], 'order_status' => RepairOrderStatus::STATUS_SYSTEM_DELETE])?>" >无效订单</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:5%;">订单ID</th>
<th style="width:25%;">订单信息</th>
<th style="width:12%;">设备信息</th>
<th style="width:8%;">报修时间</th>
<th style="width:8%;">订单金额</th>
<th style="width:7%;">订单状态</th>
<th style="width:7%;">带走设备</th>
<th style="width:7%;">接单工程师</th>
<th style="width:8%;">客服信息</th>
<th style="width:20%;">操作</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;">
<?php if(empty($order['phone'])){?>
<?='未认领';?>
<?php } else {?>
<?= $order['nickname'] ?>(<?=$order['phone'] ?>)
<?php }?>
</span><br/>
联系信息:<span style="font-weight: bold; margin-left: 10px;"><?= $order['contact_name'] ?>(<?=$order['contact_phone'] ?>)</span><br/>
上门地址:<span style="font-weight: bold; margin-left: 10px;">
<?php if ($order['title'] == $order['address'] ) {echo $order['address'] .$order['address_detail']; } else { echo $order['title'] . $order['address_detail'].'('.$order['address'].')'; } ?></span><br/>
报修渠道:<span style="font-weight: bold; margin-left: 10px;"><?= $channels[$order['repair_channel']] ?></span><br/>
是否现场派单:<span style="font-weight: bold; margin-left: 10px;"><?php
if ($order['is_on_site'] == 1 ) {
echo "是";
if ($order['has_on_site_prior_dispatch'] == 1) {
echo ",派单";
} else {
echo ",未派单";
}
if ($order['on_site_engineer_id'] == $order['engineer_id']) {
echo ",工程师已接";
} else {
echo ",工程师未接";
}
} else {
echo "否";
}
?></span><br/>
</td>
<td>
设备名称:<a style="margin-left: 10px;" href="<?=$order['device_info_url']; ?>"><?=$order['repair_device_name']; ?></a><br/>
设备拥有者:<span style="font-weight: bold; margin-left: 10px;"><?= $order['ownername'] ?></span><br/>
设备绑定人:<span style="font-weight: bold; margin-left: 10px;"><?= !empty($order['bind_engineer_name']) ? $order['bind_engineer_name'] : $order['bind_engineer_nick_name'] ?></span><br/>
</td>
<td >
<?=Yii::$app->formatter->asTime($order['created_at'],"yyyy-MM-dd HH:mm:ss"); ?>
</td>
<td >
支付金额: <?= $order['pay_price'] ?><br/>
<span style="color:#C40000;">感谢费: <?= $order['thank_fee'] ?></span>
</td>
<td >
<?=$orderStatusList[$order['status']];?>
<?php if ($order['is_admin_close']==1){
echo "(管理员关闭)";}
else if ($order['is_user_close']==1){
echo "(用户处理关闭)";}
else if ($order['is_engineer_close']==1){
echo "(工程师处理关闭)";}
else if ($order['is_suspend'] != SuspendOrder::SUSPEND_STATUS_OFF){
echo SuspendOrder::suspendLabels($order['is_suspend']);}
?><br/>
</td>
<td >
<?=$order["is_take_away_label"] ? $order["is_take_away_label"] : "未带走" ?>
</td>
<td>
<?php if (!empty($order['engineer_name'])): ?>
<?= $order['engineer_name'] . '(' . $order['engineer_phone'] . ')' ?>
<?php else : ?>
未接单
<?php endif; ?>
</td>
<td >
通话语音记录:<span style="font-weight: bold; color: #C40000; margin-left: 10px;"><?= $order['is_consult'] == 1 ? "有" : "无" ?></span><br/>
跟单客服:<span style="font-weight: bold; margin-left: 10px;color: #C40000"><?= empty($order["customerName"]) ? "无" : $order["customerName"] ?></span><br/>
是否回访完毕:<b style="color: #C40000;font-size: 13px;">
<?= (isset($order['interview_finished']) && $order['interview_finished'])==1 ? "是" : "否" ?>
</b>
</td>
<td >
<a class="btn btn-primary" style="margin: 4px;" href="<?php echo Url::toRoute(['/trade/order/info', 'id' => $order['id'],'order_status'=>$gets['order_status']]) ?>">查看详情</a>
<?php if ($order['status'] == 0): ?>
<a class="btn btn-success" style="margin: 4px;" href="<?php echo Url::toRoute(['/trade/order/allot', 'id' => $order['id'],'order_status'=>$gets['order_status']]) ?>">平台派单</a>
<?php endif; ?>
<?php if ( null != $order['apppeal_status'] && $order['apppeal_status'] >= 0 && is_numeric($order['apppeal_status'])): ?>
<a class="btn btn-warning" style="margin: 4px;" href="<?php echo Url::toRoute(['/trade/appeal/appeal', 'id' => $order['apppeal_id']]) ?>">查看质保</a>
<?php endif; ?>
<?php if ($order['has_dispatch'] == 1): ?>
<a class="btn btn-success" style="margin: 4px;" href="<?php echo Url::toRoute(['/trade/order-dispatch-record/index', 'order_no' => $order['order_no']]) ?>">查看派单信息</a>
<?php endif; ?>
</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>
var searchItemUrl = "<?=Url::toRoute('/trade/order/search-engineer')?>";
var search_engineer_count = '<?=$search_engineer_count ?>';
$(function(){
$('#customerName').comboSelect();
var getUrl ='<?=Url::toRoute("/trade/order/export-da")?>';
var filterUrl ='<?=Url::toRoute("/trade/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();
$("#city").show();
} else {
$("#selcity").show();
$("#city").hide();
}
})
})
</script>