123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528 |
- <!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/ace.min.css"/>
- <style>
- .red {
- color: red;
- }
- .yellow {
- color: #FF9900;
- }
- .ims-box {
- margin: 20px;
- }
- .screen > div {
- margin-right: 5px;
- }
- .screen button {
- padding: 4px 12px;
- }
- .table-box {
- margin-top: 30px;
- }
- .table-box table,
- .table-box table th {
- text-align: center;
- }
- .table-box button {
- margin-right: 5px;
- }
- .stop-layer-box, .resubmit-layer-box, .delete-layer-box {
- line-height: 140px;
- text-align: center;
- }
- .resubmit-layer-box input {
- line-height: 20px;
- }
- .urge-layer-box {
- margin-top: 30px;
- margin-left: 30px;
- }
- .urge-layer-box textarea {
- margin-left: 15px;
- vertical-align: top;
- }
- .alert-msg {
- text-align: center;
- vertical-align: top;
- }
- </style>
- </head>
- <body>
- <div class="ims-box">
- <form action="<?php echo Yii::app()->createUrl('imsSale/officialTable'); ?>" method="get">
- <div class="screen">
- <div class="diy_select 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="0">请选择商品</li>
- <?php if ($goodList): ?>
- <?php foreach ($goodList as $item): ?>
- <li val="<?php echo $item['goodsId'] ?>"><?php echo $item['goodsName'] ?></li>
- <?php endforeach; ?>
- <?php else: ?>
- <li val="0">暂无商品</li>
- <?php endif; ?>
- </ul>
- </div>
- <div class="diy_select select-package">
- <input type="hidden" id="packageId" name="packageId" 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>
- </ul>
- </div>
- <div class="diy_select select-status">
- <input type="hidden" id="status" name="status" 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 foreach ($applyStatus as $as): ?>
- <li val="<?php echo ($as['dictCode']+1); ?>"><?php echo $as['name']; ?></li>
- <?php endforeach; ?>
- </ul>
- </div>
- <div class="diy_select select-orderType">
- <input type="hidden" id="orderType" name="orderType" 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>
- <li val="1">线上订单</li>
- <li val="2">线下订单</li>
- </ul>
- </div>
- <button type="submit" class="label-primary-s bth-s">查询</button>
- </div>
- </form>
- <div class="table-box">
- <table id="formalOrderTable"
- 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>
- -->
- <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 id="<?php echo $item['orderId']; ?>">
- <td><?php echo $item['orderNo']; ?></td>
- <td><?php echo $item['orderTypeName']; ?></td>
- <td><?php echo $item['goodsName']; ?></td>
- <td><?php echo $item['goodsPackageName']; ?></td>
- <td><?php echo isset($item['gradeText'])?$item['gradeText']:'';?></td>
- <td><?php echo isset($item['useTime'])?$item['useTime'].'月':'';?></td>
- <td><?php echo $item['createTime']; ?></td>
- <td>
- <?php if($item['orderType'] == 1){?>
- <a href="<?php echo Yii::app()->createUrl('imsSale/purposeTable',array('purposeOrderNo'=>$item['purposeOrderNo']))?>">
- <?php echo $item['purposeOrderNo']; ?>
- </a>
- <?php } else { ?>
- <?php echo $item['purposeOrderNo']; ?>
- <?php } ?>
- </td>
- <td><?php echo $item['quantity']; ?></td>
- <!-- <td><?php echo $item['refundNum']; ?></td>
- <td><?php echo $item['orderedNum']; ?></td>
- <td><?php echo $item['quantity'] - $item['orderedNum']-$item['refundNum']; ?></td>-->
- <td><?php if(isset($item['refundNum'])) echo $item['refundNum'];?></td>
- <td><?php if(isset($item['refundCheckNum'])) echo $item['refundCheckNum'];?></td>
- <td class="subject-type"
- status="<?php echo $item['status']; ?>"><?php echo $item['statusName']; ?></td>
- <td businessKey="<?php if(isset($item['processInfo'])) echo $item['processInfo']['businessKey']; ?>">
- <?php if ($item['status']!=1): ?>
- <a href="<?php echo $this->createUrl('imsSale/viewTurnOrder?orderId='.$item['orderId'].'&quantity='.$item['quantity'].'&orderNo='.$item['orderNo'].'&goodsName='.$item['goodsName'].'&gradeText='.$item['gradeText'].'&surplus='.($item['quantity'] - $item['orderedNum']-$item['refundNum']))?>" class="btn-view">查看</a>
- <?php endif; ?>
- <?php if (isset($item['processInfo']) && $item['processInfo']['showUrge']): ?>
- <a href="#" class="btn-urge">催办</a>
- <?php endif; ?>
- <?php if (isset($item['processInfo']) && $item['processInfo']['showStop']): ?>
- <a href="#" class="btn-stop">取消</a>
- <?php endif; ?>
- <?php if (isset($item['processInfo']) && $item['processInfo']['showDelete']): ?>
- <a href="#" class="btn-delete">删除</a>
- <?php endif; ?>
- <?php if (($item['status'] == 1 && ($item['quantity'] - $item['orderedNum']-$item['refundNum']) == 0) || ($item['status'] == 8 && $item['orderType'] == 0)): ?>
- <a href="<?php echo Yii::app()->createUrl('imsSale/detailOrder',array('orderNo'=>$item['orderNo']));?>" class="btn-review">查看明细订单</a>
- <?php endif; ?>
- <?php if ($item['status'] == 1 && $item['orderType'] == 1 && ($item['quantity'] - $item['orderedNum']-$item['refundNum']) > 0): ?>
- <a href="<?php echo Yii::app()->createUrl('imsSale/orderOfficial', array('orderId' => $item['orderId'], 'remainNum' => $item['quantity'] - $item['orderedNum'])); ?>"
- class="btn-order">订购</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['goodsId']) && $_GET['goodsId']) {
- $params['goodsId'] = $_GET['goodsId'];
- }
- if (isset($_GET['packageId']) && $_GET['packageId']) {
- $params['packageId'] = $_GET['packageId'];
- }
- if (isset($_GET['status']) && $_GET['status']>0) {
- $params['status'] = $_GET['status'];
- }
- if (isset($_GET['orderType']) && $_GET['orderType']>0) {
- $params['orderType'] = $_GET['orderType'];
- }
- if (isset($_GET['page'])) {
- $params['page'] = $_GET['page'];
- }else{
- $params['page'] = 1;
- }
- echo formatPage($page, 'imsSale/officialTable', $params)
- ?>
- </ul>
- </div>
- <?php endif; ?>
- </div>
- </div>
- <script src="/js/productset/jquery.min.js"></script>
- <script src="/js/ims/layer/layer.js"></script>
- <script src="/js/ims/xsgl.js"></script>
- <script>
- $(document).ready(function () {
- function studentType() {
- $(".student-type").each(function (index) {
- if ($(this).attr('status') == 1) {
- $(this).addClass("green");
- } else {
- $(this).addClass("red");
- }
- })
- }
- 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");
- }
- })
- }
- studentType();
- setSubjectType();
- //筛选条件赋值
- <?php if(isset($_GET['goodsId']) && $_GET['goodsId']>0):?>
- var goodsId = "<?php echo $_GET['goodsId'];?>";
- $('#goodsId').val(goodsId);
- var txt = $('.select-goods li[val=' + goodsId + ']').html();
- $('.select-goods .diy_select_txt').html(txt);
- getPackage(goodsId);
- <?php endif;?>
- <?php if(isset($_GET['status']) && $_GET['status']>0):?>
- var status = "<?php echo $_GET['status'];?>";
- $('#status').val(status);
- var txt = $('.select-status li[val=' + status + ']').html();
- $('.select-status .diy_select_txt').html(txt);
- <?php endif;?>
- <?php if(isset($_GET['orderType']) && $_GET['orderType']>0):?>
- var orderType = "<?php echo $_GET['orderType'];?>";
- $('#orderType').val(orderType);
- var txt = $('.select-orderType li[val=' + orderType + ']').html();
- $('.select-orderType .diy_select_txt').html(txt);
- <?php endif;?>
- //获取套餐
- $('.select-goods li').click(function () {
- var goodsId = $('#goodsId').val();
- var currentGoodsId = $(this).attr('val');
- if (currentGoodsId > 0 && currentGoodsId != goodsId) {
- getPackage(currentGoodsId);
- }else{
- $('.select-package .diy_select_txt').val("请选择套餐");
- $('#packageId').val(0);
- $('.select-package ul').html('<li val="0">请选择套餐</li>');
- }
- });
- function getPackage(goodsId) {
- $.ajax({
- type: 'post',
- url: "<?php echo Yii::app()->createUrl('imsSale/getPackages');?>",
- data: {goodsId: goodsId},
- 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['packageId']) {
- html += '<li val="' + item['packageId'] + '">';
- html += item['packageName'];
- html += '</li>'
- }
- }
- } else {
- var html = '<li val="0">暂无套餐</li>';
- }
- $('.select-package ul').html(html);
- <?php if(isset($_GET['packageId'])):?>
- var packageId = "<?php echo $_GET['packageId'];?>";
- $('#packageId').val(packageId);
- var txt = $('.select-package li[val=' + packageId + ']').html();
- $('.select-package .diy_select_txt').html(txt);
- <?php endif;?>
- },
- error: function () {
- return;
- }
- })
- }
- //催办
- $(".table-box").on("click", ".btn-urge", function () {
- // var $(this)
- var flag = true;
- var businessKey = $(this).parent().attr('businessKey');
- layer.open({
- type: 1,
- title: '催办',
- btn: ['确定', '取消'],
- area: ['600px', '400px'], //宽高
- btnAlign: 'c',
- content: '<p style="color: red;display: none;" class="alert-msg"></p><div class="urge-layer-box"><span>内容:</span><textarea rows="10" cols="60" id="urgeText" /></div>',
- yes: function (index, layero) {
- //提交
- var text = $('#urgeText').val();
- var data = {
- 'smeDesc': text,
- 'businessKey': businessKey
- };
- if ($.trim(text)) {
- if (flag) {
- flag = false;
- $.ajax({
- type: 'post',
- url: "<?php echo Yii::app()->createUrl('imsSale/urge');?>",
- data: data,
- dataType: 'json',
- success: function (data) {
- if (data.status) {
- layer.closeAll();
- location.reload();
- } else {
- flag = true;
- $('.alert-msg').html(data.msg).fadeIn();
- }
- },
- error: function () {
- flag = true;
- $('.alert-msg').html("异常错误").fadeIn();
- }
- });
- }
- } else {
- $('.alert-msg').html("请填写内容").fadeIn();
- }
- },
- btn2: function (index, layero) {
- //取消按钮
- console.log(111)
- //return false 开启该代码可禁止点击该按钮关闭
- }
- });
- });
- //取消
- $(".table-box").on("click", ".btn-stop", 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.alert(data.msg, {icon: 7});
- }
- },
- error: function () {
- layer.msg("网络异常");
- }
- });
- });
- });
- //重新提交
- $(".table-box").on("click", ".btn-reset", function () {
- // var $(this)
- var quantity = $(this).attr('quantity');
- var orderedNum = $(this).attr('orderedNum');
- var orderId = $(this).attr('orderId');
- var flag = true;
- layer.open({
- type: 1,
- title: '重新提交',
- btn: ['确定', '取消'],
- area: ['420px', '240px'], //宽高
- btnAlign: 'c',
- content: '<p style="color: red;" class="alert-msg"></p><div class="resubmit-layer-box"><span>申请人数</span> <input type="number" id="resubmitNumber" ></div>',
- yes: function (index, layero) {
- //提交
- var officialNum = $('#resubmitNumber').val();
- if (officialNum > 0) {
- if (flag) {
- flag = false;
- $.ajax({
- type: 'post',
- url: "<?php echo Yii::app()->createUrl('imsSale/reToOfficial');?>",
- data: {'orderId': orderId, 'officialNum': officialNum},
- dataType: 'json',
- success: function (data) {
- if (data.status) {
- layer.closeAll();
- location.reload();
- } else {
- flag = true;
- $('.alert-msg').html(data.msg).fadeIn();
- }
- },
- error: function () {
- flag = true;
- $('.alert-msg').html("异常错误").fadeIn();
- }
- });
- }
- } else {
- $('.alert-msg').html("请填写数量").fadeIn();
- }
- },
- btn2: function (index, layero) {
- //取消按钮
- console.log(111)
- //return false 开启该代码可禁止点击该按钮关闭
- }
- });
- });
- //删除
- $(".table-box").on("click", ".btn-delete", 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("网络异常");
- }
- });
- });
- });
- $('body').on('focus', 'textarea', function () {
- $('.alert-msg').css("display", 'none');
- });
- $('body').on('focus', 'input', function () {
- $('.alert-msg').css("display", 'none');
- });
- });
- </script>
- </body>
- </html>
|