linwe
2024-07-11 23a1e5b3a79d4aafb1abf5d6824b51f75eb98c6d
subPackage/house/components/userInfo.vue
@@ -10,8 +10,8 @@
                  </u-form-item>
                  <u-form-item @click="showSelectBus('性别','gender')" class="form-item" labelWidth="110" label="性别"
                     prop="gender">
                     <u--input border="none" v-model="selectDefaultName.genderValue" disabled
                        disabledColor="#ffffff" placeholder="请选择性别">
                     <u--input border="none" v-model="selectDefaultName.gender" disabled disabledColor="#ffffff"
                        placeholder="请选择性别">
                     </u--input>
                     <u-icon slot="right" name="arrow-right"></u-icon>
                  </u-form-item>
@@ -36,18 +36,24 @@
                     <u--input border="none" type="number" v-model="form.phoneNumber" placeholder="请输入手机号码">
                     </u--input>
                  </u-form-item>
                  <u-form-item class="form-item" labelWidth="110" label="户籍地区" prop="residentAdcode">
                     <view class="region">
                        <picker mode="region" :value="residentadDefault" @change="changeHouseholdRegion">
                        <uni-data-picker :border="false" v-model="residentadDefault"
                           :map="{text:'name',value:'id'}" :localdata="cityList" popup-title="请选择户籍地区"
                           @change="onchange" @nodeclick="onnodeclick"></uni-data-picker>
                        <!-- <picker mode="region" custom-item="children" :range="cityList" range-key="name"
                           :value="residentadDefault" @change="changeHouseholdRegion">
                           <view class="region-picker c-c0" v-if="!residentad">
                              请选择户籍地区
                           </view>
                           <view class="region-picker c-30" v-if="residentad">
                              {{residentad}}
                           </view>
                        </picker>
                        </picker> -->
                     </view>
                     <u-icon slot="right" name="arrow-right"></u-icon>
                     <!-- <u-icon slot="right" name="arrow-right"></u-icon> -->
                  </u-form-item>
                  <u-form-item @click="showSelectBus('与业主关系','relationship')" class="form-item" labelWidth="120"
@@ -81,7 +87,7 @@
                  <u-form-item @click="showSelectBus('民族','ethnicity')" class="form-item" labelWidth="110"
                     label="民族" prop="ethnicity">
                     <u--input border="none" v-model="selectDefaultName.ethnicityValue" disabled
                     <u--input border="none" v-model="selectDefaultName.ethnicity" disabled
                        disabledColor="#ffffff" placeholder="请选择民族">
                     </u--input>
                     <u-icon slot="right" name="arrow-right"></u-icon>
@@ -183,16 +189,20 @@
                  </u-form-item> -->
                  <u-form-item class="form-item" labelWidth="110" label="籍贯地区" prop="nativePlaceAdcode">
                     <view class="region">
                        <picker mode="region" :value="navtivePlaceDefault" @change="changeNativeRegion">
                        <uni-data-picker :border="false" v-model="navtivePlaceDefault"
                           :map="{text:'name',value:'id'}" :localdata="cityList" popup-title="请选择户籍地区"
                           @change="changeNativeRegion" @nodeclick="onnodeclick"></uni-data-picker>
                        <!-- <picker :range="cityList" range-key="name" :value="navtivePlaceDefault"
                           @change="changeNativeRegion">
                           <view class="region-picker c-c0" v-if="!nativePlace">
                              请选择籍贯地区
                           </view>
                           <view class="region-picker c-30" v-if="nativePlace">
                              {{nativePlace}}
                           </view>
                        </picker>
                        </picker> -->
                     </view>
                     <u-icon slot="right" name="arrow-right"></u-icon>
                     <!-- <u-icon slot="right" name="arrow-right"></u-icon> -->
                  </u-form-item>
                  <u-form-item @click="showSelectBus('户籍类型','residentType')" class="form-item" labelWidth="110"
