This commit is contained in:
THK3121 2023-09-08 08:56:03 +08:00
commit a800fea2b5
34 changed files with 3083 additions and 2254 deletions

View File

@ -2,7 +2,7 @@
//#ifdef APP-PLUS
const jpushModule = uni.requireNativePlugin("JG-JPush");
// #endif
import { loginShopAccount } from "@/api/oaUser.js"
import { loginShopAccount, userInfo } from "@/api/oaUser.js"
export default {
onLaunch: async function(info) {
// let noticeArr = []
@ -33,10 +33,13 @@
user: data,
token: res.data.token
})
this.$store.dispatch('initConfig');
let {
data
} = await userInfo();
this.$store.commit('setUserInfo', data);
// uni.$emit('home_initUserInfo', data);
return ;
}catch(e){
console.log(e);
}

View File

@ -25,6 +25,11 @@ export const userInfo = (data) => oahttp.get('/user/info', data)
*/
export const changePassword = (data) => oahttp.post('/user/changePassword', data)
/**
* 获取当前公司已创建的小队
*/
export const userCompanyBrigade = (data) => oahttp.get('/user/company_brigade', data)
/**
* 新增人员
*/
@ -35,7 +40,6 @@ export const loginAdd = (data) => oahttp.post('/login/add', data)
*/
export const userSetInfo = (data) => oahttp.post('/user/setInfo', data)
/**
* 设置是否为队长
*/
@ -64,4 +68,4 @@ export const destroyAccount = (data) => oahttp.post('/user/destroy_account', dat
/**
* 商城登录
*/
export const loginShopAccount = (data) => oahttp.post('/login/shop_account', data)
export const loginShopAccount = (data) => oahttp.post('/login/shop_account', data, { noAuth: true })

View File

@ -2,7 +2,7 @@
<view class="c_card">
<view class="f_card">
<view class="item" @click="navTo('/subpkg/topUp/topUp')">
<view>履约保证总金额()</view>
<view>押金()</view>
<view class="price" v-if="company.deposit">{{cCount(+company.deposit)}}</view>
<view class="price" v-else>0.00</view>
</view>
@ -115,8 +115,9 @@
});
uni.navigateTo({
url: url,
success() {
uni.hideLoading()
success:(res)=> {
uni.hideLoading();
res.eventChannel.emit('company_money', { company_money: this.company.company_money })
}
})
}else Toast('暂未开放')
@ -125,9 +126,9 @@
this.loadConfig.page = 1;
this.loadConfig.status = "loadmore";
this.list = [];
this.initList();
this.loadList();
},
async initList() {
async loadList() {
if (this.loadConfig.status == "nomore") return;
this.loadConfig.status = "loading";
let res;

View File

@ -18,7 +18,7 @@
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="小队" :required="!readonly" prop="brigade" @click="changeCity('brigade')" borderBottom>
<u--input :value="formDataText.brigade" disabled disabledColor="#fff" placeholder="请选择小队"></u--input>
<u--input :value="formDataText.brigade" style="pointer-events: none;" disabled disabledColor="#fff" placeholder="请选择小队"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
</u--form>
@ -36,6 +36,9 @@
commonVillage,
commonBrigade
} from "@/api/oaPbulic.js"
import {
userCompanyBrigade
} from "@/api/oaUser.js"
import {
Toast
} from "../../libs/uniApi"
@ -163,7 +166,10 @@
changeCity(type, toast=false) {
if(toast) return Toast('不可修改该区域')
if (this.$props.readonly) return ;
if (this[type + 'List'].length == 0) return Toast('请先选择上一级地区');
if (this[type + 'List'].length == 0) {
if(type=='brigade') return Toast('小队已经建立完毕');
return Toast('请先选择上一级地区');
}
this.changeType = type;
this.showProvince = true;
},
@ -229,10 +235,20 @@
commonBrigade({
brigade: code
}).then(res => {
// ,
let f_arr = this.$store.state.app.userInfo.company?.responsible_area?.split(',')||[];
this.brigadeList = res.data.filter(item=>{
return f_arr.find(t=>item.id==t);
});
//
userCompanyBrigade().then((e)=>{
this.brigadeList = this.brigadeList.filter(item=>{
return !e.data.find(t=>t==item.id);
})
this.formData.brigade = '';
this.formDataRead.brigade = '';
this.formDataText.brigade = '';
})
})
},
}

View File

