Explorar el Código

营业执照上传不合理不予通过,删除让用户重新上传

lifanagju_citu hace 7 meses
padre
commit
800db1d6e1

+ 1 - 0
src/components/Upload/img.vue

@@ -41,6 +41,7 @@ const src = ref('')
 
 watch(() => props.value, (newVal) => {
   src.value = newVal
+  debugger
 }, { immediate: true }, { deep: true })
 
 // 选择文件

+ 10 - 2
src/plugins/confirm/confirm.vue

@@ -5,7 +5,15 @@ defineProps({
   title: String,
   text: String,
   cancel: Function,
-  sure: Function
+  sure: Function,
+  option: {
+    type: Object,
+    default: () => {
+      return {
+        hideCancelBtn: false
+      }
+    }
+  }
 })
 
 defineOptions({ name: 'ct-confirm' })
@@ -35,7 +43,7 @@ const dialog = ref(true)
         <template v-slot:actions>
           <v-spacer></v-spacer>
 
-          <v-btn @click="cancel">
+          <v-btn v-if="hideCancelBtn" @click="cancel">
             取消
           </v-btn>
 

+ 8 - 1
src/views/recruit/entRegister/register.vue

@@ -27,7 +27,7 @@
                 <Img 
                   class="mt-3" 
                   tips="上传图片" 
-                  :value="licenseUrl" 
+                  :value="licenseUrl"
                   :showSnackbar="false" 
                   @imgClick="showPreview = !showPreview" 
                   :showCursor="true" 
@@ -70,6 +70,7 @@ import { enterpriseRegisterApply } from '@/api/personal/user'
 import { onMounted, ref, computed } from 'vue';
 import { checkEmail } from '@/utils/validate'
 import { getBusinessLicenseOCR } from '@/api/common'
+import Confirm from '@/plugins/confirm'
 
 const { t } = useI18n()
 const CtFormRef = ref()
@@ -266,7 +267,13 @@ const getOcr = async () => {
       formItems.value.options.find(e => e.key === 'name').value = data.name
       business.value = data
       saveRegisterInfo()
+    } else {
+      licenseUrl.value = ''
+      Confirm(t('common.confirmTitle'), '营业执照图片识别失败,请重新上传清晰合法图片', { hideCancelBtn: true })
     }
+  } catch (error) {
+    licenseUrl.value = ''
+    Confirm(t('common.confirmTitle'), error, { hideCancelBtn: true })
   } finally {
     loading.value = false
   }