修改参数
This commit is contained in:
parent
90a961ac81
commit
7b4c2f3fd5
@ -128,7 +128,7 @@
|
||||
formData: {
|
||||
breedingList: [{
|
||||
landPlan: '', //土地规划
|
||||
}]
|
||||
}, ]
|
||||
},
|
||||
rules: {
|
||||
|
||||
@ -143,7 +143,9 @@
|
||||
},
|
||||
// 新增种养殖
|
||||
pushBreedingList() {
|
||||
this.formData.breedingList.push({})
|
||||
this.formData.breedingList.push({
|
||||
landPlan: '', //土地规划
|
||||
})
|
||||
},
|
||||
// 删除种养殖
|
||||
removeBreedingList(index) {
|
||||
|
@ -4,23 +4,23 @@
|
||||
<u--form labelPosition="left" :model="residents" :rules="rules" ref="uForm">
|
||||
<block value="人口">
|
||||
<block value="人员信息" v-for="(item, index) in residents.family" :key="'user'+index">
|
||||
<u-form-item label="姓名" required prop="residents.nickname" borderBottom>
|
||||
<u--input v-model="item.nickname" placeholder="请输入姓名"></u--input>
|
||||
<u-form-item label="姓名" required prop="residents.name" borderBottom>
|
||||
<u--input v-model="item.name" placeholder="请输入姓名"></u--input>
|
||||
</u-form-item>
|
||||
<picker mode="date" value="1990-01-01" @change="changeBirthday" :data-index="index">
|
||||
<u-form-item labelWidth="auto" label="出生日期" required prop="residents.nickname" borderBottom>
|
||||
<u--input :value="item.birthday" placeholder="请选择出生日期" disabled disabledColor="#fff"></u--input>
|
||||
<picker mode="date" value="1990-01-01" @change="changebirth_time" :data-index="index">
|
||||
<u-form-item labelWidth="auto" label="出生日期" required prop="residents.name" borderBottom>
|
||||
<u--input :value="item.birth_time" placeholder="请选择出生日期" disabled disabledColor="#fff"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
</picker>
|
||||
<picker mode="selector" :range="jobTypeList" @change="changeJobType" :data-index="index">
|
||||
<u-form-item labelWidth="auto" label="就业情况" required prop="residents.nickname" borderBottom>
|
||||
<u--input :value="item.jobType" placeholder="请选择就业情况" disabled disabledColor="#fff"></u--input>
|
||||
<picker mode="selector" :range="situationList" @change="changesituation" :data-index="index">
|
||||
<u-form-item labelWidth="auto" label="就业情况" required prop="residents.name" borderBottom>
|
||||
<u--input :value="item.situation" placeholder="请选择就业情况" disabled disabledColor="#fff"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
</picker>
|
||||
<u-form-item labelWidth="auto" label="技能特长" required prop="residents.nickname" borderBottom>
|
||||
<u--input v-model="item.skill" placeholder="请输入技能特长"></u--input>
|
||||
<u-form-item labelWidth="auto" label="技能特长" required prop="residents.name" borderBottom>
|
||||
<u--input v-model="item.skills" placeholder="请输入技能特长"></u--input>
|
||||
</u-form-item>
|
||||
<button type="primary" v-if="residents.family.length>1" class="delete"
|
||||
@click="removeFamily(index)">删除以上信息</button>
|
||||
@ -55,26 +55,26 @@
|
||||
<u--input v-model="item.grade" placeholder="请输入年级"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item labelWidth="auto" label="是否补课" required prop="residents.child" borderBottom>
|
||||
<u-radio-group v-model="item.is_course" style="margin: 16rpx;">
|
||||
<u-radio-group v-model="item.is_lesson" style="margin: 16rpx;">
|
||||
<u-radio :customStyle="{marginRight: '16px'}"
|
||||
v-for="(item, index) in [{value:1,label:'是'},{value:0,label:'否'}]" :key="index" :label="item.label"
|
||||
:name="item.value">
|
||||
</u-radio>
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
<u-form-item v-if="item.is_course>0" label-width="auto" labelPosition="top" label="补课内容" prop="residents.child_arr.age"
|
||||
<u-form-item v-if="item.is_lesson>0" label-width="auto" labelPosition="top" label="补课内容" prop="residents.child_arr.age"
|
||||
borderBottom>
|
||||
<u--textarea v-model="item.course" autoHeight placeholder="请输入需要的课程" border="surround"
|
||||
<u--textarea v-model="item.lesson" autoHeight placeholder="请输入需要的课程" border="surround"
|
||||
count></u--textarea>
|
||||
</u-form-item>
|
||||
<u-form-item label-width="auto" labelPosition="top" label="备注" prop="residents.child_arr.age" borderBottom>
|
||||
<u--textarea v-model="item.remark" autoHeight placeholder="请输入备注" border="surround" count></u--textarea>
|
||||
<u--textarea v-model="item.notes" autoHeight placeholder="请输入备注" border="surround" count></u--textarea>
|
||||
</u-form-item>
|
||||
</block>
|
||||
<button type="primary" v-if="residents.child_arr.length>1" class="delete"
|
||||
@click="removeChildArr(index)">删除以上信息</button>
|
||||
</block>
|
||||
<button type="primary" class="plus" @click="pushChildArr">+</button>
|
||||
<button type="primary" v-if="residents.child>0" class="plus" @click="pushChildArr">+</button>
|
||||
</block>
|
||||
|
||||
</u--form>
|
||||
@ -85,24 +85,24 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
jobTypeList: ['公务员','国企事业单位','民营企业','自由职业','其他'],
|
||||
situationList: ['公务员','国企事业单位','民营企业','自由职业','其他'],
|
||||
// 常住人口
|
||||
residents: {
|
||||
family: [{
|
||||
nickname: '',
|
||||
birthday: '',
|
||||
jobType: '', // 工作
|
||||
skill: '', // 技能
|
||||
name: '',
|
||||
birth_time: '',
|
||||
situation: '', // 工作
|
||||
skills: '', // 技能
|
||||
}],
|
||||
child: '', //是否存在婴幼儿
|
||||
child_arr: [ //婴幼儿列表
|
||||
{
|
||||
age: '',
|
||||
wsfy: '', //喂养方式
|
||||
feeding: '', //喂养方式
|
||||
grade: '', //年级
|
||||
is_course: '', //是否补课
|
||||
course: '', //课程
|
||||
remark: '' //备注
|
||||
is_lesson: '', //是否补课
|
||||
lesson: '', //课程
|
||||
notes: '' //备注
|
||||
}
|
||||
],
|
||||
},
|
||||
@ -113,22 +113,22 @@
|
||||
},
|
||||
methods: {
|
||||
// 选择生日
|
||||
changeBirthday(e){
|
||||
changebirth_time(e){
|
||||
let index = e.currentTarget.dataset.index;
|
||||
this.residents.family[index].birthday = e.detail.value;
|
||||
this.residents.family[index].birth_time = e.detail.value;
|
||||
},
|
||||
// 选择就业
|
||||
changeJobType(e){
|
||||
changesituation(e){
|
||||
let index = e.currentTarget.dataset.index;
|
||||
this.residents.family[index].jobType = this.jobTypeList[e.detail.value];
|
||||
this.residents.family[index].situation = this.situationList[e.detail.value];
|
||||
},
|
||||
// 添加人口
|
||||
pushFamily() {
|
||||
this.residents.family.push({
|
||||
nickname: '',
|
||||
birthday: '',
|
||||
jobType: '',
|
||||
skill: '',
|
||||
name: '',
|
||||
birth_time: '',
|
||||
situation: '', // 工作
|
||||
skills: '', // 技能
|
||||
})
|
||||
},
|
||||
// 删除人口
|
||||
@ -147,10 +147,11 @@
|
||||
pushChildArr() {
|
||||
this.residents.child_arr.push({
|
||||
age: '',
|
||||
wsfy: '', //喂养方式
|
||||
feeding: '', //喂养方式
|
||||
grade: '', //年级
|
||||
course: '', //课程
|
||||
remark: '' //备注
|
||||
is_lesson: '', //是否补课
|
||||
lesson: '', //课程
|
||||
notes: '' //备注
|
||||
})
|
||||
},
|
||||
// 删除婴幼儿
|
||||
|
@ -15,6 +15,9 @@
|
||||
</u-radio>
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
<u-form-item label="年龄" required prop="age" borderBottom>
|
||||
<u--input v-model="formData.age" placeholder="请输入年龄"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item labelWidth="auto" label="身份证号" required prop="id_card" borderBottom>
|
||||
<u--input v-model="formData.id_card" placeholder="请输入身份证号" type="idcard"></u--input>
|
||||
</u-form-item>
|
||||
@ -67,9 +70,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { upLoadImage } from "@/api/file.js"
|
||||
import { loginAdd } from "@/api/oaUser.js"
|
||||
import { Toast } from "../../libs/uniApi"
|
||||
import { informationAdd } from "@/api/information.js"
|
||||
import districtSelector from "@/components/districtSelector/districtSelector.vue" //地区选择器
|
||||
import residents from "@/components/newArchives/residents.vue" // 常住人口
|
||||
import breeding from "@/components/newArchives/breeding.vue" // 种养殖
|
||||
@ -86,6 +88,7 @@
|
||||
smart_phone: '',//是否使用智能手机
|
||||
wechat: '', //微信号
|
||||
address: '',//家庭地址
|
||||
age: '',//年龄
|
||||
},
|
||||
rules: {
|
||||
phone: {
|
||||
@ -125,7 +128,7 @@
|
||||
this.$refs.uForm.validate().then(async (e) => {
|
||||
if (e) {
|
||||
// uni.showLoading()
|
||||
// let res = await loginAdd(this.formData);
|
||||
// let res = await informationAdd(this.formData);
|
||||
// uni.hideLoading()
|
||||
// uni.showToast({
|
||||
// icon: "none",
|
||||
|
Loading…
x
Reference in New Issue
Block a user