Forráskód Böngészése

添加交工时间

lvhao 2 napja
szülő
commit
09fbfbbe57

+ 21 - 1
core/CoreApp/controllers/Whlabel_bh.php

@@ -131,6 +131,9 @@ class Whlabel_bh extends Start_Controller {
 		else if($arg == 'wdyindex'){
 			$this->_wdyindex();
 		}
+		else if($arg == 'edit_jgtime'){
+			$this->_edit_jgtime();
+		}
 		else
 		{
 			 $this->_index();
@@ -2205,7 +2208,7 @@ class Whlabel_bh extends Start_Controller {
 		    {
                 $start = ($page - 1)*$perpage;
             }
-			$list = $this->whlabel_bh->find_pc($where,'orderinfo',"id,orderinfo",'id desc',$start,$perpage);
+			$list = $this->whlabel_bh->find_pc($where,'orderinfo',"id,orderinfo,jgtime",'id desc',$start,$perpage);
 	
 
 			$rows = [];
@@ -2243,6 +2246,7 @@ class Whlabel_bh extends Start_Controller {
 				$rows[$k]['yphsl'] = $yphsl;  //已配货数量
 				$rows[$k]['yjgsj'] = $yjgsj;  //已完工数量
 				$rows[$k]['wwgsl'] = $tmp_bhnum - $yjgsj;  //未完工数量
+				$rows[$k]['jgtime'] = empty($v['jgtime'])?'<i class="method fa fa-edit" data-id="'.$v['id'].'" onclick="edit_jgtime(this)"></i>':date("Y-m-d H:i:s",$v['jgtime']).'  <i class="method fa fa-edit" data-id="'.$v['id'].'"  onclick="edit_jgtime(this)"></i>';
 			}
 
 			$total = $this->whlabel_bh->find_count($where);
@@ -2274,6 +2278,22 @@ class Whlabel_bh extends Start_Controller {
 		$this->_Template('whlabel_bh_transfer_log',$this->data);
 	}
 
+	public function _edit_jgtime(){
+		$post = $this->input->post(NULL, TRUE);
+		$info = $this->whlabel_bh->read($post['id']);
+
+		if(empty($info)){
+			echo json_encode(['code'=>-1,'msg'=>'信息异常']);exit;
+		}
+		$jgtime = strtotime($post['jgtime']);
+
+		$list = $this->whlabel_bh->find_all(" orderinfo = '".$info['orderinfo']."'");
+		foreach($list as $k=>$v){
+			$this->whlabel_bh->save(['jgtime'=>$jgtime],$v['id']);
+		}
+		echo json_encode(['code'=>1,'msg'=>'操作成功']);exit;
+	}
+
 	public function _transfer_detail($arg_array){
 		$id = $arg_array[0];
 		$transfer_list = $this->transfer->find_all();

+ 34 - 7
template/erp/whlabel_bh_transfer_log.html

@@ -22,7 +22,7 @@
 <td>已配货数量</td>
 <td>已完工数量</td>
 <td>未完成数量</td>
-
+<td>交工时间</td>
 </tr>
 </table>
 </div>
@@ -33,10 +33,11 @@
 <div class="print none"></div>
 <div class="ts"><p class="tsn"></p></div>
 <div class="systemwindow">
-<div>
-<p>是否确定删除所选信息?</p>
-<p><font class="button">确 定</font><font class="esc">取 消</font></p>
-</div>
+    <div>
+        
+        <p></p>
+        <p><font class="button">确 定</font><font class="esc">取 消</font></p>
+    </div>
 </div>
 <div class="tyrows tyrowscc"><div><p></p><p></p></div></div>
 <div class="list"><div><p>操作配置</p><ul class="fj"></ul><em></em></div></div>
@@ -60,8 +61,34 @@ $(this).find('td:eq(7)').css("width","5%");
 
 });}
 window.onload = function() { 
-if(typeof $("select[name='printer']").length < 1) return;
-setTimeout(function(){ wprinter.printer()},1000);};
+// if(typeof $("select[name='printer']").length < 1) return;
+// setTimeout(function(){ wprinter.printer()},1000);
+};
+
+function edit_jgtime(that){
+    let id = $(that).data('id');
+   
+    $(".systemwindow div p:eq(0)").html('交工时间 :<input value="" name="jgtime" style="height: 26px;color: #000;border: 1px #ccc solid;font-size: 13px;margin-right: 20px;text-align: center;color: #333;border-radius: 5px;" placeholder="请输入交工时间" type="text" onclick="laydate({istime: true,format:\'YYYY-MM-DD hh:mm\'})">');
+        $(".systemwindow div p:eq(1)").html("<font data-id='"+id+"' id='whlabel_bh_ksprint'>确 定</font><font class='esc'>取 消</font>");
+        $(".systemwindow").show();
+}
+$(".systemwindow").on('click',"#whlabel_bh_ksprint",function() {
+	var id = $(this).data("id");
+	var jgtime = $("input[name='jgtime']").val();
+    $.post('/whlabel_bh/edit_jgtime',{id:id,jgtime:jgtime},function(res){
+        $(".systemwindow").hide();
+        if(res.code == 1){
+           $(".search span").click()
+        }else{  
+            layx.alert('提示',res.msg);
+        }
+    },'json')
+   
+	
+});
+$(".systemwindow").on('click',".esc",function() {
+ $(".systemwindow").hide();	
+});
 </script>
 <script type="text/javascript" src="{$theme}js/laydate.js"></script>