yxh
8 天以前 fb16e99d60035949b870d0bed7f38b452458000a
src/views/project/fund/applyDetail/index.vue
@@ -6,8 +6,13 @@
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
        <el-row>
          <el-col :span="5">
            <el-form-item label="申请日期" prop="createTime">
              <el-date-picker clearable :disabled="true" style="width: 100%" v-model="form.createTime" type="date"
            <el-form-item label="报销单号" prop="bh">
              <el-input v-model="form.bh" :disabled="true" placeholder="报销单号" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="5">
            <el-form-item label="申请日期" prop="applyTime">
              <el-date-picker clearable :disabled="true" style="width: 100%" v-model="form.applyTime" type="date" format="yyyy-MM-dd"
                value-format="yyyy-MM-dd HH:mm:ss" placeholder="日   期">
              </el-date-picker>
            </el-form-item>
@@ -22,18 +27,13 @@
            </el-form-item>
          </el-col>
          <el-col :span="5">
            <el-form-item label="所属组别" prop="deptmentname">
              <el-input v-model="form.deptmentname" placeholder="请输入所属组别" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="5">
            <el-form-item label="组长" prop="managername">
              <el-input v-model="form.managername" placeholder="请输入组长" clearable />
            <el-form-item label="联系电话" prop="phone">
              <el-input v-model="form.phone" placeholder="请输入联系电话" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <!--
          <!--
          <el-col :span="7">
            <el-form-item label="工作单位" prop="unitno">
              <org-selecter ref="orgSelecter" :org-type="'3'" v-model="form.unitno" />
@@ -47,31 +47,42 @@
              }}</el-radio>
            </el-form-item>
          </el-col>
          <el-col :span="5">
            <el-form-item label="联系电话" prop="phone">
              <el-input v-model="form.phone" placeholder="请输入联系电话" />
            </el-form-item>
          </el-col>
          <el-col :span="5">
            <el-form-item label="捐献者" prop="name">
              <el-input :disabled="true" v-model="form.donorname" placeholder="请输入捐献者姓名" />
            </el-form-item>
          </el-col>
          <el-col :span="5" v-if="ismanager == true">
            <el-form-item label="申请金额" prop="pretaxcost">
              <el-input v-model="form.pretaxcost" placeholder="税前金额合计" :disabled="true" />
            </el-form-item>
          </el-col>
          <el-col :span="5">
            <el-form-item label="所属组别" prop="deptmentname">
              <el-input v-model="form.deptmentname" placeholder="请输入所属组别" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="5">
            <el-form-item label="组长" prop="managername">
              <el-input v-model="form.managername" placeholder="请输入组长" clearable />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row style="text-align: left">
          <el-col :span="8">
          <el-col :span="5">
            <el-form-item label="捐献案例" prop="name">
              <el-input :disabled="true" v-model="form.donorname" placeholder="请输入捐献者姓名" />
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <div style="margin-left: 10px;">
              <dict-tag
                :options="dict.type.sys_DonationStatus"
                :value="form.invoicecount"
              />
            </div>
          </el-col>
          <el-col :span="10">
            <el-form-item label="申请说明" prop="remark">
              <el-input v-model="form.remark" placeholder="申请说明" />
            </el-form-item>
          </el-col>
          <!--
          <!--
          <el-col :span="5">
            <el-form-item label="申请状态" prop="recordstatus">
              <el-select v-model="form.recordstatus" placeholder="请选择审核状态" clearable size="small" :disabled="true">
@@ -90,23 +101,34 @@
        </el-row>
        <el-row>
          <el-col :span="3" v-if="businessType == '1'">
            <el-button @click.native.prevent="importFeeItems" type="primary" size="small">
              导入服务项目
            </el-button>
          </el-col>
          <el-col :span="3">
            <div style="margin-bottom: 15px;" v-if="businessType == 2">
              <el-button type="success" icon="el-icon-download" @click="Batchentry">批量录入</el-button>
            <div style="margin-bottom: 15px;">
              <el-button type="primary" icon="el-icon-download" size="small" @click.native.prevent="importFeeItems">
                批量导入服务项目
              </el-button>
            </div>
          </el-col>
          <el-col :span="3">
            <div style="margin-bottom: 15px;" v-if="userprofile.nickName == '陈慕华' &&
              (businessType == '1' || businessType == '2')
              ">
              <el-button type="success" icon="el-icon-edit-outline" @click="Manualcalculationfn">计算个税</el-button>
          <el-col :span="3" v-if="businessType == 2">
            <div style="margin-bottom: 15px;">
              <el-button type="primary" icon="el-icon-download" size="small" @click="Batchentry">批量录入专家</el-button>
            </div>
          </el-col>
          <!-- <el-col
            :span="3"
            v-if="
              userprofile.nickName == '陈慕华' &&
                (businessType == '1' || businessType == '2')
            "
          >
            <div style="margin-bottom: 15px;">
              <el-button
                type="success"
                icon="el-icon-edit-outline"
                size="small"
                @click="Manualcalculationfn"
                >计算个税</el-button
              >
            </div>
          </el-col> -->
        </el-row>
        <el-row>
          <el-table :data="rbDetails" v-loading="loading" max-height="800" border highlight-current-row>
@@ -115,10 +137,6 @@
                <el-input v-model="scope.row.orderno" placeholder="序号" />
              </template>
            </el-table-column>
            <!--
            <el-table-column prop="itemcode" align="center" label="项目编号" show-overflow-tooltip=""
              v-if="form.applytype == '1'">
            </el-table-column>-->
            <el-table-column prop="applytype" align="center" label="服务类型" width="200">
              <template slot-scope="scope">
                <el-select v-model="scope.row.applytype" placeholder="请选择服务类型" @change="verifyFeeItemType(scope.row)">
@@ -129,8 +147,8 @@
            </el-table-column>
            <el-table-column prop="itemid" align="center" label="服务项目" width="260">
              <template slot-scope="scope">
                <el-select v-model="scope.row.itemid" placeholder="请选择服务项目" filterable @change="verifyFeeItem(scope.row)"
                  :filter-method="val => searchItemType(val, scope)">
                <el-select v-model="scope.row.itemid" placeholder="请选择服务项目" filterable
                  @change="verifyFeeItem(scope.row)" :filter-method="val => searchItemType(val, scope)">
                  <el-option v-for="dict in scope.row.itemlist" :key="dict.index" :label="dict.itemName"
                    :value="dict.id"></el-option>
                </el-select>
@@ -147,18 +165,20 @@
            </el-table-column>
            <el-table-column prop="price" align="center" label="单价" width="120" v-if="businessType == 4">
              <template slot-scope="scope">
                <el-input v-model="scope.row.price" placeholder="单价" @blur="val => {
                  sumTotalFee(scope.row);
                }
                  " />
                <el-input v-model="scope.row.price" placeholder="单价" @blur="
                  val => {
                    sumTotalFee(scope.row);
                  }
                " />
              </template>
            </el-table-column>
            <el-table-column prop="quantity" align="center" label="数量" width="120" v-if="businessType == 4">
              <template slot-scope="scope">
                <el-input v-model="scope.row.quantity" placeholder="数量" @blur="val => {
                  sumTotalFee(scope.row);
                }
                  " />
                <el-input v-model="scope.row.quantity" placeholder="数量" @blur="
                  val => {
                    sumTotalFee(scope.row);
                  }
                " />
              </template>
            </el-table-column>
            <el-table-column prop="amount" align="center" :label="amountlabel" width="120">
@@ -166,14 +186,16 @@
                <el-input v-model="scope.row.amount" placeholder="金额" />
              </template>
            </el-table-column>
            <el-table-column prop="taxamount" align="center" label="扣税金额" width="120"
              v-if="(ismanager == true) && (businessType == '1' || businessType == '2')">
            <el-table-column prop="taxamount" align="center" label="扣税金额" width="120" v-if="
              ismanager == true &&
              (businessType == '1' || businessType == '2')
            ">
              <template slot-scope="scope">
                <el-input v-model="scope.row.taxamount" placeholder="扣税金额" />
              </template>
            </el-table-column>
            <el-table-column prop="taxedamount" align="center" label="税后金额" width="120"
              v-if="(ismanager == true) && (businessType == '1' || businessType == '2')">
              v-if="businessType == '1' || businessType == '2'">
              <template slot-scope="scope">
                <el-input v-model="scope.row.taxedamount" placeholder="税后金额" />
              </template>
@@ -182,7 +204,10 @@
              width="200">
              <template slot-scope="scope">
                <el-button type="primary" plain @click="showSelectionDialog(scope, 'account')">{{
                  scope.row.beneficiaryname ? scope.row.beneficiaryname : "点击选择" }}</el-button>
                  scope.row.beneficiaryname
                    ? scope.row.beneficiaryname
                    : "点击选择"
                }}</el-button>
              </template>
            </el-table-column>
            <el-table-column prop="unitno" align="center" label="专家所在单位" width="250"
@@ -193,33 +218,7 @@
                }}</el-button>
              </template>
            </el-table-column>
            <!--
            <el-table-column prop="unitname" align="center" label="单位(个人)名称" width="300"
              v-if="form.applytype == '4' || form.applytype == '3'">
              <template slot-scope="scope">
                <el-button type="primary" plain @click="showSelectionDialog(scope, 'account')">{{
                  scope.row.unitname
                  ? scope.row.unitname
                  : "点击选择"
                }}</el-button>
                <el-select
                  v-model="scope.row.unitno"
                  placeholder="单位"
                  clearable
                  filterable
                  allow-create
                >
                  <el-option
                    v-for="(spec, index) in unitList"
                    :key="index"
                    :label="spec.organizationname"
                    :value="spec.organizationid"
                  ></el-option>
                </el-select>
              </template>
            </el-table-column>
             -->
            <el-table-column prop="title" align="center" label="职称" width="120"
              v-if="businessType == '1' || businessType == '2'">
              <template slot-scope="scope">
@@ -229,22 +228,22 @@
            <el-table-column prop="idcardno" align="center" label="身份证号" width="200"
              v-if="businessType == '1' || businessType == '2'">
              <template slot-scope="scope">
                <el-form-item :error="scope.row.error" label-width="0">
                  <el-input :disabled="userprofile.nickName != '陈慕华'
                    " v-model.number="scope.row.idcardno" @input="tableParValueChange1(scope.row)"
                    placeholder="身份证号" />
                <el-form-item label-width="0">
                  <el-input :disabled="userprofile.nickName != '陈慕华' || scope.row.isunit == 1"
                    :placeholder="scope.row.isunit == 1 ? '单位无需填写' : '身份证号'"
                    v-model.number="scope.row.idcardno" @input="tableParValueChange1(scope.row)" />
                </el-form-item>
              </template>
            </el-table-column>
            <el-table-column prop="depositbank" align="center" label="开户银行" width="200">
              <template slot-scope="scope">
                <el-input :disabled="userprofile.nickName != '陈慕华'" v-model="scope.row.depositbank" placeholder="开户银行" />
                <el-input :disabled="userprofile.nickName != '陈慕华'" v-model="scope.row.depositbank"
                  placeholder="开户银行" />
              </template>
            </el-table-column>
            <el-table-column prop="bankcardno" align="center" label="银行帐号" width="210">
              <template slot-scope="scope">
                <el-input :disabled="userprofile.nickName != '陈慕华'
                  " v-model="scope.row.bankcardno" placeholder="银行帐号" />
                <el-input :disabled="userprofile.nickName != '陈慕华'" v-model="scope.row.bankcardno" placeholder="银行帐号" />
              </template>
            </el-table-column>
            <el-table-column prop="itemdescrisca" align="center" width="330" label="项目说明">
@@ -259,22 +258,28 @@
            </el-table-column>
            <el-table-column fixed="right" align="center" label="操作" width="180">
              <template slot-scope="scope">
                <el-button type="text" size="mini" @click="addRow(scope.$index)" v-if="operationType == 'add' ||
                <el-button type="text" size="mini" @click="addRow(scope.$index)" v-if="
                  operationType == 'add' ||
                  operationType == 'update' ||
                  operationType == 'check'
                  ">新增</el-button>
                ">新增</el-button>
                <el-button @click.native.prevent="
                  deleteRows(scope.row, scope.$index, rbDetails)
                  " type="text" size="small" v-if="operationType == 'add' ||
    operationType == 'update' ||
    operationType == 'check'
    ">
                  " type="text" size="small" v-if="
                    operationType == 'add' ||
                    operationType == 'update' ||
                    operationType == 'check'
                  ">
                  删除
                </el-button>
                <el-button @click.native.prevent="
                  Filepopup(scope.$index, rbDetails, scope.row)
                  " type="text" size="small" v-if="businessType == 2 || businessType == 3 || businessType == 4
    ">票据</el-button>
                  " type="text" size="small" v-if="
                    businessType == 2 ||
                    businessType == 3 ||
                    businessType == 4 ||
                    businessType == 1
                  ">票据</el-button>
              </template>
            </el-table-column>
          </el-table>
