数量变成小数页面展示

master
OathK1per 2022-11-04 16:23:11 +08:00
parent 3fb00e7fed
commit 92f34593ba
5 changed files with 28 additions and 28 deletions

View File

@ -706,7 +706,7 @@ function prepareAjaxDataVerify(data, detailProperty, projectId) {
function bindChangeableInput() {
//数量改变
$(".input-changeable-amount").change(function () {
var amount = parseInt($(this).val());
var amount = f2($(this).val());
//找到对应的单价和税率
var price = f5($(this).parent().parent().find(".input-changeable-price").val());
var taxRate = f2($(this).parent().parent().find(".input-changeable-tax-rate").val());
@ -720,7 +720,7 @@ function bindChangeableInput() {
$(".input-changeable-price").change(function () {
var price = f5($(this).val());
//找到对应的数量和税率
var amount = parseInt($(this).parent().parent().find(".input-changeable-amount").val());
var amount = f2($(this).parent().parent().find(".input-changeable-amount").val());
var taxRate = f2($(this).parent().parent().find(".input-changeable-tax-rate").val());
console.log(amount, price, taxRate);
@ -734,7 +734,7 @@ function bindChangeableInput() {
$(".input-changeable-tax-rate").change(function () {
var taxRate = f2($(this).val());
//找到对应的数量和单价
var amount = parseInt($(this).parent().parent().find(".input-changeable-amount").val());
var amount = f2($(this).parent().parent().find(".input-changeable-amount").val());
var price = f5($(this).parent().parent().find(".input-changeable-price").val());
console.log(amount, price, taxRate);
@ -770,7 +770,7 @@ function updateAmount(className, totalClassName) {
console.log(className + ": " + f2($(this).val()));
total += f2($(this).val());
});
$("."+totalClassName).val(total);
$("."+totalClassName).val(f2Fixed(total));
}
/**

View File

@ -8,7 +8,7 @@ COST_DETAIL2={
"category":[false,"类别","string"],
"name":[false,"名称","string"],
"unit":[false,"单位","string"],
"amount":[false,"数量","string"],
"amount":[false,"数量","number"],
"price":[false,"单价","price"],
"taxRate":[false,"税率","number"],
"totalTaxInclude":[false,"含税总金额","number"],
@ -29,7 +29,7 @@ COST_DETAIL={
"category":[true,"类别","string"],
"name":[true,"名称","string"],
"unit":[true,"单位","string"],
"amount":[true,"数量","string"],
"amount":[true,"数量","number"],
"price":[true,"单价","price"],
"taxRate":[true,"税率","number"],
"totalTaxInclude":[true,"含税总金额","number"],
@ -222,7 +222,7 @@ function appendTrCost() {
'</td>'+
'<td width="100px"><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost"></td>'+
'<td width="80px"><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost""></td>'+
'<td width="100px"><input type="number" min="0" max="99999999" step="1" maxlength="8" class="am-modal-prompt-input am-modal-prompt-input-cost input-changeable-amount input-changeable-amount-cost"></td>'+
'<td width="100px"><input type="text" maxlength="14" class="number am-modal-prompt-input am-modal-prompt-input-cost input-changeable-amount input-changeable-amount-cost"></td>'+
'<td width="100px"><input type="text" min="0.00" max="9999999999.99" step="0.01" maxlength="19" class="price am-modal-prompt-input am-modal-prompt-input-cost input-changeable-price input-changeable-price-cost"></td>'+
'<td width="100px"><input type="text" min="0.00" max="99.99" step="0.01" maxlength="5" class="number am-modal-prompt-input am-modal-prompt-input-cost input-changeable-tax-rate input-changeable-tax-rate-cost"></td>'+
'<td width="100px"><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost input-changeable-total-tax-include input-changeable-total-tax-include-cost" readonly></td>'+

View File

@ -9,7 +9,7 @@ COST_PROJECT_MANAGE_DETAIL2={
"name2":[false,"业务项目","string"],
"detail":[false,"项目明细","string"],
"unit":[false,"单位","string"],
"amount":[false,"数量","string"],
"amount":[false,"数量","number"],
"price":[false,"单价","price"],
"total":[false,"总金额","number"],
"payTime":[false,"支出时间","string"],
@ -27,7 +27,7 @@ COST_PROJECT_MANAGE_DETAIL={
"name2":[false,"业务项目","string"],
"detail":[true,"项目明细","string"],
"unit":[true,"单位","string"],
"amount":[true,"数量","string"],
"amount":[true,"数量","number"],
"price":[true,"单价","price"],
"total":[true,"总金额","number"],
"payTime":[false,"支出时间","string"],
@ -145,7 +145,7 @@ function appendTrCostProjectManage() {
' </td>\n' +
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage"></td>\n' +
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage"></td>\n' +
' <td><input type="number" min="0" max="99999999" step="1" maxlength="8" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage input-changeable-amount-project-manage"></td>\n' +
' <td><input type="text" maxlength="14" class="number am-modal-prompt-input am-modal-prompt-input-cost-project-manage input-changeable-amount-project-manage"></td>\n' +
' <td><input type="text" min="0.00" max="9999999999.99" step="0.01" maxlength="19" class="price am-modal-prompt-input am-modal-prompt-input-cost-project-manage input-changeable-price-project-manage"></td>\n' +
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage input-changeable-total-project-manage" readonly></td>\n' +
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage" data-am-datepicker></td>\n' +

View File

@ -7,7 +7,7 @@ INCOME_DETAIL2={
"type":[false,"类别","string"],
"name":[false,"名称","string"],
"unit":[false,"单位","string"],
"amount":[false,"数量","string"],
"amount":[false,"数量","number"],
"price":[false,"单价","price"],
"taxRate":[false,"税率","number"],
"totalTaxInclude":[false,"含税总金额","number"],
@ -20,7 +20,7 @@ INCOME_DETAIL={
"type":[true,"类别","string"],
"name":[true,"名称","string"],
"unit":[true,"单位","string"],
"amount":[true,"数量","string"],
"amount":[true,"数量","number"],
"price":[true,"单价","price"],
"taxRate":[true,"税率","number"],
"totalTaxInclude":[true,"含税总金额","number"],
@ -176,7 +176,7 @@ function appendTrIncome() {
' </td>\n' +
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-income"></td>\n' +
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-income"></td>\n' +
' <td><input type="number" min="0" max="99999999" step="1" maxlength="8" class="am-modal-prompt-input am-modal-prompt-input-income input-changeable-amount input-changeable-amount-income"></td>\n' +
' <td><input type="text" maxlength="8" class="number am-modal-prompt-input am-modal-prompt-input-income input-changeable-amount input-changeable-amount-income"></td>\n' +
' <td><input type="text" min="0.00" max="9999999999.99" step="0.01" maxlength="19" class="price am-modal-prompt-input am-modal-prompt-input-income input-changeable-price input-changeable-price-income"></td>\n' +
' <td><input type="text" min="0.00" max="99.99" step="0.01" maxlength="5" class="number am-modal-prompt-input am-modal-prompt-input-income input-changeable-tax-rate input-changeable-tax-rate-income"></td>\n' +
' <td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-income input-changeable-total-tax-include input-changeable-total-tax-include-income" readonly></td>\n' +

View File

@ -460,7 +460,7 @@
</td>
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-income" value="${incomeDetail.name!}"></td>
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-income" value="${incomeDetail.unit!}"></td>
<td><input type="number" min="0" max="99999999" step="1" maxlength="8" class="am-modal-prompt-input am-modal-prompt-input-income input-changeable-amount input-changeable-amount-income" value="${incomeDetail.amount!0}" oninput="if(value.length>8)value=value.slice(0,8)" <#--onkeyup="integerNumber(this)"-->></td>
<td><input type="text" maxlength="14" class="number am-modal-prompt-input am-modal-prompt-input-income input-changeable-amount input-changeable-amount-income" value="${Utils.format(incomeDetail.amount,'0')}" oninput="if(value.length>8)value=value.slice(0,8)" <#--onkeyup="integerNumber(this)"-->></td>
<td><input type="text" maxlength="19" class="price am-modal-prompt-input am-modal-prompt-input-income input-changeable-price input-changeable-price-income" value="${Utils.format2(incomeDetail.price,'0')}" oninput="if(value.length>19)value=value.slice(0,19)"></td>
<td><input type="text" maxlength="5" class="number am-modal-prompt-input am-modal-prompt-input-income input-changeable-tax-rate input-changeable-tax-rate-income" value="${Utils.format(incomeDetail.taxRate,'0')}" oninput="if(value.length>5)value=value.slice(0,5)"></td>
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-income input-changeable-total-tax-include input-changeable-total-tax-include-income" value="${Utils.format(incomeDetail.totalTaxInclude,'0')}" readonly></td>
@ -475,7 +475,7 @@
<td width="100px"></td>
<td></td>
<td></td>
<td><input type="number" class="am-modal-prompt-input am-modal-prompt-input-income input-changeable-total-amount-income" value="${incomeTotalAmount!0}" readonly <#--onkeyup="integerNumber(this)"-->></td>
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-income input-changeable-total-amount-income" value="${Utils.format(incomeTotalAmount,'0')}" readonly <#--onkeyup="integerNumber(this)"-->></td>
<td></td>
<td></td>
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-income input-changeable-total-total-tax-include-income" value="${Utils.format(budgetBean.incomeTotalTaxInclude,'0')}" readonly></td>
@ -616,7 +616,7 @@
</td>
<td width="100px"><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost" value="${costDetail.name!}"></td>
<td width="80px"><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost" value="${costDetail.unit!}"></td>
<td width="100px"><input type="number" min="0" max="99999999" step="1" maxlength="8" class="am-modal-prompt-input am-modal-prompt-input-cost input-changeable-amount input-changeable-amount-cost" value="${costDetail.amount!0}" oninput="if(value.length>8)value=value.slice(0,8)" <#--onkeyup="integerNumber(this)"-->></td>
<td width="100px"><input type="text" maxlength="8" class="number am-modal-prompt-input am-modal-prompt-input-cost input-changeable-amount input-changeable-amount-cost" value="${Utils.format2(costDetail.amount,'0')}" oninput="if(value.length>8)value=value.slice(0,8)" <#--onkeyup="integerNumber(this)"-->></td>
<td width="100px"><input type="text" maxlength="19" class="price am-modal-prompt-input am-modal-prompt-input-cost input-changeable-price input-changeable-price-cost" value="${Utils.format2(costDetail.price,'0')}" oninput="if(value.length>19)value=value.slice(0,19)"></td>
<td width="100px"><input type="text" maxlength="5" class="number am-modal-prompt-input am-modal-prompt-input-cost input-changeable-tax-rate input-changeable-tax-rate-cost" value="${Utils.format(costDetail.taxRate,'0')}" oninput="if(value.length>5)value=value.slice(0,5)"></td>
<td width="100px"><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost input-changeable-total-tax-include input-changeable-total-tax-include-cost" value="${Utils.format(costDetail.totalTaxInclude,'0')}" readonly></td>
@ -645,7 +645,7 @@
<td width="150px"></td>
<td width="100px"></td>
<td width="80px"></td>
<td width="100px"><input type="number" class="am-modal-prompt-input am-modal-prompt-input-cost input-changeable-total-amount-cost" value="${costTotalAmount!0}" readonly <#--onkeyup="integerNumber(this)"-->></td>
<td width="100px"><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost input-changeable-total-amount-cost" value="${Utils.format(costTotalAmount,'0')}" readonly <#--onkeyup="integerNumber(this)"-->></td>
<td width="100px"></td>
<td width="100px"></td>
<td width="100px"><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost input-changeable-total-total-tax-include-cost" value="${Utils.format(budgetBean.costPurchaseTotalTaxInclude,'0')}" readonly></td>
@ -712,26 +712,26 @@
<td>
<select <#if costProjectManageDetail.isDiy == 1>style="display:none"<#else>style="float: left;"</#if> class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage am-modal-prompt-input-cost-project-manage-category">
<#if costProjectManageDetail.type == 1>
<option value="1" <#if costProjectManageDetail.name == "人工费">selected</#if>>人工费</option>
<option value="2" <#if costProjectManageDetail.name == "总部支撑人力费用">selected</#if>>总部支撑人力费用</option>
<option value="3" <#if costProjectManageDetail.name == "自定义">selected</#if>>自定义</option>
<option value="1" <#if costProjectManageDetail.name! == "人工费">selected</#if>>人工费</option>
<option value="2" <#if costProjectManageDetail.name! == "总部支撑人力费用">selected</#if>>总部支撑人力费用</option>
<option value="3" <#if costProjectManageDetail.name! == "自定义">selected</#if>>自定义</option>
</#if>
<#if costProjectManageDetail.type == 2>
<option value="4" <#if costProjectManageDetail.name == "人员差旅费">selected</#if>>人员差旅费</option>
<option value="5" <#if costProjectManageDetail.name == "业务费用">selected</#if>>业务费用</option>
<option value="6" <#if costProjectManageDetail.name == "商务及专项验收费用">selected</#if>>商务及专项验收费用</option>
<option value="7" <#if costProjectManageDetail.name == "办公费用">selected</#if>>办公费用</option>
<option value="8" <#if costProjectManageDetail.name == "自定义">selected</#if>>自定义</option>
<option value="4" <#if costProjectManageDetail.name! == "人员差旅费">selected</#if>>人员差旅费</option>
<option value="5" <#if costProjectManageDetail.name! == "业务费用">selected</#if>>业务费用</option>
<option value="6" <#if costProjectManageDetail.name! == "商务及专项验收费用">selected</#if>>商务及专项验收费用</option>
<option value="7" <#if costProjectManageDetail.name! == "办公费用">selected</#if>>办公费用</option>
<option value="8" <#if costProjectManageDetail.name! == "自定义">selected</#if>>自定义</option>
</#if>
<#if costProjectManageDetail.type == 4>
<option value="9" <#if costProjectManageDetail.name == "保证金">selected</#if>>保证金</option>
<option value="9" <#if costProjectManageDetail.name! == "保证金">selected</#if>>保证金</option>
</#if>
</select>
<input <#if costProjectManageDetail.isDiy == 1>type="text"<#else>type="hidden"</#if> class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage am-modal-prompt-input-cost-project-manage-category2" value="${costProjectManageDetail.name!}">
</td>
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage" value="${costProjectManageDetail.detail!}"></td>
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage" value="${costProjectManageDetail.unit!}"></td>
<td><input type="number" min="0" max="99999999" step="1" maxlength="8" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage input-changeable-amount-project-manage" value="${costProjectManageDetail.amount!0}" <#--onkeyup="integerNumber(this)"--> oninput="if(value.length>8)value=value.slice(0,8)"></td>
<td><input type="text" maxlength="8" class="number am-modal-prompt-input am-modal-prompt-input-cost-project-manage input-changeable-amount-project-manage" value="${Utils.format2(costProjectManageDetail.amount,'0')}" <#--onkeyup="integerNumber(this)"--> oninput="if(value.length>8)value=value.slice(0,8)"></td>
<td><input type="text" maxlength="19" class="price am-modal-prompt-input am-modal-prompt-input-cost-project-manage input-changeable-price-project-manage" value="${Utils.format2(costProjectManageDetail.price,'0')}" oninput="if(value.length>19)value=value.slice(0,19)"></td>
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage input-changeable-total-project-manage" value="${Utils.format(costProjectManageDetail.total,'0')}" readonly></td>
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage" value="${(costProjectManageDetail.payTime?string("yyyy-MM-dd"))!}" data-am-datepicker></td>
@ -751,7 +751,7 @@
<td></td>
<td></td>
<td></td>
<td><input type="number" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage input-changeable-total-amount-project-manage" value="${costProjectManageTotalAmount!0}" readonly <#--onkeyup="integerNumber(this)"-->></td>
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage input-changeable-total-amount-project-manage" value="${Utils.format(costProjectManageTotalAmount,'0')}" readonly <#--onkeyup="integerNumber(this)"-->></td>
<td></td>
<td><input type="text" class="am-modal-prompt-input am-modal-prompt-input-cost-project-manage input-changeable-total-total-project-manage" value="${Utils.format(budgetBean.costProjectManageTaxInclude,'0')}" readonly></td>
<td></td>