Browse Source

提交工厂备货信息

lvhao 2 days ago
parent
commit
98b03058df

+ 200 - 0
core/CoreApp/controllers/Whlabelfz1.php

@@ -0,0 +1,200 @@
+<?php defined('BASEPATH') or exit('No direct script access allowed');
+/**
+ * 由于whlabel类下的代码太长了,决定以后非必要代码都放在whlabelfz类中,以便于管理。
+ */
+class Whlabelfz1 extends Start_Controller
+{
+	public function __construct()
+	{
+        parent::__construct();
+		$this->load->_model("Model_whlabel_bh_transfer",'whlabel_bh_transfer');
+		$this->load->_model("Model_whlabel_bh_scan",'whlabel_bh_scan');
+		$this->load->_model("Model_logic_u9tools","logic_u9tools");
+		$this->load->_model("Model_whlabellabel","whlabellabel");
+    }
+    //定义方法的调用规则 获取URI第二段值
+	public function _remap($arg, $arg_array)
+	{
+		if ($arg == 'scam_mgxx') //
+		{
+            $this->_scanMgxx();
+		}
+		else if($arg =='scam_mgxx_post')
+		{
+			$this->_scanMgxxPost();
+		}else if($arg == 'mgxxindex'){
+			$this->_mgxxindex();
+		}
+		else if($arg == 'get_scan_info'){
+			$this->_getScanInfo();
+		}
+	    else {
+			$this->_index();
+		}
+	}
+
+    private function _index(){
+        die('No direct script access allowed');
+    }
+	private function _mgxxindex(){
+		$post = $this->input->post();
+		if(!empty($post)){
+			$rows = array('total'=>0,'over'=>1,'pagenum'=>1,'rows'=>([]));
+		    echo json_encode($rows);exit;
+		}
+		$this->_Template('whlabelfz1_mgxxindex', $this->data);
+	}
+	//美国销售 扫描出库的
+    private function _scanMgxx(){
+		$post = $this->input->post();
+		if(!empty($post)){
+			$type = $this->input->post('type',true);
+			$orderinfo = $this->input->post('orderinfo',true);
+			$page = $this->input->post('page',true);
+			$perpage = $this->input->post('perpage',true);
+			$where = " type = ".$type." and orderinfo = '".(string)$orderinfo."' ";
+
+			if(empty($page))
+		    {
+                $start = 0;
+		    	$perpage = 1;
+            }
+		    else
+		    {
+                $start = ($page - 1)*$perpage;
+            }
+			$order_str = 'id desc';
+			$info_list = $this->whlabel_bh_scan->find_all($where,'id,orderinfo,pm,label,sl,scantime',$order_str,$start,$perpage);
+			$total = $this->whlabel_bh_scan->find_count($where);
+		    $pagenum = ceil($total/$perpage);
+		    $over = $total-($start+$perpage);
+			foreach($info_list as $k=>$v){
+				$info_list[$k]['scantime'] = date('Y-m-d H:i:s',$v['scantime']);
+			}
+			$rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($info_list));
+			echo json_encode($rows);exit;
+		}else{
+			$orderinfo = $this->input->get('orderinfo',true);
+			$type = $this->input->get('type',true);
+			$this->data['orderinfo'] = $orderinfo;
+			$this->data['type'] = $type;
+			$this->_Template('whlabelfz1_scammgxx', $this->data);
+		}
+		
+	}
+	private function _getScanInfo(){
+		$post = $this->input->post();
+		$label = $post['label'];
+		if(empty($label)){
+			die(json_encode(['code'=>-1,'msg'=>'请输入标签号','data'=>[]]));
+		}
+		$info = $this->whlabel_bh_transfer->find("label ='".$label."'");
+		if(empty($info)){
+			die(json_encode(['code'=>-1,'msg'=>'标签号不存在','data'=>[]]));
+		}
+		echo "<pre>";
+		print_r($info);
+		die;
+	}
+	//接收美店销售的post提交
+	private function _scanMgxxPost(){
+		$post = $this->input->post();
+		$type = $post['type'];
+		$orderinfo = $post['orderinfo'];
+		$label = $post['scanlabel'];
+		$num = (int)$post['num'];
+		if(empty($type)){
+			exit(json_encode(['code'=>-1,'msg'=>'数据类型异常,请联系技术','data'=>[]],JSON_UNESCAPED_UNICODE));
+		}
+		if(empty($orderinfo)){
+			exit(json_encode(['code'=>-1,'msg'=>'美国销售单号未输入','data'=>[]],JSON_UNESCAPED_UNICODE));
+		}
+		if(empty($label)){
+			exit(json_encode(['code'=>-1,'msg'=>'标签号不能为空','data'=>[]],JSON_UNESCAPED_UNICODE));
+		}
+		if(!in_array($type,[1,2])){
+			exit(json_encode(['code'=>-1,'msg'=>'数据类型异常,请联系技术','data'=>[],JSON_UNESCAPED_UNICODE]));
+		}
+		if($type == 1){
+			$num = 1;
+		}
+		if($type == 2){
+			if($num > 200){
+				exit(json_encode(['code'=>-1,'msg'=>'扫描数量不能大于200','data'=>[],JSON_UNESCAPED_UNICODE]));
+			}
+		}
+		$info = $this->whlabel_bh_scan->find("label ='".$label."'");
+		if(!empty($info)){
+			exit(json_encode(['code'=>-1,'msg'=>'该标签已被扫描','data'=>[],JSON_UNESCAPED_UNICODE]));
+		}
+		
+		if($type == 1){
+			$res = $this->_bbscan($orderinfo,$label);
+		}elseif($type == 2){
+			$res = $this->_bqscan($orderinfo,$label,$num);
+		}
+
+		exit(json_encode($res));
+	
+	}
+	//生产布标扫描
+	private function  _bbscan($orderinfo,$label){
+		$info = $this->whlabel_bh_transfer->find("label ='".$label."'");
+		if(empty($info)){
+			return ['code'=>-1,'msg'=>'标签号不存在','data'=>[]];
+		}
+		if($info['label'] != $label){
+			return ['code'=>-1,'msg'=>'条码对应的美国销售单号不一致','data'=>[]];
+		}
+		$arr = [
+			'orderinfo'=>(string)$orderinfo,
+			'type'=>1,
+			'label'=>(string)$label,
+			'features'=>(string)$info['features'],
+			'fid'=>$info['id'],
+			'jm'=>$info['jm'],
+			'pm'=>$info['pm'],
+			'sl'=>1,
+			'scantime'=>time(),
+			'status'=>0,
+		];
+		$this->whlabel_bh_scan->insert($arr);
+		return ['code'=>1,'msg'=>'标签扫描成功','data'=>[]];
+	}
+    //标签扫描
+	private function _bqscan($orderinfo,$label,$num){
+		$info = $this->whlabellabel->find("label ='".$label."'");
+		if(empty($info)){
+			return ['code'=>-1,'msg'=>'标签号不存在','data'=>[]];
+		}
+		$list = [
+			[
+				'sku2'=>$info['features'],
+			]
+		];
+		$res = $this->logic_u9tools->getU9bm($list,'sku2');
+		if(empty($res[0])){
+			return ['code'=>-1,'msg'=>'u9条码编辑错误-1','data'=>[]];
+		}
+		if(empty($res[0]['jm'])){
+			return ['code'=>-1,'msg'=>'u9条码编辑异常-2','data'=>[]];
+		}
+		$arr = [
+			'orderinfo'=>(string)$orderinfo,
+			'type'=>1,
+			'label'=>(string)$label,
+			'features'=>(string)$info['features'],
+			'fid'=>$info['id'],
+			'jm'=>$res[0]['jm'],
+			'pm'=>$res[0]['zh'],
+			'sl'=>$num,
+			'scantime'=>time(),
+			'status'=>0,
+		];
+		$this->whlabel_bh_scan->insert($arr);
+		return ['code'=>1,'msg'=>'标签扫描成功','data'=>[]];
+
+	}
+
+
+}

