11
WXL
2023-09-12 5d624d5ad0cdce0737e565c288b0efeb8b42aef8
src/views/project/fund/applyDetail/index.vue
@@ -72,7 +72,7 @@
              }}</el-radio>
            </el-form-item>
          </el-col>
          <el-col :span="5">
          <!-- <el-col :span="5">
            <el-form-item label="银行名称" prop="bankname">
              <el-input v-model="form.bankname" placeholder="请输入银行名称" />
            </el-form-item> </el-col
@@ -83,10 +83,28 @@
                placeholder="请输入银行账号"
              />
            </el-form-item>
          </el-col>
          </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">
            <el-form-item label="申请金额" prop="pretaxcost">
              <el-input
                v-model="form.pretaxcost"
                placeholder="税前金额合计"
                :disabled="true"
              />
            </el-form-item>
          </el-col>
        </el-row>
@@ -98,15 +116,7 @@
            </el-form-item>
          </el-col>
          -->
          <el-col :span="5">
            <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="taxcost" v-if="businessType == '1' || businessType == '2'">
@@ -123,15 +133,7 @@
              <el-input v-model="form.remark" 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">
            <el-form-item label="申请状态" prop="recordstatus">
@@ -154,10 +156,29 @@
            </el-button>
          </el-col>
        </el-row>
        <el-row v-if="jurisdiction">
          <el-alert
            title="当前为查看状态,不支持修改存储。"
            type="warning"
            show-icon
          >
          </el-alert>
        </el-row>
        <el-row v-if="businessType == 2">
          <div style="margin-bottom: 15px;">
            <el-button
              type="success"
              icon="el-icon-download"
              @click="Batchentry"
              >批量录入</el-button
            >
          </div>
        </el-row>
        <el-row>
          <el-table
            :data="rbDetails"
            v-loading="loading"
            max-height="800"
            border
            highlight-current-row
          >
@@ -165,7 +186,7 @@
              prop="orderno"
              align="center"
              label="序号"
              width="65"
              width="88"
            >
              <template slot-scope="scope">
                <el-input v-model="scope.row.orderno" placeholder="序号" />
@@ -301,7 +322,15 @@
                    :value="dict.expense"></el-option>
                </el-select>
              -->
                <el-input v-model="scope.row.amount" placeholder="金额" />
                <el-input
                  v-model="scope.row.amount"
                  placeholder="金额"
                  @blur="
                    val => {
                      calculateTax(scope.row, 'A');
                    }
                  "
                />
              </template>
            </el-table-column>
            <el-table-column
@@ -318,6 +347,11 @@
                <el-input
                  v-model="scope.row.taxedamount"
                  placeholder="税后金额"
                  @blur="
                    val => {
                      calculateTax(scope.row, 'B');
                    }
                  "
                />
              </template>
            </el-table-column>
@@ -359,6 +393,7 @@
              align="center"
              label="单位名称"
              width="250"
              v-if="form.applytype != '4'"
            >
              <template slot-scope="scope">
                <el-button
@@ -366,6 +401,22 @@
                  plain
                  @click="ShowDetailDialog(scope, 'unit')"
                  >{{ scope.row.unitname }}</el-button
                >
              </template>
            </el-table-column>
            <el-table-column
              prop="unitno"
              align="center"
              label="单位/个人"
              width="250"
              v-if="form.applytype == '4'"
            >
              <template slot-scope="scope">
                <el-button
                  type="primary"
                  plain
                  @click="ShowDetailDialog(scope, 'expert')"
                  >{{ scope.row.beneficiaryname }}</el-button
                >
                <!-- <el-select
                  v-model="scope.row.unitno"
@@ -410,8 +461,8 @@
              align="center"
              label="开户银行"
              width="200"
              v-if="form.applytype != '4'"
            >
              <!-- v-if="form.applytype != '4'" -->
              <template slot-scope="scope">
                <el-input
                  v-model="scope.row.depositbank"
@@ -424,7 +475,6 @@
              align="center"
              label="银行帐号"
              width="210"
              v-if="form.applytype != '4'"
            >
              <template slot-scope="scope">
                <el-input
@@ -433,9 +483,19 @@
                />
              </template>
            </el-table-column>
            <el-table-column prop="remark" align="center" label="备注">
            <el-table-column
              prop="remark"
              align="center"
              width="330"
              label="备注"
            >
              <template slot-scope="scope">
                <el-input v-model="scope.row.remark" placeholder="备注" />
                <el-input
                  type="textarea"
                  :rows="2"
                  v-model="scope.row.remark"
                  placeholder="备注"
                />
              </template>
            </el-table-column>
            <el-table-column
