1.流程审批页面增加考核实施、指标考核

This commit is contained in:
yangzhq68909 2025-06-19 17:38:54 +08:00
parent 3801233bf0
commit 2175a82f6c
12 changed files with 479 additions and 77 deletions

View File

@ -4,6 +4,6 @@ NODE_ENV = 'development'
VITE_DELETE_CONSOLE = false
# 是否开启sourcemap
VITE_SHOW_SOURCEMAP = true
VITE_SERVER_BASEURL = 'http://10.75.15.247:8080/jeecg-boot'
VITE_SERVER_BASEURL = 'http://10.75.15.249:8080/jeecg-boot'
#VITE_SERVER_BASEURL = 'https://36.112.48.190/jeecg-boot'
#VITE_SERVER_BASEURL = 'https://szcx.zyyt.sinopec.com/jeecg-boot'

View File

@ -29,11 +29,11 @@ export function queryZbkhZbByIdApi(id : string) {
}
/*通过id查询指标考核子表数据*/
export function queryZbkhFbByIdApi(mainId : string) {
export function queryZbkhFbByIdApi(data : object) {
return http({
url: '/jxkh.zbkh/cxcJxkhZbkhZb/listCxcJxkhZbkhDwkhByMainId',
method: 'GET',
data: { mainId }
data
})
}
@ -46,3 +46,47 @@ export function queryZbkhBtByIdApi(mainId : string) {
})
}
/*通过id查询考核实施主表数据*/
export function queryKhssZbByIdApi(id : string) {
return http({
url: '/jxkh.khss/cxcJxkhXhss/getAllById',
method: 'GET',
data: { id }
})
}
/*通过id查询考核实施主表自定义表头*/
export function queryKhssZbBtByIdApi(mainId : string) {
return http({
url: '/jxkh.jxkh/cxcJxkhKhssKhjxZb/getByMainId',
method: 'GET',
data: { mainId }
})
}
/*通过id查询考核实施子表数据*/
export function queryKhssFbByIdApi(data : object) {
return http({
url: '/jxkh.khss/cxcJxkhXhss/selectAllByMainId',
method: 'GET',
data
})
}
/*通过id查询总金额*/
export function queryKhssAllSumByIdApi(mainId : string) {
return http({
url: '/jxkh.khss/cxcJxkhXhss/getAllSum',
method: 'GET',
data: { mainId }
})
}
/*通过id查询考核实子表自定义表头*/
export function queryKhssFbBtByIdApi(mainId : string) {
return http({
url: '/jxkh.jxfp.bt/cxcJxkhJxfbBtZb/listByMainId',
method: 'GET',
data: { mainId }
})
}

View File

@ -0,0 +1,11 @@
import { http } from '@/utils/http';
/*新增打卡记录*/
export function addApi(config : Object) {
return http({
url: '/cxc_rlzy.wbxm.wbdk/cxcRlzyWbdk/add',
method: 'POST',
data: config
})
}

View File

