<template>
<view>
<scroll-view :scroll-y="true">
<uni-card>
<uni-row>
<uni-col :span="11"><uni-title title="姓名 " align="left" type="h5"></uni-title></uni-col>
<uni-col :span="11" :push="2"><uni-title title="劳动合同号" align="left"
type="h5"></uni-title></uni-col>
</uni-row>
<uni-col :span="11"><uni-easyinput v-model="xm" suffixIcon="search" clearable
placeholder="姓名模糊查询" @change="Search" @iconClick="Search" /></uni-col>
<uni-col :span="11" :push="2">
<uni-easyinput v-model="ldhth" suffixIcon="search" clearable placeholder="劳动合同号模糊查询"
@change="Search" @iconClick="Search" />
</uni-col>
</view>
<view style="margin-bottom: 10rpx;">
<uni-col :span="24"><uni-title title="所属单位" align="left" type="h5"></uni-title></uni-col>
<uni-col :span="24">
<trq-depart-select returnCodeOrID="orgCode" @change="departChange"></trq-depart-select>
</uni-card>
<zb-table :show-header="true" :highlight="true" :columns="column" :stripe="true" :fit="false"
:border="true" :data="ryDataList" @detail="detail"></zb-table>
<uni-pagination :current="current" :pagerCount="pages" :total="total" prev-text="前一页" next-text="后一页"
:show-icon="false" @change="pagechange" />
<text class="example-info">当前页:{{ current }},数据总量:{{ total }}条,每页数据:{{ pageSize }}</text>
</scroll-view>
</template>
<script setup>
import {
onReady,
onLoad
} from '@dcloudio/uni-app';
reactive,
ref,
onMounted
} from 'vue';
useStore
} from '@/store';
queryDepByCode,
queryZbDepByLdhth
} from '@/api/depart.js'
queryRenyuanByDepartID
} from '@/api/renyuan.js'
let xm = ref("")
let ldhth = ref("")
let departID = ref("") //部门树选中的ID
const ryDataList = ref([])
let status = ref("")
let contentText = reactive({
contentdown: '点击查看更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
})
let pageNo = ref(1)
let pageSize = ref(10)
let total = ref(0)
let pages = ref(0)
let current = ref(0)
let params = reactive({
pageNo: pageNo,
pageSize: pageSize
let column = ref([{
label: '序号',
width: 60,
type: 'index',
color: 'blue',
align: 'center'
},
{
name: 'xm',
label: '姓名',
width: 70,
// {
// name: 'gzdw',
// label: '单位',
// align: 'center',
// width: 150
// },
name: 'xb_dictText',
label: '性别',
align: 'center',
width: 60
name: 'nl',
label: '年龄',
name: 'operation',
type: 'operation',
fixed: true,
label: '操作',
renders: [{
name: '详情',
func: 'detail',
size: 'mini'
}]
}
])
onLoad((e) => {
onMounted((e) => {
departID.value = ""
getRenyuanByDepID()
function detail(record) {
uni.navigateTo({
url: "/pages/views/renliziyuan/renyuanxinxi/detail?data=" + encodeURIComponent(JSON.stringify(record))
function pagechange(e) {
current.value = e.current
pageNo.value = e.current
function departChange(e) {
departID.value = e
function getRenyuanByDepID() {
ryDataList.value = []
let queryParm = {
pageNo: pageNo.value,
pageSize: pageSize.value,
current: current.value
};
queryParm.orgCode = departID.value
queryRenyuanByDepartID(queryParm).then((res) => {
if (res.success) {
ryDataList.value = res.result.records
total.value = res.result.total
pages.value = res.result.pages
current.value = res.result.current
}).catch((err) => {
console.log(err);
function Search() {
ryDataList.value = [];
pageSize: pageSize.value
if ((ldhth.value == '') & (xm.value == '')) {
return;
if (xm.value !== '') {
queryParm.xm = '*' + xm.value + '*';
if (ldhth.value !== '') {
queryParm.ldhth = '*' + ldhth.value + '*';
</script>
<style scoped>
.uni-group {
display: flex;
align-items: center;
</style>