From 94853e46b9d4911fb4cf00389f00a4b820db5d3c Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期三, 21 五月 2025 14:35:46 +0800
Subject: [PATCH] fix: 修正 系统上机日志查询 没有显示默认方案的问题
---
WebTM/views/计划管理/工艺路线/Gy_MaterialTechParamBillMain.html | 487 +++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 429 insertions(+), 58 deletions(-)
diff --git "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_MaterialTechParamBillMain.html" "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_MaterialTechParamBillMain.html"
index 5c28203..255a772 100644
--- "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_MaterialTechParamBillMain.html"
+++ "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_MaterialTechParamBillMain.html"
@@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8" />
- <title>浜у搧鍣ㄥ叿娓呭崟</title>
+ <title>浜у搧宸ヨ壓鍙傛暟娓呭崟</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
@@ -177,6 +177,30 @@
</div>
<div class="layui-row">
<div class="layui-inline">
+ <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">妯″叿缂栫爜</label>
+ <div class="layui-input-block" style="margin-left: 77px;">
+ <input type="text" class="layui-input" lay-verify="HMouldNumber" name="HMouldNumber" id="HMouldNumber" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+ <input type="hidden" name="HMouldID" id="HMouldID" lay-verify="HMouldID" value="0">
+ <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchHMould" id="btnSearchHMould" style="padding: 0 10px;float: right;margin-right: 3px;">
+ <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
+ </button>
+ </div>
+ </div>
+ <div class="layui-inline">
+ <label class="layui-form-label" style="width: 75px;">妯″叿鍚嶇О</label>
+ <div class="layui-input-block" style="margin-left: 120px;">
+ <input type="text" class="layui-input" name="HMouldName" lay-verify="HMouldName" id="HMouldName" 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="HMouldModel" lay-verify="HMouldModel" id="HMouldModel" style="background-color:#efefef4d;" readonly>
+ </div>
+ </div>
+ </div>
+ <div class="layui-row">
+ <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="HRemark" id="HRemark" lay-verify="HRemark" style=" width: 500px;">
@@ -311,13 +335,33 @@
</div>
</div>
</div>
-
+ <!--閫夋嫨妗�-->
+ <script type="text/html" id="HDataForm-select">
+ <select name="HDataForm" lay-filter="HDataForm" id="HDataForm{{d.LAY_TABLE_INDEX+1}}">
+ <option value="璁惧閲囬泦" selected>璁惧閲囬泦</option>
+ <option value="鎵嬪姩杈撳叆">鎵嬪姩杈撳叆</option>
+ <option value="鏂囦欢寮曞叆">鏂囦欢寮曞叆</option>
+ </select>
+ </script>
+ <script type="text/html" id="HDataUnit-select">
+ <select name="HDataUnit" lay-filter="HDataUnit" id="HDataUnit{{d.LAY_TABLE_INDEX+1}}">
+ <option value="绉�" selected>绉�</option>
+ <option value="鍒�">鍒�</option>
+ <option value="鏃�">鏃�</option>
+ </select>
+ </script>
+ <!--澶嶉�夋 鏄惁蹇呭綍鎺у埗-->
+ <script type="text/html" id="HIsRequired">
+ <div class="layui-input-block" style="margin-left: 20px;">
+ <input type="checkbox" name="HIsRequired" lay-filter="HIsRequired" id="HIsRequired{{d.LAY_TABLE_INDEX+1}}" lay-skin="primary">
+ </div>
+ </script>
<script type="text/html" id="barDemo">
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">鍒犻櫎</a>
</script>
<script>
-
+ var OptionData = [];
layui.config({
base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
}).extend({
@@ -375,27 +419,27 @@
$("#HMaker").val(sessionStorage["HUserName"]);
$("#HMakerDate").val(Format(new Date(), "yyyy-MM-dd"));
}
- //else if (OperationType == 2) {
-
- // RoadBillMain(linterid);
- // $.ajax({
- // url: GetWEBURL() + "/Web/GetMAXNum",
- // type: "GET",
- // async: false,
- // data: { "HBillType": '3301' },
- // success: function (d) {
- // $("#HInterID").val(d.data[0].HInterID);
- // $("#HBillNo").val(d.data[0].HBillNo);
- // $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
- // }
- // });
- //}
+ else if (OperationType == 2) {
+ //鍒濆鍖栬〃鏍�
+ get_InitGrid();
+ RoadBillMain(linterid);
+ $.ajax({
+ url: GetWEBURL() + "/Web/GetMAXNum",
+ type: "GET",
+ async: false,
+ data: { "HBillType": '3334' },
+ success: function (d) {
+ $("#HInterID").val(d.data[0].HInterID);
+ $("#HBillNo").val(d.data[0].HBillNo);
+ $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
+ }
+ });
+ }
else if (OperationType == 3) {
//绂佺敤鎸夐挳
var num = 1;
HfBtn(num);
-
//鍒濆鍖栬〃鏍�
get_InitGrid();
@@ -407,7 +451,7 @@
//鏄剧ず鍒楁暟鎹�
- DisPlay_HideColumn();
+ /*DisPlay_HideColumn();*/
//#endregion
@@ -447,7 +491,13 @@
get_checkSearchHProc();
});
//#endregion
-
+
+ //#region 閫夋嫨妯″叿鎸夐挳
+ form.on('submit(btnSearchHMould)', function () {
+ get_checkSearchHMould();
+ });
+ //#endregion
+
// 淇濆瓨鎻愪氦
form.on('submit(btnSave)', function (data) {//鎻愪氦
@@ -484,6 +534,41 @@
set_CancelCloseBills(1);
});
+ //#region 琛ㄦ牸琛岄�夋嫨澶勭悊
+ form.on('select(HDataForm)', 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.HDataForm = data.value;//鎶婇�変腑涓嬫媺妗唅d鍊艰祴鍊肩粰琛ㄦ牸缂撳瓨
+ }
+ });
+ });
+ form.on('select(HDataUnit)', function (data) {
+ console.log(table.cache["mainTable"])
+ //鑾峰彇涓嬫媺妗嗛�変腑鐨勫��
+ 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.HDataUnit = data.value;//鎶婇�変腑涓嬫媺妗唅d鍊艰祴鍊肩粰琛ㄦ牸缂撳瓨
+ }
+ });
+ });
+ //鏄惁 蹇呭綍鎺у埗
+ form.on('checkbox(HIsRequired)', 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.HIsRequired = data.elem.checked;//鎶婇�変腑涓嬫媺妗唅d鍊艰祴鍊肩粰琛ㄦ牸缂撳瓨
+ }
+ });
+ });
+ //#endregion
+
//澶村伐鍏锋爮浜嬩欢
table.on('toolbar(mainTable)', function (obj) {
var checkStatus = table.checkStatus('mainTable')
@@ -491,14 +576,22 @@
//鏂板琛岃〃鏍兼暟鎹�
var NewRow = {
- "HTechParamID": "",
+ "HTechParamID": 0,
"HTechParamNumber": "",
"HTechParamName": "",
- "HTechParamUnitID": "",
+ "HTechParamUnitID": 0,
"HTechParamUnitName": "",
"HStd": "0",
"HMax": "0",
"HMin": "0",
+ "HDataForm": "璁惧閲囬泦",
+ "HDataUnit": "绉�",
+ "HIsRequired": false,
+ "HDataTimes": "0",
+ "HTechParamClassID": "0",
+ "HSNO": "0",
+ "HStdNextTimes": "0",
+ "HTechParamIDStd": "0",
"HSourceBillNo": "0",
"HSourceBillType": "0",
"HSourceEntryID": "0",
@@ -508,9 +601,16 @@
case 'btn-AddLine':
table.cache["mainTable"].push(NewRow);
option.data = table.cache["mainTable"];
-
table.render(option);
-
+ for (var i = 1; i <= option.data.length; i++) {
+ $('#HDataUnit' + i + '').find("option[value='" + option.data[i - 1].HDataUnit + "']").attr("selected", true);
+ $('#HDataForm' + i + '').find("option[value='" + option.data[i - 1].HDataForm + "']").attr("selected", true);
+ if (option.data[i - 1].HIsRequired) {
+ $('#HIsRequired' + i + '').attr("checked", true);
+ }
+ }
+ form.render('select');
+ form.render('checkbox');
break;
case 'btn-CopyLine':
var copydata = JSON.stringify(data);
@@ -526,8 +626,15 @@
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++) {
+ $('#HDataUnit' + i + '').find("option[value='" + option.data[i - 1].HDataUnit + "']").attr("selected", true);
+ $('#HDataForm' + i + '').find("option[value='" + option.data[i - 1].HDataForm + "']").attr("selected", true);
+ if (option.data[i - 1].HIsRequired) {
+ $('#HIsRequired' + i + '').attr("checked", true);
+ }
+ }
+ form.render('select');
+ form.render('checkbox');
}
break;
@@ -580,10 +687,43 @@
, { field: 'HStd', title: '鏍囧噯鍊�', edit: 'text', totalRow: true }
, { field: 'HMax', title: '涓婇檺', edit: 'text', totalRow: true }
, { field: 'HMin', title: '涓嬮檺', edit: 'text', totalRow: true }
+ , { field: 'HDataForm', title: '閲囬泦鏉ユ簮', templet: '#HDataForm-select' }
+ , { field: 'HIsRequired', title: '鏄惁蹇呭綍', templet: "#HIsRequired", }
+ , { field: 'HDataUnit', title: '閲囬泦鏃堕棿鍗曚綅', templet: '#HDataUnit-select' }
+ , { field: 'HDataTimes', title: '閲囬泦鍛ㄦ湡棰戠巼', edit: 'text', totalRow: true }
+ , { field: 'HTechParamClassID', title: '宸ヨ壓鍙傛暟澶х被', hide: true }
+ , { field: 'HTechParamClassName', title: '宸ヨ壓鍙傛暟澶х被鍚嶇О', edit: 'text', event: "HTechParamClassName" } //f7
+ , { field: 'HSNO', title: '宸ヨ壓娆″簭', edit: 'text', totalRow: true }
+ , { field: 'HStdNextTimes', title: '鐞嗚娆″簭闂撮殧', edit: 'text', totalRow: true }
+ , { field: 'HTechParamIDStd', title: '瀵瑰簲璁惧畾鍊煎伐鑹哄弬鏁�', hide: true }
+ , { field: 'HTechParamIDStdName', title: '瀵瑰簲璁惧畾鍊煎伐鑹哄弬鏁板��', edit: 'text', event: "HTechParamIDStdName " } //f7
, { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo' }
]]
}
- option.data = [];
+ var rowdata = [
+ {
+ "HTechParamID": 0,
+ "HTechParamNumber": "",
+ "HTechParamName": "",
+ "HTechParamUnitID": 0,
+ "HTechParamUnitName": "",
+ "HStd": "0",
+ "HMax": "0",
+ "HMin": "0",
+ "HDataForm": "璁惧閲囬泦",
+ "HDataUnit": "绉�",
+ "HDataTimes": "0",
+ "HTechParamClassID": "0",
+ "HSNO": "0",
+ "HStdNextTimes": "0",
+ "HTechParamIDStd": "0",
+ "HSourceBillNo": "0",
+ "HSourceBillType": "0",
+ "HSourceEntryID": "0",
+ "HSourceInterID": "0"
+ }
+ ];
+ option.data = rowdata;
table.render(option);
}
@@ -622,7 +762,7 @@
shift: 2,
area: ['90%', '90%'],
maxmin: true,
- content: ['../../../views/Baseset/鍩虹璧勬枡/Gy_DepartmentList.html', 'yes'],
+ content: ['../../../views/鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_DepartmentList.html', 'yes'],
btn: ['纭畾', '鍙栨秷']
, btn1: function (index, layero) {
//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
@@ -633,7 +773,7 @@
}
$("#HDeptID").val(checkStatus.data[0].HItemID);//閮ㄩ棬id
- $("#HDeptName").val(checkStatus.data[0].HName);//閮ㄩ棬鍚嶇О
+ $("#HDeptName").val(checkStatus.data[0].閮ㄩ棬鍚嶇О);//閮ㄩ棬鍚嶇О
layer.close(layer.index);
}
@@ -655,7 +795,7 @@
, area: ['90%', '90%']//澶у皬
, title: '鍛樺伐琛�'//鏍囬
, shift: 2//寮瑰嚭鍔ㄧ敾
- , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_EmployeeList.html?openType=2&HOrgID=' + HOrgID, 'yes']
+ , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_EmployeeList.html?Type=HEmp', 'yes']
, btn: ['纭畾', '鍙栨秷']
, btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
var iframeWindow = window['layui-layer-iframe' + index] //鑾峰彇寮规椤甸潰
@@ -686,7 +826,7 @@
, shift: 2 //寮瑰嚭鍔ㄧ敾
, area: ["90%", "90%"] //绐椾綋澶у皬
, maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
- , content: ['../../Baseset/鍩虹璧勬枡/Gy_MaterialList.html', 'yes']
+ , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Material.html', 'yes']
, btn: ["纭畾", "鍙栨秷"]
, btn1: function (index, laero) {
//鎸夐挳涓� 鐨勫洖璋�
@@ -698,9 +838,9 @@
}
$("#HMaterID").val(checkStatus.data[0].HItemID);
- $("#HMaterNumber").val(checkStatus.data[0].HNumber);
- $("#HMaterName").val(checkStatus.data[0].HName);
- $("#HMaterModel").val(checkStatus.data[0].HModel);
+ $("#HMaterNumber").val(checkStatus.data[0].鐗╂枡浠g爜);
+ $("#HMaterName").val(checkStatus.data[0].鐗╂枡鍚嶇О);
+ $("#HMaterModel").val(checkStatus.data[0].瑙勬牸鍨嬪彿);
layer.close(index);//鍏抽棴寮圭獥
}
@@ -775,7 +915,7 @@
, area: ['90%', '90%']//澶у皬
, title: '璁惧缂栫爜琛�'//鏍囬
, shift: 2//寮瑰嚭鍔ㄧ敾
- , content: ['../../Baseset/鍩虹璧勬枡/Gy_EquipFileBillMainList.html', 'yes']
+ , content: ['../../璁惧绠$悊/璁惧妗f/Gy_EquipFileMainList.html', 'yes']
, btn: ['纭畾', '鍙栨秷']
, btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
var iframeWindow = window['layui-layer-iframe' + index] //鑾峰彇寮规椤甸潰
@@ -784,11 +924,39 @@
return layer.msg('璇烽�夋嫨鏁版嵁');
}
//鑾峰彇鏁版嵁
- $("#HEquipID").val(checkStatus.data[0].HInterID);//id
- $("#HEquipNumber").val(checkStatus.data[0].HEquipFileNumber);//璁惧浠g爜
- $("#HEquipName").val(checkStatus.data[0].HName);//璁惧鍚嶇О
- $("#HEquipModel").val(checkStatus.data[0].HModel2);//璁惧鍨嬪彿
+ $("#HEquipID").val(checkStatus.data[0].hmainid);//id
+ $("#HEquipNumber").val(checkStatus.data[0].璁惧缂栫爜);//璁惧浠g爜
+ $("#HEquipName").val(checkStatus.data[0].璁惧鍚嶇О);//璁惧鍚嶇О
+ $("#HEquipModel").val(checkStatus.data[0].璁惧瑙勬牸);//璁惧鍨嬪彿
+ layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+ }
+ , btn2: function (index, layero) { }
+ })
+ }
+ //#endregion
+
+ //#region 妯″叿閫夋嫨椤甸潰
+ function get_checkSearchHMould() {
+ layer.open({
+ type: 2//寮圭獥绫诲瀷
+ , skin: 'layui-layer-rim' //鍔犱笂杈规
+ , area: ['90%', '90%']//澶у皬
+ , title: '宸ュ簭琛�'//鏍囬
+ , shift: 2//寮瑰嚭鍔ㄧ敾
+ , content: ['../../妯℃不鍏风鐞�/妯℃不鍏风鐞�/Gy_MouldFileList.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('璇烽�夋嫨鏁版嵁');
+ }
+ //鑾峰彇鏁版嵁
+ $("#HMouldID").val(checkStatus.data[0].hmainid);
+ $("#HMouldNumber").val(checkStatus.data[0].妯″叿缂栧彿);
+ $("#HMouldName").val(checkStatus.data[0].妯″叿鍚嶇О);
+ $("#HMouldModel").val(checkStatus.data[0].妯″叿鍨嬪彿);
layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
}
, btn2: function (index, layero) { }
@@ -802,11 +970,10 @@
if (event.key == "F7") {
//宸ヨ壓鍙傛暟
if (obj.event == "HTechParamNumber") {
- //鎵撳紑鍣ㄥ叿绠$悊灏忕獥浣�
layer.open({
type: 2,
skin: 'layui-layer-rim', //鍔犱笂杈规
- title: '妯″叿鍒楄〃',
+ title: '宸ヨ壓鍒楄〃',
closeBtn: 1,
shift: 2,
area: ['80%', '80%'],
@@ -820,13 +987,48 @@
if (checkStatus.data.length === 0) {
return layer.msg('璇烽�夋嫨鏁版嵁');
}
- obj.update({
- "HTechParamID": checkStatus.data[0].HItemID,
- "HTechParamNumber": checkStatus.data[0].宸ヨ壓鍙傛暟浠g爜,
- "HTechParamName": checkStatus.data[0].宸ヨ壓鍙傛暟鍚嶇О,
-
- });
+
+ table.cache["mainTable"] = table.cache["mainTable"].filter(row => row.HTechParamID !== 0 && row.HTechParamID !== undefined);
+ for (var rowData of checkStatus.data) {
+ var NewRow = {
+ "HTechParamID": rowData.HItemID,
+ "HTechParamNumber": rowData.宸ヨ壓鍙傛暟浠g爜,
+ "HTechParamName": rowData.宸ヨ壓鍙傛暟鍚嶇О,
+ "HTechParamUnitID": 0,
+ "HTechParamUnitName": "",
+ "HStd": "0",
+ "HMax": "0",
+ "HMin": "0",
+ "HDataForm": "璁惧閲囬泦",
+ "HIsRequired": false,
+ "HDataUnit": "绉�",
+ "HDataTimes": "0",
+ "HTechParamClassID": "0",
+ "HSNO": "0",
+ "HStdNextTimes": "0",
+ "HTechParamIDStd": "0",
+ "HSourceBillNo": "0",
+ "HSourceBillType": "0",
+ "HSourceEntryID": "0",
+ "HSourceInterID": "0"
+ };
+ table.cache["mainTable"].push(NewRow);
+ }
+ option.data = table.cache["mainTable"];
+ table.render(option);
layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+ }
+ , end: function () {
+ if (OptionData.length > 0) {
+ //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+ obj.update({
+ "HTechParamID": OptionData[0].HItemID,
+ "HTechParamNumber": OptionData[0].宸ヨ壓鍙傛暟浠g爜,
+ "HTechParamName": OptionData[0].宸ヨ壓鍙傛暟鍚嶇О,
+
+ });
+ OptionData = [];
+ }
}
});
}
@@ -856,6 +1058,96 @@
});
layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+ }
+ , end: function () {
+ if (OptionData.length > 0) {
+ //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+ obj.update({
+ "HTechParamUnitID": OptionData[0].HItemID,
+ "HTechParamUnitName": OptionData[0].宸ヨ壓鍙傛暟鍗曚綅鍚嶇О,
+
+ });
+ OptionData = [];
+ }
+ }
+ });
+ }
+ //宸ヨ壓鍙傛暟澶х被
+ if (obj.event == "HTechParamClassName") {
+ //鎵撳紑宸ヨ壓鍙傛暟澶х被灏忕獥浣�
+ layer.open({
+ type: 2,
+ skin: 'layui-layer-rim', //鍔犱笂杈规
+ title: '宸ヨ壓鍙傛暟澶х被',
+ closeBtn: 1,
+ shift: 2,
+ area: ['80%', '80%'],
+ maxmin: true,
+ content: ['../../../views/鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_TechnologyParameterType.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({
+ "HTechParamClassID": checkStatus.data[0].HItemID,
+ "HTechParamClassName": checkStatus.data[0].宸ヨ壓鍙傛暟鍒嗙被鍚嶇О,
+
+ });
+ layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+ }
+ , end: function () {
+ //if (OptionData.length > 0) {
+ // //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+ // obj.update({
+ // "HTechParamClassID": OptionData[0].HItemID,
+ // "HTechParamClassName": OptionData[0].宸ヨ壓鍙傛暟澶х被鍚嶇О,
+ // });
+ // OptionData = [];
+ //}
+ }
+ });
+ }
+ //瀵瑰簲璁惧畾鍊煎伐鑹哄弬鏁�
+ if (obj.event == "HTechParamIDStdName") {
+ //鎵撳紑瀵瑰簲璁惧畾鍊煎伐鑹哄弬鏁�(灏忕獥浣�
+ layer.open({
+ type: 2,
+ skin: 'layui-layer-rim', //鍔犱笂杈规
+ title: '瀵瑰簲璁惧畾鍊煎伐鑹哄弬鏁板垪琛�',
+ closeBtn: 1,
+ shift: 2,
+ area: ['80%', '80%'],
+ maxmin: true,
+ content: ['../../../views/鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_TechnologyParameter.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({
+ "HTechParamIDStd": checkStatus.data[0].HItemID,
+ "HTechParamIDStdName": checkStatus.data[0].瀵瑰簲璁惧畾鍊煎伐鑹哄弬鏁板悕绉�,
+
+ });
+ layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+ }
+ , end: function () {
+ //if (OptionData.length > 0) {
+ // //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+ // obj.update({
+ // "HTechParamIDStd": OptionData[0].HItemID,
+ // "HTechParamIDStdName": OptionData[0].瀵瑰簲璁惧畾鍊煎伐鑹哄弬鏁板悕绉�,
+
+ // });
+ // OptionData = [];
+ //}
}
});
}
@@ -892,6 +1184,11 @@
oldData.splice(obj.tr.data('index'), 1)
option.data = oldData;//灏嗘暟鎹粦瀹氬埌data涓�
table.render(option);
+ for (var i = 1; i <= option.data.length; i++) {
+ $('#HDataUnit' + i).find("option[value='" + option.data[i - 1].HDataUnit + "']").attr("selected", true).trigger("change");;
+ $('#HDataForm' + i).find("option[value='" + option.data[i - 1].HDataForm + "']").attr("selected", true).trigger("change");;
+ }
+ form.render('select');
layer.close(index);
}
});
@@ -907,7 +1204,7 @@
$.ajax({
url: GetWEBURL() + '/Gy_MaterialTechParamBill/CheckGy_MaterialTechParamBillMain',
type: "GET",
- data: { "HInterID": $("#HInterID").val(), "IsAudit": nums, "user": sessionStorage["HUserName"] },
+ data: { "HInterID": $("#HInterID").val(), "IsAudit": nums, "CurUserName": sessionStorage["HUserName"] },
success: function (result) {
if (result.count == 1) {
$('#set_CheckBill').addClass("layui-btn-disabled").attr("disabled", true);
@@ -933,7 +1230,7 @@
$.ajax({
url: GetWEBURL() + '/Gy_MaterialTechParamBill/CheckGy_MaterialTechParamBillMain',
type: "GET",
- data: { "HInterID": $("#HInterID").val(), "IsAudit": nums, "user": sessionStorage["HUserName"] },
+ data: { "HInterID": $("#HInterID").val(), "IsAudit": nums, "CurUserName": sessionStorage["HUserName"] },
success: function (result) {
if (result.count == 1) {
$('#set_CheckBill').removeClass("layui-btn-disabled").attr("disabled", false);
@@ -1011,6 +1308,7 @@
//#region 缂栬緫 椤甸潰璧嬪��
function RoadBillMain(linterid)//鍔犺浇琛ㄥご
{
+
$.ajax({
url: GetWEBURL() + "Gy_MaterialTechParamBill/Gy_MaterialTechParamBillMainEditList",
async: false,
@@ -1024,8 +1322,8 @@
var tableSub = result.data[1];
//涓昏〃
form.val("formData", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫��
- "HInterID": tableMain[0]["HInterID"]
- , "HBillNo": tableMain[0]["鍗曟嵁鍙�"]
+ "HInterID": OperationType == 2 ? "" : tableMain[0]["HInterID"]
+ , "HBillNo": OperationType == 2 ? "" : tableMain[0]["鍗曟嵁鍙�"]
, "HDate": Format(new Date(tableMain[0]["鏃ユ湡"]), "yyyy-MM-dd")
, "HMaterID": tableMain[0]["HMaterID"]
, "HMaterNumber": tableMain[0]["鐗╂枡浠g爜"]
@@ -1035,6 +1333,10 @@
, "HEquipNumber": tableMain[0]["璁惧浠g爜"]
, "HEquipName": tableMain[0]["璁惧鍚嶇О"]
, "HEquipModel": tableMain[0]["璁惧鍨嬪彿"]
+ , "HMouldID": tableMain[0]["HMouldID"]
+ , "HMouldNumber": tableMain[0]["妯″叿浠g爜"]
+ , "HMouldName": tableMain[0]["妯″叿鍚嶇О"]
+ , "HMouldModel": tableMain[0]["妯″叿鍨嬪彿"]
, "HDeptID": tableMain[0]["HDeptID"]
, "HDeptName": tableMain[0]["閮ㄩ棬"]
, "HWorkCenterID": tableMain[0]["HWorkCenterID"]
@@ -1045,9 +1347,6 @@
, "HEmpName": tableMain[0]["璐熻矗浜�"]
, "HRemark": tableMain[0]["琛ㄥご澶囨敞"]
, "HOrgID": tableMain[0].HOrgID
-
-
-
, "HMaker": tableMain[0]["鍒跺崟浜�"]
, "HUpDater": tableMain[0]["淇敼浜�"]
, "HChecker": tableMain[0]["瀹℃牳浜�"]
@@ -1057,12 +1356,18 @@
, "HCloseMan": tableMain[0]["鍏抽棴浜�"]
, "HCloseDate": tableMain[0]["鍏抽棴鏃堕棿"] == null ? "" : Format(new Date(tableMain[0]["鍏抽棴鏃堕棿"]), "yyyy-MM-dd")
});
-
//瀛愯〃 璧嬪��
-
option.data = tableSub;
table.render(option);
-
+ for (var i = 1; i <= option.data.length; i++) {
+ if (option.data[i-1].HIsRequired) {
+ $('#HIsRequired' + i).attr("checked", true);
+ }
+ $('#HDataUnit' + i).find("option[value='" + option.data[i - 1].HDataUnit + "']").attr("selected", true).trigger("change");
+ $('#HDataForm' + i).find("option[value='" + option.data[i - 1].HDataForm + "']").attr("selected", true).trigger("change");
+
+ }
+ form.render('select');
form.render('checkbox');
}
}
@@ -1094,8 +1399,12 @@
for (var i = 0; i < table.cache["mainTable"].length; i++) {
if (table.cache["mainTable"][i] != "") {
table.cache["mainTable"][i].LAY_TABLE_INDEX = i;
+ table.cache["mainTable"][i].HTechParamIDStd == null ? 0 : table.cache["mainTable"][i].HTechParamIDStd
num.push(table.cache["mainTable"][i])
}
+
+
+
}
var sMainStr = JSON.stringify(data.field);
var sSubStr = JSON.stringify(num);
@@ -1278,6 +1587,68 @@
});
+
+ //閮ㄩ棬
+ function GetHDeptNameValue(obj) {
+ $("#HDeptID").val(obj[0].HItemID);//閮ㄩ棬id
+ $("#HDeptName").val(obj[0].閮ㄩ棬鍚嶇О);//閮ㄩ棬鍚嶇О
+ }
+
+ //璐熻矗浜�
+ function GetHEmpValue(obj) {
+ $("#HEmpID").val(obj[0].HItemID);//璐熻矗浜篿d
+ $("#HEmpName").val(obj[0].鑱屽憳鍚嶇О);//璐熻矗浜哄悕绉�
+ if ($("#HEmpName").val() == "") {
+ $("#HEmpName").val(obj[0].鑱屽憳浠g爜);
+ }
+ }
+
+ //鐗╂枡
+ function GetMaterValue(obj) {
+ $("#HMaterID").val(obj[0].HItemID);
+ $("#HMaterNumber").val(obj[0].鐗╂枡浠g爜);
+ $("#HMaterName").val(obj[0].鐗╂枡鍚嶇О);
+ $("#HMaterModel").val(obj[0].瑙勬牸鍨嬪彿);
+ }
+
+ //宸ヤ綔涓績
+ function GetWorkCenterValue(obj) {
+ $("#HWorkCenterID").val(obj[0].HItemID);//宸ヤ綔涓績id
+ $("#HWorkCenterName").val(obj[0].宸ヤ綔涓績鍚嶇О);//宸ヤ綔涓績鍚嶇О
+ if ($("#HWorkCenterName").val() == "") {
+ $("#HWorkCenterName").val(obj[0].宸ヤ綔涓績鍚嶇О);
+ }
+ }
+
+ //璁惧妗f
+ function GetEquipFileValue(obj) {
+ $("#HEquipID").val(obj[0].hmainid);//id
+ $("#HEquipNumber").val(obj[0].璁惧缂栫爜);//璁惧浠g爜
+ $("#HEquipName").val(obj[0].璁惧鍚嶇О);//璁惧鍚嶇О
+ $("#HEquipModel").val(obj[0].璁惧瑙勬牸);//璁惧鍨嬪彿
+ }
+
+ //宸ュ簭
+ function GetProcessValue(obj) {
+ //鑾峰彇鏁版嵁
+ $("#HProcID").val(obj[0].HItemID);//宸ヤ綔涓績id
+ $("#HProcName").val(obj[0].宸ュ簭鍚嶇О);//宸ヤ綔涓績鍚嶇О
+ if ($("#HProcName").val() == "") {
+ $("#HProcName").val(obj[0].宸ュ簭鍚嶇О);
+ }
+ }
+
+ //宸ヨ壓鍙傛暟
+ function GetParameterValue(obj) {
+ OptionData = obj;
+ }
+
+ //宸ヨ壓鍙傛暟鍗曚綅
+ function GetTechnologyParameterUnitValue(obj) {
+ OptionData = obj;
+ }
+
+
</script>
</body>
</html>
\ No newline at end of file
--
Gitblit v1.9.1