+ 1 - 0
core/CoreApp/models/Model_logic_tools.php

@@ -34,6 +34,7 @@ class Model_logic_tools extends Lin_Model {
    //根据shop 来判断是那个店铺 到时间直接选中表就好
    function getshopname($shop){
         $arr =  [
+            2=>"asteriahair",
             3=>"alipearlhair",
             4=>"westkis"
         ];

+ 176 - 0
core/CoreApp/models/Model_logic_u9mgwx.php

@@ -0,0 +1,176 @@
+<?php
+/**
+ * 系统自动处理在途库存的香港问题
+ */
+class Model_logic_u9mgwx extends Lin_Model {
+   
+    //切记要修改token_120的token真正的token!!!!
+    function __construct(){
+        parent::__construct();
+        $this->load->_model('Model_settingtest','settingtest');
+        $this->load->_model("Model_apiyyv1","apiyyv1");
+        $this->load->_model("Model_zzquque_u9","zzquque_u9");
+    }
+    public function getToken($type){
+        $name = "get_yytoken_".$type;
+        $token = $this->settingtest->$name();
+        return $token;
+    }
+   
+    /**
+     * 工厂加工生产外销的订单
+     */
+    public function doaction(){
+        $this->_add_xsd();
+        sleep(2);
+        $list = $this->zzquque_u9->find_all("( xs_status > 0 ) and ( bzch_status = 0 )");
+        foreach($list as $k=>$v){
+            $this->_cx_xsdandbzch($v);
+        }
+    }
+    // 第一步 创建销售单
+    private function _add_xsd(){
+        $start_time = strtotime(date('Y-m-d',time()));
+        $list = $this->db->select("id,orderinfo")->where(
+           ['scantime >=' => $start_time,]
+        )->from('whlabel_bh_scan')->group_by('orderinfo')->get();
+        $list= $list->result_array();
+        if(empty($list)){
+            exit('没有需要处理的数据');
+        }
+        echo "<pre>";
+        foreach($list as $k=>$v){
+            $this->_mgxxdo_one($v,$start_time);
+        }
+    }
+
+    private function _mgxxdo_one($info,$start_time){
+        $tmp_list =  $this->db->get_where('whlabel_bh_scan', [
+            'orderinfo' => $info['orderinfo'],
+            'scantime >=' => $start_time,
+        ])->result_array();
+        $goods_list = [];
+        foreach($tmp_list as $k=>$v){
+            if(isset($goods_list[$v['jm']])){
+                $goods_list[$v['jm']]['dcsl'] += 1;
+            }else{
+                $goods_list[$v['jm']] = [
+                    'jm'=>$v['jm'],
+                    'pm'=>$v['pm'],
+                    'dcsl'=>1,
+                    'final_price'=>1,//让财务录入价格
+                ];
+            }
+        }
+        $final_list = array_values($goods_list);
+        //避免一天内的东西被多次推送
+        $order_number = $info['orderinfo']."_".date("md",time());
+        $num = $this->db->where('order_no',$order_number)->from('zzquque_u9')->count_all_results();
+        //如果已经存在,则不再处理
+        if($num > 0){
+            return ;
+        }
+        $this->db->insert('zzquque_u9',[
+            'type'=>22,
+            'order_no'=>$order_number,
+            'create_time'=>time(),
+            'update_time'=>time(),
+        ]);
+        //获取到相关信息的id
+        $zzquque_u9_id = $this->db->insert_id();
+
+        $this->db->where([
+			'orderinfo'=>$info['orderinfo'],
+			'scantime >= ' => $start_time,
+            'status'=>0,
+            'zzquque_u9_id'=>0,
+		])->update("whlabel_bh_scan",[
+			'status'=>1,
+			'update_time'=>time(),
+            'zzquque_u9_id'=>$zzquque_u9_id,
+		]);
+        //创建要执行的队列信息
+        $params = [
+            'yyid'=>'02031',
+            'number'=>$order_number,
+            'time'=>time(),
+            'list'=>$final_list,
+        ];
+        $xsd_res  = $this->apiyyv1->xsdCreate($params,$this->getToken(130));
+        if(empty($xsd_res[0]['Data'][0]['m_code'])){
+            $this->editData($zzquque_u9_id,['xs_status'=>-1,'update_time'=>time()],$order_number,2,1,'xs',$xsd_res[1],$xsd_res[0]);
+            return ;
+        }
+        //更新销售单数据
+        $xs_no = $xsd_res[0]['Data'][0]["m_code"];
+        $this->editData($zzquque_u9_id,['xs_no'=>$xs_no,'xs_status'=>1,'update_time'=>time()],$order_number,2,1,'xs',$xsd_res[1],$xsd_res[0]);
+        
+    }
+
+    public function _cx_xsdandbzch($info){
+        $res = $this->apiyyv1->xsdCxByNo($info['xs_no'],$this->getToken(130));
+         //如果没审核 那么就不管
+         if(empty($res[0]['Data'])){
+            return ;
+        }
+        // 审核了 
+        $list = $res[0]['Data'];
+       
+        if($list[0]['status'] < 3){
+            return ;
+        }
+        foreach($list as $k=>$v){
+            $list[$k]['dcsl'] = $v['shipplanqtypu'];
+        }
+        $tmp_info = [
+            'zq_u9_id'=>$info['id'],
+            'drckbm'=> '13001',
+            'number'=>$info['order_no'],
+            'order_no'=>$info['order_no'],
+            'xs_no'=>$info['xs_no'],
+            'xs_two_no'=>$info['xs_no'],
+            'list'=>$list
+        ];
+        $res = $this->apiyyv1->bzchCreate($tmp_info,$this->getToken(130));
+        if($res[0]['Data'][0]['m_isSucess'] != 1){
+            $this->editData($info['id'],['bzch_status'=>-1,'update_time'=>time()],$info['order_no'],5,1,'bzch',$res[1],$res[0]);
+            return $this->logic_tools->ret_arr(-1,"标准出库的信息异常,请查看");
+        }else{
+            $this->editData($info['id'],['bzch_no'=>$res[0]['Data'][0]['m_code'],'bzch_status'=>1,'xs_status'=>3,'update_time'=>time()],$info['order_no'],5,1,'bzch',$res[1],$res[0]);
+            return $this->logic_tools->ret_arr(1,"标准出库创建成功");
+        }
+
+    }
+    
+
+   
+    //对标准出货单进行审核
+    public function checkBzch($info){
+        $res = $this->apiyyv1->bzchSubmitAndApprove(['number'=>$info['bzch_no']],$this->getToken(120));
+        // print_r($res[0]);
+        // print_r($res[1]);
+        if($res[0]['Data'][0]['m_isSucess'] != 1){
+            $this->editData($info['id'],['bzch_status'=>-2,'update_time'=>time()],$info['order_no'],5,2,'bzch_sh',$res[1],$res[0]);
+        }else{
+            $this->editData($info['id'],['bzch_no'=>$res[0]['Data'][0]['m_code'],'bzch_status'=>3,'update_time'=>time()],$info['order_no'],5,2,'bzch_sh',$res[1],$res[0]);
+        }
+    }
+
+
+
+    protected function editData($zq_u9_id,$z_qu_arr,$number,$one_type,$two_type,$apply_api,$apply_data,$ret_data){
+        $this->zzquque_u9->save($z_qu_arr,$zq_u9_id);
+        $this->zzququeu9_logs->insert([
+            'oid'=>$zq_u9_id,
+            'number'=>$number,
+            'one_type'=>$one_type,
+            'two_type'=>$two_type,
+            'apply_api'=>$apply_api,
+            'apply_data'=>json_encode($apply_data,JSON_UNESCAPED_UNICODE),
+            'ret_data'=>json_encode($ret_data,JSON_UNESCAPED_UNICODE),
+            'create_time'=>time(),
+            'read_time'=>date("Y-m-d H:i:s")
+        ]);
+    }
+}
+ 

+ 10 - 0
core/CoreApp/models/Model_whlabel_bh_scan.php

@@ -0,0 +1,10 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 
+class Model_whlabel_bh_scan extends Lin_Model 
+{
+	function __construct(){
+		parent::__construct();
+		$this->load->database();
+		$this->table = 'whlabel_bh_scan';
+		$this->load_table('whlabel_bh_scan');
+	}
+}  //end class

+ 1 - 0
core/CoreApp/models/Model_zzquque_u9.php

@@ -17,6 +17,7 @@ class Model_zzquque_u9 extends Lin_Model
 			11=>"小单美仓",//实际就是香港仓出货了
 			20=>"工厂外销单",
 			21=>"工厂备货单",
+			22=>"成品备货单",//实际就是成品库在美仓备货,一般就执行标准销售单和标准出货单
 		];
 	}
 }  

