123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504 |
- {extend name="common/common2" /}
- {block name="main"}
- <style>
- .ys-color1{
- color: #ffffff;
- background-color: #acb3d8;
- }
- .ys-color2{
- color: #ffffff;
- background-color: #fff500;
- }
- .ys-color3{
- color: #ffffff;
- background-color: #ec891a;
- }
- .ys-color4{
- color: #ffffff;
- background-color: #e45946;
- }
- .ys-yellow{
- /*color: #CC6600;*/
- }
- .input-group{
- margin-bottom: 10px;
- }
- </style>
- <div class="ibox">
- <div class="ibox-content">
- <div class="row">
- <div class="col-xs-12" style="text-align: right;">
- <form class="form-inline" id="form-search" action="{:url('convey')}?mode={$mode}">
- <div class="input-group">
- <input type="text" class="form-control" name="ysname" placeholder="运送员">
- </div>
- <div class="input-group">
- <input class="form-control" id="start" readonly placeholder="需求时间" name="xqtime" >
- </div>
- <div class="input-group">
- <input class="form-control" id="end" readonly placeholder="应完成时间" name="ywctime" >
- </div>
- <div class="input-group">
- <select name="priority" class="form-control">
- <option value="">优先级</option>
- <option value="1">可延缓的</option>
- <option value="2">常规</option>
- <option value="3">紧急</option>
- <option value="4">预约</option>
- </select>
- </div>
- <div class="input-group">
- <select name="type" class="form-control">
- <option value="">运送类型</option>
- {foreach $order_type_list as $k=>$v}
- <option value="{$v['id']}">{$v['title']}</option>
- {/foreach}
- </select>
- </div>
- <div class="input-group">
- <select name="status" class="form-control">
- <option value="">选择状态</option>
- <option value="1">新任务</option>
- <option value="2">进行中</option>
- <option value="3">延时中</option>
- </select>
- </div>
- <div class="input-group">
- <select name="start" class="form-control">
- <option value="">始发空间</option>
- {foreach $address as $k=>$v}
- <option value="{$v['id']}">{$v['title']}</option>
- {/foreach}
- </select>
- </div>
- <div class="input-group">
- <select name="end" class="form-control">
- <option value="">目的空间</option>
- {foreach $address as $k=>$v}
- <option value="{$v['id']}">{$v['title']}</option>
- {/foreach}
- </select>
- </div>
- <div class="input-group">
- <span class="input-group-btn">
- <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
- </span>
- <span class="input-group-btn">
- <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
- </span>
- </div>
- </form>
- </div>
- </div>
- </div>
- <div class="ibox-content">
- <a href="javascript:;" url="{:url('dispatchAdd',[],'')}/mode/3" data-title="创建运送订单" onclick="layer_open(this,1)" class="btn btn-sm btn-primary">新增</a>
- <a href="javascript:;" url="{:url('batchsend',[],'')}/mode/3" data-title="派工" class="btn btn-sm btn-primary paiGong">派工</a>
- <a href="javascript:;" class="btn btn-sm btn-primary finish">完成</a>
- <a href="javascript:;" class="btn btn-sm btn-primary quxiao">取消</a>
- <a href="javascript:;" class="btn btn-sm btn-primary yanchi">延迟</a>
- <a href="javascript:;" class="btn btn-sm btn-primary quxiaoyanchi">取消延迟</a>
- <a href="javascript:;" class="btn btn-sm btn-primary ysystatus">运送员状态</a>
- <a href="javascript:;" class="btn btn-sm btn-primary bhgd">驳回工单{if $count>0}({$count}){/if}</a>
- <br/>
- <br/>
- <div style="line-height: 30px; height: 30px;">
- <a style="float:left;" href="javascript:;" class="btn btn-sm btn-primary off">{if $refresh>0}关闭刷新{else}开启刷新{/if}</a>
- <span id="timermsglabel" {if $refresh==0} style="display: none" {else} style="color:black;margin-left: 10px" {/if} >30秒后自动刷新页面</span>
- </div>
- </div>
- <div class="ibox-content">
- <div class="jqGrid_wrapper">
- <table id="table" style="border-collapse: collapse"></table>
- <div id="pager"></div>
- </div>
- </div>
- </div>
- {/block}
- {block name="script"}
- <script src="/static/layDate-v5.0.9/laydate.js"></script>
- <script>
- $ppp=30;
- $(function () {
- laydate.render({
- elem: '#start',
- trigger: 'click' ,
- theme: '#148d8f',
- range:true
- });
- laydate.render({
- elem: '#end',
- trigger: 'click' ,
- theme: '#148d8f',
- range:true
- });
- $(window).bind("resize",function(){
- var width=$(".jqGrid_wrapper").width();
- $("#table").setGridWidth(width);
- });
- $.jgrid.defaults.styleUI="Bootstrap";
- $("#table").jqGrid({
- url:"{:url('convey')}?mode={$mode}",
- datatype: "json",
- colModel:[
- {label:'状态',name:'status',index:'status',width:80,editable: false,sortable: false,formatter: function (a, b, c) {
- if(a===1){
- if(c.ss >0){
- return '<span class="label ys-color'+c.ss+'">新订单</span>'
- }else {
- return '<span class="label">新订单<i class="fa fa-exclamation-triangle-fill"></i></span>'
- }
- }
- if(a===2){
- if(c.ss >0){
- return '<span class="label ys-color'+c.ss+'">进行中</span>'
- }else {
- return '<span class="label">进行中</span>'
- }
- }
- if(a===3){
- if(c.ss >0){
- return '<span class="label ys-color'+c.ss+'">延迟中</span>'
- }else {
- return '<span class="label">延迟中</span>'
- }
- }
- }},
- {label:'运送',name:'type_name',index:'type_name',width:40,editable: false,sortable: false},
- {label:'描述',name:'content',index:'content',width:50,sortable: false},
- {label:'始发',name:'start_name',index:'start_name',width:60,sortable: false},
- {label:'到达',name:'end_name',index:'end_name',width:60,sortable: false},
- {label:'运送员',name:'real_names',index:'real_names',width:60,sortable: false},
- {label:'需求',name:'xtime',index:'xtime',width:40,sortable: false},
- {label:'派工',name:'stime',index:'stime',width:40,sortable: false},
- {label:'接受',name:'ctime',index:'ctime',width:40,sortable: false},
- {label:'优先级',name:'priorityName',index:'priorityName',width:80,editable: false,sortable: false,formatter: function (a, b, c) {
- if(c.priority==3){
- return "<span class='label' style='color: red'>"+a+"</span><img src='/admin/img/jj.png' style='width: 20px !important;height: 20px !important;' alt=''>";
- }else {
- return a;
- }
- }},
- {label:'运送设备',name:'device_name',index:'device_name',width:60,sortable: false},
- {label:'创建人',name:'real_name',index:'real_name',width:60,sortable: false},
- {label:'延迟原因',name:'delay_reason',index:'delay_reason',width:60,sortable: false},
- {label:'延迟时间',name:'delay_diff',index:'delay_diff',width:60,sortable: false},
- {label:'剩余时间',name:'last_time',index:'last_time',width:60,sortable: false},
- {label:'操作',width:100,sortable: false,formatter: function (a, b, c) {
- var detail_url = "{:url('detail2',[],'')}/id/"+c.id;
- var print = "{:url('print',[],'')}/id/"+c.id;
- var btn = '<a url="'+detail_url+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-primary" title="详情">详情</span></a> ';
- // var btn = '<a href="'+detail_url+'" ><span class="label label-primary" title="详情">详情</span></a> ';
- btn += '<a url="'+print+'" href="javascript:;" onclick="layer_open(this,1)" ><span class="label label-success" data-title="打印">打印</span></a>';
- return btn;
- }},
- ],
- rowNum:1000,
- rowList:[1000],
- pager: '#pager',
- sortname: '',
- viewrecords: true,
- autowidth:true,
- mtype: 'post',
- height: 'auto',
- emptyrecords: "暂无数据",
- sortorder: "",
- multiselect: true,//可多选
- caption:"运送调度订单列表",
- loadComplete: function (xhr) {
- if(xhr.code==0){
- layer.msg(xhr.msg);
- return false;
- }
- },
- });
- var interval = function () {
- if($ppp<1)
- {
- // clearInterval(interval);
- $ppp = 30;
- $("#search-btn").click();
- }else{
- $("#timermsglabel").html($ppp+"秒后自动刷新页面");
- $ppp--;
- }
- }
- if(parseInt('{$refresh}') >0){
- var time1 = setInterval(interval,1000);
- }
- //派工
- $('.paiGong').click(function (res) {
- var rowIds = jQuery("#table").jqGrid('getGridParam', 'selarrrow'); //获取勾选记录的ID
- if(rowIds.length <=0){
- updateAlert('请选择订单','alert-danger');
- setTimeout(function(){
- $('#top-alert').find('button').click();
- },1500);
- return;
- }
- clearInterval(time1);
- var url = "{:url('batchsend',[],'')}/id/"+rowIds.join(',')+"/mode/3";
- var title = '派工';
- layer.open({
- type: 2,
- shade: 0.8,
- title: title,
- area: ['800px', '90%'],
- fix: false, //不固定
- maxmin: true,
- content: url,
- skin: 'layer-ext-moon',
- success: function(layero, index) {
- },
- end:function () {
- time1 = setInterval(interval,1000);
- }
- });
- })
- //完成
- $('.finish').click(function (res) {
- var rowIds = jQuery("#table").jqGrid('getGridParam', 'selarrrow'); //获取勾选记录的ID
- if(rowIds.length <=0){
- updateAlert('请选择订单','alert-danger');
- setTimeout(function(){
- $('#top-alert').find('button').click();
- },1500);
- return;
- }
- var url = "{:url('batchfinish',[],'')}/id/"+rowIds.join(',');
- layer.confirm('确定要完成选中的订单吗?', {
- icon: 3,
- btn: ['确定', '取消'],
- skin: 'layer-ext-moon'
- }, function(index) {
- $.post(url,{},function (res) {
- if(res.code==1){
- layer.msg('完成成功', {
- time: 2000 //2秒关闭(如果不配置,默认是3秒)
- }, function () {
- location.reload();
- });
- }else {
- layer.msg(res.msg);
- }
- })
- });
- })
- //取消
- $('.quxiao').click(function (res) {
- var rowIds = jQuery("#table").jqGrid('getGridParam', 'selarrrow'); //获取勾选记录的ID
- if(rowIds.length <=0){
- updateAlert('请选择订单','alert-danger');
- setTimeout(function(){
- $('#top-alert').find('button').click();
- },1500);
- return;
- }
- if(rowIds.length >1){
- updateAlert('每次只能取消一条','alert-danger');
- setTimeout(function(){
- $('#top-alert').find('button').click();
- },1500);
- return;
- }
- clearInterval(time1);
- var url = "{:url('disCancel',[],'')}/id/"+rowIds.join(',');
- var title = '取消';
- layer.open({
- type: 2,
- shade: 0.8,
- title: title,
- area: ['800px', '90%'],
- fix: false, //不固定
- maxmin: true,
- content: url,
- skin: 'layer-ext-moon',
- success: function(layero, index) {
- },
- end:function () {
- time1 = setInterval(interval,1000);
- }
- });
- })
- //延迟
- $('.yanchi').click(function (res) {
- var rowIds = jQuery("#table").jqGrid('getGridParam', 'selarrrow'); //获取勾选记录的ID
- if(rowIds.length <=0){
- updateAlert('请选择订单','alert-danger');
- setTimeout(function(){
- $('#top-alert').find('button').click();
- },1500);
- return;
- }
- clearInterval(time1);
- var url = "{:url('batchdelay',[],'')}/id/"+rowIds.join(',');
- var title = '延迟';
- layer.open({
- type: 2,
- shade: 0.8,
- title: title,
- area: ['800px', '90%'],
- fix: false, //不固定
- maxmin: true,
- content: url,
- skin: 'layer-ext-moon',
- success: function(layero, index) {
- },
- end:function () {
- time1 = setInterval(interval,1000);
- }
- });
- })
- //取消延迟
- $('.quxiaoyanchi').click(function (res) {
- var rowIds = jQuery("#table").jqGrid('getGridParam', 'selarrrow'); //获取勾选记录的ID
- if(rowIds.length <=0){
- updateAlert('请选择订单','alert-danger');
- setTimeout(function(){
- $('#top-alert').find('button').click();
- },1500);
- return;
- }
- var url = "{:url('batchcanceldelay',[],'')}/id/"+rowIds.join(',');
- layer.confirm('确定要取消延迟选中的订单吗?', {
- icon: 3,
- btn: ['确定', '取消'],
- skin: 'layer-ext-moon'
- }, function(index) {
- $.post(url,{},function (res) {
- if(res.code==1){
- layer.msg('取消成功', {
- time: 2000 //2秒关闭(如果不配置,默认是3秒)
- }, function () {
- location.reload();
- });
- }else {
- layer.msg(res.msg);
- }
- })
- });
- })
- //运送员状态
- $('.ysystatus').click(function (res) {
- var rowIds = jQuery("#table").jqGrid('getGridParam', 'selarrrow'); //获取勾选记录的ID
- // if(rowIds.length <=0){
- // updateAlert('请选择订单','alert-danger');
- // setTimeout(function(){
- // $('#top-alert').find('button').click();
- // },1500);
- // return;
- // }
- var url = "{:url('conveystatus',[],'')}/id/"+rowIds.join(',');
- var title = '运送员状态';
- clearInterval(time1);
- layer.open({
- type: 2,
- shade: 0.8,
- title: title,
- area: ['800px', '90%'],
- fix: false, //不固定
- maxmin: true,
- content: url,
- skin: 'layer-ext-moon',
- success: function(layero, index) {
- }, end:function () {
- time1 = setInterval(interval,1000);
- }
- });
- })
- //驳回工单
- $('.bhgd').click(function (res) {
- $ppp = 3000;
- var url = "{:url('bhTodoList')}";
- var title = '驳回工单';
- layer.open({
- type: 2,
- shade: 0.8,
- title: title,
- area: ['90%', '90%'],
- fix: false, //不固定
- maxmin: true,
- content: url,
- skin: 'layer-ext-moon',
- success: function(layero, index) {
- }
- });
- })
- $('.off').click(function () {
- $.post('{:url("orderRefreshOff")}',{},function (res) {
- if(res.code==1){
- if(res.data.status==1){
- time1 = setInterval(interval,1000);
- $("#timermsglabel").css('display','');
- $("#timermsglabel").css('margin-left','10px');
- $(".off").html('关闭刷新');
- }else {
- clearInterval(time1);
- $("#timermsglabel").css('display','none');
- $(".off").html('开启刷新');
- }
- }else {
- layer.msg(res.msg);
- }
- })
- })
- });
- </script>
- {/block}
|