@extends('layouts.admin')
@section('content')


    {{--修改表格--}}
@include('admin.table.style')

    <!--左侧菜单栏-->
@include('admin.left-sidebar')
    <!-- 内容 -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                受理案件
                <small> </small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="{{ url('/')}}"><i class="fa fa-dashboard"></i> 主页</a></li>
                <li><a href="#">项目申请</a></li>
                <li><a href="{{ url('/table') }}">受理案件</a></li>
            </ol>
        </section>
        <!-- Main content -->
        <section class="content">
            <!-- Default box -->
            <div class="box">
                <div class="box-header">

                </div>
                <!-- /.box-header -->
                <div class="box-body" id="print">
                    {{--content--}}
                    <div class="row" style="text-align: center">
                        <h3>国有土地上房屋征收与补偿核算单（货币补偿）</h3><br>
                    </div>
                    <form action="" method="post">
                        {{ csrf_field() }}
                    <div id="example2_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
                        <div class="row">
                            <div class="col-sm-2">项目名称：</div>
                            <div class="col-sm-7">
                                <select name="project_name" class="form-control">
                                    <option value=" "></option>
                                    @foreach($project as $data)
                                        <option value="{{ $data->project_name }}"
                                                @if($table->project_name == $data->project_name) selected @endif
                                        >{{ $data->project_name }}</option>
                                    @endforeach
                                </select>
                            </div>
                            <div class="col-sm-1">编号：</div>
                            <div class="col-sm-2">
                                <input style="margin: 0px;" name="num" value="{{ $table->num }}" class="form-control" type="text" placeholder="必填项">
                            </div><br><br>
                        </div>
                        <div class="row">
                            <div class="col-sm-12">
                                <table style="border: 1px solid #585858" id="example2" class="table table-bordered">
                                    <tbody>
                                    <tr>
                                        <td>被征收户姓名</td>
                                        <td colspan="3"><input name="bzc_name" value="{{ $table->bzc_name }}" class="form-control" type="text" placeholder="必填项"></td>
                                        <td>被征收房屋住址</td>
                                        <td colspan="4"><input name="bzc_addr" value="{{ $table->bzc_addr }}" class="form-control" type="text" placeholder="必填项"></td>
                                    </tr>
                                    <tr>
                                        <td>联系电话</td>
                                        <td colspan="3"><input name="bzc_tel" value="{{ $table->bzc_tel }}" class="form-control" type="text" placeholder="必填项"></td>
                                        <td>被征收人身份证号</td>
                                        <td colspan="4"><input name="bzc_cardid" value="{{ $table->bzc_cardid }}" class="form-control" type="text" placeholder="必填项"></td>
                                    </tr>
                                    <tr>
                                        <td>产权性质</td>
                                        <td colspan="3"><input name="chanquan" value="{{ $table->chanquan }}" class="form-control" type="text" placeholder="必填项"></td>
                                        <td>用 途</td>
                                        <td colspan="4"><input name="used" value="{{ $table->used }}" class="form-control" type="text" placeholder="必填项"></td>
                                    </tr>
                                    <tr>
                                        <td>证件名称</td>
                                        <td colspan="2">建设用地通知书（批准书）</td>
                                        <td colspan="2">建设用地规划许可证</td>
                                        <td>建设工程规划许可证</td>
                                        <td>国有土地使用证</td>
                                        <td colspan="2">房屋所有权证</td>
                                    </tr>
                                    <tr>
                                        <td>证号</td>
                                        <td colspan="2"><input name="data1" value="{{ $table->data1 }}" class="form-control" type="text" placeholder=""></td>
                                        <td colspan="2"><input name="data2" value="{{ $table->data2 }}" class="form-control" type="text" placeholder=""></td>
                                        <td><input name="data3" value="{{ $table->data3 }}" class="form-control" type="text" placeholder=""></td>
                                        <td><input name="data4" value="{{ $table->data4 }}" class="form-control" type="text" placeholder=""></td>
                                        <td colspan="2"><input name="data5" value="{{ $table->data5 }}" class="form-control" type="text" placeholder=""></td>
                                    </tr>
                                    <tr>
                                        <td rowspan="10">房屋补偿金额</td>
                                        <td colspan="2" rowspan="2">房屋面积</td>
                                        <td colspan="6">房屋征收补偿金额</td>
                                    </tr>
                                    <tr>
                                        <td>名称</td>
                                        <td>面积</td>
                                        <td>单价</td>
                                        <td>金额</td>
                                        <td>名称</td>
                                        <td>金额</td>

                                    </tr>
                                    <tr>
                                        <td>房1</td>
                                        <td>（<input name="data5_1" class="form-control" value="{{ $table->data5_1 }}" >）证</td>
                                        <td>房1 </td>
                                        <td> <input name="data6" value="{{ $table->data6 }}" class="form-control" type="text" placeholder=""></td>
                                        <td><input name="data6_1" value="{{ $table->data6_1 }}" class="form-control" type="text" placeholder=""></td>
                                        <td><input name="data7" value="{{ $table->data7 }}" class="form-control" type="text" placeholder="" onclick="get_product(data6,data6_1,this)"></td>
                                        <td>房1装修</td>
                                        <td><input name="data8" value="{{ $table->data8 }}" class="form-control" type="text" placeholder=""></td>
                                    </tr>
                                    <tr>
                                        <td>房2</td>
                                        <td>（<input name="data8_1" value="{{ $table->data8_1 }}"  class="form-control" >）证</td>
                                        <td>房2</td>
                                        <td> <input name="data9" value="{{ $table->data9 }}" class="form-control" type="text" placeholder=""></td>
                                        <td><input name="data9_1" value="{{ $table->data9_1 }}" class="form-control" type="text" placeholder=""></td>
                                        <td><input name="data10" value="{{ $table->data10 }}" class="form-control" type="text" placeholder="" onclick="get_product(data9,data9_1,this)"></td>
                                        <td>房2装修</td>
                                        <td><input name="data11" value="{{ $table->data11 }}" class="form-control" type="text" placeholder=""></td>
                                    </tr>
                                    <tr>
                                        <td>房3</td>
                                        <td>（<input name="data11_1" value="{{ $table->data11_1 }}" class="form-control" >）证</td>
                                        <td>房3 </td>
                                        <td><input name="data12" value="{{ $table->data12 }}" class="form-control" type="text" placeholder=""></td>
                                        <td> <input name="data12_1" value="{{ $table->data12_1 }}" class="form-control" type="text" placeholder=""></td>
                                        <td><input name="data13" value="{{ $table->data13 }}" class="form-control" type="text" placeholder="" onclick="get_product(data12,data12_1,this)"></td>
                                        <td>房3装修</td>
                                        <td><input name="data14" value="{{ $table->data14 }}" class="form-control" type="text" placeholder=""></td>
                                    </tr>
                                    <tr>
                                        <td>房4</td>
                                        <td>（<input name="data14_1" value="{{ $table->data14_1 }}"  class="form-control" >）证</td>
                                        <td>房4 </td>
                                        <td><input name="data15" value="{{ $table->data15 }}" class="form-control" type="text" placeholder=""></td>
                                        <td> <input name="data15_1" value="{{ $table->data15_1 }}" class="form-control" type="text" placeholder=""></td>
                                        <td><input name="data16" value="{{ $table->data16 }}" class="form-control" type="text" placeholder="" onclick="get_product(data15,data15_1,this)"></td>
                                        <td>房4装修</td>
                                        <td><input name="data17" value="{{ $table->data17 }}" class="form-control" type="text" placeholder=""></td>
                                    </tr>
                                    <tr>
                                        <td>房5</td>
                                        <td>（<input name="data17_1"  value="{{ $table->data17_1 }}" class="form-control" >）证</td>
                                        <td>房5 </td>
                                        <td><input name="data18" value="{{ $table->data18 }}" class="form-control" type="text" placeholder=""></td>
                                        <td> <input name="data18_1" value="{{ $table->data18_1 }}" class="form-control" type="text" placeholder=""></td>
                                        <td><input name="data19" value="{{ $table->data19 }}" class="form-control" type="text" placeholder="" onclick="get_product(data18,data18_1,this)"></td>
                                        <td>房5装修</td>
                                        <td><input name="data20" value="{{ $table->data20 }}" class="form-control" type="text" placeholder=""></td>
                                    </tr>
                                    <tr>
                                        <td>房6</td>
                                        <td>（<input name="data20_1" value="{{ $table->data20_1 }}"  class="form-control" >）证</td>
                                        <td>房6 </td>
                                        <td><input name="data21" value="{{ $table->data21 }}" class="form-control" type="text" placeholder=""></td>
                                        <td> <input name="data21_1" value="{{ $table->data21_1 }}"  class="form-control" type="text" placeholder=""></td>
                                        <td><input name="data22" value="{{ $table->data22 }}" class="form-control" type="text" placeholder="" onclick="get_product(data21,data21_1,this)"></td>
                                        <td>房6装修</td>
                                        <td><input name="data23" value="{{ $table->data23 }}" class="form-control" type="text" placeholder=""></td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"></td>
                                        <td colspan="3">小 计</td>
                                        <td> <input name="data23_1"  value="{{ $table->data23_1 }}" class="form-control" type="text" placeholder="" onclick="addsix_money(data7,data10,data13,data16,data19,data22,this)"></td>
                                        <td> 合计</td>
                                        <td> <input name="data23_2" value="{{ $table->data23_2 }}"  class="form-control" type="text" placeholder="" onclick="addsix_money(data8,data11,data14,data17,data20,data23,this)"></td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">合 计</td>
                                        <td colspan="2"><input name="data24" value="{{ $table->data24 }}" class="form-control" type="text" placeholder=""></td>
                                        <td>平米</td>
                                        <td>小计</td>
                                        <td colspan="2"><input name="data25" value="{{ $table->data25 }}" class="form-control" type="text" placeholder="">(元)</td>
                                    </tr>

                                    <tr>
                                        <td colspan="3">空院补偿额</td>
                                        <td>面积</td>
                                        <td ><input name="data25_1"  value="{{ $table->data25_1 }}" class="form-control" type="text" placeholder=""></td>
                                        <td >单价</td>
                                        <td ><input name="data25_2" value="{{ $table->data25_2 }}" class="form-control" type="text" placeholder=""></td>
                                        <td >金额</td>
                                        <td><input name="data26" value="{{ $table->data26 }}" class="form-control" type="text" placeholder="" onclick="get_product(data25_1,data25_2,this)"></td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">停产停业损失补偿额</td>
                                        <td>面积</td>
                                        <td ><input name="data26_1" value="{{ $table->data26_1 }}" class="form-control" type="text" placeholder=""></td>
                                        <td >单价</td>
                                        <td ><input name="data26_2" value="{{ $table->data26_2 }}" class="form-control" type="text" placeholder=""></td>
                                        <td >金额</td>
                                        <td><input name="data27" value="{{ $table->data27 }}" class="form-control" type="text" placeholder="" onclick="get_product(data26_1,data26_2,this)"></td>
                                    </tr>
                                    <tr>
                                        <td hidden colspan="6">房屋补偿总额=房屋补偿额小计+空院补偿+停产停业损失补偿额：<input name="data28" value="{{ $table->data28 }}" class="form-control" type="text" placeholder=""></td>
                                    </tr>
                                    <tr>
                                        <td colspan="3"><input name="data27_7" value="{{ $table->data27_7 }}"  class="form-control" type="text" placeholder=""></td>
                                        <td><input name="data27_1"  value="{{ $table->data27_1 }}"  class="form-control" type="text" placeholder=""> </td>
                                        <td ><input name="data27_2" value="{{ $table->data27_2 }}"  class="form-control" type="text" placeholder=""></td>
                                        <td > <input name="data27_3" value="{{ $table->data27_3 }}"  class="form-control" type="text" placeholder=""></td>
                                        <td ><input name="data27_4"  value="{{ $table->data27_4 }}"  class="form-control" type="text" placeholder=""></td>
                                        <td > <input name="data27_5" value="{{ $table->data27_5 }}"  class="form-control" type="text" placeholder=""></td>
                                        <td><input name="data27_6"  value="{{ $table->data27_6 }}"  class="form-control" type="text" placeholder="" onclick="get_product(data27_2,data27_4,this)"></td>
                                    </tr>
                                    <tr>
                                        <td rowspan="5">构筑物及其他补偿金</td>
                                        <td >名称</td>
                                        <td >金额</td>
                                        <td >名称</td>
                                        <td >金额</td>
                                        <td >名称</td>
                                        <td >金额</td>
                                        <td >名称</td>
                                        <td >金额</td>
                                    </tr>
                                    <tr>
                                        <td ><input name="data29" value="{{ $table->data29 }}" class="form-control" type="text" placeholder=""></td>
                                        <td ><input name="data30" value="{{ $table->data30 }}" class="form-control sum" type="text" placeholder=""></td>
                                        <td><input name="data31" value="{{ $table->data31 }}" class="form-control" type="text" placeholder=""></td>
                                        <td ><input name="data31_1" value="{{ $table->data31_1 }}" class="form-control sum" type="text" placeholder=""></td>
                                        <td ><input name="data31_2" value="{{ $table->data31_2 }}" class="form-control" type="text" placeholder=""></td>
                                        <td ><input name="data31_3" value="{{ $table->data31_3 }}" class="form-control sum" type="text" placeholder=""></td>
                                        <td ><input name="data31_4" value="{{ $table->data31_4 }}" class="form-control" type="text" placeholder=""></td>
                                        <td ><input name="data31_5" value="{{ $table->data31_5 }}" class="form-control sum" type="text" placeholder=""></td>
                                    </tr>
                                    <tr>
                                        <td ><input name="data32" value="{{ $table->data32 }}" class="form-control" type="text" placeholder=""></td>
                                        <td ><input name="data33" value="{{ $table->data33 }}" class="form-control sum" type="text" placeholder=""></td>
                                        <td><input name="data34" value="{{ $table->data34 }}" class="form-control" type="text" placeholder=""></td>
                                        <td><input name="data34_1" value="{{ $table->data34_1 }}" class="form-control sum" type="text" placeholder=""></td>
                                        <td><input name="data34_2" value="{{ $table->data34_2 }}" class="form-control" type="text" placeholder=""></td>
                                        <td><input name="data34_3" value="{{ $table->data34_3 }}" class="form-control sum" type="text" placeholder=""></td>
                                        <td><input name="data34_4" value="{{ $table->data34_4 }}" class="form-control" type="text" placeholder=""></td>
                                        <td><input name="data34_5" value="{{ $table->data34_5 }}" class="form-control sum" type="text" placeholder=""></td>
                                    </tr>
                                    <tr>
                                        <td  ><input name="data35" value="{{ $table->data35 }}" class="form-control" type="text" placeholder=""></td>
                                        <td ><input name="data36" value="{{ $table->data36 }}" class="form-control sum" type="text" placeholder=""></td>
                                        <td><input name="data37" value="{{ $table->data37 }}" class="form-control" type="text" placeholder=""></td>
                                        <td><input name="data37_1" value="{{ $table->data37_1 }}" class="form-control sum" type="text" placeholder=""></td>
                                        <td><input name="data37_2" value="{{ $table->data37_2 }}" class="form-control" type="text" placeholder=""></td>
                                        <td><input name="data37_3" value="{{ $table->data37_3 }}" class="form-control sum" type="text" placeholder=""></td>
                                        <td><input name="data37_4" value="{{ $table->data37_4 }}" class="form-control" type="text" placeholder=""></td>
                                        <td><input name="data37_5" value="{{ $table->data37_5 }}" class="form-control sum" type="text" placeholder=""></td>
                                    </tr>
                                    <tr>
                                        <td> <input name="data38" value="{{ $table->data38 }}" class="form-control" type="text" placeholder=""></td>
                                        <td ><input name="data39" value="{{ $table->data39 }}" class="form-control sum" type="text" placeholder=""></td>
                                        <td><input name="data40" value="{{ $table->data40 }}" class="form-control" type="text" placeholder=""></td>
                                        <td><input name="data40_1" value="{{ $table->data40_1 }}" class="form-control sum" type="text" placeholder=""></td>
                                        <td><input name="data40_2" value="{{ $table->data40_2 }}" class="form-control" type="text" placeholder=""></td>
                                        <td><input name="data40_3" value="{{ $table->data40_3 }}" class="form-control sum" type="text" placeholder=""></td>
                                        <td>合计：</td>
                                        <td><input name="data40_5" value="{{ $table->data40_5 }}" class="form-control" type="text" placeholder=""  onclick="sum(data40_5)"></td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">拆迁补偿总金额</td>
                                        <td colspan="4"> <input disabled id="data441" class="form-control" type="text" placeholder="大写">（元）</td>
                                        <td colspan="4"> <input name="data44" id="data442" value="{{ $table->data44 }}" class="form-control" type="text" placeholder="小写" onclick = "get_change(this,data25,data26,data27,data27_6,data40_5)">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td rowspan="2" colspan="2" style="height: 120px;">征收实施单位（章）<br> </td>
                                        <td colspan="2">被征收人（签字）</td>
                                        <td> </td>
                                        <td colspan="2">代理人（签字）</td>
                                        <td colspan="3"> </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">签约时间</td>
                                        <td colspan="5"> </td>
                                    </tr>
                                    </tbody>
                                </table>
                                <div class="row">
                                    <div class="col-sm-4">核算（签字）：<input name="hesuan"  style="border: none #ffffff;border-bottom: #777777 solid 1px;" type="text" placeholder=""></div>
                                    <div class="col-sm-4">初审（签字）：<input disabled style="border: none #ffffff;border-bottom: #777777 solid 1px;" ></div>
                                    <div class="col-sm-4">监审（签字）：<input disabled style="border: none #ffffff;border-bottom: #777777 solid 1px;" ></div>
                                </div><br>
                                <div class="row">
                                    <div class="col-sm-4">复核（签字）：<input name="fuhe" style="border: none #ffffff;border-bottom: #777777 solid 1px;" type="text" value="{{ $table->fuhe }}" placeholder=""></div>
                                    <div class="col-sm-4">初审（签字）：<input   style="border: none #ffffff;border-bottom: #777777 solid 1px;" ></div>
                                    <div class="col-sm-4">监审（签字）：<input   style="border: none #ffffff;border-bottom: #777777 solid 1px;" ></div>
                                </div><br>
                                <div class="row">
                                    <div class="col-sm-8">提交说明 : <label id="sub_description">{{ $table->sub_description }}</label></div>
                                </div>
                            </div>
                        </div>
                    </div>

                        {{--model--}}
                        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                            <div class="modal-dialog" role="document">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                        <h4 class="modal-title" id="myModalLabel">提交说明</h4>
                                    </div>
                                    <div class="modal-body">
                                        <div class="form-group">
                                            <textarea class="form-control" id="model_des" name="sub_description" placeholder="输入您的内容..."></textarea>
                                        </div>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="button" class="btn btn-default" data-dismiss="modal">返回</button>
                                        <button id="sub" type="submit" class="btn btn-primary" onclick="javascript:this.form.action='{{ url('/table/sub/'.$table_id) }}'">提交</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        {{--end model--}}
                        <div class="row" id="bottom_button">
                            <div class="col-sm-8"></div>
                            <div class="col-sm-4">
                                @if($table->status == null  || $table->status<3)
                                    @if($user->role == 0 && $table->status == 0)
                                        <button id="sub" type="submit" onclick="javascript:this.form.action='{{ url('/table/save/'.$table_id.'/update') }}'" class="btn btn-success">
                                            保存</button>
                                    @endif
                                    @if($user->role == $table->status)
                                        @if($table->status == 0)
                                            <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal">提交</button>
                                        @else
                                            <button id="sub" type="submit" onclick="javascript:this.form.action='{{ url('/table/sub/'.$table_id) }}'" class="btn btn-primary">
                                                提交</button>
                                        @endif
                                    @endif
                                    <a href="{{ url('/on_table') }}" class="btn btn-info">返回</a>
                                        <a href="{{ url('/print/'.$table_id) }}"  target="_blank"  class="btn btn-success">打印</a>
                                @else
                                    <a href="{{ url('/') }}" class="btn btn-info">返回</a>
                                    <a href="{{ url('/print/'.$table_id) }}"  target="_blank"  class="btn btn-success">打印</a>
                                @endif
                            </div>
                        </div>
                        <input type="hidden" name="table_time" value=" ">
                        </form>
                    <script type="text/javascript">
                        $(".form_datetime").datetimepicker({
                            language: 'zh',
                            format: 'yyyy年mm月dd日',
                            minView:'month'
                        }).on('changeDate',function(){
                            $(".datetimepicker").hide();
                        });

                        $(function(){
                            change(data442,data441);
                        });
                        function change(one,add){
                            var num = $(one).val();
//                            if (!/^\d*(\.\d*)?$/.test(num)) { alert("Number is wrong!"); return "Number is wrong!"; }
                            var AA = new Array("零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖");
                            var BB = new Array("", "拾", "佰", "仟", "萬", "億", "点", "");
                            var a = ("" + num).replace(/(^0*)/g, "").split("."), k = 0, re = "";
                            for (var i = a[0].length - 1; i >= 0; i--) {
                                switch (k) {
                                    case 0: re = BB[7] + re; break;
                                    case 4: if (!new RegExp("0{4}\\d{" + (a[0].length - i - 1) + "}$").test(a[0]))
                                        re = BB[4] + re; break;
                                    case 8: re = BB[5] + re; BB[7] = BB[5]; k = 0; break;
                                }
                                if (k % 4 == 2 && a[0].charAt(i + 2) != 0 && a[0].charAt(i + 1) == 0) re = AA[0] + re;
                                if (a[0].charAt(i) != 0) re = AA[a[0].charAt(i)] + BB[k % 4] + re; k++;
                            }

                            if (a.length > 1) //加上小数部分(如果有小数部分)
                            {
                                re += BB[6];
                                for (var i = 0; i < a[1].length; i++) re += AA[a[1].charAt(i)];
                            }
                            $(add).val(re);
                        }
                        function sum(result){
                            var sum = 0;
                            $(".sum").each(function(){
                                if (this.value == '') this.value = 0;
                                sum  += parseInt(this.value);
                            });
                            result.value = sum;
                        }
                        function get_product(left,right,product){
                            var result = (left.value*right.value);
                            product.value = result.toFixed(0);
                        }
                        function addtwo(one,two, add) {
                            if ($(one).val() == ''){$(one).val(0);}
                            if ($(two).val() == ''){$(two).val(0);}
                            add.value= parseInt($(one).val()) + parseInt($(two).val())  ;
                        }
                        function add(one,two,three,add) {
                            add.value= parseInt($(one).val()) + parseInt($(two).val()) + parseInt($(three).val());
                        }
                        function adde(one,two,three,four,add) {
                            add.value= parseInt($(one).val()) + parseInt($(two).val()) + parseInt($(three).val()) + parseInt($(four).val());
                        }
                        function added(one,two,three,four,five,add) {
                            add.value= parseInt($(one).val()) + parseInt($(two).val()) + parseInt($(three).val()) + parseInt($(four).val()) + parseInt($(five).val());
                        }
                        function addsix(one,two,three,four,five,six,add) {
                            if ($(one).val() == ''){$(one).val(0);}
                            if ($(two).val() == ''){$(two).val(0);}
                            if ($(three).val() == ''){$(three).val(0);}
                            if ($(four).val() == ''){$(four).val(0);}
                            if ($(five).val() == ''){$(five).val(0);}
                            if ($(six).val() == ''){$(six).val(0);}
                            add.value= parseInt($(one).val()) + parseInt($(two).val()) + parseInt($(three).val()) + parseInt($(four).val()) + parseInt($(five).val())+ parseInt($(six).val());
                        }
                        function addsix_money(one,two,three,four,five,six,add) {
                            var result;
                            if ($(one).val() == ''){$(one).val(0);}
                            if ($(two).val() == ''){$(two).val(0);}
                            if ($(three).val() == ''){$(three).val(0);}
                            if ($(four).val() == ''){$(four).val(0);}
                            if ($(five).val() == ''){$(five).val(0);}
                            if ($(six).val() == ''){$(six).val(0);}
                            result = parseFloat($(one).val()) + parseFloat($(two).val()) + parseFloat($(three).val()) + parseFloat($(four).val()) + parseFloat($(five).val())+ parseFloat($(six).val());
                            add.value = result.toFixed(0);
                        }

                        function jian(one,two,add){
                            add.value= parseInt($(one).val()) - parseInt($(two).val())
                        }
                        function NoToChinese(num,to) {
                            if (!/^\d*(\.\d*)?$/.test(num)) { alert("Number is wrong!"); return "Number is wrong!"; }
                            var AA = new Array("零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖");
                            var BB = new Array("", "拾", "佰", "仟", "萬", "億", "点", "");
                            var a = ("" + num).replace(/(^0*)/g, "").split("."), k = 0, re = "";
                            for (var i = a[0].length - 1; i >= 0; i--) {
                                switch (k) {
                                    case 0: re = BB[7] + re; break;
                                    case 4: if (!new RegExp("0{4}\\d{" + (a[0].length - i - 1) + "}$").test(a[0]))
                                        re = BB[4] + re; break;
                                    case 8: re = BB[5] + re; BB[7] = BB[5]; k = 0; break;
                                }
                                if (k % 4 == 2 && a[0].charAt(i + 2) != 0 && a[0].charAt(i + 1) == 0) re = AA[0] + re;
                                if (a[0].charAt(i) != 0) re = AA[a[0].charAt(i)] + BB[k % 4] + re; k++;
                            }

                            if (a.length > 1) //加上小数部分(如果有小数部分)
                            {
                                re += BB[6];
                                for (var i = 0; i < a[1].length; i++) re += AA[a[1].charAt(i)];
                            }

                            $(to).val(re);
                        }
                        function get_change(add,one,two,three,four,five){
                            if ($(one).val() == ''){$(one).val(0);}
                            if ($(two).val() == ''){$(two).val(0);}
                            if ($(three).val() == ''){$(three).val(0);}
                            if ($(four).val() == ''){$(four).val(0);}
                            if ($(five).val() == ''){$(five).val(0);}
                            var  num = 0;
                            num = parseFloat($(one).val()) + parseFloat($(two).val())+ parseFloat($(three).val())+ parseFloat($(four).val())+ parseFloat($(five).val());
                            $(add).val(num);

//                            if (!/^\d*(\.\d*)?$/.test(num)) { alert("Number is wrong!"); return "Number is wrong!"; }
                            var AA = new Array("零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖");
                            var BB = new Array("", "拾", "佰", "仟", "萬", "億", "点", "");
                            var a = ("" + num).replace(/(^0*)/g, "").split("."), k = 0, re = "";
                            for (var i = a[0].length - 1; i >= 0; i--) {
                                switch (k) {
                                    case 0: re = BB[7] + re; break;
                                    case 4: if (!new RegExp("0{4}\\d{" + (a[0].length - i - 1) + "}$").test(a[0]))
                                        re = BB[4] + re; break;
                                    case 8: re = BB[5] + re; BB[7] = BB[5]; k = 0; break;
                                }
                                if (k % 4 == 2 && a[0].charAt(i + 2) != 0 && a[0].charAt(i + 1) == 0) re = AA[0] + re;
                                if (a[0].charAt(i) != 0) re = AA[a[0].charAt(i)] + BB[k % 4] + re; k++;
                            }

                            if (a.length > 1) //加上小数部分(如果有小数部分)
                            {
                                re += BB[6];
                                for (var i = 0; i < a[1].length; i++) re += AA[a[1].charAt(i)];
                            }

                            $('#data441').val(re);
                        }
                        function printed(printpage){
                            $('#bottom_button').hide();
                            var headstr = "<html><head><title></title></head><body>";
                            var footstr = "</body>";
                            var newstr = document.all.item(printpage).innerHTML;
                            var oldstr = document.body.innerHTML;
                            document.body.innerHTML = headstr+newstr+footstr;
                            window.print();
                            document.body.innerHTML = oldstr;
                            $('#bottom_button').show();
                            return false;
                        }
                    </script>
                </div>
                <!-- /.box-body -->
            </div>
            <!-- /.box -->
        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
@endsection