|
@@ -29,8 +29,6 @@ $(document).ready(() => {
|
|
|
{title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'oa_tp', hAlign: 2, width: 80, type: 'Number', getValue: 'getValue.oa_tp', readOnly: true},
|
|
|
{title: '申请变更增(+)减(-)|数量', colSpan: '2|1', rowSpan: '1|1', field: 'camount', hAlign: 2, width: 60, type: 'Number', getValue: 'getValue.camount', readOnly: true},
|
|
|
{title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'ca_tp', hAlign: 2, width: 80, type: 'Number', getValue: 'getValue.ca_tp', readOnly: true},
|
|
|
- {title: '变更后|数量', colSpan: '2|1', rowSpan: '1|1', field: 'samount', hAlign: 2, width: 60, type: 'Number', readOnly: true, getValue: 'getValue.changed_amount'},
|
|
|
- {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'sa_tp', hAlign: 2, width: 80, type: 'Number', readOnly: true, getValue: 'getValue.changed_tp'},
|
|
|
],
|
|
|
emptyRows: 0,
|
|
|
headRows: 2,
|
|
@@ -80,6 +78,8 @@ $(document).ready(() => {
|
|
|
changeSpreadSetting.cols.push(newColcount);
|
|
|
changeSpreadSetting.cols.push(newColTp);
|
|
|
}
|
|
|
+ changeSpreadSetting.cols.push({title: '变更后|数量', colSpan: '2|1', rowSpan: '1|1', field: 'samount', hAlign: 2, width: 60, type: 'Number', readOnly: true, getValue: 'getValue.changed_amount'});
|
|
|
+ changeSpreadSetting.cols.push({title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'sa_tp', hAlign: 2, width: 80, type: 'Number', readOnly: true, getValue: 'getValue.changed_tp'});
|
|
|
|
|
|
const changeCol = {
|
|
|
getValue: {
|
|
@@ -102,7 +102,8 @@ $(document).ready(() => {
|
|
|
return ZhCalc.round(ZhCalc.add(data.oamount, data.spamount), findDecimal(data.unit));
|
|
|
},
|
|
|
changed_tp: function (data) {
|
|
|
- return ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(ZhCalc.add(data.oamount, data.spamount), findDecimal(data.unit))), totalPriceUnit);
|
|
|
+ return ZhCalc.add(ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.oamount, findDecimal(data.unit))), totalPriceUnit),
|
|
|
+ ZhCalc.round(ZhCalc.mul(ZhCalc.round(data.unit_price, unitPriceUnit), ZhCalc.round(data.spamount, findDecimal(data.unit))), totalPriceUnit));
|
|
|
},
|
|
|
},
|
|
|
};
|
|
@@ -151,8 +152,8 @@ $(document).ready(() => {
|
|
|
},
|
|
|
setRowValueAndSum: function (data, row, col) {
|
|
|
for (const j in aidList) {
|
|
|
- const sum = ZhCalc.round(ZhCalc.mul(data.unit_price, parseFloat(changeSpreadSheet.getValue(row, 12 + parseInt(j)*2))), totalPriceUnit);
|
|
|
- changeSpreadSheet.setValue(row, 13 + j*2, sum !== 0 ? sum : null);
|
|
|
+ const sum = ZhCalc.round(ZhCalc.mul(data.unit_price, parseFloat(changeSpreadSheet.getValue(row, 10 + parseInt(j)*2))), totalPriceUnit);
|
|
|
+ changeSpreadSheet.setValue(row, 11 + j*2, sum !== 0 ? sum : null);
|
|
|
}
|
|
|
// const sum = ZhCalc.round(ZhCalc.mul(data.unit_price, data.spamount), totalPriceUnit);
|
|
|
// changeSpreadSheet.setValue(row, col+1, sum !== 0 ? sum : null);
|
|
@@ -163,11 +164,11 @@ $(document).ready(() => {
|
|
|
let changed_sum = 0;
|
|
|
for(let i = 0; i < rowCount - 1; i++){
|
|
|
audit_sum = ZhCalc.add(audit_sum, changeSpreadSheet.getValue(i, col+1));
|
|
|
- changed_sum = ZhCalc.add(changed_sum, changeSpreadSheet.getValue(i, 11));
|
|
|
+ changed_sum = ZhCalc.add(changed_sum, changeSpreadSheet.getValue(i, (11 + aidList.length*2)));
|
|
|
}
|
|
|
|
|
|
changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, col+1, audit_sum !== 0 ? audit_sum : null);
|
|
|
- changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 11, changed_sum !== 0 ? changed_sum : null);
|
|
|
+ changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, (11 + aidList.length*2), changed_sum !== 0 ? changed_sum : null);
|
|
|
},
|
|
|
countSum: function() {
|
|
|
const rowCount = changeSpreadSheet.getRowCount();
|
|
@@ -177,18 +178,18 @@ $(document).ready(() => {
|
|
|
for(let i = 0; i < rowCount - 1; i++){
|
|
|
oSum = ZhCalc.add(oSum, changeSpreadSheet.getValue(i, 7));
|
|
|
cSum = ZhCalc.add(cSum, changeSpreadSheet.getValue(i, 9));
|
|
|
- cdSum = ZhCalc.add(cdSum, changeSpreadSheet.getValue(i, 11));
|
|
|
+ cdSum = ZhCalc.add(cdSum, changeSpreadSheet.getValue(i, (11 + aidList.length*2)));
|
|
|
}
|
|
|
changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 7, oSum !== 0 ? oSum : null);
|
|
|
changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 9, cSum !== 0 ? cSum : null);
|
|
|
- changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 11, cdSum !== 0 ? cdSum : null);
|
|
|
+ changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, (11 + aidList.length*2), cdSum !== 0 ? cdSum : null);
|
|
|
// 用户的数据合计
|
|
|
for (const j in aidList) {
|
|
|
let audit_sum = 0;
|
|
|
for(let i = 0; i < rowCount - 1; i++){
|
|
|
- audit_sum = ZhCalc.add(audit_sum, changeSpreadSheet.getValue(i, 13 + j*2));
|
|
|
+ audit_sum = ZhCalc.add(audit_sum, changeSpreadSheet.getValue(i, 11 + j*2));
|
|
|
}
|
|
|
- changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 13 + j*2, audit_sum !== 0 ? audit_sum : null);
|
|
|
+ changeSpreadSheet.setValue(changeSpreadSheet.getRowCount() - 1, 11 + j*2, audit_sum !== 0 ? audit_sum : null);
|
|
|
}
|
|
|
},
|
|
|
deletePress: function (sheet) {
|