Merge remote-tracking branch 'remotes/origin/master' into minJeecg

This commit is contained in:
lagos 2025-05-20 10:06:50 +08:00
commit 40ff07d8c4
14 changed files with 250 additions and 366 deletions

View File

@ -0,0 +1,21 @@
import { http } from '@/utils/http';
// API
export function addApi(data : Object) {
return http({
url: '/cxcGwjktb/cxcGwjktb/addData',
method: 'POST',
data
})
}
//
export function queryIf3rdGxyApi(ldhth : string) { // username
return http({
url: '/cxcGwjktbHmc/cxcGwjktbHmc/queryIf3rdGxy',
method: 'GET',
data: {
ldhth
}
})
}

View File

@ -0,0 +1,159 @@
<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationStyle: 'custom',
navigationBarTitleText: '健康填报',
},
}
</route>
<template>
<PageLayout navTitle="健康填报">
<view class="form-container">
<wd-form ref="form" :model="model">
<!-- 血压数据卡片 -->
<view class="card">
<wd-cell-group title="血压数据">
<wd-input type="number" label="高压值(mmHg)" prop="gyz" v-model="model.gyz" label-width="200px"
:rules="[{ required: true, message: '请输入高压值' }]" />
<wd-input type="number" label="低压值(mmHg)" prop="dyz" v-model="model.dyz" label-width="200px"
:rules="[{ required: true, message: '请输入低压值' }]" />
</wd-cell-group>
</view>
<!-- 健康指标卡片 -->
<view class="card">
<wd-cell-group title="健康指标">
<wd-input type="number" label="心率(次/分)" prop="xl" v-model="model.xl" label-width="200px"
:rules="[{ required: true, message: '请输入心率' }]" />
<wd-input type="number" label="血糖值(mmol/L)" prop="xtz" v-model="model.xtz" label-width="200px"
:rules="[{ required: true, message: '请输入血糖值' }]" />
<wd-input type="number" label="体重(kg)" prop="tz" v-model="model.tz" label-width="200px"
:rules="[{ required: true, message: '请输入体重' }]" />
</wd-cell-group>
</view>
<!-- 其他信息卡片 -->
<view class="card">
<wd-cell-group title="其他信息">
<wd-input label="当前位置" prop="wzzb" v-model="model.wzzb" label-width="200px" />
<wd-cell title="附件" prop="path" title-width="200px">
<wd-upload :accept="accept" v-model:file-list="model.path" :action="uploadUrl"
multiple></wd-upload>
</wd-cell>
</wd-cell-group>
</view>
<!-- 提交按钮 -->
<view class="footer">
<wd-button type="primary" size="large" @click="handleSubmit" block>
提交健康数据
</wd-button>
</view>
</wd-form>
</view>
</PageLayout>
</template>
<script setup>
import {
useMessage,
useToast
} from 'wot-design-uni'
import {
useAppStore
} from '@/store';
import {
useUserStore
} from '@/store/user';
import {
addApi,
queryIf3rdGxyApi
} from '@/api/politics/health'
import {
getEnvBaseUrl
} from '@/utils/index'
const message = useMessage()
const toast = useToast()
const appStore = useAppStore();
const userStore = useUserStore(); //
const form = ref()
const model = reactive({
gyz: '', //
dyz: '', //
xl: '', //
xtz: '', //
tz: '', //
wzzb: appStore.location, //
path: [] //
})
const accept = ref('image')
const uploadUrl = ref(getEnvBaseUrl() + '/sys/common/upload?appPath=健康填报/' + userStore.userInfo.department + '/' +
userStore.userInfo.realname)
const handleSubmit = () => {
form.value.validate().then(({
valid,
errors
}) => {
if (valid) {
const submitData = {
...model,
path: model.path.map(item => {
const response = JSON.parse(item.response);
return response.message;
}).join(',')
}
message
.confirm({
msg: '确认提交健康数据?',
title: '提示',
})
.then(() => {
addApi(submitData).then(res => {
if (res.success) {
toast.success(res.message)
} else {
toast.warning(res.message)
}
})
})
.catch(() => {})
}
})
}
const if3rdGxy = () => {
/**获取当前用户是否是三级高血压,是需要上传视频,否可以上传图片*/
queryIf3rdGxyApi(userStore.userInfo.workNo).then(res => {
if (res) {
accept.value = 'video';
} else {
accept.value = 'image';
}
})
}
onLoad(() => {
if3rdGxy()
})
</script>
<style lang="scss" scoped>
.form-container {
padding: 20rpx;
background-color: #f5f7fa;
min-height: 100vh;
}
.card {
background: #ffffff;
border-radius: 16rpx;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
margin-bottom: 30rpx;
overflow: hidden;
}
.footer {
padding: 40rpx 0;
}
</style>

