| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 | {Template header}<body><div class="warp"><div class="fixed"><ul class="search"><li>类目:<select name="category" class="select"><option value="">请选择</option>{loop typeclass(16) as $val}<option value="{$val['id']}">{$val['title']}</option>{/loop}</select></li><!--<li>重量:<select name="weight" class="select"><option value="">请选择</option>{loop $weight as $val}<option value="{$val['id']}">{$val['title']}</option>{/loop}</select></li>--><input type="hidden" name="arg_array" value="{$arg_array}" /><li>名称:<input value="" name="title" type="text" style="width:280px;"></li><li>SKU:<input value="" name="sku" type="text" style="width:280px;"></li><li><span>确 定</span></li></ul><div class="control"><select name="lm" class="dcmb"><option value="">请选择</option>{loop typeclass(16) as $val}<option value="{$val['id']}">{$val['title']}</option>{/loop}</select><a href="/weight/mb?excel=1">模板下载</a><a href="javascript:void(0);" class="drweightexcel">导入数据</a><a href="javascript:void(0);" class="check">删 除</a><a href="javascript:void(0);" class="weightdcsj">导出数据</a></div><table class="datatitle data" border="0" style="border-collapse:collapse;"><tr><td><label onClick="swapCheck()"><input name="checkbox" type="checkbox" class="regular-checkbox"></label></td><td>产品名称</td><td>标签SKU</td><td>重量</td></tr></table></div><table class="datatext data" border="0" style="border-collapse:collapse;"></table><div class="bomf"></div></div><div style="display:none;"><input id="upload-file" name="files" accept="image/xls,image/xlsx" type="file"></div><script>var dataurl = "/weight";var editurl = "/weight/edit/";var editdj = 1;var editt = "产品配置 - 修改";var customon = 1;function custom(){$(".data tr").each(function() {$(this).find('td:eq(0)').css("width","1%");});}$(".weightdcsj").click(function() {var f = "";	$(".select").each(function() {        f = f + $(this).attr("name") + "=" + $(this).children("option:selected").val() + "&";    });    $("input:text").each(function() {        f = f + $(this).attr("name") + "=" + $(this).val() + "&";    });	window.location.href = "/weight/excel?excel=1&"+f;});$(".drweightexcel").click(function() {	var xz = $("select[name='lm']").children("option:selected").val();	if(xz == '')	{		layx.alert('错误',"没有选择需要导入的类型!",function(id,button){},{dialogIcon:'error'});return false;	}var features = $(".control select[name='lm']").children("option:selected").val();var title = $(".control select[name='lm']").children("option:selected").html();var dr = $(this);$("#upload-file").click();$("#upload-file").unbind("change");$("#upload-file").bind("change",function(){weight(dr,title,features);	layx.load('loadId','导入中,请稍后',{shadable:0.6});});});function weight(dr,title,features){var file = document.getElementById("upload-file").files[0];var data = new FormData();data.append("userfile",file);$.ajax({data : data,type : "POST",url : dataurl+"/drexcel/"+features+'/'+title,cache : false,contentType : false,processData : false,dataType:"json",success: function(a) {	 layx.destroy('loadId');            if (a && a.success) {				 if(a.error == 1)				 {					 errora(a);				 }				 else				 {					  errorb(a);				 }            } else {				errorc(a);            }        }});}</script>{Template footer}
 |