Commit c5fdc60a3077f519f0491997e86d27f8d12656b0
1 parent
12e66ec8
树详情
Showing
8 changed files
with
305 additions
and
25 deletions
api/tree-archive/tree-archive.js
| @@ -47,14 +47,20 @@ export const treeLogReq = (params) => { | @@ -47,14 +47,20 @@ export const treeLogReq = (params) => { | ||
| 47 | * @returns {Promise} | 47 | * @returns {Promise} |
| 48 | */ | 48 | */ |
| 49 | export const updateTree = (data) => { | 49 | export const updateTree = (data) => { |
| 50 | - return put(' /app-api/garden/tree/update', data); | 50 | + return put('/app-api/garden/tree/update', data); |
| 51 | }; | 51 | }; |
| 52 | 52 | ||
| 53 | 53 | ||
| 54 | -// // 树基本详情 | ||
| 55 | -// export const treeDetailReq = (params) => request.get('/business/tree/'+params ) | ||
| 56 | -// ==> | ||
| 57 | -// /app-api/garden/tree/get | ||
| 58 | -// | 54 | +/** |
| 55 | + * 树基本详情 | ||
| 56 | + * @param {Object} params | ||
| 57 | + * @returns {Promise} | ||
| 58 | + */ | ||
| 59 | +export const treeDetailReq = (data) => { | ||
| 60 | + return get('/app-api/garden/tree/get', data); | ||
| 61 | +}; | ||
| 62 | + | ||
| 63 | + | ||
| 64 | + | ||
| 59 | 65 | ||
| 60 | 66 |
pages-sub/data/tree-archive/addTree.vue
| @@ -173,7 +173,13 @@ | @@ -173,7 +173,13 @@ | ||
| 173 | 173 | ||
| 174 | <script setup> | 174 | <script setup> |
| 175 | import { ref, reactive, nextTick } from 'vue' | 175 | import { ref, reactive, nextTick } from 'vue' |
| 176 | -import { onReady, onLoad, onShow } from '@dcloudio/uni-app'; | 176 | +import { onReady, onLoad, onShow, onUnload } from '@dcloudio/uni-app'; |
| 177 | +onUnload(() => { | ||
| 178 | + // 关闭所有页面,直接打开【行道树档案】主页面 【微信小程序完美兼容,无任何报错】 | ||
| 179 | + uni.reLaunch({ | ||
| 180 | + url: '/pages-sub/data/tree-archive/index' | ||
| 181 | + }) | ||
| 182 | +}) | ||
| 177 | import { addTree } from "@/api/tree-archive/tree-archive.js"; | 183 | import { addTree } from "@/api/tree-archive/tree-archive.js"; |
| 178 | import { useUploadImgs } from '@/common/utils/useUploadImgs' | 184 | import { useUploadImgs } from '@/common/utils/useUploadImgs' |
| 179 | import { useUserStore } from '@/pinia/user'; | 185 | import { useUserStore } from '@/pinia/user'; |
| @@ -360,6 +366,8 @@ onReady(() => { | @@ -360,6 +366,8 @@ onReady(() => { | ||
| 360 | }); | 366 | }); |
| 361 | }); | 367 | }); |
| 362 | 368 | ||
| 369 | + | ||
| 370 | + | ||
| 363 | const toggleArea = () => { | 371 | const toggleArea = () => { |
| 364 | isShow.value = !isShow.value | 372 | isShow.value = !isShow.value |
| 365 | } | 373 | } |
pages-sub/data/tree-archive/editTree.vue
| @@ -50,7 +50,7 @@ | @@ -50,7 +50,7 @@ | ||
| 50 | :show-head="false" | 50 | :show-head="false" |
| 51 | class="tree-card" | 51 | class="tree-card" |
| 52 | :foot-border-top="false" | 52 | :foot-border-top="false" |
| 53 | - @click="toLogDetailPage(item.id)" | 53 | + @click="toLogDetailPage(item)" |
| 54 | > | 54 | > |
| 55 | <template #body> | 55 | <template #body> |
| 56 | <view class="card-body-inner"> | 56 | <view class="card-body-inner"> |
| @@ -93,7 +93,13 @@ | @@ -93,7 +93,13 @@ | ||
| 93 | 93 | ||
| 94 | <script setup> | 94 | <script setup> |
| 95 | import { ref, reactive } from 'vue' | 95 | import { ref, reactive } from 'vue' |
| 96 | -import { onLoad, onShow } from '@dcloudio/uni-app'; | 96 | +import { onReady, onLoad, onShow, onUnload } from '@dcloudio/uni-app'; |
| 97 | +onUnload(() => { | ||
| 98 | + // 关闭所有页面,直接打开【行道树档案】主页面 【微信小程序完美兼容,无任何报错】 | ||
| 99 | + uni.reLaunch({ | ||
| 100 | + url: '/pages-sub/data/tree-archive/index' | ||
| 101 | + }) | ||
| 102 | +}) | ||
| 97 | import { treeRoadReq,treeLogReq } from "@/api/tree-archive/tree-archive.js"; | 103 | import { treeRoadReq,treeLogReq } from "@/api/tree-archive/tree-archive.js"; |
| 98 | import { timeFormat } from '@/uni_modules/uview-plus'; | 104 | import { timeFormat } from '@/uni_modules/uview-plus'; |
| 99 | 105 | ||
| @@ -136,6 +142,7 @@ onShow(() => { | @@ -136,6 +142,7 @@ onShow(() => { | ||
| 136 | } | 142 | } |
| 137 | }) | 143 | }) |
| 138 | 144 | ||
| 145 | + | ||
| 139 | // ========== Tab切换事件 ========== | 146 | // ========== Tab切换事件 ========== |
| 140 | const handleTabChange = (item) => { | 147 | const handleTabChange = (item) => { |
| 141 | activeTab.value = item.index | 148 | activeTab.value = item.index |
| @@ -182,9 +189,20 @@ const toAddTreePage = () => { | @@ -182,9 +189,20 @@ const toAddTreePage = () => { | ||
| 182 | } | 189 | } |
| 183 | 190 | ||
| 184 | // ✅ 新增:点击变更日志卡片 前往日志详情页面 | 191 | // ✅ 新增:点击变更日志卡片 前往日志详情页面 |
| 185 | -const toLogDetailPage = (logId) => { | 192 | +const toLogDetailPage = (i) => { |
| 186 | uni.navigateTo({ | 193 | uni.navigateTo({ |
| 187 | - url: `/pages-sub/data/tree-archive/logDetail?id=${logId}&treeId=${treeId.value}` | 194 | + // url: `/pages-sub/data/tree-archive/logDetail?id=${logId}&treeId=${treeId.value}` |
| 195 | + url: `/pages-sub/data/tree-archive/logDetail`, | ||
| 196 | + events: { | ||
| 197 | + sendBackData: (data) => { | ||
| 198 | + console.log('B页面回传的数据:', data); | ||
| 199 | + } | ||
| 200 | + }, | ||
| 201 | + // 2. 向B页面传递数据 | ||
| 202 | + success: (res) => { | ||
| 203 | + // 通过 eventChannel 发送数据,key | ||
| 204 | + res.eventChannel.emit('logData', i); | ||
| 205 | + } | ||
| 188 | }) | 206 | }) |
| 189 | } | 207 | } |
| 190 | </script> | 208 | </script> |
pages-sub/data/tree-archive/logDetail.vue
| 1 | -<script lang="ts"> | ||
| 2 | -import {defineComponent} from 'vue' | 1 | +<template> |
| 2 | + <view class="container"> | ||
| 3 | + <up-form :model="formData" ref="formRef" label-width="140rpx" border-bottom> | ||
| 4 | + <up-form-item label="名称" prop="treetype" required> | ||
| 5 | + <up-input v-model="formData.treetype" placeholder="请输入名称" maxlength="30" border="none" readonly/> | ||
| 6 | + </up-form-item> | ||
| 3 | 7 | ||
| 4 | -export default defineComponent({ | ||
| 5 | - name: "logDetail" | ||
| 6 | -}) | ||
| 7 | -</script> | 8 | + <view class="form-row-wrap"> |
| 9 | + <up-row gutter="10"> | ||
| 10 | + <up-col span="6"> | ||
| 11 | + <up-form-item label="胸径" prop="dbh" required> | ||
| 12 | + <up-input v-model="formData.dbh" placeholder="请输入" maxlength="10" border="none" input-align="left" readonly/> | ||
| 13 | + <template #right> | ||
| 14 | + <text style="padding-left: 12rpx;color:#ccc;font-size:14px">厘米</text> | ||
| 15 | + </template> | ||
| 16 | + </up-form-item> | ||
| 17 | + </up-col> | ||
| 18 | + <up-col span="6"> | ||
| 19 | + <up-form-item label="高度" prop="treeheight"> | ||
| 20 | + <up-input v-model="formData.treeheight" placeholder="请输入" maxlength="10" border="none" input-align="left" readonly/> | ||
| 21 | + <template #right> | ||
| 22 | + <text style="padding-left: 12rpx;color:#ccc;font-size:14px;">米</text> | ||
| 23 | + </template> | ||
| 24 | + </up-form-item> | ||
| 25 | + </up-col> | ||
| 26 | + </up-row> | ||
| 27 | + </view> | ||
| 8 | 28 | ||
| 9 | -<template> | 29 | + <up-form-item label="位置" prop="growlocation" required class="location-form-item"> |
| 30 | + <up-input v-model="formData.growlocation" placeholder="请选择" readonly border="none"/> | ||
| 31 | + </up-form-item> | ||
| 32 | + | ||
| 33 | + <up-row gutter="10"> | ||
| 34 | + <up-col span="6"> | ||
| 35 | + <up-form-item label="经度" :borderBottom="false"> | ||
| 36 | + <up-input v-model="formData.longitude" placeholder="" readonly border="none"/> | ||
| 37 | + </up-form-item> | ||
| 38 | + </up-col> | ||
| 39 | + <up-col span="6"> | ||
| 40 | + <up-form-item label="纬度" :borderBottom="false"> | ||
| 41 | + <up-input v-model="formData.latitude" placeholder="" readonly border="none"/> | ||
| 42 | + </up-form-item> | ||
| 43 | + </up-col> | ||
| 44 | + </up-row> | ||
| 45 | + | ||
| 46 | + <up-form-item label="管护单位" prop="managedutyunit" required> | ||
| 47 | + <up-input v-model="formData.managedutyunit" placeholder="请输入" maxlength="30" border="none" readonly/> | ||
| 48 | + </up-form-item> | ||
| 49 | + | ||
| 50 | + <up-form-item label="权属分类" prop="oldtreeownershipText" required> | ||
| 51 | + <text class="show-text">{{ uni.$dict.getDictLabel('tree_ownership',formData.oldtreeownership) || '' }}</text> | ||
| 52 | + </up-form-item> | ||
| 10 | 53 | ||
| 54 | + <!-- ✅ 核心修复:图片上传组件 格式兼容+正确赋值 --> | ||
| 55 | + <up-form-item label="图片信息" prop="treeImgList" required> | ||
| 56 | + <up-upload | ||
| 57 | + :file-list="formatImgList(formData.treeImgList)" | ||
| 58 | + multiple | ||
| 59 | + :width="70" | ||
| 60 | + :height="70" | ||
| 61 | + :maxCount="formatImgList(formData.treeImgList).length" | ||
| 62 | + disabled | ||
| 63 | + :preview-full-image="true" | ||
| 64 | + ></up-upload> | ||
| 65 | + </up-form-item> | ||
| 66 | + | ||
| 67 | + <view class="animated-area"> | ||
| 68 | + <up-row gutter="10"> | ||
| 69 | + <up-col span="6"> | ||
| 70 | + <up-form-item label="拉丁文" prop="latinname"> | ||
| 71 | + <up-input v-model="formData.latinname" placeholder="请输入" maxlength="30" border="none" readonly/> | ||
| 72 | + </up-form-item> | ||
| 73 | + </up-col> | ||
| 74 | + <up-col span="6"> | ||
| 75 | + <up-form-item label="级别"> | ||
| 76 | + <text class="show-text">{{ uni.$dict.getDictLabel('tree_level',formData.treelevel) || '' }}</text> | ||
| 77 | + </up-form-item> | ||
| 78 | + </up-col> | ||
| 79 | + </up-row> | ||
| 80 | + | ||
| 81 | + <up-form-item label="生长环境" prop="growthenvironment"> | ||
| 82 | + <up-input v-model="formData.growthenvironment" placeholder="请输入" maxlength="50" border="none" readonly/> | ||
| 83 | + </up-form-item> | ||
| 84 | + | ||
| 85 | + <view class="form-row-wrap"> | ||
| 86 | + <up-row gutter="10"> | ||
| 87 | + <up-col span="6"> | ||
| 88 | + <up-form-item label="预估树龄" prop="estimationtreeage"> | ||
| 89 | + <up-input v-model="formData.estimationtreeage" placeholder="请输入" maxlength="10" border="none" input-align="left" readonly/> | ||
| 90 | + <template #right> | ||
| 91 | + <text style="padding-left:12rpx;color:#ccc;font-size:14px">年</text> | ||
| 92 | + </template> | ||
| 93 | + </up-form-item> | ||
| 94 | + </up-col> | ||
| 95 | + <up-col span="6"> | ||
| 96 | + <up-form-item label="干周" prop="weekday"> | ||
| 97 | + <up-input v-model="formData.weekday" placeholder="请输入" maxlength="10" border="none" input-align="left" readonly/> | ||
| 98 | + <template #right> | ||
| 99 | + <text style="padding-left:12rpx;color:#ccc;font-size:14px">厘米</text> | ||
| 100 | + </template> | ||
| 101 | + </up-form-item> | ||
| 102 | + </up-col> | ||
| 103 | + </up-row> | ||
| 104 | + </view> | ||
| 105 | + | ||
| 106 | + <view class="form-row-wrap"> | ||
| 107 | + <up-row gutter="10"> | ||
| 108 | + <up-col span="6"> | ||
| 109 | + <up-form-item label="东西冠幅" prop="canopyeastwest"> | ||
| 110 | + <up-input v-model="formData.canopyeastwest" placeholder="请输入" maxlength="10" border="none" input-align="left" readonly/> | ||
| 111 | + <template #right> | ||
| 112 | + <text style="padding-left:12rpx;color:#ccc;font-size:14px">米</text> | ||
| 113 | + </template> | ||
| 114 | + </up-form-item> | ||
| 115 | + </up-col> | ||
| 116 | + <up-col span="6"> | ||
| 117 | + <up-form-item label="南北冠幅" prop="canopysouthnorth"> | ||
| 118 | + <up-input v-model="formData.canopysouthnorth" placeholder="请输入" maxlength="10" border="none" input-align="left" readonly/> | ||
| 119 | + <template #right> | ||
| 120 | + <text style="padding-left:12rpx;color:#ccc;font-size:14px">米</text> | ||
| 121 | + </template> | ||
| 122 | + </up-form-item> | ||
| 123 | + </up-col> | ||
| 124 | + </up-row> | ||
| 125 | + </view> | ||
| 126 | + </view> | ||
| 127 | + | ||
| 128 | + </up-form> | ||
| 129 | + </view> | ||
| 11 | </template> | 130 | </template> |
| 12 | 131 | ||
| 132 | +<script setup> | ||
| 133 | +import { ref, reactive } from 'vue' | ||
| 134 | +import { onReady, onLoad, onShow, onUnload } from '@dcloudio/uni-app'; | ||
| 135 | +import { treeDetailReq } from "@/api/tree-archive/tree-archive.js"; | ||
| 136 | +import { useUserStore } from '@/pinia/user'; | ||
| 137 | + | ||
| 138 | +// ========== 状态管理 ========== | ||
| 139 | +const formRef = ref(null) | ||
| 140 | +const userStore = useUserStore(); | ||
| 141 | + | ||
| 142 | +// 表单数据 | ||
| 143 | +const formData = reactive({ | ||
| 144 | + treetype: '', | ||
| 145 | + treeheight: '', | ||
| 146 | + dbh: '', | ||
| 147 | + treelevel: '', | ||
| 148 | + treeleveltext: '', | ||
| 149 | + managedutyunit: '', | ||
| 150 | + oldtreeownership: '', | ||
| 151 | + oldtreeownershipText: '', | ||
| 152 | + latinname: '', | ||
| 153 | + estimationtreeage: '', | ||
| 154 | + canopysouthnorth: '', | ||
| 155 | + canopyeastwest: '', | ||
| 156 | + weekday: '', | ||
| 157 | + growlocation: '', | ||
| 158 | + growthenvironment: '', | ||
| 159 | + treeImgList: [], | ||
| 160 | + address: '', | ||
| 161 | + latitude: '', | ||
| 162 | + longitude: '', | ||
| 163 | + road: '', | ||
| 164 | + maintainunit: '' | ||
| 165 | +}) | ||
| 166 | + | ||
| 167 | +// ✅ ✅ ✅ 核心新增:图片格式转换函数 【解决图片不显示的关键】 | ||
| 168 | +// 兼容两种格式:1.纯字符串数组 2.对象数组 都能正常渲染 | ||
| 169 | +const formatImgList = (imgList) => { | ||
| 170 | + if (!imgList || imgList.length === 0) return []; | ||
| 171 | + // 判断是否是纯字符串数组,转成uview需要的 {url:xxx} 格式 | ||
| 172 | + return imgList.map(item => { | ||
| 173 | + if (typeof item === 'string') { | ||
| 174 | + return { url: item }; | ||
| 175 | + } else { | ||
| 176 | + return item; | ||
| 177 | + } | ||
| 178 | + }); | ||
| 179 | +} | ||
| 180 | + | ||
| 181 | +// ========== 生命周期 ========== | ||
| 182 | +onUnload(() => { | ||
| 183 | + uni.reLaunch({ | ||
| 184 | + url: '/pages-sub/data/tree-archive/index' | ||
| 185 | + }) | ||
| 186 | +}) | ||
| 187 | + | ||
| 188 | +onLoad((options) => { | ||
| 189 | + // 获取事件通道接收上一页数据,仅做渲染赋值 | ||
| 190 | + const pages = getCurrentPages(); | ||
| 191 | + const currentPage = pages[pages.length - 1]; | ||
| 192 | + if (currentPage.getOpenerEventChannel) { | ||
| 193 | + const eventChannel = currentPage.getOpenerEventChannel(); | ||
| 194 | + eventChannel.on('logData', (data) => { | ||
| 195 | + console.log('接收上一页完整数据:', data); | ||
| 196 | + Object.assign(formData, data); | ||
| 197 | + // 这里不需要额外赋值图片,formData赋值后会自动同步,formatImgList会做格式转换 | ||
| 198 | + }); | ||
| 199 | + } | ||
| 200 | +}) | ||
| 201 | + | ||
| 202 | +onShow(async () => {}) | ||
| 203 | +onReady(() => {}); | ||
| 204 | +</script> | ||
| 205 | + | ||
| 13 | <style scoped lang="scss"> | 206 | <style scoped lang="scss"> |
| 207 | +.container { | ||
| 208 | + padding: 25rpx; | ||
| 209 | + box-sizing: border-box; | ||
| 210 | + background: #fff; | ||
| 211 | +} | ||
| 212 | + | ||
| 213 | +.location-form-item { | ||
| 214 | + padding-right: 10rpx; | ||
| 215 | +} | ||
| 216 | + | ||
| 217 | +// 只读输入框文字颜色优化 | ||
| 218 | +:deep(.u-input__inner) { | ||
| 219 | + color: #333; | ||
| 220 | + background-color: transparent !important; | ||
| 221 | +} | ||
| 222 | + | ||
| 223 | +// 纯文本展示的样式,和原输入框完全一致,无缝衔接 | ||
| 224 | +.show-text { | ||
| 225 | + font-size: 28rpx; | ||
| 226 | + color: #333; | ||
| 227 | + line-height: 80rpx; | ||
| 228 | + width: 100%; | ||
| 229 | + display: block; | ||
| 230 | + text-align: left; | ||
| 231 | +} | ||
| 14 | 232 | ||
| 233 | +// 补充:适配表单行间距,和之前一致 | ||
| 234 | +.form-row-wrap { | ||
| 235 | + width: 100%; | ||
| 236 | + display: flex; | ||
| 237 | + flex-direction: column; | ||
| 238 | + :deep(.u-form-item) { | ||
| 239 | + position: relative; | ||
| 240 | + margin-bottom: 0 !important; | ||
| 241 | + } | ||
| 242 | +} | ||
| 243 | +.form-row-wrap + .u-form-item { | ||
| 244 | + margin-top: 25rpx !important; | ||
| 245 | +} | ||
| 246 | +.animated-area { | ||
| 247 | + margin-top: 10rpx; | ||
| 248 | +} | ||
| 15 | </style> | 249 | </style> |
| 16 | \ No newline at end of file | 250 | \ No newline at end of file |
pages-sub/data/tree-archive/treeRecord.vue
| 1 | <template> | 1 | <template> |
| 2 | <view class="container"> | 2 | <view class="container"> |
| 3 | <!-- 空数据组件 --> | 3 | <!-- 空数据组件 --> |
| 4 | - <up-empty v-if="rows.length === 0" text="暂无数据"></up-empty> | 4 | + <up-empty v-if="rows.length === 0" text="暂无数据" marginTop="100"></up-empty> |
| 5 | 5 | ||
| 6 | <!-- 树木列表:up-card重构 + 保留原始背景图写法 核心满足你的要求 --> | 6 | <!-- 树木列表:up-card重构 + 保留原始背景图写法 核心满足你的要求 --> |
| 7 | <view class="record-wrap" v-else> | 7 | <view class="record-wrap" v-else> |
| @@ -61,7 +61,13 @@ | @@ -61,7 +61,13 @@ | ||
| 61 | 61 | ||
| 62 | <script setup> | 62 | <script setup> |
| 63 | import { ref} from 'vue' | 63 | import { ref} from 'vue' |
| 64 | -import { onLoad, onShow } from '@dcloudio/uni-app'; | 64 | +import { onLoad, onShow, onUnload } from '@dcloudio/uni-app'; |
| 65 | +onUnload(() => { | ||
| 66 | + // 关闭所有页面,直接打开【行道树档案】主页面 【微信小程序完美兼容,无任何报错】 | ||
| 67 | + uni.reLaunch({ | ||
| 68 | + url: '/pages-sub/data/tree-archive/index' | ||
| 69 | + }) | ||
| 70 | +}) | ||
| 65 | import { treeRoadReq } from "@/api/tree-archive/tree-archive.js"; | 71 | import { treeRoadReq } from "@/api/tree-archive/tree-archive.js"; |
| 66 | import { timeFormat } from '@/uni_modules/uview-plus'; | 72 | import { timeFormat } from '@/uni_modules/uview-plus'; |
| 67 | 73 | ||
| @@ -79,6 +85,8 @@ onShow(() => { | @@ -79,6 +85,8 @@ onShow(() => { | ||
| 79 | treeRoadQuery() | 85 | treeRoadQuery() |
| 80 | }) | 86 | }) |
| 81 | 87 | ||
| 88 | + | ||
| 89 | + | ||
| 82 | const toEditPage = (id) => { | 90 | const toEditPage = (id) => { |
| 83 | uni.navigateTo({ | 91 | uni.navigateTo({ |
| 84 | url: `/pages-sub/data/tree-archive/editTree?id=${id}` | 92 | url: `/pages-sub/data/tree-archive/editTree?id=${id}` |
pages-sub/problem/ai-manage/index.vue
| @@ -252,7 +252,8 @@ import { | @@ -252,7 +252,8 @@ import { | ||
| 252 | doneBuzSimplePage, | 252 | doneBuzSimplePage, |
| 253 | qyUniversalApproval, | 253 | qyUniversalApproval, |
| 254 | daquUniversalApproval, | 254 | daquUniversalApproval, |
| 255 | - dcyUniversalApproval | 255 | + dcyUniversalApproval, |
| 256 | + aiUniversalApproval | ||
| 256 | } from '@/api/regional-order-manage/regional-order-manage' | 257 | } from '@/api/regional-order-manage/regional-order-manage' |
| 257 | import { useUserStore } from '@/pinia/user'; | 258 | import { useUserStore } from '@/pinia/user'; |
| 258 | import { nextStepMap, buzStatusMap } from '@/common/utils/common' | 259 | import { nextStepMap, buzStatusMap } from '@/common/utils/common' |
| @@ -356,6 +357,7 @@ const callApprovalApi = async (params, taskKey) => { | @@ -356,6 +357,7 @@ const callApprovalApi = async (params, taskKey) => { | ||
| 356 | if (USER_ROLES.includes('regional_manager')) return await daquUniversalApproval(params); | 357 | if (USER_ROLES.includes('regional_manager')) return await daquUniversalApproval(params); |
| 357 | if (USER_ROLES.includes('Inspector_global')) return await dcyUniversalApproval(params); | 358 | if (USER_ROLES.includes('Inspector_global')) return await dcyUniversalApproval(params); |
| 358 | if (USER_ROLES.includes('patrol_global')) return await qyUniversalApproval(params); | 359 | if (USER_ROLES.includes('patrol_global')) return await qyUniversalApproval(params); |
| 360 | + if (USER_ROLES.includes('AI_dispatcher')) return await aiUniversalApproval(params); | ||
| 359 | }; | 361 | }; |
| 360 | 362 | ||
| 361 | /** | 363 | /** |
pages-sub/problem/regional-order-manage/order-detail.vue
| @@ -371,7 +371,8 @@ import { | @@ -371,7 +371,8 @@ import { | ||
| 371 | getApprovalDetail, | 371 | getApprovalDetail, |
| 372 | daquUniversalApproval, | 372 | daquUniversalApproval, |
| 373 | qyUniversalApproval, | 373 | qyUniversalApproval, |
| 374 | - dcyUniversalApproval | 374 | + dcyUniversalApproval, |
| 375 | + aiUniversalApproval | ||
| 375 | } from '@/api/regional-order-manage/regional-order-manage'; | 376 | } from '@/api/regional-order-manage/regional-order-manage'; |
| 376 | import {nextStepMap, buzStatusMap, calculateFormatTimeDiff} from '@/common/utils/common' | 377 | import {nextStepMap, buzStatusMap, calculateFormatTimeDiff} from '@/common/utils/common' |
| 377 | import {useUploadImgs} from '@/common/utils/useUploadImgs' | 378 | import {useUploadImgs} from '@/common/utils/useUploadImgs' |
| @@ -424,6 +425,7 @@ const callApprovalApi = async (params: any, taskKey: string) => { | @@ -424,6 +425,7 @@ const callApprovalApi = async (params: any, taskKey: string) => { | ||
| 424 | if (USER_ROLES.includes('regional_manager')) return await daquUniversalApproval(params); | 425 | if (USER_ROLES.includes('regional_manager')) return await daquUniversalApproval(params); |
| 425 | if (USER_ROLES.includes('Inspector_global')) return await dcyUniversalApproval(params); | 426 | if (USER_ROLES.includes('Inspector_global')) return await dcyUniversalApproval(params); |
| 426 | if (USER_ROLES.includes('patrol_global')) return await qyUniversalApproval(params); | 427 | if (USER_ROLES.includes('patrol_global')) return await qyUniversalApproval(params); |
| 428 | + if (USER_ROLES.includes('AI_dispatcher')) return await aiUniversalApproval(params); | ||
| 427 | throw new Error('未匹配到对应的审批接口,请检查角色或工单taskKey'); | 429 | throw new Error('未匹配到对应的审批接口,请检查角色或工单taskKey'); |
| 428 | }; | 430 | }; |
| 429 | 431 |
pages/mine/index.vue
| @@ -12,7 +12,9 @@ | @@ -12,7 +12,9 @@ | ||
| 12 | <!-- 用户名+手机号 --> | 12 | <!-- 用户名+手机号 --> |
| 13 | <view class="user-info-content"> | 13 | <view class="user-info-content"> |
| 14 | <view class="user-name">{{ userStore.isLogin ? userInfo.username : '未登录' }}</view> | 14 | <view class="user-name">{{ userStore.isLogin ? userInfo.username : '未登录' }}</view> |
| 15 | - <view class="user-phone">{{ userStore.isLogin ? userInfo.nickname : '--------' }}</view> | 15 | +<!-- <view class="user-phone">{{ userStore.isLogin ? userInfo.nickname : '--------' }}</view>--> |
| 16 | + <view class="user-phone">上次登录时间{{ timeFormat(userInfo.loginDate)}}</view> | ||
| 17 | + | ||
| 16 | </view> | 18 | </view> |
| 17 | 19 | ||
| 18 | </view> | 20 | </view> |
| @@ -22,7 +24,7 @@ | @@ -22,7 +24,7 @@ | ||
| 22 | <up-cell-group title="个人信息"> | 24 | <up-cell-group title="个人信息"> |
| 23 | <up-cell title="姓名" :value="userInfo.nickname"></up-cell> | 25 | <up-cell title="姓名" :value="userInfo.nickname"></up-cell> |
| 24 | <up-cell title="账号" :value="userInfo.username"></up-cell> | 26 | <up-cell title="账号" :value="userInfo.username"></up-cell> |
| 25 | - <up-cell title="电话" :value="userInfo.username"></up-cell> | 27 | + <up-cell title="电话" :value="userInfo.mobile"></up-cell> |
| 26 | <up-cell title="角色" :value="translateRoles(userStore.userInfo.roles)"></up-cell> | 28 | <up-cell title="角色" :value="translateRoles(userStore.userInfo.roles)"></up-cell> |
| 27 | </up-cell-group> | 29 | </up-cell-group> |
| 28 | </view> | 30 | </view> |
| @@ -61,7 +63,7 @@ import { showModal, onShow } from '@dcloudio/uni-app' | @@ -61,7 +63,7 @@ import { showModal, onShow } from '@dcloudio/uni-app' | ||
| 61 | import {translateRoles} from '@/common/utils/common' | 63 | import {translateRoles} from '@/common/utils/common' |
| 62 | // 初始化Pinia仓库 | 64 | // 初始化Pinia仓库 |
| 63 | const userStore = useUserStore() | 65 | const userStore = useUserStore() |
| 64 | - | 66 | +import { timeFormat } from '@/uni_modules/uview-plus'; |
| 65 | // 计算属性获取用户信息(响应式) | 67 | // 计算属性获取用户信息(响应式) |
| 66 | const userInfo = computed(() => userStore.userInfo.user || {}) | 68 | const userInfo = computed(() => userStore.userInfo.user || {}) |
| 67 | 69 |