11
WXL
2024-02-20 4fbeee3784d4be5483ed7ec9e00a875d66bc9ed0
src/views/project/fund/medicalCostApply/index.vue
@@ -1,28 +1,6 @@
<!--  -->
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="70px">
      <el-row align="left">
        <el-col :span="6">
          <el-form-item label="姓名" prop="name">
            <el-input v-model="queryParams.name" placeholder="请输入姓名" clearable size="small"
              @keyup.enter.native="handleQuery" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="捐献进度" prop="recordstate">
            <el-select v-model="queryParams.recordstate" placeholder="请选择记录状态" clearable size="small">
              <el-option v-for="dict in dict.type.sys_DonationStatus" :key="dict.value" :label="dict.label"
                :value="dict.value" />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        </el-col>
      </el-row>
    </el-form>
    <el-row>
      <el-col :span="6">
        <el-card shadow="never">
@@ -33,18 +11,80 @@
              </el-row>
            </el-col>
          </el-row>
          <el-table v-loading="loading" border highlight-current-row :data="donatebaseinfoList"
            @row-click="selectDonotor">
          <div>
            <el-form
              :model="queryParams"
              ref="queryForm"
              :inline="true"
              label-width="70px"
            >
              <el-form-item label="姓名" prop="name">
                <el-input
                  v-model="queryParams.name"
                  placeholder="请输入姓名"
                  clearable
                  size="small"
                  @keyup.enter.native="handleQuery"
                />
              </el-form-item>
              <el-form-item label="捐献进度" prop="recordstate">
                <el-select
                  v-model="queryParams.recordstate"
                  placeholder="请选择记录状态"
                  clearable
                  size="small"
                >
                  <el-option
                    v-for="dict in dict.type.sys_DonationStatus"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                  />
                </el-select>
              </el-form-item>
              <div style="float: right; margin-bottom: 10px;">
                <el-button
                  type="primary"
                  icon="el-icon-search"
                  size="mini"
                  @click="handleQuery"
                  >搜索</el-button
                >
                <el-button
                  icon="el-icon-refresh"
                  size="mini"
                  @click="resetQuery"
                  >重置</el-button
                >
              </div>
            </el-form>
          </div>
          <el-table
            v-loading="loading"
            border
            highlight-current-row
            :data="donatebaseinfoList"
            @row-click="selectDonotor"
          >
            <!-- <el-table-column label="捐献编号" align="center" prop="donorno" /> -->
            <el-table-column label="捐献进度" align="center" prop="recordstate">
              <template slot-scope="scope">
                <dict-tag :options="dict.type.sys_DonationStatus" :value="scope.row.recordstate" />
                <dict-tag
                  :options="dict.type.sys_DonationStatus"
                  :value="scope.row.recordstate"
                />
              </template>
            </el-table-column>
            <el-table-column label="姓名" align="center" prop="name" />
          </el-table>
          <pagination v-show="total > 0" :total="total" small :page.sync="queryParams.pageNum"
            :limit.sync="queryParams.pageSize" @pagination="getBaseInfoList" />
          <pagination
            v-show="total > 0"
            :total="total"
            small
            :page.sync="queryParams.pageNum"
            :limit.sync="queryParams.pageSize"
            @pagination="getBaseInfoList"
          />
        </el-card>
      </el-col>
      <el-col :span="18">
@@ -53,7 +93,10 @@
            <el-row :gutter="4" align="right" class="mb8">
              <el-col :span="9">
                <el-form-item label="捐献编号">
                  <el-input v-model="curCase.donorno" :disabled="true"></el-input>
                  <el-input
                    v-model="curCase.donorno"
                    :disabled="true"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="9">
