123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <template>
- <view class="box">
- <scroll-view scroll-y="true" class="scroll-box">
- <uv-steps :current="activeStep" direction="column">
- <uv-steps-item v-for="item, index in flowRecordList" :key="'f' + index" :title="item.taskName">
- <template v-slot:desc>
- <view class="desc">
- <view class="desc-item">
- <view class="item-label">办理人:</view>
- <view class="item-value">{{ item.assigneeName }}</view>
- </view>
- <view class="desc-item" v-if="item.candidate">
- <view class="item-label">候选办理:</view>
- <view class="item-value">{{ item.candidate }}</view>
- </view>
- <view class="desc-item">
- <view class="item-label">接收时间:</view>
- <view class="item-value">{{ item.createTime }}</view>
- </view>
- <view class="desc-item">
- <view class="item-label">处理时间:</view>
- <view class="item-value">{{ item.finishTime }}</view>
- </view>
- <view class="desc-item">
- <view class="item-label">耗时:</view>
- <view class="item-value">{{ item.duration }}</view>
- </view>
- </view>
- </template>
- </uv-steps-item>
- </uv-steps>
- </scroll-view>
-
- </view>
- </template>
-
- <script>
- import { flowRecord } from "@/api/flowable/finished";
- export default {
- props: {
- rows: Object
- },
- watch: {
- rows(newval) {
- console.log(newval);
- this.getFlowRecordList();
- }
- },
- created() {
- this.getFlowRecordList();
- },
- data() {
- return {
- flowRecordList: [], // 流程流转数据
- flowList: [],
- activeStep: 0,
- }
- },
- methods: {
- setColor(val) {
- if (val) {
- return "#2bc418";
- } else {
- return "#b3bdbb";
- }
- },
- setIcon(val) {
- if (val) {
- return "el-icon-check";
- } else {
- return "el-icon-time";
- }
- },
- /** 获取流程变量内容 */
- processVariables() {
- if (this.rows.taskId) {
- }
- },
- /** 流程流转记录 */
- getFlowRecordList() {
- this.activeStep = 0;
- const params = { procInsId: this.rows.procInsId, deployId: this.rows.deployId }
- flowRecord(params).then(res => {
- this.flowRecordList = res.data.flowList.reverse();
- for (let i = 0; i < this.flowRecordList.length; i++) {
- if (!this.flowRecordList[i].finishTime) {
- this.activeStep = i
- }
- }
- if (this.activeStep == 0) {
- this.activeStep = this.flowRecordList.length
- }
- }).catch(res => {
-
- })
- },
- }
- }
- </script>
-
- <style lang="scss" scoped>
- .box {
- padding: 20px;
- height: 100%;
- }
-
- .scroll-box {
- height: 100%;
- }
-
- .desc {
- padding: 8px;
- background: #fff;
- border-radius: 8px;
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
- width: 100%;
-
- .desc-item {
- display: flex;
- border-bottom: 1px solid #eee;
- height: 30px;
- align-items: center;
-
- .item-label {
- width: 80px;
- text-align: right;
- }
-
- .item-value {
- // flex: 1;
- }
- }
- }
- </style>
|