From 937f69faab202969f7ba556eaeb36c81f306b3f7 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期四, 10 八月 2023 14:23:20 +0800
Subject: [PATCH] 工资结算单(其它):数据检验增加重复校验和数量非空校验,增加列设置,子表可编辑与不可编辑做颜色区分,子表单元格内容根据列宽进行隐藏,取消分页,增加合计行
---
WebTM/views/工资管理/工资结算单(其他)/Pay_OtherBalBillEdit.html | 194 ++++++++++++++++++++++++++++++++++++++++++-----
WebTM/Properties/PublishProfiles/JFTM.pubxml.user | 2
2 files changed, 172 insertions(+), 24 deletions(-)
diff --git a/WebTM/Properties/PublishProfiles/JFTM.pubxml.user b/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
index fe3c59c..2fdd93d 100644
--- a/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
+++ b/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
@@ -2739,7 +2739,7 @@
<publishTime>10/19/2021 09:27:19</publishTime>
</File>
<File Include="views/宸ヨ祫绠$悊/宸ヨ祫缁撶畻鍗�%28鍏朵粬%29/Pay_OtherBalBillEdit.html">
- <publishTime>04/11/2023 16:34:43</publishTime>
+ <publishTime>08/10/2023 14:20:41</publishTime>
</File>
<File Include="views/宸ヨ祫绠$悊/宸ヨ祫缁撶畻鍗�%28鍏朵粬%29/Pay_OtherBalBillList.html">
<publishTime>07/20/2023 10:38:15</publishTime>
diff --git "a/WebTM/views/\345\267\245\350\265\204\347\256\241\347\220\206/\345\267\245\350\265\204\347\273\223\347\256\227\345\215\225\050\345\205\266\344\273\226\051/Pay_OtherBalBillEdit.html" "b/WebTM/views/\345\267\245\350\265\204\347\256\241\347\220\206/\345\267\245\350\265\204\347\273\223\347\256\227\345\215\225\050\345\205\266\344\273\226\051/Pay_OtherBalBillEdit.html"
index 13e0fef..fc97bc8 100644
--- "a/WebTM/views/\345\267\245\350\265\204\347\256\241\347\220\206/\345\267\245\350\265\204\347\273\223\347\256\227\345\215\225\050\345\205\266\344\273\226\051/Pay_OtherBalBillEdit.html"
+++ "b/WebTM/views/\345\267\245\350\265\204\347\256\241\347\220\206/\345\267\245\350\265\204\347\273\223\347\256\227\345\215\225\050\345\205\266\344\273\226\051/Pay_OtherBalBillEdit.html"
@@ -15,7 +15,7 @@
<script src="../../../layuiadmin/Scripts/webConfig.js"></script>
<script src="../../../layuiadmin/PubCustom.js"></script>
<script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
- <style type="text/css">
+ <!--<style type="text/css">
.layui-form-item .layui-inline {
margin-right: 0;
}
@@ -34,7 +34,7 @@
margin-left: -15px;
margin-right: -15px;
}
- </style>
+ </style>-->
</head>
<body>
@@ -60,7 +60,7 @@
<div class="layui-form-item" style="padding-top: 10px;">
<div class="layui-row">
<div class="layui-col-xs4 layui-inline">
- <label class="layui-form-label">鍗曟嵁鍙�</label>
+ <label class="layui-form-label">鍗曟嵁鍙�<label style="color:red"> * </label></label>
<div class="layui-input-inline">
<input type="text" class="layui-input" name="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly>
<input type="hidden" name="HInterID" id="HInterID" value="0">
@@ -68,7 +68,7 @@
</div>
</div>
<div class="layui-col-xs4 layui-inline">
- <label class="layui-form-label">鏃ユ湡</label>
+ <label class="layui-form-label">鏃ユ湡<label style="color:red"> * </label></label>
<div class="layui-input-inline">
<input class="layui-input" name="HDate" id="HDate" autocomplete="off" model="datetime" dateFormat="yyyy-MM-dd" placeholder="yyyy-MM-dd">
</div>
@@ -82,7 +82,7 @@
</div>
<div class="layui-row">
<div class="layui-col-xs4 layui-inline">
- <label class="layui-form-label">鐝粍</label>
+ <label class="layui-form-label">鐝粍<label style="color:red"> * </label></label>
<div class="layui-input-inline">
<input type="text" name="HGroupName" id="HGroupName" readonly class="layui-input" value="" style="float:left;width:150px;">
<input type="hidden" name="HGroupID" id="HGroupID" class="layui-input" value="" style="float:left;width:150px;">
@@ -92,7 +92,7 @@
</div>
</div>
<div class="layui-col-xs4 layui-inline">
- <label class="layui-form-label">閮ㄩ棬</label>
+ <label class="layui-form-label">閮ㄩ棬<label style="color:red"> * </label></label>
<div class="layui-input-inline">
<input type="text" name="HDeptName" id="HDeptName" readonly class="layui-input" value="" style="float:left;width:150px;">
<input type="hidden" name="HDeptID" id="HDeptID" class="layui-input" value="" style="float:left;width:150px;">
@@ -102,7 +102,7 @@
</div>
</div>
<div class="layui-col-xs4 layui-inline">
- <label class="layui-form-label">鑱屽憳</label>
+ <label class="layui-form-label">鑱屽憳<label style="color:red"> * </label></label>
<div class="layui-input-inline">
<input type="text" name="HEmpName" id="HEmpName" readonly class="layui-input" value="" style="float:left;width:150px;">
<input type="hidden" name="HEmpID" id="HEmpID" class="layui-input" value="" style="float:left;width:150px;">
@@ -136,7 +136,7 @@
</div>-->
<div class="layui-row">
<div class="layui-col-xs4 layui-inline">
- <label class="layui-form-label">宸ヨ祫绫诲瀷</label>
+ <label class="layui-form-label">宸ヨ祫绫诲瀷<label style="color:red"> * </label></label>
<div class="layui-input-inline">
<input type="text" name="HPayTypeName" id="HPayTypeName" readonly class="layui-input" value="" style="float:left;width:150px;">
<input type="hidden" name="HPayType" id="HPayType" class="layui-input" value="" style="float:left;width:150px;">
@@ -224,10 +224,9 @@
<table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
<script type="text/html" id="toolbarDemo">
<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>
<script type="text/html" id="xuhao">
@@ -257,6 +256,10 @@
, laydate = layui.laydate
, element = layui.element;
+ //妯″潡鍚�
+ var HModName = "Pay_OtherBalBill";
+
+
var params = get_UrlVars();
if (typeof (params[params[0]]) == "undefined") {
var OperationType = 1;//鎿嶄綔绫诲瀷
@@ -278,25 +281,25 @@
elem: '#mainTable'
, toolbar: '#toolbarDemo'
, height: 500
+ , totalRow: true
//,url: '/demo/table/user/' //鏁版嵁鎺ュ彛
- , page: true //寮�鍚垎椤�
, cols: [[ //琛ㄥご
{ type: 'checkbox', fixed: 'left' }
- , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe", width: 100 }
- , { field: 'HEmpID', title: 'HEmpID', edit: 'text', width: 100, hide: true }
+ , { templet: '#xuhao', title: '搴忓彿', fixed: 'left', event: "qwe", width: 100, style: 'background-color: #f9f9f9;' }
+ , { field: 'HEmpID', title: 'HEmpID', edit: 'text', width: 100, hide: true, style: 'background-color: #f9f9f9;' }
, { field: 'HEmpNumber', title: '鑱屽憳浠g爜', edit: 'text', event: 'HEmpCheck', width: 200 }
- , { field: 'HEmpName', title: '鑱屽憳鍚嶇О', width: 100 }
- , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true }
+ , { field: 'HEmpName', title: '鑱屽憳鍚嶇О', width: 100, style: 'background-color: #f9f9f9;' }
+ , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true, style: 'background-color: #f9f9f9;' }
, { field: 'HMaterCode', title: '鐗╂枡浠g爜', edit: 'text', event: 'HMaterCode', width: 100 }
- , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 300 }
- , { field: 'HMaterSpec', title: '瑙勬牸鍨嬪彿', width: 200 }
- , { field: 'HProcID', title: 'HProcID', edit: 'text', width: 100, hide: true }
+ , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 300, style: 'background-color: #f9f9f9;' }
+ , { field: 'HMaterSpec', title: '瑙勬牸鍨嬪彿', width: 200, style: 'background-color: #f9f9f9;' }
+ , { field: 'HProcID', title: 'HProcID', edit: 'text', width: 100, hide: true, style: 'background-color: #f9f9f9;' }
, { field: 'HProcNumber', title: '宸ュ簭浠g爜', edit: 'text', event: "HProcNumber", width: 100 }
- , { field: 'HProcName', title: '宸ュ簭鍚嶇О', width: 100 }
+ , { field: 'HProcName', title: '宸ュ簭鍚嶇О', width: 100, style: 'background-color: #f9f9f9;' }
, { field: 'HTimes', title: '宸ユ椂', edit: 'text', width: 100 }
, { field: 'HQty', title: '鏁伴噺', edit: 'text', width: 100 }
- , { field: 'HPrice', title: '宸ヤ环', edit: 'text', width: 100 }
- , { field: 'HMoney', title: '閲戦', edit: 'text', width: 100 }
+ , { field: 'HPrice', title: '宸ヤ环', width: 100, style: 'background-color: #f9f9f9;' }
+ , { field: 'HMoney', title: '閲戦', width: 100, totalRow: true, style: 'background-color: #f9f9f9;' }
, { field: 'HRemark', title: '澶囨敞', edit: 'text', width: 100 }
, { field: 'HMainSourceInterID ', title: '婧愬崟涓诲唴鐮�', edit: 'text', width: 100, hide: true }
, { field: 'HMainSourceEntryID', title: '婧愬崟瀛愬唴鐮�', edit: 'text', width: 100, hide: true }
@@ -349,7 +352,8 @@
});
}
-
+ //鍒楄缃�
+ DisPlay_HideColumn();
//澶村伐鍏锋爮浜嬩欢
var rowid = 0;
@@ -388,6 +392,10 @@
table.render(option);//灏嗘暟鎹覆鏌撳埌琛ㄦ牸涓�
//layer.alert(copyrow);
}
+ break;
+ //鍒楄缃�
+ case 'set_HideColumn':
+ get_HideColumn();
break;
}
});
@@ -490,6 +498,7 @@
} else {
obj.update({
HPrice: result.data[0].鍗曚环
+ ,HMoney: obj.data.HQty * result.data[0].鍗曚环
});
}
}
@@ -547,6 +556,7 @@
} else {
obj.update({
HPrice: result.data[0].鍗曚环
+ , HMoney: obj.data.HQty * result.data[0].鍗曚环
});
}
}
@@ -916,6 +926,124 @@
}
});
+ //#region 闅愯棌鍒楄缃�
+ 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 鏄剧ず鍒楁暟鎹�
+ function DisPlay_HideColumn() {
+ $.ajax({
+ url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
+ type: "GET",
+ data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
+ async: false,
+ success: function (data1) {
+ if (data1.data.length != 0) {
+ var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁
+ var titleData = ["HMaterID", "HProcID", "HEmpID", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�", "婧愬崟鍗曞彿", "婧愬崟绫诲瀷", "鍏抽棴鏃堕棿"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+
+ dataCol = data1.data[0].HGridString.split(',');
+
+ for (var i = 0; i < option.cols[0].length - 2; 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
+
});
@@ -953,7 +1081,7 @@
sSubStr = JSON.parse(sSubStr);
for (var i = 0; i <= sSubStr.length - 1; i++) { //鍒ゆ柇鎵爜鏁伴噺涓嶈兘涓�0
if (sSubStr[i].HMaterID == "") {
- layer.msg("鏄庣粏璁板綍绗�" + (i + 1) + "琛�,鍣ㄥ叿淇℃伅涓虹┖!", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+ layer.msg("鏄庣粏璁板綍绗�" + (i + 1) + "琛�,鐗╂枡淇℃伅涓虹┖!", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
return Result = false;
}
if (sSubStr[i].HProcID == "") {
@@ -964,13 +1092,33 @@
layer.msg("鏄庣粏璁板綍绗�" + (i + 1) + "琛�,鑱屽憳淇℃伅涓虹┖!", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
return Result = false;
}
+ if (sSubStr[i].HQty + "" == "0") {
+ layer.msg("鏄庣粏璁板綍绗�" + (i + 1) + "琛�,鏁伴噺涓虹┖!", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+ return Result = false;
+ }
}
+
+ //#region 瀛愯〃鍏抽敭瀛楁閲嶅妫�楠�
+ var num = [];
+ var temp;
+ for (var i = 0; i < sSubStr.length; i++) {
+ temp = sSubStr[i].HMaterID + "|" + sSubStr[i].HProcID + "|" + sSubStr[i].HEmpID;
+ if ($.inArray(temp, num) != -1) {
+ layer.msg("鏄庣粏璁板綍绗�" + (i + 1) + "琛�,鐗╂枡銆佸伐搴忋�佽亴鍛橀噸澶�!", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+ return false;
+ }
+ num.push(temp);
+ }
+ //#endregion
}
else {
return Result;
}
return Result;
}
+
+
+
</script>
</body>
</html>
\ No newline at end of file
--
Gitblit v1.9.1