|
@@ -14,6 +14,8 @@
|
|
|
{field:'itemName',title:'项目名称'}
|
|
|
,{field:'unitType',title:'单位工程',edit: 'text'}
|
|
|
,{field:'integrityFee',title:'诚信扣款'}
|
|
|
+ ,{field:'materialoffset',title:'扣抵工程款'}
|
|
|
+ ,{field:'taxdeductions',title:'税额扣减'}
|
|
|
|
|
|
]]
|
|
|
,data:[ //数据导入
|
|
@@ -23,7 +25,9 @@
|
|
|
"id":"${data.id}",
|
|
|
"unitType": "${data.unitType}",
|
|
|
"integrityFee": "${data.integrityFee}",
|
|
|
- "itemName": "${data.itemName}"
|
|
|
+ "itemName": "${data.itemName}",
|
|
|
+ "materialoffset":"",
|
|
|
+ "taxdeductions":""
|
|
|
},
|
|
|
</c:forEach>
|
|
|
</c:if>
|
|
@@ -35,6 +39,8 @@
|
|
|
}
|
|
|
$('table tr').each(function () {
|
|
|
var unitType = $(this).find('td:eq(1)').text()
|
|
|
+ $(this).find('td:eq(3)').attr("data-edit","text")
|
|
|
+ $(this).find('td:eq(4)').attr("data-edit","text")
|
|
|
if(unitType != null && unitType != ''){
|
|
|
$(this).find('td:eq(2)').attr("data-edit","text")
|
|
|
}
|
|
@@ -84,39 +90,99 @@
|
|
|
layer.msg('请输入有效数字',{icon: 5,offset:['40%','40%']});
|
|
|
return false;
|
|
|
}
|
|
|
+ if(value<0){
|
|
|
+ layer.msg('诚信扣款不能为负数',{icon: 5,offset:['40%','40%']});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(field === 'materialoffset'){
|
|
|
+ var value = obj.value;
|
|
|
+ if(isNaN(value)){ //判断输入是否是数字
|
|
|
+ layer.msg('请输入有效数字',{icon: 5,offset:['40%','40%']});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(value<0){
|
|
|
+ layer.msg('扣抵工程款不能为负数',{icon: 5,offset:['40%','40%']});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(field === 'taxdeductions'){
|
|
|
+ var value = obj.value;
|
|
|
+ if(isNaN(value)){ //判断输入是否是数字
|
|
|
+ layer.msg('请输入有效数字',{icon: 5,offset:['40%','40%']});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(value<0){
|
|
|
+ layer.msg('税金不能为负数',{icon: 5,offset:['40%','40%']});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
function updateProject(){
|
|
|
- var nameString = "";
|
|
|
- var nameString1 = "";
|
|
|
- $('table tr').each(function () {
|
|
|
- var unitType = $(this).find('td:eq(1)').text();
|
|
|
- var fee = $(this).find('td:eq(2)').text();
|
|
|
- if(unitType == ''){
|
|
|
- unitType = null
|
|
|
- }
|
|
|
- if(fee == ''){
|
|
|
- fee = null
|
|
|
- }
|
|
|
- nameString += unitType+",";
|
|
|
- nameString1 += fee+",";
|
|
|
- })
|
|
|
- var unitTypes = nameString.substring(5,nameString.length);
|
|
|
- var fees = nameString1.substring(5,nameString1.length);
|
|
|
- var ids = str.substring(0,str.length-1);
|
|
|
- $.ajax({
|
|
|
- type:"post",
|
|
|
- url:"${ctx}/project/withhold",
|
|
|
- data:{'ids':ids,'fees':fees,'unitTypes':unitTypes},
|
|
|
- success:function(result){
|
|
|
- layer.msg(result.msg, {icon: 6,offset:['38%','38%']},function () {
|
|
|
- parent.location.reload();
|
|
|
- });
|
|
|
- }
|
|
|
+ var nameString = "";
|
|
|
+ var nameString1 = "";
|
|
|
+ var materialString = "";
|
|
|
+ var taxString = "";
|
|
|
+ $('table tr').each(function () {
|
|
|
+ var unitType = $(this).find('td:eq(1)').text();
|
|
|
+ var fee = $(this).find('td:eq(2)').text();
|
|
|
+ var materialOffset = $(this).find('td:eq(3)').text();
|
|
|
+ var taxDeductions = $(this).find('td:eq(4)').text();
|
|
|
+ if(unitType == ''){
|
|
|
+ unitType = null
|
|
|
+ }else{
|
|
|
+ if(fee == ''){
|
|
|
+ layer.msg('您已输入单位工程,该诚信扣款不能为空',{icon: 5,offset:['40%','40%']});
|
|
|
+ throw SyntaxError;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(fee == ''){
|
|
|
+ fee = null
|
|
|
+ }else{
|
|
|
+ judge(fee,'诚信扣款');
|
|
|
+ }
|
|
|
+ if(materialOffset == ''){
|
|
|
+ materialOffset = null;
|
|
|
+ }else{
|
|
|
+ judge(materialOffset,'扣抵工程款');
|
|
|
+ }
|
|
|
+ if(taxDeductions == ''){
|
|
|
+ taxDeductions = null;
|
|
|
+ }else{
|
|
|
+ judge(taxDeductions,'税额扣减');
|
|
|
+ }
|
|
|
+ nameString += unitType+",";
|
|
|
+ nameString1 += fee+",";
|
|
|
+ materialString += materialOffset+",";
|
|
|
+ taxString+=taxDeductions+",";
|
|
|
+ })
|
|
|
+ var unitTypes = nameString.substring(5,nameString.length);
|
|
|
+ var fees = nameString1.substring(5,nameString1.length);
|
|
|
+ var materialStrings = materialString.substring(5,materialString.length);
|
|
|
+ var taxStrings= taxString.substring(5,taxString.length);
|
|
|
+ var ids = str.substring(0,str.length-1);
|
|
|
+ $.ajax({
|
|
|
+ type:"post",
|
|
|
+ url:"${ctx}/project/withhold",
|
|
|
+ data:{'ids':ids,'fees':fees,'unitTypes':unitTypes,'decFunds':materialStrings,'texs':taxStrings},
|
|
|
+ success:function(result){
|
|
|
+ layer.msg(result.msg, {icon: 6,offset:['38%','38%']},function () {
|
|
|
+ parent.location.reload();
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+function judge(value,name){
|
|
|
+ if(isNaN(value)){ //判断输入是否是数字
|
|
|
+ layer.msg(name+':请输入有效数字',{icon: 5,offset:['40%','40%']});
|
|
|
+ throw SyntaxError;
|
|
|
+ }
|
|
|
+ if(value<0){
|
|
|
+ layer.msg(name+'不能为负数',{icon: 5,offset:['40%','40%']});
|
|
|
+ throw SyntaxError;
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
</script>
|