123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>新增出库单</title>
- <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>
- .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;}
- </style>
- </head>
- <body>
- <h3 class="sale-title">学管领用出库单</h3>
- <input type="hidden" name="oldOrderId" id="oldOrderId" value="0">
- <div class="sale-table">
- <table width="100%">
- <tr>
- <th><em class="red">*</em>出库单标题</th>
- <td colspan="3"><input type="text" readonly style="width:100%;" placeholder="请输入标题" name="outTitle" value="<?php echo $schoolName.'-'.$coachName.'的出库单';?>"></td>
- </tr>
- <tr>
- <th><em class="red">*</em>领用日期</th>
- <td>
- <input id="outTimet" readonly type="text" style="width:100%;" placeholder="请输入出库日期" name="out_date" value="">
- </td>
- </tr>
- <tr>
- <th>领用人</th>
- <td><?php echo $coachName;?></td>
- </tr>
- <tr>
- <th><em class="red">*</em>领用品目类型</th>
- <td><input type="radio" name="itemType" value="2" <?php if($itemType == 2)echo "checked='checked'";?>>产成品<input type="radio" name="itemType" value="3" style="margin-left: 60px;" <?php if($itemType == 3)echo "checked='checked'";?>>低值易耗品</td>
- </tr>
- <tr>
- <th>领用说明</th>
- <td>
- <textarea rows="5" cols="50" class="use-explain"><?php echo isset($pmData['remark'])?$pmData['remark']:'';?></textarea>
- </td>
- </tr>
- </table>
- <div> </div>
- <div style="margin-bottom:5px; font-size:18px;">选择品目</div>
- <table width="100%" class="table-center">
- <tr>
- <th>品目名称</th>
- <th>可用库存数量</th>
- <th>出库数量</th>
- <th>单位</th>
- <?php if($itemType==3):?>
- <th>低耗使用设备</th>
- <?php endif;?>
- <th>操作</th>
- </tr>
- <tr>
- <td>
- <div class="diy_select" style="width: 240px;">
- <input type="hidden" id="itemId" name="typeId" class="diy_select_input" value="0">
- <input type="hidden" id="typeId" name="typeId" class="diy_select_input" value="0">
- <div class="diy_select_txt pm_name_txt" style="width: 200px;">请选择</div>
- <div class="diy_select_btn"></div>
- <ul class="diy_select_list pm_name" style="display: none;">
- <li val="0" invNo="0" unitName="">请选择</li>
- <?php foreach ($pmNameList as $key => $value): ?>
- <li val="<?php echo $value['itemId']; ?>" typeId="<?php echo $value['typeId']?>" invNo="<?php echo $value['invNo']-$value['scrapNo']; ?>" unitName="<?php echo isset($value['unitName'])?$value['unitName']:"";?>"><?php echo $value['itemName']; ?></li>
- <?php endforeach; ?>
- </ul>
- </div>
- </td>
- <td>
- <span class="item-num">0</span>
- </td>
- <td>
- <div class="out-count-div">
- <a class="reduce-out">-</a>
- <input type="text" name="out_stock_num" value="<?php echo isset($stockNum)?$stockNum:1;?>"/>
- <a class="add-out">+</a>
- </div>
- </td>
- <td><span class="unit-name"></span></td>
- <?php if($itemType==3):?>
- <td>
- <select name="fcId" id="fcId">
- <option value="0">请选择设备</option>
- <?php
- if($printList){
- foreach ($printList as $value){
- if(isset($fcId) && $fcId==$value['fcId']){
- echo '<option value="'.$value['fcId'].'" selected>'.$value['fixedCodeName'].' '.$value['itemName'].'</option>';
- }else{
- echo '<option value="'.$value['fcId'].'">'.$value['fixedCodeName'].' '.$value['itemName'].'</option>';
- }
- }
- }
- ?>
- </select>
- </td>
- <?php endif;?>
- <td>-</td>
- </tr>
- </table>
- <div> </div>
- <!--
- <div style="margin-bottom:5px; font-size:18px;">发放销售订单
- <span style="font-size: 12px;padding-left:20px;">指定领用的学生所在的销售订单,每次只能指定一个订单</span>
- <button type="button" class="btn btn-success btn-sm fr">选择销售订单</button>
- </div>
- <table width="100%" class="table-center">
- <tr class="item-out-list">
- <th>销售订单号</th>
- <th>商品</th>
- <th>商品配套数</th>
- <th>实际订购人数</th>
- <th>实际应发数</th>
- <th>待审核发放数</th>
- <th>已发放数</th>
- <th>本次发放数</th>
- </tr>
- <tbody class="selected_item">
- </tbody>
- </table>
- -->
- <div style="margin:10px 0 20px;">领用出库单填写后,需要提交审批并完成签字,才能完成领用。领用后出现商品损失由领用人承担。</div>
- <div class="sale-submit">
- <button type="button" class="label-primary-cancle">取消</button>
- <button type="button" class="label-primary-s bth-s">提交</button>
- </div>
- <!-- 关联正式订单弹层 -->
- <div class="layer-relate rel-order-layer">
- <div class="layer-filter">
- <input type="text" name="outCode" placeholder="销售单编号" style="height:28px">
- <select name="schoolYearName" id="schoolYear" 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="goodsId" id="goodsId" style="width: 100px;">
- <option value="0">商品</option>
- <?php if(isset($goodList) && $goodList):?>
- <?php foreach ($goodList as $key => $value): ?>
- <option value="<?php echo $value['goodsId']; ?>"><?php echo $value['goodsName']; ?></option>
- <?php endforeach; ?>
- <?php endif;?>
- </select>
- <select name="packageId" id="packageId" style="width: 100px;">
- <option value="0">套餐</option>
- </select>
- <a class="btn btn-success order-search">查询</a>
- </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>
- <th>年级</th>
- <th>单位发放数</th>
- <th>实际订购人数</th>
- <th>应发放数</th>
- <th>待审核发放数</th>
- <th>已发放数</th>
- <th>选择</th>
- </tr>
- </thead>
- <tbody >
- </tbody>
- </table>
- <div class="col-sm-12">
- <ul class="pagination">
- </ul>
- </div>
- </div>
- <script src="/js/productset/jquery.min.js"></script>
- <script src="/js/ims/jquery.datetimepicker.js"></script>
- <script src="/js/ims/layer/layer.js"></script>
- <script src="/js/ims/xsgl.js"></script>
- <?php include_once '_useDetail.php'?>
- <script>
- var listData = [];
- var sendData={};
- //选择销售订单
- $('.btn-sm').click(function () {
- var typeId = $('#typeId').val();
- if(typeId==0 || typeId==undefined){
- layer.msg('请先选择品目');
- return false;
- }
- sendData={};
- sendData= {
- typeId:typeId
- }
- getOrder(sendData,0);
- });
- $('.order-table tbody')
- .on('click','.select_btn',function(){
- var index = $(this).attr('order');
- if(!(typeof(listData[index]) == 'undefined')){
- $('.selected_item').html(listData[index]);
- layer.closeAll();
- }
- return false;
- })
- .on('click','.gotoPage',function(){
- var page=$(this).attr('rel');
- gotoPage(page);
- })
- //获取套餐
- $('#goodsId').change(function () {
- var currentGoodsId = $(this).val();
- if(currentGoodsId>0){
- getPackage(currentGoodsId);
- }else{
- $('.select-package .diy_select_txt').val("请选择套餐");
- $('#packageId').val(0);
- $('.select-package ul').html('<li val="0">请选择套餐</li>');
- }
- });
- //搜索
- $('.order-search').click(function(){
- var outCode=$('input[name=outCode]').val(),
- goodsId=$('#goodsId').val(),
- packageId=$('#packageId').val(),
- schoolYear=$('#schoolYear').val();
- var typeId = $('#typeId').val();
- sendData={};
- sendData={
- orderNo:outCode,
- goodsId:goodsId,
- packageId:packageId,
- schoolYearId:schoolYear,
- typeId:typeId
- };
- getOrder(sendData,1);
- });
- //读取订单
- function getOrder(data,type){
- listData=[];
- //提交数据
- $.ajax({
- type: 'POST',
- url: "<?php echo $this->createUrl('imsStore/ajaxGetOrderList');?>",
- data: data,
- async: false,
- dataType: 'json',
- success: function (res) {
- if (res.status == 1) {
- var hasItemOut = [];
- $("input[name='select-itemId-outId']").each(function () {
- hasItemOut.push($(this).val());
- });
- var html = '';
- var list=res.data['list'];
- for (var i = 0; i < list.length; i++) {
- var item = list[i];
- temp='';
- temp+='<tr>';
- temp += '<td>' + item['orderNo'] + '</td>';
- temp += '<td>' + item['goodsName'] + '</td>';
- temp += '<td>' + item['sendNo'] + '</td>';
- temp += '<td>' + item['quantity'] + '</td>';
- temp += '<td>' + item['sendNo']*item['quantity'] + '</td>';
- temp += '<td>' + item['waitCheckNo'] + '</td>';
- temp += '<td>' + item['saleNo'] + '</td>';
- temp += '<td><input type="text" name="out_stock_num" value=""></td>';
- temp+='</tr>';
- listData[i] = temp;
- html += '<tr>';
- html += '<td class="orderId">' + item['orderNo'] + '</td>';
- html += '<td>' + item['goodsName'] + '</td>';
- html += '<td>' + item['gradeName'] + '</td>';
- html += '<td>' + item['sendNo'] + '</td>';
- html += '<td>' + item['quantity'] + '</td>';
- html += '<td>' + item['sendNo']*item['quantity'] + '</td>';
- html += '<td>' + item['waitCheckNo'] + '</td>';
- html += '<td>' + item['saleNo'] + '</td>';
- html += '<td><a href="#" class="select_btn" order="'+i+'">选择</a></td>';
- html += '</tr>';
- }
- //分页
- var pageHtml='<tr><td colspan="9" 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);
- if(type==0){
- layer.open({
- type: 1,
- title: '发放销售订单',
- btn: ['确定','取消'],
- area: ['810px', '420px'], //宽高
- btnAlign: 'c',
- content: $('.rel-order-layer'),
- yes: function (index, layero) {
- layer.closeAll();
- }
- });
- }
- } else {
- flag = true;
- layer.msg(result.msg);
- }
- },
- error: function (jqXHR, textStatus, errorThrown) {
- /*错误信息处理*/
- flag = true;
- layer.msg('提交失败');
- }
- });
- }
- function gotoPage(page){
- sendData.page=page;
- getOrder(sendData,1);
- }
- function getPackage(goodsId) {
- console.log(goodsId);
- if (goodsId<=0){
- var html = '<option val="0">请选择套餐</option>';
- $('.select-package ul').html(html);
- }else{
- $.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 = '<option value="0">请选择套餐</option>';
- for (var i = 0; i < data.data.length; i++) {
- var item = data.data[i];
- if (item['packageId']) {
- html += '<option value="' + item['packageId'] + '">';
- html += item['packageName'];
- html += '</option>'
- }
- }
- } else {
- var html = '<option val="0">暂无套餐</option>';
- }
- console.log(html);
- $('#packageId').html(html);
- },
- error: function () {
- return;
- }
- })
- }
- }
- </script>
- </body>
- </html>
|