create.blade.php 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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' => '', 'options' => $options])
  20. @include('share.layui-form-item', ['type' => 'input', 'name' => 'spec_name', 'label' => '规格型号', 'required' => true, 'value' => (old('data') ? old('data')['spec_id'] : '')])
  21. @include('share.layui-form-item', ['type' => 'radio', 'name' => 'status', 'label' => '状态', 'selected_id' => (old('data') ? old('data')['status'] : ''), 'options' => $status_options])
  22. @include('share.project-select-form', ['project_id' => '', 'options' => $project_options])
  23. {{--@include('share.project-work-point-select-form', ['project_id' => '', 'work_point_id' => '', 'options' => $project_work_point_options])--}}
  24. @include('share.layui-form-item', ['type' => 'input', 'name' => 'number', 'label' => '固定资产编号', 'required' => true, 'value' => (old('data') ? old('data')['number'] : '')])
  25. @include('share.layui-form-item', ['id' => 'sg-produce-date', 'type' => 'date', 'name' => 'produce_date', 'label' => '出厂日期', 'required' => true, 'value' => (old('data') ? old('data')['produce_date'] : '')])
  26. @include('share.layui-form-item', ['type' => 'input', 'name' => 'shape', 'label' => '外形尺寸', 'required' => true, 'value' => (old('data') ? old('data')['shape'] : '')])
  27. @include('share.layui-form-item', ['type' => 'input', 'name' => 'buy_origin', 'label' => '采购原值', 'required' => true, 'value' => (old('data') ? old('data')['buy_origin'] : '')])
  28. @include('share.layui-form-item', ['type' => 'input', 'name' => 'manufacturer', 'label' => '生产厂家', 'required' => true, 'value' => (old('data') ? old('data')['manufacturer'] : '')])
  29. <div class="layui-form-item">
  30. <div class="layui-input-block">
  31. <button id="btnSubmit" class="layui-btn" lay-submit lay-filter="formDemo">提交</button>
  32. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  33. </div>
  34. </div>
  35. </form>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. @endsection
  41. @section('footer')
  42. <script>
  43. $(function () {
  44. layui.use(['form', 'laydate'], function(){
  45. var form = layui.form;
  46. var laydate = layui.laydate;
  47. // form.verify({
  48. // integer: function (value) {
  49. // var pattern = /^[1-9]\d*$/;
  50. // if(!(pattern.test(value) || value === '0')) {
  51. // return '组员人数必须为大于等于0的整数';
  52. // }
  53. // }
  54. // });
  55. $('#sg-back-btn').on('click', function () {
  56. window.history.go(-1);
  57. });
  58. laydate.render({
  59. elem: '.sg-select-date'
  60. });
  61. });
  62. })
  63. </script>
  64. @endsection