| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389 |
- <?php
- use yii\widgets\LinkPager;
- ?>
- <style type="text/css">
- .btn-gray {
- cursor: default;
- }
- </style>
- <?php
- use backend\widgets\TabWidget;
- echo TabWidget::widget(['list' => $this->context->menuList, 'currentMenu' => $this->context->id]);
- ?>
- <div class="panel panel-default">
- <?php
- use backend\widgets\SubTabWidget;
-
- echo SubTabWidget::widget(['list' => $this->context->subMenuList, 'currentMenu' => $this->context->action->id]);
- ?>
- <div class="panel-body">
- <div id="example-2_wrapper"
- class="dataTables_wrapper form-inline dt-bootstrap no-footer">
- <div class="row">
- <form action="" method="GET">
- <div class="col-xs-6" style="width:90%;">
- <div class="dataTables_length">
- <label><input type="search" name="content" value="<?= $content ?>" class="form-control" placeholder="订单号 / 订花人手机号"></label>
- <input class="btn btn-secondary btn-single" type="submit" name="" value="搜索"/>
- </div>
- </div>
- </form>
- </div>
- <div class="table-responsive">
- <table class="table table-bordered table-striped table-hover table-condensed">
- <thead>
- <tr class="active">
- <th class="no-sorting hidden-xs"><input type="checkbox"></th>
- <th>单号</th>
- <th>订花人</th>
- <th class="hidden-xs">收花人</th>
- <th>总价</th>
- <th class="hidden-xs">实付款</th>
- <th class="hidden-xs">送达时间</th>
- <th class="hidden-xs">状态</th>
- <th class="hidden-xs">编号</th>
- <th>类型</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody class="middle-align">
- <?php foreach ($models as $key => $val) { ?>
- <tr>
- <td class="hidden-xs"><input type="checkbox"></td>
- <td>
- <a class="add-under-line" href="/order/detail?id=<?= $val['id'] ?>"><?= $val['id'] ?></a>
- </td>
- <td><?= $val['bookName'] ?> <?= $val['bookMobile'] ?></td>
- <td class="hidden-xs receive-user">
- <?= $val['receiveUserName'] ?> <?= $val['receiveMobile'] ?>
- </td>
- <td><?= $val['prePrice'] ?></td>
- <td class="hidden-xs">
- <span><?= $val['actPrice'] ?><?php if ($val['sendCost'] > 0) {
- echo '(运费' . $val['sendCost'] . ')';
- } ?></span>
- <?php if ($val['payStatus'] == 0 && empty($val['payCode'])) { ?>
- <?php if ($val['modPriceStatus'] == 0) { ?>
- <input type="text" name="modifyPrice" pre_price="<?= $val['actPrice'] ?>" data-id="<?= $val['id'] ?>" style="width:45px;display:none;border-radius:3px;border:1px solid #ccc;" value="<?= $val['sendNum'] ?>"/>
- <a href="javascript:void(0)" name="modifyPrice" pre_price="<?= $val['actPrice'] ?>" style="color:#68b828;cursor:pointer;text-decoration:none;"
- <i="" class="fa-pencil"></a>
- <?php } ?>
- <?php } ?>
- </td>
- <td class="hidden-xs"><?php if (!empty($val['reachTime'])) {
- echo date("m-d", strtotime($val['reachTime'])) . ' ' . $reachPeriodName[$val['reachPeriod']];
- } ?></td>
- <td class="hidden-xs"><?php echo $payStatusName[$val['payStatus']]; ?></td>
- <td class="hidden-xs">
- <span><?= $val['sendNum'] ?></span>
- <!-- <input type="text" name="modifySendNum" data-id="--><? //= $val['id'] ?><!--" style="width:30px;display:none;border-radius:3px;border:1px solid #ccc;" value="--><? //= $val['sendNum'] ?><!--" />-->
- <!--<a href="javascript:void(0)" name="modifySendNum" pre_send_num="<?= $val['sendNum'] ?>" style="color:#68b828;cursor:pointer;text-decoration:none;" <i="" class="fa-pencil"></a>-->
- </td>
- <td>
- <span name="setOrderStyle_<?= $val['id'] ?>">
- <?php
- if (!empty($val['usageId']) && !empty($val['categoryId'])) {
- $usageId = $val['usageId'];
- $categoryId = $val['categoryId'];
- $categoryName = isset($categoryList[$categoryId]) ? $categoryList[$categoryId]['name'] : '';
- $usageName = isset($usageList[$usageId]) ? $usageList[$usageId]['name'] : '';
- echo $usageName;
- } else { ?>
- <?php if ($val['payStatus'] == 1) { ?>
- <a href="javascript:void(0);" onclick="setOrderStyleToShow('<?= $val['id'] ?>')" style="color:#68b828;"><i class="fa-wrench"></i></a>
- <?php } ?>
- <?php } ?>
- </span>
- </td>
- <td>
- <?php
- if ($val['receiveUserName'] != '' && $val['receiveMobile'] != ''){
- ?><!-- 有收花人信息 -->
- <?php if ($val['payStatus'] == 0) { ?> <!-- 未付款 -->
- <?php if ($val['printStatus'] == 0) { ?>
- <a href="javascript:void(0)" name="printOrder" pay-status="no" data-msg="打印" id="printOrder<?= $val['id'] ?>" order-id="<?= $val['id'] ?>" class="btn btn-secondary btn-sm btn-icon icon-left hidden-xs">打印</a>
- <?php } else { ?>
- <a href="javascript:void(0)" name="reprintOrder" pay-status="no" data-msg="打印" id="reprintOrder<?= $val['id'] ?>" order-id="<?= $val['id'] ?>" class="btn btn-turquoise btn-sm btn-icon icon-left hidden-xs">重打</a>
- <?php } ?>
-
- <?php if ($val['sendStatus'] == 0) { ?>
- <a href="javascript:void(0)" name="dealOrder" pay-status="no" data-msg="通知客户货已送达" id="dealOrder-<?= $val['id'] ?>" data-url="/order/update-pay-status?id=<?= $val['id'] ?>&status=2" class="btn btn-secondary btn-sm btn-icon icon-left">通知</a>
- <?php } else if ($val['sendStatus'] == 1) { ?>
- <a href="javascript:void(0)" class="btn btn-secondary btn-sm btn-icon icon-left">送货中</a>
- <?php } else if ($val['sendStatus'] == 2) { ?>
- <a href="javascript:void(0)" class="btn btn-gray btn-sm btn-icon icon-left">已通知</a>
- <?php } ?>
- <?php } else if ($val['payStatus'] == 1) { ?><!-- 已经付款 -->
- <?php if ($val['printStatus'] == 0) { ?>
- <a href="javascript:void(0)" name="printOrder" id="printOrder<?= $val['id'] ?>" order-id="<?= $val['id'] ?>" class="btn btn-secondary btn-sm btn-icon icon-left hidden-xs">打印</a>
- <?php } else { ?>
- <a href="javascript:void(0)" name="reprintOrder" id="reprintOrder<?= $val['id'] ?>" order-id="<?= $val['id'] ?>" class="btn btn-turquoise btn-sm btn-icon icon-left hidden-xs">重打</a>
- <?php } ?>
-
- <?php if ($val['sendStatus'] == 0) { ?>
- <a href="javascript:void(0)" name="dealOrder" data-msg="通知客户货已送达" id="dealOrder-<?= $val['id'] ?>" data-url="/order/update-pay-status?id=<?= $val['id'] ?>&status=2" class="btn btn-secondary btn-sm btn-icon icon-left">通知</a>
- <?php } else if ($val['sendStatus'] == 1) { ?>
- <a href="javascript:void(0)" class="btn btn-secondary btn-sm btn-icon icon-left">送货中</a>
- <?php } else if ($val['sendStatus'] == 2) { ?>
- <a href="javascript:void(0)" class="btn btn-gray btn-sm btn-icon icon-left">已通知</a>
- <?php } ?>
- <?php } else { ?>
- <button class="btn btn-danger">出现错误状态:<?= $val['payStatus'] ?></button>
- <?php } ?>
- <?php }else{ ?><!-- 没有收花人信息 -->
- <a href="javascript:void(0)" class="btn btn-gray btn-sm btn-icon icon-left hidden-xs">打印</a>
- <?php
- }
- ?>
- </td>
- </tr>
- <?php } ?>
- </tbody>
- </table>
- </div>
- <div class="row">
- <div>
- <!--
- <div style="display:inline-block;margin-left:15px;">
- <label><select name="example-1_length"
- aria-controls="example-1" class="form-control">
- <option value="0">批量操作</option>
- <option value="1">批量下架</option>
- <option value="2">批量删除</option>
- </select>
- </label>
- <input class="btn btn-secondary btn-single" type="submit" name="" value="确认" />
- </div>
- -->
- <div class="dataTables_paginate paging_simple_numbers" style="float:right;padding-top:0px;margin-right:15px;">
- <?= LinkPager::widget(['pagination' => $pages]); ?>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- footer -->
- <?php
- use backend\widgets\FooterWidget;
- ?>
- <?= FooterWidget::widget() ?>
- <!-- footer -->
- <script>
- function updatePrintStatus(obj, orderId) {
- $.ajax({
- type: "GET",
- url: '/order/update-print-status?id=' + orderId + '&status=1',
- async: false,
- dataType: 'json',
- success: function (data) {
- if (data.code == 'A0001') {
- obj.removeClass('btn-secondary').addClass('btn-turquoise').html('重打');
- window.open('/order/print?id=' + orderId);
- } else {
- xhPopMsg(data.msg);
- }
- }
- });
- }
- $("a[name=printOrder]").click(function () {
- var obj = $(this);
- var orderId = $(this).attr('order-id');
- var payStatus = $(this).attr('pay-status');
- if (payStatus == 'no') {
- var msg = $(this).attr('data-msg');
- $("#confirmMention .modal-body").html('此订单未付款,确认' + msg + '?');
- $('#confirmMention').modal('show', {backdrop: 'fade'}).css({
- 'margin-top': function () {
- var modalHeight = jQuery("#confirmMention").find('.modal-dialog').height();
- return ($(window).height() / 2 - (modalHeight / 2));
- }
- });
- $("button[name=confirmOk]").click(function () {
- $('#confirmMention').modal('hide');
- updatePrintStatus(obj, orderId);
- });
- } else {
- updatePrintStatus(obj, orderId);
- }
- });
- $("a[name=reprintOrder]").click(function () {
- var orderId = $(this).attr('order-id');
- var payStatus = $(this).attr('pay-status');
- if (payStatus == 'no') {
- var msg = $(this).attr('data-msg');
- $("#confirmMention .modal-body").html('此订单未付款,确认' + msg + '?');
- $('#confirmMention').modal('show', {backdrop: 'fade'}).css({
- 'margin-top': function () {
- var modalHeight = jQuery("#confirmMention").find('.modal-dialog').height();
- return ($(window).height() / 2 - (modalHeight / 2));
- }
- });
- $("button[name=confirmOk]").click(function () {
- $('#confirmMention').modal('hide');
- window.open('/order/print?id=' + orderId);
- });
- } else {
- window.open('/order/print?id=' + orderId);
- }
- });
- </script>
- <!-- modal 确认提醒框 -->
- <div class="modal fade" id="confirmMention">
- <div class="modal-dialog" style="height:300px;">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h4 class="modal-title">消息提示</h4>
- </div>
- <input type="hidden" name="requestUrl" value=""/> <input type="hidden" name="id" value=""/>
- <div class="modal-body">
- 确认<span></span>?
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-info" name="confirmOk">确认</button>
- <button type="button" class="btn btn-white" data-dismiss="modal">取消</button>
- </div>
- </div>
- </div>
- </div>
- <script>
- //确认提醒操作
- $(function () {
- jQuery("a[name=dealOrder]").click(function () {
- var url = $(this).attr('data-url');
- var classId = $(this).attr('id');
- var msg = $(this).attr('data-msg');
- var payStatus = $(this).attr('pay-status');
- if (payStatus == 'no') {
- $("#confirmMention .modal-body").html('此订单未付款,确认' + msg + '?');
- }
- $("#confirmMention .modal-body span").text(msg);
- $("#confirmMention input[name=requestUrl]").val(url);
- $("#confirmMention input[name=id]").val(classId);
- jQuery('#confirmMention').modal('show', {backdrop: 'fade'}).css({
- 'margin-top': function () {
- var modalHeight = jQuery("#confirmMention").find('.modal-dialog').height();
- return ($(window).height() / 2 - (modalHeight / 2));
- }
- });
- });
- //点击确认操作
- jQuery("button[name=confirmOk]").click(function () {
- var url = $("#confirmMention input[name=requestUrl]").val();
- var classId = $("#confirmMention input[name=id]").val();
- $.ajax({
- type: "GET",
- url: url,
- async: false,
- dataType: 'json',
- success: function (data) {
- if (data.code == 'A0001') {
- $('#confirmMention').modal('hide');
- //window.location.reload();
- $('#' + classId).removeClass('btn-secondary').addClass('btn-gray').html('已通知');
- } else {
- xhPopMsg(data.msg, 1300);
- }
- }
- });
- });
- });
- //修改配送编号
- $("a[name=modifySendNum]").click(function () {
- var pre_send_num = $(this).attr('pre_send_num');
- $(this).css("display", "none").siblings('span').css('display', 'none').siblings('input').css('display', 'block').focus().val(pre_send_num);
- });
- $("input[name=modifySendNum]").blur(function () {
- var num = $(this).val();
- var that = $(this);
- if (num.length > 0) {
- var id = $(this).attr('data-id');
- $.ajax({
- type: "GET",
- url: '/order/modify-send-num?id=' + id + '&num=' + num,
- async: false,
- dataType: 'json',
- success: function (data) {
- if (data.code == 'A0001') {
- that.css('display', 'none');
- that.siblings('a').css("display", "inline-block").attr("pre_send_num", num);
- that.siblings('span').css("display", "inline-block").html(num);
- }
- xhPopMsg(data.msg);
- }
- });
- }
- });
- //修改价格
- $("a[name=modifyPrice]").click(function () {
- var pre_price = $(this).attr('pre_price');
- $(this).css("display", "none").siblings('span').css('display', 'none').siblings('input').css('display', 'block').focus().val(pre_price);
- });
- $("input[name=modifyPrice]").blur(function () {
- var that = $(this);
- var newPrice = $(this).val();
- var pre_price = $(this).attr('pre_price');
- if (isNaN(newPrice)) {
- xhPopMsg('价格填写有误', 1300);
- that.focus().val(pre_price);
- return;
- }
- if (newPrice <= 0) {
- xhPopMsg('价格不能小于0', 1300);
- that.focus().val(pre_price);
- return;
- }
- if (newPrice.indexOf('.') > 0) {
- if (newPrice.toString().split(".")[1].length > 2) {
- xhPopMsg('价格填写有误', 1300);
- that.focus().val(pre_price);
- return;
- }
- }
- if (newPrice.length > 0) {
- var id = $(this).attr('data-id');
- $.ajax({
- type: "GET",
- url: '/order/modify-price?id=' + id + '&actPrice=' + newPrice,
- async: false,
- dataType: 'json',
- success: function (data) {
- xhPopMsg(data.msg);
- if (data.code == 'A0001') {
- that.css('display', 'none').attr("pre_price", newPrice);
- that.siblings('a').css("display", "inline-block").attr("pre_price", newPrice);
- that.siblings('span').css("display", "inline-block").html(newPrice);
- } else {
- that.css('display', 'none').attr("pre_price", pre_price);
- that.siblings('a').css("display", "inline-block").attr("pre_price", pre_price);
- that.siblings('span').css("display", "inline-block").html(pre_price);
- that.focus().val(pre_price);
- }
- }
- });
- }
- });
- </script>
|