|
@@ -138,6 +138,13 @@
|
|
|
addRow1('#projectMaterialStorageList', projectMaterialStorageListRowIdx, projectMaterialStorageListTpl, data[i])
|
|
|
}
|
|
|
}
|
|
|
+ function num(obj){
|
|
|
+ obj.value = obj.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
|
|
|
+ obj.value = obj.value.replace(/^\./g,""); //验证第一个字符是数字
|
|
|
+ obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个, 清除多余的
|
|
|
+ obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
|
|
|
+ obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); //只能输入两个小数
|
|
|
+ }
|
|
|
</script>
|
|
|
</head>
|
|
|
<body>
|
|
@@ -168,18 +175,17 @@
|
|
|
<script type="text/template" id="projectMaterialStorageListTpl">//<!--
|
|
|
<tr id="projectMaterialStorageList{{idx}}">
|
|
|
<td class="hide">
|
|
|
- <input id="projectMaterialStorageList{{idx}}_invoiceId" name="projectMaterialStorageList[{{idx}}].invoiceId" type="hidden" value="{{row.invoiceId}}"/>
|
|
|
<input id="projectMaterialStorageList{{idx}}_projectId" name="projectMaterialStorageList[{{idx}}].projectId" type="hidden" value="{{row.projectId}}"/>
|
|
|
<input id="projectMaterialStorageList{{idx}}_delFlag" name="projectMaterialStorageList[{{idx}}].delFlag" type="hidden" value="0"/>
|
|
|
</td>
|
|
|
<td>
|
|
|
- <input id="projectMaterialStorageList{{idx}}_materialName" name = "materialName" type="text" value="{{row.materialName}}" class="form-control"/>
|
|
|
+ <input id="projectMaterialStorageList{{idx}}_materialName" name = "projectMaterialStorageList[{{idx}}].materialName" type="text" value="{{row.materialName}}" class="form-control"/>
|
|
|
</td>
|
|
|
<td>
|
|
|
- <input id="projectMaterialStorageList{{idx}}_price" name = "price" type="text" value="{{row.price}}" class="form-control"/>
|
|
|
+ <input id="projectMaterialStorageList{{idx}}_price" name = "projectMaterialStorageList[{{idx}}].price" type="text" value="{{row.price}}" onkeyup="num(this)" class="form-control"/>
|
|
|
</td>
|
|
|
<td>
|
|
|
- <input id="projectMaterialStorageList{{idx}}_unit" name = "unit" type="text" value="{{row.unit}}" class="form-control"/>
|
|
|
+ <input id="projectMaterialStorageList{{idx}}_unit" name = "projectMaterialStorageList[{{idx}}].unit" type="text" value="{{row.unit}}" class="form-control"/>
|
|
|
</td>
|
|
|
<td class="text-center op-td" >
|
|
|
{{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#projectMaterialStorageList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i> 删除</span>{{/delBtn}}
|