123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <title>销售订单</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/jquery.datetimepicker.css"/>
- <link rel="stylesheet" type="text/css" href="/css/ims/ace.min.css"/>
- <style>
- .green {
- color: green;
- }
- .red {
- color: red;
- }
- .ims-box {
- margin: 20px;
- }
- .screen > div {
- float: left;
- margin-right: 8px;
- }
- .screen .date > input {
- height: 30px;
- border-radius: 4px;
- border: 1px solid #ccc;
- box-shadow: none;
- text-indent: 10px;
- }
- .screen .purposeOrderNo > input {
- height: 30px;
- border-radius: 4px;
- border: 1px solid #ccc;
- box-shadow: none;
- text-indent: 10px;
- }
- .screen button {
- padding: 4px 12px;
- }
- .table-box {
- margin-top: 30px;
- }
- .btn-formal-order {
- cursor: pointer;
- }
- .application-number-box {
- margin-top: 50px;
- text-align: center;
- }
- .application-number-box span {
- margin-right: 20px;
- }
- .layui-layer-btn .layui-layer-btn0 {
- border-color: #2977ff !important;
- background-color: #2977ff !important;
- color: #fff;
- }
- .btn-date_show{
- display: inline-block;width: 170px;overflow: hidden; text-overflow:ellipsis; white-space: nowrap;
- }
- </style>
- </head>
- <body>
- <div class="ims-box">
- <form action="<?php echo Yii::app()->createUrl('imsSale/purposeTable'); ?>" method="get">
- <div class="screen">
- <div class="diy_select year">
- <input type="hidden" id="schoolYearId" name="schoolYearId" 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="">请选择学年</li>
- <?php if ($schoolYear): ?>
- <?php foreach ($schoolYear as $val): ?>
- <li val="<?php echo $val['schoolYearId'] ?>"><?php echo $val['schoolYearName'] ?></li>
- <?php endforeach; ?>
- <?php else: ?>
- <li val="">暂无学年</li>
- <?php endif; ?>
- </ul>
- </div>
- <div class="purposeOrderNo">
- <span>订单编号:</span>
- <input type="text" id="purposeOrderNo" name="purposeOrderNo" value="<?php echo isset($_GET['purposeOrderNo'])?$_GET['purposeOrderNo']:'' ;?>"/>
- </div>
- <div class="diy_select goods">
- <input type="hidden" id="goodsId" name="goodsId" 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;width:570px;">
- <li val="">请选择商品</li>
- <?php if ($goodList): ?>
- <?php foreach ($goodList as $good): ?>
- <li val="<?php echo $good['goodsId'] ?>"><?php echo $good['goodsName'] ?></li>
- <?php endforeach; ?>
- <?php else: ?>
- <li val="">暂无商品</li>
- <?php endif; ?>
- </ul>
- </div>
- <div class="date">
- <span>下单时间:</span>
- <input type="text" name="beginTime" class="some_class" value="" id="some_class_1"/> --
- <input type="text" name="endTime" class="some_class" value="" id="some_class_2"/>
- </div>
- <button type="submit" class="label-primary-s bth-s">查询</button>
- </div>
- </form>
- <div class="table-box">
- <table id="intention-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>
- <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><?php echo $item['goodsPackageName'];?></td>
- <td><?php echo $item['schoolYearName'];?></td>
- <td><?php echo $item['gradeText'];?></td>
- <td><a class="btn-date_show" href="#"><?php echo $item['userTime'];?></a></td>
- <td><?php echo $item['createTime'];?></td>
- <td><?php echo $item['quantity'];?></td>
- <td><?php echo $item['adjustNum'];?></td>
- <td><?php echo $item['applyOfficialNum'];?></td>
- <td><?php echo $item['officialNum'];?></td>
- <td><?php echo $item['surplusNumber'] > 0 ? '未满额':'已满额'; ?></td>
- <td><?php
- if(isset($item['isAllowTurn'])){
- echo $item['isAllowTurn'];
- }
- ?></td>
- <td>
- <?php
- if(isset($item['isAllowTurn'])){
- if($item['surplusNumber'] > 0 && $item['isAllowTurn']=='开启'){
- ?>
- <a href="<?php echo Yii::app()->createUrl('imsSale/FormalOrder?useGrade='.$item['gradeText'].'&schoolYear='.$item['schoolYear'].'&goodsTypeId=0&orderId='.$item['orderId'].'&orderNo='.$item['orderNo'].'&goodsName='.$item['goodsName'].'&grade='.$item['grade'].'&surplus='.$item['surplusNumber']);?>">转财务订单</a>
- <?php
- }
- }elseif($item['surplusNumber'] > 0){
- ?>
- <a href="<?php echo Yii::app()->createUrl('imsSale/FormalOrder?useGrade='.$item['gradeText'].'&schoolYear='.$item['schoolYear'].'&goodsTypeId=0&orderId='.$item['orderId'].'&orderNo='.$item['orderNo'].'&goodsName='.$item['goodsName'].'&grade='.$item['grade'].'&surplus='.$item['surplusNumber']);?>">转财务订单</a>
- <?php
- }
- ?>
- <a href="<?php echo $this->createUrl('imsSale/pushList?orderId='.$item['orderId']) ?>"> 推送名单</a>
- </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['schoolYearId']) && $_GET['schoolYearId']) {
- $params['schoolYearId'] = $_GET['schoolYearId'];
- }
- if (isset($_GET['purposeOrderNo']) && $_GET['purposeOrderNo']) {
- $params['purposeOrderNo'] = $_GET['purposeOrderNo'];
- }
- if (isset($_GET['goodsId']) && $_GET['goodsId']) {
- $params['goodsId'] = $_GET['goodsId'];
- }
- if (isset($_GET['some_class_1']) && $_GET['some_class_1']) {
- $params['beginTime'] = $_GET['some_class_1'];
- }
- if (isset($_GET['some_class_2']) && $_GET['some_class_2']) {
- $params['endTime'] = $_GET['some_class_2'];
- }
- if (isset($_GET['page'])) {
- $params['page'] = $_GET['page'];
- }else{
- $params['page'] = 1;
- }
- echo formatPage($page, 'imsSale/purposeTable', $params);
- ?>
- </ul>
- </div>
- <?php endif; ?>
- </div>
- </div>
- <script src="/js/productset/jquery.min.js"></script>
- <script src="/js/ims/jquery.datetimepicker.js"></script>
- <script src="/js/ims/xsgl.js"></script>
- <script src="/js/layer/layer.js"></script>
- <script>
- $(document).ready(function () {
- //筛选条件赋值
- <?php if(isset($_GET['beginTime'])):?>
- $("#some_class_1").attr("value","<?php echo $_GET['beginTime']?>");
- $("#some_class_2").attr("value", "<?php echo $_GET['endTime']?>");
- <?php endif;?>
- <?php if(isset($_GET['goodsId']) && $_GET['goodsId']):?>
- var goodsId = "<?php echo $_GET['goodsId'];?>";
- $('#goodsId').val(goodsId);
- var txt = $('.goods li[val='+goodsId+']').html();
- $('.goods .diy_select_txt').html(txt);
- <?php endif;?>
- <?php if(isset($_GET['schoolYearId']) && $_GET['schoolYearId']):?>
- var schoolYearId = "<?php echo $_GET['schoolYearId'];?>";
- $('#schoolYearId').val(schoolYearId);
- var txt = $('.year li[val='+schoolYearId+']').html();
- $('.year .diy_select_txt').html(txt);
- <?php endif;?>
- $('.some_class').datetimepicker({
- format: "Y-m-d", //格式化日期
- timepicker: false //关闭时间选项
- });
- $(".btn-date_show").on("click", function () {
- layer.alert($(this).text(), {
- title: '使用月份',
- area: ['420px', '240px']
- });
- });
- $(".btn-formal-order").on("click", function () {
- var quantity= parseInt($(this).attr('a1'));
- var adjustNum = parseInt($(this).attr('a2'));
- var applyOfficialNum = parseInt($(this).attr('a3'));
- var officialNum2 = parseInt($(this).attr('a4'));
- var orderId = $(this).attr('orderId');
- var flag = true;
- layer.open({
- type: 1,
- title: '转财务订单',
- btn: ['确定', '取消'],
- area: ['420px', '240px'], //宽高
- btnAlign: 'c',
- content: '<div class="application-number-box"><p style="color: red;display: none;" class="alert-msg"></p><span>申请人数</span> <input type="number" id="applicationNumber" ></div>',
- yes: function (index, layero) {
- //提交
- var officialNum =$('#applicationNumber').val();
- if (officialNum>0) {
- if((officialNum>(quantity+adjustNum-applyOfficialNum-officialNum2))){
- $('.alert-msg').html("填写数额超出额度").fadeIn();
- }else{
- if (flag){
- flag = false;
- $.ajax({
- type: 'post',
- url: "<?php echo Yii::app()->createUrl('imsSale/toOfficial') ;?>",
- data: {'orderId':orderId, 'officialNum':officialNum},
- dataType: 'json',
- success: function (data) {
- if (data.status){
- location.reload();
- } else{
- flag = true;
- layer.msg(data.msg);
- }
- },
- error: function () {
- flag = true;
- layer.msg("异常错误");
- }
- });
- }
- }
- }else{
- layer.msg("请填写数量");
- }
- },
- btn2: function (index, layero) {
- //return false 开启该代码可禁止点击该按钮关闭
- }
- });
- return false;
- });
- });
- $('body').on('focus', '#applicationNumber', function () {
- $('.alert-msg').css("display",'none');
- });
- </script>
- </body>
- </html>
|