Parcourir la source

新品入仓
添加69码

昱硕 冯 il y a 1 an
Parent
commit
a8f8f2bc35

+ 207 - 0
wwwroot/mes/pc/Goodsnew/Goodsnew.ashx

@@ -0,0 +1,207 @@
+<%@ WebHandler Language="C#" Class="Goodsnew" %>
+
+using System;
+using System.Web;
+using System.Web.SessionState;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Data;
+using Curtain.DataAccess;
+using DK.XuWei.WebMes;
+
+public class Goodsnew : IHttpHandler, IReadOnlySessionState
+{
+	public void ProcessRequest(HttpContext context)
+	{
+		context.Response.ContentType = "text/plain";
+
+		if (mes.LoginCheck() && context.Request["m"] is object)
+		{
+			Button b = new Button();
+
+			b.btnIndex = true;
+			b.btnInsert = true;
+			b.btnDelete = true;
+			b.btnSearch = true;
+
+			switch (context.Request["m"].ToString().ToLower())
+			{
+				case "b":
+					{
+						//按钮
+						context.Response.Write(new JsonResult(b).ToJson());
+						break;
+					}
+				case "i":
+					{
+						//插入
+						if (b.btnInsert)
+							context.Response.Write(insertGood(context.Request.Form));
+						else
+							context.Response.Write(new JsonResult(JsonStatus.rightError).ToJson());
+						break;
+					}
+				case "s":
+					{
+						//搜索
+						if (b.btnIndex)
+							context.Response.Write(search(context.Request.Form));
+						else
+							context.Response.Write(new JsonResult(JsonStatus.rightError).ToJson());
+						break;
+					}
+				case "d":
+					{
+						//删除
+						if (b.btnDelete)
+							context.Response.Write(delete());
+						else
+							context.Response.Write(new JsonResult(JsonStatus.rightError).ToJson());
+						break;
+					}
+				default:
+					{
+						break;
+					}
+			}
+		}
+		else
+		{
+			context.Response.Write(new JsonResult(JsonStatus.loginError).ToJson());
+		}
+	}
+
+	/// <summary>
+	/// </summary>
+	/// <returns>json</returns>
+	private string insertGood(NameValueCollection form)
+	{
+		using (IDataAccess conn = DataAccess.Create())
+		{
+			DataTable dt = conn.ExecuteDatatable(@"
+                SELECT 
+                    m.GOODSID
+                FROM
+                    TP_MST_GOODS m
+                WHERE 
+                    m.GOODSCODE = @GOODSCODE@ 
+                ",
+			new CDAParameter("GOODSCODE", form["GOOSDCODE"])
+		);
+
+			if (dt != null && dt.Rows.Count > 0)
+			{
+				int result = conn.ExecuteNonQuery(@"
+                    INSERT INTO TP_MST_GOODSNEW ( 
+                        GOODSID,
+                        GOODCODE
+                    ) VALUES (
+                        @GOODSID@,
+                        @GOODCODE@
+                    )
+                    ",
+					new CDAParameter("GOODSID", dt.Rows[0]["GOODSID"]),
+					new CDAParameter("GOODCODE", form["GOOSDCODE"])
+					);
+			}
+			else
+			{
+				return new JsonResult("新品入仓失败").ToJson();
+			}
+			return new JsonResult(JsonStatus.success).ToJson();
+		}
+	}
+
+	/// <summary>
+	/// TP_PM_Offline 查询
+	/// </summary>
+	/// <returns>json</returns>
+	private string search(NameValueCollection form)
+	{
+		using (IDataAccess conn = DataAccess.Create())
+		{
+			int page = HttpContext.Current.Request["page"] is object ? Convert.ToInt32(HttpContext.Current.Request["page"]) : 1;
+			int rows = HttpContext.Current.Request["rows"] is object ? Convert.ToInt32(HttpContext.Current.Request["rows"]) : 10;
+			string sort = HttpContext.Current.Request["sort"] is object ? HttpContext.Current.Request["sort"] : "";
+			string order = HttpContext.Current.Request["order"] is object ? HttpContext.Current.Request["order"] : "";
+
+			string sqlStr = @"
+                SELECT 
+                  GOODSID AS SID,
+                    GOODSID,
+                    GOODCODE
+                FROM TP_MST_GOODSNEW
+            ";
+			List<CDAParameter> sqlPara = new List<CDAParameter>();
+			int total = 0;
+			DataTable dt = conn.SelectPages(page, rows, out total, sqlStr, sqlPara.ToArray());
+			return new JsonResult(dt) { total = total }.ToJson();
+		}
+	}
+
+	/// <summary>
+	/// 删除 TP_PM_Offline
+	/// </summary>
+	/// <returns>json</returns>
+	private string delete()
+	{
+		using (IDataAccess conn = DataAccess.Create())
+		{
+			if (HttpContext.Current.Request["id"] is object)
+			{
+				int result = conn.ExecuteNonQuery(@"
+                    DELETE 
+                        TP_MST_GOODSNEW 
+                    WHERE 
+                        INSTR(',' || @GOODSID@ || ',' , ',' || GOODSID || ',') > 0 
+                    ",
+					new CDAParameter("GOODSID", HttpContext.Current.Request["id"])
+				);
+				return new JsonResult(JsonStatus.success).ToJson();
+			}
+			else
+			{
+				return new JsonResult(JsonStatus.otherError).ToJson();
+			}
+		}
+	}
+
+	/// <summary>
+	/// 导出 TP_PM_Offline
+	/// </summary>
+	/// <returns>json</returns>
+	private string export()
+	{
+		return search(new NameValueCollection());
+	}
+
+	private class Button
+	{
+		public bool btnIndex = false;
+		public bool btnInsert = false;
+		public bool btnInsertBatch = false;
+		public bool btnCopy = false;
+		public bool btnDelete = false;
+		public bool btnCancel = false;
+		public bool btnSearch = false;
+		public bool btnDetail = false;
+		public bool btnCheckbox = false;
+		public bool btnExport = false;
+		public bool btnReload = false;
+	}
+
+	private class xRecord
+	{
+		public string sid { get; set; }
+		public string GOODSCODE { get; set; }
+	}
+
+	public bool IsReusable
+	{
+		get
+		{
+			return false;
+		}
+	}
+
+}

