|
@@ -1223,7 +1223,7 @@ $(document).ready(() => {
|
|
{title: '数量', field: 'quantity', hAlign: 2, width: 50},
|
|
{title: '数量', field: 'quantity', hAlign: 2, width: 50},
|
|
{title: '完成率(%)', field: 'complete_percent', hAlign: 2, width: 70},
|
|
{title: '完成率(%)', field: 'complete_percent', hAlign: 2, width: 70},
|
|
],
|
|
],
|
|
- emptyRows: 3,
|
|
|
|
|
|
+ emptyRows: 0,
|
|
headRows: 1,
|
|
headRows: 1,
|
|
headRowHeight: [40],
|
|
headRowHeight: [40],
|
|
defaultRowHeight: 21,
|
|
defaultRowHeight: 21,
|
|
@@ -1236,7 +1236,7 @@ $(document).ready(() => {
|
|
});
|
|
});
|
|
$('#searchLedger', this.obj).bind('click', () => {self.searchText()});
|
|
$('#searchLedger', this.obj).bind('click', () => {self.searchText()});
|
|
$('#over', this.obj).bind('change', () => {self.searchOver()});
|
|
$('#over', this.obj).bind('change', () => {self.searchOver()});
|
|
- $('#empty', this.obj).bind('change', () => {self.searchEmpty()});
|
|
|
|
|
|
+ $('#empty', this.obj).bind('change', () => {self.searchLess()});
|
|
this.spread.getActiveSheet().bind(GC.Spread.Sheets.Events.CellDoubleClick, function (e, info) {
|
|
this.spread.getActiveSheet().bind(GC.Spread.Sheets.Events.CellDoubleClick, function (e, info) {
|
|
const sheet = info.sheet;
|
|
const sheet = info.sheet;
|
|
const data = sheet.zh_data;
|
|
const data = sheet.zh_data;
|
|
@@ -1246,8 +1246,16 @@ $(document).ready(() => {
|
|
if (!curBills) { return }
|
|
if (!curBills) { return }
|
|
|
|
|
|
SpreadJsObj.locateTreeNode(self.mainSpread.getActiveSheet(), curBills.ledger_id);
|
|
SpreadJsObj.locateTreeNode(self.mainSpread.getActiveSheet(), curBills.ledger_id);
|
|
|
|
+ stagePosSpreadObj.loadCurPosData();
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+ calculateCompletePercent() {
|
|
|
|
+ if (!this.searchResult) return;
|
|
|
|
+ for (const sr of this.searchResult) {
|
|
|
|
+ const base = ZhCalc.add(sr.total_price, sr.end_qc_tp);
|
|
|
|
+ sr.complete_percent = base !== 0 ? ZhCalc.mul(ZhCalc.div(sr.end_gather_tp, base), 100, 2) : 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
searchText() {
|
|
searchText() {
|
|
const keyword = $('#keyword', this.obj).val();
|
|
const keyword = $('#keyword', this.obj).val();
|
|
if (keyword !== '') {
|
|
if (keyword !== '') {
|
|
@@ -1262,6 +1270,7 @@ $(document).ready(() => {
|
|
this.searchResult.push(node);
|
|
this.searchResult.push(node);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ this.calculateCompletePercent();
|
|
SpreadJsObj.loadSheetData(this.spread.getActiveSheet(), 'data', this.searchResult);
|
|
SpreadJsObj.loadSheetData(this.spread.getActiveSheet(), 'data', this.searchResult);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1280,6 +1289,7 @@ $(document).ready(() => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ this.calculateCompletePercent();
|
|
SpreadJsObj.loadSheetData(this.spread.getActiveSheet(), 'data', this.searchResult);
|
|
SpreadJsObj.loadSheetData(this.spread.getActiveSheet(), 'data', this.searchResult);
|
|
}
|
|
}
|
|
searchEmpty() {
|
|
searchEmpty() {
|
|
@@ -1297,6 +1307,25 @@ $(document).ready(() => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ this.calculateCompletePercent();
|
|
|
|
+ SpreadJsObj.loadSheetData(this.spread.getActiveSheet(), 'data', this.searchResult);
|
|
|
|
+ }
|
|
|
|
+ searchLess() {
|
|
|
|
+ this.searchResult = [];
|
|
|
|
+ const sortData = SpreadJsObj.getSortData(this.mainSpread.getActiveSheet());
|
|
|
|
+ for (const node of sortData) {
|
|
|
|
+ if (node.children && node.children.length > 0) continue;
|
|
|
|
+ if (node.quantity) {
|
|
|
|
+ if (ZhCalc.sub(node.quantity, node.end_gather_qty) > 0) {
|
|
|
|
+ this.searchResult.push(node);
|
|
|
|
+ }
|
|
|
|
+ } else if (node.total_price) {
|
|
|
|
+ if (ZhCalc.sub(node.total_price, node.end_gather_tp) > 0) {
|
|
|
|
+ this.searchResult.push(node);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.calculateCompletePercent();
|
|
SpreadJsObj.loadSheetData(this.spread.getActiveSheet(), 'data', this.searchResult);
|
|
SpreadJsObj.loadSheetData(this.spread.getActiveSheet(), 'data', this.searchResult);
|
|
}
|
|
}
|
|
}
|
|
}
|