52afc45b by zhaoqian

批量户的分摊系数限制

1 parent 371ca4ee
......@@ -314,7 +314,7 @@
methods: {
inputBlur(e){
if(e.target.value!==''&&e.target.value>0&&e.target.value<10){
if(e.target.value!==''&&+e.target.value>0&&+e.target.value<10){
e.target.style.border=""
}else{
e.target.style.border="1px solid red";
......@@ -424,12 +424,12 @@
data:this.form.ftxs,
name:'分摊系数',
dom:this.$refs.ftxs,
rule: /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/, //非空
rule:/^(?!0(\.0{1,2})?$)(\d(\.\d{1,2})?)$/, //大于0小于10的所有保留两位的数字
},
];
let flag = true;
this.rules.forEach(item=>{
if(item.rule.test(item.data) || item.data == null){
if(!item.rule.test(+item.data) || item.data == null){
if(item.dom.$el){
item.dom.$el.style.border = '1px solid red';
item.dom.$el.style.boxSizing = 'border-box';
......@@ -444,31 +444,41 @@
this.form['hbsms'] = this.bsms
this.form.qlxzList= this.$refs.qlxzModule.getQlxzDataList();
for(let i=0;i< this.form.fwjgList.length;i++){
if(this.form.fwjgList[i].fwjgzdbsm===''){
this.form.fwjgList.splice(i,1);
}
}
for(let i=0;i< this.form.fwytList.length;i++){
if(this.form.fwytList[i].fwsjytbsm===''){
this.form.fwytList.splice(i,1);
}
}
for(let i=0;i< this.form.qlxzList.length;i++){
if(this.form.qlxzList[i].qlxzdm===''){
this.form.qlxzList.splice(i,1);
}
}
console.log("批量户信息")
console.log(this.form)
batchUpdateQjH(this.form).then((res)=>{
if(res.code===200){
this.lodding()
this.$message.success("保存成功!")
this.$nextTick(()=>{
this.reset();
this.$nextTick(()=> {
if (flag) {
for(let i=0;i< this.form.fwjgList.length;i++){
if(this.form.fwjgList[i].fwjgzdbsm===''){
this.form.fwjgList.splice(i,1);
}
}
for(let i=0;i< this.form.fwytList.length;i++){
if(this.form.fwytList[i].fwsjytbsm===''){
this.form.fwytList.splice(i,1);
}
}
for(let i=0;i< this.form.qlxzList.length;i++){
if(this.form.qlxzList[i].qlxzdm===''){
this.form.qlxzList.splice(i,1);
}
}
console.log("批量户信息")
console.log(this.form)
batchUpdateQjH(this.form).then((res)=>{
if(res.code===200){
this.lodding()
this.$message.success("保存成功!")
this.$nextTick(()=>{
this.reset();
})
this.close();
}
})
this.close();
}else{
this.$message({
// message: item.name+'不能为空',
message: '表单数据有误',
type: "warning",
});
}
})
},
......