| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379 |
- <!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>
- </head>
- <body class="easyui-layout">
- <div data-options="region:'north',title:'',split:true" style="height: 540px;border:none">
- <div id="excelListToolbar">
- <form id="searchBthForm" class="smShow">
- <table style="width:100%;white-space: nowrap;padding:10px;">
- <tr>
- <td align="left">
- 辅料名称:
- </td>
- <td>
- <select name="sysCdNm" style="height:30px;" >
- <option value="0">全部</option>
- <volist name="productlist" id="val">
- <option value="{$val.product_name}">{$val.product_name}</option>
- </volist>
- </select>
- </td>
- <td align="left">
- 公司名称:
- </td>
- <td>
- <select name="user_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="1">已删除</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>
- <tr>
- <td align="left">
- 请输入订单号:
- </td>
- <td>
- <!--<input id="order_num" name="order_num" class="easyui-numberbox" style="width:150px" type="text" value="" data-options="min:0"/>-->
- <input id="order_num" name="order_num" style="width:150px" type="text" value=""/>
- </td>
- <td align="left">
- 请输入司机:
- </td>
- <td>
- <input name="deliveryman" class="" style="width:150px" type="text" value="" />
- </td>
- <td align="left">
- 请输入司机电话:
- </td>
- <td>
- <input name="shr_phone" class="" style="width:150px" type="text" value=""/>
- </td>
- </tr>
- <tr>
- <td align="left">
- 请输入车牌号:
- </td>
- <td>
- <input name="plate_number" class="" style="width:150px" type="text" value=""/>
- </td>
- <td align="left">
- 备注:
- </td>
- <td>
- <input name="note" style="width:420px" type="text" value="" >
- </td>
- <td>
- <a href="#" class="easyui-linkbutton addBthFahuo" data-options="iconCls:'icon-search'">发货</a>
- </td>
- </tr>
- <!--<tr>-->
- <!--<td colspan="4" align="right">-->
- <!--<a href="#" class="easyui-linkbutton addBthFahuo" data-options="iconCls:'icon-search'">发货</a>-->
- <!--</td>-->
- <!--</tr>-->
- </table>
- </form>
- </div>
- <table id="excelList">
- </table>
- <div class="body"></div>
- </div>
- <script>
- var excelList;
- bt_is_load=true;//定义防重复弹出小标签全局变量
- $(document).ready(function () {
- //初始化日期输入框
- initDateBox();
- excelList = $('#excelList').datagrid({
- url: '/index.php?s=/Admin/Export/getExcelData',
- method: 'post',
- toolbar: '#excelListToolbar',
- 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: 'matter_name', title: '辅料名称', sortable: true, width: 200},
- {field: 'matter_no', title: '辅料编码', sortable: true, width: 200},
- {field: 'username', title: '所属用户', width: 200},
- {field: 'large_num', title: '大件数量', align: 'center', sortable: true, width: 100},
- {field: 'small_num', title: '小件数量', align: 'center', sortable: true, width: 100},
- {field: 'date', 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){
- return "<a href="+value+">点击下载</a>";
- }else{
- return "不支持下载";
- }
- }
- },
- {field:'status',title:'状态',align:'center',sortable:false,width:100,
- formatter: function(value,row,index){
- if(value==0){
- 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='+value+' onclick="deal('+row.id+')">删除</a>';
- }else{
- //return '<a class="green" data-id='+value+' onclick="fa('+value+')">发货</a>';
- }
- }
- }
- ]],
- onClickRow: function (rowIndex, rowData) {
- $('#excelList').datagrid('unselectRow', rowIndex);
- },
- onClickCell:function(rowIndex, field, value){
- },
- onLoadError: function () {
- $.messager.alert('系统提示', '数据加载错误,请刷新重试!', 'error');
- return false;
- },
- onBeforeLoad: function (param,data) {
- if (excelList != null) {
- excelList.datagrid('loadData', {total: 0, rows: []});
- }
- /*if (supTgGrid != null) {
- supTgGrid.datagrid('loadData', {total: 0, rows: []});
- }
- return true;*/
- },
- onLoadSuccess: function(data,options){
- }
- });
- });
- $('.addBthFahuo').click(function(){
- var id_str = '';
- var order_num = $('input[name="order_num"]').val();
- var deliveryman = $('input[name="deliveryman"]').val();
- var plate_number = $('input[name="plate_number"]').val();
- var shr_phone = $('input[name="shr_phone"]').val();
- var note = $('input[name="note"]').val();
- $('.datagrid-row-checked').each(function (i, item) {
- id_str += $(this).children('td:nth-child(8)').children().text() + ',';
- });
- if (order_num == ''){
- $.messager.alert('系统提示', '请填写订单号', 'warning',function(){
- });
- return false;
- }
- if (deliveryman == ''){
- $.messager.alert('系统提示', '请填写司机', 'warning',function(){
- });
- return false;
- }
- if (plate_number == ''){
- $.messager.alert('系统提示', '请填写车牌号', 'warning',function(){
- });
- return false;
- }
- if (shr_phone == ''){
- $.messager.alert('系统提示', '请填写司机电话', 'warning',function(){
- });
- return false;
- }
- if(id_str == ''){
- $.messager.alert('系统提示', '请至少选择一个选项', 'warning',function(){
- });
- return false;
- }else {
- // $('.body').loading();
- $.ajax({
- url: "/index.php?s=/Admin/Export/addFahuo",
- type: "post",
- dataType: "json",
- data: {id: id_str, order_num: order_num, deliveryman: deliveryman,plate_number: plate_number,shr_phone: shr_phone,note: note},
- success: function (data) {
- // console.log(data);
- if (data != null) {
- $('.body').loadend();
- if (data.status == 0) {
- $.messager.alert('系统提示', data.msg, 'warning',function(){
- });
- return false;
- } else {
- // window.location.href = data.url;
- excelList.datagrid('load', $('#searchBthForm').serializeObject());
- }
- }
- },
- error: function (error) {
- }
- })
- }
- })
- function deal(id){
- $.messager.confirm('再次确认', '温馨提示:删除后无法恢复,确定删除请选择“确定”', function(r){
- if (r){
- // exit action;
- $('.body').loading();
- $.ajax({
- url: "/index.php?s=/Admin/Export/changeExcelData",
- type: "post",
- dataType: "json",
- data: {id:id},
- success: function (data) {
- $('.body').loadend();
- if (data != null) {
- if (data.status == 0) {
- $.messager.alert('系统提示', data.msg, 'error');
- excelList.datagrid('load', $('#searchBthForm').serializeObject());
- } else {
- $.messager.alert('系统提示', data.msg, 'info',function(){
- excelList.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();
- excelList.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>
|