@ -0,0 +1,230 @@
<template>
<!-- 可滚动内容区域 -->
<scroll-view class="content-scroll" :style="{ height: scrollViewHeight }" scroll-y :scroll-top="scrollTop">
<!-- 主表内容 -->
<wd-cell-group border v-if="tabbar == '0'">
<wd-cell size="large" title="年月" :value="zbInfo.assessmentDate" />
<wd-cell size="large" title="单位" :value="zbInfo.templetName_dictText" />
<wd-cell size="large" title="当月人数" :value="zbInfo.monthNumber" />
<wd-cell size="large" title="本次兑现合计" :value="zbInfo.redemptionTotal" />
<wd-collapse v-model="collapse">
<wd-collapse-item title="考核绩效" name="item01">
<wd-cell v-for="(item, index) in zbBtInfo" :key="index" :title="item.name"
:value="getKhjxValue(item.id)" />
</wd-collapse-item>
</wd-collapse>
<wd-cell size="large">
<template #title>
<view style="display: inline-block">考核公报</view>
</template>
<view style="color: blue;" @click="onlinePreview(zbInfo.bmKhgb)">
{{getFilename(zbInfo.bmKhgb)}}
</view>
</wd-cell>
</wd-cell-group>
<!-- 子表内容 -->
<wd-collapse v-model="fbCollapse" v-if="tabbar == '1'">
<div style="display: flex;justify-content: space-between;padding: 10px 15px;font-weight: bold;">
<span>已分配金额: {{ sumJx }}</span>
<span>待分配金额: {{ (allJx - 0) - (sumJx - 0) }}</span>
</div>
<wd-collapse-item v-for="(fbItem, fbIndex) in fbInfo" :key="fbIndex" :title="fbItem.userName"
:name="'item' + (fbIndex + 1)">
<wd-cell-group border>
<wd-cell size="large" title="单位/部门" :value="fbItem.depart_dictText" />
<wd-cell size="large" title="劳动合同号" :value="fbItem.ldhth" />
<wd-cell size="large" title="岗位/职务" :value="fbItem.gw" />
<wd-cell size="large" title="绩效工资合计" :value="fbItem.jxgz" />
<wd-collapse v-model="fbCollapse2">
<wd-collapse-item title="绩效详情" :name="'item0' + (fbIndex + 1)">
<wd-cell v-for="(item, index) in fbBtInfo" :key="index" :title="item.name"
:value="getJxDetailValue(fbItem.id, item.id)" />
</wd-collapse-item>
</wd-collapse>
<wd-cell size="large" title="备注" :value="fbItem.bz" />
</wd-cell-group>
</wd-collapse-item>
</wd-collapse>
<wd-pagination v-if="tabbar == '1'" v-model="page" :total="total" @change="handleChange" />
<!-- 底部占位视图 -->
<view class="bottom-spacer" :style="{ height: safeAreaBottom }"></view>
</scroll-view>
<!-- 固定在底部的TabBar -->
<wd-tabbar fixed v-model="tabbar" class="safe-area-tabbar">
<wd-tabbar-item title="考核实施主表" icon="cart"></wd-tabbar-item>
<wd-tabbar-item title="考核实施子表" icon="user"></wd-tabbar-item>
</wd-tabbar>
</template>
<script setup>
import {
queryKhssZbByIdApi,
queryKhssZbBtByIdApi,
queryKhssFbByIdApi,
queryKhssFbBtByIdApi,
queryKhssAllSumByIdApi
} from '@/api/bpm'
import {
getFilename
} from '@/utils'
//
const tabbar = ref(0)
const zbInfo = ref({})
const fbInfo = ref([])
const zbBtInfo = ref([])
const fbBtInfo = ref([])
const collapse = ref([''])
const fbCollapse = ref([''])
const fbCollapse2 = ref([''])
const jxxqList = ref([])
const sumJx = ref(0)
const allJx = ref(0)
const page = ref(1)
const total = ref(0)
const scrollTop = ref(0)
const tabbarHeight = ref(50)
const systemInfo = ref({})
const scrollViewHeight = ref('100vh')
const props = defineProps({
formData: {
type: Object,
default: () => ({})
}
})
//
const safeAreaBottom = computed(() => {
// #ifdef H5
return `${tabbarHeight.value}px`
// #endif
// #ifdef APP-PLUS || MP-WEIXIN
return `calc(${tabbarHeight.value}px + env(safe-area-inset-bottom))`
// #endif
})
//
const getSystemInfo = () => {
uni.getSystemInfo({
success: (res) => {
systemInfo.value = res
const safeBottom = res.safeAreaInsets?.bottom || 0
scrollViewHeight.value =
`calc(${res.windowHeight}px - ${tabbarHeight.value + safeBottom}px)`
}
})
}
// TabBar
const initTabbarHeight = () => {
const query = uni.createSelectorQuery().select('.safe-area-tabbar')
query.boundingClientRect(data => {
if (data) {
tabbarHeight.value = data.height
getSystemInfo()
}
}).exec()
}
//
const queryById = async () => {
const zbRes = await queryKhssZbByIdApi(props.formData.dataId)
if (zbRes.success) {
zbInfo.value = zbRes.result.records[0]
allJx.value = zbInfo.value.redemptionTotal
if (zbInfo.value.jxxqs) {
jxxqList.value = zbInfo.value.jxxqs
}
if (zbInfo.value.khjxZbId) {
const btRes = await queryKhssZbBtByIdApi(zbInfo.value.khjxZbId)
zbBtInfo.value = btRes.result
}
if (zbInfo.value.jxfpBtId) {
const btRes = await queryKhssFbBtByIdApi(zbInfo.value.jxfpBtId)
fbBtInfo.value = btRes.result
}
}
const fbRes = await queryKhssFbByIdApi({
mainId: props.formData.dataId
})
fbInfo.value = fbRes.result.records
total.value = fbRes.result.total
queryKhssAllSumByIdApi(props.formData.dataId).then(res => {
sumJx.value = res.result
})
}
//
const getKhjxValue = (khjxId) => {
if (!jxxqList.value || jxxqList.value.length === 0) return ''
const item = jxxqList.value.find(item => item.khjxId === khjxId)
return item ? item.numValue : ''
}
//
const getJxDetailValue = (mainId, jxfpBtId) => {
if (!fbInfo.value || fbInfo.value.length === 0) return ''
const currentItem = fbInfo.value.find(item => item.id === mainId)
if (!currentItem || !currentItem.jxxfpSaves) return ''
const detail = currentItem.jxxfpSaves.find(save => save.jxfpBt === jxfpBtId)
return detail ? detail.value : ''
}
const handleChange = (value) => {
fbInfo.value = []
queryKhssFbByIdApi({
mainId: props.formData.dataId,
pageNo: value.value
}).then(res => {
fbInfo.value = res.result.records
scrollTop.value = scrollTop.value ? 0 : 1 //
})
}
const onlinePreview = (e) => {
uni.navigateTo({
url: `/pages/onlinePreview/detail?data=${e}`
})
}
onMounted(() => {
queryById()
})
onReady(() => {
initTabbarHeight()
getSystemInfo()
})
</script>
<style lang="scss" scoped>
/* 滚动内容区域 */
.content-scroll {
width: 100%;
flex: 1;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
/* 底部占位视图 */
.bottom-spacer {
width: 100%;
}
/* 安全区域适配 */
.safe-area-tabbar {
/* #ifdef APP-PLUS || MP-WEIXIN */
padding-bottom: env(safe-area-inset-bottom);
/* #endif */
/* #ifdef H5 */
position: sticky;
bottom: 0;
/* #endif */
}
</style>

View File

@ -1,46 +1,57 @@
<template>
<wd-tabbar fixed v-model="tabbar" shape="round">
<wd-tabbar-item title="指标考核主表" icon="cart"></wd-tabbar-item>
<wd-tabbar-item title="指标考核子表" icon="user"></wd-tabbar-item>
</wd-tabbar>
<wd-cell-group border v-if="tabbar == '0'">
<wd-cell size="large" title="年月" :value="zbInfo.year + '年' + zbInfo.month + '月'" />
<wd-cell size="large" title="考核指标" :value="zbInfo.assessmentIndicators" />
<wd-cell size="large" title="指标类别" :value="zbInfo.indicatorCategory_dictText" />
<wd-cell size="large" title="考核对象" :value="zbInfo.templetName_dictText" />
<wd-cell size="large" title="考核周期" :value="zbInfo.assessmentCycle_dictText" />
<wd-cell size="large" title="考核部门" :value="zbInfo.assessmentDepart_dictText" />
<wd-collapse v-model="zbCollapse">
<wd-collapse-item title="评价方法" name="评价方法">{{zbInfo.evaluationMethod}}</wd-collapse-item>
</wd-collapse>
<wd-cell size="large">
<template #title>
<view>
<view style="display: inline-block">考核附件</view>
</view>
</template>
<view style="color: blue;" @click="onlinePreview(zbInfo.khfj)">
{{zbInfo.khfj}}
</view>
</wd-cell>
</wd-cell-group>
<wd-collapse v-model="collapse" v-if="tabbar == '1'">
<wd-collapse-item v-for="(fbItem, fbIndex) in fbInfo" :key="fbIndex" :title="fbItem.depart_dictText"
:name="'item' + (fbIndex + 1)">
<wd-cell v-for="(btItem, btIndex) in btInfo" :key="btIndex" :title="btItem.name"
:value="getDwkhValue(fbItem, btItem.id)" />
<wd-cell>
<!-- 可滚动内容区域 -->
<scroll-view class="content-scroll" :style="{ height: scrollViewHeight }" scroll-y :scroll-top="scrollTop">
<!-- 主表内容 -->
<wd-cell-group border v-if="tabbar == '0'">
<wd-cell size="large" title="年月" :value="zbInfo.year + '年' + zbInfo.month + '月'" />
<wd-cell size="large" title="考核指标" :value="zbInfo.assessmentIndicators" />
<wd-cell size="large" title="指标类别" :value="zbInfo.indicatorCategory_dictText" />
<wd-collapse v-model="khdxCollapse">
<wd-collapse-item title="考核对象" name="考核对象">{{zbInfo.templetName_dictText}}</wd-collapse-item>
</wd-collapse>
<wd-cell size="large" title="考核周期" :value="zbInfo.assessmentCycle_dictText" />
<wd-cell size="large" title="考核部门" :value="zbInfo.assessmentDepart_dictText" />
<wd-collapse v-model="zbCollapse">
<wd-collapse-item title="评价方法" name="评价方法">{{zbInfo.evaluationMethod}}</wd-collapse-item>
</wd-collapse>
<wd-cell size="large">
<template #title>
<view>
<view style="display: inline-block">附件</view>
<view style="display: inline-block">考核附件</view>
</view>
</template>
<view style="color: blue;" @click="onlinePreview(fbItem.annex)">
{{getFilename(fbItem.annex)}}
<view style="color: blue;" @click="onlinePreview(zbInfo.khfj)">
{{getFilename(zbInfo.khfj)}}
</view>
</wd-cell>
</wd-collapse-item>
</wd-collapse>
</wd-cell-group>
<!-- 子表内容 -->
<wd-collapse v-model="collapse" v-if="tabbar == '1'">
<wd-collapse-item v-for="(fbItem, fbIndex) in fbInfo" :key="fbIndex" :title="fbItem.depart_dictText"
:name="'item' + (fbIndex + 1)">
<wd-cell v-for="(btItem, btIndex) in btInfo" :key="btIndex" :title="btItem.name"
:value="getDwkhValue(fbItem, btItem.id)" />
<wd-cell>
<template #title>
<view>
<view style="display: inline-block">附件</view>
</view>
</template>
<view style="color: blue;" @click="onlinePreview(fbItem.annex)">
{{getFilename(fbItem.annex)}}
</view>
</wd-cell>
</wd-collapse-item>
</wd-collapse>
<wd-pagination v-if="tabbar == '1'" v-model="page" :total="total" @change="handleChange" />
<!-- 底部占位视图 -->
<view class="bottom-spacer" :style="{ height: safeAreaBottom }"></view>
</scroll-view>
<wd-tabbar fixed v-model="tabbar" class="safe-area-tabbar">
<wd-tabbar-item title="指标考核主表" icon="cart"></wd-tabbar-item>
<wd-tabbar-item title="指标考核子表" icon="user"></wd-tabbar-item>
</wd-tabbar>
</template>
<script setup>
@ -58,7 +69,14 @@
const btInfo = ref([])
const btDataInfo = ref([])
const zbCollapse = ref(['评价方法'])
const collapse = ref(['item1'])
const khdxCollapse = ref(['考核对象'])
const collapse = ref(['item01'])
const page = ref(1)
const total = ref(0)
const scrollTop = ref(0)
const tabbarHeight = ref(50)
const systemInfo = ref({})
const scrollViewHeight = ref('100vh')
const props = defineProps({
formData: {
@ -67,20 +85,57 @@
}
})
//
const safeAreaBottom = computed(() => {
// #ifdef H5
return `${tabbarHeight.value}px`
// #endif
// #ifdef APP-PLUS || MP-WEIXIN
return `calc(${tabbarHeight.value}px + env(safe-area-inset-bottom))`
// #endif
})
//
const getSystemInfo = () => {
uni.getSystemInfo({
success: (res) => {
systemInfo.value = res
const safeBottom = res.safeAreaInsets?.bottom || 0
scrollViewHeight.value =
`calc(${res.windowHeight}px - ${tabbarHeight.value + safeBottom}px)`
}
})
}
// TabBar
const initTabbarHeight = () => {
const query = uni.createSelectorQuery().select('.safe-area-tabbar')
query.boundingClientRect(data => {
if (data) {
tabbarHeight.value = data.height
getSystemInfo()
}
}).exec()
}
const queryById = async () => {
// 1.
const zbRes = await queryZbkhZbByIdApi(props.formData.dataId);
if (zbRes.success) {
zbInfo.value = zbRes.result.records[0];
// 2. btInfo
// 2. btInfo
if (zbInfo.value.dwkhBtId) {
const btRes = await queryZbkhBtByIdApi(zbInfo.value.dwkhBtId);
btInfo.value = btRes.result;
}
}
// 3. fbInfo
const fbRes = await queryZbkhFbByIdApi(props.formData.dataId);
const fbRes = await queryZbkhFbByIdApi({
mainId: props.formData.dataId
});
fbInfo.value = fbRes.result.records;
total.value = fbRes.result.total
};
const getDwkhValue = (fbItem, btId) => {
@ -88,6 +143,18 @@
const found = fbItem.dwkhSaves.find(item => item.dwkhBtId === btId);
return found ? found.value : '';
};
const handleChange = (value) => {
fbInfo.value = []
queryZbkhFbByIdApi({
mainId: props.formData.dataId,
pageNo: value.value
}).then(res => {
fbInfo.value = res.result.records
scrollTop.value = scrollTop.value ? 0 : 1 //
})
}
const onlinePreview = (e) => {
uni.navigateTo({
@ -97,17 +164,32 @@
onMounted(() => {
queryById()
getSystemInfo()
})
</script>
<style lang="scss">
/* 手动引入 wd-segmented 样式 */
@import 'wot-design-uni/components/wd-segmented/index.scss';
<style lang="scss" scoped>
/* 滚动内容区域 */
.content-scroll {
width: 100%;
flex: 1;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
/* 或直接覆盖关键样式 */
.wd-segmented {
/* 确保样式优先级 */
opacity: 1 !important;
visibility: visible !important;
}
/* 底部占位视图 */
.bottom-spacer {
width: 100%;
}
/* 安全区域适配 */
.safe-area-tabbar {
/* #ifdef APP-PLUS || MP-WEIXIN */
padding-bottom: env(safe-area-inset-bottom);
/* #endif */
/* #ifdef H5 */
position: sticky;
bottom: 0;
/* #endif */
}
</style>

View File

@ -118,7 +118,6 @@
pageSize
}).then((res) => {
if (res.success) {
console.log('----',res.result.records)
list.value = [...list.value, ...res.result.records]
}
loading = false

View File

@ -1,13 +1,16 @@
<!-- component标签可以变换组件 -->
<template>
<view>
<component ref="comptRef" :is="asyncComponent" :formData="formData" :history="history" :activeKey="activeKey" v-if="asyncComponent"
@getStampSuc="getStampSuccess"></component>
<component ref="comptRef" :is="asyncComponent" :formData="formData" :history="history" :activeKey="activeKey"
v-if="asyncComponent" @getStampSuc="getStampSuccess"></component>
<view v-else>该模块暂未建立审批页面</view>
</view>
<wd-tabbar v-if="false">
<wd-tabbar-item></wd-tabbar-item>
</wd-tabbar>
<wd-pagination v-if="false"/>
</template>
<script setup>
import { ref, reactive, onMounted, computed, watch, nextTick } from 'vue';
const compName = ref('');
const asyncComponent = ref(null);
const modules = import.meta.glob('/src/pages-bpm/**/*.vue');
@ -35,34 +38,34 @@
},
formData: {
type: Object,
default: () => { },
default: () => {},
}
})
// option
watch(() => props.path, (newVal) => {
if (newVal){
if (newVal) {
compName.value = newVal;
}
}
//
const comp = modules[`/src/pages-bpm/${compName.value}.vue`]
if(!comp){
if (!comp) {
console.log(newVal)
if(newVal.indexOf('index')==-1){
compName.value = newVal+'/index'
if (newVal.indexOf('index') == -1) {
compName.value = newVal + '/index'
console.log(compName.value)
const comp2 = modules[`/src/pages-bpm/${compName.value}.vue`]
comp2().then((myModule) => {
asyncComponent.value = myModule.default
}).catch(() => {
})
}
}else{
} else {
comp().then((myModule) => {
asyncComponent.value = myModule.default
}).catch(() => {
})
}
@ -73,18 +76,18 @@
// #endif
});
const signValidator = ()=>{
const signValidator = () => {
console.log(comptRef.value)
//
if(!comptRef.value.signValidator){
if (!comptRef.value.signValidator) {
console.log(123124)
return null;
}else{
} else {
console.log(12)
return comptRef.value.signValidator()
}
}
const getStampSuccess = (val) => {
// this.$emit('getStampSuc', val)
// //<component>使vuex
@ -93,9 +96,9 @@
// esignTag: val
// });
}
defineExpose({ //
signValidator
signValidator
})
</script>

View File

@ -525,6 +525,10 @@
"path": "document/index",
"type": "page"
},
{
"path": "khss/index",
"type": "page"
},
{
"path": "leaveApplication/index",
"type": "page"

View File

@ -52,9 +52,7 @@
</template>
<script lang="ts" setup>
import { ref, watch, onBeforeUnmount } from 'vue'
import { getFileAccessHttpUrl } from '@/common/uitls'
import { onLoad } from '@dcloudio/uni-app'
import { useToast, useMessage } from 'wot-design-uni'
import { useRouter } from '@/plugin/uni-mini-router'
import { http } from '@/utils/http'
@ -62,20 +60,22 @@
import useUpload from '@/hooks/useUpload'
import { getEnvBaseUrl } from '@/utils/index'
import { queryPostByUserIdApi, editUserApi } from '@/api/system/user'
import { useAppStore } from '@/store'
import { addApi } from '@/api/humanResource/clockin'
const appStore = useAppStore();
const userStore = useUserStore()
const toast = useToast()
const router = useRouter()
const message = useMessage()
const loading = ref(false)
const post = ref('')
let stopWatch : any = null
const dataSource = [
// { key: 'collect', title: '', class: 'cuIcon-favorfill text-yellow' },
// { key: 'redPacket', title: '', class: 'cuIcon-redpacket_fill text-red' },
{ key: 'setting', title: '个人资料', class: 'cuIcon-settingsfill text-cyan' },
{ key: 'clockin', title: '打卡', class: 'cuIcon-location text-cyan' },
{ key: 'scan', title: '扫码', class: 'cuIcon-scan text-red' },
// { key: 'location', title: '', class: 'cuIcon-location text-cyan' },
{ key: 'exit', title: '退出', class: 'cuIcon-exit text-cyan' },
]
@ -156,8 +156,28 @@
toast.warning('H5暂不支持')
// #endif
}
const clockin = () => {
// #ifndef H5
if (loading.value) return
addApi({
weizhi: appStore.clockin
}).then((res : any) => {
if(res.success){
toast.success(res.message)
}else{
toast.warning(res.message)
}
loading.value = true
})
// #endif
// #ifdef H5
toast.warning('H5暂不支持')
// #endif
}
const exit = () => {
console.log(message)
message
.confirm({
title: '提示',
@ -180,6 +200,9 @@
case 'exit':
exit()
break
case 'clockin':
clockin()
break
default:
toast.show('功能暂未开发~')
}

View File

@ -15,6 +15,7 @@ export const useAppStore = defineStore('app', {
isGray: 0 as 0 | 1, // 0=1=
position: null, //
location: null, //
clockin: null, //
temperature: null, //
weather: null //
}),
@ -28,6 +29,9 @@ export const useAppStore = defineStore('app', {
setLocation(value : string) {
this.location = value
},
setClockin(value : string) {
this.clockin = value
},
setTemperature(value : number) {
this.temperature = value
},

View File

@ -58,6 +58,7 @@ interface NavigateToOptions {
"/pages-process/taskHandle" |
"/pages-bpm/carRental/index" |
"/pages-bpm/document/index" |
"/pages-bpm/khss/index" |
"/pages-bpm/leaveApplication/index" |
"/pages-bpm/unconventional/index" |
"/pages-bpm/unconventional/stamp" |

View File

@ -398,6 +398,7 @@ export const getLocation = () => {
const obj = data.result.addressComponent
store.setPosition(obj.city ? obj.city : obj.province) //
store.setLocation(obj.city ? obj.province + obj.city + obj.county : obj.province + obj.county) //
store.setClockin(data.result.formatted_address)
getWeather(position.latitude, position.longitude)
} else {
handleDefaultLocation()