create.blade.php 3.5 KB

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