<!-- 模板 -->
<script id="render-tpl" type="text/html">
<div class="panel-body">
<div class="table-responsive col-lg-10">
<form class="form-horizontal addForm" method="post" action="editsave" name="form1" id="edit_form"
enctype="multipart/form-data">
<input type="hidden" id="id" name="id" value="{{ in_data.id }}">
<div class="form-group col-lg-12">
<label class="control-label col-lg-3 text-right"><span class="control-label required-mark">*</span>营业执照:</label>
<span class="input-group file-caption-main col-lg-5" style="float: left;">
<div class="form-control file-caption kv-fileinput-caption"
style="overflow: hidden;line-height: 23px;">
请上传营业执照,尺寸不限
</div>
<input style="display: none;" class="file-real" id="business_license"
name="business_license" type="file" multiple=""/> <div class="input-group-btn file-btn">
<div class="btn btn-primary btn-file" id="for_business_license">
<i class="glyphicon glyphicon-folder-open"></i>&nbsp;
<span class="hidden-xs">上传图片</span>
</div>
</div>
</span>
<span class="col-lg-4 text-left erbi-form-right">
<span class="layer_open_onepic" data-url="{{ in_data.business_license }}"><img src="{{ in_data.business_license }}" width="30" /></span>
</span>
</div> <div class="form-group">
<div class="col-lg-2 col-lg-offset-3">
<button type="button" class="btn btn-primary col-lg-8" id="edit_btn">提交</button>
</div> <div class="col-lg-2">
<button type="button" class="btn btn-danger col-lg-8" id="cancel_btn">取消</button>
</div>
<div class="clear"></div>
</div>
</form>
</div>
<!-- /.table-responsive -->
</div> </script>

js

/**
* 上传图片
*/
$(".upload-img").on('click', function () {
let id = $(this).parent().data('id');
$.ajax({
type: 'POST',
url: 'ajaxGetApplyInfo',
data: {id:id},
dataType: 'json',
success: function (data) {
if (data.errno == 0) {
let html = template('render-tpl', {in_data: data.data});
layer.open({
title: '上传营业执照',
type: 1,
skin: 'layui-layer-rim', //加上边框
area: ['1200px', '400px'], //宽高
content: html
});
} else {
alert(data.errdesc);
return false;
}
}
});
}); $(document).on('click','#cancel_btn',function(){
layer.closeAll();
}); $(document).on('click','#edit_btn',function(){
$("#edit_form").ajaxForm({
dataType: "json",
success : function(obj){
if(obj.errno == 0){
layer.msg('已保存');
setTimeout(function() {
layer.closeAll();
window.location.reload();
},1000);
}else{
layer.msg(obj.errdesc);
}
return false;
}
}); let id = $("#id").val();
if (!id) { // 添加
if(!dealImg('#business_license','请选择图片')) {
return;
}
}
$("#edit_form").submit();
return false;
});

art-template 弹出编辑的更多相关文章

  1. datatables.js 简单使用--弹出编辑框或添加数据框

    内容:选中某一条记录,弹出编辑框 环境:asp.net mvc ,  bootstrap 显示效果: 代码: 至于怎么弄多选框,在上一篇博客里已经有说明. 主要用到了bootstrap的模态窗,下面代 ...

  2. 使用Vue-TreeSelect组件的时候,用watch变量方式解决弹出编辑对话框界面无法触发更新的问题

    在前篇随笔<使用Vue-TreeSelect组件实现公司-部门-人员级联下拉列表的处理>中介绍了Vue-TreeSelect组件的使用,包括使用v-modal绑定值,normalizer ...

  3. layer弹出层,结合art-template实现弹出编辑

    模板 <!-- 模板 --> <script id="render-tpl" type="text/html"> <div cla ...

  4. 【LigerUI实战】Grid弹出编辑popup

    最近为分公司的项目做外援,做起了全栈的活.被公司自研架构磨灭的几乎忘掉了其他技能,正好新项目决定重新搭个架构,与同事们讨论过后,决定Spring+MyBatis+SpringMVC+CXF+Liger ...

  5. layer结合art实现弹出功能

    模板 <!-- 模板 --> <script id="render-tpl" type="text/html"> <table c ...

  6. [JavaScript] 弹出编辑框

    效果:单击图片copy,双击图片或者点Edit都会打开编辑窗口 Style <style> .black_overlay{ display: none; position: absolut ...

  7. PropertyGrid—为复杂属性提供下拉式编辑框和弹出式编辑框

    零.引言 PropertyGrid中我们经常看到一些下拉式的编辑方式(Color属性)和弹出式编辑框(字体),这些都是为一些复杂的属性提供的编辑方式,本文主要说明如何实现这样的编辑方式. 一.为属性提 ...

  8. 使用easeui dialog弹出框中使用CKeditor多次加载后无法编辑问题

    问题呈现:弹出框页面 <tr class="addtr"> <th>内容</th> <td> <!-- <textare ...

  9. iOS开发 编辑框被系统弹出的软键盘遮挡问题

    我们在开发注冊界面的时候,最后几个注冊条件经常easy被系统弹出的键盘遮挡,例如以下图: 能够看见,邮箱条件被遮挡掉了,怎么解决呢?我是通过UITextField的代理加计算偏移量: - (void) ...

随机推荐

  1. 区块链阶段1-Linux基础- 2 Linux文件系统

    2.1 什么是文件系统 文件系统是操作系统在磁盘或分区上组织文件的方法和数据结构.负责对磁盘空间进行组织和分配,存储文件数据,并对其提供保护和检索服务.学习Linux,首先需要了解整个 Linux 文 ...

  2. UML图规范

    1.子类与父类的继承关系用空心三角形+实线表示.   2.类实现接口用空心三角形+虚线表示.(实现关系) 3.类与类之间的关系用实线箭头表示.(关联关系) 关联关系还可细分为三类:单项关联(下图).双 ...

  3. <深度学习优化策略-3> 深度学习网络加速器Weight Normalization_WN

    前面我们学习过深度学习中用于加速网络训练.提升网络泛化能力的两种策略:Batch Normalization(Batch Normalization)和Layer Normalization(LN). ...

  4. text-align-last 实现文本居中对齐

    1.示例代码 <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> < ...

  5. zabbix ALL = NOPASSWD: ALL

  6. C#利用反射获取实体类的主键名称或者获取实体类的值

    //获取主键的 PropertyInfo PropertyInfo pkProp = ).FirstOrDefault(); //主键名称 var keyName=pkProp.Name; //实体类 ...

  7. SpringMVC RequestLoggingFilter log to file

    spring - How to Log HttpRequest and HttpResponse in a file? - Stack Overflowhttps://stackoverflow.co ...

  8. Leetcode: Stream of Characters

    Implement the StreamChecker class as follows: StreamChecker(words): Constructor, init the data struc ...

  9. Linux 服务器远程管理

    一.Linux 常用远程管理工具 点击下载 二.查看服务器 ip 地址命令 1.通过 ip addr 查看网卡 ip 地址 ip addr 2.通过 ifconfig 查看网卡 ip 地址 最小化安装 ...

  10. 使用java 执行ping命令

    借助 Runtime.getRuntime().exec() 可以运行一个windows的exe程序如图,使用java运行 ping 192.168.2.106,返回这样的字符串   1 2 3 4 ...