修改参数

This commit is contained in:
weipengfei 2023-07-28 18:03:47 +08:00
parent 90a961ac81
commit 7b4c2f3fd5
3 changed files with 51 additions and 45 deletions

View File

@ -128,7 +128,7 @@
formData: { formData: {
breedingList: [{ breedingList: [{
landPlan: '', // landPlan: '', //
}] }, ]
}, },
rules: { rules: {
@ -143,7 +143,9 @@
}, },
// //
pushBreedingList() { pushBreedingList() {
this.formData.breedingList.push({}) this.formData.breedingList.push({
landPlan: '', //
})
}, },
// //
removeBreedingList(index) { removeBreedingList(index) {
@ -162,7 +164,7 @@
</script> </script>
<style lang="scss"> <style lang="scss">
.delete { .delete {
margin: 22rpx 0; margin: 22rpx 0;
// margin-bottom: 40rpx; // margin-bottom: 40rpx;
width: 100%; width: 100%;

View File

@ -4,23 +4,23 @@
<u--form labelPosition="left" :model="residents" :rules="rules" ref="uForm"> <u--form labelPosition="left" :model="residents" :rules="rules" ref="uForm">
<block value="人口"> <block value="人口">
<block value="人员信息" v-for="(item, index) in residents.family" :key="'user'+index"> <block value="人员信息" v-for="(item, index) in residents.family" :key="'user'+index">
<u-form-item label="姓名" required prop="residents.nickname" borderBottom> <u-form-item label="姓名" required prop="residents.name" borderBottom>
<u--input v-model="item.nickname" placeholder="请输入姓名"></u--input> <u--input v-model="item.name" placeholder="请输入姓名"></u--input>
</u-form-item> </u-form-item>
<picker mode="date" value="1990-01-01" @change="changeBirthday" :data-index="index"> <picker mode="date" value="1990-01-01" @change="changebirth_time" :data-index="index">
<u-form-item labelWidth="auto" label="出生日期" required prop="residents.nickname" borderBottom> <u-form-item labelWidth="auto" label="出生日期" required prop="residents.name" borderBottom>
<u--input :value="item.birthday" placeholder="请选择出生日期" disabled disabledColor="#fff"></u--input> <u--input :value="item.birth_time" placeholder="请选择出生日期" disabled disabledColor="#fff"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
</picker> </picker>
<picker mode="selector" :range="jobTypeList" @change="changeJobType" :data-index="index"> <picker mode="selector" :range="situationList" @change="changesituation" :data-index="index">
<u-form-item labelWidth="auto" label="就业情况" required prop="residents.nickname" borderBottom> <u-form-item labelWidth="auto" label="就业情况" required prop="residents.name" borderBottom>
<u--input :value="item.jobType" placeholder="请选择就业情况" disabled disabledColor="#fff"></u--input> <u--input :value="item.situation" placeholder="请选择就业情况" disabled disabledColor="#fff"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
</picker> </picker>
<u-form-item labelWidth="auto" label="技能特长" required prop="residents.nickname" borderBottom> <u-form-item labelWidth="auto" label="技能特长" required prop="residents.name" borderBottom>
<u--input v-model="item.skill" placeholder="请输入技能特长"></u--input> <u--input v-model="item.skills" placeholder="请输入技能特长"></u--input>
</u-form-item> </u-form-item>
<button type="primary" v-if="residents.family.length>1" class="delete" <button type="primary" v-if="residents.family.length>1" class="delete"
@click="removeFamily(index)">删除以上信息</button> @click="removeFamily(index)">删除以上信息</button>
@ -55,26 +55,26 @@
<u--input v-model="item.grade" placeholder="请输入年级"></u--input> <u--input v-model="item.grade" placeholder="请输入年级"></u--input>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="是否补课" required prop="residents.child" borderBottom> <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'}" <u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'是'},{value:0,label:'否'}]" :key="index" :label="item.label" v-for="(item, index) in [{value:1,label:'是'},{value:0,label:'否'}]" :key="index" :label="item.label"
:name="item.value"> :name="item.value">
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </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> borderBottom>
<u--textarea v-model="item.course" autoHeight placeholder="请输入需要的课程" border="surround" <u--textarea v-model="item.lesson" autoHeight placeholder="请输入需要的课程" border="surround"
count></u--textarea> count></u--textarea>
</u-form-item> </u-form-item>
<u-form-item label-width="auto" labelPosition="top" label="备注" prop="residents.child_arr.age" borderBottom> <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> </u-form-item>
</block> </block>
<button type="primary" v-if="residents.child_arr.length>1" class="delete" <button type="primary" v-if="residents.child_arr.length>1" class="delete"
@click="removeChildArr(index)">删除以上信息</button> @click="removeChildArr(index)">删除以上信息</button>
</block> </block>
<button type="primary" class="plus" @click="pushChildArr">+</button> <button type="primary" v-if="residents.child>0" class="plus" @click="pushChildArr">+</button>
</block> </block>
</u--form> </u--form>
@ -85,24 +85,24 @@
export default { export default {
data() { data() {
return { return {
jobTypeList: ['公务员','国企事业单位','民营企业','自由职业','其他'], situationList: ['公务员','国企事业单位','民营企业','自由职业','其他'],
// //
residents: { residents: {
family: [{ family: [{
nickname: '', name: '',
birthday: '', birth_time: '',
jobType: '', // situation: '', //
skill: '', // skills: '', //
}], }],
child: '', // child: '', //
child_arr: [ // child_arr: [ //
{ {
age: '', age: '',
wsfy: '', // feeding: '', //
grade: '', // grade: '', //
is_course: '', // is_lesson: '', //
course: '', // lesson: '', //
remark: '' // notes: '' //
} }
], ],
}, },
@ -113,23 +113,23 @@
}, },
methods: { methods: {
// //
changeBirthday(e){ changebirth_time(e){
let index = e.currentTarget.dataset.index; 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; 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() { pushFamily() {
this.residents.family.push({ this.residents.family.push({
nickname: '', name: '',
birthday: '', birth_time: '',
jobType: '', situation: '', //
skill: '', skills: '', //
}) })
}, },
// //
removeFamily(index) { removeFamily(index) {
@ -146,12 +146,13 @@
// //
pushChildArr() { pushChildArr() {
this.residents.child_arr.push({ this.residents.child_arr.push({
age: '', age: '',
wsfy: '', // feeding: '', //
grade: '', // grade: '', //
course: '', // is_lesson: '', //
remark: '' // lesson: '', //
}) notes: '' //
})
}, },
// //
removeChildArr(index) { removeChildArr(index) {

View File

@ -15,6 +15,9 @@
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </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-form-item labelWidth="auto" label="身份证号" required prop="id_card" borderBottom>
<u--input v-model="formData.id_card" placeholder="请输入身份证号" type="idcard"></u--input> <u--input v-model="formData.id_card" placeholder="请输入身份证号" type="idcard"></u--input>
</u-form-item> </u-form-item>
@ -67,9 +70,8 @@
</template> </template>
<script> <script>
import { upLoadImage } from "@/api/file.js"
import { loginAdd } from "@/api/oaUser.js"
import { Toast } from "../../libs/uniApi" import { Toast } from "../../libs/uniApi"
import { informationAdd } from "@/api/information.js"
import districtSelector from "@/components/districtSelector/districtSelector.vue" // import districtSelector from "@/components/districtSelector/districtSelector.vue" //
import residents from "@/components/newArchives/residents.vue" // import residents from "@/components/newArchives/residents.vue" //
import breeding from "@/components/newArchives/breeding.vue" // import breeding from "@/components/newArchives/breeding.vue" //
@ -86,6 +88,7 @@
smart_phone: '',//使 smart_phone: '',//使
wechat: '', // wechat: '', //
address: '',// address: '',//
age: '',//
}, },
rules: { rules: {
phone: { phone: {
@ -125,7 +128,7 @@
this.$refs.uForm.validate().then(async (e) => { this.$refs.uForm.validate().then(async (e) => {
if (e) { if (e) {
// uni.showLoading() // uni.showLoading()
// let res = await loginAdd(this.formData); // let res = await informationAdd(this.formData);
// uni.hideLoading() // uni.hideLoading()
// uni.showToast({ // uni.showToast({
// icon: "none", // icon: "none",