0
0

recordAdmin.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title></title>
  6. <meta name="renderer" content="webkit">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  9. <link rel="stylesheet" href="../../static/css/font-awesome.min.css">
  10. <link rel="stylesheet" href="../../static/css/weadmin.css">
  11. <link rel="stylesheet" href="../../static/css/style.css">
  12. <!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
  13. <!--[if lt IE 9]>
  14. <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  15. <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  16. <![endif]-->
  17. <style>
  18. html{
  19. overflow-y: auto;
  20. }
  21. .layui-form-label{
  22. width: 100px;
  23. }
  24. .layui-input-block{
  25. margin-left: 138px;
  26. }
  27. .w-e-toolbar{
  28. padding: 0 !important;
  29. }
  30. .w-e-toolbar .w-e-menu{
  31. padding: 5px 4px !important;
  32. }
  33. </style>
  34. </head>
  35. <body>
  36. <div class="weadmin-body">
  37. <form class="layui-form">
  38. <div class="layui-form-item">
  39. <label class="layui-form-label">
  40. 记录管理名称:
  41. </label>
  42. <div class="layui-input-block steta_grouds">
  43. <input type="text" placeholder="请输入设备铭牌名称" class="layui-input recordName" lay-verify="required" oninput="recordTextTitles(this.value)">
  44. </div>
  45. </div>
  46. <div class="layui-form-item">
  47. <label class="layui-form-label">记录模板</label>
  48. <div class="layui-input-block">
  49. <table class="layui-table table-bordered table-bg">
  50. <thead>
  51. <tr class="text-c">
  52. <th>记录模板</th>
  53. <th>维护部门</th>
  54. <th>操作</th>
  55. </tr>
  56. </thead>
  57. <tbody class="tbodys">
  58. </tbody>
  59. </table>
  60. </div>
  61. <div class="layui-input-block" style="margin-top: 10px">
  62. <a href="javascript:;" class="layui-btn layui-btn-normal addRecord">添加其他参数</a>
  63. </div>
  64. </div>
  65. <div class="layui-form-item" style="text-align: center;padding-top: 50px">
  66. <button class="layui-btn" lay-submit lay-filter="recordBtn">提交</button>
  67. </div>
  68. </form>
  69. <span class="text" style="display: none"></span>
  70. </div>
  71. <script src="../../lib/layui/layui.js" charset="utf-8"></script>
  72. <script>
  73. layui.use(['form','layer','jquery','laydate'], function(){
  74. var form = layui.form,
  75. $ = layui.jquery,
  76. laydate= layui.laydate,
  77. layer = layui.layer;
  78. form.render();
  79. $("body").on('click','.addRecord',function () {
  80. var tbodys = $(".tbodys");
  81. parent.depMaintainFun(tbodys);
  82. });
  83. window.recordTextTitles = function (title) {
  84. parent.onFocus();
  85. parent.addrecord(title)
  86. };
  87. form.on('submit(recordBtn)', function(){
  88. var recordTemplate = [] , tr = $('.tbodys tr');
  89. var recordTemplateobj = {organizationId:"",organizationName:'',pageId:'',recordName:'',stepIndex:'',templateId:'',templateName:''};
  90. var num = 0;
  91. if ($('.recordName').val() === "") {
  92. layer.msg('记录模版信息不能为空');
  93. return false;
  94. }
  95. tr.each(function () {
  96. recordTemplateobj = {};
  97. recordTemplateobj.pageId = sessionStorage.getItem("QRcodeID");
  98. recordTemplateobj.organizationId = $(this).attr('parent-id') +','+ $(this).attr("son-id");
  99. recordTemplateobj.organizationName = $(this).find('.cursor_p').html();
  100. recordTemplateobj.stepIndex = num++ +1;
  101. recordTemplateobj.recordName = $('.recordName').val();
  102. recordTemplateobj.templateId = $(this).find('.depsName').attr('dep-id');
  103. recordTemplateobj.templateName = $(this).find(".depsName").html();
  104. recordTemplate.push(recordTemplateobj)
  105. });
  106. console.log(recordTemplate,'recordTemplate');
  107. $.ajax({
  108. url:'http://apptest.jieweizhineng.com/api/swagger/api/page/v1/addPageRecord',
  109. type:'post',
  110. data:JSON.stringify(recordTemplate),
  111. contentType:'application/json;charset=utf-8',
  112. dataType:'json',
  113. success:function (res) {
  114. if (res.code === '200'){
  115. parent.pageRelationIdFun(res.data);
  116. parent.QRcodeIndexas();
  117. layer.msg('记录模版新增成功');
  118. }else {
  119. layer.msg('记录模版新增失败,请检查信息');
  120. }
  121. },
  122. error:function () {
  123. layer.msg('网络错误,请检查网络');
  124. }
  125. });
  126. return false;
  127. });
  128. });
  129. </script>
  130. </body>
  131. </html>