|
@@ -29,7 +29,7 @@
|
|
|
// ,'<td>'
|
|
|
// ,' <select name="type" class="myselect"><option value="">请选择项目类型</option><option value="1">架空线路工程</option><option value="2">电缆工程</option><option value="3">变电站工程</option></select>'
|
|
|
// ,'<td><div contenteditable="true" class="mydiv2 mydiv" placeholder="请输入项目编号"></div></td>'
|
|
|
- ,'<td><div contenteditable="true" class="mydiv3 mydiv" placeholder="请输入供应商"></div></td>'
|
|
|
+ ,'<td><div contenteditable="true" tabindex=1 id=tab'+index+' onBlur="clearTotal('+'\''+index+'\''+');" class="mydiv3 mydiv" placeholder="请输入供应商"></div></td>'
|
|
|
,'<td style="text-align: center">'
|
|
|
,'<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">删除</button>'
|
|
|
,'</td>'
|
|
@@ -107,6 +107,10 @@ function okSubmit() {
|
|
|
}
|
|
|
//判断施工单位是否输入
|
|
|
for(var k = 0;k < div3value.length;k++){
|
|
|
+ if(div3value[k]=='合计'){
|
|
|
+ layer.msg("供应商不能为合计",{icon: 3,offset:['40%','40%']});
|
|
|
+ throw SyntaxError;
|
|
|
+ }
|
|
|
if(div3value[k]==null||div3value[k]==""){
|
|
|
layer.msg("请输入供应商",{icon: 3,offset:['40%','40%']});
|
|
|
throw SyntaxError;
|
|
@@ -170,4 +174,13 @@ function okSubmit() {
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
|
+/* 供应商名称去掉合计*/
|
|
|
+function clearTotal(id) {
|
|
|
+ var totalId = "tab"+id;
|
|
|
+ var total = $("#"+totalId).text();
|
|
|
+ if(total == '合计'){
|
|
|
+ $("#"+totalId).text(" ");
|
|
|
+ layer.msg("供应商名称不能为合计",{icon: 3,offset:['40%','40%']});
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|