Browse Source

fix table_one next_page

GGican 8 năm trước cách đây
mục cha
commit
4d102ef8ee

+ 1 - 0
resources/views/admin/table/table_eight.blade.php

xqd
@@ -401,6 +401,7 @@
                             console.log(jsons);
                             hours += 1;
                             $('#hours').val(hours);
+                            alert('已转下一页刷新,请继续填写表单');
                             return jsons;
                         }
 

+ 55 - 13
resources/views/admin/table/table_one.blade.php

xqd xqd xqd
@@ -83,7 +83,7 @@
                                     <td colspan="5">
                                         <input disabled id="total_money1" class="form-control" type="text" placeholder="大写">
                                     </td>
-                                    <td colspan="2"><input name="total_money" class="form-control" type="text" placeholder="小写" onchange="NoToChinese(this.value)" >(元)</td>
+                                    <td colspan="2"><input name="total_money" class="form-control next" type="text" placeholder="小写" onchange="NoToChinese(this.value)" >(元)</td>
                                 </tr>
                                 <tr>
                                     <td rowspan="4" colspan="2">货币化安置</td>
@@ -96,34 +96,40 @@
                                 </tr>
                                 <tr>
                                     <td rowspan="2">住宅</td>
-                                    <td><input name="home_area" class="form-control" type="text" placeholder=""  onchange="get_product(home_area,money_home_dprice,money_home_price)">
+                                    <td><input name="home_area" class="form-control next" type="text" placeholder=""  onchange="get_product(home_area,money_home_dprice,money_home_price)">
                                     </td>
-                                    <td><input name="money_home_dprice" class="form-control" type="text" placeholder="" onchange="get_product(home_area,money_home_dprice,money_home_price)">
+                                    <td><input name="money_home_dprice" class="form-control next" type="text" placeholder="" onchange="get_product(home_area,money_home_dprice,money_home_price)">
                                     </td>
-                                    <td><input name="money_home_price" value="0" class="form-control" type="text" placeholder=""></td>
-                                    <td rowspan="3"><input id="money_home_tchae" value="0" name="money_home_tchae" class="form-control" type="text" placeholder=""  onclick="jian(money_home_price,money_home_price2,money_bus_price,total_money)">
+                                    <td><input name="money_home_price" value="0" class="form-control next" type="text" placeholder=""></td>
+                                    <td rowspan="2"><input id="money_home_tchae" value="0" name="money_home_tchae" class="form-control next" type="text" placeholder=""  onclick="jian(money_home_price,money_home_price2,money_bus_price,total_money)">
                                     </td>
-                                    <td rowspan="3"><input id="money_home_jchae" value="0" name="money_home_jchae" class="form-control" type="text" placeholder="" onclick="jian(money_home_price,money_home_price2,money_bus_price,total_money)">
+                                    <td rowspan="2"><input id="money_home_jchae" value="0" name="money_home_jchae" class="form-control next" type="text" placeholder="" onclick="jian(money_home_price,money_home_price2,money_bus_price,total_money)">
                                     </td>
                                 </tr>
                                 <tr>
-                                    <td><input name="home_area2" class="form-control" type="text" placeholder="" onchange="get_product(home_area2,money_home_dprice2,money_home_price2)">
+                                    <td><input name="home_area2" class="form-control next" type="text" placeholder="" onchange="get_product(home_area2,money_home_dprice2,money_home_price2)">
                                     </td>
-                                    <td><input name="money_home_dprice2" class="form-control" type="text" placeholder="" onchange="get_product(home_area2,money_home_dprice2,money_home_price2)">
+                                    <td><input name="money_home_dprice2" class="form-control next" type="text" placeholder="" onchange="get_product(home_area2,money_home_dprice2,money_home_price2)">
                                     </td>
-                                    <td><input name="money_home_price2" value="0" class="form-control" type="text" placeholder=""></td>
+                                    <td><input name="money_home_price2" value="0" class="form-control next" type="text" placeholder=""></td>
                                 </tr>
                                 <tr>
                                     <td>商业</td>
-                                    <td><input name="money_bus_area" class="form-control" type="text" placeholder=""  onchange="get_product(money_bus_area,money_bus_dprice,money_bus_price)">
+                                    <td><input name="money_bus_area" class="form-control next" type="text" placeholder=""  onchange="get_product(money_bus_area,money_bus_dprice,money_bus_price)">
                                     </td>
-                                    <td><input name="money_bus_dprice" class="form-control" type="text" placeholder="" onchange="get_product(money_bus_area,money_bus_dprice,money_bus_price)">
+                                    <td><input name="money_bus_dprice" class="form-control next" type="text" placeholder="" onchange="get_product(money_bus_area,money_bus_dprice,money_bus_price)">
+                                    </td>
+                                    <td><input name="money_bus_price" value="0" class="form-control next" type="text" placeholder=""></td>
+
+                                    <td><a id="nextid" onclick="nextPage()">转下页</a></td>
+                                    <td><input name="other" value=" " class="form-control next" type="text" placeholder="">
+                                        <input type="hidden" name="json" id="json">
+                                        <input type="hidden" name="hours" id="hours">
                                     </td>
-                                    <td><input name="money_bus_price" value="0" class="form-control" type="text" placeholder=""></td>
                                 </tr>
                                 <tr>
                                     <td>购买房屋位置</td>
-                                    <td colspan="7"><input name="home_addr" class="form-control" type="text" value="       小区      楼号     单元      层数      室"></td>
+                                    <td colspan="7"><input name="home_addr" class="form-control next" type="text" value="       小区      楼号     单元      层数      室"></td>
                                 </tr>
                                 <tr >
                                     <td rowspan="2" colspan="2" style="height: 90px;">征收实施单位(章) </td>
@@ -263,6 +269,42 @@
                         $('#bottom_button').show();
                     return false;
                     }
+
+                var jsons = []; // 所有的回迁房数据
+                var hours = 0;  // 回迁房套数
+                function nextPage(){
+                    var json = {};
+                    var chae = $('#money_home_tchae').val();
+                    //差额不够时隐藏下一页
+                    if(chae == ''||chae == 0 ){
+                        document.getElementById('nextid').style.display = "none";
+                    }
+                    //批量赋值在数组里
+                    $(".next").each(function(){
+                        json[this.name] =this.value;
+                        this.value = ''; //清空当前页数据,伪第二页
+                    });
+
+                    //赋值下一页的总金额
+                    $('#total_money').val(chae);
+
+                    jsons.push(json);
+                    console.log(jsons);
+                    hours += 1;
+                    $('#hours').val(hours);
+                    alert('已转下一页刷新,请继续填写表单');
+                    return jsons;
+                }
+
+                $('form').submit(function(){
+                    var jsons  = nextPage();
+                    var temp = JSON.stringify(jsons);
+
+                    $('#json').val(temp);
+
+                    return true;
+                });
+
                 </script>
             </div>
             <!-- /.box-body -->