修改了人员统计三个页面相关界面和逻辑,增加照片显示

This commit is contained in:
廖德云 2025-02-16 00:17:48 +08:00 committed by ldeyun
parent cc6681cfb5
commit afe34fee9d
6 changed files with 860 additions and 894 deletions

95
package-lock.json generated
View File

@ -1,95 +0,0 @@
{
"name": "cxc-szcx-uniapp-master",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"dependencies": {
"@dcloudio/uni-ui": "^1.5.6",
"base-64": "^1.0.0",
"dayjs": "^1.11.13",
"echarts": "^5.6.0"
}
},
"node_modules/@dcloudio/uni-ui": {
"version": "1.5.6",
"resolved": "https://registry.npmjs.org/@dcloudio/uni-ui/-/uni-ui-1.5.6.tgz",
"integrity": "sha512-jmb98PasFvZkrIDXGh94GbdWg2/jyhgs1HUG+bU8eyL7Ltias/5XBz4q8w9RXyWUfqepJRqapPA2IIQpLCuTIg==",
"license": "Apache-2.0"
},
"node_modules/base-64": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/base-64/-/base-64-1.0.0.tgz",
"integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg=="
},
"node_modules/dayjs": {
"version": "1.11.13",
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz",
"integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg=="
},
"node_modules/echarts": {
"version": "5.6.0",
"resolved": "https://registry.npmmirror.com/echarts/-/echarts-5.6.0.tgz",
"integrity": "sha512-oTbVTsXfKuEhxftHqL5xprgLoc0k7uScAwtryCgWF6hPYFLRwOUHiFmHGCBKP5NPFNkDVopOieyUqYGH8Fa3kA==",
"license": "Apache-2.0",
"dependencies": {
"tslib": "2.3.0",
"zrender": "5.6.1"
}
},
"node_modules/tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==",
"license": "0BSD"
},
"node_modules/zrender": {
"version": "5.6.1",
"resolved": "https://registry.npmmirror.com/zrender/-/zrender-5.6.1.tgz",
"integrity": "sha512-OFXkDJKcrlx5su2XbzJvj/34Q3m6PvyCZkVPHGYpcCJ52ek4U/ymZyfuV1nKE23AyBJ51E/6Yr0mhZ7xGTO4ag==",
"license": "BSD-3-Clause",
"dependencies": {
"tslib": "2.3.0"
}
}
},
"dependencies": {
"@dcloudio/uni-ui": {
"version": "1.5.6",
"resolved": "https://registry.npmjs.org/@dcloudio/uni-ui/-/uni-ui-1.5.6.tgz",
"integrity": "sha512-jmb98PasFvZkrIDXGh94GbdWg2/jyhgs1HUG+bU8eyL7Ltias/5XBz4q8w9RXyWUfqepJRqapPA2IIQpLCuTIg=="
},
"base-64": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/base-64/-/base-64-1.0.0.tgz",
"integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg=="
},
"dayjs": {
"version": "1.11.13",
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz",
"integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg=="
},
"echarts": {
"version": "5.6.0",
"resolved": "https://registry.npmmirror.com/echarts/-/echarts-5.6.0.tgz",
"integrity": "sha512-oTbVTsXfKuEhxftHqL5xprgLoc0k7uScAwtryCgWF6hPYFLRwOUHiFmHGCBKP5NPFNkDVopOieyUqYGH8Fa3kA==",
"requires": {
"tslib": "2.3.0",
"zrender": "5.6.1"
}
},
"tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
},
"zrender": {
"version": "5.6.1",
"resolved": "https://registry.npmmirror.com/zrender/-/zrender-5.6.1.tgz",
"integrity": "sha512-OFXkDJKcrlx5su2XbzJvj/34Q3m6PvyCZkVPHGYpcCJ52ek4U/ymZyfuV1nKE23AyBJ51E/6Yr0mhZ7xGTO4ag==",
"requires": {
"tslib": "2.3.0"
}
}
}
}

