|
@@ -466,6 +466,12 @@ $(document).ready(() => {
|
|
|
ledgerSpreadSetting.dgnUpFields = ['deal_dgn_qty1', 'deal_dgn_qty2', 'c_dgn_qty1', 'c_dgn_qty2'];
|
|
|
ledgerSpreadSetting.getColor = function (sheet, data, row, col, defaultColor) {
|
|
|
if (data) {
|
|
|
+ const posRange = stagePos.ledgerPos[itemsPre + data.id] || [];
|
|
|
+ if (posRange.length > 0) {
|
|
|
+ for (const p of posRange) {
|
|
|
+ if (p.end_contract_qty > p.quantity) return '#f8d7da';
|
|
|
+ }
|
|
|
+ }
|
|
|
if (data.is_tp) {
|
|
|
return data.end_contract_tp > data.total_price ? '#f8d7da' : defaultColor;
|
|
|
} else {
|
|
@@ -1362,11 +1368,11 @@ $(document).ready(() => {
|
|
|
// stageTree.loadCurStageData(curStageData);
|
|
|
// stageTree.loadPreStageData(preStageData);
|
|
|
treeCalc.calculateAll(stageTree);
|
|
|
- SpreadJsObj.loadSheetData(slSpread.getActiveSheet(), 'tree', stageTree);
|
|
|
- SpreadJsObj.loadTopAndSelect(slSpread.getActiveSheet(), ckBillsSpread);
|
|
|
// 加载部位明细
|
|
|
stagePos.loadDatas(result.posData);
|
|
|
stagePos.calculateAll();
|
|
|
+ SpreadJsObj.loadSheetData(slSpread.getActiveSheet(), 'tree', stageTree);
|
|
|
+ SpreadJsObj.loadTopAndSelect(slSpread.getActiveSheet(), ckBillsSpread);
|
|
|
stagePosSpreadObj.loadCurPosData();
|
|
|
SpreadJsObj.resetTopAndSelect(spSpread.getActiveSheet());
|
|
|
// 加载中间计量
|
|
@@ -1600,9 +1606,23 @@ $(document).ready(() => {
|
|
|
searchOver() {
|
|
|
this.searchResult = [];
|
|
|
const sortData = SpreadJsObj.getSortData(this.mainSpread.getActiveSheet());
|
|
|
+ const checkPosOver = function (bills) {
|
|
|
+ const posRange = stagePos.ledgerPos[itemsPre + bills.id] || [];
|
|
|
+ if (posRange.length > 0) {
|
|
|
+ for (const p of posRange) {
|
|
|
+ if (p.end_contract_qty > p.quantity) return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ };
|
|
|
for (const node of sortData) {
|
|
|
if (node.children && node.children.length > 0) continue;
|
|
|
- if (node.end_gather_qty) {
|
|
|
+
|
|
|
+ if (checkPosOver(node)) {
|
|
|
+ const data = JSON.parse(JSON.stringify(node));
|
|
|
+ data.visible = true;
|
|
|
+ this.searchResult.push(data);
|
|
|
+ } else 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;
|