162 lines
5.3 KiB
Vue
162 lines
5.3 KiB
Vue
<template>
|
|
<view class="">
|
|
<view class="title">修房</view>
|
|
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
|
|
<u-form-item labelWidth="auto" label="修房类型" required prop="shop_front" borderBottom>
|
|
<u-radio-group v-model="formData.shop_front" 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 labelWidth="auto" label="建设面积" required prop="cultivated_area" borderBottom>
|
|
<u--input v-model="formData.cultivated_area" placeholder="请输入门面面积"></u--input>
|
|
</u-form-item>
|
|
<u-form-item labelWidth="auto" label="房屋风格" required prop="cultivated_area" borderBottom>
|
|
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
|
|
</u-form-item>
|
|
<u-form-item labelWidth="auto" label="修建地址" required prop="notes" borderBottom>
|
|
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
|
|
</u-form-item>
|
|
<u-form-item labelWidth="auto" label="预算" required prop="notes" borderBottom>
|
|
<u--input v-model="formData.cultivated_area" placeholder="请输入服务对象"></u--input>
|
|
</u-form-item>
|
|
<u-form-item labelWidth="auto" label="有无绿化" required prop="planting_company" borderBottom>
|
|
<u-radio-group v-model="formData.planting_company" 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 labelWidth="auto" label="有无装修" required prop="planting_company" borderBottom>
|
|
<u-radio-group v-model="formData.planting_company" 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 labelWidth="auto" label="房屋类型" required prop="planting_company" borderBottom>
|
|
<u-radio-group v-model="formData.planting_company" 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 labelWidth="auto" label="修建地照片" required prop="planting_company" borderBottom>
|
|
|
|
</u-form-item>
|
|
</u--form>
|
|
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
|
|
formData: {
|
|
shop_front: '', //有无门面
|
|
},
|
|
rules: {
|
|
|
|
}
|
|
}
|
|
},
|
|
created() {
|
|
this.initRules()
|
|
},
|
|
methods: {
|
|
// 初始化校验
|
|
initRules() {
|
|
let arr = Object.keys(this.formData);
|
|
arr.forEach(key => {
|
|
this.rules[key] = {
|
|
validator: (rule, value, callback) => {
|
|
this.$refs.breedingForm.clearValidate(rule.field);
|
|
value.trim() !== '' ? callback() : callback('不能为空');
|
|
},
|
|
trigger: ['change', 'blur']
|
|
}
|
|
})
|
|
},
|
|
// 校验
|
|
async validate() {
|
|
return await this.$refs.breedingForm.validate();;
|
|
},
|
|
// 选择土地规划
|
|
changeLanPlan(e) {
|
|
let index = e.currentTarget.dataset.index;
|
|
this.formData.planning = e.detail.value;
|
|
},
|
|
// 选择时间
|
|
changeDate(e) {
|
|
let data = e.currentTarget.dataset;
|
|
this.formData[data.value] = e.detail.value;
|
|
},
|
|
// 新增开设店铺
|
|
pushBreedingList() {
|
|
this.formData.push({})
|
|
},
|
|
// 删除开设店铺
|
|
removeBreedingList(index) {
|
|
uni.showModal({
|
|
confirmColor: '#f56c6c',
|
|
content: '确定删除吗?',
|
|
success: (res) => {
|
|
if (res.confirm) {
|
|
this.formData.splice(index, 1);
|
|
}
|
|
}
|
|
})
|
|
},
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.title {
|
|
margin-top: 30rpx;
|
|
font-weight: 500;
|
|
font-size: 34rpx;
|
|
|
|
&::before {
|
|
width: 8rpx;
|
|
height: 26rpx;
|
|
border-radius: 4rpx;
|
|
background-color: #3175f9;
|
|
content: "";
|
|
display: inline-block;
|
|
margin-right: 8rpx;
|
|
}
|
|
}
|
|
|
|
.delete {
|
|
margin: 22rpx 0;
|
|
// margin-bottom: 40rpx;
|
|
width: 100%;
|
|
height: 54rpx;
|
|
line-height: 54rpx;
|
|
background: #f56c6c;
|
|
border-radius: 14rpx;
|
|
font-size: 28rpx;
|
|
color: #fff;
|
|
text-align: center;
|
|
}
|
|
|
|
.plus {
|
|
margin: 22rpx 0;
|
|
// margin-bottom: 40rpx;
|
|
width: 100%;
|
|
height: 54rpx;
|
|
line-height: 54rpx;
|
|
background: $theme-oa-color;
|
|
border-radius: 14rpx;
|
|
color: #fff;
|
|
text-align: center;
|
|
}
|
|
</style> |