Merge remote-tracking branch 'origin/main'

This commit is contained in:
luozhun 2024-09-13 15:19:24 +08:00
commit 6ad6c95225
13 changed files with 253 additions and 46 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -9,16 +9,17 @@ export default defineAppConfig({
], ],
window: { window: {
backgroundTextStyle: 'light', backgroundTextStyle: 'light',
navigationBarBackgroundColor: '#f7f8fa', navigationBarBackgroundColor: '#4e87ff',
navigationBarTitleText: '', navigationBarTitleText: '',
navigationBarTextStyle: 'black', navigationBarTextStyle:'white',
backgroundColor: "#008080"
}, },
subpackages: [ subpackages: [
{ {
root: "subPages", root: "subPages",
pages: [ pages: [
'pages/policeManager/index', 'pages/policeManager/index',
'pages/policeDetails/index',
'pages/myProject/myProject', 'pages/myProject/myProject',
'pages/projectDetails/projectDetails', 'pages/projectDetails/projectDetails',
'pages/form/form' 'pages/form/form'

View File

@ -59,7 +59,6 @@ import Taro, {useLoad} from "@tarojs/taro";
const showPicker = ref(false) const showPicker = ref(false)
const formData = ref<formDate>({ const formData = ref<formDate>({
snowFlakeId:'', snowFlakeId:'',
serviceProjectId:'',
name: '', name: '',
workPost:'', workPost:'',
sex:0, sex:0,
@ -70,6 +69,7 @@ const formData = ref<formDate>({
remark:'', remark:'',
homeAddress: '' homeAddress: ''
}) })
const serviceProjectId = ref('')
const pickerValue = ref(new Date()) const pickerValue = ref(new Date())
const formRef = ref(null) const formRef = ref(null)
@ -94,7 +94,7 @@ const rules: FormRules = {
}; };
useLoad((options)=>{ useLoad((options)=>{
formData.value.serviceProjectId = JSON.parse(options.item).snowFlakeId serviceProjectId.value = JSON.parse(options.item).snowFlakeId
}) })
const openDate = ()=>{ const openDate = ()=>{
showPicker.value = true showPicker.value = true
@ -121,7 +121,7 @@ const submit = () => {
formRef.value?.validate().then(({valid, errors}) => { formRef.value?.validate().then(({valid, errors}) => {
if (valid) { if (valid) {
const saveOrUpdateSecurityUserParams = { const saveOrUpdateSecurityUserParams = {
serviceProjectId:formData.value.serviceProjectId, serviceProjectId:serviceProjectId.value,
name: formData.value.name, name: formData.value.name,
workPost:formData.value.workPost, workPost:formData.value.workPost,
sex:formData.value.sex, sex:formData.value.sex,
@ -141,7 +141,6 @@ const submit = () => {
}).then() }).then()
formData.value = { formData.value = {
snowFlakeId:'', snowFlakeId:'',
serviceProjectId:formData.value.serviceProjectId,
name: '', name: '',
workPost:'', workPost:'',
sex:0, sex:0,

View File

@ -0,0 +1,4 @@
export default definePageConfig({
navigationBarTitleText: '项目详情',
})

View File

@ -0,0 +1,53 @@
.projectDetails{
height: 100vh;
overflow: hidden;
background: #f1f1f1;
display: flex;
flex-direction: column;
.projectDetailsItem{
height: 18%;
margin: 20px;
border-radius: 10px;
background: #ffffff;
padding: 15px;
font-size: 28px;
line-height: 65px;
color: #333333;
.projectDetailsIndex{
.content{
color: #9b9b9f;
}
}
}
.projectDetailsTableDrop{
height: 80%;
.projectDetailsTable{
margin: 20px;
border-radius: 10px;
background: #ffffff;
padding: 15px;
font-size: 28px;
line-height: 50px;
color: #333333;
.projectDetailsTableItem{
//display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
font-size: 24px;
margin-bottom: 15px
}
}
}
.projectDetailsButton{
position: fixed;
bottom: 19px;
display: flex;
-webkit-justify-content: space-around;
margin-bottom: 10rpx;
right: 0;
width: 100%;
}
}

View File

@ -0,0 +1,133 @@
<template>
<view class="projectDetails">
<view class="projectDetailsItem">
<view style="display: flex;justify-content: space-between">
<text style="font-size: 18px">{{ nameValue ? nameValue : '' }}{{ '-----' + detailsList?.name }}项目</text>
<!--<text>进行中</text>-->
</view>
<view class="projectDetailsIndex">
<nut-row>
<nut-col :span="12">
<view class="content">工作人员数量:{{ detailsList?.staffTotal }}</view>
</nut-col>
<nut-col :span="12">
<view class="content">保安人员数量:{{ detailsList?.securityUserTotal }}</view>
</nut-col>
</nut-row>
<nut-row>
<nut-col :span="12">
<view class="content">服务区域面积:{{ detailsList?.serviceArea }}</view>
</nut-col>
<nut-col :span="12">
<view class="content">楼栋数量:{{ detailsList?.buildingTotal }}</view>
</nut-col>
</nut-row>
<nut-row>
<nut-col :span="16">
<view class="content">证件号{{ detailsList?.idNumber }}</view>
</nut-col>
<nut-col :span="8">
<view class="content">户数:{{ detailsList?.houseTotal }}</view>
</nut-col>
</nut-row>
</view>
</view>
<!--表格-->
<view class="projectDetailsTableDrop">
<view style="padding: 0 12px">项目人员</view>
<scroll-view :scroll-y="true" style="height: 80%;" @scrolltoupper="upper" @scrolltolower="lower"
:scroll-into-view="toView" :scroll-top="scrollTop" :refresherEnabled="true"
@refresherrefresh="onRefresherRefresh" :refresher-triggered="isRefresher"
>
<view class="projectDetailsTable" v-for="(item,index) in projectData" :key="index">
<view>
<view class="projectDetailsTableItem">
<view>
<view style="display: flex;justify-content: space-between">
<text>姓名:{{ item?.name ? item?.name : '创建者' }}</text>
<text>性别:{{ item.sex?.label ? item.sex?.label : ' 隐藏' }}</text>
<text>职位:{{ item.workPost ? item.workPost : '创建者' }}</text>
</view>
<view style="display: flex;justify-content: space-between">
<text>保安证件:{{ item.securityNumber ? item.securityNumber : '125241256451' }}</text>
<text>出生年月:{{ dayjs(item.dateOfBirth).format('YYYY-MM-DD') }}</text>
</view>
<view style="display: flex;justify-content: space-between">
<text>创建时间:{{ item.createTime }}</text>
<text>身份证:{{ item.idCard }}</text>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
</template>
<script setup lang="ts">
import Taro, {useLoad} from "@tarojs/taro";
import './index.scss'
import {ref} from "vue";
import api from "@/request/index";
import * as dayjs from 'dayjs'
const detailsList = ref()
const nameValue = ref('')
const projectData = ref<Records<string>[]>([])
useLoad(async (options: MyProjectList) => {
nameValue.value = options.name
detailsList.value = await JSON.parse(options.item)
await projectDetailsTable()
})
const projectDetailsTable = async () => {
// if (total.value === projectData.value.length) return
Taro.showLoading({
title: '加载中',
})
const queryParams = {
params: {
serviceProjectId: detailsList.value?.snowFlakeId,
},
page: {
size: 4,
current: current.value
}
}
const resp = await api.post<ProjectData>('/miniProgramUser/securityUserPager', queryParams)
projectData.value = [...projectData.value, ...resp?.data.records]
total.value = resp?.data.total
isRefresher.value = false
Taro.hideLoading()
}
const formAdd = () => {
Taro.navigateTo({url: `/subPages/pages/form/form?item=${JSON.stringify(detailsList.value)}`})
}
const total = ref<any>(null)
const current = ref(1)
const isRefresher = ref(false)
const scrollTop = ref(0)
const toView = ref('demo2')
const upper = (e) => {
console.log('到顶了:', e)
}
// /
const lower = (e) => {
if (total.value === projectData.value.length) return
if (total.value > projectData.value.length) {
console.log('触底了:', e)
current.value = current.value + 1
projectDetailsTable()
}
}
//
const onRefresherRefresh = (e) => {
projectData.value = []
total.value = null
current.value = 1 //
isRefresher.value = true
console.log('自定义下拉刷新被触发:', e)
projectDetailsTable()
}
</script>

View File

@ -13,7 +13,9 @@
<text>电话{{ item?.contactPersonInfo.telephone }}</text> <text>电话{{ item?.contactPersonInfo.telephone }}</text>
</view> </view>
<view class="project"> <view class="project">
<view v-for="(items,index) in item.serviceProjectList" :key="index">{{ items.name }}</view> <view @click="projectClick(items,item?.name)" v-for="(items,index) in item.serviceProjectList" :key="index">
{{ items.name }}
</view>
</view> </view>
</view> </view>
</view> </view>
@ -25,16 +27,24 @@ import {onMounted, ref} from "vue";
import Taro from "@tarojs/taro"; import Taro from "@tarojs/taro";
import './index.scss' import './index.scss'
const myProjectList = ref<myProjectList[]>() const myProjectList = ref<MyProjectList[]>()
const getMyServiceProject = async () => { const getMyServiceProject = async () => {
const token = Taro.getStorageSync('token') const token = Taro.getStorageSync('token')
const resp = await api.get<myProjectList[]>(`/policeIndex/getUnitServiceProjectList`, { const resp = await api.get<MyProjectList[]>(`/policeIndex/getUnitServiceProjectList`, {
token: token.value token: token.value
}) })
myProjectList.value = resp.data myProjectList.value = resp.data
console.log(resp.data) console.log(resp.data)
} }
const projectClick = (items: ServiceProjectList, name: string) => {
console.log(name, JSON.stringify(items))
Taro.navigateTo({
url: `/subPages/pages/policeDetails/index?name=${name}&item=${JSON.stringify(items)}`,
})
}
onMounted(async () => { onMounted(async () => {
await getMyServiceProject() await getMyServiceProject()
}) })

View File

@ -5,6 +5,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.projectDetailsItem{ .projectDetailsItem{
height: 18%;
margin: 20px; margin: 20px;
border-radius: 10px; border-radius: 10px;
background: #ffffff; background: #ffffff;
@ -19,17 +20,17 @@
} }
} }
.projectDetailsTableDrop{ .projectDetailsTableDrop{
height: 500px; height: 80%;
.projectDetailsTable{ .projectDetailsTable{
margin: 20px; margin: 20px;
border-radius: 10px; border-radius: 10px;
background: #ffffff; background: #ffffff;
padding: 15px; padding: 15px;
font-size: 28px; font-size: 28px;
line-height: 65px; line-height: 50px;
color: #333333; color: #333333;
.projectDetailsTableItem{ .projectDetailsTableItem{
display: flex; //display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
flex-wrap: wrap; flex-wrap: wrap;
@ -38,12 +39,14 @@
} }
} }
} }
.projectDetailsButton{ .projectDetailsButton{
position: fixed;
bottom: 19px;
display: flex; display: flex;
margin-top: auto; -webkit-justify-content: space-around;
justify-content: space-around; margin-bottom: 10rpx;
margin-bottom: 30px right: 0;
width: 100%;
} }
} }

View File

@ -34,31 +34,38 @@
</view> </view>
<!--表格--> <!--表格-->
<view class="projectDetailsTableDrop"> <view class="projectDetailsTableDrop">
<view>项目人员</view> <view style="padding: 0 12px">项目人员</view>
<scroll-view :scroll-y="true" style="height: 500rpx;" @scrolltoupper="upper" @scrolltolower="lower" <scroll-view :scroll-y="true" style="height: 80%;" @scrolltoupper="upper" @scrolltolower="lower"
@scroll="scroll" :scroll-into-view="toView" :scroll-top="scrollTop" refresherEnabled="true" :scroll-into-view="toView" :scroll-top="scrollTop" :refresherEnabled="true"
@refresherrefresh="onRefresherRefresh" :refresher-triggered="isRefresher" @refresherrefresh="onRefresherRefresh" :refresher-triggered="isRefresher"
> >
<view class="projectDetailsTable"> <view class="projectDetailsTable" v-for="(item,index) in projectData" :key="index">
<view style="border: 1px solid #ccc" v-for="(item,index) in projectData" :key="index"> <view>
<view class="projectDetailsTableItem"> <view class="projectDetailsTableItem">
<text>姓名:{{ item?.name }}</text> <view>
<text>性别:{{ item.sex.label }}</text> <view style="display: flex;justify-content: space-between">
<text>职位:{{ item.workPost }}</text> <text>姓名:{{ item?.name?item?.name:'创建者' }}</text>
<text>保安证件:{{ item.securityNumber }}</text> <text>性别:{{ item.sex?.label?item.sex?.label:' 隐藏' }}</text>
<text>地址:{{ item.homeAddress }}</text> <text>职位:{{ item.workPost?item.workPost:'创建者' }}</text>
<text>出生年月:{{ item.dateOfBirth }}</text> </view>
<view style="display: flex;justify-content: space-between">
<text>保安证件:{{ item.securityNumber?item.securityNumber:'125241256451' }}</text>
<text>出生年月:{{ dayjs(item.dateOfBirth).format('YYYY-MM-DD')}}</text>
</view>
<view style="display: flex;justify-content: space-between">
<text>创建时间:{{ item.createTime }}</text> <text>创建时间:{{ item.createTime }}</text>
<text>身份证:{{ item.idCard }}</text> <text>身份证:{{ item.idCard }}</text>
</view> </view>
</view> </view>
<view>
<nut-button style="width: 25%" size="small" type="info">删除</nut-button>
</view>
</view>
</view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<view class="projectDetailsButton"> <view class="projectDetailsButton">
<nut-button style="width: 45%" type="info" @click="formAdd">项目人员录入</nut-button> <nut-button style="width: 45%" type="info" @click="formAdd">项目人员录入</nut-button>
<nut-button style="width: 45%" type="info">二维码录入</nut-button> <nut-button style="width: 45%" type="info">二维码录入</nut-button>
@ -70,10 +77,10 @@ import Taro, {useLoad} from "@tarojs/taro";
import './projectDetails.scss' import './projectDetails.scss'
import {ref} from "vue"; import {ref} from "vue";
import api from "@/request/index"; import api from "@/request/index";
import * as dayjs from 'dayjs'
const detailsList = ref() const detailsList = ref()
const nameValue = ref('') const nameValue = ref('')
const projectData = ref<Records[]>([]) const projectData = ref<Records<string>[]>([])
useLoad(async (options: MyProjectList) => { useLoad(async (options: MyProjectList) => {
nameValue.value = options.name nameValue.value = options.name
detailsList.value = await JSON.parse(options.item) detailsList.value = await JSON.parse(options.item)
@ -89,7 +96,7 @@ const projectDetailsTable = async () => {
serviceProjectId: detailsList.value?.snowFlakeId, serviceProjectId: detailsList.value?.snowFlakeId,
}, },
page: { page: {
size: 2, size: 4,
current: current.value current: current.value
} }
} }
@ -102,7 +109,7 @@ const projectDetailsTable = async () => {
const formAdd = () => { const formAdd = () => {
Taro.navigateTo({url: `/subPages/pages/form/form?item=${JSON.stringify(detailsList.value)}`}) Taro.navigateTo({url: `/subPages/pages/form/form?item=${JSON.stringify(detailsList.value)}`})
} }
const total = ref(null) const total = ref<any>(null)
const current = ref(1) const current = ref(1)
const isRefresher = ref(false) const isRefresher = ref(false)
const scrollTop = ref(0) const scrollTop = ref(0)
@ -130,10 +137,6 @@ const onRefresherRefresh = (e) => {
console.log('自定义下拉刷新被触发:', e) console.log('自定义下拉刷新被触发:', e)
projectDetailsTable() projectDetailsTable()
} }
const scroll = (e) => {
// console.log('scroll:', e)
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@ -1,6 +1,5 @@
interface formDate { interface formDate {
snowFlakeId?:string; snowFlakeId?:string;
serviceProjectId:string;
name: string; name: string;
workPost?:string; workPost?:string;
sex:number; sex:number;

View File

@ -1,5 +1,5 @@
interface LoginUserInfo { interface LoginUserInfo {
name?: string; clientType?: string;
avatar?: string; avatar?: string;
} }

View File

@ -1,4 +1,5 @@
interface MyProjectList { interface MyProjectList {
item?:any,
address?: string; address?: string;
city?: string; city?: string;
cityName?: string; cityName?: string;

View File

@ -1,4 +1,4 @@
interface Records{ interface Records<T>{
createTime?: string; createTime?: string;
dateOfBirth?: string; dateOfBirth?: string;
homeAddress?: string; homeAddress?: string;
@ -13,12 +13,13 @@ interface Records{
workPost?:string; workPost?:string;
sex?:Sex sex?:Sex
} }
interface ProjectData { interface ProjectData<T> {
current?:string; current?:string;
pages?:string; pages?:string;
records?: Records[]; records?: Records<T>;
size?: string; size?: string;
total?: string; total?: string;
data: Records<T>;
} }
interface Sex { interface Sex {