From 6029d9cca9e132c4ba7a64cefe3db5eeaaecdf74 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期五, 07 十一月 2025 09:24:53 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-LayUI
---
WebTM/views/质量管理/库存检验单/QC_Add_Edit_StockCheckBill.html | 261 ++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 240 insertions(+), 21 deletions(-)
diff --git "a/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\272\223\345\255\230\346\243\200\351\252\214\345\215\225/QC_Add_Edit_StockCheckBill.html" "b/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\272\223\345\255\230\346\243\200\351\252\214\345\215\225/QC_Add_Edit_StockCheckBill.html"
index a1b5981..a13028d 100644
--- "a/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\272\223\345\255\230\346\243\200\351\252\214\345\215\225/QC_Add_Edit_StockCheckBill.html"
+++ "b/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\272\223\345\255\230\346\243\200\351\252\214\345\215\225/QC_Add_Edit_StockCheckBill.html"
@@ -50,6 +50,7 @@
<div style="padding: 10px;">
<button type="button" class="layui-btn layui-btn-normal" style="margin-left: 0px" lay-submit="" lay-filter="btn-AddNew" id="btn-AddNew">鏂板</button>
<button type="button" class="layui-btn layui-btn-normal" style="margin-left: 0px" lay-submit="" lay-filter="btnSave" id="btnSave">淇濆瓨</button>
+ <button type="button" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="set_CheckBill" id="set_CheckBill">瀹℃牳</button>
<button type="button" class="layui-btn layui-btn-normal" style="margin-left: 0px" lay-submit="" lay-filter="btn-Exit" id="btn-Exit">閫�鍑�</button>
</div>
<div class="layui-tab" lay-filter="tab-POStockInBill">
@@ -638,6 +639,7 @@
<div class="layui-btn-container">
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>澧炲姞涓�琛�</button>
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>澶嶅埗涓�琛�</button>
+ <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button>
</div>
</script>
<!--闅愯棌瀛楁-->
@@ -688,7 +690,7 @@
//1.妫�楠岄」鐩〃浣撴暟鎹�煎瓨鍌紝鍊熺敤鐐瑰嚮琛屼簨浠讹紝褰撳垏鎹㈣鏃舵妸涓婃鎵�鍦ㄨ鐨勬暟鎹瓨鍒皁ption.data涓婏紱
//杩欎釜鎬濊矾浼氭湁涓棶棰橈紝鏈�鍚庝竴娆$偣鍑荤殑閭h鏁版嵁灏嗕笉浼氬湪鍘昏Е鍙戠偣鍑昏浜嬩欢瀛樺偍鍊硷紝鐩墠鎯冲埌鐨勬槸鍦ㄦ墽琛屼繚瀛樻柟娉曟椂鍦ㄦ妸鏈�鍚庣偣鍑荤殑閭d竴琛屾暟鎹瓨鍏ption.data涓�
-
+ var OptionData = [];
layui.config({
base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
}).extend({
@@ -718,6 +720,7 @@
var UnRightQty_isFied = 0; //鐢ㄤ簬鍒ゆ柇鏄惁鍚堟牸//妫�楠屽�艰〃鏍间笉鍚堟牸鏁伴噺姹囨��
var editIndex = 0;//缂栬緫涓嬫爣
var SampleNum = [];//鏍锋湰鏁伴噺
+ var HModName = "QC_Add_Edit_StockCheckBill";
//#region 銆愬姩鎬佽幏鍙栨ā鍧楀悕绉般��
var HModuleType = "7519";
@@ -1066,6 +1069,10 @@
form.render('select');
}
break;
+ //鍒楄缃�
+ case 'set_HideColumn':
+ get_HideColumn();
+ break;
}
});
//#endregion
@@ -1219,7 +1226,7 @@
shift: 2,
area: ['90%', '90%'],
maxmin: true,
- content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_CheckItem.html', 'yes'],
+ content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_CheckItem.html?openType=2', 'yes'],
btn: ['纭畾', '鍙栨秷']
, btn1: function (index, layero) {
@@ -1229,16 +1236,55 @@
if (checkStatus.data.length === 0) {
return layer.msg('璇烽�夋嫨鏁版嵁');
}
- var HResult = checkStatus.data[0].榛樿缁撹 == "鍚堟牸" ? 1 : 2
- //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
- obj.update({
- 妫�楠岄」鐩�: checkStatus.data[0].鍚嶇О
- , HQCCheckItemID: checkStatus.data[0].HItemID
- , HResult: HResult
- });
- $('#HResult' + rowIndex + '').find("option[value='" + HResult + "']").attr("selected", true);
- form.render('select');
- layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+ if (checkStatus.data.length === 1) {
+ var HResult = checkStatus.data[0].榛樿缁撹 == "鍚堟牸" ? 1 : 2
+ //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
+ obj.update({
+ 妫�楠岄」鐩�: checkStatus.data[0].鍚嶇О
+ , 妫�楠岄」鐩唬鐮�: checkStatus.data[0].浠g爜
+ , HQCCheckItemID: checkStatus.data[0].HItemID
+ , HResult: HResult
+ });
+ $('#HResult' + rowIndex + '').find("option[value='" + HResult + "']").attr("selected", true);
+ form.render('select');
+ layer.close(layer.index);
+ }
+ else {
+ //(澶氶�夎)
+ //灏嗗師鏈夎〃浣撴暟鎹啓鍏ユ暟缁�
+ var tableBak = table.cache["mainTable"]; //鑾峰彇涔嬪墠缂栬緫杩囩殑琛ㄦ牸鏁版嵁
+ buttonArr = [];//娓呯┖鏁扮粍
+ for (var i = 0; i < tableBak.length; i++) {
+ if (tableBak[i]["HQCCheckItemID"] != 0 && tableBak[i]["妫�楠岄」鐩�"] != "" && tableBak[i]["HResult"] != undefined && tableBak[i]["HResult"] != null) {
+ buttonArr.push(tableBak[i]); //濡傛灉鍏抽敭瀛楁涓嶄负绌猴紝鍒欏皢涔嬪墠鐨勬暟鎹瓨鍌�
+ }
+ }
+ //灏嗘壒閲忛�夋嫨鐨勬暟鎹啓鍏ユ暟缁勶紙澶氶�夎锛�
+ for (var i = 0; i < checkStatus.data.length; i++) {
+ buttonArr.push({
+ "妫�楠岄」鐩�": checkStatus.data[i].鍚嶇О, "妫�楠岄」鐩唬鐮�": checkStatus.data[i].浠g爜, "HQCCheckItemID": checkStatus.data[i].HItemID, "HResult": 1,
+ "HInspectInstruMentID": "0", "妫�楠屼华鍣ㄤ唬鐮�": "", "妫�楠屼华鍣�": "", "HQCStd": "", "HUnit": "", "HQCNote": "", "HAnalysisMethod": "",
+ "HMax": "", "HMin": "", "HAvg": "", "HRemark": "", "HKeyInspect": false, "HStatus": 0, "HSampleSchemeID": 0, "HUnitID": 0,
+ "HInspectVal": '', "HTargetVal": '', "HUpLimit": '', "HDownLimit": '', "HUpOffSet": '', "HDownOffSet": '', "HSampleDamageQty": '0',
+ "HSampleSchemeName": "", "HSampleQty": "0", "HSampleDamageQty": "0", "HAcceptQty": "0", "HInspectionLevel": "", "HRejectQty": "",
+ "HStrictness": "", "HSampleUnRightQty": "", "HAQL": "", "HSamplingType": ""
+ });
+ }
+
+ table.reload("mainTable", {
+ data: buttonArr //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
+ })
+ for (var i = 1; i <= option.data.length; i++) {
+ $('#HResult' + i + '').find("option[value='" + option.data[i - 1].HResult + "']").attr("selected", true);
+ $('#HAnalysisMethod' + i + '').find("option[value='" + option.data[i - 1].HAnalysisMethod + "']").attr("selected", true);
+ //瀹屾垚鏍囪
+ if (option.data[i - 1].HKeyInspect) {
+ $('#HKeyInspect' + i + '').attr("checked", true);
+ }
+ }
+ form.render('select');
+ layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+ }
}
, btn2: function (index, layero) {
//鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
@@ -1259,7 +1305,7 @@
shift: 2,
area: ['90%', '90%'],
maxmin: true,
- content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_InspectInstruMent.html', 'yes'],
+ content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_InspectInstruMent.html?openType=2', 'yes'],
btn: ['纭畾', '鍙栨秷']
, btn1: function (index, layero) {
@@ -1272,7 +1318,8 @@
//鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
obj.update({
- 妫�楠屼华鍣�: checkStatus.data[0].妫�楠屼华鍣ㄥ悕绉�
+ 妫�楠屼华鍣ㄤ唬鐮�: checkStatus.data[0].妫�楠屼华鍣ㄤ唬鐮�
+ , 妫�楠屼华鍣�: checkStatus.data[0].妫�楠屼华鍣ㄥ悕绉�
, HInspectInstruMentID: checkStatus.data[0].HItemID
});
layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
@@ -1282,7 +1329,16 @@
//return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
},
end: function () {
+ if (OptionData.length > 0) {
+ //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+ obj.update({
+ 妫�楠屼华鍣ㄤ唬鐮�: OptionData[0].妫�楠屼华鍣ㄤ唬鐮�,
+ 妫�楠屼华鍣�: OptionData[0].妫�楠屼华鍣ㄥ悕绉�,
+ HInspectInstruMentID: OptionData[0].HItemID
+ });
+ OptionData = [];
+ }
}
});
}
@@ -1309,7 +1365,7 @@
shift: 2,
area: ['90%', '90%'],
maxmin: true,
- content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_InspectValue.html', 'yes'],
+ content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_InspectValue.html?openType=2', 'yes'],
btn: ['纭畾', '鍙栨秷']
, btn1: function (index, layero) {
@@ -1400,7 +1456,11 @@
form.on('submit(btnSave)', function (data) {
set_SaveBill(data);
});
-
+ //#region 瀹℃牳鎸夐挳
+ form.on('submit(set_CheckBill)', function (data) {
+ set_CheckBill(0);
+ });
+ //#endregion
//淇濆瓨
function set_SaveBill(data) {
//淇濆瓨鏈�鍚庝竴娆$偣鍑昏鐨勬楠屽��
@@ -1949,7 +2009,7 @@
shift: 2,
area: ['90%', '90%'],
maxmin: true,
- content: ['../../../views/Baseset/鍩虹璧勬枡/Sc_ProcessExchangeBillListView.html', 'yes'],
+ content: ['../../杞﹂棿绠$悊/宸ュ簭娴佽浆鍗�/Sc_ProcessExchangeBillList.html?openType=2', 'yes'],
btn: ['纭畾', '鍙栨秷']
, btn1: function (index, layero) {
@@ -1988,7 +2048,7 @@
shift: 2,
area: ['90%', '90%'],
maxmin: true,
- content: ['../../鐢熶骇绠$悊/鐢熶骇浠诲姟鍗�/Sc_ICMOBillList.html', 'yes'],
+ content: ['../../鐢熶骇绠$悊/鐢熶骇浠诲姟鍗�/Sc_ICMOBillList.html?openType=2', 'yes'],
btn: ['纭畾', '鍙栨秷']
, btn1: function (index, layero) {
@@ -2066,7 +2126,7 @@
shift: 2,
area: ['90%', '90%'],
maxmin: true,
- content: ['../../鍩虹璧勬枡/鐢熶骇鍩虹璧勬枡/Gy_Source.html', 'yes'],
+ content: ['../../鍩虹璧勬枡/鐢熶骇鍩虹璧勬枡/Gy_Source.html?Htype=&openType=2', 'yes'],
btn: ['纭畾', '鍙栨秷']
, btn1: function (index, layero) {
@@ -2142,7 +2202,7 @@
shift: 2,
area: ['90%', '90%'],
maxmin: true,
- content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Material.html', 'yes'],
+ content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Material.html?openType=2', 'yes'],
btn: ['纭畾', '鍙栨秷']
, btn1: function (index, layero) {
@@ -2173,6 +2233,7 @@
//琛ㄥご淇℃伅妫�楠屾柟妗堝脊绐�
form.on('submit(btnSearchQCScheme)', function () {
+ var HProcName = $("#HProcName").val();
//椤甸潰灞�-鑷畾涔�
layer.open({
type: 2,
@@ -2182,6 +2243,7 @@
shift: 2,
area: ['90%', '90%'],
maxmin: true,
+ //content: ['../../璐ㄩ噺绠$悊/妫�楠屾柟妗堝崟/QC_CheckProjectList.html?OperationType=1&HName=' + HName + '&HProcName=' + HProcName + '', 'yes'],
content: ['../../璐ㄩ噺绠$悊/妫�楠屾柟妗堝崟/QC_CheckProjectList.html', 'yes'],
btn: ['纭畾', '鍙栨秷']
, btn1: function (index, layero) {
@@ -2221,6 +2283,7 @@
//鍒濆鍖栬〃鏍�
function set_InitGrid() {
+ $('#set_CheckBill').addClass("layui-btn-disabled").attr("disabled", true);//鍒濆鍖栫鐢ㄥ鏍告寜閽�
$("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
$("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd"));
//鍒濆琛ㄦ牸鏁版嵁
@@ -3686,10 +3749,153 @@
form.render('checkbox');
}
//#endregion
+ //#region 瀛愯〃1锛氶殣钘忓垪璁剧疆
+ function get_HideColumn() {
+ var colName = "";
+ var contentUrl = "";
+ for (var i = 1; i < option.cols[0].length - 1; i++) {
+ colName += option.cols[0][i]["title"] + ",";
+ }
+ var urlStr = window.document.location.pathname;//鑾峰彇鏂囦欢璺緞
+ var urlLen = urlStr.split('/');
+ for (var i = 0; i < urlLen.length - 4; i++) {
+ contentUrl += "../";
+ }
+ colName = encodeURI(colName.substring(0, colName.length - 1));//瀵� URI 杩涜缂栫爜
+ contentUrl += '鍩虹璧勬枡/闅愯棌鍒楄缃�/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName;
+
+ layer.open({
+ type: 2
+ , skin: "layui-layer-rim" //鍔犱笂杈规
+ , title: "闅愯棌鍒楄缃�" //鏍囬
+ , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
+ , shift: 2 //寮瑰嚭鍔ㄧ敾
+ , area: ["50%", "90%"] //绐椾綋澶у皬
+ , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+ , content: [contentUrl, "yes"]
+ , btn: ["纭畾", "鍙栨秷"]
+ , btn1: function (index, laero) {
+ //鍒锋柊琛ㄦ牸鏁版嵁
+ DisPlay_HideColumn();
+ //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+ layer.close(index);//鍏抽棴寮圭獥
+ }
+ })
+ }
+ //#endregion
+ //#region 瀛愯〃1锛氭樉绀哄垪鏁版嵁
+ function DisPlay_HideColumn() {
+ $.ajax({
+ url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
+ async: false,
+ type: "GET",
+ data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
+ async: false,
+ success: function (data1) {
+ if (data1.data.length != 0) {
+ var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁
+ var titleData = ["HQCCheckItemID", "HInspectInstruMentID"];
+
+ dataCol = data1.data[0].HGridString.split(',');
+
+ for (var i = 0; i < option.cols[0].length - 2; i++) {
+ if (dataCol.length <= i) {
+ break;
+ }
+ var dataCols = dataCol[i].split('|');
+ //闅愯棌鍒�
+ if (dataCols[1] == 1) {
+ option.cols[0][i + 1]["hide"] = true;
+ }
+ //璁剧疆鍒楀
+ if (dataCols[3] > 0) {
+ option.cols[0][i + 1]["width"] = dataCols[3];
+ }
+ //璁剧疆鍐呭瀛椾綋澶у皬
+ if (data1.data[0].HFontSize != 0) {
+ option.cols[0][i + 1]["style"] += "font-size:" + data1.data[0].HFontSize + "px;";
+ } else {
+ option.cols[0][i + 1]["style"] += "font-size:100%";
+ }
+ //鏄剧ず鍒�
+ if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) {
+ option.cols[0][i + 1]["hide"] = false;
+ }
+ //瀛椾綋鎵�鍦ㄤ綅缃�(宸� 灞呬腑 鍙�)
+ switch (dataCols[2]) {
+ case "L":
+ option.cols[0][i + 1]["align"] = "left";
+ break;
+ case "M":
+ option.cols[0][i + 1]["align"] = "center";
+ break;
+ case "R":
+ option.cols[0][i + 1]["align"] = "right";
+ break;
+ }
+ //璁剧疆琛ㄦ牸title灞炴�ф樉绀哄埆鍚�
+ if (dataCols[4] != null && dataCols[4] != "") {
+ option.cols[0][i + 1]["title"] = dataCols[4];
+ }
+ }
+
+ //鍙栨秷鍐荤粨鍒�
+ for (var i = 1; i < option.cols[0].length - 1; i++) {
+ if (option.cols[0][i]["fixed"] != null) {
+ option.cols[0][i]["fixed"] = null;
+ }
+ else {
+ break;
+ }
+ }
+ //鍐荤粨鍒�
+ if (data1.data[0].HFixCols != 0) {
+ for (var i = 0; i < data1.data[0].HFixCols; i++) {
+ if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) {
+ data1.data[0].HFixCols += 1;
+ }
+ option.cols[0][i + 1]["fixed"] = "left";
+ }
+ }
+ table.render(option);
+ } else {
+ table.render(option);
+ }
+ }, error: function () {
+ layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+ }
+ })
+ }
+ //#endregion
//浠ヤ笂涓簂ayui妯″潡
});
-
+ //#region 瀹℃牳鏁版嵁
+ function set_CheckBill() {
+ var InterID = $("#HInterID").val();
+ //閫昏緫瀹℃牳鏂规硶
+ $.ajax({
+ type: "GET",
+ url: GetWEBURL() + "/QC_WorkSelfCheckBill/AuditQC_WorkSelfCheckBill", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+ data: { "HInterID": InterID, "Type": 1, "user": sessionStorage["HUserName"] },
+ success: function (result) {
+ if (result.count == 1) {
+ layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
+ // 寰楀埌frame绱㈠紩
+ var index = layer.getFrameIndex(window.name);
+ //鍏抽棴褰撳墠frame
+ layer.close(index);
+ });
+ $('#set_CheckBill').addClass("layui-btn-disabled").attr("disabled", true);// 绂佺敤瀹℃牳鎸夐挳
+ } else {
+ layer.alert(result.code + result.Message, { icon: 5 });
+ }
+ }, error: function () {
+ layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+ }
+ });
+ }
+ //#endregion
function GetGySource(obj) { //鐢熶骇璧勬簮
$("#HSourceName").val(obj[0].鐢熶骇璧勬簮鍚嶇О);
$("#HSourceID").val(obj[0].HItemID);
@@ -3728,6 +3934,19 @@
$("#HShiftsName").val(obj[0].鐝鍚嶇О);
$("#HShiftsID").val(obj[0].HItemID);
}
+ //宸ュ簭
+ function GetProcessValue(obj) {
+ $("#HProcName").val(obj[0].宸ュ簭鍚嶇О);
+ $("#HProcID").val(obj[0].HItemID);
+ }
+ //妫�楠岄」鐩�
+ function GetCheckItemValue(obj) {
+ OptionData = obj;
+ }
+ //妫�楠屼华鍣�
+ function GetInspectInstruMentValue(obj) {
+ OptionData = obj;
+ }
</script>
</body>
</html>
\ No newline at end of file
--
Gitblit v1.9.1