张田田 2 miesięcy temu
rodzic
commit
03a34c12bb

+ 15 - 14
src/components/ChatHistory.vue

@@ -1,4 +1,5 @@
 <script setup lang="ts">
+import { ref } from 'vue';
 import { onMounted, onUnmounted, nextTick } from 'vue';
 import { Image, Input, Button } from 'ant-design-vue';
 import { UserOutlined, RobotOutlined, SearchOutlined, CustomerServiceOutlined } from '@ant-design/icons-vue';
@@ -82,10 +83,10 @@ onUnmounted(() => {
 // 获取搜索聊天记录列表
 async function getSearchChatRecordList(keyword: string) {
   if (loading.value) return;
-  
+
   loading.value = true;
   isSearchMode.value = true;
-  
+
   try {
     const patientId = (props.data as any)?.patientId || (props.data as any)?.id?.toString();
     if (!patientId) {
@@ -94,19 +95,19 @@ async function getSearchChatRecordList(keyword: string) {
       loading.value = false;
       return;
     }
-    
+
     // 重置分页
     currentPage.value = 1;
-    
+
     const res = await getConsultChatListMethod(currentPage.value, pageSize, patientId, {
       keyWord: keyword,
     });
-    
+
     if (res && res.data && res.data.length > 0) {
       totalRecords.value = res?.total || 0;
       // 搜索模式下,直接用搜索结果替换所有记录
       searchMessages.value = res.data;
-      
+
       // 检查是否还有更多数据
       if (searchMessages.value.length >= totalRecords.value || res.data.length < pageSize) {
         hasMore.value = false;
@@ -164,7 +165,7 @@ async function loadMoreMessages() {
   if (loading.value || !hasMore.value) return;
 
   currentPage.value++;
-  
+
   // 如果是搜索模式,加载更多搜索结果
   if (isSearchMode.value && searchKeyword.value) {
     await loadMoreSearchMessages();
@@ -176,9 +177,9 @@ async function loadMoreMessages() {
 // 加载更多搜索结果
 async function loadMoreSearchMessages() {
   if (loading.value) return;
-  
+
   loading.value = true;
-  
+
   try {
     const patientId = (props.data as any)?.patientId || (props.data as any)?.id?.toString();
     if (!patientId) {
@@ -187,15 +188,15 @@ async function loadMoreSearchMessages() {
       loading.value = false;
       return;
     }
-    
+
     const res = await getConsultChatListMethod(currentPage.value, pageSize, patientId, {
       keyWord: searchKeyword.value,
     });
-    
+
     if (res && res.data && res.data.length > 0) {
       // 追加到搜索结果
       searchMessages.value = [...searchMessages.value, ...res.data];
-      
+
       // 检查是否还有更多数据
       if (searchMessages.value.length >= totalRecords.value || res.data.length < pageSize) {
         hasMore.value = false;
@@ -301,7 +302,7 @@ watchDebounced(
       console.error('缺少患者ID');
       return;
     }
-    
+
     if (newVal && newVal.trim()) {
       // 有搜索关键词,执行搜索
       await getSearchChatRecordList(newVal.trim());
@@ -579,7 +580,7 @@ function handleClose() {
     overflow-wrap: break-word;
     width: 100%;
     line-height: 1.5;
-    
+
     // Markdown 渲染样式
     :deep(strong) {
       font-weight: bold;

+ 3 - 2
src/components/EditConfigured.vue

@@ -1,4 +1,5 @@
 <script setup lang="ts">
+import { ref } from 'vue';
 import { useRequest } from 'alova/client';
 import { getDeviceManageDetailMethod, updateDeviceManageMethod } from '@/request/api/device.api';
 import { branchMethod } from '@/request/api/system.api';
@@ -121,10 +122,10 @@ const reset = () => {
   flex: 1;
   display: flex;
   flex-direction: column;
-  min-height: 0; 
+  min-height: 0;
   > div:not(.title) {
     flex: auto;
-    overflow: auto; 
+    overflow: auto;
   }
   > .title {
     flex: none;

+ 2 - 4
src/components/EditOrganization.vue

@@ -1,11 +1,12 @@
 <script setup lang="ts">
+import { watchEffect, ref, computed } from 'vue';
 import { VxeUI, type VxeFormProps, type VxeFormListeners } from 'vxe-pc-ui';
 import { useRequest } from 'alova/client';
 import { branchMethod } from '@/request/api/system.api';
 import { notification } from 'ant-design-vue';
 import type { EquirementModel } from '@/model/device.model';
 type FollowModel = Partial<EquirementModel>;
-  (notification.config as any)({
+(notification.config as any)({
   zIndex: 10000, // 直接设置层级
 });
 const defaultModel = {};
@@ -138,13 +139,10 @@ const formEmits: VxeFormListeners = {
       notification.error({ message: '请选择需要修改的机构' });
       return;
     }
-    // const selectedOrg = branch.value.find((item) => item.value === model.value.orgId);
-
     emits('submit', {
       orgId: data?.orgId,
       institutionId: data?.institutionId,
     } as any);
-    // 或者先调接口再 emit
   },
 };
 

+ 12 - 11
src/order/Negotiations.vue

@@ -19,19 +19,12 @@ interface NegotiationItem {
   images?: string[];
 }
 
-const progressMap: Record<string, string> = {
-  '0': '发起了售后申请',
-  '1': '撤销售后申请',
-  '2': '审核拒绝了申请',
-  '3': '审核通过了申请',
-  '4': '退款完成',
-};
 
 // aftersaleContent 字段中文映射
 const fieldLabelMap: Record<string, string> = {
   applyAmount: '退款金额',
   reason: '退款原因',
-  receiptStatus: '商品状态',
+  receiptStatus: '收货状态',
   remark: '退款说明',
   type: '退款类型',
   finishRatio: '完成比例',
@@ -47,7 +40,7 @@ const hiddenFields = new Set([
 
 // 特殊值的中文映射
 const valueMap: Record<string, Record<string, string>> = {
-  receiptStatus: { '1': '已收到货', '2': '未收到货' },
+  receiptStatus: { '0': '待发货', '1': '已发货', '2': '已收货' },
   type: { '0': '退款', '1': '退货退款' },
 };
 
@@ -75,7 +68,7 @@ function transformData() {
     const result: NegotiationItem = {
       name: item.createBy || '',
       time: item.createTime || '',
-      action: progressMap[item.progress] || item.title || '',
+      action: item.title || '',
       title: item.title || undefined,
       content: item.content || undefined,
     };
@@ -109,7 +102,15 @@ function transformData() {
           fields.push({ label, value: displayVal });
         }
       });
-      if (fields.length) result.fields = fields;
+      if (fields.length) {
+        // 确保收货状态显示在退款金额上方
+        const receiptIdx = fields.findIndex(f => f.label === '收货状态');
+        const amountIdx = fields.findIndex(f => f.label === '退款金额');
+        if (receiptIdx > -1 && amountIdx > -1 && receiptIdx > amountIdx) {
+          [fields[receiptIdx], fields[amountIdx]] = [fields[amountIdx], fields[receiptIdx]];
+        }
+        result.fields = fields;
+      }
       if (images.length) result.images = images;
     }
     return result;

+ 12 - 2
src/pages/index/care/configured.vue

@@ -1,4 +1,5 @@
 <script setup lang="ts">
+import { ref, reactive, computed, shallowRef, onMounted, toRaw } from 'vue';
 import { type VxeFormListeners, type VxeFormProps, type VxeGridInstance, type VxeGridListeners, type VxeGridProps, VxeUI } from 'vxe-pc-ui';
 import { usePagination, useRequest } from 'alova/client';
 import { getDictionaryMethod } from '@/request/api/dictionary.api';
@@ -207,7 +208,17 @@ const gridOptions = reactive<VxeGridProps<ConditioningSchemeModel>>({
 const gridEvents: VxeGridListeners = {};
 
 // 获取设备分页列表
-const { loading, page, pageSize, total, onSuccess, replace, refresh, remove, send: sendRefresh } = usePagination((page, size) => getConditioningSchemeMethod(page, size, model.value), {
+const {
+  loading,
+  page,
+  pageSize,
+  total,
+  onSuccess,
+  replace,
+  refresh,
+  remove,
+  send: sendRefresh,
+} = usePagination((page, size) => getConditioningSchemeMethod(page, size, model.value), {
   initialData: { data: [], total: 0 },
   initialPage: 1,
   initialPageSize: 100,
@@ -261,7 +272,6 @@ function editConfigured(model?: ConditioningSchemeModel, index?: number) {
         return h(EditConfigured, <any>{
           data: model,
           onSubmit(success: boolean, data?: ConditioningSchemeModel) {
-            console.log(success, 'success');
             // 只有成功时才刷新列表
             if (success) {
               // 使用 sendRefresh 强制刷新,避免页面闪烁