11
WXL
2024-03-20 1e487a42549384f6e937a5c7d557563aedafec2c
src/views/project/fundcheck/ethicalExpertFeeCheck/index.vue
@@ -2,24 +2,19 @@
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="120px">
      <el-row>
        <el-col :span="8">
          <el-form-item label="申请日期" prop="createTime">
            <el-date-picker format="yyyy-MM-dd" @change="selectapplication" value-format="yyyy-MM-dd" v-model="createTime"
              type="daterange" range-separator="至" start-placeholder="申请开始日期" end-placeholder="申请结束日期"
              @keyup.enter.native="flowconclusion">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="5">
          <el-form-item label="金额" prop="money" style="float: left">
            <el-input v-model="queryParams.money" placeholder="请输入申请人金额" clearable size="small"
          <el-form-item label="捐献案例" prop="donorname" style="float: left">
            <el-input v-model="queryParams.donorname" placeholder="请输入申请人捐献者" clearable size="small"
              @keyup.enter.native="flowconclusion" />
          </el-form-item>
        </el-col>
        <el-col :span="5">
          <el-form-item label="经办人" prop="APPLICANT" style="float: left">
            <el-input v-model="queryParams.APPLICANT" placeholder="请输入申请人姓名" clearable size="small"
              @keyup.enter.native="flowconclusion" />
          <el-form-item label="预审状态" prop="checkstatus" style="float: left">
            <el-select v-model="queryParams.checkstatus" placeholder="请选择" style="width: 100%">
              <el-option v-for="item in checkmaterials" :key="item.value" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="5">
@@ -30,55 +25,114 @@
            </el-select>
          </el-form-item>
        </el-col>
        <!-- <el-col :span="6">
        <el-col :span="5">
          <el-form-item label="经办人" prop="APPLICANT" style="float: left">
            <el-input v-model="queryParams.APPLICANT" placeholder="请输入申请人姓名" clearable size="small"
              @keyup.enter.native="flowconclusion" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="5">
          <el-form-item label="报销金额" prop="money" style="float: left">
            <el-input v-model="queryParams.money" placeholder="请输入申请人金额" clearable size="small"
              @keyup.enter.native="flowconclusion" />
          </el-form-item>
        </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>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-button type="primary" icon="el-icon-search" size="mini" @click="flowconclusion">搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        </el-col> -->
        </el-col>
      </el-row>
    </el-form>
    <el-row>
      <el-col :span="8">
        <div style="margin-bottom: 15px;">
          <el-button type="primary" plain icon="el-icon-circle-check" size="mini"
            @click="Totalcalculation(1)">计税后合计</el-button>
          <el-button icon="el-icon-remove-outline" type="success" plain size="mini"
            @click="Totalcalculation(0)">计税前合计</el-button>
        </div>
      </el-col>
    </el-row>
    <el-form ref="infoform" label-width="100px">
      <el-row>
        <el-table v-loading="loading" border :data="donateconsolationfundList" @selection-change="handleSelectionChange">
          <!--
          <el-table-column label="审批状态" width="120" align="center" prop="checkFlag">
        <el-table v-loading="loading" ref="multipleTable" tooltip-effect="dark" border :data="donateconsolationfundList"
          @selection-change="handleSelectionChange">
          <el-table-column type="selection" width="45"> </el-table-column>
          <el-table-column label="报销单号" align="center" prop="bh" width="150px" />
          <el-table-column label="申请日期" width="120" align="center" prop="applyTime">
            <template slot-scope="scope">
              <span v-if="scope.row.checkFlag == 0"><i class="el-icon-check"
                  style="color: #5fb878; font-weight: bold"></i></span>
              <span v-else>待审核</span>
              <span>{{ parseTime(scope.row.applyTime, "{y}-{m}-{d}") }}</span>
            </template>
          </el-table-column>
          -->
          <el-table-column label="申请日期" width="120" align="center" prop="createTime">
            <template slot-scope="scope">
              <span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
            </template>
          </el-table-column>
          <el-table-column label="经办人" align="center" prop="username" width="150px" />
          <el-table-column label="申请金额" align="center" prop="pretaxcost" width="200px" />
          <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="unitname" width="230px" /> -->
          <!-- <el-table-column label="联系电话" align="center"  prop="phone"  width="160"  /> -->
          <!-- <el-table-column label="税后金额" align="center" prop="taxedcost" width="120px" />
          <el-table-column label="申请金额" align="center" prop="amountrequested" width="120px" />
          <el-table-column label="预支费用" align="center" prop="prepaidamount" width="120px" /> -->
          <el-table-column label="经办人" align="center" prop="username" width="150px" />
          <el-table-column label="申请材料状态" width="140" 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">
            <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">
            <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 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="160px">
          <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width" width="260px">
            <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>
              <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
                    width="150"
                    property="date"
                    label="日期"
                  ></el-table-column>
                  <el-table-column
                    width="100"
                    property="name"
                    label="审批人"
                  ></el-table-column>
                  <el-table-column
                    width="300"
                    property="address"
                    label="审批结果"
                  ></el-table-column>
                </el-table>
                <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-s-order"
                  slot="reference"
                  >审批记录</el-button
                >
              </el-popover> -->
            </template>
          </el-table-column>
        </el-table>
