123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480 |
- <!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/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 > span {
- line-height: 30px;
- margin-right: 5px;
- }
- .screen .date > 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;
- }
- .stop-layer-box, .resubmit-layer-box, .delete-layer-box {
- line-height: 140px;
- text-align: center;
- }
- .qrcode-fram{display:none;}
- #imsCode img{display:inline-block!important;margin:10px 0;}
- #qrcode{display:inline-block;}
- .use-out{margin:20px; border-bottom:1px solid #ccc;}
- .use-out a{line-height:30px;padding:0 50px;margin-right:20px;font-size:16px;color:#333;}
- .use-out a.active{color:#2977ff;border-bottom:3px solid #2977ff}
- .table-box table th,.table-box td{text-align:center;}
- .page-div{text-align:right;}
- .page-div a{display:inline-block;width:20px;height:20px;text-align:center;line-height:20px;background:#999;color:#fff;cursor:pointer;}
- .page-div a:hover{background:#666;}
- .page-div span{margin:0 10px;}
- .layui-layer-page .layui-layer-content{overflow-x:hidden;}
- .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;}
- </style>
- </head>
- <body>
- <div class="use-out clearfix">
- <a class="<?php echo ($useOutType == 'use')?'active':'';?> fl" href="javascript:;" type="use">销售出库</a>
- <a href="javascript:;" class="<?php echo ($useOutType == 'out')?'active':'';?> fl" type="out">销售退库</a>
- </div>
- <div class="ims-box">
- <form action="<?php echo Yii::app()->createUrl('imsStore/deliveryOut'); ?>" method="get">
- <div class="screen clearfix">
- <div class="diy_select select-isUse">
- <input type="hidden" id="isUse" name="isUse" class="diy_select_input" value="0">
- <div class="diy_select_txt pm_status_txt">请选择状态</div>
- <div class="diy_select_btn"></div>
- <ul class="diy_select_list pm_status" style="display: none;">
- <li val="0">请选择状态</li>
- <li val="1">待确认</li>
- <li val="2">已确认</li>
- </ul>
- </div>
- <div class="diy_select select-itemId">
- <input type="hidden" id="itemId" name="itemId" class="diy_select_input" value="0">
- <div class="diy_select_txt pm_name_txt">请选择品目名称</div>
- <div class="diy_select_btn"></div>
- <ul class="diy_select_list pm_name" style="display: none;">
- <li val="0">请选择品目名称</li>
- <?php foreach ($itemList as $key => $value): ?>
- <li val="<?php echo $value['itemId']; ?>"><?php echo $value['itemName']; ?></li>
- <?php endforeach; ?>
- </ul>
- </div>
- <div class="date">
- <span>发货时间:</span>
- <input type="text" readonly name="startDate" class="some_class" value="" id="some_class_1"/> --
- <input type="text" readonly name="endDate" class="some_class" value="" id="some_class_2"/>
- </div>
- <button type="submit" class="label-primary-s bth-s">搜索</button>
- <!-- <button type="button" class="label-primary-s bth-s add_out_order">新增退库单</button>-->
- </div>
- </form>
- <div class="table-box ">
- <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>
- </tr>
- </thead>
- <tbody>
- <?php if (isset($pmDataList['list']) && $pmDataList['list']): ?>
- <?php foreach ($pmDataList['list'] as $key => $value): ?>
- <?php
- if (isset($value['inputDetails']) && isset($value['inputDetails'][0])) {
- $inputDetails = $value['inputDetails'][0];
- }
- ?>
- <tr>
- <td><?php echo $value['inCode']; ?></td>
- <td><?php echo isset($inputDetails['itemName']) ? $inputDetails['itemName'] : ''; ?></td>
- <td><?php echo isset($inputDetails['arriveNo']) ? $inputDetails['arriveNo'] : ''; ?></td>
- <td><a href="#" inId="<?php echo $value['inId'] ?>" class="viewStudent"><?php echo isset($inputDetails['arriveNo']) ? $inputDetails['arriveNo'] : ''; ?></a></td>
- <td><?php echo isset($value['oraNo']) ? $value['oraNo'] : '-'; ?></td>
- <td><?php echo isset($value['orderNo']) ? $value['orderNo'] : '-'; ?></td>
- <td class="red"><?php echo isset($value['statusDesc'])? $value['statusDesc'] : '-'?></td>
- <td>
- <?php if($value['inputStatus']==0):?>
- <!-- <a href="--><?php //echo $this->createUrl('imsStore/deliveryOutView', array('inId' => $value['inId'])); ?><!--" class="get-btn" inId="--><?php //echo $value['inId'] ?><!--">查看</a>-->
- <a href="javascript:;" class="send-btn" inId="<?php echo $value['inId'] ?>">确认退库</a>
- <?php endif; ?>
- </td>
- </tr>
- <?php endforeach; ?>
- <?php endif; ?>
- </tbody>
- </table>
- <?php if ($pmDataList): ?>
- <div class="col-sm-12">
- <ul class="pagination">
- <?php
- $params = array();
- if (isset($_GET['isUse']) && $_GET['isUse']) {
- $params['isUse'] = $_GET['isUse'];
- }
- if (isset($_GET['itemId']) && $_GET['itemId']) {
- $params['itemId'] = $_GET['itemId'];
- }
- if (isset($_GET['startDate']) && $_GET['startDate']) {
- $params['startDate'] = $_GET['startDate'];
- }
- if (isset($_GET['endDate']) && $_GET['endDate']) {
- $params['endDate'] = $_GET['endDate'];
- }
- if (isset($_GET['page'])) {
- $params['page'] = $_GET['page'];
- } else {
- $params['page'] = 1;
- }
- echo formatPage($pmDataList, 'imsStore/deliveryout', $params);
- ?>
- </ul>
- </div>
- <?php endif; ?>
- </div>
- </div>
- <!--二维码-->
- <div class="qrcode-fram" style="display: none">
- <div id="qrcode" style="width:100px; height:100px;margin: 10px auto"></div>
- <p>手机扫描二维码,到手机浏览器打开签字链接</p>
- </div>
- <!-- 关联正式订单弹层 -->
- <div class="layer-relate" style="display: none">
- <div class="layer-filter"></div>
- <table class="order-table table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable"
- style="font-size:12px">
- <thead>
- <tr>
- <th>班级</th>
- <th>学生姓名</th>
- </tr>
- </thead>
- <tbody>
- </tbody>
- </table>
- <div class="col-sm-12">
- <a href="#" class="prev">上一页</a>
- <span class="now_page">1</span>/<span class="last_page">1</span>
- <a href="#" class="next">下一页</a>
- <input type="hidden" name="inId" value="0">
- </div>
- </div>
- <script src="/js/productset/jquery.min.js"></script>
- <script src="/js/ims/jquery.datetimepicker.js"></script>
- <script src="/js/layer/layer.js"></script>
- <script src="/js/ims/xsgl.js"></script>
- <script type="text/javascript" src="/js/ims/qrcode.min.js"></script>
- <script>
- $(document).ready(function () {
- <?php if (isset($_GET['startDate'])):?>
- $("#some_class_1").attr("value", "<?php echo $_GET['startDate']?>");
- $("#some_class_2").attr("value", "<?php echo $_GET['endDate']?>");
- <?php endif;?>
- <?php if(isset($_GET['isUse'])):?>
- var isUse = "<?php echo $_GET['isUse'];?>";
- $('#isUse').val(isUse);
- var txt = $('.select-isUse li[val=' + isUse + ']').html();
- $('.select-isUse .diy_select_txt').html(txt);
- <?php endif;?>
- <?php if(isset($_GET['itemId']) && $_GET['itemId'] != ''):?>
- var itemId = "<?php echo $_GET['itemId'];?>";
- $('#itemId').val(itemId);
- var txt = $('.select-itemId li[val=' + itemId + ']').html();
- $('.select-itemId .diy_select_txt').html(txt);
- <?php endif;?>
- $('.some_class').datetimepicker({
- format: "Y-m-d", //格式化日期
- timepicker: false //关闭时间选项
- });
- //初始化状态
- var currStatus = "<?php echo isset($_GET['status']) ? $_GET['status'] : '';?>";
- if (currStatus > 0) {
- var statusText = $(".pm_status>li[val='" + currStatus + "']").text();
- $(".pm_status_txt").text(statusText);
- }
- //初始化品目
- var currPmId = "<?php echo isset($_GET['itemId']) ? $_GET['itemId'] : '';?>";
- if (currPmId > 0) {
- var pmNameText = $(".pm_name>li[val='" + currPmId + "']").text();
- $(".pm_name_txt").text(pmNameText);
- }
- //确认退库
- $(".send-btn").on("click", function () {
- var inId = $(this).attr('inId');
- layer.open({
- type: 1,
- title: '确认退库',
- btn: ['确定', '取消'],
- area: ['420px', '240px'], //宽高
- btnAlign: 'c',
- content: '<div class="application-number-box" style="text-align: center;color: red;"><p>确认要退库吗?</p></div>',
- yes: function (index, layero) {
- //提交
- $.ajax({
- type: 'post',
- url: "<?php echo Yii::app()->createUrl('imsStore/SubmitSale');?>",
- data: {'inId': inId},
- dataType: 'json',
- success: function (data) {
- if (data.status) {
- layer.alert("确认成功", {icon:1,closeBtn:0},function () {
- location.reload();
- })
- } else {
- layer.msg(data.msg);
- }
- }
- })
- },
- btn2: function (index, layero) {
- //取消按钮
- // console.log(111)
- //return false 开启该代码可禁止点击该按钮关闭
- }
- });
- return false;
- });
- //切换领用和出库
- $(".use-out>a").click(function () {
- $(this).addClass("active").siblings().removeClass("active");
- var index = $(this).index();
- var type = $(this).attr('type');
- var url = '';
- if(type == 'out'){
- url = "<?php echo $this->createUrl('imsStore/DeliveryOut');?>";
- }else{
- url = "<?php echo $this->createUrl('/imsStore/Delivery');?>";
- }
- window.location.href = url;
- // $(".ims-box").eq(index).removeClass('hidden').siblings(".ims-box").addClass('hidden');
- });
- //学生列表
- $(".viewStudent").on("click", function () {
- var inId = $(this).attr('inId');
- loadStudent(inId,1);
- return false;
- });
- });
- var displayAlert = true;
- function loadStudent(inId,page){
- $('.layer-relate').find('tbody').html('');
- $('input[name=inId]').val(inId);
- $.ajax({
- type: 'post',
- url: "<?php echo Yii::app()->createUrl('imsStore/AjaxSaleStudentList');?>",
- data: {'inId': inId,'page':page},
- dataType: 'json',
- success: function (res) {
- if(res.status==1){
- list=res.data.list;
- if(list.length>0){
- var html='';
- for(var i=0;i<list.length;i++){
- html+='<tr>';
- html+='<td>'+list[i]['clazzName']+'</td>';
- html+='<td>'+list[i]['studentName']+'</td>';
- html+='</tr>';
- }
- $('.layer-relate').find('tbody').html(html);
- }
- $('.last_page').html(res.data['lastPage']);
- $('.now_page').html(res.data['pageNum']);
- if(page==1 || res.data['lastPage'] == 1){
- $('.prev').addClass('hide');
- }else{
- $('.prev').removeClass('hide');
- }
- if(page==res.data['lastPage']){
- $('.next').addClass('hide');
- }else{
- $('.next').removeClass('hide');
- }
- if(displayAlert){
- displayAlert = false;
- layer.open({
- type: 1,
- title: '学生列表',
- btn: ['关闭'],
- page:true,
- area: ['810px', '420px'], //宽高
- btnAlign: 'c',
- content: $('.layer-relate'),
- yes: function (index, layero) {
- layer.closeAll();
- displayAlert = true;
- }
- });
- }
- }
- }
- });
- $('.prev').click(function(){
- var now_page=parseInt($('.now_page').html());
- if(now_page<=1){
- return false;
- }
- var idId=$('input[name=inId]').val();
- loadStudent(idId,(now_page-1));
- });
- // $('.next').click(function(){
- // var now_page=parseInt($('.now_page').html());
- // var last_page=parseInt($('.last_page').html());
- // if(now_page>=last_page){
- // return false;
- // }
- // var idId=$('input[name=inId]').val();
- // loadStudent(idId,(now_page+1));
- // });
- $('.prev').off("click").on('click',function(){
- var now_page=parseInt($('.now_page').html());
- if(now_page<=1){
- return false;
- }
- var idId=$('input[name=inId]').val();
- loadStudent(idId,(now_page-1));
- })
- $('.next').off("click").on('click',function(){
- var now_page=parseInt($('.now_page').html());
- var last_page=parseInt($('.last_page').html());
- if(now_page>=last_page){
- return false;
- }
- var idId=$('input[name=inId]').val();
- loadStudent(idId,(now_page+1));
- })
- }
- //增加出库dan
- $(".add_out_order").click(function () {
- var url = window.location.href = "<?php echo $this->createUrl('imsStore/deliveryOutAdd');?>";
- });
- //删除
- $(".del-btn").on("click", function () {
- var inId = $(this).attr('inId');
- layer.confirm('您确定删除吗?', {
- btn: ['确定', '取消'] //按钮
- }, function () {
- $.ajax({
- type: 'post',
- url: "<?php echo Yii::app()->createUrl('imsStore/ajaxDelIn');?>",
- data: {'inId': inId},
- 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("网络异常");
- }
- })
- });
- });
- </script>
- </body>
- </html>
|