// 数组根据key取值 function getArrVal(arrObj, key, condition) { if (!arrObj instanceof Array) { return null; } if (arrObj == null || arrObj.length === 0) { return null; } for (let obj of arrObj) { if (obj[key] === condition) { return obj; } } return null; } // 根据库位号获取其定位 function getBinPosition(locNo) { var position; $.ajax({ url: 'http://localhost:9090/jkwcs/three/query/goods/position/v1', type: "GET", data: { locNo: locNo }, async: false, success: function (res) { position = res.data; } }) return position; }