save.blade.php 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. @extends('admin/layout')
  2. @section('header')
  3. <link href="{{asset('css/plugins/chosen/chosen.css')}}" rel="stylesheet">
  4. @endsection
  5. @section('content')
  6. <body class="gray-bg">
  7. <div class="wrapper wrapper-content animated fadeInRight">
  8. <div class="row">
  9. <div class="col-sm-12">
  10. <div class="ibox float-e-margins">
  11. <div class="ibox-content">
  12. <form class="form-horizontal" id="form">
  13. <div class="form-group">
  14. <label class="col-sm-2 control-label" for="amount">金额:</label>
  15. <div class="col-sm-8">
  16. <input type="text" class="form-control" id="amount" name="amount"
  17. value="{{$data->amount ?? ''}}">
  18. </div>
  19. </div>
  20. <div class="form-group">
  21. <label class="col-sm-2 control-label" for="title">抬头:</label>
  22. <div class="col-sm-8">
  23. <input type="text" class="form-control" id="title" name="title"
  24. value="{{$data->title??''}}">
  25. </div>
  26. </div>
  27. <div class="form-group">
  28. <label class="col-sm-2 control-label" for="tax_no">税号:</label>
  29. <div class="col-sm-8">
  30. <input type="text" class="form-control" id="tax_no" name="tax_no"
  31. value="{{$data->tax_no??''}}">
  32. </div>
  33. </div>
  34. <div class="hr-line-dashed"></div>
  35. <div class="form-group">
  36. <div class="col-sm-4 col-sm-offset-2">
  37. <button class="btn btn-primary" type="button"
  38. onclick="units.save({{$data->id??0}})">
  39. 保存
  40. </button>
  41. <button class="btn btn-white closeLayer" type="button">取消</button>
  42. </div>
  43. </div>
  44. </form>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </body>
  51. @endsection
  52. @section('footer')
  53. <script>
  54. var units = {
  55. save: function (id) {
  56. var data = tips.getFormValues('#form');
  57. var ajaxConfig = {
  58. url: '/admin/invoices/' + id,
  59. type: 'put',
  60. data: data,
  61. success: function (result) {
  62. layer.msg(result.message, {icon: 6, time: 1000}, function () {
  63. window.parent.tips.tableRefresh('#table');
  64. tips.closeParentLayer();
  65. });
  66. }
  67. };
  68. tips.ajax(ajaxConfig);
  69. }
  70. };
  71. </script>
  72. @endsection