From 7ae052d141e69fe9e19392172fc2960134a03232 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 01 十二月 2025 15:54:52 +0800
Subject: [PATCH] 1.采购入库单列表、直接调拨单列表、其他出库单列表、生产入库列表、销售出库单列表:layui中开发 查看包装明细
---
WebTM/views/质量管理/质量报表/QC_InspectionFormReport.html | 860 +++++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 738 insertions(+), 122 deletions(-)
diff --git "a/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\350\264\250\351\207\217\346\212\245\350\241\250/QC_InspectionFormReport.html" "b/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\350\264\250\351\207\217\346\212\245\350\241\250/QC_InspectionFormReport.html"
index 278e638..3675fb9 100644
--- "a/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\350\264\250\351\207\217\346\212\245\350\241\250/QC_InspectionFormReport.html"
+++ "b/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\350\264\250\351\207\217\346\212\245\350\241\250/QC_InspectionFormReport.html"
@@ -50,7 +50,7 @@
<div class="layui-inline">
<label class="layui-form-label">閮ㄩ棬</label>
<div class="layui-input-block">
- <select name="HDeptName" id="HDeptName" lay-verify="required" lay-search class="layui-input">
+ <select name="HDeptName" id="HDeptName" lay-verify="required" lay-filter="HDeptName" lay-search class="layui-input">
<!--鍔ㄦ�佹覆鏌撹溅闂�-->
</select>
</div>
@@ -92,13 +92,7 @@
<div class="layui-input-block" style="margin-left: 120px;">
<input type="text" class="layui-input" name="HMaterModel" id="HMaterModel" style="background-color:#efefef4d;" readonly>
</div>
- </div>
- <div class="layui-inline">
- <label class="layui-form-label" style="width: 85px;">涓婇檺</label>
- <div class="layui-input-block" style="margin-left: 120px;">
- <input type="text" class="layui-input" name="HUpLimit" id="HUpLimit" style="background-color:#efefef4d;" readonly>
- </div>
- </div>
+ </div>
</div>
<div class="layui-row" style="margin-top:5px;">
<div class="layui-inline">
@@ -111,16 +105,47 @@
</button>
</div>
</div>
- <div class="layui-inline">
+ <div class="layui-inline" id="xh">
<label class="layui-form-label" style="width: 85px;">绌村彿</label>
<div class="layui-input-block" style="margin-left: 120px;">
<input type="text" class="layui-input" id="HMouldNum" name="HMouldNum">
</div>
</div>
+ <div class="layui-inline" id="sczz">
+ <!--style="display:none"-->
+ <label class="layui-form-label" style="width: 85px;">鐢熶骇璧勬簮</label>
+ <div class="layui-input-block" style="margin-left: 120px;">
+ <input type="hidden" class="layui-input" lay-verify="HSourceID" name="HSourceID" id="HSourceID" value="0">
+ <input type="text" class="layui-input" name="HSourceName" id="HSourceName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+ <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHSourceID" id="btnHSourceID" style="padding: 0 10px; margin-right: 3px;">
+ <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
+ </button>
+ </div>
+ </div>
+ <div class="layui-inline" id="sczz">
+ <label class="layui-form-label" style="width: 85px;">宸ュ簭</label>
+ <div class="layui-input-block" style="margin-left: 120px;">
+ <input type="hidden" class="layui-input" lay-verify="HProcID" name="HProcID" id="HProcID" value="0">
+ <input type="text" class="layui-input" name="HProcName" id="HProcName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+ <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHProcID" id="btnHProcID" style="padding: 0 10px; margin-right: 3px;">
+ <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
+ </button>
+ </div>
+ </div>
+
+ </div>
+ <div class="layui-row" style="margin-top:5px;">
+
<div class="layui-inline">
<label class="layui-form-label" style="width: 85px;">鏍囧噯鍊�</label>
<div class="layui-input-block" style="margin-left: 120px;">
<input type="text" class="layui-input" name="HTargetVal" id="HTargetVal">
+ </div>
+ </div>
+ <div class="layui-inline">
+ <label class="layui-form-label" style="width: 85px; margin-left: 50px;">涓婇檺</label>
+ <div class="layui-input-block" style="margin-left: 170px;">
+ <input type="text" class="layui-input" name="HUpLimit" id="HUpLimit" style="background-color:#efefef4d;" readonly>
</div>
</div>
<div class="layui-inline">
@@ -132,13 +157,13 @@
</div>
<div class="layui-row" style="margin-top:5px;">
<div class="layui-inline">
- <label class="layui-form-label" style="width: 85px;">鎺у埗涓婇檺</label>
+ <label class="layui-form-label" style="width: 85px;">鍧囧�兼帶鍒朵笂闄�</label>
<div class="layui-input-block" style="margin-left: 120px;">
<input type="text" class="layui-input" name="HControlUpperLimit_X" id="HControlUpperLimit_X">
</div>
</div>
<div class="layui-inline" style="margin-left: 48px;">
- <label class="layui-form-label" style="width: 85px;">鎺у埗涓嬮檺</label>
+ <label class="layui-form-label" style="width: 85px;">鍧囧�兼帶鍒朵笅闄�</label>
<div class="layui-input-block" style="margin-left: 120px;">
<input type="text" class="layui-input" name="HControlLowerLimit_X" id="HControlLowerLimit_X">
</div>
@@ -158,13 +183,13 @@
</div>
<div class="layui-row" style="margin-top:5px;">
<div class="layui-inline">
- <label class="layui-form-label" style="width: 85px;">鎺у埗涓婇檺</label>
+ <label class="layui-form-label" style="width: 85px;">鏋佸樊鎺у埗涓婇檺</label>
<div class="layui-input-block" style="margin-left: 120px;">
<input type="text" class="layui-input" name="HControlUpperLimit_S" id="HControlUpperLimit_S">
</div>
</div>
<div class="layui-inline" style="margin-left: 48px;">
- <label class="layui-form-label" style="width: 85px;">鎺у埗涓嬮檺</label>
+ <label class="layui-form-label" style="width: 85px;">鏋佸樊鎺у埗涓嬮檺</label>
<div class="layui-input-block" style="margin-left: 120px;">
<input type="text" class="layui-input" name="HControlLowerLimit_S" id="HControlLowerLimit_S">
</div>
@@ -185,17 +210,37 @@
</div>
</div>
</div>
- <div>
+ <div class="layui-tab layui-tab-card">
<table class="" id="mainTable" lay-filter="mainTable"></table>
- <div id="histogram_Avg" style="width:99.5%;height:calc(100vh);margin-top:5px;">
+ <ul class="layui-tab-title">
+ <li class="layui-this">x虅绠″埗鍥�</li>
+ <li>R绠″埗鍥�</li>
+ <li>妫�娴嬪��</li>
+ </ul>
+ <div class="layui-tab-content">
+ <div class="layui-tab-item layui-show">
+ <!--x虅绠″埗鍥�-->
+ <div id="histogram_Avg" style="width: 99.5%; height: calc(100vh);">
- </div>
- <div id="histogram_Diff" style="width:99.5%;height:calc(100vh);margin-top:15px;">
+ </div>
+ </div>
+ <div class="layui-tab-item layui-show">
+ <!--R绠″埗鍥�-->
+ <div id="histogram_Diff" style="width: 99.5%; height: calc(100vh);">
+ </div>
+ </div>
+ <div class="layui-tab-item layui-show">
+ <!--妫�娴嬪��-->
+ <div id="histogram_SJZ" style="width: 99.5%; height: calc(100vh);">
+
+ </div>
+ </div>
</div>
</div>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
+ <button type="button" class="layui-btn layui-btn-sm" lay-event="btn_Export" id="btn_Export"><i class="layui-icon layui-icon-export"></i>瀵煎嚭</button>
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-exit"><i class="layui-icon layui-icon-return"></i>閫�鍑�</button>
<button type="button" class="layui-btn layui-btn-sm" lay-event="HideColumn"><i class="layui-icon layui-icon-form"></i>闅愯棌鍒楄缃�</button>
</div>
@@ -211,7 +256,7 @@
base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
}).extend({
index: 'lib/index', //涓诲叆鍙fā鍧�
- }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate','soulTable'], function () {
+ }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate', 'soulTable'], function () {
//#region 鍏叡鍙橀噺
var $ = layui.$
@@ -227,9 +272,12 @@
//鏌ヨ鏉′欢
var sWhere = "";
var option = [];
+ var ins; //鐢ㄤ簬瀵煎嚭excel
var HModName = "QC_InspectionFormReport";
var optionAVG = [];
var optionS = [];
+ var optionSJZ = [];
+ var HQCCheckNum = [];
//#endregion
//#region 杩涘叆椤甸潰鏃㈠姞杞�
@@ -239,7 +287,7 @@
//#endregion
-
+
//#region 鐐瑰嚮浜嬩欢鍖呮嫭on form浜嬩欢绛�
//澶村伐鍏锋爮浜嬩欢
@@ -252,6 +300,9 @@
case 'HideColumn':
get_HideColumn();
break;
+ //瀵煎嚭鎸夐挳
+ case 'btn_Export': btn_Export();
+ break;
};
});
@@ -259,13 +310,26 @@
form.on('submit(btnHMaterID)', function (data) {
btnHMaterID();
});
- //#endregion
+ //#endregion
+
+ //#region 鐢熶骇璧勬簮
+ form.on('submit(btnHSourceID)', function (data) {
+ btnHSourceID();
+ });
+ //#endregion
+
+ //#region 宸ュ簭
+ form.on('submit(btnHProcID)', function (data) {
+ btnHProcID();
+ });
+ //#endregion
//#region 妫�楠岄」鐩�
form.on('submit(btnHQCCheckItemID)', function (data) {
+ btnCheckProjectList(2);
btnHQCCheckItemID();
});
- //#endregion
+ //#endregion
//閲嶇疆鎸夐挳
form.on('submit(btnReSearch)', function (data) {
@@ -313,7 +377,13 @@
}
});
});
-
+
+ ////#region 妫�绱㈡ā寮忎笅鎷夊垪琛ㄧ洃鍚�
+ //form.on('select(HDeptName)', function (data) {
+ // changeInput_Dept();
+ //});
+ ////#endregion
+
//#endregion
//#region 姝ら〉闈㈡墍鏈夌殑鏂规硶
@@ -337,8 +407,8 @@
var columns = [];
//columns.push({ type: 'numbers', title: '搴忓彿' });
- columns.push({ field:"Id", title: "搴忓彿", width: 70 });
-
+ columns.push({ field: "Id", title: "搴忓彿", width: 70 });
+
//鑾峰彇涓や釜鏈堟湡涔嬮棿鐨勭浉宸�
var time1 = Date.parse(new Date($("#HBeginDate").val()));//寮�濮嬫椂闂�
var time2 = Date.parse(new Date($("#HEndDate").val()));//缁撴潫鏃堕棿
@@ -415,14 +485,16 @@
option.cols = [col];
option.data = data1.data;
+ optionSJZ[0] = data1.data[0];
optionAVG[0] = data1.data[limit + 1];
optionS[0] = data1.data[limit + 2];
table.render(option);
- set_Line();
+ ins = table.render(option);
set_PPK();
set_CPK();
+ set_Line();
}
-
+
} else {
layer.close(wait);
layer.alert(data1.Message, { icon: 5 });
@@ -434,62 +506,138 @@
});
}
+ //#region 鏍规嵁妫�绱㈡ā寮忚皟鏁� 鎼滅储妗�
+ function changeInput_Dept() {
+ var HSearchModel = $("#HDeptName").val();
+
+ if (HSearchModel == "389502" || HSearchModel == "15035820") {
+ //闅愯棌鐢熶骇璧勬簮
+ $("#sczz").hide();
+ $("#xh").show();
+ }
+ else {
+ //闅愯棌绌村彿
+ $("#xh").hide();
+ $("#sczz").show();
+ }
+ }
+ //#endregion
+
//PPK璁$畻 x
function set_PPK() {
- var x_AVG =0;
+ var x_AVG = 0;
var x_SUM = 0;
var x_PPK = 0;
+ var x_CPK = 0;
var numCount = 0
+ //绯绘暟 涓嶅彉鐨�
var c4 = [0.7979, 0.8862, 0.9213, 0.9400, 0.9515, 0.9594, 0.9650, 0.9693, 0.9727, 0.9754, 0.9776, 0.9794, 0.9810, 0.9823, 0.9835, 0.9845, 0.9854, 0.9862, 0.9869, 0.9876, 0.9882, 0.9887, 0.9892, 0.9896];
+ //骞冲潎鍊肩殑骞冲潎鍊�
for (var j = 1; j < option.cols[0].length; j++) {
- if (optionAVG.length != 0 || optionS.length != 0) {
+ if (optionAVG.length != 0 || optionS.length != 0) {
x_AVG = calc(x_AVG, parseFloat(optionAVG[0][option.cols[0][j].field]), "+");
}
}
x_AVG = calc(x_AVG, (option.cols[0].length - 1), "/");
x_AVG = $("#HCenterline_X").val() == "" ? x_AVG : parseFloat($("#HCenterline_X").val());
- $("#HCenterline_X").val(x_AVG);
+ $("#HCenterline_X").val(x_AVG.toFixed(5));
+ //锛堟瘡澶╃殑鏁版嵁-骞冲潎鍊肩殑骞冲潎鍊硷級 涔樺钩鏂� 鍦ㄧ浉鍔�
for (var i = 1; i < option.cols[0].length; i++) {
for (var j = 0; j < option.data.length - 3; j++) {
numCount += 1;
x_SUM = calc(x_SUM, parseFloat(((parseFloat(option.data[j][option.cols[0][i].field]) - x_AVG) ** 2).toFixed(6)), "+")
-
+
}
}
-
+ //锛坰um闄や互锛堟墍鏈夋暟閲忓噺-1锛夛級 寮�骞虫柟 涓嶅寘鍚悗涓夎
x_PPK = Math.sqrt(calc(x_SUM, (numCount - 1), "/"));
+ //锛坰um闄や互锛堟墍鏈夋暟閲忥級锛� 寮�骞虫柟 涓嶅寘鍚悗涓夎
+ x_CPK = Math.sqrt(calc(x_SUM, numCount, "/"));
var limit = $("#limit").val();
if (parseInt(limit) >= 9) {
$("#HCenterline_S").val(x_PPK.toFixed(4));
}
+ //鍧囧�� 鎺у埗涓婇檺 鎺у埗涓嬮檺
+ if (limit == 1) {
+ //x鎺у埗涓婇檺 骞冲潎鍊肩殑骞冲潎鍊�+涓夊�嶇殑PPK X鎺у埗涓嬮檺 骞冲潎鍊肩殑骞冲潎鍊�-涓夊�嶇殑PPK
+ $("#HControlUpperLimit_X").val(calc(x_AVG, calc(x_PPK, 3, "*"), "+").toFixed(5))
+ $("#HControlLowerLimit_X").val(calc(x_AVG, calc(x_PPK, 3, "*"), "-").toFixed(5))
- //涓婇檺
- if ($("#HUpLimit").val() != "" && $("#HDownLimit").val() == "") {
- var HUpLimit = calc(calc(calc(parseFloat($("#HUpLimit").val()), parseFloat($("#HTargetVal").val()), "+"), x_AVG, "-"), calc(calc(3, x_PPK, "*"), c4[option.data.length - 4], "/"), "/");
- $("#HPPK").val(HUpLimit.toFixed(4));
- }
- //涓嬮檺
- else if ($("#HDownLimit").val() != "" && $("#HUpLimit").val() == "") {
- var HDownLimit = calc(calc(x_AVG, calc(parseFloat($("#HDownLimit").val()), parseFloat($("#HTargetVal").val()), "+"), "-"), calc(calc(3, x_PPK, "*"), c4[option.data.length - 4], "/"), "/");
- $("#HPPK").val(HDownLimit.toFixed(4));
+ //璁$畻鏍锋湰閲忎负1 鐨� ppk
+ //妫�楠岄」鐩細骞冲潎鍊�-涓嬮檺 闄や互涓夊�嶇殑PPK
+ var min = calc(calc(x_AVG, calc(parseFloat($("#HDownLimit").val()), parseFloat($("#HTargetVal").val()), "+"), "-"), calc(3, x_PPK, "*"), "/");
+ //妫�楠岄」鐩細涓婇檺-骞冲潎鍊� 闄や互涓夊�嶇殑PPK
+ var max = calc(calc(calc(parseFloat($("#HUpLimit").val()), parseFloat($("#HTargetVal").val()), "+"), x_AVG, "-"), calc(3, x_PPK, "*"), "/");
+ var DataHCPK = min > max ? max : min;
+ $("#HPPK").val(DataHCPK);
+
+ //璁$畻鏍锋湰閲忎负1 鐨� cpk
+ var cpkSum = 0;
+ var CPK_U = 0;
+ var CPK_N = 0;
+ for (var i = 1; i < option.cols[0].length; i++) {
+ for (var j = 0; j < option.data.length - 3; j++) {
+ if (i == 1) {
+ //鑾峰彇绗竴琛岀殑绗竴涓��
+ CPK_U = option.data[j][option.cols[0][i].field];
+ } else {
+ CPK_N = option.data[j][option.cols[0][i].field];
+ //濡傛灉绗竴琛岀殑绗竴涓�煎ぇ浜庣浜屼釜鍊硷紝绗竴涓噺鍘荤浜� 鍚﹀垯灏辨槸 绗簩涓噺鍘荤涓�涓�
+ var data_un = CPK_U > CPK_N ? calc(CPK_U, CPK_N, "-") : calc(CPK_N, CPK_U, "-");
+ //鎶婂�肩浉鍔�
+ cpkSum = calc(cpkSum, data_un, "+");
+ CPK_U = CPK_N;
+ }
+ }
+ }
+ //cpkSum 闄や互 绗竴琛屾�绘暟鍑忓幓2
+ cpkSum = calc(cpkSum, option.cols[0].length - 2, "/");
+ //cpkSum 闄や互绯绘暟
+ var HAVG_CPK = calc(cpkSum, 1.128, "/");
+ //妫�楠岄」鐩細骞冲潎鍊�-涓嬮檺 闄や互涓夊�嶇殑HAVG_CPK
+ min = calc(calc(x_AVG, calc(parseFloat($("#HDownLimit").val()), parseFloat($("#HTargetVal").val()), "+"), "-"), calc(3, HAVG_CPK, "*"), "/");
+ //妫�楠岄」鐩細涓婇檺-骞冲潎鍊� 闄や互涓夊�嶇殑HAVG_CPK
+ max = calc(calc(calc(parseFloat($("#HUpLimit").val()), parseFloat($("#HTargetVal").val()), "+"), x_AVG, "-"), calc(3, HAVG_CPK, "*"), "/");
+ DataHCPK = min > max ? max : min;
+
+ $("#HCPK").val(DataHCPK);
} else {
- var HUpLimit = calc(calc(calc(parseFloat($("#HUpLimit").val()), parseFloat($("#HTargetVal").val()), "+"), x_AVG, "-"), calc(calc(3, x_PPK, "*"), c4[option.data.length - 4], "/"), "/");
- var HDownLimit = (x_AVG - calc(parseFloat($("#HDownLimit").val()), parseFloat($("#HTargetVal").val()), "+")) / ((3 * x_PPK) / c4[option.data.length - 4]);
- $("#HPPK").val(HUpLimit > HDownLimit ? HDownLimit.toFixed(4) : HUpLimit.toFixed(4));
+ //涓婇檺
+ if ($("#HUpLimit").val() != "" && $("#HDownLimit").val() == "") {//涓婇檺涓嶇瓑浜庣┖锛屼笅闄愮瓑浜庣┖
+ //妫�楠岄」鐩細锛堜笂闄愬��-骞冲潎鍊硷級闄や互锛堜笁鍊嶇殑PPK 闄や互C4鐨勭郴鏁�:c4瀵瑰簲鐨勬牱鏈暟锛�
+ var HUpLimit = calc(calc(calc(parseFloat($("#HUpLimit").val()), parseFloat($("#HTargetVal").val()), "+"), x_AVG, "-"), calc(calc(3, x_PPK, "*"), c4[option.data.length - 4], "/"), "/");
+ $("#HPPK").val(HUpLimit.toFixed(4));
+ }
+ //涓嬮檺
+ else if ($("#HDownLimit").val() != "" && $("#HUpLimit").val() == "") {//涓嬮檺涓嶇瓑浜庣┖锛屼笂闄愮瓑浜庣┖
+ //妫�楠岄」鐩細锛堝钩鍧囧��-涓嬮檺鍊硷級闄や互锛堜笁鍊嶇殑PPK 闄や互C4鐨勭郴鏁�:c4瀵瑰簲鐨勬牱鏈暟锛�
+ var HDownLimit = calc(calc(x_AVG, calc(parseFloat($("#HDownLimit").val()), parseFloat($("#HTargetVal").val()), "+"), "-"), calc(calc(3, x_PPK, "*"), c4[option.data.length - 4], "/"), "/");
+ $("#HPPK").val(HDownLimit.toFixed(4));
+ } else {
+ //妫�楠岄」鐩細锛堜笂闄愬��-骞冲潎鍊硷級闄や互锛堜笁鍊嶇殑PPK 闄や互C4鐨勭郴鏁�:c4瀵瑰簲鐨勬牱鏈暟锛�
+ var HUpLimit = calc(calc(calc(parseFloat($("#HUpLimit").val()), parseFloat($("#HTargetVal").val()), "+"), x_AVG, "-"), calc(calc(3, x_PPK, "*"), c4[option.data.length - 4], "/"), "/");
+ //妫�楠岄」鐩細锛堝钩鍧囧��-涓嬮檺鍊硷級闄や互锛堜笁鍊嶇殑PPK 闄や互C4鐨勭郴鏁�:c4瀵瑰簲鐨勬牱鏈暟锛�
+ var HDownLimit = (x_AVG - calc(parseFloat($("#HDownLimit").val()), parseFloat($("#HTargetVal").val()), "+")) / ((3 * x_PPK) / c4[option.data.length - 4]);
+ $("#HPPK").val(HUpLimit > HDownLimit ? HDownLimit.toFixed(4) : HUpLimit.toFixed(4));
+ }
}
}
- //CPK璁$畻 s
+ //CPK璁$畻 s
function set_CPK() {
var x_AVG = 0;
var s_AVG = 0;
var s_CPK = 0;
var d2 = [1.128, 1.693, 2.059, 2.326, 2.534, 2.704, 2.847, 3.078, 3.173, 3.258, 3.336, 3.407, 3.472, 3.532, 3.588, 3.640, 3.689, 3.735, 3.778, 3.819, 3.858, 3.895, 3.931];
+ var A2 = [0,1.880, 1.023, 0.729, 0.577, 0.483, 0.419, 0.373, 0.337, 0.308];
+ var D3 = [0,0.000, 0.000, 0.000, 0.000, 0.000, 0.076, 0.136, 0.184, 0.223];
+ var D4 = [0,3.267, 2.574, 2.282, 2.114, 2.004, 1.924, 1.864, 1.816, 1.777];
+ //姹傛瀬宸�肩殑骞冲潎鍊�
for (var j = 1; j < option.cols[0].length; j++) {
if (optionAVG.length != 0 || optionS.length != 0) {
s_AVG = calc(s_AVG, parseFloat(optionS[0][option.cols[0][j].field]), "+");
@@ -497,13 +645,13 @@
}
s_AVG = calc(s_AVG, (option.cols[0].length - 1), "/")
s_AVG = $("#HCenterline_S").val() == "" || "0" ? s_AVG : parseFloat($("#HCenterline_S").val());
- $("#HCenterline_S").val(s_AVG);
+ $("#HCenterline_S").val(s_AVG);//S涓績绾�
var limit = $("#limit").val();
if (parseInt(limit) < 9) {
$("#HCenterline_S").val(s_AVG.toFixed(4));
}
-
+ //姹傚钩鍧囧�肩殑骞冲潎鍊�
for (var j = 1; j < option.cols[0].length; j++) {
if (optionAVG.length != 0 || optionS.length != 0) {
x_AVG = calc(x_AVG, parseFloat(optionAVG[0][option.cols[0][j].field]), "+");
@@ -511,28 +659,49 @@
}
x_AVG = calc(x_AVG, (option.cols[0].length - 1), "/");
x_AVG = $("#HCenterline_X").val() == "" ? x_AVG : parseFloat($("#HCenterline_X").val());
- $("#HCenterline_X").val(x_AVG);
+ $("#HCenterline_X").val(x_AVG.toFixed(5));//X涓績绾�
s_CPK = calc(s_AVG, d2[option.data.length - 4], "/");
- //涓婇檺
- if ($("#HUpLimit").val() != "" && $("#HDownLimit").val() == "") {
- var HUpLimit = calc(calc(calc(parseFloat($("#HUpLimit").val()), parseFloat($("#HTargetVal").val()),"+"), s_AVG, "-"), (3 * s_CPK), "/");
- $("#HCPK").val(HUpLimit.toFixed(4));
+ //鍧囧�� 鎺у埗涓婇檺 鎺у埗涓嬮檺
+ if (limit > 1) {
+ //骞冲潎鍊�+锛圓2鐨勭郴鏁颁箻浠� 鏋佸樊鍊肩殑骞冲潎鍊硷級
+ $("#HControlUpperLimit_X").val(calc(x_AVG, calc(A2[$("#limit").val() - 1], s_AVG, "*"), "+").toFixed(5))
+ //骞冲潎鍊�-锛圓2鐨勭郴鏁颁箻浠� 鏋佸樊鍊肩殑骞冲潎鍊硷級
+ $("#HControlLowerLimit_X").val(calc(x_AVG, calc(A2[$("#limit").val() - 1], s_AVG, "*"), "-").toFixed(5))
}
- //涓嬮檺
- else if ($("#HDownLimit").val() != "" && $("#HUpLimit").val() == "") {
- var HDownLimit = calc(calc(s_AVG, calc(parseFloat($("#HDownLimit").val()), parseFloat($("#HTargetVal").val()), "+"), "-"), (3 * s_CPK), "/");
- $("#HCPK").val(HDownLimit.toFixed(4));
- } else {
- var HUpLimit = calc(calc(calc(parseFloat($("#HUpLimit").val()), parseFloat($("#HTargetVal").val()), "+"), s_AVG, "-"), (3 * s_CPK), "/");
- var HDownLimit = calc(calc(s_AVG, calc(parseFloat($("#HDownLimit").val()), parseFloat($("#HTargetVal").val()), "+"), "-"), (3 * s_CPK), "/");
- if (s_CPK == 0) {
- $("#HCPK").val(0);
- } else {
- $("#HCPK").val(HUpLimit > HDownLimit ? HDownLimit.toFixed(4) : HUpLimit.toFixed(4));
- }
+
+ //宸�� 鎺у埗涓婇檺 鎺у埗涓嬮檺
+ //D4鐨勭郴鏁� 涔樹互 鏋佸樊鍊肩殑骞冲潎鍊�
+ $("#HControlUpperLimit_S").val(calc(D4[$("#limit").val() - 1], s_AVG, "*").toFixed(5));
+ //D3鐨勭郴鏁� 涔樹互 鏋佸樊鍊肩殑骞冲潎鍊�
+ $("#HControlLowerLimit_S").val(calc(D3[$("#limit").val() - 1], s_AVG, "*").toFixed(5));
+ var limit = $("#limit").val();
+ if (limit > 1) {
+ //涓婇檺
+ if ($("#HUpLimit").val() != "" && $("#HDownLimit").val() == "") {//涓嬮檺涓嶇瓑浜庣┖锛屼笂闄愮瓑浜庣┖
+ //锛堜笂闄愬��-骞冲潎鍊硷級闄や互 涓夊�嶇殑s_CPK
+ var HUpLimit = calc(calc(calc(parseFloat($("#HUpLimit").val()), parseFloat($("#HTargetVal").val()), "+"), x_AVG, "-"), (3 * s_CPK), "/");
+ $("#HCPK").val(HUpLimit.toFixed(4));
+ }
+ //涓嬮檺
+ else if ($("#HDownLimit").val() != "" && $("#HUpLimit").val() == "") {//涓婇檺涓嶇瓑浜庣┖锛屼笅闄愮瓑浜庣┖
+ //锛堝钩鍧囧��-涓嬮檺鍊硷級闄や互 涓夊�嶇殑s_CPK
+ var HDownLimit = calc(calc(x_AVG, calc(parseFloat($("#HDownLimit").val()), parseFloat($("#HTargetVal").val()), "+"), "-"), (3 * s_CPK), "/");
+ $("#HCPK").val(HDownLimit.toFixed(4));
+ } else {
+ //锛堜笂闄愬��-骞冲潎鍊硷級闄や互 涓夊�嶇殑s_CPK
+ var HUpLimit = calc(calc(calc(parseFloat($("#HUpLimit").val()), parseFloat($("#HTargetVal").val()), "+"), x_AVG, "-"), (3 * s_CPK), "/");
+ //锛堝钩鍧囧��-涓嬮檺鍊硷級闄や互 涓夊�嶇殑s_CPK
+ var HDownLimit = calc(calc(x_AVG, calc(parseFloat($("#HDownLimit").val()), parseFloat($("#HTargetVal").val()), "+"), "-"), (3 * s_CPK), "/");
+ if (s_CPK == 0) {
+ $("#HCPK").val(0);
+ } else {
+ $("#HCPK").val(HUpLimit > HDownLimit ? HDownLimit.toFixed(4) : HUpLimit.toFixed(4));
+ }
+
+ }
}
}
@@ -540,7 +709,7 @@
var str1, // 杞崲涓哄瓧绗︿覆鐨勬暟瀛�
str2,
ws1 = 0,// ws1锛寃s2 鐢ㄦ潵瀛樺偍浼犲叆鐨刵um鐨勫皬鏁扮偣鍚庣殑鏁板瓧鐨勪綅鏁�
- ws2 = 0,// 璧嬮粯璁ゅ�硷紝瑙e喅褰撴暣鏁板拰灏忔暟杩愮畻鏃跺�嶆暟璁$畻閿欒瀵艰嚧鐨勭粨鏋滆宸�
+ ws2 = 0,// 璧嬮粯璁ゅ�硷紝瑙e喅褰撴暣鏁板拰灏忔暟杩愮畻鏃跺�嶆暟璁$畻閿欒瀵艰嚧鐨勭粨鏋滆宸�
bigger,// bigger鍜宻maller鐢ㄤ簬鍔狅紝鍑忥紝闄ゆ硶鎵惧嚭灏忕殑閭d釜鏁板瓧锛岀粰鍚庨潰琛�0锛岃В鍐充綅鏁颁笉瀵逛粠鑰岄�犳垚鐨勮绠楅敊璇殑闂锛涗箻娉曢渶瑕佸皢缁撴灉闄や袱涓暟瀛楃殑鍊嶆暟涔嬪拰
smaller,// 渚嬪锛氬姞鍑忛櫎娉曚腑1.001 + 2.03 锛屽鏋滀笉缁�2.03杩涜琛�0锛屾渶鍚庝細鍙樻垚1001+203锛屾暟瀛楅敊浣嶅鑷寸粨鏋滈敊璇紱涔樻硶涓�1.12*1.1浼氭斁澶т负112*11锛屾墍浠ョ粨鏋滈渶瑕侀櫎浠�1000鎵嶄細鏄纭殑缁撴灉锛�112*11/1000=1.232
zeroCount, // 闇�瑕佽ˉ鍏�0鐨勪釜鏁�
@@ -562,7 +731,7 @@
if (isExistDot2) {
ws2 = str2.split('.')[1].length;
}
- // 濡倃s1 鍜� ws2 鏃犻粯璁ゅ�硷紝濡傛灉num1 鎴� num2 涓嶆槸灏忔暟鐨勮瘽鍒� ws1 鎴� ws2 鐨勫�煎皢涓� undefined
+ // 濡倃s1 鍜� ws2 鏃犻粯璁ゅ�硷紝濡傛灉num1 鎴� num2 涓嶆槸灏忔暟鐨勮瘽鍒� ws1 鎴� ws2 鐨勫�煎皢涓� undefined
// bigger 鍜� smaller 鐨勫�间細鍜岄鏈熶笉绗�
bigger = ws1 > ws2 ? ws1 : ws2;
smaller = ws1 < ws2 ? ws1 : ws2;
@@ -625,6 +794,12 @@
return sum;
}
+ //#region 瀵煎嚭Execel
+ function btn_Export() {
+ table.exportFile(ins.config.id, option.data, "xls");
+ }
+ //#endregion
+
//鎶樼嚎鍥�
function set_Line() {
//#region銆愭姌绾垮浘銆�
@@ -636,26 +811,49 @@
let H_X = [];//x杞存爣棰�
let HAvg = [];//骞冲潎鍊�
let HDifference = [];//宸��
+ let HSJZ = [];//瀹為檯鍊�
+
+ var judge = spc_judge();
for (var j = 1; j < option.cols[0].length; j++) {
if (optionAVG.length != 0 || optionS.length != 0) {
- HAvg.push(optionAVG[0][option.cols[0][j].field]);
+ if ($.inArray(optionAVG[0][option.cols[0][j].field], judge) != -1) {
+ var data = { value: optionAVG[0][option.cols[0][j].field], itemStyle: { color: 'red' } };
+ HAvg.push(data);
+ } else {
+ HAvg.push(optionAVG[0][option.cols[0][j].field]);
+ }
+
HDifference.push(optionS[0][option.cols[0][j].field]);
+ HSJZ.push(optionSJZ[0][option.cols[0][j].field]);
} else {
HAvg.push(0);
HDifference.push(0);
+ HSJZ.push(0);
}
}
for (let i = 1; i < option.cols[0].length; i++) {
H_X.push(option.cols[0][i].field);
}
+ var max = Math.max.apply(null, HSJZ);
+ var min = Math.min.apply(null, HSJZ);
+
+ var sum = 0;
+ $.each(HSJZ, function (index, value) {
+ sum += value;
+ });
+ var average = sum / HSJZ.length;
+
+ var HAreaValue = calc(calc(parseFloat($("#HControlUpperLimit_X").val()), parseFloat($("#HCenterline_X").val()), "-"), 3, "/").toFixed(5);
+ var HAreaValue_A = HAreaValue * 2;
+ var HAreaValue_B = HAreaValue * 1;
option_ZXT_Avg = {
title: {
- text: '骞冲潎鍊�',
+ text: 'x虅绠″埗鍥�',
left: 'center'
- },
+ },
grid: {
x: '3%', //鐩稿綋浜庤窛绂诲乏杈规晥鏋�:padding-left
//y: '5%', //鐩稿綋浜庤窛绂讳笂杈规晥鏋�:padding-top
@@ -668,48 +866,58 @@
},
yAxis: {
type: 'value',
- min: parseFloat($("#HDownLimit").val()) != 0 ? calc((parseFloat($("#HTargetVal").val()), calc(parseFloat($("#HDownLimit").val()), 1.3), "*"), "+") : 0, // 璁剧疆鏈�灏忓��
- max: calc(parseFloat($("#HTargetVal").val()), calc(parseFloat($("#HUpLimit").val()), 1.3, "*"), "+"), // 璁剧疆鏈�澶у��
+ min: parseFloat($("#HDownLimit").val()) != 0 ? calc(parseFloat($("#HTargetVal").val()), calc(parseFloat($("#HDownLimit").val()), 1.1, "*"), "+") : 0, // 璁剧疆鏈�灏忓��
+ max: calc(parseFloat($("#HTargetVal").val()), calc(parseFloat($("#HUpLimit").val()), 1.1, "*"), "+"), // 璁剧疆鏈�澶у��
interval: calc(calc(parseFloat($("#HUpLimit").val()), parseFloat($("#HDownLimit").val()), "-"), 10, "/"), // 璁剧疆闂磋窛
},
series: [
{
data: HAvg,
type: 'line',
- areaStyle: {//濉厖鐨勯鑹�
- color: {//绾挎�ф笎鍙樺墠鍥涗釜鍙傛暟鍒嗗埆鏄� x0, y0, x2, y2, 鑼冨洿浠� 0 - 1锛岀浉褰撲簬鍦ㄥ浘褰㈠寘鍥寸洅涓殑鐧惧垎姣旓紝濡傛灉 globalCoord 涓� `true`锛屽垯璇ュ洓涓�兼槸缁濆鐨勫儚绱犱綅缃�
- type: 'linear',
- x: 0,
- y: 1,
- x2: 0,
- y2: 0,
- colorStops: [{
- offset: 0, color: 'rgba(232,247,247)' // 0% 澶勭殑棰滆壊
- }, {
- offset: 1, color: 'rgba(183,252,252)' // 100% 澶勭殑棰滆壊
- }],
- globalCoord: false// 缂虹渷涓� false
+ itemStyle: {
+ normal: {
+ label: {
+ show: true
+ }
}
},
- itemStyle: { normal: { label: { show: true } } },
markLine: {
symbol: 'none',//鍘绘帀绠ご
data: [
- { yAxis: parseFloat($("#HTargetVal").val()) + parseFloat($("#HUpLimit").val()), lineStyle: { color: '#FF1D00' }, label: { color: '#FF1D00', fontSize: 10 } },
{
- yAxis: parseFloat($("#HTargetVal").val()) + parseFloat($("#HDownLimit").val()), lineStyle: { color: '#FF1D00' }, label: { color: '#FF1D00', fontSize: 10 }
+ name: 'USL', yAxis: parseFloat($("#HTargetVal").val()) + parseFloat($("#HUpLimit").val()), lineStyle: { color: '#FF1D00' }, label: { color: '#FF1D00', fontSize: 10 }, label: { formatter: '{b}: {c}' }
},
{
- yAxis: parseFloat($("#HControlUpperLimit_X").val()), lineStyle: { color: '#2cb615' }, label: { color: '#2cb615', fontSize: 10 }
+ name: 'LSL', yAxis: parseFloat($("#HTargetVal").val()) + parseFloat($("#HDownLimit").val()), lineStyle: { color: '#FF1D00' }, label: { color: '#FF1D00', fontSize: 10 }, label: { formatter: '{b}: {c}' }
},
{
- yAxis: parseFloat($("#HControlLowerLimit_X").val()), lineStyle: { color: '#2cb615' }, label: { color: '#2cb615', fontSize: 10 }
+ name: 'UCL', yAxis: parseFloat($("#HControlUpperLimit_X").val()), lineStyle: { color: '#ff9145' }, label: { color: '#ff9145', fontSize: 10 }, label: { formatter: '{b}: {c}' }
+ },
+ {
+ name: 'LCL', yAxis: parseFloat($("#HControlLowerLimit_X").val()), lineStyle: { color: '#ff9145' }, label: { color: '#ff9145', fontSize: 10 }, label: { formatter: '{b}: {c}' }
}
,
{
- yAxis: parseFloat($("#HCenterline_X").val()), lineStyle: { color: '#6dadf0' }, label: { color: '#6dadf0', fontSize: 10 }
+ name: 'CL', yAxis: parseFloat($("#HCenterline_X").val()), lineStyle: { color: '#000000' }, label: { color: '#000000', fontSize: 10 }, label: { formatter: '{b}: {c}' }
}
- ]
+ ,
+ {
+ name: 'B', yAxis: parseFloat($("#HCenterline_X").val()) + HAreaValue_A, lineStyle: { color: '#6dadf0' }, label: { color: '#6dadf0', fontSize: 10 }, label: { formatter: '{b}: {c}' }
+ }
+ ,
+ {
+ name: '-B', yAxis: parseFloat($("#HCenterline_X").val()) - HAreaValue_A, lineStyle: { color: '#6dadf0' }, label: { color: '#6dadf0', fontSize: 10 }, label: { formatter: '{b}: {c}' }
+ }
+ ,
+ {
+ name: 'C', yAxis: parseFloat($("#HCenterline_X").val()) + HAreaValue_B, lineStyle: { color: '#2cb615' }, label: { color: '#2cb615', fontSize: 10 }, label: { formatter: '{b}: {c}' }
+ }
+ ,
+ {
+ name: '-C', yAxis: parseFloat($("#HCenterline_X").val()) - HAreaValue_B, lineStyle: { color: '#2cb615' }, label: { color: '#2cb615', fontSize: 10 }, label: { formatter: '{b}: {c}' }
+ }
+ ],
+ precision: 3
},
}
]
@@ -723,7 +931,7 @@
option_ZXT_Diff = {
title: {
- text: '宸��',
+ text: 'R绠″埗鍥�',
left: 'center'
},
grid: {
@@ -737,49 +945,385 @@
data: H_X
},
yAxis: {
- type: 'value'
+ type: 'value',
+ min: 0, // 璁剧疆鏈�灏忓��
+ max: parseFloat($("#HControlUpperLimit_S").val()) != 0 ? calc(parseFloat($("#HControlUpperLimit_S").val()), 1.1, "*") : 0, // 璁剧疆鏈�澶у��
+ interval: calc(parseFloat($("#HControlUpperLimit_S").val()).toFixed(5), 10, "/"), // 璁剧疆闂磋窛
},
series: [
{
data: HDifference,
type: 'line',
- areaStyle: {//濉厖鐨勯鑹�
- color: {//绾挎�ф笎鍙樺墠鍥涗釜鍙傛暟鍒嗗埆鏄� x0, y0, x2, y2, 鑼冨洿浠� 0 - 1锛岀浉褰撲簬鍦ㄥ浘褰㈠寘鍥寸洅涓殑鐧惧垎姣旓紝濡傛灉 globalCoord 涓� `true`锛屽垯璇ュ洓涓�兼槸缁濆鐨勫儚绱犱綅缃�
- type: 'linear',
- x: 0,
- y: 1,
- x2: 0,
- y2: 0,
- colorStops: [{
- offset: 0, color: 'rgba(255,240,170,0)' // 0% 澶勭殑棰滆壊
- }, {
- offset: 1, color: 'rgba(255,240,170,1)' // 100% 澶勭殑棰滆壊
- }],
- globalCoord: false// 缂虹渷涓� false
- }
- },
+
itemStyle: { normal: { label: { show: true } } },
markLine: {
symbol: 'none',//鍘绘帀绠ご
data: [
{
- yAxis: parseFloat($("#HControlUpperLimit_S").val()) , lineStyle: { color: '#2cb615' }, label: { color: '#2cb615', fontSize: 10 }
+ name: 'UCL', yAxis: parseFloat($("#HControlUpperLimit_S").val()), lineStyle: { color: '#2cb615' }, label: { color: '#2cb615', fontSize: 10 }, label: { formatter: '{b}: {c}' }
},
{
- yAxis: parseFloat($("#HControlLowerLimit_S").val()), lineStyle: { color: '#2cb615' }, label: { color: '#2cb615', fontSize: 10 }
+ name: 'LCL', yAxis: parseFloat($("#HControlLowerLimit_S").val()), lineStyle: { color: '#2cb615' }, label: { color: '#2cb615', fontSize: 10 }, label: { formatter: '{b}: {c}' }
}
,
{
- yAxis: parseFloat($("#HCenterline_S").val()), lineStyle: { color: '#6dadf0' }, label: { color: '#6dadf0', fontSize: 10 }
+ name: 'CL', yAxis: parseFloat($("#HCenterline_S").val()), lineStyle: { color: '#6dadf0' }, label: { color: '#6dadf0', fontSize: 10 }, label: { formatter: '{b}: {c}' }
}
- ]
+ ],
+ precision: 3
},
}
]
};
option_ZXT_Diff && myChart.setOption(option_ZXT_Diff);
- //#endregion
+ //瀹為檯鍊�
+ var chartDom = document.getElementById('histogram_SJZ');
+ var myChart = echarts.init(chartDom);
+ var option_ZXT_SJZ;
+
+ option_ZXT_SJZ = {
+ title: {
+ text: '妫�娴嬪��',
+ left: 'center'
+ },
+ grid: {
+ x: '3%', //鐩稿綋浜庤窛绂诲乏杈规晥鏋�:padding-left
+ //y: '5%', //鐩稿綋浜庤窛绂讳笂杈规晥鏋�:padding-top
+ bottom: '5%',
+ containLabel: true
+ },
+ xAxis: {
+ type: 'category',
+ data: H_X
+ },
+ yAxis: {
+ type: 'value',
+ min: parseFloat($("#HDownLimit").val()) != 0 ? calc(parseFloat($("#HTargetVal").val()), calc(parseFloat($("#HDownLimit").val()), 1.1, "*"), "+") : 0, // 璁剧疆鏈�灏忓��
+ max: calc(parseFloat($("#HTargetVal").val()), calc(parseFloat($("#HUpLimit").val()), 1.1, "*"), "+"), // 璁剧疆鏈�澶у��
+ interval: calc(calc(parseFloat($("#HUpLimit").val()), parseFloat($("#HDownLimit").val()), "-"), 10, "/"), // 璁剧疆闂磋窛
+ },
+ series: [
+ {
+ data: HSJZ,
+ type: 'line',
+ itemStyle: {
+ normal:
+ {
+ label: {
+ show: true
+ }
+ }
+ },
+ markLine: {
+ symbol: 'none',//鍘绘帀绠ご
+ data: [
+ { name: 'USL', yAxis: parseFloat($("#HTargetVal").val()) + parseFloat($("#HUpLimit").val()), lineStyle: { color: '#FF1D00' }, label: { color: '#FF1D00', fontSize: 10 }, label: { formatter: '{b}: {c}' } },
+ {
+ name: 'LSL', yAxis: parseFloat($("#HTargetVal").val()) + parseFloat($("#HDownLimit").val()), lineStyle: { color: '#FF1D00' }, label: { color: '#FF1D00', fontSize: 10 }, label: { formatter: '{b}: {c}' }
+ },
+ {
+ name: 'UCL', yAxis: max, lineStyle: { color: '#2cb615' }, label: { color: '#2cb615', fontSize: 10 }, label: { formatter: '{b}: {c}' }
+ },
+ {
+ name: 'LCL', yAxis: min, lineStyle: { color: '#2cb615' }, label: { color: '#2cb615', fontSize: 10 }, label: { formatter: '{b}: {c}' }
+ }
+ ,
+ {
+ name: 'CL', yAxis: average.toFixed(5), lineStyle: { color: '#6dadf0' }, label: { color: '#6dadf0', fontSize: 10 }, label: { formatter: '{b}: {c}' }
+ }
+ ],
+ precision: 3
+ },
+ }
+ ]
+ };
+ option_ZXT_SJZ && myChart.setOption(option_ZXT_SJZ);
+
+ //#endregion
+
+ }
+
+ //璁$畻spc鍏ぇ鍒ゅ畾
+ function spc_judge() {
+ //鍧囧�� 锛堜笂闄�-涓績闄愶級闄や互 3 鍒嗘垚3鍒�
+ var HAreaValue = calc(calc(parseFloat($("#HControlUpperLimit_X").val()), parseFloat($("#HCenterline_X").val()), "-"), 3, "/").toFixed(5);
+ //涓婇檺閮ㄥ垎
+ var HAreaValue_A = parseFloat($("#HControlUpperLimit_X").val());//涓婇檺
+ var HAreaValue_B = calc(calc(HAreaValue, 2, "*"), parseFloat($("#HCenterline_X").val()), "+").toFixed(5);
+ var HAreaValue_C = calc(calc(HAreaValue, 1, "*"), parseFloat($("#HCenterline_X").val()), "+").toFixed(5);
+ //涓嬮檺閮ㄥ垎
+ var HAreaValue_FA = parseFloat($("#HControlLowerLimit_X").val());//涓嬮檺
+ var HAreaValue_FB = calc(parseFloat($("#HCenterline_X").val()),calc(HAreaValue, 2, "*"), "-").toFixed(5);
+ var HAreaValue_FC = calc(parseFloat($("#HCenterline_X").val()),calc(HAreaValue, 1, "*"), "-").toFixed(5);
+
+
+ let HAvg = [];//骞冲潎鍊� 鏍规嵁X- 杩欎竴琛岃绠楃殑
+
+ for (var j = 1; j < option.cols[0].length; j++) {
+ if (optionAVG.length != 0) {
+ HAvg.push(optionAVG[0][option.cols[0][j].field]);
+ }
+ }
+
+ //杩炵画鍗佷簲涓偣鍦ㄤ腑蹇冪嚎涓や晶鐨凜鍖哄唴
+ var judge_return = [];
+ if (HAvg.length >= 15) {
+ //鍥犱负鏄�15涓偣 鎵�浠�14鐨勪笅鏍囧氨鏄15鏉℃暟鎹� 鐒跺悗鏄�0-15锛�1-16
+ for (var i = 14; i < HAvg.length; i++) {
+ if (HAvg[i] >= HAreaValue_FC && HAvg[i] <= HAreaValue_C) {
+ //鏍规嵁涓婇潰鐨刬鍊肩畻鍑轰粠閭d釜涓嬫爣寮�濮�
+ for (var j = i - 14; j <= i; j++) {
+ //濡傛灉澶т簬璐焎,灏忎簬姝 閭e氨鏈夐棶棰�
+ if (HAvg[j] >= HAreaValue_FC && HAvg[j] <= HAreaValue_C) {
+ //褰撴渶鍚庝竴鏉★紝濡傛灉澶т簬璐焎,灏忎簬姝 灏辫繘鍘昏拷鍔�15鏉℃暟鎹�
+ if (i == j) {
+ for (var j1 = i; j1 >= i - 14; j1--) {
+ if ($.inArray(HAvg[j1], judge_return) == -1) {
+ judge_return.push(HAvg[j1]);
+ }
+ }
+ }
+ } else {
+ break; //缁堟褰撳墠15鏉★紝鎵ц涓嬩竴涓�15鏉�
+ }
+ }
+ }
+ }
+ }
+ //杩炵画14涓偣涓浉閭荤偣浜ゆ浛涓婁笅
+ if (HAvg.length >= 14) {
+ for (var i = 13; i < HAvg.length; i++) {
+ var judge = [];
+ for (var j = i - 13; j < i; j++) {
+ //鐢ㄧ涓�涓窡绗簩鐨勫仛瀵规瘮锛岀浜屼釜璺熺涓変釜鍋氬姣旓紝浠ユ寰幆
+ if (HAvg[j] > HAvg[j + 1]) {
+ judge.push(1);
+ } else if (HAvg[j] < HAvg[j + 1]) {
+ judge.push(-1);
+ }
+ }
+ for (var k = 0; k < judge.length; k++) {
+ if (judge[k] + judge[k + 1] == 0) { //濡傛灉鍓嶅悗鐩稿姞绛変簬0閭e氨鏄弧瓒筹紝涓嶆弧瓒冲氨鐩存帴璺冲嚭
+ if ((k + 1) == judge.length) {
+ for (var j1 = i; j1 >= i - 13; j1--) {
+ if ($.inArray(HAvg[j1], judge_return) == -1) {
+ judge_return.push(HAvg[j1]);
+ }
+ }
+ }
+ } else {
+ break;//缁堟褰撳墠寰幆
+ }
+ }
+ }
+ }
+
+ //杩炵画9涓偣钀藉湪涓績绾跨殑鍚屼竴渚�
+ if (HAvg.length >= 9) {
+ for (var i = 8; i < HAvg.length; i++) {
+ var judge = [];
+ //鐢ㄥ惊鐜殑鍊艰窡涓績绾垮姣�
+ for (var j = i - 8; j <= i; j++) {
+ if (HAvg[j] > parseFloat($("#HCenterline_X").val())) {
+ judge.push(1);
+ } else if (HAvg[j] < parseFloat($("#HCenterline_X").val())) {
+ judge.push(-1);
+ }
+ }
+ //瀵瑰惊鐜殑鎻掑叆鐨勫�硷紝鐩稿姞
+ var sum = 0;
+ for (var k = 0; k < judge.length; k++) {
+ sum += judge[k];
+ }
+ //鍒ゆ柇寰幆鎻掑叆鐨勫�兼槸鍚︾瓑浜庢涔濇垨鑰呰礋涔�
+ if (sum == 9 || sum == -9) {
+ for (var j1 = i; j1 >= i - 8; j1--) {
+ if ($.inArray(HAvg[j1], judge_return) == -1) {
+ judge_return.push(HAvg[j1]);
+ }
+ }
+ }
+ }
+ }
+
+ //杩炵画8鐐硅惤鍦ㄤ腑蹇冪嚎涓や晶涓旀棤涓�鍦–鍖轰互鍐�(鍗冲湪C鍖轰互澶�)
+ if (HAvg.length >= 8) {
+ for (var i = 7; i < HAvg.length; i++) {
+ //寰幆鐨勫�兼槸鍚﹀ぇ浜庢C 鎴栬�� 灏忎簬璐烠
+ if (HAvg[i] < HAreaValue_FC || HAvg[i] > HAreaValue_C) {
+ //婊¤冻 杩涜鍒ゆ柇鍓嶉潰鍊兼槸鍚︽弧瓒�
+ for (var j = i - 7; j <= i; j++) {
+ if (HAvg[j] < HAreaValue_FC || HAvg[j] > HAreaValue_C) {
+ //濡傛灉鏈�鍚庨兘婊¤冻 鎻掑叆
+ if (j == i) {
+ for (var j1 = i; j1 >= i - 7; j1--) {
+ if ($.inArray(HAvg[j1], judge_return) == -1) {
+ judge_return.push(HAvg[j1]);
+ }
+ }
+ }
+ } else {
+ break; //鏈変竴涓笉婊¤冻鐩存帴缁堟褰撳墠寰幆
+ }
+ }
+ }
+ }
+ }
+
+ //杩炵画6鐐归�掑鎴栭�掑噺
+ if (HAvg.length >= 6) {
+ for (var i = 5; i < HAvg.length; i++) {
+ var judge = [];
+ //鐢ㄧ涓�涓窡绗簩鐨勫仛瀵规瘮锛岀浜屼釜璺熺涓変釜鍋氬姣旓紝浠ユ寰幆
+ for (var j = i - 5; j < i; j++) {
+ if (HAvg[j] > HAvg[j + 1]) {
+ judge.push(1);
+ } else if (HAvg[j] < HAvg[j + 1]) {
+ judge.push(-1);
+ }
+ }
+ //瀵硅拷鍔犵殑鍊� 杩涜绱姞
+ var sum = 0;
+ for (var k = 0; k < judge.length; k++) {
+ sum += judge[k];
+ }
+ //濡傛灉鏄浜旀垨鑰呰礋浜� 閭e氨鍏ㄩ儴杩藉姞
+ if (sum == 5 || sum == -5) {
+ for (var j1 = i; j1 >= i - 5; j1--) {
+ if ($.inArray(HAvg[j1], judge_return) == -1) {
+ judge_return.push(HAvg[j1]);
+ }
+ }
+ }
+ }
+ }
+
+ //杩炵画5鐐逛腑鏈�4鐐硅惤鍦ㄤ腑蹇冪嚎鍚屼竴渚х殑C鍖哄
+ if (HAvg.length >= 5) {
+ for (var i = 4; i < HAvg.length; i++) {
+ var judge = [];
+ //褰撳墠鍊煎鏋滃ぇ浜� 涓績绾� 骞朵笖 澶т簬 姝
+ if (HAvg[i] > parseFloat($("#HCenterline_X").val()) && HAvg[i] > HAreaValue_C) {
+ for (var j = i - 4; j <= i; j++) {
+ var record = [];
+ //涓婇潰婊¤冻 鍒ゆ柇 褰撳墠鍊煎鏋滃ぇ浜� 涓績绾� 骞朵笖 澶т簬 姝
+ if (HAvg[j] > parseFloat($("#HCenterline_X").val()) && HAvg[j] > HAreaValue_C) {
+ record.push(HAvg[j]);
+ if (record.length >= 4) {
+ //濡傛灉婊¤冻4鏉′互涓婃暟鎹湁闂 閭e氨寰幆鎶婃暟鎹彃鍏ユ暟缁�
+ for (var j1 = i; j1 >= i - 4; j1--) {
+ //鏍规嵁
+ //if ($.inArray(HAvg[j1], judge_return) == -1) {
+ // judge_return.push(HAvg[j1]);
+ //}
+ if ($.inArray(record[j1], judge_return) == -1) {
+ judge_return.push(record[j1]);
+ }
+ }
+ }
+ }
+
+ }
+ }
+ //褰撳墠鍊煎鏋滃皬浜� 涓績绾� 骞朵笖 灏忎簬 璐烠
+ else if (HAvg[i] < parseFloat($("#HCenterline_X").val()) && HAvg[i] < HAreaValue_FC) {
+ for (var j = i - 4; j <= i; j++) {
+ var record = [];
+ //涓婇潰婊¤冻 鍒ゆ柇 褰撳墠鍊煎鏋滃皬浜� 涓績绾� 骞朵笖 灏忎簬 璐烠
+ if (HAvg[j] < parseFloat($("#HCenterline_X").val()) && HAvg[j] < HAreaValue_FC) {
+ record.push(HAvg[j]);
+ if (record.length >= 4) {
+ //濡傛灉婊¤冻4鏉′互涓婃暟鎹湁闂 閭e氨寰幆鎶婃暟鎹彃鍏ユ暟缁�
+ for (var j1 = i; j1 >= i - 4; j1--) {
+ //if ($.inArray(HAvg[j1], judge_return) == -1) {
+ // judge_return.push(HAvg[j1]);
+ //}
+ if ($.inArray(record[j1], judge_return) == -1) {
+ judge_return.push(record[j1]);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ }
+ }
+
+
+ //杩炵画3鐐逛腑鏈�2鐐硅惤鍦ㄤ腑蹇冪嚎鍚屼竴渚х殑B鍖哄
+ if (HAvg.length >= 3) {
+ for (var i = 2; i < HAvg.length; i++) {
+ var judge = [];
+ //褰撳墠鍊煎鏋滃ぇ浜� 涓績绾� 骞朵笖 澶т簬 姝
+ if (HAvg[i] > parseFloat($("#HCenterline_X").val()) && HAvg[i] > HAreaValue_B) {
+ for (var j = i - 2; j <= i; j++) {
+ var record = [];
+ //涓婇潰婊¤冻 鍒ゆ柇 褰撳墠鍊煎鏋滃ぇ浜� 涓績绾� 骞朵笖 澶т簬 姝
+ if (HAvg[j] > parseFloat($("#HCenterline_X").val()) && HAvg[j] > HAreaValue_B) {
+ record.push(HAvg[j]);
+ if (record.length >= 2) {
+ //濡傛灉婊¤冻2鏉′互涓婃暟鎹湁闂 閭e氨寰幆鎶婃暟鎹彃鍏ユ暟缁�
+ for (var j1 = i; j1 >= i - 2; j1--) {
+ //if ($.inArray(HAvg[j1], judge_return) == -1) {
+ // judge_return.push(HAvg[j1]);
+ //}
+ if ($.inArray(record[j1], judge_return) == -1) {
+ judge_return.push(record[j1]);
+ }
+ }
+ }
+ }
+
+ }
+ }
+ //褰撳墠鍊煎鏋滃皬浜� 涓績绾� 骞朵笖 灏忎簬 璐烞
+ else if (HAvg[i] < parseFloat($("#HCenterline_X").val()) && HAvg[i] < HAreaValue_FB) {
+ for (var j = i - 2; j <= i; j++) {
+ var record = [];
+ //涓婇潰婊¤冻 鍒ゆ柇 褰撳墠鍊煎鏋滃皬浜� 涓績绾� 骞朵笖 灏忎簬 璐烞
+ if (HAvg[j] < parseFloat($("#HCenterline_X").val()) && HAvg[j] < HAreaValue_FB) {
+ record.push(HAvg[j]);
+ if (record.length >= 2) {
+ //濡傛灉婊¤冻2鏉′互涓婃暟鎹湁闂 閭e氨寰幆鎶婃暟鎹彃鍏ユ暟缁�
+ for (var j1 = i; j1 >= i - 2; j1--) {
+ //if ($.inArray(HAvg[j1], judge_return) == -1) {
+ // judge_return.push(HAvg[j1]);
+ //}
+ if ($.inArray(record[j1], judge_return) == -1) {
+ judge_return.push(record[j1]);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ }
+ }
+
+
+ //1涓偣钀藉湪A鍖轰互澶�
+ if (HAvg.length >= 0) {
+ for (var i = 0; i < HAvg.length; i++) {
+ var judge = [];
+ //鍒ゆ柇褰撳墠鍊兼槸鍚﹀ぇ浜� 姝
+ if (HAvg[i] > HAreaValue_A) {
+ if ($.inArray(HAvg[i], judge_return) == -1) {
+ judge_return.push(HAvg[i]);
+ }
+ }
+ //鍒ゆ柇褰撳墠鍊兼槸鍚﹀ぇ浜� 璐烝
+ else if (HAvg[i] < HAreaValue_FA) {
+ if ($.inArray(HAvg[i], judge_return) == -1) {
+ judge_return.push(HAvg[i]);
+ }
+ }
+ }
+ }
+
+ return judge_return;
}
@@ -826,7 +1370,8 @@
var HMaterID = $("#HMaterID").val();//鐗╂枡
var HQCCheckItemID = $("#HQCCheckItemID").val();//妫�楠岄」鐩�
var HMouldNum = $("#HMouldNum").val();//绌村彿
-
+ var HSourceID = $("#HSourceID").val();//鐢熶骇璧勬簮
+ var HProcID = $("#HProcID").val();//宸ュ簭
if (limit == 0) {
return layer.msg("鏍锋湰鏁伴噺涓嶈兘涓�0!");
}
@@ -847,6 +1392,8 @@
, HMaterID: HMaterID
, HQCCheckItemID: HQCCheckItemID
, HMouldNum: HMouldNum
+ , HSourceID: HSourceID
+ , HProcID: HProcID
}
//鍒濆鍖栬〃鏍�
set_InitGrid();
@@ -863,7 +1410,7 @@
, area: ['90%', '90%']//澶у皬
, title: '鐗╂枡鍒楄〃'//鏍囬
, shift: 2//寮瑰嚭鍔ㄧ敾
- , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Material.html', 'yes']
+ , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Material.html?openType=2', 'yes']
, btn: ['纭畾', '鍙栨秷']
, btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
var iframeWindow = window['layui-layer-iframe' + index] //鑾峰彇寮规椤甸潰
@@ -882,6 +1429,57 @@
})
}
+ //鐢熶骇璧勬簮
+ function btnHSourceID() {
+ layer.open({
+ type: 2 //绫诲瀷
+ , skin: 'layui-layer-rim'//鍔犱笂杈规
+ , area: ['90%', '90%']//澶у皬
+ , title: '鐢熶骇璧勬簮鍒楄〃'//鏍囬
+ , shift: 2//寮瑰嚭鍔ㄧ敾
+ , content: ['../../鍩虹璧勬枡/鐢熶骇鍩虹璧勬枡/Gy_Source.html?Htype=&openType=2', 'yes']
+ , btn: ['纭畾', '鍙栨秷']
+ , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
+ var iframeWindow = window['layui-layer-iframe' + index] //鑾峰彇寮规椤甸潰
+ var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
+ if (checkStatus.data.length === 0) {
+ return layer.msg('璇烽�夋嫨鏁版嵁');
+ }
+ //鑾峰彇鏁版嵁
+ $("#HSourceID").val(checkStatus.data[0].HItemID);
+ $("#HSourceName").val(checkStatus.data[0].鐢熶骇璧勬簮鍚嶇О);
+ layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+ }
+ , btn2: function (index, layero) { }
+ })
+ }
+
+ //宸ュ簭
+ function btnHSourceID() {
+ layer.open({
+ type: 2 //绫诲瀷
+ , skin: 'layui-layer-rim'//鍔犱笂杈规
+ , area: ['90%', '90%']//澶у皬
+ , title: '宸ュ簭鍒楄〃'//鏍囬
+ , shift: 2//寮瑰嚭鍔ㄧ敾
+ , content: ['../../鍩虹璧勬枡/鐢熶骇鍩虹璧勬枡/Gy_Process.html?openType=2', 'yes']
+ , btn: ['纭畾', '鍙栨秷']
+ , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
+ var iframeWindow = window['layui-layer-iframe' + index] //鑾峰彇寮规椤甸潰
+ var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
+ if (checkStatus.data.length === 0) {
+ return layer.msg('璇烽�夋嫨鏁版嵁');
+ }
+ //鑾峰彇鏁版嵁
+ $("#HProcID").val(checkStatus.data[0].HItemID);
+ $("#HProcName").val(checkStatus.data[0].宸ュ簭鍚嶇О);
+ layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+ }
+ , btn2: function (index, layero) { }
+ })
+ }
+
+
//妫�楠岄」鐩垪琛�
function btnHQCCheckItemID() {
layer.open({
@@ -890,7 +1488,7 @@
, area: ['90%', '90%']//澶у皬
, title: '妫�楠岄」鐩垪琛�'//鏍囬
, shift: 2//寮瑰嚭鍔ㄧ敾
- , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_CheckItem.html', 'yes']
+ , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_CheckItem.html?Type=SPC&ID=' + HQCCheckNum.toString(), 'yes']
, btn: ['纭畾', '鍙栨秷']
, btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
var iframeWindow = window['layui-layer-iframe' + index] //鑾峰彇寮规椤甸潰
@@ -902,8 +1500,8 @@
$("#HQCCheckItemID").val(checkStatus.data[0].HItemID);
$("#HQCCheckItemNumber").val(checkStatus.data[0].浠g爜);
- btnCheckProjectList();
-
+ btnCheckProjectList(1);
+
layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
}
, btn2: function (index, layero) { }
@@ -911,8 +1509,18 @@
}
//妫�楠屾柟妗�
- function btnCheckProjectList() {
- var sWheres = " and 妫�楠岄」鐩唬鐮�='" + $("#HQCCheckItemNumber").val() + "'";
+ function btnCheckProjectList(Type) {
+ HQCCheckNum = [];
+ //Type 1 鏍规嵁閫変腑鐨勬楠岄」鐩幓鏌ヨ鏁版嵁
+ //Type 2 鏍规嵁閫変腑鐨勭墿鏂欏幓鏌ヨ鏁版嵁
+ var sWheres = "";
+ if (Type == 1) {
+ sWheres = " and 妫�楠岄」鐩唬鐮�='" + $("#HQCCheckItemNumber").val() + "' and 鐗╂枡浠g爜='" + $("#HMaterNumber").val() + "'";
+ }
+ if (Type == 2) {
+ sWheres = " and 鐗╂枡浠g爜='" + $("#HMaterNumber").val() + "'";
+ }
+
var wait = layer.load();//閬僵
$.ajax({
url: GetWEBURL() + '/QC_Management/MES_QC_CheckProjectListProjectDetaiList',
@@ -922,9 +1530,17 @@
success: function (data1) {
if (data1.count == 1) {
layer.close(wait);
- $("#HUpLimit").val(data1.data[0].涓婇檺鍊�);
- $("#HDownLimit").val(data1.data[0].涓嬮檺鍊�);
- $("#HTargetVal").val(data1.data[0].鐩爣鍊�);
+
+ if (Type == 1) {
+ $("#HUpLimit").val(data1.data[0].涓婇檺鍊�);
+ $("#HDownLimit").val(data1.data[0].涓嬮檺鍊�);
+ $("#HTargetVal").val(data1.data[0].鐩爣鍊�);
+ }
+ if (Type == 2) {
+ for (var i = 0; i < data1.data.length; i++) {
+ HQCCheckNum.push(data1.data[i]["妫�楠岄」鐩甀D"]);
+ }
+ }
//$("#HControlUpperLimit").val(data1.data[0].鎺у埗涓婇檺);
//$("#HControlLowerLimit").val(data1.data[0].鎺у埗涓嬮檺);
} else {
--
Gitblit v1.9.1