修复bug,优化组件
This commit is contained in:
parent
7cb722455b
commit
55b543f63c
@ -6,31 +6,31 @@
|
||||
<block value="人口">
|
||||
<block value="人员信息" v-for="(item, index) in residents.family" :key="'user'+index">
|
||||
<u-form-item label="姓名" required prop="family.name" borderBottom>
|
||||
<u--input v-model="item.name" placeholder="请输入姓名"></u--input>
|
||||
<u--input v-model="item.name" :readonly="readonly" placeholder="请输入姓名"></u--input>
|
||||
</u-form-item>
|
||||
<picker mode="date" value="1990-01-01" @change="changebirth_time" :data-index="index">
|
||||
<picker mode="date" value="1990-01-01" @change="changebirth_time" :disabled="readonly" :data-index="index">
|
||||
<u-form-item labelWidth="auto" label="出生日期" required prop="family.birth_time" borderBottom>
|
||||
<u--input :value="item.birth_time" placeholder="请选择出生日期" disabled disabledColor="#fff"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
</picker>
|
||||
<picker mode="selector" :range="situationList" @change="changesituation" :data-index="index">
|
||||
<picker mode="selector" :range="situationList" @change="changesituation" :disabled="readonly" :data-index="index">
|
||||
<u-form-item labelWidth="auto" label="就业情况" required prop="family.situation" borderBottom>
|
||||
<u--input :value="item.situation" placeholder="请选择就业情况" disabled disabledColor="#fff"></u--input>
|
||||
<u-icon slot="right" name="arrow-right"></u-icon>
|
||||
</u-form-item>
|
||||
</picker>
|
||||
<u-form-item labelWidth="auto" label="技能特长" required prop="family" borderBottom>
|
||||
<u--input v-model="item.skills" placeholder="请输入技能特长"></u--input>
|
||||
<u--input v-model="item.skills" :readonly="readonly" placeholder="请输入技能特长"></u--input>
|
||||
</u-form-item>
|
||||
<button type="primary" v-if="residents.family.length>1" class="delete"
|
||||
<button type="primary" v-if="residents.family.length>1&&!readonly" class="delete"
|
||||
@click="removeFamily(index)">删除以上信息</button>
|
||||
</block>
|
||||
<button type="primary" class="plus" @click="pushFamily">+</button>
|
||||
<button type="primary" v-if="!readonly" class="plus" @click="pushFamily">+</button>
|
||||
</block>
|
||||
<block value="婴幼儿信息">
|
||||
<u-form-item labelWidth="auto" label="是否存在学生、婴幼儿" required prop="child" borderBottom>
|
||||
<u-radio-group v-model="residents.child" style="margin: 16rpx;">
|
||||
<u-radio-group v-model="residents.child" :disabled="readonly" style="margin: 16rpx;">
|
||||
<u-radio :customStyle="{marginRight: '16px'}"
|
||||
v-for="(item, index) in [{value:1,label:'是'},{value:0,label:'否'}]" :key="index" :label="item.label"
|
||||
:name="item.value">
|
||||
@ -39,11 +39,11 @@
|
||||
</u-form-item>
|
||||
<block value="是" v-if="residents.child>0" v-for="(item,index) in residents.child_arr" :key="'child'+index">
|
||||
<u-form-item label="年龄" required prop="child_arr.age" borderBottom>
|
||||
<u--input v-model="item.age" placeholder="请输入年龄" type="number"></u--input>
|
||||
<u--input v-model="item.age" :readonly="readonly" placeholder="请输入年龄" type="number"></u--input>
|
||||
</u-form-item>
|
||||
<block v-if="item.age<4">
|
||||
<u-form-item labelWidth="auto" label="喂养方式" borderBottom>
|
||||
<u-radio-group v-model="item.wyfs" style="margin: 16rpx;">
|
||||
<u-radio-group v-model="item.wyfs" :disabled="readonly" style="margin: 16rpx;">
|
||||
<u-radio :customStyle="{marginRight: '16px'}"
|
||||
v-for="(item, index) in [{value:1,label:'母乳'},{value:0,label:'奶粉'}]" :key="index" :label="item.label"
|
||||
:name="item.value">
|
||||
@ -53,10 +53,10 @@
|
||||
</block>
|
||||
<block v-else>
|
||||
<u-form-item label="年级" borderBottom>
|
||||
<u--input v-model="item.grade" placeholder="请输入年级"></u--input>
|
||||
<u--input v-model="item.grade" :readonly="readonly" placeholder="请输入年级"></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item labelWidth="auto" label="是否补课" borderBottom>
|
||||
<u-radio-group v-model="item.is_lesson" style="margin: 16rpx;">
|
||||
<u-radio-group v-model="item.is_lesson" style="margin: 16rpx;" :disabled="readonly">
|
||||
<u-radio :customStyle="{marginRight: '16px'}"
|
||||
v-for="(item, index) in [{value:1,label:'是'},{value:0,label:'否'}]" :key="index" :label="item.label"
|
||||
:name="item.value">
|
||||
@ -64,17 +64,17 @@
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
<u-form-item v-if="item.is_lesson>0" label-width="auto" labelPosition="top" label="补课内容" borderBottom>
|
||||
<u--textarea v-model="item.lessons" autoHeight placeholder="请输入需要的课程" border="surround"
|
||||
<u--textarea v-model="item.lessons" :disabled="readonly" autoHeight placeholder="请输入需要的课程" border="surround"
|
||||
count></u--textarea>
|
||||
</u-form-item>
|
||||
</block>
|
||||
<u-form-item label-width="auto" labelPosition="top" label="备注" borderBottom>
|
||||
<u--textarea v-model="item.notes" autoHeight placeholder="请输入备注" border="surround" count></u--textarea>
|
||||
<u--textarea v-model="item.notes" autoHeight :disabled="readonly"placeholder="请输入备注" border="surround" count></u--textarea>
|
||||
</u-form-item>
|
||||
<button type="primary" v-if="residents.child_arr.length>1" class="delete"
|
||||
<button type="primary" v-if="residents.child_arr.length>1&&!readonly" class="delete"
|
||||
@click="removeChildArr(index)">删除以上信息</button>
|
||||
</block>
|
||||
<button type="primary" v-if="residents.child>0" class="plus" @click="pushChildArr">+</button>
|
||||
<button type="primary" v-if="residents.child>0&&!readonly" class="plus" @click="pushChildArr">+</button>
|
||||
</block>
|
||||
|
||||
</u--form>
|
||||
@ -83,6 +83,16 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props:{
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
datas: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
situationList: ['公务员', '国企事业单位', '民营企业', '自由职业', '其他'],
|
||||
@ -138,6 +148,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
datas(newValue, oldValue){
|
||||
if(this.$props.readonly&&newValue)this.residents = this.$props.datas;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async validate() {
|
||||
return this.$refs.residentsForm.validate();
|
||||
|
@ -27,7 +27,7 @@
|
||||
<view class="duty">
|
||||
<!-- ({{ myOaInfo.did_name }}){{myOaInfo.label_name}} -->
|
||||
电话:{{myOaInfo.account}}<br/>
|
||||
公司:<text v-if="myOaInfo.admin.company">{{ myOaInfo.admin.company.company_name }}</text>
|
||||
公司:<text v-if="myOaInfo.admin&&myOaInfo.admin.company">{{ myOaInfo.admin.company.company_name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -33,7 +33,7 @@
|
||||
</view>
|
||||
<view class="work">
|
||||
电话:{{oaUserInfo.account}}<br/>
|
||||
公司:<text v-if="oaUserInfo.admin.company">{{ oaUserInfo.admin.company.company_name }}</text>
|
||||
公司:<text v-if="oaUserInfo.admin&&oaUserInfo.admin.company">{{ oaUserInfo.admin.company.company_name }}</text>
|
||||
<!-- {{ oaUserInfo.did_name }}({{ oaUserInfo.label_name }}) -->
|
||||
</view>
|
||||
</view>
|
||||
|
@ -207,7 +207,7 @@ export const oaHomeData = [
|
||||
{
|
||||
text: '固定资产',
|
||||
icon: prefix + 'oa/wcsq@2x.png',
|
||||
url: '/subpkg/fixedAssets/fixedAssets'
|
||||
// url: '/subpkg/fixedAssets/fixedAssets'
|
||||
},
|
||||
{
|
||||
text: '合同管理',
|
||||
@ -223,7 +223,7 @@ export const oaHomeData = [
|
||||
{
|
||||
text: '任务管理',
|
||||
icon: prefix + 'oa/bxsq@2x.png',
|
||||
url: '/subpkg/taskAdmin/taskAdmin',
|
||||
// url: '/subpkg/taskAdmin/taskAdmin',
|
||||
},
|
||||
{
|
||||
text: '档案管理',
|
||||
|
@ -1,19 +1,87 @@
|
||||
<template>
|
||||
<view class="">
|
||||
<button class="new_btn" @click="navTo('/subpkg/newArchives/newArchives')">信息登记</button>
|
||||
<button class="new_btn" @click="navTo('/subpkg/updateArchives/updateArchives')">信息更新(测试中)</button>
|
||||
<view class="personnel_list">
|
||||
<view class="personnel_item" v-for="(item, index) in list" :key="item.id">
|
||||
<view class="top">
|
||||
<view class="left">
|
||||
<u--image class="u_avatar" :showLoading="true" :src="item.avatar||'../../static/img/public/man.png'"
|
||||
width="112.28rpx" height="112.28rpx" shape="circle"></u--image>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="info_top">
|
||||
<view class="info_name">{{item.name}}</view>
|
||||
</view>
|
||||
<view class="info_bottom">
|
||||
<view class="item phone">
|
||||
年龄:
|
||||
{{item.age}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="info_bottom">
|
||||
<view class="item phone">
|
||||
<uni-icons type="phone" color="#999999FF"></uni-icons>
|
||||
{{item.phone}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="location">
|
||||
<view class="left">
|
||||
<uni-icons type="location" color="#999999FF"></uni-icons>
|
||||
<text>居住地址:</text>
|
||||
</view>
|
||||
<view>{{item.address}}</view>
|
||||
</view>
|
||||
<view class="time">
|
||||
<view class="left">
|
||||
<uni-icons type="calendar" color="#999999FF"></uni-icons>
|
||||
<text>更新时间:</text>
|
||||
</view>
|
||||
<view>{{item.update_time}}</view>
|
||||
</view>
|
||||
<u-line color="#999999FF" v-if="showView"></u-line>
|
||||
<view v-if="showView" class="bottom" style="margin-top: 28rpx;">
|
||||
<button class="look" @click="navTo()">更新信息</button>
|
||||
<button class="look" @click="navTo('/subpkg/archivesDetail/archivesDetail?id='+item.id)">查看</button>
|
||||
</view>
|
||||
</view>
|
||||
<u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText"
|
||||
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
|
||||
</view>
|
||||
<button class="new_btn" v-if="$store.state.app.userInfo.admin_id==0" @click="navTo('/subpkg/newArchives/newArchives')">信息登记</button>
|
||||
<!-- <button class="new_btn" @click="navTo('/subpkg/updateArchives/updateArchives')">信息更新(测试中)</button> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { informationList } from "@/api/information.js"
|
||||
import { Toast } from "../../libs/uniApi";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
list: [],
|
||||
loadConfig: {
|
||||
page: 1,
|
||||
limit: 15,
|
||||
loadingText: '努力加载中',
|
||||
loadmoreText: '轻轻上拉',
|
||||
nomoreText: '我也是有底线的~~',
|
||||
status: 'loadmore'
|
||||
},
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
},
|
||||
onShow() {
|
||||
this.initLoadconfig();
|
||||
this.loadInformationList();
|
||||
},
|
||||
computed:{
|
||||
// 是否显示查看和更新按钮
|
||||
showView(){
|
||||
return this.$store.state.app.userInfo.admin_id?false:true;
|
||||
}
|
||||
},
|
||||
onLoad() {},
|
||||
onShow() {},
|
||||
methods: {
|
||||
navTo(url) {
|
||||
url ?
|
||||
@ -21,6 +89,27 @@
|
||||
url: url,
|
||||
}) : Toast('暂未开放')
|
||||
},
|
||||
initLoadconfig(){
|
||||
this.loadConfig.page = 1;
|
||||
this.loadConfig.status = "loadmore";
|
||||
this.list = [];
|
||||
},
|
||||
async loadInformationList() {
|
||||
let that = this;
|
||||
if (this.loadConfig.status == "nomore") return;
|
||||
this.loadConfig.status = "loading"
|
||||
let res = await informationList({
|
||||
page: this.loadConfig.page,
|
||||
limit: this.loadConfig.limit
|
||||
})
|
||||
this.loadConfig.status = "loadmore"
|
||||
if (res.data.length < this.loadConfig.limit) {
|
||||
this.loadConfig.status = "nomore"
|
||||
} else {
|
||||
this.loadConfig.page++;
|
||||
}
|
||||
this.list = [...this.list, ...res.data];
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
uni.stopPullDownRefresh()
|
||||
@ -30,7 +119,10 @@
|
||||
|
||||
<style lang="scss">
|
||||
.new_btn {
|
||||
margin: 0 auto;
|
||||
position: fixed;
|
||||
bottom: 28rpx;
|
||||
left: 50%;
|
||||
transform: translate(-50%);
|
||||
margin-top: 32rpx;
|
||||
// margin-bottom: 40rpx;
|
||||
width: 694rpx;
|
||||
@ -41,4 +133,117 @@
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.personnel_list {
|
||||
padding: 28rpx 0;
|
||||
margin-bottom: 100rpx;
|
||||
|
||||
.personnel_item {
|
||||
margin: 0 auto;
|
||||
width: 694rpx;
|
||||
// height: 407rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 14rpx 14rpx 14rpx 14rpx;
|
||||
margin-bottom: 32rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
padding: 28rpx;
|
||||
|
||||
.top {
|
||||
// background-color: #3274F9;
|
||||
display: flex;
|
||||
|
||||
.right {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
margin-left: 28rpx;
|
||||
font-size: 25rpx;
|
||||
font-weight: 400;
|
||||
overflow: hidden;
|
||||
color: #999999;
|
||||
|
||||
.info_top {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
font-size: 25rpx;
|
||||
font-weight: 400;
|
||||
color: $theme-oa-color;
|
||||
margin-bottom: 8rpx;
|
||||
|
||||
.info_name {
|
||||
font-size: 32rpx;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
margin-right: 18rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.info_bottom {
|
||||
display: flex;
|
||||
margin-bottom: 8rpx;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.phone {
|
||||
margin-right: 28rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.location {
|
||||
margin-top: 18rpx;
|
||||
display: flex;
|
||||
font-size: 25rpx;
|
||||
font-weight: 400;
|
||||
overflow: hidden;
|
||||
color: #999999;
|
||||
|
||||
.left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.time {
|
||||
margin-top: 8rpx;
|
||||
margin-bottom: 21rpx;
|
||||
display: flex;
|
||||
font-size: 25rpx;
|
||||
font-weight: 400;
|
||||
overflow: hidden;
|
||||
color: #999999;
|
||||
|
||||
.left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom {
|
||||
display: flex;
|
||||
justify-content: right;
|
||||
|
||||
.look {
|
||||
width: 158rpx;
|
||||
height: 53rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 26rpx 26rpx 26rpx 26rpx;
|
||||
opacity: 1;
|
||||
border: 2rpx solid $theme-oa-color;
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
margin-left: 28rpx;
|
||||
color: $theme-oa-color;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -41,8 +41,9 @@
|
||||
<view><image :src="item.qualification&&item.qualification.bank_account?'../../static/icons/ok.png':'../../static/icons/err.png'"></image>银行卡</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-line color="#999999FF"></u-line>
|
||||
<u-line color="#999999FF"></u-line>
|
||||
<view class="bottom" style="margin-top: 28rpx;">
|
||||
<button class="look" @click="navTo('/subpkg/archives/archives')">片区档案</button>
|
||||
<button class="look" @click="navTo('/subpkg/personnelDetails/personnelDetails?id='+item.id)">查看</button>
|
||||
</view>
|
||||
</view>
|
||||
@ -243,6 +244,7 @@ export default {
|
||||
border: 2rpx solid $theme-oa-color;
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
margin-left: 28rpx;
|
||||
color: $theme-oa-color;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
Loading…
x
Reference in New Issue
Block a user