@@ -184,8 +238,8 @@
            <el-table-column prop="amount" align="center" label="税前金额" width="150">
              <template slot-scope="scope">
                <el-input v-model="scope.row.amount" @blur="val => {
                    sumTotalFee();
                  }
                  sumTotalFee();
                }
                  " placeholder="税前金额" />
              </template>
            </el-table-column>
@@ -202,8 +256,8 @@
            <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();
                  }
                  sumTotalFee();
                }
                  " />
              </template>
            </el-table-column>
@@ -250,9 +304,9 @@
        </el-row>
        <el-row style="margin-top: 25px; margin-bottom: 5px">
          <el-col :span="7">
            <el-form-item label="申请日期" prop="createTime">
            <el-form-item label="申请日期" prop="applyTime">
              <!-- <el-input v-model="form.donorno" placeholder="请输入申请日期" /> -->
              <el-date-picker clearable style="width: 100%" v-model="form.createTime" type="date"
              <el-date-picker clearable style="width: 100%" v-model="form.applyTime" type="date"
                value-format="yyyy-MM-dd HH:mm:ss" placeholder="申请日期">
              </el-date-picker>
            </el-form-item>
@@ -326,7 +380,8 @@
  getdownloadBX,
  checkfund,
  listbypower,
  addFundSharedInfo
  addFundSharedInfo,
  TotalcalculationFn
} from "@/api/project/fund";
import {
  onelistFunds,
@@ -373,6 +428,10 @@
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";
export default {
  components: {
@@ -390,7 +449,9 @@
    "sys_ConsolationType",
    "sys_fund_type",
    "sys_finsubject",
    "sys_financeitemtype"
    "sys_financeitemtype",
    "sys_stage_type",
    "sys_tax"
  ],
  data() {
    return {
@@ -432,6 +493,9 @@
      exportLoading: false,
      // 选中数组
      ids: [],
      overallids: [], //总选中
      overallidsvalue: [], //总选中对象
      // 非单个禁用
      single: true,
      // 非多个禁用
@@ -447,6 +511,31 @@
      //捐献案例列表数据
      // donationCaseTableData:[],
      donatebaseinfoList: [],
      headers: {
        Authorization: "Bearer " + getToken()
      },
      gridData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        }
      ],
      // 是否显示弹出层
      open: false,
@@ -464,6 +553,21 @@
          label: "全部"
        }
      ],
      checkmaterials: [
        {
          value: 1,
          label: "材料待审核"
        },
        {
          value: 2,
          label: "审查通过等待邮寄纸质材料"
        },
        {
          value: 3,
          label: "已收到纸质材料"
        }
      ],
      // 查询参数
      queryParams: {
        pageNum: 1,
@@ -482,7 +586,7 @@
        username: [
          { required: true, message: "请输入申请人姓名", trigger: "blur" }
        ],
        createTime: [
        applyTime: [
          { required: true, message: "请输入申请日期", trigger: "blur" }
        ],
        amountrequested: [
@@ -552,6 +656,11 @@
    this.getUsermsg();
  },
  mounted() {
    if (grtItem("ethicalExpertFeeCheck")) {
      this.queryParams = grtItem("ethicalExpertFeeCheck");
      this.queryParams.APPLICATIONBEGTIME = "";
      this.queryParams.APPLICATIONENDTIME = "";
    }
    this.selectReporters();
    this.getlistOrganization();
    //this.getlistUser();
@@ -560,14 +669,16 @@
  },
  methods: {
    selectapplication() {
      console.log("时间", this.createTime);
      this.queryParams.APPLICATIONBEGTIME = this.createTime[0];
      this.queryParams.APPLICATIONENDTIME = this.createTime[1];
      console.log("时间", this.applyTime);
      this.queryParams.APPLICATIONBEGTIME = this.applyTime[0];
      this.queryParams.APPLICATIONENDTIME = this.applyTime[1];
      //   this.getlistbypower()
    },
    getlistbypower() {
      this.loading = true;
      listbypower(this.queryParams).then(res => {
        removeItem("ethicalExpertFeeCheck");
        setItem("ethicalExpertFeeCheck", this.queryParams);
        //console.log("根据权限显示列表", res);
        this.loading = false;
        let list = res.rows;
@@ -640,29 +751,41 @@
    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);
          });
        }
      });
    },
    isopenvalue(index) {
      this.isopen = index;
    },
    tojust(e) {
      let username = "111";
      getFund(e).then(res => {
@@ -839,9 +962,109 @@
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
      let xuanzlist = selection.map(item => item.id);
      if (this.ids.length <= selection.length) {
        this.ids = xuanzlist;
      } else {
        this.ids.forEach(item => {
          if (xuanzlist.includes(item)) {
          } else {
            if (this.overallids.length == 1) {
              this.overallids = [];
            } else {
              this.overallids.splice(this.overallids.indexOf(item), 1);
            }
            if (this.overallidsvalue.length == 1) {
              this.overallidsvalue = [];
            } else {
              this.overallidsvalue.splice(
                this.overallidsvalue.indexOf(item),
                1
              );
            }
            this.ids.splice(this.ids.indexOf(item), 1);
          }
        });
      }
      console.log(this.ids);
      this.ids.forEach(item => {
        if (this.overallids.includes(item)) {
          console.log("3 is in the array");
        } else {
          this.overallids.push(item);
          const obj = selection.find(obj => obj.id === item);
          console.log(obj);
          this.overallidsvalue.push(obj);
        }
      });
      console.log(this.overallids);
    },
    // 切换页后恢复选中
    Restorecheck() {
      console.log(this.donateconsolationfundList);
      console.log(this.overallids);
      const overlap = this.donateconsolationfundList.filter(value => {
        return this.overallids.includes(value.id);
      });
      // 保持ids和当前页面的同步性
      this.ids = overlap.map(item => item.id);
      console.log(overlap, "当前页选中数据");
      this.toggleSelection(overlap);
    },
    // 挂载选择状态
    toggleSelection(rows) {
      console.log(rows);
      if (rows) {
        this.$nextTick(() => {
          rows.forEach(row => {
            console.log(row);
            this.$refs.multipleTable.toggleRowSelection(row, true);
            console.log(1);
          });
        });
      } else {
        this.$refs.multipleTable.clearSelection();
      }
    },
    Totalcalculation(tot) {
      console.log(tot);
      let bojite = {
        fundids: this.overallids,
        isTaxAfter: tot
      };
      if (tot == 0) {
        TotalcalculationFn(bojite)
          .then(row => {
            console.log(row.msg);
            if (row.code == 200) {
              this.$modal.msgSuccess(row.msg);
            } else {
              console.log(123);
              this.$modal.msgError(row.msg);
            }
          })
          .catch(error => {
            this.$modal.msgError(error);
          });
      } else {
        console.log(this.overallidsvalue);
        const hasValue = this.overallidsvalue.every(obj => obj.istax == 1);
        if (hasValue) {
          TotalcalculationFn(bojite)
            .then(row => {
              if (row.code == 200) {
                this.$modal.msgSuccess(row.msg);
              } else {
                this.$modal.msgError(row.msg);
              }
            })
            .catch(error => {
              this.$modal.msgError(error);
            });
        } else {
          this.$modal.msgError("请选择算税后的数据进行合并计算");
        }
      }
    },
    /** 新增按钮操作 */
    handleAdd() {
@@ -854,7 +1077,7 @@
        this.form.donorno = this.curCase.donorno;
        this.form.name = this.curCase.name;
        this.form.infoid = this.curCase.id;
        // this.form.createTime = nowdate;
        // this.form.applyTime = nowdate;
        //this.open = true;
        //this.initFundApplyForm();
        this.fundDetailArr = [];
@@ -868,7 +1091,8 @@
        });
      }
    },
    /** 修改按钮操作 */
    /** 审核按钮操作 */
    handleCheck(row) {
      this.$router.push({
        path: "/finance/applyDetail/",