From de7931bdf73d57ca79eeb0cd48ea3a0ea5453e0e Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期一, 26 八月 2024 09:45:21 +0800
Subject: [PATCH] 新增制程陷阱测试趋势图、PPM绩效趋势图报表模块
---
WebTM/views/质量管理/工序检验单/QC_ProcessCheckBillList2.html | 271 +++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 257 insertions(+), 14 deletions(-)
diff --git "a/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillList2.html" "b/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillList2.html"
index 11af015..dd85df3 100644
--- "a/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillList2.html"
+++ "b/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillList2.html"
@@ -44,6 +44,13 @@
</div>
</div>
<div class="layui-inline">
+ <label class="layui-form-label">鏃ユ湡闂撮殧</label>
+ <div class="layui-input-block">
+ <select name="HInitTimeCycle" id="HInitTimeCycle" class="ForFilteringSchemes" lay-filter="HInitTimeCycle" style="width:190px;">
+ </select>
+ </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 ForFilteringSchemes" name="HDate1" id="HDate1">
@@ -87,6 +94,14 @@
<label class="layui-form-label" style="width: 85px;">璐ㄦ鍛�</label>
<div class="layui-input-block" style="margin-left: 120px;">
<input type="text" class="layui-input ForFilteringSchemes" name="HName1" id="HName1">
+ </div>
+ </div>
+ <div class="layui-inline">
+ <label class="layui-form-label" style="width: 85px;">椤圭洰鍙�</label>
+ <div class="layui-input-block" style="margin-left: 120px; width: 185px;">
+ <select name="HProject" id="HProject" class=" ForFilteringSchemes" lay-verify="HProject">
+ <!--鍔ㄦ�佹覆鏌撶粍缁�-->
+ </select>
</div>
</div>
</div>
@@ -146,6 +161,60 @@
</div>
<div class="layui-inline">
<input type="text" class="layui-input ForFilteringSchemes" value="" name="ColContent" id="ColContent">
+ </div>
+ </div>
+ <div class="layui-row" style="margin-top:5px">
+ <div class="layui-inline">
+ <label class="layui-form-label">杩囨护</label>
+ <div class="layui-input-block">
+ <select name="ColName1" id="ColName1" lay-filter="ColName1" style="width:190px;">
+ </select>
+ </div>
+ </div>
+ <div class="layui-inline">
+ <select name="Comparator1" id="Comparator1" lay-filter="Comparator1" style="width:190px;">
+ <option value="0" selected="selected"></option>
+ <option value="=">=</option>
+ <option value=">=">>=</option>
+ <option value=">">></option>
+ <option value="<="><=</option>
+ <option value="<"><</option>
+ <option value="<>"><></option>
+ <option value="7">鍖呭惈</option>
+ <option value="8">宸﹀寘鍚�</option>
+ <option value="9">鍙冲寘鍚�</option>
+ <option value="10">涓嶅寘鍚�</option>
+ </select>
+ </div>
+ <div class="layui-inline">
+ <input type="text" class="layui-input" value="" name="ColContent1" id="ColContent1">
+ </div>
+ </div>
+ <div class="layui-row" style="margin-top:5px">
+ <div class="layui-inline">
+ <label class="layui-form-label">杩囨护</label>
+ <div class="layui-input-block">
+ <select name="ColName2" id="ColName2" lay-filter="ColName2" style="width:190px;">
+ </select>
+ </div>
+ </div>
+ <div class="layui-inline">
+ <select name="Comparator2" id="Comparator2" lay-filter="Comparator2" style="width:190px;">
+ <option value="0" selected="selected"></option>
+ <option value="=">=</option>
+ <option value=">=">>=</option>
+ <option value=">">></option>
+ <option value="<="><=</option>
+ <option value="<"><</option>
+ <option value="<>"><></option>
+ <option value="7">鍖呭惈</option>
+ <option value="8">宸﹀寘鍚�</option>
+ <option value="9">鍙冲寘鍚�</option>
+ <option value="10">涓嶅寘鍚�</option>
+ </select>
+ </div>
+ <div class="layui-inline">
+ <input type="text" class="layui-input" value="" name="ColContent2" id="ColContent2">
</div>
</div>
</div>
@@ -338,12 +407,33 @@
//#region 鏌ヨ鎸夐挳
form.on('submit(btnSearch)', function (data) {
- get_FastQuery();
+ if ($("#HProject").val() == 0) {
+ get_FastQuery();
+ } else {
+ get_FastQuery(2);
+ }
});
//#endregion
//#endregion
+ //鏃ユ湡闂撮殧涓嬫媺鍒楄〃鐩戝惉
+ form.on('select(HInitTimeCycle)', function (data) {
+ var HInitTimeCycle = $("#HInitTimeCycle").val() * 1;
+ //鑻ユ棩鏈熼棿闅斾笉涓� 浠绘剰闂撮殧锛屽垯绂佺敤寮�濮嬫棩鏈熶笌缁撴潫鏃ユ湡鐨勯�夋嫨
+ if (HInitTimeCycle != -1) {
+ $('#HDate1').prop('disabled', true);
+ $('#HDate2').prop('disabled', true);
+ $("#HDate1").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * HInitTimeCycle), "yyyy-MM-dd"));
+ $("#HDate2").val(Format(new Date(), "yyyy-MM-dd"));
+
+ //鎵ц鏌ヨ鏂规硶
+ get_FastQuery();
+ } else {
+ $('#HDate1').prop('disabled', false);
+ $('#HDate2').prop('disabled', false);
+ }
+ });
//#region 鏈〉闈㈡墍鏈夎璋冪敤鐨勬柟娉�
//#region 鍒濆鍖栫晫闈�
@@ -354,12 +444,25 @@
laydate.render({
elem: '#HDate2'
});
- $("#HDate1").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
+ //鍒濆鍖栨棩鏈熼棿闅斻�佸紑濮嬫棩鏈熴�佺粨鏉熸棩鏈�
+ setSelect_HInitTimeCycle();
+ //鑻ユ棩鏈熼棿闅斾笉涓� 浠绘剰闂撮殧锛屽垯绂佺敤寮�濮嬫棩鏈熶笌缁撴潫鏃ユ湡鐨勯�夋嫨
+ var HInitTimeCycle = $("#HInitTimeCycle").val() * 1;
+ if (HInitTimeCycle != -1) {
+ $('#HDate1').prop('disabled', true);
+ $('#HDate2').prop('disabled', true);
+ } else {
+ $('#HDate1').prop('disabled', false);
+ $('#HDate2').prop('disabled', false);
+ }
+
+ //鏍规嵁鏃ユ湡闂撮殧璁剧疆寮�濮嬫椂闂翠笌缁撴潫鏃堕棿
+ $("#HDate1").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * HInitTimeCycle), "yyyy-MM-dd"));
$("#HDate2").val(Format(new Date(), "yyyy-MM-dd"));
//鍒濆鍖栬〃鏍�
set_InitGrid();
- //鏌ヨ
- get_Display(sWhere);
+ //鑾峰彇椤圭洰鍙�
+ Get_HProject();
//鏌ヨ褰撳墠鐧诲綍鐢ㄦ埛鏈夋病鏈夊湪褰撳墠妯″潡璁剧疆榛樿杩囨护鏂规
get_DefaultModule();
@@ -377,14 +480,42 @@
, totalRow: true
//, cellMinWidth: 90
, limit: 50
- , limits: [50, 500, 5000, 50000]
+ , limits: [50, 500, 5000, 20000]
, done: function (res, curr, count) {
soulTable.render(this);
}
};
}
//#endregion
+ //#endregion 鐩戝惉缃戞牸琛ㄤ綋浜嬩欢
+ table.on('tool(mainTable)', function (obj) {
+ var data = obj.data;
+ //鍗曟嵁鍙疯秴閾炬帴
+ if (obj.event == '鍗曟嵁鍙�') { //妫�鏌� obj.event 鏄惁绛変簬瀛楃涓� '鍗曟嵁鍙�'銆傚鏋滅瓑浜庯紝鍒欐墽琛宨f寰幆
+ var linterid = data.hmainid.toString(); //澹版槑鍙橀噺linterid 涓� data.hmainid
+ //if (AllowLoadData(sSubStr) != false) {//闈炵┖楠岃瘉
+ layer.open({ //浣跨敤 layer鐨刼pen鎵撳紑寮瑰嚭 灞�
+ type: 2 //琛ㄧず寮瑰嚭灞傜殑鍐呭鏄竴涓� iframe
+ , area: ['100%', '100%']
+ , title: '缂栬緫' + HPageTitle //璁剧疆寮瑰嚭灞傜殑鍚嶅瓧鍜屽彉閲�
+ , closeBtn: 1//鏄剧ず鍏抽棴鎸夐挳
+ , shade: 0.6 //閬僵閫忔槑搴�
+ , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+ , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+ , content: '../宸ュ簭妫�楠屽崟/QC_ProcessCheckBill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=' //璁剧疆 iframe 鐨� URL锛孶RL 涓寘鍚簡鏌ヨ鍙傛暟锛屾潵璋冪敤鎵�闇�瑕佺殑鍊�
+
+ , resize: false, //鏄惁鍏佽鐢ㄦ埛璋冩暣寮瑰嚭澶у皬
+ end: function () { //褰撳叧闂椂璋冪敤
+ get_FastQuery(table, option);
+ }
+ , cancel: function () { //鐐瑰嚮鍙栨秷鏃朵娇鐢ㄥ洖璋�
+ //$(".layui-btn").removeClass("layui-btn-disabled");
+ }
+ })
+ }
+ });
+ //#endregion
//#region 鏌ヨ
function get_Display(sWhere) {
var ajaxLoad = layer.load();
@@ -397,7 +528,7 @@
success: function (data1) {
if (data1.count == 1) {
layer.close(ajaxLoad);
-
+ var totalArray = [];
var data = [];
var col = [];
//缁欑┖鐨勬暟缁勮祴鍊�
@@ -409,6 +540,10 @@
for (var i = 0; i < data.length; i++) {
if ($.inArray(data[i].name, titleData) > -1) {
col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //闅愯棌id鍒�
+ } else if ($.inArray(data[i].name, totalArray) > -1) { //璁$畻鍒�
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120 });
+ } else if (data[i].name == '鍗曟嵁鍙�') {
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, event: '鍗曟嵁鍙�' });
}
else {
switch (data[i].Type) {
@@ -467,9 +602,10 @@
//#region 蹇�熻繃婊�
- function get_FastQuery() {
+ function get_FastQuery(number) {
var sqlWhere = " and 1=1 ";
var HBillNo = $("#HBillNo").val();//鍗曟嵁鍙�
+ var HProject = $("#HProject").val();//椤圭洰鍙�
var HNumber = $("#HNumber").val();//鐗╂枡缂栫爜
var HName = $("#HName").val();//鐗╂枡鍚嶇О
var HModel = $("#HModel").val();//瑙勬牸鍨嬪彿
@@ -483,6 +619,12 @@
var ColName = $("#ColName").val();//澶嶉�夋
var Comparator = $("#Comparator").val()
var ColContent = $("#ColContent").val();
+ var ColName1 = $("#ColName1").val();//澶嶉�夋
+ var Comparator1 = $("#Comparator1").val()
+ var ColContent1 = $("#ColContent1").val();
+ var ColName2 = $("#ColName2").val();//澶嶉�夋
+ var Comparator2 = $("#Comparator2").val()
+ var ColContent2 = $("#ColContent2").val();
if (ColName != 0 && Comparator != 0) {
var com = "";
@@ -505,7 +647,48 @@
}
sqlWhere += " and " + ColName + " " + com;
}
-
+ if (ColName1 != 0 && Comparator1 != 0) {
+ var com1 = "";
+ switch (Comparator1) {
+ case "7":
+ com1 = "like'%" + ColContent1 + "%'";
+ break;
+ case "8":
+ com1 = "like'%" + ColContent1 + "'";
+ break;
+ case "9":
+ com1 = "like'" + ColContent1 + "%'";
+ break;
+ case "10":
+ com1 = "not like'%" + ColContent1 + "%'";
+ break;
+ default:
+ com1 = "" + Comparator1 + "'" + ColContent1 + "'";
+ break;
+ }
+ sWhere += " and " + ColName1 + " " + com1;
+ }
+ if (ColName2 != 0 && Comparator2 != 0) {
+ var com2 = "";
+ switch (Comparator2) {
+ case "7":
+ com2 = "like'%" + ColContent2 + "%'";
+ break;
+ case "8":
+ com2 = "like'%" + ColContent2 + "'";
+ break;
+ case "9":
+ com2 = "like'" + ColContent2 + "%'";
+ break;
+ case "10":
+ com2 = "not like'%" + ColContent2 + "%'";
+ break;
+ default:
+ com2 = "" + Comparator + "'" + ColContent + "'";
+ break;
+ }
+ sWhere += " and " + ColName2 + " " + com2;
+ }
if (HBillNo)
sqlWhere += " and 鍗曟嵁鍙� like '%" + HBillNo + "%'";
if (HNumber)
@@ -526,10 +709,15 @@
sqlWhere += " and 宸ュ簭娴佽浆鍗″彿 like '%" + HProcExchBillNo + "%'";
if (HDate1) {
- sqlWhere += " and 鏃ユ湡 >= '" + HDate1 + "'";
+ sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + HDate1 + "'";
}
if (HDate2) {
- sqlWhere += " and 鏃ユ湡 <= '" + HDate2 + "'";
+ sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) <= '" + HDate2 + "'";
+ }
+ if (number == 2) {
+ if (HProject) {
+ sqlWhere += " and 椤圭洰鍙� like '%" + HProject + "%'";
+ }
}
get_Display(sqlWhere);
}
@@ -537,17 +725,25 @@
//#region 閲嶇疆杩囨护鏉′欢鏂规硶
function set_ClearQuery() {
+ var HInitTimeCycle = $("#HInitTimeCycle").val() * 1;
+ $("#HDate1").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * HInitTimeCycle), "yyyy-MM-dd")); //寮�濮嬫棩鏈�
+ $("#HDate2").val(Format(new Date(), "yyyy-MM-dd")); //缁撴潫鏃ユ湡
$("#HBillNo").val("");
$("#HProNumber").val("");
$("#HName").val("");
-
+ $("#HProject").val("");
$("#HNumber").val("");
$("#HModel").val("");
$("#HName1").val("");
$("#HName2").val("");
$("#HName3").val("");
$("#HProcExchBillNo").val("");
-
+ $("#ColContent2").val("");
+ $("#ColName2").val("0");
+ $("#Comparator2").val("0");
+ $("#ColContent1").val("");
+ $("#ColName1").val("0");
+ $("#Comparator1").val("0");
$("#HReceiveEmp").val("");
$("#HBillStatus").val("");
$("#HOrgID").val(sessionStorage["OrganizationID"]);
@@ -810,7 +1006,8 @@
var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁
//var titleData = ["鍗曟嵁ID", "HMouldID", "hsubid", "HManagerID", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
-
+ //涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+ var titleData = ["hmainid", "hentryid", "HEntryID", "HSourceID", "HMaterID", "HFirstCheckEmp", "HQCCheckItemID", "HUnitID", "HSampleSchemeID"];
dataCol = data1.data[0].HGridString.split(',');
for (var i = 0; i < option.cols[0].length - 1; i++) {
@@ -907,12 +1104,33 @@
Organization += '<option style="color:blue;" value="' + option.cols[0][i].field + '">' + option.cols[0][i].field + '</option>';
}
}
+ $("#ColName1").empty();
+ $("#ColName1").append(Organization);
+ $("#ColName2").empty();
+ $("#ColName2").append(Organization);
$("#ColName").empty();
$("#ColName").append(Organization);
form.render('select');
}
//#endregion
+ //#region 鍒濆鏃ユ湡闂撮殧 涓嬫媺鍒楄〃
+ function setSelect_HInitTimeCycle() {
+ var valueList = [0, 1, 2, 3, 4, 5, 6, 29];
+ var titleList = ["浠婂ぉ", "杩戜袱澶�", "杩戜笁澶�", "杩戝洓澶�", "杩戜簲澶�", "杩戝叚澶�", "杩戜竷澶�", "杩�30澶�"];
+
+ var HInitTimeCycle_ArrayList = '<option value="-1" selected="selected" >浠绘剰闂撮殧</option>';
+ for (var i = 0; i < valueList.length; i++) {
+ HInitTimeCycle_ArrayList += '<option style="color:blue;" value="' + valueList[i] + '">' + titleList[i] + '</option>';
+ }
+
+ $("#HInitTimeCycle").empty();
+ $("#HInitTimeCycle").append(HInitTimeCycle_ArrayList);
+ form.render('select');
+
+ $("#HInitTimeCycle").val("29");
+ }
+ //#endregion
//#region 鑾峰彇鍙傛暟
function getUrlVars() {
var vars = [], hash;
@@ -923,6 +1141,31 @@
vars[hash[0]] = hash[1];
}
return vars;
+ }
+ //#endregion
+
+ //#region 鑾峰彇椤圭洰鍙�
+ function Get_HProject() {
+ //鑾峰彇椤圭洰鍙�
+ var HProjectList = '<option value="0" style="color:red;" selected></option>';
+ $.ajax({
+ type: "get",
+ url: GetWEBURL() + "/Gy_Material/Get_HProject",
+ async: false,
+ data: { "HOrgID": sessionStorage["OrganizationID"] },
+ success: function (result) {
+ if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+ var data = result.data;
+ for (var i = 0; i < data.length; i++) {
+ HProjectList += '<option style="color:blue;" value="' + data[i].HName + '" >' + data[i].HName + '</option>';
+ }
+ $("#HProject").append(HProjectList);
+ form.render('select');
+
+ }
+ layer.closeAll("loading");
+ }
+ })
}
//#endregion
@@ -969,7 +1212,7 @@
document.getElementById("HFilterScheme_Now").style.display = "none";
//鎵ц鏌ヨ鏂规硶
//鏌ヨ
- //get_FastQuery();
+ get_FastQuery();
form.render("select");
}
--
Gitblit v1.9.1