<!DOCTYPE html>
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<title>报工平台</title>
|
<meta name="renderer" content="webkit">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
<!--引用layui样式文件-->
|
<link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
|
<link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
|
<link href="../../../layuiadmin/layui/css/global.css" rel="stylesheet" />
|
<!--自定义样式-->
|
<link href="../../../layuiadmin/layui/css/ReportPlatform.css" rel="stylesheet" />
|
<!--引用layui js文件-->
|
<script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
|
<script src="../../../layuiadmin/layui/layui.js"></script>
|
<script src="../../../layuiadmin/echarts.min.js"></script>
|
<script src="../../../layuiadmin/Scripts/json2.js"></script>
|
<script src="../../../layuiadmin/Scripts/webConfig.js"></script>
|
<script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
|
<script src="../../../layuiadmin/PubCustom.js"></script>
|
</head>
|
|
<body>
|
<!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
|
<!--[if lt IE 9]>
|
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
|
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
|
<![endif]-->
|
|
<div style="margin: 20px 20px;">
|
<!--<blockquote class="layui-elem-quote">注意:下述演示中的颜色只是做一个区分作用,并非栅格内置。</blockquote>-->
|
<div class="layui-row layui-col-space10">
|
<div class="layui-col-sm12 layui-col-md8">
|
<div class="layui-tab layui-tab-card" lay-filter="TabTest">
|
<ul class="layui-tab-title">
|
<li class="layui-this">工单列表</li>
|
</ul>
|
<div class="layui-tab-content content3">
|
<div class="layui-tab-item layui-show">
|
<div class="layui-row layui-col-space10" id="btomleft" style="height:600px;display:block;overflow-y:auto;">
|
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="layui-col-sm12 layui-col-md4">
|
<fieldset style="border: 1px solid #eee;box-shadow: 0 2px 5px 0 rgb(0 0 0 / 10%);">
|
<legend style="color: #5FB878">操作台</legend>
|
<div class="content4">
|
<!--<div class="layui-row layui-col-space10">
|
<div class="layui-col-sm12 layui-col-md4" onclick="OpenWork(event,this)">
|
<div class="cnt bottomright">
|
<span class="layui-icon layui-icon-play imgicon"></span>
|
<span class="imgtitle">开工</span>
|
</div>
|
</div>
|
<div class="layui-col-sm12 layui-col-md4" onclick="OpenReport(event,this)">
|
<div class="cnt bottomright">
|
<span class="layui-icon layui-icon-list imgicon"></span>
|
<span class="imgtitle">汇报</span>
|
</div>
|
</div>
|
<div class="layui-col-sm12 layui-col-md4" onclick="OpenEnd(event,this)">
|
<div class="cnt bottomright">
|
<span class="layui-icon layui-icon-logout imgicon"></span>
|
<span class="imgtitle">完工</span>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row layui-col-space10" style="display:none;">
|
<div class="layui-col-sm12 layui-col-md4" onclick="KSOpenWork(event,this)">
|
<div class="cnt bottomright">
|
<span class="layui-icon layui-icon-pause imgicon"></span>
|
<span class="imgtitle">快速开工</span>
|
</div>
|
</div>
|
|
</div>
|
<div class="layui-row layui-col-space10">
|
<div class="layui-col-sm12 layui-col-md4" onclick="SOP(event,this)">
|
<div class="cnt bottomright">
|
<span class="layui-icon layui-icon-read imgicon"></span>
|
<span class="imgtitle">作业指导书</span>
|
</div>
|
</div>
|
<div class="layui-col-sm12 layui-col-md4" onclick="OpenFistCheck(event,this)">
|
<div class="cnt bottomright">
|
<span class="layui-icon layui-icon-search imgicon"></span>
|
<span class="imgtitle">首检</span>
|
</div>
|
</div>
|
<div class="layui-col-sm12 layui-col-md4" onclick="OpenProcess(event,this)">
|
<div class="cnt bottomright">
|
<span class="layui-icon layui-icon-search imgicon"></span>
|
<span class="imgtitle">巡检</span>
|
</div>
|
</div>
|
<div class="layui-col-sm12 layui-col-md4" onclick="ProcessCheck(event,this)">
|
<div class="cnt bottomright">
|
<span class="layui-icon layui-icon-search imgicon"></span>
|
<span class="imgtitle">末检</span>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row layui-col-space10">
|
<div class="layui-col-sm12 layui-col-md4" onclick="OpenInSpection(event,this)">
|
<div class="cnt bottomright">
|
<span class="layui-icon layui-icon-release imgicon"></span>
|
<span class="imgtitle">报检申请</span>
|
</div>
|
</div>
|
<div class="layui-col-sm12 layui-col-md4" onclick="OpenMaterToSource(event,this)">
|
<div class="cnt bottomright">
|
<span class="layui-icon layui-icon-engine imgicon"></span>
|
<span class="imgtitle">上料防错</span>
|
</div>
|
</div>
|
<div class="layui-col-sm12 layui-col-md4" onclick="BadGather(event,this)">
|
<div class="cnt bottomright">
|
<span class="layui-icon layui-icon-chart imgicon"></span>
|
<span class="imgtitle">不良采集</span>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row layui-col-space10">
|
<div class="layui-col-sm12 layui-col-md4" onclick="OpenStop(event,this)">
|
<div class="cnt bottomright">
|
<span class="layui-icon layui-icon-pause imgicon"></span>
|
<span class="imgtitle">停工</span>
|
</div>
|
</div>
|
<div class="layui-col-sm12 layui-col-md4" onclick="Abnormal(event,this)">
|
<div class="cnt bottomright">
|
<span class="layui-icon layui-icon-unlink imgicon"></span>
|
<span class="imgtitle">异常申请</span>
|
</div>
|
</div>
|
<div class="layui-col-sm12 layui-col-md4" onclick="Esc(event,this)">
|
<div class="cnt bottomright">
|
<span class="layui-icon layui-icon-close imgicon"></span>
|
<span class="imgtitle">退出</span>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row layui-col-space10">
|
<div class="layui-col-sm12 layui-col-md4" onclick="CurrentStatus(event,this)">
|
<div class="cnt bottomright">
|
<span class="layui-icon layui-icon-console imgicon"></span>
|
<span class="imgtitle">当前状态</span>
|
</div>
|
</div>
|
<div class="layui-col-sm12 layui-col-md4" onclick="CodingReport(event,this)">
|
<div class="cnt bottomright">
|
<span class="layui-icon layui-icon-console imgicon"></span>
|
<span class="imgtitle">当前工单(汇报)</span>
|
</div>
|
</div>
|
<div class="layui-col-sm12 layui-col-md4" onclick="BeginDotCheck(event,this)">
|
<div class="cnt bottomright">
|
<span class="layui-icon layui-icon-search imgicon"></span>
|
<span class="imgtitle">设备启动点检</span>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row layui-col-space10">
|
<div class="layui-col-sm12 layui-col-md4" onclick="PreventErrMouldCheck(event,this)">
|
<div class="cnt bottomright">
|
<span class="layui-icon layui-icon-engine imgicon"></span>
|
<span class="imgtitle">防错验证</span>
|
</div>
|
</div>
|
<div class="layui-col-sm12 layui-col-md4" onclick="TakeSample(event,this)">
|
<div class="cnt bottomright">
|
<span class="layui-icon layui-icon-form imgicon"></span>
|
<span class="imgtitle">检验取样</span>
|
</div>
|
</div>
|
<div class="layui-col-sm12 layui-col-md4" onclick="TechParam(event,this)">
|
<div class="cnt bottomright">
|
<span class="layui-icon layui-icon-tabs imgicon"></span>
|
<span class="imgtitle">工艺参数点检</span>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row layui-col-space10">
|
<div class="layui-col-sm12 layui-col-md4" onclick="SingErrMsg(event,this)">
|
<div class="cnt bottomright">
|
<span class="layui-icon layui-icon-layer imgicon"></span>
|
<span class="imgtitle">异常签到处理</span>
|
</div>
|
</div>
|
<div class="layui-col-sm12 layui-col-md4" onclick="ErrMsgBackCheck(event,this)">
|
<div class="cnt bottomright">
|
<span class="layui-icon layui-icon-layer imgicon"></span>
|
<span class="imgtitle">异常验收</span>
|
</div>
|
</div>
|
<div class="layui-col-sm12 layui-col-md4" onclick="SubtleFlaw(event,this)">
|
<div class="cnt bottomright">
|
<span class="layui-icon layui-icon-log imgicon"></span>
|
<span class="imgtitle">微瑕品汇报</span>
|
</div>
|
</div>
|
</div>-->
|
<!--数据插入动态按钮SQL,然后此页面写点击事件即可,网页绑定新按钮即可使用-->
|
<!--insert into Gy_BGButtons (HNumber,HName,HIcno,HOnclick,HSize,HOrder) values ('按钮代码','按钮名字','按钮图标','按钮点击事件','按钮默认大小,默认是中(大,中,小)','按钮默认排序 默认0')-->
|
|
<div class="layui-row layui-col-space10" id="button-container">
|
|
</div>
|
</div>
|
</fieldset>
|
</div>
|
</div>
|
</div>
|
<script>
|
var wktag = 0;
|
var workcode = ""; //工单号
|
var HDeptID = ""; //车间ID
|
var HDept = ""; //车间
|
var HSourceID = ""; //生产资源ID
|
var HSourceName = ""; //生产资源
|
var HSourceID1 = ""; //生产资源ID1
|
var HSourceName1 = ""; //生产资源1
|
var HSourceInterID = ""; //源单主内码
|
var HProcExchInterID = ""; //流转卡id
|
var HSourceEntryID = ""; //源单子内码
|
var HSourceBillNo = ""; //源单单号
|
var HSourceBillType = ""; //源单类型
|
var HICMOInterID = ""; //生产订单主内码
|
var HICMOEntryID = ""; //生产订单子内码
|
var HICMOBillNo = ""; //任务单号
|
var HMaterName = ""; //产品名称
|
var HMaterID = 0; //产品ID
|
var HProQty = []; //时间点产量
|
var HBadQty = []; //不良数量
|
var HBadReason = []; //不良原因
|
var HEmpName = ""; //操作员
|
var HManagerID = 0;
|
var HManagerName = ""; //负责人
|
var HGroupID = 0; //班组ID
|
var HGroupName = ""; //班组
|
var HProcID = 0; //工序
|
var HSBName = ""; //设备名称
|
|
//注意:选项卡 依赖 element 模块,否则无法进行功能性操作
|
layui.config({
|
base: '../../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).use(['index', 'form', 'laydate', 'table', 'element'], function () {
|
var $ = layui.$
|
, admin = layui.admin
|
, layer = layui.layer
|
, table = layui.table
|
, form = layui.form
|
, laydate = layui.laydate
|
, element = layui.element;
|
var params = get_UrlVars();
|
var OperationType = 0;
|
var linterid = 0;
|
if (typeof (params[params[0]]) == "undefined") {
|
parent.location.href = "../../../views/index_Mobile.html";
|
} else {
|
OperationType = params[params[0]];//操作类型
|
linterid = params[params[1]];//源单id
|
HGroupID = params[params[2]];//班组ID
|
}
|
fetchButtonsData();
|
fetchListData(linterid);
|
});
|
|
//加载当前用户按钮
|
function fetchButtonsData() {
|
$.ajax({
|
url: GetWEBURL() + '/ReportPlatForm/getButtonlist',
|
type: "GET",
|
data: { "user": sessionStorage["HUserName"] },
|
success: function (data1) {
|
if (data1.data && data1.data.length > 0) {
|
// 清空现有内容
|
$("#button-container").empty();
|
var colClass = ''; // 动态设置列的样式
|
let largestColClass = 'layui-col-xs4'; // 默认新增按钮大小(假设最多是 3 个按钮一排)
|
|
// 遍历每个按钮数据并生成对应的 HTML
|
data1.data.forEach(function (buttonData, index) {
|
// 根据 defaultSize 字段选择合适的列宽
|
switch (buttonData.按钮大小) {
|
case '小':
|
colClass = 'layui-col-xs4'; // 一排4个
|
break;
|
case '中':
|
colClass = 'layui-col-xs4'; // 一排3个
|
break;
|
case '大':
|
colClass = 'layui-col-xs6'; // 一排2个
|
break;
|
default:
|
colClass = 'layui-col-md4'; // 默认设置为中等大小(3个一排)
|
}
|
|
// 更新最大列宽:取最大列宽
|
if (colClass === 'layui-col-md6') {
|
largestColClass = colClass; // 如果当前列宽是 'layui-col-md6',说明是最宽的
|
} else if (colClass === 'layui-col-md4' && largestColClass !== 'layui-col-md6') {
|
largestColClass = colClass; // 默认列宽为 'layui-col-md4',小于 'layui-col-md6'
|
} else if (colClass === 'layui-col-md3' && largestColClass === 'layui-col-md4') {
|
largestColClass = colClass; // 如果当前列宽是 'layui-col-md3',小于 'layui-col-md4'
|
}
|
|
var html = '';
|
html += '<div class="' + colClass + '" id="btn' + index + '">';
|
html += ' <div class="cnt bottomright" id="button' + index + '" onclick="' + buttonData.事件名称 + '(event, this)">';
|
html += ' <span class="layui-icon ' + buttonData.图标 + ' imgicon"></span>';
|
html += ' <span class="imgtitle">' + buttonData.名称 + '</span>';
|
html += ' </div>';
|
html += ' <span class="layui-icon layui-icon-delete delete" onclick="deleteButton(event, \'' + buttonData.HItemID + '\')"></span>'; // 修改删除按钮事件,传递 id1 和 id2
|
html += '</div>';
|
// 将生成的 HTML 追加到 #button-container
|
$("#button-container").append(html);
|
});
|
|
// 添加一个新增按钮
|
var html1 = '';
|
html1 += '<div class="layui-col-sm12 ' + largestColClass + '">';
|
html1 += ' <div class="cnt bottomright">';
|
html1 += ' <span class="layui-icon layui-icon-addition imgtitle" onclick="Add_Buttton(event,this,1)"></span>';
|
html1 += ' </div>';
|
html1 += '</div>';
|
|
$("#button-container").append(html1);
|
} else {
|
// 如果没有按钮数据,展示默认的空白新增按钮
|
var html1 = '';
|
html1 += '<div class="layui-col-sm12 layui-col-xs4">';
|
html1 += ' <div class="cnt bottomright">';
|
html1 += ' <span class="layui-icon layui-icon-addition imgtitle" onclick="Add_Buttton(event,this,1)"></span>';
|
html1 += ' </div>';
|
html1 += '</div>';
|
$("#button-container").append(html1);
|
}
|
},
|
error: function (error) {
|
console.log('获取按钮数据失败', error);
|
}
|
});
|
}
|
|
//加载工单列表
|
//选中资源
|
function fetchListData(HSourceID) {
|
if (HSourceID != "0" && HSourceID != null && HSourceID!="") {
|
$('.ctop').removeClass('check'); //删除不同父级clss样式相同的所有元素
|
//执行联动事件
|
$.ajax({
|
url: GetWEBURL() + "/ReportPlatForm/SearchGetWorkBillList",
|
type: "GET",
|
data: { "HSourceID": HSourceID },
|
dataType: "json",//数据类型可以为 text xml json script jsonp
|
success: function (data) {
|
|
var LoadData1 = data.data.h_p_JIT_GetWorkBillListInfoBySource;
|
if (LoadData1.length > 0) //工单列表数据
|
{
|
|
for (var i = 0; i < LoadData1.length; i++) {
|
var html1 = '';
|
//汇报总数大于计划数量,调整背景色提示
|
if (LoadData1[i].HDateFinishQty > LoadData1[i].HDatePlanQty) {
|
html1 += '<div class="layui-col-sm12 layui-col-md3" style="background-color:#F595A0;border-radius: 3%;">';
|
} else {
|
html1 += '<div class="layui-col-sm12 layui-col-md3">';
|
}
|
html1 += '<div class="cns" id="bs' + (i + 1) + '" onclick="CheckBtom(this,' + (i + 1) + ')">';
|
html1 += '<dl>';
|
html1 += '<dd class="tcenter">';
|
html1 += '<h1 style="display:none;"><span>单据类型:</span><span id="ty' + (i + 1) + '">' + LoadData1[i].HBillType + '</span></h1>';
|
//HSourceInterID实际取值:Sc_ICMOBillStatus_Tmp HInterID(单据主ID)
|
html1 += '<h1 style="display:none;"><span>源单主内码:</span><span id="sm' + (i + 1) + '">' + LoadData1[i].HSourceInterID + '</span></h1>';
|
html1 += '<h1 style="display:none;"><span>流转卡主ID:</span><span id="lzk' + (i + 1) + '">' + LoadData1[i].HProcExchInterID + '</span></h1>';
|
html1 += '<h1 style="display:none;"><span>源单子内码:</span><span id="sb' + (i + 1) + '">' + LoadData1[i].HSourceEntryID + '</span></h1>';
|
html1 += '<h1 style="display:none;"><span>源单单号:</span><span id="sw' + (i + 1) + '">' + LoadData1[i].HSourceBillNo + '</span></h1>';
|
html1 += '<h1 style="display:none;"><span>源单类型:</span><span id="st' + (i + 1) + '">' + LoadData1[i].HSourceBillType + '</span></h1>';
|
html1 += '<h1 style="display:none;"><span>生产订单号主ID:</span><span id="df' + (i + 1) + '">' + LoadData1[i].HICMOInterID + '</span></h1>';
|
html1 += '<h1 style="display:none;"><span>生产订单子ID:</span><span id="ds' + (i + 1) + '">' + LoadData1[i].HICMOEntryID + '</span></h1>';
|
|
|
html1 += '<h1><span>工单号:</span><span id="wk' + (i + 1) + '">' + LoadData1[i].HICMOBillNo + '</span><span style="margin-left:25px;">日期:</span><span>' + LoadData1[i].计划日期 + '</span></h1>';
|
html1 += '<h1 style="display:none;"><span>产品ID:</span><span id="materid' + (i + 1) + '">' + LoadData1[i].HMaterID + '</span></h1>';
|
html1 += '<h1 style="display:none;"><span>工序ID:</span><span id="procid' + (i + 1) + '">' + LoadData1[i].HProcID + '</span></h1>';
|
html1 += '<h1><span>产品名称:</span><span id="ptn' + (i + 1) + '">[' + LoadData1[i].HMaterNumber + ']-[' + LoadData1[i].HMaterName + ']</span></h1>';
|
html1 += '<h1><span>产品型号:</span><span id="pts' + (i + 1) + '">' + LoadData1[i].HModel + '</span></h1>';
|
html1 += '<h1><span>计划数量:</span><span>' + LoadData1[i].HDatePlanQty + '</span><span style="margin-left:20px;">汇报总数:</span><span>' + LoadData1[i].HDateFinishQty + '</span></h1>';
|
switch (LoadData1[i].HICMOStatus) {
|
case "待生产":
|
html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border3"></span><span>' + LoadData1[i].HICMOStatus + '</span><span style="margin-left:5px;">领料状态:</span><span>' + LoadData1[i].领料状态 + '</span></h1>';
|
break;
|
case "生产中":
|
html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border2"></span><span>' + LoadData1[i].HICMOStatus + '</span><span style="margin-left:5px;">领料状态:</span><span>' + LoadData1[i].领料状态 + '</span></h1>';
|
break;
|
case "挂起":
|
html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border1"></span><span>' + LoadData1[i].HICMOStatus + '</span><span style="margin-left:5px;">领料状态:</span><span>' + LoadData1[i].领料状态 + '</span></h1>';
|
break;
|
case "完工":
|
html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border4"></span><span>' + LoadData1[i].HICMOStatus + '</span><span style="margin-left:5px;">领料状态:</span><span>' + LoadData1[i].领料状态 + '</span></h1>';
|
break;
|
}
|
html1 += '<span class="prs">生产进度:</span>';
|
html1 += '<div class="layui-progress layui-progress-big" lay-showPercent="yes">';
|
html1 += '<div class="layui-progress-bar" lay-percent="' + ((LoadData1[i].HDateFinishQty / LoadData1[i].HDatePlanQty) * 100).toFixed(2) + '%" style="width:' + ((LoadData1[i].HDateFinishQty / LoadData1[i].HDatePlanQty) * 100).toFixed(2) + '%;">';
|
html1 += '<span class="layui-progress-text">' + ((LoadData1[i].HDateFinishQty / LoadData1[i].HDatePlanQty) * 100).toFixed(2) + '%</span>';
|
html1 += '</div > ';
|
html1 += '</div>';
|
html1 += '</dd>';
|
html1 += '</dl>';
|
html1 += '</div>';
|
html1 += '</div>';
|
$("#btomleft").append(html1);
|
}
|
}
|
},
|
error: function (err) {
|
layer.alert(err.Message, { time: 1 * 2000, icon: 5 });
|
return false;
|
}
|
});
|
}
|
}
|
|
// 删除按钮的事件处理函数
|
function deleteButton(event, HItemID) {
|
event.stopPropagation(); // 防止事件冒泡,避免触发按钮的点击事件
|
//逻辑删除方法
|
layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
|
$.ajax({
|
url: GetWEBURL() + "/ReportPlatForm/DeleteButtonlist",
|
type: "GET",
|
data: { "HItemID": HItemID },
|
dataType: "json",//数据类型可以为 text xml json script jsonp
|
success: function (data) {
|
if (data.count > 0) {
|
fetchButtonsData(); //执行查询过程
|
layer.close(index);
|
layer.msg(data.Message, { time: 1 * 2000, icon: 1 });
|
return false;
|
}
|
else {
|
layer.alert(data.Message, { time: 1 * 2000, icon: 5 });
|
return false;
|
}
|
},
|
error: function (err) {
|
layer.alert(err.Message, { time: 1 * 2000, icon: 5 });
|
return false;
|
}
|
});
|
})
|
}
|
|
//添加按钮
|
function Add_Buttton(event, obj, i) {
|
event.stopPropagation(); //阻止冒泡
|
//页面层-自定义
|
layer.open({
|
type: 2 //此处以iframe举例
|
, title: '按钮绑定'
|
, area: ['90%', '90%']
|
, shadeClose: false //开启遮罩关闭
|
, shade: 0.5
|
, maxmin: true
|
, content: ['../../生产管理/报工平台功能页/LineBind_Button.html', 'yes']
|
, btn: ['确定', '取消']
|
, btn1: function (index, layero, e) {
|
|
//按钮【按钮一】的回调
|
var body = layer.getChildFrame('body', index); //得到iframe页的body内容
|
|
var HUserName = sessionStorage["HUserName"];
|
var HButtonID = body.find("#HButtonID").val();
|
var HButtonName = body.find("#HName").val();
|
var HButtonSize = body.find("#HButtonSize").val();
|
var HButtonOrder = body.find("#HButtonOrder").val();
|
$.ajax(
|
{
|
url: GetWEBURL() + "/ReportPlatForm/AddButtonlist", //方法所在页面和方法名
|
dataType: "json",
|
type: "Get",
|
async: false,
|
data: {
|
"HUserName": HUserName,
|
"HButtonID": HButtonID,
|
"HButtonName": HButtonName,
|
"HButtonSize": HButtonSize,
|
"HButtonOrder": HButtonOrder
|
|
},
|
success: function (data) {
|
if (data.count == 1) { // 说明验证成功了,
|
fetchButtonsData(); //执行查询过程
|
layer.close(index);
|
layer.msg(data.Message, { time: 1 * 2000, icon: 1 });
|
return false;
|
}
|
else {
|
layer.close(index);
|
layer.alert(data.Message, { icon: 5 });
|
return false;
|
|
}
|
},
|
error: function (err) {
|
layer.alert(err.Message, { time: 1 * 2000, icon: 5 });
|
return false;
|
}
|
});
|
}
|
, btn2: function (index, layero) {
|
//按钮【按钮二】的回调
|
//return false 开启该代码可禁止点击该按钮关闭
|
}
|
|
, zIndex: layer.zIndex //重点1
|
, success: function (layero, index) {
|
|
}
|
, end: function () {
|
|
}
|
});
|
|
}
|
|
//工单列表选中
|
function CheckBtom(obj, i) {
|
var partid = $(obj).parent().attr("id"); //获取父级id
|
workcode = $("#wk" + i + "").html(); //通过样式ID获取html内容(工单号)
|
HBillType = $("#ty" + i + "").html(); //通过样式ID获取html内容(单据类型)
|
HSourceInterID = $("#sm" + i + "").html(); //通过样式ID获取html内容(源单主内码)
|
HProcExchInterID = $("#lzk" + i + "").html(); //流转卡ID
|
HSourceEntryID = $("#sb" + i + "").html(); //通过样式ID获取html内容(源单子内吗)
|
HSourceBillNo = $("#sw" + i + "").html(); //通过样式ID获取html内容(源单单号)
|
HSourceBillType = $("#st" + i + "").html(); //通过样式ID获取html内容(源单类型)
|
HICMOInterID = $("#df" + i + "").html(); //生产订单主内码
|
HICMOEntryID = $("#ds" + i + "").html(); //生产订单子内码
|
HICMOBillNo = $("#wk" + i + "").html(); //生产订单号
|
HMaterName = $("#ptn" + i + "").html(); //产品名称
|
HMaterID = $("#materid" + i + "").html(); //产品ID
|
HProcID = $("#procid" + i + "").html(); //工序ID
|
|
if (workcode != "" && workcode != null) {
|
$('.cns').removeClass('check1'); //删除不同父级clss样式相同的所有元素
|
$("#bs" + i + "").addClass('check1'); // 添加当前元素的样式
|
wktag = 1;
|
}
|
}
|
|
//非空验证
|
function AllowLoadData(body) { //非空验证
|
var Result = true;
|
if (body.find("#HSourceID").val() == '' || body.find("#HSourceID").val() == null) {
|
layer.msg("生产资源不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return Result = false;
|
}
|
if (body.find("#HManagerID").val() == '' || body.find("#HManagerID").val() == null) {
|
layer.msg("负责人不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return Result = false;
|
}
|
if (body.find("#HGroupID").val() == '' || body.find("#HGroupID").val() == null) {
|
layer.msg("班组不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return Result = false;
|
}
|
if (body.find("#HCreateDate").val() == '' || body.find("#HCreateDate").val() == null) {
|
layer.msg("创建日期不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return Result = false;
|
}
|
return Result;
|
}
|
|
//将s转化为时分秒格式 h:m:s
|
function getSeconds(s) {
|
var sTime = parseInt(s);// 秒
|
var mTime = 0;// 分
|
var hTime = 0;// 时
|
if (sTime > 60) {//如果秒数大于60,将秒数转换成整数
|
//获取分钟,除以60取整数,得到整数分钟
|
mTime = parseInt(sTime / 60);
|
//获取秒数,秒数取佘,得到整数秒数
|
sTime = parseInt(sTime % 60);
|
//如果分钟大于60,将分钟转换成小时
|
if (mTime > 60) {
|
//获取小时,获取分钟除以60,得到整数小时
|
hTime = parseInt(mTime / 60);
|
//获取小时后取佘的分,获取分钟除以60取佘的分
|
mTime = parseInt(mTime % 60);
|
}
|
}
|
var result = '';
|
if (sTime >= 0 && sTime < 10) {
|
result = "0" + parseInt(sTime) + "";
|
} else {
|
result = "" + parseInt(sTime) + "";
|
}
|
if (mTime >= 0 && mTime < 10) {
|
result = "0" + parseInt(mTime) + ":" + result;
|
} else {
|
result = "" + parseInt(mTime) + ":" + result;
|
}
|
if (hTime >= 0 && hTime < 10) {
|
result = "0" + parseInt(hTime) + ":" + result;
|
} else {
|
result = "" + parseInt(hTime) + ":" + result;
|
}
|
return result;
|
}
|
|
//开工按钮点击事件
|
function OpenWork(event, obj) {
|
if (wktag == 0) {
|
layer.alert("请选择工单列表", { icon: 5 });
|
return false;
|
}
|
if (WorkStaus(HSourceID1, workcode, HSourceInterID, "开工")) {
|
layer.alert("单据状态不满足开工条件!", { icon: 5 });
|
return false;
|
}
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '新增开工单',
|
closeBtn: 1,
|
shift: 2,
|
area: ['100%', '100%'],
|
maxmin: true,
|
content: '../../生产管理/报工平台_PDA/开工/Sc_Add_MESBeginWorkBillList_PDA.html?OperationType=2&linterid=&HSouceBillType=',
|
end: function () {
|
|
},
|
success: function (dom, index) {
|
var data = [];
|
data.push({
|
"HBillType": HBillType,
|
"HSourceInterID": HSourceInterID,
|
"HSourceEntryID": HSourceEntryID,
|
"HSourceBillNo": HSourceBillNo,
|
"HSourceBillType": HSourceBillType,
|
"HGroupID": HGroupID
|
});
|
|
//通过索引获取到当前iframe弹出层
|
var iframe = window['layui-layer-iframe' + index];
|
//调用iframe弹出层内的方法
|
iframe.edit(data);
|
},
|
});
|
}
|
|
//快速开工
|
function KSOpenWork(event, obj) {
|
if (wktag == 0) {
|
layer.alert("请选择工单列表", { icon: 5 });
|
return false;
|
}
|
if (WorkStaus(HSourceID1, workcode, HSourceInterID, "开工")) {
|
layer.alert("单据状态不满足开工条件!", { icon: 5 });
|
return false;
|
}
|
var indexOpen = layer.open({
|
type: 1
|
, title: "确认开工吗?"
|
, closeBtn: false
|
, area: '300px;'
|
, shade: 0.8
|
, id: 'LAY_layuipro' //设定一个id,防止重复弹出
|
, btn: ['确定', '取消']
|
, btnAlign: 'c'
|
, moveType: 1 //拖拽模式,0或者1
|
, content: '<div style="padding: 50px; line-height: 22px; font-weight: 300;text-align:center;">设备编号:' + HSourceName1 + '<br>工单号:' + workcode + '<br>产品名称:' + HMaterName + '<br></div>'
|
, btn1: function (index, layero, e) {
|
|
//新增开工单
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Sc_MESBeginWorkBill/SaveGetMESBeginWorkFrom_KS", //方法所在页面和方法名
|
data: { "HBillType": HBillType, "HSourceInterID": HSourceInterID, "HSourceEntryID": HSourceEntryID, "HSourceBillNo": HSourceBillNo, "user": sessionStorage["HUserName"], "HSourceBillType": HSourceBillType },
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
|
// 得到frame索引
|
var index = layer.getFrameIndex(window.name);
|
//关闭当前frame
|
layer.close(index);
|
//修改为功后刷新界面
|
//window.location.reload();
|
});
|
layer.close(indexOpen);
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
});
|
}
|
|
//SOP 作业指导书
|
function SOP(event, obj) {
|
if (wktag == 0) {
|
layer.alert("请选择工单列表", { icon: 5 });
|
return false;
|
}
|
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '作业指导书',
|
closeBtn: 1,
|
shift: 2,
|
area: ['95%', '95%'],
|
maxmin: true,
|
content: '生产管理/作业指导书/Gy_SOPBill_Video.html?OperationType=5&HMaterID=' + HMaterID + '&HSourceNo=' + workcode + '&HSourceEntryID=' + HSourceEntryID + '&HProcID=' + HProcID,
|
end: function () {
|
|
},
|
});
|
|
/* window.open("../../../views/生产管理/作业指导书/Gy_SOPBill_Video.html?OperationType=5&HMaterID=" + HMaterID + "&HSourceNo=" + workcode + "&HSourceEntryID=" + HSourceEntryID);*/
|
}
|
|
//汇报按钮点击事件
|
function OpenReport(event, obj) {
|
if (wktag == 0) {
|
layer.alert("请选择工单列表", { icon: 5 });
|
return false;
|
}
|
if (WorkStaus(HSourceID1, workcode, HSourceInterID, "汇报")) {
|
layer.alert("单据状态不满足汇报条件!", { icon: 5 });
|
return false;
|
}
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '新增产量汇报单',
|
closeBtn: 1,
|
shift: 2,
|
area: ['100%', '100%'],
|
maxmin: true,
|
content: '../../生产管理/报工平台_PDA/产量汇报/Sc_Add_ProductReportBillList_PDA.html?OperationType=2&linterid=&HSouceBillType=',
|
end: function () {
|
|
},
|
success: function (dom, index) {
|
var data = [];
|
data.push({
|
"HBillType": HBillType,
|
"HSourceInterID": HSourceInterID,
|
"HSourceEntryID": HSourceEntryID,
|
"HSourceBillNo": HSourceBillNo,
|
"HSourceBillType": HSourceBillType,
|
"HGroupID": HGroupID
|
});
|
|
//通过索引获取到当前iframe弹出层
|
var iframe = window['layui-layer-iframe' + index];
|
//调用iframe弹出层内的方法
|
iframe.edit(data);
|
},
|
});
|
}
|
//完工单按钮点击事件
|
function OpenEnd(event, obj) {
|
if (wktag == 0) {
|
layer.alert("请选择工单列表", { icon: 5 });
|
return false;
|
}
|
if (WorkStaus(HSourceID1, workcode, HSourceInterID, "完工")) {
|
layer.alert("单据状态不满足完工条件!", { icon: 5 });
|
return false;
|
}
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '新增完工单',
|
closeBtn: 1,
|
shift: 2,
|
area: ['100%', '100%'],
|
maxmin: true,
|
content: '../../生产管理/报工平台_PDA/完工/Sc_Add_MESEndWorkBillList_PDA.html?OperationType=2&linterid=&HSouceBillType=',
|
end: function () {
|
|
},
|
success: function (dom, index) {
|
var data = [];
|
data.push({
|
"HBillType": HBillType,
|
"HSourceInterID": HSourceInterID,
|
"HSourceEntryID": HSourceEntryID,
|
"HSourceBillNo": HSourceBillNo,
|
"HSourceBillType": HSourceBillType,
|
"HGroupID": HGroupID
|
});
|
|
//通过索引获取到当前iframe弹出层
|
var iframe = window['layui-layer-iframe' + index];
|
//调用iframe弹出层内的方法
|
iframe.edit(data);
|
},
|
});
|
}
|
//停工单按钮点击事件
|
function OpenStop(event, obj) {
|
if (wktag == 0) {
|
layer.alert("请选择工单列表", { icon: 5 });
|
return false;
|
}
|
if (WorkStaus(HSourceID1, workcode, HSourceInterID, "停工")) {
|
layer.alert("单据状态不满足停工条件!", { icon: 5 });
|
return false;
|
}
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '新增停工单',
|
closeBtn: 1,
|
shift: 2,
|
area: ['100%', '100%'],
|
maxmin: true,
|
content: '../../生产管理/报工平台_PDA/停工/Sc_Add_MESStopWorkBillList_PDA.html?OperationType=2&linterid=&HSouceBillType=',
|
end: function () {
|
|
},
|
success: function (dom, index) {
|
var data = [];
|
data.push({
|
"HBillType": HBillType,
|
"HSourceInterID": HSourceInterID,
|
"HSourceEntryID": HSourceEntryID,
|
"HSourceBillNo": HSourceBillNo,
|
"HSourceBillType": HSourceBillType,
|
"HGroupID": HGroupID
|
});
|
|
//通过索引获取到当前iframe弹出层
|
var iframe = window['layui-layer-iframe' + index];
|
//调用iframe弹出层内的方法
|
iframe.edit(data);
|
},
|
});
|
}
|
|
//报检申请按钮点击事件
|
function OpenInSpection(event, obj) {
|
if (wktag == 0) {
|
layer.alert("请选择工单列表", { icon: 5 });
|
return false;
|
}
|
|
var IsCheck = false;
|
|
//根据系统参数控制,判断生产订单是否做了首件检验单和工序检验单,如果有其中一种检验单没做,则不让做生产汇报单
|
$.ajax({
|
url: GetWEBURL() + "/ReportPlatForm/IsCheck",
|
type: "GET",
|
data: { "HICMOInterID": HICMOInterID, "HICMOEntryID": HICMOEntryID, "HICMOBillNo": HICMOBillNo },
|
async: false,
|
success: function (data) {
|
if (data.code == 0) {
|
layer.alert(data.Message);
|
return false;
|
} else {
|
IsCheck = true;
|
}
|
},
|
error: function (err) {
|
layer.alert(data.Message);
|
return false;
|
}
|
});
|
|
if (IsCheck == true) {
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '产量汇报列表',
|
closeBtn: 1,
|
shift: 2,
|
area: ['100%', '100%'],
|
maxmin: true,
|
content: '生产管理/产量汇报单/Sc_ProductReportBillList.html?OperationType=2&linterid=&HSouceBillType=',
|
end: function () {
|
|
},
|
success: function (dom, index) {
|
var data = [];
|
data.push({
|
"workcode": workcode,
|
"HSourceID": HSourceID1,
|
"HSourceName": HSourceName1,
|
"HICMOInterID": HICMOInterID,
|
"HICMOEntryID": HICMOEntryID,
|
"HMaker": sessionStorage["HUserName"], //sessionStorage["HUserName"]
|
"Czybm": sessionStorage["Czybm"],
|
//"HEmpID": "0", //sessionStorage["HEmpID"]
|
"HSourceBillType": HSourceBillType
|
});
|
|
//通过索引获取到当前iframe弹出层
|
var iframe = window['layui-layer-iframe' + index];
|
//调用iframe弹出层内的方法
|
iframe.edit(data);
|
},
|
});
|
}
|
|
|
}
|
|
//上料防错单
|
function OpenMaterToSource() {
|
if (wktag == 0) {
|
layer.alert("请选择工单列表", { icon: 5 });
|
return false;
|
}
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '新增上料防错单',
|
closeBtn: 1,
|
shift: 2,
|
area: ['100%', '100%'],
|
maxmin: true,
|
content: '生产管理/上料防错单/Sc_Add_MaterToSourceBillList.html?OperationType=2&linterid=&HSouceBillType=',
|
end: function () {
|
|
},
|
success: function (dom, index) {
|
var data = [];
|
data.push({
|
"HBillType": HBillType,
|
"HSourceInterID": HSourceInterID,
|
"HSourceEntryID": HSourceEntryID,
|
"HSourceBillNo": HSourceBillNo,
|
"HSourceBillType": HSourceBillType
|
});
|
|
//通过索引获取到当前iframe弹出层
|
var iframe = window['layui-layer-iframe' + index];
|
//调用iframe弹出层内的方法
|
iframe.edit(data);
|
},
|
});
|
}
|
|
//首检检验
|
function OpenFistCheck(event, obj) {
|
if (wktag == 0) {
|
layer.alert("请选择工单列表", { icon: 5 });
|
return false;
|
}
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '首件检验单-编辑'
|
, shade: 0.6
|
, maxmin: false
|
, anim: 0
|
, content: ['质量管理/首件检验单/QC_Add_Edit_FirstPieceCheckBill.html?OperationType=2&linterid=' + HProcExchInterID + '&HSouceBillType=' + HBillType + '&HICMOEntryID=' + HICMOEntryID + '&HSourceEntryID=' + HSourceEntryID + '', 'yes']
|
, resize: false
|
, cancel: function () {
|
}
|
, end: function () {
|
|
}
|
})
|
}
|
|
//过程检验
|
function OpenProcess(event, obj) {
|
if (wktag == 0) {
|
layer.alert("请选择工单列表", { icon: 5 });
|
return false;
|
}
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '巡检检验单-编辑'
|
, shade: 0.6
|
, maxmin: false
|
, anim: 0
|
, content: ['质量管理/巡检记录单/QC_Add_Edit_PatrolProcCheckOtherill.html?OperationType=2&linterid=' + HProcExchInterID + '&HSouceBillType=' + HBillType + '&HICMOEntryID=' + HICMOEntryID + '&HSourceEntryID=' + HSourceEntryID + '', 'yes']
|
, resize: false
|
, cancel: function () {
|
|
}
|
, end: function () {
|
|
}
|
})
|
}
|
//末检
|
function ProcessCheck(event, obj) {
|
if (wktag == 0) {
|
layer.alert("请选择工单列表", { icon: 5 });
|
return false;
|
}
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '工序检验单-编辑'
|
, shade: 0.6
|
, maxmin: false
|
, anim: 0
|
, content: ['质量管理/工序检验单/QC_ProcessCheckBill.html?OperationType=2&linterid=' + HProcExchInterID + '&HSouceBillType=' + HBillType + '&HICMOEntryID=' + HICMOEntryID + '&HSourceEntryID=' + HSourceEntryID + '', 'yes']
|
, resize: false
|
, cancel: function () {
|
|
}
|
, end: function () {
|
|
}
|
})
|
}
|
|
//不良采集
|
function BadGather() {
|
if (wktag == 0) {
|
layer.alert("请选择工单列表", { icon: 5 });
|
return false;
|
}
|
if (WorkStaus(HSourceID1, workcode, HSourceInterID, "不良采集")) {
|
layer.alert("单据状态不满足不良采集条件!", { icon: 5 });
|
return false;
|
}
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '质量汇报单-编辑'
|
, shade: 0.6
|
, maxmin: false
|
, anim: 0
|
, content: ['../../生产管理/报工平台_PDA/质量汇报/Sc_QualityReportBill_PDA.html?OperationType=2&linterid=' + HSourceInterID + '&HSouceBillType=' + HBillType + '&HICMOEntryID=' + HSourceEntryID, 'yes']
|
, resize: false
|
, cancel: function () {
|
}
|
, end: function () {
|
}
|
,success: function (dom, index) {
|
var data = [];
|
data.push({
|
"HBillType": HBillType,
|
"HSourceInterID": HSourceInterID,
|
"HSourceEntryID": HSourceEntryID,
|
"HSourceBillNo": HSourceBillNo,
|
"HSourceBillType": HSourceBillType,
|
"HGroupID": HGroupID
|
});
|
|
//通过索引获取到当前iframe弹出层
|
var iframe = window['layui-layer-iframe' + index];
|
//调用iframe弹出层内的方法
|
iframe.edit(data);
|
},
|
})
|
}
|
|
|
//微瑕品汇报
|
function SubtleFlaw() {
|
if (wktag == 0) {
|
layer.alert("请选择工单列表", { icon: 5 });
|
return false;
|
}
|
if (WorkStaus(HSourceID1, workcode, HSourceInterID, "微瑕品汇报")) {
|
layer.alert("单据状态不满足微瑕品汇报条件!", { icon: 5 });
|
return false;
|
}
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '微瑕品汇报单-编辑'
|
, shade: 0.6
|
, maxmin: false
|
, anim: 0
|
, content: ['生产管理/质量汇报单/Sc_QualityReportBill.html?OperationType=2&linterid=' + HSourceInterID + '&HSouceBillType=' + HBillType + '&HICMOEntryID=' + HSourceEntryID + '&HBillSubType=微瑕品', 'yes']
|
, resize: false
|
, cancel: function () {
|
|
}
|
, end: function () {
|
|
}
|
})
|
}
|
|
//当前工单按钮点击事件
|
function CurrentStatus(event, obj) {
|
if (wktag == 0) {
|
layer.alert("请选择工单列表", { icon: 5 });
|
return false;
|
}
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '当前工单',
|
closeBtn: 1,
|
shift: 2,
|
area: ['100%', '100%'],
|
maxmin: true,
|
content: '生产管理/工单/Sc_CurrentTicket.html?OperationType=2&linterid=&HSouceBillType=',
|
end: function () {
|
|
},
|
success: function (dom, index) {
|
var data = [];
|
data.push({
|
"HEquipName": $("#HEquipName1").text(),
|
"HEquipCode": $("#HEquipCode1").text(),
|
"HICMOBillNo": workcode,
|
"HICMOInterID": HICMOInterID,
|
"HICMOEntryID": HICMOEntryID,
|
"HSourceID": HSourceID1,
|
"HEmpName": HEmpName,
|
"HManagerName": HManagerName,
|
"HGroupName": HGroupName,
|
"HBillType": HBillType,
|
"HSourceInterID": HSourceInterID,
|
"HSourceEntryID": HSourceEntryID,
|
"HSourceBillNo": HSourceBillNo,
|
"HSourceBillType": HSourceBillType
|
});
|
|
//通过索引获取到当前iframe弹出层
|
var iframe = window['layui-layer-iframe' + index];
|
//调用iframe弹出层内的方法
|
iframe.edit(data);
|
},
|
|
|
});
|
}
|
|
|
//当前工单(汇报)按钮点击事件
|
function CodingReport(event, obj) {
|
if (wktag == 0) {
|
layer.alert("请选择工单列表", { icon: 5 });
|
return false;
|
}
|
if (WorkStaus(HSourceID1, workcode, HSourceInterID, "斯莫尔汇报")) {
|
layer.alert("单据状态不满足汇报条件!", { icon: 5 });
|
return false;
|
}
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '当前工单',
|
closeBtn: 1,
|
shift: 2,
|
area: ['100%', '100%'],
|
maxmin: true,
|
content: '车间管理/工序出站汇报单/Cj_StationOutBill_CurrentWork.html?OperationType=2&linterid=&HSouceBillType=',
|
end: function () {
|
|
},
|
success: function (dom, index) {
|
var data = [];
|
data.push({
|
"HEquipName": $("#HEquipName1").text(),
|
"HEquipCode": $("#HEquipCode1").text(),
|
"HICMOBillNo": workcode,
|
"HICMOInterID": HICMOInterID,
|
"HICMOEntryID": HICMOEntryID,
|
"HSourceID": HSourceID1,
|
"HSourceName": HSourceName1,
|
"HEmpName": HEmpName,
|
"HManagerID": HManagerID,
|
"HManagerName": HManagerName,
|
"HGroupName": HGroupName,
|
"HGroupID": HGroupID,
|
"HBillType": HBillType,
|
"HSourceInterID": HSourceInterID,
|
"HSourceEntryID": HSourceEntryID,
|
"HSourceBillNo": HSourceBillNo,
|
"HSourceBillType": HSourceBillType
|
});
|
|
//通过索引获取到当前iframe弹出层
|
var iframe = window['layui-layer-iframe' + index];
|
//调用iframe弹出层内的方法
|
iframe.edit(data);
|
},
|
|
|
});
|
}
|
|
//设备启动点检按钮点击事件
|
function BeginDotCheck(event, obj) {
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '新增设备启动点检单',
|
closeBtn: 1,
|
shift: 2,
|
area: ['100%', '100%'],
|
maxmin: true,
|
content: '车间管理/启动点检单/Sc_WorkBeginDotCheckBill.html?OperationType=4&linterid=&HSouceBillType=',
|
end: function () {
|
|
},
|
success: function (dom, index) {
|
var data = [];
|
data.push({
|
"HMaterID": HMaterID,
|
"HProcID": HProcID,
|
"HSourceID": HSourceID1,
|
"SCOrder": HSourceBillNo
|
});
|
|
//通过索引获取到当前iframe弹出层
|
var iframe = window['layui-layer-iframe' + index];
|
//调用iframe弹出层内的方法
|
iframe.edit(data);
|
},
|
});
|
}
|
|
//异常按钮点击事件
|
function Abnormal(event, obj) {
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '异常反馈类型',
|
closeBtn: 1,
|
shift: 2,
|
area: ['100%', '100%'],
|
maxmin: true,
|
content: '../../生产管理/异常反馈单/Sc_MESExecptFeedBackBillType.html',
|
end: function () {
|
|
},
|
success: function (dom, index) {
|
var data = [];
|
data.push({
|
"HICMOBillNo": HICMOBillNo,//工单号
|
"HSourceName": HSBName, //设备
|
"HSourceBillNo": HSourceBillNo //工序流转卡
|
});
|
|
//通过索引获取到当前iframe弹出层
|
var iframe = window['layui-layer-iframe' + index];
|
//调用iframe弹出层内的方法
|
iframe.edit(data);
|
},
|
});
|
}
|
|
//防错验证清单按钮点击事件
|
function PreventErrMouldCheck(event, obj) {
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '新增防错验证',
|
closeBtn: 1,
|
shift: 2,
|
area: ['100%', '100%'],
|
maxmin: true,
|
content: '车间管理/防错验证/Qc_PreventErrMouldCheckBill.html?OperationType=4&linterid=&HSouceBillType=',
|
end: function () {
|
|
},
|
success: function (dom, index) {
|
var data = [];
|
data.push({
|
"HMaterID": HMaterID,
|
"HProcID": HProcID,
|
"SCOrder": HSourceBillNo
|
});
|
|
//通过索引获取到当前iframe弹出层
|
var iframe = window['layui-layer-iframe' + index];
|
//调用iframe弹出层内的方法
|
iframe.edit(data);
|
},
|
});
|
}
|
|
//检验取样按钮点击事件
|
function TakeSample(event, obj) {
|
if (wktag == 0) {
|
layer.alert("请选择工单列表", { icon: 5 });
|
return false;
|
}
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '新增开工单',
|
closeBtn: 1,
|
shift: 2,
|
area: ['100%', '100%'],
|
maxmin: true,
|
content: '质量管理/检验取样还样单/QC_Add_TakeSampleCheckBill.html?OperationType=2&linterid=&HSouceBillType=',
|
end: function () {
|
|
},
|
success: function (dom, index) {
|
var data = [];
|
data.push({
|
"HBillType": HBillType,
|
"HSourceInterID": HSourceInterID,
|
"HSourceEntryID": HSourceEntryID,
|
"HSourceBillNo": HSourceBillNo,
|
"HSourceBillType": HSourceBillType
|
});
|
|
//通过索引获取到当前iframe弹出层
|
var iframe = window['layui-layer-iframe' + index];
|
//调用iframe弹出层内的方法
|
iframe.edit(data);
|
},
|
});
|
}
|
|
//工艺参数点检点击事件
|
function TechParam(event, obj) {
|
if (wktag == 0) {
|
layer.alert("请选择工单列表", { icon: 5 });
|
return false;
|
}
|
if (WorkStaus(HSourceID1, workcode, HSourceInterID, "工艺参数点检")) {
|
layer.alert("单据状态不满足工艺参数点检条件!", { icon: 5 });
|
return false;
|
}
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '新增工艺参数点检单',
|
closeBtn: 1,
|
shift: 2,
|
area: ['100%', '100%'],
|
maxmin: true,
|
content: '设备管理/设备工艺参数订单点检表/SB_EquipICMOTechParamBillEdit.html?OperationType=4&linterid=&HEntryID=',
|
end: function () {
|
|
},
|
success: function (dom, index) {
|
var data = [];
|
data.push({
|
"HBillType": HBillType,
|
"HSourceInterID": HSourceInterID,
|
"HSourceEntryID": HSourceEntryID,
|
"HSourceBillNo": HSourceBillNo,
|
"HSourceBillType": HSourceBillType
|
});
|
|
//通过索引获取到当前iframe弹出层
|
var iframe = window['layui-layer-iframe' + index];
|
//调用iframe弹出层内的方法
|
iframe.edit(data);
|
},
|
});
|
}
|
|
//异常签到处理点击事件
|
function SingErrMsg(event, obj) {
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '新增异常签到处理单',
|
closeBtn: 1,
|
shift: 2,
|
area: ['100%', '100%'],
|
maxmin: true,
|
content: '生产管理/异常反馈单/OA_ErrMsgBackSignBill_BrushCard.html?OperationType=2',
|
end: function () {
|
|
}
|
});
|
}
|
|
//异常验收点击事件
|
function ErrMsgBackCheck(event, obj) {
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '新增异常反馈验收单',
|
closeBtn: 1,
|
shift: 2,
|
area: ['100%', '100%'],
|
maxmin: true,
|
content: '质量管理/异常反馈/OA_ErrMsgBackSelfQuery_BGT.html?OperationType=2',
|
end: function () {
|
|
},
|
success: function (dom, index) {
|
var data = [];
|
data.push({
|
"HSourceID": HSourceID1,
|
"HSourceName": HSourceName1
|
});
|
//通过索引获取到当前iframe弹出层
|
var iframe = window['layui-layer-iframe' + index];
|
//调用iframe弹出层内的方法
|
iframe.edit(data);
|
}
|
});
|
}
|
|
//退出
|
function Esc(event, obj) {
|
parent.location.href = "index.html"
|
|
}
|
|
//单据状态验证
|
function WorkStaus(HSourceID1, workcode, HSourceInterID, btn) {
|
var flag = false;
|
var sWhere = "";
|
switch (btn) {
|
case "开工":
|
sWhere = " where HSourceID='" + HSourceID1 + "' and HICMOBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('0','2')"; //是否有不为开工开工状态、停工状态
|
break;
|
case "完工":
|
sWhere = " where HSourceID='" + HSourceID1 + "' and HICMOBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('1','2')"; //是否有不为开工、完工状态
|
break;
|
case "停工":
|
sWhere = " where HSourceID='" + HSourceID1 + "' and HICMOBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('1')"; //是否有不为停工挂起状态
|
break;
|
case "汇报":
|
sWhere = " where HSourceID='" + HSourceID1 + "' and HICMOBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('1','2')"; //是否有不为开工、停工挂起状态
|
break;
|
case "斯莫尔汇报":
|
sWhere = " where HSourceID='" + HSourceID1 + "' and HSourceBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('1','2')"; //是否有不为开工、停工挂起状态
|
break;
|
case "报检申请":
|
|
// break;
|
// default:
|
//}
|
|
$.ajax({
|
url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESBeginWorkBillStaus",
|
type: "GET",
|
data: { "sWhere": JSON.stringify(sWhere) },
|
dataType: "json",//数据类型可以为 text xml json script jsonp
|
async: false,
|
success: function (data) {
|
|
if (data.count > 0) {
|
flag = true;
|
|
}
|
else {
|
flag = false;
|
}
|
},
|
error: function (err) {
|
flag = false;
|
}
|
});
|
|
return flag;
|
}
|
}
|
</script>
|
</body>
|
</html>
|