Blame view

pages/workFlow/components/flowList_1.vue 2.48 KB
290144e9   易尊强   第一次
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
  <template>
  	<view class="flow-list flowBefore">
  		<view class="item" v-for="(item, index) in list" :key="item.id" @click="handleClick(item)">
  			<view class="item-cell item-title u-border-bottom">
  				<text class="title u-line-1">{{item.fullName}}</text>
  			</view>
  			<view class="item-cell">
  				<text class="time">{{item.creatorTime | date('yyyy-mm-dd hh:MM')}}</text>
  				<text :class="'status '+getFlowDoneStatus(item.status).statusCss" v-if="opType==2">
  					{{getFlowDoneStatus(item.status).text}}
  				</text>
  				<text :class="'status '+getFlowStatus(item.status).statusCss" v-else>
  					{{getFlowStatus(item.status).text}}
  				</text>
  			</view>
  		</view>
  	</view>
  </template>
  <script>
  	export default {
  		name: "FlowList",
  		props: {
  			list: {
  				type: Array,
  				default: () => []
  			},
  			opType: {
  				type: Number,
  				default: 1
  			}
  		},
  		data() {
  			return {};
  		},
  		methods: {
  			handleClick(item) {
  				const config = {
  					id: item.processId,
  					enCode: item.flowCode,
  					flowId: item.flowId,
  					formType: item.formType,
  					opType: this.opType,
  					status: item.status,
  					taskNodeId: item.thisStepId,
  					fullName: item.fullName,
  					taskId: item.id
  				}
  				uni.navigateTo({
  					url: '/pages/workFlow/flowBefore/index?config=' + encodeURIComponent(JSON.stringify(config))
  				})
  			},
  			getFlowDoneStatus(val) {
  				let status
  				switch (val) {
  					case 1:
  						status = {
  							text: '同意',
  							statusCss: 'u-type-success'
  						}
  						break;
  					default:
  						status = {
  							text: '拒绝',
  							statusCss: 'u-type-error'
  						}
  						break;
  				}
  				return status
  			},
  			getFlowStatus(val) {
  				let status
  				switch (val) {
  					case 0:
  						status = {
  							text: '等待提交',
  							statusCss: 'u-type-info'
  						}
  						break;
  					case 1:
  						status = {
  							text: '等待审核',
  							statusCss: 'u-type-primary'
  						}
  						break;
  					case 2:
  						status = {
  							text: '审核通过',
  							statusCss: 'u-type-success'
  						}
  						break;
  					case 3:
  						status = {
  							text: '审核驳回',
  							statusCss: 'u-type-error'
  						}
  						break;
  					case 4:
  						status = {
  							text: '流程撤回',
  							statusCss: 'u-type-warning'
  						}
  						break;
  					case 5:
  						status = {
  							text: '审核终止',
  							statusCss: 'u-type-info'
  						}
  						break;
  					default:
  						status = {
  							text: '等待提交',
  							statusCss: 'u-type-info'
  						}
  						break;
  				}
  				return status
  			}
  		}
  	};
  </script>