更新了信息更新

This commit is contained in:
weipengfei 2023-09-06 15:55:17 +08:00
parent cf73e016e3
commit 229fa86c07
16 changed files with 3065 additions and 2783 deletions

View File

@ -1,163 +1,176 @@
<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 v-model="formData.cultivated_area" placeholder="请输入门面面积"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="地点" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="人数" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="请包办" required prop="notes" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:2,label:'酒店'},{value:1,label:'一条龙'},{value:0,label:'只请厨师'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无歌舞表演" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无交通工具" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无住宿" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
</u--form>
</view>
</template>
<script>
export default {
data() {
return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: {
shop_front: '', //
},
rules: {
}
}
},
created() {
this.initRules()
},
methods: {
//
initRules() {
let arr = Object.keys(this.formData);
arr.forEach(key => {
this.rules[key] = {
validator: (rule, value, callback) => {
this.$refs.breedingForm.clearValidate(rule.field);
value.trim() !== '' ? callback() : callback('不能为空');
},
trigger: ['change', 'blur']
}
})
},
//
async validate() {
return await this.$refs.breedingForm.validate();;
},
//
changeLanPlan(e) {
let index = e.currentTarget.dataset.index;
this.formData.planning = e.detail.value;
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
},
//
pushBreedingList() {
this.formData.push({})
},
//
removeBreedingList(index) {
uni.showModal({
confirmColor: '#f56c6c',
content: '确定删除吗?',
success: (res) => {
if (res.confirm) {
this.formData.splice(index, 1);
}
}
})
},
},
}
</script>
<style lang="scss">
.card{
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
border-radius: 14rpx;
}
.title {
font-weight: 500;
font-size: 34rpx;
&::before {
width: 8rpx;
height: 26rpx;
border-radius: 4rpx;
background-color: #0122c7;
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;
}
<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 v-model="formData.cultivated_area" placeholder="请输入门面面积"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="地点" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="人数" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="请包办" required prop="notes" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:2,label:'酒店'},{value:1,label:'一条龙'},{value:0,label:'只请厨师'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无歌舞表演" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无交通工具" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无住宿" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
</u--form>
</view>
</template>
<script>
export default {
data() {
return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: {
shop_front: '', //
},
rules: {
}
}
},
created() {
this.initRules()
},
methods: {
//
initRules() {
let arr = Object.keys(this.formData);
arr.forEach(key => {
this.rules[key] = {
validator: (rule, value, callback) => {
this.$refs.breedingForm.clearValidate(rule.field);
value.trim() !== '' ? callback() : callback('不能为空');
},
trigger: ['change', 'blur']
}
})
},
//
async validate() {
return await this.$refs.breedingForm.validate();;
},
//
changeLanPlan(e) {
let index = e.currentTarget.dataset.index;
this.formData.planning = e.detail.value;
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
},
//
pushBreedingList() {
this.formData.push({})
},
//
removeBreedingList(index) {
uni.showModal({
confirmColor: '#f56c6c',
content: '确定删除吗?',
success: (res) => {
if (res.confirm) {
this.formData.splice(index, 1);
}
}
})
},
},
}
</script>
<style lang="scss">
.card {
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
margin-top: 0;
padding-top: 0;
border-radius: 0 0 14rpx 14rpx;
}
.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;
}
.title {
font-weight: 500;
font-size: 34rpx;
&::before {
width: 8rpx;
height: 26rpx;
border-radius: 4rpx;
background-color: #0122c7;
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,163 +1,176 @@
<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 v-model="formData.cultivated_area" placeholder="请输入门面面积"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="地点" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="人数" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="请包办" required prop="notes" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:2,label:'酒店'},{value:1,label:'一条龙'},{value:0,label:'只请厨师'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无歌舞表演" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无交通工具" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无住宿" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
</u--form>
</view>
</template>
<script>
export default {
data() {
return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: {
shop_front: '', //
},
rules: {
}
}
},
created() {
this.initRules()
},
methods: {
//
initRules() {
let arr = Object.keys(this.formData);
arr.forEach(key => {
this.rules[key] = {
validator: (rule, value, callback) => {
this.$refs.breedingForm.clearValidate(rule.field);
value.trim() !== '' ? callback() : callback('不能为空');
},
trigger: ['change', 'blur']
}
})
},
//
async validate() {
return await this.$refs.breedingForm.validate();;
},
//
changeLanPlan(e) {
let index = e.currentTarget.dataset.index;
this.formData.planning = e.detail.value;
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
},
//
pushBreedingList() {
this.formData.push({})
},
//
removeBreedingList(index) {
uni.showModal({
confirmColor: '#f56c6c',
content: '确定删除吗?',
success: (res) => {
if (res.confirm) {
this.formData.splice(index, 1);
}
}
})
},
},
}
</script>
<style lang="scss">
.card{
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
border-radius: 14rpx;
}
.title {
font-weight: 500;
font-size: 34rpx;
&::before {
width: 8rpx;
height: 26rpx;
border-radius: 4rpx;
background-color: #0122c7;
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;
}
<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 v-model="formData.cultivated_area" placeholder="请输入门面面积"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="地点" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="人数" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="请包办" required prop="notes" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:2,label:'酒店'},{value:1,label:'一条龙'},{value:0,label:'只请厨师'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无歌舞表演" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无交通工具" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无住宿" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
</u--form>
</view>
</template>
<script>
export default {
data() {
return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: {
shop_front: '', //
},
rules: {
}
}
},
created() {
this.initRules()
},
methods: {
//
initRules() {
let arr = Object.keys(this.formData);
arr.forEach(key => {
this.rules[key] = {
validator: (rule, value, callback) => {
this.$refs.breedingForm.clearValidate(rule.field);
value.trim() !== '' ? callback() : callback('不能为空');
},
trigger: ['change', 'blur']
}
})
},
//
async validate() {
return await this.$refs.breedingForm.validate();;
},
//
changeLanPlan(e) {
let index = e.currentTarget.dataset.index;
this.formData.planning = e.detail.value;
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
},
//
pushBreedingList() {
this.formData.push({})
},
//
removeBreedingList(index) {
uni.showModal({
confirmColor: '#f56c6c',
content: '确定删除吗?',
success: (res) => {
if (res.confirm) {
this.formData.splice(index, 1);
}
}
})
},
},
}
</script>
<style lang="scss">
.card {
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
margin-top: 0;
padding-top: 0;
border-radius: 0 0 14rpx 14rpx;
}
.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;
}
.title {
font-weight: 500;
font-size: 34rpx;
&::before {
width: 8rpx;
height: 26rpx;
border-radius: 4rpx;
background-color: #0122c7;
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,176 +1,189 @@
<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 v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="人数" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="请包办" required prop="notes" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:2,label:'酒店'},{value:1,label:'一条龙'},{value:0,label:'只请厨师'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无歌舞表演" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无主持仪式" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无交通工具" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无住宿" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无墓地" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
</u--form>
</view>
</template>
<script>
export default {
data() {
return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: {
shop_front: '', //
},
rules: {
}
}
},
created() {
this.initRules()
},
methods: {
//
initRules() {
let arr = Object.keys(this.formData);
arr.forEach(key => {
this.rules[key] = {
validator: (rule, value, callback) => {
this.$refs.breedingForm.clearValidate(rule.field);
value.trim() !== '' ? callback() : callback('不能为空');
},
trigger: ['change', 'blur']
}
})
},
//
async validate() {
return await this.$refs.breedingForm.validate();;
},
//
changeLanPlan(e) {
let index = e.currentTarget.dataset.index;
this.formData.planning = e.detail.value;
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
},
//
pushBreedingList() {
this.formData.push({})
},
//
removeBreedingList(index) {
uni.showModal({
confirmColor: '#f56c6c',
content: '确定删除吗?',
success: (res) => {
if (res.confirm) {
this.formData.splice(index, 1);
}
}
})
},
},
}
</script>
<style lang="scss">
.card{
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
border-radius: 14rpx;
}
.title {
font-weight: 500;
font-size: 34rpx;
&::before {
width: 8rpx;
height: 26rpx;
border-radius: 4rpx;
background-color: #0122c7;
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;
}
<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 v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="人数" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="请包办" required prop="notes" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:2,label:'酒店'},{value:1,label:'一条龙'},{value:0,label:'只请厨师'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无歌舞表演" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无主持仪式" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无交通工具" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无住宿" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无墓地" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
</u--form>
</view>
</template>
<script>
export default {
data() {
return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: {
shop_front: '', //
},
rules: {
}
}
},
created() {
this.initRules()
},
methods: {
//
initRules() {
let arr = Object.keys(this.formData);
arr.forEach(key => {
this.rules[key] = {
validator: (rule, value, callback) => {
this.$refs.breedingForm.clearValidate(rule.field);
value.trim() !== '' ? callback() : callback('不能为空');
},
trigger: ['change', 'blur']
}
})
},
//
async validate() {
return await this.$refs.breedingForm.validate();;
},
//
changeLanPlan(e) {
let index = e.currentTarget.dataset.index;
this.formData.planning = e.detail.value;
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
},
//
pushBreedingList() {
this.formData.push({})
},
//
removeBreedingList(index) {
uni.showModal({
confirmColor: '#f56c6c',
content: '确定删除吗?',
success: (res) => {
if (res.confirm) {
this.formData.splice(index, 1);
}
}
})
},
},
}
</script>
<style lang="scss">
.card {
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
margin-top: 0;
padding-top: 0;
border-radius: 0 0 14rpx 14rpx;
}
.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;
}
.title {
font-weight: 500;
font-size: 34rpx;
&::before {
width: 8rpx;
height: 26rpx;
border-radius: 4rpx;
background-color: #0122c7;
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,171 +1,184 @@
<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 v-model="formData.cultivated_area" placeholder="请输入门面面积"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="地点" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="人数" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="请包办" required prop="notes" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:2,label:'酒店'},{value:1,label:'一条龙'},{value:0,label:'只请厨师'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无歌舞表演" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无主持仪式" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无交通工具" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无住宿" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
</u--form>
</view>
</template>
<script>
export default {
data() {
return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: {
shop_front: '', //
},
rules: {
}
}
},
created() {
this.initRules()
},
methods: {
//
initRules() {
let arr = Object.keys(this.formData);
arr.forEach(key => {
this.rules[key] = {
validator: (rule, value, callback) => {
this.$refs.breedingForm.clearValidate(rule.field);
value.trim() !== '' ? callback() : callback('不能为空');
},
trigger: ['change', 'blur']
}
})
},
//
async validate() {
return await this.$refs.breedingForm.validate();;
},
//
changeLanPlan(e) {
let index = e.currentTarget.dataset.index;
this.formData.planning = e.detail.value;
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
},
//
pushBreedingList() {
this.formData.push({})
},
//
removeBreedingList(index) {
uni.showModal({
confirmColor: '#f56c6c',
content: '确定删除吗?',
success: (res) => {
if (res.confirm) {
this.formData.splice(index, 1);
}
}
})
},
},
}
</script>
<style lang="scss">
.card{
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
border-radius: 14rpx;
}
.title {
font-weight: 500;
font-size: 34rpx;
&::before {
width: 8rpx;
height: 26rpx;
border-radius: 4rpx;
background-color: #0122c7;
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;
}
<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 v-model="formData.cultivated_area" placeholder="请输入门面面积"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="地点" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="人数" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="请包办" required prop="notes" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:2,label:'酒店'},{value:1,label:'一条龙'},{value:0,label:'只请厨师'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无歌舞表演" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无主持仪式" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无交通工具" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无住宿" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
</u--form>
</view>
</template>
<script>
export default {
data() {
return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: {
shop_front: '', //
},
rules: {
}
}
},
created() {
this.initRules()
},
methods: {
//
initRules() {
let arr = Object.keys(this.formData);
arr.forEach(key => {
this.rules[key] = {
validator: (rule, value, callback) => {
this.$refs.breedingForm.clearValidate(rule.field);
value.trim() !== '' ? callback() : callback('不能为空');
},
trigger: ['change', 'blur']
}
})
},
//
async validate() {
return await this.$refs.breedingForm.validate();;
},
//
changeLanPlan(e) {
let index = e.currentTarget.dataset.index;
this.formData.planning = e.detail.value;
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
},
//
pushBreedingList() {
this.formData.push({})
},
//
removeBreedingList(index) {
uni.showModal({
confirmColor: '#f56c6c',
content: '确定删除吗?',
success: (res) => {
if (res.confirm) {
this.formData.splice(index, 1);
}
}
})
},
},
}
</script>
<style lang="scss">
.card {
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
margin-top: 0;
padding-top: 0;
border-radius: 0 0 14rpx 14rpx;
}
.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;
}
.title {
font-weight: 500;
font-size: 34rpx;
&::before {
width: 8rpx;
height: 26rpx;
border-radius: 4rpx;
background-color: #0122c7;
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

@ -117,11 +117,24 @@
</script>
<style lang="scss">
.card{
.card {
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
border-radius: 14rpx;
margin-top: 0;
padding-top: 0;
border-radius: 0 0 14rpx 14rpx;
}
.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;
}
.title {
font-weight: 500;

View File

@ -1,333 +1,323 @@
<template>
<view class="content">
<view class="tit">
<text v-if="readonly">更新时间: {{update_time}}</text>
<text>养殖信息</text>
<view class="content">
<view class="tit">
<text v-if="readonly">更新时间: {{update_time}}</text>
<text>养殖信息</text>
</view>
<view class="card">
</view>
<view class="card">
<!-- <view class="title">养殖信息</view> -->
<!-- <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="请输入产量(斤)" type="number"></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="请输入预计收益(元)" type="number"></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="请输入现代化程度(%)" type="number" maxlength="3"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="预售卖价格(元/500g)" 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>
<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="请输入产量(斤)" type="number"></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="请输入预计收益(元)"
type="number"></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="请输入现代化程度(%)" type="number"
maxlength="3"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="预售卖价格(元/500g)" 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>
</view>
</template>
<script>
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: {
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]!=null&&this.formData[item]!=undefined){
parseFloat(this.formData[item])!='NaN'?this.formData[item] = parseFloat(this.formData[item]):null;
}
})
}
},
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]!=null&&this.formData[item]!=undefined){
parseFloat(this.formData[item])!='NaN'?this.formData[item] = parseFloat(this.formData[item]):null;
}
})
}
}
},
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] != null && this
.formData[item] != undefined) {
parseFloat(this.formData[item]) != 'NaN' ? this.formData[item] = parseFloat(this.formData[item]) : null;
}
})
}
},
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] != null && this
.formData[item] != undefined) {
parseFloat(this.formData[item]) != 'NaN' ? this.formData[item] = parseFloat(this.formData[item]) :
null;
}
})
}
}
},
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;
margin-top: 0;
padding-top: 0;
border-radius: 0 0 14rpx 14rpx;
}
.card {
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
margin-top: 0;
padding-top: 0;
border-radius: 0 0 14rpx 14rpx;
}
.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;
.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;
}
}
.title {
font-weight: 500;
font-size: 34rpx;
.title {
font-weight: 500;
font-size: 34rpx;
&::before {
width: 8rpx;
height: 26rpx;
border-radius: 4rpx;
background-color: #0122c7;
content: "";
display: inline-block;
margin-right: 8rpx;
}
}
&::before {
width: 8rpx;
height: 26rpx;
border-radius: 4rpx;
background-color: #0122c7;
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;
}
.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;
}
.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,285 +1,298 @@
<!-- 深加工 -->
<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 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>
<block v-if="formData.shop_front">
<u-form-item labelWidth="auto" label="有无建设用地" required prop="shop_front" borderBottom>
<u-radio-group v-model="formData.shop_front" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="面积" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入面积"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="经营地点" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="材料来源" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无销售渠道" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无技术指导" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无品牌" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无宣传推广" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无运输" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="经营诉求" required prop="farm_tools" borderBottom>
<u--textarea v-model="formData.farm_tools" autoHeight placeholder="请输入经营诉求" border="surround"
count></u--textarea>
</u-form-item>
</block>
<block v-else>
<u-form-item labelWidth="auto" label="有无建设用地" required prop="shop_front" borderBottom>
<u-radio-group v-model="formData.shop_front" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<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
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="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="人数" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无食堂" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="材料来源" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="自动化办公程度" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无用工需求" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无品牌" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无宣传推广" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="库存情况" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无运输" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="经营诉求" required prop="farm_tools" borderBottom>
<u--textarea v-model="formData.farm_tools" autoHeight placeholder="请输入经营诉求" border="surround"
count></u--textarea>
</u-form-item>
</block>
</u--form>
</view>
</template>
<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: {
}
}
},
created() {
this.initRules()
},
methods: {
//
initRules() {
let arr = Object.keys(this.formData);
arr.forEach(key => {
this.rules[key] = {
validator: (rule, value, callback) => {
this.$refs.breedingForm.clearValidate(rule.field);
value.trim() !== '' ? callback() : callback('不能为空');
},
trigger: ['change', 'blur']
}
})
},
//
async validate() {
return await this.$refs.breedingForm.validate();;
},
//
changeLanPlan(e) {
let index = e.currentTarget.dataset.index;
this.formData.planning = e.detail.value;
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
},
//
pushBreedingList() {
this.formData.push({})
},
//
removeBreedingList(index) {
uni.showModal({
confirmColor: '#f56c6c',
content: '确定删除吗?',
success: (res) => {
if (res.confirm) {
this.formData.splice(index, 1);
}
}
})
},
},
}
</script>
<style lang="scss">
.card{
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
border-radius: 14rpx;
}
.title {
font-weight: 500;
font-size: 34rpx;
&::before {
width: 8rpx;
height: 26rpx;
border-radius: 4rpx;
background-color: #0122c7;
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;
}
<!-- 深加工 -->
<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 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>
<block v-if="formData.shop_front">
<u-form-item labelWidth="auto" label="有无建设用地" required prop="shop_front" borderBottom>
<u-radio-group v-model="formData.shop_front" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="面积" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入面积"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="经营地点" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="材料来源" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无销售渠道" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无技术指导" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无品牌" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无宣传推广" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无运输" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="经营诉求" required prop="farm_tools" borderBottom>
<u--textarea v-model="formData.farm_tools" autoHeight placeholder="请输入经营诉求" border="surround"
count></u--textarea>
</u-form-item>
</block>
<block v-else>
<u-form-item labelWidth="auto" label="有无建设用地" required prop="shop_front" borderBottom>
<u-radio-group v-model="formData.shop_front" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<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
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="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="人数" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无食堂" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="材料来源" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="自动化办公程度" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无用工需求" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无品牌" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无宣传推广" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="库存情况" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无运输" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="经营诉求" required prop="farm_tools" borderBottom>
<u--textarea v-model="formData.farm_tools" autoHeight placeholder="请输入经营诉求" border="surround"
count></u--textarea>
</u-form-item>
</block>
</u--form>
</view>
</template>
<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: {
}
}
},
created() {
this.initRules()
},
methods: {
//
initRules() {
let arr = Object.keys(this.formData);
arr.forEach(key => {
this.rules[key] = {
validator: (rule, value, callback) => {
this.$refs.breedingForm.clearValidate(rule.field);
value.trim() !== '' ? callback() : callback('不能为空');
},
trigger: ['change', 'blur']
}
})
},
//
async validate() {
return await this.$refs.breedingForm.validate();;
},
//
changeLanPlan(e) {
let index = e.currentTarget.dataset.index;
this.formData.planning = e.detail.value;
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
},
//
pushBreedingList() {
this.formData.push({})
},
//
removeBreedingList(index) {
uni.showModal({
confirmColor: '#f56c6c',
content: '确定删除吗?',
success: (res) => {
if (res.confirm) {
this.formData.splice(index, 1);
}
}
})
},
},
}
</script>
<style lang="scss">
.card {
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
margin-top: 0;
padding-top: 0;
border-radius: 0 0 14rpx 14rpx;
}
.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;
}
.title {
font-weight: 500;
font-size: 34rpx;
&::before {
width: 8rpx;
height: 26rpx;
border-radius: 4rpx;
background-color: #0122c7;
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,143 +1,177 @@
<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 v-model="formData.cultivated_area" placeholder="请输入门面面积"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="装修风格" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="装修地点" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="装修预算" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入服务对象"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="装修类型" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'私人'},{value:0,label:'公共建设'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
</u-form-item>
</u--form>
</view>
</template>
<script>
export default {
data() {
return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: {
shop_front: '', //
},
rules: {
}
}
},
created() {
this.initRules()
},
methods: {
//
initRules() {
let arr = Object.keys(this.formData);
arr.forEach(key => {
this.rules[key] = {
validator: (rule, value, callback) => {
this.$refs.breedingForm.clearValidate(rule.field);
value.trim() !== '' ? callback() : callback('不能为空');
},
trigger: ['change', 'blur']
}
})
},
//
async validate() {
return await this.$refs.breedingForm.validate();;
},
//
changeLanPlan(e) {
let index = e.currentTarget.dataset.index;
this.formData.planning = e.detail.value;
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
},
//
pushBreedingList() {
this.formData.push({})
},
//
removeBreedingList(index) {
uni.showModal({
confirmColor: '#f56c6c',
content: '确定删除吗?',
success: (res) => {
if (res.confirm) {
this.formData.splice(index, 1);
}
}
})
},
},
}
</script>
<style lang="scss">
.card{
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
border-radius: 14rpx;
}
.title {
font-weight: 500;
font-size: 34rpx;
&::before {
width: 8rpx;
height: 26rpx;
border-radius: 4rpx;
background-color: #0122c7;
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;
}
<template>
<view>
<view class="tit">
<text v-if="readonly">更新时间: {{update_time}}</text>
<text>装房</text>
</view>
<view class="card">
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
<u-form-item labelWidth="auto" label="房屋面积(m²)" required prop="house_area" borderBottom>
<u--input :readonly="readonly" type="number" v-model="formData.house_area" placeholder="请输入房屋面积(m²)"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="装修风格" required prop="decoration_style" borderBottom>
<u--input :readonly="readonly" v-model="formData.decoration_style" placeholder="请输入装修风格"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="装修地点" required prop="decoration_site" borderBottom>
<u--input :readonly="readonly" v-model="formData.decoration_site" placeholder="请输入装修地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="装修预算" required prop="budget" borderBottom>
<u--input :readonly="readonly" v-model="formData.budget" placeholder="请输入装修预算"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="装修类型" required prop="decoration_type" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.decoration_type" 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>
</u--form>
</view>
</view>
</template>
<script>
export default {
props: {
readonly: {
type: Boolean,
default: false
},
datas: {
type: Object,
default: null
},
update_time: {
type: String,
default: null
}
},
data() {
return {
formData: {
house_area: '',
decoration_style: '',
decoration_site: '',
budget: '',
decoration_type: ''
},
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] != null && this
.formData[item] != undefined) {
parseFloat(this.formData[item]) != 'NaN' ? this.formData[item] = parseFloat(this.formData[item]) : null;
}
})
}
},
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] != null && this
.formData[item] != undefined) {
parseFloat(this.formData[item]) != 'NaN' ? this.formData[item] = parseFloat(this.formData[item]) :
null;
}
})
}
}
},
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();;
},
},
}
</script>
<style lang="scss">
.card {
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
margin-top: 0;
padding-top: 0;
border-radius: 0 0 14rpx 14rpx;
}
.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;
}
.title {
font-weight: 500;
font-size: 34rpx;
&::before {
width: 8rpx;
height: 26rpx;
border-radius: 4rpx;
background-color: #0122c7;
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,133 +1,164 @@
<template>
<view class="card">
<view class="title">翻新</view>
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
<u-form-item labelWidth="auto" labelPosition="top" label="维护内容" required prop="policy_subsidies" borderBottom>
<u--textarea v-model="formData.policy_subsidies" autoHeight placeholder="请输入维护内容" border="surround"
count></u--textarea>
</u-form-item>
<u-form-item labelWidth="auto" label="维护类型" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'换'},{value:0,label:'修'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
</u--form>
</view>
</template>
<script>
export default {
data() {
return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: {
shop_front: '', //
},
rules: {
}
}
},
created() {
this.initRules()
},
methods: {
//
initRules() {
let arr = Object.keys(this.formData);
arr.forEach(key => {
this.rules[key] = {
validator: (rule, value, callback) => {
this.$refs.breedingForm.clearValidate(rule.field);
value.trim() !== '' ? callback() : callback('不能为空');
},
trigger: ['change', 'blur']
}
})
},
//
async validate() {
return await this.$refs.breedingForm.validate();;
},
//
changeLanPlan(e) {
let index = e.currentTarget.dataset.index;
this.formData.planning = e.detail.value;
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
},
//
pushBreedingList() {
this.formData.push({})
},
//
removeBreedingList(index) {
uni.showModal({
confirmColor: '#f56c6c',
content: '确定删除吗?',
success: (res) => {
if (res.confirm) {
this.formData.splice(index, 1);
}
}
})
},
},
}
</script>
<style lang="scss">
.card{
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
border-radius: 14rpx;
}
.title {
font-weight: 500;
font-size: 34rpx;
&::before {
width: 8rpx;
height: 26rpx;
border-radius: 4rpx;
background-color: #0122c7;
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;
}
<template>
<view>
<view class="tit">
<text v-if="readonly">更新时间: {{update_time}}</text>
<text>翻新房屋</text>
</view>
<view class="card">
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
<u-form-item labelWidth="auto" labelPosition="top" label="维护内容" required prop="maintenance_contents" borderBottom>
<u--textarea :readonly="readonly" v-model="formData.maintenance_contents" autoHeight placeholder="请输入维护内容" border="surround"
count></u--textarea>
</u-form-item>
<u-form-item labelWidth="auto" label="维护类型" required prop="maintenance_type" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.maintenance_type" 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>
</view>
</view>
</template>
<script>
export default {
props: {
readonly: {
type: Boolean,
default: false
},
datas: {
type: Object,
default: null
},
update_time: {
type: String,
default: null
}
},
data() {
return {
formData: {
maintenance_contents: '',
maintenance_type: ''
},
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] != null && this
.formData[item] != undefined) {
parseFloat(this.formData[item]) != 'NaN' ? this.formData[item] = parseFloat(this.formData[item]) : null;
}
})
}
},
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] != null && this
.formData[item] != undefined) {
parseFloat(this.formData[item]) != 'NaN' ? this.formData[item] = parseFloat(this.formData[item]) :
null;
}
})
}
}
},
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();;
},
},
}
</script>
<style lang="scss">
.card {
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
margin-top: 0;
padding-top: 0;
border-radius: 0 0 14rpx 14rpx;
}
.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;
}
.title {
font-weight: 500;
font-size: 34rpx;
&::before {
width: 8rpx;
height: 26rpx;
border-radius: 4rpx;
background-color: #0122c7;
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,66 +1,103 @@
<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 v-model="formData.shop_front" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'自建'},{value:0,label:'外包'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="建设面积" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面面积"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="房屋风格" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="修建地址" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="预算" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入服务对象"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无绿化" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无装修" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="房屋类型" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'私人'},{value:0,label:'公共建设'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="修建地照片" required prop="planting_company" borderBottom>
</u-form-item>
</u--form>
<view>
<view class="tit">
<text v-if="readonly">更新时间: {{update_time}}</text>
<text>修房</text>
</view>
<view class="card">
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
<u-form-item labelWidth="auto" label="修房类型" required prop="construction_type" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.construction_type" 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="建设面积(m²)" required prop="construction_area" borderBottom>
<u--input :readonly="readonly" type="number" v-model="formData.construction_area" placeholder="请输入建设面积(m²)"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="房屋风格" required prop="house_style" borderBottom>
<u--input :readonly="readonly" v-model="formData.house_style" placeholder="请输入房屋风格"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="修建地址" required prop="construction_site" borderBottom>
<u--input :readonly="readonly" v-model="formData.construction_site" placeholder="请输入修建地址"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="预算" required prop="budget" borderBottom>
<u--input :readonly="readonly" v-model="formData.budget" placeholder="请输入预算"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无绿化" required prop="afforest" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.afforest" 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="fitment" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.fitment" 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="house_type" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.house_type" 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="construction_site_img" borderBottom>
<u-upload :fileList="formData.construction_site_img?[{url:formData.construction_site_img}]:[]"
@afterRead="afterReadAvatar" @delete="formData.construction_site_img=''" :deletable="!readonly" :maxCount="1" width="250rpx" height="180rpx">
<view class="uplode">
<u-icon name="plus-circle-fill" color="#0022C7" size="28"></u-icon>
上传照片
<view class="up" style="opacity: 0;">
</view>
</view>
</u-upload>
</u-form-item>
</u--form>
</view>
</view>
</template>
<script>
import {
upLoadImage
} from "@/api/file.js"
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: '', //
construction_type: '',
construction_area: '',
house_style: '',
construction_site: '',
budget: '',
afforest: '',
fitment: '',
house_type: '',
construction_site_img: ''
},
rules: {
@ -68,7 +105,32 @@
}
},
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] != null && this
.formData[item] != undefined) {
parseFloat(this.formData[item]) != 'NaN' ? this.formData[item] = parseFloat(this.formData[item]) : null;
}
})
}
},
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] != null && this
.formData[item] != undefined) {
parseFloat(this.formData[item]) != 'NaN' ? this.formData[item] = parseFloat(this.formData[item]) :
null;
}
})
}
}
},
methods: {
//
@ -88,42 +150,38 @@
async validate() {
return await this.$refs.breedingForm.validate();;
},
//
changeLanPlan(e) {
let index = e.currentTarget.dataset.index;
this.formData.planning = e.detail.value;
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
},
//
pushBreedingList() {
this.formData.push({})
},
//
removeBreedingList(index) {
uni.showModal({
confirmColor: '#f56c6c',
content: '确定删除吗?',
success: (res) => {
if (res.confirm) {
this.formData.splice(index, 1);
}
}
})
},
//
afterReadAvatar(event) {
upLoadImage({
filePath: event.file.url,
name: 'file'
}).then(res => {
this.formData.construction_site_img = res.data.uri
})
},
},
}
</script>
<style lang="scss">
.card{
.card {
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
border-radius: 14rpx;
margin-top: 0;
padding-top: 0;
border-radius: 0 0 14rpx 14rpx;
}
.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;
}
.title {
font-weight: 500;
@ -165,4 +223,24 @@
color: #fff;
text-align: center;
}
.uplode {
width: 250rpx;
height: 180rpx;
box-sizing: border-box;
padding-top: 30rpx;
border-radius: 15rpx;
border: 1px solid $theme-oa-color;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
color: $theme-oa-color;
position: relative;
.up {
position: absolute;
color: transparent;
}
}
</style>

