Pārlūkot izejas kodu

Merge branch 'master' of http://s.dev01.dkiboss.com:9001/DK-MES-2.0/IMEX.mes.check

konghe 1 gadu atpakaļ
vecāks
revīzija
a795e72ddd

+ 4 - 3
wwwroot/Web.config

@@ -6,14 +6,15 @@
 <configuration>
   <connectionStrings>
     <!--中陶-->
-    <add name="ConnectionString" connectionString="Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.8.2)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=test)));User Id=test;Password=dongke" providerName="Oracle.ManagedDataAccess.Client"/>
+    <add name="ConnectionString" connectionString="Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.8.4)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=mestest)));User Id=mestest;Password=dongke" providerName="Oracle.ManagedDataAccess.Client"/>
   
   </connectionStrings>
   <appSettings>
     
     <!--成检 服务地址-->
-    <add key="ProductCheckServer" value="http://10.0.8.2:1233"/>
-    <!--成检 自动识别 成检/重烧-->
+     <!--<add key="ProductCheckServer" value="http://10.0.8.4:9901"/>-->
+	 <add key="ProductCheckServer" value="http://localhost:1234"/>
+	  <!--成检 自动识别 成检/重烧-->
     <add key="ProductCheckAutoRefire" value="true"/>
     <!--成检 成检/重烧 节点 ID-->
     <add key="ProductCheckRefireProcedureId" value="35"/>

+ 20 - 10
wwwroot/main/ProductCheck/api/LogIn_WCF.ashx

@@ -1,5 +1,5 @@
 <%@ WebHandler Language="C#" Class="LogIn_WCF" %>
-
+using System;
 using System.Web;
 using System.Web.SessionState;
 using System.Web.Configuration;
@@ -7,7 +7,7 @@ using Newtonsoft.Json.Linq;
 using Curtain.DataAccess;
 using Curtain.Log;
 using DK.XuWei.WebMes;
-
+using System.Net;
 /// <summary>
 /// 从WCF接口获取 用户登录
 /// xuwei 2019-10-26
@@ -19,17 +19,27 @@ public class LogIn_WCF : IHttpHandler, IRequiresSessionState
         string goUrl = context.Request["gourl"];
         WCF wcf = new WCF();
         wcf.Para = wcf.LoadParaByLoginDefault();
+        try
+        {
+            HttpBrowserCapabilities mybrowser = context.Request.Browser;
+            wcf.Para["phoneCode"] = mybrowser.Type;
+        }
+        catch
+        {
 
-        //登录参数:账套、用户、密码
-        wcf.Para.Add(new JProperty("accountCode", context.Request["accountCode"]));
-        wcf.Para.Add(new JProperty("userCode", context.Request["userCode"]));
-        wcf.Para.Add(new JProperty("userPassword", context.Request["userPassword"]));
+        }
+        finally
+        {
+            //登录参数:账套、用户、密码
+            wcf.Para.Add(new JProperty("accountCode", context.Request["accountCode"]));
+            wcf.Para.Add(new JProperty("userCode", context.Request["userCode"]));
+            wcf.Para.Add(new JProperty("userPassword", context.Request["userPassword"]));
 
-        string jsonStr = wcf.Login("/DKService/PDAModuleService/DoPDALogin", goUrl);
-        //jsonStr = ("{'success':true,'message':'操作成功!','rows':" + jsonStr + "}").Replace("'","\"");
-        context.Response.Write(jsonStr);
+            string jsonStr = wcf.Login("/DKService/PDAModuleService/DoPDALogin", goUrl);
+            //jsonStr = ("{'success':true,'message':'操作成功!','rows':" + jsonStr + "}").Replace("'","\"");
+            context.Response.Write(jsonStr);
+        }
     }
