yxh
昨天 a79d67f8a9a9fa02f9d25f987b9611af965c484f
src/views/project/fundcheck/ethicalExpertFeeCheck/index.vue
@@ -1,6 +1,7 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="120px">
    <el-form
      class="opo-query-form" :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="90px">
      <el-row>
        <el-col :span="5">
          <el-form-item label="捐献案例" prop="donorname" style="float: left">
@@ -41,9 +42,9 @@
        </el-col>
        <el-col :span="8">
          <el-form-item label="申请日期" prop="applyTime">
            <el-date-picker format="yyyy-MM-dd" @change="selectapplication" value-format="yyyy-MM-dd" v-model="applyTime"
              type="daterange" range-separator="至" start-placeholder="申请开始日期" end-placeholder="申请结束日期"
              @keyup.enter.native="flowconclusion">
            <el-date-picker format="yyyy-MM-dd" @change="selectapplication" value-format="yyyy-MM-dd HH:mm:ss"
              v-model="applyTime" type="daterange" range-separator="至" start-placeholder="申请开始日期"
              end-placeholder="申请结束日期" @keyup.enter.native="flowconclusion">
            </el-date-picker>
          </el-form-item>
        </el-col>
@@ -75,30 +76,30 @@
              <span>{{ parseTime(scope.row.applyTime, "{y}-{m}-{d}") }}</span>
            </template>
          </el-table-column>
          <el-table-column label="申请金额" align="center" prop="pretaxcost" width="200px" />
          <el-table-column label="经办人" align="center" prop="username" width="150px" />
          <el-table-column label="申请材料状态" width="140" align="center" prop="checkFlag">
          <el-table-column label="申请金额" align="center" prop="pretaxcost" width="120px" />
          <el-table-column label="经办人" align="center" prop="username" width="90px" />
          <el-table-column label="材料预审状态" width="140px" align="center" prop="checkFlag">
            <template slot-scope="scope">
              <dict-tag :options="dict.type.sys_stage_type" :value="scope.row.checkstatus" />
            </template>
          </el-table-column>
          <el-table-column label="审核状态" align="center" prop="recordstatus" width="200">
          <el-table-column label="审核状态" align="center" prop="recordstatus" width="140px">
            <template slot-scope="scope">
              <dict-tag :options="dict.type.sys_recordstatus" :value="scope.row.recordstatus" />
            </template>
          </el-table-column>
          <el-table-column label="个税计算情况" align="center" prop="recordstatus" width="200">
          <!-- <el-table-column label="个税计算情况" align="center" prop="recordstatus" width="120px">
            <template slot-scope="scope">
              <dict-tag :options="dict.type.sys_tax" :value="scope.row.istax" />
            </template>
          </el-table-column>
          <el-table-column label="所属组别" align="center" prop="deptmentname" width="200px" />
          <el-table-column label="组长" align="center" prop="managername" width="150px" />
          <el-table-column label="捐献者" align="center" prop="donorname" width="120px" />
          </el-table-column> -->
          <el-table-column label="所属组别" align="center" prop="deptmentname" width="140px" />
          <el-table-column label="组长" align="center" prop="managername" width="90px" />
          <el-table-column label="捐献者" align="center" prop="donorname" width="90px" />
          <el-table-column label="备注" align="center" prop="remark" />
          <!--<el-table-column label="捐献编号" align="center" prop="donorno" />
          <el-table-column label="财务审核" align="center" prop="financechecher" width="140" />-->
          <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width" width="260px">
          <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width" width="200px">
            <template slot-scope="scope">
              <el-button size="mini" type="text" icon="el-icon-edit" v-if="scope.row.checkFlag == 0"
                @click="handleDetail(scope.row)">详情</el-button>
@@ -106,7 +107,8 @@
              <el-button v-if="scope.row.checkFlag == 1" size="mini" type="text" icon="el-icon-edit"
                @click="handleCheck(scope.row)">审核</el-button>
              <!-- v-hasPermi="['project:donateconsolationfund:edit']" -->
              <el-button size="mini" type="text" icon="el-icon-download" @click="dayin(scope.row.id)">下载</el-button>
              <el-button size="mini" type="text" icon="el-icon-download"
                @click="totaldayin(scope.row.id)">下载</el-button>
              <!-- <el-popover placement="right" width="400" trigger="click">
                <el-table :data="gridData">
                  <el-table-column
