cxgj/modules/admin/views/ball/qc_setting.php
2023-11-27 09:45:13 +08:00

155 lines
4.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
use app\models\Store;
/**
* @author Any
* @description KISS
* @date 2021年6月30日
* @version 1.0.0
*
* _____LOG_____
*
*/
$this->title = '球车租赁设置';
$this->params['breadcrumbs'][] = $this->title;
?>
<style type="text/css">
.layui-table-cell {
height: auto;
}
#container {
width: 100%;
height: 300px;
top:0px;
}
</style>
<div class="layui-fluid">
<div class="layui-card">
<div class="layui-card-header">
<?= $this->title ?>
</div>
<div class="layui-card-header layuiadmin-card-header-auto">
<div class="layui-form-item">
<div class="layui-inline">
<!--<a class=" layui-btn" href="<?= \Yii::$app->urlManager->createUrl(["admin/feedback/edit"]) ?>">添加反馈</a>-->
</div>
<div class="layui-inline layui-float-right">
</div>
</div>
</div>
<div class="layui-card-body">
<table class="layui-table">
<colgroup>
<col width="150">
<col>
</colgroup>
<thead>
<tr>
<th>事件</th>
<th>内容</th>
<th>详情</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr>
<td>最低电量</td>
<td>
<input type="number" value="<?=$qc_zl_kwh_min_value?>" id="kwh_input" class="layui-input">
</td>
<td>
(%) 车辆在低于填写值时不能出租填写3029电量的车不能被租赁
</td>
<td>
<button class="layui-btn layui-btn-sm layui-btn-normal" id="kwh_btn">修 改</button>
</td>
</tr>
<tr>
<td>还车提醒</td>
<td>
<input type="number" value="<?=$qc_wgh_value?>" id="wgh_input" class="layui-input">
</td>
<td>
(分钟) 车辆在租赁中超出此时间点告警
</td>
<td>
<button class="layui-btn layui-btn-sm layui-btn-normal" id="wgh_btn">修 改</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<script>
<?php $this->beginBlock('js_script_wrap') ?>
layui.config({
base: '/statics/layuiadmin/' //静态资源所在路径
}).extend({
index: 'lib/index' //主入口模块
}).use(['index', 'user', 'table', 'form','element'], function () {
var $ = layui.$
, form = layui.form
, table = layui.table
, admin = layui.admin
,element = layui.element;
$('#kwh_btn').click(function(){
var key = "qc_zl_kwh_min";
var value = $("#kwh_input").val()
$.ajax({
url:"<?=\Yii::$app->urlManager->createUrl(['admin/ball/set-qc-setting'])?>",
data:{_csrf:_csrf,key:key,value:value},
type:'POST',
success:function(res){
if(res.code != 0){
return layer.alert(res.msg)
}
return layer.msg(res.msg,function(){
window.location.reload()
})
}
})
})
$('#wgh_btn').click(function(){
var key = "qc_wgh";
var value = $("#wgh_input").val()
$.ajax({
url:"<?=\Yii::$app->urlManager->createUrl(['admin/ball/set-qc-setting'])?>",
data:{_csrf:_csrf,key:key,value:value},
type:'POST',
success:function(res){
if(res.code != 0){
return layer.alert(res.msg)
}
return layer.msg(res.msg,function(){
window.location.reload()
})
}
})
})
});
function GetQueryString(name)
{
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if(r!=null)return unescape(r[2]); return null;
}
<?php $this->endBlock(); ?>
</script>
<?php $this->registerJs($this->blocks['js_script_wrap'], \yii\web\View::POS_END); ?>