123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310 |
- <!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 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/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: 5px;
- }
- .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: #15ae68 !important;
- background-color: #15ae68 !important;
- color: #fff;
- }
- .stop-layer-box, .resubmit-layer-box, .delete-layer-box {
- line-height: 140px;
- text-align: center;
- }
- </style>
- </head>
- <body>
- <div class="ims-box">
- <form action="<?php echo Yii::app()->createUrl('imsStore/stock'); ?>" method="get">
- <div class="screen clearfix">
- <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-lossType">
- <input type="hidden" id="lossType" name="lossType" 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>
- <li val="3">盘平</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">请选择品目名称</div>
- <div class="diy_select_btn"></div>
- <ul class="diy_select_list" style="display: none;">
- <li val="0">请选择品目名称</li>
- <?php foreach ($itemList as $item): ?>
- <li val="<?php echo $item['itemId'] ?>"><?php echo $item['itemName'] ?></li>
- <?php endforeach; ?>
- </ul>
- </div>
- <div class="date fl">
- <input type="text" readonly name="startStockDate" class="some_class" value="" id="some_class_1"/> --
- <input type="text" readonly name="endStockDate" class="some_class" value="" id="some_class_2"/>
- </div>
- <button type="submit" class="label-primary-s bth-s">搜索</button>
- <a href="<?php echo Yii::app()->createUrl('imsStore/stockAdd'); ?>" class="label-primary-s bth-s">新增盘点</a>
- </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>
- <th>审批状态</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- <?php if ($list): ?>
- <?php foreach ($list as $value): ?>
- <tr>
- <td><?php echo $value['stockCode'] ?></td>
- <td><?php echo $value['stockTitle'] ?></td>
- <td><?php echo date('Y-m-d',strtotime($value['stocktakingDate'])) ?></td>
- <td><?php echo $value['itemName'] ?></td>
- <td><?php echo isset($value['unitName'])?$value['unitName']:'' ?></td>
- <td><?php echo $value['theoreticalNo'] ?></td>
- <td><?php echo $value['stockNo'] ?></td>
- <td><?php echo $value['lossTypeName'] ?></td>
- <?php if ($value['lossNo'] < 0): ?>
- <td style="background: red;color: white"><?php echo $value['lossNo'] ?></td>
- <?php elseif ($value['lossNo'] > 0): ?>
- <td>+<?php echo $value['lossNo'] ?></td>
- <?php else: ?>
- <td>0</td>
- <?php endif; ?>
- <td><?php echo $value['statusName'] ?></td>
- <td>
- <?php if ($value['status'] == '0'): ?>
- <a href="<?php echo Yii::app()->createUrl('imsStore/stockView', array('stockId' => $value['stockId'],'processInstanceId'=>$value['processInfo']['processInstanceId'])); ?>">查看</a>
- <a href="#" class="stop-it" businessKey="<?php echo $value['processInfo']['businessKey']; ?>">取消</a>
- <?php endif; ?>
- <?php if ($value['status'] == '2' || $value['status'] == '3'): ?>
- <a href="<?php echo Yii::app()->createUrl('imsStore/stockEdit', array('stockId' => $value['stockId'])); ?>">重盘</a>
- <a href="#" class="delete-it" businessKey="<?php echo $value['processInfo']['businessKey']; ?>">删除</a>
- <?php endif; ?>
- <?php if ($value['status'] == '1'): ?>
- <a href="<?php echo Yii::app()->createUrl('imsStore/stockView', array('stockId' => $value['stockId'],'processInstanceId'=>$value['processInfo']['processInstanceId'])); ?>">查看</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['status']) && $_GET['status'] > 0) {
- $params['status'] = $_GET['status'];
- }
- if (isset($_GET['itemId']) && $_GET['itemId']) {
- $params['itemId'] = $_GET['itemId'];
- }
- if (isset($_GET['lossType']) && $_GET['lossType'] > 0) {
- $params['status'] = $_GET['status'];
- }
- if (isset($_GET['startStockDate']) && $_GET['startStockDate']) {
- $params['startStockDate'] = $_GET['startStockDate'];
- }
- if (isset($_GET['endStockDate']) && $_GET['endStockDate']) {
- $params['endStockDate'] = $_GET['endStockDate'];
- }
- if (isset($_GET['page'])) {
- $params['page'] = $_GET['page'];
- } else {
- $params['page'] = 1;
- }
- echo formatPage($page, 'imsStore/stock', $params)
- ?>
- </ul>
- </div>
- <?php endif; ?>
- </div>
- </div>
- <script src="/js/jquery-2.2.2.min.js"></script>
- <script src="/js/jquery.datetimepicker.js"></script>
- <script src="/js/layer/layer.js"></script>
- <script src="/js/xsgl.js"></script>
- <script>
- $(document).ready(function () {
- $('.some_class').datetimepicker({
- format: "Y-m-d", //格式化日期
- timepicker: false //关闭时间选项
- });
- <?php if (isset($_GET['startStockDate'])):?>
- $("#some_class_1").attr("value", "<?php echo $_GET['startStockDate']?>");
- $("#some_class_2").attr("value", "<?php echo $_GET['endStockDate']?>");
- <?php endif;?>
- <?php if(isset($_GET['status'])):?>
- 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['lossType'])):?>
- var lossType = "<?php echo $_GET['lossType'];?>";
- $('#lossType').val(lossType);
- var txt = $('.select-lossType li[val='+lossType+']').html();
- $('.select-lossType .diy_select_txt').html(txt);
- <?php endif;?>
- <?php if(isset($_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 //关闭时间选项
- });
- //取消
- $("body").on("click", ".stop-it", function () {
- var businessKey = $(this).attr('businessKey');
- layer.confirm('确认取消该盘点单吗?取消后可以重盘!', {
- btn: ['确定', '取消'] //按钮
- }, function () {
- $.ajax({
- type: 'post',
- url: "<?php echo Yii::app()->createUrl('imsStore/ajaxStopStock');?>",
- data: {'businessKey': businessKey},
- 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("click", ".delete-it", function () {
- var businessKey = $(this).attr('businessKey');
- layer.confirm('确认删除该盘点吗?', {
- btn: ['确定', '取消'] //按钮
- }, function () {
- $.ajax({
- type: 'post',
- url: "<?php echo Yii::app()->createUrl('imsStore/ajaxDeleteStock');?>",
- data: {'businessKey': businessKey},
- 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("网络异常");
- }
- });
- });
- });
- });
- </script>
- </body>
- </html>
|