art-template 弹出编辑
<!-- 模板 -->
<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>
<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 弹出编辑的更多相关文章
- datatables.js 简单使用--弹出编辑框或添加数据框
内容:选中某一条记录,弹出编辑框 环境:asp.net mvc , bootstrap 显示效果: 代码: 至于怎么弄多选框,在上一篇博客里已经有说明. 主要用到了bootstrap的模态窗,下面代 ...
- 使用Vue-TreeSelect组件的时候,用watch变量方式解决弹出编辑对话框界面无法触发更新的问题
在前篇随笔<使用Vue-TreeSelect组件实现公司-部门-人员级联下拉列表的处理>中介绍了Vue-TreeSelect组件的使用,包括使用v-modal绑定值,normalizer ...
- layer弹出层,结合art-template实现弹出编辑
模板 <!-- 模板 --> <script id="render-tpl" type="text/html"> <div cla ...
- 【LigerUI实战】Grid弹出编辑popup
最近为分公司的项目做外援,做起了全栈的活.被公司自研架构磨灭的几乎忘掉了其他技能,正好新项目决定重新搭个架构,与同事们讨论过后,决定Spring+MyBatis+SpringMVC+CXF+Liger ...
- layer结合art实现弹出功能
模板 <!-- 模板 --> <script id="render-tpl" type="text/html"> <table c ...
- [JavaScript] 弹出编辑框
效果:单击图片copy,双击图片或者点Edit都会打开编辑窗口 Style <style> .black_overlay{ display: none; position: absolut ...
- PropertyGrid—为复杂属性提供下拉式编辑框和弹出式编辑框
零.引言 PropertyGrid中我们经常看到一些下拉式的编辑方式(Color属性)和弹出式编辑框(字体),这些都是为一些复杂的属性提供的编辑方式,本文主要说明如何实现这样的编辑方式. 一.为属性提 ...
- 使用easeui dialog弹出框中使用CKeditor多次加载后无法编辑问题
问题呈现:弹出框页面 <tr class="addtr"> <th>内容</th> <td> <!-- <textare ...
- iOS开发 编辑框被系统弹出的软键盘遮挡问题
我们在开发注冊界面的时候,最后几个注冊条件经常easy被系统弹出的键盘遮挡,例如以下图: 能够看见,邮箱条件被遮挡掉了,怎么解决呢?我是通过UITextField的代理加计算偏移量: - (void) ...
随机推荐
- php 压缩文件
<?php $zip = new ZipArchive; $myfile = fopen("test.zip", "w"); chmod(); if ($ ...
- 【Python 代码】CS231n中Softmax线性分类器、非线性分类器对比举例(含python绘图显示结果)
1 #CS231n中线性.非线性分类器举例(Softmax) #注意其中反向传播的计算 # -*- coding: utf-8 -*- import numpy as np import matplo ...
- 分布式缓存Redis集群搭建
redis安装 1.下载tar包至/opt/redis 2.解压tar包 tar -xvf redis-4.0.14.tar.gz 3. cd redis-4.0.14 make一下. 单节点的red ...
- 项目管理工具_maven的配置
<parent> <groupId>cn.itcast.maven</groupId> <artifactId>Parent</artifactI ...
- python 生成 pyc 文件
以 pyc 为扩展名的是Python的编译文件.其执行速度快于 py 文件且不能用文本编辑编辑查看.所以 pyc 文件往往代替 py 文件发布. Python 在执行时,首先会将 py 文件中的源代码 ...
- git clone时报错“Failed to connect to 127.0.0.1 port 2453: Connection refused”如何处理?
1. 查看git的配置 git config --global --list| grep -i proxy 如果有内容输出,那么unset配置项,如: git config --global --un ...
- PHP 自动加载类
类的自动加载 (Autoloading Classes) 在编写面向对象(OOP) 程序时,很多开发者为每个类新建一个 PHP 文件. 这会带来一个烦恼:每个脚本的开头,都需要包含(include)一 ...
- git commit之后,撤销 commit
写完代码后,我们一般这样 git add . //添加所有文件 git commit -m "本功能全部完成" 执行完commit后,想撤回commit,怎么办? 可以执行如下命令 ...
- flutter State管理
import 'package:flutter/material.dart'; import 'package:scoped_model/scoped_model.dart'; class State ...
- openresty开发系列26--openresty中使用redis模块
openresty开发系列26--openresty中使用redis模块 在一些高并发的场景中,我们常常会用到缓存技术,现在我们常用的分布式缓存redis是最知名的, 操作redis,我们需要引入re ...