+ 69 - 0
wwwroot/mes/pc/Goodsnew/Goodsnew_add.html

@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8" />
+    <meta name="keywords" content="dongke,mes,ibossmes">
+    <meta name="description" content="制造企业生产过程执行管理系统">
+    <meta name="author" content="xuwei">
+    <title>东科软件</title>
+    <script src="/plugins/xeasyui/xeasyui.min.js"></script>
+</head>
+<body class="easyui-layout">
+    <!--
+        <input class="easyui-combobox w-input" id="叶子" name="叶子" data-options="prompt:'',tipPosition:'top',url:'/mes/list.ashx?m=truefalse',method:'get',valueField:'text',textField:'text',panelHeight:'200px',editable:'true'" style="width:100%;height:32px;">
+        <input class="easyui-filebox" id="图片" name="图片" data-options="prompt:'',tipPosition:'top',buttonText:'选择图片',buttonAlign:'right',accept:'image/*',onChange:$.imagePreview" style="width:100%;height:32px;" >
+    -->
+    <div data-options="region:'center',plain:true,border:false">
+        <form id="ff" method="post" class="w-form">
+            <div class="w-div">
+                <div class="w-fieldbar" onclick="$('#more1').toggle()" style="cursor:pointer;"></div>
+            </div>
+            <div id="more1" style="display:block;">
+                <div class="w-div">
+                    <div class="w-fieldname">产品ID:</div>
+                    <div class="w-field"><input disabled class="easyui-textbox" id="GOODSID" name="GOODSID" data-options="required:false,prompt:'',tipPosition:'top'" style="width:100%;height:32px;"></div>
+                </div>
+            </div>
+            <div class="w-div">
+                <div class="w-fieldbar" onclick="$('#more2').toggle()" style="cursor:pointer;"></div>
+            </div>
+            <div id="more2" style="display:block;">
+                <div class="w-div">
+                    <div class="w-fieldname">产品编码:</div>
+                    <!--<div class="w-field"><input class="easyui-textbox" id="GOODSCODE" name="GOODSCODE" data-options="required:true,prompt:'',tipPosition:'top'" style="width:100%;height:32px;"></div>-->
+                    <div class="w-field">
+                        <input class="easyui-combobox" id="GOODSCODE" name="GOOSDCODE" data-options="required:false,prompt:'',tipPosition:'top',url:'../../../mes/list.ashx?m=getGoods&select=1',method:'get',valueField:'GOODSCODE',textField:'GOODSCODE',panelHeight:'300px',editable:true" style="width:100%;height:32px;">
+                    </div>
+                </div>
+                
+            </div>
+        </form>
+    </div>
+    <div data-options="region:'south',border:false" class="w-bar">
+        <a href="javascript:void(0)" id="tbSave" class="easyui-linkbutton" data-options="iconCls:'icon-save'" onclick="submitForm()">保存</a>
+        <a href="javascript:void(0)" id="tbClose" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" onclick="cancelForm()">关闭</a>
+    </div>
+
+    <script type="text/javascript">
+
+        $(function () {
+            $('#ff').formLoad({
+				url: 'Goodsnew.ashx?m=a'
+            });
+            $('#more1').toggle();
+        });
+
+        function submitForm() {
+            $.dialog.save({
+                formid: 'ff',
+				url: 'Goodsnew.ashx?m=i'
+            });
+        }
+
+        function cancelForm() {
+            $.dialog.close();
+        }
+
+    </script>
+</body>
+</html>