@@ -536,9 +596,10 @@
                size="mini"
                class="upload-demo"
                :action="uploadFileUrl"
                :file-list="fileList"
                :file-list="fileListto"
                :show-file-list="false"
                multiple
                :limit="20"
                drag
                :headers="headers"
                :on-success="
                  (response, file, fileList) =>
@@ -547,21 +608,72 @@
                :on-preview="downFile"
                :disabled="operationType == 'detail'"
                :on-error="handleUploadError"
                :on-exceed="handleExceed"
                :on-remove="remove"
                accept="image/*,.pdf"
              >
                <el-button
                  :disabled="operationType == 'detail'"
                  size="small"
                  type="primary"
                  >上传票据</el-button
                >
                <i class="el-icon-upload"></i>
                <div class="el-upload__text">
                  将票据拖到此处,或
                  <em
                    ><el-button
                      :disabled="operationType == 'detail'"
                      size="small"
                      type="primary"
                      >点击上传</el-button
                    ></em
                  >
                </div>
              </el-upload>
              <el-table
                :data="fileListto"
                @row-click="downFile"
                style="width: 100%"
                height="400"
              >
                <el-table-column
                  prop="name"
                  :show-overflow-tooltip="true"
                  label="名称"
                >
                  <template slot-scope="scope">
                    <i style="color:#409EFF" class=" el-icon-s-order" />{{
                      scope.row.name
                    }}
                  </template>
                </el-table-column>
                <el-table-column
                  prop="name"
                  width="180"
                  :show-overflow-tooltip="true"
                  label="功能"
                >
                  <template slot-scope="scope">
                    <el-button
                      type="primary"
                      size="mini"
                      @click.native.prevent.stop="deletedowfile(scope.row)"
                      >删除</el-button
                    >
                    <el-button
                      type="primary"
                      size="mini"
                      @click.native.prevent.stop="moveupdowfile(scope.row)"
                      >上移</el-button
                    >
                  </template>
                </el-table-column>
              </el-table>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-if="operationType == 'detail' || operationType == 'check'">
        <el-row
          v-if="
            operationType == 'detail' ||
              operationType == 'check' ||
              operationType == 'update'
          "
        >
          <el-table :data="fundflowList" border>
            <el-table-column
              label="审核日期"
@@ -621,7 +733,7 @@
          v-if="
            operationType == 'add' ||
              operationType == 'update' ||
              operationType == 'check'
              ismanager == true
          "
          >提交保存</el-button
        >
@@ -638,14 +750,17 @@
    <el-dialog
      :visible.sync="showSelectionDialog"
      :close-on-click-modal="false"
      :title="'单位/专家信息选择'"
      :title="'单位/个人信息选择'"
      width="500px"
      style="text-align: center"
      v-loading="loading"
    >
      <el-form ref="funddetailForm" :model="funddetailForm">
        <el-row>
          <el-col :span="24" v-if="selectionType == 'expert'">
        <el-row v-if="businessType != 4">
          <el-col
            :span="24"
            v-if="selectionType == 'expert' && businessType != 4"
          >
            <el-form-item label="请选择专家信息:" prop="expertfrom">
              <el-radio-group v-model="expertfrom" style="margin-bottom: 0">
                <el-radio label="1">专家库</el-radio>
@@ -708,7 +823,7 @@
              label="发票单位名称"
              prop="unitno"
              label-width="120px"
              v-if="businessType == 3 || businessType == 4"
              v-if="businessType == 3"
            >
              <el-select
                v-model="funddetailForm.unitno"
