|
@@ -160,18 +160,10 @@
|
|
|
const sortData = SpreadJsObj.getSortData(searchSheet);
|
|
|
for (const node of sortData) {
|
|
|
if (node.children && node.children.length > 0) continue;
|
|
|
- if (node.end_gather_qty) {
|
|
|
- if (!node.quantity || Math.abs(node.end_gather_qty) > Math.abs(ZhCalc.add(node.quantity, node.end_qc_qty))) {
|
|
|
- const data = JSON.parse(JSON.stringify(node));
|
|
|
- data.visible = true;
|
|
|
- searchResult.push(data);
|
|
|
- }
|
|
|
- } else if (node.end_gather_tp) {
|
|
|
- if (!node.total_price || Math.abs(node.end_gather_tp) > Math.abs(ZhCalc.add(node.total_price, node.end_qc_tp))) {
|
|
|
- const data = JSON.parse(JSON.stringify(node));
|
|
|
- data.visible = true;
|
|
|
- searchResult.push(data);
|
|
|
- }
|
|
|
+ if (setting.checkOver && setting.checkOver(node)) {
|
|
|
+ const data = JSON.parse(JSON.stringify(node));
|
|
|
+ data.visible = true;
|
|
|
+ searchResult.push(data);
|
|
|
}
|
|
|
}
|
|
|
calculateCompletePercent(searchResult);
|
|
@@ -182,18 +174,10 @@
|
|
|
const sortData = SpreadJsObj.getSortData(searchSheet);
|
|
|
for (const node of sortData) {
|
|
|
if (node.children && node.children.length > 0) continue;
|
|
|
- if (node.quantity) {
|
|
|
- if (!node.end_gather_qty || checkZero(node.end_gather_qty)) {
|
|
|
- const data = JSON.parse(JSON.stringify(node));
|
|
|
- data.visible = true;
|
|
|
- searchResult.push(data);
|
|
|
- }
|
|
|
- } else if (node.total_price) {
|
|
|
- if (!node.end_gather_tp || checkZero(node.end_gather_tp)) {
|
|
|
- const data = JSON.parse(JSON.stringify(node));
|
|
|
- data.visible = true;
|
|
|
- searchResult.push(data);
|
|
|
- }
|
|
|
+ if (setting.checkEmpty && setting.checkEmpty(node)) {
|
|
|
+ const data = JSON.parse(JSON.stringify(node));
|
|
|
+ data.visible = true;
|
|
|
+ searchResult.push(data);
|
|
|
}
|
|
|
}
|
|
|
calculateCompletePercent(searchResult);
|
|
@@ -204,23 +188,15 @@
|
|
|
const sortData = SpreadJsObj.getSortData(searchSheet);
|
|
|
for (const node of sortData) {
|
|
|
if (node.children && node.children.length > 0) continue;
|
|
|
- if (node.quantity) {
|
|
|
- if (ZhCalc.sub(ZhCalc.add(node.quantity, node.end_qc_qty), node.end_gather_qty) > 0) {
|
|
|
- const data = JSON.parse(JSON.stringify(node));
|
|
|
- data.visible = true;
|
|
|
- searchResult.push(data);
|
|
|
- }
|
|
|
- } else if (node.total_price) {
|
|
|
- if (ZhCalc.sub(ZhCalc.add(node.total_price, node.end_qc_tp), node.end_gather_tp) > 0) {
|
|
|
- const data = JSON.parse(JSON.stringify(node));
|
|
|
- data.visible = true;
|
|
|
- searchResult.push(data);
|
|
|
- }
|
|
|
+ if (setting.checkLess && setting.checkLess(node)) {
|
|
|
+ const data = JSON.parse(JSON.stringify(node));
|
|
|
+ data.visible = true;
|
|
|
+ searchResult.push(data);
|
|
|
}
|
|
|
}
|
|
|
calculateCompletePercent(searchResult);
|
|
|
SpreadJsObj.loadSheetData(resultSpread.getActiveSheet(), 'data', searchResult);
|
|
|
- }
|
|
|
+ };
|
|
|
|
|
|
$('input', this.obj).bind('keydown', function (e) {
|
|
|
if (e.keyCode == 13) searchBills();
|