@@ -289,11 +299,11 @@
         :show="typeShow" :columns="[selectBusList]" @close="typeShow = false" @cancel="typeShow = false"
         keyName="name" @confirm="typeSelect"></u-picker>
      <u-datetime-picker :show="showSelectDate" v-model="currentTime" mode="date" :formatter="formatter"
         @confirm="confirmDate" @cancel="showSelectDate = false" :minDate="goOutMinDate"></u-datetime-picker>
      <u-datetime-picker :show="showSelectDate" v-model="currentTime" mode="date" @confirm="confirmDate"
         @cancel="showSelectDate = false"></u-datetime-picker>
      <u-datetime-picker :show="showSelectBirthday" v-model="currentTime" mode="date" @confirm="confirmBirthday"
         @cancel="showSelectBirthday = false" :minDate="minDate"></u-datetime-picker>
         @cancel="showSelectBirthday = false"></u-datetime-picker>
      <u-picker :defaultIndex="[homeIndex]" :closeOnClickOverlay="true" :show="showRegion" :columns="[regionList]"
         @close="showRegion = false" @cancel="showRegion = false" keyName="name" @confirm="regionSelect"></u-picker>
@@ -302,7 +312,7 @@
         :columns="[volunteerOrgTypeList]" @close="showRegion = false" @cancel="showVolunteerOrg = false"
         @confirm="confirmVolunteerOrg"></u-picker>
      <u-popup :show="isShowPopup" mode="bottom" :round="12" closeable="true" @close="isShowPopup = false">
      <u-popup :show="isShowPopup" mode="bottom" :round="12" :closeable="true" @close="isShowPopup = false">
         <view class="popup-content">
            <z-paging ref="paging" v-model="houseList" @query="queryHouseList" @onRefresh="refreshList"
               :fixed="false">
@@ -326,6 +336,13 @@
         </view>
      </u-popup>
      <u-popup :show="isShowPopupLabel" mode="center" :round="12" :closeable="true" @close="isShowPopupLabel = false">
         <view class="popup-lable">
            <householdLabel id="formLable" ref="formLable" @getLableCallback="handleData"></householdLabel>
         </view>
      </u-popup>
   </view>