@@ -65,62 +108,146 @@
            </el-row>
            <el-row :gutter="10" class="mb8">
              <el-col :span="1.5">
                <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
                  v-hasPermi="['project:medicalfund:add']">新增申请单</el-button>
                <el-button
                  type="primary"
                  plain
                  icon="el-icon-plus"
                  size="mini"
                  @click="handleAdd"
                  v-hasPermi="['project:medicalfund:add']"
                  >新增申请单</el-button
                >
              </el-col>
            </el-row>
            <el-row>
              <el-table v-loading="loading" border :data="donateconsolationfundList">
                <el-table-column label="申请日期" align="center" prop="createTime" width="150px">
              <el-table
                v-loading="loading"
                border
                :data="donateconsolationfundList"
              >
                <el-table-column
                  label="申请日期"
                  align="center"
                  prop="applyTime"
                  width="150px"
                >
                  <template slot-scope="scope">
                    <span>{{
                      parseTime(scope.row.createTime, "{y}-{m}-{d}")
                      parseTime(scope.row.applyTime, "{y}-{m}-{d}")
                    }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="申请人" align="center" prop="username" width="120px" />
                <el-table-column label="申请金额" align="center" prop="pretaxcost" width="200px" />
                <el-table-column label="所属组别" align="center" prop="deptmentname" width="220px" />
                <el-table-column label="组长" align="center" prop="managername" width="200px" />
                <el-table-column label="审核状态" align="center" prop="recordstatus">
                <el-table-column
                  label="申请人"
                  align="center"
                  prop="username"
                  width="120px"
                />
                <el-table-column
                  label="申请金额"
                  align="center"
                  prop="pretaxcost"
                  width="200px"
                />
                <el-table-column
                  label="所属组别"
                  align="center"
                  prop="deptmentname"
                  width="220px"
                />
                <el-table-column
                  label="组长"
                  align="center"
                  prop="managername"
                  width="200px"
                />
                <el-table-column
                  label="审核状态"
                  align="center"
                  prop="recordstatus"
                >
                  <template slot-scope="scope">
                    <dict-tag :options="dict.type.sys_recordstatus" :value="scope.row.recordstatus" />
                    <dict-tag
                      :options="dict.type.sys_recordstatus"
                      :value="scope.row.recordstatus"
                    />
                  </template>
                </el-table-column>
                <el-table-column
        label="预审状态"
        width="140"
        align="center"
        prop="checkstatus"
      >
        <template slot-scope="scope">
          <dict-tag
            :options="dict.type.sys_stage_type"
            :value="scope.row.checkstatus"
          />
        </template>
      </el-table-column>
                  label="申请材料状态"
                  width="140"
                  align="center"
                  prop="checkstatus"
                >
                  <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="phone" width="150px" />
                <el-table-column label="工作单位" align="center" prop="unitname" width="150px" />
                -->
                <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width"
                  width="280px">
                <el-table-column
                  label="操作"
                  fixed="right"
                  align="center"
                  class-name="small-padding fixed-width"
                  width="280px"
                >
                  <template slot-scope="scope">
                    <el-button v-if="scope.row.recordstatus == -1 ||
                      scope.row.recordstatus == 1
                      " size="mini" type="text" icon="el-icon-edit" @click="handleup(scope.row)">上报</el-button>
                    <el-button v-if="scope.row.recordstatus == -1 ||
                      scope.row.recordstatus == 1
                      " size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
                      v-hasPermi="['project:medicalfund:edit']">修改</el-button>
                    <el-button size="mini" type="text" icon="el-icon-view" @click="handleDetail(scope.row)">查看</el-button>
                    <el-button v-if="scope.row.recordstatus == -1 ||
                      scope.row.recordstatus == 1
                      " size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
                      v-hasPermi="['project:medicalfund:delete']">删除</el-button>
                    <el-button size="mini" type="text" icon="el-icon-download" @click="mixExport(scope.row.id)"
                      v-hasPermi="['project:medicalfund:download']">下载</el-button>
                    <el-button
                      v-if="
                        scope.row.recordstatus == -1 ||
                          scope.row.recordstatus == 1
                      "
                      size="mini"
                      type="text"
                      icon="el-icon-edit"
                      @click="handleup(scope.row)"
                      >上报</el-button
                    >
                    <el-button
                      v-if="
                        scope.row.recordstatus == -1 ||
                          scope.row.recordstatus == 1
                      "
                      size="mini"
                      type="text"
                      icon="el-icon-edit"
                      @click="handleUpdate(scope.row)"
                      v-hasPermi="['project:medicalfund:edit']"
                      >修改</el-button
                    >
                    <el-button
                      size="mini"
                      type="text"
                      icon="el-icon-view"
                      @click="handleDetail(scope.row)"
                      >查看</el-button
                    >
                    <el-button
                      v-if="
                        scope.row.recordstatus == -1 ||
                          scope.row.recordstatus == 1
                      "
                      size="mini"
                      type="text"
                      icon="el-icon-delete"
                      @click="handleDelete(scope.row)"
                      v-hasPermi="['project:medicalfund:delete']"
                      >删除</el-button
                    >
                    <el-button
                      size="mini"
                      type="text"
                      icon="el-icon-download"
                      @click="mixExport(scope.row.id)"
                      v-hasPermi="['project:medicalfund:download']"
                      >下载</el-button
                    >
                  </template>
                </el-table-column>
              </el-table>
@@ -129,7 +256,6 @@
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>
@@ -253,7 +379,7 @@
        username: [
          { required: true, message: "请输入申请人", trigger: "blur" }
        ],
        createTime: [
        applyTime: [
          { required: true, message: "请输入申请日期", trigger: "blur" }
        ],
        deptmentname: [
@@ -340,13 +466,13 @@
    this.getUsermsg();
  },
  beforeCreate() { }, //生命周期 - 创建之前
  beforeMount() { }, //生命周期 - 挂载之前
  beforeUpdate() { }, //生命周期 - 更新之前
  updated() { }, //生命周期 - 更新之后
  beforeDestroy() { }, //生命周期 - 销毁之前
  destroyed() { }, //生命周期 - 销毁完成
  activated() { }, //如果页面有keep-alive缓存功能,这个函数会触发
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  //方法集合
  methods: {
@@ -396,7 +522,9 @@
      } else {
        const h = this.$createElement;
        this.$message({
          message: h("p", null, [h("span", null, "请在左边的捐献案例表选择需要操作的案例!")]),
          message: h("p", null, [
            h("span", null, "请在左边的捐献案例表选择需要操作的案例!")
          ])
        });
      }
      return;
@@ -458,8 +586,8 @@
        //附件处理
        this.fileList = this.form.annexbankcard
          ? this.form.annexbankcard
            .split(",")
            .map(item => ({ url: item, name: item }))
              .split(",")
              .map(item => ({ url: item, name: item }))
          : [];
        getownFundDetail(id).then(async res => {
@@ -505,8 +633,8 @@
        //附件处理
        this.fileList = this.form.annexbankcard
          ? this.form.annexbankcard
            .split(",")
            .map(item => ({ url: item, name: item }))
              .split(",")
              .map(item => ({ url: item, name: item }))
          : [];
        listFundflow(listFundflowparams).then(res => {
@@ -534,7 +662,7 @@
      const ids = row.id || this.ids;
      this.$modal
        .confirm("是否确认删除该记录?")
        .then(function () {
        .then(function() {
          return delFund(ids);
        })
        .then(() => {
@@ -548,7 +676,7 @@
          this.getfundList();
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => { });
        .catch(() => {});
    },
    /** 上报按钮操作 */
@@ -561,8 +689,8 @@
        .then(() => {
          //查找是否存在登记完成记录
          //判断是否存在上报记录
          row.recordstatus = 0;
          row.recordstatus = 0;var currenttime = new Date();
          row.applyTime = currenttime.getFullYear() + "-" + (currenttime.getMonth()+1) + "-" + currenttime.getDate() + " " + currenttime.getHours() + ":" + currenttime.getMinutes() + ":" + currenttime.getSeconds();
          updateFund(row).then(response => {
            if (response.code == 200) {
              this.$message({
@@ -922,9 +1050,9 @@
                  tempData.itemid = tempItemArr[itemIndex].id;
                }
                if (tempData.id > 0) {
                  updateFunddetail(tempData).then(response2 => { });
                  updateFunddetail(tempData).then(response2 => {});
                } else {
                  addFunddetail(tempData).then(response2 => { });
                  addFunddetail(tempData).then(response2 => {});
                }
              }
            });
@@ -1146,22 +1274,35 @@
    // 捐献者医学统计打印
    dayin2(id) {
      getdownloadYX(id).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);
          });
        }
      });
    },
@@ -1215,7 +1356,7 @@
    },
    //文件上传
    handleUploadError() { },
    handleUploadError() {},
    handleremove(file) {
      this.fileList.splice(this.fileList.indexOf(file), 1);