| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;"> |
| | | æ±ç |
| | | </label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input class="layui-input" name="HExRate" id="HExRate" autocomplete="off" value="0" 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;"> |
| | |
| | | <div class="layui-input-block" style="margin-left: 120px; width: 501px;" readonly> |
| | | <select name="HTransType" id="HTransType" lay-verify="HTransType" style="background-color:#efefef4d;"> |
| | | <option value="é¶å">é¶å </option> |
| | | <option value="æ´è½¦">æ´è½¦</option> |
| | | <option value="åç¨">åç¨</option> |
| | | <option value="å¾è¿">å¾è¿</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | //è¡å
äºä»¶ |
| | | table.on('edit(mainTable)', function (obj) { |
| | | var field = obj.field; // å¾å°å段 |
| | | var data = obj.data; // å¾å°æå¨è¡ææé®å¼ |
| | | // 妿ç¼è¾çæ¯å®¹å¨å°ºå¯¸ç¸å
³çåæ®µï¼éæ°è®¡ç®æ»ä½ç§¯ |
| | | var field = obj.field; |
| | | var data = obj.data; |
| | | |
| | | if (field === 'HMouldLength' || field === 'HMouldWidth' || field === 'HMouldHeight' || |
| | | field === 'HMouldFoldHeight') { |
| | | field === 'HMouldFoldHeight' || field ==='HMouldQty') { |
| | | var newVolume = calculateRowVolume(data); |
| | | obj.update({ |
| | | HVolume: newVolume |
| | |
| | | calculateTotalVolume(); |
| | | } |
| | | if (field === 'HQty') { |
| | | // ç¡®ä¿è¾å
¥çæ¯æ°å |
| | | |
| | | var newValue = parseFloat(obj.value); |
| | | if (isNaN(newValue)) { |
| | | newValue = 0; |
| | |
| | | HQty: 0 |
| | | }); |
| | | } |
| | | // æ£æ¥æ¯å¦è¶
åºæºåæ°é |
| | | |
| | | checkTotalQtyExceed(); |
| | | |
| | | var mouldQty = calculateMouldQty(data); |
| | |
| | | }); |
| | | } |
| | | if (field === 'HSNP') { |
| | | // ç¡®ä¿è¾å
¥çæ¯æ°å |
| | | |
| | | var newValue = parseFloat(obj.value); |
| | | if (isNaN(newValue) || newValue <= 0) { |
| | | newValue = 1; // é»è®¤å¼è®¾ä¸º1ï¼é¿å
é¤é¶é误 |
| | | newValue = 1; |
| | | obj.update({ |
| | | HSNP: 1 |
| | | }); |
| | | } |
| | | |
| | | // èªå¨è®¡ç®å
è£
容卿°é |
| | | |
| | | var mouldQty = calculateMouldQty(data); |
| | | obj.update({ |
| | | HMouldQty: mouldQty |
| | |
| | | var field = $(this).data('field'); |
| | | laydate.render({ |
| | | elem: this.firstChild |
| | | , show: true //ç´æ¥æ¾ç¤º |
| | | , show: true |
| | | , closeStop: this |
| | | , done: function (nowDate) { |
| | | var index = obj.tr.data('index'); |
| | | //æ¶é´éæ©å®æï¼è¡æ°æ®æ´æ° |
| | | |
| | | data[field] = nowDate; |
| | | obj.update(data); |
| | | $('#HHCalibrationStatus' + (index + 1)).find("option[value='" + data.HHCalibrationStatus + "']").attr("selected", true); |
| | |
| | | var field = $(this).data('field'); |
| | | laydate.render({ |
| | | elem: this.firstChild |
| | | , show: true //ç´æ¥æ¾ç¤º |
| | | , show: true |
| | | , closeStop: this |
| | | , done: function (nowDate) { |
| | | var index = obj.tr.data('index'); |
| | | //æ¶é´éæ©å®æï¼è¡æ°æ®æ´æ° |
| | | |
| | | data[field] = nowDate; |
| | | obj.update(data); |
| | | $('#HHCalibrationStatus' + (index + 1)).find("option[value='" + data.HHCalibrationStatus + "']").attr("selected", true); |
| | |
| | | layer.open({ |
| | | type: 2, |
| | | skin: 'layui-layer-rim', //å ä¸è¾¹æ¡ |
| | | title: 'é¨é¨å表', |
| | | title: 'æ¿è¿åå表', |
| | | closeBtn: 1, |
| | | shift: 2, |
| | | area: ['80%', '80%'], |
| | |
| | | |
| | | //车åå¼¹çª |
| | | form.on('submit(HCarTypeList)', function () { |
| | | var HTotalVolume = $("#HTotalVolume").val() |
| | | //页é¢å±-èªå®ä¹ |
| | | layer.open({ |
| | | type: 2, |
| | | skin: 'layui-layer-rim', //å ä¸è¾¹æ¡ |
| | | title: 'cheå表', |
| | | title: '车åå表', |
| | | closeBtn: 1, |
| | | shift: 2, |
| | | area: ['80%', '80%'], |
| | | maxmin: true, |
| | | content: ['../../åºç¡èµæ/åºç¡èµæ/Gy_CarTypeList.html?', 'yes'], |
| | | content: ['../../åºç¡èµæ/åºç¡èµæ/Gy_CarTypeList.html?openType=' + HTotalVolume+'&HOrgName=' + sessionStorage["OrganizationID"], 'yes'], |
| | | btn: ['ç¡®å®', 'åæ¶'] |
| | | , btn1: function (index, layero) { |
| | | |
| | |
| | | |
| | | //ååå¼¹çª |
| | | form.on('submit(HContractList)', function () { |
| | | var HEndAddr = $("#HEndAddr").val(); |
| | | var HBeginAddr = $("#HBeginAddr").val(); |
| | | |
| | | //页é¢å±-èªå®ä¹ |
| | | layer.open({ |
| | | type: 2, |
| | |
| | | shift: 2, |
| | | area: ['80%', '80%'], |
| | | maxmin: true, |
| | | content: ['../../åºç¡èµæ/å
¬ç¨åºç¡èµæ/Cg_ContractTransportBillList.html?', 'yes'], |
| | | content: ['../../åºç¡èµæ/å
¬ç¨åºç¡èµæ/Cg_ContractTransportBillList.html?openType=' + HEndAddr + '&HOrgName=' + sessionStorage["OrganizationID"] + '&HBeginAddr=' + HBeginAddr, 'yes'], |
| | | btn: ['ç¡®å®', 'åæ¶'] |
| | | , btn1: function (index, layero) { |
| | | |
| | |
| | | $("#HCurID").val(checkStatus.data[0].å¸å«); |
| | | $("#HCurName").val(checkStatus.data[0].å¸å«åç§°); |
| | | $("#HMoney").val(checkStatus.data[0].è¿è¾è´¹ç¨); |
| | | $("#HExRate").val(checkStatus.data[0].æ±ç); |
| | | $("#HCarrierID").val(checkStatus.data[0].HSupID); |
| | | $("#HCarrierName").val(checkStatus.data[0].ä¾åºååç§°); |
| | | layer.close(layer.index); //å®è·åçå§ç»æ¯ææ°å¼¹åºçæä¸ªå±ï¼å¼æ¯ç±layerå
é¨å¨æéå¢è®¡ç®ç |
| | | } |
| | | , btn2: function (index, layero) { |
| | |
| | | var HCusID = $("#HCusID").val();//å¤æå®¢æ· |
| | | if (HCusID == 0 || HCusID == '') { |
| | | HCusID = checkStatus.data[0]["HCusID"]; |
| | | $("#HCusID").val(checkStatus.data[0]["HCusID"]); |
| | | $("#HCusName").val(checkStatus.data[0]["客æ·"]); |
| | | } |
| | | for (var i = 0; i < checkStatus.data.length; i++) { |
| | | if (checkStatus.data[i]["HCusID"] != HCusID) { |
| | |
| | | }) |
| | | } |
| | | //#endregion |
| | | //#region éæ©æºå-åè´§éç¥å |
| | | function setInitBySeOutStockBill(checkStatus) { |
| | | var dataArray = []; |
| | | //#region éæ©æºå |
| | | function get_checkMainSource() { |
| | | var HOrgID = $("#HOrgID").val(); |
| | | var url = "../../éå®ç®¡ç/åè´§éç¥å/Xs_SeOutStockBillList.html?openType=2&HOrgID=" + HOrgID; |
| | | |
| | | layer.open({ |
| | | type: 2//å¼¹çªç±»å |
| | | , skin: 'layui-layer-rim' //å ä¸è¾¹æ¡ |
| | | , area: ['90%', '90%']//å¤§å° |
| | | , title: 'æºåå表'//æ é¢ |
| | | , shift: 2//å¼¹åºå¨ç» |
| | | , content: [url, '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('è¯·éæ©æ°æ®'); |
| | | } |
| | | var HCusID = $("#HCusID").val();//å¤æå®¢æ· |
| | | if (HCusID == 0 || HCusID == '') { |
| | | HCusID = checkStatus.data[0]["HCusID"]; |
| | | $("#HCusID").val(checkStatus.data[0]["HCusID"]); |
| | | $("#HCusName").val(checkStatus.data[0]["客æ·"]); |
| | | } |
| | | for (var i = 0; i < checkStatus.data.length; i++) { |
| | | if (checkStatus.data[i]["HCusID"] != HCusID) { |
| | | layer.msg("䏿¨å¤±è´¥!å·²ç»éä¸çè®°å½ä¸åå¨ä¸å客æ·!"); |
| | | layer.close(index); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | // æ£æ¥æ°éæ©çæºåæ¯å¦å·²ç»å¨å表ä¸åå¨ |
| | | var isDuplicate = checkDuplicateSource(checkStatus.data); |
| | | if (isDuplicate) { |
| | | layer.msg("éæ©çæºåä¸å·²åå¨éå¤è®°å½ï¼è¯·å¿éå¤éæ©ï¼", { icon: 5 }); |
| | | layer.close(index); |
| | | return; |
| | | } |
| | | appendInitBySeOutStockBill(checkStatus); |
| | | layer.close(index); //å®è·åçå§ç»æ¯ææ°å¼¹åºçæä¸ªå±ï¼å¼æ¯ç±layerå
é¨å¨æéå¢è®¡ç®ç |
| | | } |
| | | , btn2: function (index, layero) { } |
| | | }) |
| | | } |
| | | //#endregion |
| | | |
| | | |
| | | |
| | | //#region æ£æ¥æºåæ¯å¦å·²ç»å¨å表ä¸åå¨ |
| | | function checkDuplicateSource(newSourceData) { |
| | | |
| | | var currentTableData = table.cache['mainTable'] || []; |
| | | for (var i = 0; i < newSourceData.length; i++) { |
| | | var newSourceInterID = newSourceData[i].hmainid; |
| | | var newSourceEntryID = newSourceData[i].hsubid; |
| | | for (var j = 0; j < currentTableData.length; j++) { |
| | | var existingSourceInterID = currentTableData[j].HSourceInterID; |
| | | var existingSourceEntryID = currentTableData[j].HSourceEntryID; |
| | | if (existingSourceInterID == newSourceInterID && |
| | | existingSourceEntryID == newSourceEntryID) { |
| | | return true; // åå¨éå¤ |
| | | } |
| | | } |
| | | } |
| | | |
| | | return false; // æ éå¤ |
| | | } |
| | | //#endregion |
| | | |
| | | //#region éæ©æºå-åè´§éç¥å |
| | | function appendInitBySeOutStockBill(checkStatus) { |
| | | var dataArray = []; |
| | | for (var i = 0; i < checkStatus.data.length; i++) { |
| | | var temp = getPushSeOutStockBillInit(checkStatus.data[i].hmainid, checkStatus.data[i].hsubid); |
| | | if (temp != "none") { |
| | | dataArray.push(temp); |
| | | //if (temp.ç¶æ != "å·²å®¡æ ¸") { |
| | | // layer.msg("䏿¨å¤±è´¥!åæ®å·ã" + temp.åæ®å· + "ãåæ®ç¶æä¸ä¸ºå·²å®¡æ ¸ç¶æ!"); |
| | | // return; |
| | | //} |
| | | //if (temp.è¡ç¶æ == "å·²å
³é") { |
| | | // layer.msg("䏿¨å¤±è´¥!åæ®å·ã" + temp.åæ®å· + "ãä¸éä¸çè®°å½ä¸åå¨å·²å
³éç¶æçè®°å½!"); |
| | | // return; |
| | | //} |
| | | //if (temp.å
³é人 != "") { |
| | | // layer.msg("䏿¨å¤±è´¥!åæ®å·ã" + temp.åæ®å· + "ãä¸éä¸çè®°å½ä¸åå¨å·²å
³éç¶æçè®°å½!"); |
| | | // return; |
| | | //} |
| | | |
| | | |
| | | } else { |
| | | return; |
| | | } |
| | | } |
| | | var ListMaterial = dataArray[0].HMaterID; |
| | | for (var i = 1; i < dataArray.length; i++) { |
| | | ListMaterial = ListMaterial + ";" + dataArray[i].HMaterID; |
| | | |
| | | var existingData = table.cache['mainTable'] || []; |
| | | var orginHQTY = 0; |
| | | var materialMap = {}; |
| | | for (var i = 0; i < dataArray.length; i++) { |
| | | orginHQTY = dataArray[i].æ°é; |
| | | var materialId = dataArray[i].HMaterID; |
| | | if (!materialMap[materialId]) { |
| | | materialMap[materialId] = []; |
| | | } |
| | | materialMap[materialId].push({ |
| | | hmainid: dataArray[i].hmainid, |
| | | hsubid: dataArray[i].hsubid, |
| | | åæ®å·: dataArray[i].åæ®å· |
| | | }); |
| | | } |
| | | var ListMaterial = ""; |
| | | for (var materialId in materialMap) { |
| | | if (ListMaterial) ListMaterial += ";"; |
| | | ListMaterial += materialId; |
| | | } |
| | | |
| | | if (!ListMaterial) { |
| | | layer.msg("æ²¡ææ¾å°ç©æä¿¡æ¯ï¼"); |
| | | return; |
| | | } |
| | | |
| | | $.ajax({ |
| | | url: GetWEBURL() + "/WLYayBillController/GetMesByOrginBill", |
| | | async: false, |
| | |
| | | "ListMaterial": ListMaterial |
| | | }, |
| | | success: function (result) { |
| | | if (result.code == 1) { // 说æéªè¯æåäºï¼ |
| | | if (result.code == 1) { |
| | | res = result.data; |
| | | var rowdata = []; |
| | | for (var i = 0; i < res.length; i++) { |
| | | for (var j = 0; j < dataArray.length; j++) { |
| | | var qty = res[i].HSNP || 0; |
| | | var snp = res[i].HSNP || 1; // é»è®¤æ åå
è£
æ°é为1 |
| | | var mouldQty = snp > 0 ? Math.ceil(qty / snp) : 0; |
| | | |
| | | var length = parseFloat(res[i].é¿åº¦) || 0; |
| | | var width = parseFloat(res[i].宽度) || 0; |
| | | var height = parseFloat(res[i].é«åº¦) || 0; |
| | | var rowVolume = (length * width * height).toFixed(2); |
| | | rowdata.push( |
| | | { |
| | | "HSourceInterID": dataArray[j].hmainid, "HSourceEntryID": dataArray[j].hsubid, "HSourceBillNo": dataArray[j].åæ®å·, "HMaterID": res[i].HMaterID, "HMaterNumber": res[i].ç©æä»£ç , "HMaterName": res[i].ç©æåç§°, |
| | | "HUnitID": res[i].HUnitID, "HMouldID": res[i].HMouldID, "HMouldNumber": res[i].HMouldNumber, "HMouldName": res[i].HMouldName, |
| | | "HMouldLength": res[i].é¿åº¦, "HMouldWidth": res[i].宽度, "HMouldHeight": res[i].é«åº¦, "HMouldFoldHeight": res[i].æå é«åº¦, "HQty": res[i].HSNP, "HQty_origin": res[i].HSNP, "HMouldQty": mouldQty, "HVolume": rowVolume |
| | | } |
| | | ) |
| | | var newRows = []; |
| | | for (var materialId in materialMap) { |
| | | var sourceInfos = materialMap[materialId]; |
| | | var materialInfo = null; |
| | | for (var i = 0; i < res.length; i++) { |
| | | if (res[i].HMaterID == materialId) { |
| | | materialInfo = res[i]; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | if (materialInfo) { |
| | | for (var j = 0; j < sourceInfos.length; j++) { |
| | | var sourceInfo = sourceInfos[j]; |
| | | var isExist = false; |
| | | for (var k = 0; k < existingData.length; k++) { |
| | | if (existingData[k].HSourceInterID == sourceInfo.hmainid && |
| | | existingData[k].HSourceEntryID == sourceInfo.hsubid) { |
| | | isExist = true; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (isExist) { |
| | | layer.msg(`æºå${sourceInfo.åæ®å·}å·²åå¨ï¼è·³è¿`); |
| | | continue; |
| | | } |
| | | |
| | | // 计ç®ç¸å
³æ°é |
| | | var qty = materialInfo.HSNP || 0; |
| | | var snp = materialInfo.HSNP || 1; |
| | | var mouldQty = snp > 0 ? Math.ceil(qty / snp) : 0; |
| | | |
| | | var length = parseFloat(materialInfo.é¿åº¦) || 0; |
| | | var width = parseFloat(materialInfo.宽度) || 0; |
| | | var height = parseFloat(materialInfo.é«åº¦) || 0; |
| | | var rowVolume = (length * width * height * mouldQty).toFixed(2); |
| | | |
| | | newRows.push({ |
| | | "HSourceInterID": sourceInfo.hmainid, |
| | | "HSourceEntryID": sourceInfo.hsubid, |
| | | "HSourceBillNo": sourceInfo.åæ®å·, |
| | | "HMaterID": materialInfo.HMaterID, |
| | | "HMaterNumber": materialInfo.ç©æä»£ç , |
| | | "HMaterName": materialInfo.ç©æåç§°, |
| | | "HUnitID": materialInfo.HUnitID, |
| | | "HMouldID": materialInfo.HMouldID, |
| | | "HMouldNumber": materialInfo.HMouldNumber, |
| | | "HMouldName": materialInfo.HMouldName, |
| | | "HMouldLength": materialInfo.é¿åº¦, |
| | | "HMouldWidth": materialInfo.宽度, |
| | | "HMouldHeight": materialInfo.é«åº¦, |
| | | "HMouldFoldHeight": materialInfo.æå é«åº¦, |
| | | "HQty": orginHQTY, |
| | | "HQty_origin": orginHQTY, |
| | | "HMouldQty": mouldQty, |
| | | "HVolume": rowVolume, |
| | | "HSNP": materialInfo.HSNP |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | //å表 èµå¼ |
| | | option.data = rowdata; |
| | | |
| | | if (newRows.length === 0) { |
| | | layer.msg("没æå¯æ·»å çæ°è®°å½ï¼"); |
| | | return; |
| | | } |
| | | |
| | | |
| | | var allData = existingData.concat(newRows); |
| | | |
| | | |
| | | option.data = allData; |
| | | table.render(option); |
| | | |
| | | setTimeout(function () { |
| | | calculateTotalVolume(); |
| | | }, 100); |
| | | |
| | | layer.msg(`æåæ·»å ${newRows.length}æ¡è®°å½`, { icon: 1 }); |
| | | } else { |
| | | res = result.data; |
| | | //layer.alert(result.msg, { icon: 5, btn: ['éåº'], time: 100000, offset: 't' }); |
| | | layer.alert(result.msg, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | res = "none"; |
| | | layer.alert("åçé误!", { icon: 5 }); |
| | | }, |
| | | error: function () { |
| | | layer.alert("æ²¡ææ¾å°å¯¹åºçå
è£
容å¨å
³èä¿¡æ¯ï¼è¯·æ£æ¥æ¯å¦ç»´æ¤å¹¶å®¡æ ¸!", { icon: 5 }); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | //#endregion |
| | | |
| | | //#region æ ¹æ®åè´§éç¥åçç©æä¿¡æ¯æ¾å
è£
容å¨è¡¨èµç»å表 |
| | | function getMesByVolumn() { |
| | | var res = "none"; |
| | |
| | | var tableData = table.cache['mainTable']; |
| | | if (!tableData || tableData.length === 0) return; |
| | | |
| | | // ææºååç»è®¡ç®ç©ææ°éä¹å |
| | | var sourceQtyMap = {}; // å卿ºåæ°é |
| | | var currentQtyMap = {}; // åå¨å½åç©ææ°éä¹å |
| | | |
| | | var sourceQtyMap = {}; |
| | | var currentQtyMap = {}; |
| | | |
| | | // å
æ¶éæºåæ°é |
| | | |
| | | tableData.forEach(function (row) { |
| | | if (row.HSourceInterID && row.HSourceEntryID) { |
| | | var key = row.HSourceInterID + '_' + row.HSourceEntryID; |
| | |
| | | } |
| | | }); |
| | | |
| | | // 计ç®å½åç©ææ°éä¹å |
| | | |
| | | tableData.forEach(function (row) { |
| | | if (row.HSourceInterID && row.HSourceEntryID) { |
| | | var key = row.HSourceInterID + '_' + row.HSourceEntryID; |
| | |
| | | var currentTotal = currentQtyMap[key] || 0; |
| | | |
| | | if (currentTotal > sourceQty) { |
| | | // æ¾åºå¯¹åºçæºåä¿¡æ¯ |
| | | |
| | | var sourceBillNo = ''; |
| | | tableData.some(function (row) { |
| | | if (row.HSourceInterID + '_' + row.HSourceEntryID === key) { |
| | |
| | | } |
| | | } |
| | | |
| | | // 妿æè¶
åºï¼æ¾ç¤ºæé |
| | | |
| | | if (exceedSources.length > 0) { |
| | | var message = 'ç©ææ°éä¹åè¶
è¿æºåæ°éï¼<br>'; |
| | | exceedSources.forEach(function (item, index) { |
| | |
| | | |
| | | //ä¿å |
| | | form.on('submit(Saver)', function (data) { |
| | | |
| | | var loadingRate = data.field.HLoadingRate; |
| | | if (loadingRate && typeof loadingRate === 'string') { |
| | | data.field.HLoadingRate = parseFloat(loadingRate.replace('%', '')) / 100; |
| | | } |
| | | var sMainStr = JSON.stringify(data.field); |
| | | var sSubStr = JSON.stringify(table.cache['mainTable']); |
| | | var sMainSub = sMainStr + ';' + sSubStr + ";" + sessionStorage["HUserName"]; |
| | |
| | | , { templet: '#xuhao', title: 'åºå·', sort: true, fixed: 'left', event: "qwe", style: unEditableColStyle } |
| | | , { field: 'HSourceInterID', title: 'HSourceInterID', edit: 'text', hide: true } |
| | | , { field: 'HSourceEntryID', title: 'HSourceEntryID', edit: 'text', hide: true } |
| | | , { field: 'HSourceBillNo', title: 'æºååæ®å·', edit: 'text' } |
| | | , { field: 'HSourceBillNo', title: 'æºååæ®å·' } |
| | | , { field: 'HMaterID', title: 'HMaterID', edit: 'text', hide: true } |
| | | , { field: 'HMaterNumber', title: 'ç©æä»£ç ', edit: 'text', event: "HInspectInstruMentID" } |
| | | , { field: 'HMaterNumber', title: 'ç©æä»£ç ' } |
| | | , { field: 'HMaterName', title: 'ç©æåç§°', style: unEditableColStyle } |
| | | , { field: 'HnitID', title: 'åä½ID', edit: 'text', hide: true } |
| | | , { field: 'HMouldID', title: 'HMouldID', hide: true } |
| | | , { field: 'HMouldNumber', title: 'å¨å
·ä»£ç ', event: 'HMouldNumber' } |
| | | , { field: 'HMouldNumber', title: 'å¨å
·ä»£ç ', edit: 'text',event: 'HMouldNumber' } |
| | | , { field: 'HMouldName', title: 'å¨å
·åç§°' } |
| | | , { field: 'HMouldLength', title: '容å¨é¿åº¦', edit: 'text'} |
| | | , { field: 'HMouldWidth', title: '容å¨å®½åº¦', edit: 'text'} |
| | | , { field: 'HMouldHeight', title: '容å¨é«åº¦', edit: 'text'} |
| | | , { field: 'HMouldFoldHeight', title: 'æå é«åº¦', edit: 'text'} |
| | | , { field: 'HSNP', title: 'æ åå
è£
æ°é', edit: 'text'} |
| | | , { field: 'HMouldLength', title: '容å¨é¿åº¦'} |
| | | , { field: 'HMouldWidth', title: '容å¨å®½åº¦'} |
| | | , { field: 'HMouldHeight', title: '容å¨é«åº¦'} |
| | | , { field: 'HMouldFoldHeight', title: 'æå é«åº¦'} |
| | | , { field: 'HSNP', title: 'æ åå
è£
æ°é'} |
| | | , { field: 'HMouldQty', title: 'å
è£
容卿°é', edit: 'text'} |
| | | , { field: 'HQty', title: 'ç©ææ°é', edit: 'text'} |
| | | , { field: 'HVolume', title: 'ä½ç§¯'} |
| | | , { field: 'HScatteredVolume', title: 'é¶åå ç¨ä½ç§¯', edit: 'text'} |
| | | , { field: 'HQty_origin', title: 'æºåæ°é', hide: true} |
| | | , { fixed: 'right', title: 'æä½', toolbar: '#barDemo', width: 150 } |
| | | ]; |
| | |
| | | var length = parseFloat(row.HMouldLength) || 0; |
| | | var width = parseFloat(row.HMouldWidth) || 0; |
| | | var height = parseFloat(row.HMouldHeight) || 0; |
| | | |
| | | var HMouldQty = (row.HMouldQty) || 0; |
| | | // 计ç®ä½ç§¯ï¼é¿ * 宽 * é« |
| | | var volume = length * width * height; |
| | | var volume = length * width * height * HMouldQty; |
| | | |
| | | // ä¿ç两ä½å°æ° |
| | | return volume.toFixed(2); |
| | |
| | | |
| | | //è·åæå¤§åæ®å· |
| | | get_MAXNum(); |
| | | option.data = [{ "HInspectInstruMentID": 0, "HInspectInstruMentNumber": "", "HInspectInstruMentName": " ", "HBeginDate": Format(new Date(), 'yyyy-MM-dd'), "HEndDate": Format(new Date(), 'yyyy-MM-dd'), "HHCalibrationStatus": "åæ ¼" }]; |
| | | //option.data = [{ "HInspectInstruMentID": 0, "HInspectInstruMentNumber": "", "HInspectInstruMentName": " ", "HBeginDate": Format(new Date(), 'yyyy-MM-dd'), "HEndDate": Format(new Date(), 'yyyy-MM-dd'), "HHCalibrationStatus": "åæ ¼" }]; |
| | | option.data = []; |
| | | table.render(option); |
| | | } |
| | | //è·åæå¤§åæ®å·åé»è®¤å¼èµå¼ |
| | |
| | | { |
| | | "HSourceInterID": tableSub[i].æºå主å
ç , "HSourceEntryID": tableSub[i].æºååå
ç , "HSourceBillNo": tableSub[i].æºååæ®,"HMaterID": tableSub[i].HMaterID, "HMaterNumber": tableSub[i].ç©æä»£ç , "HMaterName": tableSub[i].ç©æåç§°, |
| | | "HUnitID": tableSub[i].HUnitID, "HMouldID": tableSub[i].HMouldID, "HMouldNumber": tableSub[i].å¨å
·å·, "HMouldName": tableSub[i].å¨å
·åç§°, |
| | | "HMouldLength": tableSub[i].容å¨é¿åº¦, "HMouldWidth": tableSub[i].容å¨å®½åº¦, "HMouldHeight": tableSub[i].容å¨é«åº¦, "HMouldFoldHeight": tableSub[i].容卿å é«åº¦, "HSNP": tableSub[i].æ åå
è£
æ°é, "HMouldQty": tableSub[i].å
è£
容卿°é, "HQty": tableSub[i].ç©ææ°é, "HQty_origin": tableSub[i].HQty, "HVolume": rowVolume |
| | | "HMouldLength": tableSub[i].容å¨é¿åº¦, "HMouldWidth": tableSub[i].容å¨å®½åº¦, "HMouldHeight": tableSub[i].容å¨é«åº¦, "HMouldFoldHeight": tableSub[i].容卿å é«åº¦, "HSNP": tableSub[i].æ åå
è£
æ°é, "HMouldQty": tableSub[i].å
è£
容卿°é, "HQty": tableSub[i].ç©ææ°é, "HQty_origin": tableSub[i].HQty, "HVolume": rowVolume, "HScatteredVolume": tableSub[i].é¶åå ç¨ä½ç§¯ |
| | | } |
| | | ) |
| | | } |
| | |
| | | var length = parseFloat(row.HMouldLength) || 0; |
| | | var width = parseFloat(row.HMouldWidth) || 0; |
| | | var height = parseFloat(row.HMouldHeight) || 0; |
| | | var HMouldQty = (row.HMouldQty) || 0; |
| | | |
| | | // 计ç®åä¸ªç©æçä½ç§¯ |
| | | var volume = length * width * height; |
| | | var volume = length * width * height * HMouldQty; |
| | | totalVolume += volume; |
| | | } |
| | | } |
| | |
| | | var maxVolume = parseFloat($('#HCarTypeMaxVolume').val()) || 0; |
| | | if (maxVolume > 0) { |
| | | var loadingRate = (totalVolume / maxVolume * 100).toFixed(2); |
| | | $('#HLoadingRate').val(loadingRate); |
| | | $('#HLoadingRate').val(loadingRate+"%"); |
| | | } else { |
| | | $('#HLoadingRate').val(''); |
| | | } |
| | |
| | | function set_GridCellCheck(obj) { |
| | | $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) { |
| | | if (event.key == "F7") { |
| | | if (obj.event === 'HInspectInstruMentID') // |
| | | if (obj.event === 'HMouldNumber') // |
| | | { |
| | | var currentRowData = obj.data; |
| | | var MaterID = currentRowData.HMaterID || 0; |
| | | //页é¢å±-èªå®ä¹ |
| | | layer.open({ |
| | | type: 2, |
| | | skin: 'layui-layer-rim', //å ä¸è¾¹æ¡ |
| | | title: 'ç©æå表', |
| | | title: 'å
è£
容å¨å表', |
| | | closeBtn: 1, |
| | | shift: 2, |
| | | area: ['80%', '80%'], |
| | | maxmin: true, |
| | | content: ['../../åºç¡èµæ/å
¬ç¨åºç¡èµæ/Gy_Material.html?openType=2', 'yes'], |
| | | content: ['../../åºç¡èµæ/å
¬ç¨åºç¡èµæ/Gy_MaterialPackingRelationList.html?openType=' + MaterID + '&OrgID=' + sessionStorage["OrganizationID"], 'yes'], |
| | | btn: ['ç¡®å®', 'åæ¶'], |
| | | btn1: function (index, layero) { |
| | | |
| | | //æé®ãæé®ä¸ãçåè° |
| | | var iframeWindow = window['layui-layer-iframe' + index] //è·åå¼¹æ¡é¡µé¢ |
| | | var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//è·åtableçelem:"#test" |
| | | var iframeWindow = window['layui-layer-iframe' + index]; |
| | | if (!iframeWindow) return layer.msg('æ æ³è·åå¼¹çªæ°æ®'); |
| | | var checkStatus = iframeWindow.layui.table.checkStatus('mainTable'); |
| | | if (checkStatus.data.length === 0) { |
| | | return layer.msg('è¯·éæ©æ°æ®'); |
| | | } |
| | | else if (checkStatus.data.length === 1) { |
| | | //åæ¥æ´æ°è¡¨æ ¼åç¼å对åºçå¼ |
| | | obj.update({ |
| | | HMaterID: checkStatus.data[0].HItemID, |
| | | HMaterNumber: checkStatus.data[0].ç©æä»£ç , |
| | | HMaterName: checkStatus.data[0].ç©æåç§°, |
| | | HMouldID: checkStatus.data[0].HMouldID, |
| | | HMouldNumber: checkStatus.data[0].容å¨ä»£ç , |
| | | HMouldName: checkStatus.data[0].容å¨åç§°, |
| | | HMouldLength: checkStatus.data[0].é¿åº¦, |
| | | HMouldWidth: checkStatus.data[0].宽度, |
| | | HMouldFoldHeight: checkStatus.data[0].æå é«åº¦, |
| | | }); |
| | | } else { |
| | | |
| | |
| | | var tableBak = table.cache["mainTable"]; //è·åä¹åç¼è¾è¿çè¡¨æ ¼æ°æ® |
| | | buttonArr = [];//æ¸
空æ°ç» |
| | | for (var i = 0; i < tableBak.length; i++) { |
| | | if (tableBak[i]["HInspectInstruMentID"] != 0 && tableBak[i]["HInspectInstruMentID"] != "" && tableBak[i]["HInspectInstruMentID"] != undefined && tableBak[i]["HInspectInstruMentID"] != null) { |
| | | if (tableBak[i]["HMouldID"] != 0 && tableBak[i]["HMouldID"] != "" && tableBak[i]["HMouldID"] != undefined && tableBak[i]["HMouldID"] != null) { |
| | | buttonArr.push(tableBak[i]); //妿å
³é®å段ä¸ä¸ºç©ºï¼åå°ä¹åçæ°æ®åå¨ |
| | | } |
| | | } |
| | | //å°æ¹ééæ©çæ°æ®åå
¥æ°ç»ï¼å¤éè¡ï¼ |
| | | for (var i = 0; i < checkStatus.data.length; i++) { |
| | | buttonArr.push({ |
| | | "HInspectInstruMentID": checkStatus.data[i].hmainid, |
| | | "HInspectInstruMentNumber": checkStatus.data[i].模å
·ç¼å·, |
| | | "HInspectInstruMentName": checkStatus.data[i].模å
·åç§°, |
| | | "HBeginDate": Format(new Date(), 'yyyy-MM-dd'), |
| | | "HEndDate": Format(new Date(), 'yyyy-MM-dd'), |
| | | "HHCalibrationStatus": "åæ ¼" |
| | | "HMouldID": checkStatus.data[i].HMouldID, |
| | | "HMouldNumber": checkStatus.data[i].容å¨ä»£ç , |
| | | "HMouldName": checkStatus.data[i].容å¨åç§°, |
| | | "HMouldHeight": checkStatus.data[i].é«åº¦, |
| | | "HMouldLength": checkStatus.data[i].é¿åº¦, |
| | | "HMouldWidth": checkStatus.data[i].宽度, |
| | | "HMouldFoldHeight": checkStatus.data[i].æå é«åº¦, |
| | | }); |
| | | } |
| | | option.data = buttonArr; |
| | | table.render(option); |
| | | for (var i = 0; i < option.data.length; i++) { |
| | | $('#HHCalibrationStatus' + (i + 1)).find("option[value='" + option.data[i].HHCalibrationStatus + "']").attr("selected", true); |
| | | } |
| | | form.render('select'); |
| | | } |
| | | layer.close(layer.index); //å®è·åçå§ç»æ¯ææ°å¼¹åºçæä¸ªå±ï¼å¼æ¯ç±layerå
é¨å¨æéå¢è®¡ç®ç |
| | | } |
| | |
| | | end: function () { |
| | | if (isEmpty(optionData) === false) { |
| | | obj.update({ |
| | | HInspectInstruMentID: optionData[0].hmainid, |
| | | HInspectInstruMentNumber: optionData[0].模å
·ç¼å·, |
| | | HInspectInstruMentName: optionData[0].模å
·åç§°, |
| | | HMouldID: optionData[0].HMouldID, |
| | | HMouldNumber: optionData[0].容å¨ä»£ç , |
| | | HMouldName: optionData[0].容å¨åç§°, |
| | | HMouldLength: checkStatus.data[0].é¿åº¦, |
| | | HMouldWidth: checkStatus.data[0].宽度, |
| | | HMouldFoldHeight: checkStatus.data[0].æå é«åº¦, |
| | | }) |
| | | optionData = [] |
| | | } |