-
     public bool IsReusable
     {
         get

+ 84 - 72
wwwroot/main/ProductCheck/index.html

@@ -38,6 +38,7 @@
 						<div class="form-row">
 							<div class="form-group col-4 mb-1">
 								<label for="生产工号">生产工号</label>
+								<label ID="提示"  style="color: red; float: right; display: none;">请注意研发产品!</label>
 								<input readonly type="text" class="form-control border-secondary" id="生产工号" placeholder="请输入" required>
 							</div>
 							<div class="form-group col-4 mb-1" style="">
@@ -46,7 +47,7 @@
 							</div>
 							<div style="margin-left:-15%">
 								<div id="softkeyboard"></div>
-							<label ID="金蝶代码" style="color: red; display: none;float:right;">注意产品釉料、商标是否正确!</label>
+								<label ID="金蝶代码" style="color: red; display: none;float:right;">注意产品釉料、商标是否正确!</label> 
 							</div>
 							<div class="form-group col-4 align-self-end mb-1" style="margin-left:67%;margin-top:-10%">
 								<button onclick="loadProduct()" id="产品查询" type="button" class="btn btn-info btn-block">产品查询</button>
@@ -286,7 +287,7 @@
 	<script src="/Plugins/sweetalert/sweetalert.min.js"></script>
 	<script src="/Plugins/xrequest/xrequest.min.js"></script>
 	<script src="../Common/xuwell.js"></script>
-	<script>
+	<script> 
 		var cliclkcount = 0;
 		//xuwei 2020-04-21
 		//计件标记变量 1新建 2改判 3冷补后
@@ -749,6 +750,10 @@
 			});
 			//2020-07-02 重新加载生产工号 并验证登录状态
 			loadData();
+			//关闭左边提示请注意研发产品!
+			//var label = document.getElementById('提示');
+			//label.style.display = 'none';
+            $('#提示').css('display', 'none');
 			var barcode = document.getElementById("barcodeStaing");
 			//获取选中下拉框选项的索引
 			var index = barcode.selectedIndex;
@@ -768,14 +773,15 @@
 				procedureId = request('id');
 				//如果是重烧 把重烧ID 给 procedureId
 				if (json['success'] == true) procedureId = json['rows'];
