lvhao 2 ngày trước cách đây
mục cha
commit
8cf1d6284c
2 tập tin đã thay đổi với 355 bổ sung0 xóa
  1. 200 0
      core/CoreApp/controllers/Whlabelfz1.php
  2. 155 0
      template/erp/whlabelfz1_typedy.html

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

@@ -11,6 +11,7 @@ class Whlabelfz1 extends Start_Controller
 		$this->load->_model("Model_whlabel_bh_scan",'whlabel_bh_scan');
 		$this->load->_model("Model_logic_u9tools","logic_u9tools");
 		$this->load->_model("Model_whlabellabel","whlabellabel");
+		$this->load->_model('Model_purchase', 'purchase');
     }
     //定义方法的调用规则 获取URI第二段值
 	public function _remap($arg, $arg_array)
@@ -28,6 +29,9 @@ class Whlabelfz1 extends Start_Controller
 		else if($arg == 'get_scan_info'){
 			$this->_getScanInfo();
 		}
+		else if($arg =='typedy'){
+			$this->_typedy();
+		}
 	    else {
 			$this->_index();
 		}
@@ -196,5 +200,201 @@ class Whlabelfz1 extends Start_Controller
 
 	}
 
+	// 可以排序的仓库数量
+	private  function _typedy(){
+		$prc = array();
+		$purchase = $this->purchase->find_all();
+		foreach ($purchase as $k => $v) {
+			$prc[$v['id']] = $v['title'];
+		}
+		$post = $this->input->post(NULL, TRUE);
+		if (isset($post['page'])) {
+			$page = $this->input->post('page', true);
+			$perpage = $this->input->post('perpage', true);
+			$category = $this->input->post('category', true);
+			$size = $this->input->post('size', true);
+			$grade = $this->input->post('grade', true);
+			$color = $this->input->post('color', true);
+			$lowe = $this->input->post('lowe', true);
+			$sku = $this->input->post('sku');
+			$title = $this->input->post('title');
+			$warehouse = $this->input->post('warehouse', true);
+			$usa = $this->input->post('usa', true);
+			$purchase = $this->input->post('purchase', true);
+			$lacetype = $this->input->post('lacetype', true);
+			$haircap = $this->input->post('haircap', true);
+			$density = $this->input->post('density', true);
+			$details = $this->input->post('details', true);
+			$state = $this->input->post('state', true);
+			$lacecolor = $this->input->post('lacecolor', true);
+			$hairnumber = $this->input->post('hairnumber', true);
+			$cklx = $this->input->post('cklx', true);
+			$ktime = $this->input->post('ktime', true);
+			$jtime = $this->input->post('jtime', true);
+			$sm = $this->input->post('sm', true);
+			$cpbz = $this->input->post('cpbz', true);
+			$type = $this->input->post('type', true);
+			$ktime = strtotime($ktime);
+			$jtime = strtotime($jtime);
+			$where = "1=1";
+			
+			if ($usa) {
+				if (!$warehouse) {
+					$where  .= " and (warehouse = '5' or warehouse = '8')";
+				}
+			}
+			if ($warehouse) {
+				$where  .= " and warehouse = '$warehouse'";
+			}
+			if ($details) {
+				$where  .= " and details = '$details'";
+			}
+			if ($purchase) {
+				$where  .= " and purchase = '$purchase'";
+			}
+			if (isset($state)) {
+				if($state >-1){
+					$where  .= " and state = '$state'";
+				}
+				
+			}
+
+			if ($lacetype) {
+				$where  .= " and features like '%-$lacetype-%'";
+			}
+			if ($category) {
+				$where  .= " and features like '%-$category-%'";
+			}
+			if ($size) {
+				$where  .= " and features like '%-$size-%'";
+			}
+			if ($grade) {
+				$where  .= " and features like '%-$grade-%'";
+			}
+			if ($color) {
+				$where  .= " and features like '%-$color-%'";
+			}
+			if ($lowe) {
+				$where  .= " and features like '%-$lowe-%'";
+			}
+			if ($haircap) {
+				$where  .= " and features like '%-$haircap-%'";
+			}
+			if ($density) {
+				$where  .= " and features like '%-$density-%'";
+			}
+			if ($lacecolor) {
+				$where  .= " and features like '%-$lacecolor-%'";
+			}
+			if($sm){
+				$where .= " and  sm like '%".$sm."%'";
+			}
+			if($cpbz){
+				$where .= " and  cpbz like '%".$cpbz."%'";
+			}
+			if($type){
+				$where .= " and  type = ".$type."";
+			}
+			if (!empty($hairnumber)) {
+				$where  .= " and  features like '%-128-%' ";
+				if ($hairnumber < 0) {
+					$class_list = $this->typeclass->find_all('classid = 43');
+					foreach ($class_list as $v) {
+						$where .= " and  features not like '%-" . $v['id'] . "-%'";
+					}
+				} else {
+					$where  .= " and features like '%-$hairnumber-%'";
+				}
+			}
+
+			$where_add = '';
+			if ($cklx) {
+				$shop = $this->shop->read($cklx);
+				$where_add  .= " and zd like '" . $shop['shortname'] . "%' and state = 0";
+			}
+			
+			//数据排序
+			$order_str = "id desc";
+			if (empty($page)) {
+				$start = 0;
+				$perpage = 1;
+			} else {
+				$start = ($page - 1) * $perpage;
+			}
+			//这里为了对应前端界面的字段 新添加了label字段 后续代码会替换为sm字段
+			if ($sku) {
+				$sku = trim($sku, ' ');
+				$sku = trim($sku, '	');
+				$where  .= " and sku like '%$sku%'";
+				$info_list = $this->whlabel->find_pc($where . $where_add, 'sku,features,warehouse', 'id,warehouse,purchase,sku,title,details,shop,cpbz,label,features,number,sm', $order_str, $start, $perpage);
+			} else if ($title) {
+				$title = trim($title, ' ');
+				$title = trim($title, '	');
+				$where  .= " and title like '%$title%'";
+				$info_list = $this->whlabel->find_pc($where . $where_add, 'sku,features,warehouse', 'id,warehouse,purchase,sku,title,details,shop,cpbz,label,features,number,sm', $order_str, $start, $perpage);
+			} else {
+				//$where  .= " and time > '$ktime' and time < '$jtime'";
+				$info_list = $this->whlabel->find_pc($where . $where_add, 'sku,features,warehouse', 'id,warehouse,purchase,sku,title,details,shop,cpbz,label,features,number,sm', $order_str, $start, $perpage);
+			}
+			//$this->logic_ding->sendToDing("仓库查询:".$where . $where_add);
+
+			$info_list = $this->logic_whlabel->dataTran($info_list, ['pm']);
+			foreach ($info_list as $k => $v) {
+				$info_list[$k]['title'] = $v['title'] . "<br/>" . $v['pm'];
+				unset($info_list[$k]['pm']);
+				unset($info_list[$k]['jm']);
+				unset($info_list[$k]['bm']);
+			}
+
+			//取得信息列表
 
+			$rows = array();
+			$list = array();
+			foreach ($info_list as $key => $value) {
+				$warehouse = $this->warehouse->read($value['warehouse']);
+				$info_list[$key]['purchase'] = (isset($prc[$value['purchase']])) ? $prc[$value['purchase']] : '未知';
+				$c = $this->whlabel->find_all($where . ' and sku = "' . $value['sku'] . '" and state = 0 and warehouse = "' . $value['warehouse'] . '" and features = "' . $value['features'] . '"', 'details,cpid');
+				$z = $this->whlabel->find_all($where . ' and sku = "' . $value['sku'] . '" and zd != "" and state = 0 and warehouse = "' . $value['warehouse'] . '" and features = "' . $value['features'] . '"');
+				$info_list[$key]['cpbz'] = $value['cpbz'] ; 
+				$info_list[$key]['label'] = $value['sm'];
+				$number = $value['number'];
+				$ftime = time() - 15 * 24 * 3600;
+				$info_list[$key]['warehouse'] = $warehouse['title'];
+				$info_list[$key]['features'] = count($c);
+				$z = count($z); //查看订单号
+				$zt = $this->whlabeltransport->find_all('sku = "' . $value['sku'] . '" and warehouse = "' . $value['warehouse'] . '" and features = "' . $value['features'] . '" and cz = "0"');
+				$ztdata = '';
+				if (count($zt) > 0) {
+					foreach ($zt as $vv) {
+						$ztdata .= '<p>' . $vv['num'] . ' - ' . date('Y-m-d', $vv['stime']) . '</p>';
+					}
+				}
+				$info_list[$key]['number'] = $ztdata;
+				$info_list[$key]['sm'] = $z;
+				$details = array();
+				$cpid = array();
+				foreach ($c as $k => $v) {
+					$details[$v['details']] = $v['details'];
+					if ($v['cpid'] != 0) {
+						$cpid[$v['cpid']] = $v['cpid'];
+					}
+				}
+				$info_list[$key]['details'] = ($cpid) ? implode(" ", $details) . '<p>' . implode(" ", $cpid) . '</p>' : implode(" ", $details);
+				if ($value['shop'] != '') {
+					$shop = explode(',', trim($value['shop'], ','));
+					$shop = $this->shop->read($shop[0]);
+					$info_list[$key]['shop'] = $shop['shopname'];
+				}
+			}
+
+			$total = count($this->whlabel->find_pc($where . $where_add, 'sku,features,warehouse', 'id,warehouse,sku,title,features,number'));
+			$pagenum = ceil($total / $perpage);
+			$over = $total - ($start + $perpage);
+			$rows = array('total' => $total, 'over' => $over, 'pagenum' => $pagenum, 'rows' => ($info_list), 'CS' => $warehouse);
+			echo json_encode($rows);
+			exit;
+		}
+		$this->data['warehouse'] = (isset($arg_array[0])) ? $arg_array[0] : 5;
+		$this->_Template('whlabelfz1_typedy', $this->data);
+	}
 }

