This commit is contained in:
wpf 2023-08-20 20:48:16 +08:00
commit a6614b7f90
8 changed files with 1840 additions and 1348 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,279 +1,329 @@
<template>
<view class="card">
<view class="title">养殖信息</view>
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
<u-form-item labelWidth="auto" label="有无养殖培训" required prop="breeding_training" borderBottom>
<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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无注册成立养殖公司" required prop="breeding_company" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.breeding_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" labelPosition="top" label="备注" required prop="notes" borderBottom>
<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 :readonly="readonly" v-model="formData.breeding_type" placeholder="请输入养殖类型"></u--input>
</u-form-item>
<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" :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 :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 :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 :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 :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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="现代化程度" required prop="modernization" borderBottom>
<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 :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 :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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无加工仓储" required prop="processing_storage" borderBottom>
<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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无宣传推广" required prop="promote" borderBottom>
<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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无运输" required prop="transportation" borderBottom>
<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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="是否有扩大经营需求" required prop="expand_business_needs" borderBottom>
<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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="需求描述" prop="demand" borderBottom>
<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="政策补助" prop="policy_subsidies" borderBottom>
<u--textarea :disabled="readonly" v-model="formData.policy_subsidies" autoHeight placeholder="请输入政策补助" border="surround"
count></u--textarea>
</u-form-item>
</u--form>
<view class="content">[[]]
<view class="tit">
<text v-if="readonly">更新时间: {{update_time}}</text>
<text>养殖信息</text>
</view>
<view class="card">
<!-- <view class="title">养殖信息</view> -->
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
<u-form-item labelWidth="auto" label="有无养殖培训" required prop="breeding_training" borderBottom>
<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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无注册成立养殖公司" required prop="breeding_company" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.breeding_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" labelPosition="top" label="备注" required prop="notes" borderBottom>
<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 :readonly="readonly" v-model="formData.breeding_type" placeholder="请输入养殖类型"></u--input>
</u-form-item>
<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" :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 :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 :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 :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 :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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="现代化程度" required prop="modernization" borderBottom>
<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 :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 :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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无加工仓储" required prop="processing_storage" borderBottom>
<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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无宣传推广" required prop="promote" borderBottom>
<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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无运输" required prop="transportation" borderBottom>
<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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="是否有扩大经营需求" required prop="expand_business_needs" borderBottom>
<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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="需求描述" prop="demand" borderBottom>
<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="政策补助" prop="policy_subsidies" borderBottom>
<u--textarea :disabled="readonly" v-model="formData.policy_subsidies" autoHeight
placeholder="请输入政策补助" border="surround" count></u--textarea>
</u-form-item>
</u--form>
</view>
</view>
</view>
</template>
<script>
export default {
props:{
readonly: {
type: Boolean,
default: false
},
datas:{
type: Object,
default: null
}
},
data() {
return {
landPlanList: ['自己养', '出租', '代养', '租更多地扩大养殖'],
formData: {
// "breeding_training": 1, //
// "breeding_company": 0, //
// "notes": "", //
// "breeding_type": 22, //
// "breeding_time": "2022-07-22", //
// "mature_time": "2022-07-22", //
// "yield": 600, //
// "estimated_income": 1500, //
// "farm_tools": ",", //使
// "ecological_farming": 1, //
// "modernization": 30, //
// "pre_price": "30.00", //
// "method_sales": 1, //
// "processing_storage": 0, //
// "promote": 0, //广
// "transportation": 0, //
// "expand_business_needs": 0, //
// "demand": "", //
// "policy_subsidies": "" ,//
"breeding_training": "", //
"breeding_company": "", //
"notes": "", //
"breeding_type": "", //
"area": "", //
"breeding_time": "", //
"mature_time": "", //
"yield": "", //
"estimated_income": "", //
"farm_tools": "", //使
"ecological_farming": "", //
"modernization": "", //
"pre_price": "", //
"method_sales": "", //
"processing_storage": "", //
"promote": "", //广
"transportation": "", //
"expand_business_needs": "", //
"demand": "", //
"policy_subsidies": "" //
},
rules: {
export default {
props: {
readonly: {
type: Boolean,
default: false
},
datas: {
type: Object,
default: null
},
update_time: {
type: String,
default: null
}
},
data() {
return {
landPlanList: ['自己养', '出租', '代养', '租更多地扩大养殖'],
formData: {
// "breeding_training": 1, //
// "breeding_company": 0, //
// "notes": "", //
// "breeding_type": 22, //
// "breeding_time": "2022-07-22", //
// "mature_time": "2022-07-22", //
// "yield": 600, //
// "estimated_income": 1500, //
// "farm_tools": ",", //使
// "ecological_farming": 1, //
// "modernization": 30, //
// "pre_price": "30.00", //
// "method_sales": 1, //
// "processing_storage": 0, //
// "promote": 0, //广
// "transportation": 0, //
// "expand_business_needs": 0, //
// "demand": "", //
// "policy_subsidies": "" ,//
"breeding_training": "", //
"breeding_company": "", //
"notes": "", //
"breeding_type": "", //
"area": "", //
"breeding_time": "", //
"mature_time": "", //
"yield": "", //
"estimated_income": "", //
"farm_tools": "", //使
"ecological_farming": "", //
"modernization": "", //
"pre_price": "", //
"method_sales": "", //
"processing_storage": "", //
"promote": "", //广
"transportation": "", //
"expand_business_needs": "", //
"demand": "", //
"policy_subsidies": "" //
},
rules: {
}
}
},
created() {
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: {
//
initRules(){
let arr = Object.keys(this.formData);
let white = ['demand', 'policy_subsidies'];
arr = arr.filter(item=>{
return !white.includes(item);
})
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;
},
},
}
}
}
},
created() {
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: {
//
initRules() {
let arr = Object.keys(this.formData);
let white = ['demand', 'policy_subsidies'];
arr = arr.filter(item => {
return !white.includes(item);
})
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;
},
},
}
</script>
<style lang="scss">
.card{
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
border-radius: 14rpx;
}
.title {
font-weight: 500;
font-size: 34rpx;
.card {
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
margin-top: 0;
padding-top: 0;
border-radius: 0 0 14rpx 14rpx;
}
&::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: 64rpx;
line-height: 64rpx;
background: #f56c6c;
border-radius: 14rpx;
font-size: 28rpx;
color: #fff;
text-align: center;
}
.tit {
margin: 28rpx 28rpx 0 28rpx;
padding: 28rpx 28rpx 0 28rpx;
border-radius: 14rpx 14rpx 0 0;
background-color: $theme-oa-color;
color: white;
height: 100rpx;
display: flex;
justify-content: space-between;
.plus {
margin: 22rpx 0;
// margin-bottom: 40rpx;
width: 100%;
height: 64rpx;
line-height: 64rpx;
background: $theme-oa-color;
border-radius: 14rpx;
font-size: 28rpx;
color: #fff;
text-align: center;
}
}
.title {
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: 64rpx;
line-height: 64rpx;
background: #f56c6c;
border-radius: 14rpx;
font-size: 28rpx;
color: #fff;
text-align: center;
}
.plus {
margin: 22rpx 0;
// margin-bottom: 40rpx;
width: 100%;
height: 64rpx;
line-height: 64rpx;
background: $theme-oa-color;
border-radius: 14rpx;
font-size: 28rpx;
color: #fff;
text-align: center;
}
</style>

View File

@ -1,296 +1,344 @@
<template>
<view class="card">
<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 :readonly="readonly" v-model="formData.cultivated_area" placeholder="请输入土地总面积"></u--input>
</u-form-item>
<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 :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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无注册成立种植公司" required prop="planting_company" borderBottom>
<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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="备注" required prop="notes" borderBottom>
<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 :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 :readonly="readonly" v-model="formData.area" placeholder="请输入面积"></u--input>
</u-form-item>
<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" :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 :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 :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 :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 :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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="现代化程度" required prop="modernization" borderBottom>
<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 :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 :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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无加工仓储" required prop="processing_storage" borderBottom>
<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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无宣传推广" required prop="promote" borderBottom>
<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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无运输" required prop="transportation" borderBottom>
<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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="是否有扩大经营需求" required prop="expand_business_needs" borderBottom>
<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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="需求描述" prop="demand" borderBottom>
<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="政策补助" prop="policy_subsidies" borderBottom>
<u--textarea :disabled="readonly" v-model="formData.policy_subsidies" autoHeight placeholder="请输入政策补助" border="surround"
count></u--textarea>
</u-form-item>
</u--form>
</view>
<view class="content">
<view class="tit">
<text v-if="readonly">更新时间: {{update_time}}</text>
<text>种植信息</text>
</view>
<view class="card">
<!-- <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 :readonly="readonly" v-model="formData.cultivated_area" placeholder="请输入土地总面积"></u--input>
</u-form-item>
<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 :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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无注册成立种植公司" required prop="planting_company" borderBottom>
<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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="备注" required prop="notes" borderBottom>
<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 :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 :readonly="readonly" v-model="formData.area" placeholder="请输入面积"></u--input>
</u-form-item>
<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" :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 :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 :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 :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 :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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="现代化程度" required prop="modernization" borderBottom>
<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 :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 :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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无加工仓储" required prop="processing_storage" borderBottom>
<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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无宣传推广" required prop="promote" borderBottom>
<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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无运输" required prop="transportation" borderBottom>
<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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="是否有扩大经营需求" required prop="expand_business_needs" borderBottom>
<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">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="需求描述" prop="demand" borderBottom>
<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="政策补助" prop="policy_subsidies" borderBottom>
<u--textarea :disabled="readonly" v-model="formData.policy_subsidies" autoHeight
placeholder="请输入政策补助" border="surround" count></u--textarea>
</u-form-item>
</u--form>
</view>
</view>
</template>
<script>
export default {
props:{
readonly: {
type: Boolean,
default: false
},
datas:{
type: Object,
default: null
}
},
data() {
return {
landPlanList: ['自己种', '出租', '代种', '租更多地扩大种植'],
formData: {
// "cultivated_area": "20", //
// "planning": 1, //
// "breeding_training": 1, //
// "planting_company": 0, //
// "notes": "", //
// "breeding_type": 22, //
// "area": 20, //
// "breeding_time": "2022-07-22", //
// "mature_time": "2022-07-22", //
// "yield": 600, //
// "estimated_income": 1500, //
// "farm_tools": ",", //使
// "ecological_farming": 1, //
// "modernization": 30, //
// "pre_price": "30.00", //
// "method_sales": 1, //
// "processing_storage": 0, //
// "promote": 0, //广
// "transportation": 0, //
// "expand_business_needs": 0, //
// "demand": "", //
// "policy_subsidies": "" ,//
"cultivated_area": "", //
"planning": "", //
"breeding_training": "", //
"planting_company": "", //
"notes": "", //
"breeding_type": "", //
"area": "", //
"breeding_time": "", //
"mature_time": "", //
"yield": "", //
"estimated_income": "", //
"farm_tools": "", //使
"ecological_farming": "", //
"modernization": "", //
"pre_price": "", //
"method_sales": "", //
"processing_storage": "", //
"promote": "", //广
"transportation": "", //
"expand_business_needs": "", //
"demand": "", //
"policy_subsidies": "" //
},
rules: {
export default {
props: {
readonly: {
type: Boolean,
default: false
},
update_time: {
type: String,
default: null
},
datas: {
type: Object,
default: null
}
},
data() {
return {
landPlanList: ['自己种', '出租', '代种', '租更多地扩大种植'],
formData: {
// "cultivated_area": "20", //
// "planning": 1, //
// "breeding_training": 1, //
// "planting_company": 0, //
// "notes": "", //
// "breeding_type": 22, //
// "area": 20, //
// "breeding_time": "2022-07-22", //
// "mature_time": "2022-07-22", //
// "yield": 600, //
// "estimated_income": 1500, //
// "farm_tools": ",", //使
// "ecological_farming": 1, //
// "modernization": 30, //
// "pre_price": "30.00", //
// "method_sales": 1, //
// "processing_storage": 0, //
// "promote": 0, //广
// "transportation": 0, //
// "expand_business_needs": 0, //
// "demand": "", //
// "policy_subsidies": "" ,//
"cultivated_area": "", //
"planning": "", //
"breeding_training": "", //
"planting_company": "", //
"notes": "", //
"breeding_type": "", //
"area": "", //
"breeding_time": "", //
"mature_time": "", //
"yield": "", //
"estimated_income": "", //
"farm_tools": "", //使
"ecological_farming": "", //
"modernization": "", //
"pre_price": "", //
"method_sales": "", //
"processing_storage": "", //
"promote": "", //广
"transportation": "", //
"expand_business_needs": "", //
"demand": "", //
"policy_subsidies": "" //
},
rules: {
}
}
},
created() {
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: {
//
initRules(){
let arr = Object.keys(this.formData);
let white = ['demand', 'policy_subsidies'];
arr = arr.filter(item=>{
return !white.includes(item);
})
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;
},
},
}
}
}
},
created() {
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: {
//
initRules() {
let arr = Object.keys(this.formData);
let white = ['demand', 'policy_subsidies'];
arr = arr.filter(item => {
return !white.includes(item);
})
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;
},
},
}
</script>
<style lang="scss">
.card{
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
border-radius: 14rpx;
}
.title {
font-weight: 500;
font-size: 34rpx;
.card {
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
margin-top: 0;
padding-top: 0;
border-radius: 0 0 14rpx 14rpx;
}
&::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: 64rpx;
line-height: 64rpx;
background: #f56c6c;
border-radius: 14rpx;
font-size: 28rpx;
color: #fff;
text-align: center;
}
.tit {
margin: 28rpx 28rpx 0 28rpx;
padding: 28rpx 28rpx 0 28rpx;
border-radius: 14rpx 14rpx 0 0;
background-color: $theme-oa-color;
color: white;
height: 100rpx;
display: flex;
justify-content: space-between;
.plus {
margin: 22rpx 0;
// margin-bottom: 40rpx;
width: 100%;
height: 64rpx;
line-height: 64rpx;
background: $theme-oa-color;
border-radius: 14rpx;
font-size: 28rpx;
color: #fff;
text-align: center;
}
}
.title {
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: 64rpx;
line-height: 64rpx;
background: #f56c6c;
border-radius: 14rpx;
font-size: 28rpx;
color: #fff;
text-align: center;
}
.plus {
margin: 22rpx 0;
// margin-bottom: 40rpx;
width: 100%;
height: 64rpx;
line-height: 64rpx;
background: $theme-oa-color;
border-radius: 14rpx;
font-size: 28rpx;
color: #fff;
text-align: center;
}
</style>

View File

@ -1,234 +1,264 @@
<template>
<view class="card">
<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 :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="area" borderBottom>
<u--input :readonly="readonly" v-model="formData.area" placeholder="请输入门面面积"></u--input>
</u-form-item>
<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" :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="environment" borderBottom>
<u--input :readonly="readonly" v-model="formData.environment" placeholder="请输入门面环境"></u--input>
</u-form-item>
<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="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="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="scale" borderBottom>
<u--input :readonly="readonly" v-model="formData.scale" placeholder="请输入店铺规模"></u--input>
</u-form-item>
<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="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="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="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="appeal" borderBottom>
<u--textarea :disabled="readonly" v-model="formData.appeal" autoHeight placeholder="请输入经营诉求" border="surround"
count></u--textarea>
</u-form-item>
</u--form>
</view>
<view class="content">
<view class="tit">
<text v-if="readonly">更新时间: {{update_time}}</text>
<text>开设店铺</text>
</view>
<view class="card">
<!-- <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 :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="area" borderBottom>
<u--input :readonly="readonly" v-model="formData.area" placeholder="请输入门面面积"></u--input>
</u-form-item>
<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" :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="environment" borderBottom>
<u--input :readonly="readonly" v-model="formData.environment" placeholder="请输入门面环境"></u--input>
</u-form-item>
<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="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="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="scale" borderBottom>
<u--input :readonly="readonly" v-model="formData.scale" placeholder="请输入店铺规模"></u--input>
</u-form-item>
<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="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="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="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="appeal" borderBottom>
<u--textarea :disabled="readonly" v-model="formData.appeal" autoHeight placeholder="请输入经营诉求"
border="surround" count></u--textarea>
</u-form-item>
</u--form>
</view>
</view>
</template>
<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: {
export default {
props: {
readonly: {
type: Boolean,
default: false
},
datas: {
type: Object,
default: null
},
update_time: {
type: String,
default: null
},
},
data() {
return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: {
shop_front: '', //
area: '',
place: '',
type: '',
environment: '',
service: '',
qualification: '',
stock: '',
scale: '',
online_display: '',
brand: '',
repertory: '',
appeal: '',
},
rules: {
}
}
},
created() {
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];
})
// 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: {
//
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();
},
//
changeType(e) {
let index = e.currentTarget.dataset.index;
this.formData.type = e.detail.value;
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
},
},
}
}
}
},
created() {
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];
})
// 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: {
//
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();
},
//
changeType(e) {
let index = e.currentTarget.dataset.index;
this.formData.type = e.detail.value;
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
},
},
}
</script>
<style lang="scss">
.card {
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
border-radius: 14rpx;
}
.card {
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
margin-top: 0;
padding-top: 0;
border-radius: 0 0 14rpx 14rpx;
}
.title {
font-weight: 500;
font-size: 34rpx;
.tit {
margin: 28rpx 28rpx 0 28rpx;
padding: 28rpx 28rpx 0 28rpx;
border-radius: 14rpx 14rpx 0 0;
background-color: $theme-oa-color;
color: white;
height: 100rpx;
display: flex;
justify-content: space-between;
&::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: 64rpx;
line-height: 64rpx;
background: #f56c6c;
border-radius: 14rpx;
font-size: 28rpx;
color: #fff;
text-align: center;
}
.title {
font-weight: 500;
font-size: 34rpx;
.plus {
margin: 22rpx 0;
&::before {
width: 8rpx;
height: 26rpx;
border-radius: 4rpx;
background-color: #3175f9;
content: "";
display: inline-block;
margin-right: 8rpx;
}
}
// margin-bottom: 40rpx;
.delete {
margin: 22rpx 0;
// margin-bottom: 40rpx;
width: 100%;
height: 64rpx;
line-height: 64rpx;
background: #f56c6c;
border-radius: 14rpx;
font-size: 28rpx;
color: #fff;
text-align: center;
}
width: 100%;
.plus {
margin: 22rpx 0;
height: 64rpx;
// margin-bottom: 40rpx;
line-height: 64rpx;
width: 100%;
background: $theme-oa-color;
height: 64rpx;
border-radius: 14rpx;
line-height: 64rpx;
font-size: 28rpx;
background: $theme-oa-color;
color: #fff;
border-radius: 14rpx;
text-align: center;
font-size: 28rpx;
}
color: #fff;
text-align: center;
}
</style>

View File

@ -5,13 +5,14 @@
<view class="item" :class="current==1?'active':''" @click="current=1">商机信息</view>
</view> -->
<u-sticky bgColor="#fff">
<u-tabs :list="tabLists" @click="changeCurrent" lineColor='#3274F9' :scrollable="false" lineWidth='40'
inactiveStyle='color:#666' activeStyle="color:#3274F9"></u-tabs>
<u-tabs :list="tabLists" style="background-color: #0022C7;" @click="changeCurrent" lineColor='white'
:scrollable="false" lineWidth='40' inactiveStyle='color:white' activeStyle="color:white"></u-tabs>
</u-sticky>
<u-skeleton :style="{'margin': skeleton?28+'rpx':0}" :loading="skeleton" :animate="true" title rows="6"
rows-width="100%" rowsHeight="56">
<u--form v-show="current==0" labelPosition="left" :model="formData" ref="archives">
<view class="card">
<!-- <view class="card">
<view class="item">
<view class="title">基本信息</view>
<u-form-item labelWidth="auto" label="姓名" required prop="name" borderBottom>
@ -41,12 +42,10 @@
<view class="card" style="margin-bottom: 0;">
<view class="item">
<view class="title">地区信息</view>
<!-- <districtSelector ref="districtSelectorRef" :datas="formData" :readonly="true"></districtSelector> -->
<u-form-item labelWidth="auto" label="地址" borderBottom>
<u--textarea :value="nowAddress" autoHeight readonly></u--textarea>
</u-form-item>
<u-form-item labelWidth="auto" label="小队" required prop="address" borderBottom>
<!-- <u--input v-model="formData.brigade_name&&formData.brigade_name[0].brigade_name" :readonly="readonly" placeholder="请选择小队"></u--input> -->
<u--input v-model="formData.brigade_name" :readonly="readonly"
placeholder="请选择小队"></u--input>
</u-form-item>
@ -80,18 +79,191 @@
</block>
</view>
</view>
-->
<view class="personnel_list">
<view class="cards">
<view class="card_head">
<text style="font-size: 34rpx;">人员姓名: {{formData.name}}</text>
</view>
<view class="card_content">
<view class="right">
<view class="">
<text>性别 :</text>
<text> {{formData.sex}}</text>
</view>
<view class="">
<text>年龄 :</text>
<text>{{formData.age}}</text>
</view>
<view class="">
<text>联系方式 :</text>
<text>{{formData.phone}}</text>
</view>
<view class="">
<text>身份证号 :</text>
<text>{{formData.id_card}}</text>
</view>
<view class="hr">
</view>
<view class="">
<text>居住地址 :</text>
<text>{{nowAddress}}</text>
</view>
<view class="">
<text>详细地址 :</text>
<text>{{formData.address}}</text>
</view>
<view class="check_view">
<text>汽车是否到家 :</text>
<u-radio-group v-model="formData.highway" :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">
</u-radio>
</u-radio-group>
</view>
<view class="check_view">
<text>是否使用智能手机 :</text>
<u-radio-group v-model="formData.smart_phone" :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">
</u-radio>
</u-radio-group>
</view>
</view>
</view>
</view>
<view class="cards" v-for="(item, index) in formData.family" :key="'user'+index">
<view class="card_head">
<text style="font-size: 34rpx;">常住人口</text>
</view>
<view class="card_content">
<view class="right">
<view class="">
<text>姓名 :</text>
<text> {{item.name}}</text>
</view>
<view class="">
<text>出生日期 :</text>
<text>{{item.birth_time}}</text>
</view>
<view class="">
<text>就业情况 :</text>
<text>{{formData.phone}}</text>
</view>
<view class="">
<text>技能特长 :</text>
<text>{{item.skills}}</text>
</view>
<view class="check_view">
<text>是否存在学生婴幼儿 :</text>
<u-radio-group v-model="formData.child" :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">
</u-radio>
</u-radio-group>
</view>
</view>
</view>
</view>
<view class="cards" v-if="formData.child>0" v-for="(item,index) in formData.child_arr"
:key="'child'+index">
<view class="card_head">
<text style="font-size: 34rpx;">婴幼儿信息</text>
</view>
<view class="card_content" v-if='item.age>4'>
<view class="right">
<view class="">
<text>年龄 :</text>
<text>{{item.age}}</text>
</view>
<view class="check_view">
<text>年级 :</text>
<text>{{item.grade}}</text>
</view>
<view class="check_view">
<text>是否补课 :</text>
<u-radio-group v-model="item.is_lesson" style="margin: 16rpx;" :disabled="readonly">
<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>
</view>
<view class="check_view">
<text>补课内容 :</text>
<text>{{item.lessons || 0}}</text>
</view>
<view class="check_view">
<text>备注 :</text>
<text>{{item.notes}}</text>
</view>
</view>
</view>
<view class="card_content" v-else>
<view class="right">
<view class="">
<text>年龄 :</text>
<text>{{item.age}}</text>
</view>
<view class="check_view">
<text>喂养方式 :</text>
<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">
</u-radio>
</u-radio-group>
</view>
<view class="check_view">
<text>备注 :</text>
<text>{{item.notes}}</text>
</view>
</view>
</view>
</view>
</view>
</u--form>
<residents v-show="current==0" ref="residentsRef" :readonly="true" :datas="formData"></residents>
<!-- <residents v-show="current==0" ref="residentsRef" :readonly="true" :datas="formData"></residents> -->
<view v-show="current==1">
<block v-for="(item, index) in formData.datas" :key="'demand'+index+item.id">
<view class="update_time">
<view>更新时间:{{item.update_time}}</view>
<view class="right">{{updateTo(item.update_time)}}</view>
<!-- <view>更新时间:{{item.update_time}}</view> -->
<!-- <view class="right">{{updateTo(item.update_time)}}</view> -->
</view>
<block>
<breeding v-if="item.id==32" ref="demandRef32" :datas="item.datas" :readonly="true"></breeding>
<plant v-if="item.id==7" ref="demandRef7" :datas="item.datas" :readonly="true"></plant>
<store v-if="item.id==8" ref="demandRef8" :datas="item.datas" :readonly="true"></store>
<breeding v-if="item.id==32" ref="demandRef32" :update_time="item.update_time"
:datas="item.datas" :readonly="true"></breeding>
<plant v-if="item.id==7" ref="demandRef7" :update_time="item.update_time" :datas="item.datas"
:readonly="true"></plant>
<store v-if="item.id==8" ref="demandRef8" :update_time="item.update_time" :datas="item.datas"
:readonly="true"></store>
<deepProcessing v-if="item.id==9" ref="demandRef9" :datas="item.datas" :readonly="true">
</deepProcessing>
<thickProcessing v-if="item.id==10" ref="demandRef10" :datas="item.datas" :readonly="true">
@ -279,6 +451,68 @@
}
}
.cards {
margin: 30rpx auto;
margin-bottom: 28rpx;
width: 694rpx;
background: #FFFFFF;
border-radius: 30rpx;
opacity: 1;
overflow: hidden;
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
.card_head {
padding: 28rpx;
background-color: $theme-oa-color;
color: white;
height: 100rpx;
}
.card_content {
padding: 28rpx;
display: flex;
// justify-content: space-between;
.right {
display: flex;
flex-direction: column;
justify-content: space-between;
view {
margin-bottom: 10rpx;
text:nth-child(2) {
margin-left: 20rpx;
}
}
.check_view {
display: flex;
line-height: 70rpx;
// align-items: center;
}
}
.hr {
border-top: 1px dashed $theme-oa-color;
// display: block;
width: 85vw;
margin: 30rpx 0
}
}
}
.update_time {
padding: 32rpx 28rpx 0 28rpx;
display: flex;

View File

@ -216,10 +216,11 @@
.left {
text-align: center;
padding: 15rpx 25rpx;
padding-top: 20rpx;
margin-right: 50rpx;
width: 160rpx;
// padding: 15rpx 25rpx;
// padding-top: 20rpx;
padding: 20rpx 20rpx 10px 0;
margin-right: 20rpx;
width: 170rpx;
background-color: $theme-oa-color;
color: white;
border-radius: 40rpx;
@ -227,18 +228,13 @@
.cir {
width: 120rpx;
height: 120rpx;
background-color: #FFFFFF;
// margin-left: 25rpx;
padding: 0 25rpx;
background-color: #ffffff;
margin-left: 25rpx;
border-radius: 120rpx;
position: relative;
}
}
.right {
display: flex;
flex-direction: column;

View File

@ -9,7 +9,9 @@
<company></company>
</view>
<view class="company_list" v-show="current==1">
<view class="info_card" v-for="item in companyList" :key="item.id">
<!-- <view class="info_card" v-for="item in companyList" :key="item.id">
<view class="top" @click="navTo('/subpkg/companySign/companySign?id='+item.id)">
<view>
<view class="info_name" :class="item.is_contract?'have':'no'">{{item.company_name}}</view>
@ -33,10 +35,55 @@
<view class="left_text">区县乡镇</view>
<view>{{item.city_name+'/'+item.area_name+'/'+item.street_name}}</view>
</view>
<!-- <view>片区经理</view> -->
</view>
</view>
</view>
-->
<view class="cards" v-for="item in companyList" :key="item.id">
<view class="cards_head">
<text style="font-size: 32rpx;width:70vw">{{item.company_name}}</text>
<text @click="navTo('/subpkg/companySign/companySign?id='+item.id)">详情 <uni-icons type="forward"
style="margin-left: 10rpx;" color="white"></uni-icons></text>
</view>
<view class="cards_content">
<view class="right">
<view class="is_contract">
<view>
<text>法人姓名 :</text>
<text>{{item.master_name}}</text>
</view>
<view>
<text style="color: green;" v-if="item.is_contract">已签约</text>
<text style="color: red;" v-else>未签约</text>
</view>
</view>
<view class="">
<text>担任职务 :</text>
<text>{{item.master_position}}</text>
</view>
<view class="" @click="copyPhone(item.master_phone)">
<text>联系电话 :</text>
<text>{{item.master_phone}}</text>
</view>
<view class="">
<text>负责区域 :</text>
<text> {{item.city_name+item.area_name+item.street_name}}</text>
</view>
</view>
</view>
</view>
<u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
<mybtn text="新建签约" @click="navTo('/subpkg/companyUnsign/companyUnsign')"></mybtn>
@ -164,6 +211,81 @@
<style lang="scss">
page {}
.cards {
margin: 28rpx 0;
width: 694rpx;
background: #ffffff;
border-radius: 30rpx;
overflow: hidden;
.cards_head {
padding: 28rpx;
background-color: $theme-oa-color;
color: white;
display: flex;
justify-content: space-between;
}
.cards_content {
padding: 28rpx;
display: flex;
justify-content: space-between;
.left {
text-align: center;
// padding: 15rpx 25rpx;
padding-top: 20rpx;
width: 160rpx;
background-color: $theme-oa-color;
color: white;
border-radius: 40rpx;
.cir {
width: 120rpx;
height: 120rpx;
background-color: #ffffff;
margin-left: 25rpx;
border-radius: 120rpx;
position: relative;
}
}
.right {
display: flex;
flex-direction: column;
justify-content: space-between;
.is_contract {
width: 85vw;
display: flex;
justify-content: space-between;
height: 40rpx;
}
view {
margin-bottom: 10rpx;
text:nth-child(2) {
margin-left: 20rpx;
}
}
}
}
.u_avatar {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
.fixed_box {
width: 100%;
position: fixed;

View File

@ -245,7 +245,7 @@
padding-top: 20rpx;
margin-right: 50rpx;
width: 160rpx;
// width: 180rpx;
background-color: $theme-oa-color;
color: white;
border-radius: 40rpx;