@@ -305,7 +310,7 @@
                <el-table-column prop="name" width="180" :show-overflow-tooltip="true" label="功能">
                  <template slot-scope="scope">
                    <el-button type="primary" size="mini"
                    <el-button type="danger" 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>
@@ -315,10 +320,11 @@
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-if="operationType == 'detail' ||
        <el-row v-if="
          operationType == 'detail' ||
          operationType == 'check' ||
          operationType == 'update'
          ">
        ">
          <el-table :data="fundflowList" border>
            <el-table-column label="审核日期" align="center" width="160" prop="createTime" />
            <el-table-column label="审核人" align="center" width="120" prop="checkusername" />
@@ -334,12 +340,21 @@
        <el-row style="margin-top: 25px; margin-bottom: 5px"
          v-if="operationType == 'check' && userprofile.nickName == '陈慕华'">
          <el-col :span="20">
            <el-form-item label="申请材料状态" prop="infoid">
          <el-col :span="12">
            <el-form-item label="预审状态" prop="infoid">
              <el-radio-group v-model="form.checkstatus" align="left">
                <el-radio :label="1">待申请材料</el-radio>
                <el-radio :label="2">审核通过等待邮寄纸质材料</el-radio>
                <el-radio :label="3">已收到报销材料</el-radio>
                <el-radio :label="1">待审核</el-radio>
                <el-radio :label="2">预审通过等待纸质材料</el-radio>
                <el-radio :label="3">已收到纸质材料</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="12" v-if="businessType == 1">
            <el-form-item label="算税状态" prop="infoid">
              <el-radio-group v-model="form.istax" align="left">
                <el-radio :label="-1">审核中</el-radio>
                <el-radio :label="0">允许算税</el-radio>
                <el-radio :label="1">已算税</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
@@ -363,10 +378,11 @@
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm" v-if="operationType == 'add' ||
        <el-button type="primary" @click="submitForm" v-if="
          operationType == 'add' ||
          operationType == 'update' ||
          ismanager == true
          ">保存</el-button>
        ">保存</el-button>
        <el-button type="success" @click="handleup"
          v-if="operationType == 'add' || operationType == 'update'">上报</el-button>
        <el-button type="primary" @click="checksubmit" v-if="operationType == 'check'">提交审核</el-button>
@@ -379,11 +395,11 @@
      <el-form ref="accountselectform" :rules="dialogrules" :model="accountselectform" label-width="120px">
        <el-row v-if="selectionType == 'workunit'">
          <el-col :span="24">
            <el-form-item label="单位名称" prop="expertunitno" label-width="120px">
              <el-select v-model="accountselectform.expertunitno" placeholder="单位名称" clearable filterable allow-create
            <el-form-item label="单位名称" prop="expertunitname" label-width="120px">
              <el-select v-model="accountselectform.expertunitname" placeholder="单位名称" clearable filterable allow-create
                style="width: 100%">
                <el-option v-for="(spec, index) in unitList" :key="index" :label="spec.organizationname"
                  :value="spec.organizationid"></el-option>
                  :value="spec.organizationname"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
@@ -393,7 +409,7 @@
            <el-form-item label="账户来源" prop="accountfrom" class="left-align">
              <el-radio-group v-model="accountfrom" style="margin-bottom: 0">
                <el-radio label="1">从账户库</el-radio>
                <el-radio label="2">新增账户(新增后需要审核确认才能启用)</el-radio>
                <el-radio label="2">新增账户(新增专家账户后需要审核启用才能使用)</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
@@ -401,35 +417,54 @@
            <el-form-item label="账户名称" prop="accountname">
              <el-select filterable allow-create ref="accountname" default-first-option
                v-model="accountselectform.accountname" placeholder="请选择" style="width: 100%">
                <el-option v-for="item in accountlist" :key="item.id" :label="item.username" :value="item.username">
                <el-option v-for="item in accountlist" :key="item.id" :label="item.userid" :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-if="accountfrom == '2'">
          <el-col :span="16"><el-form-item label="新增类型" prop="usertype">
              <el-radio-group v-model="accountselectform.usertype" style="margin-bottom: 0">
                <el-radio label="expert">新增专家账号</el-radio>
                <el-radio label="org">新增单位账号</el-radio>
        <el-row v-if="selectionType == 'account' && accountfrom == '2'">
          <el-col :span="24">
            <el-form-item label="新增类型" prop="usertype" class="left-align">
              <el-radio-group v-model="accountselectform.usertype" style="margin-bottom: 0"
                @change="userTypeChange(accountselectform.usertype)">
                <el-radio label="expert">专家账户</el-radio>
                <el-radio label="org">单位账户</el-radio>
                <el-radio label="donor">捐献者亲属账户</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-if="accountfrom == '2'">
        <el-row v-if="selectionType == 'account' && accountfrom == '2'">
          <el-col :span="24">
            <el-form-item label="账号名称" prop="username">
              <el-input v-model="accountselectform.username" placeholder="请输入单位名称或专家姓名" />
            <el-form-item label="账户名称" prop="username">
              <el-input v-model="accountselectform.username" placeholder="请输入单位名称,或专家姓名,或其他账号" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-if="accountfrom == '2' && accountselectform.usertype != 'org'">
          <el-col :span="12">
            <el-form-item label="身份证号" prop="idcardno">
              <el-input v-model="accountselectform.idcardno" placeholder="请输入身份证号" />
        <el-row v-if="
          selectionType == 'account' &&
          accountfrom == '2' &&
          accountselectform.usertype == 'org'
        ">
          <el-col :span="24">
            <el-form-item label="税号" prop="unitTaxNo">
              <el-input v-model="accountselectform.unitTaxNo" placeholder="请输入税号" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-if="
          selectionType == 'account' &&
          accountfrom == '2' &&
          accountselectform.usertype != 'org'
        ">
          <el-col :span="12">
            <el-form-item label="身份证号" prop="idcardno">
              <el-input v-model="accountselectform.idcardno" placeholder="请输入身份证号" @blur="handleIdCardBlur" />
            </el-form-item>
          </el-col>
          <el-col :span="12" v-if="accountselectform.usertype == 'expert'">
            <el-form-item label="职称" prop="title">
              <el-select v-model="accountselectform.title" placeholder="请选择人员职称">
                <el-option v-for="dict in dict.type.sys_professionaltitle" :key="dict.value" :label="dict.label"
@@ -438,7 +473,11 @@
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-if="accountfrom == '2' && accountselectform.usertype != 'org'">
        <el-row v-if="
          selectionType == 'account' &&
          accountfrom == '2' &&
          accountselectform.usertype == 'expert'
        ">
          <el-col>
            <el-form-item label="所在单位" prop="unitno">
              <el-select v-model="accountselectform.unitno" placeholder="单位名称" clearable filterable allow-create
@@ -454,7 +493,7 @@
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-if="accountfrom == '2'">
        <el-row v-if="selectionType == 'account' && accountfrom == '2'">
          <el-col><el-form-item label="开户银行" prop="depositbank">
              <el-input v-model="accountselectform.depositbank" placeholder="请输入开户银行名称" />
            </el-form-item>
@@ -464,14 +503,14 @@
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-if="accountfrom == '2'">
        <el-row v-if="selectionType == 'account' && accountfrom == '2'">
          <el-col>
            <el-form-item label="联系地址" prop="address">
              <el-input v-model="accountselectform.address" placeholder="请输入联系地址" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-if="accountfrom == '2'">
        <el-row v-if="selectionType == 'account' && accountfrom == '2'">
          <el-col>
            <el-form-item label="联系电话" prop="telephone">
              <el-input v-model="accountselectform.telephone" placeholder="请输入联系电话" />
@@ -486,7 +525,7 @@
    </el-dialog>
    <el-dialog v-dialogDrags :modal="false" :close-on-click-modal="false" :title="pdftitle" :visible.sync="pdfVisible"
      width="60%">
      <div>
      <div style="margin-bottom: 10px;">
        <el-table :data="tableDatatop" style="width: 100%">
          <el-table-column v-if="businessType == 4" prop="price" align="center" label="单价">
          </el-table-column>
@@ -494,9 +533,10 @@
          </el-table-column>
          <el-table-column prop="amount" align="center" :label="amountlabel">
          </el-table-column>
          <el-table-column prop="taxedamount" align="center" label="税后金额" v-if="(this.ismanager == true) &
          <el-table-column prop="taxedamount" align="center" label="税后金额" v-if="
            (this.ismanager == true) &
            (form.applytype == '1' || form.applytype == '2')
            ">
          ">
          </el-table-column>
          <!-- <el-table-column
            prop="beneficiaryname"
@@ -528,9 +568,10 @@
          </el-table-column>
        </el-table>
      </div>
      <el-alert title="新上传文件需在提交保存后才可进行案例关联,否则视为放弃" type="error" show-icon close-text="知道了">
      </el-alert>
      <el-tabs style="margin-top: 20px;" v-model="activeName" type="border-card" @tab-click="handleClick">
        <el-tab-pane label="普通附件" :name="1">
        <el-tab-pane label="普通附件" name="common">
          <div class="pdfimg">
            <div class="box-pdf">
              <div>
@@ -542,7 +583,8 @@
                  <i class="el-icon-upload"></i>
                  <div class="el-upload__text">
                    将票据拖到此处,或
                    <em><el-button :disabled="operationType == 'detail'" size="small" type="primary">点击上传</el-button></em>
                    <em><el-button :disabled="operationType == 'detail'" size="small"
                        type="primary">点击上传</el-button></em>
                  </div>
                </el-upload>
                <el-table :data="fileListto" @row-click="downFile" style="width: 100%" height="400">
@@ -555,7 +597,7 @@
                  <el-table-column prop="name" width="190" :show-overflow-tooltip="true" label="功能">
                    <template slot-scope="scope">
                      <el-button type="primary" size="mini"
                      <el-button type="danger" 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>
@@ -569,16 +611,19 @@
            <div v-if="this.previewpdf && pdfimgsrcList.length" class="pdfimgmin">
              <!-- <img :src="pdfimg" /> -->
              <el-image style="width: 95%; height: 90%" :src="pdfimg" :preview-src-list="pdfimgsrcList">
              <el-image ref="imagePreview" style="width: 95%; height: 90%" :src="pdfimg"
                @click="handleImageClick(initialIndex)">
                <!-- <div slot="error" class="image-slot">
              <i class="el-icon-picture-outline"></i>
            </div> -->
                <i class="el-icon-picture-outline"></i>
              </div> -->
              </el-image>
              <custom-image-viewer :url-list="pdfimgsrcList" :initial-index="currentIndex" :visible="viewerVisible"
                @update:visible="viewerVisible = $event" @close="handleViewerClose" />
            </div>
            <div v-else class="pdfimgmins">{{ hintitle }}</div>
          </div>
        </el-tab-pane>
        <el-tab-pane label="发票文件" :name="2">
        <el-tab-pane label="发票文件" name="invoice">
          <div class="pdfimg">
            <div class="box-pdf">
              <div>
@@ -590,7 +635,8 @@
                  <i class="el-icon-upload"></i>
                  <div class="el-upload__text">
                    将发票文件拖到此处,或
                    <em><el-button :disabled="operationType == 'detail'" size="small" type="primary">点击上传</el-button></em>
                    <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">
@@ -617,11 +663,15 @@
            <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">
              <el-image style="width: 95%; height: 90%" :src="invoicepdfimg"
                @click="invoicehandleImageClick(initialIndex)">
                <!-- <div slot="error" class="image-slot">
              <i class="el-icon-picture-outline"></i>
            </div> -->
                <i class="el-icon-picture-outline"></i>
              </div> -->
              </el-image>
              <custom-image-viewer :url-list="invoicepdfimgsrcList" :initial-index="invoicecurrentIndex"
                :visible="invoiceviewerVisible" @update:visible="invoiceviewerVisible = $event"
                @close="invoicehandleViewerClose" />
            </div>
            <div v-else class="pdfimgmins">{{ hintitle }}</div>
          </div>
