|
|
@@ -317,7 +317,7 @@
|
|
|
]"
|
|
|
>
|
|
|
<span v-if="dialogType === 'view'">{{ scope.row.invoiceAmount }}</span>
|
|
|
- <el-input :min="0" :max="scope.row.unInvoiceAmount" v-limit="{ min: 0, max: scope.row.unInvoiceAmount }" v-else v-model="scope.row.invoiceAmount" type="number" @input="updateInvoiceAmount(scope.row)"></el-input>
|
|
|
+ <el-input v-else v-model="scope.row.invoiceAmount" type="number" @input="updateInvoiceAmount(scope.row)"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</ele-pro-table>
|
|
|
@@ -1076,14 +1076,20 @@
|
|
|
// 计算 sum 值(使用 item 的 defaultAmountTotalPrice 或其他适当的字段)
|
|
|
// const sum = parseFloat(item.defaultAmountTotalPrice) || 0;
|
|
|
let remainingTotal = sum;
|
|
|
+
|
|
|
+ let totalInvoiceAmount = sum ? JSON.parse(JSON.stringify(sum)) : 0;
|
|
|
|
|
|
// 从上到下分配 sum 给相同订单号的数据
|
|
|
sameKeyItems.forEach(paymentItem => {
|
|
|
if (remainingTotal <= 0) {
|
|
|
paymentItem.invoiceAmount = 0;
|
|
|
} else {
|
|
|
- const unInvoiceAmount = parseFloat(paymentItem.unInvoiceAmount) || 0;
|
|
|
- const allocateAmount = Math.min(remainingTotal, unInvoiceAmount);
|
|
|
+ // const unInvoiceAmount = parseFloat(paymentItem.unInvoiceAmount) || 0;
|
|
|
+ // const allocateAmount = Math.min(remainingTotal, unInvoiceAmount);
|
|
|
+ // paymentItem.invoiceAmount = allocateAmount.toFixed(2);
|
|
|
+ // remainingTotal -= allocateAmount;
|
|
|
+ // const unInvoiceAmount = parseFloat(paymentItem.unInvoiceAmount) || 0;
|
|
|
+ const allocateAmount = Math.min(remainingTotal, totalInvoiceAmount);
|
|
|
paymentItem.invoiceAmount = allocateAmount.toFixed(2);
|
|
|
remainingTotal -= allocateAmount;
|
|
|
}
|