11
WXL
2023-10-31 be42af700f901f496db68d97ab46e2c1d4bef85a
src/views/project/donationdetails/index.vue
@@ -4,51 +4,157 @@
      <div class="postfilx">
        <div class="title">工作进程</div>
        <div style="height: 666px;">
          <el-steps direction="vertical" :active="3">
          <el-steps direction="vertical" :active="workflow">
            <el-step title="潜在捐献" icon="el-icon-user">
              <template slot="description">
                <p>提交时间:<span>2023-9-20</span></p>
                <p>审核时间:<span>2023-9-30</span></p>
              <template
                slot="description"
                v-if="Processdata.donateorgan.createtime"
              >
                <p>
                  提交时间:<span>{{
                    parseTime(Processdata.donateorgan.createtime)
                  }}</span>
                </p>
                <p>
                  更新时间:<span>{{
                    parseTime(Processdata.donateorgan.updatetime)
                  }}</span>
                </p>
              </template>
            </el-step>
            <el-step title="医学评估" icon="el-icon-edit-outline">
              <template slot="description">
                <p>提交时间:<span>2023-9-20</span></p>
                <p>审核时间:<span>2023-9-30</span></p>
            <el-step
              title="医学评估"
              icon="el-icon-edit-outline"
              description="请先完成前部步骤"
            >
              <template
                slot="description"
                v-if="Processdata.medicalevaluation.createtime"
              >
                <p>
                  提交时间:<span>{{
                    parseTime(Processdata.medicalevaluation.updatetime)
                  }}</span>
                </p>
                <p>
                  更新时间:<span>{{
                    parseTime(Processdata.medicalevaluation.updatetime)
                  }}</span>
                </p>
              </template>
            </el-step>
            <el-step
              title="捐献确认"
              description="这是一段很长很长很长的描述性文字"
              description="请先完成前部步骤"
              icon="el-icon-folder-checked"
            >
              <template
                slot="description"
                v-if="Processdata.relativesconfirmation.createtime"
              >
                <p>
                  提交时间:<span>{{
                    parseTime(Processdata.relativesconfirmation.updatetime)
                  }}</span>
                </p>
                <p>
                  更新时间:<span>{{
                    parseTime(Processdata.relativesconfirmation.updatetime)
                  }}</span>
                </p>
              </template>
            </el-step>
            <el-step
              title="伦理审查"
              description="这是一段很长很长很长的描述性文字"
              description="请先完成前部步骤"
              icon="el-icon-s-order"
            ></el-step>
            >
              <template
                slot="description"
                v-if="Processdata.ethicalreviewopinions.createtime"
              >
                <p>
                  提交时间:<span>{{
                    parseTime(Processdata.ethicalreviewopinions.updatetime)
                  }}</span>
                </p>
                <p>
                  更新时间:<span>{{
                    parseTime(Processdata.ethicalreviewopinions.updatetime)
                  }}</span>
                </p>
              </template>
            </el-step>
            <el-step
              title="器官分配"
              description="这是一段很长很长很长的描述性文字"
              description="请先完成前部步骤"
              icon="el-icon-s-operation"
            ></el-step>
            >
              <template
                slot="description"
                v-if="Processdata.organallocationService.createtime"
              >
                <p>
                  提交时间:<span>{{
                    parseTime(Processdata.organallocationService.updatetime)
                  }}</span>
                </p>
                <p>
                  更新时间:<span>{{
                    parseTime(Processdata.organallocationService.updatetime)
                  }}</span>
                </p>
              </template>
            </el-step>
            <el-step
              title="获取见证"
              description="这是一段很长很长很长的描述性文字"
              description="请先完成前部步骤"
              icon="el-icon-s-management"
            ></el-step>
            >
              <template
                slot="description"
                v-if="Processdata.donationwitness.createtime"
              >
                <p>
                  提交时间:<span>{{
                    parseTime(Processdata.donationwitness.updatetime)
                  }}</span>
                </p>
                <p>
                  更新时间:<span>{{
                    parseTime(Processdata.donationwitness.updatetime)
                  }}</span>
                </p>
              </template>
            </el-step>
            <el-step
              title="完成登记"
              description="这是一段很长很长很长的描述性文字"
              description="请先完成前部步骤"
              icon="el-icon-circle-check"
            ></el-step>
            >
              <template
                slot="description"
                v-if="Processdata.donatecompletioninfo.createtime"
              >
                <p>
                  提交时间:<span>{{
                    parseTime(Processdata.donatecompletioninfo.updatetime)
                  }}</span>
                </p>
                <p>
                  更新时间:<span>{{
                    parseTime(Processdata.donatecompletioninfo.updatetime)
                  }}</span>
                </p>
              </template>
            </el-step>
          </el-steps>
        </div>
      </div>
    </div>
<!-- 右侧数据 -->
    <!-- 右侧数据 -->
    <div style="background: #fff;">
      <!-- 顶部数据 -->
      <div class="boxdiv">
        <div class="top-text">捐献者记录工作台</div>
        <el-form
@@ -295,28 +401,31 @@
          ></el-step>
        </el-steps>
      </div>
      <!-- 凭证文件 -->
      <div class="Ticket-button" v-show="actives != 5 && actives != 4">
        <el-button @click.native.prevent="Filepopup" type="success"
          >凭证文件</el-button
        >
      </div>
      <!-- 潜在捐献 -->
      <div class="boxdiv" style="margin: 30px 0 66px 0;" v-show="actives == 0">
        <el-form
          ref="latentform"
          :model="latentform"
          :rules="latentrules"
          ref="form"
          :model="form"
          :rules="rules"
          label-width="100px"
          label-position="right"
        >
          <el-row>
            <el-col :span="8">
              <el-form-item label="住院号" prop="inpatientno">
                <el-input
                  v-model="latentform.inpatientno"
                  placeholder="住院号"
                />
                <el-input v-model="form.inpatientno" placeholder="住院号" />
              </el-form-item>
            </el-col>
            <el-col :span="16">
              <el-form-item label="疾病诊断" prop="diagnosisname">
                <el-input
                  v-model="latentform.diagnosisname"
                  v-model="form.diagnosisname"
                  placeholder="请输入疾病诊断名称"
                />
              </el-form-item>
@@ -325,7 +434,7 @@
          <el-row>
            <el-col :span="12">
              <el-form-item align="left" label="血型" prop="bloodtype">
                <el-radio-group v-model="latentform.bloodtype">
                <el-radio-group v-model="form.bloodtype">
                  <el-radio
                    v-for="dict in dict.type.sys_BloodType"
                    :key="dict.value"
@@ -337,7 +446,7 @@
            </el-col>
            <el-col :span="12" :pull="1">
              <el-form-item label="Rh(D)" align="left" prop="rhyin">
                <el-radio-group v-model="latentform.rhyin">
                <el-radio-group v-model="form.rhyin">
                  <el-radio
                    v-for="dict in dict.type.sys_bloodtype_rhd"
                    :key="dict.value"
@@ -350,7 +459,7 @@
          </el-row>
          <el-row>
            <el-form-item label="疾病类型" align="left">
              <el-checkbox-group v-model="latentform.diseasetype">
              <el-checkbox-group v-model="form.diseasetype">
                <el-checkbox
                  v-for="dict in dict.type.sys_DiseaseType"
                  :key="dict.value"
