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 //#ifdef APP-PLUS
const jpushModule = uni.requireNativePlugin("JG-JPush"); const jpushModule = uni.requireNativePlugin("JG-JPush");
// #endif // #endif
import { loginShopAccount } from "@/api/oaUser.js" import { loginShopAccount, userInfo } from "@/api/oaUser.js"
export default { export default {
onLaunch: async function(info) { onLaunch: async function(info) {
// let noticeArr = [] // let noticeArr = []
@ -33,10 +33,13 @@
user: data, user: data,
token: res.data.token token: res.data.token
}) })
this.$store.dispatch('initConfig');
let { let {
data data
} = await userInfo(); } = await userInfo();
this.$store.commit('setUserInfo', data); this.$store.commit('setUserInfo', data);
// uni.$emit('home_initUserInfo', data);
return ;
}catch(e){ }catch(e){
console.log(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 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) 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="c_card">
<view class="f_card"> <view class="f_card">
<view class="item" @click="navTo('/subpkg/topUp/topUp')"> <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-if="company.deposit">{{cCount(+company.deposit)}}</view>
<view class="price" v-else>0.00</view> <view class="price" v-else>0.00</view>
</view> </view>
@ -115,8 +115,9 @@
}); });
uni.navigateTo({ uni.navigateTo({
url: url, url: url,
success() { success:(res)=> {
uni.hideLoading() uni.hideLoading();
res.eventChannel.emit('company_money', { company_money: this.company.company_money })
} }
}) })
}else Toast('暂未开放') }else Toast('暂未开放')
@ -125,9 +126,9 @@
this.loadConfig.page = 1; this.loadConfig.page = 1;
this.loadConfig.status = "loadmore"; this.loadConfig.status = "loadmore";
this.list = []; this.list = [];
this.initList(); this.loadList();
}, },
async initList() { async loadList() {
if (this.loadConfig.status == "nomore") return; if (this.loadConfig.status == "nomore") return;
this.loadConfig.status = "loading"; this.loadConfig.status = "loading";
let res; let res;

View File

@ -18,7 +18,7 @@
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
<u-form-item label="小队" :required="!readonly" prop="brigade" @click="changeCity('brigade')" borderBottom> <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-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
</u--form> </u--form>
@ -36,6 +36,9 @@
commonVillage, commonVillage,
commonBrigade commonBrigade
} from "@/api/oaPbulic.js" } from "@/api/oaPbulic.js"
import {
userCompanyBrigade
} from "@/api/oaUser.js"
import { import {
Toast Toast
} from "../../libs/uniApi" } from "../../libs/uniApi"
@ -163,7 +166,10 @@
changeCity(type, toast=false) { changeCity(type, toast=false) {
if(toast) return Toast('不可修改该区域') if(toast) return Toast('不可修改该区域')
if (this.$props.readonly) return ; 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.changeType = type;
this.showProvince = true; this.showProvince = true;
}, },
@ -229,10 +235,20 @@
commonBrigade({ commonBrigade({
brigade: code brigade: code
}).then(res => { }).then(res => {
// ,
let f_arr = this.$store.state.app.userInfo.company?.responsible_area?.split(',')||[]; let f_arr = this.$store.state.app.userInfo.company?.responsible_area?.split(',')||[];
this.brigadeList = res.data.filter(item=>{ this.brigadeList = res.data.filter(item=>{
return f_arr.find(t=>item.id==t); 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> <template>
<view class="card"> <view>
<view class="title">寿宴</view> <view class="tit">
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm"> <text v-if="readonly">更新时间: {{update_time}}</text>
<u-form-item labelWidth="auto" label="时间" required prop="cultivated_area" borderBottom> <text>寿宴</text>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面面积"></u--input> </view>
</u-form-item> <view class="card">
<u-form-item labelWidth="auto" label="地点" required prop="cultivated_area" borderBottom> <u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input> <picker mode="date" @change="changeDate" :disabled="readonly">
</u-form-item> <u-form-item labelWidth="auto" label="时间" required prop="start_date" borderBottom>
<u-form-item labelWidth="auto" label="人数" required prop="notes" borderBottom> <u--input :value="formData.start_date" style="pointer-events: none;" placeholder="请选择时间" disabled
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input> disabledColor="#fff"></u--input>
</u-form-item> <u-icon slot="right" name="arrow-right"></u-icon>
<u-form-item labelWidth="auto" label="请包办" required prop="notes" borderBottom> </u-form-item>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> </picker>
<u-radio :customStyle="{marginRight: '16px'}" <u-form-item labelWidth="auto" label="地点" required prop="address" borderBottom>
v-for="(item, index) in [{value:2,label:'酒店'},{value:1,label:'一条龙'},{value:0,label:'只请厨师'}]" :key="index" :label="item.label" <u--input v-model="formData.address" placeholder="请输入地点"></u--input>
:name="item.value"> </u-form-item>
</u-radio> <u-form-item labelWidth="auto" label="人数" required prop="people_count" borderBottom>
</u-radio-group> <u--input v-model="formData.people_count" type="number" placeholder="请输入人数"></u--input>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="有无歌舞表演" required prop="planting_company" borderBottom> <u-form-item labelWidth="auto" label="请包办" required prop="serve" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> <u-radio-group v-model="formData.serve" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}" <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:2,label:'酒店'},{value:1,label:'一条龙'},{value:0,label:'只请厨师'}]" :key="index"
:name="item.value"> :label="item.label" :name="item.value">
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="有无交通工具" required prop="planting_company" borderBottom> <u-form-item labelWidth="auto" label="有无歌舞表演" required prop="perform" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> <u-radio-group v-model="formData.perform" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}" <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"> :name="item.value">
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="有无住宿" required prop="planting_company" borderBottom> <u-form-item labelWidth="auto" label="有无交通工具" required prop="vehicle" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> <u-radio-group v-model="formData.vehicle" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}" <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"> :name="item.value">
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
</u--form> <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> </view>
</template> </template>
<script> <script>
export default { export default {
props: {
readonly: {
type: Boolean,
default: false
},
datas: {
type: Object,
default: null
},
update_time: {
type: String,
default: null
},
},
data() { data() {
return { return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: { formData: {
shop_front: '', // start_date: "", //\
address: "", //
people_count: "", //
serve: "", //
perform: "", //
vehicle: "", //
in_hotel: "", //宿
}, },
rules: { rules: {
@ -63,7 +90,32 @@
} }
}, },
created() { 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: { methods: {
// //
@ -90,8 +142,7 @@
}, },
// //
changeDate(e) { changeDate(e) {
let data = e.currentTarget.dataset; this.formData.start_date = e.detail.value;
this.formData[data.value] = e.detail.value;
}, },
// //
pushBreedingList() { pushBreedingList() {
@ -114,12 +165,44 @@
</script> </script>
<style lang="scss"> <style lang="scss">
.card{ .card {
background-color: #fff; background-color: #fff;
margin: 28rpx; margin: 28rpx;
padding: 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 { .title {
font-weight: 500; font-weight: 500;
font-size: 34rpx; font-size: 34rpx;

View File

@ -1,61 +1,88 @@
<template> <template>
<view class="card"> <view>
<view class="title">满月酒</view> <view class="tit">
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm"> <text v-if="readonly">更新时间: {{update_time}}</text>
<u-form-item labelWidth="auto" label="时间" required prop="cultivated_area" borderBottom> <text>满月酒</text>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面面积"></u--input> </view>
</u-form-item> <view class="card">
<u-form-item labelWidth="auto" label="地点" required prop="cultivated_area" borderBottom> <u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input> <picker mode="date" @change="changeDate" :disabled="readonly">
</u-form-item> <u-form-item labelWidth="auto" label="时间" required prop="start_date" borderBottom>
<u-form-item labelWidth="auto" label="人数" required prop="notes" borderBottom> <u--input :value="formData.start_date" style="pointer-events: none;" placeholder="请选择时间" disabled
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input> disabledColor="#fff"></u--input>
</u-form-item> <u-icon slot="right" name="arrow-right"></u-icon>
<u-form-item labelWidth="auto" label="请包办" required prop="notes" borderBottom> </u-form-item>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> </picker>
<u-radio :customStyle="{marginRight: '16px'}" <u-form-item labelWidth="auto" label="地点" required prop="address" borderBottom>
v-for="(item, index) in [{value:2,label:'酒店'},{value:1,label:'一条龙'},{value:0,label:'只请厨师'}]" :key="index" :label="item.label" <u--input v-model="formData.address" placeholder="请输入地点"></u--input>
:name="item.value"> </u-form-item>
</u-radio> <u-form-item labelWidth="auto" label="人数" required prop="people_count" borderBottom>
</u-radio-group> <u--input v-model="formData.people_count" type="number" placeholder="请输入人数"></u--input>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="有无歌舞表演" required prop="planting_company" borderBottom> <u-form-item labelWidth="auto" label="请包办" required prop="serve" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> <u-radio-group v-model="formData.serve" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}" <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:2,label:'酒店'},{value:1,label:'一条龙'},{value:0,label:'只请厨师'}]" :key="index"
:name="item.value"> :label="item.label" :name="item.value">
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="有无交通工具" required prop="planting_company" borderBottom> <u-form-item labelWidth="auto" label="有无歌舞表演" required prop="perform" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> <u-radio-group v-model="formData.perform" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}" <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"> :name="item.value">
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="有无住宿" required prop="planting_company" borderBottom> <u-form-item labelWidth="auto" label="有无交通工具" required prop="vehicle" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> <u-radio-group v-model="formData.vehicle" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}" <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"> :name="item.value">
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
</u--form> <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> </view>
</template> </template>
<script> <script>
export default { export default {
props: {
readonly: {
type: Boolean,
default: false
},
datas: {
type: Object,
default: null
},
update_time: {
type: String,
default: null
},
},
data() { data() {
return { return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: { formData: {
shop_front: '', // start_date: "", //\
address: "", //
people_count: "", //
serve: "", //
perform: "", //
vehicle: "", //
in_hotel: "", //宿
}, },
rules: { rules: {
@ -63,7 +90,32 @@
} }
}, },
created() { 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: { methods: {
// //
@ -90,8 +142,7 @@
}, },
// //
changeDate(e) { changeDate(e) {
let data = e.currentTarget.dataset; this.formData.start_date = e.detail.value;
this.formData[data.value] = e.detail.value;
}, },
// //
pushBreedingList() { pushBreedingList() {
@ -114,12 +165,44 @@
</script> </script>
<style lang="scss"> <style lang="scss">
.card{ .card {
background-color: #fff; background-color: #fff;
margin: 28rpx; margin: 28rpx;
padding: 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 { .title {
font-weight: 500; font-weight: 500;
font-size: 34rpx; font-size: 34rpx;

View File

@ -1,74 +1,98 @@
<template> <template>
<view class="card"> <view>
<view class="title">白事</view> <view class="tit">
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm"> <text v-if="readonly">更新时间: {{update_time}}</text>
<u-form-item labelWidth="auto" label="地点" required prop="cultivated_area" borderBottom> <text>白事</text>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input> </view>
</u-form-item> <view class="card">
<u-form-item labelWidth="auto" label="人数" required prop="notes" borderBottom> <u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input> <u-form-item labelWidth="auto" label="地点" required prop="address" borderBottom>
</u-form-item> <u--input v-model="formData.address" placeholder="请输入地点"></u--input>
<u-form-item labelWidth="auto" label="请包办" required prop="notes" borderBottom> </u-form-item>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> <u-form-item labelWidth="auto" label="人数" required prop="people_count" borderBottom>
<u-radio :customStyle="{marginRight: '16px'}" <u--input v-model="formData.people_count" type="number" placeholder="请输入人数"></u--input>
v-for="(item, index) in [{value:2,label:'酒店'},{value:1,label:'一条龙'},{value:0,label:'只请厨师'}]" :key="index" :label="item.label" </u-form-item>
:name="item.value"> <u-form-item labelWidth="auto" label="请包办" required prop="serve" borderBottom>
</u-radio> <u-radio-group v-model="formData.serve" style="margin: 16rpx;">
</u-radio-group> <u-radio :customStyle="{marginRight: '16px'}"
</u-form-item> v-for="(item, index) in [{value:2,label:'酒店'},{value:1,label:'一条龙'},{value:0,label:'只请厨师'}]" :key="index"
<u-form-item labelWidth="auto" label="有无歌舞表演" required prop="planting_company" borderBottom> :label="item.label" :name="item.value">
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> </u-radio>
<u-radio :customStyle="{marginRight: '16px'}" </u-radio-group>
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label" </u-form-item>
:name="item.value"> <u-form-item labelWidth="auto" label="有无歌舞表演" required prop="perform" borderBottom>
</u-radio> <u-radio-group v-model="formData.perform" style="margin: 16rpx;">
</u-radio-group> <u-radio :customStyle="{marginRight: '16px'}"
</u-form-item> v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
<u-form-item labelWidth="auto" label="有无主持仪式" required prop="planting_company" borderBottom> :name="item.value">
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> </u-radio>
<u-radio :customStyle="{marginRight: '16px'}" </u-radio-group>
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label" </u-form-item>
:name="item.value"> <u-form-item labelWidth="auto" label="有无主持仪式" required prop="host" borderBottom>
</u-radio> <u-radio-group v-model="formData.host" style="margin: 16rpx;">
</u-radio-group> <u-radio :customStyle="{marginRight: '16px'}"
</u-form-item> v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
<u-form-item labelWidth="auto" label="有无交通工具" required prop="planting_company" borderBottom> :name="item.value">
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> </u-radio>
<u-radio :customStyle="{marginRight: '16px'}" </u-radio-group>
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label" </u-form-item>
:name="item.value"> <u-form-item labelWidth="auto" label="有无交通工具" required prop="vehicle" borderBottom>
</u-radio> <u-radio-group v-model="formData.vehicle" style="margin: 16rpx;">
</u-radio-group> <u-radio :customStyle="{marginRight: '16px'}"
</u-form-item> v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
<u-form-item labelWidth="auto" label="有无住宿" required prop="planting_company" borderBottom> :name="item.value">
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> </u-radio>
<u-radio :customStyle="{marginRight: '16px'}" </u-radio-group>
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label" </u-form-item>
:name="item.value"> <u-form-item labelWidth="auto" label="有无住宿" required prop="in_hotel" borderBottom>
</u-radio> <u-radio-group v-model="formData.in_hotel" style="margin: 16rpx;">
</u-radio-group> <u-radio :customStyle="{marginRight: '16px'}"
</u-form-item> v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
<u-form-item labelWidth="auto" label="有无墓地" required prop="planting_company" borderBottom> :name="item.value">
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> </u-radio>
<u-radio :customStyle="{marginRight: '16px'}" </u-radio-group>
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label" </u-form-item>
:name="item.value"> <u-form-item labelWidth="auto" label="有无墓地" required prop="graveyard" borderBottom>
</u-radio> <u-radio-group v-model="formData.graveyard" style="margin: 16rpx;">
</u-radio-group> <u-radio :customStyle="{marginRight: '16px'}"
</u-form-item> v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
</u--form> :name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
</u--form>
</view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
props: {
readonly: {
type: Boolean,
default: false
},
datas: {
type: Object,
default: null
},
update_time: {
type: String,
default: null
},
},
data() { data() {
return { return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: { formData: {
shop_front: '', // address: "", //
people_count: "", //
serve: "", //
perform: "", //
host: "", //
vehicle: "", //
in_hotel: "", //宿
graveyard: "", //
}, },
rules: { rules: {
@ -76,7 +100,32 @@
} }
}, },
created() { 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: { methods: {
// //
@ -103,8 +152,7 @@
}, },
// //
changeDate(e) { changeDate(e) {
let data = e.currentTarget.dataset; this.formData.start_date = e.detail.value;
this.formData[data.value] = e.detail.value;
}, },
// //
pushBreedingList() { pushBreedingList() {
@ -127,12 +175,44 @@
</script> </script>
<style lang="scss"> <style lang="scss">
.card{ .card {
background-color: #fff; background-color: #fff;
margin: 28rpx; margin: 28rpx;
padding: 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 { .title {
font-weight: 500; font-weight: 500;
font-size: 34rpx; font-size: 34rpx;

View File

@ -1,69 +1,96 @@
<template> <template>
<view class="card"> <view>
<view class="title">婚宴</view> <view class="tit">
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm"> <text v-if="readonly">更新时间: {{update_time}}</text>
<u-form-item labelWidth="auto" label="时间" required prop="cultivated_area" borderBottom> <text>婚宴</text>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面面积"></u--input> </view>
</u-form-item> <view class="card">
<u-form-item labelWidth="auto" label="地点" required prop="cultivated_area" borderBottom> <u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input> <picker mode="date" @change="changeDate" :disabled="readonly">
</u-form-item> <u-form-item labelWidth="auto" label="时间" required prop="start_date" borderBottom>
<u-form-item labelWidth="auto" label="人数" required prop="notes" borderBottom> <u--input :value="formData.start_date" style="pointer-events: none;" placeholder="请选择时间" disabled disabledColor="#fff"></u--input>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="请包办" required prop="notes" borderBottom> </picker>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> <u-form-item labelWidth="auto" label="地点" required prop="address" borderBottom>
<u-radio :customStyle="{marginRight: '16px'}" <u--input v-model="formData.address" placeholder="请输入地点"></u--input>
v-for="(item, index) in [{value:2,label:'酒店'},{value:1,label:'一条龙'},{value:0,label:'只请厨师'}]" :key="index" :label="item.label" </u-form-item>
:name="item.value"> <u-form-item labelWidth="auto" label="人数" required prop="people_count" borderBottom>
</u-radio> <u--input v-model="formData.people_count" type="number" placeholder="请输入人数"></u--input>
</u-radio-group> </u-form-item>
</u-form-item> <u-form-item labelWidth="auto" label="请包办" required prop="serve" borderBottom>
<u-form-item labelWidth="auto" label="有无歌舞表演" required prop="planting_company" borderBottom> <u-radio-group v-model="formData.serve" style="margin: 16rpx;">
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> <u-radio :customStyle="{marginRight: '16px'}"
<u-radio :customStyle="{marginRight: '16px'}" v-for="(item, index) in [{value:2,label:'酒店'},{value:1,label:'一条龙'},{value:0,label:'只请厨师'}]" :key="index"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label" :label="item.label" :name="item.value">
:name="item.value"> </u-radio>
</u-radio> </u-radio-group>
</u-radio-group> </u-form-item>
</u-form-item> <u-form-item labelWidth="auto" label="有无歌舞表演" required prop="perform" borderBottom>
<u-form-item labelWidth="auto" label="有无主持仪式" required prop="planting_company" borderBottom> <u-radio-group v-model="formData.perform" style="margin: 16rpx;">
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> <u-radio :customStyle="{marginRight: '16px'}"
<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">
:name="item.value"> </u-radio>
</u-radio> </u-radio-group>
</u-radio-group> </u-form-item>
</u-form-item> <u-form-item labelWidth="auto" label="有无主持仪式" required prop="host" borderBottom>
<u-form-item labelWidth="auto" label="有无交通工具" required prop="planting_company" borderBottom> <u-radio-group v-model="formData.host" style="margin: 16rpx;">
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> <u-radio :customStyle="{marginRight: '16px'}"
<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">
:name="item.value"> </u-radio>
</u-radio> </u-radio-group>
</u-radio-group> </u-form-item>
</u-form-item> <u-form-item labelWidth="auto" label="有无交通工具" required prop="vehicle" borderBottom>
<u-form-item labelWidth="auto" label="有无住宿" required prop="planting_company" borderBottom> <u-radio-group v-model="formData.vehicle" style="margin: 16rpx;">
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> <u-radio :customStyle="{marginRight: '16px'}"
<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">
:name="item.value"> </u-radio>
</u-radio> </u-radio-group>
</u-radio-group> </u-form-item>
</u-form-item> <u-form-item labelWidth="auto" label="有无住宿" required prop="in_hotel" borderBottom>
</u--form> <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> </view>
</template> </template>
<script> <script>
export default { export default {
props: {
readonly: {
type: Boolean,
default: false
},
datas: {
type: Object,
default: null
},
update_time: {
type: String,
default: null
},
},
data() { data() {
return { return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: { formData: {
shop_front: '', // start_date: "", //\
address: "", //
people_count: "", //
serve: "", //
perform: "", //
host: "", //
vehicle: "", //
in_hotel: "", //宿
}, },
rules: { rules: {
@ -71,7 +98,32 @@
} }
}, },
created() { 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: { methods: {
// //
@ -98,8 +150,7 @@
}, },
// //
changeDate(e) { changeDate(e) {
let data = e.currentTarget.dataset; this.formData.start_date = e.detail.value;
this.formData[data.value] = e.detail.value;
}, },
// //
pushBreedingList() { pushBreedingList() {
@ -122,12 +173,44 @@
</script> </script>
<style lang="scss"> <style lang="scss">
.card{ .card {
background-color: #fff; background-color: #fff;
margin: 28rpx; margin: 28rpx;
padding: 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 { .title {
font-weight: 500; font-weight: 500;
font-size: 34rpx; font-size: 34rpx;

View File

@ -1,64 +1,93 @@
<template> <template>
<view class="card"> <view>
<view class="title">其他庆祝宴</view> <view class="tit">
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm"> <text v-if="readonly">更新时间: {{update_time}}</text>
<u-form-item labelWidth="auto" label="宴席类型" required prop="cultivated_area" borderBottom> <text>其他庆祝宴</text>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面面积"></u--input> </view>
</u-form-item> <view class="card">
<u-form-item labelWidth="auto" label="时间" required prop="cultivated_area" borderBottom> <u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
<u--input v-model="formData.cultivated_area" placeholder="请输入门面面积"></u--input> <u-form-item labelWidth="auto" label="宴席类型" required prop="types" borderBottom>
</u-form-item> <u--input v-model="formData.types" placeholder="请输入宴席类型"></u--input>
<u-form-item labelWidth="auto" label="地点" required prop="cultivated_area" borderBottom> </u-form-item>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input> <picker mode="date" @change="changeDate" :disabled="readonly">
</u-form-item> <u-form-item labelWidth="auto" label="时间" required prop="start_date" borderBottom>
<u-form-item labelWidth="auto" label="人数" required prop="notes" borderBottom> <u--input :value="formData.start_date" style="pointer-events: none;" placeholder="请选择时间" disabled
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input> disabledColor="#fff"></u--input>
</u-form-item> <u-icon slot="right" name="arrow-right"></u-icon>
<u-form-item labelWidth="auto" label="请包办" required prop="notes" borderBottom> </u-form-item>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> </picker>
<u-radio :customStyle="{marginRight: '16px'}" <u-form-item labelWidth="auto" label="地点" required prop="address" borderBottom>
v-for="(item, index) in [{value:2,label:'酒店'},{value:1,label:'一条龙'},{value:0,label:'只请厨师'}]" :key="index" :label="item.label" <u--input v-model="formData.address" placeholder="请输入地点"></u--input>
:name="item.value"> </u-form-item>
</u-radio> <u-form-item labelWidth="auto" label="人数" required prop="people_count" borderBottom>
</u-radio-group> <u--input v-model="formData.people_count" type="number" placeholder="请输入人数"></u--input>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="有无歌舞表演" required prop="planting_company" borderBottom> <u-form-item labelWidth="auto" label="请包办" required prop="serve" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> <u-radio-group v-model="formData.serve" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}" <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:2,label:'酒店'},{value:1,label:'一条龙'},{value:0,label:'只请厨师'}]" :key="index"
:name="item.value"> :label="item.label" :name="item.value">
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="有无交通工具" required prop="planting_company" borderBottom> <u-form-item labelWidth="auto" label="有无歌舞表演" required prop="perform" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> <u-radio-group v-model="formData.perform" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}" <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"> :name="item.value">
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="有无住宿" required prop="planting_company" borderBottom> <u-form-item labelWidth="auto" label="有无交通工具" required prop="vehicle" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> <u-radio-group v-model="formData.vehicle" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}" <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"> :name="item.value">
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
</u--form> <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> </view>
</template> </template>
<script> <script>
export default { export default {
props: {
readonly: {
type: Boolean,
default: false
},
datas: {
type: Object,
default: null
},
update_time: {
type: String,
default: null
},
},
data() { data() {
return { return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: { formData: {
shop_front: '', // types: "", //
start_date: "", //\
address: "", //
people_count: "", //
serve: "", //
perform: "", //
host: "", //
vehicle: "", //
in_hotel: "", //宿
}, },
rules: { rules: {
@ -66,7 +95,32 @@
} }
}, },
created() { 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: { methods: {
// //
@ -93,8 +147,7 @@
}, },
// //
changeDate(e) { changeDate(e) {
let data = e.currentTarget.dataset; this.formData.start_date = e.detail.value;
this.formData[data.value] = e.detail.value;
}, },
// //
pushBreedingList() { pushBreedingList() {
@ -117,12 +170,44 @@
</script> </script>
<style lang="scss"> <style lang="scss">
.card{ .card {
background-color: #fff; background-color: #fff;
margin: 28rpx; margin: 28rpx;
padding: 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 { .title {
font-weight: 500; font-weight: 500;
font-size: 34rpx; font-size: 34rpx;

View File

@ -1,333 +1,323 @@
<template> <template>
<view class="content"> <view class="content">
<view class="tit"> <view class="tit">
<text v-if="readonly">更新时间: {{update_time}}</text> <text v-if="readonly">更新时间: {{update_time}}</text>
<text>养殖信息</text> <text>养殖信息</text>
</view> </view>
<view class="card"> <view class="card">
<!-- <view class="title">养殖信息</view> --> <!-- <view class="title">养殖信息</view> -->
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm"> <u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
<u-form-item labelWidth="auto" label="有无养殖培训" required prop="breeding_training" borderBottom> <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-group :disabled="readonly" v-model="formData.breeding_training" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}" <u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:label="item.label" :name="item.value"> :name="item.value">
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="有无注册成立养殖公司" required prop="breeding_company" borderBottom> <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-group :disabled="readonly" v-model="formData.breeding_company" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}" <u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:label="item.label" :name="item.value"> :name="item.value">
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" labelPosition="top" label="备注" required prop="notes" borderBottom> <u-form-item labelWidth="auto" labelPosition="top" label="备注" required prop="notes" borderBottom>
<u--textarea :disabled="readonly" v-model="formData.notes" autoHeight placeholder="请输入备注" <u--textarea :disabled="readonly" v-model="formData.notes" autoHeight placeholder="请输入备注" border="surround"
border="surround" count></u--textarea> count></u--textarea>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="养殖类型" required prop="breeding_type" borderBottom> <u-form-item labelWidth="auto" label="养殖类型" required prop="breeding_type" borderBottom>
<u--input :readonly="readonly" v-model="formData.breeding_type" placeholder="请输入养殖类型"></u--input> <u--input :readonly="readonly" v-model="formData.breeding_type" placeholder="请输入养殖类型"></u--input>
</u-form-item> </u-form-item>
<picker mode="date" @change="changeDate" :disabled="readonly" :data-value="'breeding_time'"> <picker mode="date" @change="changeDate" :disabled="readonly" :data-value="'breeding_time'">
<u-form-item labelWidth="auto" label="养殖开始时间" required prop="breeding_time" borderBottom> <u-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>
disabledColor="#fff"></u--input> <u-icon slot="right" name="arrow-right"></u-icon>
<u-icon slot="right" name="arrow-right"></u-icon> </u-form-item>
</u-form-item> </picker>
</picker> <picker mode="date" @change="changeDate" :disabled="readonly" :data-value="'mature_time'">
<picker mode="date" @change="changeDate" :disabled="readonly" :data-value="'mature_time'"> <u-form-item labelWidth="auto" label="上市时间" required prop="mature_time" borderBottom>
<u-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--input :value="formData.mature_time" placeholder="请选择上市时间" disabled <u-icon slot="right" name="arrow-right"></u-icon>
disabledColor="#fff"></u--input> </u-form-item>
<u-icon slot="right" name="arrow-right"></u-icon> </picker>
</u-form-item> <u-form-item labelWidth="auto" label="产量(斤)" required prop="yield" borderBottom>
</picker> <u--input :readonly="readonly" v-model="formData.yield" placeholder="请输入产量(斤)" type="number"></u--input>
<u-form-item labelWidth="auto" label="产量(斤)" required prop="yield" borderBottom> </u-form-item>
<u--input :readonly="readonly" v-model="formData.yield" placeholder="请输入产量(斤)" type="number"></u--input> <u-form-item labelWidth="auto" label="预计收益(元)" required prop="estimated_income" borderBottom>
</u-form-item> <u--input :readonly="readonly" v-model="formData.estimated_income" placeholder="请输入预计收益(元)"
<u-form-item labelWidth="auto" label="预计收益(元)" required prop="estimated_income" borderBottom> type="number"></u--input>
<u--input :readonly="readonly" v-model="formData.estimated_income" placeholder="请输入预计收益(元)" type="number"></u--input> </u-form-item>
</u-form-item> <u-form-item labelWidth="auto" labelPosition="top" label="农资农具使用情况" required prop="farm_tools" borderBottom>
<u-form-item labelWidth="auto" labelPosition="top" label="农资农具收益情况" required prop="farm_tools" <u--textarea :disabled="readonly" v-model="formData.farm_tools" autoHeight placeholder="请输入农资农具使用情况"
borderBottom> border="surround" count></u--textarea>
<u--textarea :disabled="readonly" v-model="formData.farm_tools" autoHeight placeholder="请输入农资农具收益情况" </u-form-item>
border="surround" count></u--textarea> <u-form-item labelWidth="auto" label="是否生态养殖" required prop="ecological_farming" borderBottom>
</u-form-item> <u-radio-group :disabled="readonly" v-model="formData.ecological_farming" style="margin: 16rpx;">
<u-form-item labelWidth="auto" label="是否生态养殖" required prop="ecological_farming" borderBottom> <u-radio :customStyle="{marginRight: '16px'}"
<u-radio-group :disabled="readonly" v-model="formData.ecological_farming" style="margin: 16rpx;"> v-for="(item, index) in [{value:1,label:'是'},{value:0,label:'否'}]" :key="index" :label="item.label"
<u-radio :customStyle="{marginRight: '16px'}" :name="item.value">
v-for="(item, index) in [{value:1,label:'是'},{value:0,label:'否'}]" :key="index" </u-radio>
:label="item.label" :name="item.value"> </u-radio-group>
</u-radio> </u-form-item>
</u-radio-group> <u-form-item labelWidth="auto" label="现代化程度(%)" required prop="modernization" borderBottom>
</u-form-item> <u--input :readonly="readonly" v-model="formData.modernization" placeholder="请输入现代化程度(%)" type="number"
<u-form-item labelWidth="auto" label="现代化程度(%)" required prop="modernization" borderBottom> maxlength="3"></u--input>
<u--input :readonly="readonly" v-model="formData.modernization" placeholder="请输入现代化程度(%)" type="number" maxlength="3"></u--input> </u-form-item>
</u-form-item> <u-form-item labelWidth="auto" label="预售卖价格(元/500g)" required prop="pre_price" borderBottom>
<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--input :readonly="readonly" v-model="formData.pre_price" placeholder="请输入预售卖价格"></u--input> </u-form-item>
</u-form-item> <u-form-item labelWidth="auto" label="销售方式" required prop="method_sales" borderBottom>
<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-group :disabled="readonly" v-model="formData.method_sales" style="margin: 16rpx;"> <u-radio :customStyle="{marginRight: '16px'}"
<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" :name="item.value">
:label="item.label" :name="item.value"> </u-radio>
</u-radio> </u-radio-group>
</u-radio-group> </u-form-item>
</u-form-item> <u-form-item labelWidth="auto" label="有无加工仓储" required prop="processing_storage" borderBottom>
<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-group :disabled="readonly" v-model="formData.processing_storage" style="margin: 16rpx;"> <u-radio :customStyle="{marginRight: '16px'}"
<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" :name="item.value">
:label="item.label" :name="item.value"> </u-radio>
</u-radio> </u-radio-group>
</u-radio-group> </u-form-item>
</u-form-item> <u-form-item labelWidth="auto" label="有无宣传推广" required prop="promote" borderBottom>
<u-form-item labelWidth="auto" label="有无宣传推广" required prop="promote" borderBottom> <u-radio-group :disabled="readonly" v-model="formData.promote" style="margin: 16rpx;">
<u-radio-group :disabled="readonly" v-model="formData.promote" style="margin: 16rpx;"> <u-radio :customStyle="{marginRight: '16px'}"
<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" :name="item.value">
:label="item.label" :name="item.value"> </u-radio>
</u-radio> </u-radio-group>
</u-radio-group> </u-form-item>
</u-form-item> <u-form-item labelWidth="auto" label="有无运输" required prop="transportation" borderBottom>
<u-form-item labelWidth="auto" label="有无运输" required prop="transportation" borderBottom> <u-radio-group :disabled="readonly" v-model="formData.transportation" style="margin: 16rpx;">
<u-radio-group :disabled="readonly" v-model="formData.transportation" style="margin: 16rpx;"> <u-radio :customStyle="{marginRight: '16px'}"
<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" :name="item.value">
:label="item.label" :name="item.value"> </u-radio>
</u-radio> </u-radio-group>
</u-radio-group> </u-form-item>
</u-form-item> <u-form-item labelWidth="auto" label="是否有扩大经营需求" required prop="expand_business_needs" borderBottom>
<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-group :disabled="readonly" v-model="formData.expand_business_needs" style="margin: 16rpx;"> <u-radio :customStyle="{marginRight: '16px'}"
<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" :name="item.value">
:label="item.label" :name="item.value"> </u-radio>
</u-radio> </u-radio-group>
</u-radio-group> </u-form-item>
</u-form-item> <u-form-item labelWidth="auto" labelPosition="top" label="需求描述" prop="demand" borderBottom>
<u-form-item labelWidth="auto" labelPosition="top" label="需求描述" prop="demand" borderBottom> <u--textarea :disabled="readonly" v-model="formData.demand" autoHeight placeholder="请输入需求描述" border="surround"
<u--textarea :disabled="readonly" v-model="formData.demand" autoHeight placeholder="请输入需求描述" count></u--textarea>
border="surround" count></u--textarea> </u-form-item>
</u-form-item> <u-form-item labelWidth="auto" labelPosition="top" label="政策补助" prop="policy_subsidies" borderBottom>
<u-form-item labelWidth="auto" labelPosition="top" label="政策补助" prop="policy_subsidies" borderBottom> <u--textarea :disabled="readonly" v-model="formData.policy_subsidies" autoHeight placeholder="请输入政策补助"
<u--textarea :disabled="readonly" v-model="formData.policy_subsidies" autoHeight border="surround" count></u--textarea>
placeholder="请输入政策补助" border="surround" count></u--textarea> </u-form-item>
</u-form-item> </u--form>
</u--form>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
props: { props: {
readonly: { readonly: {
type: Boolean, type: Boolean,
default: false default: false
}, },
datas: { datas: {
type: Object, type: Object,
default: null default: null
}, },
update_time: { update_time: {
type: String, type: String,
default: null default: null
} }
}, },
data() { data() {
return { return {
landPlanList: ['自己养', '出租', '代养', '租更多地扩大养殖'], landPlanList: ['自己养', '出租', '代养', '租更多地扩大养殖'],
formData: { formData: {
// "breeding_training": 1, // // "breeding_training": 1, //
// "breeding_company": 0, // // "breeding_company": 0, //
// "notes": "", // // "notes": "", //
// "breeding_type": 22, // // "breeding_type": 22, //
// "breeding_time": "2022-07-22", // // "breeding_time": "2022-07-22", //
// "mature_time": "2022-07-22", // // "mature_time": "2022-07-22", //
// "yield": 600, // // "yield": 600, //
// "estimated_income": 1500, // // "estimated_income": 1500, //
// "farm_tools": ",", //使 // "farm_tools": ",", //使
// "ecological_farming": 1, // // "ecological_farming": 1, //
// "modernization": 30, // // "modernization": 30, //
// "pre_price": "30.00", // // "pre_price": "30.00", //
// "method_sales": 1, // // "method_sales": 1, //
// "processing_storage": 0, // // "processing_storage": 0, //
// "promote": 0, //广 // "promote": 0, //广
// "transportation": 0, // // "transportation": 0, //
// "expand_business_needs": 0, // // "expand_business_needs": 0, //
// "demand": "", // // "demand": "", //
// "policy_subsidies": "" ,// // "policy_subsidies": "" ,//
"breeding_training": "", // "breeding_training": "", //
"breeding_company": "", // "breeding_company": "", //
"notes": "", // "notes": "", //
"breeding_type": "", // "breeding_type": "", //
"area": "", // "area": "", //
"breeding_time": "", // "breeding_time": "", //
"mature_time": "", // "mature_time": "", //
"yield": "", // "yield": "", //
"estimated_income": "", // "estimated_income": "", //
"farm_tools": "", //使 "farm_tools": "", //使
"ecological_farming": "", // "ecological_farming": "", //
"modernization": "", // "modernization": "", //
"pre_price": "", // "pre_price": "", //
"method_sales": "", // "method_sales": "", //
"processing_storage": "", // "processing_storage": "", //
"promote": "", //广 "promote": "", //广
"transportation": "", // "transportation": "", //
"expand_business_needs": "", // "expand_business_needs": "", //
"demand": "", // "demand": "", //
"policy_subsidies": "" // "policy_subsidies": "" //
}, },
rules: { rules: {
} }
} }
}, },
created() { created() {
this.initRules(); this.initRules();
if (this.$props.readonly && this.$props.datas) { if (this.$props.readonly && this.$props.datas) {
this.formData = this.$props.datas; this.formData = this.$props.datas;
let keys = Object.keys(this.formData); let keys = Object.keys(this.formData);
keys.forEach(item => { keys.forEach(item => {
if (!isNaN(this.formData[item])&&this.formData[item]!=''&&this.formData[item]!=null&&this.formData[item]!=undefined){ if (!isNaN(this.formData[item]) && this.formData[item] != '' && this.formData[item] != null && this
parseFloat(this.formData[item])!='NaN'?this.formData[item] = parseFloat(this.formData[item]):null; .formData[item] != undefined) {
} parseFloat(this.formData[item]) != 'NaN' ? this.formData[item] = parseFloat(this.formData[item]) : null;
}) }
} })
}, }
watch: { },
datas(newValue, oldValue) { watch: {
if (this.$props.readonly && newValue) { datas(newValue, oldValue) {
this.formData = this.$props.datas; if (this.$props.readonly && newValue) {
let keys = Object.keys(this.formData); this.formData = this.$props.datas;
keys.forEach(item => { let keys = Object.keys(this.formData);
if (!isNaN(this.formData[item])&&this.formData[item]!=''&&this.formData[item]!=null&&this.formData[item]!=undefined){ keys.forEach(item => {
parseFloat(this.formData[item])!='NaN'?this.formData[item] = parseFloat(this.formData[item]):null; 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); methods: {
let white = ['demand', 'policy_subsidies']; //
arr = arr.filter(item => { initRules() {
return !white.includes(item); let arr = Object.keys(this.formData);
}) let white = ['demand', 'policy_subsidies'];
arr.forEach(key => { arr = arr.filter(item => {
this.rules[key] = { return !white.includes(item);
validator: (rule, value, callback) => { })
this.$refs.breedingForm.clearValidate(rule.field); arr.forEach(key => {
value.trim() !== '' ? callback() : callback('不能为空'); this.rules[key] = {
}, validator: (rule, value, callback) => {
trigger: ['change', 'blur'] this.$refs.breedingForm.clearValidate(rule.field);
} value.trim() !== '' ? callback() : callback('不能为空');
}) },
}, trigger: ['change', 'blur']
// }
async validate() { })
return await this.$refs.breedingForm.validate(); },
}, //
// async validate() {
changeLanPlan(e) { return await this.$refs.breedingForm.validate();
let index = e.currentTarget.dataset.index; },
this.formData.planning = e.detail.value; //
}, changeLanPlan(e) {
// let index = e.currentTarget.dataset.index;
changeDate(e) { this.formData.planning = e.detail.value;
let data = e.currentTarget.dataset; },
this.formData[data.value] = e.detail.value; //
}, changeDate(e) {
}, let data = e.currentTarget.dataset;
} this.formData[data.value] = e.detail.value;
},
},
}
</script> </script>
<style lang="scss"> <style lang="scss">
.card { .card {
background-color: #fff; background-color: #fff;
margin: 28rpx; margin: 28rpx;
padding: 28rpx; padding: 28rpx;
margin-top: 0; margin-top: 0;
padding-top: 0; padding-top: 0;
border-radius: 0 0 14rpx 14rpx; border-radius: 0 0 14rpx 14rpx;
} }
.tit { .tit {
margin: 28rpx 28rpx 0 28rpx; margin: 28rpx 28rpx 0 28rpx;
padding: 28rpx 28rpx 0 28rpx; padding: 28rpx 28rpx 0 28rpx;
border-radius: 14rpx 14rpx 0 0; border-radius: 14rpx 14rpx 0 0;
background-color: $theme-oa-color; background-color: $theme-oa-color;
color: white; color: white;
height: 100rpx; height: 100rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
}
} .title {
font-weight: 500;
font-size: 34rpx;
.title { &::before {
font-weight: 500; width: 8rpx;
font-size: 34rpx; height: 26rpx;
border-radius: 4rpx;
background-color: #0122c7;
content: "";
display: inline-block;
margin-right: 8rpx;
}
}
&::before { .delete {
width: 8rpx; margin: 22rpx 0;
height: 26rpx; // margin-bottom: 40rpx;
border-radius: 4rpx; width: 100%;
background-color: #0122c7; height: 64rpx;
content: ""; line-height: 64rpx;
display: inline-block; background: #f56c6c;
margin-right: 8rpx; border-radius: 14rpx;
} font-size: 28rpx;
} color: #fff;
text-align: center;
}
.delete { .plus {
margin: 22rpx 0; margin: 22rpx 0;
// margin-bottom: 40rpx; // margin-bottom: 40rpx;
width: 100%; width: 100%;
height: 64rpx; height: 64rpx;
line-height: 64rpx; line-height: 64rpx;
background: #f56c6c; background: $theme-oa-color;
border-radius: 14rpx; border-radius: 14rpx;
font-size: 28rpx; font-size: 28rpx;
color: #fff; color: #fff;
text-align: center; 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> </style>

View File

@ -1,183 +1,202 @@
<!-- 深加工 --> <!-- 深加工 -->
<template> <template>
<view class="card"> <view>
<view class="title">深加工</view> <view class="tit">
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm"> <text v-if="readonly">更新时间: {{update_time}}</text>
<u-form-item labelWidth="auto" label="是否在经营" required prop="shop_front" borderBottom> <text>深加工</text>
<u-radio-group v-model="formData.shop_front" style="margin: 16rpx;"> </view>
<u-radio :customStyle="{marginRight: '16px'}" <view class="card">
v-for="(item, index) in [{value:1,label:'是'},{value:0,label:'否'}]" :key="index" :label="item.label" <u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
:name="item.value"> <u-form-item labelWidth="auto" label="是否在经营" required prop="is_manage" borderBottom>
</u-radio> <u-radio-group v-model="formData.is_manage" style="margin: 16rpx;">
</u-radio-group>
</u-form-item>
<block v-if="formData.shop_front">
<u-form-item labelWidth="auto" label="有无建设用地" required prop="shop_front" borderBottom>
<u-radio-group v-model="formData.shop_front" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}" <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"> :name="item.value">
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="面积" required prop="cultivated_area" borderBottom> <block v-if="formData.is_manage">
<u--input v-model="formData.cultivated_area" placeholder="请输入面积"></u--input> <u-form-item labelWidth="auto" label="有无建设用地" required prop="construction_land" borderBottom>
</u-form-item> <u-radio-group v-model="formData.construction_land" style="margin: 16rpx;">
<u-form-item labelWidth="auto" label="经营地点" required prop="cultivated_area" borderBottom> <u-radio :customStyle="{marginRight: '16px'}"
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input> v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
</u-form-item> :name="item.value">
<u-form-item labelWidth="auto" label="材料来源" required prop="notes" borderBottom> </u-radio>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input> </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-item labelWidth="auto" labelPosition="top" label="经营诉求" required prop="farm_tools" borderBottom>
<u--textarea v-model="formData.farm_tools" autoHeight placeholder="请输入经营诉求" border="surround"
count></u--textarea>
</u-form-item>
</block>
<block v-else>
<u-form-item labelWidth="auto" label="有无建设用地" required prop="shop_front" borderBottom>
<u-radio-group v-model="formData.shop_front" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<picker :range="storeTypeList" mode="selector" @change="changeLanPlan">
<u-form-item labelWidth="auto" label="经营类型" required prop="planning" borderBottom>
<u--input :value="storeTypeList[formData.planning]" placeholder="请选择经营类型" disabled
disabledColor="#fff"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
</picker> <u-form-item labelWidth="auto" label="面积(m²)" required prop="land_area" borderBottom>
<u-form-item labelWidth="auto" label="经营地点" required prop="cultivated_area" borderBottom> <u--input v-model="formData.land_area" type="number" placeholder="请输入面积(m²)"></u--input>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input> </u-form-item>
</u-form-item> <u-form-item labelWidth="auto" label="经营地点" required prop="manage_place" borderBottom>
<u-form-item labelWidth="auto" label="人数" required prop="cultivated_area" borderBottom> <u--input v-model="formData.manage_place" placeholder="请输入经营地点"></u--input>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input> </u-form-item>
</u-form-item> <u-form-item labelWidth="auto" label="材料来源" required prop="source_materials" borderBottom>
<u-form-item labelWidth="auto" label="有无食堂" required prop="planting_company" borderBottom> <u--input v-model="formData.source_materials" placeholder="请输入材料来源"></u--input>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> </u-form-item>
<u-radio :customStyle="{marginRight: '16px'}" <u-form-item labelWidth="auto" label="有无销售渠道" required prop="marketing_channel" borderBottom>
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label" <u-radio-group v-model="formData.marketing_channel" style="margin: 16rpx;">
:name="item.value"> <u-radio :customStyle="{marginRight: '16px'}"
</u-radio> v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
</u-radio-group> :name="item.value">
</u-form-item> </u-radio>
<u-form-item labelWidth="auto" label="材料来源" required prop="notes" borderBottom> </u-radio-group>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input> </u-form-item>
</u-form-item> <u-form-item labelWidth="auto" label="有无技术指导" required prop="technical_guidance" borderBottom>
<u-form-item labelWidth="auto" label="自动化办公程度" required prop="notes" borderBottom> <u-radio-group v-model="formData.technical_guidance" style="margin: 16rpx;">
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input> <u-radio :customStyle="{marginRight: '16px'}"
</u-form-item> v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
<u-form-item labelWidth="auto" label="有无用工需求" required prop="planting_company" borderBottom> :name="item.value">
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> </u-radio>
<u-radio :customStyle="{marginRight: '16px'}" </u-radio-group>
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label" </u-form-item>
:name="item.value"> <u-form-item labelWidth="auto" label="有无品牌" required prop="brand" borderBottom>
</u-radio> <u-radio-group v-model="formData.brand" style="margin: 16rpx;">
</u-radio-group> <u-radio :customStyle="{marginRight: '16px'}"
</u-form-item> v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
<u-form-item labelWidth="auto" label="有无品牌" required prop="planting_company" borderBottom> :name="item.value">
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> </u-radio>
<u-radio :customStyle="{marginRight: '16px'}" </u-radio-group>
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label" </u-form-item>
:name="item.value"> <u-form-item labelWidth="auto" label="有无宣传推广" required prop="advertising" borderBottom>
</u-radio> <u-radio-group v-model="formData.advertising" style="margin: 16rpx;">
</u-radio-group> <u-radio :customStyle="{marginRight: '16px'}"
</u-form-item> v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
<u-form-item labelWidth="auto" label="有无宣传推广" required prop="planting_company" borderBottom> :name="item.value">
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> </u-radio>
<u-radio :customStyle="{marginRight: '16px'}" </u-radio-group>
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label" </u-form-item>
:name="item.value"> <u-form-item labelWidth="auto" label="有无运输" required prop="transport" borderBottom>
</u-radio> <u-radio-group v-model="formData.transport" style="margin: 16rpx;">
</u-radio-group> <u-radio :customStyle="{marginRight: '16px'}"
</u-form-item> v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
<u-form-item labelWidth="auto" label="库存情况" required prop="notes" borderBottom> :name="item.value">
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input> </u-radio>
</u-form-item> </u-radio-group>
<u-form-item labelWidth="auto" label="有无运输" required prop="planting_company" borderBottom> </u-form-item>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> <u-form-item labelWidth="auto" labelPosition="top" label="经营诉求" prop="business_appeal" borderBottom>
<u-radio :customStyle="{marginRight: '16px'}" <u--textarea v-model="formData.business_appeal" autoHeight placeholder="请输入经营诉求" border="surround"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label" count></u--textarea>
:name="item.value"> </u-form-item>
</u-radio> </block>
</u-radio-group> <block v-else>
</u-form-item> <u-form-item labelWidth="auto" label="有无建设用地" required prop="construction_land" borderBottom>
<u-form-item labelWidth="auto" labelPosition="top" label="经营诉求" required prop="farm_tools" borderBottom> <u-radio-group v-model="formData.construction_land" style="margin: 16rpx;">
<u--textarea v-model="formData.farm_tools" autoHeight placeholder="请输入经营诉求" border="surround" <u-radio :customStyle="{marginRight: '16px'}"
count></u--textarea> v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
</u-form-item> :name="item.value">
</block> </u-radio>
</u--form> </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> </view>
</template> </template>
<script> <script>
export default { export default {
props:{ props: {
readonly: { readonly: {
type: Boolean, type: Boolean,
default: false default: false
}, },
datas:{ datas: {
type: Object, type: Object,
default: null default: null
} },
update_time: {
type: String,
default: null
},
}, },
data() { data() {
return { return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'], storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: { formData: {
shop_front: '', // is_manage: "", //
manage: '', construction_land: "", //
// construction_land land_area: "", //
// type manage_place: "", //
// area source_materials: "", //
// count marketing_channel: "", //
// canteen technical_guidance: "", //
brand: "", //
advertising: "", //广
transport: "", //
business_appeal: "", //
manage_type: "", //
people_count: "", //
canteen: "", //
automation: "", //
employment: "", //
repertory: "", //
}, },
rules: { rules: {
@ -185,12 +204,37 @@
} }
}, },
created() { 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: { methods: {
// //
initRules() { initRules() {
let arr = Object.keys(this.formData); let arr = Object.keys(this.formData);
arr = arr.filter(item=>{
return item!="business_appeal"
})
arr.forEach(key => { arr.forEach(key => {
this.rules[key] = { this.rules[key] = {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
@ -205,43 +249,55 @@
async validate() { async validate() {
return await this.$refs.breedingForm.validate();; return await this.$refs.breedingForm.validate();;
}, },
// //
changeLanPlan(e) { changeLanPlan(e) {
let index = e.currentTarget.dataset.index; let index = e.currentTarget.dataset.index;
this.formData.planning = e.detail.value; this.formData.manage_type = e.detail.value;
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
},
//
pushBreedingList() {
this.formData.push({})
},
//
removeBreedingList(index) {
uni.showModal({
confirmColor: '#f56c6c',
content: '确定删除吗?',
success: (res) => {
if (res.confirm) {
this.formData.splice(index, 1);
}
}
})
}, },
}, },
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.card{ .card {
background-color: #fff; background-color: #fff;
margin: 28rpx; margin: 28rpx;
padding: 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 { .title {
font-weight: 500; font-weight: 500;
font-size: 34rpx; font-size: 34rpx;

View File

@ -1,143 +1,177 @@
<template> <template>
<view class="card"> <view>
<view class="title">装房</view> <view class="tit">
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm"> <text v-if="readonly">更新时间: {{update_time}}</text>
<u-form-item labelWidth="auto" label="房屋面积" required prop="cultivated_area" borderBottom> <text>装房</text>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面面积"></u--input> </view>
</u-form-item> <view class="card">
<u-form-item labelWidth="auto" label="装修风格" required prop="cultivated_area" borderBottom> <u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input> <u-form-item labelWidth="auto" label="房屋面积(m²)" required prop="house_area" borderBottom>
</u-form-item> <u--input :readonly="readonly" type="number" v-model="formData.house_area" placeholder="请输入房屋面积(m²)"></u--input>
<u-form-item labelWidth="auto" label="装修地点" required prop="notes" borderBottom> </u-form-item>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input> <u-form-item labelWidth="auto" label="装修风格" required prop="decoration_style" borderBottom>
</u-form-item> <u--input :readonly="readonly" v-model="formData.decoration_style" placeholder="请输入装修风格"></u--input>
<u-form-item labelWidth="auto" label="装修预算" required prop="notes" borderBottom> </u-form-item>
<u--input v-model="formData.cultivated_area" placeholder="请输入服务对象"></u--input> <u-form-item labelWidth="auto" label="装修地点" required prop="decoration_site" borderBottom>
</u-form-item> <u--input :readonly="readonly" v-model="formData.decoration_site" placeholder="请输入装修地点"></u--input>
<u-form-item labelWidth="auto" label="装修类型" required prop="planting_company" borderBottom> </u-form-item>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> <u-form-item labelWidth="auto" label="装修预算" required prop="budget" borderBottom>
<u-radio :customStyle="{marginRight: '16px'}" <u--input :readonly="readonly" v-model="formData.budget" placeholder="请输入装修预算"></u--input>
v-for="(item, index) in [{value:1,label:'私人'},{value:0,label:'公共建设'}]" :key="index" :label="item.label" </u-form-item>
:name="item.value"> <u-form-item labelWidth="auto" label="装修类型" required prop="decoration_type" borderBottom>
</u-radio> <u-radio-group :disabled="readonly" v-model="formData.decoration_type" style="margin: 16rpx;">
</u-radio-group> <u-radio :customStyle="{marginRight: '16px'}"
</u-form-item> v-for="(item, index) in [{value:1,label:'私人'},{value:0,label:'公共建设'}]" :key="index" :label="item.label"
:name="item.value">
</u-form-item> </u-radio>
</u--form> </u-radio-group>
</u-form-item>
</view>
</template> </u-form-item>
</u--form>
<script>
export default { </view>
data() { </view>
return { </template>
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: { <script>
shop_front: '', // export default {
}, props: {
rules: { readonly: {
type: Boolean,
} default: false
} },
}, datas: {
created() { type: Object,
this.initRules() default: null
}, },
methods: { update_time: {
// type: String,
initRules() { default: null
let arr = Object.keys(this.formData); }
arr.forEach(key => { },
this.rules[key] = { data() {
validator: (rule, value, callback) => { return {
this.$refs.breedingForm.clearValidate(rule.field); formData: {
value.trim() !== '' ? callback() : callback('不能为空'); house_area: '',
}, decoration_style: '',
trigger: ['change', 'blur'] decoration_site: '',
} budget: '',
}) decoration_type: ''
}, },
// rules: {
async validate() {
return await this.$refs.breedingForm.validate();; }
}, }
// },
changeLanPlan(e) { created() {
let index = e.currentTarget.dataset.index; this.initRules();
this.formData.planning = e.detail.value; if (this.$props.readonly && this.$props.datas) {
}, this.formData = this.$props.datas;
// let keys = Object.keys(this.formData);
changeDate(e) { keys.forEach(item => {
let data = e.currentTarget.dataset; if (!isNaN(this.formData[item]) && this.formData[item] != '' && this.formData[item] != null && this
this.formData[data.value] = e.detail.value; .formData[item] != undefined) {
}, parseFloat(this.formData[item]) != 'NaN' ? this.formData[item] = parseFloat(this.formData[item]) : null;
// }
pushBreedingList() { })
this.formData.push({}) }
}, },
// watch: {
removeBreedingList(index) { datas(newValue, oldValue) {
uni.showModal({ if (this.$props.readonly && newValue) {
confirmColor: '#f56c6c', this.formData = this.$props.datas;
content: '确定删除吗?', let keys = Object.keys(this.formData);
success: (res) => { keys.forEach(item => {
if (res.confirm) { if (!isNaN(this.formData[item]) && this.formData[item] != '' && this.formData[item] != null && this
this.formData.splice(index, 1); .formData[item] != undefined) {
} parseFloat(this.formData[item]) != 'NaN' ? this.formData[item] = parseFloat(this.formData[item]) :
} null;
}) }
}, })
}, }
} }
</script> },
methods: {
<style lang="scss"> //
.card{ initRules() {
background-color: #fff; let arr = Object.keys(this.formData);
margin: 28rpx; arr.forEach(key => {
padding: 28rpx; this.rules[key] = {
border-radius: 14rpx; validator: (rule, value, callback) => {
} this.$refs.breedingForm.clearValidate(rule.field);
.title { value.trim() !== '' ? callback() : callback('不能为空');
font-weight: 500; },
font-size: 34rpx; trigger: ['change', 'blur']
}
&::before { })
width: 8rpx; },
height: 26rpx; //
border-radius: 4rpx; async validate() {
background-color: #0122c7; return await this.$refs.breedingForm.validate();;
content: ""; },
display: inline-block; },
margin-right: 8rpx; }
} </script>
}
<style lang="scss">
.delete { .card {
margin: 22rpx 0; background-color: #fff;
// margin-bottom: 40rpx; margin: 28rpx;
width: 100%; padding: 28rpx;
height: 64rpx; margin-top: 0;
line-height: 64rpx; padding-top: 0;
background: #f56c6c; border-radius: 0 0 14rpx 14rpx;
border-radius: 14rpx; }
font-size: 28rpx;
color: #fff; .tit {
text-align: center; margin: 28rpx 28rpx 0 28rpx;
} padding: 28rpx 28rpx 0 28rpx;
border-radius: 14rpx 14rpx 0 0;
.plus { background-color: $theme-oa-color;
margin: 22rpx 0; color: white;
// margin-bottom: 40rpx; height: 100rpx;
width: 100%; display: flex;
height: 64rpx; justify-content: space-between;
line-height: 64rpx; }
background: $theme-oa-color; .title {
border-radius: 14rpx; font-weight: 500;
font-size: 28rpx; font-size: 34rpx;
color: #fff;
text-align: center; &::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> </style>

View File

@ -1,133 +1,164 @@
<template> <template>
<view class="card"> <view>
<view class="title">翻新</view> <view class="tit">
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm"> <text v-if="readonly">更新时间: {{update_time}}</text>
<u-form-item labelWidth="auto" labelPosition="top" label="维护内容" required prop="policy_subsidies" borderBottom> <text>翻新房屋</text>
<u--textarea v-model="formData.policy_subsidies" autoHeight placeholder="请输入维护内容" border="surround" </view>
count></u--textarea> <view class="card">
</u-form-item> <u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
<u-form-item labelWidth="auto" label="维护类型" required prop="planting_company" borderBottom> <u-form-item labelWidth="auto" labelPosition="top" label="维护内容" required prop="maintenance_contents" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> <u--textarea :readonly="readonly" v-model="formData.maintenance_contents" autoHeight placeholder="请输入维护内容" border="surround"
<u-radio :customStyle="{marginRight: '16px'}" count></u--textarea>
v-for="(item, index) in [{value:1,label:'换'},{value:0,label:'修'}]" :key="index" :label="item.label" </u-form-item>
:name="item.value"> <u-form-item labelWidth="auto" label="维护类型" required prop="maintenance_type" borderBottom>
</u-radio> <u-radio-group :disabled="readonly" v-model="formData.maintenance_type" style="margin: 16rpx;">
</u-radio-group> <u-radio :customStyle="{marginRight: '16px'}"
</u-form-item> v-for="(item, index) in [{value:1,label:'换'},{value:0,label:'修'}]" :key="index" :label="item.label"
</u--form> :name="item.value">
</u-radio>
</view> </u-radio-group>
</template> </u-form-item>
</u--form>
<script>
export default { </view>
data() { </view>
return { </template>
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: { <script>
shop_front: '', // export default {
}, props: {
rules: { readonly: {
type: Boolean,
} default: false
} },
}, datas: {
created() { type: Object,
this.initRules() default: null
}, },
methods: { update_time: {
// type: String,
initRules() { default: null
let arr = Object.keys(this.formData); }
arr.forEach(key => { },
this.rules[key] = { data() {
validator: (rule, value, callback) => { return {
this.$refs.breedingForm.clearValidate(rule.field); formData: {
value.trim() !== '' ? callback() : callback('不能为空'); maintenance_contents: '',
}, maintenance_type: ''
trigger: ['change', 'blur'] },
} rules: {
})
}, }
// }
async validate() { },
return await this.$refs.breedingForm.validate();; created() {
}, this.initRules();
// if (this.$props.readonly && this.$props.datas) {
changeLanPlan(e) { this.formData = this.$props.datas;
let index = e.currentTarget.dataset.index; let keys = Object.keys(this.formData);
this.formData.planning = e.detail.value; keys.forEach(item => {
}, if (!isNaN(this.formData[item]) && this.formData[item] != '' && this.formData[item] != null && this
// .formData[item] != undefined) {
changeDate(e) { parseFloat(this.formData[item]) != 'NaN' ? this.formData[item] = parseFloat(this.formData[item]) : null;
let data = e.currentTarget.dataset; }
this.formData[data.value] = e.detail.value; })
}, }
// },
pushBreedingList() { watch: {
this.formData.push({}) datas(newValue, oldValue) {
}, if (this.$props.readonly && newValue) {
// this.formData = this.$props.datas;
removeBreedingList(index) { let keys = Object.keys(this.formData);
uni.showModal({ keys.forEach(item => {
confirmColor: '#f56c6c', if (!isNaN(this.formData[item]) && this.formData[item] != '' && this.formData[item] != null && this
content: '确定删除吗?', .formData[item] != undefined) {
success: (res) => { parseFloat(this.formData[item]) != 'NaN' ? this.formData[item] = parseFloat(this.formData[item]) :
if (res.confirm) { null;
this.formData.splice(index, 1); }
} })
} }
}) }
}, },
}, methods: {
} //
</script> initRules() {
let arr = Object.keys(this.formData);
<style lang="scss"> arr.forEach(key => {
.card{ this.rules[key] = {
background-color: #fff; validator: (rule, value, callback) => {
margin: 28rpx; this.$refs.breedingForm.clearValidate(rule.field);
padding: 28rpx; value.trim() !== '' ? callback() : callback('不能为空');
border-radius: 14rpx; },
} trigger: ['change', 'blur']
.title { }
font-weight: 500; })
font-size: 34rpx; },
//
&::before { async validate() {
width: 8rpx; return await this.$refs.breedingForm.validate();;
height: 26rpx; },
border-radius: 4rpx; },
background-color: #0122c7; }
content: ""; </script>
display: inline-block;
margin-right: 8rpx; <style lang="scss">
} .card {
} background-color: #fff;
margin: 28rpx;
.delete { padding: 28rpx;
margin: 22rpx 0; margin-top: 0;
// margin-bottom: 40rpx; padding-top: 0;
width: 100%; border-radius: 0 0 14rpx 14rpx;
height: 64rpx; }
line-height: 64rpx;
background: #f56c6c; .tit {
border-radius: 14rpx; margin: 28rpx 28rpx 0 28rpx;
font-size: 28rpx; padding: 28rpx 28rpx 0 28rpx;
color: #fff; border-radius: 14rpx 14rpx 0 0;
text-align: center; background-color: $theme-oa-color;
} color: white;
height: 100rpx;
.plus { display: flex;
margin: 22rpx 0; justify-content: space-between;
// margin-bottom: 40rpx; }
width: 100%; .title {
height: 64rpx; font-weight: 500;
line-height: 64rpx; font-size: 34rpx;
background: $theme-oa-color;
border-radius: 14rpx; &::before {
font-size: 28rpx; width: 8rpx;
color: #fff; height: 26rpx;
text-align: center; 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> </style>

View File

@ -1,66 +1,103 @@
<template> <template>
<view class="card"> <view>
<view class="title">修房</view> <view class="tit">
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm"> <text v-if="readonly">更新时间: {{update_time}}</text>
<u-form-item labelWidth="auto" label="修房类型" required prop="shop_front" borderBottom> <text>修房</text>
<u-radio-group v-model="formData.shop_front" style="margin: 16rpx;"> </view>
<u-radio :customStyle="{marginRight: '16px'}" <view class="card">
v-for="(item, index) in [{value:1,label:'自建'},{value:0,label:'外包'}]" :key="index" :label="item.label" <u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
:name="item.value"> <u-form-item labelWidth="auto" label="修房类型" required prop="construction_type" borderBottom>
</u-radio> <u-radio-group :disabled="readonly" v-model="formData.construction_type" style="margin: 16rpx;">
</u-radio-group> <u-radio :customStyle="{marginRight: '16px'}"
</u-form-item> v-for="(item, index) in [{value:1,label:'自建'},{value:0,label:'外包'}]" :key="index" :label="item.label"
<u-form-item labelWidth="auto" label="建设面积" required prop="cultivated_area" borderBottom> :name="item.value">
<u--input v-model="formData.cultivated_area" placeholder="请输入门面面积"></u--input> </u-radio>
</u-form-item> </u-radio-group>
<u-form-item labelWidth="auto" label="房屋风格" required prop="cultivated_area" borderBottom> </u-form-item>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input> <u-form-item labelWidth="auto" label="建设面积(m²)" required prop="construction_area" borderBottom>
</u-form-item> <u--input :readonly="readonly" type="number" v-model="formData.construction_area" placeholder="请输入建设面积(m²)"></u--input>
<u-form-item labelWidth="auto" label="修建地址" required prop="notes" borderBottom> </u-form-item>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input> <u-form-item labelWidth="auto" label="房屋风格" required prop="house_style" borderBottom>
</u-form-item> <u--input :readonly="readonly" v-model="formData.house_style" placeholder="请输入房屋风格"></u--input>
<u-form-item labelWidth="auto" label="预算" required prop="notes" borderBottom> </u-form-item>
<u--input v-model="formData.cultivated_area" placeholder="请输入服务对象"></u--input> <u-form-item labelWidth="auto" label="修建地址" required prop="construction_site" borderBottom>
</u-form-item> <u--input :readonly="readonly" v-model="formData.construction_site" placeholder="请输入修建地址"></u--input>
<u-form-item labelWidth="auto" label="有无绿化" required prop="planting_company" borderBottom> </u-form-item>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> <u-form-item labelWidth="auto" label="预算" required prop="budget" borderBottom>
<u-radio :customStyle="{marginRight: '16px'}" <u--input :readonly="readonly" v-model="formData.budget" placeholder="请输入预算"></u--input>
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label" </u-form-item>
:name="item.value"> <u-form-item labelWidth="auto" label="有无绿化" required prop="afforest" borderBottom>
</u-radio> <u-radio-group :disabled="readonly" v-model="formData.afforest" style="margin: 16rpx;">
</u-radio-group> <u-radio :customStyle="{marginRight: '16px'}"
</u-form-item> v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
<u-form-item labelWidth="auto" label="有无装修" required prop="planting_company" borderBottom> :name="item.value">
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> </u-radio>
<u-radio :customStyle="{marginRight: '16px'}" </u-radio-group>
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label" </u-form-item>
:name="item.value"> <u-form-item labelWidth="auto" label="有无装修" required prop="fitment" borderBottom>
</u-radio> <u-radio-group :disabled="readonly" v-model="formData.fitment" style="margin: 16rpx;">
</u-radio-group> <u-radio :customStyle="{marginRight: '16px'}"
</u-form-item> v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
<u-form-item labelWidth="auto" label="房屋类型" required prop="planting_company" borderBottom> :name="item.value">
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> </u-radio>
<u-radio :customStyle="{marginRight: '16px'}" </u-radio-group>
v-for="(item, index) in [{value:1,label:'私人'},{value:0,label:'公共建设'}]" :key="index" :label="item.label" </u-form-item>
:name="item.value"> <u-form-item labelWidth="auto" label="房屋类型" required prop="house_type" borderBottom>
</u-radio> <u-radio-group :disabled="readonly" v-model="formData.house_type" style="margin: 16rpx;">
</u-radio-group> <u-radio :customStyle="{marginRight: '16px'}"
</u-form-item> v-for="(item, index) in [{value:1,label:'私人'},{value:0,label:'公共建设'}]" :key="index" :label="item.label"
<u-form-item labelWidth="auto" label="修建地照片" required prop="planting_company" borderBottom> :name="item.value">
</u-radio>
</u-form-item> </u-radio-group>
</u--form> </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> </view>
</template> </template>
<script> <script>
import {
upLoadImage
} from "@/api/file.js"
export default { export default {
props: {
readonly: {
type: Boolean,
default: false
},
datas: {
type: Object,
default: null
},
update_time: {
type: String,
default: null
}
},
data() { data() {
return { return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: { formData: {
shop_front: '', // construction_type: '',
construction_area: '',
house_style: '',
construction_site: '',
budget: '',
afforest: '',
fitment: '',
house_type: '',
construction_site_img: ''
}, },
rules: { rules: {
@ -68,7 +105,32 @@
} }
}, },
created() { 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: { methods: {
// //
@ -88,42 +150,38 @@
async validate() { async validate() {
return await this.$refs.breedingForm.validate();; return await this.$refs.breedingForm.validate();;
}, },
// //
changeLanPlan(e) { afterReadAvatar(event) {
let index = e.currentTarget.dataset.index; upLoadImage({
this.formData.planning = e.detail.value; filePath: event.file.url,
}, name: 'file'
// }).then(res => {
changeDate(e) { this.formData.construction_site_img = res.data.uri
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> </script>
<style lang="scss"> <style lang="scss">
.card{ .card {
background-color: #fff; background-color: #fff;
margin: 28rpx; margin: 28rpx;
padding: 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 { .title {
font-weight: 500; font-weight: 500;
@ -165,4 +223,24 @@
color: #fff; color: #fff;
text-align: center; 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> </style>

View File

@ -1,57 +1,84 @@
<template> <template>
<view class="card"> <view>
<view class="title">买卖房</view> <view class="tit">
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm"> <text v-if="readonly">更新时间: {{update_time}}</text>
<u-form-item labelWidth="auto" label="地点" required prop="cultivated_area" borderBottom> <text>买卖房</text>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面面积"></u--input> </view>
</u-form-item> <view class="card">
<u-form-item labelWidth="auto" label="房型" required prop="cultivated_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input> <!-- <view class="title">买卖房</view> -->
</u-form-item> <u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
<u-form-item labelWidth="auto" label="几房" required prop="notes" borderBottom> <u-form-item labelWidth="auto" label="地点" required prop="place" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input> <u--input :readonly="readonly" v-model="formData.place" placeholder="请输入房屋地点"></u--input>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="面积" required prop="notes" borderBottom> <u-form-item labelWidth="auto" label="房型" required prop="house_type" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入服务对象"></u--input> <u--input :readonly="readonly" v-model="formData.house_type" placeholder="请输入房型"></u--input>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="朝向" required prop="notes" borderBottom> <u-form-item labelWidth="auto" label="几房" required prop="rooms" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入服务对象"></u--input> <u--input :readonly="readonly" v-model="formData.rooms" placeholder="请输入几房"></u--input>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="楼层" required prop="notes" borderBottom> <u-form-item labelWidth="auto" label="面积(m²)" required prop="house_area" borderBottom>
<u--input v-model="formData.cultivated_area" placeholder="请输入服务对象"></u--input> <u--input :readonly="readonly" v-model="formData.house_area" type="number" placeholder="请输入房屋面积(m²)"></u--input>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="装修类型" required prop="planting_company" borderBottom> <u-form-item labelWidth="auto" label="朝向" required prop="orientation" borderBottom>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> <u--input :readonly="readonly" v-model="formData.orientation" placeholder="请输入房屋朝向"></u--input>
<u-radio :customStyle="{marginRight: '16px'}" </u-form-item>
v-for="(item, index) in [{value:1,label:'精装'},{value:0,label:'清水'}]" :key="index" :label="item.label" <u-form-item labelWidth="auto" label="楼层" required prop="floor" borderBottom>
:name="item.value"> <u--input :readonly="readonly" v-model="formData.floor" type="number" placeholder="请输入楼层"></u--input>
</u-radio> </u-form-item>
</u-radio-group> <u-form-item labelWidth="auto" label="装修类型" required prop="fitment" borderBottom>
</u-form-item> <u-radio-group :disabled="readonly" v-model="formData.fitment" style="margin: 16rpx;">
<u-form-item labelWidth="auto" label="预算" required prop="notes" borderBottom> <u-radio :customStyle="{marginRight: '16px'}"
<u--input v-model="formData.cultivated_area" placeholder="请输入服务对象"></u--input> v-for="(item, index) in [{value:1,label:'精装'},{value:0,label:'清水'}]" :key="index" :label="item.label"
</u-form-item> :name="item.value">
<u-form-item labelWidth="auto" label="付款类型" required prop="planting_company" borderBottom> </u-radio>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> </u-radio-group>
<u-radio :customStyle="{marginRight: '16px'}" </u-form-item>
v-for="(item, index) in [{value:1,label:'按揭'},{value:0,label:'全款'}]" :key="index" :label="item.label" <u-form-item labelWidth="auto" label="预算" required prop="budget" borderBottom>
:name="item.value"> <u--input :readonly="readonly" v-model="formData.budget" placeholder="请输入预算"></u--input>
</u-radio> </u-form-item>
</u-radio-group> <u-form-item labelWidth="auto" label="付款类型" required prop="payment_type" borderBottom>
</u-form-item> <u-radio-group :disabled="readonly" v-model="formData.payment_type" style="margin: 16rpx;">
</u-form-item> <u-radio :customStyle="{marginRight: '16px'}"
</u--form> v-for="(item, index) in [{value: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> </view>
</template> </template>
<script> <script>
export default { export default {
props: {
readonly: {
type: Boolean,
default: false
},
datas: {
type: Object,
default: null
},
update_time: {
type: String,
default: null
}
},
data() { data() {
return { return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: { formData: {
shop_front: '', // place: "",
house_type: "",
rooms: "",
house_area: "",
orientation:"",
floor: "",
fitment: "",
budget: "",
payment_type: ""
}, },
rules: { rules: {
@ -59,7 +86,32 @@
} }
}, },
created() { 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: { methods: {
// //
@ -79,42 +131,29 @@
async validate() { async validate() {
return await this.$refs.breedingForm.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> </script>
<style lang="scss"> <style lang="scss">
.card{ .card {
background-color: #fff; background-color: #fff;
margin: 28rpx; margin: 28rpx;
padding: 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 { .title {
font-weight: 500; font-weight: 500;

View File

@ -17,7 +17,7 @@
</u-form-item> </u-form-item>
<picker :range="landPlanList" :disabled="readonly" mode="selector" @change="changeLanPlan"> <picker :range="landPlanList" :disabled="readonly" mode="selector" @change="changeLanPlan">
<u-form-item labelWidth="auto" label="土地规划" required prop="planning" borderBottom> <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> disabledColor="#fff"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
@ -50,14 +50,14 @@
</u-form-item> </u-form-item>
<picker mode="date" @change="changeDate" :disabled="readonly" :data-value="'breeding_time'"> <picker mode="date" @change="changeDate" :disabled="readonly" :data-value="'breeding_time'">
<u-form-item labelWidth="auto" label="种植开始时间" required prop="breeding_time" borderBottom> <u-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> disabledColor="#fff"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
</picker> </picker>
<picker mode="date" @change="changeDate" :disabled="readonly" :data-value="'mature_time'"> <picker mode="date" @change="changeDate" :disabled="readonly" :data-value="'mature_time'">
<u-form-item labelWidth="auto" label="上市时间" required prop="mature_time" borderBottom> <u-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> disabledColor="#fff"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
@ -68,9 +68,9 @@
<u-form-item labelWidth="auto" label="预计收益(元)" required prop="estimated_income" borderBottom> <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--input :readonly="readonly" v-model="formData.estimated_income" placeholder="请输入预计收益(元)" type="number"></u--input>
</u-form-item> </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> 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> border="surround" count></u--textarea>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="是否生态种植" required prop="ecological_farming" borderBottom> <u-form-item labelWidth="auto" label="是否生态种植" required prop="ecological_farming" borderBottom>

View File

@ -1,318 +1,331 @@
<!-- 常住人口 --> <!-- 常住人口 -->
<template> <template>
<view class="card"> <view class="card">
<view class="title">常住人口</view> <view class="title">常住人口</view>
<u--form labelPosition="left" :model="residents" :rules="rules" ref="residentsForm"> <u--form labelPosition="left" :model="residents" :rules="rules" ref="residentsForm">
<block value="人口"> <block value="人口">
<block value="人员信息" v-for="(item, family_index) in residents.family" :key="'user'+family_index"> <block value="人员信息" v-for="(item, family_index) in residents.family" :key="'user'+family_index">
<u-form-item label="姓名" required prop="family.name" borderBottom> <u-form-item label="姓名" required prop="family.name" borderBottom>
<u--input v-model="item.name" :readonly="readonly" placeholder="请输入姓名"></u--input> <u--input v-model="item.name" :readonly="readonly" placeholder="请输入姓名"></u--input>
</u-form-item> </u-form-item>
<picker mode="date" value="1990-01-01" @change="changebirth_time" :disabled="readonly" :data-index="index"> <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-form-item labelWidth="auto" label="出生日期" required prop="family.birth_time" borderBottom>
<u--input :value="item.birth_time" placeholder="请选择出生日期" readonly></u--input> <u--input :value="item.birth_time" style="pointer-events: none;" placeholder="请选择出生日期" readonly></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
</picker> </picker>
<picker mode="selector" :range="situationList" @change="changesituation" :disabled="readonly" :data-index="index"> <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-form-item labelWidth="auto" label="就业情况" required prop="family.situation" borderBottom>
<u--input :value="situationList[item.situation]" placeholder="请选择就业情况" readonly></u--input> <u--input :value="situationList[item.situation]" style="pointer-events: none;" placeholder="请选择就业情况" readonly></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
</picker> </picker>
<u-form-item labelWidth="auto" label="技能特长" required prop="family" borderBottom> <u-form-item labelWidth="auto" label="技能特长" required prop="family" borderBottom>
<u--input v-model="item.skills" :readonly="readonly" placeholder="请输入技能特长"></u--input> <u--input v-model="item.skills" :readonly="readonly" placeholder="请输入技能特长"></u--input>
</u-form-item> </u-form-item>
<button v-if="!readonly" class="delete" <button v-if="!readonly" class="delete"
@click="removeFamily(index)">删除以上信息</button> @click="removeFamily(family_index)">删除以上信息</button>
</block> </block>
<button v-if="!readonly" class="plus" @click="pushFamily">添加常住人口</button> <button v-if="!readonly" class="plus" @click="pushFamily">添加常住人口</button>
</block> </block>
<block value="婴幼儿信息"> <block value="婴幼儿信息">
<u-form-item labelWidth="auto" label="是否存在学生、婴幼儿" required prop="child" borderBottom> <u-form-item labelWidth="auto" label="是否存在学生、婴幼儿" required prop="child" borderBottom>
<u-radio-group v-model="residents.child" :disabled="readonly" style="margin: 16rpx;"> <u-radio-group v-model="residents.child" :disabled="readonly" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}" <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"> :name="item.value">
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </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"> <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-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--input v-model="item.age" :readonly="readonly" placeholder="请输入年龄" type="number" maxlength="2"></u--input>
</u-form-item> </u-form-item>
<block v-if="item.age<4"> <block v-if="item.age<4">
<u-form-item labelWidth="auto" label="喂养方式" borderBottom> <u-form-item labelWidth="auto" label="喂养方式" borderBottom>
<u-radio-group v-model="item.feeding" :disabled="readonly" style="margin: 16rpx;"> <u-radio-group v-model="item.feeding" :disabled="readonly" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}" <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"> :name="item.value">
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
</block> </block>
<block v-else> <block v-else>
<u-form-item label="年级" borderBottom> <u-form-item label="年级" borderBottom>
<u--input v-model="item.grade" :readonly="readonly" placeholder="请输入年级"></u--input> <u--input v-model="item.grade" :readonly="readonly" placeholder="请输入年级"></u--input>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="是否补课" borderBottom> <u-form-item labelWidth="auto" label="是否补课" borderBottom>
<u-radio-group v-model="item.is_lesson" style="margin: 16rpx;" :disabled="readonly"> <u-radio-group v-model="item.is_lesson" style="margin: 16rpx;" :disabled="readonly">
<u-radio :customStyle="{marginRight: '16px'}" <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"> :name="item.value">
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
<u-form-item v-if="item.is_lesson>0" label-width="auto" labelPosition="top" label="补课内容" borderBottom> <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" <u--textarea v-model="item.lessons" :disabled="readonly" autoHeight placeholder="请输入需要的课程" border="surround"
count></u--textarea> count></u--textarea>
</u-form-item> </u-form-item>
</block> </block>
<u-form-item label-width="auto" labelPosition="top" label="备注" borderBottom> <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--textarea v-model="item.notes" autoHeight :disabled="readonly"placeholder="请输入备注" border="surround" count></u--textarea>
</u-form-item> </u-form-item>
<button v-if="residents.child_arr.length>1&&!readonly" class="delete" <button v-if="residents.child_arr.length>1&&!readonly" class="delete"
@click="removeChildArr(index)">删除以上信息</button> @click="removeChildArr(child_arr_index)">删除以上信息</button>
</block> </block>
<button v-if="residents.child>0&&!readonly" class="plus" @click="pushChildArr">添加学生婴幼儿</button> <button v-if="residents.child>0&&!readonly" class="plus" @click="pushChildArr">添加学生婴幼儿</button>
</block> </block>
</u--form> </u--form>
</view> </view>
</template> </template>
<script> <script>
import { Toast } from "../../libs/uniApi" import { Toast } from "../../libs/uniApi"
export default { export default {
props:{ props:{
readonly: { readonly: {
type: Boolean, type: Boolean,
default: false default: false
}, },
datas: { datas: {
type: Object, type: Object,
default: null default: null
} }
}, },
data() { data() {
return { return {
situationList: [ "做工地的","厂里打工","公司职员","政府上班","种地","在家赋闲","其他"], situationList: [ "做工地的","厂里打工","公司职员","政府上班","种地","在家赋闲","其他"],
// //
residents: { residents: {
family: [ family: [
// { // {
// name: '', // name: '',
// birth_time: '', // birth_time: '',
// situation: '', // // situation: '', //
// skills: '', // // skills: '', //
// } // }
], ],
child: '', // child: '', //
child_arr: [ // child_arr: [ //
{ {
age: '', age: '',
feeding: '', // feeding: '', //
grade: '', // grade: '', //
is_lesson: '', // is_lesson: '', //
lessons: '', // lessons: '', //
notes: '' // notes: '' //
} }
], ],
// family: [{ // family: [{
// name: '', // name: '',
// birth_time: '1988-08-08', // birth_time: '1988-08-08',
// situation: 1, // // situation: 1, //
// skills: '', // // skills: '', //
// }], // }],
// child: 1, // // child: 1, //
// child_arr: [ // // child_arr: [ //
// { // {
// age: '3', // age: '3',
// feeding: 1, // // feeding: 1, //
// grade: '', // // grade: '', //
// is_lesson: 1, // // is_lesson: 1, //
// lessons: '', // // lessons: '', //
// notes: '' // // notes: '' //
// } // }
// ], // ],
}, },
rules: { rules: {
family: { family: {
validator: (rule, value, callback ) => { validator: (rule, value, callback ) => {
if (Array.isArray(value) && value.length > 0) { if (Array.isArray(value) && value.length > 0) {
for (let i = 0; i < value.length; i++) { for (let i = 0; i < value.length; i++) {
const item = value[i]; const item = value[i];
for (const key in item) { for (const key in item) {
// //
if (!item[key]&&item[key]!==0) { if (!item[key]&&item[key]!==0) {
callback(new Error('以上四项基本信息必填')); callback(new Error('以上四项基本信息必填'));
return; return;
} }
} }
} }
// //
callback(); callback();
} else { } else {
// //
callback(new Error('数组不能为空')); callback(new Error('数组不能为空'));
} }
}, },
trigger: ['change', 'blur'] trigger: ['change', 'blur']
}, },
child: { child: {
validator: (rule, value, callback )=>{ validator: (rule, value, callback )=>{
typeof value==='number'?callback():callback('不能为空') typeof value==='number'?callback():callback('不能为空')
}, },
trigger: ['change', 'blur'] trigger: ['change', 'blur']
}, },
} }
} }
}, },
watch:{ watch:{
datas(newValue, oldValue){ datas(newValue, oldValue){
if(this.$props.readonly&&newValue){ if(this.$props.readonly&&newValue){
this.residents = this.$props.datas; this.residents = this.$props.datas;
if(!isNaN(this.residents.child))this.residents.child = +this.residents.child; if(!isNaN(this.residents.child))this.residents.child = +this.residents.child;
this.residents.family.forEach(item=>{ this.residents.family.forEach(item=>{
if(!isNaN(item.situation))item.situation = +item.situation; if(!isNaN(item.situation))item.situation = +item.situation;
}) })
this.residents.child_arr.forEach(item=>{ this.residents.child_arr.forEach(item=>{
if(!isNaN(item.feeding))item.feeding = +item.feeding; if(!isNaN(item.feeding))item.feeding = +item.feeding;
if(!isNaN(item.is_lesson))item.is_lesson = +item.is_lesson; if(!isNaN(item.is_lesson))item.is_lesson = +item.is_lesson;
}) })
} }
} }
}, },
mounted() { mounted() {
if(this.$props.readonly){ if(this.$props.readonly){
this.residents = this.$props.datas; this.residents = this.$props.datas;
if(!isNaN(this.residents.child))this.residents.child = +this.residents.child; if(!isNaN(this.residents.child))this.residents.child = +this.residents.child;
this.residents.family.forEach(item=>{ this.residents.family.forEach(item=>{
if(!isNaN(item.situation))item.situation = +item.situation; if(!isNaN(item.situation))item.situation = +item.situation;
}) })
this.residents.child_arr.forEach(item=>{ this.residents.child_arr.forEach(item=>{
if(!isNaN(item.feeding))item.feeding = +item.feeding; if(!isNaN(item.feeding))item.feeding = +item.feeding;
if(!isNaN(item.is_lesson))item.is_lesson = +item.is_lesson; if(!isNaN(item.is_lesson))item.is_lesson = +item.is_lesson;
}) })
} }
}, },
methods: { methods: {
async validate() { async validate() {
let flag = false; let flag = false;
if(this.residents.child) this.residents.child_arr.forEach(item=>{ if(this.residents.child) this.residents.child_arr.forEach(item=>{
if(item.age==''||item.age<0||item.age>200) flag = true; if(item.age==''||item.age<0||item.age>200) flag = true;
}) })
if(flag){ if(flag){
Toast('请输入年龄'); Toast('请输入年龄');
await this.$u.sleep(500); await this.$u.sleep(500);
return Promise.reject(); return Promise.reject();
} }
return this.$refs.residentsForm.validate(); return this.$refs.residentsForm.validate();
}, },
// //
changebirth_time(e) { changebirth_time(e) {
let index = e.currentTarget.dataset.index; let index = e.currentTarget.dataset.index;
this.residents.family[index].birth_time = e.detail.value; this.residents.family[index].birth_time = e.detail.value;
}, },
// //
changesituation(e) { changesituation(e) {
let index = e.currentTarget.dataset.index; let index = e.currentTarget.dataset.index;
this.residents.family[index].situation = e.detail.value; this.residents.family[index].situation = e.detail.value;
}, },
// //
pushFamily() { pushFamily() {
this.residents.family.push({ this.residents.family.push({
name: '', name: '',
birth_time: '', birth_time: '',
situation: '', // situation: '', //
skills: '', // skills: '', //
}) })
}, },
// //
removeFamily(index) { removeFamily(index) {
uni.showModal({ uni.showModal({
confirmColor: '#f56c6c', confirmColor: '#f56c6c',
content: '确定删除吗?', content: '确定删除吗?',
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
this.residents.family.splice(index, 1); this.residents.family.splice(index, 1);
} }
} }
}) })
}, },
// //
pushChildArr() { pushChildArr() {
this.residents.child_arr.push({ this.residents.child_arr.push({
age: '', age: '',
feeding: '', // feeding: '', //
grade: '', // grade: '', //
is_lesson: '', // is_lesson: '', //
lessons: '', // lessons: '', //
notes: '' // notes: '' //
}) })
}, },
// //
removeChildArr(index) { removeChildArr(index) {
uni.showModal({ uni.showModal({
confirmColor: '#f56c6c', confirmColor: '#f56c6c',
content: '确定删除吗?', content: '确定删除吗?',
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
this.residents.child_arr.splice(index, 1); this.residents.child_arr.splice(index, 1);
} }
} }
}) })
}, },
}, },
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.card{ .card {
background-color: #fff; background-color: #fff;
margin: 28rpx; margin: 28rpx;
padding: 28rpx; padding: 28rpx;
border-radius: 14rpx; margin-top: 0;
} padding-top: 0;
.title { border-radius: 0 0 14rpx 14rpx;
font-weight: 500; }
font-size: 34rpx;
.tit {
&::before { margin: 28rpx 28rpx 0 28rpx;
width: 8rpx; padding: 28rpx 28rpx 0 28rpx;
height: 26rpx; border-radius: 14rpx 14rpx 0 0;
border-radius: 4rpx; background-color: $theme-oa-color;
background-color: #0122c7; color: white;
content: ""; height: 100rpx;
display: inline-block; display: flex;
margin-right: 8rpx; justify-content: space-between;
} }
} .title {
.delete { font-weight: 500;
margin: 22rpx 0; font-size: 34rpx;
// margin-bottom: 40rpx;
width: 100%; &::before {
height: 64rpx; width: 8rpx;
line-height: 64rpx; height: 26rpx;
background: #f56c6c; border-radius: 4rpx;
border-radius: 14rpx; background-color: #0122c7;
font-size: 28rpx; content: "";
color: #fff; display: inline-block;
text-align: center; margin-right: 8rpx;
} }
}
.plus { .delete {
margin: 22rpx 0; margin: 22rpx 0;
// margin-bottom: 40rpx; // margin-bottom: 40rpx;
width: 100%; width: 100%;
height: 64rpx; height: 64rpx;
line-height: 64rpx; line-height: 64rpx;
background: $theme-oa-color; background: #f56c6c;
border-radius: 14rpx; border-radius: 14rpx;
font-size: 28rpx; font-size: 28rpx;
color: #fff; color: #fff;
text-align: center; 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> </style>

View File

@ -1,15 +1,9 @@
<template> <template>
<view class="content"> <view class="content">
<view class="tit"> <view class="tit">
<text v-if="readonly">更新时间: {{update_time}}</text> <text v-if="readonly">更新时间: {{update_time}}</text>
<text>开设店铺</text> <text>开设店铺</text>
</view> </view>
<view class="card"> <view class="card">
<!-- <view class="title">开设店铺</view> --> <!-- <view class="title">开设店铺</view> -->
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm"> <u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
@ -29,7 +23,7 @@
</u-form-item> </u-form-item>
<picker :range="storeTypeList" :disabled="readonly" mode="selector" @change="changeType"> <picker :range="storeTypeList" :disabled="readonly" mode="selector" @change="changeType">
<u-form-item labelWidth="auto" label="经营类型" required prop="type" borderBottom> <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> disabledColor="#fff"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>

View File

@ -1,167 +1,202 @@
<!-- 加工 --> <!-- 加工 -->
<template> <template>
<view class="card"> <view>
<view class="title">粗加工</view> <view class="tit">
<u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm"> <text v-if="readonly">更新时间: {{update_time}}</text>
<u-form-item labelWidth="auto" label="是否在经营" required prop="shop_front" borderBottom> <text>粗加工</text>
<u-radio-group v-model="formData.shop_front" style="margin: 16rpx;"> </view>
<u-radio :customStyle="{marginRight: '16px'}" <view class="card">
v-for="(item, index) in [{value:1,label:'是'},{value:0,label:'否'}]" :key="index" :label="item.label" <u--form labelPosition="left" :model="formData" :rules="rules" ref="breedingForm">
:name="item.value"> <u-form-item labelWidth="auto" label="是否在经营" required prop="is_manage" borderBottom>
</u-radio> <u-radio-group v-model="formData.is_manage" style="margin: 16rpx;">
</u-radio-group>
</u-form-item>
<block v-if="formData.shop_front">
<u-form-item labelWidth="auto" label="有无建设用地" required prop="shop_front" borderBottom>
<u-radio-group v-model="formData.shop_front" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}" <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"> :name="item.value">
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
<u-form-item labelWidth="auto" label="面积" required prop="cultivated_area" borderBottom> <block v-if="formData.is_manage">
<u--input v-model="formData.cultivated_area" placeholder="请输入面积"></u--input> <u-form-item labelWidth="auto" label="有无建设用地" required prop="construction_land" borderBottom>
</u-form-item> <u-radio-group v-model="formData.construction_land" style="margin: 16rpx;">
<u-form-item labelWidth="auto" label="经营地点" required prop="cultivated_area" borderBottom> <u-radio :customStyle="{marginRight: '16px'}"
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input> v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
</u-form-item> :name="item.value">
<u-form-item labelWidth="auto" label="材料来源" required prop="notes" borderBottom> </u-radio>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input> </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-item labelWidth="auto" labelPosition="top" label="经营诉求" required prop="farm_tools" borderBottom>
<u--textarea v-model="formData.farm_tools" autoHeight placeholder="请输入经营诉求" border="surround"
count></u--textarea>
</u-form-item>
</block>
<block v-else>
<u-form-item labelWidth="auto" label="有无建设用地" required prop="shop_front" borderBottom>
<u-radio-group v-model="formData.shop_front" style="margin: 16rpx;">
<u-radio :customStyle="{marginRight: '16px'}"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
:name="item.value">
</u-radio>
</u-radio-group>
</u-form-item>
<picker :range="storeTypeList" mode="selector" @change="changeLanPlan">
<u-form-item labelWidth="auto" label="经营类型" required prop="planning" borderBottom>
<u--input :value="storeTypeList[formData.planning]" placeholder="请选择经营类型" disabled
disabledColor="#fff"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
</picker> <u-form-item labelWidth="auto" label="面积(m²)" required prop="land_area" borderBottom>
<u-form-item labelWidth="auto" label="经营地点" required prop="cultivated_area" borderBottom> <u--input v-model="formData.land_area" type="number" placeholder="请输入面积(m²)"></u--input>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input> </u-form-item>
</u-form-item> <u-form-item labelWidth="auto" label="经营地点" required prop="manage_place" borderBottom>
<u-form-item labelWidth="auto" label="人数" required prop="cultivated_area" borderBottom> <u--input v-model="formData.manage_place" placeholder="请输入经营地点"></u--input>
<u--input v-model="formData.cultivated_area" placeholder="请输入经营地点"></u--input> </u-form-item>
</u-form-item> <u-form-item labelWidth="auto" label="材料来源" required prop="source_materials" borderBottom>
<u-form-item labelWidth="auto" label="有无食堂" required prop="planting_company" borderBottom> <u--input v-model="formData.source_materials" placeholder="请输入材料来源"></u--input>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> </u-form-item>
<u-radio :customStyle="{marginRight: '16px'}" <u-form-item labelWidth="auto" label="有无销售渠道" required prop="marketing_channel" borderBottom>
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label" <u-radio-group v-model="formData.marketing_channel" style="margin: 16rpx;">
:name="item.value"> <u-radio :customStyle="{marginRight: '16px'}"
</u-radio> v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
</u-radio-group> :name="item.value">
</u-form-item> </u-radio>
<u-form-item labelWidth="auto" label="材料来源" required prop="notes" borderBottom> </u-radio-group>
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input> </u-form-item>
</u-form-item> <u-form-item labelWidth="auto" label="有无技术指导" required prop="technical_guidance" borderBottom>
<u-form-item labelWidth="auto" label="自动化办公程度" required prop="notes" borderBottom> <u-radio-group v-model="formData.technical_guidance" style="margin: 16rpx;">
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input> <u-radio :customStyle="{marginRight: '16px'}"
</u-form-item> v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
<u-form-item labelWidth="auto" label="有无用工需求" required prop="planting_company" borderBottom> :name="item.value">
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> </u-radio>
<u-radio :customStyle="{marginRight: '16px'}" </u-radio-group>
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label" </u-form-item>
:name="item.value"> <u-form-item labelWidth="auto" label="有无品牌" required prop="brand" borderBottom>
</u-radio> <u-radio-group v-model="formData.brand" style="margin: 16rpx;">
</u-radio-group> <u-radio :customStyle="{marginRight: '16px'}"
</u-form-item> v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
<u-form-item labelWidth="auto" label="有无品牌" required prop="planting_company" borderBottom> :name="item.value">
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> </u-radio>
<u-radio :customStyle="{marginRight: '16px'}" </u-radio-group>
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label" </u-form-item>
:name="item.value"> <u-form-item labelWidth="auto" label="有无宣传推广" required prop="advertising" borderBottom>
</u-radio> <u-radio-group v-model="formData.advertising" style="margin: 16rpx;">
</u-radio-group> <u-radio :customStyle="{marginRight: '16px'}"
</u-form-item> v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
<u-form-item labelWidth="auto" label="有无宣传推广" required prop="planting_company" borderBottom> :name="item.value">
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> </u-radio>
<u-radio :customStyle="{marginRight: '16px'}" </u-radio-group>
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label" </u-form-item>
:name="item.value"> <u-form-item labelWidth="auto" label="有无运输" required prop="transport" borderBottom>
</u-radio> <u-radio-group v-model="formData.transport" style="margin: 16rpx;">
</u-radio-group> <u-radio :customStyle="{marginRight: '16px'}"
</u-form-item> v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
<u-form-item labelWidth="auto" label="库存情况" required prop="notes" borderBottom> :name="item.value">
<u--input v-model="formData.cultivated_area" placeholder="请输入门面环境"></u--input> </u-radio>
</u-form-item> </u-radio-group>
<u-form-item labelWidth="auto" label="有无运输" required prop="planting_company" borderBottom> </u-form-item>
<u-radio-group v-model="formData.planting_company" style="margin: 16rpx;"> <u-form-item labelWidth="auto" labelPosition="top" label="经营诉求" prop="business_appeal" borderBottom>
<u-radio :customStyle="{marginRight: '16px'}" <u--textarea v-model="formData.business_appeal" autoHeight placeholder="请输入经营诉求" border="surround"
v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label" count></u--textarea>
:name="item.value"> </u-form-item>
</u-radio> </block>
</u-radio-group> <block v-else>
</u-form-item> <u-form-item labelWidth="auto" label="有无建设用地" required prop="construction_land" borderBottom>
<u-form-item labelWidth="auto" labelPosition="top" label="经营诉求" required prop="farm_tools" borderBottom> <u-radio-group v-model="formData.construction_land" style="margin: 16rpx;">
<u--textarea v-model="formData.farm_tools" autoHeight placeholder="请输入经营诉求" border="surround" <u-radio :customStyle="{marginRight: '16px'}"
count></u--textarea> v-for="(item, index) in [{value:1,label:'有'},{value:0,label:'无'}]" :key="index" :label="item.label"
</u-form-item> :name="item.value">
</block> </u-radio>
</u--form> </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> </view>
</template> </template>
<script> <script>
export default { export default {
props: {
readonly: {
type: Boolean,
default: false
},
datas: {
type: Object,
default: null
},
update_time: {
type: String,
default: null
},
},
data() { data() {
return { return {
storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'], storeTypeList: ['超市', '生鲜', '饭店', '五金', '杂货', '服装', '文具', '其他'],
formData: { 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: { rules: {
@ -169,12 +204,37 @@
} }
}, },
created() { 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: { methods: {
// //
initRules() { initRules() {
let arr = Object.keys(this.formData); let arr = Object.keys(this.formData);
arr = arr.filter(item=>{
return item!="business_appeal"
})
arr.forEach(key => { arr.forEach(key => {
this.rules[key] = { this.rules[key] = {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
@ -189,43 +249,55 @@
async validate() { async validate() {
return await this.$refs.breedingForm.validate();; return await this.$refs.breedingForm.validate();;
}, },
// //
changeLanPlan(e) { changeLanPlan(e) {
let index = e.currentTarget.dataset.index; let index = e.currentTarget.dataset.index;
this.formData.planning = e.detail.value; this.formData.manage_type = e.detail.value;
},
//
changeDate(e) {
let data = e.currentTarget.dataset;
this.formData[data.value] = e.detail.value;
},
//
pushBreedingList() {
this.formData.push({})
},
//
removeBreedingList(index) {
uni.showModal({
confirmColor: '#f56c6c',
content: '确定删除吗?',
success: (res) => {
if (res.confirm) {
this.formData.splice(index, 1);
}
}
})
}, },
}, },
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.card{ .card {
background-color: #fff; background-color: #fff;
margin: 28rpx; margin: 28rpx;
padding: 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 { .title {
font-weight: 500; font-weight: 500;
font-size: 34rpx; font-size: 34rpx;

View File

@ -1,15 +1,20 @@
let httpApiThree; let httpApiThree;
let httpApi; 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://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://preview-worker-task.lihaink.cn' //预上线
// httpApiThree = 'https://worker-task.lihaink.cn' //正式 httpApiThree = 'https://worker-task.lihaink.cn' //正式
// #ifdef H5 // #ifdef H5
// httpApiThree = 'baseUrlTest' //生产 // httpApiThree = 'baseUrlTest' //生产
// #endif // #endif
@ -33,6 +38,7 @@ module.exports = {
// 请求域名 格式: https://您的域名 // 请求域名 格式: https://您的域名
HTTP_REQUEST_URL: httpApi, HTTP_REQUEST_URL: httpApi,
HTTP_REQUEST_URL_THREE: httpApiThree, HTTP_REQUEST_URL_THREE: httpApiThree,
HTTP_REQUEST_URL_TWO: httpApiTwo,
// #ifdef H5 // #ifdef H5
//H5接口是浏览器地址 //H5接口是浏览器地址

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -62,7 +62,6 @@
this.loadTask(); this.loadTask();
} }
}, },
onShow() {},
methods: { methods: {
changePrice(index){ changePrice(index){
if(this.changeMoney == index)this.changeMoney = -1; if(this.changeMoney == index)this.changeMoney = -1;
@ -87,7 +86,7 @@
pay(){ pay(){
if(!this.payMoney.money)return Toast('请先填写充值金额!') if(!this.payMoney.money)return Toast('请先填写充值金额!')
if(this.payMoney.money<=0)return Toast('充值金额不能小于0!') if(this.payMoney.money<=0)return Toast('充值金额不能小于0!')
if(!this.payTimer){ if(this.payTimer==null){
this.goRecharge(); this.goRecharge();
this.payTimer = setInterval(()=>{ this.payTimer = setInterval(()=>{
this.timeCount--; this.timeCount--;
@ -175,7 +174,7 @@
}) })
}, },
complete: () => { 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> keyName="name" @change="changeHandler" @cancel="demandShow = false" @confirm="changeDemand"></u-picker>
</u--form> </u--form>
<!-- <button @click="addArchives" class="btn">完成更新</button> --> <!-- <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 <u-modal :show="modelShow" title="警告" content='确定要删除该信息吗' closeOnClickOverlay showCancelButton
@close="modelShow=false" @cancel="modelShow=false" @confirm="deleteDemand(deleteIndex)"></u-modal> @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>
</view> </view>
</template> </template>
@ -105,7 +107,6 @@
}, },
data() { data() {
return { return {
listMap: new Map(),
demandShow: false, demandShow: false,
demandLoading: false, demandLoading: false,
demandList: [], // demandList: [], //
@ -114,6 +115,7 @@
updateFlag: true, updateFlag: true,
task_id: 0, task_id: 0,
modelShow: false, // modelShow: false, //
updateShow: false, //
deleteIndex: -1, // deleteIndex: -1, //
formData: { formData: {
id_card: '', id_card: '',
@ -135,24 +137,21 @@
this.task_id = +options.task_id || 0; this.task_id = +options.task_id || 0;
this.initInformationDetails({ id: options.id }); this.initInformationDetails({ id: options.id });
this.initCategoryBusinessList(); this.initCategoryBusinessList();
this.initMap();
}, },
onShow() {}, onShow() {},
methods: { methods: {
initMap() {
comonentList.forEach(item => {
this.listMap.set(item.id, item.name);
})
},
async initInformationDetails(id) { async initInformationDetails(id) {
let res = await informationDetails(id); let res = await informationDetails(id);
this.formData = res.data; this.formData = res.data;
}, },
// //
async addArchives() { async addArchives() {
this.updateShow = false;
await this.$nextTick();
if (this.showDemandList.length == 0) return Toast('请先添加需求!'); if (this.showDemandList.length == 0) return Toast('请先添加需求!');
let refsDatas = await this.loadRefsDatas(); let refsDatas = await this.loadRefsDatas();
if (!this.updateFlag) return; if (!this.updateFlag) return;
// return ;
uni.showLoading({ uni.showLoading({
title: '正在更新...', title: '正在更新...',
mask: true mask: true
@ -201,10 +200,13 @@
// //
async initCategoryBusinessList() { async initCategoryBusinessList() {
let res = await categoryBusinessList(); let res = await categoryBusinessList();
// this.demandList = res.data; res.data = res.data.filter((item)=>{
this.demandList = res.data.filter(item => item.id == 6); return item.status!=0;
this.demandList[0].children = this.demandList[0].children.filter(item => item.id == 7 || item.id == 8 || item })
.id == 32); 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; this.demandListChild = this.demandList[0].children;
}, },
// //

View File

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

View File

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

View File

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