WXL
3 天以前 5e093dcc9f4177bfd5f9ab2927914d2bf852770b
src/views/project/fund/applyDetail/index.vue
@@ -33,7 +33,7 @@
          </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" />
@@ -69,12 +69,20 @@
              <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">
@@ -104,14 +112,23 @@
              <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')
            ">
          <!-- <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>
              <el-button
                type="success"
                icon="el-icon-edit-outline"
                size="small"
                @click="Manualcalculationfn"
                >计算个税</el-button
              >
            </div>
          </el-col>
          </el-col> -->
        </el-row>
        <el-row>
          <el-table :data="rbDetails" v-loading="loading" max-height="800" border highlight-current-row>
@@ -120,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)">
@@ -134,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>
@@ -152,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">
@@ -171,16 +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 &&
            <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')
              ">
            <el-table-column prop="taxedamount" align="center" label="税后金额" width="120"
              v-if="businessType == '1' || businessType == '2'">
              <template slot-scope="scope">
                <el-input v-model="scope.row.taxedamount" placeholder="税后金额" />
              </template>
@@ -190,8 +205,8 @@
              <template slot-scope="scope">
                <el-button type="primary" plain @click="showSelectionDialog(scope, 'account')">{{
                  scope.row.beneficiaryname
                  ? scope.row.beneficiaryname
                  : "点击选择"
                    ? scope.row.beneficiaryname
                    : "点击选择"
                }}</el-button>
              </template>
            </el-table-column>
@@ -203,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">
@@ -247,7 +236,8 @@
            </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">
@@ -267,22 +257,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>
@@ -313,7 +309,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>
@@ -323,10 +319,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" />
@@ -342,12 +339,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>
@@ -371,10 +377,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>
@@ -427,6 +434,7 @@
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-if="selectionType == 'account' && accountfrom == '2'">
          <el-col :span="24">
            <el-form-item label="账户名称" prop="username">
@@ -434,13 +442,25 @@
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-if="selectionType == 'account' &&
        <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="请输入身份证号" />
              <el-input v-model="accountselectform.idcardno" placeholder="请输入身份证号" @blur="handleIdCardBlur" />
            </el-form-item>
          </el-col>
          <el-col :span="12" v-if="accountselectform.usertype == 'expert'">
@@ -452,10 +472,11 @@
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-if="selectionType == 'account' &&
        <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
@@ -503,7 +524,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>
@@ -511,9 +532,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"
@@ -545,9 +567,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>
@@ -559,7 +582,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">
@@ -572,7 +596,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>
@@ -586,17 +610,19 @@
            <div v-if="this.previewpdf && pdfimgsrcList.length" class="pdfimgmin">
              <!-- <img :src="pdfimg" /> -->
              <el-image style="width: 95%; height: 90%" @error="handleImageError" @load="handleImageLoad" :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>
@@ -608,7 +634,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">
@@ -635,12 +662,15 @@
            <div v-if="this.previewpdf && invoicepdfimgsrcList.length" class="pdfimgmin">
              <!-- <img :src="pdfimg" /> -->
              <el-image style="width: 95%; height: 90%" @error="handleImageError" @load="handleImageLoad"
                :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>