</template>
@@ -356,11 +373,13 @@
      getHouseList
   } from "@/api/house/house.js"
   import boxTitle from '../components/boxTitle/index2.vue'
   // import boxTitle from '../components/boxTitle/index2.vue'
   import householdLabel from './householdLabel.vue'
   export default {
      components: {
         selectBus,
         boxTitle
         // boxTitle,
         householdLabel
      },
      mixins: [uploadMixin],
      data() {
@@ -368,6 +387,7 @@
            addOrUpdateTitle: "添加",
            houseCode: "",
            form: {},
            formatter: 'yyyy-MM-dd',
            rules: {
               'selectDefaultName.relationship': {
                  required: true,
@@ -493,6 +513,7 @@
            },
            showSelectDate: false,
            regionList: [],
            cityList: [],
            nativePlace: "", //籍贯
            residentad: "", //户籍
            homeRegion: "", //居住地   
@@ -509,6 +530,7 @@
            minDate: "",
            goOutMinDate: "",
            isShowPopup: false,
            isShowPopupLabel: false,
            addressName: "",
            houseList: [],
            volunteerOrgTypeList: ["信州义警", "蓝天救援", "其他"],
@@ -523,6 +545,9 @@
         this.getHeader()
         this.getAllBizDict()
         this.setCardTypeDefault()
         this.getRegionList()
         this.getRegionTree()
      },
      onReady() {
@@ -531,8 +556,9 @@
      async onShow(option) {
         this.minDate = Number(new Date('1900-01-01')); //设置出生日期选择器最小值
         this.goOutMinDate = Number(new Date('1970-01-01')); //设置外出时间选择器最小值
         await this.getRegionList()
         await this.getAllBizDict()
         await this.getRegionList()
         this.homeRegion = uni.getStorageSync("curStreet")
         this.form.homeAdcode = this.getHouseRegion(uni.getStorageSync("curStreet")).code;
         this.homeIndex = this.getHouseRegion(uni.getStorageSync("curStreet")).index;
@@ -554,6 +580,12 @@
      // },
      methods: {
         handleData(res) {
            console.log("getback", res)
            this.isShowPopupLabel = false
            // householdLabelList
         },
         getHouseDetail(code, type) {
            getQrCodeDetail({
@@ -632,29 +664,44 @@
         //选择籍贯
         changeNativeRegion(e) {
            this.navtivePlaceDefault = e.detail.value
            let {
               code,
               value
            } = e.detail;
            this.nativePlace = `${value[0]}-${value[1]}-${value[2]}`
            this.form.nativePlaceAdcode = code[2];
            this.form.nativePlaceAdcode = value[2].value;
         },
         //选择户籍
         changeHouseholdRegion(e) {
         onchange(e) {
            // console.log("***1****" + JSON.stringify(e))
            this.residentadDefault = e.detail.value
            let {
               code,
               value
            } = e.detail;
            this.residentad = `${value[0]}-${value[1]}-${value[2]}`
            this.form.residentAdcode = code[2];
            this.form.residentAdcode = value[2].value;
         },
         onnodeclick(node) {
            // console.log("****2***" + JSON.stringify(node))
         },
         //选择户籍
         // changeHouseholdRegion(e) {
         //    let {
         //       code,
         //       value
         //    } = e.detail;
         //    this.residentad = `${value[0]}-${value[1]}-${value[2]}`
         //    this.form.residentAdcode = code[2];
         // },
         getRegionList() {
            select(361102).then(res => {
               console.log(res);
               // console.log(res);
               if (res.code == 200) {
                  this.regionList = res.data;
               }
@@ -662,10 +709,12 @@
            })
         },
         getRegionTree(callback) {
         getRegionTree() {
            regionTree().then(res => {
               console.log("region ==>", res.data)
               callback(res.data);
               // console.log("region ==>", res.data)
               // callback(res.data);
               // 城市
               this.cityList = res.data
            })
         },
@@ -817,9 +866,10 @@
         // 显示选择弹框
         showSelectBus(title, key) {
            // console.log("************" + JSON.stringify(this.dataList))
            // console.log("************" + key)
            this.selectBusList = this.dataList[key]
            // console.log("************" + JSON.stringify(this.selectBusList))
            // console.log("*******1*****" + JSON.stringify(this.dataList[key]))
            // console.log("******2******" + JSON.stringify(this.selectBusList))
            this.selectBusTitle = title
            // this.selectBusModel = model
            this.selectBusKey = key
@@ -828,6 +878,7 @@
         },
         //类型选择确认
         typeSelect(item) {
            console.log("****1******" + JSON.stringify(item))
            const [result] = item.value
            // this[this.selectBusModel] = result.name
            this.form[this.selectBusKey] = result.value
@@ -956,16 +1007,22 @@
         },
         navTo() {
            let data = JSON.parse(JSON.stringify(this.form));
            // let data = JSON.parse(JSON.stringify(this.form));
            console.log("form", this.form)
            // this.$u.func.globalNavigator(
            //    `householdLabel?data=${JSON.stringify(data)}&from=add`)
            if (!this.isEdit) {
               this.$u.func.globalNavigator(
                  `householdLabel?data=${JSON.stringify(data)}&from=add`)
            } else {
               this.$u.func.globalNavigator(
                  `householdLabel?data=${JSON.stringify(data)}`)
            }
            // if (!this.isEdit) {
            //    this.$u.func.globalNavigator(
            //       `householdLabel?data=${JSON.stringify(data)}&from=add`)
            // } else {
            //    this.$u.func.globalNavigator(
            //       `householdLabel?data=${JSON.stringify(data)}`)
            // }
            let that = this
            that.$refs.form.validate().then(res => {
               that.selectComponent('#formLable').$vm.init(this.form)
            })
            that.isShowPopupLabel = true
         },
         delAction() {
@@ -1272,6 +1329,11 @@
      }
   }
   .popup-lable {
      max-height: 80vh;
      /* 或者其他适合的高度 */
      overflow-y: auto;
   }
   .popup-content {
      width: 100%;