create.blade.php 3.7 KB

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