lvhao il y a 4 heures
Parent
commit
b05ac3baf2

+ 6 - 5
core/CoreApp/controllers/Beihuogl.php

@@ -260,11 +260,12 @@ class Beihuogl extends Start_Controller {
             $insert_arr = [];
 
             $time = time();
-            if(empty($data['yqwc_time'])){
-                echo json_encode(['code'=>-1,'msg'=>'预期完工事时间未填写']);
-                 die;
-            }
+           
             foreach($data['title'] as $k=>$v){
+                if(empty($data['yqwc_time'][$k])){
+                    echo json_encode(['code'=>-1,'msg'=>'第'.($k+1).'行预期完工事时间未填写']);
+                    die;
+                }
                 $insert_arr[] = [
                     'sb_no'=>$sb_no,
                     'sku'=>$data['sku'][$k],
@@ -280,7 +281,7 @@ class Beihuogl extends Start_Controller {
                     'add_time'=>$time,
                     'real_time'=>$time,
                     'update_time'=>$time,
-                    'yqwc_time'=>empty($data['yqwc_time'])?0:strtotime($data['yqwc_time']),
+                    'yqwc_time'=>empty($data['yqwc_time'][$k])?0:strtotime($data['yqwc_time'][$k]),
                 ];
             }
             $r =$this->db->insert_batch('bhsq',$insert_arr);

+ 5 - 4
template/erp/beihuogl_dyapplyadd.html

@@ -144,10 +144,7 @@
     <em>申请人:</em>
     <input value="" name="sqr" type="text" >
 </li>
-<li >
-    <em>预期完成时间:</em>
-    <input id="yqwc_time"  value="" name="yqwc_time" type="text" onClick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})"  autocomplete="off">
-</li>
+
 <li class="length">
     <em>备注:</em>
     <textarea name="remark" style="height:50px;"></textarea>
@@ -169,6 +166,7 @@
                 <th>品名(必填)</th>
                 <th>sku</th>
                 <th style="width:80px;">数量(必填)</th>
+                <th style="width:80px;">预期时间</th>
                 <th style="width:40px;">操作</th>
             </tr>
         </thead>
@@ -177,6 +175,7 @@
                 <td> <input type="text" placeholder="请输入中文品名" value="" name="title[]"> </td>
                 <td> <input type="text" placeholder="请输入库存对应的sku" value="" name="sku[]"> </td>
                 <td> <input type="number" value="1" step="1" min="0" placeholder="调整数量" name="sq_num[]"> </td>
+                <td> <input  type="date" value="" name="yqwc_time[]"> </td>
                 <td>
                     <button onclick="delGoods(this)">删除</button>
                 </td>
@@ -292,6 +291,7 @@
         <td> <input type="text" placeholder="请输入中文品名" value="" name="title[]"> </td>
         <td> <input type="text" placeholder="请输入库存对应的sku" value="" name="sku[]"> </td>
         <td> <input type="number" value="1" step="1" min="0" placeholder="调整数量" name="sq_num[]"> </td>
+        <td> <input  type="date" value="" name="yqwc_time[]"> </td>
         <td>
             <button onclick="delGoods(this)">删除</button>
         </td>
@@ -303,6 +303,7 @@
         <td> <input type="text" placeholder="请输入中文品名" value="<%= data[key]['zh'] %>" name="title[]"> </td>
         <td> <input type="text" placeholder="请输入库存对应的sku" value="<%= data[key]['sku'] %>" name="sku[]"> </td>
         <td> <input type="number" value="1" step="1" min="0" placeholder="调整数量" name="sq_num[]"> </td>
+        <td> <input  type="date" value="" name="yqwc_time[]"> </td>
         <td>
             <button onclick="delGoods(this)">删除</button>
         </td>