| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342 |
- <style>
- .bootstrap-select{width:0;padding:0;margin:0;}
- .dropdown-toggle .pull-left{margin:0;line-height: 20px;height:20px;}
- .main .form-horizontal .form-group {
- margin-bottom: 15px !important;
- }
- </style>
- <!-- 关闭订单 -->
- <div id="modal-close" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true" style="width:600px;margin:0px auto;">
- <form class="form-horizontal form" action="{!! yzWebUrl('order.operation.close') !!}" method="post" enctype="multipart/form-data">
- <input type="hidden" name="route" value="order.operation.close">
- <input type='hidden' name='order_id' value=''/>
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
- <h3>关闭订单</h3>
- </div>
- <div class="modal-body">
- <label>关闭订单原因</label>
- <textarea style="height:150px;" class="form-control" name="reson" autocomplete="off"></textarea>
- <div id="module-menus"></div>
- </div>
- <div class="modal-footer">
- <button type="submit" class="btn btn-primary" name="close" value="yes">关闭订单</button>
- <a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a>
- </div>
- </div>
- </div>
- </form>
- </div>
- <!-- 确认发货 -->
- <div id="modal-confirmsend" class="modal fade" tabindex="-1" role="dialog" style="width:600px;margin:0px auto;">
- <form class="form-horizontal form" action="" method="get"
- enctype="multipart/form-data">
- <input type='hidden' name='c' value='site'/>
- <input type='hidden' name='a' value='entry'/>
- <input type='hidden' name='m' value='yun_shop'/>
- <input type='hidden' name='do' value='{{YunShop::request()->do}}'/>
- <input type='hidden' name='order_id' value=''/>
- <input type='hidden' name='route' value='order.operation.send' id="send_form"/>
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
- <h3>快递信息</h3>
- </div>
- <div class="modal-body">
- <div class="form-group">
- <label class="col-xs-10 col-sm-3 col-md-3 control-label">收件人信息</label>
- <div class="col-xs-12 col-sm-9 col-md-8 col-lg-8">
- <div class="form-control-static">
- 收 件 人: <span class="realname">{{$order['belongs_to_member']['realname']}}</span> / <span class="mobile">{{$order['belongs_to_member']['mobile']}}</span><br>
- 收货地址: <span class="address"></span>
- </div>
- </div>
- </div>
- <div class="form-group">
- <label class="col-xs-10 col-sm-3 col-md-3 control-label">快递公司</label>
- <div class="col-xs-12 col-sm-9 col-md-8 col-lg-8">
- <select class="form-control selectpicker" name="express_code" id="express_company">
- <option value="" data-name="">其他快递</option>
- @include('express.companies')
- </select>
- <input type='hidden' name='express_company_name' id='expresscom'/>
- </div>
- </div>
- <div class="form-group">
- <label class="col-xs-10 col-sm-3 col-md-3 control-label">快递单号</label>
- <div class="col-xs-12 col-sm-9 col-md-8 col-lg-8">
- <input type="text" id="express_sn" name="express_sn" class="form-control"/>
- </div>
- </div>
- <div id="module-menus"></div>
- </div>
- <div class="modal-footer">
- <button type="submit" class="btn btn-primary span2" name="confirmsend" onclick="confirmSend()"
- value="yes">确认发货
- </button>
- <a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a>
- </div>
- </div>
- </div>
- </form>
- </div>
- <!-- 手动退款 -->
- <div id="modal-manual-refund" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true" style="width:600px;margin:0px auto;">
- <form class="form-horizontal form" action="{!! yzWebUrl('order.vue-operation.manualRefund') !!}" method="post" enctype="multipart/form-data">
- <input type="hidden" name="route" value="order.operation.manualRefund">
- <input type='hidden' name='order_id' value=''/>
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
- <h3>退款并关闭订单(请先在选品平台确认该订单是否生成,如已生成请先申请售后)</h3>
- </div>
- <div class="modal-body">
- <label>退款原因</label>
- <textarea style="height:150px;" class="form-control" name="reson" autocomplete="off"></textarea>
- <div id="module-menus"></div>
- </div>
- <div class="modal-footer">
- <button type="submit" class="btn btn-primary" name="close" value="yes">退款</button>
- <a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a>
- </div>
- </div>
- </div>
- </form>
- </div>
- <!-- 取消发货 -->
- <div id="modal-cancelsend" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true"
- style="width:600px;margin:0px auto;">
- <form class="form-horizontal form" action="{!! yzWebUrl('order.operation.cancel-send') !!}" method="post"
- enctype="multipart/form-data">
- <input type='hidden' name='order_id' value=''/>
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
- <h3>取消发货</h3>
- </div>
- <div class="modal-body">
- <label>取消发货原因</label>
- <textarea style="height:150px;" class="form-control" name="cancelreson" autocomplete="off"></textarea>
- <div id="module-menus"></div>
- </div>
- <div class="modal-footer">
- <button type="submit" class="btn btn-primary span2" name="cancelsend" value="yes">取消发货</button>
- <a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a>
- </div>
- </div>
- </div>
- </form>
- </div>
- </form>
- </div>
- <div id='changeprice_container'>
- </div>
- @include('refund.modal')
- <script language='javascript'>
- function changePrice(orderid) {
- $.post("{!! yzWebUrl('order.change-order-price') !!}", {order_id: orderid}, function (html) {
- if (html == -1) {
- alert('订单不能改价!');
- return;
- }
- $('#changeprice_container').html(html);
- $('#modal-changeprice').modal().on('shown.bs.modal', function () {
- mc_init();
- })
- });
- }
- var order_price = 0;
- var dispatch_price = 0;
- function mc_init() {
- order_price = parseFloat($('#changeprice-orderprice').val());
- dispatch_price = parseFloat($('#changeprice-dispatchprice').val());
- $('input', $('#modal-changeprice')).blur(function () {
- if ($.isNumber($(this).val())) {
- mc_calc();
- }
- });
- }
- function mc_calc() {
- var change_dispatchprice = parseFloat($('#changeprice_dispatchprice').val());
- if (!$.isNumber($('#changeprice_dispatchprice').val())) {
- change_dispatchprice = dispatch_price;
- }
- var dprice = change_dispatchprice;
- if (dprice <= 0) {
- dprice = 0;
- }
- $('#dispatchprice').html(dprice.toFixed(2));
- var oprice = 0;
- $('.changeprice_orderprice').each(function () {
- var p = 0;
- if ($.trim($(this).val()) != '') {
- p = parseFloat($.trim($(this).val()));
- }
- oprice += p;
- });
- if (Math.abs(oprice) > 0) {
- if (oprice < 0) {
- $('#changeprice').css('color', 'red');
- $('#changeprice').html(" - " + Math.abs(oprice));
- } else {
- $('#changeprice').css('color', 'green');
- $('#changeprice').html(" + " + Math.abs(oprice));
- }
- }
- var lastprice = order_price + dprice + oprice;
- $('#lastprice').html(lastprice.toFixed(2));
- }
- function mc_check() {
- var can = true;
- var lastprice = 0;
- $('.changeprice').each(function () {
- if ($.trim($(this).val()) == '') {
- return true;
- }
- var p = 0;
- if (!$.isNumber($(this).val())) {
- $(this).select();
- alert('请输入数字!');
- can = false;
- return false;
- }
- var val = parseFloat($(this).val());
- if (val <= 0 && Math.abs(val) > parseFloat($(this).parent().prev().html())) {
- $(this).select();
- alert('单个商品价格不能优惠到负数!');
- can = false;
- return false;
- }
- lastprice += val;
- });
- var op = order_price + dispatch_price + lastprice;
- if (op < 0) {
- alert('订单价格不能小于0元!');
- return false;
- }
- if (!can) {
- return false;
- }
- return true;
- }
- </script>
- <script language="javascript">
- function confirmSend() {
- var numerictype = /^[a-zA-Z0-9]+$/;;
- if ($('#express_sn').val() == '' && $('#express_company').val() != '') {
- $('#send_form').val("order.list");
- return confirm('请填写快递单号!');
- }
- $('#expresscom').val($('#express_company option:selected').attr('data-name'));
- if ($('#express_sn').val() != '') {
- if (!numerictype.test($('#express_sn').val())) {
- $('#send_form').val("order.list");
- return confirm('快递单号格式不正确!');
- }
- }
- //todo 当未选择其他快递的时候,不允许提交
- }
- function send(btn) {
- var modal = $('#modal-confirmsend');
- var itemid = $(btn).parent().find('.itemid').val();
- $(".id").val(itemid);
- modal.find(':input[name=order_id]').val(itemid);
- if ($(btn).parent().find('.addressdata').val()) {
- var addressdata = JSON.parse($(btn).parent().find('.addressdata').val());
- if (addressdata) {
- modal.find('.realname').html(addressdata.realname);
- modal.find('.mobile').html(addressdata.mobile);
- modal.find('.address').html(addressdata.address);
- }
- }
- }
- </script>
- <!-- 查看物流 -->
- <div id="modal-express" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true"
- style="width:620px;margin:0px auto;">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
- <h3>查看物流</h3></div>
- <div class="modal-body" style='max-height:500px;overflow: auto;'>
- <div class="form-group" id="module-menus-express"></div>
- </div>
- <div class="modal-footer"><a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a>
- </div>
- </div>
- </div>
- </div>
- <script language='javascript'>
- function express_find(btn, orderid) {
- $(btn).button('loading');
- $.ajax({
- url: "{!! yzWebUrl('order.detail.ajax') !!}" +"&id="+orderid,
- cache: false,
- success: function (html) {
- if (html.data.data != null && html.data.data.length > 0){
- html.data.data.forEach(v=>{
- $('#module-menus-express').append(` <p style="white-space:normal; width:100%">[`+v.time+`] ]`+ v.context+`]</p>`);
- });
- }
- // $('#module-menus-express').html(html);
- $('#modal-express').modal();
- $(btn).button('reset');
- }
- })
- }
- function refundexpress_find(btn, orderid, flag) {
- let refund_value = (flag == 2) ? 30 : 20;
- $(btn).button('loading');
- $.ajax({
- url: "{!! yzWebUrl('order.detail.refund-express') !!}" +"&order_id="+orderid +"&refund_value="+refund_value, //"{php echo $this->createWebUrl('order/list',array('op'=>'deal','to'=>'refundexpress'))}&id=" + orderid + "&flag=" + flag,
- cache: false,
- success: function (html) {
- console.log(html.data.data)
- if (html.data.data != null && html.data.data.length > 0){
- html.data.data.forEach(v=>{
- $('#data').append(` <p style="white-space:normal; width:100%">[`+v.time+`] ]`+ v.context+`]</p>`);
- });
- }
- // $('#module-menus-express').html(html);
- $('#modal-express').modal();
- $(btn).button('reset');
- }
- })
- }
- </script>
|