| | |
| | | |
| | | <u-datetime-picker ref="datetimePicker" :show="showSelectDate" v-model="workTime" mode="datetime" |
| | | :formatter="formatter" @confirm="confirmDate" @cancel="showSelectDate = false"></u-datetime-picker> |
| | | |
| | | <u-picker :show="isShowTypePicker" :columns="typeList" :defaultIndex="typeIndex" |
| | | @cancel="isShowTypePicker = false" @confirm="confirmType()" keyName="dictValue"></u-picker> |
| | | <u-picker :show="isShowLabelPicker" :columns="labelList" :defaultIndex="labelIndex" |
| | | @cancel="isShowLabelPicker = false" @confirm="confirmLabelType()" keyName="name"></u-picker> |
| | | |
| | | <u-picker :show="isShowLabelPicker" ref="uPicker" @change="changeHandler" :columns="labelList" |
| | | :defaultIndex="labelIndex" @cancel="isShowLabelPicker = false" @confirm="confirmLabelType()" |
| | | keyName="name"></u-picker> |
| | | |
| | | <!-- <footer-btn @click="submitInfo" :text="isEdit?'保存':'提交'" /> --> |
| | | |
| | |
| | | isShowTypePicker: false, |
| | | isShowLabelPicker: false, |
| | | labelList: [], |
| | | labelListTwo: [], |
| | | labelIndex: [0], |
| | | labelName: "", |
| | | keyword: "", |
| | |
| | | |
| | | getHouseType(code) { |
| | | this.houseCode = code |
| | | // this.getHouseholdList(); |
| | | this.getHouseholdList(); |
| | | }, |
| | | |
| | | |
| | |
| | | // this.info.context = data.context; |
| | | // this.info.householdId = data.householdId; |
| | | // this.info.personType = data.personType; |
| | | console.log(typeof data.personType) |
| | | // console.log(typeof data.personType) |
| | | // this.labelIndex = this.$getIndex(this.labelList[0], data.personType, "id", "name").index; |
| | | // this.labelName = this.$getIndex(this.labelList[0], data.personType, "id", "name").name; |
| | | this.getHouseholdList(); |
| | | this.labelName = data.labelName |
| | | this.getHousehold(data.householdId); |
| | | this.form.images = this.$setImageUrl(data.url, 2); |
| | | this.info.id = data.id; |
| | |
| | | |
| | | getLabelList() { |
| | | getLabelListByParentId({ |
| | | parentId: 100 |
| | | parentId: 1000 |
| | | }).then(res => { |
| | | this.labelList = [res.data]; |
| | | // this.labelList = [res.data]; |
| | | // this.labelListTwo = res.data |
| | | this.labelList.push(res.data) |
| | | this.labelList.push(res.data[0].children) |
| | | }) |
| | | }, |
| | | |
| | |
| | | console.log(res); |
| | | this.address = res.data.currentAddress; |
| | | this.selectedHousehold = res.data; |
| | | this.houseCode = res.data.houseCode |
| | | this.getHouseholdList(); |
| | | }) |
| | | }, |
| | | |
| | | getHouseholdList() { |
| | | if (!this.houseCode) { |
| | | return |
| | | } |
| | | fetchHousehold({ |
| | | labelId: this.info.personType, |
| | | searchKey: this.keyword, |
| | |
| | | }, |
| | | |
| | | //选择重点人群类型 |
| | | // confirmLabelType(e) { |
| | | // this.labelIndex = e.indexs; |
| | | // this.info.personType = e.value[0].id; |
| | | // this.labelName = e.value[0].name; |
| | | // this.isShowLabelPicker = false; |
| | | // this.getHouseholdList(); |
| | | // }, |
| | | // 回调参数为包含columnIndex、value、values |
| | | confirmLabelType(e) { |
| | | console.log('confirm', e) |
| | | // this.show = false |
| | | this.labelIndex = e.indexs; |
| | | this.info.personType = e.value[0].id; |
| | | this.labelName = e.value[0].name; |
| | | if (e.value[2]) { |
| | | this.info.personType = e.value[2].id; |
| | | this.labelName = e.value[2].name; |
| | | } else { |
| | | this.info.personType = e.value[1].id; |
| | | this.labelName = e.value[1].name; |
| | | } |
| | | this.isShowLabelPicker = false; |
| | | this.getHouseholdList(); |
| | | }, |
| | | |
| | | changeHandler(e) { |
| | | const { |
| | | columnIndex, |
| | | value, |
| | | values, // values为当前变化列的数组内容 |
| | | index, |
| | | // 微信小程序无法将picker实例传出来,只能通过ref操作 |
| | | picker = this.$refs.uPicker |
| | | } = e |
| | | // 当第一列值发生变化时,变化第二列(后一列)对应的选项 |
| | | if (columnIndex === 0) { |
| | | console.log("****************", e) |
| | | // picker为选择器this实例,变化第二列对应的选项 |
| | | picker.setColumnValues(1, value[0].children) |
| | | // picker为选择器this实例,变化第二列对应的选项 |
| | | if (value[0].hasChildren) { |
| | | picker.setColumnValues(2, value[0].children[0].children) |
| | | } |
| | | } |
| | | if (columnIndex === 1) { |
| | | console.log("*******1*********", e) |
| | | // picker为选择器this实例,变化第二列对应的选项 |
| | | if (value[1].hasChildren) { |
| | | picker.setColumnValues(2, value[1].children) |
| | | } |
| | | } |
| | | }, |
| | | |
| | | |
| | | //搜索住户 |
| | | searchHousehold() { |
| | | this.getHouseholdList() |