From 3d240d150e6e1a4e2df1a9f87d00ddd03ace4ee5 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期五, 17 一月 2025 10:06:37 +0800
Subject: [PATCH] 增加 BOM层级展开报表,修复全程追溯报表 黑白标页签导出失败,工艺路线的表头查询优化页面排序
---
WebTM/views/计划管理/工艺路线/Gy_RoutingBill.html | 473 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 443 insertions(+), 30 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_RoutingBill.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_RoutingBill.html"
index 0d98a7a..3f0cdc9 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_RoutingBill.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_RoutingBill.html"
@@ -72,6 +72,12 @@
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_AbandonCheck" id="set_AbandonCheck">鍙嶅鏍�</button>
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CloseBill" id="set_CloseBill">鍏抽棴</button>
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CancelCloseBill" id="set_CancelCloseBill">鍙嶅叧闂�</button>
+ <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_Copy" id="set_Copy">澶嶅埗</button>
+ <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CheckFlowInfo" id="set_CheckFlowInfo">鏌ョ湅瀹℃壒杩涘害</button>
+ <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CheckBill_Flow" id="set_CheckBill_Flow">澶氱骇瀹℃牳</button>
+ <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_AbandonCheck_Flow" id="set_AbandonCheck_Flow">澶氱骇鍙嶅鏍�</button>
+ <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_RejectCheck_Flow" id="set_RejectCheck_Flow">椹冲洖</button>
+ <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_WithdrawCheck_Flow" id="set_WithdrawCheck_Flow">鎾ゅ洖</button>
</div>
<div class="layui-tab" lay-filter="tab-POStockInBill">
<ul class="layui-tab-title" lay-filter="tab-all">
@@ -98,7 +104,7 @@
</div>
</div>
<div class="layui-inline">
- <label class="layui-form-label" style="width: 85px;">宸ヨ壓璺嚎鍚嶇О<label style="color:red"> * </label></label>
+ <label class="layui-form-label" style="width: 90px;">宸ヨ壓璺嚎鍚嶇О*</label>
<div class="layui-input-block" style="margin-left: 120px;">
<input type="text" class="layui-input" lay-verify="HName" name="HName" id="HName">
</div>
@@ -109,7 +115,7 @@
<div class="layui-inline">
<label class="layui-form-label" style="width: 85px;padding: 9px 18px;">浜у搧浠g爜*</label>
<div class="layui-input-block" style="margin-left: 77px;">
- <input type="text" class="layui-input" lay-verify="HMaterNumber" name="HMaterNumber" id="HMaterNumber" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+ <input type="text" class="layui-input" lay-verify="HMaterNumber" name="HMaterNumber" id="HMaterNumber" style="width: 60%;display: inline-block;">
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchMater" id="btnSearchMater" style="padding: 0 10px;float: right;margin-right: 3px;">
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
</button>
@@ -133,7 +139,7 @@
<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;">
+ <div class="layui-input-block" style="margin-left: 83px;">
<input type="text" class="layui-input" name="HUnitName" lay-verify="HUnitName" id="HUnitName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
<input type="hidden" name="HUnitID" id="HUnitID" lay-verify="HUnitID" value="0">
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnUnit" id="btnUnit" style="padding: 0 10px;float: right;margin-right: 3px;">
@@ -145,17 +151,25 @@
<label class="layui-form-label" style="width: 85px;">瀹氶绫诲瀷</label>
<div class="layui-input-inline">
<select name="HProcPriceType" id="HProcPriceType" lay-filter="HProcPriceType" style="width:200px;">
- <option value="涓存椂瀹氶" selected="selected">涓存椂瀹氶</option>
- <option value="姘镐箙瀹氶">姘镐箙瀹氶</option>
+ <option value="涓存椂瀹氶">涓存椂瀹氶</option>
+ <option value="姘镐箙瀹氶" selected="selected">姘镐箙瀹氶</option>
</select>
</div>
</div>
<div class="layui-inline">
- <div class="layui-input-block" style="margin-left: 96px;">
+ <div class="layui-input-block" style="margin-left: 0px;">
<input type="checkbox" name="checkboxHStandard" id="checkboxHStandard" lay-skin="primary" lay-filter="checkboxHStandard" checked title="鏄惁榛樿宸ヨ壓">
<input type="hidden" value="true" name="HStandard" id="HStandard" lay-verify="HStandard">
<!--<input type="checkbox" name="checkboxHUseFlag" id="checkboxHUseFlag" title="鏄惁鍚敤" lay-skin="primary" lay-filter="checkboxHUseFlag">
<input type="hidden" value="false" name="HUseFlag" id="HUseFlag">-->
+ </div>
+ </div>
+ <div class="layui-inline">
+ <label class="layui-form-label" style="width: 85px;">缁勭粐*</label>
+ <div class="layui-input-block" style="margin-left: 120px; width: 501px;">
+ <select name="HOrgID" id="HOrgID" lay-verify="HOrgID">
+ <!--鍔ㄦ�佹覆鏌撶粍缁�-->
+ </select>
</div>
</div>
</div>
@@ -173,13 +187,20 @@
<div class="layui-inline">
<label class="layui-form-label" style="width: 85px;">寮�濮嬫棩鏈�</label>
<div class="layui-input-block" style="margin-left: 120px;">
- <input type="date" class="layui-input" lay-verify="HBeginDate" name="HBeginDate" id="HBeginDate" style="padding-left: 80px;">
+ <input type="date" class="layui-input" lay-verify="HBeginDate" name="HBeginDate" id="HBeginDate" style="padding-left: 20px;">
</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="date" class="layui-input" lay-verify="HEndDate" name="HEndDate" id="HEndDate" style="padding-left: 80px;">
+ </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="hidden" class="layui-input" name="HMaker" id="HMaker" lay-verify="HMaker" value="">
+ <input type="text" class="layui-input" name="HRemark" id="HRemark" lay-verify="HRemark" placeholder="璇疯緭鍏ュ唴瀹�" onmouseover="this.title=this.value" style=" width: 500px;">
</div>
</div>
<!--<div class="layui-inline">
@@ -248,26 +269,26 @@
</div>-->
</div>
<div class="layui-row">
- <div class="layui-inline">
+ <!--<div class="layui-inline">
<label class="layui-form-label" style="width: 85px;">澶囨敞</label>
<div class="layui-input-block" style="margin-left: 120px;">
<input type="hidden" class="layui-input" name="HMaker" id="HMaker" lay-verify="HMaker" value="">
<input type="text" class="layui-input" name="HRemark" id="HRemark" lay-verify="HRemark" placeholder="璇疯緭鍏ュ唴瀹�" onmouseover="this.title=this.value" style=" width: 500px;">
</div>
- </div>
+ </div>-->
</div>
<div class="layui-row">
- <div class="layui-inline">
+ <!--<div class="layui-inline">
<label class="layui-form-label" style="width: 85px;">缁勭粐*</label>
<div class="layui-input-block" style="margin-left: 120px; width: 501px;">
- <select name="HOrgID" id="HOrgID" lay-verify="HOrgID">
+ <select name="HOrgID" id="HOrgID" lay-verify="HOrgID">-->
<!--鍔ㄦ�佹覆鏌撶粍缁�-->
- </select>
+ <!--</select>
</div>
- </div>
+ </div>-->
</div>
</div>
</div>
@@ -318,7 +339,7 @@
<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="" id="" style="background-color:#efefef4d;" readonly>
+ <input type="text" class="layui-input" name="hcloser" id="hcloser" style="background-color:#efefef4d;" readonly>
</div>
</div>
<div class="layui-inline">
@@ -338,7 +359,7 @@
<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="" id="" style="background-color:#efefef4d;" readonly>
+ <input type="text" class="layui-input" name="hclosedate" id="hclosedate" style="background-color:#efefef4d;" readonly>
</div>
</div>
<div class="layui-inline">
@@ -523,6 +544,12 @@
</script>
<script>
+ //#region 鏂囨湰妗嗚緭鍏ユ悳绱㈢浉鍏虫暟鎹�-鍙橀噺
+ var childPage = null; //鑾峰彇瀛愮獥鍙e璞★紝鐢ㄤ簬鎿嶄綔瀛愮獥鍙g殑鍙橀噺鍜屾柟娉�
+ var currRowIndex = 0; //鐢ㄤ簬瀹氫綅瀛愮獥鍙e綋鍓嶉�変腑鐨勮
+ var childData = null; //鐢ㄤ簬鑾峰彇瀛愮獥鍙h繑鍥炵殑鏁版嵁
+ //#endregion
+
var OptionData = [];
layui.config({
base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
@@ -545,7 +572,7 @@
//鍒濆琛ㄦ牸鏁版嵁
var rowdata = [{
- "HProcNo": "10", "HProcID_S": 0, "HProcType": "涓诲伐搴�", "HCenterID_S": 0, "HCenterID_SName": ""
+ "HProcNo": "10", "HProcID_S": 0, "HProcType": "涓诲伐搴�", "HCenterID_S": 0, "HCenterID_SName": "","宸ュ簭浠g爜":""
, "HWorkQty_S": 0, "HSubStdEmpQty_S": 0, "HMouldNo": "", "HChangeMould": 0, "HPackStd": ""
, "HPack": "", "HPutArea": "", "HMyWorkDays": 0, "HMyFixWorkDays": 0, "宸ュ簭": "","宸ユ":""
, "HProcID": 0, "宸ヤ綔涓績浠g爜": "", "HCenterID": 0, "宸ヤ綔涓績": "", "HSupID": 0
@@ -561,6 +588,7 @@
, "HQCSchemeID_Proc": 0, "HQCSchemeNumber_Proc": "", "HQCSchemeName_Proc": ""
, "HQCSchemeID_Patrol": 0, "HQCSchemeNumber_Patrol": "", "HQCSchemeName_Patrol": ""
, "HQCFst": false, "HQCProc": false, "HQCPatrol": false, "HMaterToSourceCtrl": false
+ ,"HSubStdEmpAvg_S": 0
}];
var HModName = "Gy_RoutingBill";
//#endregion
@@ -573,12 +601,13 @@
, limit: 500 //姣忛〉榛樿鏄剧ず鐨勬暟閲�
, totalRow: true
//, cellMinWidth: 120
- , height: 400
+ , height: 450
, cols: [[ //琛ㄥご
{ type: 'checkbox', totalRowText: '鍚堣琛�' }
, { type: 'numbers', field: '搴忓彿', title: '搴忓彿', totalRow: true }
, { field: 'HProcNo', title: '娴佹按鍙�', edit: 'text' }
- , { field: 'HProcID', title: '宸ュ簭ID', hide: true }//, hide: true
+ , { field: 'HProcID', title: '宸ュ簭ID', hide: true }//, hide: true
+ , { field: '宸ュ簭浠g爜', title: '宸ュ簭浠g爜'}
, { field: '宸ュ簭', title: '宸ュ簭', edit: 'text', event: "CheckHProcID" }//f7
, { field: 'HProcID_S', title: '宸ユID', hide: true }//, hide: true
, { field: '宸ユ', title: '宸ユ', edit: 'text', event: "CheckHProcMulID" }//f7
@@ -620,7 +649,9 @@
, { field: 'HQCSchemeID_Patrol', title: '宸℃妫�楠屾柟妗圛D', hide: true }//f7
, { field: 'HQCSchemeNumber_Patrol', title: '宸℃妫�楠屾柟妗堜唬鐮�', edit: 'text', event: "HQCSchemeNumber_Patrol", width: 125 }
, { field: 'HQCSchemeName_Patrol', title: '宸℃妫�楠屾柟妗堝悕绉�', width: 125 }//f7
-
+ , { field: 'HWorkQty', title: '鍔犲伐鏁伴噺', edit: 'text', width: 125 }
+ , { field: 'HSubStdEmpQty_S', title: '浜х嚎浜烘暟', edit: 'text', width: 125 }
+ , { field: 'HSubStdEmpAvg_S', title: '浜哄潎浜ц兘', edit: 'text', width: 125}
//, { field: 'HPassRate', title: '鑹巼', edit: 'text' }//榛樿
//, { field: 'HProcID_S', title: '宸ユ', edit: 'text' }
////, { field: 'HCenterID_S', title: '浜х嚎涓績id', hide: true }//hide: true
@@ -654,7 +685,8 @@
//, { field: 'HAutoTrunFlag', title: '鑷姩绉昏浆', templet: "#HAutoTrunFlag" }//chenbox
//, { field: 'HProcCheckNote', title: '鏈伐搴忕‘璁よ褰�', edit: 'text' }
//, { field: 'HProcWorkNum', title: '绋嬪簭鍙�', edit: 'text' }
- //, { field: 'HWorkTimes_S', title: '浜у搧鍗曚欢宸ユ椂', edit: 'text' }
+ /* , { field: 'HWorkTimes_S', title: '浜у搧鍗曚欢宸ユ椂', edit: 'text' }*/
+ , { field: 'HWorkTimes_S', title: '鍗曚欢鐢熶骇鑺傛媿', edit: 'text' }
, { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo' }
]]
//, done: function (res, curr, count) {
@@ -765,6 +797,8 @@
$("#HInterID").val(d.data[0].HInterID);
$("#HBillNo").val(d.data[0].HBillNo);
$("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
+ $("#HBeginDate").val(Format(new Date(), "yyyy-MM-dd"));
+ $("#HEndDate").val(Format(new Date(2100, 12, 31), "yyyy-MM-dd"));
}
});
}
@@ -783,6 +817,120 @@
//#endregion
//#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛�
+ //#region 琛ㄥご鍩虹璧勬枡閫夋嫨寮圭獥
+ //#region 鏂囨湰妗嗙洃鍚�
+ $(document).ready(function () {
+ //#region 鏍规嵁鐗╂枡浠g爜鑾峰彇鐗╂枡鍩虹璧勬枡绛涢�夊脊绐�
+ //鏍规嵁鍏冪礌ID瀵瑰厓绱犺繘琛岀洃鍚�=============================================================================
+ $("#HMaterNumber").on('keydown', function (data) {
+ //================================================================================================
+ var errKeys = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Enter"];
+ if ($.inArray(event.key, errKeys) == -1) { //濡傛灉鎸変笅鐨勯敭浣嶄笉鏄� 鏂瑰悜閿紝鍒欏埛鏂板脊绐椾腑鐨勬暟鎹�
+ if (childPage == null) { //鍒ゆ柇褰撳墠瀛愮獥鍙f槸鍚﹀凡缁忔墦寮�锛岃嫢鏈墦鍗★紝鍒欐墦寮�椤甸潰锛屽苟鑾峰彇瀛愮獥鍙g殑瀵硅薄
+ var offset = $(this).offset(); //鑾峰彇瑙﹀彂浜嬩欢鐨勫厓绱犵殑浣嶇疆锛岀敤浜庡畾浣嶅瓙绐楀彛鎵撳紑鐨勪綅缃�
+ var innerHeight = window.innerHeight;
+ var top = offset.top + 0.05 * innerHeight;
+ var left = offset.left;
+ if (top + 0.05 * innerHeight + 0.3 * innerHeight > innerHeight) {
+ top = top - 0.3 * innerHeight - 0.05 * innerHeight;
+ }
+ layer.open({
+ type: 2 //寮圭獥绫诲瀷
+ , skin: 'layui-layer-rim' //鍔犱笂杈规
+ , area: ['25%', '30%'] //澶у皬
+ , shadeClose: true //鐐瑰嚮閬僵鏃跺叧闂脊绐�
+ , offset: [top, left]
+ , title: false //涓嶆樉绀烘爣棰樻爮
+ //, title: '椤圭洰璐圭敤鍒楄〃' //鏍囬
+ , shift: 2 //寮瑰嚭鍔ㄧ敾
+ , closeBtn: 0 //绂佺敤鍏抽棴鎸夐挳
+ , content: ["../../鍩虹璧勬枡/閫氱敤鍩虹璧勬枡/Gy_CommonBaseData.html?OperationType=2", "yes"]
+ , success: function (layero, index) {
+ setTimeout(function () {
+ //淇敼锛屾牴鎹枃鏈鏁版嵁锛岀紪鍐欐煡璇㈣鍙�================================================================================================
+ var value = $("#HMaterNumber").val().replace(/'/g, ""); //鑾峰彇鏂囨湰妗嗘渶鏂板��
+ currRowIndex = 0;
+ var tableView = "h_v_Gy_MaterialList";
+ var childSWhere = "select top(10) HItemID,鐗╂枡浠g爜,鐗╂枡鍚嶇О,瑙勬牸鍨嬪彿,HUnitID,璁¢噺鍗曚綅鍚嶇О from " + tableView + " where 1=1 and 缁勭粐鍚嶇О = '" + sessionStorage["Organization"] + "' and (鐗╂枡浠g爜 like '%" + value + "%' or 鐗╂枡鍚嶇О like '%" + value + "%') order by 鐗╂枡浠g爜 desc";
+ childPage.getData(childSWhere, tableView);
+ //===================================================================================================================================
+ }, 200);
+ }
+ , end: function () {
+ childPage = null;
+ currRowIndex = 0;
+ if (childData != null) {
+ //鏍规嵁寮圭獥杩斿洖鏁版嵁璁剧疆鏂囨湰妗嗘暟鎹�=================================================================================================
+ //鑾峰彇鏁版嵁
+ $("#HMaterID").val(childData.HItemID);//鐗╂枡id
+ $("#HMaterName").val(childData.鐗╂枡鍚嶇О);//鐗╂枡鍚嶇О
+ $("#HMaterNumber").val(childData.鐗╂枡浠g爜);//鐗╂枡浠g爜
+ $("#HMaterModel").val(childData.瑙勬牸鍨嬪彿);//瑙勬牸鍨嬪彿
+ $("#HUnitID").val(childData.HUnitID);//璁¢噺鍗曚綅id
+ $("#HUnitName").val(childData.璁¢噺鍗曚綅鍚嶇О);//璁¢噺鍗曚綅鍚嶇О
+ if ($("#HName").val() == "") {
+ $("#HName").val(childData.鐗╂枡浠g爜);
+ }
+ //===============================================================================================================================
+
+ childData = null;
+ }
+ }
+ });
+ } else {
+ setTimeout(function () {
+ //淇敼锛屾牴鎹枃鏈鏁版嵁锛岀紪鍐欐煡璇㈣鍙�================================================================================================
+ var value = $("#HMaterNumber").val().replace(/'/g, ""); //鑾峰彇鏂囨湰妗嗘渶鏂板��
+ currRowIndex = 0;
+ var tableView = "h_v_Gy_MaterialList";
+ var childSWhere = "select top(10) HItemID,鐗╂枡浠g爜,鐗╂枡鍚嶇О,瑙勬牸鍨嬪彿,HUnitID,璁¢噺鍗曚綅鍚嶇О from " + tableView + " where 1=1 and 缁勭粐鍚嶇О = '" + sessionStorage["Organization"] + "' and (鐗╂枡浠g爜 like '%" + value + "%' or 鐗╂枡鍚嶇О like '%" + value + "%') order by 鐗╂枡浠g爜 desc";
+ childPage.getData(childSWhere, tableView);
+ //=================================================================================================================================
+ }, 200);
+ }
+ } else { //濡傛灉鎸変笅鐨勯敭浣嶆槸 鏂瑰悜閿紝鍒欒皟鏁寸獥鍙d腑 閫変腑琛� 鐨勪綅缃�
+ if (event.key == "ArrowUp") {
+ currRowIndex--;
+ childPage.setSelectedRow(currRowIndex);
+ } else if (event.key == "ArrowDown") {
+ currRowIndex++;
+ childPage.setSelectedRow(currRowIndex);
+ } else if (event.key == "Enter") {
+ //鎵嬪姩澶辩劍
+ var element = document.getElementById("HMaterNumber");
+ element.blur();
+
+ childPage.getSelectedData(currRowIndex);
+
+ if (childData != null) {
+ //鏍规嵁寮圭獥杩斿洖鏁版嵁璁剧疆鏂囨湰妗嗘暟鎹�=================================================================================================
+ //鑾峰彇鏁版嵁
+ $("#HMaterID").val(childData.HItemID);//鐗╂枡id
+ $("#HMaterName").val(childData.鐗╂枡鍚嶇О);//鐗╂枡鍚嶇О
+ $("#HMaterNumber").val(childData.鐗╂枡浠g爜);//鐗╂枡浠g爜
+ $("#HMaterModel").val(childData.瑙勬牸鍨嬪彿);//瑙勬牸鍨嬪彿
+ $("#HUnitID").val(childData.HUnitID);//璁¢噺鍗曚綅id
+ $("#HUnitName").val(childData.璁¢噺鍗曚綅鍚嶇О);//璁¢噺鍗曚綅鍚嶇О
+ if ($("#HName").val() == "") {
+ $("#HName").val(childData.鐗╂枡浠g爜);
+ }
+ //===============================================================================================================================
+
+ childData = null;
+ }
+
+
+ childPage = null;
+ currRowIndex = 0;
+ childData = null;
+ }
+ }
+ });
+ //#endregion
+ });
+ //#endregion
+ //#endregion
+
//閫夋嫨浜у搧浠g爜鎸夐挳
form.on('submit(btnSearchMater)', function () {
@@ -824,7 +972,12 @@
});
//绂佺敤鍏跺畠
form.on('submit(set_closeOtherRoute)', function (data) {
- set_closeOtherRoute(data);
+ if ($("#hcloser").val() != '') {
+ layer.alert("鍗曟嵁宸茶鍏抽棴鏃犳硶鍏抽棴鍏跺畠!", { icon: 5 });
+ } else {
+ set_closeOtherRoute(data);
+ }
+
});
//瀹℃牳
@@ -847,6 +1000,32 @@
set_CancelCloseBill(data);
});
+ //鏌ョ湅瀹℃壒杩涘害
+ form.on('submit(set_CheckFlowInfo)', function (data) {
+ set_CheckFlowInfo();
+ });
+
+ //澶氱骇瀹℃牳
+ form.on('submit(set_CheckBill_Flow)', function (data) {
+ set_CheckBill_Flow(0);
+ });
+
+ //澶氱骇鍙嶅鏍�
+ form.on('submit(set_AbandonCheck_Flow)', function (data) {
+ set_CheckBill_Flow(1);
+ });
+ //椹冲洖
+ form.on('submit(set_RejectCheck_Flow)', function (data) {
+ set_RejectCheck_Flow();
+ });
+ //鎾ゅ洖
+ form.on('submit(set_WithdrawCheck_Flow)', function (data) {
+ set_WithdrawCheck_Flow();
+ });
+ //澶嶅埗
+ form.on('submit(set_Copy)', function (data) {
+ set_Copy();
+ });
//鏄惁榛樿宸ヨ壓
form.on('checkbox(checkboxHStandard)', function (data) {
@@ -1013,7 +1192,7 @@
//鏂板琛岃〃鏍兼暟鎹�
var NewRow = {
- "HProcNo": (table.cache["mainTable"].length + 1) * 10, "HProcID_S": 0, "HProcType": "涓诲伐搴�", "HCenterID_S": 0, "HCenterID_SName": ""
+ "HProcNo": (table.cache["mainTable"].length + 1) * 10, "HProcID_S": 0, "HProcType": "涓诲伐搴�", "HCenterID_S": 0, "HCenterID_SName": "","宸ュ簭浠g爜":""
, "HWorkQty_S": 0, "HSubStdEmpQty_S": 0, "HMouldNo": "", "HChangeMould": 0, "HPackStd": ""
, "HPack": "", "HPutArea": "", "HMyWorkDays": 0, "HMyFixWorkDays": 0, "宸ュ簭": "","宸ユ":""
, "HProcID": 0, "宸ヤ綔涓績浠g爜": "", "HCenterID": 0, "宸ヤ綔涓績": "", "HSupID": 0
@@ -1029,6 +1208,7 @@
, "HQCSchemeID_Proc": 0, "HQCSchemeNumber_Proc": "", "HQCSchemeName_Proc": ""
, "HQCSchemeID_Patrol": 0, "HQCSchemeNumber_Patrol": "", "HQCSchemeName_Patrol": ""
, "HQCFst": false, "HQCProc": false, "HQCPatrol": false, "HMaterToSourceCtrl": false
+ , "HSubStdEmpAvg_S": 0
};
switch (obj.event) {
case 'btn-AddLine':
@@ -1193,6 +1373,33 @@
}
})
+ //鏄庣粏缃戞牸鍗曞厓鏍肩紪杈戜簨浠�
+ table.on('edit(mainTable)', function (obj) {
+ var value = obj.value //寰楀埌淇敼鍚庣殑鍊�
+ , data = obj.data //寰楀埌鎵�鍦ㄨ鎵�鏈夐敭鍊�
+ , field = obj.field; //寰楀埌瀛楁
+ switch (field) {
+ case 'HSubStdEmpQty_S': //浜х嚎浜烘暟
+ if (value != 0 && value != "" && data.HSubStdEmpAvg_S != 0 && data.HSubStdEmpAvg_S != "") {
+ //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
+ obj.update({
+ HWorkQty: Number((value * data.HSubStdEmpAvg_S).toFixed(2))
+ });
+ //table.render(option)
+ }
+ break;
+ case 'HSubStdEmpAvg_S': //浜х嚎浜哄潎浜ц兘
+ if (value != 0 && value != "" && data.HSubStdEmpQty_S != 0 && data.HSubStdEmpQty_S != "") {
+ //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
+ obj.update({
+ HWorkQty: Number((value * data.HSubStdEmpQty_S).toFixed(2))
+ });
+ //table.render(option)
+ }
+ break;
+ }
+ })
+
$('#HName').on('keydown', function (event) {//宸ヨ壓璺嚎鍚嶇О
if (event.keyCode == 118) {
layer.msg("宸ヨ壓璺嚎鍚嶇ОF7鎸夐挳")
@@ -1201,11 +1408,36 @@
//淇濆瓨鎻愪氦
form.on('submit(btnSave)', function (data) {//鎻愪氦
- if (AllowLoadData(data)) {
- set_AddNew(data);
+ const procNos = table.cache["mainTable"].map(item => Number(item.HProcNo));
+ if (isSortedAscending(procNos) && haveHProcNO9999()) {
+ if (AllowLoadData(data)) {
+ set_AddNew(data);
+ }
+ } else {
+ layer.msg('璇锋敞鎰忔祦姘村彿娆″簭鎴栬�呮槸鍚︽湁杞伐搴�');
}
});
-
+ // 鍑芥暟锛氬垽鏂暟缁勬槸鍚︿粠灏忓埌澶ф帓搴�
+ function isSortedAscending(arr) {
+ for (let i = 0; i < arr.length - 1; i++) {
+ if (arr[i] > arr[i + 1]) {
+ return false;
+ }
+ }
+ return true;
+ }
+ //澶嶅埗鏃朵繚璇佽浆宸ュ簭瀛樺湪
+ function haveHProcNO9999() {
+ if (OperationType == 2 || OperationType == 3) {
+ for (var i = 0; i < option.data.length; i++) {
+ if (option.data[i]["HProcNo"] == 9999 && option.data[i]["宸ュ簭浠g爜"] == 9999) {
+ return true
+ }
+ }
+ return false;
+ }
+ return true;
+ }
//閫�鍑�
form.on('submit(btnEdit)', function (data) {
if (params[1] != null) {
@@ -1440,6 +1672,8 @@
layer.confirm('鐪熺殑鍒犻櫎琛屽悧锛�', function (index) {
if (rowIndex === '0') {
layer.msg('棣栬鏃犳硶鍒犻櫎锛侊紒锛�');
+ } else if (table.cache["mainTable"][obj.tr.data('index')].HProcNo == "9999") {
+ layer.msg('绯荤粺杞伐搴忥紝涓嶅厑璁稿垹闄わ紒锛侊紒');
} else {
var oldData = table.cache["mainTable"];
oldData.splice(obj.tr.data('index'), 1)
@@ -1722,6 +1956,162 @@
})
}
+ //#region 澶氱骇 鍙嶅鏍�/瀹℃牳鏁版嵁
+ function set_CheckBill_Flow(num) {
+ var InterID = $("#HInterID").val();
+ if (InterID != 0) {
+ //閫昏緫瀹℃牳鏂规硶
+ $.ajax({
+ type: "GET",
+ url: GetWEBURL() + "/Gy_Routing/AuditFlow", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+ data: { "HInterID": InterID, "IsAudit": num, "CurUserName": sessionStorage["HUserName"], "CurUserID": sessionStorage["Czybm"] },
+ 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);
+ //淇敼涓哄姛鍚庡埛鏂扮晫闈�
+ $("#btnSearch").trigger('click');
+ });
+
+ } else {
+ layer.alert(result.code + result.Message, { icon: 5 });
+ }
+ }, error: function () {
+ layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+ }
+ });
+ }
+ else {
+ layer.msg('璇烽�夋嫨璇烽�夋嫨鍦ㄥ鎵规祦鐨勫崟鎹鏍革紒');
+ }
+ }
+ //#endregion
+
+ //#region 椹冲洖
+ function set_RejectCheck_Flow() {
+ var InterID = $("#HInterID").val();
+ if (InterID != 0) {
+ //閫昏緫瀹℃牳鏂规硶
+ $.ajax({
+ type: "GET",
+ url: GetWEBURL() + "/Gy_Routing/RejectCheckFlow", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+ data: { "HInterID": InterID, "CurUserID": sessionStorage["Czybm"] },
+ 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);
+ });
+ //淇敼涓哄姛鍚庡埛鏂扮晫闈�
+ $("#btnSearch").trigger('click');
+ } else {
+ layer.alert(result.code + result.Message, { icon: 5 });
+ }
+ }, error: function () {
+ layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+ }
+ });
+ }
+ else {
+ layer.msg('璇烽�夋嫨鍦ㄥ鎵规祦鐨勫崟鎹┏鍥烇紒');
+ }
+ }
+ //#endregion
+
+ //#region 鎾ゅ洖
+ function set_WithdrawCheck_Flow() {
+ var InterID = $("#HInterID").val();
+ if (InterID != 0) {
+ //閫昏緫瀹℃牳鏂规硶
+ $.ajax({
+ type: "GET",
+ url: GetWEBURL() + "/Gy_Routing/WithdrawCheckFlow", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+ data: { "HInterID": InterID, "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);
+ });
+ //淇敼涓哄姛鍚庡埛鏂扮晫闈�
+ $("#btnSearch").trigger('click');
+ } else {
+ layer.alert(result.code + result.Message, { icon: 5 });
+ }
+ }, error: function () {
+ layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+ }
+ });
+ }
+ else {
+ layer.msg('璇烽�夋嫨鍦ㄥ鎵规祦鐨勫崟鎹┏鍥烇紒');
+ }
+ }
+ //#endregion
+
+ //#region 澶嶅埗
+ function set_Copy() {
+ //鍒跺崟浜�
+ $("#HMaker").val(sessionStorage["HUserName"]);
+ $("#hmakers").val(sessionStorage["HUserName"]);
+ $("#hmakedate").val(Format(new Date(), "yyyy-MM-dd"));
+ $("#HBeginDate").val(Format(new Date(), "yyyy-MM-dd"));
+ $("#HEndDate").val(Format(new Date(2100, 12, 31), "yyyy-MM-dd"));
+ //璁剧疆hinterid
+ $.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"));
+ }
+ });
+ OperationType = 2;
+ }
+ //#endregion
+
+ //#region 鏌ョ湅瀹℃壒杩涘害
+ function set_CheckFlowInfo() {
+ var InterID = $("#HInterID").val();
+ if (InterID != 0) {
+ layer.open({
+ type: 2
+ , area: ['70%', '70%']
+ , title: '鍗曟嵁瀹℃壒杩涘害'
+ , closeBtn: 1
+ , shade: 0.6 //閬僵閫忔槑搴�
+ , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+ , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+ , content: '../../绯荤粺绠$悊/澶氱骇瀹℃壒/瀹℃壒杩涘害/Xt_CheckFlowProgressList.html?linterid=' + InterID + '&HSouceBillType=3301'
+ , resize: false,
+ end: function () {
+ ////淇敼涓哄姛鍚庡埛鏂扮晫闈�
+ //if (get_needClose_Bar == 0) {
+ // $("#btnSearch").trigger('click');
+ //} else if (get_needClose_Bar == 1) {
+ // $("#get_needClose").trigger('click');
+ //}
+ }
+ , cancel: function () {
+
+ }
+ })
+ } else {
+ layer.msg('璇烽�夋嫨姝g‘鏁版嵁鏌ョ湅锛�');
+ }
+ }
+ //#endregion
+
//琛屽唴鍒犻櫎蹇嵎閿�
function set_GridCellCheck(obj) {
$(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
@@ -1822,6 +2212,7 @@
var j = 0;
for (var i = (NowNum - 1); i < option.data.length; i++) {
option.data[i]["宸ュ簭"] = WorkCente[j]["宸ュ簭鍚嶇О"];
+ option.data[i]["宸ュ簭浠g爜"] = ProcessNumber[j].substring(1, ProcessNumber[j].length - 1);
option.data[i]["HProcID"] = WorkCente[j]["HProcID"];
option.data[i]["宸ヤ綔涓績"] = WorkCente[j]["宸ヤ綔涓績鍚嶇О"];
option.data[i]["HCenterID"] = WorkCente[j]["HCenterID"];
@@ -1834,7 +2225,7 @@
//鍦ㄤ笅鏂规坊鍔犳柊鐨勮〃鏍兼暟鎹�
for (var i = 0; i < num; i++) {
option.data.push({
- "HProcNo": (table.cache["mainTable"].length + i + 1) * 10, "HProcID_S": 0, "HProcType": "涓诲伐搴�", "HCenterID_S": 0, "HCenterID_SName": ""
+ "HProcNo": (table.cache["mainTable"].length + i + 1) * 10, "HProcID_S": 0, "HProcType": "涓诲伐搴�", "HCenterID_S": 0, "HCenterID_SName": "", "宸ュ簭浠g爜": ProcessNumber[j].substring(1, ProcessNumber[j].length - 1)
, "HWorkQty_S": 0, "HSubStdEmpQty_S": 0, "HMouldNo": "", "HChangeMould": 0, "HPackStd": ""
, "HPack": "", "HPutArea": "", "HMyWorkDays": 0, "HMyFixWorkDays": 0, "宸ュ簭": WorkCente[j]["宸ュ簭鍚嶇О"]
, "HProcID": WorkCente[j]["HProcID"], "宸ヤ綔涓績浠g爜": WorkCente[j]["宸ヤ綔涓績浠g爜"], "HCenterID": WorkCente[j]["HCenterID"], "宸ヤ綔涓績": WorkCente[j]["宸ヤ綔涓績鍚嶇О"], "HSupID": 0
@@ -1849,7 +2240,8 @@
, "HQCSchemeID_Fst": 0, "HQCSchemeNumber_Fst": "", "HQCSchemeName_Fst": ""
, "HQCSchemeID_Proc": 0, "HQCSchemeNumber_Proc": "", "HQCSchemeName_Proc": ""
, "HQCSchemeID_Patrol": 0, "HQCSchemeNumber_Patrol": "", "HQCSchemeName_Patrol": ""
- , "HQCFst": false, "HQCProc": false, "HQCPatrol": false,"HMaterToSourceCtrl":false
+ , "HQCFst": false, "HQCProc": false, "HQCPatrol": false, "HMaterToSourceCtrl": false
+ , "HSubStdEmpAvg_S": 0
})
j++;
}
@@ -1858,6 +2250,7 @@
var j = 0;
for (var i = (NowNum - 1); i < (NowNum - 1) + ProcessNumber.length; i++) {
option.data[i]["宸ュ簭"] = WorkCente[j]["宸ュ簭鍚嶇О"];
+ option.data[i]["宸ュ簭浠g爜"] = ProcessNumber[j].substring(1, ProcessNumber[j].length - 1);
option.data[i]["HProcID"] = WorkCente[j]["HProcID"];
option.data[i]["宸ヤ綔涓績"] = WorkCente[j]["宸ヤ綔涓績鍚嶇О"];
option.data[i]["HCenterID"] = WorkCente[j]["HCenterID"];
@@ -1889,6 +2282,7 @@
//鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
obj.update({
"宸ュ簭": OptionData[0].宸ュ簭鍚嶇О
+ , "宸ュ簭浠g爜": OptionData[0].宸ュ簭浠g爜
, "HProcID": OptionData[0].HItemID
, "宸ヤ綔涓績": OptionData[0].宸ヤ綔涓績
, "HCenterID": OptionData[0].HWorkCenterID
@@ -2268,6 +2662,8 @@
, "hupdatedate": d.data[0].淇敼鏃ユ湡 == null ? "" : Format(new Date(d.data[0].淇敼鏃ユ湡), "yyyy-MM-dd")
, "hdeleteman": d.data[0].浣滃簾浜�
, "hdeletedate": d.data[0].浣滃簾鏃ユ湡 == null ? "" : Format(new Date(d.data[0].浣滃簾鏃ユ湡), "yyyy-MM-dd")
+ , "hcloser": d.data[0].鍏抽棴浜�
+ , "hclosedate": d.data[0].鍏抽棴鏃ユ湡 == null ? "" : Format(new Date(d.data[0].鍏抽棴鏃ユ湡), "yyyy-MM-dd")
});
//瀛愯〃 璧嬪��
@@ -2276,7 +2672,7 @@
for (var i = 0; i < d.data.length; i++) {
rowdata.push(
{
- "HProcNo": d.data[i].宸ュ簭鍙�, "HProcID_S": d.data[i].宸ユ, "HProcType": d.data[i].宸ュ簭绫诲瀷, "HCenterID_S": d.data[i].HCenterID_S, "HCenterID_SName": d.data[i].浜х嚎涓績
+ "HProcNo": d.data[i].宸ュ簭鍙�, "HProcID_S": d.data[i].宸ユ, "HProcType": d.data[i].宸ュ簭绫诲瀷, "HCenterID_S": d.data[i].HCenterID_S, "HCenterID_SName": d.data[i].浜х嚎涓績, "宸ュ簭浠g爜": d.data[i].宸ュ簭浠g爜
, "HWorkQty_S": d.data[i].浜х嚎浜ц兘, "HSubStdEmpQty_S": d.data[i].浜х嚎浜烘暟, "HMouldNo": d.data[i].妯″叿缂栧彿, "HChangeMould": d.data[i].鎹㈡ā鏃堕棿, "HPackStd": d.data[i].鍛ㄨ浆绠辨爣鍑�
, "HPack": d.data[i].鍛ㄨ浆绠�, "HPutArea": d.data[i].鏆傛斁鍖�, "HMyWorkDays": d.data[i].鐢熶骇鍛ㄦ湡, "HMyFixWorkDays": d.data[i].鍥哄畾鐢熶骇澶╂暟, "宸ュ簭": d.data[i].宸ュ簭, "宸ユ": d.data[i].宸ユ鍚嶇О
, "HProcID": d.data[i].HProcID, "宸ヤ綔涓績浠g爜": d.data[i].宸ヤ綔涓績浠g爜, "HCenterID": d.data[i].HCenterID, "宸ヤ綔涓績": d.data[i].宸ヤ綔涓績鍚嶇О, "HSupID": d.data[i].HSupID
@@ -2292,6 +2688,7 @@
, "HQCSchemeID_Proc": d.data[i].HQCSchemeID_Proc, "HQCSchemeNumber_Proc": d.data[i].杞簭妫�楠屾柟妗堜唬鐮�, "HQCSchemeName_Proc": d.data[i].杞簭妫�楠屾柟妗�
, "HQCSchemeID_Patrol": d.data[i].HQCSchemeID_Patrol, "HQCSchemeNumber_Patrol": d.data[i].宸℃妫�楠屾柟妗堜唬鐮�, "HQCSchemeName_Patrol": d.data[i].宸℃妫�楠屾柟妗�
, "HQCFst": d.data[i].HQCFst == 1 ? true : false, "HQCProc": d.data[i].HQCProc == 1 ? true : false, "HQCPatrol": d.data[i].HQCPatrol == 1 ? true : false, "HMaterToSourceCtrl": d.data[i].HMaterToSourceCtrl == 1 ? true : false
+ , "HSubStdEmpAvg_S": d.data[i].浜哄潎浜ц兘
}
)
}
@@ -2350,6 +2747,14 @@
for (var i = 0; i < table.cache["mainTable"].length; i++) {
if (table.cache["mainTable"][i] != "") {
table.cache["mainTable"][i].LAY_TABLE_INDEX = i;
+
+ //鍔犲伐鏁伴噺=浜х嚎浜烘暟 * 浜х嚎浜哄潎浜ц兘
+ if (table.cache["mainTable"][i].HSubStdEmpQty_S != 0 && table.cache["mainTable"][i].HSubStdEmpQty_S != "" && table.cache["mainTable"][i].HSubStdEmpAvg_S != 0 && table.cache["mainTable"][i].HSubStdEmpAvg_S != "") {
+
+ table.cache["mainTable"][i].HWorkQty = Number((table.cache["mainTable"][i].HSubStdEmpQty_S * table.cache["mainTable"][i].HSubStdEmpAvg_S).toFixed(2))
+
+ }
+
num.push(table.cache["mainTable"][i])
}
}
@@ -2595,7 +3000,9 @@
//鍒锋柊娴佹按鍙�
function btn_Refresh(data) {
for (var i = 0; i < option.data.length; i++) {
- option.data[i]["HProcNo"] = (i + 1) * 10;
+ if (option.data[i]["HProcNo"] != 9999) {
+ option.data[i]["HProcNo"] = (i + 1) * 10;
+ }
}
table.render(option);
}
@@ -2615,7 +3022,13 @@
dataCol = data1.data[0].HGridString.split(',');
for (var i = 0; i < option.cols[0].length - 2; i++) {
- var dataCols = dataCol[i].split('|');
+ if (i >= dataCol.length) {
+ continue;
+ }
+ if (dataCol[i]) {
+ var dataCols = dataCol[i].split('|');
+ }
+
//闅愯棌鍒�
if (dataCols[1] == 1) {
option.cols[0][i + 1]["hide"] = true;
--
Gitblit v1.9.1