|
@@ -166,10 +166,20 @@
|
|
|
$(this).removeData("manual-input");
|
|
$(this).removeData("manual-input");
|
|
|
$("#contract_money").val(totalPrice);
|
|
$("#contract_money").val(totalPrice);
|
|
|
addError("合同金额不能小于物料总金额: " + totalPrice.toFixed(2));
|
|
addError("合同金额不能小于物料总金额: " + totalPrice.toFixed(2));
|
|
|
- }
|
|
|
|
|
|
|
+ // 更新大写金额
|
|
|
|
|
+ updateContractMoneyUppercase();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 即使没有修正,也要更新大写(用户手动修改金额的情况)
|
|
|
|
|
+ updateContractMoneyUppercase();
|
|
|
|
|
+ }
|
|
|
calculatePaymentAmount();
|
|
calculatePaymentAmount();
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ // 监听合同金额变化,实时更新大写
|
|
|
|
|
+ $("#contract_money").on('input', function() {
|
|
|
|
|
+ updateContractMoneyUppercase();
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
$(document).on('blur', '.startTr1:not(.hide) input.qty', function() {
|
|
$(document).on('blur', '.startTr1:not(.hide) input.qty', function() {
|
|
|
var qty = parseFloat($(this).val()) || 0;
|
|
var qty = parseFloat($(this).val()) || 0;
|
|
|
if (qty <= 0) {
|
|
if (qty <= 0) {
|
|
@@ -328,6 +338,20 @@
|
|
|
if ($('.startTr1:not(.hide)').length > 0) {
|
|
if ($('.startTr1:not(.hide)').length > 0) {
|
|
|
calculateTotalPrice();
|
|
calculateTotalPrice();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // 初始化合同金额大写显示
|
|
|
|
|
+ if (se == 1) {
|
|
|
|
|
+ // 可编辑模式:使用updateContractMoneyUppercase函数
|
|
|
|
|
+ updateContractMoneyUppercase();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 只读模式:直接从隐藏域或文本中获取金额
|
|
|
|
|
+ var contractMoney = parseFloat('${contractInfo.contract_money}') || 0;
|
|
|
|
|
+ if (contractMoney > 0) {
|
|
|
|
|
+ $("#contract_money_uppercase_display").text(numberToChineseUppercase(contractMoney));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $("#contract_money_uppercase_display").text('零元整');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
<style type="text/css">
|
|
<style type="text/css">
|
|
@@ -530,12 +554,18 @@
|
|
|
<c:choose>
|
|
<c:choose>
|
|
|
<c:when test="${fn:contains(curTacheModel.table_fields, ',contract_money,') || curTacheModel.n_se eq 1}">
|
|
<c:when test="${fn:contains(curTacheModel.table_fields, ',contract_money,') || curTacheModel.n_se eq 1}">
|
|
|
<input type="text" id="contract_money" name="contractInfo.contract_money" value="${contractInfo.contract_money }" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')">
|
|
<input type="text" id="contract_money" name="contractInfo.contract_money" value="${contractInfo.contract_money }" onkeyup="value=value.replace(/[^\d\.]/g,'')" onblur="value=value.replace(/[^\d\.]/g,'')">
|
|
|
|
|
+ <div style="font-size: 12px; color: #666; margin-top: 5px;">
|
|
|
|
|
+ <span id="contract_money_uppercase">零元整</span>
|
|
|
|
|
+ </div>
|
|
|
<div class="contract-money-hint manual-input-hint" style="display: none;">
|
|
<div class="contract-money-hint manual-input-hint" style="display: none;">
|
|
|
合同金额可随时输入,添加物料后会自动计算总金额
|
|
合同金额可随时输入,添加物料后会自动计算总金额
|
|
|
</div>
|
|
</div>
|
|
|
</c:when>
|
|
</c:when>
|
|
|
<c:otherwise>
|
|
<c:otherwise>
|
|
|
${contractInfo.contract_money }
|
|
${contractInfo.contract_money }
|
|
|
|
|
+ <div style="font-size: 12px; color: #666; margin-top: 5px;">
|
|
|
|
|
+ <span id="contract_money_uppercase_display"></span>
|
|
|
|
|
+ </div>
|
|
|
</c:otherwise>
|
|
</c:otherwise>
|
|
|
</c:choose>
|
|
</c:choose>
|
|
|
</td>
|
|
</td>
|