Browse Source

研发制度列表增加文件重名限制

ljb 8 months ago
parent
commit
b4b78c8c20
2 changed files with 24 additions and 2 deletions
  1. 0 1
      src/option/RDSystemManage/list.js
  2. 24 1
      src/views/RD-system-manage/list.vue

+ 0 - 1
src/option/RDSystemManage/list.js

@@ -9,7 +9,6 @@ const dict = [{
 }];
 
 export default {
-  height: 'auto',
   calcHeight: 30,
   tip: false,
   searchShow: true,

+ 24 - 1
src/views/RD-system-manage/list.vue

@@ -98,7 +98,7 @@
 <script>
 import {exportBloByPost, exportBlob} from "@/api/common";
 import YearMonthSelect from "@/components/year-month-select";
-import moment, { isDate } from "moment";
+import moment from "moment";
 import {getToken} from "@/util/auth";
 import {downloadXls, downloadFileByUrl} from "@/util/util";
 import { mapGetters } from "vuex";
@@ -131,6 +131,29 @@ export default window.$crudCommon({
       return `${yearAndMonthCN}${this.tag.label}`
     }
   },
+  created() {
+    this.option.column.forEach(item => {
+      if (item.prop == 'zdwjdz') {
+        item.uploadBefore = (file, done, loading) => {
+          if (this.form.zdwjdz.some(item => item.label == file.name)) {
+            this.$message.error(`${file.name}文件已存在!`);
+            return;
+          }
+          done();
+        }
+      }
+      if (item.prop == 'zdsszm') {
+         item.uploadBefore = (file, done, loading) => {
+          console.log(file.name, this.form.zdsszm)
+          if (this.form.zdsszm.some(item => item.label == file.name)) {
+            this.$message.error(`${file.name}文件已存在!`);
+            return;
+          }
+          done();
+        }
+      }
+    })
+  },
   methods: {
     getSearchParams() {
       let searchParams = { ...this.params };