@@ -679,6 +709,8 @@
</template>
<script>
import store from "@/store";
// 'sdaad2123UD2',1  'wsadadwsad',4 'sdadaddad',3 'ssaaddxs',2
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';
@@ -703,7 +735,8 @@
  getdownloadBX,
  addorupdateFund,
  ManualCalculation,
  getdetailsByItemId
  getdetailsByItemId,
  listbypower
} from "@/api/project/fund";
import {
@@ -744,7 +777,7 @@
  addExternalperson,
  updateExternalperson,
  exportExternalperson,
  getOnlyCode
  getOnlyCode, getInfoByIDCardNo
} from "@/api/project/externalperson";
import { listItemexpense } from "@/api/project/itemexpense";
@@ -753,12 +786,14 @@
import Li_area_select from "@/components/Address";
import OrgSelecter from "@/views/project/components/orgselect";
import { getToken } from "@/utils/auth";
import CustomImageViewer from "@/components/CustomImageViewer"; // 根据你的路径调整
export default {
  //import引入的组件需要注入到对象中才能使用
  components: {
    Li_area_select,
    OrgSelecter
    OrgSelecter,
    CustomImageViewer
  },
  name: "fundApply",
@@ -774,19 +809,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 {
      // 遮罩层
@@ -838,11 +894,11 @@
      baselisttages: [
        {
          id: 1,
          name: "材料待审核"
          name: "待审核"
        },
        {
          id: 2,
          name: "审查通过等待邮寄纸质材料"
          name: "预审通过等待纸质材料"
        },
        {
          id: 3,
@@ -905,10 +961,12 @@
        username: [
          { required: true, message: "请输入账户名称", trigger: "blur" }
        ],
        unitTaxNo: [{ required: true, message: "请输入税号", trigger: "blur" }],
        idcardno: [
          { required: true, message: "请输入身份账号", trigger: "blur" }
          { required: true, message: '请输入身份证号', trigger: 'blur' },
          // 添加自定义校验规则
          { validator: validateIdCard, trigger: 'blur' }
        ],
        //idcardno: [{ validator: validatePass, trigger: "blur" }],
        depositbank: [
          { required: true, message: "请输入开户银行", trigger: "change" }
        ],
@@ -972,6 +1030,8 @@
        flowconclusion: null,
        fundid: null
      },
      // 连续审批:待审批单据列表
      pendingList: [],
      // 查询参数
      queryParams: {
@@ -1036,7 +1096,7 @@
      invoicepdfimg: "",
      invoicepdfimgsrcList: [],
      invoDatatop: [],
      activeName: 1, //文件类型
      activeName: "common", //文件类型
      //上传附件路径
      uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload",
      ICDtoken: getToken(),
@@ -1048,6 +1108,11 @@
      pdftitle: "",
      pdfimg: "",
      pdfimgsrcList: [],
      currentIndex: 0, // 初始索引
      invoicecurrentIndex: 0, // 初始索引
      initialIndex: 0, // 初始索引
      viewerVisible: false, // 控制预览组件显示
      invoiceviewerVisible: false, // 控制预览组件显示
      pdfVisible: false,
      previewpdf: false,
      hintitle: "请上传文件后查看",
@@ -1215,9 +1280,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;
      }
      //初始化明细
@@ -1320,6 +1388,14 @@
    handleCheck() {
      this.isopen = 0;
      this.reset();
      // 重置审批信息,避免上一单的审批结果带入下一单
      this.checkObj = {
        flowlevelone: null,
        flowconclusion: null,
        fundid: null
      };
      // 连续审批:加载当前业务类型下的待审批列表
      this.getPendingList();
      getFund(this.curId).then(response => {
        this.form = response.data;
@@ -1629,7 +1705,7 @@
          sessionStorage.setItem("apiform", JSON.stringify(this.form));
          addorupdateFund(this.form)
            .then(response => {
              if (response.code === 200) {
              if (response.code == 200) {
                if (this.form.id) {
                  this.$modal.msgSuccess("申请单修改成功!");
                  this.$router.go(-1);
@@ -1640,7 +1716,7 @@
                    path: "/finance/applyDetail/",
                    query: {
                      id: response.data,
                      businessType: "2",
                      businessType: this.businessType,
                      operationType: "update",
                      curCase: this.curCase
                    }
@@ -1697,6 +1773,66 @@
      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);
    },
    // 取消按钮
    cancel() {
      this.$store.dispatch("tagsView/delView", this.$route);
@@ -1708,10 +1844,12 @@
      getUserProfile().then(res => {
        this.userprofile = res.data;
        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 {
@@ -1760,10 +1898,10 @@
                bankcardno: res.rows[j].bankcardno,
                unitno: res.rows[j].unitno,
                unitname: res.rows[j].unitname,
                userid: res.rows[j].username
                userid:
                  res.rows[j].username + "(" + res.rows[j].bankcardno + ")"
              });
            }
            else {
            } else {
              this.accountlist.push({
                id: res.rows[j].id,
                userno: res.rows[j].userno,
@@ -1774,7 +1912,8 @@
                bankcardno: res.rows[j].bankcardno,
                unitno: res.rows[j].unitno,
                unitname: res.rows[j].unitname,
                userid: res.rows[j].username + '(' + res.rows[j].idcardno + ')'
                userid:
                  res.rows[j].username + "(" + res.rows[j].idcardno + ")"
              });
            }
          }
@@ -2084,7 +2223,15 @@
                this.$modal.msgWarning(
                  "服务项目表中,第" +
                  (k + 1).toString() +
                  "行的服务人员姓名为选择,请选择人员后再提交保存!"
                  "行的人员姓名为空,请选择人员后再提交保存!"
                );
                return;
              }
              if (tempDetail.unitname == null) {
                this.$modal.msgWarning(
                  "服务项目表中,第" +
                  (k + 1).toString() +
                  "行的专家单位为空,请选择单位后再提交保存!"
                );
                return;
              }
@@ -2188,11 +2335,23 @@
                  flowconclusion: this.checkObj.flowlevelone,
                  flowcontent: this.checkObj.flowconclusion
                };
                this.$modal.loading("正在提交审核,请稍候!");
                checkfund(checkFundObj).then(res => {
                  //关闭窗口
                  this.$modal.msgSuccess("审核完成!");
                  this.$store.dispatch("tagsView/delView", this.$route);
                  this.$router.go(-1);
                  if (res.code == 200) {
                    //关闭窗口
                    this.$modal.closeLoading();
                    this.$modal.msgSuccess("审核完成!");
                    // 连续审批:询问是否继续审批下一单
                    this.continueOrExit();
                  } else {
                    this.$modal.closeLoading();
                    if (res.msg) {
                      this.$modal.msgError("操作失误");
                    } else {
                      this.$modal.msgError(res.msg);
                    }
                  }
                });
              }
              this.Getnetworkheader();
@@ -2420,10 +2579,8 @@
        .catch(() => {
          //几点取消的提示
        });
      //全部删除后添加一条新行
    },
    //计算总金额
    sumTotalFee(row) {
      let allSum = 0;
@@ -2536,10 +2693,24 @@
      // 图片加载成功时执行的操作
      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 {
@@ -2555,7 +2726,7 @@
      };
      const pdfimg = this.Networkheader + "/prod-api" + response.fileName;
      //获取票据信息位置
      if (this.activeName == 1) {
      if (this.activeName == "common") {
        if (response.code == 200) {
          this.previewpdf = true;
@@ -2632,36 +2803,61 @@
      this.tableDatatop = [];
      this.fileListto = [];
      this.invoicefileListto = [];
      this.pdfimg = '';
      this.pdfimg = "";
      this.invoicepdfimg = [];
      this.pdfimgsrcList = [];
      this.invoicepdfimgsrcList = [];
      this.tableDatatop.push(row);
      this.atpresent = index;
      this.pdfVisible = true;
      console.log(this.fileListto, "this.fileListto");
      console.log(this.invoicefileListto, "this.invoicefileListto");
      if (this.rbDetails[index].annexfilesList) {
        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)
        // 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;
              });
              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;
            });
          }
        );
        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 = [];
@@ -2670,26 +2866,35 @@
      }
      //发票
      if (this.rbDetails[index].invoicefilesList) {
        this.rbDetails[index].invoicefilesList.forEach((value, indexson) => {
          const pdfimg = this.Networkheader + "/prod-api" + value.url;
          fetch(pdfimg, config)
            .then(response => response.blob())
            .then(blob => {
              // 将获取的数据流转换为URL
              this.invoicefileListto.push({
                name: value.name,
                url: URL.createObjectURL(blob)
        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;
              });
              if (this.invoicefileListto.length == 1) {
                this.invoicepdfimg = URL.createObjectURL(blob);
              }
              this.invoicepdfimgsrcList.push(URL.createObjectURL(blob));
            })
            .catch(error => {
              console.error("Error loading image", error);
              return;
            });
          }
        );
        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
          );
        });
        this.previewpdf = true;
      } else {
        this.invoicefileListto = [];
@@ -2697,16 +2902,18 @@
        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) {
      if (this.activeName == "common") {
        this.pdftitle =
          "共" + this.pdfimgsrcList.length + "项,当前选中" + item.name;
        let name = item.name.split(".");
@@ -2754,7 +2961,7 @@
    },
    // 发票切换
    handleClick(tab, event) {
      if (this.activeName == 1) {
      if (this.activeName == "common") {
        this.pdftitle = "共" + this.pdfimgsrcList.length + "项";
      } else {
        this.pdftitle = "共" + this.invoicepdfimgsrcList.length + "项";
@@ -2764,16 +2971,14 @@
    deletedowfile(row) {
      console.log(row);
      let indexvalue = "";
      if (this.activeName == 1) {
      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.find(
          (item, index) => {
            return item.name == row.name;
          }
        indexvalue = this.rbDetails[this.atpresent].annexfilesList.findIndex(
          item => item.name == row.name
        );
        console.log(indexvalue, "删除索引");
        this.rbDetails[this.atpresent].annexfilesList.splice(indexvalue, 1);
@@ -2786,10 +2991,8 @@
        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.find(
          (item, index) => {
            return item.name == row.name;
          }
        indexvalue = this.rbDetails[this.atpresent].invoicefilesList.findIndex(
          item => item.name == row.name
        );
        console.log(indexvalue, "删除索引");
        this.rbDetails[this.atpresent].invoicefilesList.splice(indexvalue, 1);
@@ -2797,15 +3000,52 @@
    },
    // 点击上移
    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) {
      window.location.href = row.url;
@@ -2820,11 +3060,12 @@
      if (this.selectionType == "account") {
        //默认从账户库选择:1,账户库;2,新建账户
        this.accountfrom = "1";
        if (scope.row.idcardno == undefined || scope.row.idcardno == null) {
          this.accountselectform.accountname = scope.row.beneficiaryname;
        }
        else {
          this.accountselectform.accountname = scope.row.beneficiaryname + '(' + scope.row.idcardno + ')';
        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.expertunitname = "";
@@ -2856,9 +3097,22 @@
        if (this.selectionType == "account") {
          if (this.accountfrom == "1") {
            //赋值信息
            if (this.rbDetails[tempIndex].userno != this.accountselectform.userno) {
            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;
@@ -2911,13 +3165,12 @@
                    this.accountform.unitname = res.organizationname;
                  }
                });
              }
              else {
              } else {
                this.accountform.userstatus = 1;
              }
              addExternalperson(this.accountform).then(response => {
                if (response.code == 200) {
                if (response.code == 200) {
                  // //重新获取账户列表
                  // listExternalperson().then(res => {
                  //   this.accountlist = res.rows;
@@ -2935,7 +3188,11 @@
                      bankcardno: this.accountform.bankcardno,
                      unitno: this.accountform.unitno,
                      unitname: this.accountform.unitname,
                      userid: this.accountform.username
                      userid:
                        this.accountform.username +
                        "(" +
                        this.accountform.bankcardno +
                        ")"
                    });
                    this.$modal.msgSuccess("您已添加成功新账户信息!");
                  } else {
@@ -2949,9 +3206,15 @@
                      bankcardno: this.accountform.bankcardno,
                      unitno: this.accountform.unitno,
                      unitname: this.accountform.unitname,
                      userid: this.accountform.username + '(' + this.accountform.idcardno + ')'
                      userid:
                        this.accountform.username +
                        "(" +
                        this.accountform.idcardno +
                        ")"
                    });
                    this.$modal.msgSuccess("您已添加成功新账户信息,需要在账号状态启用后才能被使用!");
                    this.$modal.msgSuccess(
                      "您已添加成功新账户信息,需要在账号状态启用后才能被使用!"
                    );
                    return;
                  }
                  this.accountselectform.accountno = this.accountform.userno;
@@ -2963,7 +3226,8 @@
                      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].branchbankname =
                        res.branchbankname;
                      this.rbDetails[tempIndex].bankcardno = res.bankcardno;
                      this.rbDetails[tempIndex].phone = res.telephone;
@@ -3018,11 +3282,14 @@
        return;
      }
      if (regex.test(row.idcardno)) {
        row.error = "";
      } else {
        row.error = "身份证号码格式错误";
      }
      //身份证重复验证
      getInfoByIDCardNo(idcardno).then(res => {
        if (res.data.length > 1) {
          this.$modal.msgWarning("身份证号信息已被登记,请检查身份证号!"
          );
          return;
        }
      });
    },
    //账户类型选择变化
@@ -3037,6 +3304,12 @@
    }
  },
  // 失焦时手动触发校验(可选,通常配置了 trigger: 'blur' 后会自动触发)
  handleIdCardBlur() {
    // 手动校验单个字段,确保失焦时立刻看到结果
    this.$refs.showselectiondialog.validateField('idcardno');
  },
  //生命周期 - 创建完成(可以访问当前this实例)
  created() {
    //获取路由参数