@@ -728,7 +843,69 @@
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
        <el-row v-if="businessType == 4">
          <el-col :span="24">
            <el-form-item label="请选择专家信息:" prop="experthear">
              <el-radio-group
                @change="ShowDetailDialog(spocewl)"
                v-model="experthear"
                style="margin-bottom: 0"
              >
                <el-radio label="unit">人员选项</el-radio>
                <el-radio label="expert">单位选项</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="24" v-if="experthear == 'unit'">
            <el-form-item
              label="人员姓名"
              prop="beneficiaryname"
              label-width="80px"
            >
              <el-select
                filterable
                allow-create
                ref="beneficiaryname"
                default-first-option
                @change="bbaaccss"
                v-model="Personnelforname"
                placeholder="请选择"
                style="width: 100%"
              >
                <el-option
                  v-for="item in expertlist"
                  :key="item.expertNo"
                  :label="item.exportName"
                  :value="item.exportName"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="24" v-if="experthear == 'expert'">
            <el-form-item label="单位名称" prop="unitno" label-width="120px">
              <el-select
                v-model="unitforname"
                placeholder="单位名称"
                @change="bbaaccss"
                clearable
                filterable
                allow-create
                style="width: 100%"
              >
                <el-option
                  v-for="(spec, index) in unitList"
                  :key="index"
                  :label="spec.organizationname"
                  :value="spec.organizationname"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-if="businessType != 4">
          <el-col :span="12" v-if="expertfrom == '2'">
            <el-form-item label="专家姓名" prop="expertname" label-width="80px">
              <el-input
@@ -757,7 +934,7 @@
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
        <el-row v-if="businessType != 4">
          <el-col :span="24" v-if="expertfrom == '2'">
            <el-form-item
              label="身份证号"
@@ -783,7 +960,7 @@
          </el-col>          
        </el-row>
      -->
        <el-row>
        <el-row v-if="businessType != 4">
          <el-col :span="24" v-if="expertfrom == '2'">
            <el-form-item
              label="单位名称"
@@ -807,7 +984,7 @@
              </el-select> </el-form-item
          ></el-col>
        </el-row>
        <el-row>
        <el-row v-if="businessType != 4">
          <el-col :span="24" v-if="expertfrom == '2'">
            <el-form-item
              label="开户银行"
@@ -841,7 +1018,14 @@
        >
      </span>
    </el-dialog>
    <el-dialog :title="pdftitle" :visible.sync="pdfVisible" width="50%">
    <el-dialog
      v-dialogDrags
      :modal="false"
      :close-on-click-modal="false"
      :title="pdftitle"
      :visible.sync="pdfVisible"
      width="60%"
    >
      <div class="pdfimg">
        <div class="box-pdf">
          <div>
@@ -850,8 +1034,9 @@
              class="upload-demo"
              :action="uploadFileUrl"
              :file-list="fileListto"
              :show-file-list="false"
              multiple
              :limit="20"
              drag
              :headers="headers"
              :on-success="
                (response, file, fileList) =>
@@ -860,17 +1045,65 @@
              :on-preview="downFile"
              :disabled="operationType == 'detail'"
              :on-error="handleUploadError"
              :on-exceed="handleExceed"
              :on-remove="remove"
              accept="image/*,.pdf"
            >
              <el-button
                :disabled="operationType == 'detail'"
                size="small"
                type="primary"
                >上传票据</el-button
              >
              <i class="el-icon-upload"></i>
              <div class="el-upload__text">
                将票据拖到此处,或
                <em
                  ><el-button
                    :disabled="operationType == 'detail'"
                    size="small"
                    type="primary"
                    >点击上传</el-button
                  ></em
                >
              </div>
              <!-- <div class="el-upload__tip" slot="tip">
                只能上传jpg/png文件,且不超过500kb
              </div> -->
            </el-upload>
            <el-table
              :data="fileListto"
              @row-click="downFile"
              style="width: 100%"
              height="400"
            >
              <el-table-column
                prop="name"
                :show-overflow-tooltip="true"
                label="名称"
              >
                <template slot-scope="scope">
                  <i style="color:#409EFF" class=" el-icon-s-order" />{{
                    scope.row.name
                  }}
                </template>
              </el-table-column>
              <el-table-column
                prop="name"
                width="180"
                :show-overflow-tooltip="true"
                label="功能"
              >
                <template slot-scope="scope">
                  <el-button
                    type="primary"
                    size="mini"
                    @click.native.prevent.stop="deletedowfile(scope.row)"
                    >删除</el-button
                  >
                  <el-button
                    type="primary"
                    size="mini"
                    @click.native.prevent.stop="moveupdowfile(scope.row)"
                    >上移</el-button
                  >
                </template>
              </el-table-column>
            </el-table>
          </div>
          <!-- <div
            class="pdftit"
@@ -882,7 +1115,7 @@
          </div> -->
        </div>
        <div v-if="this.previewpdf" class="pdfimgmin">
        <div v-if="this.previewpdf && pdfimgsrcList.length" class="pdfimgmin">
          <!-- <img :src="pdfimg" /> -->
          <el-image
            style="width: 95%; height: 90%"
