@@ -118,6 +114,9 @@
import { showToast } from 'vant';
import 'vant/es/toast/style';
import { getComplaintDetail, getComplaintDisposalProgress } from '@/api/enterprise';
+// 引入字典工具
+import { loadDict } from '@/util/dictUtil';
+import { reactive } from 'vue';
const router = useRouter();
const route = useRoute();
@@ -125,6 +124,20 @@ const route = useRoute();
// 当前激活 tab
const activeTab = ref('detail');
+// 投诉类型字典(与新增页面保持一致)
+const complaintTypeDict = reactive({});
+
+// 加载投诉类型字典
+const loadComplaintTypeDict = () => {
+ loadDict('caseType', (columns) => {
+ columns.forEach(item => {
+ complaintTypeDict[item.value] = item.text;
+ });
+ }, () => {
+ // 加载失败不做处理,使用默认值
+ });
+};
+
const detail = ref({
time: '',
bureauDept: '',
@@ -167,7 +180,19 @@ const MOCK_PROGRESS_LIST = [
},
];
+// 根据编码获取投诉类型显示文本
+const getComplaintTypeText = (code) => {
+ console.log('投诉类型字典项111:', code);
+ if (complaintTypeDict[code] !== undefined) {
+ console.log('投诉类型字典项111:', code, complaintTypeDict[code]);
+ return complaintTypeDict[code];
+ }
+ // 默认值(兼容旧数据)
+ return code == 0 ? '默认' : code == 1 ? '联合检查' : (code || '');
+};
+
onMounted(() => {
+
const id = route.query.id;
if (!id) {
showToast('缺少投诉ID');
@@ -175,12 +200,49 @@ onMounted(() => {
}
fetchDetail(id);
fetchDisposalProgress(id);
+ // 加载投诉类型字典
+ loadComplaintTypeDict();
});
+
+
+// 获取环境变量中的文件服务地址
+const VITE_FILE_URL = import.meta.env.VITE_FILE_URL || '';
+
+// 拼接完整的图片URL
+const buildImageUrl = (path) => {
+ if (!path) return '';
+ // 如果已经是完整URL则直接返回
+ if (path.startsWith('http://') || path.startsWith('https://')) {
+ return path;
+ }
+ // 拼接后台地址
+ return VITE_FILE_URL + path;
+};
+
const fetchDetail = (id) => {
getComplaintDetail({ id }, (res) => {
if (res && res.code === 200) {
- detail.value = res.data || {};
+ const data = res.data || {};
+ // 处理附件图片,从fileList中提取uploadPath
+ const images = [];
+ if (data.fileList && Array.isArray(data.fileList)) {
+ data.fileList.forEach(file => {
+ if (file && file.uploadPath) {
+ images.push(buildImageUrl(file.uploadPath));
+ }
+ });
+ }
+ // 兼容旧的images字段
+ if (images.length === 0 && data.images && Array.isArray(data.images)) {
+ data.images.forEach(img => {
+ images.push(buildImageUrl(img));
+ });
+ }
+ detail.value = {
+ ...data,
+ images: images
+ };
}
}, () => { });
};
diff --git a/zdxt-web-client/zdxt-efcode-enterprise-app/src/views/enterprise/my/complaintSuggestion.vue b/zdxt-web-client/zdxt-efcode-enterprise-app/src/views/enterprise/my/complaintSuggestion.vue
index ce2ea3a0..9aca7181 100644
--- a/zdxt-web-client/zdxt-efcode-enterprise-app/src/views/enterprise/my/complaintSuggestion.vue
+++ b/zdxt-web-client/zdxt-efcode-enterprise-app/src/views/enterprise/my/complaintSuggestion.vue
@@ -68,7 +68,7 @@
-
+
同意
@@ -76,7 +76,7 @@
-
+
不同意
@@ -94,7 +94,8 @@
+ :loading="complaintLoading" :finished="complaintFinished"
+ @select="onComplaintItemSelect" @loadMore="loadComplaintItemList" @search="onComplaintItemSearch" />
@@ -113,8 +114,9 @@