+ 177 - 0
template/erp/whlabelfz1_mgxxindex.html

@@ -0,0 +1,177 @@
+{Template header}
+<script src="{$theme}js/system.js"></script>
+<script type="text/javascript" src="{$theme}js/layer/layer.js"></script>
+<style>
+    .layui-layer-page .layui-layer-content {
+        overflow: none;
+    }
+    
+    .layui-layer-content ul {
+        padding: 0 8px;
+    }
+    
+    .layui-layer-content ul li {
+        margin: 8px 0;
+    }
+    
+    #layui-layer1 {
+        overflow: auto;
+    }
+    
+    .layui-form-checked {
+        margin-left: 10px;
+        display: inline-block;
+    }
+    .shou_btn{
+        width: 70px;
+        height: 30px;
+        line-height: 30px;
+        background: #2ca8a1;
+        text-align: center;
+        color: #fff;
+        border-radius: 5px;
+        display: inline-block;
+        margin-left: 20px;
+        cursor: pointer;
+    }
+</style>
+
+<body>
+    <div class="warp">
+        <div class="fixed">
+            
+            <div class="numberprint">
+                <ul class="searchtop" style="text-align: center;padding: 10px 0;">
+                <li><a href="javascript:void(0);" style="height: 56px;line-height: 56px;padding: 0 88px;font-size: 26px;color: #fff;background-color: #2084db;float: left;margin-right: 50px;border-radius: 5px;display: block;cursor: pointer;" onclick="addMgxx(1)">工厂布标备货出库</a></li>
+                <li><a href="javascript:void(0);"  style="height: 56px;line-height: 56px;padding: 0 88px;font-size: 26px;color: #fff;background-color: #2ca8a1;float: left;margin-left: 50px;border-radius: 5px;display: block;cursor: pointer;" onclick="addMgxx(2)">成品库标签备货出库</a></li>
+                </ul>
+            </div>
+            
+            <ul class="search">
+                <li>
+                    <li>编号:<input value="" name="number" type="text"></li>
+                    <li>备注:<input value="" name="remark" type="text"></li>
+                    <li>出库时间<input id="timetk" value="{date('Y-m-d',time()-29*24*3600)} 0:00" name="timetk" type="text" onClick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})"> 至&nbsp;&nbsp;&nbsp;&nbsp; <input id="timetj" value="{date('Y-m-d',time()+24*3600)} 0:00"
+                            name="timetj" type="text" onClick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})"></li>
+                   
+                    <li><span>确 定</span></li>
+            </ul>
+           
+                
+                
+            
+            <table class="datatitle data" border="0" style="border-collapse:collapse;">
+                <tr>
+                    <td><label onClick=""><input name="checkbox" type="checkbox" class="regular-checkbox"></label></td>
+                    <td>编号</td>
+                    <td>类型</td>
+                    <td>u9料号</td>
+                    <td>品名</td>
+                    <td>数量</td>
+                    <td>扫描时间</td>
+                </tr>
+            </table>
+        </div>
+        <table class="datatext data" border="0" style="border-collapse:collapse;">
+        </table>
+        <div class="lbwlxq"></div>
+        <div class="bomf"></div>
+    </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>
+    
+    
+    <div class="lbwlxq"></div>
+    <div class="bomf"></div>
+
+    <div class="boundtj">
+    <div>
+    <p></p>
+    <p><font class="button">确 定</font><font class="esc">取 消</font></p>
+    </div>
+    </div>
+    <script>
+       
+    customon = 1;
+    var dataurl = "/whlabelfz1/mgxxindex";
+
+    function custom() {
+        $(".data tr").each(function() {
+            $(this).find('td:eq(0)').css("width", "1%");
+            $(this).find('td:eq(1)').css("width", "8%");
+            $(this).find('td:eq(2)').css("width", "8%");
+            $(this).find('td:eq(3)').css("width", "8%");
+            $(this).find('td:eq(4)').css("width", "8%");
+            $(this).find('td:eq(5)').css("width", "8%");
+        });
+    }
+     
+    function doDel(that){
+        let id = $(that).data("id")
+        layx.load('loadId','提交中,请稍后',{shadable:0.6});
+            $.ajax({
+                url:"/zzququeu9/scdel/"+id,
+                data:{},
+                type:"get",
+                dataType:"json",
+                success:function(a){
+                    layx.destroy('loadId');
+                    if (a && a.success) {
+                        $(".systemwindow div p:eq(0)").html(a.msg);
+                        $(".systemwindow div p:eq(1)").html("<font  onclick='doCheck()'>确 定</font>");
+                        $(".systemwindow").show();
+                    }else{
+                        $(".systemwindow div p:eq(0)").text(a.msg);
+                        $(".systemwindow div p:eq(1)").html("<p><font onclick='doCheck()'>确 定</font></p>");
+                        $(".systemwindow").show();
+                    }
+                }
+            })
+        
+    } 
+
+    function addMgxx(type){
+        $(".boundtj div p:eq(0)").html('<label>美国销售单号:<input value="" name="order_no" type="text" /> <input type="hidden" name="type" value="'+type+'"/></label>');
+        $(".boundtj div p:eq(1)").html("<font class='obaddgo'>确 定</font><font class='esc'>取 消</font>");
+        $(".boundtj").show();
+    }
+    $(".boundtj").on('click', ".obaddgo", function() {
+        let order_no = $(".boundtj input[name='order_no']").val();
+        let type = $(".boundtj input[name='type']").val();
+        $(".boundtj p").html("");
+        $(".boundtj").hide();
+        if(order_no.length == 0){
+            return layx.alert('错误',"请填写美国销售单号");
+        }
+        if(!((type ==1 ) || (type == 2))){
+            return layx.alert('错误',"请选择类型");
+        }
+        if(type == 1){
+            $.post("/whlabel_bh/check_by_number",{orderinfo:order_no},function(res){
+            if(res.code == 1){
+                window.location.href = "/whlabelfz1/scam_mgxx?orderinfo="+order_no+"&type=1";
+            }else{
+                layx.alert('错误',res.msg);
+            }
+        },'json')
+        }else{
+            window.location.href = "/whlabelfz1/scam_mgxx?orderinfo="+order_no+"&type=2";
+        }
+       
+      
+       
+    })
+    $(".boundtj").on('click', ".esc", function() {
+        console.log(456)
+        $(".boundtj p").html("");
+        $(".boundtj").hide();
+    });
+    </script>
+
+
+    {Template footer}

