<template>
  <div class="app-container">
    <div class="ImageReviewTask-list app-container">
      <el-collapse v-model="activeNames">
        <el-form ref="qualifiedForm" :model="reportResult">
          <el-form-item
            prop="Qualified"
            label="Qualified for Review:"
            label-width="200px"
            :rules="[{ required: true, message: '', trigger: 'blur' }]"
          >
            <el-radio-group v-model="reportResult.Qualified" :disabled="isReportSaved">
              <el-radio :label="true">Qualified</el-radio>
              <el-radio :label="false">Non-Qualified</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>

        <el-collapse-item
          name="Non-lymphNodeTarget"
          title="Non-nodular Target Lesions (Non-lymph Node Target Lesions)"
          disabled
        >
          <div class="toolbar">
            <span style="margin-right: 20px">Lesions Operate:</span>
            <el-button
              type="primary"
              size="small"
              :disabled="nonlymphNodeTargetMergeDisable || isReportSaved"
              @click="nonlymphNodeTargetMerge"
            >Merge</el-button>
            <span style="margin-right: 20px">SplitCount:</span>
            <el-input
              v-model="nonlymphNodeTargetSplitCount"
              placeholder="Split Count"
              :disabled="nonlymphNodeTargetSplitDisable || isReportSaved"
              class="mr"
              style="width: 80px"
              size="small"
              type="number"
              min="2"
            />
            <el-button
              type="primary"
              size="small"
              :disabled="nonlymphNodeTargetSplitDisable || isReportSaved"
              @click="nonlymphNodeTargetSplit"
            >Split</el-button>
          </div>

          <el-table
            ref="nonlymphNodeTargetBLTable"
            :data="BLNonlymphNodeTargetList"
            stripe
            size="small"
            @selection-change="handleNonlymphNodeTargetListSelectionChange"
          >
            <el-table-column label="BaseLine">
              <el-table-column type="index" width="40" />
              <el-table-column
                type="selection"
                align="left"
                width="50"
                :selectable="canNonlymphNodeTargetOpt"
              />
              <el-table-column
                prop="TULNKID"
                label="Lesion No"
                show-overflow-tooltip
                min-width="60"
              />
              <el-table-column prop="Anatomy" label="Anatomy" show-overflow-tooltip min-width="80">
                <template slot-scope="scope">
                  {{
                    (scope.row.TULOC || '') +
                      ' ' +
                      (scope.row.TULAT || '') +
                      ' ' +
                      (scope.row.TUDIR || '')
                  }}
                </template>
              </el-table-column>
              <el-table-column
                prop="LocDescription"
                label="Anatomy Description"
                min-width="120"
                show-overflow-tooltip
              >
                <template slot-scope="scope">
                  <el-input
                    v-model="scope.row.LocDescription"
                    type="text"
                    placeholder
                    size="small"
                    clearable
                    :disabled="
                      scope.row.VISITNUM != pageTPInfo.VisitNum || isReportSaved
                    "
                  />
                </template>
              </el-table-column>

              <!-- <el-table-column
                prop="Note"
                label="Comments"
                show-overflow-tooltip
                min-width="60"
              >
                <template slot-scope="scope">
                  <el-input
                    type="text"
                    v-model="scope.row.Note"
                    placeholder=""
                    size="small"
                    clearable
                    :disabled="scope.row.VISITNUM != pageTPInfo.VisitNum"
                  ></el-input>
                </template>
              </el-table-column>-->
            </el-table-column>

            <el-table-column label="Current Timepoint:">
              <el-table-column label="Current scan has covered" min-width="150">
                <template slot-scope="scope">
                  <el-select
                    v-model="scope.row.CurrentLesion.CoveredLesion"
                    style="width: 100%"
                    size="small"
                    clearable
                    :disabled="
                      scope.row.VISITNUM == 1
                        ? NonlymphNodeTargetSplitOrMergeArray.some(
                          (currentValue) =>
                            currentValue.TULNKID.indexOf(scope.row.TULNKID) !=
                            -1
                        )
                        : false || isReportSaved
                    "
                    @change="
                      nonlymphNodeTargetCoveredLesionChange(
                        scope.row.CurrentLesion
                      )
                    "
                  >
                    <el-option :value="true" label="YES" />
                    <el-option :value="false" label="NO" />
                  </el-select>
                </template>
              </el-table-column>

              <el-table-column label="Long  Axis Measurement(mm)" min-width="150">
                <template slot-scope="scope">
                  <el-select
                    v-model="scope.row.CurrentLesion.TRORRES"
                    clearable
                    style="width: 100%"
                    size="small"
                    :disabled="
                      (scope.row.VISITNUM == 1
                        ? NonlymphNodeTargetSplitOrMergeArray.some(
                          (currentValue) =>
                            currentValue.TULNKID.indexOf(scope.row.TULNKID) !=
                            -1
                        )
                        : false) ||
                        isReportSaved ||
                        scope.row.CurrentLesion.CoveredLesion == false
                    "
                    @change="nonlymphNodeTargetMeasurementChange(scope.row)"
                  >
                    <el-option
                      v-for="item in VisitNonlymphNodeTargetList"
                      :key="item.value"
                      :label="
                        item.TRORRES +
                          ' ' +
                          item.TULOC +
                          ' ' +
                          item.TULAT +
                          ' ' +
                          item.TUDIR
                      "
                      :value="item.TRORRES"
                      :disabled="item.HasSelected"
                    />
                  </el-select>
                </template>
              </el-table-column>

              <el-table-column prop="Note" label="Comments" show-overflow-tooltip min-width="100">
                <template slot-scope="scope">
                  <el-input
                    v-model="scope.row.CurrentLesion.Note"
                    type="text"
                    placeholder
                    size="small"
                    clearable
                    :disabled="
                      (scope.row.VISITNUM == 1
                        ? NonlymphNodeTargetSplitOrMergeArray.some(
                          (currentValue) =>
                            currentValue.TULNKID.indexOf(scope.row.TULNKID) !=
                            -1
                        )
                        : false) ||
                        isReportSaved ||
                        scope.row.CurrentLesion.CoveredLesion == false
                    "
                  />
                </template>
              </el-table-column>
              <el-table-column label="Action" min-width="40" fixed="right">
                <template slot-scope="scope">
                  <el-button
                    v-if="scope.row.VISITNUM == pageTPInfo.VisitNum"
                    type="text"
                    size="small"
                    :disabled="isReportSaved"
                    @click="handlenonlymphNodeTargetDelete(scope.row)"
                  >Delete</el-button>
                </template>
              </el-table-column>
            </el-table-column>
          </el-table>
        </el-collapse-item>

        <el-collapse-item
          title="Nodular Target Lesions (Lymph Node Target Lesions)"
          name="LymphNodeTarget"
          disabled
        >
          <div class="toolbar">
            <span style="margin-right: 20px">Lesions Operate:</span>
            <el-button
              type="primary"
              size="small"
              :disabled="lymphNodeTargetMergeDisable || isReportSaved"
              @click="lymphNodeTargetMerge"
            >Merge</el-button>
            <span style="margin-right: 20px">SplitCount:</span>
            <el-input
              v-model="lymphNodeTargetSplitCount"
              placeholder="Split Count"
              :disabled="lymphNodeTargetSplitDisable || isReportSaved"
              style="width: 80px"
              class="mr"
              size="small"
              type="number"
              min="2"
            />
            <el-button
              type="primary"
              size="small"
              :disabled="lymphNodeTargetSplitDisable || isReportSaved"
              @click="lymphNodeTargetSplit"
            >Split</el-button>
          </div>

          <el-table
            ref="lymphNodeTargetBLTable"
            :data="BLLymphNodeTargetList"
            stripe
            size="small"
            @selection-change="handleLymphNodeTargetListSelectionChange"
          >
            <el-table-column label="BaseLine">
              <el-table-column type="index" width="60" />
              <el-table-column
                type="selection"
                align="left"
                width="50"
                :selectable="canLymphNodeTargetOpt"
              />
              <el-table-column
                prop="TULNKID"
                label="Lesion No"
                show-overflow-tooltip
                min-width="50"
              />
              <el-table-column prop="Anatomy" label="Anatomy" show-overflow-tooltip min-width="80">
                <template slot-scope="scope">
                  {{
                    (scope.row.TULOC || '') +
                      ' ' +
                      (scope.row.TULAT || '') +
                      ' ' +
                      (scope.row.TUDIR || '')
                  }}
                </template>
              </el-table-column>
              <el-table-column
                prop="LocDescription"
                label="Anatomy Description"
                min-width="120"
                show-overflow-tooltip
              >
                <template slot-scope="scope">
                  <el-input
                    v-model="scope.row.LocDescription"
                    type="text"
                    placeholder
                    size="small"
                    clearable
                    :disabled="
                      scope.row.VISITNUM != pageTPInfo.VisitNum || isReportSaved
                    "
                  />
                </template>
              </el-table-column>
            </el-table-column>

            <el-table-column label="Current Timepoint">
              <el-table-column label="Current scan has covered" min-width="150">
                <template slot-scope="scope">
                  <el-select
                    v-model="scope.row.CurrentLesion.CoveredLesion"
                    style="width: 100%"
                    size="small"
                    :disabled="
                      scope.row.VISITNUM == 1
                        ? LymphNodeTargetSplitOrMergeArray.some(
                          (currentValue) =>
                            currentValue.TULNKID.indexOf(scope.row.TULNKID) !=
                            -1
                        )
                        : false || isReportSaved
                    "
                    @change="
                      lymphNodeTargetCoveredLesionChange(
                        scope.row.CurrentLesion
                      )
                    "
                  >
                    <el-option :value="true" label="YES" />
                    <el-option :value="false" label="NO" />
                  </el-select>
                </template>
              </el-table-column>

              <el-table-column label="Short  Axis Measurement(mm)" min-width="150">
                <template slot-scope="scope">
                  <el-select
                    v-model="scope.row.CurrentLesion.TRORRES"
                    clearable
                    style="width: 100%"
                    size="small"
                    :disabled="
                      (scope.row.VISITNUM == 1
                        ? LymphNodeTargetSplitOrMergeArray.some(
                          (currentValue) =>
                            currentValue.TULNKID.indexOf(scope.row.TULNKID) !=
                            -1
                        )
                        : false) ||
                        isReportSaved ||
                        scope.row.CurrentLesion.CoveredLesion == false
                    "
                    @change="lymphNodeTargetMeasurementChange(scope.row)"
                  >
                    <el-option
                      v-for="item in VisitLymphNodeTargetList"
                      :key="item.value"
                      :label="
                        item.TRORRES +
                          ' ' +
                          item.TULOC +
                          ' ' +
                          item.TULAT +
                          ' ' +
                          item.TUDIR
                      "
                      :value="item.TRORRES"
                      :disabled="item.HasSelected"
                    />
                  </el-select>
                </template>
              </el-table-column>

              <el-table-column prop="Note" label="Comments" show-overflow-tooltip min-width="100">
                <template slot-scope="scope">
                  <el-input
                    v-model="scope.row.CurrentLesion.Note"
                    type="text"
                    placeholder
                    size="small"
                    :disabled="
                      (scope.row.VISITNUM == 1
                        ? LymphNodeTargetSplitOrMergeArray.some(
                          (currentValue) =>
                            currentValue.TULNKID.indexOf(scope.row.TULNKID) !=
                            -1
                        )
                        : false) ||
                        isReportSaved ||
                        scope.row.CurrentLesion.CoveredLesion == false
                    "
                  />
                </template>
              </el-table-column>
              <el-table-column label="Action" min-width="40" fixed="right">
                <template slot-scope="scope">
                  <el-button
                    v-if="scope.row.VISITNUM == pageTPInfo.VisitNum"
                    type="text"
                    size="small"
                    :disabled="isReportSaved"
                    @click="handlelymphNodeTargetDelete(scope.row)"
                  >Delete</el-button>
                </template>
              </el-table-column>
            </el-table-column>
          </el-table>
        </el-collapse-item>

        <el-collapse-item title="Non-target Lesion" name="Non-targetLesion" disabled>
          <el-table ref="nontargetLesionTable" :data="BLNontargetLesionList" stripe size="small">
            <el-table-column label="BaseLine">
              <el-table-column type="index" width="60" />
              <el-table-column
                prop="TULNKID"
                label="Lesion No"
                show-overflow-tooltip
                min-width="100"
              />
              <el-table-column prop="Anatomy" label="Anatomy" show-overflow-tooltip min-width="100">
                <template slot-scope="scope">
                  {{
                    scope.row.TULOC +
                      ' ' +
                      scope.row.TULAT +
                      ' ' +
                      scope.row.TUDIR
                  }}
                </template>
              </el-table-column>

              <el-table-column
                prop="LocDescription"
                label="Anatomy Description"
                show-overflow-tooltip
                min-width="120"
              />
              <el-table-column prop="Note" label="Comments" show-overflow-tooltip min-width="100" />
            </el-table-column>
            <el-table-column label="Current Timepoint">
              <el-table-column label="Lesion Assessment" min-width="120">
                <template slot-scope="scope">
                  <el-input
                    v-model="scope.row.CurrentLesion.TRORRES"
                    type="text"
                    placeholder
                    size="small"
                    :disabled="isReportSaved"
                  />
                </template>
              </el-table-column>

              <el-table-column
                prop="TRORRESU"
                label="Lesion status"
                show-overflow-tooltip
                min-width="120"
              >
                <template slot-scope="scope">
                  <el-select
                    v-model="scope.row.CurrentLesion.TRORRESU"
                    size="small"
                    style="width: 100%"
                    clearable
                    class="mr"
                    @change="nonTargetLesionStatusChange()"
                  >
                    <el-option value="Exist" label="Exist" />
                    <el-option value="Disappear" label="Disappear" />
                    <el-option value="Identify progress" label="Identify progress" />
                  </el-select>
                  <!-- <el-input
                    v-model="scope.row.CurrentLesion.TRORRESU"
                    type="text"
                    placeholder
                    size="small"
                    :disabled="isReportSaved"
                  />-->
                </template>
              </el-table-column>

              <el-table-column prop="Note" label="Comments" show-overflow-tooltip min-width="120">
                <template slot-scope="scope">
                  <el-input
                    v-model="scope.row.CurrentLesion.Note"
                    type="text"
                    placeholder
                    size="small"
                    :disabled="isReportSaved"
                  />
                </template>
              </el-table-column>
            </el-table-column>
          </el-table>
        </el-collapse-item>

        <el-collapse-item title="Previous New Lesion" name="PreviousNewLesion" disabled>
          <el-table ref="previousNewLesionTable" :data="PreviousNewLesionList" stripe size="small">
            <el-table-column label="First">
              <el-table-column type="index" width="60" />
              <el-table-column
                prop="TULNKID"
                label="Lesion No"
                show-overflow-tooltip
                min-width="100"
              />
              <el-table-column prop="Anatomy" label="Anatomy" show-overflow-tooltip min-width="100">
                <template slot-scope="scope">
                  {{
                    scope.row.TULOC +
                      ' ' +
                      scope.row.TULAT +
                      ' ' +
                      scope.row.TUDIR
                  }}
                </template>
              </el-table-column>

              <el-table-column
                prop="LocDescription"
                label="Anatomy Description"
                show-overflow-tooltip
                min-width="120"
              />
              <el-table-column prop="Note" label="Comments" show-overflow-tooltip min-width="100" />
            </el-table-column>
            <el-table-column label="Current Timepoint">
              <el-table-column label="Lesion Assessment" min-width="120">
                <template slot-scope="scope">
                  <el-input
                    v-model="scope.row.CurrentLesion.TRORRES"
                    type="text"
                    placeholder
                    size="small"
                    :disabled="isReportSaved"
                  />
                </template>
              </el-table-column>

              <el-table-column
                prop="VisitTRORRESU"
                label="Lesion status"
                show-overflow-tooltip
                min-width="120"
              >
                <template slot-scope="scope">
                  <!-- <el-input
                    v-model="scope.row.CurrentLesion.TRORRESU"
                    type="text"
                    placeholder
                    size="small"
                    :disabled="isReportSaved"
                  />-->
                  <el-select
                    v-model="scope.row.CurrentLesion.TRORRESU"
                    size="small"
                    style="width: 100%"
                    clearable
                    class="mr"
                  >
                    <el-option value="Exist" label="Exist" />
                    <el-option value="Disappear" label="Disappear" />
                    <el-option value="Identify progress" label="Identify progress" />
                  </el-select>
                </template>
              </el-table-column>

              <el-table-column
                prop="VisitNote"
                label="Comments"
                show-overflow-tooltip
                min-width="120"
              >
                <template slot-scope="scope">
                  <el-input
                    v-model="scope.row.CurrentLesion.Note"
                    type="text"
                    placeholder
                    size="small"
                    :disabled="isReportSaved"
                  />
                </template>
              </el-table-column>
            </el-table-column>
          </el-table>
        </el-collapse-item>

        <el-collapse-item title="Equivocal New Lesion" name="EquivocalNewLesion" disabled>
          <el-table
            ref="equivocalNewLesionTable"
            :data="EquivocalNewLesionList"
            stripe
            size="small"
          >
            <el-table-column type="index" width="60" />
            <el-table-column
              prop="TULNKID"
              label="Lesion No"
              show-overflow-tooltip
              min-width="100"
            />
            <el-table-column prop="Anatomy" label="Anatomy" show-overflow-tooltip min-width="100">
              <template slot-scope="scope">
                {{
                  scope.row.TULOC +
                    ' ' +
                    scope.row.TULAT +
                    ' ' +
                    scope.row.TUDIR
                }}
              </template>
            </el-table-column>

            <el-table-column
              prop="LocDescription"
              label="Anatomy Description"
              show-overflow-tooltip
              min-width="120"
            >
              <template slot-scope="scope">
                <el-input
                  v-model="scope.row.LocDescription"
                  :disabled="isReportSaved"
                  type="text"
                  placeholder
                  size="small"
                  clearable
                />
              </template>
            </el-table-column>
            <el-table-column prop="Note" label="Comments" show-overflow-tooltip min-width="100">
              <template slot-scope="scope">
                <el-input
                  v-model="scope.row.Note"
                  :disabled="isReportSaved"
                  type="text"
                  placeholder
                  size="small"
                  clearable
                />
              </template>
            </el-table-column>
          </el-table>
        </el-collapse-item>

        <el-collapse-item title="Unequivocal New Lesion" name="UnequivocalNewLesion" disabled>
          <el-table
            ref="unequivocalNewLesionTable"
            :data="UnequivocalNewLesionList"
            stripe
            size="small"
          >
            <el-table-column type="index" width="60" />
            <el-table-column
              prop="TULNKID"
              label="Lesion No"
              show-overflow-tooltip
              min-width="100"
            />
            <el-table-column prop="Anatomy" label="Anatomy" show-overflow-tooltip min-width="100">
              <template slot-scope="scope">
                {{
                  scope.row.TULOC +
                    ' ' +
                    scope.row.TULAT +
                    ' ' +
                    scope.row.TUDIR
                }}
              </template>
            </el-table-column>

            <el-table-column
              prop="LocDescription"
              label="Anatomy Description"
              show-overflow-tooltip
              min-width="120"
            >
              <template slot-scope="scope">
                <el-input
                  v-model="scope.row.LocDescription"
                  :disabled="isReportSaved"
                  type="text"
                  placeholder
                  size="small"
                  clearable
                />
              </template>
            </el-table-column>
            <el-table-column prop="Note" label="Comments" show-overflow-tooltip min-width="100">
              <template slot-scope="scope">
                <el-input
                  v-model="scope.row.Note"
                  :disabled="isReportSaved"
                  type="text"
                  placeholder
                  size="small"
                  clearable
                />
              </template>
            </el-table-column>
          </el-table>
        </el-collapse-item>

        <el-collapse-item title="Measurements Calculation" name="MeasurementsCalculation" disabled>
          <el-row>
            <el-col :span="6">
              <div class="grid-content bg-purple">Sum of Diameter(SOD)(mm) :{{ SumOfDiameter }}</div>
            </el-col>
            <el-col :span="6">
              <div
                class="grid-content bg-purple-light"
              >Non-nodular Lesions SOD(mm) :{{ NonnodularLesionsSOD }}</div>
            </el-col>
            <el-col :span="6">
              <div class="grid-content bg-purple">Baseline SOD :{{ BaselineSOD }}</div>
            </el-col>

            <el-col :span="6">
              <div class="grid-content bg-purple">Baseline SOD % change :{{ BaselineSODChange }}</div>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <div class="grid-content bg-purple-light">
                Timepoint of Nadir SOD :{{
                  TimepointOfNadirSOD + '(' + MinVisitInfo.MinSum + ')'
                }}
              </div>
            </el-col>
            <el-col :span="6">
              <div
                class="grid-content bg-purple-light"
              >Nadir SOD increase(mm) :{{ NadirSODIncrease }}</div>
            </el-col>
            <el-col :span="6">
              <div
                class="grid-content bg-purple-light"
              >Nadir SOD % increase :{{ NadirSODIncreasePercent }}</div>
            </el-col>
          </el-row>
        </el-collapse-item>

        <el-collapse-item title="Efficacy Assessment" name="EfficacyAssessment" disabled>
          <el-form ref="efficacyAssessmentForm" :model="efficacyAssessment" label-width="100px">
            <el-row>
              <el-col :span="6">
                <el-form-item
                  prop="TargetLesion"
                  label="Target Lesion"
                  label-width="150px"
                  :rules="[{ required: false, message: '', trigger: 'blur' }]"
                >
                  <el-select
                    v-model="efficacyAssessment.TargetLesion"
                    :disabled="isReportSaved"
                    clearable
                    size="small"
                    @change="targetLesionAssessmentChange"
                  >
                    <el-option value="CR" label="完全缓解(CR)" />
                    <el-option value="PR" label=" 部分缓解(PR)" />
                    <el-option value="PD" label=" 疾病进展(PD)" />
                    <el-option value="SD" label="疾病稳定(SD)" />
                    <el-option value="NE" label="不可评估(NE)" />
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="18">
                <el-form-item
                  v-if="efficacyAssessment.RequireTargetLesionNote"
                  prop="TargetLesionNote"
                  label="Note: "
                  :rules="[{ required: true, message: '', trigger: 'blur' }]"
                >
                  <el-input v-model="efficacyAssessment.TargetLesionNote" size="small" minlength="2" />
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="6">
                <el-form-item
                  prop="Non_targetLesion"
                  label="Non-target Lesion"
                  label-width="150px"
                  :rules="[{ required: true, message: '', trigger: 'blur' }]"
                >
                  <el-select
                    v-model="efficacyAssessment.Non_targetLesion"
                    :disabled="isReportSaved"
                    clearable
                    size="small"
                    @change="
                      non_targetLesionAssessmentChange(
                        efficacyAssessment.Non_targetLesion
                      )
                    "
                  >
                    <el-option value="CR" label="完全缓解(CR)" />
                    <el-option value="Non-CR/Non-PD" label="非完全缓解/非疾病进展(Non-CR/Non-PD)" />
                    <el-option value="PD" label=" 疾病进展(PD)" />
                    <el-option value="NE" label="不可评估(NE)" />
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col v-if="efficacyAssessment.RequireNon_targetLesionNote" :span="18">
                <el-form-item
                  prop="Non_targetLesionNote"
                  label="Note: "
                  :rules="[{ required: true, message: '', trigger: 'blur' }]"
                >
                  <el-input
                    v-model="efficacyAssessment.Non_targetLesionNote"
                    size="small"
                    minlength="2"
                  />
                </el-form-item>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="6">
                <el-form-item
                  prop="OverallAssessment"
                  label="Overall Assessment"
                  label-width="150px"
                  :rules="[{ required: true, message: '', trigger: 'blur' }]"
                >
                  <el-select
                    v-model="efficacyAssessment.OverallAssessment"
                    :disabled="isReportSaved"
                    clearable
                    size="small"
                    @change="
                      overallAssessmentChange(
                        efficacyAssessment.OverallAssessment
                      )
                    "
                  >
                    <el-option value="CR" label="完全缓解(CR)" />
                    <el-option value="PR" label=" 部分缓解(PR)" />
                    <el-option value="PD" label=" 疾病进展(PD)" />
                    <el-option value="SD" label="疾病稳定(SD)" />
                    <el-option value="NE" label="不可评估(NE)" />
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col v-if="efficacyAssessment.RequireOverallAssessmentNote" :span="18">
                <el-form-item
                  label="Note: "
                  prop="OverallAssessmentNote"
                  :rules="[{ required: true, message: '', trigger: 'blur' }]"
                >
                  <el-input
                    v-model="efficacyAssessment.OverallAssessmentNote"
                    size="small"
                    minlength="2"
                  />
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
          <!-- Note:   <el-input v-model="efficacyAssessment.efficacyAssessmentNote" size="small"></el-input> -->
        </el-collapse-item>

        <el-collapse-item title="Comments" name="Comments" disabled>
          <el-form ref="commentsForm" :model="reportResult" label-width="100px" :inline="true">
            <el-form-item
              prop="DiseaseProgression"
              label="Disease Progression"
              label-width="150px"
              :rules="[{ required: true, message: '', trigger: 'blur' }]"
            >
              <el-input
                v-model="reportResult.DiseaseProgression"
                :disabled="isReportSaved"
                type="textarea"
                size="small"
              />
            </el-form-item>

            <el-form-item prop="DiseaseProgression" label="NotEvaluable" label-width="100px">
              <el-input
                v-model="reportResult.NotEvaluable"
                :disabled="isReportSaved"
                type="textarea"
                size="small"
              />
            </el-form-item>

            <el-form-item prop="Timepoint" label="Timepoint" label-width="100px">
              <el-input
                v-model="reportResult.Timepoint"
                :disabled="isReportSaved"
                type="textarea"
                size="small"
              />
            </el-form-item>
          </el-form>
        </el-collapse-item>
      </el-collapse>

      <div id="footer">
        <el-button
          type="primary"
          style="float: left; margin-left: 500px"
          :disabled="isReportSaved"
          @click="addVistLine"
        >Save</el-button>
        <el-button
          type="primary"
          style="float: right; margin-right: 600px"
          :disabled="isReportSaved"
          @click="submiteReport"
        >Submit Report</el-button>
      </div>
    </div>
  </div>