View File

@ -143,7 +143,7 @@
console.log(11)
//
uni.navigateTo({
url:`/pages/process/taskHandle?data=${JSON.stringify(item)}`
url:`/pages-process/taskHandle?data=${JSON.stringify(item)}`
})
}else{
message

View File

@ -130,24 +130,6 @@
"navigationBarTitleText": "H5在线预览"
}
},
{
"path": "pages/process/approvalTabbar",
"type": "page",
"layout": "default",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "流程审批导航"
}
},
{
"path": "pages/process/taskHandle",
"type": "page",
"layout": "default",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "任务处理"
}
},
{
"path": "pages/user/people",
"type": "page",
@ -346,7 +328,7 @@
"root": "pages-humanResource",
"pages": [
{
"path": "absence/apply",
"path": "absence/add",
"type": "page",
"layout": "default",
"style": {
@ -374,9 +356,42 @@
}
]
},
{
"root": "pages-politics",
"pages": [
{
"path": "health/add",
"type": "page",
"layout": "default",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "健康填报"
}
}
]
},
{
"root": "pages-process",
"pages": []
"pages": [
{
"path": "approvalTabbar",
"type": "page",
"layout": "default",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "流程审批导航"
}
},
{
"path": "taskHandle",
"type": "page",
"layout": "default",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "任务处理"
}
}
]
}
]
}

View File

@ -107,7 +107,7 @@
const goToProcess = ()=>{
uni.navigateTo({
url: '/pages/process/approvalTabbar'
url: '/pages-process/approvalTabbar'
})
}

View File

@ -1,45 +0,0 @@
<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationStyle: 'custom',
navigationBarTitleText: '流程审批导航',
},
}
</route>
<template>
<PageLayout nav-title="运行流程" >
<wd-tabs v-model="tab" swipeable color="#39b54a" autoLineWidth>
<wd-tab title="我的任务">
<myTask></myTask>
</wd-tab>
<wd-tab title="历史任务">
<view class="content">内容1</view>
</wd-tab>
</wd-tabs>
</PageLayout>
</template>
<script setup lang="ts">
import {
useAppStore
} from '@/store'
import {
ref
} from 'vue'
import {
onLoad,
onShow
} from '@dcloudio/uni-app';
import myTask from './components/myTask.vue'
const appStore = useAppStore();
const tab = ref(0)
</script>
<style scoped lang="scss">
::v-deep .wd-tabs__line{
background: #39b54a;
}
</style>

View File

