12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <?php $shoname_name = D('Home/Front')->get_config_by_name('shoname'); ?>
- <title><?php echo $shoname; ?></title>
- <link rel="shortcut icon" href="" />
-
- <meta name="renderer" content="webkit">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
- <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
-
- <!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
- <!--[if lt IE 9]>
- <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
- <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
- <![endif]-->
- <link href="./resource/css/bootstrap.min.css?v=201903260001" rel="stylesheet">
- <link href="./resource/css/common.css?v=201903260001" rel="stylesheet">
- <script type="text/javascript">
- window.sysinfo = {
- <?php if (!empty($_W['uniacid']) ){ ?>'uniacid': '{$_W['uniacid']}',<?php } ?>
-
- <?php if( !empty($_W['acid']) ){ ?>'acid': '{$_W['acid']}',<?php } ?>
-
- <?php if (!empty($_W['openid']) ) { ?>'openid': '{$_W['openid']}',<?php } ?>
-
- <?php if( !empty($_W['uid']) ) { ?>'uid': '{$_W['uid']}',<?php } ?>
-
- 'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php }else{ ?>0<?php } ?>,
-
- 'siteroot': '{$_W['siteroot']}',
- 'siteurl': '{$_W['siteurl']}',
- 'attachurl': '{$_W['attachurl']}',
- 'attachurl_local': '{$_W['attachurl_local']}',
- 'attachurl_remote': '{$_W['attachurl_remote']}',
- 'module' : {'url' : '<?php if( defined('MODULE_URL') ) { ?>{MODULE_URL}<?php } ?>', 'name' : '<?php if (defined('IN_MODULE') ) { ?>{IN_MODULE}<?php } ?>'},
- 'cookie' : {'pre': ''},
- 'account' : {:json_encode($_W['account'])},
- };
- </script>
- <script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
- <script type="text/javascript" src="./resource/js/lib/bootstrap.min.js"></script>
- <script type="text/javascript" src="./resource/js/app/util.js?v=201903260001"></script>
- <script type="text/javascript" src="./resource/js/app/common.min.js?v=201903260001"></script>
- <script type="text/javascript" src="./resource/js/require.js?v=201903260001"></script>
- <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
- <link href="/static/css/snailfish.css" rel="stylesheet">
- <style>
- tbody tr td{
- position: relative;
- }
- tbody tr .icow-weibiaoti--{
- visibility: hidden;
- display: inline-block;
- color: #fff;
- height:18px;
- width:18px;
- background: #e0e0e0;
- text-align: center;
- line-height: 18px;
- vertical-align: middle;
- }
- tbody tr:hover .icow-weibiaoti--{
- visibility: visible;
- }
- tbody tr .icow-weibiaoti--.hidden{
- visibility: hidden !important;
- }
- .full .icow-weibiaoti--{
- margin-left:10px;
- }
- .full>span{
- display: -webkit-box;
- display: -webkit-flex;
- display: -ms-flexbox;
- display: flex;
- vertical-align: middle;
- align-items: center;
- }
- tbody tr .label{
- margin: 5px 0;
- }
- .goods_attribute a{
- cursor: pointer;
- }
- .newgoodsflag{
- width: 22px;height: 16px;
- background-color: #ff0000;
- color: #fff;
- text-align: center;
- position: absolute;
- bottom: 70px;
- left: 57px;
- font-size: 12px;
- }
- .a{cursor: pointer;}
- .daterangepicker select.ampmselect, .daterangepicker select.hourselect, .daterangepicker select.minuteselect{
- width:auto!important;
- }
- .we7-modal-dialog .modal-footer, .modal-dialog .modal-footer{padding:0px;}
- .modal-footer{padding:0px;}
- </style>
- </head>
- <body layadmin-themealias="default">
- <table id="demo" lay-filter="test"></table>
- <div class="layui-fluid">
- <div class="layui-card">
- <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">商品列表</span></div>
-
- <div class="layui-tab layui-tab-brief" >
- <ul class="layui-tab-title">
- <li <?php if(empty($type) || $type=='all'){ ?>class="layui-this"<?php } ?>><a href="{:U('points/goods')}">全部商品({$all_count})</a></li>
- <li <?php if($type=='saleon'){ ?>class="layui-this"<?php } ?> ><a href="{:U('points/goods',array('type'=>'saleon'))}">出售中({$onsale_count})</a></li>
- <li <?php if($type=='stock_notice'){ ?>class="layui-this"<?php } ?> ><a href="{:U('points/goods',array('type'=>'stock_notice'))}">库存预警({$stock_notice_count})</a></li>
- <li <?php if($type=='getdown'){ ?>class="layui-this"<?php } ?> ><a href="{:U('points/goods',array('type'=>'getdown'))}">已下架({$getdown_count})</a></li>
-
- <?php if($is_open_shenhe == 1){ ?>
- <li <?php if($type=='warehouse'){ ?>class="layui-this"<?php } ?> ><a href="{:U('points/goods',array('type'=>'warehouse'))}">仓库({$warehouse_count})</a></li>
- <?php } ?>
- <li <?php if($type=='recycle'){ ?>class="layui-this"<?php } ?> ><a href="{:U('points/goods',array('type'=>'recycle'))}">回收站({$recycle_count})</a></li>
-
- </ul>
- </div>
-
- <div class="layui-card-body" style="padding:15px;">
- <form action="" method="get" class="form-horizontal form-search layui-form" role="form">
- <input type="hidden" name="c" value="points" />
- <input type="hidden" name="a" value="goods" />
- <input type="hidden" name="type" value="{$type}" />
-
- <div class="layui-form-item">
- <div class="layui-inline">
- <div class="layui-input-inline" >
- <input type="text" class="layui-input" name="keyword" value="{$keyword}" placeholder="输入商品编码或者名称"/>
- </div>
- <div class="layui-input-inline" >
- <select name='searchtime' class='layui-input layui-unselect' style="width:100px;padding:0 5px;">
- <option value=''>不按时间</option>
- <option value='create' <?php if($searchtime=='create'){ ?>selected<?php } ?>>团购时间</option>
- </select>
- </div>
- <div class="layui-input-inline" style="width:280px;">
- {:tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d H:i', $starttime),'endtime'=>date('Y-m-d H:i', $endtime)),true);}
- </div>
- <div class="layui-input-inline" >
- <select name="cate" class='layui-input layui-unselect' style="width:200px;" >
- <option value="" <?php if( empty($cate) ){ ?>selected<?php } ?> >商品分类</option>
- <?php foreach($category as $c){ ?>
- <option value="{$c['id']}" <?php if( $cate==$c['id'] ){ ?>selected<?php } ?> >{$c['name']}</option>
- <?php } ?>
- </select>
- </div>
-
- <div class="layui-input-inline">
- <button class="layui-btn layui-btn-sm" type="submit"> 搜索</button>
- </div>
- </div>
- </div>
- </form>
- <form action="" class="layui-form" lay-filter="example" method="post" >
-
- <div class="row">
- <div class="col-md-12">
-
- <div class="page-table-header">
-
- <span class="pull-right">
- <a href="{:U('points/addgoods', array('ok' =>1))}" class="layui-btn layui-btn-sm"><i class="fa fa-plus"></i> 添加商品</a>
- </span>
- <div class="btn-group">
-
-
- <?php if($is_updown){ ?>
- <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch' data-href="{:U('goods/change',array('type'=>'grounding','value'=>1))}">
- <i class='icow icow-shangjia2'></i> 上架
- </button>
- <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch' data-href="{:U('goods/change',array('type'=>'grounding','value'=>0))}">
- <i class='icow icow-xiajia3'></i> 下架
- </button>
- <?php } ?>
-
-
-
- <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch-group' id="batchtime" >设置活动时间</button>
-
- <?php if($type!='recycle'){ ?>
- <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch-remove' data-confirm="确认要删除吗,删除后商品将进入回收站?" data-href="{:U('goods/change',array('type'=>'grounding','value'=>3))}">
- <i class='icow icow-shanchu1'></i> 删除
- </button>
- <?php } ?>
- <?php if($type=='recycle'){ ?>
- <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch-remove' data-confirm="确认要彻底删除吗?" data-href="{:U('goods/delete')}"><i class='icow icow-shanchu1'></i> 彻底删除</button>
- <?php } ?>
- </div>
- </div>
- <table class="table table-responsive" lay-even lay-skin="line" lay-size="lg">
-
- <thead>
- <tr>
- <th style="width:25px;">
- <input type='checkbox' name="checkall" lay-skin="primary" lay-filter="checkboxall" />
- </th>
- <th style="width:80px;text-align:center;">ID</th>
- <th style=""> </th>
- <th style="width:200px;">商品名称</th>
- <th style="">活动时间</th>
- <th style="width: 120px;">价格</th>
- <th style="width: 80px;">销量</th>
- <th style="width: 80px;">库存</th>
-
- <th style="width:180px;" >是否上架<?php if($is_open_shenhe==1){ ?><br/>是否审核<?php } ?></th>
-
- <?php if($is_top){ ?>
- <?php if($index_sort_method == 1){ ?>
- <th>首页排序</th>
- <?php }else{ ?>
- <th>置顶</th>
- <?php } ?>
- <?php } ?>
-
- <th style="">操作</th>
- </tr>
- </tr>
- </thead>
- <tbody>
-
- <?php foreach($list as $item){ ?>
- <tr>
- <td>
- <input type='checkbox' name="item_checkbox" class="checkone" lay-skin="primary" value="{$item['id']}"/>
- </td>
- <td style="text-align:center;">
- {$item['id']}
- </td>
- <td>
- <a href="{:U('points/editgoods', array('id' => $item['id'],'goodsfrom'=>$goodsfrom,'page'=>$page))}">
- <img src="{$item['thumb']}" style="width:72px;height:72px;padding:1px;border:1px solid #efefef;margin: 7px 0" />
- </a>
- </td>
- <td class='full' >
- <span>
- <span style="display: block;width: 100%;">
-
- <?php if($item['supply_id'] <=0){ ?><span class="text">[自营<?php if( !empty($item['supply_name']) ){ ?>{$item['supply_name']}<?php } ?>]</span><?php }else if( !empty($item['supply_name']) ){ ?><span class="text">[{$item['supply_name']}]</span><?php } ?>
- <a href='javascript:;' data-toggle='ajaxEdit' data-href="{:U('goods/change',array('type'=>'goodsname','id'=>$item['id']))}" >
-
- <span class="text-danger">{$item['goodsname']}</span>
- </a>
-
-
-
- <?php if( !empty($item['cate']) ){ ?>
- <?php foreach($item['cate'] as $g_cate){ ?>
- <span class="text-danger">[<?php echo isset($category[$g_cate['cate_id']]) ? $category[$g_cate['cate_id']]['name']: '无分类';?>]</span>
- <?php } ?>
- <?php }else{ ?>
- <span class="text-danger">[无分类]</span>
- <?php } ?>
-
- <?php if( $pintuan_model_buy == 1 ){ ?>
- <br/>
- <?php if( $item['is_all_sale'] == 1 ){ ?>
- <span class="text-green">[所有团长{$item['head_count']}]</span>
- <?php }else if( $item['head_count'] >0 ){ ?>
- <span class="text-green">[部分团长{$item['head_count']}]</span>
- <?php }else if( $item['head_count'] == 0 ){ ?>
- <span class="text-green">[无团长0]</span>
- <?php } ?>
- <?php } ?>
-
-
- <?php if($item['is_new_buy'] == 1){ ?>
- <span class="line-text">新人专享</a>
- <?php } ?>
-
-
- </span>
- </span>
- </td>
- <td>
- {:date("Y-m-d H:i:s",$item['begin_time'])}
- <br/>
- {:date("Y-m-d H:i:s",$item['end_time'])}
- <br/>
-
- <?php if($item['grounding']==1){ ?>
- <?php if($item['end_time'] <= time()){ ?>
- <span class="text-danger">活动已结束</span>
- <?php } ?>
- <?php if( $item['begin_time'] <= time() && $item['end_time'] > time() ){ ?>
- <span class="text-danger">正在进行中</span>
- <?php } ?>
-
- <?php if( $item['begin_time'] > time() ){ ?>
- <span class="text-danger">活动未开始</span>
- <?php } ?>
- <?php }else{ ?>
-
- <?php if( $item['end_time'] <= time() ){ ?>
- <span class="text-danger">活动已结束</span>
- <?php } ?>
- <?php if( $item['begin_time'] <= time() && $item['end_time'] > time() ){ ?>
- <span class="text-danger">未上架</span>
- <?php } ?>
-
- <?php if( $item['begin_time'] > time() ){ ?>
- <span class="text-danger">活动未开始</span>
- <?php } ?>
- <?php } ?>
-
- </td>
- <td >¥
-
- <?php if( $item['hasoption']==1 ){ ?>
- {$item['price_arr']['price']} <?php if( isset($item['price_arr']['max_danprice']) ){ ?>~¥{$item['price_arr']['max_danprice']}<?php } ?>
- <?php }else{ ?>
- <a href='javascript:;' data-toggle='ajaxEdit' data-href="{:U('goods/change',array('type'=>'price','id'=>$item['id']))}" >
-
- {$item['price']}
- </a>
- <?php } ?>
- </td>
- <td>{$item['seller_count']}</td>
- <td>
-
- <?php if( $item['hasoption']==1 ){ ?>
- {$item['total']}
- <?php }else{ ?>
- <a href='javascript:;' data-toggle='ajaxEdit' data-href="{:U('goods/change',array('type'=>'total','id'=>$item['id']))}" >
-
- <span class="text-danger">{$item['total']}</span>
- </a>
- <?php } ?>
- </td>
-
- <td>
- <input type="checkbox" name="" lay-filter="undowngroundingsitch" data-href="{:U('goods/change',array('type'=>'grounding','id'=>$item['id']))}" <?php if( $item['grounding']==1 ){ ?>checked<?php }else{ ?><?php } ?> lay-skin="switch" lay-text="上架|下架">
-
- </td>
-
- <?php if($is_top){ ?>
-
- <?php if($index_sort_method == 1){ ?>
- <td style="text-align:center;">
- <a href='javascript:;' data-toggle='ajaxEdit' data-href="{:U('goods/change',array('type'=>'index_sort','id'=>$item['id']))}" >
- <span class="text-danger">{$item['index_sort']}</span>
- </a>
- </td>
- <?php }else{ ?>
- <td >
-
- <input type="checkbox" name="" lay-filter="istop_showsitch" data-href="{:U('goods/settop',array('type'=>'istop','id'=>$item['id']))}" <?php if($item['istop']==1){ ?>checked<?php }else{ ?><?php } ?> lay-skin="switch" lay-text="置顶|未置顶">
-
- </td>
- <?php } ?>
- <?php } ?>
-
-
-
-
- <td style="overflow:visible;position:relative">
-
- <a class='layui-btn layui-btn-xs' href="{:U('points/editgoods', array('id' => $item['id'],'ok'=>1,'page'=>$page))}" >
- <i class="layui-icon layui-icon-edit"></i>编辑
- </a>
-
- <?php if($type!='recycle'){ ?>
- <a class='layui-btn layui-btn-xs deldom' href="javascript:;" data-href="{:U('goods/change',array('id' => $item['id'],'type'=>'grounding','value'=>3))}" data-confirm='确认要删除吗,删除后商品将进入回收站?'>
- <i class="layui-icon"></i>删除
- </a>
- <?php } ?>
- <?php if($type=='recycle'){ ?>
- <a class='layui-btn layui-btn-xs deldom' href="javascript:;" data-href="{:U('goods/delete', array('id' => $item['id']))}" data-confirm='确认要彻底删除吗?'>
- <i class="layui-icon"></i>彻底删除
- </a>
- <?php } ?>
-
-
- </td>
- </tr>
- <?php } ?>
- </tbody>
- <tfoot>
- <tr>
- <td colspan="7">
- <div class="page-table-header">
- <input type="checkbox" name="checkall" lay-skin="primary" lay-filter="checkboxall">
- <div class="btn-group">
-
-
-
- <?php if($is_updown){ ?>
- <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch' data-href="{:U('goods/change',array('type'=>'grounding','value'=>1))}">
- <i class='icow icow-shangjia2'></i> 上架
- </button>
- <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch' data-href="{:U('goods/change',array('type'=>'grounding','value'=>0))}">
- <i class='icow icow-xiajia3'></i> 下架
- </button>
- <?php } ?>
-
-
-
- <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch-group' id="batchtime" >设置活动时间</button>
-
- <?php if($type!='recycle'){ ?>
- <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch-remove' data-confirm="确认要删除吗,删除后商品将进入回收站?" data-href="{:U('goods/change',array('type'=>'grounding','value'=>3))}">
- <i class='icow icow-shanchu1'></i> 删除
- </button>
- <?php } ?>
-
- <?php if($type=='recycle'){ ?>
- <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch-remove' data-confirm="确认要彻底删除吗?" data-href="{:U('goods/delete')}"><i class='icow icow-shanchu1'></i> 彻底删除</button>
- <?php } ?>
- </div>
- </div>
- </td>
- <td colspan="5" style="text-align: right">
- {$pager}
- </td>
- </tr>
- </tfoot>
- </table>
- </div>
- </div>
-
- </form>
- </div>
- </div>
- </div>
- <div id="batchcates_html" style="display:none;">
- <div class="layui-card">
- <div class="layui-card-body">
- <div class="modal-body" >
- <div class="layui-form-item">
- <label class="layui-form-label"></label>
- <div class="layui-input-block">
- <label class="radio-inline"><input type="radio" name="iscover" value="0" <?php if($iscover ==0){ ?> checked="checked"<?php } ?> /> 保留原有分类</label>
- <label class="radio-inline"><input type="radio" name="iscover" value="1" <?php if($iscover ==1){ ?> checked="checked"<?php } ?> /> 覆盖原有分类</label>
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">商品分类</label>
- <div class="layui-input-block">
- <select id="cates2" lay-verify="cates_sel" name='cates' class="form-control " style='' >
-
- <?php foreach($category as $c){ ?>
- <option value="{$c['id']}" <?php if(is_array($cates) && in_array($c['id'],$cates)){ ?>selected<?php } ?> >{$c['name']}</option>
- <?php } ?>
- </select>
- </div>
- </div>
- <div class="layui-form-item">
- <div class="layui-input-block">
- <button class="btn btn-primary modal-fenlei">确认</button>
- <button class="btn btn-default cancle" >取消</button>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div id="batchcates_headgroup_html" style="display:none;">
- <div class="layui-card">
- <div class="layui-card-body">
- <div class="modal-body" >
-
- <div class="layui-form-item">
- <label class="layui-form-label">团长分组</label>
- <div class="layui-input-block">
- <select id="group_heads" lay-verify="group_heads" name='group_heads' class="form-control " style='' >
-
- <?php foreach($group_list as $c){ ?>
- <option value="{$c['id']}" <?php if(is_array($cates) && in_array($c['id'],$cates)){ ?>selected<?php } ?> >{$c['groupname']}</option>
- <?php } ?>
- </select>
- </div>
- </div>
- <div class="layui-form-item">
- <div class="layui-input-block">
- <button class="btn btn-primary modal-group-head">确认</button>
- <button class="btn btn-default cancle" >取消</button>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div id="batchheads" style="z-index: 999;display: none;position: fixed;top: 0;left: 0;right: 0;bottom: 0;background: rgba(0,0,0,0.5)" class="form-horizontal form-validate batchcates" enctype="multipart/form-data">
- <div class="modal-dialog" style="position: absolute;margin-top: -300px">
- <div class="modal-content">
- <div class="modal-header">
- <button data-dismiss="modal" class="close" type="button">×</button>
- <h4 class="modal-title">选取团长</h4>
- </div>
- <div class="modal-body" style="height:600px">
- <div class="form-group">
- <label class="col-sm-2 control-label">社区位置</label>
- <div class="col-sm-10 col-xs-12">
- <p>
- <select id="sel-provance" name="province_id" onChange="selectCity();" class="select form-control" style="width:130px;display:inline;">
- <option value="" selected="true">省/直辖市</option>
- </select>
- <select id="sel-city" name="city_id" onChange="selectcounty(0)" class="select form-control" style="width:135px;display:inline;">
- <option value="" selected="true">请选择</option>
- </select>
- <select id="sel-area" name="area_id" onChange="selectstreet(0)" class="select form-control" style="width:130px;display:inline;">
- <option value="" selected="true">请选择</option>
- </select>
- <select id="sel-street" name="country_id" class="select form-control" style="width:130px;display:inline;">
- <option value="" selected="true">请选择</option>
- </select>
- </p>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">团长名称</label>
- <div class="col-sm-10 col-xs-12">
- <div class="input-group">
- <input type="text" class="form-control" name="keyword" id="supply_id_input" placeholder="团长名称/团长手机号/社区地址">
- <span class="input-group-btn">
- <button type="button" class="btn btn-default" onclick="search_heads()">搜索</button>
- </span>
- </div>
- </div>
- </div>
-
- <div class="form-group">
- <div class="col-sm-1 control-label">
-
- </div>
- <div class="col-sm-10 col-xs-12">
- <div class="page-table-header">
- <input type="checkbox" class="check_heads_all">
- <div class="btn-group">
- 全选/反选
- </div>
- </div>
- </div>
- </div>
-
- <div class="row">
- <label class="col-sm-1 control-label"></label>
- <div class="col-sm-11 col-xs-12">
- <div class="content" style="padding-top:5px;" data-name="supply_id">
- <div style="max-height:450px;overflow:auto;" id="batchheads_content">
-
- </div>
- <div class="" id="batchheads_page">
-
- </div>
- </div>
- </div>
- </div>
-
-
- </div>
- <div class="modal-footer">
- <button class="btn btn-primary model_heads">确认</button>
- <button class="btn btn-default" >取消</button>
- </div>
- </div>
- </div>
- </div>
- <div id="batch_time" style="z-index: 8;display: none;position: fixed;top: 0;left: 0;right: 0;bottom: 0;background: rgba(0,0,0,0.5)" class="form-horizontal form-validate batchtime" enctype="multipart/form-data">
- <div class="modal-dialog" style="position: absolute;margin-top: -190px">
- <div class="modal-content">
- <div class="modal-header">
- <button data-dismiss="modal" class="close" type="button">×</button>
- <h4 class="modal-title">设置活动时间</h4>
- </div>
- <div class="modal-body" style="height:270px">
- <div class="form-group">
- <label class="col-sm-2 control-label">活动时间</label>
- <div class="col-sm-8 col-xs-12">
- <span class="input-group-btn">
- {:tpl_form_field_daterange('setsametime', array('starttime'=>date('Y-m-d H:i', $starttime),'endtime'=>date('Y-m-d H:i', $endtime)),true);}
- </span>
- </div>
- </div>
- </div>
- <div class="modal-footer">
- <button class="btn btn-primary modal-time">确认</button>
- <button class="btn btn-default cancle" >取消</button>
- </div>
- </div>
- </div>
- </div>
- <script src="/layuiadmin/layui/layui.js"></script>
- <script>
- layui.config({
- base: '/layuiadmin/' //静态资源所在路径
- }).extend({
- index: 'lib/index' //主入口模块
- }).use('index');
- </script>
- <script>
- //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
- var layer = layui.layer;
- var $;
- layui.use(['jquery', 'layer','form'], function(){
- $ = layui.$;
- var form = layui.form;
-
-
- $('.deldom').click(function(){
- var s_url = $(this).attr('data-href');
- layer.confirm($(this).attr('data-confirm'), function(index){
- $.ajax({
- url:s_url,
- type:'post',
- dataType:'json',
- success:function(info){
-
- if(info.status == 0)
- {
- layer.msg(info.result.message,{icon: 1,time: 2000});
- }else if(info.status == 1){
- var go_url = location.href;
- if( info.result.hasOwnProperty("url") )
- {
- go_url = info.result.url;
- }
-
- layer.msg('操作成功',{time: 1000,
- end:function(){
- location.href = info.result.url;
- }
- });
- }
- }
- })
- });
- })
-
- $('.btn-operation').click(function(){
- var ids_arr = [];
- var obj = $(this);
- var s_toggle = $(this).attr('data-toggle');
- var s_url = $(this).attr('data-href');
-
-
- $("input[name=item_checkbox]").each(function() {
-
- if( $(this).prop('checked') )
- {
- ids_arr.push( $(this).val() );
- }
- })
- if(ids_arr.length < 1)
- {
- layer.msg('请选择要操作的内容');
- return false;
- }else{
- var can_sub = true;
- if( s_toggle == 'batch-remove' )
- {
- can_sub = false;
-
- layer.confirm($(obj).attr('data-confirm'), function(index){
- $.ajax({
- url:s_url,
- type:'post',
- dataType:'json',
- data:{ids:ids_arr},
- success:function(info){
-
- if(info.status == 0)
- {
- layer.msg(info.result.message,{icon: 1,time: 2000});
- }else if(info.status == 1){
- var go_url = location.href;
- if( info.result.hasOwnProperty("url") )
- {
- go_url = info.result.url;
- }
-
- layer.msg('操作成功',{time: 1000,
- end:function(){
- location.href = info.result.url;
- }
- });
- }
- }
- })
- });
- }else{
- $.ajax({
- url:s_url,
- type:'post',
- dataType:'json',
- data:{ids:ids_arr},
- success:function(info){
-
- if(info.status == 0)
- {
- layer.msg(info.result.message,{icon: 1,time: 2000});
- }else if(info.status == 1){
- var go_url = location.href;
- if( info.result.hasOwnProperty("url") )
- {
- go_url = info.result.url;
- }
-
- layer.msg('操作成功',{time: 1000,
- end:function(){
- location.href = info.result.url;
- }
- });
-
- }
- }
- })
- }
- }
- })
-
-
- form.on('switch(cmwsitch)', function(data){
-
- var s_url = $(this).attr('data-href')
-
- var is_take_fullreduction = 1;
- if(data.elem.checked)
- {
- is_take_fullreduction = 1;
- }else{
- is_take_fullreduction = 0;
- }
-
- $.ajax({
- url:s_url,
- type:'post',
- dataType:'json',
- data:{value:is_take_fullreduction},
- success:function(info){
-
- if(info.status == 0)
- {
- layer.msg(info.result.message,{icon: 1,time: 2000});
- }else if(info.status == 1){
- var go_url = location.href;
- if( info.result.hasOwnProperty("url") )
- {
- go_url = info.result.url;
- }
-
- layer.msg('操作成功',{time: 1000,
- end:function(){
- location.href = info.result.url;
- }
- });
- }
- }
- })
- });
- form.on('switch(groundingsitch)', function(data){
-
- var s_url = $(this).attr('data-href')
-
- var grounding = 1;
- if(data.elem.checked)
- {
- grounding = 1;
- }else{
- grounding = 0;
- }
-
- $.ajax({
- url:s_url,
- type:'post',
- dataType:'json',
- data:{value:grounding},
- success:function(info){
-
- if(info.status == 0)
- {
- layer.msg(info.result.message,{icon: 1,time: 2000});
- }else if(info.status == 1){
- var go_url = location.href;
- if( info.result.hasOwnProperty("url") )
- {
- go_url = info.result.url;
- }
-
- layer.msg('操作成功',{time: 1000,
- end:function(){
- location.href = info.result.url;
- }
- });
- }
- }
- })
- });
-
-
- form.on('switch(unengroundingsitch)', function(data){
-
- var s_url = $(this).attr('data-href')
-
- var grounding = 1;
- if(data.elem.checked)
- {
- grounding = 5;
- }
-
- $.ajax({
- url:s_url,
- type:'post',
- dataType:'json',
- data:{value:grounding},
- success:function(info){
-
- if(info.status == 0)
- {
- layer.msg(info.result.message,{icon: 1,time: 2000});
- }else if(info.status == 1){
- var go_url = location.href;
- if( info.result.hasOwnProperty("url") )
- {
- go_url = info.result.url;
- }
-
- layer.msg('操作成功',{time: 1000,
- end:function(){
- location.href = info.result.url;
- }
- });
- }
- }
- })
- });
-
- form.on('switch(engroundingsitch)', function(data){
-
- var s_url = $(this).attr('data-href')
-
- var grounding = 1;
- if(data.elem.checked)
- {
- grounding = 1;
- }else{
- grounding = 5;
- }
-
- $.ajax({
- url:s_url,
- type:'post',
- dataType:'json',
- data:{value:grounding},
- success:function(info){
-
- if(info.status == 0)
- {
- layer.msg(info.result.message,{icon: 1,time: 2000});
- }else if(info.status == 1){
- var go_url = location.href;
- if( info.result.hasOwnProperty("url") )
- {
- go_url = info.result.url;
- }
-
- layer.msg('操作成功',{time: 1000,
- end:function(){
- location.href = info.result.url;
- }
- });
- }
- }
- })
- });
- form.on('switch(undowngroundingsitch)', function(data){
-
- var s_url = $(this).attr('data-href')
-
- var grounding = 1;
- if(data.elem.checked)
- {
- grounding = 1;
- }else{
- grounding = 0;
- }
-
- $.ajax({
- url:s_url,
- type:'post',
- dataType:'json',
- data:{value:grounding},
- success:function(info){
-
- if(info.status == 0)
- {
- layer.msg(info.result.message,{icon: 1,time: 2000});
- }else if(info.status == 1){
- var go_url = location.href;
- if( info.result.hasOwnProperty("url") )
- {
- go_url = info.result.url;
- }
-
- layer.msg('操作成功',{time: 1000,
- end:function(){
- location.href = info.result.url;
- }
- });
- }
- }
- })
- });
-
- form.on('switch(is_index_showsitch)', function(data){
-
- var s_url = $(this).attr('data-href')
-
- var is_index_show = 1;
- if(data.elem.checked)
- {
- is_index_show = 1;
- }else{
- is_index_show = 0;
- }
-
- $.ajax({
- url:s_url,
- type:'post',
- dataType:'json',
- data:{value:is_index_show},
- success:function(info){
-
- if(info.status == 0)
- {
- layer.msg(info.result.message,{icon: 1,time: 2000});
- }else if(info.status == 1){
- var go_url = location.href;
- if( info.result.hasOwnProperty("url") )
- {
- go_url = info.result.url;
- }
-
- layer.msg('操作成功',{time: 1000,
- end:function(){
- location.href = info.result.url;
- }
- });
- }
- }
- })
- });
-
- form.on('switch(istop_showsitch)', function(data){
-
- var s_url = $(this).attr('data-href')
-
- var istop = 1;
- if(data.elem.checked)
- {
- istop = 1;
- }else{
- istop = 0;
- }
-
- $.ajax({
- url:s_url,
- type:'post',
- dataType:'json',
- data:{value:istop},
- success:function(info){
-
- if(info.status == 0)
- {
- layer.msg(info.result.message,{icon: 1,time: 2000});
- }else if(info.status == 1){
- var go_url = location.href;
- if( info.result.hasOwnProperty("url") )
- {
- go_url = info.result.url;
- }
-
- layer.msg('操作成功',{time: 1000,
- end:function(){
- location.href = info.result.url;
- }
- });
- }
- }
- })
- });
-
- form.on('switch(restwsitch)', function(data){
-
- var s_url = $(this).attr('data-href')
-
- var rest = 1;
- if(data.elem.checked)
- {
- rest = 1;
- }else{
- rest = 0;
- }
-
- $.ajax({
- url:s_url,
- type:'post',
- dataType:'json',
- data:{rest:rest},
- success:function(info){
-
- if(info.status == 0)
- {
- layer.msg(info.result.message,{icon: 1,time: 2000});
- }else if(info.status == 1){
- var go_url = location.href;
- if( info.result.hasOwnProperty("url") )
- {
- go_url = info.result.url;
- }
-
- layer.msg('操作成功',{time: 1000,
- end:function(){
- location.href = info.result.url;
- }
- });
- }
- }
- })
- });
- form.on('switch(enablewsitch)', function(data){
-
- var s_url = $(this).attr('data-href')
-
- var enable = 1;
- if(data.elem.checked)
- {
- enable = 1;
- }else{
- enable = 0;
- }
-
- $.ajax({
- url:s_url,
- type:'post',
- dataType:'json',
- data:{enable:enable},
- success:function(info){
-
- if(info.status == 0)
- {
- layer.msg(info.result.message,{icon: 1,time: 2000});
- }else if(info.status == 1){
- var go_url = location.href;
- if( info.result.hasOwnProperty("url") )
- {
- go_url = info.result.url;
- }
-
- layer.msg('操作成功',{time: 1000,
- end:function(){
- location.href = info.result.url;
- }
- });
- }
- }
- })
- });
-
- form.on('switch(statewsitch)', function(data){
-
- var s_url = $(this).attr('data-href')
-
- var state = 1;
- if(data.elem.checked)
- {
- state = 1;
- }else{
- state = 0;
- }
-
- $.ajax({
- url:s_url,
- type:'post',
- dataType:'json',
- data:{state:state},
- success:function(info){
-
- if(info.status == 0)
- {
- layer.msg(info.result.message,{icon: 1,time: 2000});
- }else if(info.status == 1){
- var go_url = location.href;
- if( info.result.hasOwnProperty("url") )
- {
- go_url = info.result.url;
- }
-
- layer.msg('操作成功',{time: 1000,
- end:function(){
- location.href = info.result.url;
- }
- });
- }
- }
- })
- });
- form.on('checkbox(checkboxall)', function(data){
-
- if(data.elem.checked)
- {
- $("input[name=item_checkbox]").each(function() {
- $(this).prop("checked", true);
- });
- $("input[name=checkall]").each(function() {
- $(this).prop("checked", true);
- });
-
- }else{
- $("input[name=item_checkbox]").each(function() {
- $(this).prop("checked", false);
- });
- $("input[name=checkall]").each(function() {
- $(this).prop("checked", false);
- });
- }
-
- form.render('checkbox');
- });
-
- //监听提交
- form.on('submit(formDemo)', function(data){
-
- $.ajax({
- url: data.form.action,
- type: data.form.method,
- data: data.field,
- dataType:'json',
- success: function (info) {
-
- if(info.status == 0)
- {
- layer.msg(info.result.message,{icon: 1,time: 2000});
- }else if(info.status == 1){
- var go_url = location.href;
- if( info.result.hasOwnProperty("url") )
- {
- go_url = info.result.url;
- }
-
- layer.msg('操作成功',{time: 1000,
- end:function(){
- location.href = info.result.url;
- }
- });
- }
- }
- });
-
- return false;
- });
- })
- </script>
- <script type="text/javascript" src="/static/js/dist/area/cascade.js"></script>
- <script>
- var heads_page = 1;
- $("body").delegate("#batchheads_page .pagination a","click",function(){
- heads_page = $(this).attr('page');
- search_heads_do();
- })
- function search_heads()
- {
- heads_page = 1;
- search_heads_do();
- }
- function search_heads_do()
- {
- var province_name = $('#sel-provance').val();
- var city_name = $('#sel-city').val();
- var area_name = $('#sel-area').val();
- var country_name = $('#sel-street').val();
- var keyword = $('#supply_id_input').val();
-
- $.post("{:U('communityhead/query_head')}",{page:heads_page,'province_name':province_name,'city_name': city_name,'area_name':area_name,'country_name':country_name,'keyword':keyword},
- function (ret) {
- if (ret.status == 1) {
- $('#batchheads_content').html(ret.html);
- $('#batchheads_page').html(ret.page_html);
- return
- } else {
- layer.msg('修改失败');
- }
- }, 'json');
- }
- //显示批量分类
- $('#batchcatesbut').click(function () {
- // var index = layer.load(1);
- var index = layer.open({
- type: 1,
- area: '500px',
- title: '选取分类'
- ,content: $('#batchcates_html').html(),
- yes: function(index, layero){
- //do something
- layer.close(index); //如果设定了yes回调,需进行手工关闭
- }
- });
- })
-
- $('#batch_head_group').click(function () {
- // var index = layer.load(1);
- var index = layer.open({
- type: 1,
- area: '500px',
- title: '选取团长分组'
- ,content: $('#batchcates_headgroup_html').html(),
- yes: function(index, layero){
- //do something
- layer.close(index); //如果设定了yes回调,需进行手工关闭
- }
- });
- })
-
- $('#batch_head_group2').click(function () {
- // var index = layer.load(1);
- var index = layer.open({
- type: 1,
- area: '500px',
- title: '选取团长分组'
- ,content: $('#batchcates_headgroup_html').html(),
- yes: function(index, layero){
- //do something
- layer.close(index); //如果设定了yes回调,需进行手工关闭
- }
- });
- })
-
-
- $('.check_heads_all').click(function(){
- //head_id
- if($(this).is(':checked')){
- $('.head_id').prop('checked',true);
- }else{
- $('.head_id').prop('checked',false);
- }
- })
- $('#batch_head,#batch_head2').click(function(){
-
- cascdeInit("1","1","","","","");
- search_heads_do();
-
-
- var offs_lf = ( $(window).width() -720 )/2;
- var offs_ht = ( $(window).height() -690 )/2;
-
-
- $('#batchheads .modal-dialog').css('top',offs_ht+'px');
- $('#batchheads .modal-dialog').css('margin-top','0px');
-
- $('#batchheads .modal-dialog').css('left',offs_lf+'px');
- $('#batchheads .modal-dialog').css('margin-left','0px');
-
- $('#batchheads').show();
- })
-
-
-
- $('#batchcatesbut2').click(function () {
- var index = layer.open({
- type: 1,
- area: '500px',
- title: '选取分类'
- ,content: $('#batchcates_html').html(),
- yes: function(index, layero){
- //do something
- layer.close(index); //如果设定了yes回调,需进行手工关闭
- }
- });
- })
- //关闭批量分类
- $('.modal-header .close').click(function () {
- $('#batchcates').hide();
- $('#batchheads').hide();
- $('#batch_time').hide();
- })
- // 取消批量分类
- $('.modal-footer .btn.btn-default').click(function () {
- $('#batchcates').hide();
- $('#batchheads').hide();
- $('#batch_time').hide();
- })
- $('.model_heads').click(function(){
- var head_id_arr = [];
- $('.head_id').each(function(){
- if($(this).is(':checked')) {
- head_id_arr.push( $(this).val() )
- }
- })
- if(head_id_arr.length > 0)
- {
- var selected_checkboxs = $('.table-responsive tbody tr td:first-child [type="checkbox"]:checked');
- var goodsids = selected_checkboxs.map(function () {
- return $(this).val()
- }).get();
-
- $.post("{:U('goods/ajax_batchheads')}",{'goodsids':goodsids,'head_id_arr': head_id_arr}, function (ret) {
- if (ret.status == 1) {
- $('#batchheads').hide();
- layer.msg('分配成功');
- // window.location.reload();
- return
- } else {
- layer.msg('修改失败');
- }
- }, 'json');
- }else{
- layer.msg('请选择团长');
- }
- })
- //确认
- var cates2 = 0;
- $("body").delegate("#cates2","click",function(){
-
- cates2 = $(this).val() ;
- })
-
- var group_heads2 = 'default';
- $("body").delegate("#group_heads","click",function(){
- group_heads2 = $(this).val() ;
- })
-
- $("body").delegate(".cancle","click",function(){
- layer.closeAll();
- })
-
-
-
- $("body").delegate(".modal-group-head","click",function(){
-
- var group_heads=$('#group_heads').val();
- if(group_heads2 != 'default')
- {
- group_heads = group_heads2;
- }
-
- var selected_checkboxs = $('.table-responsive tbody tr td:first-child [type="checkbox"]:checked');
- var goodsids = selected_checkboxs.map(function () {
- return $(this).val()
- }).get();
-
- if(goodsids.length <=0 )
- {
- layer.msg('请先选择商品');
- return false;
- }
-
- var iscover=$('input[name="iscover"]:checked').val();
- $.post("{:U('goods/ajax_batchcates_headgroup')}",{'goodsids':goodsids,'groupid': group_heads}, function (ret) {
- if (ret.status == 1) {
-
- layer.msg('分配成功', {
- time: 1000
- }, function(){
- window.location.reload();
- });
-
- return
- } else {
- layer.msg('分配失败');
- }
- }, 'json');
- })
-
- $("body").delegate(".modal-fenlei","click",function(){
-
- var cates=$('#cates2').val();
- if(cates2 != 0)
- {
- cates = cates2;
- }
-
-
- var selected_checkboxs = $('.table-responsive tbody tr td:first-child [type="checkbox"]:checked');
- var goodsids = selected_checkboxs.map(function () {
- return $(this).val()
- }).get();
- //id="cates"
- var iscover=$('input[name="iscover"]:checked').val();
- $.post("{:U('goods/ajax_batchcates')}",{'goodsids':goodsids,'cates': cates,'iscover':iscover}, function (ret) {
- if (ret.status == 1) {
- $('#batchcates').hide();
-
- layer.msg('修改成功', {
- time: 1000
- }, function(){
- window.location.reload();
- });
-
- return
- } else {
- layer.msg('修改失败');
- }
- }, 'json');
- })
- //----
- //显示时间设置
- $('#batchtime,#batchtime2').click(function () {
-
- var offs_lf = ( $(window).width() -720 )/2;
- var offs_ht = ( $(window).height() -290 )/2;
-
- $('#batch_time .modal-dialog').css('top',offs_ht+'px');
- $('#batch_time .modal-dialog').css('margin-top','0px');
-
- $('#batch_time .modal-dialog').css('left',offs_lf+'px');
- $('#batch_time .modal-dialog').css('margin-left','0px');
-
- $('#batch_time').show();
- })
- $('.modal-time').click(function () {
- var selected_checkboxs = $('.table-responsive tbody tr td:first-child [type="checkbox"]:checked');
- var goodsids = selected_checkboxs.map(function () {
- return $(this).val()
- }).get();
- var begin_time=$('#batch_time input[name="setsametime[start]"]').val();
- var end_time=$('#batch_time input[name="setsametime[end]"]').val();
- $.post("{:U('goods/ajax_batchtime')}",{'goodsids':goodsids,'begin_time': begin_time,'end_time':end_time}, function (ret) {
- if (ret.status == 1) {
- $('#batch_time').hide();
- layer.msg('设置成功');
- window.location.reload();
- return
- } else {
- layer.msg('设置失败');
- }
- }, 'json');
- })
-
- $(document).on("click", '[data-toggle="ajaxEdit"]', function(e) {
- var obj = $(this),
- url = obj.data('href') || obj.attr('href'),
- data = obj.data('set') || {},
- html = $.trim(obj.text()),
- required = obj.data('required') || true,
- edit = obj.data('edit') || 'input';
- var oldval = $.trim($(this).text());
- e.preventDefault();
- submit = function() {
- e.preventDefault();
- var val = $.trim(input.val());
- if (required) {
- if (val == '') {
- layer.msg(tip.lang.empty);
- return
- }
- }
- if (val == html) {
- input.remove(), obj.html(val).show();
- return
- }
- if (url) {
- $.post(url, {
- value: val
- }, function(ret) {
- ret = eval("(" + ret + ")");
- if (ret.status == 1) {
- obj.html(val).show()
- input.remove();
- location.reload();
- }else if(ret.status == 3 ){
- layer.msg('输入错误,请输入正确的数字', {icon: 2,time: 2000 }, function(){
- location.reload();
- });
-
- } else {
- layer.msg(ret.result.message, ret.result.url)
- input.remove();
- location.reload();
- }
- }).fail(function() {
- input.remove(), layer.msg(tip.lang.exception)
- })
- } else {
- input.remove();
- obj.html(val).show()
- }
- obj.trigger('valueChange', [val, oldval])
- }, obj.hide().html('<i class="fa fa-spinner fa-spin"></i>');
- var input = $('<input type="text" class="form-control input-sm" style="width: 80%;display: inline;" />');
- if (edit == 'textarea') {
- input = $('<textarea type="text" class="form-control" style="resize:none" rows=3 ></textarea>')
- }
- obj.after(input);
- input.val(html).select().blur(function() {
- submit(input)
- }).keypress(function(e) {
- if (e.which == 13) {
- submit(input)
- }
- })
- })
- </script>
- </body>
|