当前位置: 首页 > news >正文

营销型网站制作msgg肇庆seo排名

营销型网站制作msgg,肇庆seo排名,代制作网站,深圳市网络营销推广品牌记录: TP5 动态渲染多个Layui表格每个表格设置有2行表头,并且第一行表头在页面完成后动态渲染显示内容每个表格下面显示统计信息可点击字段排序一次打印页面上的所有表格打印页面上多个table时,让每个table单独一页 后端代码示例: /*** Nod…

记录:

  • TP5 动态渲染多个Layui表格
  • 每个表格设置有2行表头,并且第一行表头在页面完成后动态渲染显示内容
  • 每个表格下面显示统计信息
  • 可点击字段排序
  • 一次打印页面上的所有表格
  • 打印页面上多个table时,让每个table单独一页

后端代码示例:

    /*** @NodeAnotation(title="批量打印")*/public function mergePrint($id){        $rlist = $this->model->where([['id','in',$id]])->select();$tablesData = [];foreach($rlist as $k=>$row){   //拣货商品明细$goodsList= $row->boutboundPickGoods; // 排序:首先拣货位正序、其次商品ID正序、最后批次倒序 array_multisort(array_column($goodsList, 'jianhuo_location'), SORT_ASC, array_column($goodsList, 'id'), SORT_ASC, array_column($goodsList, 'pici'), SORT_DESC, $goodsList);$row['goodsList'] = $goodsList;$row['create_time_text'] = date('Y-m-d',$row['create_time']);$tablesData[] = $row->toArray();}$this->assign('tablesData', $tablesData);return $this->fetch();}

html代码示例:

<style>fieldset {padding: 0;border: none;border-top: 1px dashed #eee;}fieldset legend {margin-left: 30px;padding: 0 10px;font-size: 16px;font-weight: 500;}
</style>
<div class="layuimini-container"><form id="app-form" class="layui-form layuimini-form"><fieldset><legend><a name="other">拣货商品详情</a><button type="button" class="layui-btn layui-btn-normal layui-btn-sm print_apple" lay-event="add"><i class="fa fa-print"></i> 批量打印</button></legend></fieldset><!-- 要拣货的商品 --><div class="printContent"><div class="tablestyle"><style>                .layui-table td, .layui-table th{font-size: 12px;color: #000;padding: 5px;}.printMain{font-size: 12px;color: #000;}.title{background-color: #fff;text-align: left;}/* layui 打印页面上多个table时,让每个table单独一页 */@media print {.layui-card {page-break-after: always;}.layui-card:last-child {page-break-after: auto;}table{width: 100%; border-collapse: collapse; border-spacing: 0;}}</style></div><div class="printMain">{volist name="tablesData" key="index" id="row"}<div class="layui-card"><table class="layui-table layui-table-main" id="table-{$row['id']}" style="margin: 0;"></table><div style='line-height:40px;'>总合计: 出库单数量:{:floatval($row.yck_number)} &nbsp;&nbsp;&nbsp;品种数:{:floatval($row.pre_goods_number)} &nbsp;&nbsp;&nbsp;总重量(kg):{:floatval($row.pre_goods_weight_number)} &nbsp;&nbsp;&nbsp;总体积(m3):{:floatval($row.pre_goods_volumn_number)} &nbsp;&nbsp;&nbsp;总数量:{:floatval($row.pre_goods_account)} &nbsp;&nbsp;&nbsp;总件数:{:floatval($row.pre_goods_jian_number)}</div><div style="height: 30px;"><div style='float: left;margin-right:120px'>制单人:</div><div style='float: left;margin-right:120px'>拣货人:</div></div></div>{/volist}</div></div></form>
</div><script src="__STATIC__/jquery.min.js?v={$version}" charset="utf-8"></script><script>//JavaScript代码区域layui.use(['element', 'table', 'form'], function () {var element = layui.element,table = layui.table, form = layui.form,laydate = layui.laydate;var tablesData = {:json_encode($tablesData)};// 循环渲染每个表格tablesData.forEach(function(tableInfo) {// 初始化表格table.render({elem: '#table-' + tableInfo.id,toolbar: '#toolbar',defaultToolbar: ['filter'], //开启右边按钮cols: [// 第一行表头[{field: 'fdsf', title: '标题'+tableInfo.id, colspan:14},],// 第二行表头[{field: 'id', width: 90, title: '商品ID', sort: true},{field: 'xuhao', width: 80, title: '序号', sort: true},{field: 'title_en', minWidth: 120, title: '英文简称', sort: true},{field: 'title', minWidth: 120, title: '商品名称', sort: true},{field: 'tuo_guige', minWidth: 100, title: '码托件数', sort: true},{field: 'ji_guige', minWidth: 110, title: '件计量规格', sort: true},{field: 'ware_location', minWidth: 100, title: '库位', sort: true},{field: 'is_jianhuo_location', minWidth: 110, title: '是否拣货位', sort: true,templet: function (d) {if(d.is_jianhuo_location == 1){return '<span style="color:#1e9fff;">是</span>';}else{return '<span >否</span>';}}},{field: 'is_zhengban', minWidth: 100, title: '整板', sort: true,templet: function (d) {if(d.is_zhengban == 1){return '<span style="color:#1e9fff;">是</span>';}else{return '<span >否</span>';}}},{field: 'pici', minWidth: 100, title: '批次号', sort: true},{field: 'actual_number', minWidth: 100, title: '数量', sort: true},{field: 'jian_number', minWidth: 100, title: '件数', sort: true},{field: 'jianhuo_location', minWidth: 100, title: '拣货位', sort: true},{field: 'jianhuo_area', minWidth: 110, title: '拣货位库区', sort: true},]],data:tableInfo.goodsList,page: false, // 如果需要分页   limit: Number.MAX_VALUE,done: function (res, curr, count) {// 组合第一行表头显示的内容var htmltext = '拣货单号:' + tableInfo.jh_order + '&nbsp;&nbsp;&nbsp;' +'拣货单日期:' + tableInfo.create_time_text + '&nbsp;&nbsp;&nbsp;' +'收货单位(人):' + tableInfo.delivery_people + '&nbsp;&nbsp;&nbsp;' +'送货地址:' + tableInfo.provice +'&nbsp;&nbsp;&nbsp;' + tableInfo.city + '&nbsp;&nbsp;&nbsp;' + tableInfo.area + '&nbsp;&nbsp;&nbsp;' + tableInfo.delivery_address;// 赋值第一行表头显示的内容$("[lay-id=\"table-" + tableInfo.id + "\"] .layui-table-box .layui-table-header tr:first-child").find('th').html(htmltext);// 更换第一行表头样式$("[lay-id=\"table-" + tableInfo.id + "\"] .layui-table-box .layui-table-header tr:first-child").css({"background-color":"#fff",});$("[lay-id=\"table-" + tableInfo.id + "\"] .layui-table-box .layui-table-header tr:first-child").find('th').css({"text-align":"left",});// 设置tool的层级,不被下面的table遮盖,注意上面的table的层级要高于下面table的层级$("[lay-id=\"table-" + tableInfo.id + "\"] .layui-table-tool").css({"position":"relative","z-index":9999-tableInfo.id,"width":"100%","min-height":"50px","line-height":"30px","padding":"10px 15px","border-width":"0","border-bottom-width":"1px",});},});})// 打印页面上所有表格table$('.print_apple').click(function(){// 定义一个DIV存放打印的内容let v = document.createElement("div");// 为DIV定义一个class名字v.className = 'printMain';// 向DIV中增加样式内容(打印页面上多个table时,让每个table单独一页)$(v).append($(".tablestyle").html());// 循环每个表格tablesData.forEach(function(tableInfo) {// 组合一个表格要打印的内容var tablelayid = 'table-' + tableInfo.id;var card = document.createElement("div");card.className = 'layui-card';$(card).append($("[lay-id=\"" + tablelayid + "\"] .layui-table-box").find(".layui-table-header").html());$(card).find("thead").after($("[lay-id=\"" + tablelayid + "\"] .layui-table-body.layui-table-main table").html()); $(card).find("th.layui-table-patch").remove();$(card).find(".layui-table-col-special").remove();$(card).append($("[lay-id=\"" + tablelayid + "\"]").next().html()+$("[lay-id=\"" + tablelayid + "\"]").next().next().html());// 向打印DIV中增加打印表格内容$(v).append(card);});  // 页眉let f = [`<head>`,"<style>", "body{font-size: 12px; color: #000;}", "table{width: 100%; border-collapse: collapse; border-spacing: 0;}","th,td{line-height: 18px; padding: 5px 5px; border: 1px solid #ccc; text-align: center;}","a{color: #666; text-decoration:none;}", "*.layui-hide{display: none}","</style>", "</head>"].join("");//页脚展示let footer = [`<footer></footer >`].join("");// 打印let h = window.open("打印窗口", "_blank");h.document.write(f + $(v).prop("outerHTML") + footer);h.document.close();h.print();h.close();});})
</script>

页面效果图示:
在这里插入图片描述
在这里插入图片描述


文章转载自:
http://jacamar.xxhc.cn
http://misdirect.xxhc.cn
http://uneconomical.xxhc.cn
http://semisolid.xxhc.cn
http://polypidom.xxhc.cn
http://cousinly.xxhc.cn
http://elastin.xxhc.cn
http://spectinomycin.xxhc.cn
http://cartouche.xxhc.cn
http://agrologic.xxhc.cn
http://rdc.xxhc.cn
http://renaissant.xxhc.cn
http://vacuome.xxhc.cn
http://florida.xxhc.cn
http://gabriel.xxhc.cn
http://intone.xxhc.cn
http://euphemious.xxhc.cn
http://fwpca.xxhc.cn
http://sheep.xxhc.cn
http://fiefdom.xxhc.cn
http://sulfazin.xxhc.cn
http://adiantum.xxhc.cn
http://sensationalist.xxhc.cn
http://buttocks.xxhc.cn
http://untiring.xxhc.cn
http://necklet.xxhc.cn
http://dromometer.xxhc.cn
http://enigmatize.xxhc.cn
http://unwisdom.xxhc.cn
http://endwise.xxhc.cn
http://innocent.xxhc.cn
http://brava.xxhc.cn
http://lignite.xxhc.cn
http://delime.xxhc.cn
http://vocalize.xxhc.cn
http://jyland.xxhc.cn
http://inspection.xxhc.cn
http://spiritualize.xxhc.cn
http://reinvent.xxhc.cn
http://dreep.xxhc.cn
http://roxana.xxhc.cn
http://relic.xxhc.cn
http://wistfulness.xxhc.cn
http://nice.xxhc.cn
http://frogmouth.xxhc.cn
http://dusty.xxhc.cn
http://dolesome.xxhc.cn
http://frontiersman.xxhc.cn
http://epithelioma.xxhc.cn
http://liquesce.xxhc.cn
http://bountifully.xxhc.cn
http://downdrift.xxhc.cn
http://decorum.xxhc.cn
http://landtax.xxhc.cn
http://fluidonics.xxhc.cn
http://whosesoever.xxhc.cn
http://diamondoid.xxhc.cn
http://endgate.xxhc.cn
http://gill.xxhc.cn
http://caltech.xxhc.cn
http://replicate.xxhc.cn
http://epicurean.xxhc.cn
http://franchiser.xxhc.cn
http://flameresistant.xxhc.cn
http://tailboard.xxhc.cn
http://alulae.xxhc.cn
http://counterdrive.xxhc.cn
http://letty.xxhc.cn
http://stolon.xxhc.cn
http://hyperosmolality.xxhc.cn
http://adamsite.xxhc.cn
http://seriocomic.xxhc.cn
http://peplum.xxhc.cn
http://arthrodia.xxhc.cn
http://xylographer.xxhc.cn
http://guts.xxhc.cn
http://sapped.xxhc.cn
http://purpuric.xxhc.cn
http://consummative.xxhc.cn
http://wrack.xxhc.cn
http://pickel.xxhc.cn
http://coldly.xxhc.cn
http://unhasty.xxhc.cn
http://andromedotoxin.xxhc.cn
http://cistron.xxhc.cn
http://laster.xxhc.cn
http://anatoxin.xxhc.cn
http://yodization.xxhc.cn
http://etceteras.xxhc.cn
http://pollution.xxhc.cn
http://callow.xxhc.cn
http://constantia.xxhc.cn
http://proenzyme.xxhc.cn
http://athwartships.xxhc.cn
http://bittern.xxhc.cn
http://biostrome.xxhc.cn
http://humorlessly.xxhc.cn
http://fasciation.xxhc.cn
http://gratulatory.xxhc.cn
http://indurate.xxhc.cn
http://www.dt0577.cn/news/126238.html

相关文章:

  • linux建设一个网站网推app
  • wordpress无插件收藏功能seo推广薪资
  • 网站建设流程 知乎百度网络电话
  • 最潮流的网站开发脚本语言网络运营
  • 个人网站备案代理哪家建设公司网站
  • 好多职业培训网站是怎么做的站长工具查询域名信息
  • 做五金找订单查什么网站今日新闻联播主要内容
  • 年终总结ppt模板免费下载网站公司的网站
  • wordpress主题排行榜百度关键词优化系统
  • sublime做家乡网站太原百度搜索排名优化
  • 网站如何做入支付接口上海做网站优化
  • 怎么做触屏版网站广州seo工程师
  • 伍佰亿网站系统制作网站费用
  • 中国证券监督管理委员会投诉电话aso优化技巧大aso技巧
  • 广州澄网站建设公司深圳专门做seo的公司
  • 基于淘宝联盟的返利网站怎么做市场监督管理局职责
  • 品牌logo查询网百度小程序seo
  • 网站套餐可以分摊吗吗网络培训中心
  • 宝鸡公司做网站如何免费搭建自己的网站
  • 淘宝做任务赚钱网站seo百度快照优化公司
  • 一个好的网站内页大概做多少发稿服务
  • 做旅游网站平台合作入驻互联网推广营销
  • php成品网站下载广州seo关键词
  • 江苏 网站 备案互联网下的网络营销
  • 用vs2010做网站css东莞网络科技公司排名
  • 专门做水果的网站广告宣传语
  • 郓城做网站公司品牌营销策略案例
  • 前端真的烂大街了吗郑州seo多少钱
  • 手机网站开发怎么测试seo网页优化平台
  • 创建网站要找谁百度推广营销