+ 126 - 0
template/erp/whlabelfz1_scammgxx copy.html

@@ -0,0 +1,126 @@
+{Template header}
+<body>
+<div class="warp">
+<div class="fixed">
+<div style="display: flex;flex-direction: row;   align-items: center;justify-content: center;height: 40px;padding: 0 20px;background-color: #fff;border-bottom: 1px solid #eee;">
+    <div  style="padding:5px">
+        <p>
+           <span style="font-size: 20px;">美国销售单号:</span> 
+           <input style="width: 300px;height: 30px;border: 0px #ccc solid;font-size: 20px;text-align: left;color:#333;border-radius: 5px;"  type="text" name="orderinfo" value="{$orderinfo}" readonly>
+            
+          
+        </p>
+    </div>
+    <input type="hidden" name="type" value="{$type}">
+    <div style="margin-left: 10px;">
+        {if $type == 1}
+            <p>
+                <input style="width: 300px;height: 30px;border: 1px #ccc solid;font-size: 20px;text-align: center;color:#333;border-radius: 5px;" value="" name="outbound" id="outbound" placeholder="点此处扫码" type="text"><span style="font-size: 20px;color:red;padding:5px">扫描工厂生产布标<font style="padding:3px;margin-right: 10px;">0</font></span>
+            </p>
+        {else}
+            <p>
+                <input style="width: 300px;height: 30px;border: 1px #ccc solid;font-size: 20px;text-align: center;color:#333;border-radius: 5px;" value="" name="outbound" id="outbound" placeholder="点此处扫码" type="text"><span style="font-size: 20px;color:red;padding:5px">扫描成品库标签<font style="padding:3px;margin-right: 10px;">0</font></span>
+            </p>
+        {/if}
+       
+        
+    </div>
+</div>
+
+
+<!-- <ul class="exdata"></ul> -->
+<table class="datatitle data" border="0" style="border-collapse:collapse;">
+<tr>
+<td><label onClick="swapCheck()"><input name="checkbox" type="checkbox" class="regular-checkbox"></label></td>
+<td>品名</td>
+<td>简码</td>
+<td>单号</td>
+<td>数量</td>
+</tr>
+</table>
+</div>
+<table class="datatext data" border="0" style="border-collapse:collapse;">
+</table>
+<div class="bomf"></div>
+</div>
+<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>
+<div class="boundtj">
+<div>
+<p></p>
+<p><font class="button">确 定</font><font class="esc">取 消</font></p>
+</div>
+</div>
+<div class="tyrows"><div><p></p><p></p></div></div>
+<audio id="music_d">
+<source src="{$theme}music/d.mp3" type="audio/mpeg">
+</audio>
+<audio id="music_c">
+<source src="{$theme}music/c.mp3" type="audio/mpeg">
+</audio>
+<audio id="music_print">
+<source src="{$theme}music/print.mp3" type="audio/mpeg">
+</audio>
+<audio id="music_print_error">
+<source src="{$theme}music/print_error.mp3" type="audio/mpeg">
+</audio>
+<audio id="music_print_ok">
+<source src="{$theme}music/print_ok.mp3" type="audio/mpeg">
+</audio>
+<input value="{date('Y-m-d h:i:s',time())}" name="tjtime" type="hidden">
+<script>
+
+let customon = 1;
+var sysprint = 1;var systembound = 1;
+var dataurl = "/whlabelfz1/scam_mgxx";var fdataurl = "/whlabelfz1/scam_mgxx";
+function custom(){
+
+    $(".data tr").each(function() {
+        $(this).find('td:eq(0)').css("width","1%");
+        $(this).find('td:eq(1)').css("width","40%");
+        $(this).find('td:eq(2)').css("width","20%");
+        $(this).find('td:eq(3)').css("width","30%");
+        $(this).find('td:eq(4)').css("width","5%");
+
+    });
+}
+$(document).ready(function() {
+    $("#outbound").focus();
+});
+
+$("#outbound").keyup(function(event) {
+    if (event.keyCode == 13) {
+        let outbound = $("#outbound").val();
+        if((!outbound)||(outbound.length == 0)){
+            showInfo("请输入单号");
+            return ;
+        }
+        let type = $("input[name='type']").val();
+        $.post("/whlabelfz1/get_scan_info",{label:outbound,type:type},function(res){
+
+        })
+    }
+});
+
+
+function showInfo(msg){
+    $("#music_c")[0].play();
+    $("#outbound").val("");
+    $(".systemwindow div p:eq(0)").html(msg);
+    $(".systemwindow div p:eq(1)").html("<font class='wcsj'>确 定</font>");
+    $(".systemwindow").show();
+}
+$(".systemwindow").on('click', ".wcsj", function() {
+    $("#outbound").focus();
+    $(".systemwindow").hide();
+});
+</script>
+<script type="text/javascript" src="{$theme}js/laydate.js"></script>
+
+{Template footer}

