You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

407 lines
30 KiB
PHP

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<div class="right-container">
<div class="page-header">
<h3>物流预警</h3><span class="ml_5 ft-14">监控物流异常包裹,避免被平台处罚。此功能只支持拼多多电子面单号</span>
</div>
<div class="nav-block m-t">
<ul class="nav nav-tabs im-tab text-center J_orderSearchTab">
<li <?php echo (empty($_GET['orderType']) || $_GET['orderType'] == 'hasSendOrder') ? 'class="active"' : '';?>>
<a data-toggle="tab" href="#J_orderPrintPanel" data-action="hasSendOrder" data-is-isolation="0" class="span2">已发货
<span style="border-radius: 10px!important;" class="m-l-sm label label-info J_hasSendLogisticsWarningCount">
<?php echo $logisticsWarningOrderTypeAndCountMap['hasSendOrder'] ?: 0;?>
</span>
</a>
</li>
<li <?php echo $_GET['orderType'] == 'waitSendOrder' ? 'class="active"' : '';?>>
<a data-toggle="tab" href="#J_orderPrintPanel" data-action="waitSendOrder" class="span2">待发货
<span style="border-radius: 10px!important;" class="m-l-sm label label-info J_waitSendLogisticsWarningCount">
<?php echo $logisticsWarningOrderTypeAndCountMap['waitSendOrder'] ?: 0;?>
</span>
</a>
</li>
<li <?php echo $_GET['orderType'] == 'customOrder' ? 'class="active"' : '';?>>
<a data-toggle="tab" href="#J_orderPrintPanel" data-action="customOrder" class="span2">自由打印订单
<span style="border-radius: 10px!important;" class="m-l-sm label label-info J_customLogisticsWarningCount">
<?php echo $logisticsWarningOrderTypeAndCountMap['customOrder'] ?: 0;?>
</span>
</a>
</li>
</ul>
</div>
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="J_orderPrintPanel">
<div class="ft_12 mb_10">
<form class="form-horizontal" id="J_searchLogisticsWarningOrderListForm">
<input type="hidden" name="page">
<?php echo ZcHtml::hiddenInput('orderType', $_GET['orderType'], array());?>
<div class="clearfix card card-body p-y">
<div class="row">
<?php if (!empty($shopOptions)) { ?>
<div class="col-xs-2">
<div class="form-group">
<label class="p-x-0 col-xs-4 control-label">选择店铺:</label>
<div class="p-l-0 col-xs-8" style="overflow:visible;">
<div class="dropdown" style="display:block;z-index:5;">
<div style="border: 1px solid #ccc;border-radius:3px;line-height:30px;height:30px;overflow:hidden;font-size:12px;">
<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" style="display:block;text-align:left;color:#333;text-decoration:none;padding-left:13px;padding-right:15px;">
<span id="J_selectShopFilterLabel" style="color:#555;">已选择<?php echo count($selectedAuthMallIds)?>个店铺</span>
</a>
<span class="caret" style="position:absolute;top:13px;right:6px;"></span>
<ul id="J_selectShopList" class="dropdown-menu" data-stop-propagation="true" style="width:100%;">
<li>
<label class="zc-custom-control-label J_selectAllShopBtn">全选/全不选</label>
</li>
<?php foreach ($shopOptions as $shopId => $shopName) { ?>
<li>
<a href="javascript:void(0);">
<?php echo HtmlTool::customCheckbox('authMallIds[]', in_array($shopId, $selectedAuthMallIds), array('value' => $shopId), $shopName);?>
</a>
</li>
<?php } ?>
<li>
<a class="" href="<?php echo Zc::url(RouteConst::userMallAuthIndex); ?>">+添加关联店铺</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<?php } ?>
<div class="col-xs-4">
<div class="form-group">
<label class="p-x-0 col-xs-2 control-labe" >
<?php
$customTimeTypeList = ['' => '下单时间'];
$timeTypeList = ['createdTime' => '下单时间', 'confirmTime' => '成团时间', 'orderSendTime' => '发货时间'];
echo ZcHtml::dropDownList('timeType', null, $customTimeTypeList, array('class' => 'form-control input-sm J_customTimeType ', 'disabled' => ($_GET['orderType'] == 'customOrder' ? '' : 'hidden'), 'disabled' => $_GET['orderType'] == 'customOrder' ? false : true));
echo ZcHtml::dropDownList('timeType', null, $timeTypeList, array('class' => 'form-control input-sm J_timeType ' . ($_GET['orderType'] == 'customOrder' ? 'hidden' : ''), 'disabled' => $_GET['orderType'] == 'customOrder' ? true : false));
?>
</label>
<div class="p-l-0 col-xs-10">
<div class="input-group input-daterange" data-toggle="datetimepicker" data-date-format="YYYY-MM-DD" data-date-pick-time="false">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input type="text" class="form-control input-sm J_startTime" name="orderStartTime" data-drops="down" value="<?php echo date('Y-m-d', strtotime($filter['startTime']));?>">
<span class="input-group-addon no-border-x">-</span>
<input type="text" class="form-control input-sm J_endTime" name="orderEndTime" data-drops="down" value="<?php echo date('Y-m-d', strtotime($filter['endTime']));?>">
</div>
</div>
</div>
</div>
<div class="col-xs-2">
<div class="form-group">
<label class="p-x-0 col-xs-4 control-label">订单号:</label>
<div class="p-x-0 col-xs-7">
<input type="text" class="form-control input-sm" name="orderSn" value="<?php echo $filter['orderSn']?>">
</div>
</div>
</div>
<div class="col-xs-2">
<div class="form-group">
<label class="p-x-0 col-xs-4 control-label">运单号:</label>
<div class="p-x-0 col-xs-7">
<input type="text" class="form-control input-sm" name="waybillCode" value="<?php echo $filter['waybillCode']?>">
</div>
</div>
</div>
<div class="col-xs-2">
<div class="form-group">
<label class="p-x-0 col-xs-4 control-label">物流:</label>
<div class="p-x-0 col-xs-7">
<?php echo ZcHtml::dropDownList('logisticsId', $filter['logisticsId'], $logistics, array('class' => 'form-control input-sm J_chosen'))?>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-2 J_onlyPddOrderFilter">
<div class="form-group">
<label class="p-x-0 col-xs-4 control-label">退款状态:</label>
<div class="p-x-0 col-xs-7">
<?php
$refundStatusMap = [
'' => '全部',
'hasRefund' => '有退款',
'notRefund' => '无退款'
];
echo ZcHtml::dropDownList('orderRefundStatus', null, $refundStatusMap, array('class' => 'form-control input-sm'))
?>
</div>
</div>
</div>
<div class="col-xs-2">
<div class="form-group">
<label class="p-x-0 col-xs-4 control-label">物流状态:</label>
<div class="p-x-0 col-xs-7">
<?php
$logisticsStatusMap = OrderPrintConst::getLogisticsStatusMap();
echo ZcHtml::dropDownList('opLogisticsStatus', null, $logisticsStatusMap, array('class' => 'form-control input-sm'))
?>
</div>
</div>
</div>
<div class="col-xs-2">
<div class="form-group">
<label class="p-x-0 col-xs-4 control-label">状态筛选:</label>
<div class="p-x-0 col-xs-7">
<?php
$opLogistStatusListMap = [
[
'name' => '所有',
'value' => ''
],
[
'name' => '预警件',
'value' => 'hasWarning',
'child' => [
['name' => '发货后']
],
],
'hasException' => [
]
];
?>
<div class="dropdown">
<p role="button" data-toggle="dropdown" class="form-control input-sm" data-target="#" href="javascript:;" style="overflow:hidden;">
<span style="width: 90%;" class="J_opWarningStatus" data-value="">所有</span>
<span class="caret" style="position:absolute;top:13px;right:6px;"></span>
</p>
<ul class="dropdown-menu multi-level" role="menu" aria-labelledby="dropdownMenu">
<?php $opLogisticsWarningFilterMap = LogisticsConst::getOpLogisticsWarningFilterMap($opSetting) ?>
<?php foreach ($opLogisticsWarningFilterMap as $opLogisticsWarning) { ?>
<li>
<?php if (empty($opLogisticsWarning['child'])) { ?>
<a href="javascript:;" class="J_opWarningStatusItem" data-value="<?php echo $opLogisticsWarning['value']?>"><?php echo $opLogisticsWarning['name']?></a>
<?php } else { ?>
<li class="dropdown-submenu">
<a href="javascript:;" class="J_opWarningStatusItem" data-value="<?php echo $opLogisticsWarning['value']?>"><?php echo $opLogisticsWarning['name']?></a>
<ul class="dropdown-menu">
<?php foreach ($opLogisticsWarning['child'] as $subLogisticsWarning) { ?>
<li>
<a href="javascript:;" class="J_opWarningStatusItem" data-value="<?php echo $subLogisticsWarning['value']?>"><?php echo $subLogisticsWarning['name']?></a>
</li>
<?php } ?>
</ul>
</li>
<?php } ?>
</li>
<?php } ?>
</ul>
</div>
</div>
</div>
</div>
<div class="btn btn-sm btn-info inline ml_20 w90 J_searchLogisticsWarningOrderList">搜索</div>
</div>
</div>
<div class="clearfix mt_15">
<div class="pull-left ft_12">
<button type="button" class="btn btn-info btn-sm" id="J_batchCancelLogisticsWarningBtn">批量取消预警标记</button>
</div>
<div class="m-l inline">
<button type="button" class="btn btn-info btn-sm dropdown-toggle" data-toggle="dropdown">
导出<span class="caret m-l-sm"></span>
</button>
<ul class="dropdown-menu">
<li>
<a href="javascript:;" data-type="selected" class="J_batchExportBtn">导出选中数据
<span style="border-radius: 10px!important;" class="m-l-sm label label-info J_opLogisticsWarningSelectedCount">0</span>
</a>
</li>
<li>
<a href="javascript:;" data-type="condition" class="J_batchExportBtn">导出筛选数据
<span style="border-radius: 10px!important;" class="m-l-sm label label-info J_opLogisticsWarningCount">0</span>
</a>
</li>
</ul>
</div>
<div class="pull-right text-right ft_12">
<button type="button" class="btn btn-info btn-sm" id="J_showLogisticsWarningSettingModal">物流预警设置</button>
<div class="inline m-l">
<?php
$pageSizeList = array(
20 => '每页显示20条',
50 => '每页显示50条',
100 => '每页显示100条',
);
echo ZcHtml::dropDownList('pageSize', 20, $pageSizeList, array('class' => 'form-control input-md'));
?>
</div>
</div>
</div>
</form>
<div role="tabpanel" class="tab-pane active" id="J_orderListPanel">
<div class="order-list J_logisticsWarningOrderListContent"></div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="J_logisticsWarningSettingModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog" style="width: 850px;">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<div class="modal-title">物流预警设置</div>
</div>
<div class="modal-body">
<div class="row">
<div class="col-xs-3 p-a-o">
<div class="J_authMallBox" style="height: 300px;">
<ul class="list-group">
<?php foreach ($shopOptions as $authMallId => $authMallName){ ?>
<li data-mall-id="<?php echo $authMallId;?>" class="J_switchAuthMalLogisticsWarningSettingBtn list-group-item <?php echo $mallId == $authMallId ? 'active' : '';?>" style="cursor: pointer;"><?php echo $authMallName;?></li>
<?php }?>
</ul>
</div>
</div>
<div class="col-xs-9 p-a-o">
<?php echo ZcHtml::beginForm('', 'post', array('id' => 'J_logisticsWarningSettingForm', 'class' => 'form form-horizontal', 'data-mall-id' => $mallId));?>
<?php
$hourOptions = [2, 6, 12, 24, 36, 48];
$allocateHourOptions = [12, 24, 36, 48, 72, 108, 120];
$nodeStayTypeAndHoursMap = [
LogisticsConst::opLogisticsWarningNodeStayTypeJZHW => [12, 24, 36, 48],
LogisticsConst::opLogisticsWarningNodeStayTypeJJJ => [12, 24, 36, 48],
LogisticsConst::opLogisticsWarningNodeStayTypeTYSF => [24, 36, 48],
LogisticsConst::opLogisticsWarningNodeStayTypeBTSF => [36, 48, 60, 72],
LogisticsConst::opLogisticsWarningNodeStayTypeXXN => [48, 72, 108, 120],
];
?>
<div class="form-group">
<label class="col-xs-2 p-x-0 control-label">物流预警规则:</label>
<div class="col-xs-9">
<div>
<label class="zc-custom-control zc-custom-control-primary zc-custom-checkbox m-x-0 m-t-sm">
<?php echo ZcHtml::checkbox('isWarningLogisticsAcceptOvertime', $opSetting['is_warning_logistics_accept_overtime'], array(
'value' => 1,
'class' => 'custom-control-input'));
?>
<span class="custom-control-indicator"></span>
<span class="custom-control-label">发货后超过 <select name="warningLogisticsAcceptOvertimeHours" class="form-control input-sm inline span1">
<?php foreach ($hourOptions as $option) {?>
<option value="<?php echo $option;?>" <?php echo $option == $opSetting['warning_logistics_accept_overtime_hours'] ? 'selected' : '';?>><?php echo $option;?></option>
<?php }?>
</select> 小时还没有揽件记录,预警提示</span>
</label>
</div>
<div>
<label class="zc-custom-control zc-custom-control-primary zc-custom-checkbox m-x-0 m-t-sm">
<?php echo ZcHtml::checkbox('isWarningLogisticsArrivalOvertime', $opSetting['is_warning_logistics_arrival_overtime'], array(
'value' => 1,
'class' => 'custom-control-input'));
?>
<span class="custom-control-indicator"></span>
<span class="custom-control-label">揽件后超过 <select name="warningLogisticsArrivalOvertimeHours" class="form-control input-sm inline span1">
<?php foreach ($hourOptions as $option) {?>
<option value="<?php echo $option;?>" <?php echo $option == $opSetting['warning_logistics_arrival_overtime_hours'] ? 'selected' : '';?>><?php echo $option;?></option>
<?php }?>
</select> 小时还没有后续物流更新,预警提示</span>
</label>
</div>
<div>
<label class="zc-custom-control zc-custom-control-primary zc-custom-checkbox m-x-0 m-t-sm">
<?php echo ZcHtml::checkbox('isWarningLogisticsRejection', $opSetting['is_warning_logistics_rejection'], array(
'value' => 1,
'class' => 'custom-control-input'));
?>
<span class="custom-control-indicator"></span>
<span class="custom-control-label">买家拒收</span>
</label>
</div>
<div>
<label class="zc-custom-control zc-custom-control-primary zc-custom-checkbox m-x-0 m-t-sm">
<?php echo ZcHtml::checkbox('isWarningAllocateStayOvertime', $opSetting['is_warning_allocate_stay_overtime'], array(
'value' => 1,
'class' => 'custom-control-input'));
?>
<span class="custom-control-indicator"></span>
<span class="custom-control-label">分拨停留:分拨停留超过 <select name="warningAllocateStayOvertimeHours" class="form-control input-sm inline span1">
<?php foreach ($allocateHourOptions as $option) {?>
<option value="<?php echo $option;?>" <?php echo $option == $opSetting['warning_allocate_stay_overtime_hours'] ? 'selected' : '';?>><?php echo $option;?></option>
<?php }?>
</select> 小时未更新物流信息,预警提示</span>
</label>
</div>
<div>
<label class="zc-custom-control zc-custom-control-primary zc-custom-checkbox m-x-0 m-t-sm">
<?php echo ZcHtml::checkbox('isWarningNodeStayOvertime', $opSetting['is_warning_node_stay_overtime'], array(
'value' => 1,
'class' => 'custom-control-input'));
?>
<span class="custom-control-indicator"></span>
<span class="custom-control-label">节点停留</span>
</label>
<div class="ml_20 mt_10">
<p>
江浙沪皖同区域,超过
<select name="warningNodeStayJZHWOvertimeHours" class="form-control input-sm inline span1">
<?php foreach ($nodeStayTypeAndHoursMap[LogisticsConst::opLogisticsWarningNodeStayTypeJZHW] as $option) {?>
<option value="<?php echo $option;?>" <?php echo $option == $opSetting['warning_node_stay_jzhw_overtime_hours'] ? 'selected' : '';?>><?php echo $option;?></option>
<?php }?>
</select>
小时未更新物流信息,预警提示
</p>
京津冀同区域,超过
<select name="warningNodeStayJJJOvertimeHours" class="form-control input-sm inline span1">
<?php foreach ($nodeStayTypeAndHoursMap[LogisticsConst::opLogisticsWarningNodeStayTypeJJJ] as $option) {?>
<option value="<?php echo $option;?>" <?php echo $option == $opSetting['warning_node_stay_jjj_overtime_hours'] ? 'selected' : '';?>><?php echo $option;?></option>
<?php }?>
</select>
小时未更新物流信息,预警提示
</p>
</p>
同一省份(除新疆、西藏、内蒙古)超过
<select name="warningNodeStayTYSFOvertimeHours" class="form-control input-sm inline span1">
<?php foreach ($nodeStayTypeAndHoursMap[LogisticsConst::opLogisticsWarningNodeStayTypeTYSF] as $option) {?>
<option value="<?php echo $option;?>" <?php echo $option == $opSetting['warning_node_stay_tysf_overtime_hours'] ? 'selected' : '';?>><?php echo $option;?></option>
<?php }?>
</select>
小时未更新物流信息,预警提示
</p>
</p>
不同省份(除新疆、西藏、内蒙古)超过
<select name="warningNodeStayBTSFOvertimeHours" class="form-control input-sm inline span1">
<?php foreach ($nodeStayTypeAndHoursMap[LogisticsConst::opLogisticsWarningNodeStayTypeBTSF] as $option) {?>
<option value="<?php echo $option;?>" <?php echo $option == $opSetting['warning_node_stay_btsf_overtime_hours'] ? 'selected' : '';?>><?php echo $option;?></option>
<?php }?>
</select>
小时未更新物流信息,预警提示
</p>
</p>
任一地址在新疆、西藏或内蒙古超过
<select name="warningNodeStayXXNOvertimeHours" class="form-control input-sm inline span1">
<?php foreach ($nodeStayTypeAndHoursMap[LogisticsConst::opLogisticsWarningNodeStayTypeXXN] as $option) {?>
<option value="<?php echo $option;?>" <?php echo $option == $opSetting['warning_node_stay_xxn_overtime_hours'] ? 'selected' : '';?>><?php echo $option;?></option>
<?php }?>
</select>
小时未更新物流信息,预警提示
</p>
</div>
</div>
</div>
</div>
<?php echo ZcHtml::endForm();?>
</div>
</div>
</div>
<div class="modal-footer">
<div class="text-center">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary J_saveLogisticsWarningSetting">确定</button>
<button type="button" class="btn btn-primary J_saveLogisticsWarningSetting" data-is-multi-shop="1">确定并同步到其他店铺</button>
</div>
</div>
</div>
</div>
</div>
<?php echo HtmlTool::getStaticFile(array('clipboard.min.js', 'jq_puls/jquery.fileDownload.1.4.2.js', 'select2.min.js', 'jquery.history.js'), TsConst::jsGlobal);?>
<?php echo HtmlTool::getStaticFile(array('chosen.jquery.min.js?' . TsConst::jsGlobal)); ?>
<?php echo HtmlTool::getStaticFile( array('biz/common/multi_shop_select.js', 'biz/order/order_api.js', 'biz/order/op_logistics.js'), TsConst::jsOp);?>