@@ -137,8 +139,8 @@
          </el-table-column>
        </el-table>
        <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
          @pagination="getlistbypower" />
        <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize" @pagination="getlistbypower" />
      </el-row>
    </el-form>
@@ -197,7 +199,8 @@
        </el-row>
        <el-row style="margin-top: 5px; margin-bottom: 5px">
          <el-table :data="fundDetailArr" :summary-method="getSummaries" border highlight-current-row v-loading="loading">
          <el-table :data="fundDetailArr" :summary-method="getSummaries" border highlight-current-row
            v-loading="loading">
            <el-table-column prop="orderno" align="center" label="排序" width="80">
              <template slot-scope="scope">
                <el-input v-model="scope.row.orderno" placeholder="排序" />
@@ -230,17 +233,19 @@
              <template slot-scope="scope">
                <el-select filterable allow-create ref="getReportname" default-first-option
                  @change="selectpersonmsg(scope.row)" v-model="scope.row.beneficiaryname" placeholder="请选择">
                  <el-option v-for="item in arrr3" :key="item.reportNo" :label="item.reportName" :value="item.reportName">
                  <el-option v-for="item in arrr3" :key="item.reportNo" :label="item.reportName"
                    :value="item.reportName">
                  </el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column prop="amount" align="center" label="税前金额" width="150">
              <template slot-scope="scope">
                <el-input v-model="scope.row.amount" @blur="val => {
                  sumTotalFee();
                }
                  " placeholder="税前金额" />
                <el-input v-model="scope.row.amount" @blur="
                  val => {
                    sumTotalFee();
                  }
                " placeholder="税前金额" />
              </template>
            </el-table-column>
            <!-- <el-table-column
@@ -255,10 +260,11 @@
            </el-table-column> -->
            <el-table-column prop="taxedamount" align="center" label="税后金额" width="150">
              <template slot-scope="scope">
                <el-input v-model="scope.row.taxedamount" placeholder="税后金额" @blur="val => {
                  sumTotalFee();
                }
                  " />
                <el-input v-model="scope.row.taxedamount" placeholder="税后金额" @blur="
                  val => {
                    sumTotalFee();
                  }
                " />
              </template>
            </el-table-column>
            <el-table-column prop="unitno" align="center" label="单位" width="180">
@@ -306,7 +312,7 @@
          <el-col :span="7">
            <el-form-item label="申请日期" prop="applyTime">
              <!-- <el-input v-model="form.donorno" placeholder="请输入申请日期" /> -->
              <el-date-picker clearable style="width: 100%" v-model="form.applyTime" type="date"
              <el-date-picker clearable 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>
@@ -357,7 +363,7 @@
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="dundcheck" v-if="dialogType == 'edit'">审核</el-button>
        <el-button type="primary" :loading="checkSubmitLoading" :disabled="checkSubmitLoading" @click="dundcheck" v-if="dialogType == 'edit'">审核</el-button>
        <el-button @click="cancel">取消</el-button>
      </div>
    </el-dialog>
@@ -428,8 +434,11 @@
import Li_area_select from "@/components/Address";
import OrgSelecter from "@/views/project/components/orgselect";
import { getUserProfile } from "@/api/system/user";
import { getToken } from "@/utils/auth";
// 导入本地存储的方法
import { setItem, grtItem, removeItem } from "@/utils/storage.js";
import { moneySum, moneyAdd, moneySub, moneyMul, moneyRound } from "@/utils/money";
export default {
  components: {
@@ -453,6 +462,7 @@
  ],
  data() {
    return {
      checkSubmitLoading: false,
      arrr2: [],
      arrr3: [],
      //费用类型数组
@@ -509,6 +519,9 @@
      //捐献案例列表数据
      // donationCaseTableData:[],
      donatebaseinfoList: [],
      headers: {
        Authorization: "Bearer " + getToken()
      },
      gridData: [
        {
          date: "2016-05-02",
@@ -555,7 +568,7 @@
        },
        {
          value: 2,
          label: "审查通过等待邮寄纸质材料"
          label: "审查通过等待纸质材料"
        },
        {
          value: 3,
@@ -682,6 +695,7 @@
      });
    },
    dundcheck() {
      if (this.checkSubmitLoading) return;
      // this.$em
      //console.log("1234567", this.form.flowlevelone, this.form.flowconclusion);
@@ -698,12 +712,19 @@
        this.$modal.msgError("请选择审核结论!");
        return;
      }
      this.checkSubmitLoading = true;
      checkfund(checkfundobj).then(res => {
        console.log("审核费用", res);
        this.dialogOpen = false;
        this.reset();
        this.$modal.msgSuccess("审核完成!");
        this.getlistbypower();
        this.checkSubmitLoading = false;
        if (res.code == 200) {
          console.log("审核费用", res);
          this.dialogOpen = false;
          this.reset();
          this.$modal.msgSuccess("审核完成!");
          this.getlistbypower();
        } else {
          this.dialogOpen = false;
          this.$modal.msgError(res.msg || "操作失败");
        }
      });
    },
    getlistUser() {
@@ -746,22 +767,35 @@
    totaldayin(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);
          });
        }
      });
    },
