后台 运费模板

在这里插入图片描述

<div class="wrapper">
	<div class="inner-menu">
		<dl>
			<dt>商城设置</dt>
			<dd><a href="<?php echo site_url('manage/setting');?>"><i class="fa fa-list"></i>系统设置</a></dd>
			<dd class="active"><a href="<?php echo site_url('manage/template');?>"><i class="fa fa-vcard"></i>运费模板</a></dd>
			 <dd><a href="<?php echo site_url('manage/designHomePage');?>"><i class="fa fa-cog"></i>首页编辑</a></dd>
           
		</dl>
	</div>
	<div class="main clearfix">
		<div class="inner-header">
			<a class="btn btn-primary btn-sm click_a" href="javascript:;" data-toggle="modal" data-target="#myModal"><i class="fa fa-plus"></i> 新建运费模板</a>
		</div>
		<table class="table table-hover goods-list" id="table-lie">
			<thead>
				<tr>
					<th>模板名称</th>
					<th>创建时间</th>
					<th>模板管理</th>
				</tr>
			</thead>
			<tbody>
                    <?php foreach($express as $row){?>
                <tr>
                    <td><?php echo $row->name;?></td>
                    <td><?php echo $row->addtime;?></td>
                    <td><a href="javascript:;" class="delete_b"  ref="<?php echo $row->id;?>">删除</a></td>
                </tr>
                    <?php }?>
			</tbody>
		</table>
</div>

$(’.click_a’).click(function(){
var inx=0;
( . m o d a l c o n t e n t ) . f i n d ( i n p u t ) . v a l ( ) ; i f ( (&#x27;.modal-content&#x27;).find(&#x27;input&#x27;).val(&#x27;&#x27;); if( (’.modal-content .new’).eq(inx)){
$(’.new’).eq(inx).siblings(’.new’).remove();
$(’.new’).eq(inx).find(’.num’).text(‘选择地区’);
$(“input[type=‘checkbox’]”).prop(“checked”, false);
$(“input[name=‘ck01’]”).prop(“disabled”, false);
}
})
/全选/
KaTeX parse error: Expected '}', got 'EOF' at end of input: …tion(){ if((".chooseall").prop(“checked”) == true){
$(“input[name=‘ck01’]”).prop(“checked”, true);

}else{
    $("input[name='ck01']").prop("checked", false);  
}

});

$(’#tb’).on(‘click’,’.delete_a’,function() {
$(this).addClass(‘date’).parent().siblings().removeClass(‘date’);
$("#delCategoryList").modal(‘show’);

});

$(’#table-lie’).on(‘click’,’.delete_b’,function() {
$(this).addClass(‘delet’).parent().siblings().removeClass(‘delet’);
$("#delCategoryList1").modal(‘show’);

});

KaTeX parse error: Expected 'EOF', got '#' at position 3: ('#̲delCategoryList…(’.delet’).attr(“ref”);

    $.ajax({
        "type":"post",
        "url":"<?php echo site_url('manage/ajaxDeleteExpressTemplate');?>",
        "data":{"id":id},
        success:function(res){
            var data=JSON.parse(res);
            if(data.code==1){
                layer.msg('操作成功!',{icon:1,time:1000},function(){
                        window.location.reload();
                });
            }else{
                layer.msg('操作失败!',{icon:5,time:1000},function(){
                        window.location.reload();
                });
                
            }
        }
    });
    
$("#delCategoryList1").modal('hide');

});

KaTeX parse error: Expected 'EOF', got '#' at position 3: ('#̲delCategoryList…(’.date’).parent().siblings(’.td’).find(’.num’).text();
var result=Datetxt.split(" ");
for(var j=0;j<result.length;j++){
// console.log(result[j]);
var check= $(“input[type=‘checkbox’]”);
for(var k=0;k<check.length;k++){
if(check[k].value==result[j]){
$(‘input[value=’+result[j]+’]’).attr(“checked”,false);
( i n p u t [ v a l u e = + r e s u l t [ j ] + ] ) . a t t r ( &quot; d i s a b l e d &quot; , f a l s e ) ; i f ( (&#x27;input[value=&#x27;+result[j]+&#x27;]&#x27;).attr(&quot;disabled&quot;,false); if( (’.chooseall’).attr(“checked”,true)){
//$(“input[name=‘ck01’]”).attr(“disabled”,false);
$(’.chooseall’).attr(“checked”,false);
}
}
}

}
$('.date').parent().parent().remove();
$("#delCategoryList").modal('hide');

});

/*新增地区*/

function New(){
$("#tb").append(‘选择地区删除’);
}

