Переглянути джерело

Merge branch 'master' of http://s.dev01.dkiboss.com:9001/DK-MES-2.0/HEGII.ss.mes.web

李士越 1 рік тому
батько
коміт
4a37384d97
2 змінених файлів з 67 додано та 17 видалено
  1. 48 6
      wwwroot/mes/rpt/rpt151/rpt.ashx
  2. 19 11
      wwwroot/mes/rpt/rpt151/rpt_index.html

+ 48 - 6
wwwroot/mes/rpt/rpt151/rpt.ashx

@@ -20,13 +20,15 @@ public class rpt : IHttpHandler, IReadOnlySessionState
         using (IDataAccess conn = DataAccess.Create())
         {
             string GoodsTypeCode = context.Request["goodstypecode"];//产品类别
-            string GoodsCode = context.Request["goodsidMaster"];//产品编码
+            //string GoodsCode = context.Request["goodsidMaster"];//产品编码
             string LineCode = context.Request["linecode"];//成型线号
             string UserCode = context.Request["usercode"];//成型工号
                                                           //存坯汇总表(DataGridDetail1)中的值
             string GoodsID = context.Request["goodsid"];
             string LineID = context.Request["groutinglineid"] == "undefined" ? null : context.Request["groutinglineid"];//成型线号
             string UserID = context.Request["userid"] == "undefined" ? null : context.Request["userid"];
+            //商标id
+            string logoId = context.Request["LOGONAME"] is object ? context.Request["LOGONAME"].ToString() : "";
             DateTime? dateBegin;
             if (context.Request["chkStar"] != null)
             {
@@ -45,6 +47,27 @@ public class rpt : IHttpHandler, IReadOnlySessionState
             {
                 dateEnd = null;
             }
+
+            string GoodsCode = context.Request["goodsidMaster[]"];
+            if (context.Request["goodsidMaster"] is object) GoodsCode = context.Request["goodsidMaster"].ToString();
+
+            if (!String.IsNullOrWhiteSpace(GoodsCode)) {
+                List<string> list= new List<string>(GoodsCode.Split(','));
+                List<string> newlist = new List<string>();
+                foreach (string item in list) {
+                    if (!String.IsNullOrWhiteSpace(item)) {
+                        newlist.Add("'"+item+"'");
+                    }
+                }
+                if (newlist != null && newlist.Count > 1) {
+                    GoodsCode = string.Join(",", newlist);
+                }
+                else
+                {
+                    GoodsCode = "'" + GoodsCode + "'";
+                }
+            }
+
             //获取查询条件
             List<CDAParameter> sqlPara = new List<CDAParameter>();
             sqlPara.Add(new CDAParameter("accountid", int.Parse(context.Session["accountId"].ToString()), DataType.Int32));
@@ -54,6 +77,7 @@ public class rpt : IHttpHandler, IReadOnlySessionState
             sqlPara.Add(new CDAParameter("GoodsCode", GoodsCode, DataType.VarChar));
             sqlPara.Add(new CDAParameter("LineCode", LineCode, DataType.VarChar));
             sqlPara.Add(new CDAParameter("UserCode", UserCode, DataType.VarChar));
+            sqlPara.Add(new CDAParameter("LOGOID", logoId, DataType.VarChar));
             //主表
             if (context.Request["m"].ToString() == "master")
             {
@@ -118,8 +142,13 @@ public class rpt : IHttpHandler, IReadOnlySessionState
                                        instr(gdd.groutinglinecode, @LineCode@) > 0)
                                    AND (@UserCode@ IS NULL OR
                                        instr(gdd.UserCode, @UserCode@) > 0)
-                                   AND (@GoodsCode@ IS NULL OR
-                                       instr(gdd.GoodsCode, @GoodsCode@) > 0)
+                                    AND (@LOGOID@ IS NULL OR
+                                       instr(gdd.LOGOID, @LOGOID@) > 0) ");
+                if (!String.IsNullOrEmpty(GoodsCode))
+                {
+                    sqlStr.Append(@" AND gdd.GoodsCode IN ("+GoodsCode+") ");
+                }
+                sqlStr.Append(@" 
                                    AND (@GoodsTypeCode@ IS NULL OR
                                        instr(gt.GoodstypeCode, @GoodsTypeCode@) = 1)
                                    AND (@DateBegin@ IS NULL OR
@@ -227,8 +256,13 @@ public class rpt : IHttpHandler, IReadOnlySessionState
                                       instr(gdd.groutinglinecode, @LineCode@) > 0)
                                   AND (@UserCode@ IS NULL OR
                                       instr(gdd.UserCode, @UserCode@) > 0)
-                                  AND (@GoodsCode@ IS NULL OR
-                                      instr(gdd.GoodsCode, @GoodsCode@) > 0)
+                                    AND (@LOGOID@ IS NULL OR
+                                       instr(gdd.LOGOID, @LOGOID@) > 0) ";
+                if (!String.IsNullOrEmpty(GoodsCode))
+                {
+                    sqlStr += @" AND gdd.GoodsCode IN ("+GoodsCode+") ";
+                }
+                sqlStr += @" 
                                   AND (@GoodsTypeCode@ IS NULL OR
                                       instr(gt.GoodstypeCode, @GoodsTypeCode@) = 1)
                                   AND (@DateBegin@ IS NULL OR
@@ -310,7 +344,15 @@ public class rpt : IHttpHandler, IReadOnlySessionState
                    AND (@GoodsID@ IS NULL OR gdd.goodsid = @GoodsID@)
                    AND (@LineCode@ IS NULL OR instr(gdd.groutinglinecode, @LineCode@) > 0)
                    AND (@UserCode@ IS NULL OR instr(gdd.UserCode, @UserCode@) > 0)
-                   AND (@GoodsCode@ IS NULL OR instr(gdd.GoodsCode, @GoodsCode@) > 0)
+                    AND (@LOGOID@ IS NULL OR
+                                       instr(gdd.LOGOID, @LOGOID@) > 0)
+                   
+                   ";
+                if (!String.IsNullOrEmpty(GoodsCode))
+                {
+                    sqlStr += @" AND gdd.GoodsCode IN ("+GoodsCode+") ";
+                }
+                sqlStr += @" 
                    AND (@GoodsTypeCode@ IS NULL OR
                        instr(gt.GoodstypeCode, @GoodsTypeCode@) = 1)
                    AND (@DateBegin@ IS NULL OR

+ 19 - 11
wwwroot/mes/rpt/rpt151/rpt_index.html

@@ -21,25 +21,33 @@
             <div id="tbSearchDiv" style="display: block; padding: 10px;">
                 <form id="ffMaster">
                     <div>
-                        <span class="labelspan">成型线号
-                        <input class="easyui-combobox" id="linecode" name="linecode" data-options="required:false,prompt:'',tipPosition:'top',url:'../rpt.ashx?m=getLine&select=1',method:'get',valueField:'GROUTINGLINECODE',textField:'GROUTINGLINECODE',panelHeight:'300px',editable:'true',multiple:true" style="width: 120px; height: 32px;">
+                        <span class="labelspan">
+                            成型线号
+                            <input class="easyui-combobox" id="linecode" name="linecode" data-options="required:false,prompt:'',tipPosition:'top',url:'../rpt.ashx?m=getLine&select=1',method:'get',valueField:'GROUTINGLINECODE',textField:'GROUTINGLINECODE',panelHeight:'300px',editable:'true',multiple:true" style="width: 120px; height: 32px;">
                         </span>
-                        <span class="labelspan" style="width:235px;">产品类别
-                        <input class="easyui-combotree" id="goodstypecode" name="goodstypecode" data-options="required:false,prompt:'',tipPosition:'top',url:'../rpt.ashx?m=getGoodsType',method:'get',panelHeight:'200px',editable:true" style="width: 165px; height: 32px;">
+                        <span class="labelspan" style="width:235px;">
+                            产品类别
+                            <input class="easyui-combotree" id="goodstypecode" name="goodstypecode" data-options="required:false,prompt:'',tipPosition:'top',url:'../rpt.ashx?m=getGoodsType',method:'get',panelHeight:'200px',editable:true" style="width: 165px; height: 32px;">
                         </span>
                         <input class="easyui-checkbox" id="chkStar" name="chkStar" data-options="onChange:deliverChange">
-                        注浆日期                        
+                        注浆日期
                         <input class="easyui-datebox" id="datebeginMaster" name="datebeginMaster" data-options="required:false,prompt:'',tipPosition:'top'" style="width: 120px; height: 32px; color: gray">
-                        <span class="labelspan">至
-                        <input class="easyui-datebox" id="dateendMaster" name="dateendMaster" data-options="required:false,prompt:'',tipPosition:'top'" style="width: 120px; height: 32px; color: gray">
+                        <span class="labelspan">
+                            至
+                            <input class="easyui-datebox" id="dateendMaster" name="dateendMaster" data-options="required:false,prompt:'',tipPosition:'top'" style="width: 120px; height: 32px; color: gray">
                         </span>
                         <br />
-                        <span class="labelspan">成型工号
-                        <input class="easyui-combobox w-input" id="usercode" name="usercode" data-options="required:false,prompt:'',tipPosition:'top',url:'../rpt.ashx?m=getUser&select=1',method:'get',valueField:'USERCODE',textField:'USERCODE',panelHeight:'200px',editable:true" style="width: 120px; height: 32px;">
+                        <span class="labelspan">
+                            成型工号
+                            <input class="easyui-combobox w-input" id="usercode" name="usercode" data-options="required:false,prompt:'',tipPosition:'top',url:'../rpt.ashx?m=getUser&select=1',method:'get',valueField:'USERCODE',textField:'USERCODE',panelHeight:'200px',editable:true" style="width: 120px; height: 32px;">
                         </span>
-                        <span class="labelspan" style="width:235px;">产品编码
-                        <input class="easyui-combobox" id="goodsidMaster" name="goodsidMaster" data-options="required:false,prompt:'',tipPosition:'top',url:'../rpt.ashx?m=getGoods&select=1',method:'get',valueField:'GOODSCODE',textField:'GOODSCODE',panelHeight:'300px',editable:'true'" style="width: 165px; height: 32px;">
+                        <span class="labelspan" style="width:235px;">
+                            产品编码
+                            <input class="easyui-combobox" id="goodsidMaster" name="goodsidMaster" data-options="required:false,prompt:'',tipPosition:'top',url:'../rpt.ashx?m=getGoods&select=1',method:'get',valueField:'GOODSCODE',textField:'GOODSCODE',panelHeight:'300px',editable:'true',multiple:true" style="width: 165px; height: 32px;">
                         </span>
+                        产品商标:
+                        <input class="easyui-combobox" id="LOGONAME" name="LOGONAME" data-options="required:false,prompt:'',tipPosition:'top',url:'../../rpt/rpt.ashx?m=getLogoByGoods&select=1',method:'get',valueField:'ID',textField:'TEXT',panelHeight:'300px'" style="width:165px;height:32px;">
+
                         <a href="javascript:void(0)" id="btnSearchSubmit" title="清空" class="easyui-linkbutton" plain="false" onclick="$('#ffMaster').form('clear')">清空</a>
                         <a href="javascript:void(0)" id="btnSearchSubmit" title="搜索" class="easyui-linkbutton" plain="false" onclick="tbSearchSubmit()">搜索</a>
                     </div>