123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416 |
- <!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/delivery'); ?>" 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>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- <?php if (isset($pmDataList['list']) && $pmDataList['list']): ?>
- <?php foreach ($pmDataList['list'] as $key => $value): ?>
- <?php
- if (isset($value['outputDetails']) && isset($value['outputDetails'][0])) {
- $outputDetails = $value['outputDetails'][0];
- }
- ?>
- <tr>
- <td><?php echo $value['outCode']; ?></td>
- <td><?php echo isset($outputDetails['itemName']) ? $outputDetails['itemName'] : ''; ?></td>
- <td><?php echo isset($outputDetails['itemSpec']) ? $outputDetails['itemSpec'] : ''; ?></td>
- <td><?php echo isset($outputDetails['no']) ? $outputDetails['no'] : ''; ?></td>
- <td><?php echo date('Y/m/d', strtotime($value['outDate'])); ?></td>
- <td><?php echo $value['studentNo']; ?></td>
- <td class="blue"><?php echo isset($value['orderNo']) ? $value['orderNo'] : '-'; ?></td>
- <?php if ($value['isUse'] == 1):?>
- <td class="green">已领用</td>
- <td>
- <a href="<?php echo $this->createUrl('imsStore/deliveryView', array('outId' => $value['outId'])); ?>">查看</a>
- <?php if(isset($value['isSign']) && $value['isSign']):?>
- <a href="<?php echo $this->createUrl('imsStore/sign', array('outId' => $value['outId'])); ?>" class="sign-btn" outId="<?php echo $value['outId'] ?>">已签字</a>
- <?php endif;?>
- </td>
- <?php else: ?>
- <td class="red">未领用</td>
- <td>
- <?php if(isset($value['isSign']) && $value['isSign']):?>
- <a href="<?php echo $this->createUrl('imsStore/sign', array('outId' => $value['outId'])); ?>" class="sign-btn" outId="<?php echo $value['outId'] ?>">已签字</a>
- <?php else:?>
- <a href="javascript:;" class="signed-btn" url="<?php echo Yii::app()->params['qrcode'].'/#/signclazz?outId='.$value['outId'];?>">签字</a>
- <a href="<?php echo $this->createUrl('imsStore/deliveryEdit', array('outId' => $value['outId'])); ?>">编辑</a>
- <?php endif;?>
- <a href="javascript:;" class="del-btn" outId="<?php echo $value['outId'] ?>">删除</a>
- <a href="javascript:;" class="send-btn" isSign="<?php echo isset($value['isSign'])?$value['isSign']:0;?>" outId="<?php echo $value['outId'] ?>">确认出库</a>
- </td>
- <?php endif; ?>
- </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/delivery', $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>
- <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);
- }
- //增加出库dan
- $(".add_out_order").click(function () {
- var url = window.location.href = "<?php echo $this->createUrl('imsStore/deliveryAdd');?>";
- });
- //确认出库
- $(".send-btn").on("click", function () {
- var isSign = $(this).attr('isSign');
- if(isSign <= 0){
- layer.alert("请先完成签字,在确认出库");
- return false;
- }
- var outId = $(this).attr('outId');
- layer.open({
- type: 1,
- title: '确认出库后',
- btn: ['确定', '取消'],
- area: ['420px', '240px'], //宽高
- btnAlign: 'c',
- content: '<div class="application-number-box" style="padding-left:120px;text-align: left;color: red;"><p>1、库存量根据出库数量进行核减</p><p>2、领用的学生记录为已发货</p><p>确认要出库吗?</p></div>',
- yes: function (index, layero) {
- //提交
- $.ajax({
- type: 'post',
- url: "<?php echo Yii::app()->createUrl('imsStore/ajaxUseOut');?>",
- data: {'outId': outId},
- 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;
- });
- //删除
- $(".del-btn").on("click", function () {
- var outId = $(this).attr('outId');
- layer.confirm('您确定删除吗?', {
- btn: ['确定', '取消'] //按钮
- }, function () {
- $.ajax({
- type: 'post',
- url: "<?php echo Yii::app()->createUrl('imsStore/ajaxDelOut');?>",
- data: {'outId': outId},
- 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("网络异常");
- }
- })
- });
- });
- //生成二维码
- $(".signed-btn").click(function () {
- var url = $(this).attr('url');
- $("#qrcode").html('');
- if(!url){
- layer.msg("没有地址");
- return false;
- }
- var qrcode = new QRCode(document.getElementById("qrcode"), {
- width : 100,
- height : 100
- });
- qrcode.makeCode(url);
- $(".qrcode-fram img").on('load',function(){
- layer.open({
- type: 1,
- title: '签字二维码',
- btn: ['关闭'],
- area: ['340px', '240px'], //宽高
- btnAlign: 'c',
- content: '<div style="text-align:center;"><div id="imsCode">'+$("#qrcode").html()+'</div><p style="font-size: 12px">手机扫描二维码,到手机浏览器打开签字链接</p></div>',
- 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');
- });
- })
- </script>
- </body>
- </html>
|