roose 4 år sedan
förälder
incheckning
131c06d89f
2 ändrade filer med 194 tillägg och 33 borttagningar
  1. 178 15
      pages/collectInfo/collectInfo.js
  2. 16 18
      pages/collectInfo/collectInfo.wxml

+ 178 - 15
pages/collectInfo/collectInfo.js

@@ -46,6 +46,8 @@ Page({
       nation: '', //民族
       nation: '', //民族
       idNumber: '', //身份证号
       idNumber: '', //身份证号
       phone: '',
       phone: '',
+      chooseAdressArr: [],
+      chooseAdressArr1: [],
       oldMarry: [{
       oldMarry: [{
         name: "未婚"
         name: "未婚"
       }, {
       }, {
@@ -555,6 +557,8 @@ Page({
             nation: '',
             nation: '',
             idNumber: '',
             idNumber: '',
             phone: '',
             phone: '',
+            chooseAdressArr: [],
+      chooseAdressArr1: [],
             oldMarry: [{
             oldMarry: [{
               name: "未婚"
               name: "未婚"
             }, {
             }, {
@@ -1165,6 +1169,27 @@ Page({
       })
       })
     }
     }
   },
   },
+    // 补充户籍地址
+    tab1Change6(e) {
+      console.log(e.detail.value)
+      this.SubmitOldmanInfo({
+        id: this.data.nameArr[this.data.activeIndex]._id,
+        nativePlaceExt: e.detail.value
+      })
+    },
+    // 现居地址与户籍地址一致
+    tab1change6_1(e) {
+      console.log(e)
+  
+    },
+      // 补充现居住地址
+    tab1Change7(e) {
+      console.log(e.detail.value)
+      this.SubmitOldmanInfo({
+        id: this.data.nameArr[this.data.activeIndex]._id,
+        addressExt: e.detail.value
+      })
+    },
   // 婚姻以及配偶情况
   // 婚姻以及配偶情况
   tab1Change8: function (e) {
   tab1Change8: function (e) {
     console.log(e.detail.value)
     console.log(e.detail.value)
@@ -3310,6 +3335,8 @@ Page({
         nation: '', //民族
         nation: '', //民族
         idNumber: '', //身份证号
         idNumber: '', //身份证号
         phone: '',
         phone: '',
+        chooseAdressArr: [],
+      chooseAdressArr1: [],
         oldMarry: [{
         oldMarry: [{
           name: "未婚"
           name: "未婚"
         }, {
         }, {
@@ -3575,27 +3602,94 @@ Page({
     }
     }
 
 
   },
   },
-
   chooseAdress() {
   chooseAdress() {
+    if (this.data.oldInfo[this.data.activeIndex].chooseAdressArr.length == 0) {
+      wx.request({
+        url: util.globalData.publicUrl + '/civilregionalism/deptList',
+        method: "get",
+        header: {
+          appletsId: wx.getStorageSync('openId')
+        },
+        success: (res) => {
+          this.setData({
+            showAdress: true,
+            provinceArr: res.data.data
+          })
+        }
+      })
+    }
+    this.setData({
+      showAdress: true
+    })
+  },
+  // 选择现居地址
+  chooseAdress1() {
+    if (this.data.oldInfo[this.data.activeIndex].chooseAdressArr1.length == 0) {
+      wx.request({
+        url: util.globalData.publicUrl + '/civilregionalism/deptList',
+        method: "get",
+        header: {
+          appletsId: wx.getStorageSync('openId')
+        },
+        success: (res) => {
+          console.log(res.data.data)
+          this.setData({
+            showAdress1: true,
+            provinceArr1: res.data.data
+          })
+        }
+      })
+    }
+    this.setData({
+      showAdress1: true
+    })
+  },
+  provinceClick(e) {
+    console.log(e.currentTarget.dataset.item)
+    wx.showLoading({
+      title: '选择中',
+      mask: true
+    })
+    this.data.oldInfo[this.data.activeIndex].chooseAdressArr.push(e.currentTarget.dataset.item)
     wx.request({
     wx.request({
       url: util.globalData.publicUrl + '/civilregionalism/deptList',
       url: util.globalData.publicUrl + '/civilregionalism/deptList',
       method: "get",
       method: "get",
       header: {
       header: {
         appletsId: wx.getStorageSync('openId')
         appletsId: wx.getStorageSync('openId')
       },
       },
+      data: {
+        fid: e.currentTarget.dataset.item.CIVILREGIONALISMID
+      },
       success: (res) => {
       success: (res) => {
-        console.log(res.data.data)
         this.setData({
         this.setData({
-          showAdress: true,
-          provinceArr: res.data.data
+          provinceArr: res.data.data,
+          isAdress: true,
+          oldInfo: this.data.oldInfo
         })
         })
+        if (res.data.data.length == 0) {
+          this.setData({
+            pleaseChoose: false
+          })
+        }
+        if (this.data.oldInfo[this.data.activeIndex].chooseAdressArr.length == 5) {
+          this.SubmitOldmanInfo({
+            id: this.data.nameArr[this.data.activeIndex]._id,
+            // childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
+          })
+        }
+        console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr, '我是添加的数组')
+        wx.hideLoading()
       }
       }
     })
     })
+    // }
   },
   },
-  provinceClick(e) {
+  provinceClick1(e) {
     console.log(e.currentTarget.dataset.item)
     console.log(e.currentTarget.dataset.item)
-    this.data.chooseAdressArr.push(e.currentTarget.dataset.item)
-    console.log(this.data.chooseAdressArr)
+    wx.showLoading({
+      title: '选择中',
+      mask: true
+    })
+    this.data.oldInfo[this.data.activeIndex].chooseAdressArr1.push(e.currentTarget.dataset.item)
     wx.request({
     wx.request({
       url: util.globalData.publicUrl + '/civilregionalism/deptList',
       url: util.globalData.publicUrl + '/civilregionalism/deptList',
       method: "get",
       method: "get",
@@ -3607,30 +3701,48 @@ Page({
       },
       },
       success: (res) => {
       success: (res) => {
         this.setData({
         this.setData({
-          provinceArr: res.data.data,
-          isAdress: true,
-          chooseAdressArr: this.data.chooseAdressArr
+          provinceArr1: res.data.data,
+          isAdress1: true,
+          oldInfo: this.data.oldInfo
         })
         })
         if (res.data.data.length == 0) {
         if (res.data.data.length == 0) {
           this.setData({
           this.setData({
-            pleaseChoose: false
+            pleaseChoose1: false
+          })
+        }
+        if (this.data.oldInfo[this.data.activeIndex].chooseAdressArr1.length == 5) {
+          this.SubmitOldmanInfo({
+            id: this.data.nameArr[this.data.activeIndex]._id,
+            // childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
           })
           })
         }
         }
+        console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr, '我是添加的数组')
+        wx.hideLoading()
       }
       }
     })
     })
+    // }
   },
   },
   closeAdress() {
   closeAdress() {
     this.setData({
     this.setData({
       showAdress: false
       showAdress: false
     })
     })
   },
   },
+  closeAdress1() {
+    this.setData({
+      showAdress1: false
+    })
+  },
   reSelect(e) {
   reSelect(e) {
+    let Info = 'oldInfo[' + this.data.activeIndex + '].chooseAdressArr'
+    console.log(e.currentTarget.dataset.index)
     this.setData({
     this.setData({
-      chooseAdressArr: this.data.chooseAdressArr.slice(0, e.currentTarget.dataset.index)
+      [Info]: this.data.oldInfo[this.data.activeIndex].chooseAdressArr.slice(0, e.currentTarget.dataset.index),
+      oldInfo: this.data.oldInfo
     })
     })
+    console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr)
     let fid;
     let fid;
-    if (this.data.chooseAdressArr.length != 0) {
-      fid = this.data.chooseAdressArr[this.data.chooseAdressArr.length - 1].CIVILREGIONALISMID;
+    if (this.data.oldInfo[this.data.activeIndex].chooseAdressArr.length != 0) {
+      fid = this.data.oldInfo[this.data.activeIndex].chooseAdressArr[this.data.oldInfo[this.data.activeIndex].chooseAdressArr.length - 1].CIVILREGIONALISMID;
     } else {
     } else {
       fid = ''
       fid = ''
     }
     }
@@ -3647,13 +3759,64 @@ Page({
         this.setData({
         this.setData({
           provinceArr: res.data.data,
           provinceArr: res.data.data,
           isAdress: true,
           isAdress: true,
-          chooseAdressArr: this.data.chooseAdressArr
+          oldInfo: this.data.oldInfo
         })
         })
         if (res.data.data.length == 0) {
         if (res.data.data.length == 0) {
           this.setData({
           this.setData({
             pleaseChoose: false
             pleaseChoose: false
           })
           })
         }
         }
+        console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr, '我是添加的数组')
+        wx.hideLoading()
+        // this.setData({
+        //   provinceArr: res.data.data,
+        //   isAdress: true,
+        //   [Info]: this.data.oldInfo
+        // })
+        // if (res.data.data.length == 0) {
+        //   this.setData({
+        //     pleaseChoose: false
+        //   })
+        // }
+      }
+    })
+  },
+  reSelect1(e) {
+    let Info = 'oldInfo[' + this.data.activeIndex + '].chooseAdressArr1'
+    console.log(e.currentTarget.dataset.index)
+    this.setData({
+      [Info]: this.data.oldInfo[this.data.activeIndex].chooseAdressArr1.slice(0, e.currentTarget.dataset.index),
+      oldInfo: this.data.oldInfo
+    })
+    console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr1)
+    let fid;
+    if (this.data.oldInfo[this.data.activeIndex].chooseAdressArr1.length != 0) {
+      fid = this.data.oldInfo[this.data.activeIndex].chooseAdressArr1[this.data.oldInfo[this.data.activeIndex].chooseAdressArr1.length - 1].CIVILREGIONALISMID;
+    } else {
+      fid = ''
+    }
+    wx.request({
+      url: util.globalData.publicUrl + '/civilregionalism/deptList',
+      method: "get",
+      header: {
+        appletsId: wx.getStorageSync('openId')
+      },
+      data: {
+        fid
+      },
+      success: (res) => {
+        this.setData({
+          provinceArr1: res.data.data,
+          isAdress1: true,
+          oldInfo: this.data.oldInfo
+        })
+        if (res.data.data.length == 0) {
+          this.setData({
+            pleaseChoose1: false
+          })
+        }
+        console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr1, '我是添加的数组')
+        wx.hideLoading()
       }
       }
     })
     })
   },
   },

+ 16 - 18
pages/collectInfo/collectInfo.wxml

@@ -1,7 +1,7 @@
 <wxs module="urls" src="../../utils/photoUrl.wxs"></wxs>
 <wxs module="urls" src="../../utils/photoUrl.wxs"></wxs>
 <view class="container1">
 <view class="container1">
 <!--  wx:if="{{showBj}}" -->
 <!--  wx:if="{{showBj}}" -->
-	<view class="{{showBj ? 'writeOldmanName':'none'}} ">
+	<view class="{{showBj ? 'writeOldmanName':'none'}} " hidden="{{!showBj}}"   >
 		<view class="   OldmanName_box">
 		<view class="   OldmanName_box">
 			<view class="oldmanname">请输入老人姓名1111111111</view>
 			<view class="oldmanname">请输入老人姓名1111111111</view>
 			<!--   -->
 			<!--   -->
@@ -23,10 +23,9 @@
 		</view>
 		</view>
 	</view>
 	</view>
 	<van-popup show="{{ showAdress }}" round position="bottom" custom-style="height: 70%" bind:close="closeAdress">
 	<van-popup show="{{ showAdress }}" round position="bottom" custom-style="height: 70%" bind:close="closeAdress">
-		<!-- <image src="../../images/mz/closebtn.png" class="close_img" bindtap="closeAdress"></image> -->
 		<view class="choosedAdress_box">
 		<view class="choosedAdress_box">
-			<view class="choosedAdress" wx:for='{{chooseAdressArr}}' bindtap="reSelect" data-index="{{index}}" data-value="{{item}}">
-				<image src="../../images/mz/step_finish.png" style="width:30rpx;height:30rpx;margin-left:10rpx;marign-right:10rpx"></image>{{item.CIVILREGIONALISMNAME}}
+			<view class="choosedAdress" wx:for='{{oldInfo[activeIndex].chooseAdressArr}}' bindtap="reSelect" data-index="{{index}}" data-value="{{item}}">
+				<image src="../../images/mz/step_finish.png" style="width:30rpx;height:30rpx;margin-left:10rpx;marign-right:20rpx"></image>{{item.CIVILREGIONALISMNAME}}
 			</view>
 			</view>
 		</view>
 		</view>
 		<view class="adress_title" wx:if="{{pleaseChoose}}">请选择</view>
 		<view class="adress_title" wx:if="{{pleaseChoose}}">请选择</view>
@@ -36,20 +35,19 @@
 			</view>
 			</view>
 		</view>
 		</view>
 	</van-popup>
 	</van-popup>
-	<!-- <view class="adress_box" wx:if="{{showAdress}}">
-		<image src="../../images/mz/closebtn.png" class="close_img" bindtap="closeAdress"></image>
+		<van-popup show="{{ showAdress1 }}" round position="bottom" custom-style="height: 70%" bind:close="closeAdress1">
 		<view class="choosedAdress_box">
 		<view class="choosedAdress_box">
-			<view class="choosedAdress" wx:for='{{chooseAdressArr}}' bindtap="reSelect" data-index="{{index}}" data-value="{{item}}">
-				<image src="../../images/mz/step_finish.png" style="width:30rpx;height:30rpx;margin-left:10rpx;marign-left:10rpx"></image>{{item.CIVILREGIONALISMNAME}}
+			<view class="choosedAdress" wx:for='{{oldInfo[activeIndex].chooseAdressArr1}}' bindtap="reSelect1" data-index="{{index}}" data-value="{{item}}">
+				<image src="../../images/mz/step_finish.png" style="width:30rpx;height:30rpx;margin-left:10rpx;marign-right:20rpx"></image>{{item.CIVILREGIONALISMNAME}}
 			</view>
 			</view>
 		</view>
 		</view>
-		<view class="adress_title" wx:if="{{pleaseChoose}}">请选择</view>
+		<view class="adress_title" wx:if="{{pleaseChoose1}}">请选择</view>
 		<view class="adress_detail">
 		<view class="adress_detail">
-			<view wx:for='{{provinceArr}}'>
-				<view bindtap="provinceClick" data-item="{{item}}">{{item.CIVILREGIONALISMNAME}}</view>
+			<view wx:for='{{provinceArr1}}'>
+				<view bindtap="provinceClick1" data-item="{{item}}">{{item.CIVILREGIONALISMNAME}}</view>
 			</view>
 			</view>
 		</view>
 		</view>
-	</view> -->
+	</van-popup>
 	<view class="left">
 	<view class="left">
 		<view class="block1 {{currentIndex!=0?'clickblock1':''}}" bindtap="turn" data-index="0">
 		<view class="block1 {{currentIndex!=0?'clickblock1':''}}" bindtap="turn" data-index="0">
 			<image src="{{currentIndex==0?src1:src2}}" class="img"></image>
 			<image src="{{currentIndex==0?src1:src2}}" class="img"></image>
@@ -122,13 +120,13 @@
 				<view class="block"><text class="red">*</text>联系电话<input bindblur="tab1Change5" placeholder="请填写联系电话" value="{{oldInfo[activeIndex].phone}}" /></view>
 				<view class="block"><text class="red">*</text>联系电话<input bindblur="tab1Change5" placeholder="请填写联系电话" value="{{oldInfo[activeIndex].phone}}" /></view>
 				<view wx:if="{{oldPhone}}" class="required">老人联系电话不能为空哦!</view>
 				<view wx:if="{{oldPhone}}" class="required">老人联系电话不能为空哦!</view>
 				<view wx:if="{{oldPhone1}}" class="required">老人联系电话格式不对哦!</view>
 				<view wx:if="{{oldPhone1}}" class="required">老人联系电话格式不对哦!</view>
-				<view class="block"><text class="red">*</text>户籍地址
-					<view class="otherinput" bindtap="chooseAdress">点击选择户籍地址</view>
-					<input bindblur="tab1Change6" placeholder="请填写补充户籍地址" name="name" />
+				<view class="block"><text class="red">*</text>户籍地址<text bindtap="chooseAdress" style="color:#2087f7;font-size:24rpx;margin-left:20rpx">点我选择户籍地址</text>
+					<textarea class="otherinput" style="height:auto" disabled="true"  wx:if="{{oldInfo[activeIndex].chooseAdressArr.length==5}}">{{oldInfo[activeIndex].chooseAdressArr[0].CIVILREGIONALISMNAME}},{{oldInfo[activeIndex].chooseAdressArr[1].CIVILREGIONALISMNAME}},{{oldInfo[activeIndex].chooseAdressArr[2].CIVILREGIONALISMNAME}},{{oldInfo[activeIndex].chooseAdressArr[3].CIVILREGIONALISMNAME}},{{oldInfo[activeIndex].chooseAdressArr[4].CIVILREGIONALISMNAME}}</textarea>
+					<input bindblur="tab1Change6" placeholder="请填写补充户籍地址"/>
 				</view>
 				</view>
-				<checkbox value="cb" color="#fff" style="margin-top:20rpx" />现居地址与户籍地址一致
-				<view class="block"><text class="red">*</text>现居地址
-					<view class="otherinput">点击选择现居地址</view>
+				<checkbox color="#fff" style="margin-top:20rpx" bindchange="tab1change6_1"/>现居地址与户籍地址一致
+				<view class="block"><text class="red">*</text>现居地址<text bindtap="chooseAdress1" style="color:#2087f7;font-size:24rpx;margin-left:20rpx">点我选择现居地址</text>
+				<textarea class="otherinput" style="height:auto" disabled="true"  wx:if="{{oldInfo[activeIndex].chooseAdressArr1.length==5}}">{{oldInfo[activeIndex].chooseAdressArr1[0].CIVILREGIONALISMNAME}},{{oldInfo[activeIndex].chooseAdressArr1[1].CIVILREGIONALISMNAME}},{{oldInfo[activeIndex].chooseAdressArr1[2].CIVILREGIONALISMNAME}},{{oldInfo[activeIndex].chooseAdressArr1[3].CIVILREGIONALISMNAME}},{{oldInfo[activeIndex].chooseAdressArr1[4].CIVILREGIONALISMNAME}}</textarea>
 					<input bindblur="tab1Change7" placeholder="请填写补充现居地址" name="name" />
 					<input bindblur="tab1Change7" placeholder="请填写补充现居地址" name="name" />
 				</view>
 				</view>
 				<view class="block">
 				<view class="block">