WXL
4 天以前 c4599aa279fd2f90b741608392e056fbae2282d5
src/views/business/course/components/OrganAllocationStage.vue
@@ -6,44 +6,11 @@
        <span class="detail-title">器官分配基本信息</span>
      </div>
      <el-form :model="form" ref="form" :rules="rules" label-width="120px">
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="分配状态" prop="allocationStatus">
              <el-select
                v-model="form.allocationStatus"
                placeholder="请选择分配状态"
              >
                <el-option
                  v-for="dict in dict.type.organ_allocation_status || []"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="分配时间" prop="allocationTime">
              <el-date-picker
                v-model="form.allocationTime"
                type="datetime"
                value-format="yyyy-MM-dd HH:mm:ss"
                style="width: 100%"
                :disabled="form.allocationStatus == '1'"
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="负责人" prop="registrationName">
              <el-input v-model="form.registrationName" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <el-descriptions title="基本信息" :column="descriptionColumn" border size="small">
        <el-descriptions-item label="分配状态">{{ selectDictLabel(dict.type.organ_allocation_status, form.allocationStatus) }}</el-descriptions-item>
        <el-descriptions-item label="分配时间">{{ form.allocationTime || '-' }}</el-descriptions-item>
        <el-descriptions-item label="负责人">{{ form.registrationName || '-' }}</el-descriptions-item>
      </el-descriptions>
    </el-card>
    <!-- 器官分配记录部分 -->
@@ -58,49 +25,24 @@
        </div>
      </div>
      <el-form
        ref="allocationForm"
        :rules="allocationRules"
        :model="allocationData"
        label-position="right"
      >
        <el-row>
          <el-col>
            <el-form-item label-width="100px" label="分配器官">
              <el-checkbox-group
                v-model="selectedOrgans"
                @change="handleOrganSelectionChange"
              >
                <el-checkbox
                  v-for="dict in dict.type.sys_Organ || []"
                  :key="dict.value"
                  :label="dict.value"
                  :disabled="form.allocationStatus == '1'"
                >
                  {{ dict.label }}
                </el-checkbox>
              </el-checkbox-group>
              <el-input
                v-if="showOtherInput"
                v-model="otherOrganInput"
                placeholder="请输入其他器官名称"
                style="margin-top: 10px; width: 300px;"
                :disabled="form.allocationStatus == '1'"
              />
            </el-form-item>
          </el-col>
        </el-row>
      <el-descriptions title="分配器官" :column="1" border size="small" style="margin-bottom: 16px;">
        <el-descriptions-item label="分配器官">
          <template v-if="selectedOrgans && selectedOrgans.length">
            <span v-for="(v, i) in selectedOrgans" :key="v">
              {{ v === 'C01' && otherOrganInput ? '其他(' + otherOrganInput + ')' : getOrganLabel(v) }}<span v-if="i < selectedOrgans.length - 1">、</span>
            </span>
          </template>
          <template v-else>-</template>
        </el-descriptions-item>
      </el-descriptions>
        <el-row>
          <el-col>
            <el-form-item>
              <el-table
                :data="displayOrgans"
                v-loading="loading"
                border
                style="width: 100%"
                :row-class-name="getOrganRowClassName"
              >
      <el-table
        :data="displayOrgans"
        v-loading="loading"
        border
        style="width: 100%"
        :row-class-name="getOrganRowClassName"
      >
                <el-table-column
                  label="序号"
                  type="index"
