parent
efffa22e74
commit
4c919a6451
@ -1,7 +1,62 @@
|
||||
<template>
|
||||
<div>员工反馈</div>
|
||||
<div class="feedback">
|
||||
<el-input
|
||||
v-model="content"
|
||||
style="height: 50%"
|
||||
:rows="2"
|
||||
type="textarea"
|
||||
placeholder="输入反馈信息"
|
||||
/>
|
||||
<div class="bottom">
|
||||
<el-radio-group v-model="employeeName">
|
||||
<el-radio label="保密">保密</el-radio>
|
||||
<el-radio label="不保密">不保密</el-radio> </el-radio-group
|
||||
><el-button type="primary" @click="handelSubmit">提交</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup></script>
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { createFeedback } from '@/api/feedback'
|
||||
import { getEmployee } from '@/api/employee'
|
||||
import { getUserStore } from '@/stores'
|
||||
const userStore = getUserStore()
|
||||
const content = ref('')
|
||||
const employeeName = ref('保密')
|
||||
const handelSubmit = async () => {
|
||||
const params = {
|
||||
content: content.value,
|
||||
employeeName: '保密',
|
||||
status: '待处理'
|
||||
}
|
||||
if (userStore.userType !== 'employee') {
|
||||
await createFeedback(params)
|
||||
} else {
|
||||
if (employeeName.value !== '保密') {
|
||||
const res = await getEmployee(userStore._id)
|
||||
params.employeeName = res.data.employeeName
|
||||
}
|
||||
await createFeedback(params)
|
||||
}
|
||||
ElMessage({
|
||||
message: '反馈成功',
|
||||
type: 'success',
|
||||
plain: true
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
<style lang="scss" scoped>
|
||||
.feedback {
|
||||
height: 100%;
|
||||
.bottom {
|
||||
margin-top: 20px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
:deep(.el-textarea__inner) {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
Binary file not shown.
Loading…
Reference in new issue