| | |
| | | <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"> |
| | | <div class="layui-input-block" style="margin-left: 120px; width: 501px;"> |
| | | <input type="hidden" name="HSourceInterID" id="HSourceInterID" lay-verify="HSourceInterID" value="0"> |
| | | <input type="hidden" name="HSourceEntryID" id="HSourceEntryID" lay-verify="HSourceEntryID" value="0"> |
| | | <input type="hidden" name="HSourceBillNo" id="HSourceBillNo" lay-verify="HSourceBillNo" value=""> |
| | | <input type="hidden" name="HSourceBillType" id="HSourceBillType" lay-verify="HSourceBillType" value=""> |
| | | <input type="hidden" name="HRelationQty" id="HRelationQty" lay-verify="HRelationQty" value="0"> |
| | | <input type="hidden" name="HRelationMoney" id="HRelationMoney" lay-verify="HRelationMoney" value="0"> |
| | | |
| | | <input type="hidden" name="HMaterID" id="HMaterID" lay-verify="HMaterID" value="0"> |
| | | <input type="hidden" name="HMaterNumber" id="HMaterNumber" lay-verify="HMaterNumber" value=""> |
| | | <input type="hidden" name="HMaterName" id="HMaterName" lay-verify="HMaterName" value=""> |
| | | <input type="hidden" name="HUnitID" id="HUnitID" lay-verify="HUnitID" value="0"> |
| | | <input type="hidden" name="HQty" id="HQty" lay-verify="HQty" value="0"> |
| | | <input type="hidden" name="HSupID" id="HSupID" lay-verify="HSupID" value="0"> |
| | | <input type="hidden" name="HBatchNo" id="HBatchNo" lay-verify="HBatchNo"> |
| | | <input type="hidden" name="HProcExchBillNo" id="HProcExchBillNo" lay-verify="HProcExchBillNo"> |
| | | <input type="hidden" name="HProcess" id="HProcess" lay-verify="HProcess"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | //å®ä¹å
¨å±åé |
| | | |
| | | var HModName = "Cj_CollectionOfSingleProductDefects"; |
| | | var option2 = []; |
| | | //#endregion |
| | | |
| | | //#region è¿å
¥é¡µé¢å³å è½½ |
| | |
| | | $("#HInterID").val(datajson.HInterID); |
| | | $("#HBillNo").val(datajson.HBillNo); |
| | | $("#HBillNo_bak").val(datajson.HBillNo); |
| | | $("#HProcExchBillNo").val(datajson.HProcExchBillNo); |
| | | $("#HProcess").val(datajson.HProcess); |
| | | //åå§åçé¢ |
| | | set_ClearBill(); |
| | | } |
| | |
| | | //#region 触åäºä»¶ï¼å
æ¬form.on(){}æ ¼å¼çææç¹å»äºä»¶ãéæ©äºä»¶ç |
| | | |
| | | //æ¡å½¢ç åè½¦æ¹æ³ |
| | | $('#HBarCodeSN').on('keydown', function (event) { |
| | | var HBarCode = $('#HBarCodeSN').val(); |
| | | $('#HBarCode').on('keydown', function (event) { |
| | | var HBarCode = $('#HBarCode').val(); |
| | | if (event.keyCode == 13) { |
| | | if (!HBarCode) { |
| | | layer.msg("æ¡å½¢ç ä¸è½ä¸ºç©ºï¼") |
| | | return; |
| | | } |
| | | txtHBarCode_KeyDown(HBarCode); |
| | | get_Accessory(HBarCode); |
| | | } |
| | | }); |
| | | |
| | | //éæ©ä¸è¯åå |
| | | form.on('submit(btnHBadReason)', function () { |
| | | btnHBadReason(); |
| | | //é
ä»¶æ´æ¢è®°å½å表è¡å
äºä»¶ |
| | | table.on('tool(mainTable1)', function (obj) { |
| | | set_GridDelete1(obj); //è¡å
å é¤ |
| | | }); |
| | | |
| | | //ç©ææ¸
åå表è¡å
äºä»¶ |
| | | table.on('tool(mainTable2)', function (obj) { |
| | | set_GridDelete2(obj); //è¡å
å é¤ |
| | | }); |
| | | |
| | | //éæ©è´¨æ£å |
| | |
| | | }); |
| | | }); |
| | | |
| | | //ä¿åæäº¤ |
| | | form.on('submit(btnSave_BL)', function (data) {//æäº¤ |
| | | if (AllowLoadData(data)) { |
| | | set_AddNew(data, "ä¸è¯"); |
| | | } |
| | | }); |
| | | |
| | | form.on('submit(btnSave_BF)', function (data) {//æäº¤ |
| | | if (AllowLoadData(data)) { |
| | | set_AddNew(data, "æ¥åº"); |
| | | } |
| | | }); |
| | | |
| | | //éåº |
| | | form.on('submit(btnEdit)', function (data) { |
| | |
| | | |
| | | //åå§åçé¢ |
| | | function set_ClearBill() { |
| | | //å
æ 跳转å°é
ä»¶ææ¬æ¡ä¸ |
| | | $("#HBarCode").focus(); |
| | | //æ¥è¯¢ç»å®ç¨æ· |
| | | get_Display(); |
| | | //æ¥è¯¢æ¡ç ç»å®çè¿ä¿®è®°å½ |
| | | get_RepairRecord(); |
| | | //æ¥è¯¢ç©ææ¸
åæ°æ® |
| | | get_BomList($("#HProcExchBillNo").val()); |
| | | } |
| | | |
| | | //æ¥è¯¢ |
| | |
| | | }); |
| | | } |
| | | |
| | | //æ¡ç å车æ¥è¯¢ |
| | | function txtHBarCode_KeyDown(HBarCode) { |
| | | |
| | | //æ¡ç å车æ¥è¯¢æ´æ¢é
ä»¶ |
| | | var KNum = 0; |
| | | function get_Accessory(HBarCode) { |
| | | var index = layer.load(); |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + "/Cj_SingleStation/HBardCodeList", |
| | | async: true, |
| | | url: GetWEBURL() + "/Cj_SingleStation/HBardCodeAccessoryList", |
| | | async: false, |
| | | data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"] }, |
| | | dataType: "json", |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | layer.close(index); |
| | | $("#HICMOBillNo").val(data1.data[0]["ç产订å"]); |
| | | $("#HICMOInterID").val(data1.data[0]["HICMOInterID"]); |
| | | $("#HProcExchBillNo").val(data1.data[0]["å·¥åºæµè½¬å¡"]); |
| | | $("#HProcExchInterID").val(data1.data[0]["HSourceInterID"]); |
| | | $("#HMaterNumber").val(data1.data[0]["ç©æç¼ç "]); |
| | | $("#HMaterID").val(data1.data[0]["HMaterID"]); |
| | | $("#HMaterName").val(data1.data[0]["ç©æåç§°"]); |
| | | $("#HModel").val(data1.data[0]["è§æ ¼åå·"]); |
| | | $("#HBarCode").val(data1.data[0]["æ¡ç "]); |
| | | |
| | | for (var i = 0; i < option2.data.length; i++) { |
| | | if (data1.data[0]["HMaterNumber"] == option2.data[i]["é
件代ç "] && option2.data[i]["HBatchNo"] == data1.data[0]["HBatchNo"] && option2.data[i]["HBatchNo"] != "") { |
| | | return layer.msg("å½åæ¹æ¬¡å·²æ«å
¥,请ä¸è¦é夿«å
¥!"); |
| | | } |
| | | if (data1.data[0]["HMaterNumber"] == option2.data[i]["é
件代ç "] && option2.data[i]["HBatchNo"] != data1.data[0]["HBatchNo"] && option2.data[i]["HBatchNo"] != "") { |
| | | layer.confirm('æ¯å¦è¦æ¿æ¢å½åæ¹æ¬¡', function (index) { |
| | | layer.close(index); |
| | | $('#HProcName').val(HBarCode); |
| | | option2.data[i]["HBatchNo"] = data1.data[0]["HBatchNo"]; |
| | | option2.data[i]["HBarCode"] = HBarCode; |
| | | table.render(option2); |
| | | //ä¿åé
ä»¶æ´æ¹è®°å½ |
| | | set_AddNew(); |
| | | }); |
| | | break; |
| | | } |
| | | KNum += 1; |
| | | } |
| | | |
| | | $('#HBarCode').val(""); |
| | | |
| | | |
| | | } |
| | | else { |
| | | layer.close(index); |
| | | layer.msg(data1.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | } |
| | | $("#HBarCodeSN").val(""); |
| | | }, |
| | | error: function (err) { |
| | | layer.close(index); |
| | | layer.msg("é误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //ä¸è¯åå éæ©é¡µé¢ |
| | | function btnHBadReason() { |
| | | layer.open({ |
| | | type: 2//å¼¹çªç±»å |
| | | , skin: 'layui-layer-rim' //å ä¸è¾¹æ¡ |
| | | , area: ['90%', '90%']//å¤§å° |
| | | , title: 'ä¸è¯åå å表'//æ é¢ |
| | | , shift: 2//å¼¹åºå¨ç» |
| | | , content: ['../../åºç¡èµæ/ç产åºç¡èµæ/Gy_BadReason.html', 'yes'] |
| | | , btn: ['ç¡®å®', 'åæ¶'] |
| | | , btn1: function (index, layero) {//æé®ãæé®ä¸ãçåè° |
| | | var iframeWindow = window['layui-layer-iframe' + index] //è·åå¼¹æ¡é¡µé¢ |
| | | var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//è·åtableçelem:"#test" |
| | | if (checkStatus.data.length === 0) { |
| | | return layer.msg('è¯·éæ©æ°æ®'); |
| | | } |
| | | //è·åæ°æ® |
| | | $("#HBadReasonID").val(checkStatus.data[0].HItemID); |
| | | $("#HBadReasonName").val(checkStatus.data[0].ä¸è¯åå åç§°); |
| | | |
| | | layer.close(index); //å®è·åçå§ç»æ¯ææ°å¼¹åºçæä¸ªå±ï¼å¼æ¯ç±layerå
é¨å¨æéå¢è®¡ç®ç |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //è´¨æ£åéæ©é¡µé¢ |
| | |
| | | |
| | | //æ¥è¯¢æ¡ç ç»å®çè¿ä¿®è®°å½ |
| | | function get_RepairRecord() { |
| | | var sWhere = " and HBarCodeSN='" + $("#HMaterSN").val() + "' and HBarCode is not null"; |
| | | var index = layer.load(); |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + "/Cj_SingleStation/Sc_SourceLineRepairBillSub_MaterList", |
| | | async: false, |
| | | data: { "sWhere": " and HSourceBillNo='" + $("#HMaterSN").val() + "'", "user": sessionStorage["HUserName"] }, |
| | | data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] }, |
| | | dataType: "json", |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | layer.close(index); |
| | | |
| | | var option = { |
| | | elem: '#mainTable' |
| | | , toolbar: '#toolbarDemo' |
| | | elem: '#mainTable1' |
| | | //, toolbar: '#toolbarDemo' |
| | | , page: false |
| | | , totalRow: true |
| | | , data: data1.data |
| | |
| | | }); |
| | | } |
| | | |
| | | //é
ä»¶è®°å½å 餿¹æ³ |
| | | function set_GridDelete1(obj) { |
| | | if (obj.event === 'del') { |
| | | layer.confirm('ççå é¤è¡åï¼', function (index) { |
| | | var HInterID = obj.data.HInterID; |
| | | var HEntryID = obj.data.HEntryID; |
| | | |
| | | var ajaxLoad = layer.load(); |
| | | $.ajax({ |
| | | url: GetWEBURL() + "/Cj_SingleStation/ProcessItemRepairDel", |
| | | type: "GET", |
| | | async: false, |
| | | data: { "HInterID": HInterID, "HEntryID": HEntryID, "user": sessionStorage["HUserName"], "HBill": "PJ"}, |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | layer.msg("å 餿åï¼"); |
| | | layer.close(ajaxLoad); |
| | | //æ¥è¯¢æ¡ç ç»å®çè¿ä¿®è®°å½ |
| | | get_RepairRecord(); |
| | | } else { |
| | | layer.alert(result.code + result.Message, { icon: 5 }); |
| | | layer.close(ajaxLoad); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | layer.close(ajaxLoad); |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | } |
| | | |
| | | //ç©ææ¸
åå 餿¹æ³ |
| | | function set_GridDelete2(obj) { |
| | | if (obj.event === 'del2') { |
| | | layer.confirm('ççå é¤è¡åï¼', function (index) { |
| | | var HInterID = obj.data.BomHInterID; |
| | | var HEntryID = obj.data.BomHEntryID; |
| | | |
| | | var ajaxLoad = layer.load(); |
| | | $.ajax({ |
| | | url: GetWEBURL() + "/Cj_SingleStation/DelBomTempList", |
| | | type: "GET", |
| | | async: false, |
| | | data: { "HInterID": HInterID, "HEntryID": HEntryID, "user": sessionStorage["HUserName"]}, |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | layer.msg("å 餿åï¼"); |
| | | layer.close(ajaxLoad); |
| | | //æ¥è¯¢æ¸
å |
| | | get_BomList($("#HProcExchBillNo").val()); |
| | | } else { |
| | | layer.alert(result.code + result.Message, { icon: 5 }); |
| | | layer.close(ajaxLoad); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | layer.close(ajaxLoad); |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | } |
| | | |
| | | //æµè½¬å¡æ¥è¯¢å
³é®ä»¶æ¸
å |
| | | function get_BomList(HBarCode) { |
| | | var index = layer.load(); |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + "/Cj_SingleStation/HBardCodeBomList", |
| | | async: false, |
| | | data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"] }, |
| | | dataType: "json", |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | layer.close(index); |
| | | |
| | | $("#HMaterNumber").val(data1.data[0]["HMainMaterNumber"]); |
| | | $("#HMaterID").val(data1.data[0]["HMainMaterID"]); |
| | | $("#HMaterName").val(data1.data[0]["HMainMaterName"]); |
| | | //$("#HProcExchInterID").val(data1.data[0]["HProcExchInterID"]); |
| | | //$("#HProcExchEntryID").val(data1.data[0]["HProcExchEntryID"]); |
| | | //$("#HProcExchBillNo").val(data1.data[0]["HProcExchBillNo"]); |
| | | //$("#HICMOBillNo").val(data1.data[0]["HICMOBillNo"]); |
| | | //$("#HICMOInterID").val(data1.data[0]["HICMOInterID"]); |
| | | //$("#HICMOEntryID").val(data1.data[0]["HICMOEntryID"]); |
| | | //$("#HProcNo").val(data1.data[0]["HProcNo"]); |
| | | //$("#HPieceQty").val(data1.data[0]["HPieceQty"]); |
| | | //$("#HICMOQty").val(data1.data[0]["HICMOQty"]); |
| | | |
| | | option2 = { |
| | | elem: '#mainTable2' |
| | | //, toolbar: '#toolbarDemo' |
| | | , async: true |
| | | , page: false |
| | | //, totalRow: true |
| | | , cellMinWidth: 120 |
| | | , data: data1.data |
| | | , height: 185 |
| | | , cols: [[ |
| | | { type: 'numbers', title: 'åºå·' } |
| | | , { field: 'æ¥æ', title: 'æ¥æ' } |
| | | , { field: 'é
件代ç ', title: 'é
件代ç ' } |
| | | , { field: 'é
ä»¶åç§°', title: 'é
ä»¶åç§°' } |
| | | , { field: 'é
ä»¶è§æ ¼', title: 'é
ä»¶è§æ ¼' } |
| | | , { field: 'é
ä»¶æ°é', title: 'é
ä»¶æ°é' } |
| | | , { field: 'HBatchNo', title: 'å½åæ¹æ¬¡' } |
| | | , { field: 'BomHInterID', title: 'BomHInterID', hide: true } |
| | | , { field: 'BomHEntryID', title: 'BomHEntryID', hide: true } |
| | | , { field: 'HICMOInterID', title: 'HICMOInterID', hide: true } |
| | | , { field: 'HICMOEntryID', title: 'HICMOEntryID', hide: true } |
| | | , { field: 'HICMOBillNo', title: 'HICMOBillNo', hide: true } |
| | | , { field: 'HProcExchInterID', title: 'HProcExchInterID', hide: true } |
| | | , { field: 'HProcExchEntryID', title: 'HProcExchEntryID', hide: true } |
| | | , { field: 'HProcExchBillNo', title: 'HProcExchBillNo', hide: true } |
| | | , { field: 'HMaterID', title: 'HMaterID', hide: true } |
| | | , { field: 'HBarCode', title: 'HBarCode', hide: true } |
| | | , { fixed: 'right', title: 'æä½', toolbar: '#barDemo2' } |
| | | ]] |
| | | } |
| | | table.render(option2) |
| | | } |
| | | else { |
| | | layer.close(index); |
| | | layer.msg(data1.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | } |
| | | $("#HBarCodeSN").val(""); |
| | | }, |
| | | error: function (err) { |
| | | layer.close(index); |
| | | layer.msg("é误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //è·ååæ° |
| | | function getUrlVars() { |
| | |
| | | } |
| | | |
| | | //ä¿åHMaker |
| | | function set_AddNew(data, HResult) { |
| | | function set_AddNew() { |
| | | var data1 = { "field": { "HInterID": $("#HInterID").val(), "HBillNo": $("#HBillNo").val(), "HProcExchBillNo": $("#HProcExchBillNo").val(), "HProcExchInterID": $("#HProcExchInterID").val(), "HProcExchEntryID": $("#HProcExchEntryID").val(), "HProcess": $("#HProcess").val() } }; |
| | | |
| | | var sMainStr = JSON.stringify(data.field); |
| | | |
| | | var sMainSub = sMainStr + ';' + HResult + ";" + sessionStorage["HUserName"]; |
| | | var HResult = "é
ä»¶"; |
| | | var sMainStr = JSON.stringify(data1.field); |
| | | var sSubStr = JSON.stringify(table.cache["mainTable2"][KNum]); |
| | | var sMainSub = sMainStr + ';' + sSubStr + ";" + sessionStorage["HUserName"] + ";" + HResult; |
| | | |
| | | var index = layer.load(); |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: GetWEBURL() + "/Cj_SingleStation/ProcessBLSave", |
| | | url: GetWEBURL() + "/Cj_SingleStation/HFXAddRepairBill", |
| | | async: false, |
| | | data: { "sMainSub": sMainSub }, |
| | | dataType: "json", |
| | | success: function (data) { |
| | | if (data.count == 1) { |
| | | $('#btnSave').addClass("layui-btn-disabled").attr("disabled", true); |
| | | //$('#btnSave').addClass("layui-btn-disabled").attr("disabled", true); |
| | | layer.close(index); |
| | | layer.msg("æäº¤æå"); |
| | | //æ¥è¯¢æ´æ¢è®°å½ |
| | | get_RepairRecord(); |
| | | } |
| | | else { |
| | | layer.close(index); |