newPayment.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  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="" 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. </div>
  162. <table width="100%">
  163. <tr>
  164. <th>销售订单号</th>
  165. <td colspan="3">
  166. <select name="orderId" id="orderId" class="projSelect" style="width: 300px;">
  167. <option value="0">销售订单号</option>
  168. <?php
  169. if(isset($orderList) && $orderList){
  170. foreach ($orderList as $val){
  171. echo '<option value="'.$val['orderId'].'" >'.$val['orderNo'].'</option>';
  172. }
  173. }
  174. ?>
  175. </select>
  176. </td>
  177. </tr>
  178. <tr>
  179. <th><em class="red">*</em>学年</th>
  180. <td>
  181. <select name="schoolYearId" id="schoolYearId" style="width: 100px;">
  182. <option value="0">选择学年</option>
  183. <?php if(isset($schoolYear) && $schoolYear):?>
  184. <?php foreach ($schoolYear as $key => $value): ?>
  185. <option data-id="<?php echo (strtotime($value['firstSemesterBegin']) < time()) && (time() < strtotime($value['secondSemesterEnd'])) ? 1 : 0; ?>" value="<?php echo $value['schoolYearId']; ?>"><?php echo $value['schoolYearName']; ?></option>
  186. <?php endforeach; ?>
  187. <?php endif;?>
  188. </select>
  189. </td>
  190. <th><em class="red">*</em>收费学期</th>
  191. <td>
  192. <select name="semester" id="semester" style="width: 100px;">
  193. <option value="0">选择学期</option>
  194. <option value="1" <?php if(isset($grade) && $grade==1) echo 'selected';?>>上学期</option>
  195. <option value="2" <?php if(isset($grade) && $grade==2) echo 'selected';?>>下学期</option>
  196. <option value="3" <?php if(isset($grade) && $grade==3) echo 'selected';?>>跨学期</option>
  197. </select>
  198. </td>
  199. </tr>
  200. <tr>
  201. <th><em class="red">*</em>年级</th>
  202. <td>
  203. <select name="grade" id="grade" style="width: 100px;">
  204. <option value="0">选择年级</option>
  205. <option value="1">高一</option>
  206. <option value="2">高二</option>
  207. <option value="3">高三</option>
  208. </select>
  209. </td>
  210. <th><em class="red">*</em>商品</th>
  211. <td>
  212. <select name="goodsId" id="goodsId" style="width: 100px;">
  213. <option value="0">选择商品</option>
  214. <?php if ($goodList): ?>
  215. <?php foreach ($goodList as $good): ?>
  216. <option value="<?php echo $good['goodsId'] ?>"><?php echo $good['goodsName'] ?></option>
  217. <?php endforeach; ?>
  218. <?php endif; ?>
  219. </select>
  220. </td>
  221. </tr>
  222. <tr>
  223. <th><em class="red">*</em>使用人数</th>
  224. <td colspan="3"> <input type="text" placeholder="使用人数" class="int_number_check" name="use_person" value="">人</td>
  225. </tr>
  226. <tr>
  227. <th><em class="red">*</em>打印人数</th>
  228. <td colspan="3"> <input type="text" placeholder="打印人数" class="int_number_check" name="down_person" value="">人</td>
  229. </tr>
  230. <tr>
  231. <th><em class="red">*</em>收费单价</th>
  232. <td colspan="3"> <input type="text" placeholder="收费单价" class="float_number_check" name="price" value="">元</td>
  233. </tr>
  234. <tr>
  235. <th><em class="red">*</em>上学期收费人数</th>
  236. <td > <input type="text" placeholder="收费人数" class="negative_number_check" name="feeNumUp" value="">人 <span class="red">如果是退款,请填写负数</span></td>
  237. <th><em class="red">*</em>下学期收费人数</th>
  238. <td > <input type="text" placeholder="收费人数" class="negative_number_check" name="feeNumDown" value="">人 <span class="red">如果是退款,请填写负数</span></td>
  239. </tr>
  240. <tr>
  241. <th><em class="red">*</em>上学期收费金额</th>
  242. <td > <input type="text" placeholder="收费金额" class="float_number_check" name="priceSumUp" value="">元 <span class="red">如果是退款,请填写负数</span></td>
  243. <th><em class="red">*</em>下学期收费金额</th>
  244. <td > <input type="text" placeholder="收费金额" class="float_number_check" name="priceSumDown" value="">元 <span class="red">如果是退款,请填写负数</span></td>
  245. </tr>
  246. <tr>
  247. <th><em class="red">*</em>收费时间</th>
  248. <td colspan="3"> <input readonly type="text" class="some_class" placeholder="收费时间" name="charge_time" value=""></td>
  249. </tr>
  250. <tr>
  251. <th>汇款时间</th>
  252. <td colspan="3"> <input readonly type="text" class="some_class" placeholder="汇款时间" name="pay_time" value=""></td>
  253. </tr>
  254. <tr>
  255. <th>备注</th>
  256. <td colspan="3">
  257. <textarea rows="5" cols="50" class="use-explain" name="mark"></textarea>
  258. </td>
  259. </tr>
  260. </table>
  261. <div class="sale-submit">
  262. <button type="button" class="label-primary-cancle">取消</button>
  263. <button type="button" class="label-primary-s bth-s" >保存</button>
  264. </div>
  265. </div>
  266. </form>
  267. <script src="/js/productset/jquery.min.js"></script>
  268. <script src="/js/ims/jquery.datetimepicker.js"></script>
  269. <script src="/js/ims/layer/layer.js"></script>
  270. <script src="/js/ims/xsgl.js"></script>
  271. <script src="/js/select/select2.min.js"></script>
  272. <script>
  273. $(document).ready(function(){
  274. $('.projSelect').select2();
  275. var submitFlag=true;
  276. var orderArr=[];
  277. <?php
  278. if(isset($orderList) && $orderList) {
  279. foreach ($orderList as $val) {
  280. echo 'var temp={};';
  281. echo 'temp.grade='.$val['grade'].';';
  282. echo 'temp.goodsId="'.$val['goodsId'].'";';
  283. echo 'temp.schoolYearId="'.$val['schoolYearId'].'";';
  284. echo 'temp.semesterName="'.$val['semesterName'].'";';
  285. echo 'temp.orderId="'.$val['orderId'].'";';
  286. echo "orderArr.push(temp);";
  287. }
  288. }
  289. ?>
  290. $('.label-primary-cancle').click(function(){
  291. window.location.href="<?php echo $this->createUrl('imsSale/payment')?>";
  292. });
  293. $('.some_class').datetimepicker({
  294. format: "Y-m-d", //格式化日期
  295. timepicker: false //关闭时间选项
  296. });
  297. // $('.float_number_check').change(function(){
  298. // $(this).val($(this).val().replace(/[^\d.+]/g,""));
  299. // });
  300. $('.negative_number_check').change(function(){
  301. $(this).val($(this).val().replace(/[^\d-+]/g,""));
  302. });
  303. $('.int_number_check').change(function(){
  304. $(this).val($(this).val().replace(/[^\d+]/g,""));
  305. });
  306. $('.bth-s').click(function(){
  307. if(!submitFlag){
  308. return false;
  309. }
  310. if($('#schoolYearId').val()==0){
  311. layer.msg('请选择学年');
  312. return false;
  313. }
  314. if($('#semester').val()==0){
  315. layer.msg('请选择学期');
  316. return false;
  317. }
  318. if($('#grade').val()==0){
  319. layer.msg('请选择年级');
  320. return false;
  321. }
  322. if($('#goodsId').val()==0){
  323. layer.msg('请选择商品');
  324. return false;
  325. }
  326. if($('input[name=use_person]').val()=="" || $('input[name=use_person]').val()==0){
  327. layer.msg('请输入使用人数');
  328. return false;
  329. }
  330. if(!$.isNumeric($('input[name=use_person]').val())){
  331. layer.msg('使用人数不正确');
  332. return false;
  333. }
  334. if($('input[name=down_person]').val()=="" || $('input[name=down_person]').val()==0){
  335. layer.msg('请输入打印人数');
  336. return false;
  337. }
  338. if(!$.isNumeric($('input[name=down_person]').val())){
  339. layer.msg('打印人数不正确');
  340. return false;
  341. }
  342. if($('input[name=price]').val()=="" || $('input[name=price]').val()==0){
  343. layer.msg('请输入收费单价');
  344. return false;
  345. }
  346. if(isNaN($('input[name=price]').val()) || parseFloat($('input[name=price]').val())<=0){
  347. layer.msg('收费单价格式不正确');
  348. return false;
  349. }
  350. if($('#semester').val()==1){
  351. feeNum=$('input[name=feeNumUp]').val();
  352. priceSum=$('input[name=priceSumUp]').val();
  353. if(feeNum=="" || feeNum==0){
  354. layer.msg('请输入收费人数');
  355. return false;
  356. }
  357. if(!$.isNumeric(feeNum)){
  358. layer.msg('收费人数不正确');
  359. return false;
  360. }
  361. if(priceSum=="" || priceSum==0){
  362. layer.msg('请输入收费金额');
  363. return false;
  364. }
  365. if(isNaN(priceSum)){
  366. layer.msg('收费金额格式不正确');
  367. return false;
  368. }
  369. }else if($('#semester').val()==2){
  370. feeNum=$('input[name=feeNumDown]').val();
  371. priceSum=$('input[name=priceSumDown]').val();
  372. if(feeNum=="" || feeNum==0){
  373. layer.msg('请输入收费人数');
  374. return false;
  375. }
  376. if(!$.isNumeric(feeNum)){
  377. layer.msg('收费人数不正确');
  378. return false;
  379. }
  380. if(priceSum=="" || priceSum==0){
  381. layer.msg('请输入收费金额');
  382. return false;
  383. }
  384. if(isNaN(priceSum)){
  385. console.log(priceSum);
  386. layer.msg('收费金额格式不正确');
  387. return false;
  388. }
  389. }else{
  390. feeNumUp=$('input[name=feeNumUp]').val();
  391. priceUp=$('input[name=priceSumUp').val();
  392. feeNumDown=$('input[name=feeNumDown]').val();
  393. priceDown=$('input[name=priceSumDown]').val();
  394. if((feeNumUp=="" || feeNumUp==0 || !$.isNumeric(feeNumUp)) && (feeNumDown=="" || feeNumDown==0 || !$.isNumeric(feeNumDown))){
  395. console.log(feeNumUp);
  396. console.log(feeNumDown);
  397. layer.msg('收费人数不正确');
  398. return false;
  399. }
  400. if((priceUp=="" || priceUp==0 || isNaN(priceUp)) && (priceDown=="" || priceDown==0 || isNaN(priceDown)) ){
  401. layer.msg('收费金额格式不正确');
  402. return false;
  403. }
  404. }
  405. if($('input[name=charge_time]').val()==''){
  406. layer.msg('请输入收费时间');
  407. return false;
  408. }
  409. if($('#schoolYearId').find("option:selected").attr('data-id') == 0){
  410. layer.confirm('当前时间不属于所选学年,确定保存嘛?', {
  411. btn: ['确定','取消'] //按钮
  412. },function(){
  413. submitFlag=false;
  414. $('#formSubmit').submit();
  415. });
  416. }else{
  417. submitFlag=false;
  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>