operateList.vue
6.4 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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<template>
<view class="operate">
<view class="operate_list">
<view v-if="carInfo.policyStatus != '问题件' && assessor" class="operate_item">
<text class="operate_btn" :class="{active: current === 0 }" @click="handleSuccess">通过</text>
</view>
<view v-if="carInfo.policyStatus != '问题件' && assessor" class="operate_item">
<text class="operate_btn" :class="{active: current === 1 }" @click="handleReturn">退回</text>
</view>
<view v-if="carInfo.policyStatus != '问题件'" class="operate_item">
<text class="operate_btn" :class="{active: current === 2 }" @click="handleUpdate">审核</text>
</view>
<view v-if="carInfo.policyStatus == '问题件'" class="operate_item">
<text class="operate_btn" :class="{active: current === 3 }" @click="lookReason">查询</text>
</view>
<view class="operate_item">
<text class="operate_btn" :class="{active: current === 4 }" @click="handleInvalid">作废</text>
</view>
<view class="operate_item">
<text class="operate_btn" :class="{active: current === 5 }" @click="handleCirculation">分配</text>
</view>
</view>
<!-- 查询问题件回馈 -->
<up-modal :show="showIssue" title="作废备注" @confirm="showIssue = false" >
<up-parse :content="IssueMessage"></up-parse>
</up-modal>
<!-- 作废弹出框 -->
<up-modal :show="showDefeat" showCancelButton title="填写作废内容" @confirm="sunmitDeprecated" @cancel="showDefeat = false">
<up-textarea v-model="DefeatContent" placeholder="请输入内容" ></up-textarea>
</up-modal>
<!-- 退回弹出框 -->
<up-modal :show="showReturn" showCancelButton title="填写退回内容" @confirm="sunmitReturn" @cancel="showReturn = false">
<up-textarea v-model="returnContent" placeholder="请输入内容" ></up-textarea>
</up-modal>
<!-- 分配保险公司 -->
<up-modal :show="showCompany" showCancelButton closeOnClickOverlay title="选择分配项" @confirm="submitForm" @cancel="showCompany = false" @close="showCompany = false">
<view class="slot-content">
<view class="company_box">
<view class="header_top">
<up-input
placeholder="请输入承保公司名称"
prefixIcon="search"
v-model="companyQueryParams.deptName"
></up-input>
<view class="btn" @click="getDeptList">查询</view>
</view>
<view class="company_content">
<up-radio-group v-model="deptId" placement="column">
<up-radio
v-for="(item, index) in deptOptions"
:key="index"
:label="item.deptName"
:name="item.deptId"
/>
</up-radio-group>
</view>
</view>
</view>
</up-modal>
</view>
</template>
<script setup>
import { ref, reactive} from 'vue'
import { disposeUser, listDept, queryDefeatContent } from '@/api/work.js'
import useUserStore from '@/store/modules/user';
const props = defineProps({
carInfo: {
type: Object,
require: true
}
})
const userStore = useUserStore()
const emit = defineEmits(['refreshList'])
const deptOptions = ref([]);
const companyQueryParams = reactive({
deptName: undefined,
status: undefined,
});
const deptId = ref(0)
const current = ref(9)
const showIssue = ref(false)
const IssueMessage = ref('')
const showReturn = ref(false)
const returnContent = ref('')
const showDefeat = ref(false)
const DefeatContent = ref('')
const showCompany = ref(false)
const assessor = ref(false)
// 通过
const handleSuccess = () => {
current.value = 0
uni.showModal({
title: '提示',
content: '是否通过',
success: function (res) {
if (res.confirm) {
disposeUser({ associationapprove: '0', associationapprovetype: "0", deptid: userStore.transferDeptId }, props.carInfo.taskId).then((res) => {
uni.$u.toast('保单已通过')
emit('refreshList')
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
// 退回
const handleReturn = () => {
current.value = 1
showReturn.value = true
}
// 作废
const handleInvalid = () => {
current.value = 4
showDefeat.value = true
}
// 查看
const lookReason = async () => {
current.value = 3
const { data } = await queryDefeatContent({
processInstanceId: props.carInfo.processInstanceId,
type: 0,
});
IssueMessage.value = data.message;
showIssue.value = true;
}
// 审核
const handleUpdate = () => {
current.value = 2
assessor.value = true
const id = props.carInfo.businessKey
uni.navigateTo({
url: `/pages/carDetail/carDetail?carInfoId=${id}&roleId=1`
})
}
// 分配
const handleCirculation = () => {
current.value = 5
getDeptList();
showCompany.value = true
}
/** 查询公司列表 */
const getDeptList = () => {
listDept(companyQueryParams).then((response) => {
deptOptions.value = response.data.filter((item) => item.parentId === 100);
});
}
// 提交作废表单
const sunmitDeprecated = () => {
const data = {
associationapprove: '2',
comment: DefeatContent.value,
};
const taskId = props.carInfo.taskId
disposeUser(data, taskId).then((res) => {
emit('refreshList')
uni.$u.toast('保单已作废')
showDefeat.value = false
});
}
// 提交退回表单
const sunmitReturn = () => {
const data = {
associationapprove: '1',
comment: returnContent.value,
};
const taskId = props.carInfo.taskId
disposeUser(data, taskId).then((res) => {
emit('refreshList')
uni.$u.toast('保单退回')
showReturn.value = false
});
}
/** 提交通过分配承保公司 */
const submitForm = () => {
const data = {
associationapprove: '0',
associationapprovetype: "1",
deptid: deptId.value.toString(),
};
const taskId = props.carInfo.taskId
disposeUser(data, taskId).then((res) => {
showCompany.value = false;
emit('refreshList')
uni.$u.toast('保单已分配成功')
});
}
</script>
<style lang="scss" scoped>
.operate{
.operate_list{
display: flex;
align-items: center;
.operate_item{
display: flex;
align-items: center;
justify-content: center;
flex: 1;
height: 40rpx;
border-right: 2rpx solid #3680FE;
&:last-child{
border-right: 0;
}
.operate_btn{
width: 100rpx;
height: 40rpx;
line-height: 40rpx;
font-size: 24rpx;
text-align: center;
border-radius: 8rpx;
&.active{
background: #3680FE;
color: #fff;
}
}
}
}
}
.header_top {
display: flex;
align-items: center;
margin-bottom: 20rpx;
.btn{
height: 68rpx;
line-height: 68rpx;
padding: 0 28rpx;
font-size: 24rpx;
color: #fff;
background-color: #3c9cff;
}
}
.company_content{
height: 300rpx;
overflow-y: scroll;
}
</style>