Merge branch 'dev' into wanfang

dev
曾超新 5 years ago
commit dbc85adb1c
  1. 47
      frontend/controllers/InsurerController.php
  2. 3
      frontend/views/common/index.php
  3. 24
      frontend/views/insurer/my-list-info.php
  4. 20
      frontend/views/menu/edit.php
  5. 41
      frontend/views/permissions/permission.php

@ -3502,6 +3502,47 @@ class InsurerController extends BaseController
}
return $result;
}
public function actionGiftCancel()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '保存失败';
if ($request->isPost && $this->my->id == 1) {
$id = $request->post('order_id', 0);
$order_info = OrderT::findOne($id);
if (!$order_info) {
$result['msg'] = '订单不存在';
return $result;
}
$tran = OrderT::getDb()->beginTransaction();
try {
// 删除礼品/券库信息
GiftTicketTUse::deleteAll('order_id=' . $order_info->id);
// 修改订单礼品/券信息
OrderGiftT::updateAll(['gift_src'=>''],['order_id'=>$order_info->id]);
// 修改订单状态
$order_info->gift_status = 0;
$order_info->save();
$result['success'] = true;
$result['msg'] = '保存成功';
$tran->commit();
} catch (\Exception $e) {
$tran->rollBack();
$result['msg'] = $e->getMessage();
}
}else {
$result['msg'] = '当前用户无此权限';
}
return $result;
}
public function getGift($k, $v, $car_no, $order_info, $order_gift_id)
{
$result = array();
@ -3516,7 +3557,6 @@ class InsurerController extends BaseController
//礼券
if ($gift_info && $gift_info->type_id == 2) {
$pinyin_arr = explode(' ', $gift_info->pinyin_name);
// dd($pinyin_arr);
$liquan_str = 'ch';
//获取礼券拼音首字母
foreach ($pinyin_arr as $first) {
@ -3534,13 +3574,12 @@ class InsurerController extends BaseController
if ($gift_use) {
$liquan_str .= sprintf("%04d", $gift_use->gift_shuzi + 1);
$new_gift_use->gift_shuzi = $gift_use->gift_shuzi + 1;
$new_gift_use->code = $liquan_str;
} else {
$liquan_str .= sprintf("%04d", 1);
$new_gift_use->gift_shuzi = 1;
$new_gift_use->code = strtoupper($liquan_str);
}
$new_gift_use->code = strtoupper($liquan_str);
$new_gift_use->op_id = $this->my->id;
$new_gift_use->type_id = $v; //礼券ID
$new_gift_use->input_date = date('Y-m-d H:i:s');
@ -3565,7 +3604,7 @@ class InsurerController extends BaseController
if ($shiwu_use) {
$new_shiwu->gift_shuzi = $shiwu_use->gift_shuzi + 1;
$new_shiwu->code = sprintf("%04d", $gift_use->gift_shuzi + 1);
$new_shiwu->code = sprintf("%04d", $shiwu_use->gift_shuzi + 1);
} else {
$new_shiwu->gift_shuzi = 1;
$new_shiwu->code = sprintf("%04d", 1);

@ -91,6 +91,9 @@
</ul>
</div>
<a href="/common/logout" class="roll-nav roll-right J_tabExit"><i class="fa fa fa-sign-out"></i> 退出</a>
<a class="navbar-minimalize minimalize-styl-2 btn btn-success roll-right" href="#" style="position:fixed;bottom:40px;">
<i class="fa fa-bars"></i>
</a>
</div>
<div class="row J_mainContent" id="content-main">
<iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="/common/welcome" frameborder="0" data-id="index_v1.html" seamless></iframe>

@ -195,8 +195,8 @@ use common\models\PriceT;
<tr>
<th class="bg-warning">送单地址</th>
<td colspan="5" class="form-inline">
<label><?=$order_info->sendCity->name?></label>
<label><?=$order_info->sendDistrict->name?></label>
<label><?=$order_info->sendCity?$order_info->sendCity->name:''?></label>
<label><?=$order_info->sendDistrict?$order_info->sendDistrict->name:''?></label>
<label><?=$order_info->send_address?></label>
</td>
</tr>
@ -213,6 +213,11 @@ use common\models\PriceT;
<strong>确认礼品</strong>
</button>
<?php } ?>
<?php if($order_info->gift_status == 1 && $my_id == 1) { ?>
<button type="button" class="btn btn-primary btn-cancel" type="button">
<strong>取消确认</strong>
</button>
<?php } ?>
<button type="button" class="btn btn-primary btn-back" type="button">
<strong>返 回</strong>
</button>
@ -345,6 +350,21 @@ use common\models\PriceT;
//
});
});
<?php if($order_info->gift_status == 1 && $my_id == 1) { ?>
$('.btn-cancel').click(function () {
parent.layer.confirm('此操作将回滚礼品状态,删除已生成礼物记录,确定继续?', {
btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
$.post('/insurer/gift-cancel',{order_id:<?=$order_info->id?>},function(data) {
parent.layer.msg(data.msg);
window.location.reload();
}, 'json');
}, function(){
//
});
});
<?php } ?>
});
</script>
<?php $this->endBlock(); ?>

