228 lines
5.0 KiB
Vue
228 lines
5.0 KiB
Vue
<template>
|
||
<view>
|
||
<scroll-view :scroll-y="true" style="height: 100vh;">
|
||
<uni-card>
|
||
<view>
|
||
<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-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>
|
||
</uni-row>
|
||
</view>
|
||
<view style="margin-bottom: 10rpx;">
|
||
<uni-row>
|
||
<uni-col :span="24"><uni-title title="所属单位" align="left" type="h5"></uni-title></uni-col>
|
||
</uni-row>
|
||
<uni-row>
|
||
<uni-col :span="24">
|
||
<trq-depart-select v-model="departID" returnCodeOrID="orgCode"
|
||
@change="departChange"></trq-depart-select>
|
||
</uni-col>
|
||
</uni-row>
|
||
</view>
|
||
</uni-card>
|
||
<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" />
|
||
<view>
|
||
<text class="example-info">当前页:{{ current }},数据总量:{{ total }}条,每页数据:{{ pageSize }}</text>
|
||
</view>
|
||
</uni-card>
|
||
</scroll-view>
|
||
|
||
|
||
</view>
|
||
</template>
|
||
|
||
<script setup>
|
||
import {
|
||
onReady,
|
||
onLoad
|
||
|
||
} from '@dcloudio/uni-app';
|
||
import {
|
||
reactive,
|
||
ref,
|
||
onMounted
|
||
} from 'vue';
|
||
import {
|
||
useStore
|
||
} from '@/store';
|
||
import {
|
||
queryDepByCode,
|
||
queryZbDepByLdhth
|
||
} from '@/api/depart.js'
|
||
import {
|
||
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,
|
||
align: 'center'
|
||
},
|
||
{
|
||
name: 'xb_dictText',
|
||
label: '性别',
|
||
align: 'center',
|
||
width: 60
|
||
},
|
||
{
|
||
name: 'nl',
|
||
label: '年龄',
|
||
align: 'center',
|
||
width: 60
|
||
},
|
||
{
|
||
name: 'operation',
|
||
type: 'operation',
|
||
width: 60,
|
||
fixed: true,
|
||
label: '操作',
|
||
align: 'center',
|
||
renders: [{
|
||
name: '详情',
|
||
func: 'detail',
|
||
size: 'mini'
|
||
}]
|
||
}
|
||
])
|
||
|
||
onLoad((e) => {
|
||
|
||
})
|
||
onMounted((e) => {
|
||
departID.value = ""
|
||
getRenyuanByDepID()
|
||
})
|
||
|
||
function detail(record) {
|
||
// console.log(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
|
||
let params = {
|
||
pageNo: pageNo.value,
|
||
pageSize: pageSize.value,
|
||
current: current.value
|
||
};
|
||
if (departID.value.length <= 9) {
|
||
params.orgCode = departID.value
|
||
} else {
|
||
params.jcxd_code = departID.value
|
||
}
|
||
|
||
getRenyuanByDepID(params)
|
||
}
|
||
|
||
function departChange(e, data) {
|
||
departID.value = e
|
||
let params = {
|
||
pageNo: pageNo.value,
|
||
pageSize: pageSize.value,
|
||
current: current.value
|
||
};
|
||
console.log(e)
|
||
if (e.length <= 9) {
|
||
params.orgCode = departID.value
|
||
} else {
|
||
params.jcxd_code = departID.value
|
||
}
|
||
|
||
getRenyuanByDepID(params)
|
||
}
|
||
|
||
function getRenyuanByDepID(queryParm) {
|
||
ryDataList.value = []
|
||
console.log(queryParm)
|
||
queryRenyuanByDepartID(queryParm).then((res) => {
|
||
console.log(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 = [];
|
||
let queryParm = {
|
||
pageNo: pageNo.value,
|
||
pageSize: pageSize.value
|
||
};
|
||
if ((ldhth.value == '') & (xm.value == '')) {
|
||
return;
|
||
}
|
||
if (xm.value !== '') {
|
||
queryParm.xm = '*' + xm.value + '*';
|
||
}
|
||
if (ldhth.value !== '') {
|
||
queryParm.ldhth = '*' + ldhth.value + '*';
|
||
}
|
||
console.log(queryParm)
|
||
queryRenyuanByDepartID(queryParm).then((res) => {
|
||
if (res.success) {
|
||
ryDataList.value = res.result.records
|
||
total.value = res.result.total
|
||
pages.value = res.result.pages
|
||
}
|
||
}).catch((err) => {
|
||
console.log(err);
|
||
})
|
||
}
|
||
</script>
|
||
|
||
<style scoped>
|
||
.uni-group {
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
</style> |