|
@@ -1090,6 +1090,17 @@ $(document).ready(() => {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ updateNodeData: function(data) {
|
|
|
+ postData(window.location.href + '/update', { bills: data }, function(data) {
|
|
|
+ const nodes = stageTree.loadPostStageData(data);
|
|
|
+ stageTreeSpreadObj.refreshTreeNodes(slSpread.getActiveSheet(), nodes);
|
|
|
+ if (detail) {
|
|
|
+ detail.loadStageLedgerUpdateData(data, nodes);
|
|
|
+ } else {
|
|
|
+ stageIm.loadUpdateLedgerData(data, nodes);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
loadRelaData: function () {
|
|
|
const billsSheet = slSpread.getActiveSheet();
|
|
|
SpreadJsObj.saveTopAndSelect(billsSheet, ckBillsSpread);
|
|
@@ -1686,6 +1697,23 @@ $(document).ready(() => {
|
|
|
if (checkedChanges) checkedChanges.reloadChangeData();
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ const spssTenderSelect = TenderSelectMulti({
|
|
|
+ title: '根据(其他标段)计量比例计量',
|
|
|
+ type: 'gather',
|
|
|
+ dataType: 'stage',
|
|
|
+ afterSelect: function(select) {
|
|
|
+ const data = { filter: 'info', tender: select };
|
|
|
+ postData(`/sp/${spid}/spss/load`, data, function(result) {
|
|
|
+ const postil = result.map(x => { return `${x.name}(${x.stage_filter}) ${x.info.contract_tp || 0}`}).join(';');
|
|
|
+ const gatherContractTp = ZhCalc.sum(result.map(x => { return x.info.contract_tp; }));
|
|
|
+ const gatherTp = ZhCalc.sum(result.map(x => { return x.info.total_price; }));
|
|
|
+ const node = SpreadJsObj.getSelectObject(slSheet);
|
|
|
+ const contract_tp = ZhCalc.mul(ZhCalc.div(gatherContractTp, gatherTp), node.total_price);
|
|
|
+ stageTreeSpreadObj.updateNodeData({ stage: { lid: node.id, contract_tp, postil } });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ });
|
|
|
$.contextMenu({
|
|
|
selector: '#stage-ledger',
|
|
|
build: function ($trigger, e) {
|
|
@@ -2029,6 +2057,18 @@ $(document).ready(() => {
|
|
|
batchImport.show();
|
|
|
}
|
|
|
},
|
|
|
+ percentSpr: '---',
|
|
|
+ percentCalc: {
|
|
|
+ name: '根据(其他标段)计量比例计量',
|
|
|
+ disabled: function(key, opt) {
|
|
|
+ const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
|
|
|
+ const posRange = stagePos.getLedgerPos(node.id) || [];
|
|
|
+ return readOnly || !node || !node.is_tp || posRange.length > 0;
|
|
|
+ },
|
|
|
+ callback: function(key, opt) {
|
|
|
+ spssTenderSelect.showSelect();
|
|
|
+ }
|
|
|
+ },
|
|
|
shoufangdanSpr: '---',
|
|
|
shoufangdan: {
|
|
|
name: '生成收方单',
|