@ -1,170 +0,0 @@
<template>
<view class="container">
<wd-loading v-if="loading && pageNo === 1" class="loading-tip">加载中...</wd-loading>
<template v-for="(item, i) in list" :key="i">
<wd-card :title="item.bpmBizTitle" title-bold border-radius="8" use-footer-slot @click="goToPage(item)">
<view class="card-content">
<wd-row style="color: #666666;">
<wd-col :span="4">
<text>当前环节:</text>
</wd-col>
<wd-col :span="20">
{{item.taskName}}
</wd-col>
</wd-row>
<wd-row style="padding-bottom: 2px;color: #666666;">
<wd-col :span="4">
<text>流程名称:</text>
</wd-col>
<wd-col :span="20">
{{item.processDefinitionName}}
</wd-col>
</wd-row>
<view class="meta-info">
<wd-icon name="time" size="14px" color="#999"></wd-icon>
<text class="meta-text">{{item.taskBeginTime?item.taskBeginTime.substring(0,10):''}}</text>
<wd-icon name="user" size="14px" color="#999" style="margin-left: auto;"></wd-icon>
<text class="meta-text">{{item.processApplyUserName}}</text>
</view>
<wd-row style="padding-top: 10px;">
<view v-if="item.taskAssigneeName&&item.taskAssigneeName!=''">
<wd-col :span="16">
<wd-button>办理</wd-button>
</wd-col>
<wd-col :span="8">
<wd-button>委托</wd-button>
</wd-col>
</view>
<view v-else>
<wd-col :span="12">
<wd-button @click="goToPage(item)">签收</wd-button>
</wd-col>
<wd-col :span="12">
</wd-col>
</view>
</wd-row>
</view>
</wd-card>
</template>
<view class="load-more" v-if="loading && pageNo > 1">
<wd-loading size="16px">正在加载...</wd-loading>
</view>
<wd-message-box></wd-message-box>
</view>
</template>
<script setup lang="ts">
import { taskListApi,claim } from '@/api/process'
import {
ref
} from 'vue'
import {
onLoad,
onShow,
onReachBottom,
onPullDownRefresh
} from '@dcloudio/uni-app';
import { useToast, useMessage } from 'wot-design-uni'
defineOptions({
name: 'myTask',
options: {
styleIsolation: 'shared',
},
})
const toast = useToast()
const message = useMessage()
let pageNo = 1
let pageSize = 10
let loading = false
const list = ref([])
const getList = () => {
taskListApi({
pageNo,
pageSize
}).then((res) => {
console.log(res)
if (res.success) {
list.value = [...list.value,...res.result.records];
}
loading = false
}).catch((err) => {
loading = false
})
}
const goToPage = (item)=>{
//
if(item.taskAssigneeName&&item.taskAssigneeName!=''){
console.log(11)
//
uni.navigateTo({
url:`/pages/process/taskHandle?data=${JSON.stringify(item)}`
})
}else{
message
.confirm({
msg: '是否签收该任务?',
title: '确认签收吗',
})
.then(() => {
claim({taskId:item.id}).then(()=>{
uni.redirectTo({
url: './approvalTabbar'
});
})
})
}
}
onReachBottom(() => {
if (loading) return
pageNo++
getList()
})
onPullDownRefresh(() => {
pageNo = 1
list.value = []
getList()
uni.stopPullDownRefresh()
})
onShow(() => {
list.value = []
pageNo = 1
pageSize = 10
loading = false
getList()
})
</script>
<style lang="scss" scoped>
.container {
padding: 5px 0 5px;
min-height: 100vh;
background-color: #f7f7f7;
}
.card-content {
padding: 8px 0;
.meta-info {
display: flex;
align-items: center;
font-size: 12px;
color: #666;
.meta-text {
margin-left: 4px;
}
}
}
::v-deep .wd-card__title-content{
border-bottom: 1px solid #efefef;
}
</style>

View File

