<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>
|
/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;
|
}
|
}
|
}
|
/deep/ .u-textarea {
|
background-color: #F4F4F4;
|
}
|
</style>
|