From a03addb5fbf4da382275f3c9dff8dbc916c4e021 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期三, 17 九月 2025 09:52:01 +0800
Subject: [PATCH] 其他出库、其他入库:子表件数可以输入为0 乔一客户物料即时库存报表:把米数和件数的合计加上去 (按生产订单)客户订单:过滤条件改为模糊查询
---
WebTM/views/生产管理/产量汇报单/Sc_Add_ProductReportBillList.html | 633 +++++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 474 insertions(+), 159 deletions(-)
diff --git "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\344\272\247\351\207\217\346\261\207\346\212\245\345\215\225/Sc_Add_ProductReportBillList.html" "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\344\272\247\351\207\217\346\261\207\346\212\245\345\215\225/Sc_Add_ProductReportBillList.html"
index 01f2fe7..5e6dc5d 100644
--- "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\344\272\247\351\207\217\346\261\207\346\212\245\345\215\225/Sc_Add_ProductReportBillList.html"
+++ "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\344\272\247\351\207\217\346\261\207\346\212\245\345\215\225/Sc_Add_ProductReportBillList.html"
@@ -14,6 +14,7 @@
<script src="../../../layuiadmin/Scripts/json2.js"></script>
<script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
<script src="../../../layuiadmin/Scripts/webConfig.js"></script>
+ <script src="../../../layuiadmin/PubCustom.js"></script>
<script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
<style type="text/css">
.layui-form-label {
@@ -87,6 +88,8 @@
<div class="layui-btn-group">
<button type="button" id="add-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">淇濆瓨</button>
+ <button type="button" id="VerIfySaver" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="VerIfySaver">瀹℃牳</button>
+ <button type="button" id="ReVerIfySaver" class="layui-btn layui-btn-normal layui-btn-circle" lay-submit="" lay-filter="ReVerIfySaver">鍙嶅鏍�</button>
<button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">閫�鍑�</button>
</div>
@@ -108,7 +111,7 @@
<div class="layui-input-inline">
<input class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" disabled autocomplete="off">
<input id="HInterID" name="HInterID" type="hidden" />
- <input id="HMaker" name="HMaker" type="hidden" /><!--鍒跺崟浜�-->
+
</div>
</div>
<div class="layui-inline">
@@ -133,6 +136,8 @@
<input class="layui-input" name="HProcExchBillNo" lay-verify="HProcExchBillNo" id="HProcExchBillNo" autocomplete="off">
<input id="HSourceInterID" name="HSourceInterID" type="hidden" />
<input id="HSourceEntryID" name="HSourceEntryID" type="hidden" />
+ <input type="hidden" name="HSourceBillNo" id="HSourceBillNo">
+ <input type="hidden" name="HSourceBillType" id="HSourceBillType">
</div>
</div>
<div class="layui-inline">
@@ -184,6 +189,7 @@
</button>
</div>
</div>
+
<div class="layui-inline">
<label class="layui-form-label">鐢熶骇鐝粍:</label>
<div class="layui-input-inline">
@@ -199,8 +205,8 @@
<div class="layui-inline">
<label class="layui-form-label">鎿嶄綔鍛�:</label>
<div class="layui-input-inline">
- <input type="text" name="HEmpName" id="HEmpName" 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;">
+ <input type="text" name="HWorkManName" id="HWorkManName" class="layui-input" value="" style="float:left;width:150px;">
+ <input type="hidden" name="HWorkManID" id="HWorkManID" class="layui-input" value="" style="float:left;width:150px;">
<button type="button" lay-submit="" class="layui-btn" lay-filter="HEmpList" id="HEmpList" style="width:40px;">
<i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
</button>
@@ -330,20 +336,16 @@
var HSourceEntryID = ""; //婧愬崟瀛愬唴鐮�
var HSourceBillNo = ""; //婧愬崟鍗曞彿
var HSourceBillType = ""; //婧愬崟绫诲瀷
- function getUrlVars() {
- var vars = [], hash;
- var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
- for (var i = 0; i < hashes.length; i++) {
- hash = hashes[i].split('=');
- vars.push(hash[0]);
- vars[hash[0]] = hash[1];
- }
- return vars;
+ var refSav = ""; //鎻愪氦绫诲瀷
+ //鑾峰彇椤甸潰璺宠浆鍙傛暟 //鍗曟嵁缂栬緫鐘舵�侊細 1.鏃犳簮鍗曟柊澧灺� 聽2.鏈夋簮鍗曟柊澧灺� 聽3.缂栬緫聽 4.娴忚聽 5.鍙樻洿
+ var params = get_UrlVars();
+ if (typeof (params[params[0]]) == "undefined") {
+ var OperationType = 1;//鎿嶄綔绫诲瀷
+ } else {
+ var OperationType = params[params[0]];//鎿嶄綔绫诲瀷
+ var linterid = params[params[1]];//婧愬崟id
+ var HSBillType = params[params[2]];//婧愬崟绫诲瀷
}
-
- var params = getUrlVars();
- var hID = params[params[0]];//缂栬緫鏌ョ湅
- var Type = params[params[1]];//鍗曟嵁缂栬緫鐘舵�侊細 1.鏃犳簮鍗曟柊澧灺� 聽2.鏈夋簮鍗曟柊澧灺� 聽3.缂栬緫聽 4.娴忚聽 5.鍙樻洿
var edit = function (data) {
HBillType = data[0].HBillType;
@@ -360,6 +362,7 @@
}).extend({
index: 'lib/index' //涓诲叆鍙fā鍧�
}).use(['index', 'form', 'laydate', 'table', 'element'], function () {
+ //#region 鍏敤鍙橀噺
var $ = layui.$
, admin = layui.admin
, layer = layui.layer
@@ -367,49 +370,239 @@
, form = layui.form
, laydate = layui.laydate
, element = layui.element;
+ //#endregion
- //鏃ユ湡鏃堕棿閫夋嫨鍣�
- laydate.render({
- elem: '#HWorkBeginDate'
- , type: 'datetime'
- });
- laydate.render({
- elem: '#HWorkReportDate'
- , type: 'datetime'
- });
- laydate.render({
- elem: '#HDate'
- , type: 'datetime'
- });
- laydate.render({
- elem: '#HMakeDate'
- , type: 'datetime'
- });
- laydate.render({
- elem: '#HUpDateDate'
- , type: 'datetime'
- });
- laydate.render({
- elem: '#HCheckDate'
- , type: 'datetime'
- });
- laydate.render({
- elem: '#HCloseDate'
- , type: 'datetime'
- });
- laydate.render({
- elem: '#HDeleteDate'
- , type: 'datetime'
- });
+ //鍒濆鍖栬〃鍗曟彃浠�
+ set_InitFrom();
- //鍒濆鍩烘湰淇℃伅璧嬪��
- $("#HDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss")); //鍗曟嵁鏃ユ湡
- $("#HWorkReportDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss")) //鎶ュ伐鏃ユ湡
- $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss")); //鍒跺崟鏃ユ湡
- $("#HMaker").val(sessionStorage["HUserName"]); //鍒跺崟浜�
+
+ //鍒ゆ柇鎿嶄綔绫诲瀷
+ if (OperationType == 1) {//鏃犳簮鍗�
+ $("#HWorkManID").val(sessionStorage["HEmpID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鎿嶄綔鍛業D
+ $("#HWorkManName").val(sessionStorage["HEmpName"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鎿嶄綔鍛�
+ $("#HGroupID").val(sessionStorage["HGroupID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鐝粍ID
+ $("#HGroupName").val(sessionStorage["HGroup"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鐝粍
+ set_AddFNew();
+ }
+ else if (OperationType == 2) {//鏈夋簮鍗�
+ $("#HWorkManID").val(sessionStorage["HEmpID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鎿嶄綔鍛業D
+ $("#HWorkManName").val(sessionStorage["HEmpName"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鎿嶄綔鍛�
+ $("#HGroupID").val(sessionStorage["HGroupID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鐝粍ID
+ $("#HGroupName").val(sessionStorage["HGroup"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鐝粍
+ set_AddNew();
+ }
+ else if (OperationType == 3) {//缂栬緫
+ var HICMOInID = params[params[3]];//鐢熶骇璁㈠崟涓讳富ID
+ var HICMOEnID = params[params[4]];//鐢熶骇璁㈠崟瀛怚D
+ set_EditFromGrid(linterid, HICMOInID, HICMOEnID);
+ }
+ else {
+ layer.alert("鏈煡鎿嶄綔绫诲瀷锛�", { icon: 5 });
+ }
+
+ //鍒濆鍖栨彃浠�
+ function set_InitFrom() {
+ //鏃ユ湡鏃堕棿閫夋嫨鍣�
+ laydate.render({
+ elem: '#HWorkBeginDate'
+ , type: 'datetime'
+ });
+ laydate.render({
+ elem: '#HWorkReportDate'
+ , type: 'datetime'
+ });
+ laydate.render({
+ elem: '#HDate'
+ , type: 'datetime'
+ });
+ laydate.render({
+ elem: '#HMakeDate'
+ , type: 'datetime'
+ });
+ laydate.render({
+ elem: '#HUpDateDate'
+ , type: 'datetime'
+ });
+ laydate.render({
+ elem: '#HCheckDate'
+ , type: 'datetime'
+ });
+ laydate.render({
+ elem: '#HCloseDate'
+ , type: 'datetime'
+ });
+ laydate.render({
+ elem: '#HDeleteDate'
+ , type: 'datetime'
+ });
+ }
+
+ //鏃犳簮鍗曟柊澧�
+ function set_AddFNew()
+ {
+
+ }
+
+ //鏈夋簮鍗曟柊澧�
+ function set_AddNew() {
+ refSav = "Add";
+ //鍒濆鍩烘湰淇℃伅璧嬪��
+ $("#HDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss")); //鍗曟嵁鏃ユ湡
+ $("#HWorkReportDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss")) //鎶ュ伐鏃ユ湡
+ $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss")); //鍒跺崟鏃ユ湡
+ $("#HMaker").val(sessionStorage["HUserName"]); //鍒跺崟浜�
+
+ //鍔犳簮鍗曠被鍨嬪尯鍒�(鍙互鍐欎笉鍚岀殑鏂规硶)
+ $('#HICMOBillNo').attr("disabled", true);
+ $('#HSourceBillNo').attr("disabled", true);
+ $('#HProcExchBillNo').attr("disabled", true);
+ $('#HProcName').attr("disabled", true);
+ $('#HMaterCode').attr("disabled", true);
+ $('#HMaterList').addClass("layui-btn-disabled").attr("disabled", true);
+ $('#HMaterName').attr("disabled", true);
+ $('#HMaterSpec').attr("disabled", true);
+ $('#HPlanQty').attr("disabled", true);
+ $('#HSourceName').attr("disabled", true);
+ $('#HSourceList').addClass("layui-btn-disabled").attr("disabled", true);
+ $('#HWorkBeginDate').attr("disabled", true);
+ $('#HWorkReportDate').attr("disabled", true);
+
+ $.ajax(
+ {
+ type: "GET",
+ url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESBeginWorkFrom", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+ async: true,
+ data: {
+ "HSourceInterID": HSourceInterID,
+ "HSourceEntryID": HSourceEntryID,
+ "HSourceBillNo": HSourceBillNo,
+ "HSourceBillType": HBillType
+ },
+ dataType: "json",
+ success: function (data) {
+ if (data.count == 1)// 璇存槑楠岃瘉鎴愬姛浜嗭紝
+ {
+ var LoadData = data.data.h_p_JIT_GetInfoByICMOStatusInterID;
+ $("#HProcID").val(LoadData[0].HProcID); //褰撳墠宸ュ簭ID
+ $("#HProcName").val(LoadData[0].HProcName); //褰撳墠宸ュ簭
+ $("#HMaterID").val(LoadData[0].HMaterID); //浜у搧ID
+ $("#HMaterCode").val(LoadData[0].HMaterNumber); //浜у搧浠g爜
+ $("#HMaterName").val(LoadData[0].HMaterName); //浜у搧鍚嶇О
+ $("#HMaterSpec").val(LoadData[0].HModel); //浜у搧瑙勬牸
+ $("#HSourceID").val(LoadData[0].HSourceID); //鐢熶骇璧勬簮ID
+ $("#HSourceName").val(LoadData[0].HSourceName); //鐢熶骇璧勬簮
+ $("#HSourceBillNo").val(LoadData[0].HICMOBillNo); //婧愬崟鍗曞彿锛堟殏鏃跺彇鍊艰鍗曠紪鍙凤級
+ $("#HSourceInterID").val(LoadData[0].HSourceInterID); //婧愬崟涓诲唴鐮�(鍙栧�糎InterID)
+ $("#HSourceEntryID").val(LoadData[0].HSourceEntryID); //婧愬崟瀛愬唴鐮�(婧愬崟琛屽彿)
+ $("#HSourceBillType").val(HSourceBillType); //婧愬崟绫诲瀷
+ //$("#HGroupID").val(LoadData[0].HDeptID); //鐝粍ID
+ //$("#HGroupName").val(LoadData[0].HDeptName); //鐝粍
+ $("#HICMOInterID").val(LoadData[0].HICMOInterID); //鐢熶骇璁㈠崟ID
+ $("#HICMOEntryID").val(LoadData[0].HICMOEntryID); //鐢熶骇璁㈠崟瀛怚D
+ $("#HICMOBillNo").val(LoadData[0].HICMOBillNo); //鐢熶骇璁㈠崟
+ $("#HWorkBeginDate").val(LoadData[0].HBeginDate); //寮�宸ユ椂闂�
+ $("#HPlanQty").val(LoadData[0].HDatePlanQty); //璁″垝鏁伴噺
+
+ }
+ else {
+ layer.alert(data.Message, { icon: 5 });
+
+ }
+ },
+ error: function (err) {
+ layer.alert(err, { icon: 5 });
+ }
+ });
+ }
+
+ //缂栬緫
+ function set_EditFromGrid(linterid, HICMOInID, HICMOEnID)
+ {
+ refSav = "Update";
+ //鍔犳簮鍗曠被鍨嬪尯鍒�(鍙互鍐欎笉鍚岀殑鏂规硶)
+ $('#HICMOBillNo').attr("disabled", true);
+ $('#HSourceBillNo').attr("disabled", true);
+ $('#HProcExchBillNo').attr("disabled", true);
+ $('#HProcName').attr("disabled", true);
+ $('#HMaterCode').attr("disabled", true);
+ $('#HMaterList').addClass("layui-btn-disabled").attr("disabled", true);
+ $('#HMaterName').attr("disabled", true);
+ $('#HMaterSpec').attr("disabled", true);
+ $('#HPlanQty').attr("disabled", true);
+ $('#HSourceName').attr("disabled", true);
+ $('#HSourceList').addClass("layui-btn-disabled").attr("disabled", true);
+ $('#HWorkBeginDate').attr("disabled", true);
+ $('#HWorkReportDate').attr("disabled", true);
+
+ $.ajax(
+ {
+ type: "GET",
+ url: GetWEBURL() + "/Sc_MESProductReportBill/Get_Sc_MESProductReportEditBillList", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+ async: true,
+ data: {
+ "linterid": linterid,
+ "HICMOInID": HICMOInID,
+ "HICMOEnID": HICMOEnID,
+ },
+ dataType: "json",
+ success: function (data) {
+ if (data.count == 1)// 璇存槑楠岃瘉鎴愬姛浜嗭紝
+ {
+ var LoadData = data.data.h_v_IF_ICMOBillWorkQtyStatus_Tmp;
+ $("#HInterID").val(LoadData[0].HInterID); //鍗曟嵁ID
+ $("#HBillNo").val(LoadData[0].鍗曟嵁鍙�); //鍗曟嵁鍙�
+ $("#HDate").val(formatDate(LoadData[0].鏃ユ湡)); //鏃ユ湡
+ $("#HProcID").val(""); //褰撳墠宸ュ簭ID
+ $("#HProcName").val(""); //褰撳墠宸ュ簭
+ $("#HMaterID").val(LoadData[0].HMaterID); //浜у搧ID
+ $("#HMaterCode").val(LoadData[0].浜у搧浠g爜); //浜у搧浠g爜
+ $("#HMaterName").val(LoadData[0].浜у搧鍚嶇О); //浜у搧鍚嶇О
+ $("#HMaterSpec").val(LoadData[0].浜у搧瑙勬牸); //浜у搧瑙勬牸
+ $("#HSourceID").val(LoadData[0].HSourceID); //鐢熶骇璧勬簮ID
+ $("#HSourceName").val(LoadData[0].鐢熶骇璧勬簮); //鐢熶骇璧勬簮
+ $("#HSourceBillNo").val(LoadData[0].婧愬崟鍗曞彿); //婧愬崟鍗曞彿锛堟殏鏃跺彇鍊艰鍗曠紪鍙凤級
+ $("#HSourceInterID").val(LoadData[0].HSourceInterID); //婧愬崟涓诲唴鐮�(鍙栧�糎InterID)
+ $("#HSourceEntryID").val(LoadData[0].HSourceEntryID); //婧愬崟瀛愬唴鐮�(婧愬崟琛屽彿)
+ $("#HSourceBillType").val(LoadData[0].婧愬崟绫诲瀷); //婧愬崟绫诲瀷
+ $("#HGroupID").val(LoadData[0].HDeptID); //鐝粍ID
+ $("#HGroupName").val(LoadData[0].鐢熶骇鐝粍); //鐝粍
+ $("#HWorkManID").val(LoadData[0].HWorkManID); //鎿嶄綔鍛業D
+ $("#HWorkManName").val(LoadData[0].鎿嶄綔鍛�); //鎿嶄綔鍛�
+ $("#HICMOInterID").val(LoadData[0].HICMOInterID); //鐢熶骇璁㈠崟ID
+ $("#HICMOEntryID").val(LoadData[0].HICMOEntryID); //鐢熶骇璁㈠崟瀛怚D
+ $("#HICMOBillNo").val(LoadData[0].HICMOBillNo); //鐢熶骇璁㈠崟
+ $("#HWorkBeginDate").val(formatDate(LoadData[0].寮�宸ユ椂闂�)); //寮�宸ユ椂闂�
+ $("#HWorkReportDate").val(formatDate(LoadData[0].鎶ュ伐鏃堕棿)); //鎶ュ伐鏃堕棿
+ $("#HPlanQty").val(LoadData[0].HDatePlanQty); //璁″垝鏁伴噺
+ $("#HQty").val(LoadData[0].姹囨姤鏁伴噺); //鎶ュ伐鏁伴噺
+ $("#HBadQty").val(LoadData[0].涓嶈壇鏁伴噺); //涓嶈壇鏁伴噺
+ $("#HWasterQty").val(LoadData[0].鎶ュ簾鏁伴噺); //鎶ュ簾鏁伴噺
+ $("#HMaker").val(LoadData[0].鍒跺崟浜�); //鍒跺崟浜�
+ $("#HMakeDate").val(formatDate(LoadData[0].鍒跺崟鏃ユ湡)); //鍒跺崟鏃ユ湡
+ $("#HUpDater").val(sessionStorage["HUserName"]); //淇敼浜�
+ $("#HUpDateDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss")); //淇敼鏃ユ湡
+ $("#HChecker").val(LoadData[0].瀹℃牳浜�); //瀹℃牳浜�
+ $("#HCheckDate").val(formatDate(LoadData[0].瀹℃牳鏃ユ湡)); //瀹℃牳鏃ユ湡
+ $("#HCloseMan").val(LoadData[0].鍏抽棴浜�); //鍏抽棴浜�
+ $("#HCloseDate").val(formatDate(LoadData[0].鍏抽棴鏃ユ湡)); //鍏抽棴鏃ユ湡
+ $("#HDeleteMan").val(LoadData[0].浣滃簾浜�); //浣滃簾浜�
+ $("#HDeleteDate").val(formatDate(LoadData[0].浣滃簾鏃ユ湡)); //浣滃簾鏃ユ湡
+
+ }
+ else {
+ layer.alert(data.Message, { icon: 5 });
+
+ }
+ },
+ error: function (err) {
+ layer.alert(err, { icon: 5 });
+ }
+ });
+ }
+
//鍒ゆ柇鏄惁鏂板
- if (hID == null || hID == 0) {
+ if (linterid == null || linterid == 0) {
//鑾峰彇鏈�澶у崟鎹彿 new
$("#HInterID").val("0");
$("#HBillNo").val("");
@@ -424,112 +617,55 @@
});
}
else {//濡傛灉淇敼鍒欒蛋涓嬮潰 new
- $("#HInterID").val(hID);//淇敼鏃朵富琛↖D
- RoadBillMain(hID);
- /* RoadBillSub(linterid);*/
+ $("#HInterID").val(linterid);//淇敼鏃朵富琛↖D
}
+ //缂栬緫鑾峰彇琛ㄤ綋鏃舵椂闂存牸寮忕煫姝f柟寮�
+ function formatDate(date) {
+ var d = new Date(date),
+ month = '' + (d.getMonth() + 1).toString(),
+ day = '' + d.getDate().toString(),
+ year = d.getFullYear().toString(),
+ h = d.getHours().toString(),
+ mm = d.getMinutes().toString(),
+ s = d.getSeconds().toString();
- //鏈夋簮鍗曟柊澧�
- if (Type == 2) {
+ if (month.length < 2) month = '0' + month;
+ if (day.length < 2) day = '0' + day;
+ if (h.length < 2) h = '0' + h;
+ if (mm.length < 2) mm = '0' + mm;
+ if (s.length < 2) s = '0' + s;
- //鍔犳簮鍗曠被鍨嬪尯鍒�(鍙互鍐欎笉鍚岀殑鏂规硶)
- $('#HICMOBillNo').attr("disabled", true);
- $('#HSourceBillNo').attr("disabled", true);
- $('#HProcExchBillNo').attr("disabled", true);
- $('#HProcName').attr("disabled", true);
- $('#HMaterCode').attr("disabled", true);
- $('#HMaterList').addClass("layui-btn-disabled").attr("disabled", true);
- $('#HMaterName').attr("disabled", true);
- $('#HMaterSpec').attr("disabled", true);
- $('#HPlanQty').attr("disabled", true);
- $('#HSourceName').attr("disabled", true);
- $('#HSourceList').addClass("layui-btn-disabled").attr("disabled", true);
- $('#HWorkBeginDate').attr("disabled", true);
- $('#HWorkReportDate').attr("disabled", true);
-
- $.ajax(
- {
- type: "GET",
- url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESBeginWorkFrom", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
- async: true,
- data: {
- "HSourceInterID": HSourceInterID,
- "HSourceEntryID": HSourceEntryID,
- "HSourceBillNo": HSourceBillNo,
- "HSourceBillType": HSourceBillType
- },
- dataType: "json",
- success: function (data) {
- if (data.count == 1)// 璇存槑楠岃瘉鎴愬姛浜嗭紝
- {
- var LoadData = data.data.h_p_JIT_GetSourceInfoByUser;
- $("#HProcID").val(LoadData[0].HProcID); //褰撳墠宸ュ簭ID
- $("#HProcName").val(LoadData[0].HProcName); //褰撳墠宸ュ簭
- $("#HMaterID").val(LoadData[0].HMaterID); //浜у搧ID
- $("#HMaterCode").val(LoadData[0].HMaterNumber); //浜у搧浠g爜
- $("#HMaterName").val(LoadData[0].HMaterName); //浜у搧鍚嶇О
- $("#HMaterSpec").val(LoadData[0].HModel); //浜у搧瑙勬牸
- $("#HSourceID").val(LoadData[0].HSourceID); //鐢熶骇璧勬簮ID
- $("#HSourceName").val(LoadData[0].HSourceName); //鐢熶骇璧勬簮
- $("#HMainSourceBillNo").val(LoadData[0].HSourceBillNo); //婧愬崟鍗曞彿
- $("#HMainSourceInterID").val(LoadData[0].HSourceInterID); //婧愬崟涓诲唴鐮�
- $("#HMainSourceEntryID").val(LoadData[0].HSourceEntryID); //婧愬崟瀛愬唴鐮�(婧愬崟琛屽彿)
- $("#HMainSourceBillType").val(HSourceBillType); //婧愬崟绫诲瀷
- $("#HDeptID").val(LoadData[0].HDeptID); //杞﹂棿ID
- $("#HDeptName").val(LoadData[0].HDeptName); //杞﹂棿
- $("#HICMOInterID").val(LoadData[0].HICMOInterID); //鐢熶骇璁㈠崟ID
- $("#HICMOEntryID").val(LoadData[0].HICMOEntryID); //鐢熶骇璁㈠崟瀛怚D
- $("#HICMOBillNo").val(LoadData[0].HICMOBillNo); //鐢熶骇璁㈠崟
- $("#HWorkBeginDate").val(LoadData[0].HBeginDate); //寮�宸ユ椂闂�
- $("#HPlanQty").val(LoadData[0].HDatePlanQty); //璁″垝鏁伴噺
- }
- else {
- layer.alert(data.Message, { icon: 5 });
-
- }
- },
- error: function (err) {
- layer.alert(err, { icon: 5 });
- }
- });
+ return [year, month, day].join('-') + " " + [h, mm, s].join(':');
}
+
//淇濆瓨鎻愪氦
form.on('submit(Saver)', function (data) {
- var sMainStr = JSON.stringify(data.field);
if (!AllowLoadData())//鏁版嵁楠岃瘉
{
return false;
}
- $.ajax({
- type: "POST",
- url: GetWEBURL() + "/Sc_ICMOReportBill/SaveGetMESProductReportFrom", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
- async: true,
- data: { "msg": sMainStr },
- dataType: "json",
- success: function (data) {
- if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
- layer.msg(data.Message, { time: 1 * 2000, icon: 1 }, function (index) {
- layer.close(layer.index);
- window.parent.location.reload();
- });
- }
- else {
- layer.alert(data.Message, { icon: 5 })
- }
- },
- error: function (err) {
- layer.alert(err, { icon: 5 })
- }
- })
+ OverStepQty(data);
+
});
+
+ //瀹℃牳
+ form.on('submit(VerIfySaver)', function (data)
+ {
+ SaveVerify();
+ });
+ //鍙嶅鏍�
+ form.on('submit(ReVerIfySaver)', function (data)
+ {
+ ReVerIfySaver();
+ });
+
//閫�鍑�
form.on('submit(Exit)', function (data) {
- var index = parent.layer.getFrameIndex(window.name); //鍏堝緱鍒板綋鍓峣frame灞傜殑绱㈠紩
- parent.layer.close(index); //鍐嶆墽琛屽叧闂�
+ Pub_Close(1);
});
@@ -544,7 +680,7 @@
shift: 2,
area: ['80%', '80%'],
maxmin: true,
- content: ['../../PublicPage/PartInformation.html', 'yes'],
+ content: ['../../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Material.html', 'yes'],
btn: ['纭畾', '鍙栨秷']
, btn1: function (index, layero) {
@@ -554,8 +690,8 @@
if (checkStatus.data.length === 0) {
return layer.msg('璇烽�夋嫨鏁版嵁');
}
- $("#HMaterName").val(checkStatus.data[0].HName);
- $("#HMaterCode").val(checkStatus.data[0].HNumber);
+ $("#HMaterName").val(checkStatus.data[0].鐗╂枡鍚嶇О);
+ $("#HMaterCode").val(checkStatus.data[0].鐗╂枡浠g爜);
$("#HMaterID").val(checkStatus.data[0].HItemID);
layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
}
@@ -583,7 +719,7 @@
shift: 2,
area: ['80%', '80%'],
maxmin: true,
- content: ['../../PublicPage/SourceInformation.html', 'yes'],
+ content: ['../../../鍩虹璧勬枡/鐢熶骇鍩虹璧勬枡/Gy_Source.html', 'yes'],
btn: ['纭畾', '鍙栨秷']
, btn1: function (index, layero) {
@@ -593,7 +729,7 @@
if (checkStatus.data.length === 0) {
return layer.msg('璇烽�夋嫨鏁版嵁');
}
- $("#HSourceName").val(checkStatus.data[0].HName);
+ $("#HSourceName").val(checkStatus.data[0].鐢熶骇璧勬簮鍚嶇О);
$("#HSourceID").val(checkStatus.data[0].HItemID);
layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
}
@@ -621,7 +757,7 @@
shift: 2,
area: ['80%', '80%'],
maxmin: true,
- content: ['../../PublicPage/UserInformation.html', 'yes'],
+ content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_EmployeeList.html?type=HEmp', 'yes'],
btn: ['纭畾', '鍙栨秷']
, btn1: function (index, layero) {
@@ -631,8 +767,8 @@
if (checkStatus.data.length === 0) {
return layer.msg('璇烽�夋嫨鏁版嵁');
}
- $("#HEmpName").val(checkStatus.data[0].HName);
- $("#HEmpID").val(checkStatus.data[0].HItemID);
+ $("#HWorkManName").val(checkStatus.data[0].鑱屽憳鍚嶇О);
+ $("#HWorkManID").val(checkStatus.data[0].HItemID);
layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
}
, btn2: function (index, layero) {
@@ -661,7 +797,7 @@
shift: 2,
area: ['80%', '80%'],
maxmin: true,
- content: ['../../PublicPage/GroupInformation.html', 'yes'],
+ content: ['../../鍩虹璧勬枡/宸ヨ祫鍩虹璧勬枡/Gy_Group.html?type=HGroup', 'yes'],
btn: ['纭畾', '鍙栨秷']
, btn1: function (index, layero) {
@@ -671,7 +807,7 @@
if (checkStatus.data.length === 0) {
return layer.msg('璇烽�夋嫨鏁版嵁');
}
- $("#HGroupName").val(checkStatus.data[0].HName);
+ $("#HGroupName").val(checkStatus.data[0].鐝粍鍚嶇О);
$("#HGroupID").val(checkStatus.data[0].HItemID);
layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
}
@@ -690,10 +826,176 @@
+ //楠岃瘉姹囨姤鏁伴噺鏄惁瓒呰繃璁″垝鏁伴噺
+ function OverStepQty(data) {
+ var sWhere = "";
+ if (OperationType == 3) //缂栬緫
+ {
+ HSourceInterID = $("#HSourceInterID").val();
+ HSourceEntryID = $("#HSourceEntryID").val();
+ HSourceBillNo = $("#HSourceBillNo").val();
+ HSourceBillType = $("#HSourceBillType").val();
+ }
+ sWhere = " where HSourceID='" + $("#HSourceID").val() + "' and HSourceInterID='" + HSourceInterID + "' and HSourceEntryID='" + HSourceEntryID + "' and HSourceBillNo='" + HSourceBillNo + "' and HSourceBillType='" + HSourceBillType + "' ";
+ $.ajax({
+ url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESOverStepQty",
+ type: "GET",
+ data: { "sWhere": sWhere },
+ dataType: "json",//鏁版嵁绫诲瀷鍙互涓� text xml json script jsonp
+ async: false,
+ success: function (datas) {
+ var LoadData = datas.data.Sc_ICMOBillWorkQtyStatus_Tmp;
+ var HQty = LoadData[0].HQty;
+ var HBadQty = LoadData[0].HBadQty;
+ var HWasterQty = LoadData[0].HWasterQty;
+ var yessqty = HQty + HBadQty + HWasterQty;
+ var sumqty = parseFloat($("#HQty").val()) + yessqty;
+ if (sumqty > parseFloat($("#HPlanQty").val())) {
+ layer.confirm("宸叉眹鎶ユ暟閲�:銆�" + yessqty + "銆�,褰撳墠姹囨姤鏁伴噺:銆�" + parseFloat($("#HQty").val()) + "銆戜笉鑳藉ぇ浜庤鍒掓暟閲�:銆�" + parseFloat($("#HPlanQty").val()) + "銆戯紒", {
+ btn: ['纭', '鍙栨秷']
+ }, function (index) {
+ //鍏抽棴褰撳墠frame
+ layer.close(index);
+ //Submit(data);
+ }, function () {
+
+ });
+ }
+ else {
+ Submit(data);
+ }
+ },
+ error: function (err) {
+ layer.alert(err, { icon: 5 })
+ }
+ });
+ }
+
+ //鎻愪氦璇锋眰ajax
+ function Submit(data) {
+ if (data.field.HBadQty == "" || data.field.HBadQty == null) {
+ data.field.HBadQty = 0;
+ }
+ if (data.field.HWasterQty == "" || data.field.HWasterQty == null) {
+ data.field.HWasterQty = 0;
+ }
+ var sMainStr = JSON.stringify(data.field);
+ var sMainSub = sMainStr + ';' + refSav;
+
+ $.ajax({
+ type: "POST",
+ url: GetWEBURL() + "/Sc_MESBeginWorkBill/SaveGetMESProductReportFrom", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+ async: false,
+ data: { "msg": sMainSub },
+ dataType: "json",
+ success: function (data) {
+ if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+ $("#HInterID").val(data.HInterID);//鑾峰彇鎻愪氦鎴愬姛杩斿洖鐨勫崟鎹富ID
+ layer.msg(data.Message, { time: 1 * 2000, icon: 1 }, function (index) {
+ if (data.Verify == "Y") //鑷姩瀹℃牳
+ {
+ layer.close(index);
+ SaveVerify(); //瀹℃牳
+ }
+ else {
+ layer.close(index);
+ }
+ });
+
+ //layer.confirm(data.Message, {
+ // btn: ['纭']
+ //}, function (index) {
+ // if (data.Verify == "Y") //鑷姩瀹℃牳
+ // {
+ // layer.close(index);
+ // SaveVerify(); //瀹℃牳
+ // }
+ // else {
+ // layer.close(index);
+ // }
+ //});
+ }
+ else {
+ layer.alert(data.Message, { icon: 5 })
+ }
+ },
+ error: function (err) {
+ layer.alert(err, { icon: 5 })
+ }
+ })
+ }
+
+ //瀹℃牳鎻愪氦
+ function SaveVerify()
+ {
+ var HSourceID = $("#HSourceID").val(); //鐢熶骇璧勬簮ID
+ var HSourceInterID = $("#HSourceInterID").val(); //婧愬崟涓诲唴鐮�
+ var HSourceEntryID = $("#HSourceEntryID").val();//婧愬崟瀛愬唴鐮�
+ var HSourceBillNo = $("#HSourceBillNo").val();//婧愬崟鍗曞彿
+ var HICMOInterID = $("#HICMOInterID").val();//鐢熶骇璁㈠崟涓籌D
+ var HICMOEntryID = $("#HICMOEntryID").val();//鐢熶骇璁㈠崟瀛怚D
+ var HInterID = $("#HInterID").val();//浜ч噺姹囨姤涓存椂琛ㄤ富ID
+ if (!AllowLoadData())//鏁版嵁楠岃瘉
+ {
+ return false;
+ }
+ //閫昏緫瀹℃牳鏂规硶
+ $.ajax({
+ type: "GET",
+ url: GetWEBURL() + "/Sc_MESBeginWorkBill/MESProductAuditProcessReportList", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+ data: { "HSourceID": HSourceID, "HSourceInterID": HSourceInterID, "HSourceEntryID": HSourceEntryID, "HSourceBillNo": HSourceBillNo, "HICMOInterID": HICMOInterID, "HICMOEntryID": HICMOEntryID, "HInterID": HInterID, "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
+ success: function (result) {
+ if (result.count == 1) {
+ layer.msg(result.Message, { time: 1 * 2000, icon: 1 }, function () {
+
+ });
+
+ } else {
+ layer.alert(result.code + result.Message, { icon: 5 });
+ }
+ }, error: function () {
+ layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+ }
+ });
+ }
+ //鍙嶅鏍告彁浜�
+ function ReVerIfySaver()
+ {
+ var HSourceID = $("#HSourceID").val(); //鐢熶骇璧勬簮ID
+ var HSourceInterID = $("#HSourceInterID").val(); //婧愬崟涓诲唴鐮�
+ var HSourceEntryID = $("#HSourceEntryID").val();//婧愬崟瀛愬唴鐮�
+ var HSourceBillNo = $("#HSourceBillNo").val();//婧愬崟鍗曞彿
+ var HICMOInterID = $("#HICMOInterID").val();//鐢熶骇璁㈠崟涓籌D
+ var HICMOEntryID = $("#HICMOEntryID").val();//鐢熶骇璁㈠崟瀛怚D
+ var HInterID = $("#HInterID").val();//浜ч噺姹囨姤涓存椂琛ㄤ富ID
+ if (!AllowLoadData())//鏁版嵁楠岃瘉
+ {
+ return false;
+ }
+ //閫昏緫瀹℃牳鏂规硶
+ $.ajax({
+ type: "GET",
+ url: GetWEBURL() + "/Sc_MESBeginWorkBill/MESProductAuditProcessReportList", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+ data: { "HSourceID": HSourceID, "HSourceInterID": HSourceInterID, "HSourceEntryID": HSourceEntryID, "HSourceBillNo": HSourceBillNo, "HICMOInterID": HICMOInterID, "HICMOEntryID": HICMOEntryID, "HInterID": HInterID, "IsAudit": 1, "CurUserName": sessionStorage["HUserName"] },
+ success: function (result) {
+ if (result.count == 1) {
+ layer.msg(result.Message, { time: 1 * 2000, icon: 1 }, function () {
+
+ });
+
+ } else {
+ layer.alert(result.code + result.Message, { icon: 5 });
+ }
+ }, error: function () {
+ layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+ }
+ });
+ }
//浠ヤ笂涓簂ayui妯″潡
});
- function AllowLoadData() { //闈炵┖楠岃瘉
+ //闈炵┖楠岃瘉
+ function AllowLoadData() {
var Result = true;
if ($("#HBillNo").val() == '' || $("#HBillNo").val() == null) {
layer.msg("鍗曟嵁鍙蜂笉鑳戒负绌�!", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
@@ -707,11 +1009,11 @@
layer.msg("浜у搧缂栫爜涓嶈兘涓虹┖锛�", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
return Result = false;
}
- if ($("#HWorkBeginDate").val() == '' || $("#HBeginDate").val() == null) {
+ if ($("#HWorkBeginDate").val() == '' || $("#HWorkBeginDate").val() == null) {
layer.msg("寮�宸ユ椂闂翠笉鑳戒负绌猴紒", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
return Result = false;
}
- if ($("#HWorkReportDate").val() == '' || $("#HBeginDate").val() == null) {
+ if ($("#HWorkReportDate").val() == '' || $("#HWorkReportDate").val() == null) {
layer.msg("寮�宸ユ椂闂翠笉鑳戒负绌猴紒", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
return Result = false;
}
@@ -719,7 +1021,7 @@
layer.msg("鐢熶骇璧勬簮涓嶈兘涓虹┖锛�", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
return Result = false;
}
- if ($("#HEmpID").val() == '' || $("#HEmpID").val() == null) {
+ if ($("#HWorkManID").val() == '' || $("#HWorkManID").val() == null) {
layer.msg("鎿嶄綔鍛樹笉鑳戒负绌猴紒", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
return Result = false;
}
@@ -730,13 +1032,26 @@
if ($("#HGroupID").val() == '' || $("#HGroupID").val() == null) {
layer.msg("鐝粍涓嶈兘涓虹┖锛�", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
return Result = false;
- }
+ }
if ($("#HICMOInterID").val() == '' || $("#HICMOInterID").val() == null) {
layer.msg("鐢熶骇璁㈠崟涓嶈兘涓虹┖锛�", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
return Result = false;
}
return Result;
}
+
+ //鎿嶄綔鍛�
+ function GetHEmpValue(obj) {
+ $("#HWorkManName").val(obj[0].鑱屽憳鍚嶇О);
+ $("#HWorkManID").val(obj[0].HItemID);
+ }
+ //鐢熶骇鐝粍
+ function GetHGroupValue(obj) {
+ $("#HGroupName").val(obj[0].鐝粍鍚嶇О);
+ $("#HGroupID").val(obj[0].HItemID);
+ }
+
+
</script>
</body>
</html>
--
Gitblit v1.9.1