table_one.blade.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. @extends('layouts.admin')
  2. @section('content')
  3. {{--修改表格--}}
  4. @include('admin.table.style')
  5. <!--左侧菜单栏-->
  6. @include('admin.left-sidebar')
  7. <!-- 内容 -->
  8. <div class="content-wrapper">
  9. <!-- Content Header (Page header) -->
  10. <section class="content-header">
  11. <h1>
  12. 受理案件
  13. <small> </small>
  14. </h1>
  15. <ol class="breadcrumb">
  16. <li><a href="{{ url('/')}}"><i class="fa fa-dashboard"></i> 主页</a></li>
  17. <li><a href="#">项目申请</a></li>
  18. <li><a href="{{ url('/table') }}">受理案件</a></li>
  19. </ol>
  20. </section>
  21. <!-- Main content -->
  22. <section class="content">
  23. <!-- Default box -->
  24. <div class="box">
  25. <div class="box-header">
  26. </div>
  27. <!-- /.box-header -->
  28. <div class="box-body" id="print">
  29. {{--content--}}
  30. <div class="row" style="text-align: center">
  31. <h3>国有土地房屋征收与补偿安置单(货币化安置)</h3><br>
  32. </div>
  33. <form action="" method="post">
  34. {{ csrf_field() }}
  35. <div id="example2_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
  36. <div class="row">
  37. <div class="col-sm-2" style="text-align: right">项目名称:</div>
  38. <div class="col-sm-7">
  39. <select name="project_name" class="form-control">
  40. <option value=" "></option>
  41. @foreach($project as $data)
  42. <option value="{{ $data->project_name }}"
  43. @if($table->project_name == $data->project_name) selected @endif
  44. >{{ $data->project_name }}</option>
  45. @endforeach
  46. </select>
  47. </div>
  48. <div class="col-sm-1" style="text-align: right">编号:</div>
  49. <div class="col-sm-2">
  50. <input name="num" style="margin: 0px;" class="form-control" type="text" placeholder="必填项" value="{{ $table->num }}">
  51. </div><br><br>
  52. </div>
  53. <div class="row">
  54. <div class="col-sm-12">
  55. @if(count($errors)>0)
  56. <div class="callout callout-danger">
  57. @if(is_object($errors))
  58. @foreach($errors->all() as $error)
  59. <p>{{ $error }}</p>
  60. @endforeach
  61. @else
  62. <p>{{ $errors }}</p>
  63. @endif
  64. </div>
  65. @endif
  66. <table style="border: 1px solid #585858" id="example2" class="table table-bordered">
  67. <tbody>
  68. <tr>
  69. <td colspan="2" width="20%">被征收人姓名:</td>
  70. <td colspan="2" ><input name="bzc_name" class="form-control" type="text" placeholder="" value="{{ $table->bzc_name }}"></td>
  71. <td colspan="2" width="20%" >被征收房屋地址</td>
  72. <td colspan="2" ><input name="bzc_addr" class="form-control" type="text" placeholder="" value="{{ $table->bzc_addr }}"></td>
  73. </tr>
  74. <tr>
  75. <td colspan="2" width="20%">联系电话:</td>
  76. <td colspan="2" ><input name="bzc_tel" class="form-control" type="text" placeholder="" value="{{ $table->bzc_tel }}"></td>
  77. <td colspan="2" width="20%" >被征收人身份证号码:</td>
  78. <td colspan="2" ><input name="bzc_cardid" class="form-control" type="text" placeholder="" value="{{ $table->bzc_cardid }}"></td>
  79. </tr>
  80. <tr>
  81. <td colspan="2" width="20%">产权性质:</td>
  82. <td colspan="2" ><input name="property" class="form-control" type="text" placeholder="" value="{{ $table->property }}"></td>
  83. <td colspan="2" width="20%" >用途:</td>
  84. <td colspan="2" ><input name="used" class="form-control" type="text" placeholder="" value="{{ $table->used }}"></td>
  85. </tr>
  86. <?php $i = 1; $k = 1; $h = 0?>
  87. @if(is_array($table->jsons)||is_object($table->jsons))
  88. @foreach($table->jsons as $value)
  89. <tr>
  90. <td width="10%">拆迁补偿总金额:</td>
  91. <td colspan="5"><input disabled id="total_money_2" class="form-control" type="text" placeholder="">( 元 )</td>
  92. <td colspan="2"><input value="{{ $value->total_money }}" id="total_money_1" name="total_money" class="form-control <?php echo 'next'.$h++ ?>" type="text" placeholder="小写" onchange="NoToChinese(this.value)" >(元)</td>
  93. </tr>
  94. <tr>
  95. <td rowspan="4" colspan="2">货币化安置</td>
  96. <td>房屋类别</td>
  97. <td>购买存量房面积(㎡)</td>
  98. <td>购买存量房单价(元/㎡)</td>
  99. <td>购买存量房价格(元)</td>
  100. <td>应退差额(元)</td>
  101. <td>应交差额(元)</td>
  102. </tr>
  103. <tr>
  104. <td rowspan="2">住宅</td>
  105. <td><input name="home_area" class="form-control <?php echo 'next'.$h++ ?>" type="text" placeholder="" value="{{ $value->home_area }}" onchange="get_product(home_area,money_home_dprice,money_home_price)">
  106. </td>
  107. <td><input name="money_home_dprice" class="form-control <?php echo 'next'.$h++ ?>" type="text" value="{{$value->money_home_dprice}}" onchange="get_product(home_area,money_home_dprice,money_home_price)">
  108. </td>
  109. <td><input name="money_home_price" class="form-control <?php echo 'next'.$h++ ?>" type="text" value="{{$value->money_home_price}}" onclick="get_product(home_area,money_home_dprice,money_home_price)">
  110. </td>
  111. <td rowspan="3"><input name="money_home_tchae" id="money_home_tchae" class="form-control <?php echo 'next'.$h++ ?>" type="text" value="{{ $value->money_home_tchae }}" onclick="jian(money_home_price,money_home_price2,money_bus_price,total_money)">
  112. </td>
  113. <td rowspan="3"><input name="money_home_jchae" id="money_home_jchae" class="form-control <?php echo 'next'.$h++ ?>" type="text" value="{{ $value->money_home_jchae }}" onclick="jian(money_home_price,money_home_price2,money_bus_price,total_money)">
  114. </td>
  115. </tr>
  116. <tr>
  117. <td><input name="home_area2" class="form-control <?php echo 'next'.$h++ ?>" type="text" value="{{ $value->home_area2 }}" onchange="get_product(home_area2,money_home_dprice2,money_home_price2)">
  118. </td>
  119. <td><input name="money_home_dprice2" class="form-control <?php echo 'next'.$h++ ?>" type="text" value="{{ $value->money_home_dprice2 }}" onchange="get_product(home_area2,money_home_dprice2,money_home_price2)">
  120. </td>
  121. <td><input name="money_home_price2" class="form-control <?php echo 'next'.$h++ ?>" type="text" value="{{ $value->money_home_price2 }}" onclick="get_product(home_area2,money_home_dprice2,money_home_price2)">
  122. </td>
  123. </tr>
  124. <tr>
  125. <td>商业</td>
  126. <td><input name="money_bus_area" class="form-control <?php echo 'next'.$h++ ?>" type="text" placeholder="" value="{{ $value->money_bus_area }}" onchange="get_product(money_bus_area,money_bus_dprice,money_bus_price)">
  127. </td>
  128. <td><input name="money_bus_dprice" class="form-control <?php echo 'next'.$h++ ?>" type="text" placeholder="" value="{{ $value->money_bus_dprice }}" onchange="get_product(money_bus_area,money_bus_dprice,money_bus_price)">
  129. </td>
  130. <td><input name="money_bus_price" class="form-control <?php echo 'next'.$h++ ?>" type="text" placeholder="" value="{{ $value->money_bus_price }}" onclick="get_product(money_bus_area,money_bus_dprice,money_bus_price)">
  131. </td>
  132. </tr>
  133. <tr>
  134. <td>购买房屋位置</td>
  135. <td colspan="7"><input name="home_addr" class="form-control <?php echo 'next'.$h++ ?>" type="text" placeholder="" value="{{ $value->home_addr }}">
  136. </td>
  137. </tr>
  138. @endforeach
  139. @endif
  140. <tr >
  141. <td rowspan="2" colspan="2" style="height: 90px;">征收实施单位(章)</td>
  142. <td>被征收人(签字)</td>
  143. <td colspan="2"> </td>
  144. <td>代理人(签字)</td>
  145. <td colspan="2"> </td>
  146. </tr>
  147. <tr>
  148. <td>签约时间</td>
  149. <td colspan="5"><input readonly id="table_time" name="table_time" class="form-control" type="hidden" placeholder=""></td>
  150. </tr>
  151. </tbody>
  152. </table>
  153. <div class="row">
  154. <div class="col-sm-4">核算(签字):<input name="hesuan" style="border: none #ffffff;border-bottom: #777777 solid 1px;" type="text" placeholder=""></div>
  155. <div class="col-sm-4">初审(签字):<input disabled style="border: none #ffffff;border-bottom: #777777 solid 1px;" ></div>
  156. <div class="col-sm-4">监审(签字):<input disabled style="border: none #ffffff;border-bottom: #777777 solid 1px;" ></div>
  157. </div><br><div class="row">
  158. <div class="col-sm-4">复核(签字):<input name="fuhe" style="border: none #ffffff;border-bottom: #777777 solid 1px;" type="text" value="{{ $table->fuhe }}" placeholder=""></div>
  159. <div class="col-sm-4">初审(签字):<input style="border: none #ffffff;border-bottom: #777777 solid 1px;" ></div>
  160. <div class="col-sm-4">监审(签字):<input style="border: none #ffffff;border-bottom: #777777 solid 1px;" ></div>
  161. </div><br>
  162. <div class="row">
  163. <div class="col-sm-8">提交说明 : <label id="sub_description">{{ $table->sub_description }}</label></div>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. {{--model--}}
  169. <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  170. <div class="modal-dialog" role="document">
  171. <div class="modal-content">
  172. <div class="modal-header">
  173. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  174. <h4 class="modal-title" id="myModalLabel">提交说明</h4>
  175. </div>
  176. <div class="modal-body">
  177. <div class="form-group">
  178. <textarea class="form-control" id="model_des" name="sub_description" placeholder="输入您的内容..."></textarea>
  179. </div>
  180. </div>
  181. <div class="modal-footer">
  182. <button type="button" class="btn btn-default" data-dismiss="modal">返回</button>
  183. <button id="sub" type="submit" class="btn btn-primary" onclick="javascript:this.form.action='{{ url('/table/sub/'.$table_id) }}'">提交</button>
  184. </div>
  185. </div>
  186. </div>
  187. </div>
  188. {{--end model--}}
  189. <script type="text/javascript">
  190. $("#table_time").datetimepicker({
  191. language: 'zh',
  192. format: 'yyyy年mm月dd日',
  193. minView:'month'
  194. }).on('changeDate',function(){
  195. $(".datetimepicker").hide();
  196. });
  197. $(function(){
  198. var num =$('#total_money_1').val();
  199. var AA = new Array("零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖");
  200. var BB = new Array("", "拾", "佰", "仟", "萬", "億", "点", "");
  201. var a = ("" + num).replace(/(^0*)/g, "").split("."), k = 0, re = "";
  202. for (var i = a[0].length - 1; i >= 0; i--) {
  203. switch (k) {
  204. case 0: re = BB[7] + re; break;
  205. case 4: if (!new RegExp("0{4}\\d{" + (a[0].length - i - 1) + "}$").test(a[0]))
  206. re = BB[4] + re; break;
  207. case 8: re = BB[5] + re; BB[7] = BB[5]; k = 0; break;
  208. }
  209. if (k % 4 == 2 && a[0].charAt(i + 2) != 0 && a[0].charAt(i + 1) == 0) re = AA[0] + re;
  210. if (a[0].charAt(i) != 0) re = AA[a[0].charAt(i)] + BB[k % 4] + re; k++;
  211. }
  212. if (a.length > 1) //加上小数部分(如果有小数部分)
  213. {
  214. re += BB[6];
  215. for (var i = 0; i < a[1].length; i++) re += AA[a[1].charAt(i)];
  216. }
  217. $('#total_money_2').val(re);
  218. });
  219. function jian(I,P,Q,total){
  220. var result;
  221. if ($(I).val() == ''){$(I).val(0);}
  222. if ($(P).val() == ''){$(P).val(0);}
  223. if ($(Q).val() == ''){$(Q).val(0);}
  224. if ($(total).val() == ''){$(total).val(0);}
  225. result = parseFloat($(total).val()) - ( parseFloat($(I).val())+parseFloat($(P).val())+parseFloat($(Q).val()) );
  226. result = Math.round(result);
  227. if(result >= 0){
  228. $('#money_home_tchae').val(result);
  229. $('#money_home_jchae').val('');
  230. }else{
  231. $('#money_home_tchae').val('');
  232. $('#money_home_jchae').val(result*(-1));
  233. }
  234. }
  235. function get_product(left,right,product){
  236. var result = (left.value*right.value);
  237. product.value = result.toFixed(0);
  238. }
  239. function NoToChinese(num) {
  240. if (!/^\d*(\.\d*)?$/.test(num)) { alert("Number is wrong!"); return "Number is wrong!"; }
  241. var AA = new Array("零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖");
  242. var BB = new Array("", "拾", "佰", "仟", "萬", "億", "点", "");
  243. var a = ("" + num).replace(/(^0*)/g, "").split("."), k = 0, re = "";
  244. for (var i = a[0].length - 1; i >= 0; i--) {
  245. switch (k) {
  246. case 0: re = BB[7] + re; break;
  247. case 4: if (!new RegExp("0{4}\\d{" + (a[0].length - i - 1) + "}$").test(a[0]))
  248. re = BB[4] + re; break;
  249. case 8: re = BB[5] + re; BB[7] = BB[5]; k = 0; break;
  250. }
  251. if (k % 4 == 2 && a[0].charAt(i + 2) != 0 && a[0].charAt(i + 1) == 0) re = AA[0] + re;
  252. if (a[0].charAt(i) != 0) re = AA[a[0].charAt(i)] + BB[k % 4] + re; k++;
  253. }
  254. if (a.length > 1) //加上小数部分(如果有小数部分)
  255. {
  256. re += BB[6];
  257. for (var i = 0; i < a[1].length; i++) re += AA[a[1].charAt(i)];
  258. }
  259. $('#total_money_2').val(re);
  260. }
  261. var jsons = [];
  262. function getdata(){
  263. for (var j = 0; j <{{ count($table->jsons)}}; j++) {
  264. var json = {};
  265. $(".next" + j).each(function () {
  266. json[this.name] = this.value;
  267. });
  268. jsons.push(json);
  269. }
  270. console.log(jsons);
  271. return jsons;
  272. }
  273. $('form').submit(function(){
  274. jsons = getdata();
  275. var temp = JSON.stringify(jsons);
  276. $('#json').val(temp);
  277. console.log(temp);
  278. return true;
  279. });
  280. function printed(printpage)
  281. {
  282. $('#bottom_button').hide();
  283. var headstr = "<html><head><title></title></head><body>";
  284. var footstr = "</body>";
  285. var newstr = document.all.item(printpage).innerHTML;
  286. var oldstr = document.body.innerHTML;
  287. document.body.innerHTML = headstr+newstr+footstr;
  288. window.print();
  289. document.body.innerHTML = oldstr;
  290. $('#bottom_button').show();
  291. return false;
  292. }
  293. </script>
  294. <div class="row" id="bottom_button">
  295. <div class="col-sm-8"></div>
  296. <div class="col-sm-4">
  297. @if($table->status == null || $table->status<3)
  298. @if($user->role == 0 && $table->status == 0)
  299. <button id="sub" type="submit" onclick="javascript:this.form.action='{{ url('/table/save/'.$table_id.'/update') }}'" class="btn btn-success">
  300. 保存</button>
  301. @endif
  302. @if($user->role == $table->status)
  303. @if($table->status == 0)
  304. <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal">提交</button>
  305. @else
  306. <button id="sub" type="submit" onclick="javascript:this.form.action='{{ url('/table/sub/'.$table_id) }}'" class="btn btn-primary">
  307. 提交</button>
  308. <a href="{{ url('/back/?table_type_id='.$table_type_id.'&table_id='.$table_id) }}" class="btn btn-danger">驳回</a>
  309. @endif
  310. @endif
  311. <a href="{{ url('/on_table') }}" class="btn btn-info">返回</a>
  312. <a href="{{ url('/print/'.$table_id) }}" target="_blank" class="btn btn-success">打印</a>
  313. @else
  314. <a href="{{ url('/') }}" class="btn btn-info">返回</a>
  315. <a href="{{ url('/print/'.$table_id) }}" target="_blank" class="btn btn-success">打印</a>
  316. @endif
  317. </div>
  318. </div>
  319. </form>
  320. </div>
  321. <!-- /.box-body -->
  322. </div>
  323. <!-- /.box -->
  324. </section>
  325. <!-- /.content -->
  326. </div>
  327. <!-- /.content-wrapper -->
  328. @endsection