This commit is contained in:
weipengfei 2023-08-01 16:43:13 +08:00
parent a808e309b4
commit a3a990c241
12 changed files with 394 additions and 218 deletions

View File

@ -28,4 +28,10 @@ export const commonVillage = (data) => oahttp.get('/common/village', data)
/**
* 获取小队
*/
export const commonBrigade = (data) => oahttp.get('/common/brigade', data)
export const commonBrigade = (data) => oahttp.get('/common/brigade', data)
/**
* 获取商机分类
*/
export const categoryBusinessList = (data) => oahttp.get('/CategoryBusiness/list', data)

View File

@ -19,7 +19,7 @@
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="村社" required prop="village" @click="changeCity('village')" borderBottom>
<u--input :value="formDataText.village" disabled disabledColor="#fff" placeholder="请选择村"></u--input>
<u--input :value="formDataText.village" type="text" disabled disabledColor="#fff" placeholder="请选择村"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="小队" required prop="brigade" @click="changeCity('brigade')" borderBottom>
@ -37,6 +37,16 @@
import { Toast } from "../../libs/uniApi"
export default {
name:"districtSelector",
props:{
readonly: {
type: Boolean,
default: false
},
datas:{
type: Object,
default: null
}
},
data() {
return {
showProvince: false,
@ -98,8 +108,15 @@
changeType: '', //
};
},
watch:{
datas(newValue, oldValue){
if(newValue){
console.log('获取地址');
}
}
},
mounted() {
this.initProvinceAndCity();
if(!this.$props.readonly) this.initProvinceAndCity();
},
methods:{
async validate(){
@ -135,6 +152,7 @@
},
//
changeCity(type) {
if(this.$props.readonly)return ;
if (this[type + 'List'].length == 0) return Toast('请先选择上一级地区');
this.changeType = type;
this.showProvince = true;

View File

@ -3,16 +3,16 @@
<view class="title">种养殖</view>
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
<u-form-item labelWidth="auto" label="耕地总面积" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入耕地总面积"></u--input>
<u--input :readonly="readonly" v-model="formData.cultivated_area" placeholder="请输入耕地总面积"></u--input>
</u-form-item>
<picker :range="landPlanList" mode="selector" @change="changeLanPlan">
<picker :range="landPlanList" :disabled="readonly" mode="selector" @change="changeLanPlan">
<u-form-item labelWidth="auto" label="土地规划" required prop="planning" borderBottom>
<u--input :value="landPlanList[formData.planning]" 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="breeding_training" borderBottom>
<u-radio-group v-model="formData.breeding_training" style="margin: 16rpx;">
<u-radio-group :disabled="readonly" v-model="formData.breeding_training" 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">
@ -20,7 +20,7 @@
</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-group :disabled="readonly" 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">
@ -28,38 +28,38 @@
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="备注" required prop="notes" borderBottom>
<u--textarea v-model="formData.notes" autoHeight placeholder="请输入备注" border="surround" count></u--textarea>
<u--textarea :disabled="readonly" v-model="formData.notes" autoHeight placeholder="请输入备注" border="surround" count></u--textarea>
</u-form-item>
<u-form-item labelWidth="auto" label="种养殖类型" required prop="breeding_type" borderBottom>
<u--input 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 labelWidth="auto" label="面积" required prop="area" borderBottom>
<u--input v-model="formData.area" placeholder="请输入面积"></u--input>
<u--input :readonly="readonly" v-model="formData.area" placeholder="请输入面积"></u--input>
</u-form-item>
<picker mode="date" @change="changeDate" :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--input :value="formData.breeding_time" placeholder="请选择种养殖开始时间" disabled disabledColor="#fff"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
</picker>
<picker mode="date" @change="changeDate" :data-value="'mature_time'">
<picker mode="date" @change="changeDate" :disabled="readonly" :data-value="'mature_time'">
<u-form-item labelWidth="auto" label="上市时间" required prop="mature_time" borderBottom>
<u--input :value="formData.mature_time" 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="yield" borderBottom>
<u--input v-model="formData.yield" placeholder="请输入产量"></u--input>
<u--input :readonly="readonly" v-model="formData.yield" placeholder="请输入产量"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="预计收益" required prop="estimated_income" borderBottom>
<u--input v-model="formData.estimated_income" placeholder="请输入预计收益"></u--input>
<u--input :readonly="readonly" v-model="formData.estimated_income" placeholder="请输入预计收益"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="农资农具收益情况" required prop="farm_tools" borderBottom>
<u--textarea v-model="formData.farm_tools" autoHeight placeholder="请输入农资农具收益情况" border="surround"
<u--textarea :disabled="readonly" v-model="formData.farm_tools" autoHeight placeholder="请输入农资农具收益情况" border="surround"
count></u--textarea>
</u-form-item>
<u-form-item labelWidth="auto" label="是否生态种养殖" required prop="ecological_farming" borderBottom>
<u-radio-group v-model="formData.ecological_farming" style="margin: 16rpx;">
<u-radio-group :disabled="readonly" v-model="formData.ecological_farming" 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">
@ -67,13 +67,13 @@
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="现代化程度" required prop="modernization" borderBottom>
<u--input v-model="formData.modernization" placeholder="请输入现代化程度"></u--input>
<u--input :readonly="readonly" v-model="formData.modernization" placeholder="请输入现代化程度"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="预售卖价格" required prop="pre_price" borderBottom>
<u--input v-model="formData.pre_price" placeholder="请输入预售卖价格"></u--input>
<u--input :readonly="readonly" v-model="formData.pre_price" placeholder="请输入预售卖价格"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="销售方式" required prop="method_sales" borderBottom>
<u-radio-group v-model="formData.method_sales" style="margin: 16rpx;">
<u-radio-group :disabled="readonly" v-model="formData.method_sales" 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">
@ -81,7 +81,7 @@
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无加工仓储" required prop="processing_storage" borderBottom>
<u-radio-group v-model="formData.processing_storage" style="margin: 16rpx;">
<u-radio-group :disabled="readonly" v-model="formData.processing_storage" 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">
@ -89,7 +89,7 @@
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无宣传推广" required prop="promote" borderBottom>
<u-radio-group v-model="formData.promote" style="margin: 16rpx;">
<u-radio-group :disabled="readonly" v-model="formData.promote" 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">
@ -97,7 +97,7 @@
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无运输" required prop="transportation" borderBottom>
<u-radio-group v-model="formData.transportation" style="margin: 16rpx;">
<u-radio-group :disabled="readonly" v-model="formData.transportation" 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">
@ -105,7 +105,7 @@
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="是否有扩大经营需求" required prop="expand_business_needs" borderBottom>
<u-radio-group v-model="formData.expand_business_needs" style="margin: 16rpx;">
<u-radio-group :disabled="readonly" v-model="formData.expand_business_needs" 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">
@ -113,10 +113,10 @@
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="种养殖需求描述" required prop="demand" borderBottom>
<u--textarea v-model="formData.demand" autoHeight placeholder="请输入种养殖需求描述" border="surround" count></u--textarea>
<u--textarea :disabled="readonly" v-model="formData.demand" autoHeight placeholder="请输入种养殖需求描述" border="surround" count></u--textarea>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="政策补助" required prop="policy_subsidies" borderBottom>
<u--textarea v-model="formData.policy_subsidies" autoHeight placeholder="请输入政策补助" border="surround"
<u--textarea :disabled="readonly" v-model="formData.policy_subsidies" autoHeight placeholder="请输入政策补助" border="surround"
count></u--textarea>
</u-form-item>
</u--form>
@ -126,12 +126,22 @@
<script>
export default {
props:{
readonly: {
type: Boolean,
default: false
},
datas:{
type: Object,
default: null
}
},
data() {
return {
landPlanList: ['自己种养', '出租', '代种养', '租更多地扩大种植'],
formData: {
"cultivated_area": "20", //
"planning": 66, //
"planning": 1, //
"breeding_training": 1, //
"planting_company": 0, //
"notes": "试试备注", //
@ -159,7 +169,25 @@
}
},
created() {
this.initRules()
this.initRules();
if(this.$props.readonly&&this.$props.datas){
this.formData = this.$props.datas;
let keys = Object.keys(this.formData);
keys.forEach(item=>{
if(!isNaN(this.formData[item]))this.formData[item] = +this.formData[item];
})
}
},
watch:{
datas(newValue, oldValue){
if(this.$props.readonly&&newValue){
this.formData = this.$props.datas;
let keys = Object.keys(this.formData);
keys.forEach(item=>{
if(!isNaN(this.formData[item]))this.formData[item] = +this.formData[item];
})
}
}
},
methods: {
//

View File

@ -157,11 +157,28 @@
<script>
export default {
props:{
readonly: {
type: Boolean,
default: false
},
datas:{
type: Object,
default: null
}
},
data() {
return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: {
shop_front: '', //
manage: '',
// construction_land
// type
// area
// count
// canteen
},
rules: {

View File

@ -16,17 +16,17 @@
</picker>
<picker mode="selector" :range="situationList" @change="changesituation" :disabled="readonly" :data-index="index">
<u-form-item labelWidth="auto" label="就业情况" required prop="family.situation" borderBottom>
<u--input :value="item.situation" placeholder="请选择就业情况" disabled disabledColor="#fff"></u--input>
<u--input :value="situationList[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="family" borderBottom>
<u--input v-model="item.skills" :readonly="readonly" placeholder="请输入技能特长"></u--input>
</u-form-item>
<button type="primary" v-if="residents.family.length>1&&!readonly" class="delete"
<button v-if="residents.family.length>1&&!readonly" class="delete"
@click="removeFamily(index)">删除以上信息</button>
</block>
<button type="primary" v-if="!readonly" class="plus" @click="pushFamily">+</button>
<button v-if="!readonly" class="plus" @click="pushFamily">+</button>
</block>
<block value="婴幼儿信息">
<u-form-item labelWidth="auto" label="是否存在学生、婴幼儿" required prop="child" borderBottom>
@ -43,7 +43,7 @@
</u-form-item>
<block v-if="item.age<4">
<u-form-item labelWidth="auto" label="喂养方式" borderBottom>
<u-radio-group v-model="item.wyfs" :disabled="readonly" style="margin: 16rpx;">
<u-radio-group v-model="item.feeding" :disabled="readonly" 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">
@ -71,10 +71,10 @@
<u-form-item label-width="auto" labelPosition="top" label="备注" borderBottom>
<u--textarea v-model="item.notes" autoHeight :disabled="readonly"placeholder="请输入备注" border="surround" count></u--textarea>
</u-form-item>
<button type="primary" v-if="residents.child_arr.length>1&&!readonly" class="delete"
<button v-if="residents.child_arr.length>1&&!readonly" class="delete"
@click="removeChildArr(index)">删除以上信息</button>
</block>
<button type="primary" v-if="residents.child>0&&!readonly" class="plus" @click="pushChildArr">+</button>
<button v-if="residents.child>0&&!readonly" class="plus" @click="pushChildArr">+</button>
</block>
</u--form>
@ -98,21 +98,38 @@
situationList: ['公务员', '国企事业单位', '民营企业', '自由职业', '其他'],
//
residents: {
// family: [{
// name: '',
// birth_time: '',
// situation: '', //
// skills: '', //
// }],
// child: '', //
// child_arr: [ //
// {
// age: '',
// feeding: '', //
// grade: '', //
// is_lesson: '', //
// lessons: '', //
// notes: '' //
// }
// ],
family: [{
name: '',
birth_time: '',
situation: '', //
skills: '', //
name: '超出',
birth_time: '1988-08-08',
situation: 1, //
skills: '豆腐干大锅饭', //
}],
child: '', //
child: 1, //
child_arr: [ //
{
age: '',
feeding: '', //
grade: '', //
is_lesson: '', //
lessons: '', //
notes: '' //
age: '3',
feeding: 1, //
grade: '', //
is_lesson: 1, //
lessons: '数学', //
notes: '没有' //
}
],
},
@ -150,7 +167,17 @@
},
watch:{
datas(newValue, oldValue){
if(this.$props.readonly&&newValue)this.residents = this.$props.datas;
if(this.$props.readonly&&newValue){
this.residents = this.$props.datas;
if(!isNaN(this.residents.child))this.residents.child = +this.residents.child;
this.residents.family.forEach(item=>{
if(!isNaN(item.situation))item.situation = +item.situation;
})
this.residents.child_arr.forEach(item=>{
if(!isNaN(item.feeding))item.feeding = +item.feeding;
if(!isNaN(item.is_lesson))item.is_lesson = +item.is_lesson;
})
}
}
},
methods: {
@ -165,7 +192,7 @@
//
changesituation(e) {
let index = e.currentTarget.dataset.index;
this.residents.family[index].situation = this.situationList[e.detail.value];
this.residents.family[index].situation = e.detail.value;
},
//
pushFamily() {

View File

@ -3,83 +3,80 @@
<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-group :disabled="readonly" 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 labelWidth="auto" label="门面面积" required prop="area" borderBottom>
<u--input :readonly="readonly" v-model="formData.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 labelWidth="auto" label="经营地点" required prop="place" borderBottom>
<u--input :readonly="readonly" v-model="formData.place" placeholder="请输入经营地点"></u--input>
</u-form-item>
<picker :range="storeTypeList" mode="selector" @change="changeLanPlan">
<u-form-item labelWidth="auto" label="经营类型" required prop="planning" borderBottom>
<u--input :value="storeTypeList[formData.planning]" placeholder="请选择经营类型" disabled
<picker :range="storeTypeList" :disabled="readonly" mode="selector" @change="changeType">
<u-form-item labelWidth="auto" label="经营类型" required prop="type" borderBottom>
<u--input :value="storeTypeList[formData.type]" 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="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
<u-form-item labelWidth="auto" label="门面环境" required prop="environment" borderBottom>
<u--input :readonly="readonly" v-model="formData.environment" 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 labelWidth="auto" label="服务对象" required prop="service" borderBottom>
<u--input :readonly="readonly" v-model="formData.service" 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-form-item labelWidth="auto" label="有无营业资质" required prop="qualification" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.qualification" 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-form-item labelWidth="auto" label="有无进货渠道" required prop="stock" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.stock" 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="notes" borderBottom>
<u--input v-model="formData.breeding_type" placeholder="请输入店铺规模"></u--input>
<u-form-item labelWidth="auto" label="店铺规模" required prop="scale" borderBottom>
<u--input :readonly="readonly" v-model="formData.scale" placeholder="请输入店铺规模"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="商品来源" required prop="notes" borderBottom>
<u--input v-model="formData.breeding_type" placeholder="请输入商品来源"></u--input>
<u-form-item labelWidth="auto" label="商品来源" required prop="source" borderBottom>
<u--input :readonly="readonly" v-model="formData.source" placeholder="请输入商品来源"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="服务对象" required prop="notes" borderBottom>
<u--input v-model="formData.breeding_type" 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-form-item labelWidth="auto" label="有无线上展示" required prop="online_display" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.online_display" 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-form-item labelWidth="auto" label="有无品牌" required prop="brand" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.brand" 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-form-item labelWidth="auto" label="库存情况" required prop="repertory" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.repertory" 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" labelPosition="top" label="经营诉求" required prop="farm_tools" borderBottom>
<u--textarea v-model="formData.farm_tools" autoHeight placeholder="请输入经营诉求" border="surround"
<u-form-item labelWidth="auto" labelPosition="top" label="经营诉求" required prop="appeal" borderBottom>
<u--textarea :disabled="readonly" v-model="formData.appeal" autoHeight placeholder="请输入经营诉求" border="surround"
count></u--textarea>
</u-form-item>
</u--form>
@ -89,11 +86,33 @@
<script>
export default {
props: {
readonly: {
type: Boolean,
default: false
},
datas: {
type: Object,
default: null
}
},
data() {
return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: {
shop_front: '', //
area: '',
place: '',
type: '',
environment: '',
service: '',
qualification: '',
stock: '',
scale: '',
online_display: '',
brand: '',
repertory: '',
appeal: '',
},
rules: {
@ -101,7 +120,27 @@
}
},
created() {
this.initRules()
this.initRules();
if (this.$props.readonly && this.$props.datas) {
this.formData = this.$props.datas;
console.log(this.formData);
let keys = Object.keys(this.formData);
keys.forEach(item => {
if (!isNaN(this.formData[item])) this.formData[item] = +this.formData[item];
})
console.log(this.formData);
}
},
watch: {
datas(newValue, oldValue) {
if (this.$props.readonly && newValue) {
this.formData = this.$props.datas;
let keys = Object.keys(this.formData);
keys.forEach(item => {
if (!isNaN(this.formData[item])) this.formData[item] = +this.formData[item];
})
}
}
},
methods: {
//
@ -121,32 +160,16 @@
async validate() {
return await this.$refs.breedingForm.validate();;
},
//
changeLanPlan(e) {
//
changeType(e) {
let index = e.currentTarget.dataset.index;
this.formData.planning = e.detail.value;
this.formData.type = 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>

View File

@ -25,7 +25,7 @@
<!-- <view class="new_task" @click="goNewTask">+新建任务</view> -->
<!-- 事件列表 -->
<view class="task_list">
<taskCard class="task_card" v-for="item in 10" :key="item"></taskCard>
<!-- <taskCard class="task_card" v-for="item in 10" :key="item"></taskCard> -->
</view>
<u-loadmore :status="status" :loading-text="loadingText" :loadmore-text="loadmoreText" :nomore-text="nomoreText" />
<!-- <tabbar></tabbar> -->

View File

@ -30,7 +30,7 @@
<uni-icons type="location" color="#999999FF"></uni-icons>
<text>居住地址:</text>
</view>
<view>{{item.address}}</view>
<view>{{item.area_name+item.street_name+item.village_name}}</view>
</view>
<view class="time">
<view class="left">
@ -70,7 +70,8 @@
},
}
},
onLoad() {
onLoad(options) {
console.log(options);
},
onShow() {
this.initLoadconfig();

View File

@ -1,6 +1,10 @@
<template>
<view class="">
<view class="card">
<view class="top_box">
<view class="item" :class="current==0?'active':''" @click="current=0">基本信息</view>
<view class="item" :class="current==1?'active':''" @click="current=1">商机信息</view>
</view>
<view class="card" v-show="current==0">
<u--form labelPosition="left" :model="formData" ref="archives">
<view class="item">
<view class="title">基本信息</view>
@ -10,7 +14,7 @@
<u-form-item label="性别" required prop="sex" borderBottom>
<u-radio-group v-model="formData.sex" :disabled="readonly" style="margin: 16rpx;">
<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:2,label:'女'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
@ -26,7 +30,7 @@
</u-form-item>
</view>
<view class="item">
<districtSelector ref="districtSelectorRef"></districtSelector>
<districtSelector ref="districtSelectorRef" :datas="formData" :readonly="true"></districtSelector>
<u-form-item labelWidth="auto" label="详细地址" required prop="address" borderBottom>
<u--input v-model="formData.address" :readonly="readonly" placeholder="请输入详细地址"></u--input>
</u-form-item>
@ -57,32 +61,32 @@
<residents ref="residentsRef" :readonly="true" :datas="formData"></residents>
<!-- <breeding ref="breedingRef"></breeding> -->
<block v-for="(item, index) in showDemandList" :key="'demand'+index">
<block v-if="item.category_id==0">
<breeding v-if="item.category_child==0" ref="demandRef00"></breeding>
<store v-if="item.category_child==1" ref="demandRef01"></store>
<deepProcessing v-if="item.category_child==2" ref="demandRef02"></deepProcessing>
<thickProcessing v-if="item.category_child==3" ref="demandRef03"></thickProcessing>
</block>
<block v-if="item.category_id==1">
<houseRepair v-if="item.category_child==0" ref="demandRef10"></houseRepair>
<houseDecoration v-if="item.category_child==1" ref="demandRef11"></houseDecoration>
<houseRenovate v-if="item.category_child==2" ref="demandRef12"></houseRenovate>
<houseTransaction v-if="item.category_child==3" ref="demandRef13"></houseTransaction>
</block>
<block v-if="item.category_id==2">
<banquetMarry v-if="item.category_child==0" ref="demandRef20"></banquetMarry>
<banquetBirthday v-if="item.category_child==1" ref="demandRef21"></banquetBirthday>
<banquetFullMoon v-if="item.category_child==2" ref="demandRef22"></banquetFullMoon>
<banquetOther v-if="item.category_child==3" ref="demandRef23"></banquetOther>
<banquetFuneral v-if="item.category_child==4" ref="demandRef24"></banquetFuneral>
</block>
</block>
</u--form>
<!-- <button @click="addArchives" type="primary" class="btn">完成登记</button> -->
</view>
<view class="card" style="padding-top: 1rpx;" v-show="current==1">
<block v-for="(item, index) in formData.datas" :key="'demand'+index+item.id">
<block>
<breeding v-if="item.id==7" :datas="item.datas" :readonly="true" ref="demandRef7"></breeding>
<store v-if="item.id==8" :datas="item.datas" :readonly="true" ref="demandRef8"></store>
<deepProcessing v-if="item.id==9" :datas="item.datas" :readonly="true" ref="demandRef9"></deepProcessing>
<thickProcessing v-if="item.id==10" :datas="item.datas" :readonly="true" ref="demandRef10"></thickProcessing>
</block>
<block>
<houseRepair v-if="item.id==12" :datas="item.datas" :readonly="true" ref="demandRef12"></houseRepair>
<houseDecoration v-if="item.id==13" :datas="item.datas" :readonly="true" ref="demandRef13"></houseDecoration>
<houseRenovate v-if="item.id==14" :datas="item.datas" :readonly="true" ref="demandRef14"></houseRenovate>
<houseTransaction v-if="item.id==15" :datas="item.datas" :readonly="true" ref="demandRef15"></houseTransaction>
</block>
<block>
<banquetMarry v-if="item.id==17" :datas="item.datas" :readonly="true" ref="demandRef17"></banquetMarry>
<banquetBirthday v-if="item.id==18" :datas="item.datas" :readonly="true" ref="demandRef18"></banquetBirthday>
<banquetFullMoon v-if="item.id==19" :datas="item.datas" :readonly="true" ref="demandRef19"></banquetFullMoon>
<banquetOther v-if="item.id==20" :datas="item.datas" :readonly="true" ref="demandRef20"></banquetOther>
<banquetFuneral v-if="item.id==21" :datas="item.datas" :readonly="true" ref="demandRef21"></banquetFuneral>
</block>
</block>
</view>
</view>
</template>
@ -109,6 +113,7 @@
data() {
return {
readonly: true,
current: 0,
showDemandList: [],
formData: {
id_card: '',
@ -120,8 +125,8 @@
wechat: '', //
address: '', //
age: '', //
category_id: '1',
category_child: '2',
category_id: 1,
category_child: 1,
data_type: '1',
},
@ -147,6 +152,27 @@
</script>
<style lang="scss">
.top_box{
background-color: #fff;
display: flex;
.item{
width: 175rpx;
height: 53rpx;
background: #F5F5F5FF;
color: #999999FF;
border-radius: 35rpx 35rpx 35rpx 35rpx;
opacity: 1;
display: flex;
justify-content: center;
align-items: center;
margin: 28rpx;
}
.active{
background: $theme-oa-color;
color: #fff;
}
}
.card {
background-color: #fff;
margin: 28rpx;

View File

@ -59,6 +59,7 @@
},
onLoad() {},
onShow() {
this.initLoadConfig()
this.initContractList()
},
onReady() {
@ -74,20 +75,30 @@
url: url
}) : Toast('暂未开放')
},
initLoadConfig(){
this.loadConfig.page = 1;
this.loadConfig.status = "loadmore";
this.list = [];
},
async initContractList() {
if(this.loadConfig.status=="nomore")return;
this.loadConfig.status="loading"
let res = await contractList({
page: this.loadConfig.page,
limit: this.loadConfig.limit
})
this.loadConfig.status="loadmore"
if(res.data.data.length<this.loadConfig.limit){
this.loadConfig.status="nomore"
}else {
this.loadConfig.page++;
try{
if(this.loadConfig.status=="nomore")return;
this.loadConfig.status="loading"
let res = await contractList({
page: this.loadConfig.page,
limit: this.loadConfig.limit
})
this.loadConfig.status="loadmore"
if(res.data.data.length<this.loadConfig.limit){
this.loadConfig.status="nomore"
}else {
this.loadConfig.page++;
}
this.list = [...this.list, ...res.data?.data]
}catch(e){
this.initLoadConfig();
this.loadConfig.status = "nomore"
}
this.list = [...this.list, ...res.data?.data]
}
},
onPullDownRefresh() {

View File

@ -10,7 +10,7 @@
<u-form-item label="性别" required prop="sex" borderBottom>
<u-radio-group v-model="formData.sex" style="margin: 16rpx;">
<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:2,label:'女'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
@ -56,36 +56,36 @@
</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">
<breeding v-if="item.category_child==0" ref="demandRef00"></breeding>
<store v-if="item.category_child==1" ref="demandRef01"></store>
<deepProcessing v-if="item.category_child==2" ref="demandRef02"></deepProcessing>
<thickProcessing v-if="item.category_child==3" ref="demandRef03"></thickProcessing>
<block>
<breeding v-if="item.id==7" ref="demandRef7"></breeding>
<store v-if="item.id==8" ref="demandRef8"></store>
<deepProcessing v-if="item.id==9" ref="demandRef9"></deepProcessing>
<thickProcessing v-if="item.id==10" ref="demandRef10"></thickProcessing>
</block>
<block v-if="item.category_id==1">
<houseRepair v-if="item.category_child==0" ref="demandRef10"></houseRepair>
<houseDecoration v-if="item.category_child==1" ref="demandRef11"></houseDecoration>
<houseRenovate v-if="item.category_child==2" ref="demandRef12"></houseRenovate>
<houseTransaction v-if="item.category_child==3" ref="demandRef13"></houseTransaction>
<block>
<houseRepair v-if="item.id==12" ref="demandRef12"></houseRepair>
<houseDecoration v-if="item.id==13" ref="demandRef13"></houseDecoration>
<houseRenovate v-if="item.id==14" ref="demandRef14"></houseRenovate>
<houseTransaction v-if="item.id==15" ref="demandRef15"></houseTransaction>
</block>
<block v-if="item.category_id==2">
<banquetMarry v-if="item.category_child==0" ref="demandRef20"></banquetMarry>
<banquetBirthday v-if="item.category_child==1" ref="demandRef21"></banquetBirthday>
<banquetFullMoon v-if="item.category_child==2" ref="demandRef22"></banquetFullMoon>
<banquetOther v-if="item.category_child==3" ref="demandRef23"></banquetOther>
<banquetFuneral v-if="item.category_child==4" ref="demandRef24"></banquetFuneral>
<block>
<banquetMarry v-if="item.id==17" ref="demandRef17"></banquetMarry>
<banquetBirthday v-if="item.id==18" ref="demandRef18"></banquetBirthday>
<banquetFullMoon v-if="item.id==19" ref="demandRef19"></banquetFullMoon>
<banquetOther v-if="item.id==20" ref="demandRef20"></banquetOther>
<banquetFuneral v-if="item.id==21" ref="demandRef21"></banquetFuneral>
</block>
<button type="primary" class="delete" @click="removeShowDemand">-</button>
<button 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]"
<button class="plus demand" @click="demandShow=true">点击添加更多需求</button>
<u-picker :show="demandShow" ref="demandRef" :loading="demandLoading" :columns="[demandList, demandListChild]" keyName="name"
@change="changeHandler" @cancel="demandShow = false" @confirm="changeDemand"></u-picker>
</u--form>
<button @click="addArchives" type="primary" class="btn">完成登记</button>
<button @click="addArchives" class="btn">完成登记</button>
</view>
</view>
</template>
@ -93,6 +93,8 @@
<script>
import { Toast } from "../../libs/uniApi"
import { informationAdd } from "@/api/information.js"
import { debounce, forEach, throttle } from "lodash"
import { categoryBusinessList } from "@/api/oaPbulic.js"
import districtSelector from "@/components/districtSelector/districtSelector.vue" //
import residents from "@/components/newArchives/residents.vue" //
import breeding from "@/components/newArchives/breeding.vue" //
@ -109,24 +111,38 @@
import banquetOther from "@/components/newArchives/banquetOther.vue" //
import banquetFuneral from "@/components/newArchives/banquetFuneral.vue" //
export default {
components: { districtSelector, residents, breeding, store, deepProcessing, thickProcessing, houseRepair, houseDecoration, houseRenovate,houseTransaction, banquetMarry, banquetBirthday,banquetFullMoon, banquetOther, banquetFuneral },
components: { districtSelector, residents, breeding, store, deepProcessing, thickProcessing, houseRepair,
houseDecoration, houseRenovate, houseTransaction, banquetMarry, banquetBirthday, banquetFullMoon, banquetOther,
banquetFuneral },
data() {
return {
demandShow: false,
demandLoading: false,
demandList: ['生产投入明细', '修房装修', '宴席', '生活采购'], //
demandListChild: ['种养殖', '开设店铺', '深加工', '粗加工'], //
demandList: [], //
demandListChild: [], //
showDemandList: [], //
formData: {
id_card: '',
sex: '',
name: '',
phone: '', //
highway: '', //
smart_phone: '', //使
wechat: '', //
address: '', //
age: '', //
// id_card: '',
// sex: '',
// name: '',
// phone: '', //
// highway: '', //
// smart_phone: '', //使
// wechat: '', //
// address: '', //
// age: '', //
// category_id: '1',
// category_child: '2',
// data_type: '1',
id_card: '324234234353454343',
sex: 1,
name: '测试的',
phone: 14332323444, //
highway: 1, //
smart_phone: 1, //使
wechat: 21313132, //
address: '大师傅大师傅但是', //
age: 33, //
category_id: '1',
category_child: '2',
data_type: '1',
@ -184,12 +200,15 @@
},
}
},
onLoad() {},
onLoad() {
this.initCategoryBusinessList();
},
onShow() {},
methods: {
//
async addArchives() {
Toast('开发中')
let refsDatas = this.loadRefsDatas();
let flag1 = this.$refs.districtSelectorRef.validate();
let flag2 = this.$refs.residentsRef.validate();
let flag3 = this.$refs.breedingRef.validate();
@ -207,68 +226,68 @@
...districtForm,
...this.$refs.residentsRef.residents,
datas: [{
category_id: '1',
category_child: '2',
datas: {
...this.$refs.breedingRef.formData
}
}]
id: 7,
datas: {
...this.$refs.breedingRef.formData
}
},
...refsDatas
]
});
uni.hideLoading()
uni.showToast({
icon: "none",
title: "添加成功",
success: () => {
setTimeout(() => {
uni.navigateBack()
}, 1000)
// setTimeout(() => {
// uni.navigateBack()
// }, 1000)
}
})
}
})
},
//
loadRefsDatas() {
let datas = [];
this.showDemandList.forEach(item => {
// console.log(this.$refs['demandRef'+item.category_id+''+item.category_child][0]);
this.$refs['demandRef' + item.id][0].validate();
datas.push({
id: item.id,
datas: { ...this.$refs['demandRef' + item.id][0]['formData'] }
})
})
// console.log(datas);
return datas;
},
//
async initCategoryBusinessList(){
let res = await categoryBusinessList();
this.demandList = res.data;
},
//
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)
this.demandListChild = this.demandList[e.indexs[0]].children||[];
}
},
//
changeDemand(e) {
this.showDemandList.push({
category_id: e.indexs[0],
category_child: e.indexs[1],
})
// console.log(this.showDemandList);
changeDemand: throttle(function(e) {
this.demandShow = false;
},
if(e.value[1]){
this.showDemandList.push(e.value[1]);
}else {
this.showDemandList.push(e.value[0]);
}
}, 3000),
//
removeShowDemand(index){
removeShowDemand(index) {
uni.showModal({
title:'确定删除这一部分内容吗',
title: '确定删除这一部分内容吗',
success: (res) => {
if(res.confirm)this.showDemandList.splice(index, 1);
if (res.confirm) this.showDemandList.splice(index, 1);
}
})
}

View File

@ -43,7 +43,7 @@
</view>
<u-line color="#999999FF"></u-line>
<view class="bottom" style="margin-top: 28rpx;">
<button class="look" @click="navTo('/subpkg/archives/archives')">片区档案</button>
<button class="look" @click="navTo('/subpkg/archives/archives?id='+item.id)">片区档案</button>
<button class="look" @click="navTo('/subpkg/personnelDetails/personnelDetails?id='+item.id)">查看</button>
</view>
</view>