11
WXL
2023-08-28 151122a373835c93ef1418c7db0985c0660acf7e
src/views/project/travelexpenseapply/travelexpensedetail/index.vue
@@ -960,10 +960,13 @@
        <div v-if="this.previewpdf" class="pdfimgmin">
          <!-- <img :src="pdfimg" /> -->
          <el-image
            style="width: 100px; height: 100px"
            style="width: 95%; height: 90%"
            :src="pdfimg"
            :preview-src-list="pdfimgsrcList"
          >
            <!-- <div slot="error" class="image-slot">
              <i class="el-icon-picture-outline"></i>
            </div> -->
          </el-image>
        </div>
        <div v-else class="pdfimgmins">{{ hintitle }}</div>
@@ -1071,6 +1074,8 @@
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 网络请求头
      Networkheader: null,
      // 当前单据ID
      curId: 0,
@@ -1165,6 +1170,8 @@
  },
  created() {
    this.Getnetworkheader();
    //获取记录列表
    // this.getList();
@@ -1222,7 +1229,20 @@
  methods: {
    handleUploadError() {},
    // 获取请求头
    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);
      } else {
        const index = string.indexOf("8032");
        this.Networkheader = string.slice(0, index + 4); // 截取8032及其前部字符
        console.log(this.Networkheader);
      }
    },
    remove(file, fileList) {
      const rbDetails = [...this.rbDetails];
      this.fileListto.splice(this.fileListto.indexOf(file), 1);
@@ -1236,13 +1256,19 @@
    //文件上传成功回调
    uploadSccess(response, file, fileList) {
      this.rbDetails;
      //获取票据信息位置
      if (response.code == 200) {
        this.form.filename = file.raw.name;
        this.$modal.msgSuccess(response.msg);
        this.fileListto.push({ name: file.name, url: response.url });
        this.fileListto.push({
          name: file.name,
          url: response.fileName
        });
        // this.fileListto.push({
        //   name: file.name,
        //   url: response.url
        // });
        this.rbDetails[this.atpresent].annexfilesList = this.fileListto;
      } else {
        console.log(response.msg);
@@ -1252,8 +1278,14 @@
    Filepopup(index, rows, row) {
      this.atpresent = index;
      this.pdfVisible = true;
      console.log(this.rbDetails[index]);
      if (this.rbDetails[index].annexfilesList) {
        this.fileListto = this.rbDetails[index].annexfilesList;
        console.log(this.fileListto);
        this.pdfimg = this.Networkheader + "/prod-api" + this.fileListto[0].url;
        console.log(this.pdfimg);
        this.pdfimgsrcList = [];
        this.pdfimgsrcList.push(this.pdfimg);
      } else {
        this.fileListto = [];
        this.pdfimg = "";
@@ -1273,11 +1305,12 @@
      } else if (name[1] == "jpg" || "png") {
        this.previewpdf = true;
        if (item.url) {
          this.pdfimg = item.url;
          this.pdfimgsrcList=[]
          this.pdfimgsrcList.push(item.url);
          this.pdfimg = this.Networkheader + "/prod-api" + item.url;
          this.pdfimgsrcList = [];
          this.pdfimgsrcList.push(this.pdfimg);
          console.log(this.pdfimg);
        } else {
          this.pdfimg = item.response.url;
          this.pdfimg = this.Networkheader + "/prod-api" + item.response.url;
        }
      } else {
        this.hintitle = "当前文件暂不支持预览";
@@ -1578,6 +1611,7 @@
      this.loading = true;
      listReimbursement(this.queryParams).then(response => {
        this.reimbursementList = response.rows;
        console.log(this.reimbursementList);
        this.total = response.total;
        this.loading = false;
      });
@@ -1717,6 +1751,7 @@
        //获取报销明细信息
        getReimbursementdetaillist(curId).then(res => {
          this.rbDetails = res.data;
          console.log(this.rbDetails);
          if (this.rbDetails.length == 0) {
            this.addDetailRow(0);
          }