Files
sifa-mp/lawOrgPages/pages/peopleList.vue
T
2025-05-22 10:33:32 +08:00

90 lines
3.0 KiB
Vue

<template>
<view class="min-height bg-main-light">
<HeaderItem title="人员"/>
<view class="p-20 pos-r bg-linear">
<u-input v-model="keyword" shape="circle" :custom-style="{background: 'white', height: '65rpx'}"
placeholder="请输入您要查找的人员姓名"/>
<view class="pos-a" style="right: 30rpx; top: 30rpx">
<u-button shape="circle" type="primary" :custom-style="{width: '200rpx', zIndex: 9999}" @click="getList">
搜索
</u-button>
</view>
</view>
<view class="card m-20 flex justify-center items-center" @click="showType = true">
<u-icon name="arrow-down" :label="type" label-pos="left" label-size="25rpx"/>
</view>
<template v-if="list.length">
<view class="card m-20 flex justify-start items-start" v-for="(item, index) in list" :key="index">
<u-icon name="/lawOrgPages/static/header.png" size="80rpx"/>
<view class="ml-15 flex flex-col justify-start text-25 text-gray-weight w-100p">
<text class="text-28">{{ item.name }}</text>
<view class="flex justify-between items-center mt-15 w-100p" @click="call(item.phone)">
<text>联系方式: {{ item.phone }}</text>
<u-icon name="phone" :color="MAIN()" size="50rpx"/>
</view>
<text class="mt-15">技术职称: {{ item.position }}</text>
<text class="mt-15">执业类别: {{ item.positionType }}</text>
<text class="mt-15">执业机构: {{ item.lawOrg ? item.lawOrg.title : '' }}</text>
</view>
</view>
</template>
<u-empty v-else icon="/lawOrgPages/static/empty.png"/>
<u-picker :show="showType" :columns="[typeList]" @cancel="showType = false"
:default-index="defaultIndex"
@confirm="selectType" key-name="dictDataCode"
/>
</view>
</template>
<script>
import HeaderItem from "@/components/HeaderItem.vue";
import {dictDataReq} from "@/api/common";
import {listLawOrgPeopleReq} from "@/api/lawOrg";
import {MAIN} from "@/config/color";
export default {
name: "peopleList",
components: {HeaderItem},
data() {
return {
type: '',
keyword: '',
list: [],
typeList: [],
defaultIndex: [0],
showType: false
}
},
methods: {
MAIN() {
return MAIN
},
async getTypeList() {
const {data} = await dictDataReq({dictId: '162'})
this.typeList = data
this.defaultIndex = [data.findIndex(item => item.dictDataCode === this.type)]
},
selectType({value}) {
this.type = value[0].dictDataCode
this.showType = false
this.getList()
},
async getList() {
const {data} = await listLawOrgPeopleReq({
keywords: this.keyword
})
this.list = data.filter(item => item.type === this.type)
},
call(phoneNumber){
uni.makePhoneCall({
phoneNumber: phoneNumber
})
}
},
onLoad({type}) {
this.type = type
this.getTypeList()
this.getList()
}
}
</script>