@@ -909,17 +1142,52 @@
        <el-button type="primary" @click="Savenow">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 批量选取 -->
    <el-dialog
      title="批量生成明细信息"
      :visible.sync="batchdialogVisible"
      width="30%"
    >
      <div style="max-height: 300px; overflow-y: auto">
        <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-group>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="BatchentryFn">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
// 'sdaad2123UD2',1  'wsadadwsad',4 'sdadaddad',3 'ssaaddxs',2
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';
import {
  listDonatebaseinfo,
  getDonatebaseinfo
} from "@/api/project/donatebaseinfo";
import debounce from "lodash/debounce";
import {
  onelistFund,
  listFund,
@@ -989,7 +1257,6 @@
    Li_area_select,
    OrgSelecter
  },
  name: "fundApply",
  dicts: [
@@ -1016,9 +1283,12 @@
      // 导出遮罩层
      exportLoading: false,
      usernamedata: "",
      jurisdiction: false,
      // 表单参数
      form: {},
      experthear: "",
      spocewl: "",
      //费用申请表单title
      title: "",
      //申请单类型
@@ -1048,8 +1318,14 @@
      feeUnitList: [],
      // 网络请求头
      Networkheader: null,
      batchdialogVisible: false,
      itemlist: [],
      cityOptions: [],
      checkAll: false,
      checkedCities: [],
      Personnelforname: "请选择",
      unitforname: "请选择",
      isIndeterminate: true,
      //是否是专家费的OPO审批人员
      ismanager: false,
@@ -1077,6 +1353,8 @@
      rowfeeblocks: [],
      fundflowList: [],
      // 随机数
      randomnumber: "",
      //专家/单位选择:expert/unit
      selectionType: "",
@@ -1202,19 +1480,44 @@
      pdfimgsrcList: [],
      pdfVisible: false,
      previewpdf: false,
      hintitle: "选中左侧已上传文件预览查看",
      hintitle: "请上传文件后查看",
      atpresent: "",
      Savereminder: false, //提醒保存弹框
      Reminderquantity: 0, //提醒数量
      totalquantity: 0 //总数量
      totalquantity: 0, //总数量
      Modifyornot: 0 //是否修改
    };
  },
  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    bbaaccss(val) {
      console.log(val);
      console.log(this.funddetailForm);
    },
    // 浏览器页面关闭或刷新提示
    beforeunloadHandler(e) {
      if (
        (JSON.stringify(this.form) == sessionStorage.getItem("apiform") &&
          JSON.stringify(this.rbDetails) ==
            sessionStorage.getItem("apifunddetail")) ||
        !sessionStorage.getItem("apifunddetail")
      ) {
        console.log(cg);
      } else {
        this._beforeUnload_time = new Date().getTime();
        e = e || window.event;
        if (e) {
          e.returnValue = "关闭提示";
        }
        return "关闭提示";
      }
    },
    // 表单重置
    reset() {
      this.form = {
@@ -1266,16 +1569,14 @@
    },
    // 获取请求头
    Getnetworkheader() {
      console.log(window.location.href);
      let string = window.location.href;
      if (string.includes("9091")) {
        const index = string.indexOf("9091");
        this.Networkheader = string.slice(0, index + 4); // 截取9091及其前部字符
        console.log(this.Networkheader);
        // console.log(this.Networkheader);
      } else {
        const index = string.indexOf("8032");
        this.Networkheader = string.slice(0, index + 4); // 截取8032及其前部字符
        console.log(this.Networkheader);
      }
    },
    /** 通过参数获取业务类型 */
@@ -1303,6 +1604,7 @@
      } else if (this.businessType == "4") {
        this.businessName = "办公费用报销单";
        this.amountLabel = "金额";
        this.getUnitList();
        // this.getBaseInfoList();
      }
