Files
jobslink-user-clent/pageMy/setUserBase/sub/surveyDetail.vue

103 lines
3.2 KiB
Vue
Raw Permalink Normal View History

2024-04-29 11:32:35 +08:00
<template>
<view class="app_cotainer">
<view class="content">
2024-05-07 10:59:06 +08:00
<p>调研题目{{infoMation.surveyTitle}}</p>
<view style="margin-top: 20rpx;">调研内容</view>
<p style="margin-top: 20rpx; font-size: 32rpx;">{{infoMation.surveyContent}}</p>
2024-04-29 11:32:35 +08:00
</view>
<u--form labelPosition="left" :fromData="fromData" :model="fromData" :rules="rules" ref="uForm1">
<u-form-item label="" prop="replyContent" labelWidth="80" borderBottom>
<u--textarea v-model="fromData.replyContent" placeholder="回复内容"></u--textarea>
</u-form-item>
</u--form>
<view class="btn_add">
2024-05-08 20:01:24 +08:00
<u-button type="primary" size="large" text="提交信息" @click="submit"></u-button>
2024-04-29 11:32:35 +08:00
</view>
</view>
</template>
<script>
const rules = {
'replyContent': {
type: 'string',
required: true,
message: '请填写投诉标题',
trigger: ['blur', 'change']
},
}
import {
queryByIdEmploymentSurveyManage,
replyEmploymentSurveyManage
} from '@/api/help.js'
export default {
data() {
return {
infoMation: {},
fromData: {},
rules: Object.assign({}, rules),
isNext: true,
}
},
onLoad({
id
}) {
this.getDetail(id)
},
created() {
},
methods: {
async submit() {
if (this.isNext) {
this.isNext = false
} else {
return
}
if (!this.fromData.replyContent) {
this.isNext = true
return this.$api.mag('请输入回复内容')
}
console.log('submit', this.fromData)
let params = {
surveyId: this.infoMation.id,
...this.fromData,
}
uni.showLoading({
title: '请求中'
})
let resData = await replyEmploymentSurveyManage(params)
uni.hideLoading()
this.isNext = true
if (resData.data?.code === 200) {
uni.$u.toast(resData.data.msg)
this.$api.sleep(1000).then(() => {
uni.navigateBack(1)
})
}
},
getDetail(id) {
return new Promise(async (resolve, reject) => {
let resData = await queryByIdEmploymentSurveyManage({
id
})
if (resData.data.code === 200) {
this.infoMation = resData.data.data
resolve(resData.data.data)
} else {
reject()
}
})
}
}
}
</script>
<style scoped>
.app_cotainer {
padding: 24rpx;
}
.content {
margin-bottom: 100rpx;
}
</style>