| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta name="ctx" content="" />
- <link rel="stylesheet" type="text/css" href="/static/easyui/themes/default/easyui.css">
- <link rel="stylesheet" type="text/css" href="/static/easyui/themes/icon.css">
- <link rel="stylesheet" type="text/css" href="/static/styles/demo.css">
- <link rel="stylesheet" type="text/css" href="/static/uploadify/uploadify.css">
- <link rel="stylesheet" type="text/css" href="/Public/libs/css/export.css">
- <script type="text/javascript" src="/static/basejs/jquery-1.8.0.min.js"></script>
- <script type="text/javascript" src="/static/easyui/jquery.easyui.min.js"></script>
- <script type="text/javascript" src="/static/easyui/easyui-lang-zh_CN.js"></script>
- <script type="text/javascript" src="/static/uploadify/jquery.uploadify.js"></script>
- <script type="text/javascript" src="/static/basejs/th.js"></script>
- <script type="text/javascript" src="/static/easyui/src/jquery.window.js"></script>
- <script type="text/javascript" src="/static/easyui/formatter.js"></script>
- <script type="text/javascript" src="/static/easyui/easyui-extend.js"></script>
- <script type="text/javascript" src="/static/easyui/easyui-validatebox-extend.js"></script>
- <script type="text/javascript" src="/static/easyui/easyui-loading.js"></script>
- <script type="text/javascript" src="/static/basejs/jquery.qrcode.min.js"></script>
- <script type="text/javascript" src="/static/basejs/LodopFuncs.js"></script>
- <script type="text/javascript" src="/static/basejs/newqcode.js"></script>
- <script type="text/javascript" src="/static/basejs/template.js"></script>
- <style>
- .tg1 {border-collapse:collapse;border-spacing:0;font-weight:500;width:1186px}
- .tg1 td{font-family:Arial, sans-serif;font-size:18px;/*padding:10px 5px;*/border-style:solid;border-width:1px;overflow:hidden;word-break:break-all;border-color:black;}
- .tg1 th{font-family:Arial, sans-serif;font-size:20px;font-weight:500;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;}
- .tg1 .tg-s6z21{text-align:center;}
- .tg1 .code{font-size:11px;}
- .tg1 .tg-031e{text-align:center;}
- td{
- padding: 3px 0px;
- }
- .tg1 .tg-s6z2 img{ width:100px;}
- .tg1 .font_bold{ font-size: 16px;font-weight:500; }
- .head td{text-align: center;border: none;font-weight: 400;font-size: 28px}
- .head1 td{text-align: center;border: none;font-weight: 400;font-size: 24px}
- .info td{border:none}
- .tg2 {border-collapse:collapse;border-spacing:0;font-weight:500;width:1086px}
- .tg2 td{
- font-size: 16px;
- /*text-align: center;*/
- }
- .table{
- width: 1186px;
- position: relative;
- }
- #print span{
- font-size: 16px;
- }
- </style>
- <script src="/static/basejs/jQuery.print.js"></script>
- </head>
- <body class="easyui-layout">
- <div data-options="region:'north',title:'',split:true" style="height: 540px;border:none">
- <div id="fahuoListToolbar">
- <form id="searchBthForm" class="smShow">
- <table style="width:100%;white-space: nowrap;padding:10px;">
- <tr>
- <td align="left">
- 请输入订单号:
- </td>
- <td>
- <input name="order_number" class="" style="width:150px" type="text" value="" data-options="required:true"/>
- </td>
- <td align="left">
- 公司名称:
- </td>
- <td>
- <select name="supplier_name" style="height:30px;">
- <volist name="userlist" id="val">
- <option value="{$val.nickname}">{$val.nickname}</option>
- </volist>
- </select>
- </td>
- <td align="left">
- 发货单状态:
- </td>
- <td align="left">
- <select name="status" style="height:30px;width:150px">
- <option value="0">已发货</option>
- <option value="2">已收货</option>
- </select>
- </td>
- </tr>
- <tr>
- <td align="left">
- 发货开始时间:
- </td>
- <td>
- <input id ="startDate" name="startDate" class="easyui-datebox" style="width:150px" type="text" value="" data-options="editable:false"/>
- </td>
- <td align="left">
- 发货结束时间:
- </td>
- <td>
- <input id ="endDate" name="endDate" class="easyui-datebox" style="width:150px" type="text" value="" data-options="editable:false"/>
- </td>
- <td colspan="2" align="left">
- <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="searchBthFun()">查询</a>
- </td>
- <tr/>
- <tr>
- <td colspan="10" class="export-tips"></td>
- </tr>
- </table>
- </form>
- </div>
- <table id="fahuoList">
- </table>
- <div class="body"></div>
- </div>
- <div data-options="region:'center',title:'所属发货单信息',split:true" >
- <div id="exportGridToolbar">
- <form id="searchTgForm">
- <input name="exportId" id='exportId' type="hidden"/><!-- 标签类型 -->
- </form>
- </div>
- <table id=exportGrid></table>
- </div>
- <div class="table" style="display: none;margin:0px 30px;">
- <div id="print">
- <div style="width: 1100px;height: 100px;position: relative;">
- <div style="float: left">
- <div style="width: 1000px;font-weight: 400;font-size: 28px;text-align: center;line-height: 50px;" class="company"></div>
- <div style="width: 1000px;font-weight: 400;font-size: 24px;text-align: center;line-height: 50px;">送货单</div>
- </div>
- <div id="qrcode" style="display:inline-block;width: 105px;height: 105px;position: absolute;right: 100px;top: -5px;">
- <img src="" style="width: 105px;height: 105px;" id="myImage" alt=""/>
- </div>
- </div>
- <table class="tg1" style="margin-top: 3px;">
- <!--<tr>-->
- <!--<td style="border: none"></td>-->
- <!--</tr>-->
- <tr class="info">
- <td colspan="6">客户名称:河南中烟工业有限责任公司黄金叶生产制造中心</td>
- <td colspan="4">送货单号:<span style="font-size: 16px;" id="shdh"></span></td>
- <!--<td rowspan="2" style="border: none" width="8%"></td>-->
- </tr>
- <tr class="info">
- <td colspan="6">送货地址:河南省郑州市经开区第三大街9号</td>
- <td colspan="4">送货日期:<span style="font-size: 16px;" id="shrq_date"></span></td>
- </tr>
- </table>
- <!--<div style=" width:1258px">-->
- <!--<hr />-->
- <!--</div>-->
- <!--<span>送货单备注:<span id=><span id='note'></span></span>-->
- <!--<br> -->
- <br>
- <table class="tg1" style="table-layout:fixed;width: 1020px" id="table"></table>
- <table class="tg2" style="margin-top: 3px;">
- <tr class="footer">
- <td colspan="3">发货单位:<span class="company"></span></td>
- <td colspan="3">司机/司机电话:<span id="deliveryman"></span></td>
- <td colspan="3">车牌号:<span id="carid"></span></td>
- </tr>
- <tr class="footer">
- <td colspan="7">发货单位地址:<span id="address"></span></td>
- <td colspan="3">收货单位(签名、盖章)</td>
- </tr>
- </table>
- </div>
- </div>
- <script>
- var fahuoList,exportGrid;
- bt_is_load=true;//定义防重复弹出小标签全局变量
- $(document).ready(function () {
- //初始化日期输入框
- initDateBox();
- fahuoList = $('#fahuoList').datagrid({
- url: '/index.php?s=/Admin/Export/getFahuoData',
- method: 'post',
- toolbar: '#fahuoListToolbar',
- striped : true,
- showFooter:false,
- rownumbers: false, // 如果为true,则显示一个行号列。
- singleSelect: false, // 如果为true,则只允许选择一行。
- nowrap: false, // 如果为true,则在同一行中显示数据。设置为true可以提高加载性能。
- fit: true, // datagrid自适应宽高
- fitColumns: true, // 使列自动展开/收缩到合适的数据表格宽度。
- autoRowHeight: false, // 定义设置行的高度,根据该行的内容。设置为false可以提高负载性能。
- sortName: 'id', // 排序字段
- sortOrder: 'desc', // 排序方式
- pagination: true, // 显示分页工具条
- pageSize: 100,//初始化页面大小
- pageList: [10, 20, 30, 50, 100, 500,1000,2000,5000,10000],// 初始化页面大小选择列表
- queryParams: $('#searchBthForm').serializeObject(),
- columns: [[
- {field: 'ck', checkbox: true},
- {field: 'shdh', title: '送货单号', sortable: true, width: 200},
- {field: 'order_number', title: '订单号', sortable: true, width: 200},
- {field: 'deliveryman', title: '司机', width: 200},
- {field: 'plate_number', title: '车牌号', align: 'center', sortable: true, width: 100},
- {field: 'supplier_name', title: '供应商名称', align: 'center', sortable: true, width: 100},
- {field: 'create_time', title: '送货日期', align: 'center', sortable: true, width: 150,
- formatter: function(value,row,index){
- return UnixToDate(value,true,8);
- }
- },
- {field:'id',title:'ID',align:'center',sortable:false,width:100,hidden:true},
- {field: 'file_dir', title: '发货单打印', align: 'center', sortable: true, width: 200,
- formatter: function(value,row,index){
- if(row.status==0 && row.user_type == 1){
- return "<a href='javascript:;' onclick='dayin("+row.id+")'>点击打印</a>";
- }else{
- return "<a href='javascript:;'>未开通权限</a>";
- }
- }
- },
- {field:'status',title:'状态',align:'center',sortable:false,width:100,
- formatter: function(value,row,index){
- if(value==0){
- return '已发货';
- }else if (value==2){
- return '已收货';
- }else {
- return '已删除';
- }
- }
- },
- {field:'option',title:'操作',align:'center',sortable:false,width:100,
- formatter: function(value,row,index){
- if(row.status==0){
- return '<a class="red" data-id='+row.id+' onclick="deal('+row.id+')">删除</a>';
- }else{
- //return '<a class="green" data-id='+value+' onclick="fa('+value+')">发货</a>';
- }
- }
- }
- ]],
- onClickRow: function (rowIndex, rowData) {
- $('#fahuoList').datagrid('unselectRow', rowIndex);
- },
- onClickCell:function(rowIndex, field, value){
- },
- onLoadError: function () {
- $.messager.alert('系统提示', '数据加载错误,请刷新重试!', 'error');
- return false;
- },
- onBeforeLoad: function (param,data) {
- if (fahuoList != null) {
- fahuoList.datagrid('loadData', {total: 0, rows: []});
- }
- },
- onLoadSuccess: function(data,options){
- },
- onClickRow: function (rowIndex, rowData) {
- $('#exportId').val(rowData.large_id);
- exportGrid.datagrid('load', $('#searchTgForm').serializeObject());
- },
- });
- });
- function dayin(id){
- $.ajax({
- method:"POST",
- url:"/index.php?s=/Admin/Export/print1",
- data:{id:id},
- dataType:'JSON',
- success:function(res){
- $(".company").html(res.supplier_name); //供应商
- $("#shdh").html(res.shdh); //送货单号
- $("#shrq_date").html(res.shrq_date); //送货日期
- $("#carid").html(res.plate_number); //车牌号
- $("#deliveryman").html(res.deliveryman+' '+res.shr_phone);//送货人
- $("#address").html(res.address); //发货单位地址
- var arr = res.arr;
- var note='';
- var html = '<tr><th class="tg-s6z2">物料名称</th>' +
- '<th class="tg-s6z2">生产批号</th>' +
- '<th class="tg-s6z2">大件</th>' +
- '<th class="tg-s6z2">小件</th>' +
- '<th class="tg-s6z2">单位</th>' +
- '<th class="tg-s6z2">实发数量</th>' +
- '<th class="tg-s6z2">备注</th>' +
- '<th id="explain" rowspan="'+(res.count+1)+'" width="7%" style="border: none"><span style="writing-mode: tb-rl;height: 300px;font-size:16px;text-align: center;">' +
- '蓝联(回):业务 黄联(回):运输 '+'<br>'+'白联:存根 红联:财务 绿联:客户</span></th></tr>';
- for (var i=0;i < arr.length;i++){
- html+= '<tr><td class="tg-031e">'+arr[i].matter_name+'</td>';
- html+= '<td class="tg-031e" style="word-break:break-all;">'+(arr[i].bach_num?arr[i].bach_num:'')+'</td>';
- html+= '<td class="tg-031e">'+arr[i].large_num+'</td>';
- html+= '<td class="tg-031e">'+arr[i].small_num+'</td>';
- if(arr[i].mater_type==1){
- html+= '<td class="tg-031e">万张</td>';
- html+='<td class="tg-031e">'+arr[i].l_num+'</td>';
- html+='<td class="tg-031e" >'+arr[i].small_num+'件*'+parseInt(arr[i].num)+'张'+'</td>';
- }else if (arr[i].mater_type==2){
- html+= '<td class="tg-031e">kg</td>';
- html+='<td class="tg-031e">'+parseFloat(arr[i].num)*parseFloat(arr[i].small_num)/1000+'</td>';
- html+='<td class="tg-031e" >'+arr[i].small_num+'件*'+parseFloat(arr[i].num)/1000+'kg'+'</td>';
- }else if (arr[i].mater_type==3){
- html+= '<td class="tg-031e">万支</td>';
- html+='<td class="tg-031e">'+parseFloat(arr[i].num)*parseFloat(arr[i].small_num)/10000+'</td>';
- html+='<td class="tg-031e" >'+arr[i].small_num+'件*'+parseInt(arr[i].num)+'支'+'</td>';
- }
- // note+=arr[i].note;
- // html+='<td class="tg-031e" >'+arr[i].small_num+'件*'+parseInt(arr[i].num)+(arr[i].mater_type==1?'张':"kg")+'</td>';
- }
- html+= '<tr><td class="tg-031e">送货单备注</td><td colspan="6" class="tg-031e">'+res.note+'</td></tr>';
- $("#table").html(html)
- // $("#note").html(note);
- $('#myImage').attr("src", res.qrcode_add);
- // createQrcode(res.shdh,110,110);
- // var img = document.getElementById("myImage"); /// get image element
- // var canvas = document.getElementsByTagName('canvas')[0];
- // img.src = canvas.toDataURL(); /// update image
- // if(!res.qrcode_add){
- // $.ajax({
- // method:"POST",
- // data:{
- // qrcode_add:img.src,
- // ids:id
- // },
- // dataType:'JSON',
- // url:"/index.php?s=/Admin/Export/qrcode_up",
- // success:function(rs){
- // console.log(rs);
- // }
- // });
- // }
- $.print('#print');
- return false;
- }
- })
- }
- // function createQrcode(txt,width,height) {
- // $("#qrcode").qrcode({
- // render: "canvas",//canvas和table两种渲染方式
- // width: width,
- // height: height,
- // correctLevel:3,//二维码纠错级别
- // background:"#ffffff",//背景颜色
- // foreground:"#000000", //二维码颜色
- // text:txt
- // });
- // }
- function deal(id){
- $.messager.confirm('再次确认', '温馨提示:删除后无法恢复,确定删除请选择“确定”', function(r){
- if (r){
- // exit action;
- $('.body').loading();
- $.ajax({
- url: "/index.php?s=/Admin/Export/changeFahuoData",
- type: "post",
- dataType: "json",
- data: {id:id},
- success: function (data) {
- $('.body').loadend();
- if (data != null) {
- if (data.status == 0) {
- $.messager.alert('系统提示', data.msg, 'error');
- fahuoList.datagrid('load', $('#searchBthForm').serializeObject());
- } else {
- $.messager.alert('系统提示', data.msg, 'info',function(){
- fahuoList.datagrid('load', $('#searchBthForm').serializeObject());
- });
- }
- }
- },
- error: function (error) {
- }
- })
- }
- });
- return false;
- }
- function fa(id){
- }
- //初始化日期输入框
- function initDateBox() {
- var nowDate = new Date;
- $('#endDate').datebox('setValue', nowDate.Format("yyyy-MM-dd"));
- nowDate.setMonth(nowDate.getMonth() - 1);
- nowDate.setDate(nowDate.getDay() +1);
- $('#startDate').datebox('setValue', nowDate.Format("yyyy-MM-dd"));
- }
- function searchBthFun() {
- if ($('#searchBthForm').form('validate')) {
- //var obj = $('#searchBthForm').serializeObject();
- fahuoList.datagrid('load', $('#searchBthForm').serializeObject());
- }
- }
- function UnixToDate(unixTime, isFull, timeZone) {
- if (typeof (timeZone) == 'number') {
- unixTime = parseInt(unixTime) + parseInt(timeZone) * 60 * 60;
- }
- var time = new Date(unixTime * 1000);
- var ymdhis = "";
- ymdhis += time.getUTCFullYear() + "-";
- ymdhis += (time.getUTCMonth() + 1) + "-";
- ymdhis += time.getUTCDate();
- if (isFull === true) {
- ymdhis += " " + time.getUTCHours() + ":";
- ymdhis += time.getUTCMinutes() + ":";
- ymdhis += time.getUTCSeconds();
- }
- return ymdhis;
- }
- </script>
- </body>
- </html>
|