@@ -1319,6 +1621,7 @@
        this.handleUpdate();
      } else if (this.operationType == "detail") {
        this.title = this.businessName + "查看";
        this.jurisdiction = true;
        this.handleDetail();
      } else if (this.operationType == "check") {
        this.title = this.businessName + "审核";
@@ -1360,6 +1663,10 @@
      getFund(this.curId).then(response => {
        this.form = response.data;
        sessionStorage.removeItem("apiform");
        sessionStorage.setItem("apiform", JSON.stringify(this.form));
        // this.form.recordstate =-1;
        // this.form.recordstatus = response.data.recordstatus + "";
        //附件处理
@@ -1368,6 +1675,7 @@
        //明细处理
        getownFundDetail(this.curId).then(res => {
          this.rbDetails = res.data;
          if (this.rbDetails.length > 0) {
            for (let m = 0; m < this.rbDetails.length; m++) {
              this.rbDetails[m].itemlist = [];
@@ -1393,10 +1701,24 @@
              //   });
              // });
            }
            console.log("yeil");
            sessionStorage.removeItem("apifunddetail");
            sessionStorage.setItem(
              "apifunddetail",
              JSON.stringify(this.rbDetails)
            );
          } else {
            this.addRow(0);
          }
        });
        let listFundflowparams = {
          fundid: this.curId,
          fundtype: 2
        };
        listFundflow(listFundflowparams).then(res => {
          this.fundflowList = res.rows;
        });
        console.log(this.fundflowList);
      });
    },
@@ -1407,6 +1729,10 @@
      getFund(this.curId).then(response => {
        this.form = response.data;
        sessionStorage.removeItem("apiform");
        sessionStorage.setItem("apiform", JSON.stringify(this.form));
        console.log("response.data", response.data);
        //附件处理
        // this.fileList = this.form.annexbankcard ? this.form.annexbankcard.split(",").map(item => ({ url: item, name: item })) : []
@@ -1443,13 +1769,17 @@
      });
    },
    /** 修改按钮操作 */
    /** 查看按钮操作 */
    handleCheck() {
      this.isopen = 0;
      this.reset();
      getFund(this.curId).then(response => {
        this.form = response.data;
        sessionStorage.removeItem("apiform");
        sessionStorage.setItem("apiform", JSON.stringify(this.form));
        //附件处理
        // this.fileList = this.form.annexbankcard ? this.form.annexbankcard.split(",").map(item => ({ url: item, name: item })) : []
@@ -1541,9 +1871,24 @@
          });
        });
    },
    generateRandomString(length) {
      const characters =
        "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
      let randomString = "";
      for (let i = 0; i < length; i++) {
        randomString += characters.charAt(
          Math.floor(Math.random() * characters.length)
        );
      }
      return randomString;
    },
    /** 提交按钮 */
    submitForm() {
    submitForm: debounce(function() {
      if (!this.randomnumber) {
        this.randomnumber = this.generateRandomString(9);
        this.form.randomnumber = this.randomnumber;
      }
      console.log(this.randomnumber);
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.formData = this.form;
@@ -1709,10 +2054,11 @@
                isNaN(parseFloat(tempDetail.taxamount)) ||
                parseFloat(tempDetail.taxamount) == 0
              ) {
                tempDetail.taxedamount = tempDetail.amount;
                tempDetail.taxedamount = parseFloat(tempDetail.amount);
              } else {
                tempDetail.taxedamount =
                  tempDetail.amount + tempDetail.taxamount;
                  parseFloat(tempDetail.amount) +
                  parseFloat(tempDetail.taxamount);
              }
            }
          }
@@ -1766,6 +2112,11 @@
              this.$modal.msgError("申请单保存失败:" + response.msg);
            }
          });
          sessionStorage.setItem(
            "apifunddetail",
            JSON.stringify(this.rbDetails)
          );
          sessionStorage.setItem("apiform", JSON.stringify(this.form));
          //关闭窗口
          this.loading = false;
