<template>
  <div class="container">
    <!-- 添加按钮 -->
    <div class="total_top">
      <el-form :inline="true" class="demo-form-inline" :model="queryitem">
        <el-form-item label="项目名称：">
          <el-input
            placeholder="请输入"
            v-model.trim="queryitem.projectName"
          ></el-input>
        </el-form-item>
        <el-form-item label="审批状态：">
          <el-select placeholder="请选择" v-model.trim="queryitem.tripStatus">
            <el-option label="待审批" value="0"></el-option>
            <el-option label="小组长通过" value="1"></el-option>
            <el-option label="小组长驳回" value="2"></el-option>
            <el-option label="财务通过" value="3"></el-option>
            <el-option label="财务驳回" value="4"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" @click="onSubmit()"
            >查询</el-button
          >
        </el-form-item>
        <el-form-item>
          <el-button
            type="primary"
            icon="el-icon-refresh-right"
            @click="reset()"
            >重置</el-button
          >
        </el-form-item>
        <el-form-item>
          <el-button
            type="success"
            icon="el-icon-circle-plus"
            @click="insertOrupdatereimebursementItem()"
            >申请出差报销</el-button
          >
        </el-form-item>
      </el-form>
    </div>
    <!-- 表格内容区域 -->
    <div class="total_content">
      <el-table :data="tableData" style="width: 100%" border>
        <el-table-column align="center" type="expand">
          <template slot-scope="props">
            <el-form label-position="left" class="demo-table-expand">
              <el-descriptions
                title="报销详情"
                :column="5"
                border
                style="width: 100%"
              >
                <el-descriptions-item label="组长审批状态" :span="2">
                  <el-tag
                    :type="
                      props.row.tripStatus == 0
                        ? 'info'
                        : props.row.tripStatus == 2
                        ? 'danger'
                        : 'success'
                    "
                  >
                    {{
                      props.row.tripStatus == 0
                        ? "待审批"
                        : props.row.tripStatus == 2
                        ? "驳回"
                        : "通过"
                    }}
                  </el-tag>
                </el-descriptions-item>
                <el-descriptions-item
                  label="组长审批时间"
                  :span="3"
                  :formatter="timestampToTime"
                  >{{ props.row.headmanTime }}</el-descriptions-item
                >
                <el-descriptions-item label="组长驳回缘由" :span="5">{{
                  props.row.headmanRefute || "无"
                }}</el-descriptions-item>
                <el-descriptions-item label="财务审批状态" :span="2">
                  <el-tag
                    :type="
                      props.row.tripStatus == 4
                        ? 'danger'
                        : props.row.tripStatus == 3
                        ? 'success'
                        : 'info'
                    "
                  >
                    {{
                      props.row.tripStatus == 4
                        ? "驳回"
                        : props.row.tripStatus == 3
                        ? "通过"
                        : "待审批"
                    }}
                  </el-tag>
                </el-descriptions-item>
                <el-descriptions-item
                  label="财务审批时间"
                  :span="3"
                  :formatter="timestampToTime"
                  >{{ props.row.financeTime }}</el-descriptions-item
                >
                <el-descriptions-item label="财务驳回缘由" :span="5">{{
                  props.row.finaceRefute || "无"
                }}</el-descriptions-item>
                <el-descriptions-item label="查看详情" :span="5">
                  <el-button
                    @click="getdetails(props.row)"
                    type="primary"
                    style="margin: 5px"
                    size="mini"
                    >查看详情</el-button
                  >
                </el-descriptions-item>
              </el-descriptions>
            </el-form>
          </template>
        </el-table-column>
        <el-table-column align="center" label="序号" width="50px">
          <template slot-scope="scope">
            {{
              (queryitem.pageNum - 1) * queryitem.pageSize + scope.$index + 1
            }}
          </template>
        </el-table-column>
        <el-table-column align="center" label="报销项目" prop="projectName">
        </el-table-column>
        <el-table-column
          align="center"
          label="申报总金额(元)"
          prop="applyTotalAmountSmall"
        >
        </el-table-column>
        <el-table-column align="center" label="核报总金额(元)">
          <template slot-scope="props">
            {{ props.row.verifyTotalAmountSmall || "还未核实金额" }}
          </template>
        </el-table-column>
        <el-table-column align="center" label="组长审批人">
          <template slot-scope="props">
            {{ props.row.financeName || "暂无" }}
          </template>
        </el-table-column>
        <el-table-column align="center" label="财务审批人">
          <template slot-scope="props">
            {{ props.row.financeName || "暂无" }}
          </template>
        </el-table-column>
        <el-table-column
          label="报销日期"
          prop="applyTime"
          :formatter="timestampToTime"
          align="center"
        >
        </el-table-column>
        <el-table-column align="center" label="发票文件" width="120">
          <template slot-scope="scope">
            <el-button
              style="margin: 5px"
              type="primary"
              size="mini"
              @click="ReviseImage(scope.row)"
              >点击查看</el-button
            >
          </template>
        </el-table-column>
        <el-table-column align="center" label="下载附件" width="120">
          <template slot-scope="scope">
            <el-button
              type="primary"
              size="mini"
              @click="selectImage(scope.row)"
              >点击查看</el-button
            >
          </template>
        </el-table-column>
        <el-table-column align="center" label="状态">
          <template slot-scope="props">
            <el-tag
              :type="
                props.row.tripStatus == 0
                  ? 'info'
                  : props.row.tripStatus == 1 || props.row.tripStatus == 3
                  ? 'success'
                  : 'danger'
              "
            >
              {{
                props.row.tripStatus == 0
                  ? "待审批"
                  : props.row.tripStatus == 1
                  ? "小组长通过"
                  : props.row.tripStatus == 2
                  ? "小组长驳回"
                  : props.row.tripStatus == 3
                  ? "财务通过"
                  : props.row.tripStatus == 4
                  ? "财务驳回"
                  : "不存在"
              }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column align="center" label="操作" width="180">
          <template slot-scope="scope">
            <el-button
              style="margin: 5px"
              size="mini"
              icon="el-icon-edit"
              type="info"
              @click="insertOrupdatereimebursementItem(scope.row)"
              v-if="scope.row.tripStatus == 0"
              >修改信息</el-button
            >
            <el-button
              style="margin: 5px"
              size="mini"
              type="danger"
              @click="Resubmit(scope.row)"
              v-if="scope.row.tripStatus == 2 || scope.row.tripStatus == 4"
              >重新提交</el-button
            >
            <el-button
              style="margin: 5px"
              size="mini"
              type="warning"
              @click="withdraw(scope.row)"
              v-if="scope.row.tripStatus == 0"
            >
              撤回</el-button
            >
            <el-link
              type="success"
              style="margin: 5px"
              size="mini"
              v-if="scope.row.tripStatus == 3"
              >已通过</el-link
            >
            <el-link
              type="info"
              style="margin: 5px"
              size="mini"
              v-if="scope.row.tripStatus == 1"
              >待审批</el-link
            >
          </template>
        </el-table-column>
      </el-table>
      <!-- 发票图片 -->
      <el-drawer
        title="发票详情"
        :visible.sync="invoiceShow"
        :direction="direction"
        size="40%"
      >
        <!-- filePath-->
        <el-table
          :data="getinvoivelist"
          style="width: 100%; text-align: center"
          border
        >
          <el-table-column
            type="index"
            label="序号"
            width="40"
          ></el-table-column>
          <el-table-column prop="prop" label="发票详情">
            <template slot-scope="scope">
              <div v-if="fromgetlist(scope.row)">
                <el-image
                  style="width: 80px; height: 80px"
                  :src="scope.row.fileUrl"
                  :preview-src-list="srcList"
                ></el-image>
              </div>
              <div v-else>
                <a @click="Agrt(scope.row)">点击查看文件</a>
              </div>
            </template>
          </el-table-column>
        </el-table>
      </el-drawer>
      <!-- 查看详情 -->
      <el-drawer
        title="查看详情"
        :visible.sync="drawer"
        :direction="direction"
        size="45%"
      >
        <el-form>
          <el-descriptions
            :column="6"
            border
            title="基本信息"
            style="padding: 20px"
            label-class-name="my-label"
          >
            <el-descriptions-item label="出差理由" :span="6">
              <span>{{ paramlist.tripReason }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="附件数量" :span="3">
              <span>{{ paramlist.enclosureNumber }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="出发地点" :span="3">
              <span>{{ paramlist.fromPlace }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="目的地点" :span="3">
              <span>{{ paramlist.purposePlace }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="天数" :span="3">
              <span>{{ paramlist.days }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="交通工具" :span="3">
              <span>{{ paramlist.vehicle }}</span>
            </el-descriptions-item>
          </el-descriptions>

          <el-descriptions
            :column="6"
            border
            title="费用详情"
            style="padding: 20px"
            label-class-name="my-label"
          >
            <el-descriptions-item label="伙食补贴" :span="3">
              <span>{{ paramlist.foodAllowance }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="公杂补贴" :span="3">
              <span>{{ paramlist.publicMiscellaneousSubsidy }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="火车/汽车/轮船费(元)" :span="3">
              <span>{{ paramlist.tripCost }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="机票费" :span="3">
              <span>{{ paramlist.planeTicket }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="汽油费" :span="3">
              <span>{{ paramlist.trafficCost }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="住宿费" :span="3">
              <span>{{ paramlist.lodgingCost }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="其他费用" :span="3">
              <span>{{ paramlist.otherCost }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="审批状态" :span="3">
              <el-tag
                size="mini"
                :type="
                  paramlist.tripStatus == 0
                    ? 'info'
                    : paramlist.tripStatus == 1 || paramlist.tripStatus == 3
                    ? 'success'
                    : 'danger'
                "
              >
                {{
                  paramlist.tripStatus == 0
                    ? "待审批"
                    : paramlist.tripStatus == 1
                    ? "小组长通过"
                    : paramlist.tripStatus == 2
                    ? "小组长驳回"
                    : paramlist.tripStatus == 3
                    ? "财务通过"
                    : paramlist.tripStatus == 4
                    ? "财务驳回"
                    : "不存在"
                }}
              </el-tag>
            </el-descriptions-item>

            <el-descriptions-item label="备注" :span="6">
              <span>{{ paramlist.remarks }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="无票据说明" :span="6">
              <span>{{ paramlist.nobillExplain }}</span>
            </el-descriptions-item>
            <el-descriptions-item label="随行人员" :span="6">
              <el-tag
                type="warning"
                size="mini"
                v-for="item in paramlist.entouragelist"
                :key="item.id"
                style="margin: 0px 5px"
                >{{ item.personnelName }}</el-tag
              >
            </el-descriptions-item>
          </el-descriptions>
        </el-form>
      </el-drawer>
    </div>
    <!-- 分页区域 -->
    <div class="block">
      <el-pagination
        layout="->, total, prev, pager, next"
        :total="total"
        :current-page.sync="queryitem.pageNum"
        :page-size="queryitem.pageSize"
        @current-change="getpagelist"
      >
      </el-pagination>
    </div>
    <!-- 附件的下载与添加 -->
    <div>
      <el-drawer
        title="附件操作"
        :visible.sync="drawer2"
        :direction="direction"
        size="50%"
      >
        <el-button
          type="primary"
          style="margin-left: 5%; margin: 30px 50px"
          :disabled="disabled2"
          @click="updatecard"
          >添加附件</el-button
        >

        <el-card
          style="width: 90%; margin-left: 5%; margin-top: 20px"
          v-show="getshow == 1"
        >
          <el-row class="row-bg">
            <div
              v-for="index in queryDTOList"
              :key="index.enclosureId"
              class="lsitall"
            >
              <el-col :span="10">
                <div style="margin-top: 6px; margin-left: 40px">
                  附件{{ index.enclosureId }}
                </div>
              </el-col>
              <el-col :span="12" style="margin-left: -50px">
                <el-button
                  type="primary"
                  icon="el-icon-folder-checked"
                  size="mini"
                  style="font-size: 13px"
                  @click="delProject(index)"
                  >下载</el-button
                >

                <el-popover placement="top" width="160" v-model="index.visible">
                  <p>确定要删除此条附件吗</p>
                  <div style="text-align: right; margin: 0">
                    <el-button
                      size="mini"
                      type="text"
                      @click="index.visible = false"
                      >取消</el-button
                    >
                    <el-button
                      type="primary"
                      size="mini"
                      @click="deleteProject(index)"
                      >确定</el-button
                    >
                  </div>
                  <el-button
                    type="danger"
                    icon="el-icon-delete"
                    size="mini "
                    style="font-size: 13px"
                    slot="reference"
                    >删除</el-button
                  >
                </el-popover>
              </el-col>
            </div>
          </el-row>
        </el-card>
        <!-- 附件上传 -->
        <el-card
          style="width: 90%; margin-left: 5%; margin-top: 20px"
          v-show="getshow == 0"
        >
          <div style="width: 60%; margin-left: 30px">
            <el-input
              type="textarea"
              :rows="2"
              placeholder="请输入附件详情"
              v-model="proutlist1.enclosureDescribe"
              style="margin: 20px 0px"
            ></el-input>
            <el-upload
              class="upload-demo"
              ref="upload1"
              drag
              :action="action1"
              :file-list="fileList1"
              :on-remove="delfile1"
              :auto-upload="false"
              :on-change="onChangepdf"
              :headers="fileUploadHeader"
              :on-success="Refresh"
              :data="proutlist1"
              multiple
              style="margin: 20px 0px"
            >
              <i class="el-icon-upload"></i>
              <div class="el-upload__text">
                将文件拖到此处，或
                <em>点击上传附件</em>
              </div>
              <div class="el-upload__tip" slot="tip">
                只能上传文件，且不超过500kb
              </div>
            </el-upload>
          </div>
          <div style="margin-left: 75%">
            <el-button @click="remove()">取 消</el-button>
            <el-button
              type="primary"
              @click="determine()"
              style="margin-top: 20px"
              >确 定</el-button
            >
          </div>
        </el-card>

        <div v-show="getshow == 3"></div>
      </el-drawer>
    </div>
  </div>
</template>
    
  <script>
import {
  queryBypage,
  selectAll,
  reimbursementListid,
  resubmit,
  selectProjectpeople,
} from "@/api/spendreimbursement";
import { getFileUrl } from "@/api/companyFile";
import { selectAllById, selectByIdF, deleteById } from "@/api/project";
export default {
  created() {
    this.fileUploadHeader["X-Token"] = this.$store.getters.token;
    this.proutlist1.userId = this.$store.getters.urId;
    this.proutlist1.companyId = this.$store.getters.companyId;
    this.parm.companyId = this.$store.getters.companyId;
    this.action1 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures";
    this.reimebursementprojectpeopleItem();
    this.getpagelist();
  },
  data() {
    return {
      activeName: "second",
      total: 0,
      queryitem: {
        projectName: null,
        tripStatus: null,
        pageNum: 1,
        pageSize: 5,
      },
      //抽屉
      drawer: false,
      invoiceShow: false,
      // 对话框
      dialogFormVisible: false,
      // 接受的数据
      tableData: [],
      // 收集随从人员进行展示
      collectProjectpeople: [],
      getinvoivelist: [],
      // 发票状态
      invoicestatus: false,
      //查看详情
      paramlist: {},
      // 收集随从人员名字
      peopleList: {
        collectName: [],
      },
      //临时一条记录的所有数据 可以用来
      temporaryData: {},
      //查询图片给的值
      getinvoiveId: {
        tripId: 0,
      },
      fileUploadHeader: {
        "X-Token": null,
      },

      //附件///-------
      //drawer1: false,
      direction: "rtl",
      fileList1: [], //合同文件
      disabled2: false, //隐藏
      getshow: 1, //判断show的显示与隐藏,
      queryDTOList: [], //收集附件的数据
      //附件抽屉
      drawer2: false,
      //发票对话框
      dialogFormVisible: false,
      invoiceListAdd: [], //查询发票的集合
      getFormslist: {
        userId: null,
        companyId: null,
        type: 0,
      }, //查询的能选择的表单信息
      getListincom: [], //收集选择的数组
      incomeIdgrt: null, //收集incomeId数据
      getshow: 1, //判断show的显示与隐藏,
      //合同文件上传携带参数
      proutlist1: {
        Id: null,
        enclosureDescribe: "",
        status: 3, //0收入 1支出
        userId: null,
        companyId: null,
      },
      fileTypepdf: false, //判断合同文件是否存在
      fileList1: [], //附件文件
      disabled: false, //隐藏

      table: false,
      invoicelist: [],
      formtripid: null,
      srcList: [],
      parm: {
        tripId: null,
        companyId: null,
      },
    };
  },
  methods: {
    //添加人员
    addDomain() {
      this.peopleList.collectName.push({
        personnelName: "",
        tripId: null,
      });
    },
    //删除人员
    removeDomain(item) {
      var index = this.peopleList.collectName.indexOf(item);
      this.$confirm("此操作将永久删除该随从人员, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        if (index !== -1) {
          this.peopleList.collectName.splice(index, 1);
          this.$message({
            type: "success",
            message: "删除成功!",
          });
        } else {
          this.$message.error(res.msg);
        }
      });
    },
    // 搜索
    onSubmit() {
      this.getpagelist();
    },
    // 重置
    reset() {
      this.queryitem = {
        projectName: null,
        tripStatus: null,
        pageNum: 1,
        pageSize: 10,
        userId: this.$store.getters.companyId,
      };
      this.getpagelist();
    },
    // 查询de所有员工
    reimebursementprojectpeopleItem() {
      const params = {
        companyId: this.$store.getters.companyId,
      };
      selectProjectpeople(params).then((res) => {
        if (res.success) {
          this.collectProjectpeople = res.data;
        } else {
          this.$message.error(res.msg);
        }
      });
    },
    //跳转添加修改的窗口
    insertOrupdatereimebursementItem(data) {
      if (data == "" || data == undefined) {
        this.$router.push("/spendreimbursementAdd");
      } else {
        this.$router.push({
          path: "/spendreimbursementListUpdate",
          query: {
            tripid: data.tripId,
          },
        });
      }
    },
    // 展示数据的方法
    getpagelist(pager = 1) {
      this.queryitem.pageNum = pager;
      const params = {
        ...this.queryitem,
        userId: this.$store.getters.urId,
      };
      //分页查询出差报销记录
      queryBypage(params).then((res) => {
        this.tableData = res.data.list;
        if (res.success) {
          this.total = res.data.total;
          //获取随性人员
          res.data.list.forEach((e) => {
            this.parm.tripId = e.tripId;
            this.formtripid = e.tripId;
            selectAll({ tripId: e.tripId }).then((resu) => {
              if (resu.success) {
                e.entouragelist = resu.data;
              } else {
                this.$message.error(resu.msg);
              }
            });
          });
        } else {
          this.$message.error(res.msg);
        }
      });
    },
    // 查看详情
    getdetails(data) {
      this.drawer = true;
      this.paramlist = data;
    },
    //查询发票编号
    Selectlsitinvoice() {
      selectAllById(this.parm).then((res) => {
        if (res.success) {
          this.invoicelist = res.data;
          if (this.invoicelist.length == 1) {
            this.invoicestatus = true;
          } else {
            this.invoicestatus = false;
            this.back();
          }
        } else {
          this.$message.error(res.msg);
          this.back();
        }
      });
    },
    // 从新提交
    Resubmit(data) {
      resubmit(data).then((res) => {
        if (res.success) {
          this.$message.success("重新提交成功，等待审批");
          this.getpagelist();
        } else {
          this.$message.error(res.msg);
        }
      });
    },
    // 撤回申请
    withdraw(data) {
      this.$confirm("此操作将永久删除该记录！, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        reimbursementListid(data.tripId).then((res) => {
          if (res.success) {
            this.$message({
              type: "success",
              message: "撤回成功!",
            });
            this.getpagelist();
          } else {
            this.$message.error(res.msg);
          }
        });
      });
    },
    //查看图片的方法
    ReviseImage(row) {
      this.invoiceShow = true;
      this.getinvoiveId.tripId = row.tripId;
      this.Selectinsertlsit();
    },
    //查询发票图片
    Selectinsertlsit() {
      const params = {
        ...this.getinvoiveId,
        companyId: this.$store.getters.companyId,
      };
      selectAllById(params).then((res) => {
        if (res.success) {
          this.getinvoivelist = res.data;
          this.getinvoivelist.forEach((e) => {
            let fileNamepdf = e.filePath;
            let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
            getFileUrl(e.filePath).then((res) => {
              if (res.success) {
                e.fileUrl = res.data;
                if (fileType != ".pdf") {
                  this.srcList.push(res.data);
                }
              }
            });
          });
        } else {
          this.$message.error(res.msg);
        }
      });
    },
    //时间处理
    timestampToTime(row, column, cellValue) {
      return cellValue.split(" ")[0];
    },

    ///----附件区域
    //查看项目附件.....
    selectImage(row) {
      const params = {
        companyId: this.$store.getters.companyId,
        tripId: row.tripId,
      };
      this.proutlist1.Id = row.tripId;
      if (row.tripStatus == 2 || row.tripStatus == 0) {
        this.disabled2 = false;
      } else {
        this.disabled2 = true;
      }
      selectByIdF(params).then((res) => {
        if (res.success) {
          this.queryDTOList = res.data;
          if (this.queryDTOList.length > 0) {
            this.drawer2 = true;
            this.getshow = 1;
            this.disabled = false;
          } else {
            this.drawer2 = true;
            this.disabled = false;
            this.getshow = 3;
          }
        } else {
          this.$message.error(res.msg);
        }
      });
    },
    //下载附件
    async delProject(row) {
      var a = document.createElement("a"); //创建一个<a></a>标签
      a.href = (await getFileUrl(row.enclosureFile)).data; // 给a标签的href属性值加上地址，注意，这里是绝对路径，不用加 点.
      //a.download = row.enclosureFile; //设置下载文件文件名，这里加上.xlsx指定文件类型，pdf文件就指定.fpd即可
      a.target = "_blank";
      a.style.display = "none"; // 障眼法藏起来a标签
      document.body.appendChild(a); // 将a标签追加到文档对象中
      a.click(); // 模拟点击了a标签，会触发a标签的href的读取，浏览器就会自动下载了
      a.remove(); // 一次性的，用完就删除a标签
    },
    //显示添加附件
    updatecard() {
      this.getshow = 0;
      this.disabled = true;
      this.clearFile();
    },
    //删除附件
    deleteProject(row) {
      deleteById(row).then((res) => {
        if (res.success) {
          this.selectImage(row);
          this.$message({
            message: "删除成功",
            type: "success",
          });
          this.visible = false;
        } else {
          this.$message.error(res.msg);
        }
      });
    },
    //清除附件文件
    delfile1(file) {
      this.$message.error("上传附件失败");
    },
    //清除附件文件
    clearFile(){
      this.fileList1 = []
      this.fileTypepdf = false;
      this.proutlist1.enclosureDescribe = "";
    },
    //确定提交附件
    determine() {
      //判断是否有附件文件
      if (this.fileTypepdf) {
        this.$refs.upload1.submit();
        this.getshow = 1; //隐藏与显示
        this.disabled = false;
      } else {
        this.$message.error("请添加附件，在进行提交");
      }
    },
    //刷新附件
    Refresh(res) {
      this.$message.success("上传附件成功");
      if (res.success) {
        const params = {
          tripId: this.proutlist1.Id,
          companyId: this.$store.getters.companyId,
        };
        selectByIdF(params).then((res) => {
          if (res.success) {
            this.queryDTOList = res.data;
            this.proutlist1.enclosureDescribe = ""; //初始化数据
          } else {
            this.$message.error(res.msg);
          }
        });
      }else{
        this.$message.error(res.msg);
      }
    },
    //附件取消
    remove() {
      if (this.queryDTOList.length > 0) {
        this.getshow = 1;
        this.disabled = false;
        this.clearFile();
      } else {
        this.getshow = 3;
        this.disabled = false;
        this.clearFile();
      }
    },
    //附件文件校验
    onChangepdf(file) {
      if (file.name.substring(file.name.lastIndexOf(".")) != "") {
        this.fileTypepdf = true;
      } else {
        this.$message.warning("附件只能只能上传文件");
        this.$refs.upload1.clearFiles();
        this.fileTypepdf = false;
      }
    },
    //判断图片与pdf显示与隐藏
    fromgetlist(row) {
      if (row.filePath == null) {
        return false;
      } else {
        if (row.filePath.substring(row.filePath.lastIndexOf(".")) != ".pdf") {
          return true;
        } else {
          return false;
        }
      }
    },
    //跳转修改
    Agrt(row) {
      window.open(row.fileUrl, "_blank");
    },
  },
};
</script>
    
  <style>
.my-label {
  width: 100px;
}
.total_content {
  padding: 0px 15px;
}
.demo-table-expand {
  font-size: 0;
  padding: 0px 100px;
  width: 100%;
}
.demo-table-expand label {
  width: 90px;
  color: #99a9bf;
}
.demo-table-expand .el-form-item {
  margin-right: 150px;
  margin-bottom: 0;
  width: 80%;
}
.total_top {
  margin: 15px 20px;
}

.lsitall .el-col {
  margin: 20px 10px;
}
.lsitall .el-button {
  margin-left: 16px;
}
.row-bg {
  margin-left: 15%;
}
.dialog-footer {
  width: 90%;
  margin: 20px 5%;
}
.lsitall .el-col {
  margin: 20px 10px;
}
.lsitall .el-button {
  margin-left: 16px;
}
.row-bg {
  margin-left: 15%;
}
.dialog-footer {
  width: 90%;
  margin: 20px 5%;
}
</style>