123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- {extend name="common/base"/}
- {block name="style"}
- <style>
- .footer{
- display: none;
- }
-
- /*表格*/
- #tabniubi {
- width: 100%;
- margin: 10px 0;
- background-color: #fff;
- color: #5f5f5f;
- }
- #tabniubi th {
- padding: 9px 15px;
- min-height: 20px;
- height: 40px !important;
- text-align: center;
- /* font-size: 14px; */
- border-width: 1px;
- border-style: solid;
- border-color: #e2e2e2;
- font: 14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial, sans-serif;
- }
- #tabniubi tr:first-child {
- padding: 0;
- min-height: 0;
- line-height: 0;
- border-width: 0;
- border-style: none;
- border-color: #fff;
- font-size: 0;
- }
- #tabniubi tr:first-child th {
- padding: 0;
- min-height: 0;
- line-height: 0;
- border-width: 0;
- border-style: none;
- border-color: #fff;
- font-size: 0;
- }
- .form-title {
- background-color: rgb(241, 241, 241);
- color: rgb(95, 95, 95);
- border-color: rgb(241, 241, 241);
- font-weight: 600;
- }
- </style>
- {/block}
- {block name="body"}
- <form class="layui-form p-4">
- <h3 class="pb-3">新增预约</h3>
- <table id="tabniubi" cellpadding="1" cellspacing="1">
- <tr>
- <th style="width: 10%;height: 0 !important;"></th>
- <th style="width: 10%;height: 0 !important;"></th>
- <th style="width: 10%;height: 0 !important;"></th>
- <th style="width: 10%;height: 0 !important;"></th>
- <th style="width: 10%;height: 0 !important;"></th>
- <th style="width: 10%;height: 0 !important;"></th>
- <th style="width: 10%;height: 0 !important;"></th>
- <th style="width: 10%;height: 0 !important;"></th>
- <th style="width: 10%;height: 0 !important;"></th>
- </tr>
- <tr border="1">
-
- <tr>
- <th class="form-title">预约时间<font style="color:red;"> *</font></th>
- <th colspan="4">
- <input type="text" class="layui-input" lay-verify="required" readonly name="appointment_time" id="ID-laydate-type-datetime-1" placeholder="请选择预约时间">
- </th>
- <th class="form-title">派遣人数<font style="color:red;">*</font></th>
- <th colspan="3">
- <input type="text" name="dispatch_num" lay-verify="required" class="layui-input" placeholder="请添加派遣人数">
- </th>
-
- </tr>
- <!-- <tr>-->
- <!-- <th class="form-title">审核人 <font style="color: red !important;">*</font></th>-->
- <!-- <th colspan="2">-->
- <!-- <select name="sent_review_head" lay-reqText="请选择审核人">-->
- <!-- <option value="{$sent_review_head_name}">{$sent_review_head_name}</option>-->
- <!-- </select>-->
- <!-- </th>-->
- <!-- </tr>-->
-
- <tr>
- <th class="form-title">地址/备注<font style="color:red;"> *</font></th>
- <th colspan="8">
- <textarea placeholder="" name="address_or_remark" lay-verify="required" class="layui-textarea"></textarea>
- </th>
- </tr>
- </table>
- <div class="pt-3">
- <input type="hidden" name="project_id" lay-verify="required" lay-reqText="" placeholder="" class="layui-input" value="{$project_id}" readonly>
- <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
- <button type="reset" class="layui-btn layui-btn-primary">重置</button>
- </div>
- </form>
- {/block}
- <!-- /主体 -->
- <!-- 脚本 -->
- {block name="script"}
- <script>
- const moduleInit = ['tool', 'oaTool'];
- function gouguInit() {
- var form = layui.form, tool = layui.tool, oaTool = layui.oaTool;
- layui.laydate.render({
- elem: '#ID-laydate-type-datetime-1',
- type: 'datetime',
- fullPanel: true // 2.8+
- });
- let a = 1;
-
- //监听提交
- form.on('submit(webform)', function (data) {
-
- if (!isIntegerString(data.field.dispatch_num)){
-
- layer.msg('派遣人数请输入整数');
- return false;
- }
- console.log(Number.isInteger(data.field.dispatch_num),data.field.dispatch_num)
- if(a){
- layer.confirm('确定要申请吗?', {
- icon: 3,
- title: '提示'
- }, function (index) {
- let callback = function (e) {
- layer.msg(e.msg);
- parent.layui.appointmentTable.reload();
- if (e.code == 0) {
- tool.tabRefresh(71);
- tool.sideClose(1000);
- a = 1
- }
- }
- tool.post("/admin/project.appointment/add_company", data.field, callback)
- a = 0
- });
- }
-
-
- return false;
- });
- }
- function isIntegerString(str) {
- var pattern = /^-?\d+$/; // 匹配整数,包括负整数
- return pattern.test(str);
- }
- </script>
- {/block}
|