add_company.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. {extend name="common/base"/}
  2. {block name="style"}
  3. <style>
  4. .footer{
  5. display: none;
  6. }
  7. /*表格*/
  8. #tabniubi {
  9. width: 100%;
  10. margin: 10px 0;
  11. background-color: #fff;
  12. color: #5f5f5f;
  13. }
  14. #tabniubi th {
  15. padding: 9px 15px;
  16. min-height: 20px;
  17. height: 40px !important;
  18. text-align: center;
  19. /* font-size: 14px; */
  20. border-width: 1px;
  21. border-style: solid;
  22. border-color: #e2e2e2;
  23. font: 14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial, sans-serif;
  24. }
  25. #tabniubi tr:first-child {
  26. padding: 0;
  27. min-height: 0;
  28. line-height: 0;
  29. border-width: 0;
  30. border-style: none;
  31. border-color: #fff;
  32. font-size: 0;
  33. }
  34. #tabniubi tr:first-child th {
  35. padding: 0;
  36. min-height: 0;
  37. line-height: 0;
  38. border-width: 0;
  39. border-style: none;
  40. border-color: #fff;
  41. font-size: 0;
  42. }
  43. .form-title {
  44. background-color: rgb(241, 241, 241);
  45. color: rgb(95, 95, 95);
  46. border-color: rgb(241, 241, 241);
  47. font-weight: 600;
  48. }
  49. </style>
  50. {/block}
  51. {block name="body"}
  52. <form class="layui-form p-4">
  53. <h3 class="pb-3">新增预约</h3>
  54. <table id="tabniubi" cellpadding="1" cellspacing="1">
  55. <tr>
  56. <th style="width: 10%;height: 0 !important;"></th>
  57. <th style="width: 10%;height: 0 !important;"></th>
  58. <th style="width: 10%;height: 0 !important;"></th>
  59. <th style="width: 10%;height: 0 !important;"></th>
  60. <th style="width: 10%;height: 0 !important;"></th>
  61. <th style="width: 10%;height: 0 !important;"></th>
  62. <th style="width: 10%;height: 0 !important;"></th>
  63. <th style="width: 10%;height: 0 !important;"></th>
  64. <th style="width: 10%;height: 0 !important;"></th>
  65. </tr>
  66. <tr border="1">
  67. <tr>
  68. <th class="form-title">预约时间<font style="color:red;"> *</font></th>
  69. <th colspan="4">
  70. <input type="text" class="layui-input" lay-verify="required" readonly name="appointment_time" id="ID-laydate-type-datetime-1" placeholder="请选择预约时间">
  71. </th>
  72. <th class="form-title">派遣人数<font style="color:red;">*</font></th>
  73. <th colspan="3">
  74. <input type="text" name="dispatch_num" lay-verify="required" class="layui-input" placeholder="请添加派遣人数">
  75. </th>
  76. </tr>
  77. <!-- <tr>-->
  78. <!-- <th class="form-title">审核人 <font style="color: red !important;">*</font></th>-->
  79. <!-- <th colspan="2">-->
  80. <!-- <select name="sent_review_head" lay-reqText="请选择审核人">-->
  81. <!-- <option value="{$sent_review_head_name}">{$sent_review_head_name}</option>-->
  82. <!-- </select>-->
  83. <!-- </th>-->
  84. <!-- </tr>-->
  85. <tr>
  86. <th class="form-title">地址/备注<font style="color:red;"> *</font></th>
  87. <th colspan="8">
  88. <textarea placeholder="" name="address_or_remark" lay-verify="required" class="layui-textarea"></textarea>
  89. </th>
  90. </tr>
  91. </table>
  92. <div class="pt-3">
  93. <input type="hidden" name="project_id" lay-verify="required" lay-reqText="" placeholder="" class="layui-input" value="{$project_id}" readonly>
  94. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
  95. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  96. </div>
  97. </form>
  98. {/block}
  99. <!-- /主体 -->
  100. <!-- 脚本 -->
  101. {block name="script"}
  102. <script>
  103. const moduleInit = ['tool', 'oaTool'];
  104. function gouguInit() {
  105. var form = layui.form, tool = layui.tool, oaTool = layui.oaTool;
  106. layui.laydate.render({
  107. elem: '#ID-laydate-type-datetime-1',
  108. type: 'datetime',
  109. fullPanel: true // 2.8+
  110. });
  111. let a = 1;
  112. //监听提交
  113. form.on('submit(webform)', function (data) {
  114. if (!isIntegerString(data.field.dispatch_num)){
  115. layer.msg('派遣人数请输入整数');
  116. return false;
  117. }
  118. console.log(Number.isInteger(data.field.dispatch_num),data.field.dispatch_num)
  119. if(a){
  120. layer.confirm('确定要申请吗?', {
  121. icon: 3,
  122. title: '提示'
  123. }, function (index) {
  124. let callback = function (e) {
  125. layer.msg(e.msg);
  126. parent.layui.appointmentTable.reload();
  127. if (e.code == 0) {
  128. tool.tabRefresh(71);
  129. tool.sideClose(1000);
  130. a = 1
  131. }
  132. }
  133. tool.post("/admin/project.appointment/add_company", data.field, callback)
  134. a = 0
  135. });
  136. }
  137. return false;
  138. });
  139. }
  140. function isIntegerString(str) {
  141. var pattern = /^-?\d+$/; // 匹配整数,包括负整数
  142. return pattern.test(str);
  143. }
  144. </script>
  145. {/block}