-
+                
 				//加载产品信息
 				$.get('api/GetCheckBarCode_WCF.ashx', { 'procedureid': procedureId, 'barcode': $('#产品条码').val() }, function (data) {
 					var json = JSON.parse(data);
+                   
 					if (json['success'] == true) {
 						//打印条码
 						if (printBarcode) $('#barcodeImg').attr('src', 'print/barcodeimg.ashx?barcode=' + $('#产品条码').val());
-
+						
 						if (json['rows'][0]['out_errMsg'] == '') {
 							//读取产品信息
 							$('#产品商标').val('商标:' + json['rows'][0]["out_logoName"]);
@@ -784,76 +790,81 @@
 							$('#产品名称').val('名称:' + json['rows'][0]["out_goodsName"]);
 							$('#重烧').val('重烧:' + json['rows'][0]["out_isReFire"]);
 							$('#干补').val('干补:' + json['rows'][0]["out_specialRepairFlag"]);
-							swal.close();
+							swal.close(); 
+                            let str = json['rows'][0]["out_goodsCode"] != null ? json['rows'][0]["out_goodsCode"]:"";
+                            let str2 = json['rows'][0]["out_mouldCode"] != null ? json['rows'][0]["out_mouldCode"] : "";
+                            if (str.includes('中试') && str2.includes('YF')) {
+                                //label.style.display = 'none';
+                                $('#提示').css('display', 'block');
+                            } 
+                                 //加载完成工序 判断 是 新建 还是 编辑
+								$.get('api/GetCompleteProcedureIDPDA_WCF.ashx', { 'barcode': $('#产品条码').val() }, function (data) {
+									var json = JSON.parse(data);
+									if (json["success"] == true) { 
+										if (mybarcode == "---请选择---") {
+											completeProcedure = json["rows"];
+											if (procedureId == completeProcedure[0]["COMPLETEPROCEDUREID"]) {
+												checkFlag = "2";
+												action = "update";
+												loadUpdateData(0);
+											}
+											else {
+												//2020-03-23 修正 回收后 再次成检 改判操作 找到正确的成检ID
+												$.get('api/GetProductionDataCheckID_WCF.ashx', { 'barcode': $('#产品条码').val() }, function (data) {
 
+													if (data == '{"success":true,"message":"操作成功!","rows":}') {
+														data = '{"success":true,"message":"操作成功!","rows":[]}';
+													} 
+													var json = JSON.parse(data);
+													if (json["success"] == true) {
 
-							//加载完成工序 判断 是 新建 还是 编辑
-							$.get('api/GetCompleteProcedureIDPDA_WCF.ashx', { 'barcode': $('#产品条码').val() }, function (data) {
-								var json = JSON.parse(data);
-								if (json["success"] == true) {
-									if (mybarcode == "---请选择---") {
-										completeProcedure = json["rows"];
-										if (procedureId == completeProcedure[0]["COMPLETEPROCEDUREID"]) {
-											checkFlag = "2";
-											action = "update";
-											loadUpdateData(0);
-										}
-										else {
-											//2020-03-23 修正 回收后 再次成检 改判操作 找到正确的成检ID
-											$.get('api/GetProductionDataCheckID_WCF.ashx', { 'barcode': $('#产品条码').val() }, function (data) {
-
-												if (data == '{"success":true,"message":"操作成功!","rows":}') {
-													data = '{"success":true,"message":"操作成功!","rows":[]}';
-												}
-
-												var json = JSON.parse(data);
-												if (json["success"] == true) {
-
-													//2020-04-23 xuwei 修正
-													if (json["rows"].length == 0) {
-														//为空行时是新建
-														checkFlag = "1";
-														action = "insert";
-														loadInsertData();
-													}
-													else {
-														if (json["rows"][0]["PROCEDUREID"] == procedureId) {
-															//工序相等时是更新
-															checkFlag = "3";
-															action = "update";
-															loadUpdateData(json["rows"][0]["PRODUCTIONDATAID"]);
+														//2020-04-23 xuwei 修正
+														if (json["rows"].length == 0) {
+															//为空行时是新建
+															checkFlag = "1";
+															action = "insert";
+															loadInsertData();
 														}
 														else {
-															//工序不等时不可到达
-															resetGoodsGrade(false);
-															swal({
-																title: "产品查询",
-																text: "该工序不可到达!请确认质量登记工序!",
-																icon: "error",
-																button: "确定"
-															}).then(function () {
-																$('#产品条码').val('');
-																$('#产品条码').focus();
-															});
+															if (json["rows"][0]["PROCEDUREID"] == procedureId) {
+																//工序相等时是更新
+																checkFlag = "3";
+																action = "update";
+																loadUpdateData(json["rows"][0]["PRODUCTIONDATAID"]);
+															}
+															else {
+																//工序不等时不可到达
+																resetGoodsGrade(false);
+																swal({
+																	title: "产品查询",
+																	text: "该工序不可到达!请确认质量登记工序!",
+																	icon: "error",
+																	button: "确定"
+																}).then(function () {
+																	$('#产品条码').val('');
+																	$('#产品条码').focus();
+																});
+															}
 														}
+														//if (json["rows"][0]["PRODUCTIONDATAID"] != 0) {
+														//    checkFlag = "3";
+														//    action = "update";
+														//    loadUpdateData(json["rows"][0]["PRODUCTIONDATAID"]);
+														//}
+														//else {
+														//    checkFlag = "1";
+														//    action = "insert";
+														//    loadInsertData();
+														//}
 													}
-													//if (json["rows"][0]["PRODUCTIONDATAID"] != 0) {
-													//    checkFlag = "3";
-													//    action = "update";
-													//    loadUpdateData(json["rows"][0]["PRODUCTIONDATAID"]);
-													//}
-													//else {
-													//    checkFlag = "1";
-													//    action = "insert";
-													//    loadInsertData();
-													//}
-												}
-											});
+												});
+											}
+
 										}
 									}
-								}
-							});
-						}
+
+								}); 
+                            } 
 						else {
 							resetGoodsGrade(false);
 							swal({
@@ -880,25 +891,26 @@
 					}
 					if (mybarcode != document.getElementById("产品条码").value) {
 						//产品缺陷列表清空
-						ClearProductDefectList();
+						ClearProductDefectList(); 
 					}
-
+                    
 				});
-			});
+			}); 
+
 			//查询金蝶代码
 			var barcode = document.getElementById("产品条码").value;
 			$.post('api/GetKingdeeCode.ashx', { 'BarCode': barcode }, function (data) {
 				var json = JSON.parse(data);
 				if (json['success'] == true && json['rows'] == "1") {
-					$('#金蝶代码').css('display', 'none');
+					$('#金蝶代码').css('display', 'none'); 
 				}
 				else {
 					$('#金蝶代码').css('display', 'block');
 				}
 			});
 
-		}
-
+		} 
+		 
 		//加载插入数据
 		function loadInsertData() {