@@ -362,7 +471,7 @@
            </el-form-item>
            <el-form-item label="其他" prop="diseasetypeOther">
              <el-input
                v-model="latentform.diseasetypeOther"
                v-model="form.diseasetypeOther"
                placeholder="请输入其他"
              />
            </el-form-item>
@@ -370,7 +479,7 @@
          <el-row>
            <el-col :span="12">
              <el-form-item align="left" label="传染病">
                <el-checkbox-group v-model="latentform.infectious">
                <el-checkbox-group v-model="form.infectious">
                  <el-checkbox
                    v-for="dict in dict.type.sys_Infectious"
                    :key="dict.value"
@@ -384,7 +493,7 @@
            <el-col :span="12">
              <el-form-item align="left" label="其他" prop="infectiousOther">
                <el-input
                  v-model="latentform.infectiousOther"
                  v-model="form.infectiousOther"
                  placeholder="请输入其他"
                />
              </el-form-item>
@@ -393,7 +502,7 @@
          <el-row>
            <el-col :span="9">
              <el-form-item align="left" label="病人状况">
                <el-checkbox-group v-model="latentform.patientstate">
                <el-checkbox-group v-model="form.patientstate">
                  <el-checkbox
                    v-for="dict in dict.type.sys_patientstate"
                    :key="dict.value"
@@ -406,7 +515,7 @@
            </el-col>
            <el-col :span="15" align="left">
              <el-form-item label="其他情况">
                <el-checkbox-group v-model="latentform.othercases">
                <el-checkbox-group v-model="form.othercases">
                  <el-checkbox
                    v-for="dict in dict.type.sys_OtherCases"
                    :key="dict.value"
@@ -428,7 +537,7 @@
                    class="relation"
                    align="left"
                  >
                    <el-checkbox-group v-model="latentform.kinship">
                    <el-checkbox-group v-model="form.kinship">
                      <el-checkbox
                        v-for="dict in dict.type.sys_Kinship"
                        :key="dict.value"
@@ -442,7 +551,7 @@
                <el-col :span="12">
                  <el-form-item label="其他" prop="kinshipOther">
                    <el-input
                      v-model="latentform.kinshipOther"
                      v-model="form.kinshipOther"
                      placeholder="请输入其他"
                    />
                  </el-form-item>
@@ -453,7 +562,7 @@
          <el-row>
            <el-col :span="24">
              <el-form-item align="left" label="本人意愿 ">
                <el-checkbox-group v-model="latentform.selfwill">
                <el-checkbox-group v-model="form.selfwill">
                  <el-checkbox
                    v-for="dict in dict.type.sys_SelfWill"
                    :key="dict.value"
@@ -469,7 +578,7 @@
            <el-col :span="12">
              <el-form-item label="主要亲属" prop="majorrelatives">
                <el-input
                  v-model="latentform.majorrelatives"
                  v-model="form.majorrelatives"
                  placeholder="请输入主要亲属"
                />
              </el-form-item>
@@ -477,7 +586,7 @@
            <el-col :span="8">
              <el-form-item label="与捐赠者关系" prop="familyrelations">
                <el-select
                  v-model="latentform.familyrelations"
                  v-model="form.familyrelations"
                  placeholder="请选择与捐赠者关系"
                >
                  <el-option
@@ -493,7 +602,7 @@
          <el-row>
            <el-col :span="12">
              <el-form-item align="left" label="信息来源">
                <el-checkbox-group v-model="latentform.infosources">
                <el-checkbox-group v-model="form.infosources">
                  <el-checkbox
                    v-for="dict in dict.type.sys_InfoSources"
                    :key="dict.value"
@@ -507,7 +616,7 @@
            <el-col :span="8">
              <el-form-item label="其他" prop="infosourcesOther">
                <el-input
                  v-model="latentform.infosourcesOther"
                  v-model="form.infosourcesOther"
                  placeholder="请输入信息来源其他"
                />
              </el-form-item>
@@ -516,16 +625,13 @@
          <el-row>
            <el-col :span="8">
              <el-form-item label="信息员" prop="infoname">
                <el-input
                  v-model="latentform.infoname"
                  placeholder="请输入信息员"
                />
                <el-input v-model="form.infoname" placeholder="请输入信息员" />
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="联系电话" prop="infophone">
                <el-input
                  v-model="latentform.infophone"
                  v-model="form.infophone"
                  placeholder="请输入信息员联系电话"
                />
              </el-form-item>
@@ -537,14 +643,14 @@
                <org-selecter
                  ref="addCrossOrgSelect"
                  :org-type="'2'"
                  v-model="latentform.redorganno"
                  v-model="form.redorganno"
                />
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="联系人" prop="contactperson">
                <el-input
                  v-model="latentform.contactperson"
                  v-model="form.contactperson"
                  placeholder="请输入联系人"
                />
              </el-form-item>
@@ -555,7 +661,7 @@
                  clearable
                  size="small"
                  style="width: 190px"
                  v-model="latentform.contacttime"
                  v-model="form.contacttime"
                  type="datetime"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  placeholder="选择报告时间"
@@ -575,7 +681,7 @@
                  style="width: 260px"
                  ref="orgSelecter"
                  :org-type="'1'"
                  v-model="latentform.acquisitiontissueno"
                  v-model="form.acquisitiontissueno"
                />
              </el-form-item>
            </el-col>
@@ -585,7 +691,7 @@
              <el-form-item label="报告人" prop="reporterno">
                <el-select
                  ref="getReportname"
                  v-model="latentform.reporterno"
                  v-model="form.reporterno"
                  placeholder="请选择"
                >
                  <el-option
@@ -601,7 +707,7 @@
            <el-col :span="8">
              <el-form-item label="联系电话" prop="reporterphone">
                <el-input
                  v-model="latentform.reporterphone"
                  v-model="form.reporterphone"
                  placeholder="请输入联系电话"
                />
              </el-form-item>
@@ -612,7 +718,7 @@
                  clearable
                  size="small"
                  style="width: 190px"
                  v-model="latentform.reporttime"
                  v-model="form.reporttime"
                  type="datetime"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  placeholder="选择报告时间"
@@ -623,19 +729,27 @@
          </el-row>
        </el-form>
        <div class="dialog-footer">
          <el-button v-show="showSaveBtn" type="primary" @click="submitForm"
          <el-button
            v-show="!showTerminationBtn"
            type="primary"
            @click="submitForm"
            >保存捐献者信息</el-button
          >
          <el-button
            v-show="showTerminationBtn"
            type="primary"
            :type="showTerminationBtn == 0 ? 'warning' : 'success'"
            @click="Terminationcase"
            >终止案例</el-button
            >{{ showTerminationBtn == 0 ? "终止案例" : "恢复案例" }}</el-button
          >
          <el-button v-show="Reportforreview" type="primary" @click="ReviewFn"
          <el-button
            v-show="Reportforreview"
            type="primary"
            @click="Reportforreview"
            >上报审核</el-button
          >
          <el-button v-show="makeastepforward" type="primary" @click="ReviewFn"
          <el-button
            v-show="makeastepforward"
            type="primary"
            @click="makeastepforward"
            >下一步</el-button
          >
          <el-button @click="cancel">取 消</el-button>