+ 98 - 0
wwwroot/mes/pc/Goodsnew/Goodsnew_index.html

@@ -0,0 +1,98 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8" />
+    <meta name="keywords" content="dongke,mes,ibossmes">
+    <meta name="description" content="制造企业生产过程执行管理系统">
+    <meta name="author" content="xuwei">
+    <title>东科软件</title>
+    <script src="/plugins/xeasyui/xeasyui.min.js"></script>
+    <link href="/plugins/xeasyui/toolbar.min.css" rel="stylesheet" />
+</head>
+<body>
+    <!--工具条-->
+    <div id="tb" class="i-toolbar">
+        <a href="javascript:void(0)" style="display:none" id="btnInsert" title="添加" class="easyui-linkbutton" iconcls="icon-add" plain="true" onclick="tbAdd()">添加</a>
+        <a href="javascript:void(0)" style="display:none" id="btnDelete" title="删除" class="easyui-linkbutton" iconcls="icon-remove" plain="true" onclick="tbDelete()">删除</a>
+        <a href="javascript:void(0)" style="display:none" id="btnSearch" title="搜索" class="easyui-linkbutton" iconcls="icon-search" plain="true" toggle="true" onclick="tbSearch()">搜索</a>
+        <a href="javascript:void(0)" id="btnReload" title="刷新" class="easyui-linkbutton" iconcls="icon-reload" plain="true" onclick="tbReload()">刷新</a>
+        <div id="tbSearchDiv" style="display:none;padding:10px;">
+            <form id="ff">
+                <div>
+                    <a href="javascript:void(0)" id="btnSearchSubmit" title="搜索" class="easyui-linkbutton" plain="false" onclick="tbSearchSubmit()">搜索</a>
+                </div>
+            </form>
+        </div>
+    </div>
+    <!--表格-->
+    <table id="dg" data-options="toolbar: '#tb',onDblClickRow: dgDblclickrow,showFooter:false">
+        <thead>
+            <tr>
+                <th data-options="field:'SID',title:'SID',width:220,align:'left',checkbox:true,hidden:true">SID</th>
+                <th data-options="field:'GOODSID',title:'产品ID',align:'left',sortable:true"></th>
+                <th data-options="field:'GOODCODE',title:'产品编码',align:'left',sortable:true"></th>
+            </tr>
+        </thead>
+    </table>
+    <script type="text/javascript">
+
+        //加载完成
+        $(function () {
+            //加载按钮
+            $('#tb').buttonLoad({
+				url:'Goodsnew.ashx?m=b'
+            });
+            //加载表格数据
+            tbSearchSubmit();
+        });
+
+        //添加按钮
+        function tbAdd() {
+            $('#dg').datagridDialog({
+                title: '添加数据',
+                width: 640,
+                height: 480,
+				url: 'Goodsnew_add.html'
+            });
+        }
+
+        //删除按钮
+        function tbDelete() {
+            $('#dg').datagridPost({
+                title:'删除操作',
+				url: 'Goodsnew.ashx?m=d',
+                onValidate: function (r) { return true; }
+            });
+        }
+
+        //搜索按钮
+        function tbSearch() {
+            $('#tbSearchDiv').toggle();
+        }
+
+        //搜索提交
+        function tbSearchSubmit() {
+            $('#dg').datagridLoad({
+                title: '新品入仓',
+				idField: 'GOODSID',
+                queryParams: $('#ff').serializeJson(),
+				url: 'Goodsnew.ashx?m=s',
+                columnMenu: '#btnColumnMenu',
+                columnMoving: false
+            });
+        }
+
+        //刷新
+        function tbReload() {
+            tbSearchSubmit();
+        }
+		//表格双击
+		function dgDblclickrow(rowIndex, rowData) {
+			tbDetail();
+		}
+        function formatterTrueFalse(value, row, index) { return value == 'True' ? '是' : '否'; }
+        function stylerTrueFalse(value, row, index) { return value == 'True' ? 'color:black' : 'color:red'; }
+
+    </script>
+</body>
+</html>

