123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373 |
- <link href="/css/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>
- .sale-title{font-size: 14px;font-weight:bold}
- .whiteColor{background: #fff;color:#000}
- .ims-box {
- margin: 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;
- }
- .list {
- padding: 0 40px;
- /*margin-top: 40px;*/
- overflow: hidden;
- }
- .list h2 {
- line-height: 30px;
- font-size: 14px;
- }
- .list .student-list_box {
- width: 300px;
- }
- .list .student-list_box > ul {
- height: 260px;
- overflow: auto;
- padding: 20px;
- background-color: #eef3ff;
- }
- .list .student-list_box li {
- line-height: 30px;
- cursor: pointer;
- }
- .list .student-selected_box {
- margin-left: 60px;
- }
- .list .student-list {
- display: none;
- margin-left: 20px;
- }
- .list .student-list li.active .btn-select_all {
- display: inline-block;
- }
- .list .student-list span {
- cursor: pointer;
- }
- .list .btn-select_all {
- margin-left: 84px;
- color: #008000;
- }
- .student-name_box li {
- position: relative;
- margin-left: 28px;
- line-height: 30px;
- }
- .student-name_box input {
- position: absolute;
- left: 155px;
- top: 8px;
- }
- .btn-select_all,
- .student-name_box {
- display: none;
- }
- .student-selected {
- width: 320px;
- height: 220px;
- overflow: auto;
- }
- .student-selected li {
- float: left;
- margin-right: 24px;
- margin-bottom: 12px;
- height: 26px;
- line-height: 26px;
- text-indent: 20px;
- background-color: #f2f2f2;
- }
- .student-selected .btn-delete {
- float: right;
- margin-right: 20px;
- color: red;
- cursor: pointer;
- }
- .btn-confirm_purchase {
- display: block;
- margin: 0 auto;
- margin-top: 100px;
- margin-bottom: 50px;
- width: 430px;
- 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: rgba(0, 153, 102, 1);
- cursor: pointer;
- }
- #imgPreview {
- display: inline-block;
- margin-top: 12px;
- }
- #imgPreview > img {
- max-width: 100px;
- max-height: 100px;
- margin-right: 5px;
- }
- .layui-layer-btn .layui-layer-btn0 {
- border-color: #15ae68 !important;
- background-color: #15ae68 !important;
- color: #fff;
- }
- .stop-layer-box, .resubmit-layer-box, .delete-layer-box {
- line-height: 140px;
- text-align: center;
- }
- .table-center th,.table-center td{text-align:center;}
- .table-center .diy_select{float:none;display:inline-block;}
- .out-count-div{display:inline-block;}
- .out-count-div a{display:inline-block;width:20px;height:20px;text-align:center;line-height:20px; background:#999;color:#fff;cursor:pointer}
- .out-count-div a:hover{background:#666;}
- .out-count-div span{margin-left:10px;}
- .activePage{display: inline-block;width: 30px;height: 30px;background: #0e8e54;text-align: center;line-height: 30px;color:#fff;margin-right: 10px;}
- .page{display: inline-block;width: 30px;height: 30px;border:1px solid #0e8e54;text-align: center;line-height: 30px;color:#000;margin-right: 10px;}
- .grant th{width:10%}
- .grant-info{color:#0e8e54}
- </style>
- <!--发放情况-->
- <div class="ims-box">
- <h3 class="sale-title"> 发放情况</h3>
- <div class="sale-table">
- <table width="100%" class="table grant ">
- <tr>
- <th>领用出库数</th>
- <td class="whiteColor" ><?php echo $num;?></td>
- <th>已退库数</th>
- <td class="whiteColor"><?php echo $refoundNo;?></td>
- <th>已发放数</th>
- <td class="whiteColor"><?php echo $sendNo;?></td>
- <th>剩余发放数</th>
- <td class="whiteColor"><?php echo ($num-$refoundNo-$sendNo);?></td>
- </tr>
- </table>
- </div>
- <h3 class="sale-title"> 发放销售订单</h3>
- <span class="grant-info">填写正数代表发放,填写负数代表撤销发放</span>
- <div class="layer-filter">
- <form action="<?php echo Yii::app()->createUrl('imsStore/grant'); ?>" id="orderSearch" method="get">
- <select name="schoolYearId" id="schoolYearId" style="width: 100px;">
- <option value="0">学年</option>
- <?php if(isset($schoolYear) && $schoolYear):?>
- <?php foreach ($schoolYear as $key => $value): ?>
- <option value="<?php echo $value['schoolYearId']; ?>"><?php echo $value['schoolYearName']; ?></option>
- <?php endforeach; ?>
- <?php endif;?>
- </select>
- <select name="semester" id="semester" style="width: 100px;">
- <option value="0">学期</option>
- <option value="1" <?php if(isset($grade) && $grade==1) echo 'selected';?>>上学期</option>
- <option value="2" <?php if(isset($grade) && $grade==2) echo 'selected';?>>下学期</option>
- <option value="3" <?php if(isset($grade) && $grade==3) echo 'selected';?>>跨学期</option>
- </select>
- <select name="grade" id="grade" style="width: 100px;">
- <option value="0">年级</option>
- <option value="1">高一</option>
- <option value="2">高二</option>
- <option value="3">高三</option>
- </select>
- <input type="text" name="orderNo" placeholder="订单号" style="height:28px">
- <a class="btn btn-success order-search">查询</a>
- <input type="hidden" name="outId" value="<?php echo $outId?>">
- <input type="hidden" name="ajaxDataRequest" value="1">
- <input type="hidden" name="typeId" value="<?php echo $typeId?>">
- <input type="hidden" name="page" value="1">
- </form>
- </div>
- <div class="table-box ">
- <table id="record-table"
- class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable order-table"
- 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>
- </tr>
- </thead>
- <tbody>
- </tbody>
- </table>
- </div>
- </div>
- <div class="sale-submit">
- <button type="button" class="label-primary-cancle">取消</button>
- <button type="button" class="label-primary-s bth-s">提交</button>
- </div>
- <script>
- $(function(){
- $('.order-search').click(function(){
- $('input[name=page]').val(1);
- getOrder();
- });
- $('.order-table')
- .on('click','.gotoPage',function(){
- var page=$(this).attr('rel');
- $('input[name=page]').val(page);
- getOrder();
- })
- function getOrder(){
- $.ajax({
- url:'<?php echo $this->createUrl('imsStore/ajaxGetOrderList')?>',
- type:'POST',
- dataType:'json',
- data:$('#orderSearch').serialize(),
- success:function(res){
- var html = '';
- var list=res.data['list'];
- for (var i = 0; i < list.length; i++) {
- var item = list[i];
- html += '<tr>';
- html += '<td class="orderId" orderId="'+item['orderId']+'">' + item['orderNo'] + '</td>';
- html += '<td>' + item['goodsName'] + '</td>';
- html += '<td>' + item['packageName'] + '</td>';
- html += '<td>' + item['gradeName'] + '</td>';
- html += '<td>' + item['quantity'] + '</td>';
- html += '<td>' + item['typeName'] + '</td>';
- html += '<td>' + item['sendNo'] + '</td>';
- html += '<td class="should">' + item['sendNo']*item['quantity'] + '</td>';
- html += '<td class="already">' + item['saleNo'] + '</td>';
- html += '<td><input type="text" name="outNo" class="outNo" value=""></td>';
- html += '</tr>';
- }
- //分页
- var pageHtml='<tr><td colspan="11" align="center">';
- lastPage=parseInt(res.data['lastPage']);
- if(lastPage){
- for(var i=1;i<=lastPage;i++){
- if(res.data['pageNum']==i){
- pageHtml+='<a href="#" class="activePage">'+i+'</a>';
- }else{
- pageHtml+='<a href="#" class="gotoPage page" rel="'+i+'">'+i+'</a>';
- }
- }
- }
- pageHtml+='</td></tr>';
- html+=pageHtml;
- $('.order-table tbody').html(html);
- }
- });
- }
- //保存
- $('.bth-s').click(function(){
- var outId='<?php echo $outId?>'
- var len=$('.outNo').length;
- var regu = /^[0-9]+$/;
- sendData=[];
- for(var i=0;i<len;i++) {
- if($('.outNo').eq(i).val()!==''){
- should=parseInt($('.outNo').eq(i).closest('tr').find('.should').html());
- already=parseInt($('.outNo').eq(i).closest('tr').find('.already').html());
- outNo=parseInt($('.outNo').eq(i).val());
- if (isNaN(outNo)) {
- layer.msg("请填写正确的数值")
- return false;
- }
- if(outNo>0){
- if(outNo>(should-already)){
- layer.msg("本次发放总数超过领用出库单剩余发放数")
- return false;
- }
- }else{
- if((already+outNo)<0){
- layer.msg("本次退回数不能超过剩余退回数")
- return false;
- }
- }
- sendData.push({orderId:$('.outNo').eq(i).closest('tr').find('.orderId').attr('orderId'),outNo:outNo});
- }
- }
- if(sendData.length>0){
- $('.bth-s').attr('disabled',true);
- $.ajax({
- url:'<?php echo $this->createUrl('imsStore/saveGrant')?>',
- type:'POST',
- data:{outId:outId,orders:sendData},
- dataType:'json',
- success:function(res){
- if(res.status==1){
- layer.msg('保存成功',{time: 1000, icon:6,end:function(){
- window.location.href='<?php echo $this->createUrl('imsStore/viewGrant',array('outId'=>$outId))?>';
- }});
- }else{
- if(res.msg!=undefined){
- layer.msg(res.msg);
- }else{
- layer.msg('提交失败');
- }
- }
- $('.bth-s').attr('disabled',false);
- }
- })
- }else{
- layer.msg("请填写本次发放数")
- }
- });
- })
- </script>
|