cxc-szcx-uniapp/pages/views/renliziyuan/renyuanxinxi/taizhang.vue

183 lines
3.8 KiB
Vue

<template>
<view>
<scroll-view :scroll-y="true">
<uni-card>
<uni-title title="" type="h1" align="center"></uni-title>
<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" focus suffixIcon="search" placeholder="姓名模糊查询"
@change="Search" @iconClick="Search" /></uni-col>
<uni-col :span="11" :push="2">
<uni-easyinput v-model="ldhth" focus suffixIcon="search" 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>
{{rrr}}
<zb-table :show-header="true" :highlight="true" :columns="column" :stripe="true" :fit="false"
:border="true" :data="ryDataList"></zb-table>
</uni-card>
</scroll-view>
<uni-load-more :status="status" :content-text="contentText"></uni-load-more>
</view>
</template>
<script setup>
import {
onReady,
onLoad
} from '@dcloudio/uni-app';
import {
reactive,
ref
} 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
let ryDataList = ref([])
let rrr=ref("")
let status = ref("false")
let contentText = reactive({
contentdown: '点击查看更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
})
let pageNo = ref(1)
let pageSize = ref(10)
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',
label: '操作',
align: 'center',
renders: [{
name: '详情',
func: 'detail',
size: 'mini'
}]
}
])
onLoad((e) => {
})
function detail() {
}
function departChange (e){
ryDataList = []
departID.value = e
let queryParm = {
pageNo: pageNo.value,
pageSize: pageSize.value
};
queryParm.orgCode = departID.value
queryRenyuanByDepartID(queryParm).then((res) => {
if (res.success) {
ryDataList.value = res.result.records
rrr.value=ryDataList[0].xm
console.log(ryDataList)
}
}).catch((err) => {
console.log(err);
})
}
const Search = () => {
ryDataList = [];
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 = res.result.records
console.log(ryDataList)
}
}).catch((err) => {
console.log(err);
})
}
</script>
<style scoped>
.uni-group {
display: flex;
align-items: center;
}
</style>