editPayment.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>编辑回款反馈</title>
  6. <link href="/css/base.css" rel="stylesheet">
  7. <link href="/css/ims/ims.css" rel="stylesheet">
  8. <link rel="stylesheet" type="text/css" href="/css/ims/bootstrap.min.css"/>
  9. <link rel="stylesheet" type="text/css" href="/css/ims/ace.min.css"/>
  10. <link rel="stylesheet" type="text/css" href="/css/ims/jquery.datetimepicker.css"/>
  11. <link type="text/css" rel="stylesheet" href="/js/select/select2.min.css" />
  12. <style>
  13. p {
  14. margin: 0;
  15. padding: 0;
  16. }
  17. .ims-box {
  18. margin: 20px;
  19. }
  20. .screen {
  21. padding-left: 20px;
  22. height: 44px;
  23. line-height: 44px;
  24. background-color: #eff4fa;
  25. }
  26. .screen li {
  27. float: left;
  28. margin-right: 65px;
  29. }
  30. .bg-d9bf6e {
  31. margin-left: 5px;
  32. padding: 0 20px;
  33. color: #fff;
  34. background-color: #d9bf6e;
  35. }
  36. .list {
  37. padding: 0 40px;
  38. /*margin-top: 40px;*/
  39. overflow: hidden;
  40. }
  41. .list h2 {
  42. line-height: 30px;
  43. font-size: 14px;
  44. }
  45. .list .student-list_box {
  46. width: 300px;
  47. }
  48. .list .student-list_box > ul {
  49. height: 260px;
  50. overflow: auto;
  51. padding: 20px;
  52. background-color: #eef3ff;
  53. }
  54. .list .student-list_box li {
  55. line-height: 30px;
  56. cursor: pointer;
  57. }
  58. .list .student-selected_box {
  59. margin-left: 60px;
  60. }
  61. .list .student-list {
  62. display: none;
  63. margin-left: 20px;
  64. }
  65. .list .student-list li.active .btn-select_all {
  66. display: inline-block;
  67. }
  68. .list .student-list span {
  69. cursor: pointer;
  70. }
  71. .list .btn-select_all {
  72. margin-left: 84px;
  73. color: #008000;
  74. }
  75. .student-name_box li {
  76. position: relative;
  77. margin-left: 28px;
  78. line-height: 30px;
  79. }
  80. .student-name_box input {
  81. position: absolute;
  82. left: 155px;
  83. top: 8px;
  84. }
  85. .btn-select_all,
  86. .student-name_box {
  87. display: none;
  88. }
  89. .student-selected {
  90. width: 320px;
  91. height: 220px;
  92. overflow: auto;
  93. }
  94. .student-selected li {
  95. float: left;
  96. margin-right: 24px;
  97. margin-bottom: 12px;
  98. height: 26px;
  99. line-height: 26px;
  100. text-indent: 20px;
  101. background-color: #f2f2f2;
  102. }
  103. .student-selected .btn-delete {
  104. float: right;
  105. margin-right: 20px;
  106. color: red;
  107. cursor: pointer;
  108. }
  109. .btn-confirm_purchase {
  110. display: block;
  111. margin: 0 auto;
  112. margin-top: 100px;
  113. margin-bottom: 50px;
  114. width: 430px;
  115. line-height: 54px;
  116. color: #fff;
  117. font-family: PingFangSC-Regular, "PingFang SC";
  118. font-weight: 400;
  119. font-style: normal;
  120. font-size: 20px;
  121. text-align: center;
  122. background-color: rgba(0, 153, 102, 1);
  123. cursor: pointer;
  124. }
  125. #imgPreview {
  126. display: inline-block;
  127. margin-top: 12px;
  128. }
  129. #imgPreview > img {
  130. max-width: 100px;
  131. max-height: 100px;
  132. margin-right: 5px;
  133. }
  134. .layui-layer-btn .layui-layer-btn0 {
  135. border-color: #15ae68 !important;
  136. background-color: #15ae68 !important;
  137. color: #fff;
  138. }
  139. .stop-layer-box, .resubmit-layer-box, .delete-layer-box {
  140. line-height: 140px;
  141. text-align: center;
  142. }
  143. .table-center th,.table-center td{text-align:center;}
  144. .table-center .diy_select{float:none;display:inline-block;}
  145. .out-count-div{display:inline-block;}
  146. .out-count-div a{display:inline-block;width:20px;height:20px;text-align:center;line-height:20px; background:#999;color:#fff;cursor:pointer}
  147. .out-count-div a:hover{background:#666;}
  148. .out-count-div span{margin-left:10px;}
  149. .activePage{display: inline-block;width: 30px;height: 30px;background: #0e8e54;text-align: center;line-height: 30px;color:#fff;margin-right: 10px;}
  150. .page{display: inline-block;width: 30px;height: 30px;border:1px solid #0e8e54;text-align: center;line-height: 30px;color:#000;margin-right: 10px;}
  151. </style>
  152. </head>
  153. <body>
  154. <h3 class="sale-title">编辑</h3>
  155. <form action="<?php echo $this->createUrl('imsSale/newPayment')?>" method="post" id="formSubmit">
  156. <div class="sale-table">
  157. <div style="margin-bottom:15px;color: red">
  158. <p>1,使用人数和打印人数每次填写总人数</p>
  159. <p>2,如果是退款,收费人数和收费金额填写负数</p>
  160. <p>3,请谨慎填写所有信息</p>
  161. <p>4、作废回款反馈信息,请把各个数量及金额改为0,并提交申请。</p>
  162. </div>
  163. <table width="100%">
  164. <tr>
  165. <th>销售订单号</th>
  166. <td colspan="3">
  167. <select name="orderId" id="orderId" class="projSelect" style="width: 300px;">
  168. <option value="0">销售订单号</option>
  169. <?php
  170. if(isset($orderList) && $orderList){
  171. foreach ($orderList as $val){
  172. if($data['orderId']==$val['orderId']){
  173. echo '<option value="'.$val['orderId'].'" selected>'.$val['orderNo'].'</option>';
  174. }else{
  175. echo '<option value="'.$val['orderId'].'" >'.$val['orderNo'].'</option>';
  176. }
  177. }
  178. }
  179. ?>
  180. </select>
  181. </td>
  182. </tr>
  183. <tr>
  184. <th><em class="red">*</em>学年</th>
  185. <td>
  186. <select name="schoolYearId" id="schoolYearId" style="width: 100px;">
  187. <option value="0">选择学年</option>
  188. <?php if(isset($schoolYear) && $schoolYear):?>
  189. <?php foreach ($schoolYear as $key => $value): ?>
  190. <option data-id="<?php echo (strtotime($value['firstSemesterBegin']) < time()) && (time() < strtotime($value['secondSemesterEnd'])) ? 1 : 0; ?>" value="<?php echo $value['schoolYearId']; ?>" <?php if($data['schoolYearId']==$value['schoolYearId']) echo 'selected';?>><?php echo $value['schoolYearName']; ?></option>
  191. <?php endforeach; ?>
  192. <?php endif;?>
  193. </select>
  194. </td>
  195. <th><em class="red">*</em>学期</th>
  196. <td>
  197. <select name="semester" id="semester" style="width: 100px;">
  198. <option value="0">选择学期</option>
  199. <option value="1" <?php if(isset($data['semester']) && ($data['semester']+1)==1) echo 'selected';?>>上学期</option>
  200. <option value="2" <?php if(isset($data['semester']) && ($data['semester']+1)==2) echo 'selected';?>>下学期</option>
  201. <option value="3" <?php if(isset($data['semester']) && ($data['semester']+1)==3) echo 'selected';?>>跨学期</option>
  202. </select>
  203. </td>
  204. </tr>
  205. <tr>
  206. <th><em class="red">*</em>年级</th>
  207. <td>
  208. <select name="grade" id="grade" style="width: 100px;">
  209. <option value="0">选择年级</option>
  210. <option value="1" <?php if(isset($data['grade']) && $data['grade']==1) echo 'selected';?>>高一</option>
  211. <option value="2" <?php if(isset($data['grade']) && $data['grade']==2) echo 'selected';?>>高二</option>
  212. <option value="3" <?php if(isset($data['grade']) && $data['grade']==3) echo 'selected';?>>高三</option>
  213. </select>
  214. </td>
  215. <th><em class="red">*</em>商品</th>
  216. <td>
  217. <select name="goodsId" id="goodsId" style="width: 100px;">
  218. <option value="0">选择商品</option>
  219. <?php if ($goodList): ?>
  220. <?php foreach ($goodList as $good): ?>
  221. <option value="<?php echo $good['goodsId'] ?>" <?php if($data['goodsId']==$good['goodsId']) echo 'selected';?>><?php echo $good['goodsName'] ?></option>
  222. <?php endforeach; ?>
  223. <?php endif; ?>
  224. </select>
  225. </td>
  226. </tr>
  227. <tr>
  228. <th><em class="red">*</em>使用人数</th>
  229. <td colspan="3"> <input type="text" placeholder="使用人数" class="int_number_check" name="use_person" value="<?php echo $data['useNum'];?>">人</td>
  230. </tr>
  231. <tr>
  232. <th><em class="red">*</em>打印人数</th>
  233. <td colspan="3"> <input type="text" placeholder="打印人数" class="int_number_check" name="down_person" value="<?php echo $data['downloadNum'];?>">人</td>
  234. </tr>
  235. <tr>
  236. <th><em class="red">*</em>收费单价</th>
  237. <td colspan="3"> <input type="text" placeholder="收费单价" class="float_number_check" name="price" value="<?php echo sprintf("%.2f",$data['price']);?>">元</td>
  238. </tr>
  239. <tr>
  240. <th><em class="red">*</em>上学期收费人数</th>
  241. <td > <input type="text" placeholder="收费人数" class="negative_number_check" name="feeNumUp" value="<?php echo $data['feeNumUp'];?>">人 <span class="red">如果是退款,请填写负数</span></td>
  242. <th><em class="red">*</em>下学期收费人数</th>
  243. <td > <input type="text" placeholder="收费人数" class="negative_number_check" name="feeNumDown" value="<?php echo $data['feeNumDown'];?>">人 <span class="red">如果是退款,请填写负数</span></td>
  244. </tr>
  245. <tr>
  246. <th><em class="red">*</em>上学期收费金额</th>
  247. <td > <input type="text" placeholder="收费金额" class="float_number_check" name="priceSumUp" value="<?php echo sprintf("%.2f",$data['priceSumUp']);?>">元 <span class="red">如果是退款,请填写负数</span></td>
  248. <th><em class="red">*</em>下学期收费金额</th>
  249. <td > <input type="text" placeholder="收费金额" class="float_number_check" name="priceSumDown" value="<?php echo sprintf("%.2f",$data['priceSumDown']);?>">元 <span class="red">如果是退款,请填写负数</span></td>
  250. </tr>
  251. <tr>
  252. <th><em class="red">*</em>收费时间</th>
  253. <td colspan="3"> <input readonly type="text" class="some_class" placeholder="收费时间" name="charge_time" value="<?php echo $data['feeTime'];?>""></td>
  254. </tr>
  255. <tr>
  256. <th>汇款时间</th>
  257. <td colspan="3"> <input readonly type="text" class="some_class" placeholder="汇款时间" name="pay_time" value="<?php echo $data['remitDate'];?>""></td>
  258. </tr>
  259. <tr>
  260. <th>备注</th>
  261. <td colspan="3">
  262. <textarea rows="5" cols="50" class="use-explain" name="mark"><?php echo $data['remark'];?></textarea>
  263. </td>
  264. </tr>
  265. </table>
  266. <div class="sale-submit">
  267. <input type="hidden" name="id" value="<?php echo $data['bcId']?>">
  268. <button type="button" class="label-primary-cancle">取消</button>
  269. <button type="button" class="label-primary-s bth-s" >保存</button>
  270. </div>
  271. </div>
  272. </form>
  273. <script src="/js/productset/jquery.min.js"></script>
  274. <script src="/js/ims/jquery.datetimepicker.js"></script>
  275. <script src="/js/ims/layer/layer.js"></script>
  276. <script src="/js/ims/xsgl.js"></script>
  277. <script src="/js/select/select2.min.js"></script>
  278. <script>
  279. $(document).ready(function(){
  280. $('.projSelect').select2();
  281. var orderArr=[];
  282. <?php
  283. if(isset($orderList) && $orderList) {
  284. foreach ($orderList as $val) {
  285. echo 'var temp={};';
  286. echo 'temp.grade='.$val['grade'].';';
  287. echo 'temp.goodsId="'.$val['goodsId'].'";';
  288. echo 'temp.schoolYearId="'.$val['schoolYearId'].'";';
  289. echo 'temp.semesterName="'.$val['semesterName'].'";';
  290. echo 'temp.orderId="'.$val['orderId'].'";';
  291. echo "orderArr.push(temp);";
  292. }
  293. }
  294. ?>
  295. $('.label-primary-cancle').click(function(){
  296. window.location.href="<?php echo $this->createUrl('imsSale/payment')?>";
  297. });
  298. $('.some_class').datetimepicker({
  299. format: "Y-m-d", //格式化日期
  300. timepicker: false //关闭时间选项
  301. });
  302. // $('.float_number_check').change(function(){
  303. // $(this).val($(this).val().replace(/[^\d.+]/g,""));
  304. // });
  305. $('.negative_number_check').change(function(){
  306. $(this).val($(this).val().replace(/[^\d-+]/g,""));
  307. });
  308. $('.int_number_check').change(function(){
  309. $(this).val($(this).val().replace(/[^\d+]/g,""));
  310. });
  311. $('.bth-s').click(function(){
  312. if($('#schoolYearId').val()==0){
  313. layer.msg('请选择学年');
  314. return false;
  315. }
  316. if($('#semester').val()==0){
  317. layer.msg('请选择学期');
  318. return false;
  319. }
  320. if($('#grade').val()==0){
  321. layer.msg('请选择年级');
  322. return false;
  323. }
  324. if($('#goodsId').val()==0){
  325. layer.msg('请选择商品');
  326. return false;
  327. }
  328. if($('input[name=use_person]').val()=="" ){
  329. layer.msg('请输入使用人数');
  330. return false;
  331. }
  332. if(!$.isNumeric($('input[name=use_person]').val())){
  333. layer.msg('使用人数不正确');
  334. return false;
  335. }
  336. if($('input[name=down_person]').val()=="" ){
  337. layer.msg('请输入打印人数');
  338. return false;
  339. }
  340. if(!$.isNumeric($('input[name=down_person]').val())){
  341. layer.msg('打印人数不正确');
  342. return false;
  343. }
  344. if($('input[name=price]').val()=="" ){
  345. layer.msg('请输入收费单价');
  346. return false;
  347. }
  348. if(isNaN($('input[name=price]').val()) || parseFloat($('input[name=price]').val())<0){
  349. layer.msg('收费单价格式不正确');
  350. return false;
  351. }
  352. if($('#semester').val()==1){
  353. feeNum=$('input[name=feeNumUp]').val();
  354. priceSum=$('input[name=priceSumUp]').val();
  355. if(feeNum==""){
  356. layer.msg('请输入收费人数');
  357. return false;
  358. }
  359. if(!$.isNumeric(feeNum)){
  360. layer.msg('收费人数不正确');
  361. return false;
  362. }
  363. if(priceSum=="" ){
  364. layer.msg('请输入收费金额');
  365. return false;
  366. }
  367. if(isNaN(priceSum)){
  368. layer.msg('收费金额格式不正确');
  369. return false;
  370. }
  371. }else if($('#semester').val()==2){
  372. feeNum=$('input[name=feeNumDown]').val();
  373. priceSum=$('input[name=priceSumDown]').val();
  374. if(feeNum==""){
  375. layer.msg('请输入收费人数');
  376. return false;
  377. }
  378. if(!$.isNumeric(feeNum)){
  379. layer.msg('收费人数不正确');
  380. return false;
  381. }
  382. if(priceSum=="" ){
  383. layer.msg('请输入收费金额');
  384. return false;
  385. }
  386. if(isNaN(priceSum)){
  387. layer.msg('收费金额格式不正确');
  388. return false;
  389. }
  390. }else{
  391. feeNumUp=$('input[name=feeNumUp]').val();
  392. priceUp=$('input[name=priceSumUp]').val();
  393. feeNumDown=$('input[name=feeNumDown]').val();
  394. priceDown=$('input[name=priceSumDown]').val();
  395. if((feeNumUp=="" || !$.isNumeric(feeNumUp)) && (feeNumDown=="" || !$.isNumeric(feeNumDown))){
  396. console.log(feeNumUp);
  397. console.log(feeNumDown);
  398. layer.msg('收费人数不正确');
  399. return false;
  400. }
  401. if((priceUp=="" || isNaN(priceUp)) && (priceDown=="" || isNaN(priceDown)) ){
  402. layer.msg('收费金额格式不正确');
  403. return false;
  404. }
  405. }
  406. if($('input[name=charge_time]').val()==''){
  407. layer.msg('请输入收费时间');
  408. return false;
  409. }
  410. $(this).attr('disabled',true);
  411. if($('#schoolYearId').find("option:selected").attr('data-id') == 0){
  412. layer.confirm('当前时间不属于所选学年,确定保存嘛?', {
  413. btn: ['确定','取消'] //按钮
  414. },function(){
  415. $('#formSubmit').submit();
  416. });
  417. }else{
  418. $('#formSubmit').submit();
  419. }
  420. });
  421. $('#orderId').change(function(){
  422. orderId=$(this).val();
  423. $.each(orderArr,function (i,val) {
  424. if(val.orderId==orderId){
  425. $('#grade').val(val.grade);
  426. $('#schoolYearId').val(val.schoolYearId);
  427. $('#goodsId').val(val.goodsId);
  428. if(val.semesterName=='上学期'){
  429. $('#semester').val(1);
  430. changeSemester(1);
  431. }else if(val.semesterName=='下学期'){
  432. $('#semester').val(2);
  433. changeSemester(2);
  434. }else if(val.semesterName=='跨学期'){
  435. $('#semester').val(3);
  436. changeSemester(3);
  437. }
  438. }
  439. })
  440. });
  441. })
  442. $('#semester').change(function(){
  443. val=$(this).val();
  444. changeSemester(val)
  445. });
  446. function changeSemester(val){
  447. if(val==1){
  448. $('input[name=feeNumUp]').attr('readonly',false);
  449. $('input[name=priceSumUp]').attr('readonly',false);
  450. $('input[name=feeNumDown]').attr('readonly',true);
  451. $('input[name=priceSumDown]').attr('readonly',true);
  452. $('input[name=feeNumDown]').val(0);
  453. $('input[name=priceSumDown]').val(0);
  454. }else if(val==2){
  455. $('input[name=feeNumUp]').attr('readonly',true);
  456. $('input[name=priceSumUp]').attr('readonly',true);
  457. $('input[name=feeNumDown]').attr('readonly',false);
  458. $('input[name=priceSumDown]').attr('readonly',false);
  459. $('input[name=feeNumUp]').val(0);
  460. $('input[name=priceSumUp]').val(0);
  461. }else if(val==3){
  462. $('input[name=feeNumUp]').attr('readonly',false);
  463. $('input[name=priceSumUp]').attr('readonly',false);
  464. $('input[name=feeNumDown]').attr('readonly',false);
  465. $('input[name=priceSumDown]').attr('readonly',false);
  466. }
  467. }
  468. </script>
  469. </body>
  470. </html>