</template>
<script>
import {
  getVisitLineLesion,
  saveVisitReport,
  submiteReport,
  saveImageLabelList,
  getImageLabelList
} from '@/api/reading'
export default {
  name: 'WorkloadTask',
  // eslint-disable-next-line vue/require-prop-types
  props: ['globalRowVisitNum', 'visitTpCode'],
  data() {
    return {
      isReportSaved: false,
      pageTPInfo: '',
      efficacyAssessment: {
        TargetLesion: '',
        RequireTargetLesionNote: false,
        Non_targetLesion: '',
        RequireNon_targetLesionNote: false,
        OverallAssessment: '',
        RequireOverallAssessmentNote: false,
        efficacyAssessmentNote: ''
      },
      previousOverallAssessment: {
        visitName: '',
        overallAssessment: ''
      },
      measurementsCalculation: {
        SumOfDiameter: '',
        NonnodularLesionsSOD: '',
        BaselineSODChange: '',
        BaselineSOD: '',
        NadirSODIncrease: '',
        NadirSODIncreasePercent: '',
        TimepointOfNadirSOD: ''
      },

      activeNames: [
        'ImageQualityAssessment',
        'Non-lymphNodeTarget',
        'LymphNodeTarget',
        'Non-targetLesion',
        'EfficacyAssessment',
        'Comments',
        'PreviousNewLesion',
        'EquivocalNewLesion',
        'UnequivocalNewLesion',
        'MeasurementsCalculation'
      ],

      // localStorageData: [
      //   { TRORRES: 10, TULOC: 'lung', TULAT: 'left', TUDIR: 'ddd' },
      //   { TRORRES: 11, TULOC: 'lung', TULAT: 'right', TUDIR: 'ccc' },
      // ],

      VisitNontargetLesionList: [],
      VisitNonlymphNodeTargetList: [],
      VisitLymphNodeTargetList: [],

      nonlymphNodeTargetSplitCount: 0,
      nonlymphNodeTargetDisableIds: [],
      nonlymphNodeTargetSelectArray: [],
      BLNonlymphNodeTargetList: [],
      nonlymphNodeTargetMergeDisable: true,
      nonlymphNodeTargetSplitDisable: true,

      lymphNodeTargetSplitCount: 0,
      lymphNodeTargetDisableIds: [],
      lymphNodeTargetSelectArray: [],
      BLLymphNodeTargetList: [],
      lymphNodeTargetMergeDisable: true,
      lymphNodeTargetSplitDisable: true,

      BLNontargetLesionList: [],

      PreviousNewLesionList: [],

      EquivocalNewLesionList: [
        // {
        //   TRORRES: 10,
        //   TULOC: 'kk',
        //   TULAT: 'left',
        //   TUDIR: 'ddd',
        //   LocDescription: 'Equivocal1',
        //   Note: 'Equivocal1'
        // },
        // {
        //   TRORRES: 10,
        //   TULOC: 'gg',
        //   TULAT: 'left',
        //   TUDIR: 'ddd',
        //   LocDescription: 'Equivocal1',
        //   Note: 'Equivocal2'
        // }
      ],
      UnequivocalNewLesionList: [
        // {
        //   TRORRES: 10,
        //   TULOC: 'kk',
        //   TULAT: 'left',
        //   TUDIR: 'ddd',
        //   LocDescription: 'Unequivocal2',
        //   Note: 'Unequivocal2'
        // },
        // {
        //   TRORRES: 10,
        //   TULOC: 'gg',
        //   TULAT: 'left',
        //   TUDIR: 'ddd',
        //   LocDescription: 'Unequivocal1',
        //   Note: 'Unequivocal1'
        // }
      ],
      imageLabelList: [],

      imageDataHasUpdate: false,

      reportResult: {
        Qualified: '',
        DiseaseProgression: '',
        NotEvaluable: '',
        Timepoint: '',
        TrialCode: '',
        SubjectCode: '',
        VisitNum: '',
        VisitName: '',
        DiseaseSituation: '',
        Comment: '',
        TPId: '',
        DicomStudyId: ''
      },
      MinVisitInfo: {
        MinSum: 0,
        MinVistName: ''
      }
    }
  },

  computed: {
    NonlymphNodeTargetSplitOrMergeArray: function() {
      return this.BLNonlymphNodeTargetList.filter(
        (element) =>
          element.VISITNUM === this.pageTPInfo.VisitNum ||
          element.TULNKID.indexOf('/') !== -1 ||
          element.TULNKID.indexOf('.') !== -1
      )
    },

    LymphNodeTargetSplitOrMergeArray: function() {
      return this.BLLymphNodeTargetList.filter(
        (element) =>
          element.VISITNUM === this.pageTPInfo.VisitNum ||
          element.TULNKID.indexOf('/') !== -1 ||
          element.TULNKID.indexOf('.') !== -1
      )
    },

    SumOfDiameter: function() {
      let sum = 0

      this.BLNonlymphNodeTargetList.forEach(
        (element) => (sum += Number(element.CurrentLesion.TRORRES))
      )
      this.BLLymphNodeTargetList.forEach(
        (element) => (sum += Number(element.CurrentLesion.TRORRES))
      )

      return sum.toFixed(1)
    },
    NonnodularLesionsSOD() {
      let sum = 0
      this.BLNonlymphNodeTargetList.forEach(
        (element) => (sum += Number(element.CurrentLesion.TRORRES))
      )
      // this.measurementsCalculation.NonnodularLesionsSOD = sum
      return sum.toFixed(1)
    },

    BaselineSODChange: function() {
      let visitSum = 0
      let blSum = 0
      this.BLNonlymphNodeTargetList.forEach((element) => {
        visitSum += Number(element.CurrentLesion.TRORRES)
        blSum += Number(element.TRORRES)
      })
      this.BLLymphNodeTargetList.forEach((element) => {
        visitSum += Number(element.CurrentLesion.TRORRES)
        blSum += Number(element.TRORRES)
      })

      return (((visitSum - blSum) * 100) / blSum).toFixed(1) + '%'
    },

    BaselineSOD: function() {
      let blSum = 0
      this.BLNonlymphNodeTargetList.forEach((element) => {
        blSum += Number(element.TRORRES)
      })
      this.BLLymphNodeTargetList.forEach((element) => {
        blSum += Number(element.TRORRES)
      })

      return blSum
    },

    NadirSODIncrease: function() {
      let visitSum = 0
      // let blSum = 0
      this.BLNonlymphNodeTargetList.forEach((element) => {
        visitSum += Number(element.CurrentLesion.TRORRES)
        // blSum += Number(element.TRORRES)
      })
      this.BLLymphNodeTargetList.forEach((element) => {
        visitSum += Number(element.CurrentLesion.TRORRES)
        // blSum += Number(element.TRORRES)
      })

      const historyMinSum = this.MinVisitInfo.MinSum
      return (visitSum - historyMinSum).toFixed(1)
    },

    NadirSODIncreasePercent: function() {
      let visitSum = 0
      this.BLNonlymphNodeTargetList.forEach((element) => {
        visitSum += Number(element.CurrentLesion.TRORRES)
      })
      this.BLLymphNodeTargetList.forEach((element) => {
        visitSum += Number(element.CurrentLesion.TRORRES)
      })
      return ((visitSum * 100) / this.NadirSODIncrease).toFixed(1) + '%'
    },

    TimepointOfNadirSOD: function() {
      return this.MinVisitInfo.MinVistName
    }
  },

  created() {
    this.pageTPInfo = this.$route.query

    // 处理global页面进来
    if (this.globalRowVisitNum) {
      this.pageTPInfo.VisitNum = this.globalRowVisitNum

      this.pageTPInfo.WorkloadCode = this.visitTpCode
    }

    this.isReportSaved = this.pageTPInfo.Status === 80
    this.reportResult.TpCode = this.pageTPInfo.WorkloadCode
    this.reportResult.TrialCode = this.pageTPInfo.TrialCode
    this.reportResult.SubjectCode = this.pageTPInfo.SubjectCode
    this.reportResult.VisitNum = this.pageTPInfo.VisitNum
    this.reportResult.VisitName = this.pageTPInfo.VisitName
    this.reportResult.TPId = this.pageTPInfo.WorkloadId
    this.reportResult.DicomStudyId = this.pageTPInfo.StudyId

    getVisitLineLesion(
      this.pageTPInfo.TrialCode,
      this.pageTPInfo.SubjectCode,
      this.pageTPInfo.VisitNum,
      this.pageTPInfo.WorkloadCode
    ).then((res) => {
      this.BLNonlymphNodeTargetList = res.Result.BLLesionList.filter(
        (t) => t.LesionType === 1
      )
      this.BLLymphNodeTargetList = res.Result.BLLesionList.filter(
        (t) => t.LesionType === 2
      )

      this.BLNontargetLesionList = res.Result.BLLesionList.filter(
        (t) => t.LesionType === 3
      )
      this.MinVisitInfo = res.Result.MinVisitInfo
      this.reportResult.TpCode = this.pageTPInfo.WorkloadCode

      this.reportResult = res.Result.ReportResult
        ? res.Result.ReportResult
        : this.reportResult

      // 恢复疗效表单
      this.efficacyAssessment = res.Result.Efficacy
      this.efficacyAssessment.RequireOverallAssessmentNote =
        this.efficacyAssessment.OverallAssessmentNote.length > 0
      this.efficacyAssessment.RequireTargetLesionNote =
        this.efficacyAssessment.TargetLesionNote.length > 0
      this.efficacyAssessment.RequireNon_targetLesionNote =
        this.efficacyAssessment.Non_targetLesionNote.length > 0

      this.PreviousNewLesionList = res.Result.PreviousNewLesionList

      this.EquivocalNewLesionList =
        res.Result.EquivocalNewLesionList.length !== 0
          ? res.Result.EquivocalNewLesionList
          : this.EquivocalNewLesionList
      this.UnequivocalNewLesionList =
        res.Result.UnequivocalNewLesionList.length !== 0
          ? res.Result.UnequivocalNewLesionList
          : this.UnequivocalNewLesionList

      getImageLabelList(this.pageTPInfo.WorkloadCode).then((res) => {
        if (res.Result.length > 0) {
          res.Result.forEach((item) => {
            this.imageLabelList.push(JSON.parse(item.LabelValue))
          })

          this.handelImageLabelDataLogic(this.imageLabelList)
        }
      })
    })
  },

  mounted() {
    const that = this
    window.addEventListener('storage', function(e) {
      // 判断是影像界面 设置了数据  设置的key而且一定是'measureData' 防止其他界面操作localStorage 从而进入
      if (e.url.indexOf('baseLine') !== -1 && e.key === 'measureData') {
        const measureData = JSON.parse(e.newValue)
        const tpData = measureData[that.pageTPInfo.WorkloadCode]

        if (measureData) {
          that.imageDataHasUpdate = true
          that.imageLabelList = []

          tpData.forEach((t) => that.imageLabelList.push(t))

          that.handelImageLabelDataLogic(tpData)

          // 删除localStorage本次数据
          delete measureData[that.pageTPInfo.WorkloadCode]
          localStorage.setItem('measureData', JSON.stringify(measureData))
        }
      }
    })
  },
  methods: {
    nonTargetLesionStatusChange() {
      this.efficacyAssessment.Non_targetLesion = ''
      this.efficacyAssessment.OverallAssessment = ''
    },

    targetLesionAssessmentChange(selectValue) {
      // clear 操作   不用填写Note
      if (!selectValue) {
        this.efficacyAssessment.RequireTargetLesionNote = false
        return
      }

      // 当前访视 非淋巴结长径和
      let longNonlymphNodeTargetSum = 0
      // 基线   非淋巴结长径和
      let longBaseNonlymphNodeTargetSum = 0

      let nonLymphNodeTargetSelectCount = 0

      // 当前访视 巴结长径和
      let shortLymphNodeTargetSum = 0
      // 基线   淋巴结长径和
      let shortBaselymphNodeTargetSum = 0
      let lymphNodeTargetSelectCount = 0

      this.BLNonlymphNodeTargetList.forEach((element) => {
        if (element.CurrentLesion.TRORRES) {
          nonLymphNodeTargetSelectCount++
          longNonlymphNodeTargetSum += Number(element.CurrentLesion.TRORRES)
        }
        if (element.TRORRES) {
          longBaseNonlymphNodeTargetSum += Number(element.TRORRES)
        }
      })
      let allLymphNodeLessThan10 = true
      this.BLLymphNodeTargetList.forEach((element) => {
        if (element.CurrentLesion.TRORRES) {
          // 给基线选择了对应的病灶数量
          lymphNodeTargetSelectCount++
          shortLymphNodeTargetSum += Number(element.CurrentLesion.TRORRES)
          if (element.CurrentLesion.TRORRES >= 10) { allLymphNodeLessThan10 = false }
        }
        if (element.TRORRES) {
          shortBaselymphNodeTargetSum += Number(element.TRORRES)
        }
      })

      if (
        lymphNodeTargetSelectCount === 0 &&
        nonLymphNodeTargetSelectCount === 0 &&
        this.BLNonlymphNodeTargetList.length +
          this.BLLymphNodeTargetList.length >
          0
      ) {
        this.$alert(
          '基线有测量数据,当前未给基线的病灶选择访视数据,请确认',
          '提示',
          {
            confirmButtonText: '确定'
          }
        )
      }

      // 完全缓解 所有非结节靶病灶消失，即非结节靶病灶的长径总和为0mm；所有靶淋巴结病灶的短径必须减少至＜10 mm
      if (selectValue === 'CR') {
        if (longNonlymphNodeTargetSum > 0 || allLymphNodeLessThan10 === false) {
          this.$confirm(
            '完全缓解一般指的是：非结节靶病灶的长径总和为0mm、所有靶淋巴结病灶的短径必须减少至＜10 mm,坚持自己的选择？',
            '提示',
            {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }
          )
            .then(() => {
              this.efficacyAssessment.RequireTargetLesionNote = true
              this.$forceUpdate()
            })
            .catch(() => {
              this.efficacyAssessment.TargetLesion = ''
              this.efficacyAssessment.TargetLesionNote = ''
              this.efficacyAssessment.RequireTargetLesionNote = false
            })

          return
        }
      } else if (selectValue === 'PR') { // 靶病灶总径与基线相比减低至少30%
        const percent =
          (longBaseNonlymphNodeTargetSum +
            shortBaselymphNodeTargetSum -
            shortLymphNodeTargetSum -
            longNonlymphNodeTargetSum) /
          (longBaseNonlymphNodeTargetSum + shortBaselymphNodeTargetSum)
        if (percent < 0.3) {
          this.$confirm(
            '部分缓解一般指的是：靶病灶总径与基线相比减低至少30%. 当前为：' +
              (percent * 100).toFixed(2) +
              '%. 坚持自己的选择？',
            '提示',
            {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }
          )
            .then(() => {
              this.efficacyAssessment.RequireTargetLesionNote = true
              this.$forceUpdate()
            })
            .catch(() => {
              this.efficacyAssessment.TargetLesion = ''
              this.efficacyAssessment.TargetLesionNote = ''
              this.efficacyAssessment.RequireTargetLesionNote = false
            })
        }
      } else if (selectValue === 'PD') {
        // 疾病进展（PD）  以靶病灶直径之和的最小值为参照，直径和增加≥20%；且必须满足直径和的绝对值增加至少5 mm。
        const minPercent =
          (longBaseNonlymphNodeTargetSum +
            shortBaselymphNodeTargetSum -
            this.MinVisitInfo.MinSum) /
          this.MinVisitInfo.MinSum
        const min =
          longBaseNonlymphNodeTargetSum +
          shortBaselymphNodeTargetSum -
          this.MinVisitInfo.MinSum
        if (!(minPercent >= 0.2 && min > 5)) {
          this.$confirm(
            '疾病进展（PD）一般指的是：以靶病灶直径之和的最小值为参照，直径和增加≥20%；且必须满足直径和的绝对值增加至少5 mm. 当前直径和增加：' +
              minPercent * 100 +
              '%.坚持自己的选择？',
            '提示',
            {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }
          )
            .then(() => {
              this.efficacyAssessment.RequireTargetLesionNote = true
              this.$forceUpdate()
            })
            .catch(() => {
              this.efficacyAssessment.TargetLesion = ''
              this.efficacyAssessment.TargetLesionNote = ''
              this.efficacyAssessment.RequireTargetLesionNote = false
            })
        }
      } else if (selectValue === 'SD') {
        // 疾病稳定（SD）  介于PR及PD之间
        const percent =
          (longBaseNonlymphNodeTargetSum +
            shortBaselymphNodeTargetSum -
            shortLymphNodeTargetSum -
            longNonlymphNodeTargetSum) /
          (longBaseNonlymphNodeTargetSum + shortBaselymphNodeTargetSum)

        const minPercent =
          (longBaseNonlymphNodeTargetSum +
            shortBaselymphNodeTargetSum -
            this.MinVisitInfo.MinSum) /
          this.MinVisitInfo.MinSum
        const min =
          longBaseNonlymphNodeTargetSum +
          shortBaselymphNodeTargetSum -
          this.MinVisitInfo.MinSum

        if (!(percent < 0.3 || minPercent < 0.2 || min < 5)) {
          this.$confirm(
            '疾病稳定（SD）：介于PR及PD之间.坚持自己的选择？',
            '提示',
            {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }
          )
            .then(() => {
              this.efficacyAssessment.RequireTargetLesionNote = true
              this.$forceUpdate()
            })
            .catch(() => {
              this.efficacyAssessment.TargetLesion = ''
              this.efficacyAssessment.TargetLesionNote = ''
              this.efficacyAssessment.RequireTargetLesionNote = false
            })
        }
      }
      // 无充分的数据，又无法确定病情进展
      // else if (selectValue == 'NE') {
      // } else {
      // }
    },

    non_targetLesionAssessmentChange(selectValue) {
      // clear 操作   不用填写Note
      if (!selectValue) {
        this.efficacyAssessment.RequireNon_targetLesionNote = false
        return
      }

      let non_targetLesionSelectCount = 0
      this.BLNontargetLesionList.forEach((element) => {
        if (element.CurrentLesion.TRORRESU) non_targetLesionSelectCount++
      })

      if (non_targetLesionSelectCount !== this.BLNontargetLesionList.length) {
        this.$alert('当前未填写完基线的非靶病灶选择访视数据,请确认', '提示', {
          confirmButtonText: '确定'
        })
        return
      }

      if (this.BLNontargetLesionList.length > 0) {
        const disappearArray = this.BLNontargetLesionList.filter(
          (t) => t.CurrentLesion.TRORRESU === 'Disappear'
        ).map((obj, index) => {
          return obj.CurrentLesion.TRORRESU
        })

        // 完全缓解 所有非靶病灶消失，且肿瘤标记物恢复至正常水平。所有淋巴结无病理性意义（短径＜10 mm）
        if (selectValue === 'CR') {
          if (disappearArray.length !== this.BLNontargetLesionList.length) {
            this.$confirm(
              '完全缓解一般指的是：所有非靶病灶消失.坚持自己的选择？',
              '提示',
              {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
              }
            )
              .then(() => {
                this.efficacyAssessment.RequireNon_targetLesionNote = true
                this.$forceUpdate()
              })
              .catch(() => {
                this.efficacyAssessment.Non_targetLesion = ''
                this.efficacyAssessment.Non_targetLesionNote = ''
                this.efficacyAssessment.RequireNon_targetLesionNote = false
              })
          }
        } else if (selectValue === 'Non-CR/Non-PD') {
          // Non-CR/Non-PD  存在一个或多个非靶病灶和/或持续存在，肿瘤标记物水平超出正常水平。
          const existArray = this.BLNontargetLesionList.filter(
            (t) => t.CurrentLesion.TRORRESU === 'Exist'
          ).map((obj, index) => {
            return obj.CurrentLesion.TRORRESU
          })

          if (existArray.length < 1) {
            this.$confirm(
              '部分缓解一般指的是：存在一个或多个非靶病灶持续存在.坚持自己的选择？',
              '提示',
              {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
              }
            )
              .then(() => {
                this.efficacyAssessment.RequireNon_targetLesionNote = true
                this.$forceUpdate()
              })
              .catch(() => {
                this.efficacyAssessment.Non_targetLesion = ''
                this.efficacyAssessment.Non_targetLesionNote = ''
                this.efficacyAssessment.RequireNon_targetLesionNote = false
              })
          }
        } else if (selectValue === 'PD') {
          // 疾病进展（PD） 已存在的非靶病灶出现明确进展。
          const progressArray = this.BLNontargetLesionList.filter(
            (t) => t.CurrentLesion.TRORRESU === 'Identify progress'
          ).map((obj, index) => {
            return obj.CurrentLesion.TRORRESU
          })

          if (progressArray.length === 0) {
            this.$confirm(
              '疾病进展一般指的是：已存在的非靶病灶出现明确进展.坚持自己的选择？',
              '提示',
              {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
              }
            )
              .then(() => {
                this.efficacyAssessment.RequireNon_targetLesionNote = true
                this.$forceUpdate()
              })
              .catch(() => {
                this.efficacyAssessment.Non_targetLesion = ''
                this.efficacyAssessment.Non_targetLesionNote = ''
                this.efficacyAssessment.RequireNon_targetLesionNote = false
              })
          }
        }
        // 不可评估（NE）   无充分的数据，又无法确定病情进展
        // else if (selectValue == 'NE') {
        // } else {
        // }
      }
    },

    overallAssessmentChange(selectValue) {
      // clear 操作   不用填写Note
      if (!selectValue) {
        this.efficacyAssessment.RequireOverallAssessmentNote = false
        return
      }

      const hasNewLession = this.UnequivocalNewLesionList.length === 0

      // 有靶病灶
      if (
        this.BLNonlymphNodeTargetList.length +
          this.BLNontargetLesionList.length >
        0
      ) {
        if (
          !this.efficacyAssessment.Non_targetLesion ||
          !this.efficacyAssessment.TargetLesion
        ) {
          this.$alert(
            '请先选择靶病灶和非靶病灶评估结果后，再选择总体疗效',
            '提示',
            {
              confirmButtonText: '确定'
            }
          )
          this.efficacyAssessment.OverallAssessment = ''
          return
        }

        // 前两条 非靶病灶是Na 或者是CR
        if (
          this.efficacyAssessment.TargetLesion === 'CR' &&
          (this.BLNontargetLesionList.length === 0 ||
            this.efficacyAssessment.Non_targetLesion === 'CR') &&
          hasNewLession === false &&
          this.efficacyAssessment.OverallAssessment !== 'CR'
        ) {
          this.$confirm('按照规则,总体疗效应为CR.坚持自己的选择？', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          })
            .then(() => {
              this.efficacyAssessment.RequireOverallAssessmentNote = true
              this.$forceUpdate()
            })
            .catch(() => {
              this.efficacyAssessment.OverallAssessment = ''
              this.efficacyAssessment.OverallAssessmentNote = ''
              this.efficacyAssessment.RequireOverallAssessmentNote = false
            })
        }

        //  3-4条
        if (
          this.efficacyAssessment.TargetLesion === 'CR' &&
          (this.efficacyAssessment.Non_targetLesion === 'Non-CR/Non-PD' ||
            this.efficacyAssessment.Non_targetLesion === 'NE') &&
          hasNewLession === false &&
          this.efficacyAssessment.OverallAssessment !== 'PR'
        ) {
          this.$confirm('按照规则,总体疗效应为PR.坚持自己的选择？', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          })
            .then(() => {
              this.efficacyAssessment.RequireOverallAssessmentNote = true
              this.$forceUpdate()
            })
            .catch(() => {
              this.efficacyAssessment.OverallAssessment = ''
              this.efficacyAssessment.OverallAssessmentNote = ''
              this.efficacyAssessment.RequireOverallAssessmentNote = false
            })
        }

        //  5条
        if (
          this.efficacyAssessment.TargetLesion === 'PR' &&
          (this.efficacyAssessment.Non_targetLesion !== 'PD' ||
            this.efficacyAssessment.Non_targetLesion === 'NE') &&
          hasNewLession === false &&
          this.efficacyAssessment.OverallAssessment !== 'PR'
        ) {
          this.$confirm('按照规则,总体疗效应为PR.坚持自己的选择？', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          })
            .then(() => {
              this.efficacyAssessment.RequireOverallAssessmentNote = true
              this.$forceUpdate()
            })
            .catch(() => {
              this.efficacyAssessment.OverallAssessment = ''
              this.efficacyAssessment.OverallAssessmentNote = ''
              this.efficacyAssessment.RequireOverallAssessmentNote = false
            })
        }
        // 6
        if (
          this.efficacyAssessment.TargetLesion === 'SD' &&
          (this.efficacyAssessment.Non_targetLesion !== 'PD' ||
            this.efficacyAssessment.Non_targetLesion === 'NE') &&
          hasNewLession === false &&
          this.efficacyAssessment.OverallAssessment !== 'SD'
        ) {
          this.$confirm('按照规则,总体疗效应为SD.坚持自己的选择？', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          })
            .then(() => {
              this.efficacyAssessment.RequireOverallAssessmentNote = true
              this.$forceUpdate()
            })
            .catch(() => {
              this.efficacyAssessment.OverallAssessment = ''
              this.efficacyAssessment.OverallAssessmentNote = ''
              this.efficacyAssessment.RequireOverallAssessmentNote = false
            })
        }
        // 7
        if (
          this.efficacyAssessment.TargetLesion === 'NE' &&
          this.efficacyAssessment.Non_targetLesion !== 'PD' &&
          hasNewLession === false &&
          this.efficacyAssessment.OverallAssessment !== 'NE'
        ) {
          this.$confirm('按照规则,总体疗效应为NE.坚持自己的选择？', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          })
            .then(() => {
              this.efficacyAssessment.RequireOverallAssessmentNote = true
              this.$forceUpdate()
            })
            .catch(() => {
              this.efficacyAssessment.OverallAssessment = ''
              this.efficacyAssessment.OverallAssessmentNote = ''
              this.efficacyAssessment.RequireOverallAssessmentNote = false
            })
        }

        // 最后三条
        if (
          (this.efficacyAssessment.TargetLesion === 'PD' ||
            this.efficacyAssessment.Non_targetLesion === 'PD' ||
            hasNewLession) &&
          this.efficacyAssessment.OverallAssessment !== 'PD'
        ) {
          this.$confirm('按照规则,总体疗效应为PD.坚持自己的选择？', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          })
            .then(() => {
              this.efficacyAssessment.RequireOverallAssessmentNote = true
              this.$forceUpdate()
            })
            .catch(() => {
              this.efficacyAssessment.OverallAssessment = ''
              this.efficacyAssessment.OverallAssessmentNote = ''
              this.efficacyAssessment.RequireOverallAssessmentNote = false
            })
        }
      } else {
        // 无靶病灶
        if (!this.efficacyAssessment.Non_targetLesion) {
          this.$alert('请先选择非靶病灶评估结果后，再选择总体疗效', '提示', {
            confirmButtonText: '确定'
          })
          this.efficacyAssessment.OverallAssessment = ''
          return
        }

        if (
          this.efficacyAssessment.Non_targetLesion === 'CR' &&
          hasNewLession === false &&
          this.efficacyAssessment.OverallAssessment !== 'CR'
        ) {
          this.$confirm('按照规则,总体疗效应为CR.坚持自己的选择？', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          })
            .then(() => {
              this.efficacyAssessment.RequireOverallAssessmentNote = true
              this.$forceUpdate()
            })
            .catch(() => {
              this.efficacyAssessment.OverallAssessment = ''
              this.efficacyAssessment.OverallAssessmentNote = ''
              this.efficacyAssessment.RequireOverallAssessmentNote = false
            })
        }

        if (
          this.efficacyAssessment.Non_targetLesion === 'Non-CR/Non-PD' &&
          hasNewLession === false &&
          this.efficacyAssessment.OverallAssessment !== 'Non-CR/Non-PD'
        ) {
          this.$confirm(
            '按照规则,总体疗效应为Non-CR/Non-PD.坚持自己的选择？',
            '提示',
            {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }
          )
            .then(() => {
              this.efficacyAssessment.RequireOverallAssessmentNote = true
              this.$forceUpdate()
            })
            .catch(() => {
              this.efficacyAssessment.OverallAssessment = ''
              this.efficacyAssessment.OverallAssessmentNote = ''
              this.efficacyAssessment.RequireOverallAssessmentNote = false
            })
        }

        if (
          this.efficacyAssessment.Non_targetLesion === 'NE' &&
          hasNewLession === false &&
          this.efficacyAssessment.OverallAssessment !== 'NE'
        ) {
          this.$confirm('按照规则,总体疗效应为NE.坚持自己的选择？', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          })
            .then(() => {
              this.efficacyAssessment.RequireOverallAssessmentNote = true
              this.$forceUpdate()
            })
            .catch(() => {
              this.efficacyAssessment.OverallAssessment = ''
              this.efficacyAssessment.OverallAssessmentNote = ''
              this.efficacyAssessment.RequireOverallAssessmentNote = false
            })
        }

        // 表格倒数两个  当有新病灶或者 非靶病灶 是不能明确的PD 时候  总体评估是PD
        if (
          (hasNewLession || this.efficacyAssessment.Non_targetLesion === 'PD') &&
          this.efficacyAssessment.OverallAssessment !== 'PD'
        ) {
          this.$confirm('按照规则,总体疗效应为PD.坚持自己的选择？', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          })
            .then(() => {
              this.efficacyAssessment.RequireOverallAssessmentNote = true
              this.$forceUpdate()
            })
            .catch(() => {
              this.efficacyAssessment.OverallAssessment = ''
              this.efficacyAssessment.OverallAssessmentNote = ''
              this.efficacyAssessment.RequireOverallAssessmentNote = false
            })
        }
      }
    },

    // 处理填充下拉框数据 数据来源  1、影像界面推过来  2、 表单页面自己获取
    //  处理的逻辑包括  1、影像界面推过来时填写的Note 不被冲掉  2、 下拉框的禁用逻辑

    handelImageLabelDataLogic(imageData) {
      const that = this
      const tpData = imageData

      const lesionType1 = tpData.filter((t) => t.lesionType === 1)
      const lesionType2 = tpData.filter((t) => t.lesionType === 2)
      const lesionType3 = tpData.filter((t) => t.lesionType === 3)
      const lesionType4 = tpData.filter((t) => t.lesionType === 4)
      const lesionType5 = tpData.filter((t) => t.lesionType === 5)

      if (lesionType1.length > 0) {
        lesionType1.forEach((element) => {
          const location = element.lesionLocation.split('-')
          element.TRORRES = element.lesionValue.substring(
            0,
            element.lesionValue.length - 2
          )
          element.TULOC = location[0] || ''
          element.TULAT = location[1] || ''
          element.TUDIR = location[2] || ''
          element.HasSelected = false
        })
        that.VisitNonlymphNodeTargetList = lesionType1

        // 处理下拉款禁用逻辑
        that.VisitNonlymphNodeTargetList.forEach((el) => {
          that.BLNonlymphNodeTargetList.forEach((bL) => {
            if (
              bL.CurrentLesion.TRORRES &&
              bL.CurrentLesion.TRORRES === el.TRORRES
            ) {
              el.HasSelected = true
            }
          })
        })
      }

      if (lesionType2.length > 0) {
        lesionType2.forEach((element) => {
          const location = element.lesionLocation.split('-')
          element.TRORRES = element.lesionValue.substring(
            0,
            element.lesionValue.length - 2
          )
          element.TULOC = location[0] || ''
          element.TULAT = location[1] || ''
          element.TUDIR = location[2] || ''
          element.HasSelected = false
        })
        that.VisitLymphNodeTargetList = lesionType2

        // 处理下拉款禁用逻辑
        that.VisitLymphNodeTargetList.forEach((el) => {
          that.BLLymphNodeTargetList.forEach((bL) => {
            if (
              bL.CurrentLesion.TRORRES &&
              bL.CurrentLesion.TRORRES === el.TRORRES
            ) {
              el.HasSelected = true
            }
          })
        })
      }

      if (lesionType3.length > 0) {
        lesionType3.forEach((element) => {
          const location = element.lesionLocation.split('-')
          element.TULOC = location[0] || ''
          element.TULAT = location[1] || ''
          element.TUDIR = location[2] || ''
        })
        // that.BLNontargetLesionList = lesionType3
      }

      if (lesionType4.length > 0) {
        lesionType4.forEach((element) => {
          const location = element.lesionLocation.split('-')
          element.TULOC = location[0] || ''
          element.TULAT = location[1] || ''
          element.TUDIR = location[2] || ''
        })
        that.EquivocalNewLesionList = lesionType4
      }

      if (lesionType5.length > 0) {
        lesionType5.forEach((element) => {
          const location = element.lesionLocation.split('-')
          element.TULOC = location[0] || ''
          element.TULAT = location[1] || ''
          element.TUDIR = location[2] || ''
        })
        that.UnequivocalNewLesionList = lesionType5
      }
    },

    // 分裂或者添加 病灶得删除操作  --非淋巴结靶病灶
    handlenonlymphNodeTargetDelete(row) {
      this.BLNonlymphNodeTargetList = this.BLNonlymphNodeTargetList.filter(
        (t) => t.TULNKID !== row.TULNKID
      )
    },

    nonlymphNodeTargetCoveredLesionChange(currentLesion) {
      this.VisitNonlymphNodeTargetList.forEach((el) => {
        if (el.TRORRES === currentLesion.TRORRES) {
          el.HasSelected = false
        }
      })
      currentLesion.TRORRES = ''
      currentLesion.Note = ''
    },

    lymphNodeTargetCoveredLesionChange(currentLesion) {
      this.VisitLymphNodeTargetList.forEach((el) => {
        if (el.TRORRES === currentLesion.TRORRES) {
          el.HasSelected = false
        }
      })
      currentLesion.TRORRES = ''
      currentLesion.Note = ''
    },

    // 选择测量值得校验操作  --非淋巴结靶病灶
    nonlymphNodeTargetMeasurementChange(row) {
      this.efficacyAssessment.TargetLesion = ''
      this.efficacyAssessment.OverallAssessment = ''
      // 当选择了测量值的时候才进行验证
      if (row.CurrentLesion.TRORRES) {
        // 保留一份拷贝 当清除的时候清除下拉框状态
        row.CurrentLesion.TRORRESCopy = row.CurrentLesion.TRORRES

        const imageData = this.VisitNonlymphNodeTargetList.filter(
          (t) => t.TRORRES === row.CurrentLesion.TRORRES
        )[0]

        // 分裂和合并得不校验
        if (row.VISITNUM === this.pageTPInfo.VisitNum) {
          // 界面显示病灶位置
          row.TULOC = imageData.TULOC
          row.TULAT = imageData.TULAT
          row.TUDIR = imageData.TUDIR
        } else {
          if (
            row.TULOC !== imageData.TULOC ||
            row.TULAT !== imageData.TULAT ||
            row.TUDIR !== imageData.TUDIR
          ) {
            // 病灶部位何位置不一致，提示  确认 则设置已选择 不能选择了  否则，取消该选项
            this.$confirm(
              `BaseLine: ${
                row.TULOC + ' ' + row.TULAT + ' ' + row.TUDIR
              }  Current: ${
                imageData.TULOC + ' ' + imageData.TULAT + ' ' + imageData.TUDIR
              },confirm ?`,
              'tips',
              {
                confirmButtonText: 'Confirm',
                cancelButtonText: 'Cancel',
                type: 'warning'
              }
            )
              .then(() => {
                this.VisitNonlymphNodeTargetList.forEach((el) => {
                  if (el.TRORRES === row.CurrentLesion.TRORRES) {
                    el.HasSelected = true
                  }
                })
              })
              .catch(() => {
                row.CurrentLesion.TRORRES = ''
                this.VisitNonlymphNodeTargetList.forEach((el) => {
                  if (el.TRORRES === row.CurrentLesion.TRORRESCopy) {
                    el.HasSelected = false
                  }
                })
              })
          } else {
            this.VisitNonlymphNodeTargetList.forEach((el) => {
              if (el.TRORRES === row.CurrentLesion.TRORRES) {
                el.HasSelected = true
              }
            })
          }
        }
      } else {
        // 当取消测量值的时候 清除下拉框状态
        this.VisitNonlymphNodeTargetList.forEach((el) => {
          if (el.TRORRES === row.CurrentLesion.TRORRESCopy) {
            el.HasSelected = false
          }
        })
      }
      // 处理下拉款禁用逻辑   重新执行一遍（为了    下拉框切换的时候，不知道上一个值）
      this.VisitNonlymphNodeTargetList.forEach((el) => {
        el.HasSelected = false
        this.BLNonlymphNodeTargetList.forEach((bL) => {
          if (
            bL.CurrentLesion.TRORRES &&
            bL.CurrentLesion.TRORRES === el.TRORRES
          ) {
            el.HasSelected = true
          }
        })
      })
    },

    // 分裂按钮操作  --非淋巴结靶病灶
    nonlymphNodeTargetSplit() {
      // 数组中添加分裂的项目
      const count = parseInt(this.nonlymphNodeTargetSplitCount)

      if (count === 0 || count === 1) {
        return
      }

      // 分裂的项如果提前录入了数据 此时清空 然后禁用
      const splitItem = this.BLNonlymphNodeTargetList.filter(
        (t) => t.TUSEQ === this.nonlymphNodeTargetSelectArray[0]
      )[0]
      splitItem.CurrentLesion.CoveredLesion = ''
      splitItem.CurrentLesion.Note = ''
      splitItem.CurrentLesion.TRORRES = ''

      for (let index = 1; index <= count; index++) {
        this.BLNonlymphNodeTargetList.push({
          TULNKID: splitItem.TULNKID + '.' + index,
          TUGRPID: splitItem.TULNKID,
          VISITNUM: this.pageTPInfo.VisitNum,
          CurrentLesion: {
            Note: this.nonlymphNodeTargetSelectArray[0] + 'split' + index
          }
        })
      }

      this.nonlymphNodeTargetSplitCount = 0
      this.$refs.nonlymphNodeTargetBLTable.clearSelection()
    },

    // 合并按钮操作  --非淋巴结靶病灶
    nonlymphNodeTargetMerge() {
      const tULNKIDArray = []
      // 合并的项如果提前录入了数据 此时清空 然后禁用
      this.nonlymphNodeTargetSelectArray.forEach((element) => {
        const mergeItem = this.BLNonlymphNodeTargetList.filter(
          (t) => t.TUSEQ === element
        )[0]
        mergeItem.CurrentLesion.CoveredLesion = ''
        mergeItem.CurrentLesion.Note = ''
        mergeItem.CurrentLesion.TRORRES = ''
        tULNKIDArray.push(mergeItem.TULNKID)
      })

      // 数组中添加合并的项目
      this.BLNonlymphNodeTargetList.push({
        VISITNUM: this.pageTPInfo.VisitNum,
        TULNKID: tULNKIDArray.join('/'),
        CurrentLesion: {
          Note: this.nonlymphNodeTargetSelectArray.join('/') + 'Merge'
        }
      })

      this.$refs.nonlymphNodeTargetBLTable.clearSelection()
    },

    // 合并 分裂按钮禁用控制逻辑  --非淋巴结靶病灶
    handleNonlymphNodeTargetListSelectionChange(val) {
      const arr = []
      for (let index = 0; index < val.length; index++) {
        arr.push(val[index].TUSEQ)
      }
      this.nonlymphNodeTargetSelectArray = arr

      if (this.nonlymphNodeTargetSelectArray.length >= 2) {
        this.nonlymphNodeTargetSplitDisable = true
        this.nonlymphNodeTargetMergeDisable = false
      } else if (this.nonlymphNodeTargetSelectArray.length === 1) {
        this.nonlymphNodeTargetSplitDisable = false
        this.nonlymphNodeTargetMergeDisable = true
      } else {
        this.nonlymphNodeTargetSplitDisable = true
        this.nonlymphNodeTargetMergeDisable = true
      }
    },

    // 下拉框禁用逻辑  --非淋巴结靶病灶
    canNonlymphNodeTargetOpt(row) {
      let flag = true
      if (row.VISITNUM === this.pageTPInfo.VisitNum) {
        // 分裂或者合并的没有序号 不能勾选 防止合并或者分裂操作
        flag = false
      }

      this.NonlymphNodeTargetSplitOrMergeArray.forEach((t) => {
        if (t.TULNKID.indexOf(row.TULNKID) !== -1) {
          flag = false
        }
      })
      return flag
    },

    // 分裂或者添加 病灶得删除操作  --淋巴结靶病灶
    handlelymphNodeTargetDelete(row) {
      this.BLLymphNodeTargetList = this.BLLymphNodeTargetList.filter(
        (t) => t.TULNKID !== row.TULNKID
      )
    },

    // 选择测量值得校验操作  --淋巴结靶病灶
    lymphNodeTargetMeasurementChange(row) {
      this.efficacyAssessment.TargetLesion = ''
      this.efficacyAssessment.OverallAssessment = ''

      // 当选择了测量值的时候才进行验证
      if (row.CurrentLesion.TRORRES) {
        // 保留一份拷贝 当清除的时候清除下拉框状态
        row.CurrentLesion.TRORRESCopy = row.CurrentLesion.TRORRES
        const imageData = this.VisitLymphNodeTargetList.filter(
          (t) => t.TRORRES === row.CurrentLesion.TRORRES
        )[0]

        // 分裂和合并得不校验
        if (row.VISITNUM === this.pageTPInfo.VisitNum) {
          // 界面显示病灶位置
          row.TULOC = imageData.TULOC
          row.TULAT = imageData.TULAT
          row.TUDIR = imageData.TUDIR
        } else {
          if (
            row.TULOC !== imageData.TULOC ||
            row.TULAT !== imageData.TULAT ||
            row.TUDIR !== imageData.TUDIR
          ) {
            // 病灶部位何位置不一致，提示  确认 则设置已选择 不能选择了  否则，取消该选项
            this.$confirm(
              `BaseLine: ${
                row.TULOC + ' ' + row.TULAT + ' ' + row.TUDIR
              }  Current: ${
                imageData.TULOC + ' ' + imageData.TULAT + ' ' + imageData.TUDIR
              },confirm ?`,
              'tips',
              {
                confirmButtonText: 'Confirm',
                cancelButtonText: 'Cancel',
                type: 'warning'
              }
            )
              .then(() => {
                this.VisitLymphNodeTargetList.forEach((el) => {
                  if (el.TRORRES === row.CurrentLesion.TRORRES) {
                    el.HasSelected = true
                  }
                })
                return
              })
              .catch(() => {
                row.CurrentLesion.TRORRES = ''
                this.VisitLymphNodeTargetList.forEach((el) => {
                  if (el.TRORRES === row.CurrentLesion.TRORRESCopy) {
                    el.HasSelected = false
                  }
                })
                return
              })
          } else {
            this.VisitLymphNodeTargetList.forEach((el) => {
              if (el.TRORRES === row.CurrentLesion.TRORRES) {
                el.HasSelected = true
              }
            })
          }
        }
      } else {
        // 当取消测量值的时候 清除下拉框状态
        this.VisitLymphNodeTargetList.forEach((el) => {
          if (el.TRORRES === row.CurrentLesion.TRORRESCopy) {
            el.HasSelected = false
          }
        })
      }

      // 处理下拉款禁用逻辑   重新执行一遍（为了    下拉框切换的时候，不知道上一个值）
      this.VisitLymphNodeTargetList.forEach((el) => {
        el.HasSelected = false
        this.BLLymphNodeTargetList.forEach((bL) => {
          if (
            bL.CurrentLesion.TRORRES &&
            bL.CurrentLesion.TRORRES === el.TRORRES
          ) {
            el.HasSelected = true
          }
        })
      })
    },

    // 淋巴结靶病灶 --分裂按钮操作
    lymphNodeTargetSplit() {
      // 数组中添加分裂的项目
      const count = parseInt(this.lymphNodeTargetSplitCount)

      if (count === 0 || count === 1) {
        return
      }

      // 分裂的项如果提前录入了数据 此时清空 然后禁用
      const splitItem = this.BLLymphNodeTargetList.filter(
        (t) => t.TUSEQ === this.lymphNodeTargetSelectArray[0]
      )[0]
      splitItem.CurrentLesion.CoveredLesion = ''
      splitItem.CurrentLesion.Note = ''
      splitItem.CurrentLesion.TRORRES = ''

      for (let index = 1; index <= count; index++) {
        this.BLLymphNodeTargetList.push({
          VISITNUM: this.pageTPInfo.VisitNum,
          TULNKID: splitItem.TULNKID + '.' + index,
          TUGRPID: splitItem.TULNKID,
          CurrentLesion: {
            Note: this.lymphNodeTargetSelectArray[0] + 'split' + index
          }
        })
      }

      this.lymphNodeTargetSplitCount = 0
      this.$refs.lymphNodeTargetBLTable.clearSelection()
    },

    // 淋巴结靶病灶 -- 合并按钮操作
    lymphNodeTargetMerge() {
      const tULNKIDArray = []

      // 合并的项如果提前录入了数据 此时清空 然后禁用
      this.lymphNodeTargetSelectArray.forEach((element) => {
        const mergeItem = this.BLLymphNodeTargetList.filter(
          (t) => t.TUSEQ === element
        )[0]
        mergeItem.CurrentLesion.CoveredLesion = ''
        mergeItem.CurrentLesion.Note = ''
        mergeItem.CurrentLesion.TRORRES = ''

        tULNKIDArray.push(mergeItem.TULNKID)
      })

      // 数组中添加合并的项目
      this.BLLymphNodeTargetList.push({
        VISITNUM: this.pageTPInfo.VisitNum,
        TULNKID: tULNKIDArray.join('/'),
        CurrentLesion: {
          Note: this.lymphNodeTargetSelectArray.join('/') + 'Merge'
        }
      })

      this.$refs.lymphNodeTargetBLTable.clearSelection()
    },

    // 淋巴结靶病灶-- 合并 分裂按钮禁用控制逻辑
    handleLymphNodeTargetListSelectionChange(val) {
      const arr = []
      for (let index = 0; index < val.length; index++) {
        arr.push(val[index].TUSEQ)
      }
      this.lymphNodeTargetSelectArray = arr

      if (this.lymphNodeTargetSelectArray.length >= 2) {
        this.lymphNodeTargetSplitDisable = true
        this.lymphNodeTargetMergeDisable = false
      } else if (this.lymphNodeTargetSelectArray.length === 1) {
        this.lymphNodeTargetSplitDisable = false
        this.lymphNodeTargetMergeDisable = true
      } else {
        this.lymphNodeTargetSplitDisable = true
        this.lymphNodeTargetMergeDisable = true
      }
    },

    // 淋巴结靶病灶 -- 下拉框禁用逻辑
    canLymphNodeTargetOpt(row) {
      let flag = true
      if (row.VISITNUM === this.pageTPInfo.VisitNum) {
        // 分裂或者合并的没有序号 不能勾选 防止合并或者分裂操作
        flag = false
      }

      this.LymphNodeTargetSplitOrMergeArray.forEach((t) => {
        if (t.TULNKID.indexOf(row.TULNKID) !== -1) {
          flag = false
        }
      })
      return flag
    },

    submiteReport() {
      submiteReport(this.pageTPInfo.WorkloadId).then((res) => {
        this.$message.success('Report saved successfully')
        this.isReportSaved = true
      })
    },

    saveImageLabel() {
      const param = {}
      param.TpCode = this.pageTPInfo.WorkloadCode
      param.ImageLabelList = []
      this.imageLabelList.forEach((element) => {
        param.ImageLabelList.push({
          StudyId: this.pageTPInfo.StudyId,
          LabelValue: JSON.stringify(element),
          SeriesId: element.seriesId,
          InstanceId: element.instanceId
        })
      })

      saveImageLabelList(param).then((res) => {
        this.imageDataHasUpdate = false
        this.$message.success('saved imgeLable successfully')
      })
    },

    // 非靶病灶 end
    addVistLine() {
      const that = this

      let a = true
      let b = true
      let c = true

      this.$refs.qualifiedForm.validate((valid) => {
        if (!valid) {
          a = false
          return
        }
      })

      this.$refs.commentsForm.validate((valid) => {
        if (!valid) {
          b = false
          return
        }
      })

      this.$refs.efficacyAssessmentForm.validate((valid) => {
        if (!valid) {
          c = false
          return
        }
      })

      if (a && b && c) {
        // 纯粹的测量信息 tr
        const postTRArray = []

        // 分裂或者合并的 tu tr信息
        const lessionArray = []
        this.BLNonlymphNodeTargetList.forEach((element) => {
          // 非淋巴结靶病灶
          // 属于新病灶
          if (element.VISITNUM === this.pageTPInfo.VisitNum) {
            lessionArray.push({
              LesionType: 1, // 病灶类型
              STUDYID: this.pageTPInfo.TrialCode, // 项目Id
              USUBJID: this.pageTPInfo.SubjectCode, // 受试者Id
              TUSPID: this.pageTPInfo.Sponsor,
              //  TUSEQ="" //病灶序号 不传递
              TUGRPID: element.TUGRPID, // 病灶分组
              // TUREFID:"" //医学影像 ID
              TULNKID: element.TULNKID, // 关联测量结果，及TUGRPID一起，标识分裂及合并
              TUTESTCD: 'TUMIDENT',
              TUTEST: 'Tumor Identification',
              TUORRES: 'TARGET', // 标识结果 1：target 2：None target 3： New
              TUSTRESC: 'TARGET',
              TUNAM: 'zhizhun', // /完成肿瘤标识的供应商名称或标识
              LocDescription: element.LocDescription, // 部位描述
              TULOC: element.TULOC, // 解剖学位置
              TULAT: element.TULAT, // 左侧 右侧。。。
              TUDIR: element.TUDIR, // 方向
              TUPORTOT: '', // 更详细的分布，安排，分配的修饰语， 比如，全部的，单一的，部分的，多数的。
              TUMETHOD: '', // 标识肿瘤的方法
              TUEVAL: '', // 评估者的角色。 例如：研究者，独立评估者。
              TUEVALID: '', // 这个特定的评估者变量是与 TUEVAL一起使用来提供更详 细的信息
              TUACPTFL: '', // 双人阅片  这个标帜用来认定能够被接受的一条评估记录。
              VISITNUM: this.pageTPInfo.VisitNum,
              VISIT: this.pageTPInfo.VisitName,
              VISITDY: 0,
              EPOCH: '', // 时期
              TUDTC: '', // 检查日期
              TUDY: 0, // 检查日
              TRTESTCD: '', // 检查简称
              TRTEST: '', // 检查项名称
              TRORRES: element.CurrentLesion.TRORRES, // 原始结果
              TRORRESU: '', // 原始单位
              TRSTRESC: '', // 标准化结果
              TRSTRESN: 0, // 标准化结果（N）
              TRSTRESU: '', // // 标准化单位
              TRSTAT: '', // 未做状态
              TRREASND: '', // 未做原因
              Note: element.CurrentLesion.Note,
              TRGRPID: '', // 用于关联域内同一受试者的一组相关记录
              TRDTC: '', // 检查日期
              TRDY: 0, // 检查日
              CoveredLesion: element.CurrentLesion.CoveredLesion
            })
          } else if (
            element.VISITNUM !== this.pageTPInfo.VisitNum &&
            element.CurrentLesion.CoveredLesion
          ) {
            postTRArray.push({
              STUDYID: this.pageTPInfo.TrialCode, // 项目Id
              TRSPID: this.pageTPInfo.Sponsor,
              DOMAIN: '',
              USUBJID: this.pageTPInfo.SubjectCode, // 受试者Id
              // TRSEQ: "",
              TRGRPID: '',
              TRREFID: '', // 内部或外部的肿瘤/病灶标识
              TRLNKID: element.TULNKID, // 链接在肿瘤/病灶标识域（TU）内单一肿瘤的标识记录结果的标识符
              TRLNKGRP: '', // 用于组合/链接所用于RS 域中的疗效评估记录的测量/评估
              TRTESTCD: '', // 检查项简称
              TRTEST: '', // 检查项名称
              TRORRES: element.CurrentLesion.TRORRES, // 原始结果
              TRORRESU: element.CurrentLesion.TRORRESU, // 原始单位

              TRSTRESC: '', // 标准化结果
              TRSTRESN: 0, // 标准化结果N
              TRSTRESU: '', // 标准化单位
              TRSTAT: '', // 未作状态
              TRREASND: '', // 未作原因
              TRNAM: '', // 供应商名称
              TRMETHOD: '', // 检查方法
              TREVAL: '', // 评估者
              TREVALID: '', // 评估者标识符
              TRACPTFL: '', // 这个标帜用来认定能够被接受的一条评估记录
              VISITNUM: this.pageTPInfo.VisitNum,
              VISIT: this.pageTPInfo.VisitName,
              VISITDY: 0,
              EPOCH: '', // 时期
              TRDTC: '', // 检查日期
              TRDY: 0, // 检查日
              Note: element.CurrentLesion.Note,
              CoveredLesion: element.CurrentLesion.CoveredLesion
            })
          }
        })

        this.BLLymphNodeTargetList.forEach((element) => {
          // 淋巴结靶病灶
          // 1、新病灶
          if (element.VISITNUM === this.pageTPInfo.VisitNum) {
            lessionArray.push({
              LesionType: 2, // 病灶类型
              STUDYID: this.pageTPInfo.TrialCode, // 项目Id
              USUBJID: this.pageTPInfo.SubjectCode, // 受试者Id
              TUSPID: this.pageTPInfo.Sponsor,
              //  TUSEQ="" //病灶序号 不传递
              TUGRPID: element.TUGRPID, // 病灶分组
              // TUREFID:"" //医学影像 ID
              TULNKID: element.TULNKID, // 关联测量结果，及TUGRPID一起，标识分裂及合并
              TUTESTCD: 'TUMIDENT',
              TUTEST: 'Tumor Identification',
              TUORRES: 'TARGET', // 标识结果 1：target 2：None target 3： New
              TUSTRESC: 'TARGET',
              TUNAM: 'zhizhun', // /完成肿瘤标识的供应商名称或标识
              LocDescription: element.LocDescription, // 部位描述
              TULOC: element.TULOC, // 解剖学位置
              TULAT: element.TULAT, // 左侧 右侧。。。
              TUDIR: element.TUDIR, // 方向
              TUPORTOT: '', // 更详细的分布，安排，分配的修饰语， 比如，全部的，单一的，部分的，多数的。
              TUMETHOD: '', // 标识肿瘤的方法
              TUEVAL: '', // 评估者的角色。 例如：研究者，独立评估者。
              TUEVALID: '', // 这个特定的评估者变量是与 TUEVAL一起使用来提供更详 细的信息
              TUACPTFL: '', // 双人阅片  这个标帜用来认定能够被接受的一条评估记录。
              VISITNUM: this.pageTPInfo.VisitNum,
              VISIT: this.pageTPInfo.VisitName,
              VISITDY: 0,
              EPOCH: '', // 时期
              TUDTC: '', // 检查日期
              TUDY: 0, // 检查日
              TRTESTCD: '', // 检查简称
              TRTEST: '', // 检查项名称
              TRORRES: element.CurrentLesion.TRORRES, // 原始结果
              TRORRESU: '', // 原始单位
              TRSTRESC: '', // 标准化结果
              TRSTRESN: 0, // 标准化结果（N）
              TRSTRESU: '', // // 标准化单位
              TRSTAT: '', // 未做状态
              TRREASND: '', // 未做原因
              Note: element.CurrentLesion.Note,
              TRGRPID: '', // 用于关联域内同一受试者的一组相关记录
              TRDTC: '', // 检查日期
              TRDY: 0, // 检查日
              CoveredLesion: element.CurrentLesion.CoveredLesion
            })
          } else if (
            element.VISITNUM !== this.pageTPInfo.VisitNum &&
            element.CurrentLesion.CoveredLesion
          ) {
            postTRArray.push({
              STUDYID: this.pageTPInfo.TrialCode, // 项目Id
              TRSPID: this.pageTPInfo.Sponsor,
              DOMAIN: '',
              USUBJID: this.pageTPInfo.SubjectCode, // 受试者Id
              // TRSEQ: "",
              TRGRPID: '',
              TRREFID: '', // 内部或外部的肿瘤/病灶标识
              TRLNKID: element.TULNKID, // 链接在肿瘤/病灶标识域（TU）内单一肿瘤的标识记录结果的标识符
              TRLNKGRP: '', // 用于组合/链接所用于RS 域中的疗效评估记录的测量/评估
              TRTESTCD: '', // 检查项简称
              TRTEST: '', // 检查项名称
              TRORRES: element.CurrentLesion.TRORRES, // 原始结果
              TRORRESU: element.CurrentLesion.TRORRESU, // 原始单位

              TRSTRESC: '', // 标准化结果
              TRSTRESN: 0, // 标准化结果N
              TRSTRESU: '', // 标准化单位
              TRSTAT: '', // 未作状态
              TRREASND: '', // 未作原因
              TRNAM: '', // 供应商名称
              TRMETHOD: '', // 检查方法
              TREVAL: '', // 评估者
              TREVALID: '', // 评估者标识符
              TRACPTFL: '', // 这个标帜用来认定能够被接受的一条评估记录
              VISITNUM: this.pageTPInfo.VisitNum,
              VISIT: this.pageTPInfo.VisitName,
              VISITDY: 0,
              EPOCH: '', // 时期
              TRDTC: '', // 检查日期
              TRDY: 0, // 检查日
              Note: element.CurrentLesion.Note,
              CoveredLesion: element.CurrentLesion.CoveredLesion
            })
          }
        })

        // 非靶病灶
        this.BLNontargetLesionList.forEach((element) => {
          postTRArray.push({
            STUDYID: this.pageTPInfo.TrialCode, // 项目Id
            TRSPID: this.pageTPInfo.Sponsor,
            DOMAIN: '',
            USUBJID: this.pageTPInfo.SubjectCode, // 受试者Id
            // TRSEQ: "",
            TRGRPID: '',
            TRREFID: '', // 内部或外部的肿瘤/病灶标识
            TRLNKID: element.TULNKID, // 链接在肿瘤/病灶标识域（TU）内单一肿瘤的标识记录结果的标识符
            TRLNKGRP: '', // 用于组合/链接所用于RS 域中的疗效评估记录的测量/评估
            TRTESTCD: '', // 检查项简称
            TRTEST: '', // 检查项名称
            TRORRES: element.CurrentLesion.TRORRES, // 原始结果
            TRORRESU: element.CurrentLesion.TRORRESU, // 原始单位

            TRSTRESC: '', // 标准化结果
            TRSTRESN: 0, // 标准化结果N
            TRSTRESU: '', // 标准化单位
            TRSTAT: '', // 未作状态
            TRREASND: '', // 未作原因
            TRNAM: '', // 供应商名称
            TRMETHOD: '', // 检查方法
            TREVAL: '', // 评估者
            TREVALID: '', // 评估者标识符
            TRACPTFL: '', // 这个标帜用来认定能够被接受的一条评估记录
            VISITNUM: this.pageTPInfo.VisitNum,
            VISIT: this.pageTPInfo.VisitName,
            VISITDY: 0,
            EPOCH: '', // 时期
            TRDTC: '', // 检查日期
            TRDY: 0, // 检查日
            Note: element.CurrentLesion.Note
          })
        })

        // PreviousNewLesionList
        this.PreviousNewLesionList.forEach((element) => {
          postTRArray.push({
            STUDYID: this.pageTPInfo.TrialCode, // 项目Id
            TRSPID: this.pageTPInfo.Sponsor,
            DOMAIN: '',
            USUBJID: this.pageTPInfo.SubjectCode, // 受试者Id
            // TRSEQ: "",
            TRGRPID: '',
            TRREFID: '', // 内部或外部的肿瘤/病灶标识
            TRLNKID: element.TULNKID, // 链接在肿瘤/病灶标识域（TU）内单一肿瘤的标识记录结果的标识符
            TRLNKGRP: '', // 用于组合/链接所用于RS 域中的疗效评估记录的测量/评估
            TRTESTCD: '', // 检查项简称
            TRTEST: '', // 检查项名称
            TRORRES: element.CurrentLesion.TRORRES, // 原始结果
            TRORRESU: element.CurrentLesion.TRORRESU, // 原始单位

            TRSTRESC: '', // 标准化结果
            TRSTRESN: 0, // 标准化结果N
            TRSTRESU: '', // 标准化单位
            TRSTAT: '', // 未作状态
            TRREASND: '', // 未作原因
            TRNAM: '', // 供应商名称
            TRMETHOD: '', // 检查方法
            TREVAL: '', // 评估者
            TREVALID: '', // 评估者标识符
            TRACPTFL: '', // 这个标帜用来认定能够被接受的一条评估记录
            VISITNUM: this.pageTPInfo.VisitNum,
            VISIT: this.pageTPInfo.VisitName,
            VISITDY: 0,
            EPOCH: '', // 时期
            TRDTC: '', // 检查日期
            TRDY: 0, // 检查日
            Note: element.CurrentLesion.Note
          })
        })

        // Equivocal New Lesion
        this.EquivocalNewLesionList.forEach((element) => {
          lessionArray.push({
            LesionType: 4, // 病灶类型
            STUDYID: this.pageTPInfo.TrialCode, // 项目Id
            USUBJID: this.pageTPInfo.SubjectCode, // 受试者Id
            TUSPID: this.pageTPInfo.Sponsor,
            //  TUSEQ="" //病灶序号 不传递
            TUGRPID: element.TUGRPID, // 病灶分组
            // TUREFID:"" //医学影像 ID
            TULNKID: element.TULNKID, // 关联测量结果，及TUGRPID一起，标识分裂及合并
            TUTESTCD: 'TUMIDENT',
            TUTEST: 'Tumor Identification',
            TUORRES: '', // 标识结果 1：target 2：None target 3： New
            TUSTRESC: '',
            TUNAM: '', // /完成肿瘤标识的供应商名称或标识
            LocDescription: element.LocDescription, // 部位描述
            TULOC: element.TULOC, // 解剖学位置
            TULAT: element.TULAT, // 左侧 右侧。。。
            TUDIR: element.TUDIR, // 方向
            TUPORTOT: '', // 更详细的分布，安排，分配的修饰语， 比如，全部的，单一的，部分的，多数的。
            TUMETHOD: '', // 标识肿瘤的方法
            TUEVAL: '', // 评估者的角色。 例如：研究者，独立评估者。
            TUEVALID: '', // 这个特定的评估者变量是与 TUEVAL一起使用来提供更详 细的信息
            TUACPTFL: '', // 双人阅片  这个标帜用来认定能够被接受的一条评估记录。
            VISITNUM: this.pageTPInfo.VisitNum,
            VISIT: this.pageTPInfo.VisitName,
            VISITDY: 0,
            EPOCH: '', // 时期
            TUDTC: '', // 检查日期
            TUDY: 0, // 检查日
            TRTESTCD: '', // 检查简称
            TRTEST: '', // 检查项名称
            TRORRES: element.TRORRES, // 原始结果
            TRORRESU: '', // 原始单位
            TRSTRESC: '', // 标准化结果
            TRSTRESN: 0, // 标准化结果（N）
            TRSTRESU: '', // // 标准化单位
            TRSTAT: '', // 未做状态
            TRREASND: '', // 未做原因
            Note: element.Note,
            TRGRPID: '', // 用于关联域内同一受试者的一组相关记录
            TRDTC: '', // 检查日期
            TRDY: 0 // 检查日
          })
        })

        // Unequivocal New Lesion
        this.UnequivocalNewLesionList.forEach((element) => {
          lessionArray.push({
            LesionType: 5, // 病灶类型
            STUDYID: this.pageTPInfo.TrialCode, // 项目Id
            USUBJID: this.pageTPInfo.SubjectCode, // 受试者Id
            TUSPID: this.pageTPInfo.Sponsor,
            //  TUSEQ="" //病灶序号 不传递
            TUGRPID: element.TUGRPID, // 病灶分组
            // TUREFID:"" //医学影像 ID
            TULNKID: element.TULNKID, // 关联测量结果，及TUGRPID一起，标识分裂及合并
            TUTESTCD: 'TUMIDENT',
            TUTEST: 'Tumor Identification',
            TUORRES: '', // 标识结果 1：target 2：None target 3： New
            TUSTRESC: '',
            TUNAM: '', // /完成肿瘤标识的供应商名称或标识
            LocDescription: element.LocDescription, // 部位描述
            TULOC: element.TULOC, // 解剖学位置
            TULAT: element.TULAT, // 左侧 右侧。。。
            TUDIR: element.TUDIR, // 方向
            TUPORTOT: '', // 更详细的分布，安排，分配的修饰语， 比如，全部的，单一的，部分的，多数的。
            TUMETHOD: '', // 标识肿瘤的方法
            TUEVAL: '', // 评估者的角色。 例如：研究者，独立评估者。
            TUEVALID: '', // 这个特定的评估者变量是与 TUEVAL一起使用来提供更详 细的信息
            TUACPTFL: '', // 双人阅片  这个标帜用来认定能够被接受的一条评估记录。
            VISITNUM: this.pageTPInfo.VisitNum,
            VISIT: this.pageTPInfo.VisitName,
            VISITDY: 0,
            EPOCH: '', // 时期
            TUDTC: '', // 检查日期
            TUDY: 0, // 检查日
            TRTESTCD: '', // 检查简称
            TRTEST: '', // 检查项名称
            TRORRES: element.TRORRES, // 原始结果
            TRORRESU: '', // 原始单位
            TRSTRESC: '', // 标准化结果
            TRSTRESN: 0, // 标准化结果（N）
            TRSTRESU: '', // // 标准化单位
            TRSTAT: '', // 未做状态
            TRREASND: '', // 未做原因
            Note: element.Note,
            TRGRPID: '', // 用于关联域内同一受试者的一组相关记录
            TRDTC: '', // 检查日期
            TRDY: 0 // 检查日
          })
        })

        // Efficacy Assessment
        const rsArray = []
        const efficacyAssessmentTarget = {
          StudyGuid: this.pageTPInfo.StudyId,
          TrialGuid: this.pageTPInfo.TrialId,
          SubjectGuid: this.pageTPInfo.SubjectId,

          STUDYID: this.pageTPInfo.TrialCode, // 项目Id
          DOMAIN: '',
          USUBJID: this.pageTPInfo.SubjectCode, // 受试者Id
          // RSSEQ: "",
          RSGRPID: '',
          RSREFID: '', // 内部或外部的肿瘤/病灶标识,
          RSSPID: this.pageTPInfo.Sponsor, // 申办者定义的参考编码。
          RSLNKID: '', // 用来把相同肿瘤的为了决定反应结果的（在肿瘤/病灶测量域中的）适当测量记录与对反应的评估链接起来。
          RSLNKGRP: '', // 用于链接肿瘤疗效评估与TR 域中相关测量/评估记录。
          RSTESTCD: 'TRGRESP', // 评估项简称
          RSTEST: 'Target Response', // 评估项名称
          RSCAT: '', // 类别
          RSORRES: this.efficacyAssessment.TargetLesion, // 原始结果
          RSSTRESC: this.efficacyAssessment.TargetLesion, // 标准化结果
          RSSTAT: '', // 未作状态
          RSREASND: '', // 未作原因
          RSNAM: '', // 实验室/供应商名称
          RSEVAL: '', // 评估者
          RSEVALID: '', // 评估者标识符
          RSACPTFL: '', // 记录接受标帜
          VISITNUM: this.pageTPInfo.VisitNum,
          VISIT: this.pageTPInfo.VisitName,
          VISITDY: 0,
          EPOCH: '', // 时期
          RSDTC: '', // 检查日期/时间
          RSDY: 0 // 检查日
        }

        const efficacyAssessmentNontarget = JSON.parse(
          JSON.stringify(efficacyAssessmentTarget)
        )
        efficacyAssessmentTarget.Note = this.efficacyAssessment.TargetLesionNote

        efficacyAssessmentNontarget.RSTESTCD = 'NTRGRESP'
        efficacyAssessmentNontarget.RSTEST = 'Non-target Response'
        efficacyAssessmentNontarget.RSORRES = this.efficacyAssessment.Non_targetLesion
        efficacyAssessmentNontarget.RSSTRESC = this.efficacyAssessment.Non_targetLesion
        efficacyAssessmentNontarget.Note = this.efficacyAssessment.Non_targetLesionNote

        const efficacyAssessmentOverall = JSON.parse(
          JSON.stringify(efficacyAssessmentTarget)
        )
        efficacyAssessmentOverall.RSTESTCD = 'OVRLRESP'
        efficacyAssessmentOverall.RSTEST = 'Overall Response'
        efficacyAssessmentOverall.RSORRES = this.efficacyAssessment.OverallAssessment
        efficacyAssessmentOverall.RSSTRESC = this.efficacyAssessment.OverallAssessment
        efficacyAssessmentOverall.Note = this.efficacyAssessment.OverallAssessmentNote

        rsArray.push(efficacyAssessmentTarget)
        rsArray.push(efficacyAssessmentNontarget)
        rsArray.push(efficacyAssessmentOverall)

        // Measurements Calculation
        const calculation = {
          STUDYID: this.pageTPInfo.TrialCode, // 项目Id
          TRSPID: this.pageTPInfo.Sponsor,
          DOMAIN: '',
          USUBJID: this.pageTPInfo.SubjectCode, // 受试者Id
          TRGRPID: '',
          TRREFID: '', // 内部或外部的肿瘤/病灶标识
          TRLNKID: '', // 链接在肿瘤/病灶标识域（TU）内单一肿瘤的标识记录结果的标识符
          TRLNKGRP: '', // 用于组合/链接所用于RS 域中的疗效评估记录的测量/评估
          TRTESTCD: '', // 检查项简称
          TRTEST: '', // 检查项名称
          TRORRES: '', // 原始结果
          TRORRESU: '', // 原始单位

          TRSTRESC: '', // 标准化结果
          TRSTRESN: 0, // 标准化结果N
          TRSTRESU: '', // 标准化单位
          TRSTAT: '', // 未作状态
          TRREASND: '', // 未作原因
          TRNAM: '', // 供应商名称
          TRMETHOD: '', // 检查方法
          TREVAL: '', // 评估者
          TREVALID: '', // 评估者标识符
          TRACPTFL: '', // 这个标帜用来认定能够被接受的一条评估记录
          VISITNUM: this.pageTPInfo.VisitNum,
          VISIT: this.pageTPInfo.VisitName,
          VISITDY: 0,
          EPOCH: '', // 时期
          TRDTC: '', // 检查日期
          TRDY: 0, // 检查日
          Note: ''
        }

        const SumOfDiameterCalculation = JSON.parse(JSON.stringify(calculation))
        SumOfDiameterCalculation.TRTEST = 'Sum of Diameter'
        SumOfDiameterCalculation.TRTESTCD = 'SUMDIAM'
        SumOfDiameterCalculation.TRORRES = this.SumOfDiameter

        const NonnodularLesionsSODCalculation = JSON.parse(
          JSON.stringify(calculation)
        )
        NonnodularLesionsSODCalculation.TRTEST =
          'Sum Diameters of Non Lymph NodeTumors'
        NonnodularLesionsSODCalculation.TRTESTCD = 'SUMNLNLD'
        NonnodularLesionsSODCalculation.TRORRES = this.NonnodularLesionsSOD

        postTRArray.push(SumOfDiameterCalculation)
        postTRArray.push(NonnodularLesionsSODCalculation)

        this.$confirm('Sure fill in all the information?', {
          type: 'warning',
          distinguishCancelAndClose: true,
          confirmButtonText: 'Ok',
          cancelButtonText: 'Cancel'
        }).then(() => {
          saveVisitReport({
            LesionInformation: lessionArray,
            TrList: postTRArray,
            ReportResult: this.reportResult,
            RSList: rsArray,
            PreviousOverallAssessment: this.previousOverallAssessment
          }).then((res) => {
            // this.isReportSaved = true
            this.$message.success('added successfully')
          })
        })

        if (that.imageDataHasUpdate) {
          that.saveImageLabel()
        }
      }
    }
  }
}
</script>
<style lang="scss">
.ImageReviewTask-list {
  height: 100%;

  .el-collapse-item.is-disabled .el-collapse-item__header {
    color: black;
    font-weight: bold;
  }

  .el-collapse-item__header {
    background-color: #f0f0f0;
    height: 40px;
    line-height: 50px;
    padding: 0 5px;
  }
  .el-collapse-item__wrap {
    padding: 0 5px;
  }
  .el-collapse {
    margin-bottom: 100px;
  }
  .toolbar {
    margin: 5px 0px;
    .mr {
      margin-right: 5px;
      width: 130px;
    }
  }

  #footer {
    position: fixed;
    bottom: 30px;
    width: 100%;
    // height: 30px; /*脚部的高度*/
    // background: #6cf;
    clear: both;
  }
}
</style>

