Files
8-Heli-Differential-MesProject/Common/08WebFun_base/WebFun_base/MisWebInterfaceFunc/Web_Init.cs
2026-06-08 10:59:21 +08:00

817 lines
22 KiB
C#

//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Threading.Tasks;
//using SystemFramework;
//namespace MesWebFun_base
//{
// public partial class MisWebInterface
// {
// /*该js文件用于处理"页面初始化"业务逻辑处理*/
// //记录TabSelect时的Tab顺序
// var Tab_Index = '操作指南';
// //记录操作指南区域的先后顺序:1显示操作指南,0显示工艺卡
// var Index = 1;
// var btnconfig =
// {
// btn: {
// close:'<span class="glyphicon glyphicon glyphicon-off" aria-hidden="true"></span> 重新工作',
// comfrie:'<span class="glyphicon glyphicon glyphicon-ok" aria-hidden="true"></span> 继续工作'
// }
// }
//var dditConfig = {
// btn: {
// close:'<span class="glyphicon glyphicon glyphicon-off" aria-hidden="true"></span> 重新工作',
// comfrie:'<span class="glyphicon glyphicon glyphicon-ok" aria-hidden="true"></span> 继续工作'
// },
// hintLayer: {
// icon: 7,
// title: ["涂胶-拧紧超时报警","background-color:#4476A7"],
// area: ['600px', '320px'],
// skin: 'layui-layer-molv',
// offset: '240px',
// btn: [btnconfig.btn.comfrie, btnconfig.btn.close]
// },
// hintLayer1: {
// icon: 1,
// area: ['360px', '250px'],
// title: "提示信息",
// skin: 'layerStyle',
// offset: '350px',
// btn: ["确定登录", "取消登录"]
//}
//}
////初始化MES界面
//void loadingMes()
//{
// var opName = $("#tbx_opname").val();
// //初始化Mes界面_更新上面的数据
// loadingMesData();
// $.ajax({
// url: '../submit/OpName.ashx?type=MesloadingSelect&value=' + opName,
// data:
// {
// mainModule: 1, //主模块代码
// MesWebCode: 2//页面代码
// },
// dataType: 'json',
// success: function(data) {
// if (data != null && data != "")
// {
// for (i = 0; i < data.length; i++)
// {
// switch (data[i].标签属性)
// {
// case "lbl":
// {
// updataLbl(data[i]);
// }
// break;
// case "tab":
// {
// updataTab(data[i]);
// }
// break;
// case "btn":
// {
// updataBtn(data[i]);
// }
// break;
// }
// }
// }
// else
// {
// return;
// }
// }
// })
// //更新lbl
// void updataLbl(data)
//{
// try
// {
// var key = data.标签ID;
// var value = data.标签文字;
// $('#' + key).text(value);
// }
// catch (Error)
// {
// }
//}
////更新btn
//void updataBtn(data)
//{
// var key = data.标签ID;
// var value = data.标签文字;
// $('#' + key).val(value);
//}
////更新tab
//void updataTab(data)
//{
// //第一步取到tab的控件
// var tab_key = data.所属父级ID;
// var launageType = data.语言编号;
// $("#Hidden_language").val(launageType);
// var value = data.模块描述;
// //console.info(value);
// var tab_index = data.模块编号;
// if (data.是否禁用 == 0 && data.是否禁用 != undefined)
// {
// var tab_child = $('#' + tab_key).tabs('getTab', value);
// if (tab_child != null)
// {
// $('#' + tab_key).tabs('update', {
// tab: tab_child,
// options:
// {
// title: value // 新tab的title
// }
// });
// }
// } else
//{
// $('#' + tab_key).tabs('close', value);
// $('#' + tab_key).tabs('select', 0);
//}
// }
//}
////初始化Mes界面_更新上面的input
//void loadingMesData()
//{
//}
////打开功能按钮对话框
//void OpenPanel()
//{
// $("#div_btnfunction_main").toggle();
//}
////根据对象以及百分比获取实际absolutely长度大小
//void FixWidth(sender, percent)
//{
// alert('0');
// return $('#' + sender).width() * percent;
//}
////获取html页面参数
//void getvalue(name)
//{
// var str = window.location.search;
// if (str.indexOf(name) != -1)
// {
// var pos_start = str.indexOf(name) + name.length + 1;
// var pos_end = str.indexOf("&", pos_start);
// if (pos_end == -1)
// {
// return str.substring(pos_start);
// }
// else
// {
// return str.substring(pos_start, pos_end)
// }
// }
// else
// {
// return "没有这个name值";
// }
//}
////初始化工步属性
//void IniStepProperty()
//{
// var opName = $("#tbx_opname").val();
// $.ajax({
// type: "POST",
// url: '../submit/OpName.ashx?type=StepProperty&value=' + opName + '',
// success: function(data) {
// if (data != null && data != "")
// {
// var stepProperty = data.toString();
// $("#Hidden_stepProperty").val(stepProperty);
// }
// }
// })
//}
////在线,离线,启用点击事件
//void show_Pannel_status1()
//{
// $('#combobox_btnfunction_status').combobox('showPanel');
//}
////功能按钮-从数据库中初始化在线/离线/屏蔽的combobox
//void initOnlineOutlineCombobox()
//{
// var opName = $("#tbx_opname").val();
// $.ajax({
// type: "POST",
// url: "../submit/OpName.ashx?type=Init_OnlineOutline",
// data:
// {
// opnameValue: opName
// },
// dataType: 'json',
// success: function(data) {
// if (data != null && data != "")
// {
// if (data.value == "2")
// {
// $("#btn_function").css("background-color", "red");
// $("#combobox_btnfunction_status").combobox("setValue", "2");
// }
// else
// {
// $("#btn_function").css("background-color", "green");
// $("#combobox_btnfunction_status").combobox("setValue", "0");
// }
// }
// }
// });
//}
////初始化combox--功能按钮
//void initCombobox()
//{
// var opName = $("#tbx_opname").val();
// var headwidth = $("#div_btnfunction_status").width();
// var headheight = $("#div_btnfunction_status").height();
// $("#combobox_btnfunction_status").combobox({
// width: 130,
// height: 35,
// //panelHeight: headheight,
// panelHeight: 80,
// valueField: "id",
// textField: "line",
// value: "在线",
// data:
// [{
// id: "0",
// line: "在线"
// }, {
// id: "2",
// line: "屏蔽"
// }],
// editable: false,
// onSelect: function(record) {
// var opName = $("#tbx_opname").val();
// var text = $("#combobox_btnfunction_status").combobox("getText");
// var value = $("#combobox_btnfunction_status").combobox("getValue");
// if (value == 2)
// {
// $("#btn_function").css("background-color", "red");
// }
// else
// {
// $("#btn_function").css("background-color", "green");
// }
// //插入到数据库
// $.ajax({
// type: "POST",
// url: "../submit/OpName.ashx?type=Insert_OnlineOutline",
// data:
// {
// opnameValue: opName,
// selectValue: value
// },
// dataType: 'json',
// success: function(data) {
// if (data != null && data != "")
// {
// if (data.falg == "1")
// {
// //发送信号
// var sendmessage = "MSG,OnLineState|" + opName + "|" + value;
// sendMessage(sendmessage);
// }
// else
// {
// }
// }
// }
// });
// }
// });
//} //初始化tab
//var slectTabFlag = 1;
////初始化tab
//void initTab()
//{
// var meswidth = $("#div_mes_main").width();
// var timewidth = $("#div_time_main").width();
// // var tabWidth = (meswidth - timewidth) * 0.975;
// var tabWidth = (meswidth - timewidth) * 0.83;
// var tabHeight = $("#div_time_main").height();
// $('#div_tab').tabs({
// border: false,
// tabWidth: tabWidth / 6,
// tabHeight: tabHeight,
// onSelect: function(title, index) {
// switch (title)
// {
// case '操作指南':
// SettingIndex(title);
// initProcessData();
// initAssembleData();
// ShowCraft();
// break;
// case '工艺卡':
// SettingIndex(title);
// ShowCraft();
// break;
// case '订单完工':
// SettingIndex(title);
// initOrderInfoData();
// ReloadOrderInfoData();
// break;
// case '物料拉动':
// SettingIndex(title);
// initOrderInfoData();
// ReloadOrderInfoData();
// break;
// case '质量查询':
// SettingIndex(title);
// IniQualityButtons_bgColor();
// initStationdata();
// repairMark = 0;
// break;
// case '设备管理':
// SettingIndex(title);
// initMaintainInfodata();
// var tab = $('#div_tab').tabs('getSelected');
// tab.panel('refresh');
// break;
// case 'ANDON':
// SettingIndex(title);
// ///测试
// init_Combobox_ando_call();
// init_combobox_ando_reset();
// InitMaterailAndo();
// //alert($("#tbx_opname").val());
// $('#div_andon_table_material').css({
// "left": "0px"
// });
////初始化物料ando弹出的div
//Init_ando_popup();
////初始化质量ando弹出的div
//Init_ando_quality_popup();
////初始化设备ando弹出的div
//Init_ando_machine_popup();
//break;
// case '返修管理':
// SettingIndex(title);
//initStationdataRepair();
//IniQualityButtons_bgColorRepair();
//repairMark = 1;
//break;
// }
// }
// });
//}
////点击Tab设置Index
//void SettingIndex(index)
//{
// switch (index)
// {
// case '操作指南': //操作指南
// if (Tab_Index != '操作指南')
// {
// Index = 0;
// Tab_Index = '操作指南';
// return;
// }
// else
// {
// if (Index == 1)
// {
// Index = 0;
// return;
// }
// if (Index == 0)
// {
// Index = 1;
// return;
// }
// }
// break;
// case '工艺卡': //工艺卡
// if (Tab_Index != '工艺卡')
// {
// Index = 0;
// Tab_Index = '操作指南';
// return;
// }
// else
// {
// if (Index == 1)
// {
// Index = 0;
// return;
// }
// if (Index == 0)
// {
// Index = 1;
// return;
// }
// }
// break;
// case '订单完工': //订单完工
// Tab_Index = index;
// Index = 0;
// return;
// break;
// case '物料拉动': //物料拉动
// Tab_Index = index;
// Index = 0;
// return;
// break;
// case '质量查询': //质量查询
// Tab_Index = index;
// Index = 0;
// return;
// break;
// case '设备管理': //设备管理
// Tab_Index = index;
// Index = 0;
// return;
// break;
// case 'ANDON': //Andon
// Tab_Index = index;
// Index = 0;
// return;
// break;
// case '返修管理': //返修管理
// Tab_Index = index;
// Index = 0;
// return;
// break;
// default:
// Tab_Index = 0;
// Index = 0;
// return;
// break;
// }
//}
////显示工序卡和操作指南头
//void ShowCraft()
//{
// if (Index == 0)
// {
// var tab = $('#div_tab').tabs('getSelected');
// var launageType = $("#Hidden_language").val();
// if (launageType == 1)
// {
// $('#div_tab').tabs('update', {
// tab: tab,
// options:
// {
// title: "操作指南" // 新tab的title
// }
// });
// }
// if (launageType == 2)
//{
// $('#div_tab').tabs('update', {
// tab: tab,
// options:
// {
// title: "OperageGuid" // 新tab的title
// }
// });
//}
// $("#div_tab_operationcard").css({
// "display": "none"
// });
// }
// else
//{
// //20170331 CORBIN
// var opName = $('#tbx_opname').val();
// $.ajax({
// type: "POST",
// url: '../submit/OpName.ashx?type=GetPdfSrc&value=' + opName,
// success: function(data) {
// if (data != "" || data == null)
// {
// if (document.getElementById('pdf_operationcard') != null)
// {
// $('#pdf_operationcard').attr("src", data);
// initoperationcard();
// }
// }
// else
// {
// $('#pdf_operationcard').attr("src", "../pdf/确认是否上传PDF.pdf");
// initoperationcard();
// }
// }
// })
// //20170331 CORBIN
// $("#div_tab_operationcard").css({
// "display": "block"
// });
// var tab = $('#div_tab').tabs('getSelected');
// var launageType = $("#Hidden_language").val();
// if (launageType == 1)
// {
// $('#div_tab').tabs('update', {
// tab: tab,
// options:
// {
// title: "工艺卡" // 新tab的title
// }
// });
// }
// if (launageType == 2)
// {
// $('#div_tab').tabs('update', {
// tab: tab,
// options:
// {
// title: "ProcessCard" // 新tab的title
// }
// });
// }
//}
//}
////测试虚拟键盘
//void test_tbx_scanbarcode()
//{
// VirtualKeyboard.toggle('', 'softkey');
// $("#kb_langselector,#kb_mappingselector,#copyrights").css("display", "none");
//}
////工位刚登入时,将一些信息复位掉
//void Web_Login()
//{
// var opName = $("#tbx_opname").val();
// $.ajax({
// type: "POST",
// url: '../submit/OpName.ashx?type=WebLoginIn&value=' + opName + '',
// success: function(data) {
// if (data != null && data != "")
// {
// }
// }
// });
////初始化界面
////显示操作指南 ph- 2014年11月18日
//ReceivedSignal_ProcessList(); //显示操作指南
//ReceivedSignal_MaterialList(); //显示物料
//ReceivedSignal_PictureShow(); //显示操作图片
//ShowLEDNotice(); //初始化LED
//}
//void InitMaterialLeave_dialog()
//{
// //open方法
// layer.open({
// icon: 7,
// closeBtn: 1,
// skin: 'layui-layer-lan',
// area:['600px', '350px'],
// content: $("#MaterialLeave_dialog").html(),
// btn:["确定" ],
// yes: function(index, layero) {
// layer.close(index);
// }
// });
//}
////质量门
//void MaterailQuality_dialoga()
//{
// //open方法
// layer.open({
// icon: 7,
// closeBtn: 1,
// skin: 'layui-layer-lan',
// area:['600px', '350px'],
// content: $("#MaterailQuality_dialog").html(),
// btn:["确定"],
// yes: function(index, layero) {
// layer.close(index);
// }
// });
//}
////涂胶延时提醒
//void InitdelayTime_dialog()
//{
// //open方法
// layer.open({
// icon: 7,
// title:["延时提醒提示"],
// closeBtn: 1,
// skin: 'layui-layer-lan',
// area:['600px', '350px'],
// content: $("#delayTime_dialog").html(),
// btn:["继续工作", "重新工作", ],
// yes: function(index, layero) {
// var opName = $("#tbx_opname").val();
// var sendmessage = "MSG,ContinueFixAllow|" + opName + "|1";
// sendMessage(sendmessage);
// layer.close(index);
// },
// btn2: function(index, layero) {
// layer.close(index);
// },
// });
//}
////打印条码提醒
//void InitPrintConfirm_dialog()
//{
// $('#PrintConfirm_dialog').dialog({
// title: '打印条码扫描验证错误',
// width: 600,
// height: 270,
// modal: true,
// closed: true,
// buttons:
// [{
// text: '继续工作',
// iconCls: 'icon-ok',
// handler: function() {
// var opName = $("#tbx_opname").val();
// var sendmessage = "MSG,PrinterrorAlter|" + opName + "|1";
// sendMessage(sendmessage);
// $('#PrintConfirm_dialog').dialog('close');
// }
// }, {
// text: '重新工作',
// iconCls: 'icon-cancel',
// handler: function() {
// $('#PrintConfirm_dialog').dialog('close');
// }
// }]
// });
//}
////OP2150涂胶延时提醒
//void InitTightdelayTime_dialog()
//{
// //open方法
// layer.open({
// icon: 7,
// title:["涂胶延时提醒"],
// closeBtn: 1,
// skin: 'layui-layer-lan',
// area:['600px', '350px'],
// content: $("#tightTime_dialog").html(),
// btn:["继续工作", "重新工作",],
// yes: function(index, layero) {
// var opName = $("#tbx_opname").val();
// var sendmessage = "MSG,ContinueFixAllow|" + opName + "|1";
// sendMessage(sendmessage);
// layer.close(index);
// },
// btn2: function(index, layero) {
// layer.close(index);
// },
// });
//}
////涂胶时间不足提醒
//void InitNotenough_dialog()
//{
// //open方法
// layer.open({
// icon: 7,
// title:["涂胶-测试台架时间不足"],
// closeBtn: 1,
// skin: 'layui-layer-lan',
// area:['600px', '350px'],
// content: $("#Notenough_dialog").html(),
// btn:["继续工作", "重新工作", ],
// yes: function(index, layero) {
// var opName = $("#tbx_opname").val();
// var sendmessage = "MSG,ContinueFixAllow|" + opName + "|1";
// sendMessage(sendmessage);
// layer.close(index);
// },
// btn2: function(index, layero) {
// layer.close(index);
// },
// });
//}
////OP4150打标重复报警
//void InitMarking_dialog()
//{
// //open方法
// layer.open({
// icon: 7,
// title:["打标工件编号重复"],
// closeBtn: 1,
// skin: 'layui-layer-lan',
// area:['600px', '350px'],
// content: $("#Marking_dialog").html(),
// btn:["继续工作", "重新工作", ],
// yes: function(index, layero) {
// var opName = $("#tbx_opname").val();
// var sendmessage = "MSG,ContinueFixAllow|" + opName + "|1";
// sendMessage(sendmessage);
// layer.close(index);
// },
// btn2: function(index, layero) {
// layer.close(index);
// },
// });
//}
////二维码零件未扫描
//void InitNoScan_dialog()
//{
// $('#NoScanMats_dialog').dialog({
// title: '物料未扫描完全',
// width: 600,
// height: 270,
// modal: true,
// closed: true,
// buttons:
// [{
// text: '确定',
// iconCls: 'icon-ok',
// handler: function() {
// $('#NoScanMats_dialog').dialog('close');
// }
// }]
// });
//}
////删除排队
//void button_Orderdele()
//{
// var opName = $("#tbx_opname").val();
// var orderengine_num = $("#txt_orderengine_num").val();
// $.ajax({
// type: 'post',
// url: '../submit/OpName.ashx?type=OrderlistDelete&value=' + opName + '&orderengine_num=' + orderengine_num,
// dataType: 'json',
// success: function(data) {
// $("#txt_orderengine_num").val('');
// }
// });
//sendMessage(sendmessage);
// $.messager.show({
//title: '提示',
// msg: '删除成功!',
// timeout: 2000,
// showType: 'slide'
// });
//}
////线外工位质量数据、物料数据
//void InitLineout_dialog()
//{
// $('#Lineout_dialog').dialog({
// title: '线外工装数据显示',
// width: 860,
// height: 610,
// closed: false,
// cache: false,
// modal: true
// });
//IniQualityButtons_bgColor_alert();
//initStationdata_alert();
//}
//void btn_Lineout_dialog_Cancel()
//{
// $('#Lineout_dialog').dialog({
// closed: true,
// });
//}
//void btn_Lineout_dialog_Continue()
//{
// var opName = $("#tbx_opname").val();
// var barcode = $("#Lineout_barcode").val();
// var sendmessage = "MSG,ContinueFixAllow|" + opName + "|" + barcode;
// sendMessage(sendmessage);
// $('#Lineout_dialog').dialog({
// closed: true,
// });
//}
// }
//}