@@ -1437,49 +1471,45 @@
      });
    },
    //计算总金额
    //计算总金额(金额一律走精确运算,禁止 parseFloat 累加)
    sumTotalFee() {
      let allSum = 0;
      const detailsArr = [];
      let preTaxSum = 0;
      let taxedSum = 0;
      if (this.form.applytype != null) {
        for (let i = 0; i < this.fundDetailArr.length; i++) {
          const detail = this.fundDetailArr[i];
          let totalFee = 0;
          let taxFee = 0;
          if (this.form.applytype == 1 || this.form.applytype == 2) {
            //计算当前报销内容费用合计
            if (!isNaN(parseFloat(this.fundDetailArr[i].amount))) {
              totalFee += parseFloat(this.fundDetailArr[i].amount);
              taxFee += parseFloat(this.fundDetailArr[i].amount);
              preTaxSum += parseFloat(this.fundDetailArr[i].amount);
            //计算当前报销内容费用合计:税前 - 扣税
            if (!isNaN(parseFloat(detail.amount))) {
              totalFee = moneyAdd(totalFee, detail.amount);
              preTaxSum = moneyAdd(preTaxSum, detail.amount);
            }
            if (!isNaN(parseFloat(this.fundDetailArr[i].taxamount))) {
              totalFee -= parseFloat(this.fundDetailArr[i].taxamount);
              taxFee -= parseFloat(this.fundDetailArr[i].taxamount);
            if (!isNaN(parseFloat(detail.taxamount))) {
              totalFee = moneySub(totalFee, detail.taxamount);
            }
            //taxedamount
            if (!isNaN(parseFloat(this.fundDetailArr[i].taxedamount))) {
              taxedSum += parseFloat(this.fundDetailArr[i].taxedamount);
            if (!isNaN(parseFloat(detail.taxedamount))) {
              taxedSum = moneyAdd(taxedSum, detail.taxedamount);
            }
          } else if (this.form.applytype == 3) {
            if (
              !isNaN(parseFloat(this.fundDetailArr[i].price)) &&
              !isNaN(parseFloat(this.fundDetailArr[i].quantity))
              !isNaN(parseFloat(detail.price)) &&
              !isNaN(parseFloat(detail.quantity))
            ) {
              totalFee +=
                parseFloat(this.fundDetailArr[i].price) *
                parseFloat(this.fundDetailArr[i].quantity);
              totalFee = moneyMul(detail.price, detail.quantity);
            }
          }
          // if (!isNaN(parseFloat(taxFee))) {
          //   this.fundDetailArr[i].taxedamount = taxFee.toFixed(2);
          // }
          allSum += totalFee;
          detailsArr.push(totalFee);
        }
      }
      this.form.amountrequested = allSum.toFixed(2);
      this.form.pretaxcost = preTaxSum.toFixed(2);
      this.form.taxedcost = taxedSum.toFixed(2);
      this.form.amountrequested = moneyRound(moneySum(detailsArr)).toFixed(2);
      this.form.pretaxcost = moneyRound(preTaxSum).toFixed(2);
      this.form.taxedcost = moneyRound(taxedSum).toFixed(2);
      this.$forceUpdate();
      console.log(this.form);
    },
@@ -1490,7 +1520,7 @@
        // this.defaultperson = response.data;
        // this.standardlevel = response.data.standardlevel;
        if (
          response.data.userName === "001" ||
          response.data.userName === "053" ||
          response.data.userName === "002" ||
          response.data.userName === "admin"
        ) {