@ -13,12 +13,12 @@ use \common\libs\MyLib;
<form role="form" class="form-horizontal data-from" id="theFrm">
<input type="hidden" name="id" value="<?=intval($info->id)?>">
<div class="form-group">
<label class="col-sm-1 control-label">菜单名称</label>
<div class="col-sm-3">
<label class="col-sm-2 control-label">菜单名称</label>
<div class="col-sm-4">
<input type="text" name="name" value="<?=$info->name?>" class="form-control">
</div>
<label class="col-sm-1 control-label">上级菜单</label>
<div class="col-sm-3">
<label class="col-sm-2 control-label">上级菜单</label>
<div class="col-sm-4">
<select name="parent_id" class="form-control">
<option value="0"></option>
<?php
@ -33,18 +33,18 @@ use \common\libs\MyLib;
</div>
</div>
<div class="form-group">
<label class="col-sm-1 control-label">图标</label>
<div class="col-sm-3">
<label class="col-sm-2 control-label">图标</label>
<div class="col-sm-4">
<input type="text" name="icon" value="<?=$info->icon?>" class="form-control">
</div>
<label class="col-sm-1 control-label">路径</label>
<div class="col-sm-3">
<label class="col-sm-2 control-label">路径</label>
<div class="col-sm-4">
<input type="text" name="path" value="<?=$info->path?>" class="form-control">
</div>
</div>
<div class="form-group">
<label class="col-sm-1 control-label">排序</label>
<div class="col-sm-3">
<label class="col-sm-2 control-label">排序</label>
<div class="col-sm-4">
<input type="text" name="order_id" value="<?=$info->order_id?>" class="form-control">
</div>
</div>

@ -2,10 +2,10 @@
use \common\libs\MyLib;
?>
<?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-content">
<div class="row">
@ -18,7 +18,7 @@ use \common\libs\MyLib;
<div class="row">
<div class="col-sm-12">
<label class="i-checks">
<input type="checkbox" name="menu_ids[]" value="<?=$item->id?>" <?=in_array($item->id, $menu_ids)?'checked':''?>><i></i> <?=$item->name?>
<input type="checkbox" class="parent_checkbox" name="menu_ids[]" value="<?=$item->id?>" <?=in_array($item->id, $menu_ids)?'checked':''?>><i></i> <?=$item->name?>
</label>
</div>
</div>
@ -28,7 +28,7 @@ use \common\libs\MyLib;
<div class="row">
<div class="col-sm-12">
<label class="i-checks">
<input type="checkbox" name="menu_ids[]" value="<?=$sub_item->id?>" <?=in_array($sub_item->id, $menu_ids)?'checked':''?>><i></i> <?=$sub_item->name?>
<input type="checkbox" class="sub_checkbox" name="menu_ids[]" value="<?=$sub_item->id?>" <?=in_array($sub_item->id, $menu_ids)?'checked':''?>><i></i> <?=$sub_item->name?>
</label>
</div>
</div>
@ -48,13 +48,13 @@ use \common\libs\MyLib;
</div>
</div>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script>
$(function(){
$('.btn-save').click(function(){
var params = $('#theFrm').serialize();
@ -67,6 +67,27 @@ use \common\libs\MyLib;
}
},'json');
});
//处理自动选择功能
$('.parent_checkbox').click(function() {
var checked = $(this).prop('checked');
var subs = $(this).parent().parent().parent().parent().next().find('.sub_checkbox');
for(var i = 0; i < subs.length; i++) {
if(checked) {
$(subs[i]).prop('checked', 'checked');
} else {
$(subs[i]).prop('checked', '');
}
}
});
$('.sub_checkbox').click(function() {
var checked = $(this).prop('checked');
var subs = $(this).parent().parent().parent().parent().prev().find('.parent_checkbox');
for(var i = 0; i < subs.length; i++) {
if(checked) {
$(subs[i]).prop('checked', 'checked');
}
}
});
});
</script>
</script>
<?php $this->endBlock(); ?>
Loading…
Cancel
Save