View File

@ -98,17 +98,17 @@
}); });
/*生产环境 begin */ /*生产环境 begin */
// loginApi({ loginApi({
// username: un, username: un,
// password: pw, password: pw,
// ip: getDeviceIp() ip: getDeviceIp()
/*生产环境 end */ /*生产环境 end */
/*开发环境 begin */ /*开发环境 begin */
localLoginApi({ // localLoginApi({
username: username.value, // username: username.value,
password: password.value, // password: password.value,
captcha: 'app' // captcha: 'app'
/*开发环境 end */ /*开发环境 end */
}).then((loginres) => { }).then((loginres) => {
if (loginres.success) { if (loginres.success) {

File diff suppressed because it is too large Load Diff

View File

@ -1,86 +1,112 @@
<template> <template>
<view> <view>
<view class="container" id="top1"> <view class="container" id="top1">
<uni-row style="margin-bottom: 10rpx; margin-left: 30rpx; margin-right: 30rpx"> <uni-row style="margin-bottom: 10px">
<uni-col :span="5"><uni-title :title="'选择单位'" align="left" type="h4"></uni-title></uni-col> <uni-col :span="5"><uni-title :title="'选择单位'" align="left" type="h4"></uni-title></uni-col>
<uni-col :span="19"> <uni-col :span="19">
<trq-depart-select v-model="selectedOrgCode" returnCodeOrID="orgCode" <trq-depart-select v-model="selectedOrgCode" returnCodeOrID="orgCode"
@change="onOrgCodeChange"></trq-depart-select> @change="onOrgCodeChange"></trq-depart-select>
</uni-col> </uni-col>
</uni-row> </uni-row>
<uni-row style="margin-bottom: 10px">
<uni-row style="margin-bottom: 20rpx; margin-left: 30rpx; margin-right: 30rpx">
<uni-col :span="5"><uni-title :title="'选择字段'" align="left" type="h4"></uni-title></uni-col> <uni-col :span="5"><uni-title :title="'选择字段'" align="left" type="h4"></uni-title></uni-col>
<uni-col :span="19"> <uni-col :span="12">
<uni-data-select v-model="selectedField" :localdata="fieldList" <uni-data-select v-model="selectedField" :localdata="fieldList"
@change="onFieldChange"></uni-data-select> @change="onFieldChange"></uni-data-select>
</uni-col> </uni-col>
</uni-row> </uni-row>
</view> </view>
<!-- ECharts图表 --> <!-- ECharts图表 -->
<view class="chart-container"> <view class="chart-container">
<l-echart ref="chart" @finished="initChart" /> <l-echart ref="chart" @finished="initChart" />
</view> </view>
<!-- 翻页按钮 --> <!-- 翻页按钮 -->
<view style="display: flex; justify-content: center; margin-top: 10px"> <view style="display: flex; justify-content: center; margin-top: 10px">
<button @click="prevPage" :disabled="currentPage === 1" size="mini">上一页</button> <button @click="prevPage" :disabled="currentPage === 1" size="mini">上一页</button>
<button @click="nextPage" :disabled="currentPage * pageSize >= chartDataCount.value" <button @click="nextPage" :disabled="currentPage * pageSize >= chartDataCount.value"
size="mini">下一页</button> size="mini">下一页</button>
</view> </view>
<!-- 数据表格 --> <!-- 数据表格 -->
<uni-row style="margin-top: 10px; margin-left: 20px; margin-right: 20px" v-if="personnelList.length > 0">
<uni-row style="margin-top: 10px; margin-left: 30rpx; margin-right: 30rpx" v-if="personnelList.length > 0"> <uni-col :span="2">
<uni-col :span="3">
<view class="titleStyle">序号</view> <view class="titleStyle">序号</view>
</uni-col> </uni-col>
<uni-col :span="5"> <uni-col :span="4">
<view class="titleStyle">姓名</view> <view class="titleStyle">姓名</view>
</uni-col> </uni-col>
<uni-col :span="5"> <uni-col :span="5">
<view class="titleStyle">基层单位</view> <view class="titleStyle">基层单位</view>
</uni-col> </uni-col>
<uni-col :span="5"> <uni-col :span="5" v-if="selectedField.value !== 'zjmc'">
<view class="titleStyle">基层班组</view>
</uni-col>
<uni-col :span="5" v-else>
<view class="titleStyle">岗位</view>
</uni-col>
<uni-col :span="4">
<view class="titleStyle">年龄</view> <view class="titleStyle">年龄</view>
</uni-col> </uni-col>
<uni-col :span="6"> <uni-col :span="4">
<view class="titleStyle">操作</view> <view class="titleStyle">操作</view>
</uni-col> </uni-col>
</uni-row> </uni-row>
<scroll-view scroll-y :style="{ height: bottomHeight + 'px' }"> <scroll-view scroll-y :style="{ height: bottomHeight + 'px' }">
<uni-row style="margin-bottom: 10rpx; margin-left: 30rpx; margin-right: 30rpx"> <uni-row style="margin-bottom: 10px; margin-left: 20px; margin-right: 20px; font-size: 12px">
<view v-for="(item, index) in personnelList"> <view v-for="(item, index) in personnelList">
<uni-col :span="3"> <uni-col :span="2">
<view class="dataStyle"> <view class="dataStyle">
{{ index + 1 }} {{ index + 1 }}
</view> </view>
</uni-col> </uni-col>
<uni-col :span="5"> <uni-col :span="4">
<view class="dataStyle"> <view class="dataStyle">
{{ item.xm }} {{ item.xm }}
</view> </view>
</uni-col> </uni-col>
<uni-col :span="5"> <uni-col :span="5">
<view class="dataStyle"> <view class="dataStyle1">
{{ item.jcdw }}
</view>
</uni-col>
<uni-col :span="5" v-if="selectedField.value != 'zjmc'">
<view class="dataStyle1">
{{ item.jcxd }} {{ item.jcxd }}
</view> </view>
</uni-col> </uni-col>
<uni-col :span="5"> <uni-col :span="4" v-else>
<view class="dataStyle">
{{ item.sdgw }}
</view>
</uni-col>
<uni-col :span="4">
<view class="dataStyle"> <view class="dataStyle">
{{ item.nl }} {{ item.nl }}
</view> </view>
</uni-col> </uni-col>
<uni-col :span="6">
<uni-col :span="4">
<view class="dataStyle"> <view class="dataStyle">
<button size="mini" type="primary" @click="detail(item)">详情</button> <span @click="detail(item)">详情</span>
<!-- <button size="mini" type="primary" @click="detail(item)">详情</button> -->
</view> </view>
</uni-col> </uni-col>
</view> </view>
</uni-row> </uni-row>
</scroll-view> </scroll-view>
<uni-popup ref="showPopup" type="bottom" border-radius="10px 10px 0 0">
<uni-card>
<uni-title :title="'已选证书:'" align="left" type="h4"></uni-title>
<view style="color: red;font-weight: 300;margin-bottom: 10px;">{{dictData}}</view>
<scroll-view scroll-y style="height: 40vh;">
<view>
<cxc-szcx-dictSelect :dictCode="dictCode" @change="dictChange"></cxc-szcx-dictSelect>
</view>
</scroll-view>
</uni-card>
</uni-popup>
</view> </view>
</template> </template>
@ -91,7 +117,7 @@
onMounted, onMounted,
computed computed
} from 'vue'; } from 'vue';
import * as echarts from 'echarts'; import * as echarts from 'echarts/dist/echarts.min'; // EChartsH5
import { import {
cxcRyDatAstatistics, cxcRyDatAstatistics,
cxcRyDatAstatisticsCertificate, cxcRyDatAstatisticsCertificate,
@ -107,14 +133,15 @@
text: '取证情况', text: '取证情况',
value: 'zjmc', value: 'zjmc',
isDict: false, isDict: false,
dictCode: 'gzrlzy' dictCode: 'gzrlzy',
}, },
{ {
text: '岗位类别', text: '岗位类别',
value: 'gwlb', value: 'gwlb',
isDict: false, isDict: false,
dictCode: '' dictCode: ''
}, { },
{
text: '性别', text: '性别',
value: 'xb', value: 'xb',
isDict: true, isDict: true,
@ -135,6 +162,8 @@
]); // ]); //
const dictCode = ref(''); const dictCode = ref('');
const dictData = ref('');
const showPopup = ref(null);
const fieldisDict = ref(true); const fieldisDict = ref(true);
const selectedOrgCode = ref(''); // orgCode const selectedOrgCode = ref(''); // orgCode
@ -164,11 +193,15 @@
} }
onMounted(() => { onMounted(() => {
// #ifdef APP
getHeight(); getHeight();
// #endif
}); });
// #ifdef APP
const dictChange = (e) => {
console.log(e)
dictData.value = e
}
const getHeight = () => { const getHeight = () => {
// //
@ -188,7 +221,7 @@
.exec(); .exec();
}; };
// #endif
// ECharts length departChange // ECharts length departChange
// //
const initChart = () => { const initChart = () => {
@ -675,14 +708,15 @@
let res = []; let res = [];
chartData.value = []; chartData.value = [];
try { try {
if (selectedField.value === 'zjmc') {
if (selectedField.value === "zjmc") { console.log(dictCode.value);
console.log(dictCode.value) console.log(dictData.value);
res = await cxcRyDatAstatisticsCertificate({ res = await cxcRyDatAstatisticsCertificate({
orgCode: selectedOrgCode.value, orgCode: selectedOrgCode.value,
field: selectedField.value, field: selectedField.value,
dictCode: dictCode.value, dictCode: dictCode.value,
fieldisDict: fieldisDict.value fieldisDict: fieldisDict.value,
typeOfWorkList: dictData.value
}); });
} else { } else {
res = await cxcRyDatAstatistics({ res = await cxcRyDatAstatistics({
@ -740,7 +774,7 @@
// //
const onOrgCodeChange = (e, data) => { const onOrgCodeChange = (e, data) => {
personnelList.value = [] personnelList.value = [];
selectedOrgCode.value = e; selectedOrgCode.value = e;
// console.log(data.value.title); // console.log(data.value.title);
selectedOrgCodeLabel.value = data.value.title; selectedOrgCodeLabel.value = data.value.title;
@ -748,7 +782,8 @@
}; };
const onFieldChange = (e) => { const onFieldChange = (e) => {
personnelList.value = []
personnelList.value = [];
// console.log(e); // console.log(e);
try { try {
selectedField.value = e; selectedField.value = e;
@ -761,6 +796,9 @@
fieldisDict.value = element.isDict; fieldisDict.value = element.isDict;
} }
} }
if (selectedField.value === 'zjmc') {
showPopup.value.open()
}
fetchStatisticsData(); fetchStatisticsData();
} catch (error) { } catch (error) {
//TODO handle the exception //TODO handle the exception
@ -769,7 +807,7 @@
}; };
const onChartClick = (e) => { const onChartClick = (e) => {
personnelList.value = [] personnelList.value = [];
const { const {
ldhth ldhth
} = chartData.value; } = chartData.value;
@ -791,29 +829,29 @@
/* 全局容器 */ /* 全局容器 */
.container { .container {
margin: 10rpx 10rpx; margin: 10px 10px;
padding: 10rpx; padding: 10px;
background: linear-gradient(145deg, #f5f9ff, var(--light-blue)); background: linear-gradient(145deg, #f5f9ff, var(--light-blue));
border-radius: 24rpx; border-radius: 12px;
box-shadow: 0 8rpx 24rpx rgba(64, 158, 255, 0.15); box-shadow: 0 4px 12px rgba(64, 158, 255, 0.15);
border: 2rpx solid rgba(64, 158, 255, 0.1); border: 1px solid rgba(64, 158, 255, 0.1);
} }
/* 图表容器 */ /* 图表容器 */
.chart-container { .chart-container {
height: 250px; height: 250px;
margin: 20rpx 0; margin: 10px 0;
border-radius: 24rpx; border-radius: 12px;
overflow: hidden; overflow: hidden;
background: #ffffff; background: #ffffff;
box-shadow: 0 8rpx 32rpx rgba(64, 158, 255, 0.12); box-shadow: 0 4px 16px rgba(64, 158, 255, 0.12);
border: 2rpx solid rgba(64, 158, 255, 0.08); border: 1px solid rgba(64, 158, 255, 0.08);
} }
/* 表格标题行 */ /* 表格标题行 */
.titleStyle { .titleStyle {
font-size: 12px; font-size: 10px;
color: #747474; color: #747474;
line-height: 30px; line-height: 30px;
height: 30px; height: 30px;
@ -826,11 +864,21 @@
/* 内容样式 */ /* 内容样式 */
.dataStyle { .dataStyle {
max-font-size: 14px; font-size: 10px;
/* 最大字体限制 */ color: #00007f;
min-font-size: 10px; line-height: 30px;
/* 最小字体限制 */ height: 30px;
font-size: 12px; font-weight: 500;
text-align: center;
vertical-align: middle;
border-bottom: 1px solid #919191;
border-left: 1px solid #919191;
text-overflow: ellipsis;
}
/* 内容样式 */
.dataStyle1 {
font-size: 8px;
color: #00007f; color: #00007f;
line-height: 30px; line-height: 30px;
height: 30px; height: 30px;
@ -845,13 +893,13 @@
/* 滚动区域 */ /* 滚动区域 */
scroll-view { scroll-view {
background: #ffffff; background: #ffffff;
border-radius: 0 0 16rpx 16rpx; border-radius: 0 0 8px 8px;
box-shadow: 0 8rpx 24rpx rgba(0, 35, 111, 0.08); box-shadow: 0 4px 12px rgba(0, 35, 111, 0.08);
} }
/* 输入框聚焦效果 */ /* 输入框聚焦效果 */
.trq-depart-select:focus-within { .trq-depart-select:focus-within {
box-shadow: 0 0 0 4rpx rgba(64, 158, 255, 0.2); box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
border-color: var(--primary-blue); border-color: var(--primary-blue);
} }
@ -859,7 +907,7 @@
@keyframes fadeIn { @keyframes fadeIn {
from { from {
opacity: 0; opacity: 0;
transform: translateY(20rpx); transform: translateY(10px);
} }
to { to {
@ -874,28 +922,28 @@
/* 自定义滚动条美化 */ /* 自定义滚动条美化 */
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 8rpx; width: 4px;
background: rgba(64, 158, 255, 0.05); background: rgba(64, 158, 255, 0.05);
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
background: linear-gradient(45deg, var(--primary-blue), var(--deep-blue)); background: linear-gradient(45deg, var(--primary-blue), var(--deep-blue));
border-radius: 12rpx; border-radius: 6px;
border: 2rpx solid white; border: 1px solid white;
} }
/* 筛选行间距优化 */ /* 筛选行间距优化 */
.filter-row { .filter-row {
margin: 30rpx 0; margin: 15px 0;
padding: 20rpx 0; padding: 10px 0;
border-radius: 16rpx; border-radius: 8px;
} }
/* 响应式调整优化 */ /* 响应式调整优化 */
@media (max-width: 768px) { @media (max-width: 768px) {
.chart-container { .chart-container {
height: 250px; height: 250px;
border-radius: 20rpx; border-radius: 10px;
} }
} }

View File

@ -1,228 +1,297 @@
<template> <template>
<view> <view class="container" id="top1">
<scroll-view :scroll-y="true" style="height: 100vh;"> <uni-card>
<uni-card> <view>
<view> <uni-row>
<uni-row> <uni-col :span="11"><uni-title title="姓名 " align="left" type="h5"></uni-title></uni-col>
<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-col :span="11" :push="2"><uni-title title="劳动合同号" align="left" </uni-row>
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-row> <uni-col :span="11" :push="2">
<uni-col :span="11"><uni-easyinput v-model="xm" suffixIcon="search" clearable <uni-easyinput v-model="ldhth" suffixIcon="search" clearable placeholder="劳动合同号模糊查询" @change="Search" @iconClick="Search" />
placeholder="姓名模糊查询" @change="Search" @iconClick="Search" /></uni-col> </uni-col>
<uni-col :span="11" :push="2"> </uni-row>
<uni-easyinput v-model="ldhth" suffixIcon="search" clearable placeholder="劳动合同号模糊查询" </view>
@change="Search" @iconClick="Search" /> <view style="margin-bottom: 10rpx">
</uni-col> <uni-row>
</uni-row> <uni-col :span="24"><uni-title title="所属单位" align="left" type="h5"></uni-title></uni-col>
</view> </uni-row>
<view style="margin-bottom: 10rpx;"> <uni-row>
<uni-row> <uni-col :span="24">
<uni-col :span="24"><uni-title title="所属单位" align="left" type="h5"></uni-title></uni-col> <trq-depart-select v-model="departID" returnCodeOrID="orgCode" @change="departChange"></trq-depart-select>
</uni-row> </uni-col>
<uni-row> </uni-row>
<uni-col :span="24"> </view>
<trq-depart-select v-model="departID" returnCodeOrID="orgCode" </uni-card>
@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> </view>
<uni-card>
<!-- 数据表格 -->
<uni-row v-if="ryDataList.length > 0">
<uni-col :span="3">
<view class="titleStyle">序号</view>
</uni-col>
<uni-col :span="5">
<view class="titleStyle">姓名</view>
</uni-col>
<uni-col :span="5">
<view class="titleStyle">性别</view>
</uni-col>
<uni-col :span="5">
<view class="titleStyle">年龄</view>
</uni-col>
<uni-col :span="6">
<view class="titleStyle">操作</view>
</uni-col>
</uni-row>
<scroll-view scroll-y :style="{ height: bottomHeight + 'px' }">
<uni-row>
<view v-for="(item, index) in ryDataList">
<uni-col :span="3">
<view class="dataStyle">
{{ index + 1 }}
</view>
</uni-col>
<uni-col :span="5">
<view class="dataStyle">
{{ item.xm }}
</view>
</uni-col>
<uni-col :span="5">
<view class="dataStyle">
{{ item.xb_dictText }}
</view>
</uni-col>
<uni-col :span="5">
<view class="dataStyle">
{{ item.nl }}
</view>
</uni-col>
<uni-col :span="6">
<view class="dataStyle">
<button size="mini" type="primary" @click="detail(item)">详情</button>
</view>
</uni-col>
</view>
</uni-row>
<view class="pagination">
<uni-pagination :current="current" :pagerCount="5" :total="total" prev-text="前一页" next-text="后一页" :show-icon="false" @change="pagechange" />
</view>
</scroll-view>
</uni-card>
</template> </template>
<script setup> <script setup>
import { import { onReady, onLoad } from '@dcloudio/uni-app';
onReady, import { reactive, ref, onMounted } from 'vue';
onLoad 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([]);
} from '@dcloudio/uni-app'; const bottomHeight = ref(0);
import { let status = ref('');
reactive, let contentText = reactive({
ref, contentdown: '点击查看更多',
onMounted contentrefresh: '加载中',
} from 'vue'; contentnomore: '没有更多'
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 pageNo = ref(1);
let contentText = reactive({ let pageSize = ref(10);
contentdown: '点击查看更多', let total = ref(0);
contentrefresh: '加载中', let pages = ref(0);
contentnomore: '没有更多' let current = ref(0);
}) let params = reactive({
pageNo: pageNo,
pageSize: pageSize
});
let pageNo = ref(1) onLoad((e) => {});
let pageSize = ref(10) onMounted((e) => {
let total = ref(0) // #ifdef APP
let pages = ref(0) getHeight();
let current = ref(0) // #endif
let params = reactive({ departID.value = '';
pageNo: pageNo, getRenyuanByDepID();
pageSize: pageSize });
})
let column = ref([{
label: '序号',
width: 60,
type: 'index',
color: 'blue',
align: 'center'
},
{ // #ifdef APP
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) => { const getHeight = () => {
//
}) const systemInfo = uni.getSystemInfoSync();
onMounted((e) => { const screenHeight = systemInfo.screenHeight;
departID.value = "" //
getRenyuanByDepID() const query = uni.createSelectorQuery();
}) //
query
function detail(record) { .select('#top1')
// console.log(record) .boundingClientRect((rect1) => {
uni.navigateTo({ //
url: "/pages/views/renliziyuan/renyuanxinxi/detail?data=" + encodeURIComponent(JSON.stringify(record)) const topComponentsHeight = rect1.height;
//
bottomHeight.value = screenHeight - topComponentsHeight - 415;
}) })
.exec();
};
// #endif
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;
} }
function pagechange(e) { getRenyuanByDepID(params);
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;
} }
function departChange(e, data) { getRenyuanByDepID(params);
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);
if (departID.value.length <= 6) {
console.log(123242353);
uni.showToast({
title: '全厂数据较多,请选 下一层级...',
icon: 'none',
duration: 1000
});
return;
} }
if (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 getRenyuanByDepID(queryParm) { function Search() {
ryDataList.value = [] ryDataList.value = [];
console.log(queryParm) let queryParm = {
queryRenyuanByDepartID(queryParm).then((res) => { pageNo: pageNo.value,
console.log(res) 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) { if (res.success) {
ryDataList.value = res.result.records ryDataList.value = res.result.records;
total.value = res.result.total total.value = res.result.total;
pages.value = res.result.pages pages.value = res.result.pages;
current.value = res.result.current
} }
}).catch((err) => {
console.log(err);
}) })
} .catch((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); console.log(err);
}) });
} }
</script> </script>
<style scoped> <style scoped>
.uni-group { /* 全局容器 */
display: flex; .container {
align-items: center; margin: 10rpx 10rpx;
} padding: 10rpx;
</style> background: linear-gradient(145deg, #ffaaff, var(--light-blue));
border-radius: 24rpx;
box-shadow: 0 8rpx 24rpx rgba(64, 158, 255, 0.15);
border: 2rpx solid rgba(64, 158, 255, 0.1);
}
.uni-group {
display: flex;
align-items: center;
}
.titleStyle {
font-size: 12px;
color: #747474;
line-height: 30px;
height: 30px;
background: #f2f9fc;
text-align: center;
vertical-align: middle;
border-left: 1px solid #919191;
border-bottom: 1px solid #919191;
}
/* 内容样式 */
.dataStyle {
font-size: 12px;
color: #00007f;
line-height: 30px;
height: 30px;
font-weight: 500;
text-align: center;
vertical-align: middle;
border-bottom: 1px solid #919191;
border-left: 1px solid #919191;
text-overflow: ellipsis;
}
/* 内容样式 */
.pagination {
font-size: 16px;
color: #00007f;
line-height: 30px;
height: 30px;
font-weight: 500;
text-align: center;
vertical-align: middle;
text-overflow: ellipsis;
}
</style>

View File

@ -1,9 +1,9 @@
<template> <template>
<uni-row> <uni-row>
<view v-for="(item,index) in data"> <view v-for="(item, index) in data">
<uni-col :span="item.titleSpan"> <uni-col :span="item.titleSpan">
<view class="titleStyle"> <view class="titleStyle">
{{item.title}} {{ item.title }}
</view> </view>
</uni-col> </uni-col>
<uni-col :span="item.valueSpan"> <uni-col :span="item.valueSpan">
@ -11,110 +11,107 @@
{{ doEmptyString(item.value) }} {{ doEmptyString(item.value) }}
</view> </view>
</uni-col> </uni-col>
</view> </view>
</uni-row> </uni-row>
</template> </template>
<script> <script>
export default { export default {
props: { props: {
// //
cellData: { cellData: {
type: Object, type: Object,
default: () => [{ default: () => [
title: "", {
value: "", title: '',
value: '',
titleSpan: 4, titleSpan: 4,
valueSpan: 4 valueSpan: 4
}] }
}, ]
// title value
rowDataCount: {
type: Number,
default: 3
}
}, },
data() { // title value
return { rowDataCount: {
data: [] type: Number,
} default: 3
}, }
watch: { },
cellData: { data() {
deep: true, return {
immediate: true, data: []
handler(val) { };
let totalSpan = 0; },
for (var i = 0; i < val.length; i++) { // 24 watch: {
if ((i + 1) % this.rowDataCount != 0) { cellData: {
totalSpan = totalSpan + val[i].titleSpan + val[i].valueSpan deep: true,
} else { immediate: true,
val[i].valueSpan = 24 - totalSpan - val[i].titleSpan; handler(val) {
totalSpan = 0; let totalSpan = 0;
} for (var i = 0; i < val.length; i++) {
// 24
if ((i + 1) % this.rowDataCount != 0) {
totalSpan = totalSpan + val[i].titleSpan + val[i].valueSpan;
} else {
val[i].valueSpan = 24 - totalSpan - val[i].titleSpan;
totalSpan = 0;
} }
this.data = val;
// console.log(this.data)
} }
this.data = val;
// console.log(this.data)
} }
}, }
methods: { },
/// methods: {
doEmptyString(obj) { ///
let str = '/'; doEmptyString(obj) {
if (typeof(obj) == "undefined" || (obj) === null || (obj) === '') { let str = '/';
return str; if (typeof obj == 'undefined' || obj === null || obj === '' || obj === 'Na' || obj === 'N' || obj === '0') {
} return str;
return obj + '';
} }
return obj + '';
} }
} }
};
</script> </script>
<style scoped> <style scoped>
/* 标签样式 */ /* 标签样式 */
.titleStyle { .titleStyle {
font-size: 12px; font-size: 10px;
color: #747474; color: #747474;
line-height: 30px; line-height: 30px;
height: 30px; height: 30px;
background: #F2F9FC; background: #f2f9fc;
text-align: center; text-align: center;
vertical-align: middle; vertical-align: middle;
border-left: 1px solid #919191; border-left: 1px solid #919191;
border-right: 1px solid #919191; border-right: 1px solid #919191;
border-bottom: 1px solid #919191; border-bottom: 1px solid #919191;
; }
}
/* 内容样式 */ /* 内容样式 */
.dataStyle { .dataStyle {
font-size: 12px;
color: #00007f;
line-height: 35px;
height: 30px;
font-weight: 500;
text-align: center;
vertical-align: middle;
border-bottom: 1px solid #919191;
text-overflow: ellipsis;
overflow: hidden;
}
font-size: 14px; /* 内容样式 */
color: #00007f; .dataStyle1 {
line-height: 35px; font-size: 10px;
height: 30px; color: #00007f;
font-weight: 500; line-height: 15px;
text-align: center; height: 30px;
vertical-align: middle; font-weight: 500;
border-bottom: 1px solid #919191; text-align: center;
text-overflow: ellipsis; vertical-align: middle;
overflow: hidden; border-bottom: 1px solid #919191;
} text-overflow: ellipsis;
overflow: hidden;
/* 内容样式 */ }
.dataStyle1 { </style>
font-size: 12px;
color: #00007f;
line-height: 15px;
height: 30px;
font-weight: 500;
text-align: center;
vertical-align: middle;
border-bottom: 1px solid #919191;
text-overflow: ellipsis;
overflow: hidden;
}
</style>