@@ -43,6 +43,7 @@
diff --git a/src/views/enterpriseLibrary/enterprise/components/child/BasicInfo.vue b/src/views/enterpriseLibrary/enterprise/components/child/BasicInfo.vue
index 826cdfc..7ba8acd 100644
--- a/src/views/enterpriseLibrary/enterprise/components/child/BasicInfo.vue
+++ b/src/views/enterpriseLibrary/enterprise/components/child/BasicInfo.vue
@@ -7,7 +7,7 @@
-
+
@@ -38,6 +38,7 @@ export default {
components: {
UploadFile
},
+ dicts: ['identification_tag'],
data() {
return {
form: {
@@ -50,6 +51,10 @@ export default {
businessScope: '',
fileList: []
},
+ // OCR 识别规则
+ // ocrRuleList: ['business_license', 'face_id_card_portrait', 'national_emblem_id_card', 'account_opening_license'],
+ ocrRuleList: ['business_license'],
+ fileUploadList: [],
rules: {
fileList: [
{ required: true, message: '请上传营业执照', trigger: 'blur' }
@@ -75,6 +80,9 @@ export default {
}
}
+ },
+ created() {
+
},
methods: {
// 校验规则
@@ -89,6 +97,41 @@ export default {
})
})
},
+ // ocr文件识别规则
+ ocrRule(type) {
+ const foundItem = this.dict.type.identification_tag.find(item => item.value === type);
+ const item = foundItem ? {
+ fileUploadType: foundItem.value,
+ fields_json: foundItem.raw.remark,
+ suffix: 'mainDatabase'
+ } : null;
+ console.log(item);
+
+ this.fileUploadList.push(item)
+ },
+ // 添加ocr文件识别规则
+ addOcrRule() {
+ this.ocrRuleList.forEach(item => {
+ this.ocrRule(item)
+ })
+ },
+ },
+ computed: {
+ fileUploadRule() {
+ return this.fileUploadList[0] || {};
+ }
+ },
+ watch: {
+ // 监听字典数据加载完成
+ 'dict.type.identification_tag': {
+ handler(newVal) {
+ if (newVal && newVal.length > 0) {
+ console.log('字典数据加载完成:', newVal);
+ this.addOcrRule();
+ }
+ },
+ immediate: true // 立即执行一次
+ }
},
}