研发图纸文件管理系统-前端项目
he wei
2023-07-11 3cd5f491727cbbface34aa159eafbcea71fb2289
U sop新增 更新说明时 验证文件名称
1个文件已修改
28 ■■■■■ 已修改文件
src/pages/resourceManage/sopFile/list.vue 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/sopFile/list.vue
@@ -255,6 +255,7 @@
  name: "list",
  data() {
    return {
      rowFileName: '',
      logList: [],
      logVisible: false,
      currentObj: null,
@@ -486,6 +487,7 @@
      this.file = null;
      this.file1 = null;
      this.resObj = { rowId: row.id };
      this.rowFileName = row.fileName;
      this.onlyXls = true;
      this.uploadShow = true;
    },
@@ -546,14 +548,17 @@
        this.$message.error("sop说明文件解析异常");
        return false;
      }
      // let info = this.resData[0];
      // if(!info.boardNumber || !info.type) {
      //   this.$error({
      //     title: '系统提示',
      //     content: '缺少板号或软件类型,请输入板号和软件类型',
      //   });
      //   return false;
      // }
      // 如果sop文件名称 != sop说明里的文件名称 + 文件版本  则报错拒绝
      let reg = /(.*)\..{1,5}$/;
      let name1 = this.file.name.match(reg)[1];
      let { fileName, fileVersion } = this.resObj;
      let name2 = fileName + fileVersion;
      if (name1.toLowerCase() != name2.toLowerCase()) {
        this.$message.error("sop与说明文件可能不匹配");
        return false;
      }
      let loading = this.$layer.loading();
      const formData = new FormData();
@@ -568,7 +573,7 @@
            this.$message.success("上传成功");
            this.searchData();
          } else {
            this.$message.error("解析失败");
            this.$message.error(msg);
          }
          this.$layer.close(loading);
        })
@@ -586,6 +591,11 @@
        this.$message.error("sop说明文件解析异常");
        return false;
      }
      if (this.rowFileName.toLowerCase() != this.resObj.fileName.toLowerCase()) {
        this.$message.error("说明文件与该条记录可能不匹配");
        return false;
      }
      let loading = this.$layer.loading();
      updateSop(this.resObj)
        .then((res) => {