cxc-szcx-uniapp/pages/views/renliziyuan/renyuanxinxi/taizhang.vue
ldeyun a5d733a269 Merge branch 'master' of http://10.75.166.171/cxcxt/cxc-szcx-uniapp
# Conflicts:
#	package-lock.json
#	pages/views/renliziyuan/renyuanxinxi/taizhang.vue
#	pages/views/renliziyuan/renyuanxinxi/tongji.vue
2025-01-22 22:29:32 +08:00

212 lines
4.6 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view>
<scroll-view :scroll-y="true">
<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 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: 'gzdw',
// label: '单位',
// align: 'center',
// width: 150
// },
{
name: 'xb_dictText',
label: '性别',
align: 'center',
width: 60
},
{
name: 'nl',
label: '年龄',
align: 'center',
width: 60
},
{
name: 'operation',
type: 'operation',
fixed: true,
label: '操作',
align: 'center',
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
getRenyuanByDepID()
}
function departChange(e) {
departID.value = e
getRenyuanByDepID()
}
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 = [];
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 + '*';
}
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>