View File

@ -1,57 +1,84 @@
<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 v-model="formData.cultivated_area" placeholder="请输入门面面积"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="房型" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="几房" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="面积" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入服务对象"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="朝向" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入服务对象"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="楼层" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入服务对象"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="装修类型" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'精装'},{value:0,label:'清水'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="预算" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入服务对象"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="付款类型" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'按揭'},{value:0,label:'全款'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
</u-form-item>
</u--form>
<view>
<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="place" borderBottom>
<u--input :readonly="readonly" v-model="formData.place" placeholder="请输入房屋地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="房型" required prop="house_type" borderBottom>
<u--input :readonly="readonly" v-model="formData.house_type" placeholder="请输入房型"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="几房" required prop="rooms" borderBottom>
<u--input :readonly="readonly" v-model="formData.rooms" placeholder="请输入几房"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="面积(m²)" required prop="house_area" borderBottom>
<u--input :readonly="readonly" v-model="formData.house_area" type="number" placeholder="请输入房屋面积(m²)"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="朝向" required prop="orientation" borderBottom>
<u--input :readonly="readonly" v-model="formData.orientation" placeholder="请输入房屋朝向"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="楼层" required prop="floor" borderBottom>
<u--input :readonly="readonly" v-model="formData.floor" type="number" placeholder="请输入楼层"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="装修类型" required prop="fitment" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.fitment" 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="budget" borderBottom>
<u--input :readonly="readonly" v-model="formData.budget" placeholder="请输入预算"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="付款类型" required prop="payment_type" borderBottom>
<u-radio-group :disabled="readonly" v-model="formData.payment_type" 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>
</u--form>
</view>
</view>
</template>
<script>
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: '', //
place: "",
house_type: "",
rooms: "",
house_area: "",
orientation:"",
floor: "",
fitment: "",
budget: "",
payment_type: ""
},
rules: {
@ -59,7 +86,32 @@
}
},
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] != null && this
.formData[item] != undefined) {
parseFloat(this.formData[item]) != 'NaN' ? this.formData[item] = parseFloat(this.formData[item]) : null;
}
})
}
},
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] != null && this
.formData[item] != undefined) {
parseFloat(this.formData[item]) != 'NaN' ? this.formData[item] = parseFloat(this.formData[item]) :
null;
}
})
}
}
},
methods: {
//
@ -79,42 +131,29 @@
async validate() {
return await this.$refs.breedingForm.validate();;
},
//
changeLanPlan(e) {
let index = e.currentTarget.dataset.index;
this.formData.planning = e.detail.value;
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
},
//
pushBreedingList() {
this.formData.push({})
},
//
removeBreedingList(index) {
uni.showModal({
confirmColor: '#f56c6c',
content: '确定删除吗?',
success: (res) => {
if (res.confirm) {
this.formData.splice(index, 1);
}
}
})
},
},
}
</script>
<style lang="scss">
.card{
.card {
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
border-radius: 14rpx;
margin-top: 0;
padding-top: 0;
border-radius: 0 0 14rpx 14rpx;
}
.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;
}
.title {
font-weight: 500;

View File

@ -1,318 +1,331 @@
<!-- 常住人口 -->
<template>
<view class="card">
<view class="title">常住人口</view>
<u--form labelPosition="left" :model="residents" :rules="rules" ref="residentsForm">
<block value="人口">
<block value="人员信息" v-for="(item, family_index) in residents.family" :key="'user'+family_index">
<u-form-item label="姓名" required prop="family.name" borderBottom>
<u--input v-model="item.name" :readonly="readonly" placeholder="请输入姓名"></u--input>
</u-form-item>
<picker mode="date" value="1990-01-01" @change="changebirth_time" :disabled="readonly" :data-index="index">
<u-form-item labelWidth="auto" label="出生日期" required prop="family.birth_time" borderBottom>
<u--input :value="item.birth_time" placeholder="请选择出生日期" readonly></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
</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="situationList[item.situation]" placeholder="请选择就业情况" readonly></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 v-if="!readonly" class="delete"
@click="removeFamily(index)">删除以上信息</button>
</block>
<button v-if="!readonly" class="plus" @click="pushFamily">添加常住人口</button>
</block>
<block value="婴幼儿信息">
<u-form-item labelWidth="auto" label="是否存在学生、婴幼儿" required prop="child" borderBottom>
<u-radio-group v-model="residents.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>
</u-form-item>
<block value="是" v-if="residents.child>0" v-for="(item,child_arr_index) in residents.child_arr" :key="'child'+child_arr_index">
<u-form-item label="年龄" required prop="child_arr.age" borderBottom>
<u--input v-model="item.age" :readonly="readonly" placeholder="请输入年龄" type="number" maxlength="2"></u--input>
</u-form-item>
<block v-if="item.age<4">
<u-form-item labelWidth="auto" label="喂养方式" borderBottom>
<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>
</u-form-item>
</block>
<block v-else>
<u-form-item label="年级" borderBottom>
<u--input v-model="item.grade" :readonly="readonly" placeholder="请输入年级"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="是否补课" borderBottom>
<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>
</u-form-item>
<u-form-item v-if="item.is_lesson>0" label-width="auto" labelPosition="top" label="补课内容" borderBottom>
<u--textarea v-model="item.lessons" :disabled="readonly" autoHeight placeholder="请输入需要的课程" border="surround"
count></u--textarea>
</u-form-item>
</block>
<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 v-if="residents.child_arr.length>1&&!readonly" class="delete"
@click="removeChildArr(index)">删除以上信息</button>
</block>
<button v-if="residents.child>0&&!readonly" class="plus" @click="pushChildArr">添加学生婴幼儿</button>
</block>
</u--form>
</view>
</template>
<script>
import { Toast } from "../../libs/uniApi"
export default {
props:{
readonly: {
type: Boolean,
default: false
},
datas: {
type: Object,
default: null
}
},
data() {
return {
situationList: [ "做工地的","厂里打工","公司职员","政府上班","种地","在家赋闲","其他"],
//
residents: {
family: [
// {
// name: '',
// birth_time: '',
// situation: '', //
// skills: '', //
// }
],
child: '', //
child_arr: [ //
{
age: '',
feeding: '', //
grade: '', //
is_lesson: '', //
lessons: '', //
notes: '' //
}
],
// family: [{
// name: '',
// birth_time: '1988-08-08',
// situation: 1, //
// skills: '', //
// }],
// child: 1, //
// child_arr: [ //
// {
// age: '3',
// feeding: 1, //
// grade: '', //
// is_lesson: 1, //
// lessons: '', //
// notes: '' //
// }
// ],
},
rules: {
family: {
validator: (rule, value, callback ) => {
if (Array.isArray(value) && value.length > 0) {
for (let i = 0; i < value.length; i++) {
const item = value[i];
for (const key in item) {
//
if (!item[key]&&item[key]!==0) {
callback(new Error('以上四项基本信息必填'));
return;
}
}
}
//
callback();
} else {
//
callback(new Error('数组不能为空'));
}
},
trigger: ['change', 'blur']
},
child: {
validator: (rule, value, callback )=>{
typeof value==='number'?callback():callback('不能为空')
},
trigger: ['change', 'blur']
},
}
}
},
watch:{
datas(newValue, oldValue){
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;
})
}
}
},
mounted() {
if(this.$props.readonly){
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: {
async validate() {
let flag = false;
if(this.residents.child) this.residents.child_arr.forEach(item=>{
if(item.age==''||item.age<0||item.age>200) flag = true;
})
if(flag){
Toast('请输入年龄');
await this.$u.sleep(500);
return Promise.reject();
}
return this.$refs.residentsForm.validate();
},
//
changebirth_time(e) {
let index = e.currentTarget.dataset.index;
this.residents.family[index].birth_time = e.detail.value;
},
//
changesituation(e) {
let index = e.currentTarget.dataset.index;
this.residents.family[index].situation = e.detail.value;
},
//
pushFamily() {
this.residents.family.push({
name: '',
birth_time: '',
situation: '', //
skills: '', //
})
},
//
removeFamily(index) {
uni.showModal({
confirmColor: '#f56c6c',
content: '确定删除吗?',
success: (res) => {
if (res.confirm) {
this.residents.family.splice(index, 1);
}
}
})
},
//
pushChildArr() {
this.residents.child_arr.push({
age: '',
feeding: '', //
grade: '', //
is_lesson: '', //
lessons: '', //
notes: '' //
})
},
//
removeChildArr(index) {
uni.showModal({
confirmColor: '#f56c6c',
content: '确定删除吗?',
success: (res) => {
if (res.confirm) {
this.residents.child_arr.splice(index, 1);
}
}
})
},
},
}
</script>
<style lang="scss">
.card{
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
border-radius: 14rpx;
}
.title {
font-weight: 500;
font-size: 34rpx;
&::before {
width: 8rpx;
height: 26rpx;
border-radius: 4rpx;
background-color: #0122c7;
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;
}
<!-- 常住人口 -->
<template>
<view class="card">
<view class="title">常住人口</view>
<u--form labelPosition="left" :model="residents" :rules="rules" ref="residentsForm">
<block value="人口">
<block value="人员信息" v-for="(item, family_index) in residents.family" :key="'user'+family_index">
<u-form-item label="姓名" required prop="family.name" borderBottom>
<u--input v-model="item.name" :readonly="readonly" placeholder="请输入姓名"></u--input>
</u-form-item>
<picker mode="date" value="1990-01-01" @change="changebirth_time" :disabled="readonly" :data-index="index">
<u-form-item labelWidth="auto" label="出生日期" required prop="family.birth_time" borderBottom>
<u--input :value="item.birth_time" placeholder="请选择出生日期" readonly></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
</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="situationList[item.situation]" placeholder="请选择就业情况" readonly></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 v-if="!readonly" class="delete"
@click="removeFamily(index)">删除以上信息</button>
</block>
<button v-if="!readonly" class="plus" @click="pushFamily">添加常住人口</button>
</block>
<block value="婴幼儿信息">
<u-form-item labelWidth="auto" label="是否存在学生、婴幼儿" required prop="child" borderBottom>
<u-radio-group v-model="residents.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>
</u-form-item>
<block value="是" v-if="residents.child>0" v-for="(item,child_arr_index) in residents.child_arr" :key="'child'+child_arr_index">
<u-form-item label="年龄" required prop="child_arr.age" borderBottom>
<u--input v-model="item.age" :readonly="readonly" placeholder="请输入年龄" type="number" maxlength="2"></u--input>
</u-form-item>
<block v-if="item.age<4">
<u-form-item labelWidth="auto" label="喂养方式" borderBottom>
<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>
</u-form-item>
</block>
<block v-else>
<u-form-item label="年级" borderBottom>
<u--input v-model="item.grade" :readonly="readonly" placeholder="请输入年级"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="是否补课" borderBottom>
<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>
</u-form-item>
<u-form-item v-if="item.is_lesson>0" label-width="auto" labelPosition="top" label="补课内容" borderBottom>
<u--textarea v-model="item.lessons" :disabled="readonly" autoHeight placeholder="请输入需要的课程" border="surround"
count></u--textarea>
</u-form-item>
</block>
<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 v-if="residents.child_arr.length>1&&!readonly" class="delete"
@click="removeChildArr(index)">删除以上信息</button>
</block>
<button v-if="residents.child>0&&!readonly" class="plus" @click="pushChildArr">添加学生婴幼儿</button>
</block>
</u--form>
</view>
</template>
<script>
import { Toast } from "../../libs/uniApi"
export default {
props:{
readonly: {
type: Boolean,
default: false
},
datas: {
type: Object,
default: null
}
},
data() {
return {
situationList: [ "做工地的","厂里打工","公司职员","政府上班","种地","在家赋闲","其他"],
//
residents: {
family: [
// {
// name: '',
// birth_time: '',
// situation: '', //
// skills: '', //
// }
],
child: '', //
child_arr: [ //
{
age: '',
feeding: '', //
grade: '', //
is_lesson: '', //
lessons: '', //
notes: '' //
}
],
// family: [{
// name: '',
// birth_time: '1988-08-08',
// situation: 1, //
// skills: '', //
// }],
// child: 1, //
// child_arr: [ //
// {
// age: '3',
// feeding: 1, //
// grade: '', //
// is_lesson: 1, //
// lessons: '', //
// notes: '' //
// }
// ],
},
rules: {
family: {
validator: (rule, value, callback ) => {
if (Array.isArray(value) && value.length > 0) {
for (let i = 0; i < value.length; i++) {
const item = value[i];
for (const key in item) {
//
if (!item[key]&&item[key]!==0) {
callback(new Error('以上四项基本信息必填'));
return;
}
}
}
//
callback();
} else {
//
callback(new Error('数组不能为空'));
}
},
trigger: ['change', 'blur']
},
child: {
validator: (rule, value, callback )=>{
typeof value==='number'?callback():callback('不能为空')
},
trigger: ['change', 'blur']
},
}
}
},
watch:{
datas(newValue, oldValue){
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;
})
}
}
},
mounted() {
if(this.$props.readonly){
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: {
async validate() {
let flag = false;
if(this.residents.child) this.residents.child_arr.forEach(item=>{
if(item.age==''||item.age<0||item.age>200) flag = true;
})
if(flag){
Toast('请输入年龄');
await this.$u.sleep(500);
return Promise.reject();
}
return this.$refs.residentsForm.validate();
},
//
changebirth_time(e) {
let index = e.currentTarget.dataset.index;
this.residents.family[index].birth_time = e.detail.value;
},
//
changesituation(e) {
let index = e.currentTarget.dataset.index;
this.residents.family[index].situation = e.detail.value;
},
//
pushFamily() {
this.residents.family.push({
name: '',
birth_time: '',
situation: '', //
skills: '', //
})
},
//
removeFamily(index) {
uni.showModal({
confirmColor: '#f56c6c',
content: '确定删除吗?',
success: (res) => {
if (res.confirm) {
this.residents.family.splice(index, 1);
}
}
})
},
//
pushChildArr() {
this.residents.child_arr.push({
age: '',
feeding: '', //
grade: '', //
is_lesson: '', //
lessons: '', //
notes: '' //
})
},
//
removeChildArr(index) {
uni.showModal({
confirmColor: '#f56c6c',
content: '确定删除吗?',
success: (res) => {
if (res.confirm) {
this.residents.child_arr.splice(index, 1);
}
}
})
},
},
}
</script>
<style lang="scss">
.card {
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
margin-top: 0;
padding-top: 0;
border-radius: 0 0 14rpx 14rpx;
}
.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;
}
.title {
font-weight: 500;
font-size: 34rpx;
&::before {
width: 8rpx;
height: 26rpx;
border-radius: 4rpx;
background-color: #0122c7;
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,269 +1,282 @@
<!-- 深加工 -->
<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 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>
<block v-if="formData.shop_front">
<u-form-item labelWidth="auto" label="有无建设用地" required prop="shop_front" borderBottom>
<u-radio-group v-model="formData.shop_front" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="面积" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入面积"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="经营地点" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="材料来源" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无销售渠道" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无技术指导" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无品牌" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无宣传推广" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无运输" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="经营诉求" required prop="farm_tools" borderBottom>
<u--textarea v-model="formData.farm_tools" autoHeight placeholder="请输入经营诉求" border="surround"
count></u--textarea>
</u-form-item>
</block>
<block v-else>
<u-form-item labelWidth="auto" label="有无建设用地" required prop="shop_front" borderBottom>
<u-radio-group v-model="formData.shop_front" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<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
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="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="人数" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无食堂" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="材料来源" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="自动化办公程度" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无用工需求" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无品牌" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无宣传推广" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="库存情况" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无运输" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="经营诉求" required prop="farm_tools" borderBottom>
<u--textarea v-model="formData.farm_tools" autoHeight placeholder="请输入经营诉求" border="surround"
count></u--textarea>
</u-form-item>
</block>
</u--form>
</view>
</template>
<script>
export default {
data() {
return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: {
shop_front: '', //
},
rules: {
}
}
},
created() {
this.initRules()
},
methods: {
//
initRules() {
let arr = Object.keys(this.formData);
arr.forEach(key => {
this.rules[key] = {
validator: (rule, value, callback) => {
this.$refs.breedingForm.clearValidate(rule.field);
value.trim() !== '' ? callback() : callback('不能为空');
},
trigger: ['change', 'blur']
}
})
},
//
async validate() {
return await this.$refs.breedingForm.validate();;
},
//
changeLanPlan(e) {
let index = e.currentTarget.dataset.index;
this.formData.planning = e.detail.value;
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
},
//
pushBreedingList() {
this.formData.push({})
},
//
removeBreedingList(index) {
uni.showModal({
confirmColor: '#f56c6c',
content: '确定删除吗?',
success: (res) => {
if (res.confirm) {
this.formData.splice(index, 1);
}
}
})
},
},
}
</script>
<style lang="scss">
.card{
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
border-radius: 14rpx;
}
.title {
font-weight: 500;
font-size: 34rpx;
&::before {
width: 8rpx;
height: 26rpx;
border-radius: 4rpx;
background-color: #0122c7;
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;
}
<!-- 深加工 -->
<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 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>
<block v-if="formData.shop_front">
<u-form-item labelWidth="auto" label="有无建设用地" required prop="shop_front" borderBottom>
<u-radio-group v-model="formData.shop_front" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="面积" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入面积"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="经营地点" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="材料来源" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无销售渠道" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无技术指导" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无品牌" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无宣传推广" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无运输" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="经营诉求" required prop="farm_tools" borderBottom>
<u--textarea v-model="formData.farm_tools" autoHeight placeholder="请输入经营诉求" border="surround"
count></u--textarea>
</u-form-item>
</block>
<block v-else>
<u-form-item labelWidth="auto" label="有无建设用地" required prop="shop_front" borderBottom>
<u-radio-group v-model="formData.shop_front" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<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
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="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="人数" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无食堂" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="材料来源" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="自动化办公程度" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无用工需求" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无品牌" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无宣传推广" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="库存情况" required prop="notes" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无运输" required prop="planting_company" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="经营诉求" required prop="farm_tools" borderBottom>
<u--textarea v-model="formData.farm_tools" autoHeight placeholder="请输入经营诉求" border="surround"
count></u--textarea>
</u-form-item>
</block>
</u--form>
</view>
</template>
<script>
export default {
data() {
return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: {
shop_front: '', //
},
rules: {
}
}
},
created() {
this.initRules()
},
methods: {
//
initRules() {
let arr = Object.keys(this.formData);
arr.forEach(key => {
this.rules[key] = {
validator: (rule, value, callback) => {
this.$refs.breedingForm.clearValidate(rule.field);
value.trim() !== '' ? callback() : callback('不能为空');
},
trigger: ['change', 'blur']
}
})
},
//
async validate() {
return await this.$refs.breedingForm.validate();;
},
//
changeLanPlan(e) {
let index = e.currentTarget.dataset.index;
this.formData.planning = e.detail.value;
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
},
//
pushBreedingList() {
this.formData.push({})
},
//
removeBreedingList(index) {
uni.showModal({
confirmColor: '#f56c6c',
content: '确定删除吗?',
success: (res) => {
if (res.confirm) {
this.formData.splice(index, 1);
}
}
})
},
},
}
</script>
<style lang="scss">
.card {
background-color: #fff;
margin: 28rpx;
padding: 28rpx;
margin-top: 0;
padding-top: 0;
border-radius: 0 0 14rpx 14rpx;
}
.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;
}
.title {
font-weight: 500;
font-size: 34rpx;
&::before {
width: 8rpx;
height: 26rpx;
border-radius: 4rpx;
background-color: #0122c7;
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>

File diff suppressed because it is too large Load Diff

View File

@ -42,8 +42,6 @@
payMoney: {
money: ''
},
//
payData: null,
payTimer: null,
timeCount: 5,
task_id: -1, //id,,
@ -64,28 +62,6 @@
this.loadTask();
}
},
onShow() {
if(this.payData){
payStatus({
order_id: payData.order_id,
from: payData.from,
}).then((status)=>{
uni.showToast({
icon: status.data.pay_status?'success':'none',
title: status.data.pay_status?'支付成功':'支付失败'
})
if(this.task_id>0){
uni.$emit('upBuyShare');
uni.navigateBack();
}
else{
userInfo().then(user=>{
this.$store.commit('setUserInfo', user.data);
})
}
})
}
},
methods: {
changePrice(index){
if(this.changeMoney == index)this.changeMoney = -1;
@ -110,7 +86,7 @@
pay(){
if(!this.payMoney.money)return Toast('请先填写充值金额!')
if(this.payMoney.money<=0)return Toast('充值金额不能小于0!')
if(!this.payTimer){
if(this.payTimer==null){
this.goRecharge();
this.payTimer = setInterval(()=>{
this.timeCount--;
@ -135,7 +111,6 @@
queryData.task_id = this.task_id;
}
let { data } = await recharge(queryData);
this.payData = data;
let res = await payWay({
order_id: data.order_id,
from: data.from,
@ -171,6 +146,24 @@
success: (e) => {
// console.log('', e);
uni.hideLoading();
payStatus({
order_id: data.order_id,
from: data.from,
}).then((status)=>{
uni.showToast({
icon: status.data.pay_status?'success':'none',
title: status.data.pay_status?'支付成功':'支付失败'
})
if(this.task_id>0){
uni.$emit('upBuyShare');
uni.navigateBack();
}
else{
userInfo().then(user=>{
this.$store.commit('setUserInfo', user.data);
})
}
})
},
fail: (e) => {
console.log(e);

View File

@ -55,7 +55,7 @@
keyName="name" @change="changeHandler" @cancel="demandShow = false" @confirm="changeDemand"></u-picker>
</u--form>
<!-- <button @click="addArchives" class="btn">完成更新</button> -->
<mybtn text="完成更新" @click="$u.throttle(addArchives, 2000)"></mybtn>
<mybtn text="完成更新" @click="$u.throttle(addArchives, 1500)"></mybtn>
<u-modal :show="modelShow" title="警告" content='确定要删除该信息吗' closeOnClickOverlay showCancelButton
@close="modelShow=false" @cancel="modelShow=false" @confirm="deleteDemand(deleteIndex)"></u-modal>
</view>
@ -105,7 +105,6 @@
},
data() {
return {
listMap: new Map(),
demandShow: false,
demandLoading: false,
demandList: [], //
@ -135,15 +134,9 @@
this.task_id = +options.task_id || 0;
this.initInformationDetails({ id: options.id });
this.initCategoryBusinessList();
this.initMap();
},
onShow() {},
methods: {
initMap() {
comonentList.forEach(item => {
this.listMap.set(item.id, item.name);
})
},
async initInformationDetails(id) {
let res = await informationDetails(id);
this.formData = res.data;
@ -153,6 +146,7 @@
if (this.showDemandList.length == 0) return Toast('请先添加需求!');
let refsDatas = await this.loadRefsDatas();
if (!this.updateFlag) return;
// return ;
uni.showLoading({
title: '正在更新...',
mask: true
@ -201,10 +195,13 @@
//
async initCategoryBusinessList() {
let res = await categoryBusinessList();
// this.demandList = res.data;
this.demandList = res.data.filter(item => item.id == 6);
this.demandList[0].children = this.demandList[0].children.filter(item => item.id == 7 || item.id == 8 || item
.id == 32);
res.data = res.data.filter((item)=>{
return item.status!=0;
})
this.demandList = res.data;
// this.demandList = res.data.filter(item => item.id == 6);
// this.demandList[0].children = this.demandList[0].children.filter(item => item.id == 7 || item.id == 8 || item
// .id == 32);
this.demandListChild = this.demandList[0].children;
},
//