@@ -641,13 +691,19 @@
    </el-dialog>
    <!-- 批量选取 -->
    <el-dialog title="批量生成明细信息" :visible.sync="batchdialogVisible" width="30%">
    <el-dialog title="批量生成明细信息" :visible.sync="batchdialogVisible" width="35%">
      <div style="margin-bottom: 12px">
        <el-input v-model="personKeyword" clearable size="small" prefix-icon="el-icon-search"
          placeholder="输入 姓名 / 单位 / 工号 / 身份证后4位 筛查" style="width: 330px" />
        <span style="margin-left: 10px; color: #909399; font-size: 12px">共 {{ filteredCityOptions.length }} 人</span>
      </div>
      <div style="max-height: 300px; overflow-y: auto">
        <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
        <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选(当前筛查结果)</el-checkbox>
        <div style="margin: 15px 0;"></div>
        <el-checkbox-group v-model="checkedCities" @change="handleCheckedCitiesChange">
          <el-checkbox border v-for="city in cityOptions" :label="city" :key="city.reportNo">{{ city.reportName
          }}</el-checkbox>
          <el-checkbox border v-for="city in filteredCityOptions" :label="city"
            :key="city.reportNo + '_' + city.reportName">{{ city.reportName
            }}{{ city.unitname ? " · " + city.unitname : "" }}</el-checkbox>
        </el-checkbox-group>
      </div>