@@ -846,16 +960,21 @@
          </el-row>
        </el-form>
        <div class="dialog-footer">
          <el-button v-show="showSaveBtn" type="primary" @click="submitForm"
          <el-button
            v-show="!showTerminationBtn"
            type="primary"
            @click="Savethedetails"
            >保存评估信息</el-button
          >
          <el-button
            v-show="showTerminationBtn"
            type="primary"
            :type="showTerminationBtn == 0 ? 'warning' : 'success'"
            @click="Terminationcase"
            >终止案例</el-button
            >{{ showTerminationBtn == 0 ? "终止案例" : "恢复案例" }}</el-button
          >
          <el-button v-show="makeastepforward" type="primary" @click="ReviewFn"
          <el-button
            v-show="makeastepforward"
            type="primary"
            @click="makeastepforward"
            >下一步</el-button
          >
          <el-button @click="cancel">取 消</el-button>
@@ -871,24 +990,6 @@
          label-position="right"
        >
          <el-row>
            <el-col :span="12">
              <el-form-item
                label="亲属关系"
                prop="kinship"
                class="relation"
                align="left"
              >
                <el-checkbox-group v-model="affirmform.kinship">
                  <el-checkbox
                    v-for="dict in dict.type.sys_Kinship"
                    :key="dict.value"
                    :label="dict.value"
                  >
                    {{ dict.label }}
                  </el-checkbox>
                </el-checkbox-group>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="子女数量" prop="kinshipChildrennum">
                <el-input
@@ -1059,16 +1160,21 @@
          </el-row>
        </el-form>
        <div class="dialog-footer">
          <el-button v-show="showSaveBtn" type="primary" @click="submitForm"
          <el-button
            v-show="!showTerminationBtn"
            type="primary"
            @click="Savethedetails"
            >保存捐献信息</el-button
          >
          <el-button
            v-show="showTerminationBtn"
            type="primary"
            :type="showTerminationBtn == 0 ? 'warning' : 'success'"
            @click="Terminationcase"
            >终止案例</el-button
            >{{ showTerminationBtn == 0 ? "终止案例" : "恢复案例" }}</el-button
          >
          <el-button v-show="makeastepforward" type="primary" @click="ReviewFn"
          <el-button
            v-show="makeastepforward"
            type="primary"
            @click="makeastepforward"
            >下一步</el-button
          >
          <el-button @click="cancel">取 消</el-button>
@@ -1122,16 +1228,21 @@
          </el-row>
        </el-form>
        <div class="dialog-footer" style="min-height: 500px; margin: 20px 0; ">
          <el-button v-show="showSaveBtn" type="primary" @click="submitForm"
          <el-button
            v-show="!showTerminationBtn"
            type="primary"
            @click="Savethedetails"
            >保存捐献信息</el-button
          >
          <el-button
            v-show="showTerminationBtn"
            type="primary"
            :type="showTerminationBtn == 0 ? 'warning' : 'success'"
            @click="Terminationcase"
            >终止案例</el-button
            >{{ showTerminationBtn == 0 ? "终止案例" : "恢复案例" }}</el-button
          >
          <el-button v-show="makeastepforward" type="primary" @click="ReviewFn"
          <el-button
            v-show="makeastepforward"
            type="primary"
            @click="makeastepforward"
            >下一步</el-button
          >
          <el-button @click="cancel">取 消</el-button>
@@ -1143,127 +1254,163 @@
          ref="allocationform"
          :model="allocationform"
          :rules="allocationrules"
          label-width="100px"
          label-position="right"
        >
          <el-row>
            <el-col :span="8">
              <el-form-item label="分配状态" prop="organstate">
                <el-select
                  v-model="allocationform.organstate"
                  placeholder="请选择器官状态"
                >
                  <el-option
                    v-for="dict in dict.type.sys_organstate"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="捐献姓名" prop="curdonorname">
                <el-input
                  v-model="curdonorname"
                  placeholder="捐献者姓名"
                  disabled
                />
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="器官名称" prop="organnumber">
                <el-select
                  ref="organNameSelect"
                  v-model="allocationform.organnumber"
                  placeholder="请选择器官编号"
                  clearable
                  size="small"
                  disabled
                >
                  <el-option
                    v-for="dict in dict.type.sys_Organ"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
          <el-form-item label-width="100px" label="选择器官">
            <el-checkbox-group v-model="organalForm.organname">
              <el-checkbox
                v-for="dict in dict.type.sys_Organ"
                :key="dict.value"
                :label="dict.value"
                @change="changeorganState(dict.value)"
              >
                {{ dict.label }}
              </el-checkbox>
            </el-checkbox-group>
          </el-form-item>
          <el-form-item>
            <el-table v-loading="loading" border :data="allocationform">
              <el-table-column
                label="器官名称"
                align="center"
                width="70"
                prop="organname"
              />
              <el-table-column
                label="器官编号"
                align="center"
                width="70"
                prop="organno"
              />
              <el-table-column
                label="分配状态"
                align="center"
                width="120"
                prop="organstate"
              >
                <template slot-scope="scope">
                  <el-select
                    v-model="scope.row.organstate"
                    placeholder="请选择器官状态"
                  >
                    <el-option
                      v-for="dict in dict.type.sys_organstate"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                    ></el-option>
                  </el-select>
                </template>
              </el-table-column>
              <el-table-column
                label="移植医院"
                align="center"
                width="230"
                prop="transplanthospitalname"
              >
                <template slot-scope="scope">
                  <org-selecter
                    ref="tranHosSelect"
                    :org-type="'4'"
                    v-model="scope.row.transplanthospitalno"
                    style="width: 100%"
                  />
                </el-select>
              </el-form-item> </el-col
            ><el-col :span="8">
              <el-form-item label="系统编号" prop="ageunit">
                <el-input
                  v-model="allocationform.ageunit"
                  placeholder="请输入系统编号"
                />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row
            ><el-col :span="8">
              <el-form-item label="接收时间" prop="applicanttime">
                <el-date-picker
                  clearable
                  size="small"
                  style="width: 100%"
                  v-model="allocationform.applicanttime"
                  type="datetime"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  placeholder="选择接收时间"
                >
                </el-date-picker>
              </el-form-item> </el-col
            ><el-col :span="16">
              <el-form-item label="移植医院" prop="treatmenthospitalno">
                <org-selecter
                  ref="tranHosSelect"
                  :org-type="'4'"
                  v-model="allocationform.transplanthospitalno"
                  style="width: 100%"
                />
              </el-form-item> </el-col></el-row
          ><el-row>
            <el-col :span="8">
              <el-form-item label="受体姓名" prop="name">
                <el-input v-model="allocationform.name" placeholder="姓名" />
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="证件类型" prop="idcardtype">
                <el-select
                  v-model="allocationform.idcardtype"
                  placeholder="请选择移植人证件类型"
                >
                  <el-option
                    v-for="dict in dict.type.sys_IDType"
                    :key="dict.value"
                    :label="dict.label"
                    :value="parseInt(dict.value)"
                  ></el-option>
                </el-select>
              </el-form-item> </el-col
            ><el-col :span="8">
              <el-form-item label="证件号码" prop="idcardno">
                <el-input
                  v-model="allocationform.idcardno"
                  placeholder="请输入移植人证件号码"
                />
              </el-form-item>
            </el-col>
          </el-row>
                </template>
              </el-table-column>
              <el-table-column
                label="系统编号"
                align="center"
                width="120"
                prop="ageunit"
              >
                <template slot-scope="scope">
                  <el-input
                    v-model="scope.row.ageunit"
                    placeholder="系统编号"
                  />
                </template>
              </el-table-column>
              <el-table-column
                label="接收时间"
                align="center"
                width="200"
                prop="applicanttime"
              >
                <template slot-scope="scope">
                  <el-date-picker
                    clearable
                    size="small"
                    style="width: 100%"
                    v-model="scope.row.applicanttime"
                    type="datetime"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择接收时间"
                  >
                  </el-date-picker>
                </template>
              </el-table-column>
              <el-table-column
                label="受体姓名"
                align="center"
                width="120"
                prop="name"
              >
                <template slot-scope="scope">
                  <el-input v-model="scope.row.name" placeholder="受体姓名" />
                </template>
              </el-table-column>
              <el-table-column
                label="证件类型"
                align="center"
                width="150"
                prop="idcardtype"
              >
                <template slot-scope="scope">
                  <el-select
                    v-model="scope.row.idcardtype"
                    placeholder="移植人证件类型"
                  >
                    <el-option
                      v-for="dict in dict.type.sys_IDType"
                      :key="dict.value"
                      :label="dict.label"
                      :value="parseInt(dict.value)"
                    ></el-option>
                  </el-select>
                </template>
              </el-table-column>
              <el-table-column
                label="证件号码"
                align="center"
                width="200"
                prop="idcardno"
              >
                <template slot-scope="scope">
                  <el-input
                    v-model="scope.row.idcardno"
                    placeholder="证件号码"
                  />
                </template>
              </el-table-column>
            </el-table>
          </el-form-item>
        </el-form>
        <div class="dialog-footer">
          <el-button v-show="showSaveBtn" type="primary" @click="submitForm"
          <el-button
            v-show="!showTerminationBtn"
            type="primary"
            @click="Savethedetails"
            >保存捐献信息</el-button
          >
          <el-button
            v-show="showTerminationBtn"
            type="primary"
            :type="showTerminationBtn == 0 ? 'warning' : 'success'"
            @click="Terminationcase"
            >终止案例</el-button
            >{{ showTerminationBtn == 0 ? "终止案例" : "恢复案例" }}</el-button
          >
          <el-button v-show="makeastepforward" type="primary" @click="ReviewFn"
          <el-button
            v-show="makeastepforward"
            type="primary"
            @click="makeastepforward"
            >下一步</el-button
          >
          <el-button @click="cancel">取 消</el-button>
