From be8b558b89a89deb3aa871fc2ddaacb7fb2197bd Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期一, 16 十月 2023 09:25:14 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-LayUI
---
WebTM/views/生产管理/异常反馈单/Sc_MESExecptFeedBackBillList.html | 225 +++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 190 insertions(+), 35 deletions(-)
diff --git "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\345\274\202\345\270\270\345\217\215\351\246\210\345\215\225/Sc_MESExecptFeedBackBillList.html" "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\345\274\202\345\270\270\345\217\215\351\246\210\345\215\225/Sc_MESExecptFeedBackBillList.html"
index e153a78..536e107 100644
--- "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\345\274\202\345\270\270\345\217\215\351\246\210\345\215\225/Sc_MESExecptFeedBackBillList.html"
+++ "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\345\274\202\345\270\270\345\217\215\351\246\210\345\215\225/Sc_MESExecptFeedBackBillList.html"
@@ -41,7 +41,7 @@
<div class="layui-inline">
<label class="layui-form-label">闃呰鐘舵��</label>
<div class="layui-input-block">
- <select name="HReadFlag" lay-filter="HReadFlag" style="width:190px;">
+ <select id="HReadFlag" name="HReadFlag" lay-filter="HReadFlag" style="width:190px;">
<option value="-1" selected="selected">鍏ㄩ儴</option>
<option value="0">鏈槄</option>
<option value="1">宸查槄</option>
@@ -80,10 +80,10 @@
<div class="layui-inline">
<label class="layui-form-label">绱ф�ョ▼搴�</label>
<div class="layui-input-block">
- <select name="HLevel" lay-filter="HLevel" style="width:190px;">
- <option value="-1" selected="selected">鍏ㄩ儴</option>
- <option value="0">鏅��</option>
- <option value="1">绱ф��</option>
+ <select id="HLevel" name="HLevel" lay-filter="HLevel" style="width:190px;">
+ <option value="鍏ㄩ儴" selected="selected">鍏ㄩ儴</option>
+ <option value="鏅��">鏅��</option>
+ <option value="绱ф��">绱ф��</option>
</select>
</div>
</div>
@@ -101,6 +101,7 @@
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Case" id="btn-Case" style="display:none;"><i class="layui-icon layui-icon-note"></i>缁撴</button>
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Test" id="btn-Test" style="display:none;"><i class="layui-icon layui-icon-circle"></i>楠岃瘉</button>
<button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>鍒锋柊</button>
+ <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button>
<button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>閫�鍑�</button>
</div>
</script>
@@ -129,8 +130,10 @@
//鏌ヨ鏉′欢
var sWhere = "";
var option = [];
+ var titleData = ["HInterID", "HEntryID", "HDeptID","HBillStatus"];
//#endregion
+ var HModName = "Sc_MESExecptFeedBackBillList";
//#region 杩涘叆椤甸潰鏃㈠姞杞�
//鍒濆鍖栬〃鏍�
set_InitGrid();
@@ -152,16 +155,19 @@
case 'btn-Delete':set_DeleteBill();
break;
//瀹℃牳鎸夐挳
- case 'btn-Audit': set_CheckBill();
+ case 'btn-Audit': set_AuditBill();
break;
//鍙嶅鏍告寜閽�
- case 'btn-DeAudit': set_AbandonCheck();
+ case 'btn-DeAudit': set_DeAuditBill();
break;
//鍒锋柊
case 'get_Refresh': set_Refresh();
break;
//閫�鍑�
case 'get_Exit': Pub_Close(2);
+ break;
+ //鍒楄缃�
+ case 'set_HideColumn': get_HideColumn();
break;
};
});
@@ -179,8 +185,8 @@
//#region 姝ら〉闈㈡墍鏈夋柟娉�
- //鍒濆鍖栬〃鏍�
- function set_InitGrid() {
+ //鍒濆鍖栬〃鏍�
+ function set_InitGrid() {
$("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
$("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
var columns = [
@@ -227,7 +233,7 @@
}
//鍔犺浇缃戞牸
function get_Display(sWhere) {
- var wait = layer.load();//閬僵
+ var ajaxLoad = layer.load();//閬僵
$.ajax({
url: GetWEBURL() + '/Sc_MESTransFerWorkBill/Get_TransFerBillList',
@@ -235,20 +241,169 @@
data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
success: function (data1) {
if (data1.count == 1) {
- DataList = data1.data;
+ var data = [];
+ var col = [];
+ //缁欑┖鐨勬暟缁勮祴鍊�
+ for (var key in data1.list) {
+ data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
+ }
+ //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋
+ col.push({ type: 'checkbox', fixed: 'left' });
+ for (var i = 0; i < data.length; i++) {
+ // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
+ if ($.inArray(data[i].name, titleData) > -1) {
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //闅愯棌id鍒�
+ }
+ else {
+ switch (data[i].Type) {
+ //int
+ case 'DateTime':
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 120 });
+ break;
+ default:
+ col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120 });
+ }
+ }
+ }
+
+ option.cols = [col];
option.data = data1.data;
table.render(option);
- layer.close(wait);
+
+ layer.close(ajaxLoad);
+ //layer.alert("鏌ヨ鎴愬姛", { icon: 1 });
} else {
- layer.close(wait);
- layer.alert(data1.Message, { icon: 5 });
+ layer.close(ajaxLoad);
+ layer.alert(data1.code + data1.Message, { icon: 5 });
}
}, error: function () {
- layer.close(wait);
+ layer.close(ajaxLoad);
layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
}
});
+ DisPlay_HideColumn();
}
+
+
+ //#region 闅愯棌鍒楄缃�
+ function get_HideColumn() {
+ var colName = "";
+ var contentUrl = "";
+ for (var i = 1; i < option.cols[0].length; 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 鏄剧ず鍒楁暟鎹�
+ function DisPlay_HideColumn() {
+ $.ajax({
+ url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
+ type: "GET",
+ data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
+ success: function (data1) {
+ if (data1.data.length != 0) {
+
+ var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁
+ //var titleData = ["鍗曟嵁ID", "HMouldID", "hsubid", "HManagerID", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+
+ dataCol = data1.data[0].HGridString.split(',');
+
+ for (var i = 0; i < option.cols[0].length - 1; i++) {
+ 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 (data1.data[0].HColumnWidth != 0) {
+ // option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;";
+ //} else {
+ // option.cols[0][i + 1]["width"] = "";
+ //}
+ //鏄剧ず鍒�
+ 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;
+ }
+ }
+
+ //鍙栨秷鍐荤粨鍒�
+ 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
+
+
//鏂板
function set_AddNew() {
@@ -306,9 +461,9 @@
var checkStatus = table.checkStatus('mainTable')
, data = checkStatus.data;
if (checkStatus.data.length === 1) {
- var InterID = data[0].hmainid.toString();
+ var InterID = data[0].HInterID.toString();
var HEntryID = data[0].HEntryID.toString();
- var HReadFlag = data[0].HReadFlag.toString();
+ var HReadFlag = data[0].闃呰鐘舵��.toString();
if (HReadFlag == "鏈槄") {
//閫昏緫鍒犻櫎鏂规硶
layer.confirm("纭瑕佸垹闄ゅ悧锛屽垹闄ゅ悗涓嶈兘鎭㈠", { title: "鍒犻櫎纭" }, function (index) {
@@ -354,44 +509,44 @@
}
function get_FastQuery() {
- var HStatus = $("select[name='HReadFlag']").val();//鐘舵��
+ var HStatus = $("#HReadFlag").val();//闃呰鐘舵��
var HBeginDate = $("#HBeginDate").val();//寮�濮嬫棩鏈�
var HEndDate = $("#HEndDate").val();//缁撴潫鏃ユ湡
var HSendMan = $("#HSendMan").val();//鍙戦�佷汉
- var HLevel = $("select[name='HLevel']").val();//绱ф�ョ▼搴�
+ var HLevel = $("#HLevel").val();//绱ф�ョ▼搴�
if (HStatus) {
switch (HStatus) {
case '-1': //鍏ㄩ儴
sWhere += "";
break;
case '0': //鏈槄
- sWhere += " and B.HReadFlag='0'";
+ sWhere += " and 闃呰鐘舵�� = '鏈槄'";
break;
case '1': //宸查槄
- sWhere += " and B.HReadFlag='1'";
+ sWhere += " and 闃呰鐘舵�� = '宸查槄'";
break;
default:
}
}
if (HBeginDate) {
- sWhere += " and CONVERT(varchar(100),A.HDate, 23) >= '" + HBeginDate + "'";
+ sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + HBeginDate + "'";
}
if (HEndDate) {
- sWhere += " and CONVERT(varchar(100),A.HDate, 23) <= '" + HEndDate + "'";
+ sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) <= '" + HEndDate + "'";
}
if (HSendMan) {
- sWhere += " and A.HSendMan like '%" + HSendMan + "%'";
+ sWhere += " and 鍙戦�佷汉 like '%" + HSendMan + "%'";
}
if (HLevel) {
switch (HLevel) {
- case '-1': //鍏ㄩ儴
+ case '鍏ㄩ儴': //鍏ㄩ儴
sWhere += "";
break;
- case '0': //鏅��
- sWhere += " and A.HLevel='0'";
+ case '鏅��': //鏅��
+ sWhere += " and 绱ф�ョ▼搴� ='鏅��'";
break;
- case '1': //绱ф��
- sWhere += " and A.HLevel='1'";
+ case '绱ф��': //绱ф��
+ sWhere += " and 绱ф�ョ▼搴� ='绱ф��'";
break;
default:
}
@@ -403,11 +558,11 @@
//閲嶇疆杩囨护鏉′欢
function set_ClearQuery() {
- $('#HReadFlag').find("option[value='-1']").attr("selected", true);
+ $('#HReadFlag').val("-1");
$("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
$("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
$("#HSendMan").val("");
- $('#HLevel').find("option[value='-1']").attr("selected", true);
+ $('#HLevel').val("鏅��");
sWhere = "";
get_Display(sWhere);
}
@@ -419,8 +574,8 @@
, data = checkStatus.data;
if (checkStatus.data.length === 1) {
var HBillStatus = data[0].HBillStatus.toString(); //鍗曟嵁鐘舵��
- var InterID = data[0].hmainid.toString();
- if (HBillStatus > 0) {
+ var InterID = data[0].HInterID.toString();
+ if (HBillStatus > 1) {
layer.msg('鍗曟嵁涓嶄负鏈鏍哥姸鎬�,涓嶈兘鍐嶆瀹℃牳锛�');
return false;
}
@@ -460,8 +615,8 @@
, data = checkStatus.data;
if (checkStatus.data.length === 1) {
var HBillStatus = data[0].HBillStatus.toString(); //鍗曟嵁鐘舵��
- var InterID = data[0].hmainid.toString();
- if (HBillStatus=0) {
+ var InterID = data[0].HInterID.toString();
+ if (HBillStatus==1) {
layer.msg('鍗曟嵁鏈鏍哥姸鎬�,鏃犻渶鍙嶅鏍革紒');
return false;
}
--
Gitblit v1.9.1