123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <title>试用记录trial</title>
- <meta name="description" content="">
- <meta name="keywords" content="">
- <link href="/css/ims/base.css" rel="stylesheet">
- <link rel="stylesheet" type="text/css" href="/css/ims/bootstrap.min.css"/>
- <link rel="stylesheet" type="text/css" href="/css/ims/ace.min.css"/>
- <style>
- input {
- height: 30px;
- border-radius: 4px;
- border: 1px solid #ccc;
- box-shadow: none;
- text-indent: 10px;
- margin-right: 5px;
- float:left;
- }
- .green {
- color: green;
- }
- .red {
- color: red;
- }
- .yellow {
- color: #FF9900;
- }
- .layui-layer-zxhx .layui-layer-title {
- background: #15ae68;
- }
- .layui-layer-zxhx .layui-layer-btn a {
- background: #15ae68;
- border-color: #15ae68;
- }
- .ims-box {
- margin: 20px;
- }
- .ims-box .title h1 {
- display: inline-block;
- font-size: 28px;
- }
- .ims-box .title a {
- margin-left: 30px;
- color: #0000FF;
- }
- .screen {
- height: 30px;
- margin-top: 20px;
- margin-bottom: 20px;
- }
- .screen > div {
- margin: 0 5px;
- line-height: 30px;
- }
- .apply-extend-trial {
- cursor: pointer;
- }
- .stop-layer-box, .resubmit-layer-box, .delete-layer-box {
- line-height: 140px;
- text-align: center;
- }
- </style>
- </head>
- <body>
- <div class="ims-box">
- <form action="<?php echo Yii::app()->createUrl('imsSale/trialTable'); ?>" method="get">
- <div class="screen">
- <div class="diy_select select-seasonId">
- <input type="hidden" id="seasonId" name="seasonId" class="diy_select_input" value="0">
- <div class="diy_select_txt">请选择学期</div>
- <div class="diy_select_btn"></div>
- <ul class="diy_select_list" style="display: none;">
- <?php if ($seasonList): ?>
- <li val="0">请选择学期</li>
- <?php foreach ($seasonList as $season): ?>
- <?php if($season['semesters']){
- foreach ($season['semesters'] as $val){
- echo '<li val="'.$season['schoolYearId'].'_'.$val['semesterId'].'">'.$season['periodName'].$val['semesterName'].'</li>';
- }
- }?>
- <?php endforeach; ?>
- <?php else: ?>
- <li val="0">暂无学期</li>
- <?php endif; ?>
- </ul>
- </div>
- <div class="diy_select select-goods">
- <input type="hidden" id="goodsTypeId" name="goodsTypeId" class="diy_select_input" value="0">
- <div class="diy_select_txt">请选择商品</div>
- <div class="diy_select_btn"></div>
- <ul class="diy_select_list" style="display: none;">
- <?php if ($goodList): ?>
- <li val="0">请选择商品</li>
- <?php foreach ($goodList as $good): ?>
- <li val="<?php echo $good['goodsTypeId']; ?>"><?php echo $good['goodsTypeName']; ?></li>
- <?php endforeach; ?>
- <?php else: ?>
- <li val="">暂无商品</li>
- <?php endif; ?>
- </ul>
- </div>
- <div class="diy_select select-subject">
- <input type="hidden" id="subject" name="subject" class="diy_select_input" value="0">
- <div class="diy_select_txt">请选择学科</div>
- <div class="diy_select_btn"></div>
- <ul class="diy_select_list" style="display: none;">
- <li val="0">请选择学科</li>
- <?php
- if(isset($subject) && $subject){
- foreach($subject as $key=> $val){
- echo '<li val="'.$key.'">'.$val.'</li>';
- }
- }
- ?>
- </ul>
- </div>
- <div class="diy_select select-grade">
- <input type="hidden" id="grade" name="grade" class="diy_select_input" value="0">
- <div class="diy_select_txt">请选择年级</div>
- <div class="diy_select_btn"></div>
- <ul class="diy_select_list" style="display: none;">
- <li val="0">请选择年级</li>
- <?php
- if(Yii::app()->params['grade_list']){
- foreach (Yii::app()->params['grade_list'] as $val){
- echo '<li val="'.$val['id'].'" >'.$val['grade_name'].'</li>';
- }
- }
- ?>
- </ul>
- </div>
- <div class="diy_select select-clazzId">
- <input type="hidden" id="clazzId" name="clazzId" class="diy_select_input" value="0">
- <div class="diy_select_txt">请选择班级</div>
- <div class="diy_select_btn"></div>
- <ul class="diy_select_list" style="display: none;">
- </ul>
- </div>
- <button type="submit" class="label-primary-s bth-s">查询</button>
- <a href="<?php echo Yii::app()->createUrl('imsSale/trial');?>" type="button" class="label-primary-s bth-s">开通试用</a>
- <button type="button" class="label-primary-s stu-query">试用学生查询</button>
- <a class="label-primary-s timetable">普通试用时间表</a>
- </div>
- </form>
- <div>
- <table id="record-table"
- class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable"
- style="font-size:12px">
- <thead>
- <tr>
- <th>订单号</th>
- <th>试用商品</th>
- <th>试用人数</th>
- <th>暂停人数</th>
- <th>年级</th>
- <th>试用学科</th>
- <th>开始试用时间</th>
- <th>试用结束时间</th>
- <th>已使用次数</th>
- <th>试用类型</th>
- <th>状态</th>
- <th>审批状态</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- <?php if ($list): ?>
- <?php foreach ($list as $item): ?>
- <tr>
- <td><?php echo $item['orderNo']; ?></td>
- <td><?php echo $item['goodsName']; ?></td>
- <td>
- <a href="<?php echo Yii::app()->createUrl('imsSale/trialStudent', array('orderId' => $item['orderId'])) ?>">
- <?php echo $item['trialStudentNum']; ?>
- </a>
- </td>
- <td><?php echo $item['stopNum']; ?></td>
- <td><?php echo $item['gradeName']; ?></td>
- <td><?php echo $item['subjectName']; ?></td>
- <td><?php echo $item['beginTime']; ?></td>
- <td><?php echo $item['endTime']; ?></td>
- <td><?php echo $item['trialNum']; ?></td>
- <td><?php echo isset($item['trialTypeName'])?$item['trialTypeName']:'' ?></td>
- <td class="trial-type" status="<?php echo $item['status']; ?>"><?php echo $item['statusName']; ?></td>
- <td class="subject-type" status="<?php echo $item['applyStatus']; ?>"><?php echo $item['applyStatusName']; ?></td>
- <td businessKey="<?php echo $item['processInfo']['businessKey'] ?>">
- <?php if ($item['canDelay']): ?>
- <a href="#" orderId="<?php echo $item['orderId'];?>" class="canDelay">申请延长试用</a>
- <?php endif; ?>
- <?php if ($item['processInfo']['showStop']): ?>
- <a href="#" orderId="<?php echo $item['orderId'];?>" class="showStop">取消</a>
- <?php endif; ?>
- <?php if ($item['processInfo']['showDelete']): ?>
- <a href="#" orderId="<?php echo $item['orderId'];?>" class="showDelete">删除</a>
- <?php endif; ?>
- <a href="#" orderId="<?php echo $item['orderId'];?>" class="showLog">日志</a>
- <?php if($item['applyStatus']==1):?>
- <a href="<?php echo $this->createUrl('imsSale/trialDeleteApply',array('orderId'=>$item['orderId']))?>" class="showDeleteApply">删除学生</a>
- <?php endif;?>
- </td>
- </tr>
- <?php endforeach; ?>
- <?php endif; ?>
- </tbody>
- </table>
- <?php if ($page): ?>
- <div class="col-sm-12">
- <ul class="pagination">
- <?php
- $params = array();
- if (isset($_GET['goodsTypeId']) && $_GET['goodsTypeId']) {
- $params['goodsTypeId'] = $_GET['goodsTypeId'];
- }
- if (isset($_GET['grade']) && $_GET['grade']) {
- $params['grade'] = $_GET['grade'];
- }
- if (isset($_GET['clazzId']) && $_GET['clazzId']) {
- $params['clazzId'] = $_GET['clazzId'];
- }
- if (isset($_GET['seasonId']) && $_GET['seasonId']) {
- $params['seasonId'] = $_GET['seasonId'];
- }
- if (isset($_GET['page'])) {
- $params['page'] = $_GET['page'];
- }else{
- $params['page'] = 1;
- }
- if (isset($_GET['subject']) && $_GET['subject']) {
- $params['subject'] = $_GET['subject'];
- }
- echo formatPage($page, 'imsSale/trialTable', $params);
- ?>
- </ul>
- </div>
- <?php endif; ?>
- </div>
- </div>
- </div>
- <script src="/js/productset/jquery.min.js"></script>
- <script src="/js/layer/layer.js"></script>
- <script src="/js/ims/xsgl.js"></script>
- <!--日志弹层-->
- <link rel="stylesheet" href="/css/cylet.css" />
- <style>
- .class-modal-body-1{overflow: auto;height:400px;}
- .class-modal-body-1 td{font-size:14px;line-height:200%}
- </style>
- <div class="confirmbox-mask" style="display: none" id="classModal">
- <div class="class-modal">
- </div>
- </div>
- <div class="confirmbox-mask" style="display: none" id="classModal-1">
- <form name="table_set">
- <div class="class-modal-1">
- <i class="icon icon-close-1"></i><div class="class-modal-head-1">日志</div>
- <div class="class-modal-body-1">
- <table cellspacing="0" cellpadding="0" border="0" class="logList">
- </table>
- </div>
- </div>
- </form>
- </div>
- <div class="confirmbox-mask" style="display: none" id="classModal-2">
- <div class="class-modal-1">
- <i class="icon icon-close-1"></i><div class="class-modal-head-1">试用学生查询</div>
- <div style="margin: 5px 0 0 5px;color: red;font-size: 10px;">输入学生姓名或试用单号查询</div>
- <div style="margin: 5px 0 0 5px;width: 100%;" >
- <input type="text" class="clazzName" placeholder="输入学生姓名"/>
- <input type="text" class="clazzName" placeholder="试用订单号"/>
- <input type="button" class="label-primary-s order-module-query " value="查询"/>
- </div>
- <br><br>
- <div style="height: 300px;max-height:300px;overflow: auto;">
- <table id="record-table"
- class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable"
- style="font-size:12px;width: 680px;margin: 5px 5px 0 5px;">
- <thead id="student-info">
- </thead>
- </table>
- </div>
- </div>
- </div>
- <div class="confirmbox-mask" style="display: none" id="classModal-3">
- <div class="class-modal-1">
- <i class="icon icon-close-1"></i><div class="class-modal-head-1">普通试用时间表</div>
- <div style="height: 300px;max-height:300px;overflow: auto;">
- <table id="record-table"
- class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable"
- style="font-size:12px;width: 680px;margin: 5px 5px 0 5px;">
- <thead id="timetable-info">
- </thead>
- </table>
- </div>
- </div>
- </div>
- <script>
- $(document).ready(function () {
- //日志
- $('.showLog').click(function(){
- var orderId=$(this).attr('orderId');
- $.ajax({
- url:'<?php echo $this->createUrl('imsSale/getOrderLog')?>',
- type:'POST',
- dataType:'json',
- data:{orderId:orderId},
- success:function(res){
- console.log(res);
- if(res.status==1 && res.data.length>0){
- var html='';
- for(var i=0;i<res.data.length;i++){
- html+='<tr>';
- html+= '<td><img src="/images/right_head.png"></td>';
- html+='<td width="40%">'+res.data[i]['createTime']+'</td>';
- html+='<td width="40%">【'+res.data[i]['userName']+'】'+res.data[i]['info']+'</td>';
- html+='</tr>';
- }
- $('.logList').html(html);
- $('#classModal-1').show();
- }else{
- layer.msg('未获取到日志数据');
- }
- }
- });
- });
- $('.icon-close-1').click(function(){
- $('#classModal-1,#classModal-2,#classModal-3').hide();
- });
- $('.stu-query').click(function(){
- $('#student-info').html('<tr> <th>试用订单号</th> <th>学生姓名</th> <th>学生ID</th><th>年级</th> <th>班级</th> <th>试用商品</th> <th>学科</th> </tr>');
- $('#classModal-2').show();
- });
- $('.order-module-query').click(function () {
- var studentName = $(this).prev().prev().val();
- var orderNo = $(this).prev().val();
- studentName = $.trim(studentName);
- orderNo = $.trim(orderNo);
- $.ajax({
- url:'<?php echo $this->createUrl('imsSale/getStudentInfo')?>',
- type:'POST',
- dataType:'json',
- data:{studentName:studentName,orderNo:orderNo},
- success:function(res){
- console.log(res);
- if(res.status==1 && res.data.length>0){
- var html='<tr> <th>试用订单号</th> <th>学生姓名</th> <th>学生ID</th><th>年级</th> <th>班级</th> <th>试用商品</th> <th>学科</th> </tr>';
- for(var i=0;i<res.data.length;i++){
- html+='<tr>';
- html+= '<td>'+res.data[i]['orderNo']+'</td>';
- html+= '<td>'+res.data[i]['studentName']+'</td>';
- html+= '<td>'+res.data[i]['studentId']+'</td>';
- html+= '<td>'+res.data[i]['gradeName']+'</td>';
- html+= '<td>'+res.data[i]['clazzName']+'</td>';
- html+= '<td>'+res.data[i]['goodsName']+'</td>';
- html+= '<td>'+res.data[i]['subjectName']+'</td>';
- html+='</tr>';
- }
- $('#student-info').html(html);
- }else{
- $('#student-info').html('');
- layer.msg('未查询到数据');
- }
- }
- });
- })
- //筛选条件赋值
- <?php if(isset($_GET['grade']) && $_GET['grade']>0):?>
- var grade = "<?php echo $_GET['grade'];?>";
- $('#grade').val(grade);
- var txt = $('.select-grade li[val='+grade+']').html();
- $('.select-grade .diy_select_txt').html(txt);
- getClass(grade);
- <?php endif;?>
- <?php if(isset($_GET['subject']) && $_GET['subject']>0):?>
- var subject = "<?php echo $_GET['subject'];?>";
- $('#subject').val(subject);
- var txt = $('.select-subject li[val='+subject+']').html();
- $('.select-subject .diy_select_txt').html(txt);
- <?php endif;?>
- <?php if(isset($_GET['seasonId']) && $_GET['seasonId']):?>
- var seasonId = "<?php echo $_GET['seasonId'];?>";
- $('#seasonId').val(seasonId);
- var txt = $('.select-seasonId li[val='+seasonId+']').html();
- $('.select-seasonId .diy_select_txt').html(txt);
- <?php endif;?>
- <?php if(isset($_GET['goodsTypeId']) && $_GET['goodsTypeId']):?>
- var goodsTypeId = "<?php echo $_GET['goodsTypeId'];?>";
- $('#goodsTypeId').val(goodsTypeId);
- var txt = $('.select-goods li[val='+goodsTypeId+']').html();
- $('.select-goods .diy_select_txt').html(txt);
- <?php endif;?>
- function setType() {
- $(".trial-type").each(function (index) {
- if ($(this).attr('status') == 1) {
- $(this).addClass("red");
- } else {
- $(this).addClass("green");
- }
- })
- }
- function setSubjectType() {
- $(".subject-type").each(function (index) {
- if ($(this).attr('status') == '1') {
- $(this).addClass("green");
- } else if ($(this).attr('status') == '2') {
- $(this).addClass("red");
- } else if ($(this).attr('status') == '3') {
- $(this).addClass("grey");
- } else {
- $(this).addClass("yellow");
- }
- })
- }
- setType();
- setSubjectType();
- //获取班级
- $('.select-grade li').click(function () {
- var grade = $('#grade').val();
- var currentGrade = $(this).attr('val');
- if (currentGrade > 0 && currentGrade != grade) {
- getClass(currentGrade);
- }else {
- $('.select-clazzId .diy_select_txt').html('请选择班级');
- $('#clazzId').val(0);
- $('.select-clazzId ul').html("<li val='0'>请选择班级</li>");
- }
- });
- function getClass(currentGrade){
- $('.select-clazzId .diy_select_txt').html('请选择班级');
- $('.select-clazzId ul').html('');
- $.ajax({
- type: 'post',
- url: "<?php echo Yii::app()->createUrl('imsSale/getClassList');?>",
- data: {grade: currentGrade},
- dataType: 'json',
- success: function (data) {
- console.log(data);
- if (data.status) {
- var html = '<li val="0">请选择班级</li>';
- for (var i = 0; i < data.data.length; i++) {
- var item = data.data[i];
- if (item['class_id']) {
- html += '<li val="' + item['class_id'] + '">';
- html += item['class_name'];
- html += '</li>'
- }
- }
- } else {
- var html = '<li val="0">暂无班级数据</li>';
- }
- $('.select-clazzId ul').html(html);
- <?php if(isset($_GET['clazzId'])):?>
- var clazzId = "<?php echo $_GET['clazzId'];?>";
- $('#clazzId').val(clazzId);
- var txt = $('.select-clazzId li[val=' + clazzId + ']').html();
- $('.select-clazzId .diy_select_txt').html(txt);
- <?php endif;?>
- },
- error: function () {
- return;
- }
- })
- }
- $(".canDelay").on("click", function () {
- var orderId = $(this).attr('orderId');
- $(this).removeClass('canDelay');
- $.ajax({
- type: 'post',
- url: "<?php echo Yii::app()->createUrl('imsSale/relayTrial');?>",
- data: {'orderId': orderId},
- dataType: 'json',
- success: function (data) {
- if(data.status){
- layer.alert(data.msg, {icon:1},function () {
- location.reload();
- });
- }else{
- layer.alert(data.msg, {icon:7});
- }
- }
- });
- });
- //取消
- $("body").on("click", ".showStop", function () {
- // var $(this)
- var businessKey = $(this).parent().attr('businessKey');
- layer.confirm('确认取消流程吗?', {
- btn: ['确定', '取消'] //按钮
- }, function () {
- $.ajax({
- type: 'post',
- url: "<?php echo Yii::app()->createUrl('imsSale/stop');?>",
- data: {'businessKey': businessKey,'title':"试用订单-取消"},
- dataType: 'json',
- success: function (data) {
- if (data.status) {
- layer.alert("取消成功", {icon:1,closeBtn:0},function () {
- location.reload();
- })
- } else {
- layer.msg(data.msg);
- }
- },
- error: function () {
- layer.msg("网络异常");
- }
- });
- });
- });
- //删除
- $("body").on("click", ".showDelete", function () {
- // var $(this)
- var businessKey = $(this).parent().attr('businessKey');
- layer.confirm('确认删除该订单吗?', {
- btn: ['确定', '取消'] //按钮
- }, function () {
- $.ajax({
- type: 'post',
- url: "<?php echo Yii::app()->createUrl('imsSale/delete');?>",
- data: {'businessKey': businessKey,'title':"试用订单-删除"},
- dataType: 'json',
- success: function (data) {
- if (data.status) {
- layer.alert("删除成功", {icon:1,closeBtn:0},function () {
- location.reload();
- })
- } else {
- layer.msg(data.msg);
- }
- },
- error: function () {
- layer.msg("网络异常");
- }
- });
- });
- });
- $('.timetable').click(function () {
- $.ajax({
- type: 'post',
- url: "<?php echo Yii::app()->createUrl('imsSale/timetable');?>",
- dataType: 'json',
- success: function (res) {
- if (res.status) {
- var html='<tr> <th>年级</th> <th>学科</th> <th>产品</th><th>普通试用开始时间</th> <th>普通试用截止时间</th> </tr>';
- for(var i=0;i<res.data.length;i++){
- html+='<tr>';
- html+= '<td>'+res.data[i]['gradeName']+'</td>';
- html+= '<td>'+res.data[i]['subjectName']+'</td>';
- html+= '<td>'+res.data[i]['goodsTypeName']+'</td>';
- html+= '<td>'+res.data[i]['trialBeginDateStr']+'</td>';
- html+= '<td>'+res.data[i]['trailEndDateStr']+'</td>';
- html+='</tr>';
- }
- $('#timetable-info').html(html);
- $('#classModal-3').show();
- }else{
- $('#timetable-info').html('');
- layer.msg('未查询到数据');
- }
- },
- error: function () {
- layer.msg("网络异常");
- }
- });
- });
- $('.icon-close-3').click(function(){
- $('#classModal-3').hide();
- });
- });
- </script>
- </body>
- </html>
|