@ -1,61 +1,88 @@
<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>
<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">
<picker mode="date" @change="changeDate" :disabled="readonly">
<u-form-item labelWidth="auto" label="时间" required prop="start_date" borderBottom>
<u--input :value="formData.start_date" style="pointer-events: none;" 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="address" borderBottom>
<u--input v-model="formData.address" placeholder="请输入地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="人数" required prop="people_count" borderBottom>
<u--input v-model="formData.people_count" type="number" placeholder="请输入人数"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="请包办" required prop="serve" borderBottom>
<u-radio-group v-model="formData.serve" 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="perform" borderBottom>
<u-radio-group v-model="formData.perform" 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="vehicle" borderBottom>
<u-radio-group v-model="formData.vehicle" 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="in_hotel" borderBottom>
<u-radio-group v-model="formData.in_hotel" 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 {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: {
shop_front: '', //
start_date: "", //\
address: "", //
people_count: "", //
serve: "", //
perform: "", //
vehicle: "", //
in_hotel: "", //宿
},
rules: {
@ -63,7 +90,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: {
//
@ -90,8 +142,7 @@
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
this.formData.start_date = e.detail.value;
},
//
pushBreedingList() {
@ -114,12 +165,44 @@
</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;
font-size: 34rpx;

View File

@ -1,61 +1,88 @@
<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>
<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">
<picker mode="date" @change="changeDate" :disabled="readonly">
<u-form-item labelWidth="auto" label="时间" required prop="start_date" borderBottom>
<u--input :value="formData.start_date" style="pointer-events: none;" 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="address" borderBottom>
<u--input v-model="formData.address" placeholder="请输入地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="人数" required prop="people_count" borderBottom>
<u--input v-model="formData.people_count" type="number" placeholder="请输入人数"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="请包办" required prop="serve" borderBottom>
<u-radio-group v-model="formData.serve" 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="perform" borderBottom>
<u-radio-group v-model="formData.perform" 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="vehicle" borderBottom>
<u-radio-group v-model="formData.vehicle" 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="in_hotel" borderBottom>
<u-radio-group v-model="formData.in_hotel" 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 {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: {
shop_front: '', //
start_date: "", //\
address: "", //
people_count: "", //
serve: "", //
perform: "", //
vehicle: "", //
in_hotel: "", //宿
},
rules: {
@ -63,7 +90,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: {
//
@ -90,8 +142,7 @@
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
this.formData.start_date = e.detail.value;
},
//
pushBreedingList() {
@ -114,12 +165,44 @@
</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;
font-size: 34rpx;

View File

@ -1,74 +1,98 @@
<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>
<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="address" borderBottom>
<u--input v-model="formData.address" placeholder="请输入地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="人数" required prop="people_count" borderBottom>
<u--input v-model="formData.people_count" type="number" placeholder="请输入人数"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="请包办" required prop="serve" borderBottom>
<u-radio-group v-model="formData.serve" 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="perform" borderBottom>
<u-radio-group v-model="formData.perform" 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="host" borderBottom>
<u-radio-group v-model="formData.host" 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="vehicle" borderBottom>
<u-radio-group v-model="formData.vehicle" 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="in_hotel" borderBottom>
<u-radio-group v-model="formData.in_hotel" 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="graveyard" borderBottom>
<u-radio-group v-model="formData.graveyard" 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 {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: {
shop_front: '', //
address: "", //
people_count: "", //
serve: "", //
perform: "", //
host: "", //
vehicle: "", //
in_hotel: "", //宿
graveyard: "", //
},
rules: {
@ -76,7 +100,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: {
//
@ -103,8 +152,7 @@
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
this.formData.start_date = e.detail.value;
},
//
pushBreedingList() {
@ -127,12 +175,44 @@
</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;
font-size: 34rpx;

View File

@ -1,69 +1,96 @@
<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>
<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">
<picker mode="date" @change="changeDate" :disabled="readonly">
<u-form-item labelWidth="auto" label="时间" required prop="start_date" borderBottom>
<u--input :value="formData.start_date" style="pointer-events: none;" 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="address" borderBottom>
<u--input v-model="formData.address" placeholder="请输入地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="人数" required prop="people_count" borderBottom>
<u--input v-model="formData.people_count" type="number" placeholder="请输入人数"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="请包办" required prop="serve" borderBottom>
<u-radio-group v-model="formData.serve" 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="perform" borderBottom>
<u-radio-group v-model="formData.perform" 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="host" borderBottom>
<u-radio-group v-model="formData.host" 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="vehicle" borderBottom>
<u-radio-group v-model="formData.vehicle" 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="in_hotel" borderBottom>
<u-radio-group v-model="formData.in_hotel" 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 {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: {
shop_front: '', //
start_date: "", //\
address: "", //
people_count: "", //
serve: "", //
perform: "", //
host: "", //
vehicle: "", //
in_hotel: "", //宿
},
rules: {
@ -71,7 +98,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: {
//
@ -98,8 +150,7 @@
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
this.formData.start_date = e.detail.value;
},
//
pushBreedingList() {
@ -122,12 +173,44 @@
</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;
font-size: 34rpx;

View File

@ -1,64 +1,93 @@
<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="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>
<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="types" borderBottom>
<u--input v-model="formData.types" placeholder="请输入宴席类型"></u--input>
</u-form-item>
<picker mode="date" @change="changeDate" :disabled="readonly">
<u-form-item labelWidth="auto" label="时间" required prop="start_date" borderBottom>
<u--input :value="formData.start_date" style="pointer-events: none;" 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="address" borderBottom>
<u--input v-model="formData.address" placeholder="请输入地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="人数" required prop="people_count" borderBottom>
<u--input v-model="formData.people_count" type="number" placeholder="请输入人数"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="请包办" required prop="serve" borderBottom>
<u-radio-group v-model="formData.serve" 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="perform" borderBottom>
<u-radio-group v-model="formData.perform" 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="vehicle" borderBottom>
<u-radio-group v-model="formData.vehicle" 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="in_hotel" borderBottom>
<u-radio-group v-model="formData.in_hotel" 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 {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: {
shop_front: '', //
types: "", //
start_date: "", //\
address: "", //
people_count: "", //
serve: "", //
perform: "", //
host: "", //
vehicle: "", //
in_hotel: "", //宿
},
rules: {
@ -66,7 +95,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: {
//
@ -93,8 +147,7 @@
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
this.formData.start_date = e.detail.value;
},
//
pushBreedingList() {
@ -117,12 +170,44 @@
</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;
font-size: 34rpx;

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" style="pointer-events: none;" 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" style="pointer-events: none;" 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,183 +1,202 @@
<!-- 深加工 -->
<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;">
<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="is_manage" borderBottom>
<u-radio-group v-model="formData.is_manage" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
v-for="(item, index) in [{value:1,label:'是'},{value: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>
<block v-if="formData.is_manage">
<u-form-item labelWidth="auto" label="有无建设用地" required prop="construction_land" borderBottom>
<u-radio-group v-model="formData.construction_land" 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>
<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>
<u-form-item labelWidth="auto" label="面积(m²)" required prop="land_area" borderBottom>
<u--input v-model="formData.land_area" type="number" placeholder="请输入面积(m²)"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="经营地点" required prop="manage_place" borderBottom>
<u--input v-model="formData.manage_place" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="材料来源" required prop="source_materials" borderBottom>
<u--input v-model="formData.source_materials" placeholder="请输入材料来源"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无销售渠道" required prop="marketing_channel" borderBottom>
<u-radio-group v-model="formData.marketing_channel" 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="technical_guidance" borderBottom>
<u-radio-group v-model="formData.technical_guidance" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无品牌" required prop="brand" borderBottom>
<u-radio-group v-model="formData.brand" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无宣传推广" required prop="advertising" borderBottom>
<u-radio-group v-model="formData.advertising" 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="transport" borderBottom>
<u-radio-group v-model="formData.transport" 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="business_appeal" borderBottom>
<u--textarea v-model="formData.business_appeal" autoHeight placeholder="请输入经营诉求" border="surround"
count></u--textarea>
</u-form-item>
</block>
<block v-else>
<u-form-item labelWidth="auto" label="有无建设用地" required prop="construction_land" borderBottom>
<u-radio-group v-model="formData.construction_land" 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="manage_type" borderBottom>
<u--input :value="storeTypeList[formData.manage_type]" style="pointer-events: none;" 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="manage_place" borderBottom>
<u--input v-model="formData.manage_place" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="人数" required prop="people_count" borderBottom>
<u--input v-model="formData.people_count" placeholder="请输入人数"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无食堂" required prop="canteen" borderBottom>
<u-radio-group v-model="formData.canteen" 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="source_materials" borderBottom>
<u--input v-model="formData.source_materials" placeholder="请输入材料来源"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="自动化办公程度" required prop="automation" borderBottom>
<u--input v-model="formData.automation" placeholder="请输入自动化办公程度"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无用工需求" required prop="employment" borderBottom>
<u-radio-group v-model="formData.employment" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无品牌" required prop="brand" borderBottom>
<u-radio-group v-model="formData.brand" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无宣传推广" required prop="advertising" borderBottom>
<u-radio-group v-model="formData.advertising" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="库存情况" required prop="repertory" borderBottom>
<u--input v-model="formData.repertory" placeholder="请输入库存情况"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无运输" required prop="transport" borderBottom>
<u-radio-group v-model="formData.transport" 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="business_appeal" borderBottom>
<u--textarea v-model="formData.business_appeal" autoHeight placeholder="请输入经营诉求" border="surround"
count></u--textarea>
</u-form-item>
</block>
</u--form>
</view>
</view>
</template>
<script>
export default {
props:{
readonly: {
type: Boolean,
default: false
},
datas:{
type: Object,
default: null
}
props: {
readonly: {
type: Boolean,
default: false
},
datas: {
type: Object,
default: null
},
update_time: {
type: String,
default: null
},
},
data() {
return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: {
shop_front: '', //
manage: '',
// construction_land
// type
// area
// count
// canteen
is_manage: "", //
construction_land: "", //
land_area: "", //
manage_place: "", //
source_materials: "", //
marketing_channel: "", //
technical_guidance: "", //
brand: "", //
advertising: "", //广
transport: "", //
business_appeal: "", //
manage_type: "", //
people_count: "", //
canteen: "", //
automation: "", //
employment: "", //
repertory: "", //
},
rules: {
@ -185,12 +204,37 @@
}
},
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: {
//
initRules() {
let arr = Object.keys(this.formData);
arr = arr.filter(item=>{
return item!="business_appeal"
})
arr.forEach(key => {
this.rules[key] = {
validator: (rule, value, callback) => {
@ -205,43 +249,55 @@
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);
}
}
})
this.formData.manage_type = e.detail.value;
},
},
}
</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;
font-size: 34rpx;

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

@ -17,7 +17,7 @@
</u-form-item>
<picker :range="landPlanList" :disabled="readonly" mode="selector" @change="changeLanPlan">
<u-form-item labelWidth="auto" label="土地规划" required prop="planning" borderBottom>
<u--input :value="landPlanList[formData.planning]" placeholder="请选择规划" disabled
<u--input :value="landPlanList[formData.planning]" style="pointer-events: none;" placeholder="请选择规划" disabled
disabledColor="#fff"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
@ -50,14 +50,14 @@
</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
<u--input :value="formData.breeding_time" style="pointer-events: none;" 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
<u--input :value="formData.mature_time" style="pointer-events: none;" placeholder="请选择上市时间" disabled
disabledColor="#fff"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
@ -68,9 +68,9 @@
<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"
<u-form-item labelWidth="auto" labelPosition="top" label="农资农具使用情况" required prop="farm_tools"
borderBottom>
<u--textarea :disabled="readonly" v-model="formData.farm_tools" autoHeight placeholder="请输入农资农具收益情况"
<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>

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="family_index">
<u-form-item labelWidth="auto" label="出生日期" required prop="family.birth_time" borderBottom>
<u--input :value="item.birth_time" style="pointer-events: none;" 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="family_index">
<u-form-item labelWidth="auto" label="就业情况" required prop="family.situation" borderBottom>
<u--input :value="situationList[item.situation]" style="pointer-events: none;" 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(family_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(child_arr_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,15 +1,9 @@
<template>
<view class="content">
<view class="tit">
<text v-if="readonly">更新时间: {{update_time}}</text>
<text>开设店铺</text>
</view>
<view class="card">
<!-- <view class="title">开设店铺</view> -->
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
@ -29,7 +23,7 @@
</u-form-item>
<picker :range="storeTypeList" :disabled="readonly" mode="selector" @change="changeType">
<u-form-item labelWidth="auto" label="经营类型" required prop="type" borderBottom>
<u--input :value="storeTypeList[formData.type]" placeholder="请选择经营类型" disabled
<u--input :value="storeTypeList[formData.type]" style="pointer-events: none;" placeholder="请选择经营类型" disabled
disabledColor="#fff"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>

View File

@ -1,167 +1,202 @@
<!-- 加工 -->
<!-- 加工 -->
<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;">
<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="is_manage" borderBottom>
<u-radio-group v-model="formData.is_manage" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
v-for="(item, index) in [{value:1,label:'是'},{value: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>
<block v-if="formData.is_manage">
<u-form-item labelWidth="auto" label="有无建设用地" required prop="construction_land" borderBottom>
<u-radio-group v-model="formData.construction_land" 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>
<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>
<u-form-item labelWidth="auto" label="面积(m²)" required prop="land_area" borderBottom>
<u--input v-model="formData.land_area" type="number" placeholder="请输入面积(m²)"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="经营地点" required prop="manage_place" borderBottom>
<u--input v-model="formData.manage_place" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="材料来源" required prop="source_materials" borderBottom>
<u--input v-model="formData.source_materials" placeholder="请输入材料来源"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无销售渠道" required prop="marketing_channel" borderBottom>
<u-radio-group v-model="formData.marketing_channel" 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="technical_guidance" borderBottom>
<u-radio-group v-model="formData.technical_guidance" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无品牌" required prop="brand" borderBottom>
<u-radio-group v-model="formData.brand" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无宣传推广" required prop="advertising" borderBottom>
<u-radio-group v-model="formData.advertising" 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="transport" borderBottom>
<u-radio-group v-model="formData.transport" 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="business_appeal" borderBottom>
<u--textarea v-model="formData.business_appeal" autoHeight placeholder="请输入经营诉求" border="surround"
count></u--textarea>
</u-form-item>
</block>
<block v-else>
<u-form-item labelWidth="auto" label="有无建设用地" required prop="construction_land" borderBottom>
<u-radio-group v-model="formData.construction_land" 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="manage_type" borderBottom>
<u--input :value="storeTypeList[formData.manage_type]" style="pointer-events: none;" 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="manage_place" borderBottom>
<u--input v-model="formData.manage_place" placeholder="请输入经营地点"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="人数" required prop="people_count" borderBottom>
<u--input v-model="formData.people_count" type="number" placeholder="请输入人数"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无食堂" required prop="canteen" borderBottom>
<u-radio-group v-model="formData.canteen" 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="source_materials" borderBottom>
<u--input v-model="formData.source_materials" placeholder="请输入材料来源"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="自动化办公程度" required prop="automation" borderBottom>
<u--input v-model="formData.automation" placeholder="请输入自动化办公程度"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无用工需求" required prop="employment" borderBottom>
<u-radio-group v-model="formData.employment" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无品牌" required prop="brand" borderBottom>
<u-radio-group v-model="formData.brand" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="有无宣传推广" required prop="advertising" borderBottom>
<u-radio-group v-model="formData.advertising" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item labelWidth="auto" label="库存情况" required prop="repertory" borderBottom>
<u--input v-model="formData.repertory" placeholder="请输入库存情况"></u--input>
</u-form-item>
<u-form-item labelWidth="auto" label="有无运输" required prop="transport" borderBottom>
<u-radio-group v-model="formData.transport" 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="business_appeal" borderBottom>
<u--textarea v-model="formData.business_appeal" autoHeight placeholder="请输入经营诉求" border="surround"
count></u--textarea>
</u-form-item>
</block>
</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: '', //
is_manage: "", //
construction_land: "", //
land_area: "", //
manage_place: "", //
source_materials: "", //
marketing_channel: "", //
technical_guidance: "", //
brand: "", //
advertising: "", //广
transport: "", //
business_appeal: "", //
manage_type: "", //
people_count: "", //
canteen: "", //
automation: "", //
employment: "", //
repertory: "", //
},
rules: {
@ -169,12 +204,37 @@
}
},
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: {
//
initRules() {
let arr = Object.keys(this.formData);
arr = arr.filter(item=>{
return item!="business_appeal"
})
arr.forEach(key => {
this.rules[key] = {
validator: (rule, value, callback) => {
@ -189,43 +249,55 @@
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);
}
}
})
this.formData.manage_type = e.detail.value;
},
},
}
</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;
font-size: 34rpx;

View File

@ -1,15 +1,20 @@
let httpApiThree;
let httpApi;
let httpApiTwo;
// 正式使用的域名
httpApi = 'https://ceshi-worker-task.lihaink.cn' //测试
// httpApi = 'https://ceshi-worker-task.lihaink.cn' //测试
// httpApi = 'https://preview-worker-task.lihaink.cn' //预上线
// httpApi = 'https://worker-task.lihaink.cn' //正式
httpApi = 'https://worker-task.lihaink.cn' //正式
// 物流
httpApiTwo = 'https://logistics.lihaink.cn' //正式环境
// httpApiTwo = 'https://ceshi-logistics.lihaink.cn' //测试环境
httpApiThree = 'https://ceshi-worker-task.lihaink.cn' //测试
// httpApiThree = 'https://ceshi-worker-task.lihaink.cn' //测试
// httpApiThree = 'https://preview-worker-task.lihaink.cn' //预上线
// httpApiThree = 'https://worker-task.lihaink.cn' //正式
httpApiThree = 'https://worker-task.lihaink.cn' //正式
// #ifdef H5
// httpApiThree = 'baseUrlTest' //生产
// #endif
@ -33,6 +38,7 @@ module.exports = {
// 请求域名 格式: https://您的域名
HTTP_REQUEST_URL: httpApi,
HTTP_REQUEST_URL_THREE: httpApiThree,
HTTP_REQUEST_URL_TWO: httpApiTwo,
// #ifdef H5
//H5接口是浏览器地址

View File

@ -60,7 +60,8 @@
"payment" : {
"weixin" : {
"__platform__" : [ "ios", "android" ],
"appid" : "wx4789d9f1b50390ba",
// "appid" : "wx4789d9f1b50390ba",
"appid" : "wx9d68c92b550ddd1e", //
"UniversalLinks" : "https://worker-task.lihaink.cn/"
}
},

View File

@ -184,6 +184,7 @@
mapState
} from 'vuex';
import bj from "@/static/animation/home.json"
import { userInfo } from "@/api/oaUser.js"
//#ifdef APP-PLUS
var jpushModule = uni.requireNativePlugin("JG-JPush");
// #endif
@ -202,7 +203,7 @@
is_captain: 0,
notArr: [],
orderList: [],
// oaHomeData: [],
oaHomeData: [],
src: "https://cdn.uviewui.com/uview/album/1.jpg",
assessData: [{
num: "0",
@ -241,6 +242,9 @@
onLoad() {
this.is_captain = JSON.parse(uni.getStorageSync("USER_INFO")).is_captain
this.options.data = bj;
// uni.$on('home_initUserInfo', (data=null)=>{
// this.initUserInfo(data);
// });
//#ifdef APP-PLUS
let that = this;
jpushModule.addNotificationListener(function(result) {
@ -257,6 +261,12 @@
// this.getUserIndex()
// this.getIndexList()
if(uni.getStorageSync('uniMP'))this.uniMP = true;
userInfo().then(({data})=>{
this.$store.commit('setUserInfo', data);
this.initUserInfo(data);
this.$store.dispatch('initConfig');
// console.log('', data);
});
this.getApproveList();
this.initUserInfo();
this.showToask();
@ -273,21 +283,53 @@
}
},
computed: {
oaHomeData() {
const route = '/pages/oaHome/oaHome';
let arr = [];
this.$store.state.config?.config?.menu?.forEach((item) => {
if (item.paths.includes(route)) {
arr = item.children;
}
})
if (arr.length >= 8) {
arr = arr.slice(0, 7);
let obj = this.$store.state.config?.config?.menu?.find(item => item.paths.includes(
'/pages/moreFun/moreFun'));
arr.push(obj);
// oaHomeData() {
// const route = '/pages/oaHome/oaHome';
// let arr = [];
// this.$store.state.config?.config?.menu?.forEach((item) => {
// if (item.paths.includes(route)) {
// arr = item.children;
// }
// })
// if (arr.length >= 8) {
// arr = arr.slice(0, 7);
// let obj = this.$store.state.config?.config?.menu?.find(item => item.paths.includes(
// '/pages/moreFun/moreFun'));
// arr.push(obj);
// }
// return arr;
// },
},
watch: {
'$store.state.app.token':{
handler: function(n, o){
userInfo().then(({data})=>{
// console.log(data);
this.$store.commit('setUserInfo', data);
this.initUserInfo(data);
this.$store.dispatch('initConfig');
});
}
},
'$store.state.config.config.menu': {
immediate: true,
deep: true,
handler: function(n, o){
const route = '/pages/oaHome/oaHome';
let arr = [];
n.forEach((item) => {
if (item.paths.includes(route)) {
arr = item.children;
}
})
if (arr.length >= 8) {
arr = arr.slice(0, 7);
let obj = n.find(item => item.paths.includes(
'/pages/moreFun/moreFun'));
arr.push(obj);
}
this.oaHomeData = arr;
}
return arr;
}
},
methods: {
@ -324,7 +366,8 @@
url: "/pages/logistics/index",
});
},
initUserInfo() {
initUserInfo(data=null) {
if(data) return this.myOaInfo = data;
this.$store.state.app.userInfo ?
(this.myOaInfo = this.$store.state.app.userInfo) :
(this.myOaInfo.avatar = "");

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
<template>
<view style="padding-top: 28rpx;">
<view style="padding-top: 28rpx;padding-bottom: 160rpx;">
<view class="card">
<view class="title">任务名称: {{task.title}}</view>
<u-line style="margin: 14rpx 0;"></u-line>
@ -9,7 +9,7 @@
<view class="card">
<view class="title">任务描述</view>
<u-line style="margin: 14rpx 0;"></u-line>
<view class="text">{{task.content}}</view>
<view class="text">{{task.content||'暂无任务描述'}}</view>
</view>
<view class="card">
<view class="title">事件记录</view>

View File

@ -93,7 +93,7 @@
<!-- <u-button class="btns" type="primary" icon="plus" text="新建签约"></u-button> -->
</view>
<view class="company_info" v-show="current==2">
<companyFinance></companyFinance>
<companyFinance ref="financeRef"></companyFinance>
</view>
<view v-show="current==3">
<task ref="taskRef" style="width: 100vw;"></task>
@ -128,9 +128,11 @@
name: '签约公司'
}, {
name: '公司财务'
}, {
name: '任务情况'
}],
},
// {
// name: ''
// },
],
loadConfig: {
page: 1,
limit: 15,
@ -153,6 +155,7 @@
},
onReachBottom() {
if (this.current == 1) this.loadCompanyList();
else if (this.current == 2) this.$refs.financeRef.loadList();
else if (this.current == 3) this.$refs.taskRef.loadList();
},
methods: {
@ -212,6 +215,7 @@
},
onPullDownRefresh() {
if (this.current == 1) this.initLoad();
else if (this.current == 2) this.$refs.financeRef.initLoad();
else if (this.current == 3) this.$refs.taskRef.initLoadConfig();
this.$u.sleep(500).then(() => {
uni.stopPullDownRefresh()

View File

@ -54,7 +54,7 @@
</view>
<view class="bottom" @click="navTo('/subpkg/orderDetail/orderDetail')">
<view class="item">
<view>履约保证金额()</view>
<view>押金()</view>
<view class="num" v-show="eyeType">{{
userInfo.deposit || 0.0
}}</view>
@ -444,6 +444,7 @@ page {
align-items: center;
.item {
flex: 1;
text-align: center;
font-size: 25rpx;
font-weight: 400;

View File

@ -298,8 +298,8 @@
upLoadImage
} from "@/api/file.js"
import {
loginAdd
} from "@/api/oaUser.js"
loginAdd,
} from "@/api/oaUser.js"
import districtSelector from "@/components/districtSelector/districtSelector.vue" //
import districtSelectorTow from "@/components/districtSelector/districtSelectorTow.vue" //
import {

View File

@ -75,7 +75,7 @@
},
loadConfig:{
page: 1,
limit: 25,
limit: 15,
loadingText: '努力加载中',
loadmoreText: '轻轻上拉',
nomoreText: '没有更多账单了~~',

View File

@ -203,6 +203,7 @@
<style lang="scss">
.personnel {
padding: 28rpx 0;
padding-bottom: 160rpx;
.new_btn {
position: fixed;
bottom: 30rpx;

View File

@ -62,7 +62,6 @@
this.loadTask();
}
},
onShow() {},
methods: {
changePrice(index){
if(this.changeMoney == index)this.changeMoney = -1;
@ -87,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--;
@ -175,7 +174,7 @@
})
},
complete: () => {
this.payMoney.money = '';
if(this.task_id<=0)this.payMoney.money = '';
},
});
}

View File

@ -55,9 +55,11 @@
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="updateShow=true"></mybtn>
<u-modal :show="modelShow" title="警告" content='确定要删除该信息吗' closeOnClickOverlay showCancelButton
@close="modelShow=false" @cancel="modelShow=false" @confirm="deleteDemand(deleteIndex)"></u-modal>
<u-modal :show="updateShow" title="提示" content='确认信息无误后再更新' closeOnClickOverlay showCancelButton
@close="updateShow=false" @cancel="updateShow=false" @confirm="$u.throttle(addArchives, 1500)"></u-modal>
</view>
</view>
</template>
@ -105,7 +107,6 @@
},
data() {
return {
listMap: new Map(),
demandShow: false,
demandLoading: false,
demandList: [], //
@ -114,6 +115,7 @@
updateFlag: true,
task_id: 0,
modelShow: false, //
updateShow: false, //
deleteIndex: -1, //
formData: {
id_card: '',
@ -135,24 +137,21 @@
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;
},
//
async addArchives() {
this.updateShow = false;
await this.$nextTick();
if (this.showDemandList.length == 0) return Toast('请先添加需求!');
let refsDatas = await this.loadRefsDatas();
if (!this.updateFlag) return;
// return ;
uni.showLoading({
title: '正在更新...',
mask: true
@ -201,10 +200,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;
},
//

View File

@ -11,7 +11,8 @@
</view>
<view class="item">
<text>可用余额</text>
<text>{{$store.state.app.userInfo.user_money||'0.00'}}</text>
<text>{{company_money||'0.00'}}</text>
<!-- <text>{{$store.state.app.userInfo.user_money||'0.00'}}</text> -->
</view>
</view>
</view>
@ -43,6 +44,7 @@
return {
priceList: ['10元','50元','100元','500元','1000元','5000元','全部', '自定义'],
changeMoney: -1,
company_money: "0.00",
payMoney: {
money: ''
},
@ -58,8 +60,12 @@
})
}
},
onLoad() {},
onShow() {},
onLoad() {
const eventChannel = this.getOpenerEventChannel();
eventChannel.on('company_money', (e)=>{
this.company_money = e.company_money;
})
},
methods: {
copyPhone(str = "") {
uni.setClipboardData({

View File

@ -1,5 +1,5 @@
import {
HTTP_REQUEST_URL_THREE,
HTTP_REQUEST_URL_TWO,
HEADER,
TOKENNAME,
} from '@/config/app';
@ -21,8 +21,7 @@ function baseRequestTwo(url, method, data, {
noAuth = false,
noVerify = false
}) {
// let Url = "https://logistics.lihaink.cn", //正式环境
let Url = "https://ceshi-logistics.lihaink.cn", //测试环境
let Url = HTTP_REQUEST_URL_TWO,
header = HEADER;
if (!noAuth) {
// 已经未登录了,禁止请求
@ -41,6 +40,7 @@ function baseRequestTwo(url, method, data, {
// if (store.state.app.token) header[TOKENNAME] = 'Bearer ' + store.state.app.token;
if (store.state.app.token) header[TOKENNAME] = store.state.app.token;
// header[TOKENNAME] = 'Bearer sdjflidshjgfkbdasgjmasbgvhauuiavhkesvndkaesbvkjsdbv';
return new Promise((reslove, reject) => {
// uni.showLoading({
@ -52,6 +52,7 @@ function baseRequestTwo(url, method, data, {
method: method || 'GET',
header: {
...header
},
data: method != 'GET' ? data || {} : {},
params: method == 'GET' ? data : {},
@ -66,10 +67,12 @@ function baseRequestTwo(url, method, data, {
reject(res.data);
} else if (res.data.code == 0) {
// uni.hideLoading();
uni.showToast({
title: res.data.msg || '请检查网络',
icon: 'none'
})
if (res.data.show != 1 && res.data.msg != '无登录信息') {
uni.showToast({
title: res.data.msg || '请检查网络',
icon: 'none',
})
}
reject(res.data);
} else if (res.data.code == 1) {
store.commit("SET_REQUEST");

View File

@ -67,10 +67,12 @@ function baseRequestTwo(url, method, data, {
reject(res.data);
} else if (res.data.code == 0) {
// uni.hideLoading();
uni.showToast({
title: res.data.msg || '请检查网络',
icon: 'none',
})
if(res.data.show!=1&&res.data.msg!='无登录信息'){
uni.showToast({
title: res.data.msg || '请检查网络',
icon: 'none',
})
}
reject(res.data);
} else if (res.data.code == 1) {
store.commit("SET_REQUEST");