function quxiao(){
if ( $(’.diqu’).css(“display”) === “block” ) {
$(’.diqu’).hide();
var checkArryy = $(‘input[type=“checkbox”]’);
for (var i = 0; i < checkArryy.length; i++) {
if(checkArryy[i].checked==true){
checkArryy[i].disabled=true;
}
}
}
}

KaTeX parse error: Expected '}', got 'EOF' at end of input: …nction(){ if((this).attr(“checked”)==true){
$(this).addClass(‘xuanzhong’);
}else{
$(this).removeClass(‘xuanzhong’);
}
});

KaTeX parse error: Expected 'EOF', got '#' at position 3: ('#̲tb').on('click'…(".chooseall").prop(“checked”) == true){
$(“input[name=‘ck01’]”).disabled=false;
$(“input[name=‘ck01’]”).checked=false;
}

var arrCity=$(this).text();
var newArrCity = arrCity.split(' ');
for (var i=0;i<newArrCity.length;i++) {
	var value = newArrCity[i];
	$('input[name="ck01"][value="'+value+'"]').prop('checked',true);
	$('input[name="ck01"][value="'+value+'"]').prop('disabled',false);
	}	
$(this).parent().parent().siblings().find('span').removeClass('active0');
$(this).addClass('active0');
	if ($('.diqu').css('display') === 'none') {
		$('.diqu').show();

	} else {
		$('.diqu').hide();
	
	}

});

$(’#diqu-qd’).click(function(){
function checkedTest(){
var count = 0;
var checkArry = $(‘input[name=“ck01”]’);
for (var i = 0; i < checkArry.length; i++) {
if(checkArry[i].checked == true){
var obj=document.getElementsByName(‘ck01’);
//选择所有name="‘ck01’“的对象,返回数组
//取到对象数组后,我们来循环检测它是不是被选中
var s=’’;
for(var i=0; i<obj.length; i++){
if(obj[i].disabled){
// obj[i].value==”";
obj[i].checked==false;
}else{
if(obj[i].checked&&obj[i].value!=“11”){
obj[i].disabled=“disabled”;
s+=obj[i].value+’ ';
}
//如果选中,将value添加到变量s中
}
}
// console.log(s);
//那么现在来检测s的值就知道选中的复选框的值了

		}
	} 
	if( count == 0&&s!="选择地区"&&s!==""){ 
		            $('.active0').text(s);
					
					$('.diqu').hide();                                                                        
				
			        count++;
		     }else{
			        $('.active0').text("选择地区");
		            $('.active0').removeClass('active0');
					$('.diqu').hide();
					
					
		     } 
}
checkedTest();	 

});

/保存/
function save(){
if( ( &quot; [ n a m e = N a m e ] &quot; ) . v a l ( ) = = &quot; &quot; (&quot;[name=&#x27;Name&#x27;]&quot;).val()==&quot;&quot;|| ("[name=‘Name’]").val()==$(’#table-lie .Name’).val()){
alert(‘模板名不能为空或已存在’);
return false;

}else{
var a= ( &quot; [ n a m e = n u m b e r 1 ] &quot; ) . v a l ( ) ; v a r b = (&quot;[name=&#x27;number1&#x27;]&quot;).val(); var b= ("[name=‘number2’]").val();
var c= ( &quot; [ n a m e = n u m b e r 3 ] &quot; ) . v a l ( ) ; v a r d = (&quot;[name=&#x27;number3&#x27;]&quot;).val(); var d= ("[name=‘number4’]").val();
var e= ( &quot; [ n a m e = N a m e ] &quot; ) . v a l ( ) ; v a r r e g i o n = (&quot;[name=&#x27;Name&#x27;]&quot;).val(); var region= (’.num’).text();
var val=$(’.Name’).val();
if(e!=’’&& e!==val){

	var person=[];
            $(".new").each(function(){
                person.push({
                    "name":e, //模板名称
                    "region":$(this).find('.num').text(),//地区名
                    "piece":$(this).find("[name='number1']").val(),// 首件
                    "fee":$(this).find("[name='number2']").val(),//首费
                    "Continuation":$(this).find("[name='number3']").val(),//续件
                    "renew":$(this).find("[name='number4']").val()//续费
                });
            });
            var JsonString=JSON.stringify(person);
            $.ajax({
                "type":"post",
                "url":"<?php echo site_url('manage/ajaxExpressTemplate');?>",
                "data":{"data":JsonString,"name":e},
                success:function(res){
                    var data=JSON.parse(res);
                    if(data.code==1){
                        layer.msg('操作成功!',{icon:1,time:1000},function(){
                                window.location.reload();
                        });
                    }else{
                        layer.msg('操作失败!',{icon:5,time:1000},function(){
                                window.location.reload();
                        });
                    }
                }
            });
}else{
	return false;
}

}

}

效果图
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/wxb8826206/article/details/84561080