From 2f053f201b7a0e8cc07cf932940bfbf5d0fedaa3 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期二, 09 一月 2024 17:04:39 +0800
Subject: [PATCH] 1
---
WebTM/views/设备管理/Sb_Add_EqpMaintenanceBillList.html | 208 ++++++++++++++++++++++++++++++---------------------
1 files changed, 123 insertions(+), 85 deletions(-)
diff --git "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_Add_EqpMaintenanceBillList.html" "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_Add_EqpMaintenanceBillList.html"
index 01e0f91..b96d197 100644
--- "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_Add_EqpMaintenanceBillList.html"
+++ "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_Add_EqpMaintenanceBillList.html"
@@ -157,11 +157,12 @@
<select name="HMainSourceBillType" lay-filter="HMainSourceBillType" id="HMainSourceBillType">
<option value="璁惧缁翠慨鐧昏鍗�" selected="selected">璁惧缁翠慨鐧昏鍗�</option>
<option value="鎵嬪伐褰曞叆">鎵嬪伐褰曞叆</option>
+ <option value="璁惧缁翠慨娲惧伐鍗�">璁惧缁翠慨娲惧伐鍗�</option>
</select>
</div>
</div>
<div class="layui-inline">
- <label class="layui-form-label">璁惧鏁呴殰鐧昏鍗曢�夊崟鍙�</label>
+ <label class="layui-form-label">閫夊崟鍙�</label>
<div class="layui-input-inline">
<input type="text" name="HMainSourceBillNo" id="HMainSourceBillNo" class="layui-input" value="" style="float:left;width:150px;">
<input type="hidden" name="HMainSourceInterID" id="HMainSourceInterID" class="layui-input" value="" style="float:left;width:150px;">
@@ -288,6 +289,13 @@
set_InitGrid_pj();
//鍒ゆ柇鎿嶄綔绫诲瀷
if (OperationType == 1) {//鏃犳簮鍗�
+ $("#HEmpID").val(sessionStorage["HEmpID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭缁翠慨浜篒D
+ $("#HEmpName").val(sessionStorage["HEmpName"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭缁翠慨浜�
+ $("#HDeptID").val(sessionStorage["HDeptID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭閮ㄩ棬ID
+ $("#HDeptName").val(sessionStorage["HDept"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭閮ㄩ棬
+ $("#HManagerID").val(sessionStorage["HEmpID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭璐熻矗浜篒D
+ $("#HManagerName").val(sessionStorage["HEmpName"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭璐熻矗浜�
+
set_AddFNew();
}
else if (OperationType == 3) {//缂栬緫
@@ -305,12 +313,12 @@
form.render('select');
switch (Sctag) {
//鏃犳簮鍗曟柊澧�
- case '1':
+ case '鎵嬪伐褰曞叆':
$('#HMainSourceBillNo').attr("disabled", false);
$('#XDHList').addClass("layui-btn-disabled").attr("disabled", true);
break;
//鏈夋簮鍗曟柊澧灺� 聽
- case '2':
+ default:
$('#HMainSourceBillNo').attr("disabled", true);
$('#XDHList').removeClass("layui-btn-disabled").attr("disabled", false);
break;
@@ -325,7 +333,7 @@
table.on('toolbar(mainTable)', function (obj) {
var checkStatus = table.checkStatus('mainTable')
, data = checkStatus.data;;
- var NewRow = { "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": ""/*, "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " " */ };
+ var NewRow = { "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": sessionStorage["HEmpID"], "HManagerCode": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRepairExplanation": "", "HRemark": ""/*, "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " " */ };
switch (obj.event) {
//澧炲姞涓�琛�
case 'btn-AddLine': set_AddLine(NewRow);
@@ -339,7 +347,7 @@
table.on('toolbar(mainTable1)', function (obj) {
var checkStatus = table.checkStatus('mainTable1')
, data = checkStatus.data;
- var NewRow = { "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HQty": "0", "HRemark": "" };
+ var NewRow = { "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HManagerID": sessionStorage["HEmpID"], "HManagerNumber": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HQty": "0", "HRemark": "" };
switch (obj.event) {
//鏂板涓�琛�
case 'btn-AddLine1': btnAddLine1(NewRow);
@@ -557,85 +565,115 @@
//琛ㄥご淇℃伅閫夋嫨鍗曟嵁寮圭獥
form.on('submit(XDHList)', function () {
- //椤甸潰灞�-鑷畾涔�
- layer.open({
- type: 2,
- skin: 'layui-layer-rim', //鍔犱笂杈规
- title: '璁惧鏁呴殰鐧昏鍗�',
- shift: 2,
- area: ['90%', '90%'],
- content: ['../璁惧绠$悊/Sb_EqpConkBookBillList.html', 'yes'],
- btn: ['纭畾', '鍙栨秷']
- , btn1: function (index, layero) {
- //var NewRow = { "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "", "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " " };
- ////鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
- 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('璇烽�夋嫨鍗曟嵁鏁版嵁');
- }
- $("#HMainSourceBillNo").val(checkStatus.data[0].鍗曟嵁鍙�);
- $("#HMainSourceInterID").val(checkStatus.data[0].hmainid);
- $("#HMainSourceEntryID").val(checkStatus.data[0].hsubid);
- //鍥炲~璁惧淇℃伅
- $("#HEquipName").val(checkStatus.data[0].璁惧鍚嶇О);
- $("#HEquipID").val(checkStatus.data[0].HEquipID);
- ////鎸夐�夊崟鍙峰姞杞借〃浣撴暟鎹�
- //$.ajax({
- // url: GetWEBURL() + 'Sb_EqpRepairWorkBill/Sb_EqpRepairWorkBillSubByHMainSourceBillNo',
- // type: "GET",
- // data: { "HMainSourceBillNo": checkStatus.data[0].鍗曟嵁鍙� },
- // success: function (result) {
- // if (result.count == 1) {
- // var EndData = result.data;
- // var rowdate = layui.table.cache["mainTable"];
- // if (rowdate.length == 0) //琛ㄤ綋鏁版嵁涓虹┖鏃�
- // {
- // buttonArr = [];//娓呯┖鏁扮粍
- // for (var i = 0; i < checkStatus.data.length; i++) {
- // var checkrow = { "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "", "HSourceInterID": EndData[i].hmainid, "HSourceEntryID": EndData[i].hsubid, "HSourceBillNo": EndData[i].鍗曟嵁鍙�, "HSourceBillType": EndData[i].HBillType };
- // buttonArr.push(checkrow); //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍
- // }
- // table.reload("mainTable", {
- // data: buttonArr //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
- // })
- // }
- // else {
- // buttonArr = [];//娓呯┖鏁扮粍
- // for (var i = 0; i < EndData.length; i++) {
- // var checkrow = {
- // "HRepairID": rowdate[i].HRepairID, "HRepairCode": rowdate[i].HRepairCode, "HRepairName": rowdate[i].HRepairName,
- // "HRepairExplanation": rowdate[i].HRepairExplanation, "HManagerID": rowdate[i].HManagerID, "HManagerCode": rowdate[i].HManagerCode,
- // "HManagerName": rowdate[i].HManagerName, "HMoney": rowdate[i].HMoney, "HRemark": rowdate[i].HRemark,
- // "HSourceInterID": EndData[i].hmainid, "HSourceEntryID": EndData[i].hsubid,
- // "HSourceBillNo": EndData[i].鍗曟嵁鍙�, "HSourceBillType": EndData[i].HBillType
- // };
- // buttonArr.push(checkrow); //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍
- // }
- // table.reload("mainTable", {
- // data: buttonArr //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
- // })
- // }
- // } else {
- // layer.alert(result.code + result.Message, { icon: 5 });
- // }
- // }, error: function () {
- // layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
- // }
- //});
- layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
- }
- , btn2: function (index, layero) {
- //鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
- //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
- },
- end: function () {
- },
- success: function (layero, index) {
- //layer.full(index);
- }
- });
+ if ($("#HMainSourceBillType").val() == "璁惧缁翠慨鐧昏鍗�") {
+ //椤甸潰灞�-鑷畾涔�
+ layer.open({
+ type: 2,
+ skin: 'layui-layer-rim', //鍔犱笂杈规
+ title: '璁惧鏁呴殰鐧昏鍗�',
+ shift: 2,
+ area: ['90%', '90%'],
+ content: ['../璁惧绠$悊/Sb_EqpConkBookBillList.html', 'yes'],
+ btn: ['纭畾', '鍙栨秷']
+ , btn1: function (index, layero) {
+ //var NewRow = { "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "", "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " " };
+ ////鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
+ 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('璇烽�夋嫨鍗曟嵁鏁版嵁');
+ }
+ $("#HMainSourceBillNo").val(checkStatus.data[0].鍗曟嵁鍙�);
+ $("#HMainSourceInterID").val(checkStatus.data[0].hmainid);
+ $("#HMainSourceEntryID").val(checkStatus.data[0].hsubid);
+ //鍥炲~璁惧淇℃伅
+ $("#HEquipName").val(checkStatus.data[0].璁惧鍚嶇О);
+ $("#HEquipID").val(checkStatus.data[0].HEquipID);
+ ////鎸夐�夊崟鍙峰姞杞借〃浣撴暟鎹�
+ //$.ajax({
+ // url: GetWEBURL() + 'Sb_EqpRepairWorkBill/Sb_EqpRepairWorkBillSubByHMainSourceBillNo',
+ // type: "GET",
+ // data: { "HMainSourceBillNo": checkStatus.data[0].鍗曟嵁鍙� },
+ // success: function (result) {
+ // if (result.count == 1) {
+ // var EndData = result.data;
+ // var rowdate = layui.table.cache["mainTable"];
+ // if (rowdate.length == 0) //琛ㄤ綋鏁版嵁涓虹┖鏃�
+ // {
+ // buttonArr = [];//娓呯┖鏁扮粍
+ // for (var i = 0; i < checkStatus.data.length; i++) {
+ // var checkrow = { "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "", "HSourceInterID": EndData[i].hmainid, "HSourceEntryID": EndData[i].hsubid, "HSourceBillNo": EndData[i].鍗曟嵁鍙�, "HSourceBillType": EndData[i].HBillType };
+ // buttonArr.push(checkrow); //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍
+ // }
+ // table.reload("mainTable", {
+ // data: buttonArr //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
+ // })
+ // }
+ // else {
+ // buttonArr = [];//娓呯┖鏁扮粍
+ // for (var i = 0; i < EndData.length; i++) {
+ // var checkrow = {
+ // "HRepairID": rowdate[i].HRepairID, "HRepairCode": rowdate[i].HRepairCode, "HRepairName": rowdate[i].HRepairName,
+ // "HRepairExplanation": rowdate[i].HRepairExplanation, "HManagerID": rowdate[i].HManagerID, "HManagerCode": rowdate[i].HManagerCode,
+ // "HManagerName": rowdate[i].HManagerName, "HMoney": rowdate[i].HMoney, "HRemark": rowdate[i].HRemark,
+ // "HSourceInterID": EndData[i].hmainid, "HSourceEntryID": EndData[i].hsubid,
+ // "HSourceBillNo": EndData[i].鍗曟嵁鍙�, "HSourceBillType": EndData[i].HBillType
+ // };
+ // buttonArr.push(checkrow); //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍
+ // }
+ // table.reload("mainTable", {
+ // data: buttonArr //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
+ // })
+ // }
+ // } else {
+ // layer.alert(result.code + result.Message, { icon: 5 });
+ // }
+ // }, error: function () {
+ // layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+ // }
+ //});
+ layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+ }
+ , btn2: function (index, layero) {
+ //鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
+ //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
+ },
+ end: function () {
+
+ },
+ success: function (layero, index) {
+ //layer.full(index);
+ }
+ });
+ } else if ($("#HMainSourceBillType").val() == "璁惧缁翠慨娲惧伐鍗�") {
+ //椤甸潰灞�-鑷畾涔�
+ layer.open({
+ type: 2,
+ skin: 'layui-layer-rim', //鍔犱笂杈规
+ title: '璁惧缁翠慨娲惧伐鍗�',
+ shift: 2,
+ area: ['90%', '90%'],
+ content: ['../璁惧绠$悊/璁惧缁翠慨娲惧伐鍗�/Sb_EquipRepairSendWorkBillList.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 !=1 ) {
+ return layer.msg('璇烽�夋嫨涓�鏉″崟鎹暟鎹�');
+ }
+ $("#HMainSourceBillNo").val(checkStatus.data[0].鍗曟嵁鍙�);
+ $("#HMainSourceInterID").val(checkStatus.data[0].hmainid);
+ $("#HMainSourceEntryID").val(checkStatus.data[0].hsubid);
+ //鍥炲~璁惧淇℃伅
+ $("#HEquipName").val(checkStatus.data[0].璁惧);
+ $("#HEquipID").val(checkStatus.data[0].HEquipID);
+
+ layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+ }
+ });
+ }
});
//淇濆瓨
@@ -792,8 +830,8 @@
function set_AddFNew() {
//鑾峰彇鏈�澶у崟鎹彿
get_MAXNum();
- option.data = [{ "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": ""/*, "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " "*/ }];
- option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HQty": "0", "HRemark": "" }];
+ option.data = [{ "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": sessionStorage["HEmpID"], "HManagerCode": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRepairExplanation": "", "HRemark": ""/*, "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " "*/ }];
+ option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HManagerID": sessionStorage["HEmpID"], "HManagerNumber": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HQty": "0", "HRemark": "" }];
table.render(option);
table.render(option1);
}
--
Gitblit v1.9.1