@@ -1774,7 +2125,7 @@
          this.$router.go(-1);
        }
      });
    },
    }, 500),
    //审批提交
    checksubmit() {
@@ -1897,13 +2248,16 @@
    //获取费用机构列表
    getFeeUnitList() {
      console.log("单位");
      listReportname("org").then(res => {
        this.feeUnitList = res.data;
      });
      console.log(this.feeUnitList);
    },
    //获取医疗机构列表
    getUnitList() {
      console.log("医疗机构");
      listOrganization(3).then(response => {
        for (let i = 0; i < response.rows.length; i++) {
          this.unitList.push({
@@ -1911,6 +2265,7 @@
            organizationid: response.rows[i].id,
            organizationname: response.rows[i].organizationname
          });
          console.log(this.unitList);
        }
      });
    },
@@ -1978,10 +2333,16 @@
            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;
@@ -2083,6 +2444,34 @@
      });
    },
    //计算个税:type(A:已知税前金额,计算税后金额;B:已知税后金额,计算税前金额)
    calculateTax(row, type) {
      //if (isNaN(parseFloat(tempDetail.taxedamount)))
      //获取参数
      this.taxParam.beneficiaryNo = row.beneficiaryno;
      this.taxParam.startTime = this.form.createTime.substring(0, 10);
      if (type == "A") {
        // 计算个税、税后金额
        this.taxParam.money = row.amount.toString();
        getTaxByBeneFiciaryNo(this.taxParam).then(res => {
          if (res.code == 200) {
            row.taxamount = res.data;
            row.taxedamount = row.amount - row.taxamount;
          }
        });
      } else {
        // 计算税前、个税金额
        this.taxParam.money = row.taxedamount.toString();
        getTaxBeforeByAfterMoney(this.taxParam).then(res => {
          if (res.code == 200) {
            row.taxamount = res.data.nowTax;
            row.amount = parseFloat(res.data.nowTaxBeforeMoney);
          }
        });
      }
    },
    //导入所有项目
    importFeeItems() {
      this.loading = true;
@@ -2157,6 +2546,10 @@
    },
    // 接受提醒立刻保存
    Savenow() {
      if (!this.randomnumber) {
        this.randomnumber = this.generateRandomString(9);
        this.form.randomnumber = this.randomnumber;
      }
      this.Savereminder = false;
      this.Reminderquantity = 0;
      this.totalquantity = 0;
@@ -2273,7 +2666,7 @@
                }
              });
            }
            // 计算税前、税费、税后金额
            if (tempDetail.amount == undefined || tempDetail.amount == null || tempDetail.amount == 0 || tempDetail.amount == '') {
              //获取参数
@@ -2325,10 +2718,11 @@
                isNaN(parseFloat(tempDetail.taxamount)) ||
                parseFloat(tempDetail.taxamount) == 0
              ) {
                tempDetail.taxedamount = tempDetail.amount;
                tempDetail.taxedamount = parseFloat(tempDetail.amount);
              } else {
                tempDetail.taxedamount =
                  tempDetail.amount + tempDetail.taxamount;
                  parseFloat(tempDetail.amount) +
                  parseFloat(tempDetail.taxamount);
              }
            }
          }
