Ver Fonte

修改 产品下拉框数据更改为柱状图

张忠帅 há 2 anos atrás
pai
commit
21d6e25b28

+ 39 - 11
wwwroot/mes/pm/fqcitems/fqcitems.ashx

@@ -213,7 +213,7 @@ public class fqcitems : IHttpHandler, IReadOnlySessionState
             else
             {
                 sqlStr += " ORDER BY m.UPDATETIME DESC " ;
-                
+
             }
             int total = 0;
             DataTable dt = conn.SelectPages(page, rows,out total, sqlStr, sqlPara.ToArray());
@@ -480,7 +480,34 @@ public class fqcitems : IHttpHandler, IReadOnlySessionState
     {
         using(IDataAccess conn=DataAccess.Create())
         {
-            int result = conn.ExecuteNonQuery(@"
+            string[] goodscode = form["GOODSCODE"].ToString().Split(',');
+            ArrayList  al = new ArrayList(goodscode);
+            string goods = null;
+            string goodstypes = null;
+            DataTable goodstype = null;
+            int flags = 0;
+            for (int i = 0; i < al.Count; i++) {
+                string test = al[i].ToString();
+                string test2 = test;
+                if (flags == 0)
+                {
+                    goodstypes += "'" + al[i] + "'";
+                }
+                else {
+                    goodstypes += ",'" + al[i]+"'";
+                }
+                flags++;
+
+            }
+            goodstype = conn.ExecuteDatatable(@"SELECT GOODSID,GOODSCODE FROM TP_MST_GOODS WHERE VALUEFLAG=1 and GOODSCODE in(" +goodstypes+")", new CDAParameter(null, null));
+
+            if (goodstype.Rows.Count >0 )
+            {
+                goods += goodstype.Rows[0]["GOODSCODE"]+"...";
+            }
+            if (!string.IsNullOrWhiteSpace(goods))
+            {
+                int result = conn.ExecuteNonQuery(@"
                 UPDATE TP_PM_FQCITEMS 
                 SET
                     INSPECTTYPE = @INSPECTTYPE@,
@@ -494,15 +521,16 @@ public class fqcitems : IHttpHandler, IReadOnlySessionState
                 WHERE 
                     ITEMSID = @ITEMSID@
                 ",
-                new CDAParameter("INSPECTTYPE",form["INSPECTTYPE"]),
-                new CDAParameter("INSPECTNAME",form["INSPECTNAME"]),
-                new CDAParameter("GOODSID",0),
-                new CDAParameter("GOODSCODE",form["GOODSCODE"]),
-                new CDAParameter("INSPECTVERSION",form["INSPECTVERSION"]),
-                new CDAParameter("REMARKS",form["REMARKS"]),
-                new CDAParameter("UPDATEUSERID",HttpContext.Current.Session["userId"]),
-                new CDAParameter("ITEMSID",HttpContext.Current.Request["id"])
-            );
+                    new CDAParameter("INSPECTTYPE", form["INSPECTTYPE"]),
+                    new CDAParameter("INSPECTNAME", form["INSPECTNAME"]),
+                    new CDAParameter("GOODSID", null),
+                    new CDAParameter("GOODSCODE", goods),
+                    new CDAParameter("INSPECTVERSION", form["INSPECTVERSION"]),
+                    new CDAParameter("REMARKS", form["REMARKS"]),
+                    new CDAParameter("UPDATEUSERID", HttpContext.Current.Session["userId"]),
+                    new CDAParameter("ITEMSID", HttpContext.Current.Request["id"])
+                );
+            }
             return new JsonResult(JsonStatus.success).ToJson();
         }
     }

+ 2 - 6
wwwroot/mes/pm/fqcitems/fqcitems_edit.html

@@ -70,14 +70,10 @@
                     <div class="w-fieldname">检验标准名称:</div>
                     <div class="w-field"><input class="easyui-textbox" id="INSPECTNAME" name="INSPECTNAME" data-options="required:true,prompt:'请填写INSPECTNAME...',tipPosition:'top'" style="width:100%;height:32px;"></div>
                 </div>
-                <!--<div class="w-div">
-                    <div class="w-fieldname">产品ID:</div>
-                    <div class="w-field"><input class="easyui-textbox" id="GOODSID" name="GOODSID" data-options="required:false,prompt:'请填写GOODSID...',tipPosition:'top'" style="width:100%;height:32px;"></div>
-                </div>-->
                 <div class="w-div">
-                    <div class="w-fieldname">产品编码:</div>
+                    <div class="w-fieldname">产品类别:</div>
                     <div class="w-field">
-                        <input class="easyui-combobox" id="GOODSCODE" name="GOODSCODE" data-options="required:true,prompt:'',tipPosition:'top',url:'/mes/list.ashx?m=getGoods&select=1',method:'get',valueField:'GOODSCODE',textField:'GOODSCODE',panelHeight:'140px',editable:true,multiple:false" style="width: 100%; height: 32px;">
+                        <input class="easyui-combotree" id="GOODSCODE" name="GOODSCODE" data-options="required:false,prompt:'',tipPosition:'top',url:'/mes/list.ashx?m=getGoodsTpyes',method:'get',valueField:'GOODSCODE',textField:'TEXT',panelHeight:'200px',editable:true,multiple:true" style="width: 100%; height: 32px;">
                     </div>
                 </div>
                 <div class="w-div">