societyOrder.vue
5.1 KB
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<template>
<view class="company_container">
<up-navbar placeholder leftIconColor="#fff" autoBack bgColor="transparent" />
<view class="work_box">
<view class="work_list">
<carCard v-for="carItem in List" :key="carItem.taskId" :tipContent="tipContent" :carInfo="carItem">
<template #header>
<navTop :carNum="carItem.licensePlateNumber" />
</template>
<template #center>
<wordInfo :phone="carItem.phone" :userName="carItem.name" :company="carItem.sysDeptName" />
</template>
<template #footer>
<operateList v-if="typeId === 0" :carInfo="carItem" @refreshList="getList"/>
<view style="display: flex;align-items: center;gap: 30rpx;">
<view class="btn" @click="lookDetail(carItem.businessKey)">查看详情</view>
<view v-if="typeId === 3" class="btn" @click="lookFeedback(carItem.processInstanceId)">查看回馈</view>
<view v-if="typeId === 4" class="btn" @click="lookRemark(carItem.processInstanceId)">查看备注</view>
</view>
</template>
</carCard>
<up-empty
:show="List.length == 0"
mode="list"
text="暂无待办事项"
/>
</view>
<!-- 分页器 -->
<view v-show="List.length > 0">
<uni-pagination :total="allTotal" v-model="queryParams.pageNum" :pageSize="queryParams.pageSize" @change="getList(typeId)"/>
</view>
</view>
<!-- 保单回馈 -->
<up-modal :show="showFeedback" title="保单回馈" @confirm="showFeedback = false" >
<up-parse :content="feedbakcForm.message"></up-parse>
</up-modal>
<!-- 作废备注 -->
<up-modal :show="showDefeat" title="作废备注" @confirm="showDefeat = false" >
<up-parse :content="defeatForm.message"></up-parse>
</up-modal>
</view>
</template>
<script setup>
import { ref, reactive } from 'vue';
import { onLoad, onPullDownRefresh } from '@dcloudio/uni-app'
import { queryMyList, queryProcessedList, queryOngoingList, queryEndedList, queryDeprecatedList, queryDefeatContent, queryResult } from '@/api/work.js'
import carCard from '@/components/carCard.vue';
import navTop from '@/components/navTop.vue';
import wordInfo from '@/components/wordInfo.vue';
import operateList from '@/components/operateList.vue';
const List = ref([])
const allTotal = ref(0)
const typeId = ref(0)
const showFeedback = ref(false)
const showDefeat = ref(false)
const feedbakcForm = ref({
policyNumber: '',
message: ''
})
const defeatForm = ref({
message: ''
})
const titleStyle = {
fontSize: '36rpx',
color: '#fff',
fontWeight: 500
}
const queryParams = reactive({
pageNum: 1,
pageSize: 10
});
const tipContent = ref('')
// 初始加载数据
onLoad((options) => {
typeId.value = Number(options.type)
getList(typeId.value)
})
// 用户下拉刷新
onPullDownRefresh(async () => {
queryParams.pageNum = 1
List.value = []
getList(typeId.value)
})
const getList = (id) => {
//调用获取数据方法
switch (id) {
case 0:
tipContent.value = '待处理'
queryMyList(queryParams).then(res => {
List.value = res.data.rows
allTotal.value = res.data.total
uni.stopPullDownRefresh()
})
break;
case 1:
tipContent.value = '已处理'
queryProcessedList(queryParams).then(res => {
List.value = res.rows
allTotal.value = res.total
uni.stopPullDownRefresh()
})
break;
case 2:
tipContent.value = '进行中'
queryOngoingList(queryParams).then(res => {
List.value = res.rows
allTotal.value = res.total
uni.stopPullDownRefresh()
})
break;
case 3:
tipContent.value = '已完结'
queryEndedList(queryParams).then(res => {
List.value = res.rows
allTotal.value = res.total
uni.stopPullDownRefresh()
})
break;
case 4:
tipContent.value = '已作废'
queryDeprecatedList(queryParams).then(res => {
List.value = res.rows
allTotal.value = res.total
uni.stopPullDownRefresh()
})
break;
}
}
// 查看详情
const lookDetail = (id) => {
uni.navigateTo({
url: `/pages/carDetail/carDetail?carInfoId=${id}`
})
}
// 查看回馈
const lookFeedback = (processInstanceId) => {
queryResult({ processInstanceId}).then((res) => {
feedbakcForm.value.policyNumber = res?.data?.policyNumber;
feedbakcForm.value.message = res?.data?.message;
showFeedback.value = true;
});
}
// 查看备注
const lookRemark = (processInstanceId) => {
queryDefeatContent({ processInstanceId}).then((res) => {
defeatForm.value.message = res?.data?.message;
showDefeat.value = true;
});
}
</script>
<style lang="scss" scoped>
.company_container{
width: 100%;
height: 100vh;
background: url('http://bxhd.crgx.net/profile/avatar/2024/09/25/bg-index_20240925113012A004.png') no-repeat;
background-size: 100% 100%;
overflow: hidden;
.work_box{
padding: 20rpx 30rpx;
height: calc(100vh - 288rpx);
background-color: #F8F9FF;
overflow-y: scroll;
.work_list{
display: flex;
flex-direction: column;
gap: 20rpx;
margin-bottom: 30rpx;
}
}
}
.btn {
width: 100rpx;
height: 40rpx;
line-height: 40rpx;
font-size: 24rpx;
text-align: center;
color: #3c9cff;
}
</style>