+ 4 - 1
wwwroot/mes/pc/sapmaterialcode/sapmaterialcode.ashx

@@ -152,6 +152,7 @@ public class bompackunit : IHttpHandler, IReadOnlySessionState
 				,VALUEFLAG
 				,CREATEUSERID
 				,UPDATEUSERID
+				,ZWLJC
 				) values(
 				@MATNR@
 				,@WERKS@
@@ -209,6 +210,7 @@ public class bompackunit : IHttpHandler, IReadOnlySessionState
 				,@VALUEFLAG@
 				,@CREATEUSERID@
 				,@UPDATEUSERID@
+				,@ZWLJC@
 				)";
 
 			decimal menge = 0;
@@ -273,7 +275,8 @@ public class bompackunit : IHttpHandler, IReadOnlySessionState
 					new CDAParameter("ACCOUNTID", HttpContext.Current.Session["accountId"]),
 					new CDAParameter("VALUEFLAG", 1),
 					new CDAParameter("CREATEUSERID", HttpContext.Current.Session["userId"]),
-					new CDAParameter("UPDATEUSERID", HttpContext.Current.Session["userId"])
+					new CDAParameter("UPDATEUSERID", HttpContext.Current.Session["userId"]),
+					new CDAParameter("ZWLJC", row["ZWLJC"])
 				);
 			}
 

+ 1 - 0
wwwroot/mes/pc/sapmaterialcode/sapmaterialcode_index.html

@@ -83,6 +83,7 @@
 					<th data-options="field:'ZMYYSL',title:'名义用水量',align:'left',sortable:true"></th>
 					<th data-options="field:'ZCPCCBZQ',title:'产品尺寸(包装前)',align:'left',sortable:true"></th>
 					<th data-options="field:'ZCPCCBZH',title:'产品尺寸(包装后)',align:'left',sortable:true"></th>
+					<th data-options="field:'ZWLJC',title:'69码)',align:'left',sortable:true"></th>
 				</tr>
 		</table>
 	</div>