From c47dec91c838a2d6ed99f8e057e6e95ffbe77ced Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期二, 31 十二月 2024 15:55:44 +0800
Subject: [PATCH] 模具添加列设置和按钮设置
---
WebTM/views/车间管理/启动点检单/Sc_WorkBeginDotCheckBill.html | 231 ++++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 201 insertions(+), 30 deletions(-)
diff --git "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\220\257\345\212\250\347\202\271\346\243\200\345\215\225/Sc_WorkBeginDotCheckBill.html" "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\220\257\345\212\250\347\202\271\346\243\200\345\215\225/Sc_WorkBeginDotCheckBill.html"
index caeed44..b7d7a6f 100644
--- "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\220\257\345\212\250\347\202\271\346\243\200\345\215\225/Sc_WorkBeginDotCheckBill.html"
+++ "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\220\257\345\212\250\347\202\271\346\243\200\345\215\225/Sc_WorkBeginDotCheckBill.html"
@@ -292,16 +292,25 @@
</div>
</div>
</div>
- <!--椤圭洰闃舵琛細鍒犻櫎-->
+ <!--鍒犻櫎-->
<script type="text/html" id="barDemo">
- <!--<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>
+ <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="HCheckResult">
<select name="HCheckResult" lay-filter="HCheckResult" id="HCheckResult{{d.LAY_TABLE_INDEX+1}}">
<option value="OK" selected>OK</option>
<option value="X">X</option>
+ </select>
+ </script>
+ <!--琛屼笅鎷夐�夋嫨(缁撴灉)-->
+ <script type="text/html" id="HDotCheckType">
+ <select name="HDotCheckType" lay-filter="HDotCheckType" id="HDotCheckType{{d.LAY_TABLE_INDEX+1}}">
+ <option value="璁惧" selected>璁惧</option>
+ <option value="妯″叿">妯″叿</option>
+ <option value="浣滀笟鎸囧涔�">浣滀笟鎸囧涔�</option>
+ <option value="妫�楠屾寚瀵间功">妫�楠屾寚瀵间功</option>
</select>
</script>
@@ -344,7 +353,7 @@
var params = getUrlVars();
var OperationType = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鏁版嵁绫诲瀷 1娣诲姞 淇濆瓨 2澶嶅埗 3 缂栬緫 4 鎶ュ伐骞冲彴鎸夐挳璺宠浆
var linterid = params[params[1]]; //浠庡弬鏁颁腑鑾峰彇 鍗曟嵁鍐呯爜
-
+
//#endregion
@@ -367,7 +376,7 @@
//#endregion
-
+
//#region 鍒ゆ柇骞惰缃搷浣滅被鍨嬨�侀〉闈㈠垵濮嬪寲
if (OperationType == null || OperationType == 1) { //鏂板
@@ -377,10 +386,12 @@
//鍒濆鍖栧埗鍗曚汉鍜屽埗鍗曟椂闂�
$("#HMaker").val(sessionStorage["HUserName"]);
- $("#HMakerDate").val(Format(new Date(), "yyyy-MM-dd"));
+ $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd"));
//鍒濆鍖栨棩鏈�
$("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
+ $("#HGroupID").val(sessionStorage["HGroupID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鐝粍ID
+ $("#HGroupName").val(sessionStorage["HGroup"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鐝粍
//鍒濆鍖栧瓙琛�
get_InitGrid();
@@ -392,26 +403,29 @@
//鍒濆鍖栧瓙琛�
get_InitGrid();
-
+
RoadBillMain(linterid);
//绂佺敤缁勭粐閫夐」
$('#HOrgID').attr("disabled", true);
}
- else if (OperationType==4) {
+ else if (OperationType == 4) {
//鐢熸垚骞惰缃富琛ㄧ殑鍐呯爜鍜屽崟鎹彿
createBillNo();
//鍒濆鍖栧埗鍗曚汉鍜屽埗鍗曟椂闂�
$("#HMaker").val(sessionStorage["HUserName"]);
- $("#HMakerDate").val(Format(new Date(), "yyyy-MM-dd"));
+ $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd"));
//鍒濆鍖栨棩鏈�
$("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
+ $("#HGroupID").val(sessionStorage["HGroupID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鐝粍ID
+ $("#HGroupName").val(sessionStorage["HGroup"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鐝粍
//鍒濆鍖栧瓙琛�
get_InitGrid();
//鑾峰彇鎶ュ伐鍙拌烦杞暟鎹�
RoadBillEdit(HMaterID, HProcID, HSourceID, SCOrder);
+ Get_HNowMould(HSourceID);
//绂佺敤缁勭粐閫夐」
$('#HOrgID').attr("disabled", true);
}
@@ -500,7 +514,7 @@
//鏂板琛岃〃鏍兼暟鎹�
var NewRow = {
- "HCheckNoteItemID": "0", "HCheckNoteItemName": "", "HCheckPostID": "0", "HCheckPostName": "", "HCheckResult": "","HRemark":"",
+ "HCheckNoteItemID": "0", "HCheckNoteItemName": "", "HCheckPostID": "0", "HCheckPostName": "", "HDotCheckType": "璁惧", "HRelationID": "0", "HRelationName": "", "HCheckResult": "", "HRemark": "",
"HSourceBillNo": 0, "HSourceBillType": 0, "HSourceInterID": 0, "HSourceEntryID": 0,
};
switch (obj.event) {
@@ -511,7 +525,9 @@
table.render(option);
for (var i = 1; i <= option.data.length; i++) {
$('#HCheckResult' + i + '').find("option[value='" + option.data[i - 1].HCheckResult + "']").attr("selected", true);
-
+ }
+ for (var i = 1; i <= option.data.length; i++) {
+ $('#HDotCheckType' + i + '').find("option[value='" + option.data[i - 1].HDotCheckType + "']").attr("selected", true);
}
form.render('select');
break;
@@ -531,7 +547,9 @@
table.render(option);//灏嗘暟鎹覆鏌撳埌琛ㄦ牸涓�
for (var i = 1; i <= option.data.length; i++) {
$('#HCheckResult' + i + '').find("option[value='" + option.data[i - 1].HCheckResult + "']").attr("selected", true);
-
+ }
+ for (var i = 1; i <= option.data.length; i++) {
+ $('#HDotCheckType' + i + '').find("option[value='" + option.data[i - 1].HDotCheckType + "']").attr("selected", true);
}
form.render('select');
}
@@ -540,7 +558,7 @@
}
});
-
+
//#region 瀛愯〃锛氳鍐呬簨浠�
table.on('tool(mainTable)', function (obj) {
set_GridDelete(obj); //琛屽唴鍒犻櫎
@@ -549,7 +567,7 @@
});
//#endregion
-
+
//#endregion
@@ -590,14 +608,17 @@
, totalRow: true
, cellMinWidth: 120
, height: 400
- ,limit:100
+ , limit: 100
, cols: [[
{ type: 'checkbox', totalRowText: '鍚堣琛�' }
, { type: 'numbers', title: '搴忓彿', style: 'background-color: #f9f9f9;' }
, { field: 'HCheckNoteItemID', title: 'HCheckNoteItemID', hide: true, style: 'background-color: #f9f9f9;' }
, { field: 'HCheckNoteItemName', title: '妫�鏌ラ」鐩�', edit: 'text', event: "HCheckNoteItemID", style: 'background-color: #f9f9f9;' } //f7
- , { field: 'HCheckPostID', title: 'HCheckPostID', hide: true, style: 'background-color: #f9f9f9;'}
+ , { field: 'HCheckPostID', title: 'HCheckPostID', hide: true, style: 'background-color: #f9f9f9;' }
, { field: 'HCheckPostName', title: '纭鑰呰鑹�', edit: 'text', event: "HCheckPostID", style: 'background-color: #f9f9f9;' }
+ , { field: 'HDotCheckType', title: '鐐规绫诲瀷', templet: '#HDotCheckType' }
+ , { field: 'HRelationID', title: 'HRelationID', hide: true, style: 'background-color: #f9f9f9;' }
+ , { field: 'HRelationName', title: '缂栫爜', edit: 'text', event: "HRelationID" }
, { field: 'HCheckResult', title: '缁撴灉', templet: '#HCheckResult' }
, { field: 'HRemark', title: '澶囨敞', edit: 'text' }
, { field: 'HSourceInterID', title: '婧愬崟鍐呯爜', hide: true, style: 'background-color: #f9f9f9;' }
@@ -614,8 +635,11 @@
, "HCheckNoteItemName": ""
, "HCheckPostID": "0"
, "HCheckPostName": ""
+ , "HDotCheckType": "璁惧"
+ , "HRelationID": "0"
+ , "HRelationName": ""
, "HCheckResult": ""
- , "HRemark":""
+ , "HRemark": ""
, "HSourceInterID": "0"
, "HSourceEntryID": "0"
, "HSourceBillNo": ""
@@ -635,6 +659,17 @@
$.each(option.data, function (index, value) {
if (value.LAY_TABLE_INDEX == dataindex) {
value.HCheckResult = data.value;//鎶婇�変腑涓嬫媺妗唅d鍊艰祴鍊肩粰琛ㄦ牸缂撳瓨
+ }
+ });
+ });
+
+ form.on('select(HDotCheckType)', 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.HDotCheckType = data.value;//鎶婇�変腑涓嬫媺妗唅d鍊艰祴鍊肩粰琛ㄦ牸缂撳瓨
}
});
});
@@ -672,7 +707,7 @@
//#region 鐢熶骇璁㈠崟閫夋嫨椤甸潰
function get_checkSearchHICMO() {
-
+
//鎵撳紑鐢熶骇璁㈠崟灏忕獥浣�
layer.open({
type: 2
@@ -814,7 +849,7 @@
$("#HCheckEmpName").val(checkStatus.data[0].鑱屽憳鍚嶇О);
$("#HCheckEmpID").val(checkStatus.data[0].HItemID);
-
+
layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
}
, btn2: function (index, layero) { }
@@ -963,6 +998,71 @@
}
})
}
+ //绫诲瀷淇℃伅
+ if (obj.event == "HRelationID") {
+ if (obj.data.HDotCheckType == "璁惧") {
+ layer.open({
+ type: 2
+ , skin: "layui-layer-rim" //鍔犱笂杈规
+ , title: "璁惧鍒楄〃" //鏍囬
+ , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
+ , shift: 2 //寮瑰嚭鍔ㄧ敾
+ , area: ["90%", "90%"] //绐椾綋澶у皬
+ , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+ , content: ["../../璁惧绠$悊/璁惧妗f/Gy_EquipFileMainList.html", "yes"]
+ , btn: ["纭畾", "鍙栨秷"]
+ , btn1: function (index, laero) {
+ //鎸夐挳涓� 鐨勫洖璋�
+ var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰
+ var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹�
+
+ if (checkStatus.data.length != 1) {
+ return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�");
+ }
+ //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+ obj.update({
+ "HRelationID": checkStatus.data[0].hmainid,
+ "HRelationName": checkStatus.data[0].璁惧鍚嶇О
+ })
+ layer.close(index);//鍏抽棴寮圭獥
+ }
+ , btn2: function (index, layero) { }
+ , end: function () {
+ }
+ })
+ } else if (obj.data.HDotCheckType == "妯″叿") {
+ layer.open({
+ type: 2
+ , skin: "layui-layer-rim" //鍔犱笂杈规
+ , title: "妯″叿鍒楄〃" //鏍囬
+ , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
+ , shift: 2 //寮瑰嚭鍔ㄧ敾
+ , area: ["90%", "90%"] //绐椾綋澶у皬
+ , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+ , content: ["../../妯℃不鍏风鐞�/妯℃不鍏风鐞�/Gy_MouldFileList.html", "yes"]
+ , btn: ["纭畾", "鍙栨秷"]
+ , btn1: function (index, laero) {
+ //鎸夐挳涓� 鐨勫洖璋�
+ var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰
+ var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹�
+
+ if (checkStatus.data.length != 1) {
+ return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�");
+ }
+ //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+ obj.update({
+ "HRelationID": checkStatus.data[0].hmainid,
+ "HRelationName": checkStatus.data[0].妯″叿鍚嶇О
+ })
+ layer.close(index);//鍏抽棴寮圭獥
+ }
+ , btn2: function (index, layero) { }
+ , end: function () {
+ }
+ })
+ }
+
+ }
obj.event = "";
return false;
}
@@ -1087,14 +1187,23 @@
//瀛愯〃 璧嬪��
var rowdata = [];
for (var i = 0; i < tableSub.length; i++) {
+ var relationName = "";
+ if (tableSub[i]["鐐规绫诲瀷"] == "璁惧") {
+ relationName = tableSub[i]["璁惧鍚嶇О"];
+ } else if (tableSub[i]["鐐规绫诲瀷"] == "妯″叿") {
+ relationName = tableSub[i]["妯″叿鍚嶇О"];
+ }
rowdata.push(
{
"HCheckNoteItemID": tableSub[i]["HCheckNoteItemID"],
"HCheckNoteItemName": tableSub[i]["妫�鏌ラ」鐩�"],
"HCheckPostID": tableSub[i]["HCheckPostID"],
"HCheckPostName": tableSub[i]["纭鑰呰鑹�"],
+ "HDotCheckType": tableSub[i]["鐐规绫诲瀷"],
+ "HRelationID": tableSub[i]["HRelationID"],
+ "HRelationName": relationName,
"HCheckResult": tableSub[i]["缁撴灉"],
- "HRemark": tableSub[i]["琛ㄤ綋澶囨敞"]
+ "HRemark": tableSub[i]["琛ㄤ綋澶囨敞"]
}
);
}
@@ -1103,8 +1212,10 @@
for (var i = 0; i < rowdata.length; i++) {
$('#HCheckResult' + (i + 1)).find("option[value='" + tableSub[i].缁撴灉 + "']").attr("selected", true);
}
+ for (var i = 0; i < rowdata.length; i++) {
+ $('#HDotCheckType' + (i + 1)).find("option[value='" + tableSub[i].鐐规绫诲瀷 + "']").attr("selected", true);
+ }
form.render('select');
- form.render('checkbox');
}
})
}
@@ -1129,10 +1240,29 @@
for (var i = 0; i < oldData.length; i++) {
$('#HCheckResult' + (i + 1)).find("option[value='" + oldData[i].HCheckResult + "']").attr("selected", true);
}
+ for (var i = 0; i < rowdata.length; i++) {
+ $('#HDotCheckType' + (i + 1)).find("option[value='" + oldData[i].鐐规绫诲瀷 + "']").attr("selected", true);
+ }
form.render('select');
layer.close(index);
}
});
+ }
+ if (obj.event === 'edit') {
+ var Type = obj.data.HDotCheckType;
+ var HInterId = obj.data.HRelationID
+ layer.open({
+ type: 2
+ , skin: 'layui-layer-rim' //鍔犱笂杈规
+ , area: ['100%', '100%']
+ , title: '鏃ョ偣妫�娓呭崟'
+ , shift: 0//寮瑰嚭鍔ㄧ敾
+ , content: '../../杞﹂棿绠$悊/鍚姩鐐规鍗�/Sc_WorkDotCheckBillList_Day.html?OperationType=' + Type + '&linterid=' + HInterId + '&HSouceBillType='
+ , btn: ['纭畾'],
+ // 鎸夐挳1 鐨勫洖璋�
+ end: function (index, layero, that) {
+ }
+ })
}
}
//#endregion
@@ -1174,11 +1304,11 @@
}
//#region 瀛愯〃 鏁版嵁妫�楠�
-
+
for (var i = 0; i < option.data.length; i++) {
if (typeof option.data[i] !== 'object' || option.data[i] === null || Array.isArray(option.data[i])) {
- continue; // 璺宠繃闈炲璞¢」锛堝绌烘暟缁勶級
+ continue; // 璺宠繃闈炲璞¢」锛堝绌烘暟缁勶級
}
if (option.data[i]["HCheckNoteItemID"] == "0") {
@@ -1190,7 +1320,7 @@
layer.msg("绗�" + i + "琛岋細纭鑰呰鑹叉湭閫夋嫨锛�");
return false;
}
-
+
}
//#endregion
@@ -1207,14 +1337,14 @@
url: GetWEBURL() + "/Sc_WorkBeginDotCheckBill/锘縎c_WorkBeginDotCheckBillList",
type: "GET",
async: false,
- data: { "HMaterID": HMaterID, "HProcID": HProcID, "HSourceID": HSourceID, "SCOrder": SCOrder,"user": sessionStorage["HUserName"] },
+ data: { "HMaterID": HMaterID, "HProcID": HProcID, "HSourceID": HSourceID, "SCOrder": SCOrder, "user": sessionStorage["HUserName"] },
success: function (result) {
var tableMain = result.data;
var tableSub = result.data;
//涓昏〃 璧嬪��
form.val("formData", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫��
-
+
"HICMOInterID": tableMain[0]["鐢熶骇涓诲唴鐮�"]
, "HICMOEntryID": tableMain[0]["鐢熶骇瀛愬唴鐮�"]
, "HICMOBillNo": tableMain[0]["鐢熶骇璁㈠崟鍙�"]
@@ -1234,20 +1364,62 @@
//瀛愯〃 璧嬪��
var rowdata = [];
for (var i = 0; i < tableSub.length; i++) {
+ var relationName = "";
+ if (tableSub[i]["鐐规绫诲瀷"] == "璁惧") {
+ relationName = tableSub[i]["璁惧鍚嶇О"];
+ } else if (tableSub[i]["鐐规绫诲瀷"] == "妯″叿") {
+ relationName = tableSub[i]["妯″叿鍚嶇О"];
+ }
rowdata.push(
{
"HCheckNoteItemID": tableSub[i]["妫�鏌ラ」鐩甀D"],
"HCheckNoteItemName": tableSub[i]["妫�鏌ラ」鐩�"],
"HCheckPostID": tableSub[i]["纭鑰呰鑹睮D"],
"HCheckPostName": tableSub[i]["纭鑰呰鑹�"],
+ "HDotCheckType": tableSub[i]["鐐规绫诲瀷"],
+ "HRelationID": tableSub[i]["HRelationID"] == null ? "0" : tableSub[i]["HRelationID"],
+ "HRelationName": relationName,
"HCheckResult": "",
- "HRemark":""
+ "HRemark": ""
}
);
}
option.data = rowdata;
table.render(option);
+ for (var i = 0; i < rowdata.length; i++) {
+ $('#HDotCheckType' + (i + 1)).find("option[value='" + tableSub[i].鐐规绫诲瀷 + "']").attr("selected", true);
+ }
+ form.render('select');
+ }
+ })
+ }
+ //#endregion
+
+ //#region 鑾峰彇鏈�杩戠殑涓�娆′笂妯″崟璧嬪��
+ function Get_HNowMould(HSourceID)
+ {
+ $.ajax({
+ url: GetWEBURL() + "/Sc_WorkBeginDotCheckBill/锘縎c_WorkBeginDotCheckBill_HMould",
+ type: "GET",
+ async: false,
+ data: { "HSourceID": HSourceID, "user": sessionStorage["HUserName"] },
+ success: function (result) {
+ var tableSub = result.data;
+ //瀛愯〃 璧嬪��
+ for (var i = 0; i < option.data.length; i++) {
+ if (option.data[i]["HDotCheckType"] == "妯″叿") {
+ option.data[i]["HRelationName"] = tableSub[0]["妯″叿鍚嶇О"];
+ option.data[i]["HRelationID"] = tableSub[0]["HMouldID"] == null ? "0" : tableSub[0]["HMouldID"];
+ }
+ }
+ var tables = option.data;
+ option.data = option.data;
+ table.render(option);
+ for (var i = 0; i < tables.length; i++) {
+ $('#HDotCheckType' + (i + 1)).find("option[value='" + tables[i]["HDotCheckType"] + "']").attr("selected", true);
+ }
+ form.render('select');
}
})
}
@@ -1282,8 +1454,7 @@
}
//鐝粍闀�
- function GetHManagerValue(obj)
- {
+ function GetHManagerValue(obj) {
$("#HGroupLeaderName").val(obj[0].鑱屽憳鍚嶇О);
$("#HGroupLeaderID").val(obj[0].HItemID);
}
@@ -1296,7 +1467,7 @@
function GetGyPostValue(obj) {
OptionData = obj[0];
}
-
+
</script>
</body>
</html>
\ No newline at end of file
--
Gitblit v1.9.1