+ @click="!readonly && setAnswer(q, '是')">
是
+ @click="!readonly && setAnswer(q, '否')">
否
@@ -249,11 +249,12 @@ const evaluateForm = ref({
// ========== 问题列表(默认模板)==========
const questionList = ref([
- { text: '是否存在和执法,接受被执法企业的馈赠、报酬、福利等?', answer: '否' },
- { text: '是否存在要求被执法企业提供宴请、娱乐、旅游等活动?', answer: '否' },
- { text: '是否存在干扰企业正常生产经营、刻意要求企业法人到场的行为?', answer: '否' },
- { text: '是否存在任性处罚企业、乱查封、乱扣押、乱冻结、违规责令停产停业的行为?', answer: '否' },
- { text: '是否存在变相执法,以咨询、培训、考核等名义行执法之实?', answer: '否' },
+ { text: '是否存在和执法,接受被执法企业的馈赠、报酬、福利等?', answer: '否', inputText: '', isOther: false },
+ { text: '是否存在要求被执法企业提供宴请、娱乐、旅游等活动?', answer: '否', inputText: '', isOther: false },
+ { text: '是否存在干扰企业正常生产经营、刻意要求企业法人到场的行为?', answer: '否', inputText: '', isOther: false },
+ { text: '是否存在任性处罚企业、乱查封、乱扣押、乱冻结、违规责令停产停业的行为?', answer: '否', inputText: '', isOther: false },
+ { text: '是否存在变相执法,以咨询、培训、考核等名义行执法之实?', answer: '否', inputText: '', isOther: false },
+ { text: '其他', answer: '否', inputText: '', isOther: true },
]);
// ========== 字段映射工具:对后端多种字段名容错 ==========
@@ -313,6 +314,7 @@ const fillEvaluateFormFromInfo = (info) => {
questionList.value = questionList.value.map((q, idx) => ({
...q,
answer: String(info['problem' + (idx + 1)]) === '1' ? '是' : '否',
+ inputText: q.isOther ? (info.otherProblemText || '') : '',
}));
};
@@ -326,6 +328,14 @@ const getRatingText = (score) => {
return map[score] || '';
};
+// ========== 设置问题答案 ==========
+const setAnswer = (q, answer) => {
+ q.answer = answer;
+ if (q.isOther && answer === '否') {
+ q.inputText = '';
+ }
+};
+
// ========== 返回上一页 ==========
const onClickLeft = () => {
router.back();
@@ -339,6 +349,11 @@ const onViewCaseDetail = () => {
// ========== 提交评价 ==========
const onSubmit = () => {
if (readonly.value) return;
+ const otherQuestion = questionList.value.find(q => q.isOther);
+ if (otherQuestion && otherQuestion.answer === '是' && !otherQuestion.inputText.trim()) {
+ showToast('请输入其他问题的具体内容');
+ return;
+ }
showConfirmDialog({
title: '确认提交',
message: '确认提交本次评价吗?提交后将无法修改。',
@@ -356,6 +371,9 @@ const onSubmit = () => {
questionList.value.forEach((q, idx) => {
const val = evaluateForm.value.hasOtherIssues ? (q.answer === '是' ? 1 : 0) : 0;
params['problem' + (idx + 1)] = val;
+ if (q.isOther) {
+ params.otherProblemText = q.inputText;
+ }
});
submitEvaluate(params, () => {
showToast('评价提交成功');
@@ -420,7 +438,7 @@ const onSubmit = () => {
color: #333;
margin-bottom: 0.25rem;
padding-bottom: 0.15rem;
- border-bottom: 1px solid #f0f0f0;
+ // border-bottom: 1px solid #f0f0f0;
display: flex;
align-items: baseline;
.union-tag {
@@ -599,6 +617,7 @@ const onSubmit = () => {
padding: 0.25rem 0;
padding-right: 2.2rem;
border-bottom: 1px solid #f5f5f5;
+ min-height: 0.8rem;
&:last-child {
border-bottom: none;
@@ -615,10 +634,10 @@ const onSubmit = () => {
.question-options {
position: absolute;
right: 0;
- top: 50%;
- transform: translateY(-50%);
+ top: 0.25rem;
display: flex;
gap: 0.2rem;
+ z-index: 10;
}
.option-btn {
@@ -645,6 +664,19 @@ const onSubmit = () => {
}
}
}
+
+ .question-input-wrap {
+ margin-top: 0.15rem;
+ padding-left: 0.6rem;
+
+ :deep(.van-field__control) {
+ font-size: 0.3rem;
+ }
+
+ :deep(.van-field) {
+ margin: 0;
+ }
+ }
}
/* ===== 底部提交栏 ===== */