Pārlūkot izejas kodu

feat: 调整问题上报查询参数并补全详情展示字段

去除 pageQuestionReportData 的 status 参数并新增 token 入参,同时在问题详情页补齐状态、当事人、联系人和联系电话等字段展示,兼容已上报状态。

Made-with: Cursor
haifeng.zhang 6 dienas atpakaļ
vecāks
revīzija
230309367d

+ 75 - 17
src/api/questionReqort/types.ts

@@ -51,6 +51,10 @@ export interface AddQuestionReportDataReq {
 /** 上报问题列表req */
 export interface PageQuestionReportDataReq extends PageReq {
   /**
+   * 登录 token
+   */
+  token: string
+  /**
    * 问题标题
    */
   questionTitle?: string
@@ -59,10 +63,6 @@ export interface PageQuestionReportDataReq extends PageReq {
    */
   questionType?: string
   /**
-   * 发布状态(0待解答;1已解答)
-   */
-  status?: number
-  /**
    * 发布时间
    */
   createTime?: number
@@ -91,33 +91,91 @@ export interface QuestionListRes {
 /** 问题详情res */
 export interface QuestionDetailRes {
   /**
+   * 主键id
+   */
+  uuid: string
+  /**
+   * 问题类型
+   */
+  questionType: string
+  /**
+   * 问题标题
+   */
+  questionTitle: string
+  /**
+   * 问题内容
+   */
+  questionContent: string
+  /**
+   * 街道code
+   */
+  streetCode?: string
+  /**
+   * 街道名称
+   */
+  streetName?: string
+  /**
+   * 网格编号
+   */
+  grid?: string
+  /**
+   * 网格名称
+   */
+  gridName?: string
+  /**
    * 地址名称
    */
   addrName: string
   /**
-   * 时间
+   * 解答状态(0待解答;1已解答;2已上报)
    */
+  status: 0 | 1 | 2
+  expandStr?: string
+  createUser?: string
   createTime: number
+  updateUser?: string
+  updateTime?: number
+  isDelete?: number
   /**
-   * 问题内容
+   * 问题解答
    */
-  questionContent: string
+  questionAnswer?: string
   /**
-   * 问题标题
+   * 社区编码
    */
-  questionTitle: string
+  communityCode?: string
   /**
-   * 问题类型
+   * 社区名称
    */
-  questionType: string
+  communityName?: string
   /**
-   * 主键id
+   * 当事人列表
    */
-  uuid: string
-  /** 发布状态(0待解答;1已解答) */
-  status: 0 | 1
-  /** 问题解答 */
-  questionAnswer:string
+  personList?: string
+  /**
+   * 负责人名称
+   */
+  chargerName?: string
+  /**
+   * 联系人
+   */
+  contactPerson?: string
+  /**
+   * 联系电话
+   */
+  contactPhone?: string
+  /**
+   * 负责人code
+   */
+  chargerCode?: string
+  /**
+   * 详细地址值
+   */
+  addrDetailName?: string
+  /**
+   * 群主手机号
+   */
+  ownerPhone?: string
 }
 
 /** 类型查询列表res */

+ 37 - 1
src/subPages/pages/reportProblems/detail.vue

@@ -10,10 +10,26 @@
 import { getQuestionReportDetail } from '@/api/questionReqort';
 import { QuestionDetailRes } from '@/api/questionReqort/types';
 import { onLoad } from '@dcloudio/uni-app';
-import { ref } from 'vue';
+import { computed, ref } from 'vue';
 
 
 const questDetail = ref<QuestionDetailRes>()
+
+const statusText = computed(() => {
+  const status = questDetail.value?.status
+  if (status === 1) return '已解答'
+  if (status === 2) return '已上报'
+  return '待解答'
+})
+
+const personListText = computed(() => {
+  const personList = questDetail.value?.personList || ''
+  return personList
+    .split(/[,,、]+/)
+    .map(item => item.trim())
+    .filter(Boolean)
+    .join('、')
+})
 onLoad(async (option) => {
   if (option && option.id) {
     const { id } = option;
@@ -31,6 +47,7 @@ onLoad(async (option) => {
         <view class="value">{{ questDetail?.questionType }}</view>
         <van-tag v-if="questDetail?.status === 0" color="red">待解答</van-tag>
         <van-tag v-if="questDetail?.status === 1" color="green">已解答</van-tag>
+        <van-tag v-if="questDetail?.status === 2" color="#1989fa">已上报</van-tag>
       </view>
     </view>
     <!-- 问题标题 -->
@@ -48,6 +65,25 @@ onLoad(async (option) => {
       <view class="label">所在地:</view>
       <view class="value">{{ questDetail?.addrName }}</view>
     </view>
+    <view class="form-item">
+      <view class="label">状态:</view>
+      <view class="value">{{ statusText }}</view>
+    </view>
+    <view class="form-item">
+      <view class="label">当事人:</view>
+      <view class="value" v-if="personListText">{{ personListText }}</view>
+      <view class="value text-[#e3e3e3]" v-else>暂无</view>
+    </view>
+    <view class="form-item">
+      <view class="label">联系人:</view>
+      <view class="value" v-if="questDetail?.contactPerson">{{ questDetail?.contactPerson }}</view>
+      <view class="value text-[#e3e3e3]" v-else>暂无</view>
+    </view>
+    <view class="form-item">
+      <view class="label">联系电话:</view>
+      <view class="value" v-if="questDetail?.contactPhone">{{ questDetail?.contactPhone }}</view>
+      <view class="value text-[#e3e3e3]" v-else>暂无</view>
+    </view>
     <van-divider></van-divider>
     <!-- 问题解答 -->
     <view class="form-item">

+ 4 - 2
src/subPages/pages/reportProblems/index.vue

@@ -7,8 +7,10 @@ import GridAddress from '@/components/address/gridAddress/index.vue'
 import { showNotify } from 'vant'
 import dayjs from 'dayjs';
 import { onLoad } from '@dcloudio/uni-app'
+import useUserState from '@/store/userState'
 
 const active = ref(0)
+const userState = useUserState()
 
 interface ReportFormData extends AddQuestionReportDataReq {
   location?: string
@@ -218,7 +220,7 @@ const questList = async () => {
   const { data } = await pageQuestionReportData({
     pageNumber: pageInfo.value.pageNumber,
     pageSize: pageInfo.value.pageSize,
-    status: 1
+    token: userState.getUserTokenInfo || '',
   })
   list.value = list.value.concat(data.records)
   pageInfo.value.pageNumber++
@@ -330,7 +332,7 @@ onMounted(async () => {
         <van-button class="w-full mb-3" type="primary" @click="submit">提交</van-button>
       </view>
     </van-tab>
-    <van-tab title="问题答复(已回复)">
+    <van-tab title="问题答复">
       <view class="tab-container">
         <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="questList">
           <view v-for="item in list" :key="item.uuid" class="list-item-style">