ssfg преди 4 години
родител
ревизия
d3b05bb906
променени са 2 файла, в които са добавени 72 реда и са изтрити 179 реда
  1. 70 151
      pages/collectInfo/collectInfo.js
  2. 2 28
      pages/collectInfo/collectInfo.wxml

+ 70 - 151
pages/collectInfo/collectInfo.js

@@ -5,10 +5,8 @@ var isonShow;
 var isTwoOnshow;
 Page({
   data: {
-    // isVisittimesnull: true,
-    // visitWaysFromOther: true,
-    // showLoading:false,
-    // fiveLeave:true,
+    codeArr: [],
+    nowAdress: false,
     color: '#898989',
     paizhaofalg: false,
     activeIndex: 0,
@@ -361,31 +359,6 @@ Page({
       '0次', '1次', '2次及以上'
     ],
     // tab4
-    // regularsInfo: {
-    //   visitMode: '', //巡访方式 如果选了其他也是必填 多选
-    //   visitModeExt: '', //巡访方式--其它
-    //   visitCount: '', //巡访频次, 如果选了其他也是必填 单选
-    //   visitCountExt: '', //巡访频次--其它
-    // },
-    // visitWays: [{
-    //   name: '电话问候'
-    // }, {
-    //   name: '上门巡访'
-    // }, {
-    //   name: '其它'
-    // }],
-    // visitTimes: [{
-    //   name: '每天'
-    // }, {
-    //   name: '每周'
-    // }, {
-    //   name: '每月'
-    // }, {
-    //   name: '每季'
-    // }, {
-    //   name: '其它'
-    // }],
-    // syrIndex:
     regularsInfos: [{
       visitMode: [{
         name: '电话问候',
@@ -432,7 +405,6 @@ Page({
     multiIndex: [0, 0, 0, 0, 0]
   },
   chooseAdress() {
-
     let arr = 'multiArray[0]'
     wx.request({
       url: util.globalData.publicUrl + '/civilregionalism/deptList',
@@ -446,7 +418,6 @@ Page({
         res.data.data.forEach(item => {
           newdata.push(item);
         });
-        console.log(newdata)
         for (var i = 0; i < newdata.length; i++) {
           if (newdata[i].CIVILREGIONALISMNAME == '吉林省') {
             j = i;
@@ -462,8 +433,6 @@ Page({
     })
   },
   chooseAdress2(fid) {
-
-    console.log(fid)
     let mid;
     if (fid) {
       mid = fid
@@ -482,7 +451,6 @@ Page({
         fid: mid
       },
       success: (res) => {
-        console.log(res.data.data, '我是二级内容')
         res.data.data.forEach(item => {
           newdata.push(item)
         });
@@ -494,8 +462,6 @@ Page({
     })
   },
   chooseAdress3(fid) {
-
-    console.log(fid)
     let mid;
     if (fid) {
       mid = fid
@@ -514,7 +480,6 @@ Page({
         fid: mid
       },
       success: (res) => {
-        console.log(res.data.data, '我是三级内容')
         res.data.data.forEach(item => {
           newdata.push(item)
         });
@@ -526,8 +491,6 @@ Page({
     })
   },
   chooseAdress4(fid) {
-
-    console.log(fid)
     let mid;
     if (fid) {
       mid = fid
@@ -546,7 +509,6 @@ Page({
         fid: mid
       },
       success: (res) => {
-        console.log(res.data.data, '我是四级内容')
         res.data.data.forEach(item => {
           newdata.push(item)
         });
@@ -558,7 +520,6 @@ Page({
     })
   },
   chooseAdress5(fid) {
-    console.log(fid)
     let mid;
     if (fid) {
       mid = fid
@@ -577,7 +538,6 @@ Page({
         fid: mid
       },
       success: (res) => {
-        console.log(res.data.data, '我是五级内容')
         res.data.data.forEach(item => {
           newdata.push(item)
         });
@@ -589,7 +549,6 @@ Page({
     })
   },
   bindMultiPickerChange: function (e) {
-    console.log(this.data.multiArray, '我是数组111111111')
     let arr = 'oldInfo[' + this.data.activeIndex + '].chooseAdressArr'
     let province = this.data.multiArray[0][e.detail.value[0]].CIVILREGIONALISMNAME;
     let city = this.data.multiArray[1][e.detail.value[1]].CIVILREGIONALISMNAME;
@@ -603,13 +562,14 @@ Page({
     let villageCode = this.data.multiArray[4][e.detail.value[4]].CIVILREGIONALISMCODE;
     this.setData({
       multiIndex: e.detail.value,
-      [arr]: []
+      [arr]: [],
+      codeArr: []
     })
-    let codeArr = [];
-    codeArr.push(provinceCode, cityCode, areaCode, townCode, villageCode)
+    this.data.codeArr.push(provinceCode, cityCode, areaCode, townCode, villageCode)
     this.data.oldInfo[this.data.activeIndex].chooseAdressArr.push(province, city, area, town, village)
     let a = this.data.oldInfo[this.data.activeIndex].chooseAdressArr.join("/");
-    let b = codeArr.join(",")
+    let b = this.data.codeArr.join(",")
+    console.log(this.data.codeArr, '我是codeArr00000')
     this.SubmitOldmanInfo({
       id: this.data.nameArr[this.data.activeIndex]._id,
       nativePlace: a,
@@ -618,6 +578,23 @@ Page({
     this.setData({
       [arr]: this.data.oldInfo[this.data.activeIndex].chooseAdressArr
     })
+    console.log(this.data.oldInfo[this.data.activeIndex].isSameWithAddress, '是否一致?')
+    if (this.data.oldInfo[this.data.activeIndex].isSameWithAddress[0].checked) {
+      let Info = 'oldInfo[' + this.data.activeIndex + '].chooseAdressArr1'
+      let Infos = 'oldInfo[' + this.data.activeIndex + '].addressExt'
+      this.setData({
+        [Info]: this.data.oldInfo[this.data.activeIndex].chooseAdressArr,
+        [Infos]: this.data.oldInfo[this.data.activeIndex].nativePlaceExt
+      })
+      let a = this.data.oldInfo[this.data.activeIndex].chooseAdressArr.join("/");
+      console.log(this.data.codeArr)
+      let b = this.data.codeArr.join(",")
+      this.SubmitOldmanInfo({
+        id: this.data.nameArr[this.data.activeIndex]._id,
+        address: a,
+        addressId: b
+      })
+    }
   },
   bindMultiPickerColumnChange: function (e) {
     if (e.detail.column == 0) {
@@ -631,7 +608,6 @@ Page({
     }
   },
   bindMultiPickerChange1: function (e) {
-    console.log(this.data.multiArray, '我是数组2222222222')
     let arr = 'oldInfo[' + this.data.activeIndex + '].chooseAdressArr1'
     let province = this.data.multiArray[0][e.detail.value[0]].CIVILREGIONALISMNAME;
     let city = this.data.multiArray[1][e.detail.value[1]].CIVILREGIONALISMNAME;
@@ -1492,11 +1468,6 @@ Page({
   },
   // 现居地址与户籍地址一致
   tab1change6_1(e) {
-    console.log(e.detail.value)
-    let Info = 'oldInfo[' + this.data.activeIndex + '].chooseAdressArr1'
-    let Infos = 'oldInfo[' + this.data.activeIndex + '].addressExt'
-    let address = 'oldInfo[' + this.data.activeIndex + '].address'
-
     const items = this.data.oldInfo[this.data.activeIndex].isSameWithAddress
     const values = e.detail.value
     for (let i = 0, lenI = items.length; i < lenI; ++i) {
@@ -1512,46 +1483,43 @@ Page({
     this.setData({
       [isSameWithAddress]: items
     })
-
-
-
-    console.log(this.data.oldInfo[this.data.activeIndex].nativePlaceExt, "打印下这个");
+    console.log(this.data.oldInfo[this.data.activeIndex].isSameWithAddress, 'isSameWithAddress')
+    console.log(e.detail.value)
+    let Info = 'oldInfo[' + this.data.activeIndex + '].chooseAdressArr1'
+    let Infos = 'oldInfo[' + this.data.activeIndex + '].addressExt'
     if (e.detail.value[0] == '现居地址与户籍地址一致') {
-      if (this.data.oldInfo[this.data.activeIndex].chooseAdressArr.length == 5) {
-        let nativePlaceId = '';
-        let nativePlace = '';
-        for (let value of this.data.oldInfo[this.data.activeIndex].chooseAdressArr) {
-          nativePlace += value.CIVILREGIONALISMNAME + '/'
-          nativePlaceId += value.CIVILREGIONALISMID + ','
-          console.log(value, "打印下");
-        }
-        this.SubmitOldmanInfo({
-          id: this.data.nameArr[this.data.activeIndex]._id,
-          address: nativePlace.substring(0, nativePlace.length - 1),
-          addressId: nativePlaceId.substring(0, nativePlaceId.length - 1),
-        })
-      }
+      this.setData({
+        nowAdress: true,
+        [Info]: this.data.oldInfo[this.data.activeIndex].chooseAdressArr,
+        [Infos]: this.data.oldInfo[this.data.activeIndex].nativePlaceExt
+      })
       this.SubmitOldmanInfo({
         id: this.data.nameArr[this.data.activeIndex]._id,
-        isSameWithAddress: '是',
-        addressExt: this.data.oldInfo[this.data.activeIndex].nativePlaceExt,
-
+        isSameWithAddress: '是'
       })
-      this.setData({
-        [Info]: this.data.oldInfo[this.data.activeIndex].chooseAdressArr,
-        [Infos]: this.data.oldInfo[this.data.activeIndex].nativePlaceExt,
+      let a = this.data.oldInfo[this.data.activeIndex].chooseAdressArr.join("/");
+      console.log(this.data.codeArr)
+      let b = this.data.codeArr.join(",")
+      this.SubmitOldmanInfo({
+        id: this.data.nameArr[this.data.activeIndex]._id,
+        address: a,
+        addressId: b
       })
     } else {
+      this.setData({
+        nowAdress: false,
+        [Info]: [],
+        [Infos]: []
+      })
       this.SubmitOldmanInfo({
         id: this.data.nameArr[this.data.activeIndex]._id,
-        isSameWithAddress: '否',
-        addressExt: '',
+        isSameWithAddress: '否'
       })
-      this.setData({
-        [Info]: '',
-        [Infos]: '',
+      this.SubmitOldmanInfo({
+        id: this.data.nameArr[this.data.activeIndex]._id,
+        address: null,
+        addressId: null
       })
-      console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr1)
     }
   },
   // 补充现居住地址
@@ -1808,7 +1776,7 @@ Page({
     }
     this.SubmitOldmanInfo({
       id: this.data.nameArr[this.data.activeIndex]._id,
-      majorDiseases: JSON.stringify(e.detail.value)
+      majorDiseases: e.detail.value
     })
   },
   // 残疾人等级
@@ -1843,7 +1811,7 @@ Page({
     }
     this.SubmitOldmanInfo({
       id: this.data.nameArr[this.data.activeIndex]._id,
-      ability: this.data.disableLeval[e.detail.value]
+      ability: this.data.ableStatus[e.detail.value]
     })
   },
   // 生活经济情况
@@ -2058,7 +2026,7 @@ Page({
     if (index < 0 && e.detail.value.length != 0) {
       this.SubmitOldmanInfo({
         id: this.data.nameArr[this.data.activeIndex]._id,
-        accompany: JSON.stringify(e.detail.value)
+        accompany: e.detail.value
       })
     }
   },
@@ -2147,19 +2115,11 @@ Page({
       })
     }
     if (index < 0 && e.detail.value.length != 0) {
-      // this.setData({
-      //   ofenmanDetail: true
-      // })
       this.SubmitOldmanInfo({
         id: this.data.nameArr[this.data.activeIndex]._id,
-        lookAfter: JSON.stringify(e.detail.value)
+        lookAfter: e.detail.value
       })
     }
-    // else {
-    //   this.setData({
-    //     ofenmanDetail: false
-    //   })
-    // }
   },
   // 其他人员关系
   tab1Change20: function (e) {
@@ -2318,35 +2278,15 @@ Page({
     let index2 = e.detail.value.indexOf('分散供养特困老年人')
     let index3 = e.detail.value.indexOf('计划生育特殊家庭老人')
     let index4 = e.detail.value.indexOf('空巢老年人')
-    // let revise1 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[1].disabled'
     let revise1 = "oldInfo[" + this.data.activeIndex + "].oldType[0].disable";
     let revise2 = "oldInfo[" + this.data.activeIndex + "].oldType[1].disable";
     let revise3 = "oldInfo[" + this.data.activeIndex + "].oldType[2].disable";
     let revise4 = "oldInfo[" + this.data.activeIndex + "].oldType[3].disable";
-    let revise5 = "oldInfo[" + this.data.activeIndex + "].oldType[3].checked";
+    // let revise5 = "oldInfo[" + this.data.activeIndex + "].oldType[4].checked";
     this.SubmitOldmanInfo({
       id: this.data.nameArr[this.data.activeIndex]._id,
       oldType: JSON.stringify(e.detail.value)
     })
-    // if (index1 >= 0) {
-    //   this.setData({
-    //     [revise2]: true,
-    //     [revise3]: true,
-    //     [revise4]: true,
-    //     [revise5]: true
-    //   })
-    //   return false;
-    // } else {
-    //   console.log("反選的");
-    //   this.setData({
-    //     // [revise1]: false,
-    //     [revise2]: false,
-    //     [revise3]: false,
-    //     [revise4]: false,
-    //     [revise5]: false
-    //   })
-    //   index4 = -1;
-    // }
     if (index2 >= 0) {
       this.setData({
         [revise1]: true,
@@ -2375,46 +2315,27 @@ Page({
         [revise4]: false
       })
     }
-    // if (index4 >= 0) {
-    //   this.setData({
-    //     [revise1]: true,
-    //     [revise2]: true,
-    //     [revise3]: true
-    //   })
-    //   return false;
-    // } else {
-    //   this.setData({
-    //     [revise1]: false,
-    //     [revise2]: false,
-    //     [revise3]: false
-    //   })
-    // }
     if (index1 >= 0) {
       this.setData({
         [revise2]: true,
         [revise3]: true,
         [revise4]: true,
-        [revise5]: true
+        // [revise5]: true
       })
       return false;
     } else if (index4 >= 0) {
       this.setData({
-        [revise1]: false,
-        [revise2]: false,
-        [revise3]: false,
-        [revise4]: false,
-        [revise5]: true
+        [revise1]: true,
+        [revise2]: true,
+        [revise3]: true
       })
     } else {
       this.setData({
         [revise1]: false,
         [revise2]: false,
-        [revise3]: false,
-        [revise4]: false,
-
+        [revise3]: false
       })
     }
-
   },
   goPhoto() {
     let that = this;
@@ -2669,8 +2590,9 @@ Page({
   tab2Change7: function (e) {
     console.log(e.detail.value)
     let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].outgoingplace';
+    let a = e.detail.value.join("/");
     this.setData({
-      [child]: e.detail.value
+      [child]: a
     })
     this.SubmitOldmanInfo({
       id: this.data.nameArr[this.data.activeIndex]._id,
@@ -2804,11 +2726,10 @@ Page({
       }
     })
     let Info = 'otherInfo[' + this.data.activeIndex + '].Info.sex'
-    let othersyrSexArr = 'otherInfo[' + this.data.activeIndex + '].Info.othersyrSexArr'
-
+    // let othersyrSexArr = 'otherInfo[' + this.data.activeIndex + '].Info.othersyrSexArr'
     this.setData({
       [Info]: e.detail.value,
-      [othersyrSexArr]: data,
+      // [othersyrSexArr]: data,
     })
     this.SubmitOldmanInfo({
       id: this.data.nameArr[this.data.activeIndex]._id,
@@ -2874,8 +2795,9 @@ Page({
   tab3Change9: function (e) {
     console.log(e)
     let Info = 'otherInfo[' + this.data.activeIndex + '].Info.outgoingplace'
+    let a = e.detail.value.join("/");
     this.setData({
-      [Info]: e.detail.value,
+      [Info]: a
     })
     this.SubmitOldmanInfo({
       id: this.data.nameArr[this.data.activeIndex]._id,
@@ -3567,8 +3489,6 @@ Page({
                 accompanyArr[4].checked = true;
               }
             }
-
-
             let lookAfterArr = [];
             if (item.lookAfter.includes("无人照料")) {
               for (let i = 0; i < 6; i++) {
@@ -3676,10 +3596,10 @@ Page({
                 }
               })
             })
-            if (item.majorDiseases[0]) {
-              let patorl = this.removeExcess(item.majorDiseases[0]);
+            console.log(item.majorDiseases, '0000')
+            if (item.majorDiseases) {
               sickType.forEach(items => {
-                patorl.forEach(itemss => {
+                item.majorDiseases.forEach(itemss => {
                   if (items.name == itemss) {
                     items.checked = true;
                   }
@@ -3693,7 +3613,6 @@ Page({
                 }
               })
             })
-
             let chooseAdressArr = [];
             let chooseAdressArr1 = [];
             // if (item.nativePlace && item.nativePlaceId) {

+ 2 - 28
pages/collectInfo/collectInfo.wxml

@@ -21,32 +21,6 @@
 			</view>
 		</view>
 	</view>
-	<van-popup show="{{ showAdress }}" round position="bottom" custom-style="height: 70%" bind:close="closeAdress">
-		<view class="choosedAdress_box">
-			<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 class="adress_title" wx:if="{{pleaseChoose}}">请选择</view>
-		<view class="adress_detail">
-			<view wx:for='{{provinceArr}}'>
-				<view bindtap="provinceClick" data-item="{{item}}">{{item.CIVILREGIONALISMNAME}}</view>
-			</view>
-		</view>
-	</van-popup>
-	<van-popup show="{{ showAdress1 }}" round position="bottom" custom-style="height: 70%" bind:close="closeAdress1">
-		<view class="choosedAdress_box">
-			<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 class="adress_title" wx:if="{{pleaseChoose1}}">请选择</view>
-		<view class="adress_detail">
-			<view wx:for='{{provinceArr1}}'>
-				<view bindtap="provinceClick1" data-item="{{item}}">{{item.CIVILREGIONALISMNAME}}</view>
-			</view>
-		</view>
-	</van-popup>
 	<view class="left">
 		<view class="block1 {{currentIndex!=0?'clickblock1':''}}" bindtap="turn" data-index="0">
 			<image src="{{currentIndex==0?src1:src2}}" class="img"></image>
@@ -135,13 +109,13 @@
 					</label>
 				</checkbox-group>
 				<view class="block"><text class="red">*</text>现居地址
-					<picker mode="multiSelector" bindchange="bindMultiPickerChange1" bindcolumnchange="bindMultiPickerColumnChange" value="{{multiIndex1}}" range="{{multiArray}}" range-key="{{'CIVILREGIONALISMNAME'}}">
+					<picker disabled="{{nowAdress}}" mode="multiSelector" bindchange="bindMultiPickerChange1" bindcolumnchange="bindMultiPickerColumnChange" value="{{multiIndex1}}" range="{{multiArray}}" range-key="{{'CIVILREGIONALISMNAME'}}">
 						<view class="picker1">
 							<view wx:if="{{oldInfo[activeIndex].chooseAdressArr1.length==0}}">点我选择现居地址</view>
 							<textarea style="width:450rpx;height:auto" disabled="true" wx:else>{{oldInfo[activeIndex].chooseAdressArr1}}</textarea>
 						</view>
 					</picker>
-					<input bindblur="tab1Change7" placeholder="请填写补充现居地址" name="name" value="{{oldInfo[activeIndex].addressExt}}" />
+					<input disabled="{{nowAdress}}" bindblur="tab1Change7" placeholder="请填写补充现居地址" name="name" value="{{oldInfo[activeIndex].addressExt}}" />
 				</view>
 				<view class="block">
 					<view class="name"><text class="red">*</text>婚姻及配偶情况</view>