| | |
| | | <input type="text" class="layui-input" name="HBarCode_BatchSec" lay-verify="HBarCode_BatchSec" id="HBarCode_BatchSec" style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-inline" style="display: none"> |
| | | <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="HCheckDate" lay-verify="HCheckDate" id="HCheckDate" style="background-color:#efefef4d;"placeholder="请è¾å
¥å¹´ææ ¼å¼å¦2501ï¼å
±åä½å两ä½ä»£è¡¨å¹´ä»½å两ä½ä»£è¡¨æä»½ï¼"> |
| | | </div> |
| | | </div> |
| | | <!--<div class="layui-inline"> |
| | |
| | | var HModName2 = "Cj_ProcessItemStationPlatform_batchKeyElement2"; |
| | | var option = []; |
| | | var option2 = []; |
| | | var previousHBarCode = ""; |
| | | //#endregion |
| | | |
| | | //#region è¿å
¥é¡µé¢å³å è½½ |
| | |
| | | $("#HBarCode_Batch").focus(); |
| | | return |
| | | } |
| | | if (!checkHSNAndDate(HBarCode_SN)) { |
| | | return |
| | | } |
| | | if (HBarCode_SN) { |
| | | createBillNo(); |
| | | txtHBarCodeSN_KeyDown(HBarCode_SN); |
| | |
| | | $("#HBarCode_SN").focus(); |
| | | return |
| | | } |
| | | if ($("#HBarCode_SN").val().substring(0, 5) == "51510" || $("#HBarCode_SN").val().substring(0, 5) == "77217") { |
| | | var sql = "exec h_p_Cj_BlueToothBarCodeSave '" + $("#HBarCode_Key").val() + "'," + option.data[0].HMaterID + "," + "100004" + ",'" + sessionStorage["HUserName"] + "'"; |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + "/Gy_SOPBillList/UpDelSQL", //æ¹æ³æå¨é¡µé¢åæ¹æ³å |
| | | async: false, |
| | | data: { "sWhere": sql }, |
| | | success: function (result) { |
| | | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (HBarCode_Key) { |
| | | txtHBarCodeKey_KeyDown(HBarCode_Key); |
| | | } |
| | |
| | | }); |
| | | //æ¢äº§å |
| | | 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); |
| | | } |
| | | $("#HBarCode_SN").val(""); |
| | | $("#HBarCode_Key").val(""); |
| | | option.data = []; |
| | | table.render(option); |
| | | |
| | | |
| | | //å¯ç¨è¾å
¥æ¡,èæ¯è²æ¢å¤ |
| | | $("#HBarCode_SN").prop("readonly", false); |
| | | $("#HBarCode_SN").css('background', '#FFFFFF')//产åç ææ¬æ¡èæ¯è²æ¢å¤ |
| | | $("#HBarCode_SN").focus(); |
| | | |
| | | //éæ°è·ååæ®å· |
| | | //$.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(); |
| | | }); |
| | | |
| | | |
| | |
| | | dataType: "json", |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | layer.close(indexs); |
| | | var data = data1.data |
| | | |
| | | for (var i = 0; i < option.data.length; i++) { |
| | |
| | | if (AllowLoadData(data)) { |
| | | set_SaveBill(data); |
| | | } |
| | | } |
| | | |
| | | layer.close(indexs); |
| | | } |
| | | } |
| | | else { |
| | | layer.close(indexs); |
| | |
| | | "field": { |
| | | "HProcID": $("#HProcID").val(), "HBatchNo": $("#HBarCode_Batch").val(), |
| | | "HGroupID": $("#HGroupID").val(), "HSourceID": $("#HSourceID").val(), |
| | | "HProdOrgID": sessionStorage["OrganizationID"], |
| | | "HPRDOrgID": sessionStorage["OrganizationID"], |
| | | "HEmpID": $("#HEmpID").val(), "HDeptID": $("#HDeptID").val() |
| | | } |
| | | }; |
| | |
| | | } |
| | | //#endregion |
| | | |
| | | //æ ¡éª äº§ååå¹´æ |
| | | function checkHSNAndDate(HBarCode) { |
| | | // 1. æ ¡éªHBarCodeé¿åº¦ |
| | | if (!HBarCode || HBarCode.length < 20) { |
| | | layer.confirm("HBarCodeé¿åº¦ä¸è¶³20ä½"); |
| | | return false; |
| | | } |
| | | |
| | | // 2. è§£æHBarCodeçå¹´ææ¥ |
| | | const yearLastDigit = HBarCode[12]; // 第13ä½ï¼ç´¢å¼12ï¼ï¼å¹´ä»½æåä¸ä½ |
| | | const monthCode = HBarCode[13].toUpperCase(); // 第14ä½ï¼æä»½ï¼N-Zï¼ |
| | | |
| | | |
| | | // 计ç®å¹´ä»½ï¼å设å½åä¸çºªï¼å¦2020-2029ï¼ |
| | | |
| | | const year = yearLastDigit; |
| | | |
| | | // è®¡ç®æä»½ï¼N=1, ..., Z=12ï¼ |
| | | const validChars = "NPQRSTUVWXYZ"; |
| | | if (!validChars.includes(monthCode)) { |
| | | layer.confirm("å符å¿
é¡»æ¯ N, P-Z ä¹ä¸ï¼è·³è¿ Oï¼"); |
| | | return false; |
| | | } |
| | | |
| | | // è®¡ç®æä»½ï¼N=1, P=2, ..., Z=12 |
| | | const month = validChars.indexOf(monthCode) + 1; |
| | | |
| | | |
| | | // 3. è·åè¾å
¥æ¡çå¹´æï¼æ ¼å¼NNMMï¼å¦2307表示2023å¹´7æï¼ |
| | | const checkDateInput = document.getElementById("HCheckDate"); |
| | | if (!checkDateInput) { |
| | | layer.confirm("æ¾ä¸å°HCheckDateè¾å
¥æ¡"); |
| | | return false; |
| | | } |
| | | const inputValue = checkDateInput.value.trim(); |
| | | if (!/^\d{4}$/.test(inputValue)) { |
| | | layer.confirm("è¾å
¥æ¡æ ¼å¼é误ï¼å¿
é¡»æ¯NNMMï¼å¦2307ï¼"); |
| | | return false; |
| | | } |
| | | const inputYear = inputValue.substring(1, 2); // NNï¼å¦23ï¼ |
| | | const inputMonth = parseInt(inputValue.substring(2, 4), 10); // MMï¼å¦07ï¼ |
| | | |
| | | // 4. æ ¡éªå¹´ææ¯å¦ä¸è´ |
| | | if (year !== inputYear || month !== inputMonth) { |
| | | layer.confirm( |
| | | `å¹´æä¸å¹é
ï¼HBarCode=${year}å¹´${month}æï¼è¾å
¥æ¡=${inputYear}å¹´${inputMonth}æ` |
| | | ); |
| | | return false; |
| | | } |
| | | |
| | | // 5. æ ¡éªåäºä½æ¯å¦ä¸ä¸ä¸æ¬¡ä¸è´ |
| | | const currentFirstFive = HBarCode.substring(0, 5); |
| | | if (previousHBarCode) { |
| | | const previousFirstFive = previousHBarCode.substring(0, 5); |
| | | if (currentFirstFive !== previousFirstFive) { |
| | | layer.confirm( |
| | | `åäºä½ä¸ä¸è´ï¼å½å=${currentFirstFive}ï¼ä¸ä¸æ¬¡=${previousFirstFive}` |
| | | ); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | // 6. æ´æ°ä¸ä¸æ¬¡çHBarCode |
| | | previousHBarCode = HBarCode; |
| | | $("#HCheckDate").prop("readonly", true); |
| | | console.log("æ ¡éªéè¿"); |
| | | return true; |
| | | } |
| | | |
| | | function get_Display(sWhere = '') { |
| | | var ajaxLoad = layer.load(); |