yuanhao
2025-05-19 cc610ef597a4b600b4c48c80026f3a99be171f3b
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
<template>
    <view>
        <view class="page-box">
            <view class="padding">
                <view class="font">
                    投诉部门
                </view>
                <view style="margin-top: 20rpx;" @click="show = true">
                    <u-input placeholder="请选择" readonly  :value="executeDeptName"     suffixIcon="arrow-right"></u-input>
                </view>
                <view class="font">
                    投诉主题
                </view>
                <view>
                    <u-radio-group v-model="complaintType">
                        <u-radio v-for="(aa, ii) in list" :key="ii" :name="aa.dictCode">
                            {{aa.dictLabel}}
                        </u-radio>
                    </u-radio-group>
                </view>
                <view class="font">
                    投诉
                </view>
                <view class="margin-top">
                    <u-textarea :cursorSpacing="70" v-model="complaintReason" placeholder="请输入..."></u-textarea>
                </view>
            </view>
            <view class="down">
                <view class="enter" @click="entery()">提交</view>
            </view>
        </view>
        <u-picker :show="show" @close="show = false" @confirm="confirm" @cancel="show = false" keyName="deptName" :columns="columns"></u-picker>
        
    </view>
</template>
 
<script>
    import { getDicts } from '@/api/data.js'
    import { deptList, complaintAdd } from '@/api/index'
    import { orderComplaint } from '@/api/qiye.js'
    export default {
        data() {
            return {
                list: [],
                show: false,
                columns: [],
                complaintReason: '',
                complaintType: '',
                executeDeptName: '',
                executeId: ''
            }
        },
        onLoad() {
            getDicts('complaint_type').then(val => {
                this.list = val.data.data
            })
            this.deptList()
        },
        methods: {
            confirm(e) {
                this.executeDeptName = e.value[0].deptName
                this.executeId = e.value[0].deptId
                this.show = false
            },
            deptList() {
                deptList({parentId: 100}).then(val => {
                    // console.log(val)
                    this.columns = [val.data.data]
                })
            },
            entery() {
                if(this.executeDeptName == '') {
                    uni.showToast({
                        title: '请选择投诉对象',
                        icon: 'none'
                    })
                    return
                }
                if(this.complaintType==''){
                    uni.showToast({
                        title: '请选择投诉主题',
                        icon: 'none'
                    })
                    return
                }
                if(this.complaintReason==''){
                    uni.showToast({
                        title: '请输入投诉内容',
                        icon: 'none'
                    })
                    return
                }
                const userInfo = uni.getStorageSync('qiyedata')
                const companyId = uni.getStorageSync('companyId')
                let data = {
                    complaintType:this.complaintType,
                    complaintReason:this.complaintReason,
                    executeDeptName: this.executeDeptName,
                    executeDeptId: this.executeId,
                    companyName: userInfo.companyName,
                    companyPhone: userInfo.companyPhone,
                    companyUser: userInfo.companyUser,
                    companyId: companyId
                }
                complaintAdd(data).then(val => {
                    if(val.data.code === 200) {
                        uni.showToast({
                            title: '提交成功',
                            icon: 'none'
                        })
                        setTimeout(() => {
                            uni.navigateBack()
                        }, 500)
                    }
        
                })
            },
        }
    }
</script>
 
<style lang="scss" scoped>
    ::v-deep .u-radio-group {
        margin-top: 20rpx;
        flex-wrap: wrap;
        .u-radio {
            margin-right: 20rpx;
            margin-bottom: 20rpx;
        }
    }
    
.page-box {
        padding: 24rpx 0;
        .font{
            color: #4a4e60;
            font-size: 32rpx;
            margin-top: 20rpx;
        }
        .title1 {
            font-size: 36rpx;
            font-weight: 700;
            padding: 0 32rpx;
            border-bottom: 2rpx solid #F4F4F4;
            padding-bottom: 24rpx;
        }
 
        .padding {
            padding: 0 24rpx;
        }
 
        .margin-top {
            margin-top: 20rpx;
        }
 
        .down {
            padding: 34rpx 30rpx 30rpx;
            display: flex;
            justify-content: space-between;
 
            >view {
                display: inline-block;
            }
 
            .button {
                padding: 20rpx 40rpx;
                background: #F7F7F7;
                border-radius: 20rpx;
            }
 
            .enter {
                width: 100%;
                background: #1171E0;
                color: white;
                border-radius: 20rpx;
                padding: 20rpx 40rpx;
                text-align: center;
            }
        }
    }
    ::v-deep .u-textarea {
        background-color: #F4F4F4;
    }
</style>