Showing
2 changed files
with
67 additions
and
20 deletions
| ... | @@ -2,12 +2,12 @@ | ... | @@ -2,12 +2,12 @@ |
| 2 | * @Author: hookehuyr hookehuyr@gmail.com | 2 | * @Author: hookehuyr hookehuyr@gmail.com |
| 3 | * @Date: 2022-05-31 12:06:19 | 3 | * @Date: 2022-05-31 12:06:19 |
| 4 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 4 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 5 | - * @LastEditTime: 2024-06-07 10:28:48 | 5 | + * @LastEditTime: 2024-07-30 17:21:26 |
| 6 | * @FilePath: /data-table/src/main.js | 6 | * @FilePath: /data-table/src/main.js |
| 7 | * @Description: | 7 | * @Description: |
| 8 | */ | 8 | */ |
| 9 | import { createApp } from 'vue'; | 9 | import { createApp } from 'vue'; |
| 10 | -import { Button, Image as VanImage, Col, Row, Icon, Form, Field, CellGroup, ConfigProvider, Toast, Uploader, Empty, Tab, Tabs, Overlay, NumberKeyboard, Lazyload, List, PullRefresh, Popup, Picker, Sticky, Stepper, Tag, Swipe, SwipeItem, Dialog, ActionSheet, Loading, Checkbox, Search, NavBar, Collapse, CollapseItem, RadioGroup, Radio, CheckboxGroup, Area, DatePicker, TimePicker, PickerGroup, Rate, Calendar, Divider, Popover, NoticeBar, ImagePreview, FloatingBubble } from 'vant'; | 10 | +import { Button, Image as VanImage, Col, Row, Icon, Form, Field, CellGroup, ConfigProvider, Toast, Uploader, Empty, Tab, Tabs, Overlay, NumberKeyboard, Lazyload, List, PullRefresh, Popup, Picker, Sticky, Stepper, Tag, Swipe, SwipeItem, Dialog, ActionSheet, Loading, Checkbox, Search, NavBar, RadioGroup, Radio, CheckboxGroup, Area, DatePicker, TimePicker, PickerGroup, Rate, Calendar, Divider, Popover, NoticeBar, ImagePreview, FloatingBubble, Collapse, CollapseItem } from 'vant'; |
| 11 | import router from './router'; | 11 | import router from './router'; |
| 12 | import App from './App.vue'; | 12 | import App from './App.vue'; |
| 13 | // import axios from './utils/axios'; | 13 | // import axios from './utils/axios'; |
| ... | @@ -25,6 +25,6 @@ app.config.warnHandler = () => null; | ... | @@ -25,6 +25,6 @@ app.config.warnHandler = () => null; |
| 25 | 25 | ||
| 26 | app.config.globalProperties.$http = axios; // 关键语句 | 26 | app.config.globalProperties.$http = axios; // 关键语句 |
| 27 | 27 | ||
| 28 | -app.use(pinia).use(router).use(Button).use(VanImage).use(Col).use(Row).use(Icon).use(Form).use(Field).use(CellGroup).use(Toast).use(Uploader).use(Empty).use(Tab).use(Tabs).use(Overlay).use(NumberKeyboard).use(Lazyload).use(List).use(PullRefresh).use(Popup).use(Picker).use(Sticky).use(Stepper).use(Tag).use(Swipe).use(SwipeItem).use(Dialog).use(ActionSheet).use(Loading).use(Checkbox).use(Search).use(ConfigProvider).use(NavBar).use(Collapse).use(CollapseItem).use(Radio).use(RadioGroup).use(CheckboxGroup).use(Area).use(DatePicker).use(TimePicker).use(PickerGroup).use(Rate).use(Calendar).use(Divider).use(Popover).use(NoticeBar).use(ImagePreview).use(FloatingBubble); | 28 | +app.use(pinia).use(router).use(Button).use(VanImage).use(Col).use(Row).use(Icon).use(Form).use(Field).use(CellGroup).use(Toast).use(Uploader).use(Empty).use(Tab).use(Tabs).use(Overlay).use(NumberKeyboard).use(Lazyload).use(List).use(PullRefresh).use(Popup).use(Picker).use(Sticky).use(Stepper).use(Tag).use(Swipe).use(SwipeItem).use(Dialog).use(ActionSheet).use(Loading).use(Checkbox).use(Search).use(ConfigProvider).use(NavBar).use(Collapse).use(CollapseItem).use(Radio).use(RadioGroup).use(CheckboxGroup).use(Area).use(DatePicker).use(TimePicker).use(PickerGroup).use(Rate).use(Calendar).use(Divider).use(Popover).use(NoticeBar).use(ImagePreview).use(FloatingBubble).use(Collapse).use(CollapseItem); |
| 29 | app.use(vueEsign) | 29 | app.use(vueEsign) |
| 30 | app.mount('#app'); | 30 | app.mount('#app'); | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-07-18 10:22:22 | 2 | * @Date: 2022-07-18 10:22:22 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-07-29 17:11:14 | 4 | + * @LastEditTime: 2024-07-30 18:04:03 |
| 5 | * @FilePath: /data-table/src/views/index.vue | 5 | * @FilePath: /data-table/src/views/index.vue |
| 6 | * @Description: 首页 | 6 | * @Description: 首页 |
| 7 | --> | 7 | --> |
| ... | @@ -54,23 +54,54 @@ | ... | @@ -54,23 +54,54 @@ |
| 54 | 流程操作 | 54 | 流程操作 |
| 55 | </van-button> | 55 | </van-button> |
| 56 | </div> | 56 | </div> |
| 57 | - <!-- TODO: 显示审批意见 --> | 57 | + <!-- 显示审批意见 --> |
| 58 | - <!-- <div v-if="page_type === 'info'" style="margin: 16px; padding-top: 1rem;"> | 58 | + <div v-if="page_type === 'info' && form_flow_process_list.length" style="margin: 16px;"> |
| 59 | <div> | 59 | <div> |
| 60 | - <p style="margin-bottom: 1rem; font-size: 0.85rem; font-weight: bold;">审批意见</p> | 60 | + <p style="margin-bottom: 1rem; font-size: 0.85rem; font-weight: bold;">审批结果</p> |
| 61 | - <div style="margin-bottom: 1rem; border: 1px solid #eee;"> | 61 | + <div style="margin-bottom: 1rem; border-left: 1px solid #eee; border-right: 1px solid #eee;"> |
| 62 | - <van-field | 62 | + <van-collapse ref="collapseRef" v-model="active_flow_process"> |
| 63 | - v-model="approval_note" | 63 | + <van-collapse-item v-for="(item, index) in form_flow_process_list" :value="item.node_action_id === 'commit' ? '提交' : '驳回'" :name="item.node_code"> |
| 64 | - rows="3" | 64 | + <template #title> |
| 65 | - autosize | 65 | + <div style="display: flex; align-items: center;"> |
| 66 | - label="" | 66 | + <van-icon |
| 67 | - type="textarea" | 67 | + :name="item.node_action_id === 'commit' ? 'passed' : 'close'" |
| 68 | - placeholder="" | 68 | + :color="item.node_action_id === 'commit' ? '#05ae33' : 'red'" size="1rem" |
| 69 | - disabled | 69 | + /> |
| 70 | - /> | 70 | + <span v-if="item.node_action_id === 'commit'" class="van-ellipsis" style="color: #05ae33; width: 45vw; display: inline-block; line-height: 1rem;"> |
| 71 | + {{ item.node_name }} | ||
| 72 | + </span> | ||
| 73 | + <span v-else class="van-ellipsis" style="color: red; width: 45vw; display: inline-block; line-height: 1rem;"> | ||
| 74 | + {{ item.node_name }} | ||
| 75 | + </span> | ||
| 76 | + </div> | ||
| 77 | + </template> | ||
| 78 | + <div> | ||
| 79 | + <!-- <van-row gutter="" align="center" style="margin-bottom: 0.25rem;"> | ||
| 80 | + <van-col span="8">审批操作</van-col> | ||
| 81 | + <van-col span="16" style="text-align: right;">commit=提交,reject=驳回</van-col> | ||
| 82 | + </van-row> --> | ||
| 83 | + <van-row v-if="item.node" gutter="" align="center" style="margin-bottom: 0.25rem;"> | ||
| 84 | + <van-col span="8">审批意见</van-col> | ||
| 85 | + <van-col span="16" style="text-align: right;">{{ item.node }}</van-col> | ||
| 86 | + </van-row> | ||
| 87 | + <van-row gutter="" align="center" style="margin-bottom: 0.25rem;"> | ||
| 88 | + <van-col span="8">节点名称</van-col> | ||
| 89 | + <van-col span="16" style="text-align: right;">{{ item.node_name }}</van-col> | ||
| 90 | + </van-row> | ||
| 91 | + <van-row gutter="" align="center" style="margin-bottom: 0.25rem;"> | ||
| 92 | + <van-col span="8">审批人名称</van-col> | ||
| 93 | + <van-col span="16" style="text-align: right;">{{ item.created_by_name }}</van-col> | ||
| 94 | + </van-row> | ||
| 95 | + <van-row gutter="" align="center" style="margin-bottom: 0.25rem;"> | ||
| 96 | + <van-col span="8">审批时间</van-col> | ||
| 97 | + <van-col span="16" style="text-align: right;">{{ formatDate(item.created_time) }}</van-col> | ||
| 98 | + </van-row> | ||
| 99 | + </div> | ||
| 100 | + </van-collapse-item> | ||
| 101 | + </van-collapse> | ||
| 71 | </div> | 102 | </div> |
| 72 | </div> | 103 | </div> |
| 73 | - </div> --> | 104 | + </div> |
| 74 | <!-- <van-cell-group :border="false"> | 105 | <!-- <van-cell-group :border="false"> |
| 75 | <component | 106 | <component |
| 76 | v-for="(item, index) in mockData" | 107 | v-for="(item, index) in mockData" |
| ... | @@ -175,7 +206,7 @@ import { useRoute } from "vue-router"; | ... | @@ -175,7 +206,7 @@ import { useRoute } from "vue-router"; |
| 175 | import { queryFormAPI, postVerifyPasswordAPI } from "@/api/form.js"; | 206 | import { queryFormAPI, postVerifyPasswordAPI } from "@/api/form.js"; |
| 176 | import { addFormDataAPI, queryFormDataAPI, modiFormDataAPI, flowFormDataAPI } from "@/api/data.js"; | 207 | import { addFormDataAPI, queryFormDataAPI, modiFormDataAPI, flowFormDataAPI } from "@/api/data.js"; |
| 177 | import { showSuccessToast, showFailToast, showConfirmDialog } from "vant"; | 208 | import { showSuccessToast, showFailToast, showConfirmDialog } from "vant"; |
| 178 | -import { wxInfo, getUrlParams } from "@/utils/tools"; | 209 | +import { wxInfo, getUrlParams, formatDate } from "@/utils/tools"; |
| 179 | import { styleColor } from "@/constant.js"; | 210 | import { styleColor } from "@/constant.js"; |
| 180 | import { sharePage } from '@/composables/useShare.js' | 211 | import { sharePage } from '@/composables/useShare.js' |
| 181 | import wx from 'weixin-js-sdk' | 212 | import wx from 'weixin-js-sdk' |
| ... | @@ -377,14 +408,30 @@ const onBindSubmit = (values) => { | ... | @@ -377,14 +408,30 @@ const onBindSubmit = (values) => { |
| 377 | }; | 408 | }; |
| 378 | 409 | ||
| 379 | const flow_node_code = $route.query.flow_node_code ? $route.query.flow_node_code :formSetting.value.flow_node_code; // flow_node_code 表示随机选择的流程节点的ID | 410 | const flow_node_code = $route.query.flow_node_code ? $route.query.flow_node_code :formSetting.value.flow_node_code; // flow_node_code 表示随机选择的流程节点的ID |
| 411 | +const form_flow_process_list = ref([]); | ||
| 412 | +const active_flow_process = ref([]); | ||
| 413 | +const collapseRef = ref(null); | ||
| 380 | 414 | ||
| 381 | onMounted(async () => { | 415 | onMounted(async () => { |
| 382 | // TAG: 全局背景色 | 416 | // TAG: 全局背景色 |
| 383 | document | 417 | document |
| 384 | .querySelector("body") | 418 | .querySelector("body") |
| 385 | .setAttribute("style", `background-color: ${styleColor.backgroundColor}`); | 419 | .setAttribute("style", `background-color: ${styleColor.backgroundColor}`); |
| 386 | - const { data } = await queryFormAPI({ form_code: $route.query.code, page_type, data_id, flow_node_code }); // flow_node_code 表示随机选择的流程节点的ID | 420 | + const { data, flow_process_list, code } = await queryFormAPI({ form_code: $route.query.code, page_type, data_id, flow_node_code }); // flow_node_code 表示随机选择的流程节点的ID |
| 387 | const form_data = data; | 421 | const form_data = data; |
| 422 | + // 处理审批意见显示 | ||
| 423 | + if (code) { | ||
| 424 | + setTimeout(() => { | ||
| 425 | + form_flow_process_list.value = flow_process_list; // 上中下游节点的审批意见 | ||
| 426 | + if (flow_process_list?.length) { | ||
| 427 | + // active_flow_process.value.push(flow_process_list[0]['node_code']); | ||
| 428 | + nextTick(() => { | ||
| 429 | + // 全部展开 | ||
| 430 | + collapseRef.value?.toggleAll(true); | ||
| 431 | + }) | ||
| 432 | + } | ||
| 433 | + }, 1000); | ||
| 434 | + } | ||
| 388 | // 缓存表单信息 | 435 | // 缓存表单信息 |
| 389 | store.changeFormInfo(data); | 436 | store.changeFormInfo(data); |
| 390 | // 表单网页标题 | 437 | // 表单网页标题 | ... | ... |
-
Please register or login to post a comment