123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>试用订单删除申请</title>
- <link href="/css/ims/base.css" rel="stylesheet">
- <link href="/css/ims/ims.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" />
- <link rel="stylesheet" type="text/css" href="/css/ims/jquery.datetimepicker.css" />
- <style>
- .ims-box {
- margin-top: 5px;
- margin-left: 20px;
- margin-right: 20px;
- }
- .screen {
- padding-left: 20px;
- height: 44px;
- line-height: 44px;
- background-color: #eff4fa;
- }
- .screen li {
- float: left;
- margin-right: 65px;
- }
- .bg-d9bf6e {
- margin-left: 5px;
- padding: 0 20px;
- color: #fff;
- background-color: #d9bf6e;
- }
- .number{
- margin-top: 10px;
- }
- .ims-add-student-box {
- margin: 20px;
- }
- .ims-add-student-box p{
- margin: 0;
- }
- .ims-add-student-box .ims-title{
- font-size: 20px;
- font-weight: bold;
- }
- .ims-add-student-box .ims-title span{
- margin-right: 20px;
- }
- .ims-add-student-box .add-student-box {
- margin-top: 20px;
- font-size: 0;
- overflow: hidden;
- }
- .ims-add-student-box .add-student-box>div{
- display: inline-block;
- height: 530px;
- font-size: 14px;
- vertical-align: top;
- }
- .ims-add-student-box .add-student-box .add-student-title{
- padding: 0 8px;
- line-height: 30px;
- color: #fff;
- background-color: #2977ff;
- }
- .ims-add-student-box .add-student-box .add-student-title label{
- font-size: 14px;
- font-weight: normal;
- cursor: pointer;
- margin-bottom: 0;
- }
- .ims-add-student-box .add-student-box .add-student-title input{
- vertical-align: middle;
- margin: 0;
- }
- #input-search-student{
- width: 120px;
- height: 20px;
- border: 0;
- color:#000;
- }
- .ims-add-student-box .add-student-box{
- line-height: 30px;
- min-width: 938px;
- }
- .ims-add-student-box .add-student-box .class-box {
- width: 180px;
- text-align: center;
- border: 1px solid #ccc;
- }
- .ims-add-student-box .student-list div{
- font-size: 14px;
- font-weight: normal;
- }
- .ims-add-student-box .add-student-box .class-list{
- height: 500px;
- overflow: auto;
- }
- .ims-add-student-box .add-student-box .class-list li{
- border-bottom: 1px solid #ccc;
- cursor: pointer;
- }
- .ims-add-student-box .class-list .active{
- color: #629aff;
- }
- .ims-add-student-box .add-student-box .student-list{
- margin: 0;
- width: 34%;
- min-width: 326px;
- border: 1px solid #ccc;
- border-left: 0;
- }
- .ims-add-student-box .student-list-content,.selected-list-content{
- padding: 8px;
- height: 500px;
- overflow: auto;
- }
- .ims-add-student-box .student-list-content label,.selected-list-content label{
- display: inline-block;
- width: 150px;
- cursor: pointer;
- font-size: 14px;
- font-weight: normal;
- }
- .ims-add-student-box .btn-search-student{
- height: 20px;
- line-height: 20px;
- padding: 0 5px;
- border-radius: 3px;
- color: #629aff;
- background-color: #fff;
- border: none;
- outline: none;
- cursor: pointer;
- }
- .ims-add-student-box .btns-box {
- width: 100px;
- text-align: center;
- }
- .ims-add-student-box .btn-left,.ims-add-student-box .btn-right{
- margin: 150px auto 0;
- width: 40px;
- height: 40px;border: 1px solid #ccc;
- border-radius: 50%;
- background-color: #fff;
- text-align: center;
- line-height: 40px;
- cursor: pointer;
- }
- .ims-add-student-box .selected-list{
- width: 34%;
- min-width: 326px;
- border: 1px solid #ccc;
- }
- .ims-add-student-box .btn-confirm_purchase {
- display: block;
- margin: 0 auto;
- margin-top: 100px;
- margin-bottom: 50px;
- width: 200px;
- line-height: 54px;
- color: #fff;
- font-family: PingFangSC-Regular, "PingFang SC";
- font-weight: 400;
- font-style: normal;
- font-size: 20px;
- text-align: center;
- background-color: #2977ff;
- cursor: pointer;
- }
- .yiiPager li{display: inline}
- .clear{clear: both}
- </style>
- </head>
- <body>
- <div class="ims-box">
- <h3 class="sale-title">删除试用学生申请</h3>
- <p class="red">*注意:本功能用户填错试用订单时使用,不可用于其它情况</p>
- <h4 >删除原因说明</h4>
- <table width="100%">
- <tr>
- <td >
- <textarea name="remark" id="remark" cols="50" class="use-explain" rows="5"></textarea>
- </td>
- </tr>
- </table>
- <br><br>
- <span>删除试用学生名单</span>
- <button type="submit" class="label-primary-s bth-s stop">添加</button>
- <button type="submit" class="label-primary-s bth-s remove-student">删除</button>
- <table width="100%" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" id="P_list">
- <tr>
- <td>序号</td>
- <td>学生</td>
- <td>班级</td>
- </tr>
- </table>
- <button type="button" class="label-primary-s bth-s add-order" style="float: left;margin-top:5px;" >提交</button>
- <div class="clear"></div>
- <div class="layer-edit">
- <div class="ims-add-student-box">
- <h2 class="ims-title"><span>添加学生</span></h2>
- <div class="add-student-box">
- <div class="class-box">
- <div class="add-student-title">
- <p>班级</p>
- </div>
- <ul class="class-list">
- <li class="active">一班</li>
- <li>二班</li>
- <li>三班</li>
- </ul>
- </div>
- <div class="student-list">
- <div class="add-student-title clearfix">
- <span class="fl">
- <label>
- <input type="checkbox" name="select-all" value="1" /><span class="msg1">试用学生</span>
- </label>
- <span></span>
- </span>
- <span class="fr">
- </span>
- </div>
- <div class="student-list-content" id="studentListContent">
- </div>
- </div>
- <div class="btns-box">
- <p class="btn-left" id="btnRemoveStudent"><</p>
- <p class="btn-right" id="btnAddStudent" >></p>
- </div>
- <div class="selected-list">
- <div class="add-student-title">
- <p><span class="msg2">删除</span>(<span id="studentSelectedLength">0</span>人)</p>
- </div>
- <div class="selected-list-content" id="selectedListContent">
- </div>
- </div>
- </div>
- <input type="hidden" name="actionType" value="">
- <button type="button" class="label-primary-s bth-s cancel" style="float: left;margin-top:5px;margin-left:45%" >返回</button>
- <button type="button" class="label-primary-s bth-s save" style="float: left;margin-top:5px;" >保存</button>
- </div>
- </div>
- </div>
- </body>
- <script src="/js/jquery-2.2.2.min.js" ></script>
- <script src="/js/layer/layer.js"></script>
- <script>
- var orderId='<?php echo $orderId?>';
- var selectedDataAll=[];
- var selectedDataValue =[];
- var selectedClassId=0;
- var selectedClassName='';
- $('.cancel').click(function(){
- layer.closeAll();
- selectedDataAll=[];
- selectedDataValue =[];
- $('#selectedListContent').html('');
- });
- $('.save').click(function(){
- actionType=$('input[name=actionType]').val();
- if(selectedDataValue.length==0){
- layer.msg('请选择学生');
- return false;
- }
- console.log(selectedDataAll);
- html='<tr><td></td><td>序号</td><td>姓名</td><td>班级</td></tr>';
- for (var i = 0; i < selectedDataAll.length; i++) {
- html+='<tr id="'+selectedDataAll[i]['value']+'" class="select-student-list">';
- html+='<td width="1%"><input type="checkbox" value="'+selectedDataAll[i]['value']+'" name="select-student"></td>';
- html+='<td>'+(i+1)+'</td>';
- html=html+'<td>'+selectedDataAll[i].name+'</td>';
- html+='<td>'+selectedDataAll[i].class+'</td>';
- html+='</tr>';
- }
- $('#P_list').html(html);
- layer.closeAll();
- return false;
- });
- $('.stop').click(function(){
- selectedDataAll=[];
- selectedDataValue =[];
- selectedClassId=0;
- selectedClassName='';
- $('#selectedListContent').html('');
- $('#studentSelectedLength').html(0);
- $('input[name=actionType]').val(0);
- $.ajax({
- url:'<?php echo $this->createUrl('imsSale/GetDeleteClassesByOrderId')?>',
- type:'POST',
- dataType:'json',
- data:{orderId:orderId,type:1},
- success:function (res) {
- if(res.status==1){
- var html='';
- for(var i=0;i<res.data.length;i++){
- html+='<li classId="'+res.data[i]['clazzId']+'" rel="1">'+res.data[i]['clazzName']+'</li>';
- }
- $('.class-list').html(html);
- var studentHtml='';
- for(var i=0;i<res.students.length;i++){
- studentHtml+='<label><input type="checkbox" className="'+res.students[i]['clazzName']+'" name="studentName" value="'+res.students[i]['osId']+'" />'+res.students[i]['studentName']+'</label>';
- }
- $('.student-list-content').html(studentHtml);
- var selectStudentIndex=layer.open({
- title: false,
- closeBtn: 1,
- type: 1,
- offset: '20px',
- area: ['65%', '650px'],
- content: $(".layer-edit")
- });
- }
- }
- });
- });
- //班级切换
- $(".class-list").on("click", "li", function(event) {
- if(!$(this).hasClass('subjectObj')){
- $(".class-list li").removeClass("active");
- $(this).addClass("active");
- selectedClassId=classId=$(this).attr('classId');
- selectedClassName=className=$(this).html();
- getStudent(classId);
- }
- });
- function getStudent(classId){
- $.ajax({
- url:'<?php echo $this->createUrl('imsSale/GetDeleteStudentByClassIdOrderId')?>',
- type:'POST',
- dataType:'json',
- data:{'classId':classId,'orderId':orderId},
- success:function(res){
- if(res.status==1){
- var studentHtml='';
- for(var i=0;i<res.data.length;i++){
- studentHtml+='<label><input type="checkbox" className="'+res.data[i]['clazzName']+'" name="studentName" classId="'+classId+'" value="'+res.data[i]['osId']+'" />'+res.data[i]['studentName']+'</label>';
- }
- $('.student-list-content').html(studentHtml);
- }else{
- $('.student-list-content').html('');
- }
- }
- });
- }
- // 全选按钮
- $("input[name='select-all']").change(function() {
- var type = $("input[name='select-all']").prop("checked")
- if(type){
- obj=$("#studentListContent").find("input");
- for(var i=0;i<obj.length;i++){
- if(obj.eq(i).attr('disabled')==undefined){
- obj.eq(i).prop("checked", true);
- }
- }
- }else{
- $("#studentListContent").find("input").prop("checked", false);
- }
- });
- // 添加学生
- $("#btnAddStudent").on("click", function() {
- getStudentSelected();
- });
- // 移出学生
- $("#btnRemoveStudent").on("click", function() {
- removeStudentSelected();
- });
- //删除选中学生
- $('.remove-student').click(function(){
- var selectedData = $("#P_list input[name='select-student']:checked"); //获取所以选中学生
- if(selectedDataAll.length==0){
- layer.msg('请选择要删除的学生');
- return false;
- }
- for (var i = 0; i < selectedDataAll.length; i++) {
- for (var j = 0; j < selectedData.length; j++) {
- if(selectedData[j].value===selectedDataAll[i].value){
- selectedDataAll.splice(i,1);
- }
- $(selectedData[j]).closest('tr').remove();
- }
- }
- $('#studentSelectedLength').text(selectedDataAll.length);
- });
- function getStudentSelected() {
- var selectedData = $("#studentListContent input[name='studentName']:checked"); //获取所以选中学生
- var studentName = '';
- for (var i = 0; i < selectedData.length; i++) {
- if (!isSelected(selectedData[i].value)) {
- studentName = $(selectedData[i]).parent().text();
- var student ={
- name:studentName,
- value:selectedData[i].value,
- class:$(selectedData[i]).attr('className'),
- classId:$(selectedData[i]).attr('classId'),
- };
- selectedDataAll.push(student);
- selectedDataValue.push(selectedData[i].value);
- }else{
- //console.log(selectedData[i].value)
- }
- showSelectedStudent();
- }
- };
- function isSelected(val){
- return selectedDataValue.indexOf(val) > -1
- };
- function removeStudentSelected() {
- var selectedStudent = $("#selectedListContent input[name='selectedStudent']:checked"); //获取所有选中学生
- var selectedData = $("#studentListContent input[name='studentName']:checked"); //获取所以选中学生
- for (var i = 0; i < selectedStudent.length; i++) {
- $(selectedStudent[i]).parent().remove();
- for (var j = 0; j < selectedData.length; j++) {
- if(selectedData[j].value===selectedStudent[i].value){
- $(selectedData[j]).prop("checked", false);
- if(selectedDataValue.length>0){
- for(var k=0;k<selectedDataValue.length;k++){
- if(selectedDataValue[k]===selectedStudent[i].value){
- selectedDataValue.splice(k,1);
- selectedDataAll.splice(k,1);
- }
- }
- }
- }
- }
- }
- $('#studentSelectedLength').text(selectedDataAll.length);
- };
- function showSelectedStudent() {
- var selectedDataList = [];
- for (var i = 0; i < selectedDataAll.length; i++) {
- selectedDataList.push('<label><input type="checkbox" name="selectedStudent" value="'+ selectedDataAll[i].value +'" />'+selectedDataAll[i].name+'</label>');
- }
- $('#selectedListContent').html(selectedDataList);
- $('#studentSelectedLength').text(selectedDataAll.length);
- };
- $('.add-order').click(function(){
- var selectedData = $(".select-student-list");
- var osIds=[];
- var reason=$('.use-explain').val();
- if(reason==''){
- layer.msg('删除原因不能为空');
- return false;
- }
- for (var j = 0; j < selectedData.length; j++) {
- osIds.push($(selectedData[j]).attr('id'))
- }
- console.log(osIds)
- $.ajax({
- url:'<?php echo $this->createUrl('imsSale/orderTrialDelete')?>',
- type:'POST',
- dataType:'json',
- data:{'osIds':osIds,'orderId':orderId,'reason':reason},
- success:function(res){
- if(res.status==1){
- layer.msg('提交成功');
- window.location.href='<?php echo $this->createUrl('imsSale/trialDeleteList')?>'
- }else{
- if(res.msg!=undefined){
- layer.msg(res.msg);
- }else{
- res.msg('提交失败');
- }
- }
- }
- });
- });
- </script>
- </html>
|