146 lines
7.9 KiB
PHP
Executable File
146 lines
7.9 KiB
PHP
Executable File
<?php
|
|
use yii\helpers\Html;
|
|
use yii\helpers\Url;
|
|
?>
|
|
<div class="wrapper wrapper-content">
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<div class="ibox float-e-margins">
|
|
<div class="ibox-title">
|
|
<h5>门店管理</h5>
|
|
<div class="ibox-tools">
|
|
<a class="collapse-link">
|
|
<i class="fa fa-chevron-up"></i>
|
|
</a>
|
|
|
|
<a class="close-link">
|
|
<i class="fa fa-times"></i>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<div class="ibox-content">
|
|
<div class="alert alert-info">
|
|
此处录入各网点/门店/办事处/分公司的基础资料
|
|
</div>
|
|
<form class="form-horizontal m-t" method="post" action="<?=Url::toRoute('store/save')?>" role="form">
|
|
<input type="hidden" name="_csrf-backend" value="<?=Yii::$app->getRequest()->getCsrfToken();?>" />
|
|
<input type="hidden" name="id" value="<?=isset($detail['id'])?$detail['id']:0;?>">
|
|
|
|
<div class="form-group draggable">
|
|
<label class="col-sm-1 control-label"><span class="red">*</span> 名称:</label>
|
|
<div class="col-sm-7">
|
|
<input class="form-control" type="text" name="title" value="<?=isset($detail['title'])?$detail['title']:'';?>" placeholder="请输入网点名称" autocomplete="on">
|
|
<span class="help-block m-b-none">如:三亚办事处</span>
|
|
</div>
|
|
|
|
<label class="col-sm-1 control-label">排序:</label>
|
|
<div class="col-sm-2">
|
|
<input class="form-control" type="text" name="order_by" placeholder="" autocomplete="off" value="<?=isset($detail['order_by'])?$detail['order_by']: ''?>">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="col-sm-1 control-label"><span class="red">*</span> 地理位置:</label>
|
|
<div class="col-sm-3" style="margin-right: 0; padding-right: 0;">
|
|
<input type="text" class="form-control" value="<?=isset($detail['lat'])?$detail['lat']:'';?>" placeholder="纬度" id="lat" name="lat"/>
|
|
</div>
|
|
<div class="col-sm-1" style="margin: 0;padding: 0;width: 3rem; line-height: 3rem;text-align: center;">--</div>
|
|
<div class="col-sm-3" style="margin-left: 0; padding-left: 0;" >
|
|
<input type="text" class="form-control" value="<?=isset($detail['longt'])?$detail['longt']:'';?>" placeholder="经度" id="lng" name="lng"/>
|
|
</div>
|
|
<div class="col-sm-1">
|
|
<button type="button" mini="load" w="90%" h="90%" href="<?=Url::toRoute(['index/map','callback'=>'showLatLng','lat'=>isset($detail['lat'])?$detail['lat']:'0','lng'=>isset($detail['longt'])?$detail['longt']:'0']);?>" class="btn btn-w-m btn-primary">从地图选择</button>
|
|
</div>
|
|
<script>
|
|
function showLatLng(lat,lng,detail){
|
|
layer.closeAll();
|
|
layer.msg('选取经纬度成功!');
|
|
$("#lat").val(lat);
|
|
$("#lng").val(lng);
|
|
$("#address").val(detail);
|
|
}
|
|
</script>
|
|
</div>
|
|
|
|
<div class="form-group draggable">
|
|
<label class="col-sm-1 control-label"><span class="red">*</span> 办公地址:</label>
|
|
<div class="col-sm-2">
|
|
<input type="text" class="form-control" name="city_title" id="city-title" value="<?=isset($detail['city_title'])?$detail['city_title']:'';?>" placeholder="点击选择所在城市" autocomplete="off" href="<?=Url::toRoute(['city/select','callback'=>'city']);?>" w="80%;" h="90%;" title="选择所在城市" mini="load">
|
|
<input type="hidden" class="form-control" name="city" id="city-value" value="<?=isset($detail['city'])?$detail['city']:0;?>">
|
|
</div>
|
|
<script>
|
|
function selectCity(title,id,callback)
|
|
{
|
|
layer.closeAll();
|
|
layer.msg('已选择');
|
|
$('#'+callback+'-value').val(id);
|
|
$('#'+callback+'-title').val(title);
|
|
}
|
|
</script>
|
|
<div class="col-sm-7">
|
|
<input class="form-control" type="text" name="addr" id="address" placeholder="请填写具体位置,如**路**号**楼**室" value="<?=isset($detail['addr'])?$detail['addr']:'';?>" autocomplete="off">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group draggable">
|
|
<label class="col-sm-1 control-label">是否删除:
|
|
</label>
|
|
|
|
<div class="col-sm-9">
|
|
<label class="radio-inline">
|
|
<input type="radio" <?=(isset($detail['deleted'])&&$detail['deleted']==1)?'checked':'';?> value="1" id="deleted1" name="deleted">是</label>
|
|
<label class="radio-inline">
|
|
<input type="radio" <?=((!isset($detail['deleted']))||isset($detail['deleted'])&&$detail['deleted']==0)?'checked':'';?> value="0" id="deleted2" name="deleted">否</label>
|
|
</div>
|
|
</div>
|
|
<div class="hr-line-dashed"></div>
|
|
<div class="form-group draggable">
|
|
<div class="col-sm-12 col-sm-offset-3">
|
|
<button class="btn btn-primary" type="submit">保存</button>
|
|
<button class="btn btn-white" type="reset">取消</button>
|
|
<a class="btn btn-info" href="<?=Url::toRoute('store/list')?>">全部网点</a>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<div class="clearfix"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
function showImageFrame(obj){
|
|
//取预设参数
|
|
var id,title,width,height,url;
|
|
id = $(obj).attr('data-id');
|
|
title = $(obj).attr('data-title');
|
|
width = $(obj).attr('data-width');
|
|
height = $(obj).attr('data-height');
|
|
url = $(obj).attr('data-src');
|
|
//iframe层
|
|
parent.layer.open({
|
|
type: 2,
|
|
title: title,
|
|
shadeClose: true,
|
|
shade: 0.8,
|
|
area: [width, height],
|
|
content: url //iframe的url
|
|
});
|
|
}
|
|
|
|
function deleteImage(elm){
|
|
$(elm).prev().attr("src", "../img/nopic.jpg");
|
|
$(elm).parent().prev().find("input").val("");
|
|
parent.layer.msg('图片已删除;您可重新上传');
|
|
}
|
|
|
|
function selectImage(title,path,src,callback)
|
|
{
|
|
layer.closeAll();
|
|
layer.msg('图片已选择');
|
|
$('#'+callback+'-value').val(path);
|
|
$('#'+callback+'-preview').attr('src',src);
|
|
}
|
|
</script>
|