فهرست منبع

渠道人员家庭成员管理 信息填报 不点添加 直接确定提交

wangguangping 3 سال پیش
والد
کامیت
a156e5d1ed
1فایلهای تغییر یافته به همراه117 افزوده شده و 15 حذف شده
  1. 117 15
      src/pages/main/memberFamily/empInfoFilling.vue

+ 117 - 15
src/pages/main/memberFamily/empInfoFilling.vue

@@ -250,9 +250,11 @@
             choline(v, n) {
                 let _this = this;
                 n.row.fillId = this.fillId;
+                // console.log(n.row);
                 let url = '';
                 if (v == 1) {
                     url = "/market/cMemberFillDetail/add"
+                    // _this.infodata.push({});
                 } else if (v == 3) {
                     url = "/market/cMemberFillDetail/update"
                 } else if (v == 2) {
@@ -459,7 +461,7 @@
                     },
                 }).then((res) => {
                     this.infodata = res.data.data;
-                    this.infodata.push({});
+                    this.infodata.push({fillId: this.fillId});
                 });
             },
             //添加
@@ -468,21 +470,121 @@
                     this.infolist = {};
                     this.dialogStatus = false;
                 }else{
-                    this.$http({
-                        url: "/market/cMemberFillDetail/saveFillDetailSummary",
-                        method: "post",
-                        headers: {
-                            "Content-Type": "application/json",
-                            "page": '{"pageNo":"' + 1 + '","pageSize":"100"}'
-                        },
-                        data: {
-                            fillId:this.fillId
-                        },
-                    }).then((res) => {
-                        this.infolist = {};
-                        this.dialogStatus = false;
-                    });
+                    let infodata1 = JSON.parse(JSON.stringify(this.infodata))
+                    let infodataLast = infodata1[infodata1.length-1]
+
+                    if(Object.keys(infodataLast).length >= 2){
+                        if(!infodataLast.memberRelation){
+                            this.$message({
+                                message: '请填写成员关系',
+                                type: 'error'
+                            });
+                            return false
+                        }
+                        
+                        if(!infodataLast.memberName){
+                            this.$message({
+                                message: '请填写成员姓名',
+                                type: 'error'
+                            });
+                            return false
+                        }
+                        
+                        if(!infodataLast.memberSex){
+                            this.$message({
+                                message: '请填写成员性别',
+                                type: 'error'
+                            });
+                            return false
+                        }
+                        if(!infodataLast.idCard){
+                            this.$message({
+                                message: '请填写成员身份证号',
+                                type: 'error'
+                            });
+                            return false
+                        }
+                        this.$http({
+                            url: "/market/cMemberFillDetail/saveFillDetailSummaryNew",
+                            method: "post",
+                            headers: {
+                                "Content-Type": "application/json",
+                                "page": '{"pageNo":"' + 1 + '","pageSize":"100"}'
+                            },
+                            data: infodata1,
+                        }).then((res) => {
+                            this.infolist = {};
+                            this.dialogStatus = false;
+                        });
+                    }else if(Object.keys(infodataLast).length == 1){
+                        this.$http({
+                            url: "/market/cMemberFillDetail/saveFillDetailSummaryNew",
+                            method: "post",
+                            headers: {
+                                "Content-Type": "application/json",
+                                "page": '{"pageNo":"' + 1 + '","pageSize":"100"}'
+                            },
+                            data: infodata1,
+                        }).then((res) => {
+                            this.infolist = {};
+                            this.dialogStatus = false;
+                        });
+                    }
+
+
+                    // let isInfodataNull = infodataLast.filter((item)=>{
+                    //     console.log(item.length);
+                    //     return item.length
+                    // })
+                    // console.log(isInfodataNull);  
+                // this.infodata.forEach((item,index)=>{
+                    // if(!infodataLast.memberRelation){
+                    //     this.$message({
+                    //         message: '请填写成员关系',
+                    //         type: 'error'
+                    //     });
+                    //     return false
+                    // }
+                    
+                    // if(!infodataLast.memberName){
+                    //     this.$message({
+                    //         message: '请填写成员姓名',
+                    //         type: 'error'
+                    //     });
+                    //     return false
+                    // }
+                    
+                    // if(!infodataLast.memberSex){
+                    //     this.$message({
+                    //         message: '请填写成员性别',
+                    //         type: 'error'
+                    //     });
+                    //     return false
+                    // }
+                    // if(!infodataLast.idCard){
+                    //     this.$message({
+                    //         message: '请填写成员身份证号',
+                    //         type: 'error'
+                    //     });
+                    //     return false
+                    // }
+                // })
+                    // this.$http({
+                    //     url: "/market/cMemberFillDetail/saveFillDetailSummaryNew",
+                    //     method: "post",
+                    //     headers: {
+                    //         "Content-Type": "application/json",
+                    //         "page": '{"pageNo":"' + 1 + '","pageSize":"100"}'
+                    //     },
+                    //     data: infodata1,
+                    // }).then((res) => {
+                    //     this.infolist = {};
+                    //     this.dialogStatus = false;
+                    // });
+                    // console.log(infodata1)
+                
                 }
+                
             },
             submitInfo(u) {
                 let _this = this;