@@ -660,6 +716,8 @@
</template>
<script>
import store from "@/store";
// 'sdaad2123UD2',1  'wsadadwsad',4 'sdadaddad',3 'ssaaddxs',2
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';
@@ -684,7 +742,9 @@
  getdownloadBX,
  addorupdateFund,
  ManualCalculation,
  getdetailsByItemId
  getdetailsByItemId,
  validateExpertFee,
  listbypower
} from "@/api/project/fund";
import {
@@ -724,7 +784,8 @@
  delExternalperson,
  addExternalperson,
  updateExternalperson,
  exportExternalperson
  exportExternalperson,
  getOnlyCode, getInfoByIDCardNo
} from "@/api/project/externalperson";
import { listItemexpense } from "@/api/project/itemexpense";
@@ -733,12 +794,16 @@
import Li_area_select from "@/components/Address";
import OrgSelecter from "@/views/project/components/orgselect";
import { getToken } from "@/utils/auth";
import { moneySum, moneyMul, moneySub, moneyRound } from "@/utils/money";
import { checkFileName, checkDetails } from "@/utils/fileNameCheck";
import CustomImageViewer from "@/components/CustomImageViewer"; // 根据你的路径调整
export default {
  //import引入的组件需要注入到对象中才能使用
  components: {
    Li_area_select,
    OrgSelecter
    OrgSelecter,
    CustomImageViewer
  },
  name: "fundApply",
@@ -754,19 +819,40 @@
    //"sys_finsubject",
    //"sys_financeitemtype",
    //"sys_expensetype",
    'sys_DonationStatus',
    "sys_recordstatus",
    "sys_professionaltitle"
  ],
  data() {
    var validatePass = (rule, value, callback) => {
    // 自定义身份证号校验器
    const validateIdCard = (rule, value, callback) => {
      // 1. 如果为空,交给 required 规则去处理,这里直接放行
      if (!value) {
        return callback();
      }
      const regex = /^[1-9]\d{5}(19|20)\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}([0-9]|X)$/;
      if (regex.test(value)) {
        callback();
      } else {
        callback(new Error("身份证号码格式错误"));
      }
      // 2. 调用后端接口进行重复性校验
      getInfoByIDCardNo(value).then(res => {
        // 假设后端返回的 res.data 是数组,且长度大于0表示已存在
        if (res.data && res.data.length > 0) {
          // 校验不通过,将错误信息传给 callback
          callback(new Error("身份证号信息已被登记,请检查!"));
        } else {
          // 校验通过
          callback();
        }
      }).catch(() => {
        // 接口异常时的处理
        callback(new Error("校验身份证号时发生网络错误"));
      });
    };
    //这里存放数据
    return {
      // 遮罩层
@@ -785,7 +871,7 @@
      businessName: "",
      //操作类型
      operationType: "",
      Loadornot: false,
      //当前单据id
      curId: 0,
      //当前选中捐献案例
@@ -805,6 +891,8 @@
      // 网络请求头
      Networkheader: null,
      batchdialogVisible: false,
      //批量录入弹框的筛查关键字
      personKeyword: "",
      itemlist: [],
      cityOptions: [],
      checkAll: false,
@@ -818,11 +906,11 @@
      baselisttages: [
        {
          id: 1,
          name: "材料待审核"
          name: "待审核"
        },
        {
          id: 2,
          name: "审查通过等待邮寄纸质材料"
          name: "预审通过等待纸质材料"
        },
        {
          id: 3,
@@ -870,9 +958,6 @@
      // 表单校验
      rules: {
        // createTime: [
        //   { required: true, message: "请输入填报日期", trigger: "blur" }
        // ],
        reason: [
          { required: true, message: "请输入出差事由", trigger: "blur" }
        ],
@@ -880,16 +965,37 @@
          { required: true, message: "请输入所属业务组", trigger: "blur" }
        ]
      },
      dialogrules: {
        // expertidcardno: [{ validator: validatePass, trigger: "blur" }],
        usertype: [
          { required: true, message: "请输入账户类型", trigger: "blur" }
        ],
        username: [
          { required: true, message: "请输入账户名称", trigger: "blur" }
        ],
        unitTaxNo: [{ required: true, message: "请输入税号", trigger: "blur" }],
        idcardno: [
          {
            // 账户类型选择"单位机构"时不需要身份证号
            validator: (rule, value, callback) => {
              if (this.hasUserType(this.accountselectform.usertype, "org")) {
                return callback();
              }
              if (!value || !String(value).trim()) {
                return callback(new Error("请输入身份证号"));
              }
              return callback();
            },
            trigger: "blur"
          },
          // 添加自定义校验规则
          { validator: validateIdCard, trigger: 'blur' }
        ],
        depositbank: [
          { required: true, message: "请输入开户银行", trigger: "change" }
        ],
        bankcardno: [
          { required: true, message: "请输入银行卡号", trigger: "change" }
        ],
        unitno: [
          { required: true, message: "请选择单位名称", trigger: "change" }
        ]
      },
@@ -908,13 +1014,15 @@
        unitno: null,
        personnelunitno: null,
        address: null,
        telephone: null
        telephone: null,
        username: null,
        userno: null
      },
      accountform: {
        searchValue: null,
        id: null,
        userstatus: 1,
        userstatus: 0,
        usertype: null,
        pym: null,
@@ -946,6 +1054,8 @@
        flowconclusion: null,
        fundid: null
      },
      // 连续审批:待审批单据列表
      pendingList: [],
      // 查询参数
      queryParams: {
@@ -980,6 +1090,11 @@
        username: null,
        usertype: null
      },
      // 查询最新序号参数
      seqnoParams: {
        businessType: "externalperson",
        datequery: false
      },
      //计算个税参数
      taxParam: {
@@ -1005,9 +1120,10 @@
      invoicepdfimg: "",
      invoicepdfimgsrcList: [],
      invoDatatop: [],
      activeName: 1, //文件类型
      activeName: "common", //文件类型
      //上传附件路径
      uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload",
      ICDtoken: getToken(),
      //文件上传token
      headers: {
        Authorization: "Bearer " + getToken()
@@ -1016,6 +1132,11 @@
      pdftitle: "",
      pdfimg: "",
      pdfimgsrcList: [],
      currentIndex: 0, // 初始索引
      invoicecurrentIndex: 0, // 初始索引
      initialIndex: 0, // 初始索引
      viewerVisible: false, // 控制预览组件显示
      invoiceviewerVisible: false, // 控制预览组件显示
      pdfVisible: false,
      previewpdf: false,
      hintitle: "请上传文件后查看",
@@ -1028,7 +1149,16 @@
  },
  //监听属性 类似于data概念
  computed: {},
  computed: {
    //批量录入弹框:按关键字(姓名/单位/工号/身份证后4位)筛查后的候选人
    filteredCityOptions() {
      const kw = (this.personKeyword || "").trim().toLowerCase();
      if (!kw) {
        return this.cityOptions;
      }
      return this.cityOptions.filter(item => this.personMatchKeyword(item, kw));
    }
  },
  //监控data中的数据变化
  watch: {},
  //方法集合
@@ -1183,9 +1313,12 @@
        this.businessType == "2" ||
        this.businessType == "3"
      ) {
        console.log(this.curCase,'this.curCase');
        this.form.infoid = this.curCase.id;
        this.form.donorname = this.curCase.name;
        this.form.donorno = this.curCase.donorno;
        this.form.invoicecount = this.curCase.recordstate;
      }
      //初始化明细
@@ -1199,11 +1332,8 @@
      this.reset();
      getFund(this.curId).then(response => {
        console.log(response.data, "初始");
        this.form = response.data;
        sessionStorage.removeItem("apiform");
        sessionStorage.setItem("apiform", JSON.stringify(this.form));
        // this.form.recordstate =-1;
@@ -1251,8 +1381,6 @@
      this.reset();
      getFund(this.curId).then(response => {
        console.log(response.data, "初始");
        this.form = response.data;
        sessionStorage.removeItem("apiform");
        sessionStorage.setItem("apiform", JSON.stringify(this.form));
@@ -1262,7 +1390,7 @@
        //业务明细
        getownFundDetail(this.curId).then(res => {
          this.rbDetails = res.data;
          console.log("this.feeBlocks", this.feeBlocks);
          for (let m = 0; m < this.rbDetails.length; m++) {
            this.rbDetails[m].itemlist = [];
            this.getRowFeeItems(m, this.rbDetails[m]);
@@ -1270,10 +1398,6 @@
            //获取费用项目的详细信息
            this.rbDetails[m].rowfeeblocks = this.feeBlocks.filter(
              r => r.itemid == this.rbDetails[m].itemid
            );
            console.log(
              "this.rbDetails[m].rowfeeblocks",
              this.rbDetails[m].rowfeeblocks
            );
          }
@@ -1297,12 +1421,18 @@
    handleCheck() {
      this.isopen = 0;
      this.reset();
      // 重置审批信息,避免上一单的审批结果带入下一单
      this.checkObj = {
        flowlevelone: null,
        flowconclusion: null,
        fundid: null
      };
      // 连续审批:加载当前业务类型下的待审批列表
      this.getPendingList();
      getFund(this.curId).then(response => {
        console.log(response.data, "初始");
        this.form = response.data;
        sessionStorage.removeItem("apiform");
        sessionStorage.setItem("apiform", JSON.stringify(this.form));
        //附件处理
@@ -1379,7 +1509,7 @@
          //判断是否存在上报记录
          this.form.recordstatus = 0;
          var currenttime = new Date();
          this.form.createTime =
          this.form.applyTime =
            currenttime.getFullYear() +
            "-" +
            (currenttime.getMonth() + 1) +
@@ -1432,6 +1562,11 @@
    },
    /** 提交按钮 */
    submitForm: debounce(function () {
      // 2026-10-15:保存前附件文件名规范校验(仅新增单据;老单据的历史附件由后端按"只校验本次变更"放行)
      if (!this.checkDetailFileNames()) {
        return;
      }
      if (!this.randomnumber) {
        this.randomnumber = this.generateRandomString(9);
        this.form.randomnumber = this.randomnumber;
@@ -1440,6 +1575,31 @@
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.formData = this.form;
          // 专家劳务费专用:9 条费用控制规则校验(校验不通过不允许保存)
          if (this.businessType == "1") {
            this.$modal.loading("正在校验专家劳务费用,请稍候!");
            this.checkExpertFeeRules("保存").then((allowed) => {
              this.$modal.closeLoading();
              if (allowed) {
                this.doSubmitForm();
              }
            });
            return;
          }
          this.doSubmitForm();
        }
      });
    }, 500),
    /**
     * 保存申请单的实际落库逻辑。
     *
     * 从 submitForm 中拆出,便于在专家劳务费规则校验通过后再执行;
     * 其他业务类型由 submitForm 直接调用,行为与拆分前一致。
     */
    doSubmitForm() {
          //保存前校验数据
          for (let k = 0; k < this.rbDetails.length; k++) {
@@ -1452,22 +1612,6 @@
              );
              return;
            }
            /*
            if (
              tempDetail.idcardno == null &&
              this.businessType != "3" &&
              this.businessType != "4"
            ) {
              console.log(1122);
              this.$modal.msgWarning(
                "服务项目表中,第" +
                  (k + 1).toString() +
                  "行的身份证未完善,请先填写身份证后再提交保存!"
              );
              return;
            }
            */
            if (this.businessType == "1") {
              if (tempDetail.servicesscope == null) {
@@ -1526,7 +1670,7 @@
              let tempDetail = this.rbDetails[j];
              if (
                isNaN(parseFloat(tempDetail.amount)) ||
                parseFloat(tempDetail.amount) == 0
                moneyRound(tempDetail.amount) == 0
              ) {
                this.$modal.msgWarning(
                  "服务项目表中,第" +
@@ -1541,7 +1685,7 @@
              let tempDetail = this.rbDetails[j];
              if (
                isNaN(parseFloat(tempDetail.amount)) ||
                parseFloat(tempDetail.amount) == 0
                moneyRound(tempDetail.amount) == 0
              ) {
                this.$modal.msgWarning(
                  "服务项目表中,第" +
@@ -1552,7 +1696,7 @@
              }
              if (
                isNaN(parseFloat(tempDetail.taxamount)) ||
                parseFloat(tempDetail.taxamount) == 0
                moneyRound(tempDetail.taxamount) == 0
              ) {
                tempDetail.taxedamount = parseFloat(tempDetail.amount);
              } else {
@@ -1594,6 +1738,19 @@
            // });
          } else {
            this.form.recordstatus = -1;
            var currenttime = new Date();
            this.form.applyTime =
              currenttime.getFullYear() +
              "-" +
              (currenttime.getMonth() + 1) +
              "-" +
              currenttime.getDate() +
              " " +
              currenttime.getHours() +
              ":" +
              currenttime.getMinutes() +
              ":" +
              currenttime.getSeconds();
            // addorupdateFund(this.form).then((response) => {
            //   if (response.code === 200) {
@@ -1611,9 +1768,7 @@
          sessionStorage.setItem("apiform", JSON.stringify(this.form));
          addorupdateFund(this.form)
            .then(response => {
              console.log(this.form);
              console.log(response, "保存返参");
              if (response.code === 200) {
              if (response.code == 200) {
                if (this.form.id) {
                  this.$modal.msgSuccess("申请单修改成功!");
                  this.$router.go(-1);
@@ -1624,7 +1779,7 @@
                    path: "/finance/applyDetail/",
                    query: {
                      id: response.data,
                      businessType: "2",
                      businessType: this.businessType,
                      operationType: "update",
                      curCase: this.curCase
                    }
@@ -1643,48 +1798,188 @@
          //关闭窗口
          this.loading = false;
          // this.getfundList();
        }
    },
    /**
     * 专家劳务费 9 条费用控制规则校验(提交前拦截)。
     *
     * 适用范围:businessType === '1'(专家劳务费申请单),与后端 applytype === '1' 对应。
     * 其他业务类型(伦理专家费、医学成本、办公费用)不校验,直接放行。
     *
     * 校验口径(同一捐献案例 infoid 下累计)由后端统一实现:
     *   errors   阻断型:提示违反的具体规则,不允许继续保存/审核
     *   warnings 提示型:仅提醒经办人处理(规则 5、6),需二次确认后才继续
     *
     * @param {string} action 当前动作,用于拼接提示文案(如“保存”“提交审核”)
     * @returns {Promise<boolean>} true 允许继续,false 阻止继续
     */
    checkExpertFeeRules(action) {
      if (this.businessType != "1") {
        return Promise.resolve(true);
      }
      // 后端按「案例内已有单据 + 本次提交明细」合并计算,确保尚未落库的明细也参与校验
      const payload = Object.assign({}, this.form, {
        applytype: this.form.applytype || "1",
        serviceFunddetails: this.rbDetails,
      });
    }, 500),
      // 排查用:能直接从控制台看到到底送了什么,以及后端判定了什么
      console.log("[专家费校验] 提交校验", action, {
        businessType: this.businessType,
        applytype: payload.applytype,
        infoid: payload.infoid,
        fundId: payload.id,
        明细: (this.rbDetails || []).map((d) => ({
          itemid: d.itemid,
          amount: d.amount,
          taxedamount: d.taxedamount,
          场景: d.servicesscopename,
        })),
      });
      return validateExpertFee(payload)
        .then((res) => {
          const errors = (res && res.errors) || [];
          const warnings = (res && res.warnings) || [];
          console.log("[专家费校验] 后端返回", { errors, warnings });
    //审批提交
    // checksubmit() {
    //   console.log(this.checkObj.flowlevelone);
    //   if (
    //     this.form.checkstatus != 3 &&
    //     this.userprofile.nickName == "陈慕华" &&
    //     this.checkObj.flowlevelone == 1
    //   ) {
    //     this.$modal.msgError("请选确认材料状态已收到!");
    //     return;
    //   }
    //   this.Savenow();
    //   console.log("保存并审批");
    // },
          // 1) 阻断型:列出违反的具体规则,不允许继续
          //    用弹窗而非轻提示:错误可能有多条,轻提示会挤成一行且很快消失
          if (errors.length > 0) {
            this.$modal.alertError(
              "专家劳务费用不符合以下规定,无法" +
                action +
                ":\n\n" +
                errors.map((msg, i) => i + 1 + ". " + msg).join("\n\n")
            );
            return false;
          }
          // 2) 提示型:需经办人确认后才能继续(当前规则 5、6 已改为硬拦截,此分支保留备用)
          if (warnings.length > 0) {
            const confirmText =
              "专家劳务费用存在以下问题,请确认是否继续" +
              action +
              "?\n\n" +
              warnings.map((msg, i) => i + 1 + ". " + msg).join("\n\n");
            return this.$modal
              .confirm(confirmText)
              .then(() => true)
              .catch(() => false);
          }
          return true;
        })
        .catch((err) => {
          // 接口异常时按“不阻断”处理,避免校验服务不可用导致完全无法报销;
          // 后端 addOrUpdateNew / checkFund 仍有同样的硬拦截兜底。
          console.error("专家劳务费规则校验接口调用失败", err);
          return true;
        });
    },
    checksubmit() {
      console.log(this.checkObj.flowlevelone);
      if (this.userprofile.nickName == "陈慕华") {
        //检查是否收到纸质材料
        if (this.form.checkstatus != 3 && this.checkObj.flowlevelone == 1) {
          this.$modal.msgError("请确认报销的纸质材料已经收到!");
      //检查是否收到纸质材料
      if (this.checkObj.flowlevelone == 2) {
        if (!this.checkObj.flowconclusion) {
          this.$modal.msgError(
            "请输入审核不通过的说明信息,方便经办人修改申请单!"
          );
          return;
        }
      } else if (this.checkObj.flowlevelone == 1) {
        if (this.userprofile.nickName == "陈慕华") {
          //检查是否收到纸质材料
          if (this.form.checkstatus != 3) {
            this.$modal.msgError("请先确认报销的纸质材料是否已经收到!");
            return;
          }
        //检查个税计算
        // if ( (this.form.applytype == "1" || this.form.applytype == "2") && this.form.fundtaxtime == null ) {
        //   this.$modal.msgError(
        //     "提交专家费用申请单、伦理专家申请费用申请单审核,需要先完成个税计算!"
        //   );
        //   return;
        // }
        if (this.form.applytype == "1" && this.form.fundtaxtime == null) {
          this.$modal.msgError("提交专家费用申请单审核,需要先完成个税计算!");
          return;
          //检查个税计算
          if (this.form.applytype == "1" && this.form.fundtaxtime == null) {
            this.$modal.msgError(
              "请先完成专家费用的个税计算后,再提交审核通过!"
            );
            return;
          }
        }
      } else {
        this.$modal.msgError("请先选择审批结果再提交!");
        return;
      }
      this.Savenow();
      console.log("保存并审批");
      // 专家劳务费专用:9 条费用控制规则校验(仅审核通过时拦截)
      const needExpertFeeCheck = this.checkObj.flowlevelone == 1;
      const expertFeePromise = needExpertFeeCheck
        ? this.checkExpertFeeRules("提交审核")
        : Promise.resolve(true);
      expertFeePromise.then((allowed) => {
        if (!allowed) {
          return;
        }
        this.Savenow();
        console.log("保存并审批");
      });
    },
    // 连续审批:获取当前业务类型下的待审批列表
    getPendingList() {
      return listbypower({
        pageNum: 1,
        pageSize: 1000,
        CHECKFLAG: 1,
        APPLYTYPE: this.businessType
      })
        .then(res => {
          this.pendingList = res.rows || [];
        })
        .catch(() => {
          this.pendingList = [];
        });
    },
    // 连续审批:审批完成后询问是否继续审批下一单
    continueOrExit() {
      // 重新拉取待审批列表(当前单据已审批完成被移出列表)
      this.getPendingList().then(() => {
        const list = this.pendingList || [];
        const next = list[0] || null;
        if (next) {
          this.$confirm("审批已完成,是否继续审批下一张待审批单据?", "提示", {
            confirmButtonText: "继续审批",
            cancelButtonText: "返回列表",
            type: "info"
          })
            .then(() => {
              // 在当前页面直接加载下一张待审批单据
              this.curId = next.id;
              this.handleCheck();
              // 同步更新地址栏,避免刷新后回到上一单
              this.$router
                .replace({
                  path: this.$route.path,
                  query: {
                    id: next.id,
                    businessType: this.businessType,
                    operationType: "check"
                  }
                })
                .catch(() => {});
            })
            .catch(() => {
              this.exitToPage();
            });
        } else {
          this.$modal.msgSuccess("已无待审批单据,返回列表");
          this.exitToPage();
        }
      });
    },
    // 返回列表页
    exitToPage() {
      this.$store.dispatch("tagsView/delView", this.$route);
      this.$router.go(-1);
    },
    // 取消按钮
@@ -1697,12 +1992,13 @@
    getUserProfile() {
      getUserProfile().then(res => {
        this.userprofile = res.data;
        console.log(this.userprofile);
        this.standardlevel = res.data.standardlevel;
        if (
          this.userprofile.userName == "admin" ||
          this.userprofile.userName == "001" ||
          this.userprofile.userName == "047"
          this.userprofile.userName == "053" ||
          this.userprofile.userName == "047" ||
          store.getters.rolesor[0].roleSort == "13"
        ) {
          this.ismanager = true;
        } else {
@@ -1717,7 +2013,6 @@
          this.form.managername = this.userprofile.dept.leader;
          this.form.phone = this.userprofile.phonenumber;
          // this.form.applytype = this.businessType;
          // this.form.createTime = new Date();
          if (this.businessType == "4") {
            this.getUserAccount();
@@ -1733,32 +2028,60 @@
      });
    },
    /** 人员类型(多值,逗号分隔)是否包含指定类型;org = 单位机构 */
    hasUserType(usertype, code) {
      if (!usertype) {
        return false;
      }
      return (
        String(usertype)
          .split(",")
          .map(t => t.trim())
          .indexOf(code) > -1
      );
    },
    /** 受益人/账户是否为"单位"(人员类型含 org) */
    //获取专家、单位机构的账户列表
    getAccountList() {
      listExternalperson().then(res => {
        this.accountlist = res.rows;
        /**
        for (let j = 0; j < this.accountlist.length; j++) {
        // this.accountlist = res.rows;
        //获取启用的账户列表
        for (let j = 0; j < res.rows.length; j++) {
          //单位账号列表
          if (this.accountlist[j].usertype == "org") {
            this.feeAccountList.push({
              id: this.accountlist[j].id,
              reportNo: this.accountlist[j].userno,
              reportName: this.accountlist[j].username,
              depositbank: this.accountlist[j].depositbank,
              branchbankname: this.accountlist[j].branchbankname,
              bankcardno: this.accountlist[j].bankcardno
            });
          }
          //专家账号列表
          else if (res.rows[j].usertype == "expert") {
            this.expertAccountList.push({
              expertNo: this.accountlist[j].id,
              exportName: this.accountlist[j].username+"("+this.accountlist[j].id+")"
            });
          if (res.rows[j].userstatus == "1") {
            if (this.hasUserType(res.rows[j].usertype, "org")) {
              this.accountlist.push({
                id: res.rows[j].id,
                userno: res.rows[j].userno,
                username: res.rows[j].username,
                idcardno: res.rows[j].idcardno,
                title: res.rows[j].title,
                depositbank: res.rows[j].depositbank,
                bankcardno: res.rows[j].bankcardno,
                unitno: res.rows[j].unitno,
                unitname: res.rows[j].unitname,
                usertype: res.rows[j].usertype,
                userid:
                  res.rows[j].username + "(" + res.rows[j].bankcardno + ")"
              });
            } else {
              this.accountlist.push({
                id: res.rows[j].id,
                userno: res.rows[j].userno,
                username: res.rows[j].username,
                idcardno: res.rows[j].idcardno,
                title: res.rows[j].title,
                depositbank: res.rows[j].depositbank,
                bankcardno: res.rows[j].bankcardno,
                unitno: res.rows[j].unitno,
                unitname: res.rows[j].unitname,
                usertype: res.rows[j].usertype,
                userid:
                  res.rows[j].username + "(" + res.rows[j].idcardno + ")"
              });
            }
          }
        }
        */
      });
    },
@@ -1766,7 +2089,7 @@
    getUserAccount() {
      this.accountlist.map(res => {
        if (res.username == this.form.username) {
          this.form.bankname = res.depositbank; //res.branchbankname、res.depositbank;
          this.form.bankname = res.depositbank;
          this.form.bankcardno = res.bankcardno;
          this.form.phone = res.telephone;
        }
@@ -1778,7 +2101,6 @@
      listOrganization(3).then(response => {
        for (let i = 0; i < response.rows.length; i++) {
          this.unitList.push({
            //organizationid: response.rows[i].organizationid,
            organizationid: response.rows[i].id,
            organizationname: response.rows[i].organizationname
          });
@@ -1837,7 +2159,6 @@
    //获取服务项目
    getRowFeeItems(rowindex, row) {
      let list = this.feeItemTypes.filter(r => r.itemType == row.applytype);
      console.log(list[0]);
      row.itemlist = list[0].itemDetails;
      this.$set(this.rbDetails, rowindex, row);
    },
@@ -1859,22 +2180,11 @@
            row.amount = 0.0;
            row.taxamount = 0.0;
            row.taxedamount = item.expense;
            //计算税前金额
            // this.calculateTax(row, "B");
          } else {
            row.amount = item.expense;
            row.taxamount = 0.0;
            row.taxedamount = 0.0;
            //计算税后金额
            // this.calculateTax(row, "A");
          }
          // this.form.serviceFunddetails = 0;
          // this.rbDetails.map(item => {
          //   this.form.serviceFunddetails += item.amount;
          // });
        }
      });
    },
@@ -1959,15 +2269,13 @@
    //计算个税:type(A:已知税前金额,计算税后金额;B:已知税后金额,计算税前金额)
    calculateTax(row, type) {
      let targetValue = 0;
      for (let i = 0; i < this.rbDetails.length; i++) {
        if (!this.rbDetails[i].amount) {
          this.rbDetails[i].amount = 0;
        }
        targetValue += parseFloat(this.rbDetails[i].amount); // 假设每个对象中的特定值存储在'specificValue'属性下
      }
      console.log(targetValue, "合计");
      this.form.pretaxcost = targetValue;
      // 合计金额必须精确累加,否则会写入 form.pretaxcost 并落库
      this.form.pretaxcost = moneySum(this.rbDetails, "amount");
    },
    //导入所有项目
@@ -2041,6 +2349,11 @@
    },
    // 接受提醒立刻保存
    Savenow() {
      // 2026-10-15:保存前附件文件名规范校验(仅新增单据;老单据的历史附件由后端按"只校验本次变更"放行)
      if (!this.checkDetailFileNames()) {
        return;
      }
      if (!this.randomnumber) {
        this.randomnumber = this.generateRandomString(9);
        this.form.randomnumber = this.randomnumber;
@@ -2048,177 +2361,202 @@
      this.Savereminder = false;
      this.Reminderquantity = 0;
      this.totalquantity = 0;
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.formData = this.form;
          //保存前校验数据
          for (let k = 0; k < this.rbDetails.length; k++) {
            let tempDetail = this.rbDetails[k];
            if (tempDetail.itemid == null) {
              this.$modal.msgWarning(
                "服务项目表中,第" +
                (k + 1).toString() +
                "行的服务项目未选择,请先选择服务项目后再提交保存!"
              );
              return;
            }
            if (this.businessType == "1") {
              if (tempDetail.servicesscope == null) {
                this.$modal.msgWarning(
                  "服务项目表中,第" +
                  (k + 1).toString() +
                  "行的费用说明未选择,请选择费用说明后再提交保存!"
                );
                return;
              }
              if (tempDetail.beneficiaryno == null) {
                this.$modal.msgWarning(
                  "服务项目表中,第" +
                  (k + 1).toString() +
                  "行的服务人员姓名为选择,请选择人员后再提交保存!"
                );
                return;
              }
            }
          }
          //处理明细
          for (let i = 0; i < this.rbDetails.length; i++) {
            let tempDetail = this.rbDetails[i];
            //获取服务项目明细
            let tempitemlist = tempDetail.itemlist;
            let itemIndex = tempitemlist.findIndex(
              item => tempDetail.itemid == item.id
            );
            if (itemIndex > -1) {
              tempDetail.itemname = tempitemlist[itemIndex].itemName;
              tempDetail.itemid = tempitemlist[itemIndex].id;
            }
            //获取applytypename、服务费用大类
            let applytypeIndex = this.rowfeeItemTypes.findIndex(
              item => tempDetail.applytype == item.value
            );
            if (applytypeIndex > -1) {
              tempDetail.applytypename = this.rowfeeItemTypes[
                applytypeIndex
              ].label;
              tempDetail.subjecttype = this.rowfeeItemTypes[
                applytypeIndex
              ].subjecttype;
              tempDetail.subjecttypename = this.rowfeeItemTypes[
                applytypeIndex
              ].subjecttypename;
            }
            this.rbDetails[i] = tempDetail;
          }
          //计算当前行报销内容费用合计,税前金额(amount)、扣税金额(taxamount)、税后金额(taxedamount)
          if (this.businessType == "2") {
            for (let j = 0; j < this.rbDetails.length; j++) {
              let tempDetail = this.rbDetails[j];
              if (
                isNaN(parseFloat(tempDetail.amount)) ||
                parseFloat(tempDetail.amount) == 0
              ) {
                this.$modal.msgWarning(
                  "服务项目表中,第" +
                  (j + 1).toString() +
                  "行的金额未输入,请先输入金额后再提交保存!"
                );
                return;
              }
            }
          } else if (this.businessType == "3" || this.businessType == "4") {
            for (let j = 0; j < this.rbDetails.length; j++) {
              let tempDetail = this.rbDetails[j];
              if (
                isNaN(parseFloat(tempDetail.amount)) ||
                parseFloat(tempDetail.amount) == 0
              ) {
                this.$modal.msgWarning(
                  "服务项目表中,第" +
                  (j + 1).toString() +
                  "行的金额未输入,请先输入金额后再提交保存!"
                );
                return;
              }
              if (
                isNaN(parseFloat(tempDetail.taxamount)) ||
                parseFloat(tempDetail.taxamount) == 0
              ) {
                tempDetail.taxedamount = parseFloat(tempDetail.amount);
              } else {
                tempDetail.taxedamount =
                  parseFloat(tempDetail.amount) +
                  parseFloat(tempDetail.taxamount);
              }
            }
          }
          //保存数据
          this.loading = true;
          this.form.serviceFunddetails = 0;
          this.rbDetails.map(item => {
            this.form.serviceFunddetails += item.amount;
          });
          this.form.serviceFunddetails = this.rbDetails;
          if (this.form.id != null) {
          } else {
            this.form.recordstatus = -1;
          }
          addorupdateFund(this.form).then(response => {
            if (response.code === 200) {
              this.$modal.msgSuccess("申请单保存成功!");
              // 非提醒状态下执行审批解决异步调用延迟问题
              if (!this.Savereminder) {
                let checkFundObj = {
                  // fundid: this.checkObj.fundid,
                  fundid: this.curId,
                  flowconclusion: this.checkObj.flowlevelone,
                  flowcontent: this.checkObj.flowconclusion
                };
                checkfund(checkFundObj).then(res => {
                  //关闭窗口
                  this.$modal.msgSuccess("审核完成!");
                  this.$store.dispatch("tagsView/delView", this.$route);
                  this.$router.go(-1);
                });
              }
              this.Getnetworkheader();
              this.getroute();
              this.getAccountList();
              this.getUserList();
              this.getUserProfile();
            } else {
              this.$modal.msgError("申请单保存失败:" + response.msg);
            }
          });
          //关闭窗口
          this.loading = false;
          // this.getfundList();
      // 专家劳务费专用:9 条费用控制规则校验(校验不通过不允许落库)
      this.checkExpertFeeRules("保存").then((allowed) => {
        if (!allowed) {
          return;
        }
        this.$refs["form"].validate(valid => {
          if (valid) {
            this.formData = this.form;
            //保存前校验数据
            for (let k = 0; k < this.rbDetails.length; k++) {
              let tempDetail = this.rbDetails[k];
              if (tempDetail.itemid == null) {
                this.$modal.msgWarning(
                  "服务项目表中,第" +
                  (k + 1).toString() +
                  "行的服务项目未选择,请先选择服务项目后再提交保存!"
                );
                return;
              }
              if (this.businessType == "1") {
                if (tempDetail.servicesscope == null) {
                  this.$modal.msgWarning(
                    "服务项目表中,第" +
                    (k + 1).toString() +
                    "行的费用说明未选择,请选择费用说明后再提交保存!"
                  );
                  return;
                }
                if (tempDetail.beneficiaryno == null) {
                  this.$modal.msgWarning(
                    "服务项目表中,第" +
                    (k + 1).toString() +
                    "行的人员姓名为空,请选择人员后再提交保存!"
                  );
                  return;
                }
                if (tempDetail.unitname == null) {
                  this.$modal.msgWarning(
                    "服务项目表中,第" +
                    (k + 1).toString() +
                    "行的专家单位为空,请选择单位后再提交保存!"
                  );
                  return;
                }
              }
            }
            //处理明细
            for (let i = 0; i < this.rbDetails.length; i++) {
              let tempDetail = this.rbDetails[i];
              //获取服务项目明细
              let tempitemlist = tempDetail.itemlist;
              let itemIndex = tempitemlist.findIndex(
                item => tempDetail.itemid == item.id
              );
              if (itemIndex > -1) {
                tempDetail.itemname = tempitemlist[itemIndex].itemName;
                tempDetail.itemid = tempitemlist[itemIndex].id;
              }
              //获取applytypename、服务费用大类
              let applytypeIndex = this.rowfeeItemTypes.findIndex(
                item => tempDetail.applytype == item.value
              );
              if (applytypeIndex > -1) {
                tempDetail.applytypename = this.rowfeeItemTypes[
                  applytypeIndex
                ].label;
                tempDetail.subjecttype = this.rowfeeItemTypes[
                  applytypeIndex
                ].subjecttype;
                tempDetail.subjecttypename = this.rowfeeItemTypes[
                  applytypeIndex
                ].subjecttypename;
              }
              this.rbDetails[i] = tempDetail;
            }
            //计算当前行报销内容费用合计,税前金额(amount)、扣税金额(taxamount)、税后金额(taxedamount)
            if (this.businessType == "2") {
              for (let j = 0; j < this.rbDetails.length; j++) {
                let tempDetail = this.rbDetails[j];
                if (
                  isNaN(parseFloat(tempDetail.amount)) ||
                  moneyRound(tempDetail.amount) == 0
                ) {
                  this.$modal.msgWarning(
                    "服务项目表中,第" +
                    (j + 1).toString() +
                    "行的金额未输入,请先输入金额后再提交保存!"
                  );
                  return;
                }
              }
            } else if (this.businessType == "3" || this.businessType == "4") {
              for (let j = 0; j < this.rbDetails.length; j++) {
                let tempDetail = this.rbDetails[j];
                if (
                  isNaN(parseFloat(tempDetail.amount)) ||
                  moneyRound(tempDetail.amount) == 0
                ) {
                  this.$modal.msgWarning(
                    "服务项目表中,第" +
                    (j + 1).toString() +
                    "行的金额未输入,请先输入金额后再提交保存!"
                  );
                  return;
                }
                if (
                  isNaN(parseFloat(tempDetail.taxamount)) ||
                  moneyRound(tempDetail.taxamount) == 0
                ) {
                  tempDetail.taxedamount = parseFloat(tempDetail.amount);
                } else {
                  tempDetail.taxedamount =
                    parseFloat(tempDetail.amount) +
                    parseFloat(tempDetail.taxamount);
                }
              }
            }
            //保存数据
            this.loading = true;
            this.form.serviceFunddetails = 0;
            this.rbDetails.map(item => {
              this.form.serviceFunddetails += item.amount;
            });
            this.form.serviceFunddetails = this.rbDetails;
            if (this.form.id != null) {
            } else {
              this.form.recordstatus = -1;
            }
            addorupdateFund(this.form).then(response => {
              if (response.code === 200) {
                this.$modal.msgSuccess("申请单保存成功!");
                // 非提醒状态下执行审批解决异步调用延迟问题
                if (!this.Savereminder) {
                  let checkFundObj = {
                    // fundid: this.checkObj.fundid,
                    fundid: this.curId,
                    flowconclusion: this.checkObj.flowlevelone,
                    flowcontent: this.checkObj.flowconclusion
                  };
                  this.$modal.loading("正在提交审核,请稍候!");
                  checkfund(checkFundObj).then(res => {
                    if (res.code == 200) {
                      //关闭窗口
                      this.$modal.closeLoading();
                      this.$modal.msgSuccess("审核完成!");
                      // 连续审批:询问是否继续审批下一单
                      this.continueOrExit();
                    } else {
                      this.$modal.closeLoading();
                      this.$modal.msgError(res.msg || "操作失败");
                    }
                  });
                }
                this.Getnetworkheader();
                this.getroute();
                this.getAccountList();
                this.getUserList();
                this.getUserProfile();
              } else {
                this.$modal.msgError("申请单保存失败:" + response.msg);
              }
            });
            //关闭窗口
            this.loading = false;
            // this.getfundList();
          }
        });
      });
    },
    handleCheckAllChange(val) {
      this.checkedCities = val ? this.cityOptions : [];
      this.checkedCities = val ? this.filteredCityOptions.slice() : [];
      this.isIndeterminate = false;
    },
    handleCheckedCitiesChange(value) {
      let checkedCount = value.length;
      this.checkAll = checkedCount === this.cityOptions.length;
      this.checkAll =
        this.filteredCityOptions.length > 0 &&
        checkedCount === this.filteredCityOptions.length;
      this.isIndeterminate =
        checkedCount > 0 && checkedCount < this.cityOptions.length;
        checkedCount > 0 && checkedCount < this.filteredCityOptions.length;
    },
    // 手动计算
    Manualcalculationfn() {
      ManualCalculation(this.rbDetails).then(res => {
        console.log(res);
        if (res.code == 200) {
          sessionStorage.removeItem("apiform");
          sessionStorage.removeItem("apifunddetail");
@@ -2250,19 +2588,57 @@
    // 批量录入点击
    Batchentry() {
      // ethical
      this.personKeyword = "";
      this.checkedCities = [];
      this.checkAll = false;
      this.isIndeterminate = false;
      listReportname("ethical").then(res => {
        this.cityOptions = res.data;
      });
      this.batchdialogVisible = true;
    },
    /** 批量录入弹框:姓名/单位/工号/身份证后4位 命中判断 */
    personMatchKeyword(item, kw) {
      const idcard = String(item.idcrad || "");
      return (
        String(item.reportName || "")
          .toLowerCase()
          .indexOf(kw) > -1 ||
        String(item.unitname || "")
          .toLowerCase()
          .indexOf(kw) > -1 ||
        String(item.reportNo || "")
          .toLowerCase()
          .indexOf(kw) > -1 ||
        (idcard.length >= 4 && idcard.slice(-4).indexOf(kw) > -1)
      );
    },
    // 确认录入
    BatchentryFn() {
      // 明细中已有的人员姓名,用于重复提醒
      const existed = {};
      this.rbDetails.forEach(row => {
        if (row.beneficiaryname) {
          existed[String(row.beneficiaryname).trim()] = true;
        }
      });
      const duplicated = [];
      this.checkedCities.forEach(item => {
        const nameKey = String(item.reportName || "").trim();
        if (nameKey && existed[nameKey]) {
          duplicated.push(item.reportName);
          return;
        }
        if (nameKey) {
          existed[nameKey] = true;
        }
        let rowData = {
          orderno: null,
          fundid: null,
          beneficiaryname: item.reportName,
          beneficiaryno: item.reportNo,
          isunit: 0,
          unitname: item.unitname,
          unitno: null,
          uintuserno: null,
@@ -2307,11 +2683,17 @@
        this.rbDetails.push(rowData);
      });
      for (let i = 0; i < this.checkedCities.length + 1; i++) {
      for (let i = 0; i < this.rbDetails.length; i++) {
        this.rbDetails[i].orderno = i + 1;
      }
      this.calculateTax();
      this.batchdialogVisible = false;
      this.checkedCities = [];
      if (duplicated.length) {
        this.$modal.msgWarning(
          "以下人员在明细中已存在,已跳过重复添加:" + duplicated.join("、")
        );
      }
    },
    //新增一行
    addRow(rowIndex) {
@@ -2321,6 +2703,7 @@
        fundid: null,
        beneficiaryname: null,
        beneficiaryno: null,
        isunit: 0,
        unitname: null,
        itemdescribe: null,
        unitno: null,
@@ -2361,10 +2744,6 @@
        rowfeeblocks: [],
        annexfiles: null
      };
      // if (this.Reminderquantity >= 5) {
      //   this.Savereminder = true;
      //   return;
      // }
      if (rowIndex == undefined || rowIndex == null || rowIndex < 0) {
        this.rbDetails.push(rowData);
      } else {
@@ -2419,37 +2798,34 @@
        .catch(() => {
          //几点取消的提示
        });
      //全部删除后添加一条新行
    },
    //计算总金额
    //计算总金额(金额一律走精确运算,禁止 parseFloat 累加)
    sumTotalFee(row) {
      let allSum = 0;
      const detailsArr = [];
      if (this.form.applytype != null) {
        for (let i = 0; i < this.rbDetails.length; i++) {
          const detail = this.rbDetails[i];
          let totalFee = 0;
          let taxFee = 0;
          if (this.form.applytype == 1 || this.form.applytype == 2) {
            //计算当前报销内容费用合计
            if (!isNaN(parseFloat(this.rbDetails[i].amount))) {
              totalFee += parseFloat(this.rbDetails[i].amount);
              taxFee += parseFloat(this.rbDetails[i].amount);
            //计算当前报销内容费用合计:税前 - 扣税
            if (!isNaN(parseFloat(detail.amount))) {
              totalFee = moneySub(totalFee, -parseFloat(detail.amount));
              taxFee = moneySub(taxFee, -parseFloat(detail.amount));
            }
            if (!isNaN(parseFloat(this.rbDetails[i].taxamount))) {
              totalFee -= parseFloat(this.rbDetails[i].taxamount);
              taxFee -= parseFloat(this.rbDetails[i].taxamount);
            if (!isNaN(parseFloat(detail.taxamount))) {
              totalFee = moneySub(totalFee, detail.taxamount);
              taxFee = moneySub(taxFee, detail.taxamount);
            }
          } else if (this.form.applytype == 3 || this.form.applytype == 4) {
            //单价*数量=税前金额
            if (
              !isNaN(parseFloat(this.rbDetails[i].price)) &&
              !isNaN(parseFloat(this.rbDetails[i].quantity))
              !isNaN(parseFloat(detail.price)) &&
              !isNaN(parseFloat(detail.quantity))
            ) {
              totalFee +=
                parseFloat(this.rbDetails[i].price) *
                parseFloat(this.rbDetails[i].quantity);
              this.rbDetails[i].amount = totalFee;
              totalFee = moneyMul(detail.price, detail.quantity);
              detail.amount = totalFee;
            }
          }
@@ -2458,9 +2834,10 @@
          //   this.rbDetails[i].taxedamount = taxFee.toFixed(2);
          // }
          allSum += totalFee;
          detailsArr.push(totalFee);
        }
      }
      const allSum = moneyRound(moneySum(detailsArr));
      // this.form.amountrequested = allSum.toFixed(2);
      // this.$forceUpdate();
    },
@@ -2496,30 +2873,63 @@
    totalprint(e) {
      // const id =this.row.id
      getdownloadBX(e).then(res => {
        if (res.downloadUrl) {
          var fileUrl = res;
          //获取当前网址
          var urlBase = process.env.VUE_APP_BASE_API;
          var curWWWPath = window.document.location.href;
          var pos = curWWWPath.indexOf(window.document.location.pathname);
          // 创建a标签
          var aEle = document.createElement("a");
          aEle.href =
            curWWWPath.substring(0, pos) + urlBase + fileUrl["downloadUrl"];
          aEle.click();
          this.$alert("下载成功", "提示", {
            confirmButtonText: "确定",
            type: "success"
        var fileUrl = res;
        //获取当前网址
        var urlBase = process.env.VUE_APP_BASE_API;
        var curWWWPath = window.document.location.href;
        var pos = curWWWPath.indexOf(window.document.location.pathname);
        // 创建a标签
        var aEle = document.createElement("a");
        aEle.href =
          curWWWPath.substring(0, pos) + urlBase + fileUrl["downloadUrl"];
        console.log(aEle.href);
        // 添加Authorization头部
        fetch(aEle.href, {
          headers: this.headers
        })
          .then(response => {
            // 将文件下载链接作为blob对象进行下载
            return response.blob();
          })
          .then(blob => {
            const url = window.URL.createObjectURL(new Blob([blob]));
            console.log(url);
            const link = document.createElement("a");
            link.href = url;
            const name = fileUrl["downloadName"];
            link.setAttribute("download", name); // 替换file.pdf为实际的文件名
            document.body.appendChild(link);
            link.click();
            link.parentNode.removeChild(link);
          });
        }
      });
    },
    //文件上传
    handleImageError(e) {
      // 加载失败
    },
    handleImageLoad(e) {
      // 图片加载成功时执行的操作
      console.log("Image loaded successfully");
    },
    handleImageClick(index) {
      this.currentIndex = index;
      this.viewerVisible = true;
    },
    invoicehandleImageClick(index) {
      this.invoicecurrentIndex = index;
      this.invoiceviewerVisible = true;
    },
    handleViewerClose() {
      this.viewerVisible = false;
    },
    invoicehandleViewerClose() {
      this.invoiceviewerVisible = false;
    },
    handleUploadError() { },
    remove(file, fileList) {
      const rbDetails = [...this.rbDetails];
      if (this.activeName == 1) {
      if (this.activeName == "common") {
        this.fileListto.splice(this.fileListto.indexOf(file), 1);
        rbDetails[this.atpresent].annexfilesList = this.fileListto;
      } else {
@@ -2528,110 +2938,237 @@
      }
    },
    /**
     * 2026-10-15:上传时校验附件文件名(业务要求:不合格立即提示且不加入列表)。
     * 规则与后端 AttachmentNameValidator 同口径:必须含中文 / 去掉扩展名后主干 ≤20 字 /
     * 不含空格及 / \ : * ? " < > | # % 等特殊字符。
     */
    checkUploadFileName(file) {
      const raw = file && file.raw ? file.raw.name : file && file.name;
      const r = checkFileName(raw);
      if (!r.ok) {
        this.$modal.msgError(r.msg);
        return false;
      }
      return true;
    },
    /**
     * 2026-10-15:保存前校验整单明细附件文件名(含同一行内重名)。
     * 口径(业务确认):只校验"本次变更"的附件——老单据里已存在的不合规附件名不能把保存卡死
     * (否则老单据改一个金额都存不进去)。后端按 id 读旧记录放行历史附件;前端拿不到"哪些是历史"
     * 的权威信息,因此**仅新增单据**做保存前拦截,编辑老单据时新增的不合规附件由后端二次校验拦下。
     */
    checkDetailFileNames() {
      if (this.form && this.form.id) {
        return true;
      }
      const c = checkDetails(this.rbDetails);
      if (!c.ok) {
        this.$modal.msgError(c.msg);
        return false;
      }
      return true;
    },
    uploadSccess(response, file, fileList) {
      if (!this.checkUploadFileName(file)) {
        return;
      }
      this.rbDetails;
      const config = {
        headers: { Authorization: "Bearer " + this.ICDtoken }
      };
      const pdfimg = this.Networkheader + "/prod-api" + response.fileName;
      //获取票据信息位置
      console.log(response);
      console.log(file);
      if (this.activeName == 1) {
      if (this.activeName == "common") {
        if (response.code == 200) {
          // this.form.filename = file.raw.name;
          this.previewpdf = true;
          fetch(pdfimg, config)
            .then(response => response.blob())
            .then(blob => {
              // 将获取的数据流转换为URL
              this.pdfimg = URL.createObjectURL(blob);
              this.pdfimgsrcList.push(URL.createObjectURL(blob));
              this.fileListto.push({
                name: file.name,
                url: URL.createObjectURL(blob)
              });
            })
            .catch(error => {
              console.error("Error loading image", error);
              return;
            });
          this.$modal.msgSuccess(response.msg);
          this.fileListto.push({
          console.log(this.fileListto, "新增后");
          if (!this.rbDetails[this.atpresent].annexfilesList) {
            this.rbDetails[this.atpresent].annexfilesList = [];
          }
          this.rbDetails[this.atpresent].annexfilesList.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;
          fetch(pdfimg, config)
            .then(response => response.blob())
            .then(blob => {
              // 将获取的数据流转换为URL
              this.invoicepdfimg = URL.createObjectURL(blob);
              this.invoicepdfimgsrcList.push(URL.createObjectURL(blob));
              this.invoicefileListto.push({
                name: file.name,
                url: URL.createObjectURL(blob)
              });
            })
            .catch(error => {
              console.error("Error loading image", error);
              return;
            });
          this.$modal.msgSuccess(response.msg);
          this.invoicefileListto.push({
          console.log(this.invoicefileListto, "新增后");
          if (!this.rbDetails[this.atpresent].invoicefilesList) {
            this.rbDetails[this.atpresent].invoicefilesList = [];
          }
          this.rbDetails[this.atpresent].invoicefilesList.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) {
      const config = {
        headers: { Authorization: "Bearer " + this.ICDtoken }
      };
      this.tableDatatop = [];
      this.fileListto = [];
      this.invoicefileListto = [];
      this.pdfimg = "";
      this.invoicepdfimg = [];
      this.pdfimgsrcList = [];
      this.invoDatatop = [];
      this.invoicepdfimgsrcList = [];
      this.invoDatatop.push(row);
      this.tableDatatop.push(row);
      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);
        // this.rbDetails[index].annexfilesList.forEach((value, indexson) => {
        //   const pdfimg = this.Networkheader + "/prod-api" + value.url;
        //   fetch(pdfimg, config)
        //     .then(response => response.blob())
        //     .then(blob => {
        //       // 将获取的数据流转换为URL
        //       this.fileListto.push({
        //         name: value.name,
        //         url: URL.createObjectURL(blob)
        //       });
        //       if (this.fileListto.length == 1) {
        //         this.pdfimg = URL.createObjectURL(blob);
        //       }
        //       this.pdfimgsrcList.push(URL.createObjectURL(blob));
        //     })
        //     .catch(error => {
        //       console.error("Error loading image", error);
        //       return;
        //     });
        // });
        const fetchPromises = this.rbDetails[index].annexfilesList.map(
          (value, indexson) => {
            const pdfimg = this.Networkheader + "/prod-api" + value.url;
            return fetch(pdfimg, config)
              .then(response => response.blob())
              .then(blob => {
                return {
                  name: value.name,
                  url: URL.createObjectURL(blob)
                };
              })
              .catch(error => {
                console.error("Error loading image", error);
                return null;
              });
          }
        );
        Promise.all(fetchPromises).then(fileListto => {
          this.fileListto = fileListto.filter(item => item !== null);
          this.pdfimg = this.fileListto[0].url;
          console.log(this.pdfimg, "pdfimg");
          this.pdfimgsrcList = this.fileListto.map(item => item.url);
        });
        this.previewpdf = true;
      } 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
        const fetchPromises = this.rbDetails[index].invoicefilesList.map(
          (value, indexson) => {
            const pdfimg = this.Networkheader + "/prod-api" + value.url;
            return fetch(pdfimg, config)
              .then(response => response.blob())
              .then(blob => {
                return {
                  name: value.name,
                  url: URL.createObjectURL(blob)
                };
              })
              .catch(error => {
                console.error("Error loading image", error);
                return null;
              });
          }
        );
        Promise.all(fetchPromises).then(invoicefileListto => {
          this.invoicefileListto = invoicefileListto.filter(
            item => item !== null
          );
          this.invoicepdfimg = this.invoicefileListto[0].url;
          console.log(this.invoicepdfimg, "invoicepdfimg");
          this.invoicepdfimgsrcList = this.invoicefileListto.map(
            item => item.url
          );
        });
        console.log(this.invoicepdfimgsrcList);
        console.log(this.invoicepdfimg);
        this.previewpdf = true;
      } else {
        this.invoicefileListto = [];
        this.invoicepdfimg = "";
        this.pdftitle = "";
      }
      if (this.activeName == 1) {
      if (this.activeName == "common") {
        this.pdftitle = "共" + this.pdfimgsrcList.length + "项";
      } else {
        this.pdftitle = "共" + this.invoicepdfimgsrcList.length + "项";
      }
      console.log(this.fileListto, "this.fileListto");
      console.log(this.rbDetails[index].annexfilesList, "annexfilesList");
    },
    // 点击已上传文件
    downFile(item) {
      if (this.activeName == 1) {
        console.log(item, "点击文件拿item");
      if (this.activeName == "common") {
        this.pdftitle =
          "共" + this.pdfimgsrcList.length + "项,当前选中" + item.name;
        let name = item.name.split(".");
@@ -2640,11 +3177,12 @@
          this.previewpdf = false;
          this.hintitle = "当前文件暂不支持预览";
        } else if (name[1] == "jpg" || "png") {
          console.log(item, "展示");
          this.previewpdf = true;
          if (item.url) {
            this.pdfimg = this.Networkheader + "/prod-api" + item.url;
            this.pdfimg = item.url;
          } else {
            this.pdfimg = this.Networkheader + "/prod-api" + item.response.url;
            this.pdfimg = "";
          }
        } else {
          this.hintitle = "当前文件暂不支持预览";
@@ -2652,7 +3190,6 @@
          this.previewpdf = false;
        }
      } else {
        console.log(item, "点击文件拿item");
        this.pdftitle =
          "共" + this.invoicepdfimgsrcList.length + "项,当前选中" + item.name;
        let name = item.name.split(".");
@@ -2663,12 +3200,9 @@
        } 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");
            this.invoicepdfimg = item.url;
          } else {
            this.invoicepdfimg =
              this.Networkheader + "/prod-api" + item.response.url;
            this.invoicepdfimg = "";
          }
        } else {
          this.hintitle = "当前文件暂不支持预览";
@@ -2682,7 +3216,7 @@
    },
    // 发票切换
    handleClick(tab, event) {
      if (this.activeName == 1) {
      if (this.activeName == "common") {
        this.pdftitle = "共" + this.pdfimgsrcList.length + "项";
      } else {
        this.pdftitle = "共" + this.invoicepdfimgsrcList.length + "项";
@@ -2690,40 +3224,88 @@
    },
    // 点击删除
    deletedowfile(row) {
      if (this.activeName == 1) {
        const indexlist = this.getIndexInArray(
          this.pdfimgsrcList,
          this.Networkheader + "/prod-api" + row.url
        );
      console.log(row);
      let indexvalue = "";
      if (this.activeName == "common") {
        const indexlist = this.getIndexInArray(this.pdfimgsrcList, row.url);
        this.pdfimgsrcList.splice(indexlist, 1);
        const index = this.getIndexInArray(this.fileListto, row);
        this.fileListto.splice(index, 1);
        console.log(this.rbDetails[this.atpresent].annexfilesList);
        indexvalue = this.rbDetails[this.atpresent].annexfilesList.findIndex(
          item => item.name == row.name
        );
        console.log(indexvalue, "删除索引");
        this.rbDetails[this.atpresent].annexfilesList.splice(indexvalue, 1);
      } else {
        const indexlist = this.getIndexInArray(
          this.invoicepdfimgsrcList,
          this.Networkheader + "/prod-api" + row.url
          row.url
        );
        this.invoicepdfimgsrcList.splice(indexlist, 1);
        const index = this.getIndexInArray(this.invoicefileListto, row);
        this.invoicefileListto.splice(index, 1);
        console.log(this.rbDetails[this.atpresent].invoicefilesList);
        indexvalue = this.rbDetails[this.atpresent].invoicefilesList.findIndex(
          item => item.name == row.name
        );
        console.log(indexvalue, "删除索引");
        this.rbDetails[this.atpresent].invoicefilesList.splice(indexvalue, 1);
      }
    },
    // 点击上移
    moveupdowfile(row) {
      if (this.activeName == 1) {
        const index = this.getIndexInArray(this.fileListto, row);
      if (this.activeName == "common") {
        const index = this.fileListto.findIndex(item => item.name == row.name);
        const item = this.fileListto.splice(index, 1)[0]; // 移除指定索引处的元素,并保存到item变量中
        this.fileListto.splice(index - 1, 0, item); // 将item插入到索引位置的前一位
        const indexann = this.rbDetails[
          this.atpresent
        ].annexfilesList.findIndex(item => item.name == row.name);
        const itemann = this.rbDetails[this.atpresent].annexfilesList.splice(
          indexann,
          1
        )[0]; // 移除指定索引处的元素,并保存到item变量中
        this.rbDetails[this.atpresent].annexfilesList.splice(
          indexann - 1,
          0,
          itemann
        ); // 将itemann插入到索引位置的前一位
        console.log(indexann, "indexann");
        console.log(index, "index");
      } else {
        const index = this.getIndexInArray(this.invoicefileListto, row);
        const index = this.invoicefileListto.findIndex(
          item => item.name == row.name
        );
        const item = this.invoicefileListto.splice(index, 1)[0]; // 移除指定索引处的元素,并保存到item变量中
        this.invoicefileListto.splice(index - 1, 0, item); // 将item插入到索引位置的前一位
        const indexinvo = this.rbDetails[
          this.atpresent
        ].invoicefilesList.findIndex(item => item.name == row.name);
        const iteminvo = this.rbDetails[this.atpresent].invoicefilesList.splice(
          indexinvo,
          1
        )[0]; // 移除指定索引处的元素,并保存到item变量中
        this.rbDetails[this.atpresent].invoicefilesList.splice(
          indexinvo - 1,
          0,
          iteminvo
        ); // 将iteminvo插入到索引位置的前一位
      }
      console.log(
        this.rbDetails[this.atpresent].annexfilesList,
        "annexfilesList"
      );
      console.log(this.fileListto, "fileListto");
      // console.log(this.rbDetails[this.atpresent].invoicefilesList,'invoicefilesList');
    },
    Downloadfile(row) {
      console.log(row);
      window.location.href = this.Networkheader + "/prod-api" + row.url;
      window.location.href = row.url;
    },
    //专家/医疗机构/费用报销机构选择
    showSelectionDialog(scope, selectiontype) {
      this.selectionScope = scope;
@@ -2733,15 +3315,21 @@
      if (this.selectionType == "account") {
        //默认从账户库选择:1,账户库;2,新建账户
        this.accountfrom = "1";
        if (scope.row.idcardno) {
          this.accountselectform.accountname =
            scope.row.beneficiaryname + "(" + scope.row.idcardno + ")";
        } else {
          this.accountselectform.accountname =
            scope.row.beneficiaryname + "(" + scope.row.bankcardno + ")";
        }
        this.accountselectform.accountno = scope.row.beneficiaryno;
        this.accountselectform.accountname = scope.row.beneficiaryname;
        this.accountselectform.expertunitname = "";
        this.accountselectform.expertunitno = "";
        this.accountselectform.unitno = "";
        this.accountselectform.unitname = "";
        this.accountselectform.telephone = "";
        this.accountselectform.username = "";
        this.accountselectform.userno = "";
        this.accountselectform.idcardno = "";
        this.accountselectform.telephone = "";
        this.accountselectform.title = "";
        this.accountselectform.unitno = "";
        this.accountselectform.unitname = "";
@@ -2754,7 +3342,6 @@
        this.accountselectform.expertunitname = scope.row.unitname;
        this.accountselectform.expertunitno = scope.row.unitno;
      }
      this.showselectiondialog = true;
    },
@@ -2765,84 +3352,134 @@
        if (this.selectionType == "account") {
          if (this.accountfrom == "1") {
            //赋值信息
            this.accountlist.map(res => {
              if (res.username == this.accountselectform.accountname) {
                console.log(res);
                this.rbDetails[tempIndex].beneficiaryno = res.userno;
                this.rbDetails[tempIndex].beneficiaryname = res.username;
                this.rbDetails[tempIndex].depositbank = res.depositbank;
                this.rbDetails[tempIndex].branchbankname = res.branchbankname;
                this.rbDetails[tempIndex].bankcardno = res.bankcardno;
                this.rbDetails[tempIndex].phone = res.telephone;
            if (
              this.rbDetails[tempIndex].userno != this.accountselectform.userno
            ) {
              this.accountlist.map(res => {
                if (res.id == this.accountselectform.accountname) {
                  console.log(res, "res");
                  const hasIdOne = this.rbDetails.some(
                    obj => obj.beneficiaryname == res.username
                  );
                  if (hasIdOne) {
                    this.$modal.msgWarning(
                      "服务项目表中,人员名称:" +
                      res.username +
                      "重复,请注意核对信息!"
                    );
                  }
                  this.rbDetails[tempIndex].beneficiaryno = res.userno;
                  this.rbDetails[tempIndex].beneficiaryname = res.username;
                  this.rbDetails[tempIndex].depositbank = res.depositbank;
                  this.rbDetails[tempIndex].branchbankname = res.branchbankname;
                  this.rbDetails[tempIndex].bankcardno = res.bankcardno;
                  this.rbDetails[tempIndex].phone = res.telephone;
                if (res.usertype == "org") {
                  this.rbDetails[tempIndex].idcardno = "";
                  this.rbDetails[tempIndex].title = "";
                  this.rbDetails[tempIndex].unitno = "";
                  this.rbDetails[tempIndex].unitname = "";
                } else {
                  this.rbDetails[tempIndex].idcardno = res.idcardno;
                  this.rbDetails[tempIndex].title = res.title;
                  this.rbDetails[tempIndex].unitno = parseInt(res.unitno);
                  this.rbDetails[tempIndex].unitname = res.unitname;
                }
              }
            });
          } else if (this.accountfrom == "2") {
            //保存新增账号
            this.accountform.id = null;
            this.accountform.userno =
              this.accountlist[this.accountlist.length - 1].id + 1;
            this.accountform.usertype = this.accountselectform.usertype;
            this.accountform.username = this.accountselectform.username;
            this.accountform.idcardno = this.accountselectform.idcardno;
            this.accountform.sex = null;
            this.accountform.title = this.accountselectform.title;
            this.accountform.telephone = this.accountselectform.telephone;
            this.accountform.address = this.accountselectform.address;
            this.accountform.wbm = null;
            this.accountform.pym = null;
            this.accountform.depositbank = this.accountselectform.depositbank;
            this.accountform.bankcardno = this.accountselectform.bankcardno;
            this.accountform.branchbankname = null;
            this.accountform.remark = null;
            this.accountform.del_flag = "0";
            this.accountform.personnelunitno = null;
            if (this.accountselectform.usertype != "org") {
              this.accountform.unitno = this.accountselectform.unitno;
              this.unitList.map(res => {
                if (res.organizationid == this.accountform.unitno) {
                  this.accountform.unitname = res.organizationname;
                  if (res.usertype == "org") {
                    this.$set(this.rbDetails[tempIndex], "isunit", 1);
                    this.rbDetails[tempIndex].idcardno = "";
                    this.rbDetails[tempIndex].title = "";
                    this.rbDetails[tempIndex].unitno = "";
                    this.rbDetails[tempIndex].unitname = "";
                  } else {
                    this.$set(this.rbDetails[tempIndex], "isunit", 0);
                    this.rbDetails[tempIndex].idcardno = res.idcardno;
                    this.rbDetails[tempIndex].title = res.title;
                    this.rbDetails[tempIndex].unitno = parseInt(res.unitno);
                    this.rbDetails[tempIndex].unitname = res.unitname;
                  }
                }
              });
              // try {
              //   let unitIndex = this.unitList.findIndex(
              //     item => this.accountform.unitno == item.organizationid
              //   );
              //   if (unitIndex > -1) {
              //     this.accountform.unitname = this.unitList[unitIndex].organizationname;
              //   } else {
              //     this.accountform.unitname = this.accountform.unitno;
              //   }
              // } catch {
              //   this.accountform.unitname = this.accountform.unitno;
              // }
            }
            addExternalperson(this.accountform).then(response => {
              if (response.code == 200) {
                //this.$modal.msgSuccess("新的专家或单位账户信息已添加成功!");
                this.accountselectform.accountno = this.accountselectform.userno;
                this.accountselectform.accountname = this.accountselectform.username;
          } else if (this.accountfrom == "2") {
            //保存新增账号
            //获取用户编号
            getOnlyCode(this.seqnoParams).then(res => {
              this.accountform.userno = res.data.currentvalue;
                //重新获取账户列表
                listExternalperson().then(res => {
                  this.accountlist = res.rows;
              this.accountform.id = null;
              this.accountform.usertype = this.accountselectform.usertype;
              this.accountform.username = this.accountselectform.username;
              this.accountform.idcardno = this.accountselectform.idcardno;
              this.accountform.sex = null;
              this.accountform.title = this.accountselectform.title;
              this.accountform.telephone = this.accountselectform.telephone;
              this.accountform.address = this.accountselectform.address;
              this.accountform.wbm = null;
              this.accountform.pym = null;
              this.accountform.depositbank = this.accountselectform.depositbank;
              this.accountform.bankcardno = this.accountselectform.bankcardno;
              this.accountform.branchbankname = null;
              this.accountform.remark = null;
              this.accountform.del_flag = "0";
              this.accountform.personnelunitno = null;
              if (this.accountselectform.usertype == "expert") {
                this.accountform.unitno = this.accountselectform.unitno;
                this.unitList.map(res => {
                  if (res.organizationid == this.accountform.unitno) {
                    this.accountform.unitname = res.organizationname;
                  }
                });
              } else {
                this.accountform.userstatus = 1;
              }
              addExternalperson(this.accountform).then(response => {
                if (response.code == 200) {
                  // //重新获取账户列表
                  // listExternalperson().then(res => {
                  //   this.accountlist = res.rows;
                  // });
                  console.log("addExternalperson", response.data.id);
                  if (this.accountselectform.usertype == "org") {
                    this.accountlist.push({
                      id: response.data.id,
                      userno: this.accountform.userno,
                      username: this.accountform.username,
                      idcardno: this.accountform.idcardno,
                      title: this.accountform.title,
                      depositbank: this.accountform.depositbank,
                      bankcardno: this.accountform.bankcardno,
                      unitno: this.accountform.unitno,
                      unitname: this.accountform.unitname,
                      userid:
                        this.accountform.username +
                        "(" +
                        this.accountform.bankcardno +
                        ")"
                    });
                    this.$modal.msgSuccess("您已添加成功新账户信息!");
                  } else {
                    this.accountlist.push({
                      id: response.data.id,
                      userno: this.accountform.userno,
                      username: this.accountform.username,
                      idcardno: this.accountform.idcardno,
                      title: this.accountform.title,
                      depositbank: this.accountform.depositbank,
                      bankcardno: this.accountform.bankcardno,
                      unitno: this.accountform.unitno,
                      unitname: this.accountform.unitname,
                      userid:
                        this.accountform.username +
                        "(" +
                        this.accountform.idcardno +
                        ")"
                    });
                    this.$modal.msgSuccess(
                      "您已添加成功新账户信息,需要在账号状态启用后才能被使用!"
                    );
                    return;
                  }
                  this.accountselectform.accountno = this.accountform.userno;
                  this.accountselectform.accountname = this.accountselectform.username;
                  //赋值信息
                  this.accountlist.map(res => {
                    if (res.username == this.accountselectform.accountname) {
                    if (res.userno == this.accountselectform.accountno) {
                      this.rbDetails[tempIndex].beneficiaryno = res.userno;
                      this.rbDetails[tempIndex].beneficiaryname = res.username;
                      this.rbDetails[tempIndex].depositbank = res.depositbank;
@@ -2851,12 +3488,14 @@
                      this.rbDetails[tempIndex].bankcardno = res.bankcardno;
                      this.rbDetails[tempIndex].phone = res.telephone;
                      if (res.usertype == "org") {
                      if (this.hasUserType(res.usertype, "org")) {
                        this.$set(this.rbDetails[tempIndex], "isunit", 1);
                        this.rbDetails[tempIndex].idcardno = "";
                        this.rbDetails[tempIndex].title = "";
                        this.rbDetails[tempIndex].unitno = "";
                        this.rbDetails[tempIndex].unitname = "";
                      } else {
                        this.$set(this.rbDetails[tempIndex], "isunit", 0);
                        this.rbDetails[tempIndex].idcardno = res.idcardno;
                        this.rbDetails[tempIndex].title = res.title;
                        this.rbDetails[tempIndex].unitno = parseInt(res.unitno);
@@ -2864,27 +3503,33 @@
                      }
                    }
                  });
                });
              }
                }
              });
            });
          }
        } else if (this.selectionType == "workunit") {
          console.log(tempIndex);
          this.rbDetails[
            tempIndex
          ].unitno = this.accountselectform.expertunitno;
          this.unitList.map(res => {
            if (res.organizationid == this.accountform.unitno) {
              this.rbDetails[tempIndex].unitno.unitname = res.organizationname;
            }
          });
          if (
            this.rbDetails[tempIndex].unitname !=
            this.accountselectform.expertunitname
          ) {
            this.rbDetails[
              tempIndex
            ].unitname = this.accountselectform.expertunitname;
            this.unitList.map(res => {
              if (
                res.organizationname == this.accountselectform.expertunitname
              ) {
                this.rbDetails[tempIndex].unitno = res.organizationid;
              }
            });
          }
        }
        //关闭窗口
        this.showselectiondialog = false;
      });
    },
    tableParValueChange(row, tto) {
      const regex = /^[1-9]\d{5}(19|20)\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}([0-9]|X)$/;
      if (tto) {
@@ -2895,13 +3540,33 @@
        }
        return;
      }
      console.log(11);
      if (regex.test(row.idcardno)) {
        row.error = "";
      } else {
        row.error = "身份证号码格式错误";
      //身份证重复验证
      getInfoByIDCardNo(idcardno).then(res => {
        if (res.data.length > 1) {
          this.$modal.msgWarning("身份证号信息已被登记,请检查身份证号!"
          );
          return;
        }
      });
    },
    //账户类型选择变化
    userTypeChange(type) {
      if (type == "org") {
        this.accountselectform.idcardno = "";
        this.accountselectform.unitno = "";
        this.accountselectform.unitname = "";
        this.accountselectform.personnelunitno = "";
      }
      // this.$modal.msgWarning(type);
    }
  },
  // 失焦时手动触发校验(可选,通常配置了 trigger: 'blur' 后会自动触发)
  handleIdCardBlur() {
    // 手动校验单个字段,确保失焦时立刻看到结果
    this.$refs.showselectiondialog.validateField('idcardno');
  },
  //生命周期 - 创建完成(可以访问当前this实例)
@@ -2915,7 +3580,9 @@
  //生命周期 - 挂载完成(可以访问DOM元素)
  mounted() {
    window.addEventListener("beforeunload", e => this.beforeunloadHandler(e));
    // 存住同一个引用,否则 removeEventListener 传新箭头函数无法真正移除,会泄漏监听器
    this._beforeUnloadHandler = e => this.beforeunloadHandler(e);
    window.addEventListener("beforeunload", this._beforeUnloadHandler);
    this.getUserList();
    let apiaccountselectform = this.accountselectform;
    let apiform = this.form;
@@ -2931,7 +3598,10 @@
  updated() { }, //生命周期 - 更新之后
  beforeDestroy() { }, //生命周期 - 销毁之前
  destroyed() {
    window.removeEventListener("beforeunload", e => this.beforeunloadFn(e));
    if (this._beforeUnloadHandler) {
      window.removeEventListener("beforeunload", this._beforeUnloadHandler);
      this._beforeUnloadHandler = null;
    }
  }, //生命周期 - 销毁完成
  activated() { } //如果页面有keep-alive缓存功能,这个函数会触发
};