| | |
| | | <label class="layui-form-label" style="padding-left:0px" id="">ééç :</label> |
| | | <input type="text" class="layui-input" name="HBarCode_SN" lay-verify="HBarCode_SN" autocomplete="off" placeholder="请é®å
¥åå车" id="HBarCode_SN" style="width: 500px;"> |
| | | </div> |
| | | |
| | | <button class="layui-btn layui-btn-normal" style="float:left;" type="button" lay-submit="" lay-filter="btnNextProc" id="btnNextProc">æ¢äº§å</button> |
| | | |
| | | <button class="layui-btn layui-btn-normal" style="float:right" type="button" lay-submit="" lay-filter="btnExit" id="btnExit">éåº</button> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </div> |
| | | |
| | |
| | | <label class="layui-form-label" style="width: 85px;" id="">å½åééç :</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HSNNo" lay-verify="HSNNo" id="HSNNo" style="background-color:#efefef4d;" readonly> |
| | | </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="text" class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" style="background-color:#EDEDED;" readonly> |
| | | <input type="hidden" name="HInterID" id="HInterID" lay-verify="HInterID"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script type="text/html" id="toolbarDemo"> |
| | | <!--<script type="text/html" id="toolbarDemo"> |
| | | <div class="layui-btn-container"> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete"><i class="layui-icon layui-icon-form"></i>è§£ç»</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn" id="HideColumn"><i class="layui-icon layui-icon-form"></i>å设置</button> |
| | | </div> |
| | | </script> |
| | | </script>--> |
| | | <script type="text/html" id="toolbarDemo2"> |
| | | <div class="layui-btn-container"> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete2"><i class="layui-icon layui-icon-form"></i>å é¤</button> |
| | |
| | | </div> |
| | | </body> |
| | | </html> |
| | | <script type="text/html" id="barDemo"> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">å é¤</a> |
| | | </script> |
| | | <script> |
| | | |
| | | layui.config({ |
| | |
| | | |
| | | //å®ä¹å
¨å±åé |
| | | |
| | | var HModName = "Cj_ProcessItemStationPlatform_batch"; |
| | | var HModName2 = "Cj_ProcessItemStationPlatform_batch2"; |
| | | var HModName = "Cj_ProcessItemStationPlatform_KeyElement"; |
| | | var HModName2 = "Cj_ProcessItemStationPlatform_KeyElement2"; |
| | | var option = []; |
| | | var option2 = []; |
| | | //#endregion |
| | |
| | | //#endregion |
| | | |
| | | //#region 触åäºä»¶ï¼å
æ¬form.on(){}æ ¼å¼çææç¹å»äºä»¶ãéæ©äºä»¶ç |
| | | |
| | | table.on('tool(mainTable)', function (obj) { |
| | | set_GridDelete(obj); //è¡å
å é¤ |
| | | }); |
| | | |
| | | //头工å
·æ äºä»¶ |
| | | table.on('toolbar(mainTable)', function (obj) { |
| | | switch (obj.event) { |
| | |
| | | table.on('toolbar(mainTable2)', function (obj) { |
| | | switch (obj.event) { |
| | | //å é¤æé® |
| | | case 'btn-Delete2': set_DeleteBill2(); |
| | | case 'btn-Delete2': btn_Delete(); |
| | | break; |
| | | //å设置 |
| | | case 'set_HideColumn2': get_HideColumnNoPage(HModName2, sessionStorage["HUserName"], option2, get_Display); |
| | | break; |
| | | }; |
| | | }); |
| | | //æ¹æ¬¡ç åè½¦æ¹æ³ |
| | | $('#HBarCode_Batch').on('keydown', function (event) { |
| | | var HBarCode = $('#HBarCodeSN').val(); |
| | | var HBardCodeProcExchBillNo = $('#HBardCodeProcExchBillNo').val(); |
| | | if (event.keyCode == 13) { |
| | | if (!HBardCodeProcExchBillNo) { |
| | | layer.msg(get_MessageError("[0000-2-034]请å
æ«æµè½¬å¡ï¼", sessionStorage["HTranSlate"])) |
| | | return; |
| | | } else { |
| | | HBarCode = HBarCode.toUpperCase(); |
| | | if (!HBarCode) { |
| | | layer.msg(get_MessageError("[0000-2-019]æ¡å½¢ç ä¸è½ä¸ºç©ºï¼", sessionStorage["HTranSlate"])) |
| | | return; |
| | | } else { |
| | | if (HBarCode.length != 29 && HBarCode.length != 50) { |
| | | layer.alert(get_MessageError("[3791-2-012]åä»¶æ¡ç é¿åº¦ä¸ä¸º29使50ä½!", sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-035]éåº', sessionStorage["HTranSlate"])], time: 100000, offset: 't' }); |
| | | return; |
| | | } |
| | | |
| | | if (HBarCode.match(/[^\x00-\xff]/g) != null) { |
| | | layer.alert(get_MessageError("[3791-2-013]å¿
é¡»æ¯åè§å符!", sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-035]éåº', sessionStorage["HTranSlate"])], time: 100000, offset: 't' }); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | for (var i = 0; i < option.data.length; i++) { |
| | | if (option.data[i]["HBatchNo"] == "") { |
| | | layer.msg(get_MessageError("[3791-2-014]å½åå·¥åºæ¹æ¬¡ä¸è½ä¸ºç©ºï¼", sessionStorage["HTranSlate"])) |
| | | return; |
| | | } |
| | | } |
| | | txtHBarCode_KeyDown(HBarCode); |
| | | } |
| | | }); |
| | | |
| | | //ééç åè½¦æ¹æ³ |
| | | $('#HBarCode_SN').on('keydown', function (event) { |
| | | var HBarCode = $('#HBardCodeProcExchBillNo').val(); |
| | | var HBarCode_SN = $('#HBarCode_SN').val(); |
| | | if (event.keyCode == 13) { |
| | | if (!HBarCode) { |
| | | layer.msg(get_MessageError("[0000-1-057]æµè½¬å¡ä¸è½ä¸ºç©ºï¼", sessionStorage["HTranSlate"])) |
| | | return; |
| | | |
| | | if (HBarCode_SN) { |
| | | createBillNo(); |
| | | txtHBarCodeSN_KeyDown(HBarCode_SN); |
| | | } |
| | | setIntervalIndex = setInterval(setIntervalList, 30000); |
| | | get_BomList(HBarCode); |
| | | //if (option.data != 0) { |
| | | // //ä¿åå°ä¸´æ¶è¡¨ |
| | | // get_AddBomTempList(); |
| | | //} |
| | | //æ¥è¯¢ä¸è¯è®°å½ |
| | | get_BadRecords(); |
| | | //æ¥è¯¢åæ ¼è®°å½ |
| | | get_HGRecords(); |
| | | |
| | | |
| | | } |
| | | }); |
| | | //å
³é®ä»¶åè½¦æ¹æ³ |
| | | $('#HBarCode_Key').on('keydown', function (event) { |
| | | var HBarCode_Key = $('#HBarCode_Key').val(); |
| | | if (event.keyCode == 13) { |
| | | |
| | | if ($("#HBarCode_SN").val() == "" || $("#HBarCode_SN").val() == null) { |
| | | layer.msg("æªæ«SNç 请å
æ«ç "); |
| | | $("#HBarCode_SN").focus(); |
| | | return |
| | | } |
| | | if (HBarCode_Key) { |
| | | txtHBarCodeKey_KeyDown(HBarCode_Key); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | |
| | |
| | | form.on('submit(btnHProc)', function () { |
| | | btnHProc(); |
| | | }); |
| | | //æ¢äº§å |
| | | form.on('submit(btnNextProc)', function (data) { |
| | | //for (var i = 0; i < option.data.length; i++) { |
| | | // if (option.data[i].HBindingQty < 1 || option.data[i].HBarCode == "") { |
| | | // layer.alert("第<span style='color: red;'>" + (i + 1) + "</span>è¡ï¼é
ä»¶ <span style='color: blue;'>" + option.data[i].HMaterName + "</span> æªç»å®é½æ´ï¼") |
| | | // return; |
| | | // } |
| | | //} |
| | | |
| | | //ä¿åå
³é®ä»¶ |
| | | if (AllowLoadData(data)) { |
| | | set_SaveBill(data); |
| | | } |
| | | |
| | | //åå²ç»å®è®°å½æ¥è¯¢ |
| | | //get_Display(); |
| | | }); |
| | | |
| | | //éåº |
| | | form.on('submit(btnExit)', function (data) { |
| | |
| | | //åå§åçé¢ |
| | | function set_ClearBill() { |
| | | //è¿å
¥é¡µé¢é»è®¤å
æ 卿µè½¬å¡ä¸ |
| | | $("#HBardCodeProcExchBillNo").focus(); |
| | | $("#HBarCode_SN").focus(); |
| | | //å¶å人 |
| | | $("#HMaker").val(sessionStorage["HUserName"]); |
| | | $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd")); |
| | |
| | | //åå§åè¡¨æ ¼ |
| | | set_InitGrid(); |
| | | // |
| | | //get_Display(); |
| | | get_Display(); |
| | | } |
| | | |
| | | //#region éè¿ç»å½ç¨æ·è·åé»è®¤å¼ |
| | |
| | | function set_InitGrid() { |
| | | option= { |
| | | elem: '#mainTable' |
| | | , toolbar: '#toolbarDemo' |
| | | //, toolbar: '#toolbarDemo' |
| | | , page: false |
| | | , totalRow: true |
| | | , cellMinWidth: 120 |
| | | , data: [] |
| | | , height: 285 |
| | | , limit: 10 |
| | | , cols: [[ |
| | | { type: 'numbers', title: 'åºå·' } |
| | | , { field: 'æ¥æ', title: 'æ¥æ' } |
| | | , { field: 'é
件代ç ', title: 'é
件代ç ' } |
| | | , { field: 'é
ä»¶åç§°', title: 'é
ä»¶åç§°' } |
| | | , { field: 'é
ä»¶è§æ ¼', title: 'é
ä»¶è§æ ¼' } |
| | | , { field: 'é
ä»¶æ°é', title: 'é
ä»¶æ°é', totalRow: true} |
| | | , { field: 'HBatchNo', title: 'å½åæ¹æ¬¡' } |
| | | , { 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 } |
| | | , cols: [[ //ç»å®ä¿¡æ¯è¡¨ |
| | | { type: 'numbers', title: 'åºå·', width: 50 } |
| | | , { field: 'HBarCode_P', title: '产åç ', width: 265 } |
| | | , { field: 'HBarCode', title: 'é
ä»¶ç ', width: 265 } |
| | | , { field: 'HPartsQty', title: 'é
ä»¶æ°', width: 72 } |
| | | , { field: 'HBindingQty', title: 'å·²ç»æ°', width: 72 } |
| | | , { field: 'HMaterID', title: 'HMaterID', hide: true } |
| | | , { field: 'HBarCode', title: 'HBarCode', hide: true } |
| | | , { field: 'HMaterNumber', title: 'ç©æä»£ç ', width: 160 } |
| | | , { field: 'HMaterName', title: 'ç©æåç§°', width: 160 } |
| | | , { field: 'HMaterModel', title: 'è§æ ¼åå·', width: 160, hide: true } |
| | | , { field: 'HBatchNo', title: 'æ¹æ¬¡', width: 160, hide: true } |
| | | , { field: 'HSourceID', title: 'HSourceID', width: 160, hide: true } |
| | | , { field: 'HEquipID', title: 'HEquipID', width: 160, hide: true } |
| | | , { field: 'HGroupID', title: 'HGroupID', width: 160, hide: true } |
| | | , { field: 'HWorkerID', title: 'HWorkerID', width: 160, hide: true } |
| | | , { field: 'HScanDate', title: 'HScanDate', width: 160, hide: true } |
| | | , { field: 'HSourceInterID', title: 'HSourceInterID', width: 160, hide: true } |
| | | , { field: 'HSourceEntryID', title: 'HSourceEntryID', width: 160, hide: true } |
| | | , { field: 'HSourceBillNo', title: 'HSourceBillNo', width: 160, hide: true } |
| | | , { fixed: 'right', title: 'æä½', toolbar: '#barDemo', width: 66 } |
| | | ]] |
| | | } |
| | | option2 = { |
| | |
| | | table.render(option2); |
| | | } |
| | | |
| | | //æ¡ç å车æ¥è¯¢ |
| | | function txtHBarCode_KeyDown(HBarCode) { |
| | | |
| | | var HProcExchBillNo = $("#HProcExchBillNo").val(); |
| | | //产åSNééç ç å车æ¥è¯¢ |
| | | function txtHBarCodeSN_KeyDown(HBarCode) { |
| | | //ä¸»è¡¨ä¿¡æ¯æ¥è¯¢ |
| | | var indexs = layer.load(); |
| | | //é
ä»¶ä¿¡æ¯æ¥è¯¢ |
| | | var HBillNo = $("#HBillNo").val(); |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + "/Cj_SingleStation/SNHBardCodeList", |
| | | url: GetWEBURL() + "/Cj_SingleStation/HBardCodeBomList_XW", |
| | | async: false, |
| | | data: { "HBarCode": HBarCode, "HProcExchBillNo": HProcExchBillNo, "user": sessionStorage["HUserName"], "HOrgID": sessionStorage["OrganizationID"] }, |
| | | data: { "HBillNo": HBillNo, "HBarCode": HBarCode, "HProcID": $("#HProcID").val(), "HOrgID": sessionStorage["OrganizationID"], "user": sessionStorage["HUserName"] }, |
| | | dataType: "json", |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | layer.close(indexs); |
| | | var index = layer.load(); |
| | | var data = data1.data |
| | | var rowarr = []; |
| | | |
| | | for (var i = 0; i < data.length; i++) { |
| | | rowarr.push({ |
| | | "HBarCode_P": data[i].产åç , "HPartsBarCode": "", "HPartsQty": data[i].ååå项ç¨é, "HBindingQty": 0 |
| | | , "HMaterID": data[i].åé¡¹ç©æID, "HMaterNumber": data[i].åé¡¹ç©æä»£ç , "HMaterName": data[i].åé¡¹ç©æåç§°, "HMaterModel": data[i].åé¡¹è§æ ¼åå·, "HBatchNo": "" |
| | | , "HSourceID": $("#HSourceID").val(), "HEquipID": 0, "HGroupID": $("#HGroupID").val(), "HWorkerID": $("#HEmpID").val() |
| | | , "HScanDate": new Date(), "HSourceInterID": $("#HICMOInterID").val() |
| | | , "HSourceEntryID": $("#HICMOEntryID").val(), "HSourceBillNo": $("#HICMOBillNo").val() |
| | | }); |
| | | } |
| | | |
| | | option.data = rowarr; |
| | | |
| | | table.render(option); |
| | | |
| | | |
| | | |
| | | //ç¦ç¨è¾å
¥æ¡,èæ¯è²åç° |
| | | $("#HBarCode_SN").prop("readonly", true); |
| | | $("#HBarCode_SN").css('background', '#EDEDED')//èæ¯è²åç° |
| | | //å
æ 跳转å°é
ä»¶ç ææ¬æ¡ä¸ |
| | | $("#HBarCode_Key").focus(); |
| | | //è·å对åºä¸»è¡¨ä¿¡æ¯ |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + "/Cj_SingleStation/HBardCodeSNList", |
| | | url: GetWEBURL() + "/Cj_SingleStation/checkHBarCode_Batch", |
| | | async: false, |
| | | data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"] }, |
| | | data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"], "HOrgID": sessionStorage["OrganizationID"] }, |
| | | dataType: "json", |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | layer.close(index); |
| | | $("#HBarCode_P").val(HBarCode); |
| | | if (AllowLoadData()) { |
| | | //ä¿åæ°æ® |
| | | set_AddAssemblyBill(); |
| | | } |
| | | layer.close(indexs); |
| | | $("#HSNNo").val(HBarCode); |
| | | $("#HMaterNumber").val(data1.data[0]["HMaterNumber"]) |
| | | $("#HMaterName").val(data1.data[0]["HMaterName"]) |
| | | $("#HMaterModel").val(data1.data[0]["HMaterModel"]) |
| | | $("#HICMOBillNo").val(data1.data[0]["HSourceBillNo"]) |
| | | } |
| | | else { |
| | | layer.close(index); |
| | | layer.msg(get_MessageError(data1.Message, sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 100000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨æç¤º", sessionStorage["HTranSlate"]) }); |
| | | layer.close(indexs); |
| | | layer.confirm(data1.Message); |
| | | } |
| | | $("#HBarCodeSN").val(""); |
| | | |
| | | }, |
| | | error: function (err) { |
| | | layer.close(index); |
| | | layer.close(indexs); |
| | | layer.msg(get_MessageError("é误:" + err, sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 100000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨æç¤º", sessionStorage["HTranSlate"]) }); |
| | | return; |
| | | } |
| | | }); |
| | | } |
| | | else { |
| | | layer.close(indexs); |
| | | layer.msg(get_MessageError(data1.Message, sessionStorage["HTranSlate"])); |
| | | $("#HBarCode_SN").val(""); |
| | | $("#HBarCode_SN").focus(); |
| | | layer.confirm(data1.Message); |
| | | } |
| | | //å
æ 跳转å°SNæ¡ç ææ¬æ¡ä¸ |
| | | //$("#HBarCodeSN").focus(); |
| | | $("#HBarCodeSN").val(""); |
| | | }, |
| | | error: function (err) { |
| | | layer.close(indexs); |
| | | layer.msg(get_MessageError("é误:" + err, sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 100000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨æç¤º", sessionStorage["HTranSlate"]) }); |
| | | layer.msg("é误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | $("#HBarCode_SN").val(""); |
| | | $("#HBarCode_SN").focus(); |
| | | layer.confirm(data1.Message); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | //é
ä»¶ç å车æ¥è¯¢ |
| | | function txtHBarCodeKey_KeyDown(HBarCode) { |
| | | var indexs = layer.load(); |
| | | var HBillNo = $("#HBillNo").val(); |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + "/Cj_SingleStation/BarCodeBillBomMatch_XW", |
| | | async: false, |
| | | data: { "HBillNo": HBillNo, "HBarCode": HBarCode, "HBarCode_P": $('#HBarCode_SN').val(), "HProcID": $('#HProcID').val(), "user": sessionStorage["HUserName"], "HOrgID": sessionStorage["OrganizationID"] }, |
| | | dataType: "json", |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | var data = data1.data |
| | | |
| | | for (var i = 0; i < option.data.length; i++) { |
| | | if (data[0].HMaterID == option.data[i].HMaterID && option.data[i].HBindingQty < option.data[i].HPartsQty) { |
| | | option.data[i].HMaterID = data[0].HMaterID |
| | | option.data[i].HMaterNumber = data[0].ç©æä»£ç |
| | | option.data[i].HMaterName = data[0].ç©æåç§° |
| | | option.data[i].HMaterModel = data[0].è§æ ¼åå· |
| | | option.data[i].HBarCode = data[0].é
ä»¶ç |
| | | option.data[i].HBindingQty = option.data[i].HBindingQty + 1 |
| | | $("#HReturnMessage").text("æåæ«ç ä¸ä¸ªé
ä»¶:" + data[0].ç©æåç§°); |
| | | break; |
| | | } else if (data[0].HMaterID == option.data[i].HMaterID && i == option.data.length - 1) { |
| | | layer.msg("第" + (i + 1) + "è¡å·²å
¨é¨ç»å®ï¼è¯·å¿è¶
éç»å®"); |
| | | } else if (data[0].HMaterID != option.data[i].HMaterID && i == option.data.length - 1) { |
| | | layer.msg("ææ«é
ä»¶ç ï¼" + HBarCode + " ,对åºç©æä¸å¨çäº§ç¨ææ¸
åä¸ï¼"); |
| | | } |
| | | } |
| | | |
| | | //option.data = rowarr; |
| | | |
| | | table.render(option); |
| | | //å
æ 跳转å°é
ä»¶ç ææ¬æ¡ä¸ |
| | | $("#HBarCode_Key").focus(); |
| | | $("#HBarCode_Key").val(""); |
| | | |
| | | layer.close(indexs); |
| | | } |
| | | else { |
| | | layer.close(indexs); |
| | | layer.confirm(data1.Message); |
| | | } |
| | | }, |
| | | error: function (err) { |
| | | layer.close(indexs); |
| | | layer.msg("é误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //å è½½ç½æ ¼ |
| | | function get_Display() { |
| | | //å è½½åå²è¿ç«æ¸
åä¿¡æ¯ |
| | | function get_Display(sWhere = '') { |
| | | var ajaxLoad = layer.load(); |
| | | var HProcID = $("#HProcID").val(); |
| | | var HSourceID = $("#HSourceID").val(); |
| | | sWhere += ` and HProcID = ${HProcID} and HSourceID = ${HSourceID}` |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Cg_POOrderBill/list', |
| | | url: GetWEBURL() + '/Cj_SingleStation/SingleStationOutBillList', |
| | | async: false, |
| | | type: "GET", |
| | | data: { "sWhere": '', "user": sessionStorage["HUserName"] }, |
| | | data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | var data = [];//ååæ®µæ°æ® |
| | | var col = []; |
| | | var titleData=[] |
| | | var titleData = [] |
| | | var totalArray = ["æ°é", "å
³èæ°é", "æªå
³èæ°é", "æå°æ¡ç æ°é", "æªæå°æ¡ç æ°é", "宿¶æ°é", "éé¢"]; |
| | | //ç»ç©ºçæ°ç»èµå¼ |
| | | for (var key in data1.list) { |
| | |
| | | } |
| | | } |
| | | } |
| | | option.cols = [col] |
| | | option.data = data1.data; |
| | | option2.cols = [col] |
| | | option2.data = data1.data; |
| | | |
| | | |
| | | |
| | | |
| | | //å·æ°è¡¨æ ¼æ°æ® |
| | | DisPlay_HideColumn(HModName, sessionStorage["HUserName"], option, []); |
| | | DisPlay_HideColumn(HModName2, sessionStorage["HUserName"], option2, []); |
| | | |
| | | table.render(option); |
| | | table.render(option2); |
| | | layer.close(ajaxLoad); |
| | | //layer.alert("æ¥è¯¢æå", { icon: 1 }); |
| | | } else { |
| | |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //#region ä¿åæ¹æ³ |
| | | function set_SaveBill() { |
| | | var data = { |
| | | "field": { |
| | | "HProcID": $("#HProcID").val(), "HBatchNo": "", |
| | | "HGroupID": $("#HGroupID").val(), "HSourceID": $("#HSourceID").val(), |
| | | "HProdOrgID": sessionStorage["OrganizationID"], |
| | | "HEmpID": $("#HEmpID").val(), "HDeptID": $("#HDeptID").val() |
| | | } |
| | | }; |
| | | var sMainStr = JSON.stringify(data.field); |
| | | var HBarCode = $("#HBarCode_SN").val(); |
| | | var sSubStr = JSON.stringify(option.data); |
| | | var sMainSub = sMainStr + ';' + HBarCode + ';' + sSubStr + ';' + sessionStorage["HUserName"]; |
| | | var indexs = layer.load(); |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: GetWEBURL() + "/Cj_SingleStation/AddStationOutBillAndAssemblyBill", |
| | | async: false, |
| | | data: { "sMainSub": sMainSub }, |
| | | dataType: "json", |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | layer.close(indexs); |
| | | |
| | | |
| | | $("#HReturnMessage").text("æåè¿ç«æ«ç ä¸ä¸ªäº§å:" + HBarCode); |
| | | //åæ¢äº§å |
| | | set_changeHBarCodeSN(); |
| | | get_Display(); |
| | | } |
| | | else { |
| | | |
| | | layer.close(indexs); |
| | | layer.msg(data1.Message, { icon: 5, btn: ["确认"], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "åºç°é误" }); |
| | | } |
| | | |
| | | }, |
| | | error: function (err) { |
| | | |
| | | layer.close(indexs); |
| | | layer.msg(get_MessageError("é误:" + err, sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 100000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨æç¤º", sessionStorage["HTranSlate"]) }); |
| | | } |
| | | }); |
| | | } |
| | | //#endregion |
| | | |
| | | //å é¤åæ® |
| | | function btn_Delete() { |
| | | var checkStatus = table.checkStatus('mainTable2') |
| | | , data = checkStatus.data; |
| | | if (checkStatus.data.length === 1) { |
| | | layer.confirm(get_MessageError('[0000-1-003]ç¡®å®å é¤' + data[0].åæ®å· + 'åï¼', sessionStorage["HTranSlate"]), function (index) { |
| | | var ajaxLoad = layer.load(); |
| | | //é»è¾å 餿¹æ³ |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Cj_StationOutBill/del_StationOutBillandAssemblyBill', |
| | | type: "GET", |
| | | data: { "HInterID": data[0].hmainid, "HBarCode_P": data[0].ééSNç , "HDeleteMan": sessionStorage["HUserName"], "HBillSubType": "3791" }, |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | get_Display(); |
| | | layer.close(ajaxLoad); |
| | | } else { |
| | | layer.close(ajaxLoad); |
| | | layer.alert(get_MessageError(result.Message, sessionStorage["HTranSlate"]) + result.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.close(ajaxLoad); |
| | | layer.alert(get_MessageError("[0000-1-002]æ¥å£è¯·æ±å¤±è´¥!", sessionStorage["HTranSlate"]), { icon: 5 }); |
| | | } |
| | | }); |
| | | layer.close(index); |
| | | }); |
| | | } else { |
| | | layer.msg(get_MessageError('[0000-1-001]è¯·éæ©ä¸è¡æ°æ®ç¼è¾ï¼', sessionStorage["HTranSlate"])); |
| | | } |
| | | } |
| | | |
| | | //åæ¢äº§åæ¹æ³ |
| | | function set_changeHBarCodeSN() { |
| | | $("#HSNNo").val(""); |
| | | $("#HMaterNumber").val("") |
| | | $("#HMaterName").val("") |
| | | $("#HMaterModel").val("") |
| | | $("#HICMOBillNo").val("") |
| | | |
| | | |
| | | //å¯ç¨è¾å
¥æ¡,èæ¯è²æ¢å¤ |
| | | $("#HBarCode_SN").prop("readonly", false); |
| | | $("#HBarCode_SN").css('background', '#FFFFFF')//产åç ææ¬æ¡èæ¯è²æ¢å¤ |
| | | //æ¸
ç©ºææ¬æ¡å
容 |
| | | $("#HBarCode_SN").val("");//产åç ææ¬æ¡å
容æ¸
空 |
| | | //å
æ 跳转å°äº§åç ææ¬æ¡ä¸ |
| | | $("#HBarCode_SN").focus(); |
| | | |
| | | //æ¸
é¤ç»å®ä¿¡æ¯ç½æ ¼æ«ç è®°å½ |
| | | option.data = []; |
| | | table.render(option); |
| | | } |
| | | |
| | | // çæåæ®å· |
| | | function createBillNo() { |
| | | //éæ°è·ååæ®å· |
| | | $.ajax({ |
| | | url: GetWEBURL() + "/Web/GetMAXNumPDA", |
| | | type: "GET", |
| | | async: false, |
| | | data: { "HBillType": '3727' }, |
| | | success: function (d) { |
| | | //$("#HInterID").val(d.data[0].HInterID); |
| | | $("#HBillNo").val(d.data[0].HBillNo); |
| | | //$("#HDate").val(Format(new Date(), "yyyy-MM-dd")); //é»è®¤ä¸ºå½åæ¥æ |
| | | //éæ°å¯ç¨ä¿åæé® |
| | | //$("#btnSave").removeClass("layui-btn-disabled").attr("disabled", false); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //è¡¨æ ¼è¡å
äºä»¶å é¤ |
| | | function set_GridDelete(obj) { |
| | | var data = obj.data; |
| | | var rowIndex = $(obj.tr).attr("data-index"); |
| | | if (obj.event === 'del') { |
| | | layer.confirm('ççå é¤è¡åï¼', function (index) { |
| | | |
| | | var wait = layer.load(); |
| | | //å é¤ä¸´æ¶è¡¨æ°æ® |
| | | $.ajax({ |
| | | url: GetWEBURL() + 'Deltet_Sc_AssemblyBill_BindBarCodeTemp', |
| | | type: "GET", |
| | | data: { "HBillNo": $("#HBillNo").val(), "HBarCode": option.data[rowIndex].HBarCode, "user": sessionStorage["HUserName"] }, |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | layer.msg(result.Message, { icon: 1, time: 500 }, function () { |
| | | //å
³éå½åframe |
| | | layer.close(wait); |
| | | }); |
| | | } else { |
| | | layer.alert(result.code + result.Message, { icon: 5 }); |
| | | layer.close(wait); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | layer.close(wait); |
| | | } |
| | | }); |
| | | |
| | | |
| | | //å·æ°è¡¨æ ¼æ°æ® |
| | | option.data[rowIndex].HBarCode = ""; |
| | | option.data[rowIndex].HBindingQty = 0; |
| | | //option.data[rowIndex].HMaterID = 0; |
| | | option.data[rowIndex].HMaterNumber = ""; |
| | | option.data[rowIndex].HMaterName = ""; |
| | | option.data[rowIndex].HMaterModel = ""; |
| | | option.data[rowIndex].HBarCode = ""; |
| | | |
| | | table.render(option); |
| | | layer.close(index); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | //åå·¥éæ©é¡µé¢ |
| | |
| | | //é空éªè¯ |
| | | function AllowLoadData() { |
| | | |
| | | var HBarCode = $("#HBarCode_P").val(); |
| | | var HBarCode = $("#HBarCode_SN").val(); |
| | | if (HBarCode == "") { |
| | | layer.msg(get_MessageError("[0000-2-019]产åSNä¸è½ä¸ºç©º!", sessionStorage["HTranSlate"])) |
| | | return false; |
| | | } |
| | | var sSubStr = JSON.stringify(table.cache['mainTable']); |
| | | |
| | | var HEmpID2 = $("#HEmpID2").val(); |
| | | if (HEmpID2 == 0) { |
| | | layer.msg(get_MessageError("[0000-2-030]æä½åä¸è½ä¸ºç©º!", sessionStorage["HTranSlate"])) |
| | | return false; |
| | | if (typeof (sSubStr) != "undefined" && typeof (sSubStr) != "") { |
| | | sSubStr = JSON.parse(sSubStr); |
| | | for (var i = 0; i < sSubStr.length; i++) { |
| | | if (sSubStr[i].HBarCode == "" || sSubStr[i].HBarCode == undefined || sSubStr[i].HBarCode == null) { |
| | | layer.msg("ç»å®ä¿¡æ¯ç¬¬" + (i + 1) + "è¡,é
ä»¶ç æªç»å®!", { icon: 5, btn: ['确认'], time: 4000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | return Result = false; |
| | | } |
| | | } |
| | | } else { |
| | | layer.msg("é
ä»¶ç»å®ä¿¡æ¯ä¸å
许为空!", { icon: 5, btn: ['确认'], time: 4000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | return Result = false; |
| | | } |
| | | |
| | | |
| | | //var HBadReasonID = $("#HBadReasonID").val(); |
| | | //if (HBadReasonID == 0) { |
| | | // layer.msg("ä¸è¯åå ä¸è½ä¸ºç©º!") |
| | |
| | | <label class="layui-form-label" style="padding-left:0px" id="">ééç :</label> |
| | | <input type="text" class="layui-input" name="HBarCode_SN" lay-verify="HBarCode_SN" autocomplete="off" placeholder="请é®å
¥åå车" id="HBarCode_SN" style="width: 500px;"> |
| | | </div> |
| | | |
| | | <button class="layui-btn layui-btn-normal" style="float:left;" type="button" lay-submit="" lay-filter="btnNextProc" id="btnNextProc">æ¢äº§å</button> |
| | | <!--<button class="layui-btn layui-btn-normal" style="float:left;" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">ä¿å</button>--> |
| | | |
| | | <button class="layui-btn layui-btn-normal" style="float:right" type="button" lay-submit="" lay-filter="btnExit" id="btnExit">éåº</button> |
| | | <button class="layui-btn layui-btn-normal" style="float: right" type="button" lay-submit="" lay-filter="btnChange" id="btnChange">åæ´</button> |
| | |
| | | |
| | | |
| | | </div> |
| | | <div class="layui-tab layui-tab-card" style="width: 49%; float: left; background-color: white;height:400px"> |
| | | <div class="layui-tab layui-tab-card" style="width: 40%; float: left; background-color: white;height:400px"> |
| | | <ul class="layui-tab-title" lay-filter="tab-all"> |
| | | <li lay-id="1" style="padding:1px;" class="layui-this">产åä¿¡æ¯</li> |
| | | <li lay-id="2" style="padding:1px;">å
¶ä»ä¿¡æ¯</li> |
| | |
| | | </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="text" class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" style="background-color:#EDEDED;" readonly> |
| | | <input type="hidden" name="HInterID" id="HInterID" lay-verify="HInterID"> |
| | | </div> |
| | | </div> |
| | | <!--<div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;" id="">å½åæ¹æ¬¡:</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HBatchNo" lay-verify="HBatchNo" id="HBatchNo" style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | </div>--> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;" id="">ä¾åºå:</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-tab layui-tab-card" style="width: 50.5%; float: right;"> |
| | | <div class="layui-tab layui-tab-card" style="width: 59.5%; float: right;"> |
| | | <ul class="layui-tab-title"> |
| | | <li class="layui-this">å
³é®ä»¶æ¸
å</li> |
| | | </ul> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script type="text/html" id="toolbarDemo"> |
| | | <div class="layui-btn-container"> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete"><i class="layui-icon layui-icon-form"></i>è§£ç»</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn" id="HideColumn"><i class="layui-icon layui-icon-form"></i>å设置</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="toolbarDemo2"> |
| | | <div class="layui-btn-container"> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete2"><i class="layui-icon layui-icon-form"></i>å é¤</button> |
| | |
| | | </div> |
| | | </body> |
| | | </html> |
| | | <script type="text/html" id="barDemo"> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">å é¤</a> |
| | | </script> |
| | | <script> |
| | | |
| | | layui.config({ |
| | |
| | | |
| | | //å®ä¹å
¨å±åé |
| | | |
| | | var HModName = "Cj_ProcessItemStationPlatform_batch"; |
| | | var HModName2 = "Cj_ProcessItemStationPlatform_batch2"; |
| | | var HModName = "Cj_ProcessItemStationPlatform_batchKeyElement"; |
| | | var HModName2 = "Cj_ProcessItemStationPlatform_batchKeyElement2"; |
| | | var option = []; |
| | | var option2 = []; |
| | | //#endregion |
| | |
| | | |
| | | //#region 触åäºä»¶ï¼å
æ¬form.on(){}æ ¼å¼çææç¹å»äºä»¶ãéæ©äºä»¶ç |
| | | //头工å
·æ äºä»¶ |
| | | |
| | | //ç»å®ä¿¡æ¯è¡å
äºä»¶ |
| | | table.on('tool(mainTable)', function (obj) { |
| | | set_GridDelete(obj); //è¡å
å é¤ |
| | | }); |
| | | |
| | | table.on('toolbar(mainTable)', function (obj) { |
| | | switch (obj.event) { |
| | | //å é¤æé® |
| | | case 'btn-Delete': set_DeleteBill(); |
| | | break; |
| | | //case 'btn-Delete': btn_Delete(); |
| | | // break; |
| | | //å设置 |
| | | case 'set_HideColumn': get_HideColumnNoPage(HModName, sessionStorage["HUserName"], option, get_Display); |
| | | break; |
| | |
| | | table.on('toolbar(mainTable2)', function (obj) { |
| | | switch (obj.event) { |
| | | //å é¤æé® |
| | | case 'btn-Delete2': set_DeleteBill2(); |
| | | case 'btn-Delete2': btn_Delete(); |
| | | break; |
| | | //å设置 |
| | | case 'set_HideColumn2': get_HideColumnNoPage(HModName2, sessionStorage["HUserName"], option2, get_Display); |
| | | break; |
| | | }; |
| | | }); |
| | | |
| | | //åæ´ |
| | | form.on('submit(btnChange)', function (data) { |
| | | $("#HBarCode_Batch").val(""); |
| | | $("#HBarCode_Batch").prop("readonly", false); |
| | | $("#HBarCode_BatchSec").val(""); |
| | | $("#HBatchNo").val(""); |
| | | $("#HMaterNumber").val(""); |
| | | $("#HMaterName").val(""); |
| | | $("#HMaterModel").val(""); |
| | | $("#HSupID").val(0) |
| | | $("#HSupName").val(0) |
| | | //è¿å
¥é¡µé¢é»è®¤å
æ 卿¹æ¬¡ä¸ |
| | | $("#HBarCode_Batch").focus(); |
| | | }); |
| | | |
| | | //æ¹æ¬¡ç åè½¦æ¹æ³ |
| | | $('#HBarCode_Batch').on('keydown', function (event) { |
| | | var HBarCode = $('#HBarCodeSN').val(); |
| | | var HBardCodeProcExchBillNo = $('#HBardCodeProcExchBillNo').val(); |
| | | var HBarCode = $('#HBarCode_Batch').val(); |
| | | if (event.keyCode == 13) { |
| | | if (!HBardCodeProcExchBillNo) { |
| | | layer.msg(get_MessageError("[0000-2-034]请å
æ«æµè½¬å¡ï¼", sessionStorage["HTranSlate"])) |
| | | return; |
| | | } else { |
| | | HBarCode = HBarCode.toUpperCase(); |
| | | if (!HBarCode) { |
| | | layer.msg(get_MessageError("[0000-2-019]æ¡å½¢ç ä¸è½ä¸ºç©ºï¼", sessionStorage["HTranSlate"])) |
| | | return; |
| | | } else { |
| | | if (HBarCode.length != 29 && HBarCode.length != 50) { |
| | | layer.alert(get_MessageError("[3791-2-012]åä»¶æ¡ç é¿åº¦ä¸ä¸º29使50ä½!", sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-035]éåº', sessionStorage["HTranSlate"])], time: 100000, offset: 't' }); |
| | | return; |
| | | } |
| | | //妿ééç ä¸ä¸ºç©º |
| | | if (HBarCode) { |
| | | txtHBarCode_KeyDown(HBarCode); |
| | | } |
| | | |
| | | if (HBarCode.match(/[^\x00-\xff]/g) != null) { |
| | | layer.alert(get_MessageError("[3791-2-013]å¿
é¡»æ¯åè§å符!", sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-035]éåº', sessionStorage["HTranSlate"])], time: 100000, offset: 't' }); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | for (var i = 0; i < option.data.length; i++) { |
| | | if (option.data[i]["HBatchNo"] == "") { |
| | | layer.msg(get_MessageError("[3791-2-014]å½åå·¥åºæ¹æ¬¡ä¸è½ä¸ºç©ºï¼", sessionStorage["HTranSlate"])) |
| | | return; |
| | | } |
| | | } |
| | | txtHBarCode_KeyDown(HBarCode); |
| | | } |
| | | }); |
| | | |
| | | //ééç åè½¦æ¹æ³ |
| | | $('#HBarCode_SN').on('keydown', function (event) { |
| | | var HBarCode = $('#HBardCodeProcExchBillNo').val(); |
| | | var HBarCode_SN = $('#HBarCode_SN').val(); |
| | | if (event.keyCode == 13) { |
| | | if (!HBarCode) { |
| | | layer.msg(get_MessageError("[0000-1-057]æµè½¬å¡ä¸è½ä¸ºç©ºï¼", sessionStorage["HTranSlate"])) |
| | | return; |
| | | if ($("#HBarCode_Batch").val() == "" || $("#HBarCode_Batch").val() == null) { |
| | | layer.msg("æªæ«æ¹æ¬¡ç 请å
æ«ç "); |
| | | $("#HBarCode_Batch").focus(); |
| | | return |
| | | } |
| | | setIntervalIndex = setInterval(setIntervalList, 30000); |
| | | get_BomList(HBarCode); |
| | | //if (option.data != 0) { |
| | | // //ä¿åå°ä¸´æ¶è¡¨ |
| | | // get_AddBomTempList(); |
| | | //} |
| | | //æ¥è¯¢ä¸è¯è®°å½ |
| | | get_BadRecords(); |
| | | //æ¥è¯¢åæ ¼è®°å½ |
| | | get_HGRecords(); |
| | | if (HBarCode_SN) { |
| | | createBillNo(); |
| | | txtHBarCodeSN_KeyDown(HBarCode_SN); |
| | | } |
| | | |
| | | |
| | | } |
| | | }); |
| | | //å
³é®ä»¶åè½¦æ¹æ³ |
| | | $('#HBarCode_Key').on('keydown', function (event) { |
| | | var HBarCode_Key = $('#HBarCode_Key').val(); |
| | | if (event.keyCode == 13) { |
| | | if ($("#HBarCode_Batch").val() == "" || $("#HBarCode_Batch").val() == null) { |
| | | layer.msg("æªæ«æ¹æ¬¡ç 请å
æ«ç "); |
| | | $("#HBarCode_Batch").focus(); |
| | | return |
| | | } |
| | | if ($("#HBarCode_SN").val() == "" || $("#HBarCode_SN").val() == null) { |
| | | layer.msg("æªæ«SNç 请å
æ«ç "); |
| | | $("#HBarCode_SN").focus(); |
| | | return |
| | | } |
| | | if (HBarCode_Key) { |
| | | txtHBarCodeKey_KeyDown(HBarCode_Key); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | |
| | | //ä¿å |
| | | form.on('submit(btnSave)', function (data) { |
| | | if (AllowLoadData(data)) { |
| | | set_SaveBill(data); |
| | | } |
| | | }); |
| | | //æ¢äº§å |
| | | form.on('submit(btnNextProc)', function (data) { |
| | | //for (var i = 0; i < option.data.length; i++) { |
| | | // if (option.data[i].HBindingQty < 1 || option.data[i].HBarCode == "") { |
| | | // layer.alert("第<span style='color: red;'>" + (i + 1) + "</span>è¡ï¼é
ä»¶ <span style='color: blue;'>" + option.data[i].HMaterName + "</span> æªç»å®é½æ´ï¼") |
| | | // return; |
| | | // } |
| | | //} |
| | | |
| | | //ä¿åå
³é®ä»¶ |
| | | if (AllowLoadData(data)) { |
| | | set_SaveBill(data); |
| | | } |
| | | |
| | | |
| | | |
| | | //éæ°è·ååæ®å· |
| | | //$.ajax({ |
| | | // url: GetWEBURL() + "/Web/GetMAXNumPDA", |
| | | // type: "GET", |
| | | // data: { "HBillType": '3727' }, |
| | | // success: function (d) { |
| | | // $("#HInterID").val(d.data[0].HInterID); |
| | | // $("#HBillNo").val(d.data[0].HBillNo); |
| | | // $("#HDate").val(Format(new Date(), "yyyy-MM-dd")); //é»è®¤ä¸ºå½åæ¥æ |
| | | // //éæ°å¯ç¨ä¿åæé® |
| | | // $("#btnSave").removeClass("layui-btn-disabled").attr("disabled", false); |
| | | // } |
| | | //}); |
| | | |
| | | //åå²ç»å®è®°å½æ¥è¯¢ |
| | | //get_Display(); |
| | | }); |
| | | |
| | | |
| | | //éæ©æä½å |
| | | form.on('submit(btnHEmp)', function () { |
| | |
| | | //åå§åçé¢ |
| | | function set_ClearBill() { |
| | | //è¿å
¥é¡µé¢é»è®¤å
æ 卿µè½¬å¡ä¸ |
| | | $("#HBardCodeProcExchBillNo").focus(); |
| | | $("#HBarCode_Batch").focus(); |
| | | //å¶å人 |
| | | $("#HMaker").val(sessionStorage["HUserName"]); |
| | | $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd")); |
| | | |
| | | //éè¿ç»å½ç¨æ·è·åé»è®¤å¼ |
| | | GetDefValByUser(); |
| | | //åå§åè¡¨æ ¼ |
| | | set_InitGrid(); |
| | | // |
| | | //get_Display(); |
| | | get_Display(); |
| | | } |
| | | |
| | | //#region éè¿ç»å½ç¨æ·è·åé»è®¤å¼ |
| | |
| | | } |
| | | //#endregion |
| | | |
| | | // çæåæ®å· |
| | | function createBillNo() { |
| | | //éæ°è·ååæ®å· |
| | | $.ajax({ |
| | | url: GetWEBURL() + "/Web/GetMAXNumPDA", |
| | | type: "GET", |
| | | async: false, |
| | | data: { "HBillType": '3727' }, |
| | | success: function (d) { |
| | | //$("#HInterID").val(d.data[0].HInterID); |
| | | $("#HBillNo").val(d.data[0].HBillNo); |
| | | //$("#HDate").val(Format(new Date(), "yyyy-MM-dd")); //é»è®¤ä¸ºå½åæ¥æ |
| | | //éæ°å¯ç¨ä¿åæé® |
| | | //$("#btnSave").removeClass("layui-btn-disabled").attr("disabled", false); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //å
³é®ä»¶æ¸
å |
| | | function set_InitGrid() { |
| | | option= { |
| | | elem: '#mainTable' |
| | | , toolbar: '#toolbarDemo' |
| | | //, toolbar: '#toolbarDemo' |
| | | , page: false |
| | | , totalRow: true |
| | | , cellMinWidth: 120 |
| | | , data: [] |
| | | , height: 285 |
| | | , limit: 10 |
| | | , cols: [[ |
| | | { type: 'numbers', title: 'åºå·' } |
| | | , { field: 'æ¥æ', title: 'æ¥æ' } |
| | | , { field: 'é
件代ç ', title: 'é
件代ç ' } |
| | | , { field: 'é
ä»¶åç§°', title: 'é
ä»¶åç§°' } |
| | | , { field: 'é
ä»¶è§æ ¼', title: 'é
ä»¶è§æ ¼' } |
| | | , { field: 'é
ä»¶æ°é', title: 'é
ä»¶æ°é', totalRow: true} |
| | | , { field: 'HBatchNo', title: 'å½åæ¹æ¬¡' } |
| | | , { 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 } |
| | | , limit: 50 |
| | | , cols: [[ //ç»å®ä¿¡æ¯è¡¨ |
| | | { type: 'numbers', title: 'åºå·', width: 50 } |
| | | , { field: 'HBarCode_P', title: '产åç ', width: 265 } |
| | | , { field: 'HBarCode', title: 'é
ä»¶ç ', width: 265 } |
| | | , { field: 'HPartsQty', title: 'é
ä»¶æ°', width: 72 } |
| | | , { field: 'HBindingQty', title: 'å·²ç»æ°', width: 72 } |
| | | , { field: 'HMaterID', title: 'HMaterID', hide: true } |
| | | , { field: 'HBarCode', title: 'HBarCode', hide: true } |
| | | , { field: 'HMaterNumber', title: 'ç©æä»£ç ', width: 160 } |
| | | , { field: 'HMaterName', title: 'ç©æåç§°', width: 160 } |
| | | , { field: 'HMaterModel', title: 'è§æ ¼åå·', width: 160, hide: true } |
| | | , { field: 'HBatchNo', title: 'æ¹æ¬¡', width: 160, hide: true } |
| | | , { field: 'HSourceID', title: 'HSourceID', width: 160, hide: true } |
| | | , { field: 'HEquipID', title: 'HEquipID', width: 160, hide: true } |
| | | , { field: 'HGroupID', title: 'HGroupID', width: 160, hide: true } |
| | | , { field: 'HWorkerID', title: 'HWorkerID', width: 160, hide: true } |
| | | , { field: 'HScanDate', title: 'HScanDate', width: 160, hide: true } |
| | | , { field: 'HSourceInterID', title: 'HSourceInterID', width: 160, hide: true } |
| | | , { field: 'HSourceEntryID', title: 'HSourceEntryID', width: 160, hide: true } |
| | | , { field: 'HSourceBillNo', title: 'HSourceBillNo', width: 160, hide: true } |
| | | , { fixed: 'right', title: 'æä½', toolbar: '#barDemo', width: 66 } |
| | | ]] |
| | | } |
| | | option2 = { |
| | |
| | | //æ¡ç å车æ¥è¯¢ |
| | | function txtHBarCode_KeyDown(HBarCode) { |
| | | |
| | | var HProcExchBillNo = $("#HProcExchBillNo").val(); |
| | | var indexs = layer.load(); |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + "/Cj_SingleStation/SNHBardCodeList", |
| | | url: GetWEBURL() + "/Cj_SingleStation/checkHBarCode_Batch", |
| | | async: false, |
| | | data: { "HBarCode": HBarCode, "HProcExchBillNo": HProcExchBillNo, "user": sessionStorage["HUserName"], "HOrgID": sessionStorage["OrganizationID"] }, |
| | | data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"], "HOrgID": sessionStorage["OrganizationID"] }, |
| | | dataType: "json", |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | layer.close(indexs); |
| | | var index = layer.load(); |
| | | $("#HBarCode_BatchSec").val(HBarCode); |
| | | const parts = HBarCode.split('@'); |
| | | $("#HBatchNo").val(parts[2]); |
| | | |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + "/Cj_SingleStation/HBardCodeSNList", |
| | | async: false, |
| | | data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"] }, |
| | | dataType: "json", |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | layer.close(index); |
| | | $("#HBarCode_P").val(HBarCode); |
| | | if (AllowLoadData()) { |
| | | //ä¿åæ°æ® |
| | | set_AddAssemblyBill(); |
| | | } |
| | | } |
| | | else { |
| | | layer.close(index); |
| | | layer.msg(get_MessageError(data1.Message, sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 100000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨æç¤º", sessionStorage["HTranSlate"]) }); |
| | | } |
| | | $("#HBarCodeSN").val(""); |
| | | }, |
| | | error: function (err) { |
| | | layer.close(index); |
| | | layer.msg(get_MessageError("é误:" + err, sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 100000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨æç¤º", sessionStorage["HTranSlate"]) }); |
| | | } |
| | | }); |
| | | $("#HMaterNumber").val(data1.data[0]["HMaterNumber"]) |
| | | $("#HMaterName").val(data1.data[0]["HMaterName"]) |
| | | $("#HMaterModel").val(data1.data[0]["HMaterModel"]) |
| | | $("#HSupID").val(data1.data[0]["HSupID"]) |
| | | $("#HSupName").val(data1.data[0]["HSupName"]) |
| | | $("#HBarCode_Batch").prop("readonly", true); |
| | | |
| | | //å
æ å¨ééç ä¸ |
| | | $("#HBarCode_SN").focus(); |
| | | } |
| | | else { |
| | | layer.close(indexs); |
| | | layer.msg(get_MessageError(data1.Message, sessionStorage["HTranSlate"])); |
| | | layer.msg(data1.Message); |
| | | } |
| | | //å
æ 跳转å°SNæ¡ç ææ¬æ¡ä¸ |
| | | //$("#HBarCodeSN").focus(); |
| | | $("#HBarCodeSN").val(""); |
| | | |
| | | }, |
| | | error: function (err) { |
| | | layer.close(indexs); |
| | |
| | | }); |
| | | } |
| | | |
| | | //å è½½ç½æ ¼ |
| | | function get_Display() { |
| | | var ajaxLoad = layer.load(); |
| | | //产åSNééç ç å车æ¥è¯¢ |
| | | function txtHBarCodeSN_KeyDown(HBarCode) { |
| | | //ä¸»è¡¨ä¿¡æ¯æ¥è¯¢ |
| | | var indexs = layer.load(); |
| | | //é
ä»¶ä¿¡æ¯æ¥è¯¢ |
| | | var HBillNo = $("#HBillNo").val(); |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Cg_POOrderBill/list', |
| | | type: "GET", |
| | | url: GetWEBURL() + "/Cj_SingleStation/HBardCodeBomList_XW", |
| | | async: false, |
| | | data: { "HBillNo": HBillNo,"HBarCode": HBarCode, "HProcID": $("#HProcID").val(), "HOrgID": sessionStorage["OrganizationID"], "user": sessionStorage["HUserName"] }, |
| | | dataType: "json", |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | var data = data1.data |
| | | var rowarr = []; |
| | | |
| | | for (var i = 0; i < data.length; i++) { |
| | | rowarr.push({ |
| | | "HBarCode_P": data[i].产åç , "HPartsBarCode": "", "HPartsQty": data[i].ååå项ç¨é, "HBindingQty": 0 |
| | | , "HMaterID": data[i].åé¡¹ç©æID, "HMaterNumber": data[i].åé¡¹ç©æä»£ç , "HMaterName": data[i].åé¡¹ç©æåç§°, "HMaterModel": data[i].åé¡¹è§æ ¼åå·, "HBatchNo": "" |
| | | , "HSourceID": $("#HSourceID").val(), "HEquipID": 0, "HGroupID": $("#HGroupID").val(), "HWorkerID": $("#HEmpID").val() |
| | | , "HScanDate": new Date(), "HSourceInterID": $("#HICMOInterID").val() |
| | | , "HSourceEntryID": $("#HICMOEntryID").val(), "HSourceBillNo": $("#HICMOBillNo").val() |
| | | }); |
| | | } |
| | | |
| | | option.data = rowarr; |
| | | |
| | | table.render(option); |
| | | |
| | | |
| | | |
| | | //ç¦ç¨è¾å
¥æ¡,èæ¯è²åç° |
| | | $("#HBarCode_SN").prop("readonly", true); |
| | | $("#HBarCode_SN").css('background', '#EDEDED')//èæ¯è²åç° |
| | | //å
æ 跳转å°é
ä»¶ç ææ¬æ¡ä¸ |
| | | $("#HBarCode_Key").focus(); |
| | | //è·å对åºä¸»è¡¨ä¿¡æ¯ |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + "/Cj_SingleStation/checkHBarCode_Batch", |
| | | async: false, |
| | | data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"], "HOrgID": sessionStorage["OrganizationID"] }, |
| | | dataType: "json", |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | layer.close(indexs); |
| | | $("#HSNNo").val(HBarCode); |
| | | $("#HMaterNumber").val(data1.data[0]["HMaterNumber"]) |
| | | $("#HMaterName").val(data1.data[0]["HMaterName"]) |
| | | $("#HMaterModel").val(data1.data[0]["HMaterModel"]) |
| | | $("#HICMOBillNo").val(data1.data[0]["HSourceBillNo"]) |
| | | } |
| | | else { |
| | | layer.close(indexs); |
| | | layer.confirm(data1.Message); |
| | | } |
| | | |
| | | }, |
| | | error: function (err) { |
| | | layer.close(indexs); |
| | | layer.msg(get_MessageError("é误:" + err, sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 100000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨æç¤º", sessionStorage["HTranSlate"]) }); |
| | | return; |
| | | } |
| | | }); |
| | | } |
| | | else { |
| | | layer.close(indexs); |
| | | $("#HBarCode_SN").val(""); |
| | | $("#HBarCode_SN").focus(); |
| | | layer.confirm(data1.Message); |
| | | } |
| | | }, |
| | | error: function (err) { |
| | | layer.close(indexs); |
| | | layer.msg("é误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | $("#HBarCode_SN").val(""); |
| | | $("#HBarCode_SN").focus(); |
| | | layer.confirm(data1.Message); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | //é
ä»¶ç å车æ¥è¯¢ |
| | | function txtHBarCodeKey_KeyDown(HBarCode) { |
| | | var indexs = layer.load(); |
| | | var HBillNo = $("#HBillNo").val(); |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + "/Cj_SingleStation/BarCodeBillBomMatch_XW", |
| | | async: false, |
| | | data: { "HBillNo": HBillNo,"HBarCode": HBarCode, "HBarCode_P": $('#HBarCode_SN').val(), "HProcID": $('#HProcID').val(), "user": sessionStorage["HUserName"], "HOrgID": sessionStorage["OrganizationID"] }, |
| | | dataType: "json", |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | var data = data1.data |
| | | |
| | | for (var i = 0; i < option.data.length; i++) { |
| | | if (data[0].HMaterID == option.data[i].HMaterID && option.data[i].HBindingQty < option.data[i].HPartsQty) { |
| | | option.data[i].HMaterID = data[0].HMaterID |
| | | option.data[i].HMaterNumber = data[0].ç©æä»£ç |
| | | option.data[i].HMaterName = data[0].ç©æåç§° |
| | | option.data[i].HMaterModel = data[0].è§æ ¼åå· |
| | | option.data[i].HBarCode = data[0].é
ä»¶ç |
| | | option.data[i].HBindingQty = option.data[i].HBindingQty + 1 |
| | | $("#HReturnMessage").text("æåæ«ç ä¸ä¸ªé
ä»¶:" + data[0].ç©æåç§°); |
| | | break; |
| | | } else if (data[0].HMaterID == option.data[i].HMaterID && i == option.data.length - 1) { |
| | | layer.msg("第" + (i + 1) + "è¡å·²å
¨é¨ç»å®ï¼è¯·å¿è¶
éç»å®"); |
| | | } else if (data[0].HMaterID != option.data[i].HMaterID && i == option.data.length - 1) { |
| | | layer.msg("ææ«é
ä»¶ç ï¼" + HBarCode + " ,对åºç©æä¸å¨çäº§ç¨ææ¸
åä¸ï¼"); |
| | | } |
| | | } |
| | | |
| | | //option.data = rowarr; |
| | | |
| | | table.render(option); |
| | | //å
æ 跳转å°é
ä»¶ç ææ¬æ¡ä¸ |
| | | $("#HBarCode_Key").focus(); |
| | | $("#HBarCode_Key").val(""); |
| | | |
| | | layer.close(indexs); |
| | | } |
| | | else { |
| | | layer.close(indexs); |
| | | layer.msg(data1.Message); |
| | | } |
| | | }, |
| | | error: function (err) { |
| | | layer.close(indexs); |
| | | layer.msg("é误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //åæ¢äº§åæ¹æ³ |
| | | function set_changeHBarCodeSN() { |
| | | $("#HSNNo").val(""); |
| | | $("#HMaterNumber").val("") |
| | | $("#HMaterName").val("") |
| | | $("#HMaterModel").val("") |
| | | $("#HICMOBillNo").val("") |
| | | |
| | | |
| | | //å¯ç¨è¾å
¥æ¡,èæ¯è²æ¢å¤ |
| | | $("#HBarCode_SN").prop("readonly", false); |
| | | $("#HBarCode_SN").css('background', '#FFFFFF')//产åç ææ¬æ¡èæ¯è²æ¢å¤ |
| | | //æ¸
ç©ºææ¬æ¡å
容 |
| | | $("#HBarCode_SN").val("");//产åç ææ¬æ¡å
容æ¸
空 |
| | | //å
æ 跳转å°äº§åç ææ¬æ¡ä¸ |
| | | $("#HBarCode_SN").focus(); |
| | | |
| | | //æ¸
é¤ç»å®ä¿¡æ¯ç½æ ¼æ«ç è®°å½ |
| | | option.data = []; |
| | | table.render(option); |
| | | } |
| | | |
| | | //#region ä¿åæ¹æ³ |
| | | function set_SaveBill() { |
| | | var data = { |
| | | "field": { |
| | | "HProcID": $("#HProcID").val(), "HBatchNo": $("#HBarCode_Batch").val(), |
| | | "HGroupID": $("#HGroupID").val(), "HSourceID": $("#HSourceID").val(), |
| | | "HProdOrgID": sessionStorage["OrganizationID"], |
| | | "HEmpID": $("#HEmpID").val(), "HDeptID": $("#HDeptID").val() |
| | | } |
| | | }; |
| | | var sMainStr = JSON.stringify(data.field); |
| | | var HBarCode = $("#HBarCode_SN").val(); |
| | | var sSubStr = JSON.stringify(option.data); |
| | | var sMainSub = sMainStr + ';' + HBarCode + ';' + sSubStr+';' + sessionStorage["HUserName"]; |
| | | var indexs = layer.load(); |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: GetWEBURL() + "/Cj_SingleStation/AddStationOutBillAndAssemblyBill", |
| | | async: false, |
| | | data: { "sMainSub": sMainSub }, |
| | | dataType: "json", |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | layer.close(indexs); |
| | | |
| | | |
| | | $("#HReturnMessage").text("æåè¿ç«æ«ç ä¸ä¸ªäº§å:" + HBarCode); |
| | | //åæ¢äº§å |
| | | set_changeHBarCodeSN(); |
| | | get_Display(); |
| | | } |
| | | else { |
| | | |
| | | layer.close(indexs); |
| | | layer.msg(data1.Message, { icon: 5, btn: ["确认"], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "åºç°é误" }); |
| | | } |
| | | |
| | | }, |
| | | error: function (err) { |
| | | |
| | | layer.close(indexs); |
| | | layer.msg(get_MessageError("é误:" + err, sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 100000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨æç¤º", sessionStorage["HTranSlate"]) }); |
| | | } |
| | | }); |
| | | } |
| | | //#endregion |
| | | |
| | | |
| | | function get_Display(sWhere = '') { |
| | | var ajaxLoad = layer.load(); |
| | | var HProcID = $("#HProcID").val(); |
| | | var HSourceID = $("#HSourceID").val(); |
| | | sWhere += ` and HProcID = ${HProcID} and HSourceID = ${HSourceID}` |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Cj_SingleStation/SingleStationOutBillList', |
| | | async: false, |
| | | type: "GET", |
| | | data: { "sWhere": '', "user": sessionStorage["HUserName"] }, |
| | | data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | var data = [];//ååæ®µæ°æ® |
| | | var col = []; |
| | | var titleData=[] |
| | | var titleData = [] |
| | | var totalArray = ["æ°é", "å
³èæ°é", "æªå
³èæ°é", "æå°æ¡ç æ°é", "æªæå°æ¡ç æ°é", "宿¶æ°é", "éé¢"]; |
| | | //ç»ç©ºçæ°ç»èµå¼ |
| | | for (var key in data1.list) { |
| | |
| | | } |
| | | } |
| | | } |
| | | option.cols = [col] |
| | | option.data = data1.data; |
| | | option2.cols = [col] |
| | | option2.data = data1.data; |
| | | |
| | | |
| | | |
| | | |
| | | //å·æ°è¡¨æ ¼æ°æ® |
| | | DisPlay_HideColumn(HModName, sessionStorage["HUserName"], option, []); |
| | | DisPlay_HideColumn(HModName2, sessionStorage["HUserName"], option2, []); |
| | | |
| | | table.render(option); |
| | | table.render(option2); |
| | | layer.close(ajaxLoad); |
| | | //layer.alert("æ¥è¯¢æå", { icon: 1 }); |
| | | } else { |
| | |
| | | }) |
| | | } |
| | | |
| | | //è¡¨æ ¼è¡å
äºä»¶å é¤ |
| | | function set_GridDelete(obj) { |
| | | var data = obj.data; |
| | | var rowIndex = $(obj.tr).attr("data-index"); |
| | | if (obj.event === 'del') { |
| | | layer.confirm('ççå é¤è¡åï¼', function (index) { |
| | | |
| | | var wait = layer.load(); |
| | | //å é¤ä¸´æ¶è¡¨æ°æ® |
| | | $.ajax({ |
| | | url: GetWEBURL() + 'Deltet_Sc_AssemblyBill_BindBarCodeTemp', |
| | | type: "GET", |
| | | data: { "HBillNo": $("#HBillNo").val(), "HBarCode": option.data[rowIndex].HBarCode, "user": sessionStorage["HUserName"] }, |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | layer.msg(result.Message, { icon: 1, time: 500 }, function () { |
| | | //å
³éå½åframe |
| | | layer.close(wait); |
| | | }); |
| | | } else { |
| | | layer.alert(result.code + result.Message, { icon: 5 }); |
| | | layer.close(wait); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | layer.close(wait); |
| | | } |
| | | }); |
| | | |
| | | |
| | | //å·æ°è¡¨æ ¼æ°æ® |
| | | option.data[rowIndex].HBarCode = ""; |
| | | option.data[rowIndex].HBindingQty = 0; |
| | | //option.data[rowIndex].HMaterID = 0; |
| | | option.data[rowIndex].HMaterNumber = ""; |
| | | option.data[rowIndex].HMaterName = ""; |
| | | option.data[rowIndex].HMaterModel = ""; |
| | | option.data[rowIndex].HBarCode = ""; |
| | | |
| | | table.render(option); |
| | | layer.close(index); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | //é空éªè¯ |
| | | function AllowLoadData() { |
| | | |
| | | var HBarCode = $("#HBarCode_P").val(); |
| | | var HBarCode = $("#HBarCode_SN").val(); |
| | | if (HBarCode == "") { |
| | | layer.msg(get_MessageError("[0000-2-019]产åSNä¸è½ä¸ºç©º!", sessionStorage["HTranSlate"])) |
| | | return false; |
| | | } |
| | | var sSubStr = JSON.stringify(table.cache['mainTable']); |
| | | |
| | | var HEmpID2 = $("#HEmpID2").val(); |
| | | if (HEmpID2 == 0) { |
| | | layer.msg(get_MessageError("[0000-2-030]æä½åä¸è½ä¸ºç©º!", sessionStorage["HTranSlate"])) |
| | | return false; |
| | | if (typeof (sSubStr) != "undefined" && typeof (sSubStr) != "") { |
| | | sSubStr = JSON.parse(sSubStr); |
| | | for (var i = 0; i < sSubStr.length; i++) { |
| | | if (sSubStr[i].HBarCode == "" || sSubStr[i].HBarCode == undefined || sSubStr[i].HBarCode == null) { |
| | | layer.msg("ç»å®ä¿¡æ¯ç¬¬" + (i + 1) + "è¡,é
ä»¶ç æªç»å®!", { icon: 5, btn: ['确认'], time: 4000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | return Result = false; |
| | | } |
| | | } |
| | | } else { |
| | | layer.msg("é
ä»¶ç»å®ä¿¡æ¯ä¸å
许为空!", { icon: 5, btn: ['确认'], time: 4000, offset: 't', skin: 'layui-layer-lan', title: "温馨æç¤º" }); |
| | | return Result = false; |
| | | } |
| | | |
| | | |
| | | //var HBadReasonID = $("#HBadReasonID").val(); |
| | | //if (HBadReasonID == 0) { |
| | |
| | | return true; |
| | | } |
| | | |
| | | //å é¤åæ® |
| | | function btn_Delete() { |
| | | var checkStatus = table.checkStatus('mainTable2') |
| | | , data = checkStatus.data; |
| | | if (checkStatus.data.length === 1) { |
| | | layer.confirm(get_MessageError('[0000-1-003]ç¡®å®å é¤' + data[0].åæ®å· + 'åï¼', sessionStorage["HTranSlate"]), function (index) { |
| | | var ajaxLoad = layer.load(); |
| | | //é»è¾å 餿¹æ³ |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Cj_StationOutBill/del_StationOutBillandAssemblyBill', |
| | | type: "GET", |
| | | data: { "HInterID": data[0].hmainid, "HBarCode_P": data[0].ééSNç , "HDeleteMan": sessionStorage["HUserName"], "HBillSubType": "3791" }, |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | get_Display(); |
| | | layer.close(ajaxLoad); |
| | | } else { |
| | | layer.close(ajaxLoad); |
| | | layer.alert(get_MessageError(result.Message, sessionStorage["HTranSlate"]) + result.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.close(ajaxLoad); |
| | | layer.alert(get_MessageError("[0000-1-002]æ¥å£è¯·æ±å¤±è´¥!", sessionStorage["HTranSlate"]), { icon: 5 }); |
| | | } |
| | | }); |
| | | layer.close(index); |
| | | }); |
| | | } else { |
| | | layer.msg(get_MessageError('[0000-1-001]è¯·éæ©ä¸è¡æ°æ®ç¼è¾ï¼', sessionStorage["HTranSlate"])); |
| | | } |
| | | } |
| | | |
| | | //#endregion |
| | | |
| | | }); |
| | |
| | | <div class="layui-tab-content" style=""> |
| | | <div class="layui-tab-item layui-show"> |
| | | <div class="layui-input-block" style="display: inline-block; margin-left:0px;"> |
| | | <label class="layui-form-label" style="padding-left:0px" id="">éæ±æ°é:</label> |
| | | <input type="text" class="layui-input" name="HNeedQty" lay-verify="HNeedQty" autocomplete="off" id="HNeedQty" value="100" style="width: 100px;float:left"> |
| | | <label class="layui-form-label" style="padding-left:0px" id="">æå¤§ç®±æ°:</label> |
| | | <input type="text" class="layui-input" name="HNeedQty" lay-verify="HNeedQty" autocomplete="off" id="HNeedQty" value="2" style="width: 100px;float:left" readonly> |
| | | |
| | | </div> |
| | | <div class="layui-input-block" style="display: inline-block; margin-left:0px;"> |
| | |
| | | <input type="text" class="layui-input" name="HWeight" lay-verify="HWeight" autocomplete="off" id="HWeight" value="100" style="width: 100px;float:left"> |
| | | |
| | | </div> |
| | | <div class="layui-input-block" style="display: inline-block; margin-left:0px;"> |
| | | <label class="layui-form-label" style="padding-left:0px" id="">æå°éé:</label> |
| | | <input type="text" class="layui-input" name="HWeight" lay-verify="HMinWeight" autocomplete="off" id="HMinWeight" value="0" style="width: 100px;float:left"> |
| | | |
| | | </div> |
| | | <div class="layui-input-block" style="display: inline-block; margin-left:0px;"> |
| | | <label class="layui-form-label" style="padding-left:0px" id="">æå¤§éé:</label> |
| | | <input type="text" class="layui-input" name="HWeight" lay-verify="HMaxWeight" autocomplete="off" id="HMaxWeight" value="101" style="width: 100px;float:left"> |
| | | |
| | | </div> |
| | | <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table> |
| | | |
| | | </div> |
| | | <!--å
¶ä»ä¿¡æ¯--> |
| | | <div class="layui-tab-item"> |
| | | <div class="layui-form-item" style="padding-top: 10px;"> |
| | | |
| | | <div class="layui-row"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;padding: 9px 18px;" id="BT_HProcName">å·¥åº</label> |
| | | <div class="layui-input-block" style="margin-left: 77px;"> |
| | | <input type="text" class="layui-input" name="HProcName" lay-verify="HProcName" id="HProcName" style="background-color: #efefef4d; width: 60%; display: inline-block;" readonly> |
| | | <input type="hidden" name="HProcID" id="HProcID" lay-verify="HProcID" value="0"> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHProc" id="btnHProc" style="padding: 0 10px;float: right;margin-right: 3px;"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px; padding: 9px 18px;" id="BT_HDeptName">å½å车é´</label> |
| | | <div class="layui-input-block" style="margin-left: 77px;"> |
| | | <input type="text" class="layui-input" lay-verify="HDeptName" name="HDeptName" id="HDeptName" style="background-color: #efefef4d; width: 60%; display: inline-block;" readonly> |
| | | <input type="hidden" class="layui-input" lay-verify="HDeptID" name="HDeptID" id="HDeptID"> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHDept" id="btnHDept" style="padding: 0 10px;float: right;margin-right: 3px;"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;padding: 9px 18px;" id="BT_HEmpName">æä½å</label> |
| | | <div class="layui-input-block" style="margin-left: 77px;"> |
| | | <input type="text" class="layui-input" lay-verify="HEmpName" name="HEmpName" id="HEmpName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly> |
| | | <input type="hidden" class="layui-input" lay-verify="HEmpID" name="HEmpID" id="HEmpID" value="0"> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHEmp" id="btnHEmp" style="padding: 0 10px;float: right;margin-right: 3px;"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px; padding: 9px 18px;" id="BT_HGroupName">ç产çç»</label> |
| | | <div class="layui-input-block" style="margin-left: 77px;"> |
| | | <input type="text" class="layui-input" name="HGroupName" id="HGroupName" lay-verify="HGroupName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly> |
| | | <input type="hidden" class="layui-input" name="HGroupID" lay-verify="HGroupID" id="HGroupID" value="0"> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHGroup" id="btnHGroup" style="padding: 0 10px;float: right;margin-right: 3px;"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px; padding: 9px 18px;" id="BT_HSourceName">çäº§èµæº</label> |
| | | <div class="layui-input-block" style="margin-left: 77px;"> |
| | | <input type="text" class="layui-input" name="HSourceName" id="HSourceName" lay-verify="HSourceName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly> |
| | | <input type="hidden" class="layui-input" name="HSourceID" lay-verify="HSourceID" id="HSourceID" value="0"> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHSource" id="btnHSource" style="padding: 0 10px;float: right;margin-right: 3px;"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">å¶å人</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | |
| | | <script type="text/html" id="toolbarDemo"> |
| | | <div class="layui-btn-container"> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete"><i class="layui-icon layui-icon-form"></i>è§£ç»</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn" id="HideColumn"><i class="layui-icon layui-icon-form"></i>å设置</button> |
| | | <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn" id="HideColumn"><i class="layui-icon layui-icon-form"></i>å设置</button>--> |
| | | </div> |
| | | </script> |
| | | <script type="text/html" id="toolbarDemo2"> |
| | | <div class="layui-btn-container"> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete2"><i class="layui-icon layui-icon-form"></i>å é¤</button> |
| | | <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete2"><i class="layui-icon layui-icon-form"></i>å é¤</button>--> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn2" id="HideColumn"><i class="layui-icon layui-icon-form"></i>å设置</button> |
| | | </div> |
| | | </script> |
| | |
| | | </div> |
| | | </body> |
| | | </html> |
| | | <script type="text/html" id="barDemo"> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">å é¤</a> |
| | | </script> |
| | | <script> |
| | | |
| | | layui.config({ |
| | |
| | | |
| | | //å®ä¹å
¨å±åé |
| | | |
| | | var HModName = "Cj_ProcessItemStationPlatform_batch"; |
| | | var HModName2 = "Cj_ProcessItemStationPlatform_batch2"; |
| | | var HModName = "Cj_ProcessItemStationPlatform_CaseCode"; |
| | | var HModName2 = "Cj_ProcessItemStationPlatform_CaseCode2"; |
| | | var option = []; |
| | | var option2 = []; |
| | | var barCodeData = [];//è®°å½SNæ¡ç ä¿¡æ¯ |
| | | //#endregion |
| | | |
| | | //#region è¿å
¥é¡µé¢å³å è½½ |
| | |
| | | //#endregion |
| | | |
| | | //#region 触åäºä»¶ï¼å
æ¬form.on(){}æ ¼å¼çææç¹å»äºä»¶ãéæ©äºä»¶ç |
| | | |
| | | table.on('tool(mainTable)', function (obj) { |
| | | set_GridDelete(obj); //è¡å
å é¤ |
| | | }); |
| | | |
| | | //头工å
·æ äºä»¶ |
| | | table.on('toolbar(mainTable)', function (obj) { |
| | | switch (obj.event) { |
| | | //å é¤æé® |
| | | case 'btn-Delete': set_DeleteBill(); |
| | | case 'btn-Delete': btn_Delete(); |
| | | break; |
| | | //å设置 |
| | | case 'set_HideColumn': get_HideColumnNoPage(HModName, sessionStorage["HUserName"], option, get_Display); |
| | |
| | | break; |
| | | }; |
| | | }); |
| | | //æ¹æ¬¡ç åè½¦æ¹æ³ |
| | | $('#HBarCode_Batch').on('keydown', function (event) { |
| | | var HBarCode = $('#HBarCodeSN').val(); |
| | | var HBardCodeProcExchBillNo = $('#HBardCodeProcExchBillNo').val(); |
| | | if (event.keyCode == 13) { |
| | | if (!HBardCodeProcExchBillNo) { |
| | | layer.msg(get_MessageError("[0000-2-034]请å
æ«æµè½¬å¡ï¼", sessionStorage["HTranSlate"])) |
| | | return; |
| | | } else { |
| | | HBarCode = HBarCode.toUpperCase(); |
| | | if (!HBarCode) { |
| | | layer.msg(get_MessageError("[0000-2-019]æ¡å½¢ç ä¸è½ä¸ºç©ºï¼", sessionStorage["HTranSlate"])) |
| | | return; |
| | | } else { |
| | | if (HBarCode.length != 29 && HBarCode.length != 50) { |
| | | layer.alert(get_MessageError("[3791-2-012]åä»¶æ¡ç é¿åº¦ä¸ä¸º29使50ä½!", sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-035]éåº', sessionStorage["HTranSlate"])], time: 100000, offset: 't' }); |
| | | return; |
| | | } |
| | | |
| | | if (HBarCode.match(/[^\x00-\xff]/g) != null) { |
| | | layer.alert(get_MessageError("[3791-2-013]å¿
é¡»æ¯åè§å符!", sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-035]éåº', sessionStorage["HTranSlate"])], time: 100000, offset: 't' }); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | for (var i = 0; i < option.data.length; i++) { |
| | | if (option.data[i]["HBatchNo"] == "") { |
| | | layer.msg(get_MessageError("[3791-2-014]å½åå·¥åºæ¹æ¬¡ä¸è½ä¸ºç©ºï¼", sessionStorage["HTranSlate"])) |
| | | return; |
| | | } |
| | | } |
| | | txtHBarCode_KeyDown(HBarCode); |
| | | } |
| | | }); |
| | | |
| | | |
| | | //ééç åè½¦æ¹æ³ |
| | | $('#HBarCode_SN').on('keydown', function (event) { |
| | | var HBarCode = $('#HBardCodeProcExchBillNo').val(); |
| | | var HBarCode_SN = $('#HBarCode_SN').val(); |
| | | if (event.keyCode == 13) { |
| | | if (!HBarCode) { |
| | | layer.msg(get_MessageError("[0000-1-057]æµè½¬å¡ä¸è½ä¸ºç©ºï¼", sessionStorage["HTranSlate"])) |
| | | return; |
| | | } |
| | | setIntervalIndex = setInterval(setIntervalList, 30000); |
| | | get_BomList(HBarCode); |
| | | //if (option.data != 0) { |
| | | // //ä¿åå°ä¸´æ¶è¡¨ |
| | | // get_AddBomTempList(); |
| | | //} |
| | | //æ¥è¯¢ä¸è¯è®°å½ |
| | | get_BadRecords(); |
| | | //æ¥è¯¢åæ ¼è®°å½ |
| | | get_HGRecords(); |
| | | |
| | | |
| | | txtHBarCode_KeyDown(HBarCode_SN); |
| | | |
| | | } |
| | | }); |
| | |
| | | Pub_Close(2); |
| | | } |
| | | }); |
| | | |
| | | //åæ´ |
| | | form.on('submit(btnSave)', function (data) { |
| | | set_getCaseCode(); |
| | | }); |
| | | |
| | | //#endregion |
| | | |
| | |
| | | //åå§åçé¢ |
| | | function set_ClearBill() { |
| | | //è¿å
¥é¡µé¢é»è®¤å
æ 卿µè½¬å¡ä¸ |
| | | $("#HBardCodeProcExchBillNo").focus(); |
| | | $("#HBarCode_SN").focus(); |
| | | //å¶å人 |
| | | $("#HMaker").val(sessionStorage["HUserName"]); |
| | | $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd")); |
| | |
| | | //åå§åè¡¨æ ¼ |
| | | set_InitGrid(); |
| | | // |
| | | //get_Display(); |
| | | get_Display(); |
| | | var data = localStorage.getItem("CaseCodeDataCache"); |
| | | if (data != null) { |
| | | |
| | | option.data = JSON.parse(data); |
| | | table.render(option); |
| | | } |
| | | } |
| | | |
| | | //#region éè¿ç»å½ç¨æ·è·åé»è®¤å¼ |
| | |
| | | } |
| | | }) |
| | | } |
| | | //#endregion |
| | | //#endregion |
| | | |
| | | //å
³é®ä»¶æ¸
å |
| | | //å½©çæ¸
å |
| | | function set_InitGrid() { |
| | | option= { |
| | | elem: '#mainTable' |
| | | , toolbar: '#toolbarDemo' |
| | | //, toolbar: '#toolbarDemo' |
| | | , page: false |
| | | , totalRow: true |
| | | , cellMinWidth: 120 |
| | |
| | | , height: 285 |
| | | , limit: 10 |
| | | , cols: [[ |
| | | { type: 'numbers', title: 'åºå·' } |
| | | , { field: 'æ¥æ', title: 'æ¥æ' } |
| | | , { field: 'é
件代ç ', title: 'é
件代ç ' } |
| | | , { field: 'é
ä»¶åç§°', title: 'é
ä»¶åç§°' } |
| | | , { field: 'é
ä»¶è§æ ¼', title: 'é
ä»¶è§æ ¼' } |
| | | , { field: 'é
ä»¶æ°é', title: 'é
ä»¶æ°é', totalRow: true} |
| | | , { field: 'HBatchNo', title: 'å½åæ¹æ¬¡' } |
| | | { type: 'checkbox', fixed: 'left', totalRowText: 'å计' } |
| | | , { type: 'numbers', title: 'åºå·' } |
| | | , { field: 'HItemID', title: 'HItemID', hide: true } |
| | | , { field: 'HBarCode', title: '产åSNç ' } |
| | | , { field: 'HMaterID', title: 'HMaterID', hide: true } |
| | | , { field: 'HMaterNumber', title: 'ç©æä»£ç ' } |
| | | , { field: 'HMaterName', title: 'ç©æåç§°', totalRow: true} |
| | | , { field: 'HMaterModel', title: 'è§æ ¼åå·' } |
| | | , { 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 } |
| | | , { field: 'HICMOBillNo', title: 'ç产订åå·', hide: true } |
| | | , { field: 'HInterID', title: 'HInterID', hide: true } |
| | | , { field: 'HWeight', title: 'éé' } |
| | | , { fixed: 'right', title: 'æä½', toolbar: '#barDemo', width: 66 } |
| | | |
| | | ]] |
| | | } |
| | | option2 = { |
| | |
| | | |
| | | //æ¡ç å车æ¥è¯¢ |
| | | function txtHBarCode_KeyDown(HBarCode) { |
| | | getHBarCodeData(HBarCode); |
| | | //æ¸
空SNééç å
容 |
| | | $("#HBarCode_SN").val(""); |
| | | $("#HBarCode_SN").focus(); |
| | | } |
| | | |
| | | var HProcExchBillNo = $("#HProcExchBillNo").val(); |
| | | var indexs = layer.load(); |
| | | function getHBarCodeData(HBarCode) { |
| | | indexs = layer.load(); |
| | | //è·å对åºä¸»è¡¨ä¿¡æ¯ |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + "/Cj_SingleStation/SNHBardCodeList", |
| | | url: GetWEBURL() + "/Cj_SingleStation/checkHBarCode_Batch", |
| | | async: false, |
| | | data: { "HBarCode": HBarCode, "HProcExchBillNo": HProcExchBillNo, "user": sessionStorage["HUserName"], "HOrgID": sessionStorage["OrganizationID"] }, |
| | | data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"], "HOrgID": sessionStorage["OrganizationID"] }, |
| | | dataType: "json", |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | layer.close(indexs); |
| | | var index = layer.load(); |
| | | |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + "/Cj_SingleStation/HBardCodeSNList", |
| | | async: false, |
| | | data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"] }, |
| | | dataType: "json", |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | layer.close(index); |
| | | $("#HBarCode_P").val(HBarCode); |
| | | if (AllowLoadData()) { |
| | | //ä¿åæ°æ® |
| | | set_AddAssemblyBill(); |
| | | } |
| | | } |
| | | else { |
| | | layer.close(index); |
| | | layer.msg(get_MessageError(data1.Message, sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 100000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨æç¤º", sessionStorage["HTranSlate"]) }); |
| | | } |
| | | $("#HBarCodeSN").val(""); |
| | | }, |
| | | error: function (err) { |
| | | layer.close(index); |
| | | layer.msg(get_MessageError("é误:" + err, sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 100000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨æç¤º", sessionStorage["HTranSlate"]) }); |
| | | } |
| | | }); |
| | | barCodeData = data1.data[0]; |
| | | //$("#HMinWeight").val();è·åæå¤§æ°éæå°ééæå¤§ç®±æ° |
| | | //$("#HMaxWeight").val(); |
| | | //$("#HNeedQty").val(); |
| | | if (AllowLoadData()) { |
| | | set_SaveBill(HBarCode); |
| | | } |
| | | } |
| | | else { |
| | | layer.close(indexs); |
| | | layer.msg(get_MessageError(data1.Message, sessionStorage["HTranSlate"])); |
| | | |
| | | layer.confirm(data1.Message); |
| | | } |
| | | //å
æ 跳转å°SNæ¡ç ææ¬æ¡ä¸ |
| | | //$("#HBarCodeSN").focus(); |
| | | $("#HBarCodeSN").val(""); |
| | | |
| | | }, |
| | | error: function (err) { |
| | | layer.close(indexs); |
| | | |
| | | layer.msg(get_MessageError("é误:" + err, sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 100000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨æç¤º", sessionStorage["HTranSlate"]) }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //å è½½ç½æ ¼ |
| | | function get_Display() { |
| | | var ajaxLoad = layer.load(); |
| | | |
| | | //#region è¿ç«ä¿åæ¹æ³ |
| | | function set_SaveBill(HBarCode) { |
| | | var data = { |
| | | "field": { |
| | | "HProcID": $("#HProcID").val(), "HBatchNo": "", "HWeight": $("#HWeight").val(), |
| | | "HGroupID": $("#HGroupID").val(), "HSourceID": $("#HSourceID").val(), |
| | | "HProdOrgID": sessionStorage["OrganizationID"], |
| | | "HEmpID": $("#HEmpID").val(), "HDeptID": $("#HDeptID").val() |
| | | } |
| | | }; |
| | | var sMainStr = JSON.stringify(data.field); |
| | | var sSubStr = HBarCode; |
| | | var sMainSub = sMainStr + ';' + sSubStr + ';' + sessionStorage["HUserName"]; |
| | | var indexs = layer.load(); |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Cg_POOrderBill/list', |
| | | type: "POST", |
| | | url: GetWEBURL() + "/Cj_SingleStation/AddStationOutBillList", |
| | | async: false, |
| | | data: { "sMainSub": sMainSub }, |
| | | dataType: "json", |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | layer.close(indexs); |
| | | //æ¸
åå
容åå
¥ |
| | | barCodeData.HInterID = data1.data//è·å对åºåºææ±æ¥ä½å
ç |
| | | barCodeData.HWeight = $("#HWeight").val()//éé |
| | | option.data.push(barCodeData); |
| | | table.render(option) |
| | | //æ¬å°åå¨ |
| | | localStorage.setItem("CaseCodeDataCache", JSON.stringify(option.data)); |
| | | |
| | | $("#HReturnMessage").text("æåæ«ç ä¸ä¸ª:" + HBarCode); |
| | | get_Display(); |
| | | } |
| | | else { |
| | | |
| | | layer.close(indexs); |
| | | layer.msg(data1.Message, { icon: 5, btn: ["确认"], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "åºç°é误" }); |
| | | } |
| | | |
| | | }, |
| | | error: function (err) { |
| | | |
| | | layer.close(indexs); |
| | | layer.msg(get_MessageError("é误:" + err, sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 100000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨æç¤º", sessionStorage["HTranSlate"]) }); |
| | | } |
| | | }); |
| | | } |
| | | //#endregion |
| | | |
| | | //#region ä¸ç®±ç çæ |
| | | function set_getCaseCode() { |
| | | const hitmidString = option.data.map(item => item.HItemID).join(","); |
| | | var sMainSub = hitmidString + ';' + sessionStorage["HUserName"]; |
| | | var indexs = layer.load(); |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: GetWEBURL() + "/Cj_SingleStation/AddCaseCode", |
| | | async: false, |
| | | data: { "sMainSub": sMainSub }, |
| | | dataType: "json", |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | layer.close(indexs); |
| | | //æ¸
åå
容åå
¥ |
| | | option.data = []; |
| | | table.render(option) |
| | | //æ¬å°åå¨ |
| | | localStorage.setItem("CaseCodeDataCache", JSON.stringify(option.data)); |
| | | |
| | | $("#HReturnMessage").text("æåçæä¸ä¸ª:" + data1.data); |
| | | get_Display(); |
| | | } |
| | | else { |
| | | |
| | | layer.close(indexs); |
| | | layer.msg(data1.Message, { icon: 5, btn: ["确认"], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "åºç°é误" }); |
| | | } |
| | | |
| | | }, |
| | | error: function (err) { |
| | | |
| | | layer.close(indexs); |
| | | layer.msg(get_MessageError("é误:" + err, sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 100000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨æç¤º", sessionStorage["HTranSlate"]) }); |
| | | } |
| | | }); |
| | | } |
| | | //#endregion |
| | | |
| | | |
| | | //å è½½åå²è¿ç«æ¸
åä¿¡æ¯ |
| | | function get_Display(sWhere = '') { |
| | | var ajaxLoad = layer.load(); |
| | | var HProcID = $("#HProcID").val(); |
| | | var HSourceID = $("#HSourceID").val(); |
| | | sWhere += ` and HProcID = ${HProcID} and HSourceID = ${HSourceID}` |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Cj_SingleStation/SingleStationOutBillList', |
| | | async: false, |
| | | type: "GET", |
| | | data: { "sWhere": '', "user": sessionStorage["HUserName"] }, |
| | | data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | var data = [];//ååæ®µæ°æ® |
| | | var col = []; |
| | | var titleData=[] |
| | | var titleData = [] |
| | | var totalArray = ["æ°é", "å
³èæ°é", "æªå
³èæ°é", "æå°æ¡ç æ°é", "æªæå°æ¡ç æ°é", "宿¶æ°é", "éé¢"]; |
| | | //ç»ç©ºçæ°ç»èµå¼ |
| | | for (var key in data1.list) { |
| | |
| | | } |
| | | } |
| | | } |
| | | option.cols = [col] |
| | | option.data = data1.data; |
| | | option2.cols = [col] |
| | | option2.data = data1.data; |
| | | |
| | | |
| | | |
| | | |
| | | //å·æ°è¡¨æ ¼æ°æ® |
| | | DisPlay_HideColumn(HModName, sessionStorage["HUserName"], option, []); |
| | | DisPlay_HideColumn(HModName2, sessionStorage["HUserName"], option2, []); |
| | | |
| | | table.render(option); |
| | | table.render(option2); |
| | | layer.close(ajaxLoad); |
| | | //layer.alert("æ¥è¯¢æå", { icon: 1 }); |
| | | } else { |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //å é¤åæ® |
| | | function btn_Delete() { |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data; |
| | | if (checkStatus.data.length === 1) { |
| | | layer.confirm(get_MessageError('[0000-1-003]ç¡®å®å é¤' + data[0].HBarCode + 'åï¼', sessionStorage["HTranSlate"]), function (index) { |
| | | var ajaxLoad = layer.load(); |
| | | //é»è¾å 餿¹æ³ |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Cj_StationOutBill/del_StationOutBill', |
| | | type: "GET", |
| | | data: { "HInterID": data[0].HInterID, "HDeleteMan": sessionStorage["HUserName"], "HBillSubType": "3791" }, |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | get_Display(); |
| | | layer.close(ajaxLoad); |
| | | } else { |
| | | layer.close(ajaxLoad); |
| | | layer.alert(get_MessageError(result.Message, sessionStorage["HTranSlate"]) + result.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.close(ajaxLoad); |
| | | layer.alert(get_MessageError("[0000-1-002]æ¥å£è¯·æ±å¤±è´¥!", sessionStorage["HTranSlate"]), { icon: 5 }); |
| | | } |
| | | }); |
| | | layer.close(index); |
| | | }); |
| | | } else { |
| | | layer.msg(get_MessageError('[0000-1-001]è¯·éæ©ä¸è¡æ°æ®ç¼è¾ï¼', sessionStorage["HTranSlate"])); |
| | | } |
| | | } |
| | | |
| | | //è¡¨æ ¼è¡å
äºä»¶å é¤ |
| | | function set_GridDelete(obj) { |
| | | var data = obj.data; |
| | | var rowIndex = $(obj.tr).attr("data-index"); |
| | | if (obj.event === 'del') { |
| | | layer.confirm('ççå é¤è¡åï¼', function (index) { |
| | | |
| | | var wait = layer.load(); |
| | | //é»è¾å 餿¹æ³ |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Cj_StationOutBill/del_StationOutBill', |
| | | type: "GET", |
| | | data: { "HInterID": data.HInterID, "HDeleteMan": sessionStorage["HUserName"], "HBillSubType": "3791" }, |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | // å é¤ id=2 ç对象ï¼Bobï¼ |
| | | debugger |
| | | const index = option.data.findIndex(item => item.HInterID === data.HInterID); |
| | | if (index !== -1) { |
| | | option.data.splice(index, 1); // ä» index å¼å§å é¤ 1 个å
ç´ |
| | | } |
| | | //æ¬å°åå¨ |
| | | localStorage.setItem("CaseCodeDataCache", JSON.stringify(option.data)); |
| | | |
| | | get_Display(); |
| | | table.render(option); |
| | | layer.close(wait); |
| | | } else { |
| | | layer.close(wait); |
| | | layer.alert(get_MessageError(result.Message, sessionStorage["HTranSlate"]) + result.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.close(wait); |
| | | layer.alert(get_MessageError("[0000-1-002]æ¥å£è¯·æ±å¤±è´¥!", sessionStorage["HTranSlate"]), { icon: 5 }); |
| | | } |
| | | }); |
| | | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | //åå·¥éæ©é¡µé¢ |
| | | function btnHEmp() { |
| | |
| | | //é空éªè¯ |
| | | function AllowLoadData() { |
| | | |
| | | var HBarCode = $("#HBarCode_P").val(); |
| | | if (HBarCode == "") { |
| | | layer.msg(get_MessageError("[0000-2-019]产åSNä¸è½ä¸ºç©º!", sessionStorage["HTranSlate"])) |
| | | let HMinWeight = +$("#HMinWeight").val(); |
| | | let HMaxWeight = +$("#HMaxWeight").val(); |
| | | let HWeight = +$("#HWeight").val(); |
| | | //ç¬¬ä¸æ¬¡æ«ééç |
| | | if (option.data.length === 0) { |
| | | if (HWeight < HMinWeight || HWeight > HMaxWeight) { |
| | | layer.confirm("ééæ ¡éªå¤±è´¥") |
| | | return false; |
| | | } |
| | | } else { |
| | | if (HWeight < HMinWeight || HWeight > HMaxWeight) { |
| | | layer.confirm("ééæ ¡éªå¤±è´¥") |
| | | return false; |
| | | } |
| | | if (option.data[0].HMaterID != barCodeData.HMaterID) { |
| | | return false; |
| | | } |
| | | } |
| | | if (option.data.length >= $("#HNeedQty").val()) { |
| | | layer.confirm("ç®±æ°å·²æ»¡è¯·æäº¤") |
| | | return false; |
| | | } |
| | | |
| | | var HEmpID2 = $("#HEmpID2").val(); |
| | | if (HEmpID2 == 0) { |
| | | layer.msg(get_MessageError("[0000-2-030]æä½åä¸è½ä¸ºç©º!", sessionStorage["HTranSlate"])) |
| | | return false; |
| | | } |
| | | |
| | | //var HBadReasonID = $("#HBadReasonID").val(); |
| | | //if (HBadReasonID == 0) { |
| | | // layer.msg("ä¸è¯åå ä¸è½ä¸ºç©º!") |
| | | // return false; |
| | | //} |
| | | |
| | | return true; |
| | | } |
| | | |