/**
* 分组统计文本框输入的数量次数
*/
function GroupBy(arrayData) {
var returnData = [];
$.each(arrayData, function (index, item) {
if (returnData.some(o => o.qty == item)) {
returnData.find(o => o.qty == item).count += 1;
}
else {
returnData.push({ qty: item, count: 1 });
}
})
return returnData;
}
/**
* 比较数组的差异
*/
function findOperate(obj1, obj2) {
var result = [];
var hebing = obj1.concat(obj2);
hebing.sort();
hebing.reverse();
var quchong = $.unique(hebing);
quchong.forEach(function (qitem, index, array) {
if (obj2.every(function (item, qindex, array) { return qitem != item; })) {
result.push(qitem);
}
});
return result;
}