From 3b57005ff0ece33bde3cce11bc3a93ab57722071 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期四, 04 七月 2024 15:59:00 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-LayUI
---
WebTM/views/设备管理/Sb_EquipDotCheckBillEdit.html | 407 ++++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 353 insertions(+), 54 deletions(-)
diff --git "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipDotCheckBillEdit.html" "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipDotCheckBillEdit.html"
index 133970e..8f90645 100644
--- "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipDotCheckBillEdit.html"
+++ "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipDotCheckBillEdit.html"
@@ -13,15 +13,24 @@
<script src="../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
<script src="../../layuiadmin/Scripts/webConfig.js"></script>
<script src="../../layuiadmin/PubCustom.js"></script>
- <script src="../../../layuiadmin/PageTitle.js"></script>
+ <script src="../../layuiadmin/PageTitle.js"></script>
<style type="text/css">
.layui-form-label {
width: 95px;
}
+ /* 闃叉涓嬫媺妗嗙殑涓嬫媺鍒楄〃琚殣钘�---蹇呴』璁剧疆--- */
+ .layui-table-cell {
+ overflow: visible !important;
+ }
+ /* 浣垮緱涓嬫媺妗嗕笌鍗曞厓鏍煎垰濂藉悎閫� */
+ td .layui-form-select {
+ margin-top: -10px;
+ margin-left: -15px;
+ margin-right: -15px;
+ }
</style>
</head>
<body>
-
<div id="layout1" class="layui-fluid">
<div class="layui-row layui-col-space15">
<div class="layui-col-md12">
@@ -29,13 +38,9 @@
<form id="form0" class="layui-form" lay-filter="component-form-group" action="">
<div class="layui-card-header">
<div class="layui-btn-group">
-
<button type="button" id="add-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_SaveBill">淇濆瓨</button>
<button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Cancel">閫�鍑�</button>
-
-
</div>
-
</div>
<div class="layui-card-body">
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
@@ -50,7 +55,7 @@
<div class="layui-inline">
<label class="layui-form-label">鍗曟嵁鍙�</label>
<div class="layui-input-inline">
- <input class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly>
+ <input class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly>
<input id="HInterID" name="HInterID" type="hidden" />
<input id="HMaker" name="HMaker" type="hidden" /><!--鍒跺崟浜�-->
</div>
@@ -71,7 +76,7 @@
<label class="layui-form-label">璁惧<label style="color:red"> * </label></label>
<div class="layui-input-inline">
<input type="hidden" name="HEquipID" id="HEquipID" class="layui-input" value="" style="float:left;width:150px;">
- <input type="text" name="HEquipName" id="HEquipName" class="layui-input" value="" style="float:left;width:150px;background-color:#efefef4d;"readonly="readonly">
+ <input type="text" name="HEquipName" id="HEquipName" class="layui-input" value="" style="float:left;width:150px;background-color:#efefef4d;" readonly="readonly">
<button type="button" lay-submit="" class="layui-btn" lay-filter="ProductModulList" style="width:40px;">
<i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
</button>
@@ -117,6 +122,36 @@
</div>
<div class="layui-form-item">
<div class="layui-inline">
+ <label class="layui-form-label">寮傚父鎯呭喌璁板綍</label>
+ <div class="layui-input-inline">
+ <input type="text" name="HErrNote" id="HErrNote" class="layui-input">
+ </div>
+ </div>
+ <div class="layui-inline">
+ <label class="layui-form-label">閲嶅ぇ瀹夊叏<br />闅愭偅璁板綍</label>
+ <div class="layui-input-inline" style="margin-top:10px;">
+ <input type="text" name="HBigSafeNote" id="HBigSafeNote" class="layui-input">
+ </div>
+ </div>
+ <div class="layui-inline">
+ <label class="layui-form-label">鐐规鏁版嵁</label>
+ <div class="layui-input-inline">
+ <input type="text" name="HDotCheckNote" id="HDotCheckNote" class="layui-input">
+ </div>
+ </div>
+ <div class="layui-inline">
+ <label class="layui-form-label">鐢熶骇鐝</label>
+ <div class="layui-input-inline">
+ <input type="hidden" name="HShiftsID" id="HShiftsID" class="layui-input" value="0" style="float:left;width:150px;">
+ <input type="text" name="HShiftsName" id="HShiftsName" class="layui-input" value="" style="float:left;width:150px;background-color:#efefef4d;" readonly="readonly">
+ <button type="button" lay-submit="" class="layui-btn" lay-filter="btnHShifts" style="width:40px;">
+ <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
+ </button>
+ </div>
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <div class="layui-inline">
<label class="layui-form-label">鎽樿</label>
<div class="layui-input-inline">
<textarea placeholder="璇疯緭鍏ユ憳瑕�" class="layui-textarea" name="HExplanation" id="HExplanation"></textarea>
@@ -126,6 +161,13 @@
<label class="layui-form-label">澶囨敞</label>
<div class="layui-input-inline">
<textarea placeholder="璇疯緭鍏ュ娉�" class="layui-textarea" name="HRemark" id="HRemark"></textarea>
+ </div>
+ </div>
+ <div class="layui-inline">
+ <label class="layui-form-label">鏈�缁堢粨璁�</label>
+ <div class="layui-input-inline">
+ <input type="radio" name="HLastResult" id="HLastResult" value="OK" title="OK" checked>
+ <input type="radio" name="HLastResult" id="HLastResult" value="NG" title="NG">
</div>
</div>
</div>
@@ -155,7 +197,16 @@
<!--<a class="layui-btn layui-btn-xs" lay-event="edit">缂栬緫</a>-->
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">鍒犻櫎</a>
</script>
+ <!--琛屼笅鎷夐�夋嫨(鐐规缁撴灉)-->
+ <script type="text/html" id="HDotCheckResult">
+ <select name="HDotCheckResult" lay-filter="HDotCheckResult" id="HDotCheckResult{{d.LAY_TABLE_INDEX+1}}">
+ <!--<option value="">璇烽�夋嫨</option>-->
+ <option value="Y" selected>Y</option>
+ <option value="X">X</option>
+ </select>
+ </script>
<script>
+ var OptionData = [];
//鑾峰彇鍙傛暟
var params = get_UrlVars();
if (typeof (params[params[0]]) == "undefined") {
@@ -220,7 +271,7 @@
table.on('toolbar(mainTable)', function (obj) {
var checkStatus = table.checkStatus('mainTable')
, data = checkStatus.data;
- var NewRow = { "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": sessionStorage["HEmpID"], "HManagerCode": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": "" };
+ var NewRow = { "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": sessionStorage["HEmpID"], "HManagerCode": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "","HDotCheckResult":"Y"};
switch (obj.event) {
//鏂板涓�琛�
case 'btn-AddLine': btnAddLine(NewRow);
@@ -271,6 +322,42 @@
}
});
});
+
+ //琛ㄥご淇℃伅鐢熶骇鐝寮圭獥
+ form.on('submit(btnHShifts)', function () {
+ //椤甸潰灞�-鑷畾涔�
+ layer.open({
+ type: 2,
+ skin: 'layui-layer-rim', //鍔犱笂杈规
+ title: '鐢熶骇鐝鍒楄〃',
+ closeBtn: 1,
+ shift: 2,
+ area: ['80%', '80%'],
+ maxmin: true
+ , content: ['../鍩虹璧勬枡/鐢熶骇鍩虹璧勬枡/Gy_ShiftsList.html', '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('璇烽�夋嫨鏁版嵁');
+ }
+ $("#HShiftsID").val(checkStatus.data[0].HItemID);
+ $("#HShiftsName").val(checkStatus.data[0].鐝鍚嶇О);
+ layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+ }
+ , btn2: function (index, layero) {
+ //鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
+ //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
+ },
+ end: function () {
+ },
+ success: function (layero, index) {
+ }
+ });
+ });
+
//鑾峰彇璁惧鐐规瑙勭▼
function get_DocCheckItem() {
$.ajax({
@@ -282,7 +369,7 @@
if (result.count == 1) {
var DJData = result;//
var rowdate1 = layui.table.cache["mainTable"];
- option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": " ", "HDotCheckItem": " ", "HDotCheckPart": " ", "HClaim": " ", "HManagerID": 0, "HManagerCode": " ", "HManagerName": " ", "HRemark": " " }];
+ option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": " ", "HDotCheckItem": " ", "HDotCheckPart": " ", "HClaim": " ", "HManagerID": 0, "HManagerCode": " ", "HManagerName": " ", "HRemark": " ", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y"}];
table.render(option);
$("#HEquipDotCheckRuleInterID").val(DJData.data[0].HInterID);
$("#HEquipDotCheckRuleInterNo").val(DJData.data[0].HBillNo);
@@ -293,17 +380,20 @@
var checkrow = {
"HDotCheckItemID": DJData.data[i].HDotCheckItemID, "HDotCheckCode": DJData.data[i].HDotCheckCode, "HDotCheckItem": DJData.data[i].HDotCheckItem,
"HDotCheckPart": DJData.data[i].HDotCheckPart, "HManagerID": DJData.data[i].HManagerID, "HManagerCode": DJData.data[i].HManagerCode,
- "HManagerName": DJData.data[i].HManagerName
+ "HManagerName": DJData.data[i].HManagerName, "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y"
};
buttonArr.push(checkrow); //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍
}
- table.reload("mainTable", {
- data: buttonArr //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
- })
+
+ option.data = buttonArr;
+ table.render(option);
+ //table.reload("mainTable", {
+ // data: buttonArr //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
+ //})
}
}
else {
- option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "" }];
+ option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y" }];
table.render(option);
//layer.alert("璇ヨ澶囨殏鏃犻粯璁ょ偣妫�璁板綍", { icon: 5 });
}
@@ -347,7 +437,40 @@
}
});
});
- function get_DocCheckItem2() {
+ //琛岄�夋嫨澶勭悊锛堢偣妫�缁撴灉锛�
+ form.on('select(HDotCheckResult)', function (data) {
+ //鑾峰彇涓嬫媺妗嗛�変腑鐨勫��
+ var elem = data.othis.parents('tr');
+ var dataindex = elem.attr("data-index");
+ $.each(option.data, function (index, value) {
+ if (value.LAY_TABLE_INDEX == dataindex) {
+ value.HDotCheckResult = data.value;//鎶婇�変腑涓嬫媺妗唅d鍊艰祴鍊肩粰琛ㄦ牸缂撳瓨
+ }
+ });
+
+ //for (var i = 1; i <= option.data.length; i++) {
+ // $('#HDotCheckResult' + i + '').find("option[value='" + option.data[i - 1].HDotCheckResult + "']").attr("selected", true);
+ //}
+ //form.render('select');
+ console.log(table.cache['mainTable']);
+
+ var HQty = 0;//琛ㄤ綋琛屼笉鍚堟牸鏁伴噺
+ for (let i = 0; i < table.cache['mainTable'].length; i++) {
+ if (table.cache['mainTable'][i].HDotCheckResult == "X") {
+ HQty++;
+ }
+ }
+ if (HQty > 0) {
+ document.querySelectorAll("[name='HLastResult']")[0].removeAttribute('checked'); //鍒犻櫎閫夋嫨灞炴��
+ $("input:radio[name=HLastResult][value=" + "NG" + "]").attr("checked", "true"); //娣诲姞閫夋嫨灞炴��
+ } else {
+ document.querySelectorAll("[name='HLastResult']")[1].removeAttribute('checked'); //鍒犻櫎閫夋嫨灞炴��
+ $("input:radio[name=HLastResult][value=" + "OK" + "]").attr("checked", "true"); //娣诲姞閫夋嫨灞炴��
+ }
+ form.render('radio');
+ });
+
+ window.get_DocCheckItem2 = function () {
$.ajax({
url: GetWEBURL() + "/Web/GetDotCheckRuleItemByDotCheckRuleID",
type: "GET",
@@ -357,7 +480,7 @@
if (result.count == 1) {
var DJData = result;//
var rowdate1 = layui.table.cache["mainTable"];
- option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": " ", "HDotCheckItem": " ", "HDotCheckPart": " ", "HClaim": " ", "HManagerID": 0, "HManagerCode": " ", "HManagerName": " ", "HRemark": " " }];
+ option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": " ", "HDotCheckItem": " ", "HDotCheckPart": " ", "HClaim": " ", "HManagerID": 0, "HManagerCode": " ", "HManagerName": " ", "HRemark": " ", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y"}];
table.render(option);
if (DJData.data.length != 0) //琛ㄤ綋鏁版嵁涓虹┖鏃�
@@ -367,17 +490,19 @@
var checkrow = {
"HDotCheckItemID": DJData.data[i].HDotCheckItemID, "HDotCheckCode": DJData.data[i].HDotCheckCode, "HDotCheckItem": DJData.data[i].HDotCheckItem,
"HDotCheckPart": DJData.data[i].HDotCheckPart, "HManagerID": DJData.data[i].HManagerID, "HManagerCode": DJData.data[i].HManagerCode,
- "HManagerName": DJData.data[i].HManagerName
+ "HManagerName": DJData.data[i].HManagerName, "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y"
};
buttonArr.push(checkrow); //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍
}
- table.reload("mainTable", {
- data: buttonArr //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
- })
+ option.data = buttonArr;
+ table.render(option);
+ //table.reload("mainTable", {
+ // data: buttonArr //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
+ //})
}
}
else {
- option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "" }];
+ option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y"}];
table.render(option);
//layer.alert("璇ヨ澶囨殏鏃犻粯璁ょ偣妫�璁板綍", { icon: 5 });
}
@@ -407,7 +532,7 @@
return layer.msg('璇烽�夋嫨涓�鏉℃暟鎹�');
}
$("#HPlanName").val(checkStatus.data[0].鍗曟嵁鍙�);
- $("#HPlanNo").val(checkStatus.data[0].hmainid);
+ $("#HPlanNo").val(checkStatus.data[0].鍗曟嵁鍙�);
$("#HEquipDotCheckPlanInterID").val(checkStatus.data[0].hmainid);
//$("#HEquipName").val(checkStatus.data[0].璁惧鍚嶇О);
//$("#HEquipID").val(checkStatus.data[0].璁惧ID);
@@ -432,7 +557,7 @@
if (result.count == 1) {
var DJData = result.data;//
var rowdate1 = layui.table.cache["mainTable"];
- option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": " ", "HDotCheckItem": " ", "HDotCheckPart": " ", "HClaim": " ", "HManagerID": 0, "HManagerCode": " ", "HManagerName": " ", "HRemark": " " }];
+ option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": " ", "HDotCheckItem": " ", "HDotCheckPart": " ", "HClaim": " ", "HManagerID": 0, "HManagerCode": " ", "HManagerName": " ", "HRemark": " ", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y" }];
table.render(option);
if (DJData.length != 0) //琛ㄤ綋鏁版嵁涓虹┖鏃�
@@ -443,19 +568,22 @@
var checkrow = {
"HDotCheckItemID": DJData[i].HDotCheckID, "HDotCheckCode": DJData[i].鐐规椤圭洰浠g爜, "HDotCheckItem": DJData[i].鐐规椤圭洰,
"HDotCheckPart": DJData[i].鐐规閮ㄤ綅, "HClaim": DJData[i].鍏蜂綋瑕佹眰, "HManagerID": DJData[i].HEmployeeID,
- "HManagerCode": DJData[i].璐熻矗浜轰唬鐮�, "HManagerName": DJData[i].璐熻矗浜哄悕绉�, "HRemark": DJData[i].HRemark
+ "HManagerCode": DJData[i].璐熻矗浜轰唬鐮�, "HManagerName": DJData[i].璐熻矗浜哄悕绉�, "HRemark": DJData[i].HRemark,
+ "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y"
};
buttonArr.push(checkrow); //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍
}
- table.reload("mainTable", {
- data: buttonArr //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
- })
+ option.data = buttonArr;
+ table.render(option);
+ //table.reload("mainTable", {
+ // data: buttonArr //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
+ //})
} else {
layer.alert("鐐瑰墠鏃堕棿娈垫殏鏃犻渶瑕佺偣妫�鐨勮鍒�", { icon: 5 });
}
}
else {
- option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "" }];
+ option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y"}];
table.render(option);
//layer.alert("璇ヨ澶囨殏鏃犻粯璁ょ偣妫�璁板綍", { icon: 5 });
}
@@ -471,6 +599,7 @@
var sMainStr = JSON.stringify(data.field);
var sSubStr = JSON.stringify(table.cache['mainTable']);
var sMainSub = sMainStr + ';' + sSubStr + ";" + sessionStorage["HUserName"];
+ console.log(sSubStr);
if (AllowLoadData(sSubStr)) {
$.ajax(
{
@@ -488,9 +617,7 @@
});
}
else {
-
f_alert(data.Message);
- console.log("Reason" + sMainStr + "sub:" + JSON.stringify(layui.table.cache.mainTable));
}
layer.closeAll("loading");
},
@@ -535,11 +662,16 @@
function set_InitGrid() {
//琛ㄥご
columns = [
- { type: 'checkbox', fixed: 'left', totalRowText: '鍚堣琛�'}
+ { type: 'checkbox', fixed: 'left', totalRowText: '鍚堣琛�' }
, { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe" }
, { field: 'HDotCheckItemID', title: '鐐规椤圭洰ID', edit: 'text', hide: true }
, { field: 'HDotCheckCode', title: '鐐规椤圭洰浠g爜', edit: 'text', event: "HDotCheckCode" }
, { field: 'HDotCheckItem', title: '鐐规椤圭洰', edit: 'text', event: "" }
+ , { field: 'HDotCheckItemClassID', title: '鐐规椤圭洰鍒嗙被ID', edit: 'text', hide: true }
+ , { field: 'HDotCheckItemClassName', title: '鐐规椤圭洰鍒嗙被', edit: 'text', event: 'HDotCheckItemClassName' }
+ , { field: 'HDotCheckItemMethodID', title: '鐐规鏂规硶ID', edit: 'text', hide: true }
+ , { field: 'HDotCheckItemMethodName', title: '鐐规鏂规硶', edit: 'text', event: 'HDotCheckItemMethodName' }
+ , { field: 'HDotCheckResult', title: '鐐规缁撴灉', templet: '#HDotCheckResult', event: 'HDotCheckResult' }
, { field: 'HDotCheckPart', title: '鐐规閮ㄤ綅', edit: 'text', event: "" }
, { field: 'HClaim', title: '鍏蜂綋瑕佹眰', edit: 'text' }
, { field: 'HManagerID', title: '璐熻矗浜轰唬鐮�', edit: 'text', hide: true }
@@ -566,15 +698,15 @@
//澧炲姞涓�琛屼簨浠�
function btnAddLine(NewRow) {
- var tableBak = table.cache["mainTable"]; //鑾峰彇涔嬪墠缂栬緫杩囩殑琛ㄦ牸鏁版嵁
- buttonArr = [];//娓呯┖鏁扮粍
- for (var i = 0; i < tableBak.length; i++) {
- buttonArr.push(tableBak[i]); //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍
+
+ table.cache["mainTable"].push(NewRow);
+ option.data = table.cache["mainTable"];
+ table.render(option);
+
+ for (var i = 1; i <= option.data.length; i++) {
+ $('#HDotCheckResult' + i + '').find("option[value='" + option.data[i - 1].HDotCheckResult + "']").attr("selected", true);
}
- buttonArr.push(NewRow); //鍦ㄥ熬閮ㄥ姞涓�琛�
- table.reload("mainTable", {
- data: buttonArr //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
- })
+ form.render('select');
}
//琛ㄦ牸澶嶅埗涓�琛屼簨浠�
function btnCopyLine(data) {
@@ -591,6 +723,11 @@
table.cache["mainTable"].push(JSON.parse(copyrow));//灏嗗鍒剁殑琛屽己杞垚json杩藉姞鍒拌〃鏍间笂
option.data = table.cache["mainTable"];//灏嗘暟鎹粦瀹氬埌data涓�
table.render(option);//灏嗘暟鎹覆鏌撳埌琛ㄦ牸涓�
+
+ for (var i = 1; i <= option.data.length; i++) {
+ $('#HDotCheckResult' + i + '').find("option[value='" + option.data[i - 1].HDotCheckResult + "']").attr("selected", true);
+ }
+ form.render('select');
}
}
// 琛ㄦ牸琛屽唴浜嬩欢鍒犻櫎
@@ -637,19 +774,56 @@
if (checkStatus.data.length === 0) {
return layer.msg('璇烽�夋嫨鏁版嵁');
}
- //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
- obj.update({
- HDotCheckItemID: checkStatus.data[0].HItemID,
- HDotCheckCode: checkStatus.data[0].鐐规椤圭洰浠g爜,
- HDotCheckItem: checkStatus.data[0].鐐规椤圭洰鍚嶇О
- });
- layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+
+ if (checkStatus.data.length === 1) {
+ //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
+ obj.update({
+ HDotCheckItemID: checkStatus.data[0].HItemID,
+ HDotCheckCode: checkStatus.data[0].鐐规椤圭洰浠g爜,
+ HDotCheckItem: checkStatus.data[0].鐐规椤圭洰鍚嶇О,
+ HDotCheckItemClassID: checkStatus.data[0].HDotCheckItemClassID,
+ HDotCheckItemClassName: checkStatus.data[0].鐐规椤圭洰鍒嗙被鍚嶇О,
+ });
+ layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+ } else {
+ //(澶氶�夎)
+ //灏嗗師鏈夎〃浣撴暟鎹啓鍏ユ暟缁�
+ var tableBak = table.cache["mainTable"]; //鑾峰彇涔嬪墠缂栬緫杩囩殑琛ㄦ牸鏁版嵁
+ buttonArr = [];//娓呯┖鏁扮粍
+ for (var i = 0; i < tableBak.length; i++) {
+ if (tableBak[i]["HDotCheckItemID"] != 0 && tableBak[i]["HDotCheckItemID"] != "" && tableBak[i]["HDotCheckItemID"] != undefined && tableBak[i]["HDotCheckItemID"] != null) {
+ buttonArr.push(tableBak[i]); //濡傛灉鍏抽敭瀛楁涓嶄负绌猴紝鍒欏皢涔嬪墠鐨勬暟鎹瓨鍌�
+ }
+ }
+ //灏嗘壒閲忛�夋嫨鐨勬暟鎹啓鍏ユ暟缁勶紙澶氶�夎锛�
+ for (var i = 0; i < checkStatus.data.length; i++) {
+ buttonArr.push({ "HDotCheckItemID": checkStatus.data[i].HItemID, "HDotCheckCode": checkStatus.data[i].鐐规椤圭洰浠g爜, "HDotCheckItem": checkStatus.data[i].鐐规椤圭洰鍚嶇О, "HDotCheckPart": "", "HClaim": "", "HManagerID": sessionStorage["HEmpID"], "HManagerCode": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y" });
+ }
+ option.data = buttonArr;
+ table.render(option);
+ //table.reload("mainTable", {
+ // data: buttonArr //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
+ //})
+
+ layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+ }
}
, btn2: function (index, layero) {
//鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
//return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
},
end: function () {
+ if (OptionData.length > 0) {
+ //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+ obj.update({
+ HDotCheckItemID: OptionData[0].HItemID,
+ HDotCheckCode: OptionData[0].鐐规椤圭洰浠g爜,
+ HDotCheckItem: OptionData[0].鐐规椤圭洰鍚嶇О,
+ HDotCheckItemClassID: OptionData[0].HDotCheckItemClassID,
+ HDotCheckItemClassName: OptionData[0].鐐规椤圭洰鍒嗙被鍚嶇О,
+ });
+ OptionData = [];
+ }
}
});
}
@@ -664,7 +838,7 @@
shift: 2,
area: ['90%', '90%'],
maxmin: true
- , content: ['../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_EmployeeList.html', 'yes']
+ , content: ['../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_EmployeeList.html?type=HManager', 'yes']
, btn: ['纭畾', '鍙栨秷']
, btn1: function (index, layero) {
//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
@@ -686,9 +860,85 @@
//return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
},
end: function () {
+ if (OptionData.length > 0) {
+ //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+ obj.update({
+ HManagerID: OptionData[0].HItemID,
+ HManagerCode: OptionData[0].鑱屽憳浠g爜,
+ HManagerName: OptionData[0].鑱屽憳鍚嶇О
+ });
+ OptionData = [];
+ }
}
});
}
+ if (obj.event === 'HDotCheckItemClassName') //鐐规椤圭洰鍒嗙被
+ {
+ //椤甸潰灞�-鑷畾涔�
+ layer.open({
+ type: 2,
+ skin: 'layui-layer-rim', //鍔犱笂杈规
+ title: '鐐规椤圭洰鍒嗙被鍒楄〃',
+ closeBtn: 1,
+ shift: 2,
+ area: ['90%', '90%'],
+ maxmin: true
+ , content: ['../鍩虹璧勬枡/鍩虹璧勬枡/Gy_DotCheckItemClassList.html', '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('璇烽�夋嫨鏁版嵁');
+ }
+ //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
+ obj.update({
+ HDotCheckItemClassID: checkStatus.data[0].HItemID,
+ HDotCheckItemClassName: checkStatus.data[0].鐐规椤圭洰鍒嗙被鍚嶇О
+ });
+ layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+ }
+ , btn2: function (index, layero) {
+ //鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
+ //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
+ }
+ });
+ }
+ if (obj.event === 'HDotCheckItemMethodName') //鐐规鏂规硶
+ {
+ //椤甸潰灞�-鑷畾涔�
+ layer.open({
+ type: 2,
+ skin: 'layui-layer-rim', //鍔犱笂杈规
+ title: '鐐规鏂规硶鍒楄〃',
+ closeBtn: 1,
+ shift: 2,
+ area: ['90%', '90%'],
+ maxmin: true
+ , content: ['../鍩虹璧勬枡/鍩虹璧勬枡/Gy_DotCheckItemMethodList.html', '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('璇烽�夋嫨鏁版嵁');
+ }
+ //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
+ obj.update({
+ HDotCheckItemMethodID: checkStatus.data[0].HItemID,
+ HDotCheckItemMethodName: checkStatus.data[0].鐐规鏂规硶鍚嶇О
+ });
+ layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+ }
+ , btn2: function (index, layero) {
+ //鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
+ //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
+ }
+ });
+ }
+
obj.event = "";
return false;
@@ -719,7 +969,7 @@
function set_AddFNew() {
//鑾峰彇鏈�澶у崟鎹彿
get_MAXNum();
- option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": sessionStorage["HEmpID"], "HManagerCode": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": "" }];
+ option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": sessionStorage["HEmpID"], "HManagerCode": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y" }];
table.render(option);
}
@@ -727,7 +977,7 @@
function set_EditFromGrid(linterid) {
set_EditForm(linterid); //缂栬緫鑾峰彇琛ㄥご
set_EditGrid(linterid); //缂栬緫鑾峰彇琛ㄤ綋
- option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "" }];
+ option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "", "HDotCheckResult": "Y" }];
table.render(option);
}
//缂栬緫鑾峰彇琛ㄥご
@@ -755,7 +1005,22 @@
, "HRemark": data.琛ㄥご澶囨敞 //澶囨敞
, "HEquipDotCheckRuleInterID": data.璁惧鐐规瑙勭▼ID // 璁惧鐐规瑙勭▼ID
, "HEquipDotCheckRuleInterNo": data.璁惧鐐规瑙勭▼ // 璁惧鐐规瑙勭▼
+ , "HErrNote": data.寮傚父鎯呭喌璁板綍 //寮傚父鎯呭喌璁板綍
+ , "HBigSafeNote": data.閲嶅ぇ瀹夊叏闅愭偅璁板綍 //閲嶅ぇ瀹夊叏闅愭偅璁板綍
+ , "HDotCheckNote": data.鐐规鏁版嵁 //鐐规鏁版嵁
+ , "HShiftsID": data.HShiftsID //
+ , "HShiftsName": data.鐝鍚嶇О //鐝鍚嶇О
+ //, "HLastResult": data.鏈�缁堢粨璁� == "鍚堟牸" ? "OK" : "NG" //鏈�缁堢粨璁�
});
+
+ if (data.鏈�缁堢粨璁� == "涓嶅悎鏍�") {
+ document.querySelectorAll("[name='HLastResult']")[0].removeAttribute('checked'); //鍒犻櫎閫夋嫨灞炴��
+ $("input:radio[name=HLastResult][value=" + "NG" + "]").attr("checked", "true"); //娣诲姞閫夋嫨灞炴��
+ } else {
+ document.querySelectorAll("[name='HLastResult']")[1].removeAttribute('checked'); //鍒犻櫎閫夋嫨灞炴��
+ $("input:radio[name=HLastResult][value=" + "OK" + "]").attr("checked", "true"); //娣诲姞閫夋嫨灞炴��
+ }
+ form.render('radio');
} else {
layer.alert(result.msg, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
@@ -773,12 +1038,21 @@
url: GetWEBURL() + 'Sb_EquipDotCheckBill/Sb_EquipDotCheckBillListProjectDetai',
type: "GET",
data: { "sqlWhere": "and hmainid=" + linterid },
- success: function (result) {
- console.log(result);
+ success: function (result) {
if (result.count == 1) {
- option.data = result.data;
- table.render(option);
+ var data = result.data;
+ var subarr = [];
+ for (var i = 0; i < data.length; i++) {
+ subarr.push({ "HDotCheckItemID": data[i].鐐规椤圭洰ID, "HDotCheckCode": data[i].鐐规椤圭洰浠g爜, "HDotCheckItem": data[i].鐐规椤圭洰, "HDotCheckPart": data[i].鐐规閮ㄤ綅, "HClaim": data[i].鍏蜂綋瑕佹眰, "HManagerID": data[i].璐熻矗浜篒D, "HManagerCode": data[i].璐熻矗浜虹紪鐮�, "HManagerName": data[i].璐熻矗浜�, "HRemark": data[i].琛ㄤ綋澶囨敞, "HDotCheckItemClassID": data[i].HDotCheckItemClassID, "HDotCheckItemClassName": data[i].鐐规椤圭洰鍒嗙被鍚嶇О, "HDotCheckItemMethodID": data[i].HDotCheckItemMethodID, "HDotCheckItemMethodName": data[i].鐐规鏂规硶鍚嶇О, "HDotCheckResult": data[i].鐐规缁撴灉 == "鍚堟牸" ? 'Y' : 'X' });
+ }
+
+ option.data = subarr;
+ table.render(option);
+ for (let j = 0; j < data.length; j++) {
+ $("#HDotCheckResult" + (j + 1)).val(data[j].鐐规缁撴灉 == "鍚堟牸" ? 'Y' : 'X')
+ }
+ form.render('select');
} else {
layer.alert(result.code + result.Message, { icon: 5 });
}
@@ -841,9 +1115,34 @@
return true;
}
}
+ //閿欒淇℃伅
+ function f_alert(sMsg) {
+ layer.alert(sMsg, { icon: 5 });
+
+ }
//#endregion
});
+
+ //璁惧
+ function GetEquipFileValue(obj) {
+ $("#HEquipName").val(obj[0].璁惧鍚嶇О);
+ $("#HEquipID").val(obj[0].hmainid);
+ }
+ //鐐规瑙勭▼
+ function GetSb_EquipDotCheckRuleListValue(obj) {
+ $("#HEquipDotCheckRuleInterNo").val(obj.鍗曟嵁鍙�);
+ $("#HEquipDotCheckRuleInterID").val(obj.hmainid);
+ get_DocCheckItem2();
+ }
+ //鐐规椤圭洰
+ function GetDotCheckListValue(obj) {
+ OptionData[0] = obj;
+ }
+ //璐d换浜�
+ function GetHManagerValue(obj) {
+ OptionData = obj;
+ }
</script>
</body>
</html>
\ No newline at end of file
--
Gitblit v1.9.1