@@ -2378,6 +2772,11 @@
          addorupdateFund(this.form).then(response => {
            if (response.code === 200) {
              this.$modal.msgSuccess("申请单保存成功!");
              this.Getnetworkheader();
              this.getroute();
              this.getExternalList();
              this.getUserList();
              this.getUserProfile();
            } else {
              this.$modal.msgError("申请单保存失败:" + response.msg);
            }
@@ -2389,7 +2788,86 @@
        }
      });
    },
    handleCheckAllChange(val) {
      console.log(val);
      this.checkedCities = val ? this.cityOptions : [];
      this.isIndeterminate = false;
    },
    handleCheckedCitiesChange(value) {
      console.log(value);
      console.log(this.checkedCities);
      let checkedCount = value.length;
      console.log(checkedCount);
      this.checkAll = checkedCount === this.cityOptions.length;
      this.isIndeterminate =
        checkedCount > 0 && checkedCount < this.cityOptions.length;
    },
    // 批量录入点击
    Batchentry() {
      // ethical
      listReportname("ethical").then(res => {
        console.log(res);
        this.cityOptions = res.data;
      });
      this.batchdialogVisible = true;
    },
    // 确认录入
    BatchentryFn() {
      this.checkedCities.forEach(item => {
        console.log(item);
        let rowData = {
          orderno: null,
          id: item.id,
          fundid: null,
          beneficiaryname: item.reportName,
          beneficiaryno: null,
          unitname: item.unitname,
          unitno: null,
          uintuserno: null,
          title: item.title,
          idcardtype: null,
          idcardno: item.idcrad,
          sex: null,
          familyrelations: null,
          phone: null,
          depositbank: item.depositbank,
          bankcardno: item.bankcardno,
          branchbankname: item.branchbankname,
          annexbankcard: null,
          annexregistform: null,
          applytype: "伦理审核专家费",
          itemid: "器官捐献伦理审核专家费",
          itemname: null,
          itemtype: null,
          amount: 200,
          prepaidamount: null,
          taxamount: null,
          invoicecount: null,
          taxedamount: null,
          attachcount: null,
          remark: null,
          recordstatus: "-1",
          delFlag: null,
          createBy: null,
          createTime: null,
          updateBy: null,
          updateTime: null,
          uploadflag: null,
          uploadtime: null,
          itemlist: [],
          servicesscope: null,
          rowfeeblocks: [],
          annexfiles: null
        };
        console.log(rowData);
        this.rbDetails.push(rowData);
      });
      for (let i = 0; i < this.checkedCities.length + 1; i++) {
        this.rbDetails[i].orderno = i + 1;
      }
      this.batchdialogVisible = false;
    },
    //新增一行
    addRow(rowIndex) {
      let rowData = {
@@ -2436,10 +2914,10 @@
        rowfeeblocks: [],
        annexfiles: null
      };
      if (this.Reminderquantity >= 5) {
        this.Savereminder = true;
        return;
      }
      // if (this.Reminderquantity >= 5) {
      //   this.Savereminder = true;
      //   return;
      // }
      if (rowIndex == undefined || rowIndex == null || rowIndex < 0) {
        this.rbDetails.push(rowData);
      } else {
@@ -2459,6 +2937,11 @@
        type: "success"
      })
        .then(() => {
          console.log(this.rbDetails.length);
          if (this.rbDetails.length == 1) {
            console.log("新增");
            this.addRow(0);
          }
          if (row.id !== null) {
            delFunddetail(row.id).then(res => {
              if (res.code === 200) {
@@ -2492,13 +2975,7 @@
        });
      //全部删除后添加一条新行
      if (this.rbDetails.length == 1) {
        this.addRow(0);
      }
    },
    //计算个税
    calculateTax() {},
    //计算总金额
    sumTotalFee(row) {
@@ -2594,28 +3071,10 @@
    //文件上传
    handleUploadError() {},
    /** 下载文件按钮操作 */
    downFile(item) {
      const url = process.env.VUE_APP_BASE_API + item.url;
      var a = document.createElement("a");
      var event = new MouseEvent("click");
      a.download = item.name;
      a.href = url;
      a.dispatchEvent(event);
    },
    // remove(file) {
    //   this.fileList.splice(this.fileList.indexOf(file), 1)
    // },
    remove(file, fileList) {
      const rbDetails = [...this.rbDetails];
      this.fileListto.splice(this.fileListto.indexOf(file), 1);
      rbDetails[this.atpresent].annexfilesList = this.fileListto;
    },
    handleExceed() {
      this.$message.error(`上传文件数量不能超过 ${5} 个!`);
    },
    //文件上传成功回调
@@ -2635,9 +3094,15 @@
      //获取票据信息位置
      if (response.code == 200) {
        this.form.filename = file.raw.name;
        this.previewpdf = true;
        this.$modal.msgSuccess(response.msg);
        this.fileListto.push({ name: file.name, url: response.fileName });
        // this.fileListto.push({ name: file.name, url: response.url });
        this.pdfimgsrcList.push(
          this.Networkheader + "/prod-api" + response.fileName
        );
        this.pdfimg = this.Networkheader + "/prod-api" + response.fileName;
        this.rbDetails[this.atpresent].annexfilesList = this.fileListto;
      } else {
        console.log(response.msg);
@@ -2649,10 +3114,15 @@
      this.atpresent = index;
      this.pdfVisible = true;
      if (this.rbDetails[index].annexfilesList) {
        this.previewpdf = true;
        this.fileListto = this.rbDetails[index].annexfilesList;
        this.pdfimg = this.Networkheader + "/prod-api" + this.fileListto[0].url;
        // this.pdfimg = this.fileListto[0].url;
        this.pdfimgsrcList = [];
        this.pdfimgsrcList.push(this.pdfimg);
        this.fileListto.forEach(item => {
          this.pdfimgsrcList.push(this.Networkheader + "/prod-api" + item.url);
        });
        console.log(this.pdfimgsrcList);
        console.log(this.pdfimg);
      } else {
        this.fileListto = [];
@@ -2660,8 +3130,10 @@
        this.pdftitle = "";
      }
    },
    // 点击已上传文件
    downFile(item) {
      console.log(item);
      this.pdftitle = item.name;
      let name = item.name.split(".");
      if (name[1] == "pdf") {
@@ -2672,11 +3144,15 @@
        this.previewpdf = true;
        if (item.url) {
          this.pdfimg = this.Networkheader + "/prod-api" + item.url;
          this.pdfimgsrcList = [];
          this.pdfimgsrcList.push(this.pdfimg);
          // if (!this.pdfimgsrcList.includes(this.pdfimg)) {
          //   this.pdfimgsrcList.push(this.pdfimg);
          //   console.log("加入");
          // }
          console.log(this.pdfimg);
          console.log(this.pdfimgsrcList, "imglist");
        } else {
          this.pdfimg = this.Networkheader + "/prod-api" + item.response.url;
          this.pdfimg = this.Networkheader + "/prod-api" + item.url;
        }
      } else {
        this.hintitle = "当前文件暂不支持预览";
@@ -2684,10 +3160,43 @@
        this.previewpdf = false;
      }
    },
    getIndexInArray(arr, obj) {
      return arr.indexOf(obj);
    },
    // 点击删除
    deletedowfile(row) {
      console.log(this.fileListto);
      console.log(row);
      const indexlist = this.getIndexInArray(
        this.pdfimgsrcList,
        this.Networkheader + "/prod-api" + row.url
      );
      console.log(indexlist);
      this.pdfimgsrcList.splice(indexlist, 1);
      const index = this.getIndexInArray(this.fileListto, row);
      this.fileListto.splice(index, 1);
      console.log(index);
      console.log(this.pdfimgsrcList);
    },
    // 点击上移
    moveupdowfile(row) {
      const index = this.getIndexInArray(this.fileListto, row);
      const item = this.fileListto.splice(index, 1)[0]; // 移除指定索引处的元素,并保存到item变量中
      this.fileListto.splice(index - 1, 0, item); // 将item插入到索引位置的前一位
    },
    //专家/医疗机构/费用报销机构选择
    ShowDetailDialog(spoce, showType) {
      this.spocewl = spoce;
      console.log(spoce);
      this.selectionType = showType;
      if (this.businessType == 4 || !showType) {
        this.selectionType = this.experthear;
        console.log(this.selectionType);
      }
      // if (!showType) {
      //   this.selectionType = this.experthear;
      // }
      this.expertfrom = "1";
      this.funddetailForm.index = spoce.$index;
@@ -2708,13 +3217,27 @@
    //专家/医疗机构/费用报销机构选择
    ConfirmDetailDialog() {
      console.log(this.unitforname);
      console.log(this.Personnelforname);
      if (this.businessType == 4) {
        if (this.experthear == "expert") {
          this.funddetailForm.beneficiaryname = this.unitforname;
        } else {
          console.log(11);
          this.funddetailForm.beneficiaryname = this.Personnelforname;
          console.log(this.funddetailForm.beneficiaryname);
        }
      }
      console.log(this.funddetailForm);
      let tempIndex = this.funddetailForm.index;
      let tempExpertName = this.funddetailForm.beneficiaryname;
      let tempUnitname = this.funddetailForm.unitname;
      let singleDetail = this.rbDetails[tempIndex];
      console.log(tempExpertName);
      if (this.selectionType == "expert") {
        if (this.expertfrom == "1") {
      if (this.selectionType == "expert" || this.businessType == 4) {
        if (this.expertfrom == "1" || this.experthear == "unit") {
          //从专家列表获取信息
          this.personlist.map(res => {
            if (tempExpertName == res.username) {
@@ -2829,6 +3352,14 @@
        }
      }
      // if (this.experthear == "unit") {
      //   singleDetail.unitname = "";
      // }
      if (this.businessType == 4) {
        singleDetail.beneficiaryname = this.funddetailForm.beneficiaryname;
      }
      console.log(singleDetail);
      console.log(this.funddetailForm);
      this.rbDetails[tempIndex] = singleDetail;
      this.showSelectionDialog = false;
    }
@@ -2840,12 +3371,19 @@
    this.Getnetworkheader();
    this.getroute();
    this.getExternalList();
    this.getFeeUnitList();
  },
  //生命周期 - 挂载完成(可以访问DOM元素)
  mounted() {
    window.addEventListener("beforeunload", e => this.beforeunloadHandler(e));
    this.getUserList();
    this.getUserProfile();
    let apifunddetailForm = this.funddetailForm;
    let apiform = this.form;
    console.log(apiform);
    console.log(apifunddetailForm);
    // this.getFeeUnitList();
  },
@@ -2894,7 +3432,7 @@
  height: 600px;
  .box-pdf {
    width: 200px;
    width: 400px;
    padding-top: 20px;
    margin-right: 30px;
    border: 1px solid #dcdfe6;
@@ -2933,4 +3471,12 @@
  line-height: 36px;
  text-align: center;
}
::v-deep .el-alert__title {
  font-size: 25px;
  line-height: 25px;
}
::v-deep .el-checkbox.is-bordered + .el-checkbox.is-bordered {
  margin-left: 0 !important;
  margin-bottom: 10px;
}
</style>