@@ -133,127 +75,36 @@
                  align="center"
                  width="120"
                  prop="organname"
                >
                  <template slot-scope="scope">
                    <el-input
                      v-model="scope.row.organname"
                      placeholder="器官名称"
                      :disabled="true"
                    />
                  </template>
                </el-table-column>
                <!-- <el-table-column
                  label="分配系统编号"
                  align="center"
                  width="150"
                  prop="caseno"
                >
                  <template slot-scope="scope">
                    <el-input
                      v-model="scope.row.caseno"
                      placeholder="分配系统编号"
                      :disabled="
                        form.allocationStatus == '1' ||
                          scope.row.allocationstatus == '3'
                      "
                    />
                  </template>
                </el-table-column> -->
                  show-overflow-tooltip
                />
                <el-table-column
                  label="分配开始时间"
                  align="center"
                  width="180"
                  prop="applicanttime"
                >
                  <template slot-scope="scope">
                    <el-date-picker
                      clearable
                      size="small"
                      style="width: 100%"
                      v-model="scope.row.applicanttime"
                      type="datetime"
                      value-format="yyyy-MM-dd HH:mm:ss"
                      placeholder="选择开始接收时间"
                      :disabled="
                        form.allocationStatus == '1' ||
                          scope.row.allocationstatus == '3'
                      "
                    />
                  </template>
                </el-table-column>
                />
                <el-table-column
                  label="分配接收时间"
                  align="center"
                  width="180"
                  prop="organgettime"
                >
                  <template slot-scope="scope">
                    <el-date-picker
                      clearable
                      size="small"
                      style="width: 100%"
                      v-model="scope.row.organgettime"
                      type="datetime"
                      value-format="yyyy-MM-dd HH:mm:ss"
                      placeholder="选择分配接收时间"
                      :disabled="
                        form.allocationStatus == '1' ||
                          scope.row.allocationstatus == '3'
                      "
                    />
                  </template>
                </el-table-column>
                />
                <el-table-column
                  label="受体姓氏"
                  align="center"
                  width="120"
                  prop="name"
                >
                  <template slot-scope="scope">
                    <el-input
                      v-model="scope.row.name"
                      placeholder="受体姓氏"
                      :disabled="
                        form.allocationStatus == '1' ||
                          scope.row.allocationstatus == '3'
                      "
                    />
                  </template>
                </el-table-column>
                />
                <el-table-column
                  label="移植医院"
                  align="center"
                  width="200"
                  prop="transplanthospitalname"
                >
                  <template slot-scope="scope">
                    <el-autocomplete
                      v-model="scope.row.transplanthospitalname"
                      :fetch-suggestions="queryHospitalSearch"
                      placeholder="请选择或输入移植医院"
                      style="width: 100%"
                      clearable
                    ></el-autocomplete>
                  </template>
                  <!-- <template slot-scope="scope">
                    <el-select
                      v-model="scope.row.transplanthospitalname"
                      placeholder="请选择移植医院"
                      style="width: 100%"
                    >
                      <el-option
                        v-for="dict in dict.type.Geta_hospital"
                        :key="dict.value"
                        :label="dict.label"
                        :value="dict.value"
                      ></el-option>
                    </el-select>
                  </template> -->
                </el-table-column>
                  show-overflow-tooltip
                />
                <!-- 修改template中的说明列 -->
                <el-table-column
@@ -264,16 +115,7 @@
                >
                  <template slot-scope="scope">
                    <div v-if="scope.row.allocationstatus != '3'">
                      <el-input
                        type="textarea"
                        clearable
                        v-model="scope.row.reallocationreason"
                        placeholder="请输入说明"
                        :disabled="
                          form.allocationStatus == '1' ||
                            scope.row.allocationstatus == '3'
                        "
                      />
                      <span>{{ scope.row.reallocationreason || '-' }}</span>
                    </div>
                    <div v-else>
                      <!-- 重分配记录:显示详细查看按钮 -->