+ 149 - 0
template/erp/whlabelfz1_scammgxx.html

@@ -0,0 +1,149 @@
+{Template header}
+<body>
+<div class="warp">
+<div class="fixed">
+<div class="numberprint">
+<ul class="searchtop search" style="text-align: center;padding: 10px 0;">
+
+<li style="height: 56px;line-height: 56px;"><input value="" name="scanlabel" id="scanlabel" placeholder="点此处扫码" type="text" style="width:500px;height: 50px;line-height: 50px;"></li>
+{if  $type == 2}
+<li style="font-size: 26px;">
+   扫描数量: <input value="1" name="num"  placeholder="请输入扫描数量,不得超过200个" type="text" style="width:60px;height: 50px;line-height: 50px;">
+</li>
+{/if}
+<li style="height: 56px;line-height: 56px;padding: 0 88px;font-size: 26px;margin-right: 50px;border-radius: 5px; display: inline-block;;cursor: pointer;">
+    <font style="color:blue">
+        {if $type == 1}
+        扫描工厂生产布标
+        {else}
+        扫描成品库标签
+        {/if}
+    </font>
+   (<font style="margin-left: 10px;margin-right:10px;color:red" id="">0</font>)
+</li>
+
+<li style="display: none;"><span>确 定</span></li>
+<br/>
+<li style="height: 56px;line-height: 56px;padding: 0 88px;font-size: 26px;color: #fff;background-color: #2084db;margin-right: 50px;border-radius: 5px; display: inline-block;;cursor: pointer;">美国销售单号:{$orderinfo} <input type="hidden" name="orderinfo" value="{$orderinfo}"> <input type="hidden" name="type" value="{$type}"></li>
+</ul>
+</div>
+<table class="datatitle data" border="0" style="border-collapse:collapse;">
+<tr>
+<td><label onClick="swapCheck()"><input name="checkbox" type="checkbox" class="regular-checkbox"></label></td>
+<td>编号</td>
+<td>品名</td>
+<td>扫描标签</td>
+<td>数量</td>
+<td>扫描时间</td>
+</tr>
+</table>
+</div>
+<table class="datatext data" border="0" style="border-collapse:collapse;">
+</table>
+<div class="bomf"></div>
+</div>
+<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>
+<div class="boundtj">
+<div>
+<p></p>
+<p><font class="button">确 定</font><font class="esc">取 消</font></p>
+</div>
+</div>
+<div class="tyrows"><div><p></p><p></p></div></div>
+<audio id="music_d">
+<source src="{$theme}music/d.mp3" type="audio/mpeg">
+</audio>
+<audio id="music_c">
+<source src="{$theme}music/c.mp3" type="audio/mpeg">
+</audio>
+<audio id="music_print">
+<source src="{$theme}music/print.mp3" type="audio/mpeg">
+</audio>
+<audio id="music_print_error">
+<source src="{$theme}music/print_error.mp3" type="audio/mpeg">
+</audio>
+<audio id="music_print_ok">
+<source src="{$theme}music/print_ok.mp3" type="audio/mpeg">
+</audio>
+<audio id="music_jiaji">
+    <source src="{$theme}music/jiaji.mp3" type="audio/mpeg">
+</audio>
+<script>
+var sysprint = 1;var transfer = 1;
+var dataurl = "/whlabelfz1/scam_mgxx/";var fdataurl = "/whlabelfz1/scam_mgxx/";
+var customon = 1;
+function custom() {
+    $(".data tr").each(function() {
+        $(this).find('td:eq(0)').css("width", "1%");
+        $(this).find('td:eq(1)').css("width", "10%");
+        $(this).find('td:eq(2)').css("width", "20%");
+        $(this).find('td:eq(3)').css("width", "10%");
+        $(this).find('td:eq(4)').css("width", "5%");
+        $(this).find('td:eq(5)').css("width", "10%");
+    });
+}
+
+$(document).ready(function() {
+    $("#scanlabel").focus();
+});
+
+
+
+
+$(document).keyup(function(event) {
+    if (event.keyCode == 13) {
+        let scanlabel = $("#scanlabel").val();
+        let type = $("input[name='type']").val();
+        let orderinfo = $("input[name='orderinfo']").val();
+        let num = 0;
+        if(type == 2){
+            num  = $("input[name='num']").val();
+        }
+        console.log("=======================")
+        console.log("scanlabel:"+scanlabel);
+        console.log("type:"+type);
+        console.log("orderinfo:"+orderinfo);
+        console.log("num:"+num);
+        if(!scanlabel){
+            $("#scanlabel").focus();
+            layx.alert('提示','扫描标签异常!')
+            return false;
+        }
+        if(type == 2){
+            if(!num){
+                $("#scanlabel").focus();
+                layx.alert('提示','请输入扫描数量!')
+                return false;
+            }
+            if(num > 200){
+                $("#scanlabel").focus();
+                layx.alert('提示','扫描数量不能超过200!')
+                return false;
+            }
+        }
+        $.post("/whlabelfz1/scam_mgxx_post", {scanlabel: scanlabel, type: type, orderinfo: orderinfo, num: num}, function(res) {
+            $("#scanlabel").focus();
+            if(res.code == 1){
+                $("#scanlabel").blur()
+                $(".search span").click();
+            }else{
+                layx.alert('提示',res.msg, function(id, button) {
+                    $("#scanlabel").blur()
+                    
+            }, { dialogIcon: 'error' })
+
+            }
+        },'json')
+	}
+})
+
+</script>
+<script type="text/javascript" src="{$theme}js/laydate.js"></script>
+{Template footer}