@@ -1700,16 +1847,21 @@
        </el-form>
        <div class="dialog-footer">
          <el-button v-show="showSaveBtn" type="primary" @click="submitForm"
          <el-button
            v-show="!showTerminationBtn"
            type="primary"
            @click="Savethedetails"
            >保存捐献信息</el-button
          >
          <el-button
            v-show="showTerminationBtn"
            type="primary"
            :type="showTerminationBtn == 0 ? 'warning' : 'success'"
            @click="Terminationcase"
            >终止案例</el-button
            >{{ showTerminationBtn == 0 ? "终止案例" : "恢复案例" }}</el-button
          >
          <el-button v-show="makeastepforward" type="primary" @click="ReviewFn"
          <el-button
            v-show="makeastepforward"
            type="primary"
            @click="makeastepforward"
            >下一步</el-button
          >
          <el-button @click="cancel">取 消</el-button>
@@ -1930,41 +2082,192 @@
          </el-row>
        </el-form>
        <div class="dialog-footer">
          <el-button v-show="showSaveBtn" type="primary" @click="submitForm"
          <el-button
            v-show="!showTerminationBtn"
            type="primary"
            @click="Savethedetails"
            >保存捐献者信息</el-button
          >
          <el-button
            v-show="showTerminationBtn"
            type="primary"
            :type="showTerminationBtn == 0 ? 'warning' : 'success'"
            @click="Terminationcase"
            >终止案例</el-button
            >{{ showTerminationBtn == 0 ? "终止案例" : "恢复案例" }}</el-button
          >
          <el-button v-show="Reportforreview" type="primary" @click="ReviewFn"
          <el-button
            v-show="Reportforreview"
            type="primary"
            @click="Reportforreview"
            >上报审核</el-button
          >
          <el-button @click="cancel">取 消</el-button>
        </div>
      </div>
    </div>
    <!-- 附件弹窗 -->
    <el-dialog
      v-dialogDrags
      :modal="false"
      :close-on-click-modal="false"
      :title="pdftitle"
      :visible.sync="pdfVisible"
      width="60%"
    >
      <el-tabs
        style="margin-top: 20px;"
        v-model="activeName"
        type="card"
        @tab-click="handleClick"
      >
        <el-tab-pane label="潜在捐献" :name="1"> </el-tab-pane>
        <el-tab-pane label="医学评估" :name="2"> </el-tab-pane>
        <el-tab-pane label="捐献确认" :name="3"> </el-tab-pane>
        <el-tab-pane label="伦理审查" :name="4"> </el-tab-pane>
        <el-tab-pane label="完成登记" :name="7"> </el-tab-pane>
      </el-tabs>
      <div class="pdfimg">
        <div class="box-pdf">
          <div>
            <el-upload
              size="mini"
              class="upload-demo"
              :action="uploadFileUrl"
              :file-list="invoicefileList"
              :show-file-list="false"
              multiple
              drag
              :headers="headers"
              :on-success="
                (response, file, fileList) =>
                  uploadSccess(response, file, fileList)
              "
              :on-preview="downFile"
              :disabled="operationType == 'detail'"
              :on-error="handleUploadError"
              :on-remove="remove"
              accept="image/*,.pdf"
            >
              <i class="el-icon-upload"></i>
              <div class="el-upload__text">
                将发票文件拖到此处,或
                <em
                  ><el-button
                    :disabled="operationType == 'detail'"
                    size="small"
                    type="primary"
                    >点击上传</el-button
                  ></em
                >
              </div>
            </el-upload>
            <el-table
              :data="invoicefileListto"
              @row-click="downFile"
              style="width: 100%"
              height="400"
            >
              <el-table-column
                prop="name"
                :show-overflow-tooltip="true"
                label="名称"
              >
                <template slot-scope="scope">
                  <i style="color:#409EFF" class=" el-icon-s-order" />{{
                    scope.row.name
                  }}
                </template>
              </el-table-column>
              <el-table-column
                prop="name"
                width="180"
                :show-overflow-tooltip="true"
                label="功能"
              >
                <template slot-scope="scope">
                  <el-button
                    type="primary"
                    size="mini"
                    @click.native.prevent.stop="deletedowfile(scope.row)"
                    >删除</el-button
                  >
                  <el-button
                    type="primary"
                    size="mini"
                    @click.native.prevent.stop="moveupdowfile(scope.row)"
                    >上移</el-button
                  >
                </template>
              </el-table-column>
            </el-table>
          </div>
        </div>
        <div
          v-if="this.previewpdf && invoicepdfimgsrcList.length"
          class="pdfimgmin"
        >
          <!-- <img :src="pdfimg" /> -->
          <el-image
            style="width: 95%; height: 90%"
            :src="invoicepdfimg"
            :preview-src-list="invoicepdfimgsrcList"
          >
            <!-- <div slot="error" class="image-slot">
              <i class="el-icon-picture-outline"></i>
            </div> -->
          </el-image>
        </div>
        <div v-else class="pdfimgmins">{{ hintitle }}</div>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import {
  listDonatebaseinfo,
  addDonateannex,
  listDonateannex,
  Modifydonationattachment
} from "@/api/project/donateannex";
import {
  getDonatebaseinfo,
  delDonatebaseinfo,
  addDonatebaseinfo,
  updateDonatebaseinfo,
  exportDonatebaseinfo,
  downloadbaseinfo,
  getdonatorno
  // exportProvincemessage,
  getDonatebaseinfoflow
} from "@/api/project/donatebaseinfo";
import {
  listMedicalevaluation,
  addMedicalevaluation,
  updateMedicalevaluation
} from "@/api/project/medicalevaluation";
import {
  addDonateflowchart,
  listDonateflowchart,
  updateDonateflowchart
} from "@/api/project/DonationEvaluation";
import {
  listOrganallocation,
  addOrganallocation,
  updateOrganallocation
} from "@/api/project/organallocation";
import {
  listDonateorgan,
  addDonateorgan,
  delDonateorgan,
  updateDonateorgan
} from "@/api/project/donateorgan";
import {
  listRelativesconfirmation,
  getRelativesconfirmation,
  addRelativesconfirmation,
  updateRelativesconfirmation
} from "@/api/project/relativesconfirmation";
import Li_area_select from "@/components/Address";
import OrgSelecter from "@/views/project/components/orgselect";
import AnnexUpload from "@/views/project/components/annexupload";
import ReportName from "@/views/project/components/organizationUser";
import { getToken } from "@/utils/auth";
export default {
  name: "donationdetails",
  components: {
@@ -1995,23 +2298,34 @@
    "sys_FamilyRelation",
    "sys_OrganDecision",
    "sys_CoreAssessConclusion",
    "sys_BaseAssessConclusion"
    "sys_BaseAssessConclusion",
    "sys_EthicalReview"
  ],
  data() {
    return {
      id: 736,
      infoid: 734,
      form: {},
      latentform: {},
      medicineform: {},
      affirmform: {},
      affirmform: {
        organdecision: []
      },
      ethicform: {},
      allocationform: {},
      witnessform: {},
      accomplishform: {},
      actives: 0,
      tableData: [],
      actives: 0, //进程
      workflow:0,
      loading: false,
      //   保存、终止按钮确认
      showSaveBtn: true,
      showTerminationBtn: true,
      showTerminationBtn: 0, //终止状态 0-未终止 1-已终止
      //选择器官表单
      organalForm: {
        //器官列表
        organname: []
      },
      Processdata: {}, //流程数据
      //省市区默认值设置,可为空
      searchAddress: {
        sheng: "",
@@ -2020,6 +2334,11 @@
        organizationname: null
      },
      residenceAddresss: {
        sheng: "浙江省",
        shi: "",
        qu: ""
      },
      defultAddresss: {
        sheng: "浙江省",
        shi: "",
        qu: ""
@@ -2057,11 +2376,7 @@
        age: [{ required: true, message: "请输入年龄", trigger: "blur" }],
        treatmenthospitalno: [
          { required: true, message: "请选择医疗机构", trigger: "blur" }
        ]
        // treatmenthospitalno: [{ required: true, message: "请选择医疗机构", trigger: "change" }],
      },
      // 潜在捐献效验
      latentrules: {
        ],
        bloodtype: [
          { required: true, message: "请选择ABO血型", trigger: "blur" }
        ],
@@ -2092,7 +2407,6 @@
            trigger: "blur"
          }
        ],
        // contactnumber: [{required: true,message: "请输入红十字会联系电话",trigger: "change"}],
        acquisitiontissueno: [
          { required: true, message: "器官获取组织不能为空", trigger: "blur" }
        ],
@@ -2106,24 +2420,68 @@
          { required: true, message: "请输入报告人联系电话", trigger: "blur" }
        ]
      },
      // 各级明细效验
      medicinerules: {},
      affirmrules: {},
      ethicrules: {},
      allocationrules: {},
      witnessrules: {},
      accomplishrules: {}
      accomplishrules: {},
      //附件列表
      donatelist: [], //附件总组
      potentiallist: [], //潜在附件
      medicinelist: [], //医学附件
      affirmlist: [], //确认附件
      ethiclist: [], //伦理附件
      registerlist: [], //完成附件
      fileList: [],
      fileListto: [],
      invoicefileList: [],
      invoicefileListto: [],
      invoicepdfimg: "",
      invoicepdfimgsrcList: [],
      invoDatatop: [],
      activeName: 1, //文件类型
      //上传附件路径
      uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload",
      //文件上传token
      headers: {
        Authorization: "Bearer " + getToken()
      },
      // 网络请求头
      Networkheader: null,
      //票据文件
      pdftitle: "",
      pdfimg: "",
      pdfimgsrcList: [],
      pdfVisible: false,
      previewpdf: false,
      hintitle: "请上传文件后查看",
      atpresent: ""
    };
  },
  created() {
  mounted() {
    // this.id = this.$route.query.id;
    this.Getbasicinformation();
    this.listDonateannex();
  },
  methods: {
    // 获取主表数据
    Getbasicinformation() {
      getDonatebaseinfo(this.id).then(response => {
      // 左侧流程数据
      getDonatebaseinfoflow(this.infoid).then(res => {
        console.log(res.data);
        this.Processdata = res.data;
      });
      // 表单数据
      getDonatebaseinfo(this.infoid).then(response => {
        this.form = response.data;
        this.showTerminationBtn = response.data.terminationCase;
        this.actives = response.data.workflow;
        this.workflow=response.data.workflow;
        response.data.sex = parseInt(response.data.sex);
        this.form.id = response.data.id;
        this.form.diseasetype = this.form.diseasetype.split(",");
@@ -2141,24 +2499,649 @@
        this.residenceAddresss.shi = response.data.residencecityname;
        this.residenceAddresss.qu = response.data.residencetownname;
        this.registerAddresss.qu = response.data.registertownname;
        this.latentform = this.form;
      });
    },
    // 获取二级表数据
    GetAttacheddata() {
      let searchParam = {
        infoid: this.form.id
      };
      if (this.actives == 1) {
        listMedicalevaluation(searchParam).then(response => {
          if (response.code == 200) {
            this.medicineform = response.rows[0];
          } else {
            this.$modal.msgError(
              "获取医学评估记录失败:" + JSON.stringify(response)
            );
          }
        });
      } else if (this.actives == 2) {
        listRelativesconfirmation(searchParam).then(response => {
          if (response.code == 200) {
            this.affirmform = response.rows[0];
            if (!this.affirmform) {
              this.affirmform = {};
              this.affirmform.residenceprovincename = "";
              this.affirmform.residencecityname = "";
              this.affirmform.residencetownname = "";
            }
            this.defultAddresss.sheng = this.affirmform.residenceprovincename;
            this.defultAddresss.shi = this.affirmform.residencecityname;
            this.defultAddresss.qu = this.affirmform.residencetownname;
            if (this.affirmform.kinship) {
              this.affirmform.kinship = this.affirmform.kinship.split(",");
            }
            if (this.affirmform.organdecision) {
              this.affirmform.organdecision = this.affirmform.organdecision.split(
                ","
              );
            }
          } else {
            this.$modal.msgError(
              "查询是否存在确认登记记录失败" + JSON.stringify(response)
            );
          }
        });
      } else if (this.actives == 3) {
        listDonateflowchart(searchParam).then(response => {
          if (response.code == 200 && response.rows.length == 1) {
            this.ethicform = response.rows[0];
          } else {
            console.log("伦理审查数据为空");
          }
        });
      } else if (this.actives == 4) {
        listDonateorgan(searchParam).then(response => {
          if (response.code == 200) {
            this.allocationform = response.rows;
            this.allocationform.infoid = this.form.id;
            this.organalForm.organname = [];
            for (let i = 0; i < response.rows.length; i++) {
              this.organalForm.organname.push(response.rows[i].organno);
            }
          } else {
            this.$modal.msgError(
              "获取器官分配信息失败:" + JSON.stringify(response)
            );
          }
        });
      } else if (this.actives == 5) {
        listMedicalevaluation(searchParam).then(response => {
          if (response.code == 200) {
            this.witnessform = response.rows[0];
            this.witnessform.infoid = this.form.id;
          } else {
            this.$modal.msgError(
              "获取医学评估记录失败:" + JSON.stringify(response)
            );
          }
        });
      } else if (this.actives == 6) {
        listMedicalevaluation(searchParam).then(response => {
          if (response.code == 200) {
            this.accomplishform = response.rows[0];
            this.accomplishform.infoid = this.form.id;
            this.open = true;
          } else {
            this.$modal.msgError(
              "获取医学评估记录失败:" + JSON.stringify(response)
            );
          }
        });
      }
    },
    // 获取附件数据并分类二级列
    listDonateannex() {
      let parmi = {};
      parmi.infoid = this.infoid.toString();
      listDonateannex(parmi).then(res => {
        this.donatelist = res.rows;
      });
// 测试数据
      const arr = [
        { type: "type1", name: "saaada" },
        { type: "type2", name: "ssssda" },
        { type: "type3", name: "sdddda" },
        { type: "type4", name: "sdddda" },
        { type: "type5", name: "sdddda" }
      ];
      const groupedArr = arr.reduce((accumulator, currentValue) => {
        const key = currentValue.type;
        if (key == "type1") {
          this.potentiallist.push(currentValue);
        } else if (key == "type2") {
          this.medicinelist.push(currentValue);
        } else if (key == "type3") {
          this.affirmlist.push(currentValue);
        } else if (key == "type4") {
          this.ethiclist.push(currentValue);
        } else if (key == "type5") {
          this.registerlist.push(currentValue);
        }
        return accumulator;
      }, {});
      console.log(this.potentiallist);
      console.log(this.medicinelist);
    },
    /** 保存主表按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        console.log("提交的数据们:", this.form);
        if (valid) {
          this.form.birthday = this.$moment(this.form.birthday).format(
            "YYYY-MM-DD HH:mm:ss"
          );
          this.form.diseasetype = this.form.diseasetype.join(",");
          this.form.infectious = this.form.infectious.join(",");
          this.form.selfwill = this.form.selfwill.join(",");
          this.form.othercases = this.form.othercases.join(",");
          this.form.infosources = this.form.infosources.join(",");
          this.form.kinship = this.form.kinship.join(",");
          this.form.patientstate = this.form.patientstate.join(",");
          this.form.registerprovince = this.$refs.registerSelect.getSheng();
          this.form.registerprovincename = this.registerAddresss.sheng;
          this.form.residenceprovince = this.$refs.residenceSelect.getSheng();
          this.form.residenceprovincename = this.residenceAddresss.sheng;
          this.form.registercity = this.$refs.registerSelect.getShi();
          this.form.registercityname = this.registerAddresss.shi;
          this.form.residencecity = this.$refs.residenceSelect.getShi();
          this.form.residencecityname = this.residenceAddresss.shi;
          this.form.residencetown = this.$refs.residenceSelect.getQu();
          this.form.residencetownname = this.residenceAddresss.qu;
          this.form.registertown = this.$refs.registerSelect.getQu();
          this.form.registertownname = this.registerAddresss.qu;
          this.form.reportername = this.$refs.getReportname.$data.selectedLabel;
          try {
            this.form.treatmenthospitalname = this.$refs.addOrgSelect.getOptionByValue(
              this.form.treatmenthospitalno
            ).organizationname;
          } catch {
            this.form.treatmenthospitalname = this.form.treatmenthospitalno;
          }
          try {
            this.form.redorganname = this.$refs.addCrossOrgSelect.getOptionByValue(
              this.form.redorganno
            ).organizationname;
          } catch {
            this.form.redorganname = this.form.redorganno;
          }
          if (this.form.id != null) {
            updateDonatebaseinfo(this.form).then(response => {
              this.$modal.msgSuccess("保存成功");
              this.Getbasicinformation();
              this.GetAttacheddata();
              this.open = false;
            });
          } else {
            this.form.workflow = 1;
            this.form.recordstate = 0;
            addDonatebaseinfo(this.form).then(response => {
              if (response.code == 200) {
                this.$modal.msgSuccess("新增成功");
                this.Getbasicinformation();
                this.GetAttacheddata();
                this.open = false;
              } else {
                this.$modal.msgError("新增失败:" + response.msg);
              }
            });
          }
        }
      });
    },
    // 保存二级表按钮
    Savethedetails() {
      if (this.actives == 1) {
        this.Processvalidation();
        this.medicineform.infoid = this.form.id;
        this.$refs["medicineform"].validate(valid => {
          if (valid) {
            if (this.medicineform.id != null) {
              updateMedicalevaluation(this.medicineform).then(response => {});
            } else {
              addMedicalevaluation(this.medicineform).then(response => {
                this.$modal.msgSuccess("医学评估信息新增成功");
              });
            }
            this.submitForm();
          }
        });
      } else if (this.actives == 2) {
        this.Processvalidation();
        this.affirmform.infoid = this.form.id;
        this.$refs["affirmform"].validate(valid => {
          if (valid) {
            if (this.affirmform.id != null) {
              updateRelativesconfirmation(this.affirmform).then(response => {});
            } else {
              addRelativesconfirmation(this.affirmform).then(response => {
                this.$modal.msgSuccess("捐献确认信息新增成功");
              });
            }
            this.submitForm();
          }
        });
      } else if (this.actives == 3) {
        this.Processvalidation();
        this.ethicform.infoid = this.form.id;
        this.$refs["ethicform"].validate(valid => {
          if (valid) {
            if (this.ethicform.id != null) {
              updateDonateflowchart(this.ethicform).then(response => {});
            } else {
              addDonateflowchart(this.ethicform).then(response => {
                this.$modal.msgSuccess("伦理审查信息新增成功");
              });
            }
            this.submitForm();
          }
        });
      } else if (this.actives == 4) {
        this.Processvalidation();
        this.allocationform.infoid = this.form.id;
        this.$refs["allocationform"].validate(valid => {
          if (valid) {
            if (this.allocationform[0].id != null) {
              updateOrganallocation(this.allocationform).then(response => {
                this.$modal.msgSuccess("修改成功");
              });
            } else {
              addOrganallocation(this.allocationform).then(response => {
                this.$modal.msgSuccess("新增成功");
              });
            }
            this.submitForm();
          }
        });
      } else if (this.actives == 5) {
        this.Processvalidation();
        this.witnessform.infoid = this.form.id;
        this.$refs["witnessform"].validate(valid => {
          if (valid) {
            if (this.witnessform.id != null) {
              // 获取捐献器官列表
              listDonateorgan(oraganqueryParam).then(response => {
                this.loading = false;
                if (response.code == 200) {
                  this.organdonation = [];
                  this.tableData = response.rows;
                  //获取医院默认是移植医院
                  for (let i = 0; i < this.tableData.length; i++) {
                    if (
                      this.tableData[i].gainhospitalname == null ||
                      this.tableData[i].gainhospitalname == ""
                    ) {
                      this.tableData[i].gainhospitalname = this.tableData[
                        i
                      ].transplanthospitalname;
                    }
                    if (
                      this.tableData[i].gainhospitalno == null ||
                      this.tableData[i].gainhospitalno == ""
                    ) {
                      this.tableData[i].gainhospitalno = this.tableData[
                        i
                      ].transplanthospitalno;
                    }
                  }
                  //this.organalForm.organname = [];
                  for (let i = 0; i < response.rows.length; i++) {
                    this.form.organdonation.push(response.rows[i].organno);
                  }
                } else {
                  this.$modal.msgError("获取捐献器官失败:" + response.msg);
                }
              });
              // 获取信息
            } else {
              addMedicalevaluation(this.witnessform).then(response => {
                this.$modal.msgSuccess("新增成功");
              });
            }
            this.submitForm();
          }
        });
      } else if (this.actives == 6) {
        this.Processvalidation();
        this.accomplishform.infoid = this.form.id;
        this.$refs["accomplishform"].validate(valid => {
          if (valid) {
            if (this.accomplishform.id != null) {
              updateMedicalevaluation(this.accomplishform).then(response => {
                this.$modal.msgSuccess("修改成功");
              });
            } else {
              addMedicalevaluation(this.accomplishform).then(response => {
                this.$modal.msgSuccess("新增成功");
              });
            }
            this.submitForm();
          }
        });
      }
    },
    // 切换tab
    on_click(e) {
      console.log(e);
      if (e != "" || e != null) {
        this.actives = e;
      // if (e != "" || e != null) {
      this.actives = e;
      // }
      this.GetAttacheddata();
    },
    // 器官分配栏目控制
    changeorganState(value) {
      let organIndex = this.allocationform.findIndex(
        item => item.organno == value
      );
      if (organIndex == -1) {
        //获取器官名称
        let temporganname = "";
        for (let i = 0; i < this.dict.type.sys_Organ.length; i++) {
          if (value == this.dict.type.sys_Organ[i].value) {
            temporganname = this.dict.type.sys_Organ[i].label;
            break;
          }
        }
        if (temporganname != "") {
          this.allocationform.push({
            organname: temporganname,
            organno: value,
            id: null,
            transplanthospitalname: null,
            transplanthospitalno: null,
            organstate: "2"
          });
        }
      } else {
        this.$confirm("是否确认删除器官分配记录", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            if (organIndex != -1) {
              let tempOrgan = this.allocationform[organIndex];
              console.log(tempOrgan);
              if (tempOrgan.organstate != 1 && tempOrgan.id > 0) {
                this.$modal.msgWarning("只有未分配器官可进行删除!");
                this.organalForm.organname.push(value);
                return;
              }
              if (tempOrgan.id > 0) {
                //查找器官表记录,判断器官状态
                this.loading = true;
                delDonateorgan(tempOrgan.id).then(delLocationRes => {
                  this.loading = false;
                  this.$modal.msgSuccess("删除成功");
                });
              } else {
                this.allocationform.splice(deleteIndex, 1);
              }
            }
          })
          .catch(() => {});
      }
    },
    // 前进步骤
    makeastepforward() {},
    makeastepforward() {
      console.log(this.actives);
      if (this.actives <= 6) {
        this.actives++;
        this.GetAttacheddata();
      } else {
        console.log("已到达最大值");
      }
    },
    // 更改进程效验
    Processvalidation() {
      console.log(this.form.workflow);
      console.log(this.actives);
      if (this.form.workflow == this.actives) {
        this.form.workflow++;
      } else if (this.form.workflow > this.actives) {
      } else {
        this.$modal.msgWarning("请先完成前部步骤");
        return;
      }
      console.log(this.form.workflow);
    },
    // 上报审核
    Reportforreview() {},
    // 终止案例
    Terminationcase() {},
    Terminationcase() {
      this.form.terminationCase == 1
        ? (this.form.terminationCase = 0)
        : (this.form.terminationCase = 1);
      this.submitForm();
    },
    // 返回上一页
    cancel() {}
    cancel() {},
    // ----------------------------------文件
    // 获取请求头
    Getnetworkheader() {
      let string = window.location.href;
      if (string.includes("9091")) {
        const index = string.indexOf("9091");
        this.Networkheader = string.slice(0, index + 4); // 截取9091及其前部字符
      } else {
        const index = string.indexOf("8032");
        this.Networkheader = string.slice(0, index + 4); // 截取8032及其前部字符
      }
    },
    //文件上传
    handleUploadError() {},
    remove(file, fileList) {
      const rbDetails = [...this.rbDetails];
      if (this.activeName == 1) {
        this.fileListto.splice(this.fileListto.indexOf(file), 1);
        rbDetails[this.atpresent].annexfilesList = this.fileListto;
      } else {
        this.invoicefileListto.splice(this.invoicefileListto.indexOf(file), 1);
        rbDetails[this.atpresent].invoicefilesList = this.invoicefileListto;
      }
    },
    uploadSccess(response, file, fileList) {
      this.rbDetails;
      //获取票据信息位置
      if (this.activeName == 1) {
        if (response.code == 200) {
          // this.form.filename = file.raw.name;
          this.previewpdf = true;
          this.$modal.msgSuccess(response.msg);
          this.fileListto.push({
            name: file.name,
            url: response.fileName
          });
          this.pdfimgsrcList.push(
            this.Networkheader + "/prod-api" + response.fileName
          );
          console.log(this.pdfimgsrcList);
          this.pdftitle = "共" + this.pdfimgsrcList.length + "项";
          this.pdfimg = this.Networkheader + "/prod-api" + response.fileName;
          this.rbDetails[this.atpresent].annexfilesList = this.fileListto;
        } else {
          console.log(response.msg);
        }
      } else {
        if (response.code == 200) {
          // this.form.filename = file.raw.name;
          this.previewpdf = true;
          this.$modal.msgSuccess(response.msg);
          this.invoicefileListto.push({
            name: file.name,
            url: response.fileName
          });
          this.invoicepdfimgsrcList.push(
            this.Networkheader + "/prod-api" + response.fileName
          );
          console.log(this.invoicepdfimgsrcList);
          this.pdftitle = "共" + this.invoicepdfimgsrcList.length + "项";
          this.pdfimg = this.Networkheader + "/prod-api" + response.fileName;
          this.rbDetails[
            this.atpresent
          ].invoicefilesList = this.invoicefileListto;
          console.log(this.rbDetails[this.atpresent]);
        } else {
          console.log(response.msg);
        }
      }
    },
    // 点击票据
    Filepopup(index, rows, row) {
      this.activeName = this.actives + 1;
      console.log(this.activeName);
      this.pdfimgsrcList = [];
      this.invoicepdfimgsrcList = [];
      this.atpresent = index;
      this.pdfVisible = true;
      console.log(this.rbDetails[index]);
      if (this.rbDetails[index].annexfilesList) {
        this.previewpdf = true;
        this.fileListto = this.rbDetails[index].annexfilesList;
        console.log(this.fileListto);
        this.pdfimg = this.Networkheader + "/prod-api" + this.fileListto[0].url;
        this.fileListto.forEach(item => {
          this.pdfimgsrcList.push(this.Networkheader + "/prod-api" + item.url);
        });
      } else {
        this.fileListto = [];
        this.pdfimg = "";
        this.pdftitle = "";
      }
      // -发票文件
      if (this.rbDetails[index].invoicefilesList) {
        this.previewpdf = true;
        this.invoicefileListto = this.rbDetails[index].invoicefilesList;
        console.log(this.invoicefileListto);
        this.invoicepdfimg =
          this.Networkheader + "/prod-api" + this.invoicefileListto[0].url;
        this.invoicefileListto.forEach(item => {
          this.invoicepdfimgsrcList.push(
            this.Networkheader + "/prod-api" + item.url
          );
        });
        console.log(this.invoicepdfimgsrcList);
        console.log(this.invoicepdfimg);
      } else {
        this.invoicefileListto = [];
        this.invoicepdfimg = "";
        this.pdftitle = "";
      }
      if (this.activeName == 1) {
        this.pdftitle = "共" + this.pdfimgsrcList.length + "项";
      } else {
        this.pdftitle = "共" + this.invoicepdfimgsrcList.length + "项";
      }
    },
    // 点击已上传文件
    downFile(item) {
      if (this.activeName == 1) {
        console.log(item, "点击文件拿item");
        this.pdftitle =
          "共" + this.pdfimgsrcList.length + "项,当前选中" + item.name;
        let name = item.name.split(".");
        if (name[1] == "pdf") {
          this.$modal.msgWarning("当前文件暂不支持预览");
          this.previewpdf = false;
          this.hintitle = "当前文件暂不支持预览";
        } else if (name[1] == "jpg" || "png") {
          this.previewpdf = true;
          if (item.url) {
            this.pdfimg = this.Networkheader + "/prod-api" + item.url;
          } else {
            this.pdfimg = this.Networkheader + "/prod-api" + item.response.url;
          }
        } else {
          this.hintitle = "当前文件暂不支持预览";
          this.$modal.msgWarning("当前文件暂不支持预览");
          this.previewpdf = false;
        }
      } else {
        console.log(item, "点击文件拿item");
        this.pdftitle =
          "共" + this.invoicepdfimgsrcList.length + "项,当前选中" + item.name;
        let name = item.name.split(".");
        if (name[1] == "pdf") {
          this.$modal.msgWarning("当前文件暂不支持预览");
          this.previewpdf = false;
          this.hintitle = "当前文件暂不支持预览";
        } else if (name[1] == "jpg" || "png") {
          this.previewpdf = true;
          if (item.url) {
            this.invoicepdfimg = this.Networkheader + "/prod-api" + item.url;
            console.log(this.invoicepdfimg, "pdfimg");
            console.log(this.invoicepdfimgsrcList, "imglist");
          } else {
            this.invoicepdfimg =
              this.Networkheader + "/prod-api" + item.response.url;
          }
        } else {
          this.hintitle = "当前文件暂不支持预览";
          this.$modal.msgWarning("当前文件暂不支持预览");
          this.previewpdf = false;
        }
      }
    },
    getIndexInArray(arr, obj) {
      return arr.indexOf(obj);
    },
    // 发票切换
    handleClick(tab, event) {
      if (this.activeName == 1) {
        this.pdftitle = "共" + this.pdfimgsrcList.length + "项";
      } else {
        this.pdftitle = "共" + this.invoicepdfimgsrcList.length + "项";
      }
    },
    // 点击删除
    deletedowfile(row) {
      if (this.activeName == 1) {
        const indexlist = this.getIndexInArray(
          this.pdfimgsrcList,
          this.Networkheader + "/prod-api" + row.url
        );
        this.pdfimgsrcList.splice(indexlist, 1);
        const index = this.getIndexInArray(this.fileListto, row);
        this.fileListto.splice(index, 1);
      } else {
        const indexlist = this.getIndexInArray(
          this.invoicepdfimgsrcList,
          this.Networkheader + "/prod-api" + row.url
        );
        this.invoicepdfimgsrcList.splice(indexlist, 1);
        const index = this.getIndexInArray(this.invoicefileListto, row);
        this.invoicefileListto.splice(index, 1);
      }
    },
    // 点击上移
    moveupdowfile(row) {
      if (this.activeName == 1) {
        const index = this.getIndexInArray(this.fileListto, row);
        const item = this.fileListto.splice(index, 1)[0]; // 移除指定索引处的元素,并保存到item变量中
        this.fileListto.splice(index - 1, 0, item); // 将item插入到索引位置的前一位
      } else {
        const index = this.getIndexInArray(this.invoicefileListto, row);
        const item = this.invoicefileListto.splice(index, 1)[0]; // 移除指定索引处的元素,并保存到item变量中
        this.invoicefileListto.splice(index - 1, 0, item); // 将item插入到索引位置的前一位
      }
    },
    // 保存
    saveattachment(stype) {}
  }
};
</script>
@@ -2195,11 +3178,58 @@
    }
  }
}
.upload-demo {
  text-align: center;
}
.pdfimg {
  display: flex; // text-align: center;
  width: 100%;
  height: 600px;
  .box-pdf {
    width: 400px;
    padding-top: 20px;
    margin-right: 30px;
    border: 1px solid #dcdfe6;
    -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
      0 0 6px 0 rgba(0, 0, 0, 0.04);
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1); // <- Add this to fix.
  }
  .pdftit {
    width: 200px;
    padding: 20px;
    font-size: 18px;
  }
  .pdftit:hover {
    background: #c0cef7;
  }
  .pdfimgmin {
    width: 60%;
    img {
      width: 100%;
    }
  }
  .pdfimgmins {
    font-size: 28px;
    width: 60%;
    text-align: center;
  }
}
.Ticket-button {
  margin-top: 10px;
  text-align: right;
  padding-right: 66px;
}
.boxdiv {
  font-size: 18px;
  padding: 0 30px;
  padding-bottom: 10px;
  margin-top:20px;
  margin-top: 10px;
  .top-text {
    text-align: center;