@@ -311,102 +153,11 @@
                  </template>
                </el-table-column>
                <el-table-column
                  label="操作"
                  align="center"
                  width="120"
                  class-name="small-padding fixed-width"
                  v-if="form.allocationStatus !== '1'"
                  fixed="right"
                >
                  <template slot-scope="scope">
                    <el-button
                      size="mini"
                      type="text"
                      icon="el-icon-copy-document"
                      @click="handleRedistribution(scope.row)"
                      :disabled="scope.row.allocationstatus == '3'"
                      style="color: #e6a23c;"
                    >
                      {{
                        scope.row.allocationstatus == "3"
                          ? "已重分配"
                          : "重分配"
                      }}
                    </el-button>
                    <el-button
                      v-if="scope.row.allocationstatus != '3'"
                      size="mini"
                      type="text"
                      icon="el-icon-delete"
                      @click="handleInvalidate(scope.row)"
                      :disabled="
                        scope.row.allocationstatus == '3' ||
                          scope.row.allocationstatus == '2'
                      "
                      style="color: #f56c6c;"
                    >
                      {{
                        scope.row.allocationstatus == "2" ? "已作废" : "作废"
                      }}
                    </el-button>
                  </template>
                </el-table-column>
              </el-table>
            </el-form-item>
          </el-col>
        </el-row>
      </el-table>
        <!-- 分配统计信息 -->
        <!-- <div
          class="allocation-stats"
          v-if="
            allocationData.serviceDonateorganList &&
              allocationData.serviceDonateorganList.length > 0
          "
        >
          <el-row :gutter="20">
            <el-col :span="6">
              <div class="stat-item">
                <span class="stat-label">已分配器官:</span>
                <span class="stat-value"
                  >{{ allocationData.serviceDonateorganList.length }} 个</span
                >
              </div>
            </el-col>
            <el-col :span="6">
              <div class="stat-item">
                <span class="stat-label">待审核:</span>
                <span class="stat-value">{{ pendingReviewCount }} 个</span>
              </div>
            </el-col>
            <el-col :span="6">
              <div class="stat-item">
                <span class="stat-label">涉及医院:</span>
                <span class="stat-value">{{ uniqueHospitals }} 家</span>
              </div>
            </el-col>
            <el-col :span="6">
              <div class="stat-item">
                <span class="stat-label">重分配:</span>
                <span class="stat-value">{{ redistributedCount }} 个</span>
              </div>
            </el-col>
          </el-row>
        </div> -->
        <div
          v-if="
            !allocationData.serviceDonateorganList ||
              allocationData.serviceDonateorganList.length == 0
          "
          class="empty-allocation"
        >
          <el-empty description="暂无分配记录" :image-size="80">
            <span>请先选择要分配的器官</span>
          </el-empty>
        </div>
      </el-form>
      <div v-if="!displayOrgans.length" class="empty-allocation">
        <el-empty description="暂无分配记录" :image-size="80" />
      </div>
    </el-card>
    <!-- 附件管理部分优化 -->
@@ -414,23 +165,7 @@
      <div class="attachment-header">
        <i class="el-icon-paperclip"></i>
        <span class="attachment-title">相关附件</span>
        <span class="attachment-tip"
          >支持上传器官分配相关文件 (最多{{ attachmentLimit }}个)</span
        >
      </div>
      <!-- 使用 UploadAttachment 组件 -->
      <UploadAttachment
        ref="uploadAttachment"
        :file-list="attachmentFileList"
        :limit="attachmentLimit"
        :accept="attachmentAccept"
        :multiple="true"
        @change="handleAttachmentChange"
        @upload-success="handleUploadSuccess"
        @upload-error="handleUploadError"
        @remove="handleAttachmentRemove"
      />
      <!-- 附件列表展示 -->
      <div class="attachment-list" v-if="attachments && attachments.length > 0">
@@ -462,7 +197,7 @@
              <span>{{ formatFileSize(scope.row.fileSize) }}</span>
            </template>
          </el-table-column>
          <el-table-column label="操作" width="280" fixed="right">
          <el-table-column label="操作" width="180" fixed="right">
            <template slot-scope="scope">
              <el-button
                size="mini"