+ 155 - 0
template/erp/whlabelfz1_typedy.html

@@ -0,0 +1,155 @@
+{Template header}
+<body>
+<div class="warp">
+<div class="fixed">
+<ul class="search">
+<li>类目:<select name="category" class="select">
+<option value="">请选择</option>{loop typeclass(16) as $val}
+<option value="{$val['id']}">{$val['title']}</option>{/loop}</select></li>
+<li>等级:<select name="grade" class="select">
+<option value="">请选择</option>{loop typeclass(13) as $val}
+<option value="{$val['id']}">{$val['title']}</option>{/loop}</select></li>
+<li>颜色:<select name="color" class="select">
+<option value="">请选择</option>{loop typeclassyc(8) as $val}
+<option value="{$val['id']}">{$val['title']}</option>{/loop}</select></li>
+<li>曲度:<select name="lowe" class="select">
+<option value="">请选择</option>{loop typeclassyc(15) as $val}
+<option value="{$val['id']}">{$val['title']}</option>{/loop}</select></li>
+<li>头套种类:<select name="lacetype" class="select">
+<option value="">请选择</option><option value="146">13*4 Lace Front wigs</option>
+{loop typeclassyc(18) as $val}
+{if $val['id']!=146}
+<option value="{$val['id']}">{$val['title']}</option>
+{/if}
+{/loop}
+</select></li>
+<li>蕾丝颜色:<select name="lacecolor" class="select">
+<option value="">请选择</option>{loop typeclassyc(9) as $val}
+<option value="{$val['id']}">{$val['title']}</option>{/loop}</select></li>
+<li>长度:<select name="size" class="select">
+<option value="">请选择</option>{loop typeclass(14) as $val}
+<option value="{$val['id']}">{$val['title']}</option>{/loop}</select></li>
+<li>密度:<select name="density" class="select">
+<option value="">请选择</option>{loop typeclassyc(10) as $val}
+<option value="{$val['id']}">{$val['title']}</option>{/loop}</select></li>
+<li>头套大小:<select name="haircap" class="select">
+<option value="">请选择</option>{loop typeclassyc(6) as $val}
+<option value="{$val['id']}">{$val['title']}</option>{/loop}</select></li>
+<li>人发头套编号:<select name="hairnumber" class="select">
+    <option value="">请选择</option>
+    <option value="-1">无编号</option>
+    {loop typeclassyc(43) as $val}
+    
+    <option value="{$val['id']}">{$val['title']}</option>
+    {/loop}
+    </select>
+</li>
+<li>状态:<select name="state" class="select">
+<option value="0">在库</option>
+<option value="-1">全部</option>
+<!--
+<option value="">请选择</option>
+<option value="1">正常出库</option>
+<option value="10">美店零售</option>
+-->
+</select></li>
+<!-- <li class="none">统计时间:<input id="timetk"  value="{date('Y-m-d',time()-29*24*3600)} 0:00" name="ktime" 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="jtime" type="text" onClick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})"></li>-->
+<li>店铺:<select name="cklx" class="select">
+    <option value="">请选择</option>
+    {loop usershop() as $val}
+    <option value="{$val['id']}">{$val['shopname']}</option>
+    {/loop}
+</select></li>
+<li>供应商:<select name="purchase" class="select">
+<option value="">全部</option>
+{loop purchase(100) as $val}
+<option value="{$val['id']}">{$val['title']}</option>
+{/loop}
+</select>
+</li>
+
+<li>
+    类型  :<select name="type" class="select">
+        <option value="">全部</option>
+        {loop whlabel_type(100) as $val}
+        <option value="{$val['id']}">{$val['title']}</option>
+        {/loop}
+        </select>
+</li>
+<li>SKU:<input value="" name="sku" type="text" style="width:400px"></li>
+
+
+<li>商品名称:<input value="" name="title" type="text" style="width:400px"></li>
+<li>备注:<input value="" name="cpbz" type="text" style="width:120px"></li>
+<li>说明:<input value="" name="sm" type="text" style="width:120px"></li>
+
+<li><span>确 定</span></li>
+<input value="{$warehouse}" name="warehouse" type="hidden" >
+</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>SKU</td>
+<td>商品名称</td>
+<td>位置及编码</td>
+<td>品牌</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>
+<script>
+var dataurl = "/whlabelfz1/typedy";var fdataurl = "/whlabelfz1/";var excel = "/whlabelfz1/";
+$(function () { $("#ktime").calendar();$("#jtime").calendar();});
+var customon = 1;
+function custom(){
+$(".data tr").each(function() {
+$(this).find('td:eq(1)').css("width","6%");
+$(this).find('td:eq(2)').css("width","8%");
+$(this).find('td:eq(3)').css("width","10%");
+$(this).find('td:eq(4)').css("width","24%");
+$(this).find('td:eq(5)').css("width","11%");
+$(this).find('td:eq(6)').css("width","6%");
+$(this).find('td:eq(7)').css("width","10%");
+$(this).find('td:eq(8)').css("width","5%");
+$(this).find('td:eq(9)').css("width","5%");
+$(this).find('td:eq(10)').css("width","10%");
+$(this).find('td:eq(11)').css("width","5%");
+});}
+$("select[name=dccz]").change(function(){
+	if($(this).find("option:selected").val() == "")
+	{
+		 $(".ts p").html("请选择导出模板");
+                $(".ts").fadeIn();
+                setTimeout('$(".ts").fadeOut()', 800);
+				return false;
+	}
+    var f = "";
+    $(".select").each(function() {
+        f = f + $(this).attr("name") + "=" + $(this).children("option:selected").val() + "&";
+    });
+    $("input:text").each(function() {
+        f = f + $(this).attr("name") + "=" + $(this).val() + "&";
+    });
+	$("input:hidden").each(function() {
+        f = f + $(this).attr("name") + "=" + $(this).val() + "&";
+    });
+	window.location.href = "http://1.wepolicy.cn/whlabel/"+$("select[name=dccz]").find("option:selected").data("url")+"?excel="+$("select[name=dccz]").find("option:selected").val()+"&"+f;
+	$("select[name=dccz] option:eq(0)").prop('selected','selected'); 
+});
+</script>
+<script type="text/javascript" src="{$theme}js/laydate.js"></script>
+<div style="display:none;">
+<input id="upload-file" name="files" accept="image/xls,image/xlsx" type="file">
+</div>
+{Template footer}