dc0f5a29 by 杨威

宗地表单校验完善

1 parent aa47701f
...@@ -599,9 +599,6 @@ export default { ...@@ -599,9 +599,6 @@ export default {
599 rule: /^\s*$/g, //非空 599 rule: /^\s*$/g, //非空
600 }, 600 },
601 ) 601 )
602 if (ind == item.list.length-1) {
603 temp += item.list.length;
604 }
605 if(this.hasSyqx){ 602 if(this.hasSyqx){
606 rules.push( 603 rules.push(
607 { 604 {
...@@ -613,6 +610,9 @@ export default { ...@@ -613,6 +610,9 @@ export default {
613 } 610 }
614 ) 611 )
615 } 612 }
613 if (ind == item.list.length-1) {
614 temp += item.list.length;
615 }
616 }) 616 })
617 }) 617 })
618 this.rulesResult = true; 618 this.rulesResult = true;
...@@ -664,6 +664,18 @@ export default { ...@@ -664,6 +664,18 @@ export default {
664 664
665 // }, 665 // },
666 }, 666 },
667 watch:{
668 countList: {
669 handler : function (newVal, oldVal) {
670 newVal.forEach((item,ind)=>{
671 if(item.qlxzdm != ''){
672 this.$refs.qlxzdm[ind].$el.style.border=""
673 }
674 })
675 },
676 deep:true
677 } ,
678 }
667 }; 679 };
668 </script> 680 </script>
669 <style lang="less"> 681 <style lang="less">
......
...@@ -627,7 +627,6 @@ export default { ...@@ -627,7 +627,6 @@ export default {
627 updateZDxx(formData) { 627 updateZDxx(formData) {
628 //获取权利性质数据 628 //获取权利性质数据
629 this.formData.list = this.$refs.qlxzModule.getQlxzDataList(); 629 this.formData.list = this.$refs.qlxzModule.getQlxzDataList();
630 this.$refs.qlxzModule.getRules();
631 console.log(this.$refs.qlxzModule.getRulesResult(),'this.$refs.qlxzModule.getRules()'); 630 console.log(this.$refs.qlxzModule.getRulesResult(),'this.$refs.qlxzModule.getRules()');
632 //判断容密高是否为区间值,如果是区间值,则将输入框的值赋予 631 //判断容密高是否为区间值,如果是区间值,则将输入框的值赋予
633 this.formData.jyrjl = this.isInterval(this.formData.jyrjl) ? this.rjl : this.formData.jyrjl; 632 this.formData.jyrjl = this.isInterval(this.formData.jyrjl) ? this.rjl : this.formData.jyrjl;
...@@ -689,14 +688,8 @@ export default { ...@@ -689,14 +688,8 @@ export default {
689 rule: /^\s*$/g, //非空 688 rule: /^\s*$/g, //非空
690 }, 689 },
691 ] 690 ]
692 //判断宗地代码和不动产单元号是否手动修改过(宗地代码和不动产单元号的前14位是否和底盘代码一致)
693 if(this.formData.zddm.substring(0,14) != this.dpdm || this.formData.bdcdyh.substring(0,14) != this.dpdm){
694 this.$message({
695 message: '宗地代码或不动产单元号有误,请核对后再试一次',
696 type: "warning",
697 });
698 }else{
699 // console.log(this.rules,'rules'); 691 // console.log(this.rules,'rules');
692 this.$refs.qlxzModule.getRules();
700 let flag = true; 693 let flag = true;
701 this.rules.forEach(item=>{ 694 this.rules.forEach(item=>{
702 if(item.rule.test(item.data) || item.data == null){ 695 if(item.rule.test(item.data) || item.data == null){
...@@ -717,47 +710,55 @@ export default { ...@@ -717,47 +710,55 @@ export default {
717 } 710 }
718 }) 711 })
719 this.$nextTick(()=>{ 712 this.$nextTick(()=>{
720 if(flag){ 713 if(flag && this.$refs.qlxzModule.getRulesResult()){
721 //宗地面积处理 714 //宗地面积处理
722 // console.log(this.formData.zdmj,'this.formData.zdmj'); 715 // console.log(this.formData.zdmj,'this.formData.zdmj');
723 // this.formData.zdmj = this.formData.zdmj.replace(/[^\d\.]/g,'') 716 // this.formData.zdmj = this.formData.zdmj.replace(/[^\d\.]/g,'')
724 updateQjZdjbxx(this.formData) 717 //判断宗地代码和不动产单元号是否手动修改过(宗地代码和不动产单元号的前14位是否和底盘代码一致)
725 .then((res) => { 718 if(this.formData.zddm.substring(0,14) != this.dpdm || this.formData.bdcdyh.substring(0,14) != this.dpdm){
726 if (res.code == 200) { 719 this.$message({
727 console.log(res); 720 message: '宗地代码或不动产单元号有误,请核对后再试一次',
728 this.$message({ 721 type: "warning",
729 message: '保存成功', 722 });
730 type: "success", 723 }else{
731 }); 724 updateQjZdjbxx(this.formData)
732 // 保存成功再次查询 725 .then((res) => {
733 this.getZdjbxxData(this.$store.state.zdbsm); 726 if (res.code == 200) {
734 } else { 727 console.log(res);
735 this.$message({ 728 this.$message({
736 message: res.message, 729 message: '保存成功',
737 type: "warning", 730 type: "success",
738 }); 731 });
739 } 732 // 保存成功再次查询
740 }) 733 this.getZdjbxxData(this.$store.state.zdbsm);
741 .catch((error) => {}); 734 } else {
742 //保存到空间库里面 735 this.$message({
743 var self = this; 736 message: res.message,
744 for(var key in this.geoAttributes){ 737 type: "warning",
745 if(key == "BSM"){ 738 });
746 self.geoAttributes[key] = this.$store.state.zdbsm 739 }
747 }else if(key == 'QLSDFS'){
748 var qlsdfsList = self.$store.state.qlsdfsList,value = self.formData.qlsdfs;
749 var qlsdfs = qlsdfsList.filter(item => {
750 return item.bsm == value;
751 }) 740 })
752 self.geoAttributes[key] = qlsdfs[0] ? qlsdfs[0].mc:""; 741 .catch((error) => {});
753 }else { 742 //保存到空间库里面
754 var formKay = key.toLowerCase(); 743 var self = this;
755 self.geoAttributes[key] = self.formData[formKay]; 744 for(var key in this.geoAttributes){
745 if(key == "BSM"){
746 self.geoAttributes[key] = this.$store.state.zdbsm
747 }else if(key == 'QLSDFS'){
748 var qlsdfsList = self.$store.state.qlsdfsList,value = self.formData.qlsdfs;
749 var qlsdfs = qlsdfsList.filter(item => {
750 return item.bsm == value;
751 })
752 self.geoAttributes[key] = qlsdfs[0] ? qlsdfs[0].mc:"";
753 }else {
754 var formKay = key.toLowerCase();
755 self.geoAttributes[key] = self.formData[formKay];
756 }
756 } 757 }
758 self.updAttributes(this.$store.state.zdbsm,'zd',this.geoAttributes,function (res) {
759 console.log("属性保存完成!!");
760 });
757 } 761 }
758 self.updAttributes(this.$store.state.zdbsm,'zd',this.geoAttributes,function (res) {
759 console.log("属性保存完成!!");
760 });
761 }else{ 762 }else{
762 this.$message({ 763 this.$message({
763 // message: item.name+'不能为空', 764 // message: item.name+'不能为空',
...@@ -766,11 +767,6 @@ export default { ...@@ -766,11 +767,6 @@ export default {
766 }); 767 });
767 } 768 }
768 }) 769 })
769
770
771 }
772
773
774 770
775 }, 771 },
776 inputBlur(e){ 772 inputBlur(e){
...@@ -885,6 +881,16 @@ export default { ...@@ -885,6 +881,16 @@ export default {
885 zdbsm:function (val) { 881 zdbsm:function (val) {
886 this.getZdjbxxData(val) 882 this.getZdjbxxData(val)
887 this.curZdbsm = val; 883 this.curZdbsm = val;
884 },
885 "formData.bdcdyh":function (val) {
886 if (val != '') {
887 this.$refs.bdcdyh.style.border = '';
888 }
889 },
890 "formData.zddm":function (val) {
891 if (val != '') {
892 this.$refs.zddm.style.border = '';
893 }
888 } 894 }
889 }, 895 },
890 }; 896 };
......