@ -1,98 +0,0 @@
<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationStyle: 'custom',
navigationBarTitleText: '任务处理',
},
}
</route>
<template>
<PageLayout nav-title="流程办理">
<wd-tabs v-model="tab" swipeable color="#39b54a" autoLineWidth>
<wd-tab title="单据">
</wd-tab>
<wd-tab title="任务处理">
<view class="content">内容2</view>
</wd-tab>
<wd-tab title="流程图">
<img :src="imgPath" style="border:2px;cursor:hand;" alt="流程图" usemap="#planetmap">
</wd-tab>
</wd-tabs>
</PageLayout>
</template>
<script setup lang="ts">
import {
ref
} from 'vue'
import {
onLoad,
onShow,
onReachBottom,
onPullDownRefresh
} from '@dcloudio/uni-app';
import { useToast, useMessage } from 'wot-design-uni'
import {
useAppStore
} from '@/store'
import {
getProcessNodeInfo,
getHisProcessNodeInfo
} from '@/api/process'
import {
getEnvBaseUrl
} from '@/utils/index'
import { json } from 'stream/consumers';
const formData = ref({})
const path = ref('') //url
const appStore = useAppStore();
const tab = ref(0)
const handleClickLeft = () => {
uni.navigateBack()
}
onLoad((options) => {
let useData = JSON.parse(options.data);
console.log(123)
getProcessNodeInfo({taskId:useData.id}).then(res=>{
console.log(res)
if(res.success){
let data = {
dataId:res.result.dataId,
taskId:useData.id,
taskDefKey:useData.taskId,
procInsId:useData.processInstanceId,
tableName:res.result.tableName,
permissionList:res.result.permissionList,
vars:res.result.records
}
formData.value = data;//
let tempFormUrl = res.result.formUrlMobile;
path.value = tempFormUrl; //url
}
})
})
const imgPath = () => {
var params = JSON.stringify({
'processInstanceId': formData.procInsId
})
let url = `${getEnvBaseUrl()}/act/task/traceImage?${params}`;
console.log(url)
return url;
}
</script>
<style lang="scss" scoped>
::v-deep .wd-tabs__line{
background: #39b54a;
}
</style>

View File

@ -13,8 +13,6 @@ interface NavigateToOptions {
"/pages/onlinePreview/detail" |
"/pages/onlinePreview/onlinePreview" |
"/pages/onlinePreview/onlinePreviewH5" |
"/pages/process/approvalTabbar" |
"/pages/process/taskHandle" |
"/pages/user/people" |
"/pages/workHome/index" |
"/pages-home/home/home" |
@ -33,9 +31,12 @@ interface NavigateToOptions {
"/pages-operate/file/detail" |
"/pages-operate/file/index" |
"/pages-operate/sc/index" |
"/pages-humanResource/absence/apply" |
"/pages-humanResource/absence/add" |
"/pages-humanResource/absence/index" |
"/pages-integrated/duty/index";
"/pages-integrated/duty/index" |
"/pages-politics/health/add" |
"/pages-process/approvalTabbar" |
"/pages-process/taskHandle";
}
interface RedirectToOptions extends NavigateToOptions {}

View File

@ -343,29 +343,29 @@ export const getLocation = () => {
}
},
fail: function (err) {
uni.showToast({
title: '位置解析失败',
icon: 'error'
})
// uni.showToast({
// title: '',
// icon: 'error'
// })
handleDefaultLocation()
}
});
},
fail: function (err) {
//
if (err.errCode === 2 || err.errCode === 12) {
// 2: , 12:
uni.showToast({
title: '请开启定位服务',
icon: 'error'
})
// if (err.errCode === 2 || err.errCode === 12) {
// // 2: , 12:
// uni.showToast({
// title: '',
// icon: 'error'
// })
} else {
uni.showToast({
title: '定位获取失败',
icon: 'error'
})
}
// } else {
// uni.showToast({
// title: '',
// icon: 'error'
// })
// }
handleDefaultLocation()
}
});
@ -388,7 +388,7 @@ function handleDefaultLocation() {
}
function weatherRequest(params : { lat ?: string; lon ?: string; q ?: string }) {
function weatherRequest(params : { lat ?: number; lon ?: number; q ?: string }) {
const store = useAppStore()
uni.request({
url: 'https://api.openweathermap.org/data/2.5/weather',
@ -407,17 +407,17 @@ function weatherRequest(params : { lat ?: string; lon ?: string; q ?: string })
res.data.weather[0].icon
)
} else {
uni.showToast({
title: '天气数据格式错误',
icon: 'error'
})
// uni.showToast({
// title: '',
// icon: 'error'
// })
}
},
fail: function () {
uni.showToast({
title: '天气获取失败',
icon: 'error'
})
}
// fail: function () {
// uni.showToast({
// title: '',
// icon: 'error'
// })
// }
});
}

View File

@ -68,6 +68,7 @@ export default ({ command, mode }) => {
'src/pages-operate',
'src/pages-humanResource',
'src/pages-integrated',
'src/pages-politics',
'src/pages-process',
], // pages
dts: 'src/types/uni-pages.d.ts',