付延余
2022-12-19 8fc8838a441ae3d3b1616f4fc003b16292978b54
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<template>
    <view class="approval-history">
        <combined-title title="审批历史"></combined-title>
        <u-empty v-if="scheduleData.length == 0"
                mode="data"
                icon="http://cdn.uviewui.com/uview/empty/data.png"
                        width="100px"
                        height="150px"
        >
        </u-empty>
        <view class="scheduleTable" v-for="(item,index) in scheduleData" :key="index">
            <uni-table border stripe emptyText="暂无更多数据">
                <!-- 表格数据行 -->
                <uni-tr>
                    <uni-th align="center">任务名称</uni-th>
                    <uni-td>{{ item.name }}</uni-td>
                </uni-tr>
                <uni-tr>
                    <uni-th align="center">处理人</uni-th>
                    <uni-td>
                        <view class="assigneesContainer">
                            <u-tag :text="role.nickname" type="primary" size="mini" plain v-for="(role,roleIndex) in item.assignees" :key="roleIndex"></u-tag>
                        </view>
                    </uni-td>
                </uni-tr>
                <uni-tr>
                    <uni-th align="center">审批操作</uni-th>
                    <uni-td>{{item.deleteReason}}</uni-td>
                </uni-tr>
                <uni-tr>
                    <uni-th align="center">审批意见</uni-th>
                    <uni-td>{{ item.comment=='undefined'?item.endTime?'未填写':'':item.comment|| item.endTime?'未填写':'' }}</uni-td>
                </uni-tr>
                <uni-tr>
                    <uni-th align="center">耗时</uni-th>
                    <uni-td>{{
                        item.duration >= 86400000
                                        ? parseInt(item.duration / 86400000 + '天' + parseInt(item.duration % 86400000) / 3600000 + '时' + parseInt(item.duration % 3600000) / 60000 + '分')
                                        : item.duration >= 3600000
                                        ? parseInt(item.duration / 3600000) + '时' + parseInt((item.duration / 3600000) % 3600000) + '分'
                                        : parseInt(item.duration / 60000) + '分'
                                        }}
                                        </uni-td>
                </uni-tr>
                <uni-tr>
                    <uni-th align="center">创建时间</uni-th>
                    <uni-td>{{ item.createTime }}</uni-td>
                </uni-tr>
                <uni-tr>
                    <uni-th align="center">完成时间</uni-th>
                    <uni-td>{{ item.endTime ||'' }}</uni-td>
                </uni-tr>
                <uni-tr>
                    <uni-th align="center">状态</uni-th>
                    <uni-td :style="{color:(item.endTime==null?'#969696':'#007AFF')}">{{ item.endTime ==null? '待处理' : '已办理' }}</uni-td>
                </uni-tr>
            </uni-table>
        </view>
 
        <!-- 菜单栏 -->
        <popup-menu @menuShow="menushow" ref="menuRef"></popup-menu>
    </view>
</template>
 
<script>
import popupMenu from '@/components/common/popup-menu/popup-menu.vue';
import combinedTitle from '@/components/common/combined-title/combined-title.vue';
export default {
    data() {
        return {
            scheduleData: [],
                // meizhongshenqing: '葛泉矿申请:煤矸石',
                // renwu: '发运审批',
                // liucheng: '发运通知单',
                // faqiren: '葛泉矿',
                // shenpiCaozuo: '审批通过',
                // shenpiyijian: '同意',
                // haoshi: '19秒',
                // createTime: '2022-5-25 12:06:15'
            applicationId:null,
            menuShow:false,
            ifEmpty:false
        };
    },
    onLoad(options){
        this.applicationId = JSON.parse(options.index);
    },
    // 点击导航栏菜单后
    onNavigationBarButtonTap(e) {
        // console.log(e);
        this.$refs.menuRef.menuClick();
    },
    onShow(){
        if(this.menuShow == true){
            this.$refs.menuRef.menuClick()
        }
        this.init();
    },
    components: {
        combinedTitle,
        popupMenu
    },
    methods: {
        init(){
            this.historicFlow()
        },
        historicFlow(){
            this.$reqGet('historicFlow',{},this.applicationId).then(res=>{
                console.log('审批历史',res);
 
                if(res.code == 0){
                    if(res.data == null){
                        this.ifEmpty = true
                    } else{
                        this.scheduleData = res.data
                    }
                }
            })
        },
        menushow(e){
            this.menuShow = e
        }
    }
};
</script>
 
<style lang="scss" scoped>
::v-deep.approval-history {
    width: 100%;
    height: 100%;
    .scheduleTable {
        margin: vww(10) auto 0;
        width: 91%;
        .uni-table {
            .uni-table-tr {
                .uni-table-th {
                    width: vww(88);
                    height: vww(40);
                    background-color: #f5f5f5;
                    color: #111111;
                    font-size: vww(13);
                    font-weight: 500;
                }
                .uni-table-td {
                    width: vww(240);
                    height: vww(40);
                    background-color: #ffffff;
                    color: #111111;
                    font-size: vww(13);
                }
            }
      // 处理人标签容器
      .assigneesContainer{
        .u-transition{
          display:inline-block;
          margin-left: vww(3);
        }
      }
        }
        // 边框
        // .table--border{
        //     border:1px solid #DDDDDD;
        // }
    }
}
</style>