create.blade.php 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. @extends('admin.layout-content')
  2. @section('header')
  3. <style>
  4. </style>
  5. @endsection
  6. @section('content')
  7. <div class="layui-card">
  8. <div class="layui-card-header sg-card-header">
  9. 创建设备
  10. <div class="sg-card-create">
  11. <button id="sg-back-btn" class="layui-btn layui-btn-sm">返回</button>
  12. </div>
  13. </div>
  14. <div class="layui-card-body">
  15. <div class="layui-container sg-create-container">
  16. <div class="layui-col-sm8 layui-col-sm-offset2">
  17. <form class="layui-form" method="POST" action="{{ $pre_uri . 'store' }}">
  18. {{ csrf_field() }}
  19. @include('share.name-select-form', ['device_name_id' => '', 'spec_id' => '', 'options' => $options])
  20. @include('share.layui-form-item', ['type' => 'radio', 'name' => 'status', 'label' => '状态', 'selected_id' => (old('data') ? old('data')['status'] : ''), 'options' => $status_options])
  21. @include('share.layui-form-item', ['type' => 'input', 'name' => 'number', 'label' => '固定资产编号', 'required' => true, 'value' => (old('data') ? old('data')['number'] : '')])
  22. @include('share.layui-form-item', ['id' => 'sg-produce-date', 'type' => 'date', 'name' => 'produce_date', 'label' => '出厂日期', 'required' => true, 'value' => (old('data') ? old('data')['produce_date'] : '')])
  23. @include('share.layui-form-item', ['type' => 'input', 'name' => 'shape', 'label' => '外形尺寸', 'required' => true, 'value' => (old('data') ? old('data')['shape'] : '')])
  24. @include('share.layui-form-item', ['type' => 'input', 'name' => 'buy_origin', 'label' => '采购原值', 'required' => true, 'value' => (old('data') ? old('data')['buy_origin'] : '')])
  25. @include('share.layui-form-item', ['type' => 'input', 'name' => 'manufacturer', 'label' => '生产厂家', 'required' => true, 'value' => (old('data') ? old('data')['manufacturer'] : '')])
  26. <div class="layui-form-item">
  27. <div class="layui-input-block">
  28. <button class="layui-btn" lay-submit lay-filter="formDemo">提交</button>
  29. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  30. </div>
  31. </div>
  32. </form>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. @endsection
  38. @section('footer')
  39. <script>
  40. $(function () {
  41. layui.use(['form', 'laydate'], function(){
  42. var form = layui.form;
  43. var laydate = layui.laydate;
  44. // form.verify({
  45. // integer: function (value) {
  46. // var pattern = /^[1-9]\d*$/;
  47. // if(!(pattern.test(value) || value === '0')) {
  48. // return '组员人数必须为大于等于0的整数';
  49. // }
  50. // }
  51. // });
  52. $('#sg-back-btn').on('click', function () {
  53. window.history.go(-1)
  54. });
  55. laydate.render({
  56. elem: '.sg-select-date'
  57. });
  58. });
  59. })
  60. </script>
  61. @endsection