Переглянути джерело

附件上传盖章类型限制

lizhenhao 2 роки тому
батько
коміт
10192e3fdd
1 змінених файлів з 16 додано та 3 видалено
  1. 16 3
      src/views/common/UpLoadComponentV2.vue

+ 16 - 3
src/views/common/UpLoadComponentV2.vue

@@ -61,6 +61,7 @@
               :is="scope.row.sealTypeComponent || 'sealTypeComponentA'"
               :options="$dictUtils.getDictList('cw_seal_type')"
               :value="scope.row.sealType"
+              :scope="scope"
               @updateSealType="updateSealType"
             ></component>
           </template>
@@ -204,7 +205,7 @@
         data () {
           return { sealType: '' }
         },
-        props: ['options', 'value'],
+        props: ['options', 'value', 'scope'],
         mounted () {
           this.sealType = this.value
         },
@@ -221,8 +222,20 @@
               props: ['value'],
               on: {
                 change: (value) => {
-                  this.sealType = value
-                  this.$emit('updateSealType', value)
+                  let suffix = this.scope.row.name.substring(this.scope.row.name.lastIndexOf('.') + 1)
+                  if (parseInt(value) === 1) {
+                    if (suffix === 'pdf' || suffix === 'doc') {
+                      this.sealType = value
+                      this.$emit('updateSealType', value)
+                    } else {
+                      this.$message.error('此文件不允许盖章类型为“电子章”')
+                      this.sealType = ''
+                      this.$emit('updateSealType', '')
+                    }
+                  } else {
+                    this.sealType = value
+                    this.$emit('updateSealType', value)
+                  }
                 }
               }
             },