deliverGoods.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  6. <title>发货</title>
  7. <meta name="description" content="">
  8. <meta name="keywords" content="">
  9. <link href="/css/base.css" rel="stylesheet">
  10. <link href="/css/ims/ims.css" rel="stylesheet">
  11. <link rel="stylesheet" type="text/css" href="/css/ims/bootstrap.min.css" />
  12. <link rel="stylesheet" type="text/css" href="/css/ims/ace.min.css" />
  13. <style>
  14. .ims-box {
  15. margin: 20px;
  16. }
  17. .screen>div {
  18. margin-right: 30px;
  19. }
  20. .screen>span{
  21. line-height: 30px;
  22. margin-right:5px;
  23. }
  24. .screen button {
  25. padding: 4px 12px;
  26. }
  27. .table-box {
  28. margin-top: 30px;
  29. }
  30. .table-box table,
  31. .table-box table th {
  32. text-align: center;
  33. }
  34. .table>tbody>tr>td{
  35. vertical-align: middle;
  36. }
  37. .yellow{
  38. color: #FF9900;
  39. }
  40. .table-box a{
  41. color: blue
  42. }
  43. .red {
  44. color: red;
  45. }
  46. .yellow {
  47. color: #FF9900;
  48. }
  49. .ims-box {
  50. margin: 20px;
  51. }
  52. .screen > div {
  53. margin-right: 5px;
  54. }
  55. .screen button {
  56. padding: 4px 12px;
  57. }
  58. .table-box {
  59. margin-top: 30px;
  60. }
  61. .table-box table,
  62. .table-box table th {
  63. text-align: center;
  64. }
  65. .table-box button {
  66. margin-right: 5px;
  67. }
  68. .stop-layer-box, .resubmit-layer-box, .delete-layer-box {
  69. line-height: 140px;
  70. text-align: center;
  71. }
  72. .resubmit-layer-box input {
  73. line-height: 20px;
  74. }
  75. .urge-layer-box {
  76. margin-top: 30px;
  77. margin-left: 30px;
  78. }
  79. .urge-layer-box textarea {
  80. margin-left: 15px;
  81. vertical-align: top;
  82. }
  83. .dialog-information-inquiry{
  84. display: none;
  85. width: 400px;
  86. margin: 0 auto;
  87. border: 1px solid #f1f1f1;
  88. /*box-shadow:4px 4px 10px #7c7c7c;*/
  89. }
  90. .dialog-information-inquiry .title{
  91. padding: 0 16px;
  92. height: 30px;
  93. line-height: 30px;
  94. background-color: #2977ff;
  95. }
  96. .dialog-information-inquiry .title .title-text{
  97. font-size: 18px;
  98. color: #fff;
  99. font-weight: 650px;
  100. }
  101. .dialog-information-inquiry .title .title-tag{
  102. display: inline-block;
  103. margin-right: 20px;
  104. margin-top: 10px;
  105. padding: 6px 12px;
  106. height: 16px;
  107. line-height: 16px;
  108. color: #fff;
  109. border: 1px solid #F8F8FA;
  110. border-radius: 4px;
  111. background-color: #2977ff;
  112. cursor: pointer;
  113. }
  114. .dialog-information-inquiry .dialog-btn-close{
  115. display: inline-block;
  116. color: #fff;
  117. cursor: pointer;
  118. }
  119. .dialog-information-inquiry .dialog-msg{
  120. margin: 20px 0;
  121. text-align: center;
  122. line-height: 20px;
  123. font-size: 16px;
  124. }
  125. .dialog-information-inquiry .btn-box{
  126. margin-bottom: 28px;
  127. text-align: center;
  128. }
  129. .dialog-information-inquiry .btn-yes{
  130. display: inline-block;
  131. /* padding: 6px 12px; */
  132. width:90px;
  133. height: 30px;
  134. line-height: 30px;
  135. border-radius: 4px;
  136. color: #fff;
  137. cursor: pointer;
  138. background-color: #2977ff;
  139. }
  140. #imgPreview {
  141. display: inline-block;
  142. margin-top: 12px;
  143. }
  144. #imgPreview > img {
  145. max-width: 100px;
  146. max-height: 100px;
  147. margin-right: 5px;
  148. }
  149. </style>
  150. </head>
  151. <body>
  152. <div class="ims-box">
  153. <div class="table-box ">
  154. <span>调拨明细</span>
  155. <table id="record-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px">
  156. <thead>
  157. <tr>
  158. <th>品目名称</th>
  159. <th>规格</th>
  160. <th>申请数量</th>
  161. <th>单位</th>
  162. <th>状态</th>
  163. <th>操作</th>
  164. </tr>
  165. </thead>
  166. <tbody>
  167. <?php if ($allocateDetail):?>
  168. <?php foreach($allocateDetail as $v):?>
  169. <tr>
  170. <td><?php echo $v['itemName'];?></td>
  171. <td><?php echo $v['itemSpec'];?></td>
  172. <td class="yellow"><?php echo $v['applyNo'];?></td>
  173. <td class="yellow"><?php echo $v['unitName']?></td>
  174. <td><?php echo $v['deliveryStatusName'];?></td>
  175. <td>
  176. <?php if($v['deliveryStatusName']=='待处理'):?>
  177. <a href="#" applyNo="<?php echo $v['applyNo']?>" atType="<?php echo $atType?>" atDetailId="<?php echo $v['atDetailId']?>" itemId="<?php echo $v['itemId']?>" class="confirmBtn">确认发货</a>
  178. <?php endif;?>
  179. </td>
  180. </tr>
  181. <?php endforeach;?>
  182. <?php endif;?>
  183. </tbody>
  184. </table>
  185. <span>发货记录</span>
  186. <table id="record-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px">
  187. <thead>
  188. <tr>
  189. <th>品目名称</th>
  190. <th>规格</th>
  191. <th>发货数量</th>
  192. <th>标准单位</th>
  193. </tr>
  194. </thead>
  195. <tbody>
  196. <?php if ($sendData):?>
  197. <?php foreach($sendData as $v):?>
  198. <tr>
  199. <td><?php echo $v['itemName'];?></td>
  200. <td><?php echo $v['itemSpec'];?></td>
  201. <td><?php echo $v['no'];?></td>
  202. <td><?php echo $v['unitName']?></td>
  203. </tr>
  204. <?php endforeach;?>
  205. <?php endif;?>
  206. </tbody>
  207. </table>
  208. </div>
  209. </div>
  210. <!-- 确认发货 -->
  211. <style>
  212. *{padding:0px;margin:0px;font-family:微软雅黑}
  213. ul,li,ol{list-style-type:none;}
  214. .clearfix:after{clear:both;overflow:hidden;content:"";display:block;}
  215. input ,button{outline:none;}
  216. .position-r{position:relative}
  217. .fl{float:left;}
  218. .fr{float:right;}
  219. .mt5{margin-top:5px;}
  220. .mt10{margin-top:10px;}
  221. .mt20{margin-top:20px;}
  222. .ml15{margin-left:15px;}
  223. .mr15{margin-right:15px;}
  224. .font_bold{font-weight:bold;}
  225. .choseImg{cursor:pointer;}
  226. .ttd{background:url(/images/back-d.png) center repeat;width:100%;height:100%;position:fixed;top:0px;z-index:999}
  227. .s-state{width:380px;background:#fff;margin:2% auto 0 auto;}
  228. .hint_size{height:45px;width:90%;color:#333;line-height:45px;margin:0px auto;border-bottom:1px solid #ccc;}
  229. .mistake_character{text-align:left;color:#606060;font-size:14px;padding:0px 0px 28px 0px;width:90%;margin:0px auto;}
  230. .roger{width:100px;height:35px;border:1px solid #15ae68;background:#15ae68;color:#fff;font-size:16px;cursor:pointer;}
  231. .rogergb{background:#ccc;border:1px solid #ccc;}
  232. .allTeacher{width:164px;height:30px;border:1px solid #ccc;border-radius:6px;margin-top:10px;}
  233. button.wordBtn{background:#50d2c2;color:#fff;width:120px;height:30px;border:1px solid #50d2c2;cursor:pointer;border-radius:4px;margin-left: 15px;}
  234. #uploadImgList{
  235. height:120px;
  236. overflow: scroll;
  237. }
  238. </style>
  239. <div class="ttd" style="display: none;">
  240. <div class="s-state clearfix posirela">
  241. <div class="hint_size clearfix">
  242. <span class="fl ml15">确认发货</span>
  243. </div>
  244. <table id="record-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px">
  245. <tr>
  246. <td style="width: 100px;padding-right:5px;">已发货数量:</td>
  247. <td>0</td>
  248. </tr>
  249. <tr>
  250. <td>发货数量:</td>
  251. <td><input type="text" name="sendNo" readonly value=""></td>
  252. </tr>
  253. <tr>
  254. <td>物流公司:</td>
  255. <td>
  256. <select id="logisticsName">
  257. <option value="">选择物流公司</option>
  258. <?php
  259. if($express){
  260. foreach ($express as $v){
  261. echo '<option value="'.$v['dictCode'].'">'.$v['name'].'</option>>';
  262. }
  263. }
  264. ?>
  265. </select>
  266. </td>
  267. </tr>
  268. <tr>
  269. <td>物流单号:</td>
  270. <td><input type="text" name="logisticsCode" value="" ></td>
  271. </tr>
  272. <tr class="fixedCodes">
  273. <td>固定资产编号 :</td>
  274. <td >
  275. <div id="fixCodesDiv" style="height:80px; overflow: scroll;">
  276. </div>
  277. </td>
  278. </tr>
  279. <tr>
  280. <th><em class="red">*</em>快递照片</th>
  281. <td colspan="3" >
  282. <label class="add-img">
  283. <span>+</span>
  284. <input type="file" id="uploadImg" accept="image/*" style="display: none;"/>
  285. </label>
  286. <span>图片上传</span>
  287. <div id="uploadImgList">
  288. <div id="oldImg">
  289. <?php
  290. if(isset($images)){
  291. foreach ($images as $v){
  292. echo '<img src="'.$v.'" width="90">';
  293. }
  294. }
  295. ?>
  296. </div>
  297. <div id="imgPreview"></div>
  298. </div>
  299. </td>
  300. </tr>
  301. </table>
  302. <div class="mistake_character clearfix">
  303. <div class="clearfix" style="width:300px;margin:0px auto;">
  304. <input type="hidden" name="atDetailId" value="">
  305. <input type="hidden" name="itemId" value="">
  306. <input type="hidden" name="applyNo" value="">
  307. <input type="hidden" name="atType" value="">
  308. <p class="fl"><button class="roger shut" id="btnSubmit">确定</button></p>
  309. <p class="fr"><button class="roger shut rogergb" id="btnClose">取消</button></p>
  310. </div>
  311. </div>
  312. </div>
  313. </div>
  314. <script src="/js/productset/jquery.min.js"></script>
  315. <script src="/js/ims/xsgl.js"></script>
  316. <script src="/js/ims/jquery.datetimepicker.js"></script>
  317. <link rel="stylesheet" type="text/css" href="/css/ims/jquery.datetimepicker.css"/>
  318. <script>
  319. $(document).ready(function() {
  320. $('.confirmBtn').click(function(){
  321. var itemId=$(this).attr('itemId'),
  322. atDetailId=$(this).attr('atDetailId'),
  323. applyNo=$(this).attr('applyNo'),
  324. atType=$(this).attr('atType');
  325. //固定资产编号
  326. if(atType==0){
  327. $.ajax({
  328. url:'<?php echo $this->createUrl('imsStore/getFixedAssetsNo')?>',
  329. type:'POST',
  330. dataType:'json',
  331. data:{itemId:itemId},
  332. success:function (res) {
  333. if(res.status==1){
  334. $('input[name=atDetailId]').val(atDetailId);
  335. $('input[name=itemId]').val(itemId);
  336. $('input[name=applyNo]').val(applyNo);
  337. $('input[name=atType]').val(atType);
  338. $('input[name=sendNo]').val(applyNo);
  339. $('.fixedCodes').show();
  340. if(res.data.length>0){
  341. html='';
  342. $.each(res.data,function(i,v){
  343. html+='<input type="checkbox" value="'+v+'" name="fixedCodes">'+v;
  344. })
  345. $('#fixCodesDiv').html(html);
  346. }
  347. $('.ttd').show()
  348. }
  349. }
  350. });
  351. }else{
  352. $('input[name=atDetailId]').val(atDetailId);
  353. $('input[name=itemId]').val(itemId);
  354. $('input[name=applyNo]').val(applyNo);
  355. $('input[name=atType]').val(atType);
  356. $('input[name=sendNo]').val(applyNo);
  357. $('.fixedCodes').hide()
  358. $('.ttd').show()
  359. }
  360. });
  361. //确认发货
  362. $('#btnSubmit').click(function(){
  363. var atDetailId= $('input[name=atDetailId]').val();
  364. var logisticsCode= $('input[name=logisticsCode]').val();
  365. var logisticsName= $('#logisticsName').val();
  366. var fixedCodes= [];
  367. var no= parseInt($('input[name=sendNo]').val());
  368. var applyNo=$('input[name=applyNo]').val();
  369. var atType=$('input[name=atType]').val();
  370. $('input[name=fixedCodes]:checked').each(function() {
  371. fixedCodes.push($(this).val())
  372. });
  373. if(no<1 || isNaN(no)){
  374. layer.msg('发货数量不正确');
  375. return false;
  376. }
  377. if(logisticsName==""){
  378. layer.msg('请选择物流公司');
  379. return false;
  380. }
  381. if(logisticsCode==""){
  382. layer.msg('请填写物流单号');
  383. return false;
  384. }
  385. if(fixedCodes.length!=parseInt(no) && atType==0){
  386. layer.msg('发货数量和资产编号不一致');
  387. return false;
  388. }
  389. if(no>applyNo){
  390. layer.msg('发货数量不能大于申请数量');
  391. return false;
  392. }
  393. var imgArr = [];
  394. $('#imgPreview img').each(function () {
  395. imgArr.push($(this).attr('src'));
  396. });
  397. var oldImg=[];
  398. $('#oldImg img').each(function () {
  399. oldImg.push($(this).attr('src'));
  400. });
  401. if (imgArr.length <= 0 && oldImg.length <= 0) {
  402. layer.msg('请上传快递照片');
  403. return false;
  404. }
  405. data={
  406. atDetailId:atDetailId,
  407. logisticsCode:logisticsCode,
  408. logisticsName:logisticsName,
  409. fixedCodes:fixedCodes,
  410. no:no,
  411. imgUrls:imgArr
  412. }
  413. $.ajax({
  414. url:'<?php echo $this->createUrl('imsStore/confirmDeliver')?>',
  415. type:'POST',
  416. dataType:'json',
  417. data:data,
  418. success:function (res) {
  419. if(res.status==1){
  420. layer.msg('发货成功')
  421. window.location.reload();
  422. }else{
  423. if(res.msg!=undefined){
  424. layer.msg(res.msg)
  425. }else{
  426. layer.msg('发货失败')
  427. }
  428. }
  429. }
  430. });
  431. });
  432. $('#btnClose').click(function(){
  433. $('#imgPreview').html('');
  434. $('.ttd').hide()
  435. });
  436. // 添加图片
  437. $("#uploadImg").on("change", function () {
  438. //限制图片数量
  439. var imgObj = $('#imgPreview img');
  440. var formData = new FormData();
  441. formData.append('uploadFile', document.getElementById('uploadImg').files[0]);
  442. if(document.getElementById('uploadImg').files[0]==undefined){
  443. return false;
  444. }
  445. var basic = "<?php echo $basic;?>";
  446. $.ajax({
  447. url: "<?php echo $uploadUrl;?>",
  448. type: "post",
  449. data: formData,
  450. processData: false,
  451. contentType: false,
  452. beforeSend: function (req) {
  453. req.setRequestHeader("Authorization", basic);
  454. },
  455. success: function (data) {
  456. console.log(data);
  457. if (data.errCode == '00') {
  458. var html = "<img src='" + data.data.url + "' width='90'>";
  459. $('#imgPreview').append(html);
  460. $('#uploadImg').val('');
  461. } else {
  462. layer.msg(data.errMsg);
  463. }
  464. }
  465. });
  466. });
  467. });
  468. </script>
  469. </body>
  470. </html>