养殖类型由输入修改为选择
This commit is contained in:
parent
5b18e4c495
commit
04d00264ae
@ -31,9 +31,16 @@
|
|||||||
<u--textarea :disabled="readonly" v-model="formData.notes" autoHeight placeholder="请输入备注" border="surround"
|
<u--textarea :disabled="readonly" v-model="formData.notes" autoHeight placeholder="请输入备注" border="surround"
|
||||||
count></u--textarea>
|
count></u--textarea>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item labelWidth="auto" label="养殖类型" required prop="breeding_type" borderBottom>
|
<!-- <u-form-item labelWidth="auto" label="养殖类型" required prop="breeding_type" borderBottom>
|
||||||
<u--input :readonly="readonly" v-model="formData.breeding_type" placeholder="请输入养殖类型"></u--input>
|
<u--input :readonly="readonly" v-model="formData.breeding_type" placeholder="请输入养殖类型"></u--input>
|
||||||
</u-form-item>
|
</u-form-item> -->
|
||||||
|
<picker :range="breedingTypeList" range-key="name" :disabled="readonly" mode="selector" @change="changeBreeding">
|
||||||
|
<u-form-item labelWidth="auto" label="养殖类型" required prop="planning" borderBottom>
|
||||||
|
<u--input :value="breedingName" style="pointer-events: none;" placeholder="请选择养殖类型" disabled
|
||||||
|
disabledColor="#fff"></u--input>
|
||||||
|
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||||
|
</u-form-item>
|
||||||
|
</picker>
|
||||||
<picker mode="date" @change="changeDate" :disabled="readonly" :data-value="'breeding_time'">
|
<picker mode="date" @change="changeDate" :disabled="readonly" :data-value="'breeding_time'">
|
||||||
<u-form-item labelWidth="auto" label="养殖开始时间" required prop="breeding_time" borderBottom>
|
<u-form-item labelWidth="auto" label="养殖开始时间" required prop="breeding_time" borderBottom>
|
||||||
<u--input :value="formData.breeding_time" style="pointer-events: none;" placeholder="请选择养殖开始时间" disabled disabledColor="#fff"></u--input>
|
<u--input :value="formData.breeding_time" style="pointer-events: none;" placeholder="请选择养殖开始时间" disabled disabledColor="#fff"></u--input>
|
||||||
@ -121,13 +128,8 @@
|
|||||||
border="surround" count></u--textarea>
|
border="surround" count></u--textarea>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</u--form>
|
</u--form>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -149,6 +151,11 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
landPlanList: ['自己养', '出租', '代养', '租更多地扩大养殖'],
|
landPlanList: ['自己养', '出租', '代养', '租更多地扩大养殖'],
|
||||||
|
breedingTypeList: [
|
||||||
|
{ id: 1, name: "水产"},
|
||||||
|
{ id: 2, name: "禽类" },
|
||||||
|
{ id: 3, name: "大型动物" },
|
||||||
|
],
|
||||||
formData: {
|
formData: {
|
||||||
// "breeding_training": 1, //有无养殖培训
|
// "breeding_training": 1, //有无养殖培训
|
||||||
// "breeding_company": 0, //有无注册成立种殖公司
|
// "breeding_company": 0, //有无注册成立种殖公司
|
||||||
@ -223,6 +230,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed:{
|
||||||
|
breedingName(){
|
||||||
|
return this.breedingTypeList.find((item)=>item.id==this.formData.breeding_type)?.name;
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 初始化校验
|
// 初始化校验
|
||||||
initRules() {
|
initRules() {
|
||||||
@ -245,10 +257,10 @@
|
|||||||
async validate() {
|
async validate() {
|
||||||
return await this.$refs.breedingForm.validate();
|
return await this.$refs.breedingForm.validate();
|
||||||
},
|
},
|
||||||
// 选择土地规划
|
// 选择养殖类型
|
||||||
changeLanPlan(e) {
|
changeBreeding(e) {
|
||||||
let index = e.currentTarget.dataset.index;
|
// let index = e.currentTarget.dataset.index;
|
||||||
this.formData.planning = e.detail.value;
|
this.formData.breeding_type = this.breedingTypeList[e.detail.value].id;
|
||||||
},
|
},
|
||||||
// 选择时间
|
// 选择时间
|
||||||
changeDate(e) {
|
changeDate(e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user