新增选择需求
This commit is contained in:
parent
97a5a337e1
commit
ee5e264c88
@ -82,11 +82,8 @@
|
||||
<u--textarea v-model="item.farm_tools" autoHeight placeholder="请输入经营诉求" border="surround"
|
||||
count></u--textarea>
|
||||
</u-form-item>
|
||||
<button type="primary" v-if="formData.length>1" class="delete"
|
||||
@click="removeBreedingList(index)">删除以上开设店铺信息</button>
|
||||
</u--form>
|
||||
</block>
|
||||
<button type="primary" class="plus" @click="pushBreedingList">+</button>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
@ -56,6 +56,16 @@
|
||||
</view>
|
||||
<residents ref="residentsRef"></residents>
|
||||
<breeding ref="breedingRef"></breeding>
|
||||
<block v-for="(item, index) in showDemandList" :key="'demand'+index">
|
||||
<block v-if="item.category_id==0">
|
||||
<store v-if="item.category_child==1" ref="demandRef01"></store>
|
||||
</block>
|
||||
<button type="primary" class="delete" @click="removeShowDemand">-</button>
|
||||
</block>
|
||||
<button type="primary" class="plus demand" @click="demandShow=true">点击添加更多需求</button>
|
||||
<u-picker :show="demandShow" ref="demandRef" :loading="demandLoading" :columns="[demandList, demandListChild]"
|
||||
@change="changeHandler" @cancel="demandShow = false" @confirm="changeDemand"></u-picker>
|
||||
|
||||
</u--form>
|
||||
<button @click="addArchives" type="primary" class="btn">完成登记</button>
|
||||
</view>
|
||||
@ -68,10 +78,16 @@
|
||||
import districtSelector from "@/components/districtSelector/districtSelector.vue" //地区选择器
|
||||
import residents from "@/components/newArchives/residents.vue" // 常住人口
|
||||
import breeding from "@/components/newArchives/breeding.vue" // 种养殖
|
||||
import store from "@/components/newArchives/store.vue" // 开设店铺
|
||||
export default {
|
||||
components:{districtSelector, residents, breeding},
|
||||
components: { districtSelector, residents, breeding, store },
|
||||
data() {
|
||||
return {
|
||||
demandShow: false,
|
||||
demandLoading: false,
|
||||
demandList: ['生产投入明细', '修房装修', '宴席', '生活采购'], //更多需求
|
||||
demandListChild: ['种养殖', '开设店铺', '深加工', '粗加工'], //更多二级需求
|
||||
showDemandList: [], //更多需求展示列表
|
||||
formData: {
|
||||
id_card: '',
|
||||
sex: '',
|
||||
@ -84,6 +100,7 @@
|
||||
age: '', //年龄
|
||||
category_id: '1',
|
||||
category_child: '2',
|
||||
data_type: '1',
|
||||
},
|
||||
rules: {
|
||||
phone: {
|
||||
@ -160,9 +177,13 @@
|
||||
...this.formData,
|
||||
...districtForm,
|
||||
...this.$refs.residentsRef.residents,
|
||||
datas: [{
|
||||
category_id: '1',
|
||||
category_child: '2',
|
||||
datas: {
|
||||
...this.$refs.breedingRef.formData
|
||||
}
|
||||
}]
|
||||
});
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
@ -178,6 +199,45 @@
|
||||
})
|
||||
|
||||
},
|
||||
// 选择更多需求
|
||||
changeHandler(e) {
|
||||
if (e.columnIndex == 0) { //滑动左侧时才加载,右侧不加载
|
||||
this.demandLoading = true;
|
||||
setTimeout(() => {
|
||||
switch (e.indexs[0]) {
|
||||
case 0:
|
||||
this.demandListChild = ['种养殖', '开设店铺', '深加工', '粗加工'];
|
||||
break;
|
||||
case 1:
|
||||
this.demandListChild = ['修房', '装房', '翻新', '买卖房'];
|
||||
break;
|
||||
case 2:
|
||||
this.demandListChild = ['婚宴', '寿宴', '满月酒', '其他庆祝宴', '白事'];
|
||||
break;
|
||||
case 3:
|
||||
this.demandListChild = ['烟酒', '水电气电话', '交通工具', '生活用品', '农副特产品'];
|
||||
break;
|
||||
default:
|
||||
this.demandListChild = [];
|
||||
break;
|
||||
}
|
||||
this.demandLoading = false;
|
||||
}, 800)
|
||||
}
|
||||
},
|
||||
// 确认添加需求
|
||||
changeDemand(e) {
|
||||
this.showDemandList.push({
|
||||
category_id: e.indexs[0],
|
||||
category_child: e.indexs[1],
|
||||
})
|
||||
console.log(this.showDemandList);
|
||||
this.demandShow = false;
|
||||
},
|
||||
// 删除需求
|
||||
removeShowDemand(index){
|
||||
this.showDemandList.splice(index, 1);
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
uni.stopPullDownRefresh()
|
||||
@ -227,4 +287,34 @@
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
.demand {
|
||||
margin-top: 40rpx;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
</style>
|
Loading…
x
Reference in New Issue
Block a user