1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>查看库存盘点</title>
- <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/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: #2977ff;
- }
- .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: 300px;
- overflow: auto;
- }
- .student-selected li {
- float: left;
- margin-right: 24px;
- margin-bottom: 12px;
- width: 280px;
- 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: #2977ff;
- cursor: pointer;
- }
- .sale-table input {
- border: 1px solid #ccc;
- border-radius: 4px;
- }
- #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: #2977ff !important;
- background-color: #2977ff !important;
- color: #fff;
- }
- .stop-layer-box, .resubmit-layer-box, .delete-layer-box {
- line-height: 140px;
- text-align: center;
- }
- .blue{
- color:blue;
- cursor: pointer;
- }
- .bg-green{
- background-color: #2977ff;
- }
- .bg-red{
- background-color: red;
- }
- .bg-yellow{
- background-color: #DAA520;
- }
-
- .title{
- padding: 0 10px;
- font-size: 16px;
- font-weight: 600;
- line-height: 28px;
- }
- .product{
- margin-top: 10px;
- padding: 0 10px;
- }
- .table-product{
- width: 100%;
- text-align: center;
- line-height: 30px;
- }
- .table-product tr:nth-child(odd) {
- background-color: #fafafa;
- }
- .product .table-product th,.product .table-product td{
- width: 15%;
- }
- .product .table-product th{
- text-align: center;
- }
- .product .plan-count-wrap-po{
- display: inline-block;
- height: 24px;
- font-size: 0;
- }
- .product .reduce-count,.product .add-count{
- display: inline-block;
- width: 24px;
- line-height: 24px;
- height: 24px;
- font-size: 14px;
- text-align: center;
- color: #fff;
- background-color: #666;
- cursor: pointer;
- }
- .product .product-contrast{
- text-align: left;
- padding-left: 6%;
- }
- .product .plan-count{
- width: 80px;
- height: 24px;
- line-height: 24px;
- font-size: 14px;
- text-align: center;
- box-sizing: border-box;
- }
- .tag-table-product{
- display: inline-block;
- margin-right: 10px;
- width: 24px;
- height: 24px;
- line-height: 24px;
- color: #fff;
- text-align: center;
- }
- .assets{
- width: 100%;
- margin-top: 10px;
- padding: 0 10px;
- }
- .assets .table-assets{
- width: 100%;
- text-align: center;
- line-height: 30px;
- }
- .table-assets tr:nth-child(odd) {
- background-color: #fafafa;
- }
- .assets .table-assets th{
- text-align: center;
- }
- .show-layer-assets-number{
- color: #169BD5;
- cursor: pointer;
- }
- /*弹窗开始*/
- .dialog-layer-assets-number{
- display: none;
- width: 360px;
- padding: 10px 20px;
- color: #666;
- }
- .dialog-layer-assets-number .pan-title{
- line-height: 32px;
- color: #333;
- font-weight: 600;
- }
- .assets-number-list{
- height: 60px;
- overflow: auto;
- }
- .assets-number-list label{
- display: inline-block;
- width: 150px;
- line-height: 30px;
- font-size: 13px;
- }
- .dialog-layer-assets-number .new-assets-number-box{
- line-height: 30px;
- }
- .dialog-layer-assets-number .input-new-assets-number{
- width: 120px;
- line-height: 24px;
- box-sizing: border-box;
- }
- .dialog-layer-assets-number .new-add-plan{
- line-height: 24px;
- margin-left: 14px;
- border-radius: 3px;
- padding: 0 4px;
- font-size: 12px;
- color: #fff;
- background-color: #2977ff;
- cursor: pointer;
- border: none;
- outline: none;
- }
- body .input-layer-new-assets-number{
- width: 137px;
- border: none;
- outline: none;
- background: #fff !important;
-
- }
- .dialog-btn-box{
- margin-top: 20px;
- text-align: center;
- }
- .dialog-btn-box button{
- width: 60px;
- height: 24px;
- line-height: 24px;
- text-align: center;
- cursor: pointer;
- border: none;
- outline: none;
- }
- .dialog-btn-box .btn-dialog-colse{
- color: #2977ff;
- background-color: #fff;
- border: 1px solid #2977ff;
- box-sizing: border-box;
- }
- .dialog-btn-box .btn-dialog-save{
- margin-left: 20px;
- color: #fff;
- background-color: #2977ff;
- }
- /*在谷歌下移除input[number]的上下箭头*/
- .new-assets-number-box input[type='number']::-webkit-outer-spin-button,
- .new-assets-number-box input[type='number']::-webkit-inner-spin-button{
- -webkit-appearance: none !important;
- margin: 0;
- }
- /*在firefox下移除input[number]的上下箭头*/
- .new-assets-number-box input[type="number"]{-moz-appearance:textfield;}
-
- .new-add-plan{
- display: none;
- }
-
-
- .urge-layer-box {
- margin-top: 30px;
- margin-left: 30px;
- }
- .urge-layer-box textarea {
- margin-left: 15px;
- vertical-align: top;
- }
- #urgeText{
- width: 450px;
- display: inline-block;
- vertical-align: text-top;
- resize:none
- }
- .now-hidden{display:none}
- .show-tr{
- color:#2977ff;
- cursor: pointer;
- }
- </style>
- </head>
- <body>
- <h3 class="sale-title">库存盘点单</h3>
- <input type="hidden" name="itemName">
- <input type="hidden" name="itemSpec">
- <input type="hidden" name="itemCode">
- <input type="hidden" name="unitId">
- <div class="sale-table">
- <table width="100%">
- <tr>
- <th><em class="red">*</em>标题</th>
- <td colspan="3">
- <input type="text" style="width:50%;" name="stockTitle" value="<?php echo $list['stockTitle'];?>" readonly="readonly">
- </td>
- </tr>
- <tr>
- <th><em class="red">*</em>盘点日期</th>
- <td colspan="3">
- <input class="stocktakingDate" type="text" name="stocktakingDate" style="width:50%;" readonly value="<?php echo $list['stocktakingDate'];?>" active="false">
- </td>
- </tr>
- <tr>
- <th><em class="red">*</em>盘点凭证</th>
- <td colspan="3">
- <span class="img-title" style="display:none">
- <label class="add-img">
- <span>+</span>
- <input type="file" id="fileImg" accept="image/*" style="display: none;" />
- </label>
- <span> 请上传货品盘点的照片</span>
- </span>
- <div id="imgPreview" active="false">
- <?php if(isset($list['images']) && $list['images']):?>
- <?php foreach($list['images'] as $k=>$v):?>
- <img src="<?php echo $v;?>" />
- <?php endforeach;?>
- <?php endif;?>
- </div>
- </td>
- </tr>
- <tr>
- <!-- more less same-->
- <td colspan="4" class="sale-num get-status">
- </td>
- </tr>
- <tr>
- <th>盘点说明</th>
- <td colspan="3">
- <textarea name="remark" id="remark" rows="6" cols="60" readonly="readonly"><?php echo $list['remark'];?></textarea>
- </td>
- </tr>
- </table>
- </div>
- <?php if(isset($list) && $list):?>
- <?php if(isset($list['finishRes']) && $list['finishRes']):?>
- <?php $tr_show = "";?>
- <?php $tr_hide = "";?>
- <h4 class="title">产成品</h4>
- <div class="product">
- <table class="table-product" border="1px">
- <tr>
- <th>品目名称</th>
- <th class="now-hidden">理论数量</th>
- <th>总库存盘点</th>
- <th>不合格品盘点</th>
- <th>单位</th>
- <th>总库存盘点情况</th>
- <th>不合格品盘点情况</th>
- </tr>
- <?php foreach($list['finishRes'] as $kk=>$vv):?>
- <?php
- if($vv['stockNo'] == $vv['theoreticalNo']){
- $profit = '<span class="tag-table-product bg-yellow">平</span>';
- }elseif($vv['stockNo'] < $vv['theoreticalNo']){
- $profit = '<span class="tag-table-product bg-red">亏</span>-'.($vv['theoreticalNo']-$vv['stockNo']);
- }elseif($vv['stockNo'] > $vv['theoreticalNo']){
- $profit = '<span class="tag-table-product bg-green">盈</span>+'.($vv['stockNo']-$vv['theoreticalNo']);
- }
- if($vv['scrapLoss'] == 0 ){
- $scrap = '<span class="tag-table-product bg-yellow">平</span>';
- }else if($vv['scrapLoss'] > 0){
- $scrap = '<span class="tag-table-product bg-green">盈</span>+'.$vv['scrapLoss'];
- }else{
- $scrap = '<span class="tag-table-product bg-red">亏</span>-'.$vv['scrapLoss'];
- }
- ?>
- <?php
- if($vv['theoreticalNo'] > 0){
- $tr_show .= '<tr class="no-fixed" itemId="'.$vv['itemId'].'"><td>'.$vv['itemName'].'</td><td class="now-hidden">'.$vv['theoreticalNo'].'</td><td><span class="plan-count-wrap-po inv-count"><span class="reduce-count" active="false">-</span><input type="text" name="plan-count" class="plan-count" oninput="value=value.replace(/[^\d]/g,\'\')" readonly="readonly" value="'.$vv['stockNo'].'"><span class="add-count" active="false">+</span></span></td><td class="now-hidden">'.$vv['scrapOld'].'</td><td><span class="plan-count-wrap-po scrap-count"><span class="reduce-count" active="false">-</span><input type="text" name="plan-count" class="plan-count" oninput="value=value.replace(/[^\d]/g,\'\')" readonly="readonly" value="'.$vv['scrapNo'].'"><span class="add-count" active="false">+</span></span></td><td>'.$vv['unitName'].'</td><td class="product-contrast">'.$profit.'</td><td class="product-contrast">'.$scrap.'</td></tr>';
- }else{
- $tr_hide .= '<tr class="no-fixed hide need-hide" itemId="'.$vv['itemId'].'"><td>'.$vv['itemName'].'</td><td class="now-hidden">'.$vv['theoreticalNo'].'</td><td><span class="plan-count-wrap-po inv-count"><span class="reduce-count" active="false">-</span><input type="text" name="plan-count" class="plan-count" oninput="value=value.replace(/[^\d]/g,\'\')" readonly="readonly" value="'.$vv['stockNo'].'"><span class="add-count" active="false">+</span></span></td><td class="now-hidden">'.$vv['scrapOld'].'</td><td><span class="plan-count-wrap-po scrap-count"><span class="reduce-count" active="false">-</span><input type="text" name="plan-count" class="plan-count" oninput="value=value.replace(/[^\d]/g,\'\')" readonly="readonly" value="'.$vv['scrapNo'].'"><span class="add-count" active="false">+</span></span></td><td>'.$vv['unitName'].'</td><td class="product-contrast">'.$profit.'</td><td class="product-contrast">'.$scrap.'</td></tr>';
- }
- ?>
- <!--<tr class="no-fixed" itemId="<?php echo $vv['itemId']?>"><td><?php echo $vv['itemName'];?></td><td class="now-hidden"><?php echo $vv['theoreticalNo'];?></td><td><span class="plan-count-wrap-po inv-count"><span class="reduce-count" active="false">-</span><input type="text" name="plan-count" class="plan-count" oninput="value=value.replace(/[^\d]/g,'')" readonly="readonly" value="<?php echo $vv['stockNo'];?>"><span class="add-count" active="false">+</span></span></td><td class="now-hidden"><?php echo $vv['scrapOld'];?></td><td><span class="plan-count-wrap-po scrap-count"><span class="reduce-count" active="false">-</span><input type="text" name="plan-count" class="plan-count" oninput="value=value.replace(/[^\d]/g,'')" readonly="readonly" value="<?php echo $vv['scrapNo'];?>"><span class="add-count" active="false">+</span></span></td><td><?php echo $vv['unitName'];?></td><td class="product-contrast"><?php echo $profit;?></td><td class="product-contrast"><?php echo $scrap;?></td></tr>-->
- <?php endforeach;?>
- <?php echo $tr_show;?>
- <?php if($tr_hide):?>
- <?php echo $tr_hide;?>
- <?php endif;?>
- </table>
- <?php if($tr_hide):?>
- <div class="show-tr fr">展示更多</div>
- <?php endif;?>
- </div>
- <?php endif;?>
- <?php if(isset($list['fixedRes']) && $list['fixedRes']):?>
- <?php $tr_show = "";?>
- <?php $tr_hide = "";?>
- <h4 class="title">固定资产</h4>
- <div class="assets">
- <table class="table-assets" border="1">
- <tr>
- <th>品目名称</th>
- <th class="now-hidden">理论数量</th>
- <th>盘点数量</th>
- <th>单位</th>
- <th>盘点情况</th>
- </tr>
- <?php foreach($list['fixedRes'] as $kk=>$vv):?>
- <?php
- if($vv['stockNo'] == $vv['theoreticalNo']){
- $profit = '<span class="tag-table-product bg-yellow">平</span>';
- }elseif($vv['stockNo'] < $vv['theoreticalNo']){
- $profit = '<span class="tag-table-product bg-red">亏</span>-'.($vv['theoreticalNo']-$vv['stockNo']);
- }elseif($vv['stockNo'] > $vv['theoreticalNo']){
- $profit = '<span class="tag-table-product bg-green">盈</span>+'.($vv['stockNo']-$vv['theoreticalNo']);
- }
- ?>
- <?php
- if($vv['theoreticalNo'] > 0){
- $tr_show .= '<tr class="fixed" itemId="'.$vv['itemId'].'"><td>'.$vv['itemName'].'</td><td class="now-hidden">'.$vv['theoreticalNo'].'</td><td class="blue choose-pro" planId="'.$vv['itemId'].'" originIds="'.implode(',', $vv['invFixedCodes']).'" selectIds="'.implode(',', $vv['fixedCodes']).'" active="false">'.$vv['stockNo'].'</td><td>'.$vv['unitName'].'</td><td class="product-contrast">'.$profit.'</td></tr>';
- }else{
- $tr_hide .= '<tr class="fixed hide need-hide" itemId="'.$vv['itemId'].'"><td>'.$vv['itemName'].'</td><td class="now-hidden">'.$vv['theoreticalNo'].'</td><td class="blue choose-pro" planId="'.$vv['itemId'].'" originIds="'.implode(',', $vv['invFixedCodes']).'" selectIds="'.implode(',', $vv['fixedCodes']).'" active="false">'.$vv['stockNo'].'</td><td>'.$vv['unitName'].'</td><td class="product-contrast">'.$profit.'</td></tr>';
- }
- ?>
- <!--<tr class="fixed" itemId="<?php echo $vv['itemId']?>"><td><?php echo $vv['itemName'];?></td><td class="now-hidden"><?php echo $vv['theoreticalNo'];?></td><td class="blue choose-pro" planId="<?php echo $vv['itemId'];?>" originIds="<?php echo implode(',', $vv['invFixedCodes']);?>" selectIds="<?php echo implode(',', $vv['fixedCodes']);?>" active="false"><?php echo $vv['stockNo'];?></td><td><?php echo $vv['unitName'];?></td><td class="product-contrast"><?php echo $profit;?></td></tr>-->
- <?php endforeach;?>
- <?php echo $tr_show;?>
- <?php if($tr_hide):?>
- <?php echo $tr_hide;?>
- <?php endif;?>
- </table>
- <?php if($tr_hide):?>
- <div class="show-tr fr">展示更多</div>
- <?php endif;?>
- </div>
- <?php endif;?>
- <?php if(isset($list['lowRes']) && $list['lowRes']):?>
- <?php $tr_show = "";?>
- <?php $tr_hide = "";?>
- <h4 class="title">低值易耗品</h4>
- <div class="product">
- <table class="table-product" border="1px">
- <tr>
- <th>品目名称</th>
- <th class="now-hidden">理论数量</th>
- <th>总库存盘点</th>
- <th>不合格品盘点</th>
- <th>单位</th>
- <th>总库存盘点情况</th>
- <th>不合格品盘点情况</th>
- </tr>
- <?php foreach($list['lowRes'] as $kk=>$vv):?>
- <?php
- if($vv['stockNo'] == $vv['theoreticalNo']){
- $profit = '<span class="tag-table-product bg-yellow">平</span>';
- }elseif($vv['stockNo'] < $vv['theoreticalNo']){
- $profit = '<span class="tag-table-product bg-red">亏</span>-'.($vv['theoreticalNo']-$vv['stockNo']);
- }elseif($vv['stockNo'] > $vv['theoreticalNo']){
- $profit = '<span class="tag-table-product bg-green">盈</span>+'.($vv['stockNo']-$vv['theoreticalNo']);
- }
- if($vv['scrapLoss'] == 0 ){
- $scrap = '<span class="tag-table-product bg-yellow">平</span>';
- }else if($vv['scrapLoss'] > 0){
- $scrap = '<span class="tag-table-product bg-green">盈</span>+'.$vv['scrapLoss'];
- }else{
- $scrap = '<span class="tag-table-product bg-red">亏</span>-'.$vv['scrapLoss'];
- }
- ?>
- <?php
- if($vv['theoreticalNo'] > 0){
- $tr_show .= '<tr class="no-fixed" itemId="'.$vv['itemId'].'"><td>'.$vv['itemName'].'</td><td class="now-hidden">'.$vv['theoreticalNo'].'</td><td><span class="plan-count-wrap-po inv-count"><span class="reduce-count" active="false">-</span><input type="text" name="plan-count" class="plan-count" oninput="value=value.replace(/[^\d]/g,\'\')" readonly="readonly" value="'.$vv['stockNo'].'"><span class="add-count" active="false">+</span></span></td><td class="now-hidden">'.$vv['scrapOld'].'</td><td><span class="plan-count-wrap-po scrap-count"><span class="reduce-count" active="false">-</span><input type="text" name="plan-count" class="plan-count" oninput="value=value.replace(/[^\d]/g,\'\')" readonly="readonly" value="'.$vv['scrapNo'].'"><span class="add-count" active="false">+</span></span></td><td>'.$vv['unitName'].'</td><td class="product-contrast">'.$profit.'</td><td class="product-contrast">'.$scrap.'</td></tr>';
- }else{
- $tr_hide .= '<tr class="no-fixed hide need-hide" itemId="'.$vv['itemId'].'"><td>'.$vv['itemName'].'</td><td class="now-hidden">'.$vv['theoreticalNo'].'</td><td><span class="plan-count-wrap-po inv-count"><span class="reduce-count" active="false">-</span><input type="text" name="plan-count" class="plan-count" oninput="value=value.replace(/[^\d]/g,\'\')" readonly="readonly" value="'.$vv['stockNo'].'"><span class="add-count" active="false">+</span></span></td><td class="now-hidden">'.$vv['scrapOld'].'</td><td><span class="plan-count-wrap-po scrap-count"><span class="reduce-count" active="false">-</span><input type="text" name="plan-count" class="plan-count" oninput="value=value.replace(/[^\d]/g,\'\')" readonly="readonly" value="'.$vv['scrapNo'].'"><span class="add-count" active="false">+</span></span></td><td>'.$vv['unitName'].'</td><td class="product-contrast">'.$profit.'</td><td class="product-contrast">'.$scrap.'</td></tr>';
- }
- ?>
- <!--<tr class="no-fixed" itemId="<?php echo $vv['itemId']?>"><td><?php echo $vv['itemName'];?></td><td class="now-hidden"><?php echo $vv['theoreticalNo'];?></td><td><span class="plan-count-wrap-po inv-count"><span class="reduce-count" active="false">-</span><input type="text" name="plan-count" class="plan-count" oninput="value=value.replace(/[^\d]/g,'')" readonly="readonly" value="<?php echo $vv['stockNo'];?>"><span class="add-count" active="false">+</span></span></td><td class="now-hidden"><?php echo $vv['scrapOld'];?></td><td><span class="plan-count-wrap-po scrap-count"><span class="reduce-count" active="false">-</span><input type="text" name="plan-count" class="plan-count" oninput="value=value.replace(/[^\d]/g,'')" readonly="readonly" value="<?php echo $vv['scrapNo'];?>"><span class="add-count" active="false">+</span></span></td><td><?php echo $vv['unitName'];?></td><td class="product-contrast"><?php echo $profit;?></td><td class="product-contrast"><?php echo $scrap;?></td></tr>-->
- <?php endforeach;?>
- <?php echo $tr_show;?>
- <?php if($tr_hide):?>
- <?php echo $tr_hide;?>
- <?php endif;?>
- </table>
- <?php if($tr_hide):?>
- <div class="show-tr fr">展示更多</div>
- <?php endif;?>
- </div>
- <?php endif;?>
- <?php if(isset($list['rawRes']) && $list['rawRes']):?>
- <?php $tr_show = "";?>
- <?php $tr_hide = "";?>
- <h4 class="title">原材料</h4>
- <div class="product">
- <table class="table-product" border="1px">
- <tr>
- <th>品目名称</th>
- <th class="now-hidden">理论数量</th>
- <th>总库存盘点</th>
- <th>不合格品盘点</th>
- <th>单位</th>
- <th>总库存盘点情况</th>
- <th>不合格品盘点情况</th>
- </tr>
- <?php foreach($list['rawRes'] as $kk=>$vv):?>
- <?php
- if($vv['stockNo'] == $vv['theoreticalNo']){
- $profit = '<span class="tag-table-product bg-yellow">平</span>';
- }elseif($vv['stockNo'] < $vv['theoreticalNo']){
- $profit = '<span class="tag-table-product bg-red">亏</span>-'.($vv['theoreticalNo']-$vv['stockNo']);
- }elseif($vv['stockNo'] > $vv['theoreticalNo']){
- $profit = '<span class="tag-table-product bg-green">盈</span>+'.($vv['stockNo']-$vv['theoreticalNo']);
- }
- if($vv['scrapLoss'] == 0 ){
- $scrap = '<span class="tag-table-product bg-yellow">平</span>';
- }else if($vv['scrapLoss'] > 0){
- $scrap = '<span class="tag-table-product bg-green">盈</span>+'.$vv['scrapLoss'];
- }else{
- $scrap = '<span class="tag-table-product bg-red">亏</span>-'.$vv['scrapLoss'];
- }
- ?>
- <?php
- if($vv['theoreticalNo'] > 0){
- $tr_show .= '<tr class="no-fixed" itemId="'.$vv['itemId'].'"><td>'.$vv['itemName'].'</td><td class="now-hidden">'.$vv['theoreticalNo'].'</td><td><span class="plan-count-wrap-po inv-count"><span class="reduce-count" active="false">-</span><input type="text" name="plan-count" class="plan-count" oninput="value=value.replace(/[^\d]/g,\'\')" readonly="readonly" value="'.$vv['stockNo'].'"><span class="add-count" active="false">+</span></span></td><td class="now-hidden">'.$vv['scrapOld'].'</td><td><span class="plan-count-wrap-po scrap-count"><span class="reduce-count" active="false">-</span><input type="text" name="plan-count" class="plan-count" oninput="value=value.replace(/[^\d]/g,\'\')" readonly="readonly" value="'.$vv['scrapNo'].'"><span class="add-count" active="false">+</span></span></td><td>'.$vv['unitName'].'</td><td class="product-contrast">'.$profit.'</td><td class="product-contrast">'.$scrap.'</td></tr>';
- }else{
- $tr_hide .= '<tr class="no-fixed hide need-hide" itemId="'.$vv['itemId'].'"><td>'.$vv['itemName'].'</td><td class="now-hidden">'.$vv['theoreticalNo'].'</td><td><span class="plan-count-wrap-po inv-count"><span class="reduce-count" active="false">-</span><input type="text" name="plan-count" class="plan-count" oninput="value=value.replace(/[^\d]/g,\'\')" readonly="readonly" value="'.$vv['stockNo'].'"><span class="add-count" active="false">+</span></span></td><td class="now-hidden">'.$vv['scrapOld'].'</td><td><span class="plan-count-wrap-po scrap-count"><span class="reduce-count" active="false">-</span><input type="text" name="plan-count" class="plan-count" oninput="value=value.replace(/[^\d]/g,\'\')" readonly="readonly" value="'.$vv['scrapNo'].'"><span class="add-count" active="false">+</span></span></td><td>'.$vv['unitName'].'</td><td class="product-contrast">'.$profit.'</td><td class="product-contrast">'.$scrap.'</td></tr>';
- }
- ?>
- <!--<tr class="no-fixed" itemId="<?php echo $vv['itemId']?>"><td><?php echo $vv['itemName'];?></td><td class="now-hidden"><?php echo $vv['theoreticalNo'];?></td><td><span class="plan-count-wrap-po inv-count"><span class="reduce-count" active="false">-</span><input type="text" name="plan-count" class="plan-count" oninput="value=value.replace(/[^\d]/g,'')" readonly="readonly" value="<?php echo $vv['stockNo'];?>"><span class="add-count" active="false">+</span></span></td><td class="now-hidden"><?php echo $vv['scrapOld'];?></td><td><span class="plan-count-wrap-po scrap-count"><span class="reduce-count" active="false">-</span><input type="text" name="plan-count" class="plan-count" oninput="value=value.replace(/[^\d]/g,'')" readonly="readonly" value="<?php echo $vv['scrapNo'];?>"><span class="add-count" active="false">+</span></span></td><td><?php echo $vv['unitName'];?></td><td class="product-contrast"><?php echo $profit;?></td><td class="product-contrast"><?php echo $scrap;?></td></tr>-->
- <?php endforeach;?>
- <?php echo $tr_show;?>
- <?php if($tr_hide):?>
- <?php echo $tr_hide;?>
- <?php endif;?>
- </table>
- <?php if($tr_hide):?>
- <div class="show-tr fr">展示更多</div>
- <?php endif;?>
- </div>
- <?php endif;?>
- <?php endif;?>
- <div class="sale-submit" style="margin-top: 25px;">
- <button type="button" class="" onclick="javascript:history.back(-1);">返回</button>
- <?php if($statusId == 2 || $statusId == 3):?>
- <button type="button" class=" label-primary-s bth-s editPlan">编辑</button>
- <?php endif;?>
- <?php if($list['processInfo']['showUrge']):?>
- <button type="button" class=" label-primary-s bth-s" id="pressPlan">催办</button>
- <?php endif;?>
- <?php if($list['processInfo']['showStop']):?>
- <button type="button" class=" label-primary-s bth-s" id="stopPlan">中止</button>
- <?php endif;?>
- <?php if($list['processInfo']['showDelete']):?>
- <button type="button" class=" label-primary-s bth-s" id="delPlan">删除</button>
- <?php endif;?>
- <?php if($statusId == 2):?>
- <button type="button" class=" label-primary-s bth-s" id="watchPlan">查看理由</button>
- <?php endif;?>
- <button type="button" class="label-primary-s bth-s" id="viewLog" >日志</button>
- </div>
- <div class="dialog-layer-assets-number">
- <div class='pan-title'>盘点数量(<span class='pan-count'>0</span>)</div>
- <div class='assets-number-list-parent'>
-
- </div>
- <div class='new-assets-number-box-parent'>
-
- </div>
-
- <div class='dialog-btn-box'>
- <button type="button" class="back-plan btn-dialog-colse">返回</button>
- <button type="button" class="btn-dialog-save" id="add-plan-identifier" style="display:none">提交</button>
- </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>
- <!--日志弹层-->
- <link rel="stylesheet" href="/css/cylet.css" />
- <style>
- .class-modal-body-1{overflow: auto;height:400px;}
- .class-modal-body-1 td{font-size:14px;line-height:200%}
- </style>
- <div class="confirmbox-mask" style="display: none" id="classModal">
- <div class="class-modal">
- </div>
- </div>
- <div class="confirmbox-mask" style="display: none" id="classModal-1">
- <form name="table_set">
- <div class="class-modal-1">
- <i class="icon icon-close-1"></i><div class="class-modal-head-1">日志</div>
- <div class="class-modal-body-1">
- <table cellspacing="0" cellpadding="0" border="0">
- <?php
- if($logList){
- foreach ($logList as $val){
- echo '<tr>';
- echo '<td><img src="/images/right_head.png"></td>';
- echo '<td width="40%">'.$val['createTime'].'</td>';
- echo '<td width="50%">【'.$val['userName'].'】'.$val['info'].'</td>';
- echo '</tr>';
- }
- }
- ?>
- </table>
- </div>
- </div>
- </form>
- </div>
- </body>
- <script>
- $('.icon-close-1').click(function(){
- $('#classModal-1').hide();
- });
- $('#viewLog').click(function(){
- $('#classModal-1').show();
- });
- </script>
- <script>
- $(function(){
- window.status = 0;//查看
- })
- </script>
- <?php // include_once '_stock.php'?>
- <script>
- //////////状态事件
- //查看理由
- $('body').delegate('#watchPlan','click', function(){
- <?php if(isset($list['resDTOList']) && $list['resDTOList']):?>
- <?php $noticeArr = end($list['resDTOList']);$notice = $noticeArr['info'];?>
- layer.alert("<?php echo $notice;?>", {icon: 7});
- <?php endif;?>
- });
- //催办
- $('body').delegate('#pressPlan','click', function(){
- // var data = {
- // 'smeDesc': '催办',
- // 'businessKey': '<?php // echo $list['processInfo']['businessKey'];?>'
- // };
- // $.ajax({
- // type: 'post',
- // url: "<?php // echo Yii::app()->createUrl('imsSale/urge');?>",
- // data: data,
- // dataType: 'json',
- // success: function (data) {
- // if (data.status) {
- // layer.closeAll();
- // window.location.href = "<?php // echo $this->createUrl('imsStore/newStock');?>";
- // } else {
- // flag = true;
- // $('.alert-msg').html(data.msg).fadeIn();
- // }
- // },
- // error: function () {
- // flag = true;
- // $('.alert-msg').html("异常错误").fadeIn();
- // }
- // });
- 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': '<?php echo $list['processInfo']['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();
- window.location.href = "<?php echo $this->createUrl('imsStore/newStock');?>";
- // 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 开启该代码可禁止点击该按钮关闭
- }
- });
- });
- //中止
- $('body').delegate('#stopPlan','click', function(){
- var businessKey = '<?php echo $list['processInfo']['businessKey'];?>';
- var doType = 'stop';
- $.ajax({
- type: 'get',
- url: "<?php echo Yii::app()->createUrl('imsStore/ajaxOutDelStop');?>",
- data: {'businessKey': businessKey,doType:doType},
- dataType: 'json',
- success: function (data) {
- if (data.status) {
- layer.alert("提交成功", {icon: 1,closeBtn:0},function (index) {
- window.location.href = "<?php echo $this->createUrl('imsStore/newStock');?>";
- layer.closeAll();
- });
- } else {
- layer.alert(data.msg, {icon: 7});
- return false;
- }
- },
- error: function () {
- layer.msg("网络异常");
- return false;
- }
- })
- });
- //删除
- $('body').delegate('#delPlan','click', function(){
- var businessKey = '<?php echo $list['processInfo']['businessKey'];?>';
- var doType = 'del';
- $.ajax({
- type: 'get',
- url: "<?php echo Yii::app()->createUrl('imsStore/ajaxOutDelStop');?>",
- data: {'businessKey': businessKey,doType:doType},
- dataType: 'json',
- success: function (data) {
- if (data.status) {
- layer.alert("提交成功", {icon: 1,closeBtn:0},function (index) {
- window.location.href = "<?php echo $this->createUrl('imsStore/newStock');?>";
- layer.closeAll();
- });
- } else {
- layer.alert(data.msg, {icon: 7});
- return false;
- }
- },
- error: function () {
- layer.msg("网络异常");
- return false;
- }
- })
- });
-
- //编辑
- $('body').delegate('.editPlan','click', function(){
- window.status = 1;
- $('.stocktakingDate').attr("active","true").attr("id",'stocktakingDate');
- $('.stocktakingDate').datetimepicker({
- format: "Y-m-d", //格式化日期
- timepicker: false //关闭时间选项
- });
- $('#imgPreview').attr("active","true");
- $('.img-title').css("display","inline-block");
- $('#remark').prop("readonly",false);
- $('.choose-pro,.reduce-count,.add-count').attr("active","true");
- $('input[name="plan-count"]').attr("readonly",false);
- $('#add-plan-identifier').css("display","inline-block");
- $(this).html("提交");
- $(this).removeClass("editPlan").addClass("edit-plan-identifier");
- $('#watchPlan,#delPlan').css("display","none");
- });
- ///////
- $('body').delegate('.choose-pro','click', function(){
- if(status == 1){
- var cssStr = "display:inline-block";
- }else{
- var cssStr = "display:none";
- }
- var planId = $(this).attr("planId");
- var originIds = $(this).attr("originIds");
- var selectIds = $(this).attr("selectIds");
- var active = $(this).attr("active");
- if(selectIds){
- var selectIdsArr = selectIds.split(",");
- }else{
- var selectIdsArr = [];
- }
- if(active == "false"){
- var disabledStr = "disabled='disabled'";
- }else{
- var disabledStr = '';
- }
- // if(planId){
- // $.ajax({
- // url: "<?php // echo Yii::app()->createUrl('imsStore/ajaxGetIdentifier')?>",
- // type: "post",
- // data: {'planId':planId},
- // dataType: 'json',
- // success: function (res) {
- // console.log(res);
- var html = "";
- // html += "<div class='pan-title'>盘点数量(<span class='pan-count'>0</span>)</div>";
- if(originIds){
- originIdsArr = originIds.split(",");
- html += "<div class='assets-number-list'>";
- for(var a = 0;a<originIdsArr.length;a++){
- if($.inArray(originIdsArr[a],selectIdsArr) > -1){
- html += "<label><input type='checkbox' name='need-plan' value='' checked='checked' "+disabledStr+"><input type='text' value='"+originIdsArr[a]+"' name='need-plan-name' class='input-layer-new-assets-number' readonly='readonly'></label>";
- }else{
- html += "<label><input type='checkbox' name='need-plan' value='' "+disabledStr+"><input type='text' value='"+originIdsArr[a]+"' name='need-plan-name' class='input-layer-new-assets-number' readonly='readonly'></label>";
- }
- }
- html += "</div>";
- }else{
- originIdsArr = [];
- }
- var html3 = "";
- if(selectIds){
- selectIdsArr = selectIds.split(",");
- var selectId = 1;
- var isSelect = 0;
- for(var b = 0;b<selectIdsArr.length;b++){
- if($.inArray(selectIdsArr[b],originIdsArr) < 0){
- isSelect = 1;
- if(selectId == 1){
- html3 += "<div class='new-assets-number-box'>";
- html3 += " <input type='checkbox' name='need-plan' value='' checked='checked' "+disabledStr+"><input type='text' value='"+selectIdsArr[b]+"' name='need-plan-name' class='input-new-assets-number' "+disabledStr+">";
- html3 += " <button type='button' class='new-add-plan' style='"+cssStr+"'>新盘点编号</button>";
- html3 += "</div>";
- selectId = 0;
- }else{
- html3 += "<div class='new-assets-number-box'><input type='checkbox' name='need-plan' value='' checked='checked' "+disabledStr+"><input type='text' value='"+selectIdsArr[b]+"' name='need-plan-name' class='input-new-assets-number' "+disabledStr+"></div>";
- }
- }
- }
- if(isSelect == 0){
- html3 += "<div class='new-assets-number-box'>";
- html3 += " <input type='checkbox' name='need-plan' value='' "+disabledStr+"><input type='text' value='' name='need-plan-name' class='input-new-assets-number' placeholder='输入新编号' "+disabledStr+">";
- html3 += " <button type='button' class='new-add-plan' style='"+cssStr+"'>新盘点编号</button>";
- html3 += "</div>";
- }
- }else{
- html3 += "<div class='new-assets-number-box'>";
- html3 += " <input type='checkbox' name='need-plan' value='' "+disabledStr+"><input type='text' value='' name='need-plan-name' class='input-new-assets-number' placeholder='输入新编号' "+disabledStr+">";
- html3 += " <button type='button' class='new-add-plan' style='"+cssStr+"'>新盘点编号</button>";
- html3 += "</div>";
- }
- $('.new-assets-number-box-parent').html(html3);
- // html += "<div class='new-assets-number-box'>";
- // html += " <input type='checkbox' name='need-plan' value=''><input type='text' value='' name='need-plan-name' class='input-new-assets-number' placeholder='输入新编号'>";
- // html += " <button type='button' class='new-add-plan'>新盘点编号</button>";
- // html += "</div>";
- // html += "<div class='dialog-btn-box'>";
- // html += ' <button type="button" class="back-plan btn-dialog-colse">返回</button>';
- // html +=' <button type="button" class="btn-dialog-save" id="add-plan-identifier" planId='+planId+'>提交</button>';
- // html += "</div>";
- $('.assets-number-list-parent').html(html);
- $('#add-plan-identifier').attr("planId",planId);
- var length = $('.dialog-layer-assets-number input:checked').length;
- $('.pan-count').html(length);
- layer.open({
- title: false,
- closeBtn: 0,
- type: 1,
- area: ['360px', '200px'],
- content: $(".dialog-layer-assets-number")
- });
-
- // }
- // })
- // }
-
- });
- $('body').delegate('.dialog-layer-assets-number input[type="checkbox"]','click', function(){
- var length = $('.dialog-layer-assets-number input:checked').length;
- $('.pan-count').html(length);
- });
- $('body').delegate('.btn-dialog-colse','click', function(){
- layer.close(layer.index);
- });
- $('body').delegate('.new-add-plan','click', function(){
- var html = "<div class='new-assets-number-box'><input type='checkbox' name='need-plan' value=''><input type='text' value='' name='need-plan-name' class='input-new-assets-number' placeholder='输入新编号'></div>";
- $(this).parent().after(html);
- });
- $('body').delegate('#add-plan-identifier','click', function(){
- var selectIdentifierIds = [];
- var originIdentifierIds = [];
- var planId = $(this).attr("planId");
- $('input[name="need-plan"]:checked').each(function(){
- if($(this).next().val()){
- selectIdentifierIds.push($(this).next().val());
- }
- });
- $('.assets-number-list input[name="need-plan-name"]').each(function(){
- originIdentifierIds.push($(this).val());
- })
- // if(selectIdentifierIds.length>0){
- $('.choose-pro[planId='+planId+']').html(selectIdentifierIds.length);
- // }
- $('.choose-pro[planId='+planId+']').attr("selectIds",selectIdentifierIds.join(","));
- $('.choose-pro[planId='+planId+']').attr("originIds",originIdentifierIds.join(","));
- layer.close(layer.index);
-
- console.log(selectIdentifierIds);
- })
- $('body').delegate('.add-count[active="true"]','click', function(){
- var count = parseInt($(this).prev().val());
- count += 1;
- $(this).prev().val(count);
- if($(this).parent().hasClass("inv-count")){
- var type = 6;
- }else{
- var type = 7;
- }
- var oldCount = parseInt($(this).parent().parent().prev().text());
- if(oldCount == count){
- $(this).parent().parent().parent().find("td:eq("+type+")").html('<span class="tag-table-product bg-yellow">平</span>');
- }else if(oldCount > count){
- $(this).parent().parent().parent().find("td:eq("+type+")").html('<span class="tag-table-product bg-red">亏</span>-'+(oldCount-count));
- }else if(oldCount < count){
- $(this).parent().parent().parent().find("td:eq("+type+")").html('<span class="tag-table-product bg-green">盈</span>+'+(count-oldCount));
- }
- });
- $('body').delegate('.reduce-count[active="true"]','click', function(){
- var count = parseInt($(this).next().val());
- if($(this).parent().hasClass("inv-count")){
- var type = 6;
- }else{
- var type = 7;
- }
- if(count >= 1){
- count -= 1;
- $(this).next().val(count);
- var oldCount = parseInt($(this).parent().parent().prev().text());
- if(oldCount == count){
- $(this).parent().parent().parent().find("td:eq("+type+")").html('<span class="tag-table-product bg-yellow">平</span>');
- }else if(oldCount > count){
- $(this).parent().parent().parent().find("td:eq("+type+")").html('<span class="tag-table-product bg-red">亏</span>-'+(oldCount-count));
- }else if(oldCount < count){
- $(this).parent().parent().parent().find("td:eq("+type+")").html('<span class="tag-table-product bg-green">盈</span>+'+(count-oldCount));
- }
-
- }
-
- });
- $('.plan-count').on('input propertychange', function() {
- var count = parseInt($(this).val());
- var oldCount = parseInt($(this).parent().parent().prev().text());
- if($(this).parent().hasClass("inv-count")){
- var type = 6;
- }else{
- var type = 7;
- }
- if(oldCount == count){
- $(this).parent().parent().parent().find("td:eq("+type+")").html('<span class="tag-table-product bg-yellow">平</span>');
- }else if(oldCount > count){
- $(this).parent().parent().parent().find("td:eq("+type+")").html('<span class="tag-table-product bg-red">亏</span>-'+(oldCount-count));
- }else if(oldCount < count){
- $(this).parent().parent().parent().find("td:eq("+type+")").html('<span class="tag-table-product bg-green">盈</span>+'+(count-oldCount));
- }
- });
- $('.asd[active="true"]').on('click',function(){
- console.log(6666)
- });
-
- //添加图片
- $("#fileImg").on("change", function () {
- //限制图片数量
- var imgObj = $('#imgPreview img');
- if(imgObj.length>=10){
- layer.msg("最多可上传10张图片");
- return false;
- }
- var formData = new FormData();
- formData.append('uploadFile', document.getElementById('fileImg').files[0]);
- if(document.getElementById('fileImg').files[0]==undefined){
- return false;
- }
- var basic = "<?php echo $basic;?>";
- $.ajax({
- url: "<?php echo $uploadUrl;?>",
- type: "post",
- data: formData,
- processData: false,
- contentType: false,
- beforeSend: function (req) {
- req.setRequestHeader("Authorization", basic);
- },
- success: function (data) {
- console.log(data);
- if (data.errCode == '00') {
- var html = "<img src='" + data.data.url + "'>";
- $('#imgPreview').append(html);
- $('#uploadImg').val('');
- } else {
- layer.msg(data.errMsg);
- }
- },
- error:function(data){
- console.log(data);
- }
- });
- });
- $("body").on("click", "#imgPreview[active='true'] img", function () {
- var obj = $(this);
- var imgUrl = $(this).attr('src');
- layer.confirm('您确定删除此图片吗?', {
- btn: ['确定', '取消'] //按钮
- }, function () {
- obj.remove();
- layer.closeAll();
- });
- });
- //提交
- $('body').delegate('.edit-plan-identifier','click', function(){
- var flag = true;
- if (flag){
- flag = false;
- var stockTitle = $.trim($("input[name='stockTitle']").val());
- var stocktakingDate = $("input[name='stocktakingDate']").val();
- var remark = $('#remark').val();
- var details = [];
- var isZero = 0;
- var no = 0;
- if (stockTitle == '') {
- layer.msg('标题名称不能为空!');
- return false;
- } else if (stockTitle.length > 49) {
- showMsg('标题名称不能超过50个字符!');
- return false;
- }
- if (!stocktakingDate) {
- layer.msg('时间不能为空!');
- return false;
- }
- var imgArr = [];
- $('#imgPreview img').each(function () {
- imgArr.push($(this).attr('src'));
- });
- if (imgArr.length < 1) {
- layer.msg('请上传图片!');
- return false;
- }
- //其他
- $('.no-fixed').each(function(){
- details[no] = {};
- details[no].fixedCodes = [];
- details[no].invFixedCodes = [];
- details[no].itemId = $(this).attr("itemId");
- details[no].stockNo = parseFloat($(this).find("td:eq(2)").find("input").val());
- details[no].theoreticalNo = parseFloat($(this).find("td:eq(1)").text());
- details[no].lossNo = accSub(parseFloat($(this).find("td:eq(2)").find("input").val()),parseFloat($(this).find("td:eq(1)").text()));
- details[no].scrapOld = parseFloat($(this).find("td:eq(3)").text());
- details[no].scrapNo = parseFloat($(this).find("td:eq(4)").find("input").val());
- details[no].scrapLoss = accSub(parseFloat($(this).find("td:eq(4)").find("input").val()),parseFloat($(this).find("td:eq(3)").text()));
- if(details[no].lossNo == 0){
- details[no].lossType = 2;
- }else if(details[no].lossNo > 0){
- details[no].lossType = 1;
- }else if(details[no].lossNo < 0){
- details[no].lossType = 0;
- }
- if(details[no].stockNo == 0){
- isZero = 1;
- }
- no++;
- });
- $('.fixed').each(function(){
- details[no] = {};
- if($(this).find("td:eq(2)").attr("selectIds")){
- details[no].fixedCodes = $(this).find("td:eq(2)").attr("selectIds").split(",");
- }else{
- details[no].fixedCodes = [];
- }
- if($(this).find("td:eq(2)").attr("originIds")){
- details[no].invFixedCodes = $(this).find("td:eq(2)").attr("originIds").split(",");
- }else{
- details[no].invFixedCodes = [];
- }
-
- details[no].itemId = $(this).attr("itemId");
- details[no].stockNo = parseFloat($(this).find("td:eq(2)").text());
- details[no].theoreticalNo = $(this).find("td:eq(1)").text();
- details[no].lossNo = accSub(parseFloat($(this).find("td:eq(2)").text()),$(this).find("td:eq(1)").text());
- if(details[no].lossNo == 0){
- details[no].lossType = 2;
- }else if(details[no].lossNo > 0){
- details[no].lossType = 1;
- }else if(details[no].lossNo < 0){
- details[no].lossType = 0;
- }
- if(details[no].stockNo == 0){
- isZero = 1;
- }
- no++;
- });
- //固定资产
- // var fixedCodesArr = [];
- // var inFixedCodesArr = [];
- // if (itemType.val()==0){
- // var fixedObj = $('input[name="fixedCodes"]:checked');
- // fixedObj.each(function () {
- // fixedCodesArr.push($(this).val());
- // });
- // var infixedObj = $('input[name="fixedCodes"]');
- // infixedObj.each(function () {
- // inFixedCodesArr.push($(this).val());
- // });
- // }
- var processInfo = '<?php echo json_encode($list['processInfo']);?>';
- var data = {
- stockTitle: stockTitle,
- stocktakingDate: stocktakingDate,
- imgArr: imgArr,
- remark:remark,
- details:details,
- processInfo:JSON.parse(processInfo),
- stockId:'<?php echo $list['stockId'];?>',
- pId:'<?php echo $_GET['planId']?>'
- };
- console.log(data);
- if(isZero == 1){
- layer.confirm('盘点数量有0值项,确定提交吗?', {
- btn: ['提交', '返回'] //按钮
- }, function () {
- $.ajax({
- type: 'POST',
- url: "<?php echo $this->createUrl('imsStore/ajaxNewStockEdit');?>",
- data: data,
- async: false,
- dataType: 'json',
- success: function (result) {
- if (result.status == 1) {
- layer.alert(result.msg, {icon: 1,closeBtn:0}, function () {
- window.location.href = "<?php echo $this->createUrl('imsStore/newStock');?>";
- })
- } else {
- flag = true;
- layer.alert(result.msg,{icon:2});
- }
- },
- error: function (jqXHR, textStatus, errorThrown) {
- /*错误信息处理*/
- flag = true;
- layer.msg('提交失败');
- }
- });
- },function(){
- layer.closeAll();
- });
- }else{
- layer.confirm('确认提交盘点单吗?', {
- btn: ['提交', '返回'] //按钮
- }, function () {
- $.ajax({
- type: 'POST',
- url: "<?php echo $this->createUrl('imsStore/ajaxNewStockEdit');?>",
- data: data,
- async: false,
- dataType: 'json',
- success: function (result) {
- if (result.status == 1) {
- layer.alert(result.msg, {icon: 1,closeBtn:0}, function () {
- window.location.href = "<?php echo $this->createUrl('imsStore/newStock');?>";
- })
- } else {
- flag = true;
- layer.alert(result.msg,{icon:2});
- }
- },
- error: function (jqXHR, textStatus, errorThrown) {
- /*错误信息处理*/
- flag = true;
- layer.msg('提交失败');
- }
- });
- },function(){
- layer.closeAll();
- });
- }
-
- } else {
- layer.msg("稍安勿躁,正在处理中...");
- }
- });
- //展示更多或收起
- $("body").on("click",".show-tr", function(){
- if($(this).hasClass("hide-tr")){
- $(this).prev().find("tr.need-hide").addClass("hide");
- $(this).html("展开更多");
- $(this).removeClass("hide-tr");
- }else{
- $(this).html("收起");
- $(this).addClass("hide-tr");
- $(this).prev().find("tr.need-hide").removeClass("hide");
- }
-
- });
- var accSub = function(num1, num2) {
- num1 = Number(num1);
- num2 = Number(num2);
- var dec1, dec2, times;
- try { dec1 = countDecimals(num1)+1; } catch (e) { dec1 = 0; }
- try { dec2 = countDecimals(num2)+1; } catch (e) { dec2 = 0; }
- times = Math.pow(10, Math.max(dec1, dec2));
- // var result = Number(((num1 * times - num2 * times) / times);
- var result = Number((accMul(num1, times) - accMul(num2, times)) / times);
- return getCorrectResult("sub", num1, num2, result);
- // return result;
- };
- function accMul(arg1,arg2)
- {
- var m=0,s1=arg1.toString(),s2=arg2.toString();
- try{m+=s1.split(".")[1].length}catch(e){}
- try{m+=s2.split(".")[1].length}catch(e){}
- return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m)
- }
- var countDecimals = function(num) {
- var len = 0;
- try {
- num = Number(num);
- var str = num.toString().toUpperCase();
- if (str.split('E').length === 2) { // scientific notation
- var isDecimal = false;
- if (str.split('.').length === 2) {
- str = str.split('.')[1];
- if (parseInt(str.split('E')[0]) !== 0) {
- isDecimal = true;
- }
- }
- let x = str.split('E');
- if (isDecimal) {
- len = x[0].length;
- }
- len -= parseInt(x[1]);
- } else if (str.split('.').length === 2) { // decimal
- if (parseInt(str.split('.')[1]) !== 0) {
- len = str.split('.')[1].length;
- }
- }
- } catch(e) {
- throw e;
- } finally {
- if (isNaN(len) || len < 0) {
- len = 0;
- }
- return len;
- }
- };
- var convertToInt = function(num) {
- num = Number(num);
- var newNum = num;
- var times = countDecimals(num);
- var temp_num = num.toString().toUpperCase();
- if (temp_num.split('E').length === 2) {
- newNum = Math.round(num * Math.pow(10, times));
- } else {
- newNum = Number(temp_num.replace(".", ""));
- }
- return newNum;
- };
- var getCorrectResult = function(type, num1, num2, result) {
- var temp_result = 0;
- switch (type) {
- case "add":
- temp_result = num1 + num2;
- break;
- case "sub":
- temp_result = num1 - num2;
- break;
- case "div":
- temp_result = num1 / num2;
- break;
- case "mul":
- temp_result = num1 * num2;
- break;
- }
- if (Math.abs(result - temp_result) > 1) {
- return temp_result;
- }
- return result;
- };
- </script>
- </body>
- </html>
|