operateList.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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<template>
<view class="operate">
<view class="operate_list">
<view class="operate_item">
<text class="operate_btn" :class="{active: current === 0 }" @click="handleSuccess">通过</text>
</view>
<view class="operate_item">
<text class="operate_btn" :class="{active: current === 1 }" @click="handleReturn">退回</text>
</view>
<view class="operate_item">
<text class="operate_btn" :class="{active: current === 2 }" @click="handleInvalid">作废</text>
</view>
<view class="operate_item">
<text class="operate_btn" :class="{active: current === 3 }" @click="handleUpdate">修改</text>
</view>
<view class="operate_item">
<text class="operate_btn" :class="{active: current === 4 }" @click="handleCirculation">流转</text>
</view>
</view>
<!-- 作废回馈弹出框 -->
<up-modal :show="showDefeat" showCancelButton title="填写作废回馈" @confirm="sunmitDeprecated" @cancel="showDefeat = false">
<up-textarea v-model="DefeatContent" 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>
<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>
</up-modal>
</view>
</template>
<script setup>
import { ref, reactive} from 'vue'
import { disposeUser, listDept } from '@/api/work.js'
const props = defineProps({
carInfo: {
type: Object,
require: true
}
})
const emit = defineEmits(['refreshList'])
const deptOptions = ref([]);
const companyQueryParams = reactive({
deptName: undefined,
status: undefined,
});
const deptId = ref(0)
const current = ref(9)
const showDefeat = ref(false)
const DefeatContent = ref('')
const showCompany = ref(false)
// 通过
const handleSuccess = () => {
current.value = 0
uni.showModal({
title: '提示',
content: '是否通过',
success: function (res) {
if (res.confirm) {
disposeUser({ associationapprove: '0' }, props.carInfo.taskId).then((res) => {
uni.$u.toast('保单已通过')
emit('refreshList')
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
// 退回
const handleReturn = () => {
current.value = 1
uni.showModal({
title: '提示',
content: '是否退回',
success: function (res) {
if (res.confirm) {
disposeUser({ associationapprove: '1' }, props.carInfo.taskId).then((res) => {
uni.$u.toast('保单已退回')
emit('refreshList')
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
// 作废
const handleInvalid = () => {
current.value = 2
showDefeat.value = true
}
// 修改
const handleUpdate = () => {
current.value = 3
const id = props.carInfo.businessKey
uni.navigateTo({
url: `/pages/carDetail/carDetail?carInfoId=${id}&roleId=1`
})
}
// 分配
const handleCirculation = () => {
current.value = 4
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 submitForm = () => {
const data = {
associationapprove: '0',
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;
}
}
</style>