@@ -479,92 +214,15 @@
              >
                下载
              </el-button>
              <el-button
                size="mini"
                type="danger"
                @click="handleRemoveAttachment(scope.$index)"
              >
                删除
              </el-button>
            </template>
          </el-table-column>
        </el-table>
      </div>
    </el-card>
    <div style="text-align: center; margin: 30px 0;">
      <el-button type="primary" @click="handleSave" :loading="saveLoading">
        保存
      </el-button>
      <el-button
        type="success"
        @click="handleConfirmAllocation"
        :disabled="form.allocationStatus == '1'"
        :loading="confirmLoading"
      >
        确认分配
      </el-button>
    </div>
    <!-- 重分配对话框 -->
    <el-dialog
      title="器官重分配"
      :visible.sync="redistributionDialogVisible"
      width="500px"
      @close="handleRedistributionDialogClose"
    >
      <el-form
        :model="redistributionForm"
        :rules="redistributionRules"
        ref="redistributionFormRef"
        label-width="100px"
      >
        <el-form-item label="原器官信息">
          <el-input v-model="redistributionForm.organname" readonly />
        </el-form-item>
        <el-form-item label="重分配原因" prop="reason" required>
          <el-input
            type="textarea"
            :rows="4"
            v-model="redistributionForm.reason"
            placeholder="请输入重分配原因"
          />
        </el-form-item>
        <el-form-item label="重分配时间" prop="redistributionTime" required>
          <el-date-picker
            v-model="redistributionForm.redistributionTime"
            type="datetime"
            placeholder="请选择重分配时间"
            value-format="yyyy-MM-dd HH:mm:ss"
            style="width: 100%"
          />
        </el-form-item>
        <el-form-item label="重分配附件">
          <UploadAttachment
            ref="redistributionAttachmentUpload"
            :file-list="redistributionAttachmentList"
            :limit="5"
            :accept="attachmentAccept"
            :multiple="true"
            @change="handleRedistributionChange"
            @upload-success="handleRedistributionUploadSuccess"
            @upload-error="handleRedistributionUploadError"
            @remove="handleRedistributionAttachmentRemove"
          />
          <div style="margin-top: 5px; font-size: 12px; color: #999;">
            支持上传重分配相关文件 (最多5个)
          </div>
        </el-form-item>
      </el-form>
      <div slot="footer">
        <el-button @click="redistributionDialogVisible = false">取消</el-button>
        <el-button
          type="primary"
          @click="handleRedistributionConfirm"
          :loading="redistributionLoading"
        >
          确认重分配
        </el-button>
      <div v-else class="empty-attachment">
        <el-empty description="暂无附件" :image-size="80" />
      </div>
    </el-dialog>
    </el-card>
    <!-- 在template中添加重分配详情弹窗 -->
    <el-dialog
      title="重分配详情"
@@ -574,7 +232,7 @@
      <div v-loading="redistributionDetailLoading">
        <div v-if="currentRedistributionDetail" style="padding: 20px;">
          <!-- 基本信息 -->
          <el-descriptions title="重分配信息" :column="2" border>
          <el-descriptions title="重分配信息" :column="descriptionColumn" border size="small">
            <el-descriptions-item label="器官名称">
              {{ currentRedistributionDetail.organname || "-" }}
            </el-descriptions-item>
@@ -709,20 +367,20 @@
  allocationedit,
  donateorganBaseinfoInfo
} from "@/api/businessApi";
import UploadAttachment from "@/components/UploadAttachment";
import FilePreviewDialog from "@/components/FilePreviewDialog";
import OrgSelecter from "@/views/project/components/orgselect";
import CaseBasicInfo from "@/components/CaseBasicInfo";
import dayjs from "dayjs";
import readonlyDescriptionsMixin from "./readonlyDescriptionsMixin";
export default {
  name: "OrganAllocationDetail",
  components: {
    UploadAttachment,
    OrgSelecter,
    FilePreviewDialog,
    CaseBasicInfo
  },
  mixins: [readonlyDescriptionsMixin],
  dicts: [
    "sys_BloodType",
    "sys_DonationCategory",