Просмотр исходного кода

患者信息表修改认领逻辑

cgp 2 недель назад
Родитель
Сommit
7b112b120d
2 измененных файлов с 224 добавлено и 109 удалено
  1. 9 0
      src/api/qw/companyCustomer.js
  2. 215 109
      src/views/qw/companyCustomer/index.vue

+ 9 - 0
src/api/qw/companyCustomer.js

@@ -35,6 +35,15 @@ export function updateCustomer(data) {
   })
 }
 
+// 认领客户
+export function claimCustomer(data) {
+  return request({
+    url: '/qw/companyCustomer/claimCustomer',
+    method: 'put',
+    data: data
+  })
+}
+
 // 删除客户
 export function delCustomer(ids) {
   return request({

+ 215 - 109
src/views/qw/companyCustomer/index.vue

@@ -24,6 +24,37 @@
           :default-time="['00:00:00', '23:59:59']"
         ></el-date-picker>
       </el-form-item>
+      <!-- 新增:信息表生成时间 -->
+      <el-form-item label="生成时间">
+        <el-date-picker
+          v-model="createTimeRange"
+          size="small"
+          style="width: 240px"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          type="daterange"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          :default-time="['00:00:00', '23:59:59']"
+        ></el-date-picker>
+      </el-form-item>
+      <!-- 完善状态 -->
+      <el-form-item label="完善状态" prop="claimStatus">
+        <el-select v-model="queryParams.claimStatus" placeholder="请选择" clearable size="small" style="width: 120px">
+          <el-option label="未完善" :value="0" />
+          <el-option label="已完善" :value="1" />
+        </el-select>
+      </el-form-item>
+      <!-- 已购 -->
+      <el-form-item label="购买状态" prop="purchased">
+        <el-checkbox v-model="queryParams.purchased">已购</el-checkbox>
+      </el-form-item>
+      <!-- 购买次数范围 -->
+      <el-form-item label="购买次数">
+        <el-input-number v-model="queryParams.minBuyCount" :min="0" size="small" style="width: 100px" controls-position="right" placeholder="最少" />
+        <span style="margin: 0 5px">-</span>
+        <el-input-number v-model="queryParams.maxBuyCount" :min="0" size="small" style="width: 100px" controls-position="right" placeholder="最多" />
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -55,19 +86,32 @@
       <el-table-column label="年龄" align="center" prop="age" />
       <el-table-column label="地址" align="center" prop="address" show-overflow-tooltip />
       <el-table-column label="电话" align="center" prop="phone" />
+      <el-table-column label="生成时间" align="center" prop="createTime" width="180">
+        <template slot-scope="scope">{{ parseTime(scope.row.createTime) }}</template>
+      </el-table-column>
       <el-table-column label="建档时间" align="center" prop="filingTime" width="180">
         <template slot-scope="scope">{{ parseTime(scope.row.filingTime) }}</template>
       </el-table-column>
       <el-table-column label="客服姓名" align="center" prop="companyUserName" />
       <el-table-column label="负责医生" align="center" prop="doctorName" />
+      <el-table-column label="购买次数" align="center" prop="buyCount" />
+      <el-table-column label="完善状态" align="center" prop="claimStatus" :formatter="claimStatusFormat" />
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300">
         <template slot-scope="scope">
           <el-button size="mini" type="text" icon="el-icon-info" @click="handleDetail(scope.row)">详情</el-button>
-          <el-button size="mini" type="text" icon="el-icon-edit" v-if="scope.row.myCustomerFlag" @click="handleUpdate(scope.row)">修改</el-button>
-          <el-button size="mini" type="text" icon="el-icon-delete" v-if="scope.row.myCustomerFlag" @click="handleDelete(scope.row)">删除</el-button>
-          <el-button size="mini" type="text" icon="el-icon-user" v-if="!scope.row.companyUserId" @click="handleClaim(scope.row)">认领客户</el-button>
-          <el-button size="mini" type="text" icon="el-icon-view" @click="handlePrescribe(scope.row)">查看处方</el-button>
-          <el-button size="mini" type="text" icon="el-icon-document" @click="handleCollection(scope.row)">查看信息采集</el-button>
+          <el-button size="mini" type="text" icon="el-icon-edit" v-if="scope.row.myCustomerFlag"
+                     @click="handleUpdate(scope.row)">修改
+          </el-button>
+          <el-button size="mini" type="text" icon="el-icon-delete" v-if="scope.row.myCustomerFlag"
+                     @click="handleDelete(scope.row)">删除
+          </el-button>
+          <el-button size="mini" type="text" icon="el-icon-user" v-if="!scope.row.companyUserId"
+                     @click="handleClaim(scope.row)">认领客户
+          </el-button>
+          <el-button size="mini" type="text" icon="el-icon-view" @click="handlePrescribe(scope.row)">查看处方
+          </el-button>
+          <el-button size="mini" type="text" icon="el-icon-document" @click="handleCollection(scope.row)">查看信息采集
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -80,83 +124,76 @@
       @pagination="getList"
     />
 
-    <!-- 新增/编辑/详情 弹窗 -->
+    <!-- ========== 新增/编辑/详情 弹窗(保持不变,但已移除认领逻辑) ========== -->
     <el-dialog :title="title" :visible.sync="open" width="1100px" append-to-body :close-on-click-modal="false">
       <el-form ref="form" :model="form" :rules="rules" label-width="100px" size="small">
         <!-- 第一行:客户姓名、性别、年龄、电话 -->
         <div style="display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 15px;">
-          <el-form-item label="客户姓名" prop="customerMane" style="flex: 1; min-width: 140px; margin-bottom: 0;">
-            <!-- 2. 绑定 :disabled="isDetail" -->
-            <el-input v-model="form.customerName" placeholder="请输入客户姓名" :disabled="isDetail" />
+          <el-form-item label="客户姓名" prop="customerName" style="flex: 1; min-width: 140px; margin-bottom: 0;">
+            <el-input v-model="form.customerName" placeholder="请输入客户姓名" :disabled="isDetail"/>
           </el-form-item>
           <el-form-item label="性别" prop="sex" style="flex: 0.6; min-width: 100px; margin-bottom: 0;">
-            <!-- 2. 绑定 :disabled="isDetail" -->
             <el-select v-model="form.sex" placeholder="请选择" style="width: 100%" :disabled="isDetail">
-              <el-option v-for="dict in sexOptions" :key="dict.value" :label="dict.label" :value="dict.value" />
+              <el-option v-for="dict in sexOptions" :key="dict.value" :label="dict.label" :value="dict.value"/>
             </el-select>
           </el-form-item>
           <el-form-item label="年龄" prop="age" style="flex: 0.7; min-width: 120px; margin-bottom: 0;">
-            <!-- 2. 绑定 :disabled="isDetail" -->
-            <el-input-number v-model="form.age" :min="18" :max="200" placeholder="年龄" controls-position="right" style="width: 100%" :disabled="isDetail" />
+            <el-input-number v-model="form.age" :min="18" :max="200" placeholder="年龄" controls-position="right"
+                             style="width: 100%" :disabled="isDetail"/>
           </el-form-item>
           <el-form-item label="电话" prop="phone" style="flex: 1.2; min-width: 150px; margin-bottom: 0;">
-            <!-- 2. 绑定 :disabled="isDetail" -->
-            <el-input v-model="form.phone" placeholder="请输入电话" :disabled="isDetail" />
+            <el-input v-model="form.phone" placeholder="请输入电话" :disabled="isDetail"/>
           </el-form-item>
         </div>
 
         <!-- 第二行:地址、建档时间 -->
         <div style="display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 15px;">
           <el-form-item label="地址" prop="address" style="flex: 2; min-width: 200px; margin-bottom: 0;">
-            <!-- 2. 绑定 :disabled="isDetail" -->
-            <el-input v-model="form.address" placeholder="请输入地址" :disabled="isDetail" />
+            <el-input v-model="form.address" placeholder="请输入地址" :disabled="isDetail"/>
           </el-form-item>
           <el-form-item label="建档时间" prop="filingTime" style="flex: 1; min-width: 180px; margin-bottom: 0;">
-            <!-- 2. 绑定 :disabled="isDetail" -->
-            <el-date-picker v-model="form.filingTime" type="datetime" placeholder="选择建档时间" value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%" :disabled="isDetail" />
+            <el-date-picker v-model="form.filingTime" type="datetime" placeholder="选择建档时间"
+                            value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%" :disabled="isDetail"/>
           </el-form-item>
         </div>
 
         <!-- 第三行:客服姓名、约诊时间、负责医生 -->
         <div style="display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 15px;">
           <el-form-item label="客服姓名" prop="companyUserName" style="flex: 1; min-width: 130px; margin-bottom: 0;">
-            <!-- 2. 绑定 :disabled="isDetail" -->
-            <el-input v-model="form.companyUserName" placeholder="客服姓名" :disabled="isDetail" />
-            <input type="hidden" v-model="form.companyUserId" />
+            <el-input v-model="form.companyUserName" placeholder="客服姓名" :disabled="isDetail"/>
+            <input type="hidden" v-model="form.companyUserId"/>
           </el-form-item>
           <el-form-item label="约诊时间" prop="appointmentTime" style="flex: 1.2; min-width: 180px; margin-bottom: 0;">
-            <!-- 2. 绑定 :disabled="isDetail" -->
-            <el-date-picker v-model="form.appointmentTime" type="datetime" placeholder="选择约诊时间" value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%" :disabled="isDetail" />
+            <el-date-picker v-model="form.appointmentTime" type="datetime" placeholder="选择约诊时间"
+                            value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%" :disabled="isDetail"/>
           </el-form-item>
           <el-form-item label="负责医生" prop="doctorName" style="flex: 1; min-width: 130px; margin-bottom: 0;">
-            <!-- 2. 绑定 :disabled="isDetail" -->
-            <el-input v-model="form.doctorName" placeholder="负责医生" :disabled="isDetail" />
-            <input type="hidden" v-model="form.doctorId" />
+            <el-input v-model="form.doctorName" placeholder="负责医生" :disabled="isDetail"/>
+            <input type="hidden" v-model="form.doctorId"/>
           </el-form-item>
         </div>
 
         <!-- 独占行文本域 -->
         <div style="margin-bottom: 15px;">
           <el-form-item label="现病史" prop="presentIllness" style="margin-bottom: 0;">
-            <!-- 2. 绑定 :disabled="isDetail" -->
-            <el-input type="textarea" v-model="form.presentIllness" placeholder="请输入现病史" :rows="3" :disabled="isDetail" />
+            <el-input type="textarea" v-model="form.presentIllness" placeholder="请输入现病史" :rows="3"
+                      :disabled="isDetail"/>
           </el-form-item>
         </div>
         <div style="margin-bottom: 15px;">
           <el-form-item label="现用药情况" prop="currentMedication" style="margin-bottom: 0;">
-            <!-- 2. 绑定 :disabled="isDetail" -->
-            <el-input type="textarea" v-model="form.currentMedication" placeholder="请输入现用药情况" :rows="3" :disabled="isDetail" />
+            <el-input type="textarea" v-model="form.currentMedication" placeholder="请输入现用药情况" :rows="3"
+                      :disabled="isDetail"/>
           </el-form-item>
         </div>
         <div style="margin-bottom: 0;">
           <el-form-item label="过敏史" prop="allergyHistory" style="margin-bottom: 0;">
-            <!-- 2. 绑定 :disabled="isDetail" -->
-            <el-input type="textarea" v-model="form.allergyHistory" placeholder="请输入过敏史" :rows="3" :disabled="isDetail" />
+            <el-input type="textarea" v-model="form.allergyHistory" placeholder="请输入过敏史" :rows="3"
+                      :disabled="isDetail"/>
           </el-form-item>
         </div>
       </el-form>
 
-      <!-- 3. 在底部只显示“关闭”按钮,不显示“确定”和“取消” -->
       <div slot="footer" class="dialog-footer" v-if="!isDetail">
         <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
@@ -167,20 +204,21 @@
     </el-dialog>
 
     <!-- 处方列表弹窗 -->
-    <el-dialog title="处方信息" :visible.sync="prescribeOpen" width="1100px" append-to-body :close-on-click-modal="false">
+    <el-dialog title="处方信息" :visible.sync="prescribeOpen" width="1100px" append-to-body
+               :close-on-click-modal="false">
       <el-table v-loading="prescribeLoading" :data="prescribeList">
-        <el-table-column label="处方ID" align="center" prop="prescribeId" />
-        <el-table-column label="处方单号" align="center" prop="prescribeCode" />
+        <el-table-column label="处方ID" align="center" prop="prescribeId"/>
+        <el-table-column label="处方单号" align="center" prop="prescribeCode"/>
         <el-table-column label="处方类型" align="center" prop="prescribeType">
           <template slot-scope="scope">
-            <dict-tag :options="prescribeTypeOptions" :value="scope.row.prescribeType" />
+            <dict-tag :options="prescribeTypeOptions" :value="scope.row.prescribeType"/>
           </template>
         </el-table-column>
-        <el-table-column label="患者姓名" align="center" prop="patientName" />
-        <el-table-column label="医生姓名" align="center" prop="doctorName" />
+        <el-table-column label="患者姓名" align="center" prop="patientName"/>
+        <el-table-column label="医生姓名" align="center" prop="doctorName"/>
         <el-table-column label="是否确认" align="center" prop="doctorConfirm">
           <template slot-scope="scope">
-            <dict-tag :options="doctorConfirmOptions" :value="scope.row.doctorConfirm" />
+            <dict-tag :options="doctorConfirmOptions" :value="scope.row.doctorConfirm"/>
           </template>
         </el-table-column>
         <el-table-column label="审核时间" align="center" prop="auditTime" width="180">
@@ -210,22 +248,35 @@
     </el-dialog>
 
     <!-- 信息采集弹窗 -->
-    <collection-info-dialog :visible.sync="collectionVisible" :id="currentId" />
+    <collection-info-dialog :visible.sync="collectionVisible" :id="currentId"/>
+
+    <!-- ========== 新增:独立的认领确认弹窗 ========== -->
+    <el-dialog title="认领客户" :visible.sync="claimDialogVisible" width="400px" append-to-body
+               :close-on-click-modal="false">
+      <div>
+        <p>确认认领客户【{{ currentClaimRow && currentClaimRow.customerName }}】吗?</p>
+        <p>认领后,该客户将归属到您的客服账号和负责医生名下。</p>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="claimDialogVisible = false">取 消</el-button>
+        <el-button type="primary" :loading="claimSubmitLoading" @click="submitClaim">确 认</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import {
   listCustomer, getCustomer, addCustomer, updateCustomer, delCustomer, exportCustomer,
-  getCompanyUserAndDoctor, getPrescribeListByIdAndPhone
+  getCompanyUserAndDoctor, getPrescribeListByIdAndPhone, claimCustomer
 } from '@/api/qw/companyCustomer'
-import { parseTime } from '@/utils/common'
+import {parseTime} from '@/utils/common'
 
 import CollectionInfoDialog from './CollectionInfoDialog.vue'
 
 export default {
   name: "Customer",
-  components: { CollectionInfoDialog },   // 注册信息采集表组件
+  components: {CollectionInfoDialog},
   data() {
     const validatePhone = (rule, value, callback) => {
       if (!value) {
@@ -259,37 +310,42 @@ export default {
       title: "",
       open: false,
       dateRange: [],
+      createTimeRange: [],
       queryParams: {
         pageNum: 1,
         pageSize: 10,
         customerName: null,
         phone: null,
-        companyUserName: null
+        companyUserName: null,
+        claimStatus: 0,
+        purchased: false,
+        minBuyCount: null,
+        maxBuyCount: null
       },
       form: {},
       rules: {
-        customerName: [{ required: true, message: "客户姓名不能为空", trigger: "blur" }],
-        sex: [{ required: true, message: "请选择性别", trigger: "change" }],
+        customerName: [{required: true, message: "客户姓名不能为空", trigger: "blur"}],
+        sex: [{required: true, message: "请选择性别", trigger: "change"}],
         age: [
-          { required: true, message: "年龄不能为空", trigger: "blur" },
-          { validator: validateAge, trigger: "blur" }
+          {required: true, message: "年龄不能为空", trigger: "blur"},
+          {validator: validateAge, trigger: "blur"}
         ],
         phone: [
-          { required: true, message: "电话不能为空", trigger: "blur" },
-          { validator: validatePhone, trigger: "blur" }
+          {required: true, message: "电话不能为空", trigger: "blur"},
+          {validator: validatePhone, trigger: "blur"}
         ],
-        address: [{ required: true, message: "地址不能为空", trigger: "blur" }],
+        address: [{required: true, message: "地址不能为空", trigger: "blur"}],
         // filingTime: [{ required: true, message: "建档时间不能为空", trigger: "blur" }],
-        companyUserName: [{ required: true, message: "客服姓名不能为空", trigger: "blur" }],
-        doctorName: [{ required: true, message: "负责医生不能为空", trigger: "blur" }],
+        companyUserName: [{required: true, message: "客服姓名不能为空", trigger: "blur"}],
+        doctorName: [{required: true, message: "负责医生不能为空", trigger: "blur"}],
         // presentIllness: [{ required: true, message: "现病史不能为空", trigger: "blur" }],
         // currentMedication: [{ required: true, message: "现用药情况不能为空", trigger: "blur" }],
         // allergyHistory: [{ required: true, message: "过敏史不能为空", trigger: "blur" }]
       },
       sexOptions: [
-        { label: '女', value: '0' },
-        { label: '男', value: '1' },
-        { label: '未知', value: '2' }
+        {label: '女', value: '0'},
+        {label: '男', value: '1'},
+        {label: '未知', value: '2'}
       ],
       // 处方相关
       prescribeOpen: false,
@@ -303,24 +359,31 @@ export default {
         pageSize: 10
       },
       doctorConfirmOptions: [
-        { dictValue: '0', dictLabel: "未确认" },
-        { dictValue: '1', dictLabel: "已确认" }
+        {dictValue: '0', dictLabel: "未确认"},
+        {dictValue: '1', dictLabel: "已确认"}
       ],
       prescribeTypeOptions: [
-        { dictValue: '1', dictLabel: "西药" },
-        { dictValue: '2', dictLabel: "中药" },
-        { dictValue: '3', dictLabel: "OTC" }
+        {dictValue: '1', dictLabel: "西药"},
+        {dictValue: '2', dictLabel: "中药"},
+        {dictValue: '3', dictLabel: "OTC"}
       ],
-      //控制信息采集弹窗的变量
+      // 控制信息采集弹窗的变量
       collectionVisible: false,
-      //详情弹窗
+      // 详情弹窗只读模式
       isDetail: false,
+      // 新增:独立认领弹窗相关
+      claimDialogVisible: false,
+      claimSubmitLoading: false,
+      currentClaimRow: null,
     }
   },
   created() {
     this.getList()
   },
   methods: {
+    claimStatusFormat(row) {
+      return row.claimStatus === 1 ? '已完善' : '未完善';
+    },
     parseTime,
     getCurrentDateTime() {
       const now = new Date();
@@ -334,53 +397,100 @@ export default {
     },
     getList() {
       this.loading = true;
-      listCustomer(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
-        const data = response;
-        this.customerList = data.rows;
-        this.total = data.total;
+      const params = this.addDateRange(this.queryParams, this.dateRange);
+      if (this.createTimeRange && this.createTimeRange.length === 2) {
+        params.beginCreateTime = this.createTimeRange[0];
+        params.endCreateTime = this.createTimeRange[1];
+      }
+      if (!params.purchased) {
+        delete params.purchased;
+      }
+      listCustomer(params).then(response => {
+        this.customerList = response.rows;
+        this.total = response.total;
         this.loading = false;
       }).catch(() => {
         this.loading = false;
       });
     },
-    /** 认领客户(打开编辑弹窗并预填当前客服&医生信息) */
+    resetQuery() {
+      this.dateRange = [];
+      this.createTimeRange = [];
+      this.resetForm("queryForm");
+      this.queryParams.claimStatus = 0;
+      this.queryParams.purchased = false;
+      this.queryParams.minBuyCount = null;
+      this.queryParams.maxBuyCount = null;
+      this.handleQuery();
+    },
+    /**
+     * 修改后的认领客户逻辑:打开独立的确认弹窗(不打开编辑弹窗)
+     * 先校验客户是否已被认领,再校验当前用户是否有绑定的医生信息
+     */
     handleClaim(row) {
-      this.reset(); // 重置表单、关闭只读模式
-      const id = row.id;
-      // 先调用详情接口获取最新客户信息
-      getCustomer(id).then(customerRes => {
-        const customerData = customerRes.data;
-        // 检查是否已被认领
-        if (customerData.companyUserId && customerData.companyUserId !== '') {
-          this.$message.warning('该客户已被认领,无法重复认领');
+      // 二次确认(虽然按钮已控制显示,但防止脚本调用)
+      if (row.companyUserId) {
+        this.$message.warning('该客户已被认领,无法重复认领');
+        return;
+      }
+      // 预检:当前用户是否绑定了医生(避免点击确认后才发现无法认领)
+      getCompanyUserAndDoctor().then(res => {
+        const userData = res.data;
+        if (!userData || !userData.doctorId) {
+          this.$modal.msgError("未找到绑定医生!请先绑定医生后再操作!");
           return;
         }
-        // 未被认领,继续获取当前客服信息
-        getCompanyUserAndDoctor().then(userRes => {
-          const userData = userRes.data;
-          if (!userData || !userData.doctorId) {
-            this.$modal.msgError("未找到绑定医生!请绑定医生后再操作!");
-            return;
-          }
-          // 合并数据:保留原客户信息,覆盖客服和医生字段
-          customerData.companyUserId = userData.companyUserId;
-          customerData.companyUserName = userData.companyUserName;
-          customerData.doctorId = userData.doctorId;
-          customerData.doctorName = userData.doctorName;
-          // 性别转换
-          if (customerData.sex !== undefined && customerData.sex !== null) {
-            customerData.sex = String(customerData.sex);
-          }
-          this.form = customerData;
-          this.open = true;
-          this.title = "认领客户";
+        // 通过预检,打开独立弹窗
+        this.currentClaimRow = row;
+        this.claimDialogVisible = true;
+      }).catch(err => {
+        console.error("获取客服/医生信息失败", err);
+        this.$message.error("获取用户信息失败,无法认领");
+      });
+    },
+    /** 执行认领提交(独立弹窗的确认按钮) */
+    submitClaim() {
+      if (!this.currentClaimRow || !this.currentClaimRow.id) {
+        this.$message.error("客户信息异常,请刷新后重试");
+        this.claimDialogVisible = false;
+        return;
+      }
+      // 避免重复提交
+      this.claimSubmitLoading = true;
+      // 重新获取最新的客服和医生信息(确保认领时数据准确)
+      getCompanyUserAndDoctor().then(res => {
+        const userData = res.data;
+        if (!userData || !userData.doctorId) {
+          this.$message.error("未找到绑定医生,无法认领");
+          this.claimSubmitLoading = false;
+          this.claimDialogVisible = false;
+          return;
+        }
+        // 构造认领参数:只需要客户ID、客服ID/姓名、医生ID/姓名
+        const claimParams = {
+          id: this.currentClaimRow.id,
+          companyUserId: userData.companyUserId,
+          companyUserName: userData.companyUserName,
+          doctorId: userData.doctorId,
+          doctorName: userData.doctorName
+        };
+        claimCustomer(claimParams).then(() => {
+          this.$message.success("认领成功");
+          this.claimDialogVisible = false;
+          // 刷新表格,显示最新认领状态
+          this.getList();
         }).catch(error => {
-          console.error("获取客服医生信息失败", error);
-          this.$message.error("获取信息失败,无法认领");
+          console.error("认领失败", error);
+          const msg = error?.message || error?.msg || "认领失败,请重试";
+          this.$message.error(msg);
+        }).finally(() => {
+          this.claimSubmitLoading = false;
         });
-      }).catch(error => {
-        console.error("获取客户详情失败", error);
-        this.$message.error("获取客户信息失败,请重试");
+      }).catch(err => {
+        console.error("获取客服/医生信息失败", err);
+        this.$message.error("获取用户信息失败,无法认领");
+        this.claimSubmitLoading = false;
+        this.claimDialogVisible = false;
       });
     },
     sexFormat(row) {
@@ -429,18 +539,13 @@ export default {
         allergyHistory: null
       };
       this.resetForm("form");
-      // 重置详情模式
+      // 重置详情模式(注意:不再包含 isClaim)
       this.isDetail = false;
     },
     handleQuery() {
       this.queryParams.pageNum = 1;
       this.getList();
     },
-    resetQuery() {
-      this.dateRange = [];
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id);
       this.single = selection.length !== 1;
@@ -482,6 +587,8 @@ export default {
       try {
         const valid = await this.$refs["form"].validate();
         if (!valid) return;
+
+        // 普通新增或修改(不再包含认领分支)
         if (this.form.id != null) {
           await updateCustomer(this.form);
           this.$message.success("修改成功");
@@ -555,7 +662,6 @@ export default {
         pageSize: this.prescribeQueryParams.pageSize
       };
       getPrescribeListByIdAndPhone(params).then(response => {
-        // 后端返回 TableDataInfo,直接取 rows 和 total
         this.prescribeList = response.rows || [];
         this.prescribeTotal = response.total || 0;
         this.prescribeLoading = false;