|
@@ -1092,6 +1092,7 @@ $(document).ready(() => {
|
|
|
measureByBatch: function (posNames, ratio, apply2sibling) {
|
|
|
if (posNames.length <= 0) return;
|
|
|
if (ratio <= 0) return;
|
|
|
+ const fRatio = ZhCalc.div(ratio, 100);
|
|
|
|
|
|
const sheet = slSpread.getActiveSheet();
|
|
|
const node = SpreadJsObj.getSelectObject(sheet);
|
|
@@ -1106,7 +1107,8 @@ $(document).ready(() => {
|
|
|
if (posNames.indexOf(p.name) < 0) continue;
|
|
|
data.updateData.push({
|
|
|
pid: p.id, lid: p.lid,
|
|
|
- contract_qty: ZhCalc.mul(p.quantity, ratio)
|
|
|
+ contract_qty: ZhCalc.mul(p.quantity, fRatio),
|
|
|
+ contract_expr: `${p.quantity}*${ratio}%`,
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -1784,7 +1786,7 @@ $(document).ready(() => {
|
|
|
const html = [];
|
|
|
for (const [i, p] of spSpread.getActiveSheet().zh_data.entries()) {
|
|
|
html.push('<tr>');
|
|
|
- html.push('<td>', i, '</td>');
|
|
|
+ html.push('<td>', i+1, '</td>');
|
|
|
html.push('<td>', p.name, '</td>');
|
|
|
html.push('<td>', p.quantity, '</td>');
|
|
|
html.push('<td><input type="checkbox" pos-name="' + p.name + '"></td></td>');
|
|
@@ -3715,6 +3717,6 @@ $(document).ready(() => {
|
|
|
toastr.warning('请勾选需要按计量比例的计量单元');
|
|
|
return;
|
|
|
}
|
|
|
- stageTreeSpreadObj.measureByBatch(posName, ZhCalc.div(ratio, 100), apply2sibling);
|
|
|
+ stageTreeSpreadObj.measureByBatch(posName, ratio, apply2sibling);
|
|
|
})
|
|
|
});
|