企业库

This commit is contained in:
cwchen 2025-10-23 17:04:04 +08:00
parent 2328ab1158
commit 244a9d2c8b
12 changed files with 511 additions and 270 deletions

View File

@ -0,0 +1,46 @@
import request from '@/utils/request'
// 主体库->查询列表
export function listAPI(params) {
return request({
url: '/smartBid/mainDatabase/enterprise/getList',
method: 'GET',
params
})
}
/* 主体库->新增主体库 */
export function addDataAPI(data) {
return request({
url: '/smartBid/mainDatabase/enterprise/addData',
method: 'POST',
data
})
}
/* 主体库->修改主体库 */
export function editDataAPI(data) {
return request({
url: '/smartBid/mainDatabase/enterprise/editData',
method: 'POST',
data
})
}
/* 主体库->删除主体库 */
export function delDataAPI(data) {
return request({
url: '/smartBid/mainDatabase/enterprise/delData',
method: 'POST',
data
})
}
/* 主体库->查询详情 */
export function getDetailDataAPI(params) {
return request({
url: '/smartBid/mainDatabase/enterprise/getDetailData',
method: 'GET',
params
})
}

View File

@ -164,7 +164,7 @@ export const dynamicRoutes = [
},
{
path: '/enterpriseForm',
path: '/enterpriseAdd',
component: Layout,
hidden: true,
permissions: ['enterpriseLibrary:enterprise:add'],
@ -177,6 +177,20 @@ export const dynamicRoutes = [
}
]
},
{
path: '/enterpriseEdit',
component: Layout,
hidden: true,
permissions: ['enterpriseLibrary:enterprise:edit'],
children: [
{
path: 'index',
component: () => import('@/views/enterpriseLibrary/enterprise/components/EnterpriseForm'),
name: 'EnterpriseForm',
meta: { title: '编辑主体信息', activeMenu: '/enterpriseLibrary/enterprise', noCache: true }
}
]
},
{
path: '/enterpriseDetail',
component: Layout,

View File

@ -43,7 +43,7 @@
</template>
<script>
import { uploadSmallFileByOcr,uploadLargeFileByOcr } from '@/api/common/uploadFile.js'
import { uploadSmallFileByOcr, uploadLargeFileByOcr } from '@/api/common/uploadFile.js'
export default {
name: 'UploadFile',
props: {
@ -206,7 +206,7 @@ export default {
this.updateFileStatus(file.uid, 'success', '', res.data, 100);
console.log('上传成功后的文件列表:', this.files);
//
this.$emit('file-change', this.getCurrentFiles(),this.type);
this.$emit('file-change', this.getCurrentFiles(), this.type);
} catch (err) {
this.$bus.$emit('endUpload');
//
@ -225,12 +225,12 @@ export default {
//
this.files.splice(fileIndex, 1);
console.log('移除失败文件后的文件列表:', this.files);
//
this.clearPreview();
//
this.$emit('file-change', this.getCurrentFiles(),this.type);
this.$emit('file-change', this.getCurrentFiles(), this.type);
}
},
@ -312,7 +312,7 @@ export default {
//
handleExceed(files, fileList) {
console.log('文件超出限制处理',files,fileList);
console.log('文件超出限制处理', files, fileList);
//
if (files.length > 0) {
//
@ -397,13 +397,13 @@ export default {
//
isImageFile(file) {
return file && file.type && file.type.startsWith('image/');
return (file && file.type && file.type.startsWith('image/')) || (file && file.fileType === '1');
},
//
isDocumentFile(file) {
if (!file || !file.name) return false;
const fileExtension = file.name.split('.').pop().toLowerCase();
return ['pdf', 'doc', 'docx', 'xls', 'xlsx'].includes(fileExtension);
return ['pdf', 'doc', 'docx', 'xls', 'xlsx'].includes(fileExtension) || (file && file.fileType === '2');
},
//
generateImagePreview(file) {
@ -417,6 +417,15 @@ export default {
};
reader.readAsDataURL(file);
},
//
generateImagePreviewFromPath(file) {
console.log(file.lsFilePath);
this.previewImageUrl = file.lsFilePath;
this.previewImageName = file.name;
//
this.previewFileName = '';
this.previewFileType = '';
},
//
generateDocumentPreview(file) {
const fileExtension = file.name.split('.').pop().toLowerCase();
@ -455,19 +464,13 @@ export default {
//
showImagePreview() {
return this.previewImageUrl &&
this.files.length === 1 &&
this.files[0] &&
this.files[0].raw &&
this.isImageFile(this.files[0].raw);
this.files.length === 1 ;
},
//
showFilePreview() {
return this.previewFileName &&
this.previewFileType &&
this.files.length === 1 &&
this.files[0] &&
this.files[0].raw &&
this.isDocumentFile(this.files[0].raw);
this.files.length === 1;
},
accept() {
return this.uploadType.split('、').map(type => `.${type}`).join(',');
@ -506,22 +509,40 @@ export default {
watch: {
fileList: {
handler(newVal) {
// console.log('fileList :', newVal);
// 使
this.files = this.formatFileList(newVal);
//
if (newVal.length === 1 && newVal[0] && newVal[0].raw) {
if (this.isImageFile(newVal[0].raw)) {
this.generateImagePreview(newVal[0].raw);
} else if (this.isDocumentFile(newVal[0].raw)) {
this.generateDocumentPreview(newVal[0].raw);
// lsFilePath
if (newVal.length > 0) {
const firstFile = newVal[0];
console.log("firstFile", firstFile);
if (firstFile && firstFile.lsFilePath) {
//
if (this.isImageFile(firstFile)) {
this.generateImagePreviewFromPath(firstFile);
} else if (this.isDocumentFile(firstFile)) {
this.generateDocumentPreview(firstFile);
}
} else {
// lsFilePath退
if (firstFile && firstFile.raw) {
if (this.isImageFile(firstFile.raw)) {
this.generateImagePreview(firstFile.raw);
} else if (this.isDocumentFile(firstFile.raw)) {
this.generateDocumentPreview(firstFile.raw);
}
} else {
this.clearPreview();
}
}
} else {
this.clearPreview();
}
},
immediate: true,
deep: true
},
}
},
}
</script>

View File

@ -9,15 +9,15 @@
<el-row :gutter="24" class="content-row">
<!-- 基本信息 -->
<el-col :span="6" class="pane-left">
<BasicInfoDetail ref="basicInfoDetail" />
<BasicInfoDetail ref="basicInfoDetail" :detailData="detailData"/>
</el-col>
<!-- 法人信息 -->
<el-col :span="6" class="pane-center">
<LegalPersonDetail ref="legalPersonDetail" />
<LegalPersonDetail ref="legalPersonDetail" :detailData="detailData"/>
</el-col>
<!-- 开户证明 -->
<el-col :span="6" class="pane-right">
<AccountOpeningCertificateDetail ref="accountOpeningCertificateDetail" />
<AccountOpeningCertificateDetail ref="accountOpeningCertificateDetail" :detailData="detailData"/>
</el-col>
</el-row>
</div>
@ -28,6 +28,7 @@ import { decryptWithSM4 } from '@/utils/sm'
import BasicInfoDetail from './child/BasicInfoDetail.vue'
import LegalPersonDetail from './child/LegalPersonDetail.vue'
import AccountOpeningCertificateDetail from './child/AccountOpeningCertificateDetail.vue'
import { getDetailDataAPI } from '@/api/enterpriseLibrary/enterprise/enterprise'
export default {
name: 'EnterpriseDetail',
@ -38,44 +39,25 @@ export default {
},
data() {
return {
id: decryptWithSM4(this.$route.query.id),
enterpriseId: decryptWithSM4(this.$route.query.enterpriseId),
type: decryptWithSM4(this.$route.query.type),
detailData: {} //
}
},
created() {
this.getDetail()
},
methods: {
//
handleClose() {
const obj = { path: "/enterpriseLibrary/enterprise" }
this.$tab.closeOpenPage(obj)
},
//
async handleSave() {
try {
//
const [basicInfoData, legalPersonData, accountData] = await Promise.all([
this.$refs.basicInfo.validate(),
this.$refs.legalPerson.validate(),
this.$refs.accountOpeningCertificate.validate()
])
//
const formData = {
...basicInfoData,
...legalPersonData,
...accountData
}
console.log('所有表单校验通过,完整数据:', formData)
//
// await this.saveEnterprise(formData)
this.$message.success('保存成功')
} catch (error) {
// console.error(':', error)
this.$message.error(error.message || '请完善表单信息')
}
}
//
async getDetail() {
const res = await getDetailDataAPI({ enterpriseId: this.enterpriseId })
this.detailData = res.data;
},
}
}

View File

@ -29,15 +29,15 @@
<el-row :gutter="24" class="content-row">
<!-- 基本信息 -->
<el-col :span="6" class="pane-left">
<BasicInfo ref="basicInfo" />
<BasicInfo ref="basicInfo" :detailData="detailData" />
</el-col>
<!-- 法人信息 -->
<el-col :span="6" class="pane-center">
<LegalPerson ref="legalPerson" />
<LegalPerson ref="legalPerson" :detailData="detailData" />
</el-col>
<!-- 开户证明 -->
<el-col :span="6" class="pane-right">
<AccountOpeningCertificate ref="accountOpeningCertificate" />
<AccountOpeningCertificate ref="accountOpeningCertificate" :detailData="detailData" />
</el-col>
</el-row>
</div>
@ -49,6 +49,7 @@ import { decryptWithSM4 } from '@/utils/sm'
import BasicInfo from './child/BasicInfo.vue'
import LegalPerson from './child/LegalPerson.vue'
import AccountOpeningCertificate from './child/AccountOpeningCertificate.vue'
import { addDataAPI, editDataAPI, getDetailDataAPI } from '@/api/enterpriseLibrary/enterprise/enterprise'
export default {
name: 'EnterpriseForm',
@ -59,23 +60,32 @@ export default {
},
data() {
return {
id: decryptWithSM4(this.$route.query.id),
enterpriseId: decryptWithSM4(this.$route.query.enterpriseId),
type: decryptWithSM4(this.$route.query.type),
showUploadAnimation: false,
showSaveAnimation: false, //
uploadQueue: 0, //
animationText: '识别中',
isSaving: false // loading
isSaving: false, // loading
detailData: {} //
}
},
created() {
this.getDetail()
},
methods: {
//
handleClose() {
const obj = { path: "/enterpriseLibrary/enterprise" }
this.$tab.closeOpenPage(obj)
},
//
async getDetail() {
const res = await getDetailDataAPI({ enterpriseId: this.enterpriseId })
console.log('res:', res);
this.detailData = res.data;
},
//
async handleSave() {
//
@ -99,46 +109,65 @@ export default {
...basicInfoData,
...legalPersonData,
...accountData,
allFiles: [...basicInfoData.fileList, ...legalPersonData.fileList, ...legalPersonData.fileList2, ...accountData.fileList],
allFiles: [...basicInfoData.delFileList, ...legalPersonData.delFileList, ...accountData.delFileList]
allFiles: [
...basicInfoData.fileList.map(file => JSON.parse(JSON.stringify(file))),
...legalPersonData.fileList.map(file => JSON.parse(JSON.stringify(file))),
...legalPersonData.fileList2.map(file => JSON.parse(JSON.stringify(file))),
...accountData.fileList.map(file => JSON.parse(JSON.stringify(file)))
],
delFiles: [
...basicInfoData.delFileList,
...legalPersonData.delFileList,
...accountData.delFileList
]
}
console.log('所有表单校验通过,完整数据:', formData)
let allFiles = formData.allFiles.map(file => {
return file?.response?.fileRes ? {
...file.response.fileRes,
} : null;
}).filter(item => item !== null);
formData.files = allFiles;
//
delete formData.fileList;
delete formData.delFileList;
let allFiles = formData.allFiles.map(file => {
return {
...file.obj,
}
});
formData.allFiles = allFiles;
//
await this.saveEnterprise(formData)
this.$message.success('保存成功')
//
this.handleClose()
delete formData.allFiles;
delete formData.fileList2;
//
const res = await this.saveEnterprise(formData)
console.log('res:', res);
if (res.code === 200) {
this.$message.success('保存成功')
this.handleClose()
}
} catch (error) {
console.error('保存失败:', error)
this.$message.error(error.message || '保存失败,请重试')
} finally {
//
this.isSaving = false
this.showSaveAnimation = false
}
},
//
//
async saveEnterprise(formData) {
//
return new Promise((resolve, reject) => {
setTimeout(() => {
//
// 使 reject(new Error(''))
resolve({ code: 200, message: '保存成功' })
}, 2000) // 2
if (this.type === 'add') { //
addDataAPI(formData).then(res => {
resolve(res)
}).catch(error => {
reject(error)
})
} else { //
formData.enterpriseId = this.enterpriseId;
editDataAPI(formData).then(res => {
resolve(res)
}).catch(error => {
reject(error)
})
}
})
},
//
@ -188,11 +217,11 @@ export default {
min-height: 100vh;
overflow-y: auto;
position: relative;
//
&.no-pointer-events {
pointer-events: none;
//
* {
pointer-events: none;
@ -211,7 +240,7 @@ export default {
display: flex;
align-items: center;
justify-content: center;
//
pointer-events: auto;
@ -223,7 +252,7 @@ export default {
bottom: 0;
background: rgba(255, 255, 255, 0.6); //
backdrop-filter: blur(4px);
//
pointer-events: auto;
}
@ -240,7 +269,7 @@ export default {
0 0 0 1px rgba(31, 114, 234, 0.1);
min-width: 280px;
animation: slideInUp 0.3s ease-out;
//
pointer-events: auto;

View File

@ -26,6 +26,12 @@ export default {
name: 'AccountOpeningCertificate',
components:{UploadFile},
dicts: ['identification_tag'],
props:{
detailData: {
type: Object,
default: () => {}
}
},
data() {
return {
form: {
@ -45,7 +51,7 @@ export default {
},
rules: {
fileList:[
{ required: true, message: '请上传开户许可证', trigger: 'blur' }
{ required: true, message: '请上传开户许可证', trigger: 'change' }
],
openingBank: [
{ required: true, message: '请输入开户银行', trigger: 'blur' }
@ -114,6 +120,25 @@ export default {
handleDelFile(file) {
console.log(file);
this.form.delFileList.push(file.response.fileRes.uploadPath || file.filePath);
},
setFormData(){
const fileList = this.getFileList('account_opening_license');
this.form = {
fileList: fileList,
openingBank: this.detailData.openingBank || '',
openingAccount: this.detailData.openingAccount || '',
delFileList: []
}
},
getFileList(businessType){
return this.detailData.fileList.filter(item => item.businessType === businessType).map(item => {
return {
name: item.fileName,
filePath: item.filePath,
lsFilePath:item.lsFilePath,
fileType:item.fileType
};
});
}
},
computed: {
@ -130,8 +155,18 @@ export default {
}
},
immediate: true //
},
detailData:{
handler(newVal) {
if (Object.keys(newVal).length > 0) {
this.setFormData();
}
},
immediate: true, //
deep:true
}
},
}
</script>

View File

@ -10,7 +10,7 @@
<div class="detail-item">
<div class="item-label">开户许可证</div>
<div class="item-value">
<el-image :src="url" :preview-src-list="srcList" class="license-image">
<el-image :src="form.url" class="license-image">
</el-image>
</div>
</div>
@ -18,13 +18,13 @@
<!-- 开户银行 -->
<div class="detail-item">
<div class="item-label">开户银行</div>
<div class="item-value">{{ enterpriseName || '中讯科技股份有限公司' }}</div>
<div class="item-value">{{ form.openingBank || '--' }}</div>
</div>
<!-- 开户账号 -->
<div class="detail-item">
<div class="item-label">开户账号</div>
<div class="item-value">{{ enterpriseCode || '12345678901313132390' }}</div>
<div class="item-value">{{ form.openingAccount || '--' }}</div>
</div>
@ -33,25 +33,55 @@
</template>
<script>
import UploadFile from '@/views/common/UploadFile.vue'
import basicInfo from '@/assets/enterpriseLibrary/basic-info.png'
export default {
name: 'AccountOpeningCertificateDetail',
components: {
UploadFile
props: {
detailData: {
type: Object,
default: () => { }
}
},
data() {
return {
name: '',
enterpriseName: '',
url: basicInfo,
srcList: [basicInfo],
form:{
openingBank:'',
openingAccount:'',
url:null,
}
}
},
methods: {
//
setDetailData() {
const fileList = this.getFileList('account_opening_license')
this.form = {
openingBank: this.detailData.openingBank,
openingAccount: this.detailData.openingAccount,
url:fileList[0].lsFilePath,
}
},
getFileList(businessType){
return this.detailData.fileList.filter(item => item.businessType === businessType).map(item => {
return {
name: item.fileName,
filePath: item.filePath,
lsFilePath:item.lsFilePath,
fileType:item.fileType
};
});
}
},
watch: {
detailData: {
handler(newVal) {
if (Object.keys(newVal).length > 0) {
this.setDetailData();
}
},
immediate: true, //
deep: true
}
},
}
</script>

View File

@ -50,6 +50,12 @@ export default {
components: {
UploadFile
},
props:{
detailData: {
type: Object,
default: () => {}
}
},
dicts: ['identification_tag'],
data() {
return {
@ -79,7 +85,7 @@ export default {
},
rules: {
fileList: [
{ required: true, message: '请上传营业执照', trigger: 'blur' }
{ required: true, message: '请上传营业执照', trigger: 'change' }
],
enterpriseName: [
{ required: true, message: '请输入企业名称', trigger: 'blur' }
@ -139,6 +145,8 @@ export default {
},
//
handleFileChange(file) {
console.log(file);
this.form.fileList = file;
if (file instanceof Array && file.length > 0 && file[0].response) {
const response = file[0].response;
@ -167,7 +175,33 @@ export default {
handleDelFile(file) {
console.log(file);
this.form.delFileList.push(file.response.fileRes.uploadPath || file.filePath);
},
setFormData(){
const fileList = this.getFileList('business_license');
this.form = {
enterpriseName: this.detailData.enterpriseName || '',
enterpriseCode: this.detailData.enterpriseCode || '',
registeredCapital: this.detailData.registeredCapital || '',
establishedDate: this.detailData.establishedDate || null,
businessTerm: this.detailData.businessTerm || '',
residence: this.detailData.residence || '',
businessScope: this.detailData.businessScope || '',
fileList: fileList,
delFileList: []
}
},
getFileList(businessType){
return this.detailData.fileList.filter(item => item.businessType === businessType).map(item => {
return {
name: item.fileName,
filePath: item.filePath,
lsFilePath:item.lsFilePath,
fileType:item.fileType
};
});
}
},
computed: {
fileUploadRule() {
@ -183,6 +217,15 @@ export default {
}
},
immediate: true //
},
detailData:{
handler(newVal) {
if (Object.keys(newVal).length > 0) {
this.setFormData();
}
},
immediate: true, //
deep:true
}
},
}

View File

@ -10,75 +10,113 @@
<div class="detail-item">
<div class="item-label">营业执照</div>
<div class="item-value">
<el-image :src="url" :preview-src-list="srcList" class="license-image">
</el-image>
<el-image :src="form.url" class="license-image"></el-image>
</div>
</div>
<!-- 企业名称 -->
<div class="detail-item">
<div class="item-label">企业名称</div>
<div class="item-value">{{ enterpriseName || '中讯科技股份有限公司' }}</div>
<div class="item-value">{{ form.enterpriseName || '--' }}</div>
</div>
<!-- 统一社会信用代码 -->
<div class="detail-item">
<div class="item-label">统一社会信用代码</div>
<div class="item-value">{{ enterpriseCode || '12345678901313132390' }}</div>
<div class="item-value">{{ form.enterpriseCode || '--' }}</div>
</div>
<!-- 注册资本 -->
<div class="detail-item">
<div class="item-label">注册资本</div>
<div class="item-value">{{ registeredCapital || '11000.00' }}</div>
<div class="item-value">{{ form.registeredCapital || '--' }}</div>
</div>
<!-- 成立日期 -->
<div class="detail-item">
<div class="item-label">成立日期</div>
<div class="item-value">{{ form.establishedDate || '--' }}</div>
</div>
<!-- 营业期限 -->
<div class="detail-item">
<div class="item-label">营业期限</div>
<div class="item-value">{{ businessTerm || '2015/01/01-2035/01/01' }}</div>
<div class="item-value">{{ form.businessTerm || '--' }}</div>
</div>
<!-- 住所 -->
<div class="detail-item">
<div class="item-label">住所</div>
<div class="item-value">{{ residence || '安徽省合肥市蜀山区望江西路100号' }}</div>
<div class="item-value">{{ form.residence || '--' }}</div>
</div>
<!-- 经营范围 -->
<div class="detail-item">
<div class="item-label">经营范围</div>
<div class="item-value">{{ businessScope || '软件开发、技术服务、电子商务' }}</div>
<div class="item-value">{{ form.businessScope || '--' }}</div>
</div>
</div>
<el-dialog title="营业执照" :visible.sync="showPhoto" width="60%" append-to-body>
<view-photo :images="images" />
</el-dialog>
</div>
</template>
<script>
import basicInfo from '@/assets/enterpriseLibrary/basic-info.png'
export default {
name: 'BasicInfoDetail',
components: {
props: {
detailData: {
type: Object,
default: () => { }
}
},
data() {
return {
name: '',
url: basicInfo,
srcList: [basicInfo],
enterpriseName: '',
enterpriseCode: '',
registeredCapital: '',
businessTerm: '',
residence: '',
businessScope: '',
fileList: [],
form: {
enterpriseName: '',
enterpriseCode: '',
registeredCapital: '',
establishedDate:'',
businessTerm: '',
residence: '',
businessScope: '',
url:null
}
}
},
methods: {
setDetailData() {
const fileList = this.getFileList('business_license');
this.form = {
enterpriseName: this.detailData.enterpriseName,
enterpriseCode: this.detailData.enterpriseCode,
registeredCapital: this.detailData.registeredCapital,
establishedDate: this.detailData.establishedDate,
businessTerm: this.detailData.businessTerm,
residence: this.detailData.residence,
businessScope: this.detailData.businessScope,
url:fileList[0].lsFilePath
}
},
getFileList(businessType){
return this.detailData.fileList.filter(item => item.businessType === businessType).map(item => {
return {
name: item.fileName,
filePath: item.filePath,
lsFilePath:item.lsFilePath,
fileType:item.fileType
};
});
}
},
watch: {
detailData: {
handler(newVal) {
if (Object.keys(newVal).length > 0) {
this.setDetailData();
}
},
immediate: true, //
deep: true
}
},
}
</script>

View File

@ -40,6 +40,12 @@ export default {
name: 'LegalPerson',
components: { UploadFile },
dicts: ['identification_tag'],
props:{
detailData: {
type: Object,
default: () => {}
}
},
data() {
return {
form: {
@ -63,10 +69,10 @@ export default {
},
rules: {
fileList: [
{ required: true, message: '请上传身份证人像面', trigger: 'blur' }
{ required: true, message: '请上传身份证人像面', trigger: 'change' }
],
fileList2: [
{ required: true, message: '请上传身份证国徽面', trigger: 'blur' }
{ required: true, message: '请上传身份证国徽面', trigger: 'change' }
],
legalPersonName: [
{ required: true, message: '请输入法人姓名', trigger: 'blur' }
@ -143,6 +149,30 @@ export default {
handleDelFile(file) {
console.log(file);
this.form.delFileList.push(file.response.fileRes.uploadPath || file.filePath);
},
setFormData(){
const fileList = this.getFileList('face_id_card_portrait')
const fileList2 = this.getFileList('national_emblem_id_card')
this.form = {
legalPersonName: this.detailData.legalPersonName || '',
legalPersonIdCard: this.detailData.legalPersonIdCard || '',
idCardStartDate: this.detailData.idCardStartDate || '',
legalPersonPosition: this.detailData.legalPersonPosition || '',
legalPersonPhone: this.detailData.legalPersonPhone || '',
fileList: fileList,
fileList2: fileList2,
delFileList: []
}
},
getFileList(businessType){
return this.detailData.fileList.filter(item => item.businessType === businessType).map(item => {
return {
name: item.fileName,
filePath: item.filePath,
lsFilePath:item.lsFilePath,
fileType:item.fileType
};
});
}
},
computed: {
@ -162,6 +192,15 @@ export default {
}
},
immediate: true //
},
detailData:{
handler(newVal) {
if (Object.keys(newVal).length > 0) {
this.setFormData();
}
},
immediate: true, //
deep:true
}
},
}

View File

@ -10,7 +10,7 @@
<div class="detail-item">
<div class="item-label">身份证人像面</div>
<div class="item-value">
<el-image :src="url" :preview-src-list="srcList" class="license-image">
<el-image :src="form.url" class="license-image">
</el-image>
</div>
</div>
@ -18,38 +18,38 @@
<div class="detail-item">
<div class="item-label">身份证国徽面</div>
<div class="item-value">
<el-image :src="url" :preview-src-list="srcList" class="license-image">
<el-image :src="form.url2" class="license-image">
</el-image>
</div>
</div>
<!-- 法人姓名 -->
<div class="detail-item">
<div class="item-label">法人姓名</div>
<div class="item-value">{{ enterpriseName || '中讯科技股份有限公司' }}</div>
<div class="item-value">{{ form.legalPersonName || '--' }}</div>
</div>
<!-- 法人身份证号 -->
<div class="detail-item">
<div class="item-label">法人身份证号</div>
<div class="item-value">{{ enterpriseCode || '12345678901313132390' }}</div>
<div class="item-value">{{ form.legalPersonIdCard || '--' }}</div>
</div>
<!-- 身份证有效期 -->
<div class="detail-item">
<div class="item-label">身份证有效期</div>
<div class="item-value">{{ registeredCapital || '11000.00' }}</div>
<div class="item-value">{{ form.idCardStartDate || '--' }}</div>
</div>
<!-- 法人职务 -->
<div class="detail-item">
<div class="item-label">法人职务</div>
<div class="item-value">{{ businessTerm || '2015/01/01-2035/01/01' }}</div>
<div class="item-value">{{ form.legalPersonPosition || '--' }}</div>
</div>
<!-- 法人联系方式 -->
<div class="detail-item">
<div class="item-label">法人联系方式</div>
<div class="item-value">{{ residence || '安徽省合肥市蜀山区望江西路100号' }}</div>
<div class="item-value">{{ form.legalPersonPhone || '--' }}</div>
</div>
</div>
@ -57,29 +57,62 @@
</template>
<script>
import UploadFile from '@/views/common/UploadFile.vue'
import basicInfo from '@/assets/enterpriseLibrary/basic-info.png'
export default {
name: 'LegalPersonDetail',
components: {
UploadFile
props: {
detailData: {
type: Object,
default: () => { }
}
},
data() {
return {
name: '',
enterpriseName: '',
enterpriseCode: '',
registeredCapital: '',
businessTerm: '',
residence: '',
businessScope: '',
fileList: [],
url: basicInfo,
srcList: [basicInfo],
form:{
legalPersonName:'',
legalPersonIdCard:'',
idCardStartDate:'',
legalPersonPosition:'',
legalPersonPhone:'',
url:null,
url2:null,
}
}
},
methods: {
setDetailData() {
const fileList = this.getFileList('face_id_card_portrait')
const fileList2 = this.getFileList('national_emblem_id_card')
this.form = {
legalPersonName: this.detailData.legalPersonName,
legalPersonIdCard: this.detailData.legalPersonIdCard,
idCardStartDate: this.detailData.idCardStartDate,
legalPersonPosition: this.detailData.legalPersonPosition,
legalPersonPhone: this.detailData.legalPersonPhone,
url:fileList[0].lsFilePath,
url2:fileList2[0].lsFilePath,
}
},
getFileList(businessType){
return this.detailData.fileList.filter(item => item.businessType === businessType).map(item => {
return {
name: item.fileName,
filePath: item.filePath,
lsFilePath:item.lsFilePath,
fileType:item.fileType
};
});
}
},
watch: {
detailData: {
handler(newVal) {
if (Object.keys(newVal).length > 0) {
this.setDetailData();
}
},
immediate: true, //
deep: true
}
},
}
</script>

View File

@ -34,66 +34,59 @@
</div>
<!-- 企业信息卡片 -->
<div class="enterprise-card" v-for="(enterprise, index) in enterpriseList" :key="index">
<div class="enterprise-card" v-for="item in enterpriseList" :key="item.enterpriseId">
<div class="enterprise-header">
<h3 class="enterprise-name">{{ enterprise.name }}</h3>
<h3 class="enterprise-name">{{ item.enterpriseName }}</h3>
</div>
<div class="enterprise-info">
<div class="info-item">
<span class="label">法定代表人:</span>
<span class="value">{{ enterprise.legalRepresentative }}</span>
<span class="value">{{ item.legalPersonName }}</span>
</div>
<div class="info-item">
<span class="label">统一信用代码:</span>
<span class="value">{{ enterprise.creditCode }}</span>
<span class="value">{{ item.enterpriseCode }}</span>
</div>
</div>
<!-- 过期文档标签 -->
<div class="expired-tags" v-if="enterprise.expiredDocs && enterprise.expiredDocs.length > 0">
<span class="expired-tag" v-for="doc in enterprise.expiredDocs" :key="doc">{{ doc }}</span>
<div class="expired-tags" v-if="item.errorInfos && item.errorInfos.length > 0">
<span class="expired-tag" v-for="doc in item.errorInfos" :key="doc">{{ doc }}</span>
</div>
<!-- 数据统计 -->
<div class="data-stats">
<div class="stat-item">
<span class="stat-label">资质库</span>
<span class="stat-value">10</span>
<span class="stat-value">{{ item.qualificationNum }}</span>
</div>
<div class="stat-item">
<span class="stat-label">业绩库</span>
<span class="stat-value">23</span>
<span class="stat-value">{{ item.performanceNum }}</span>
</div>
<div class="stat-item">
<span class="stat-label">人员库</span>
<span class="stat-value">55</span>
<span class="stat-value">{{ item.personnelNum }}</span>
</div>
<div class="stat-item">
<span class="stat-label">财务库</span>
<span class="stat-value">88</span>
<span class="stat-value">{{ item.financeNum }}</span>
</div>
<!-- <div class="stat-item">
<span class="stat-label">技术方案库</span>
<span class="stat-value">88</span>
</div>
<div class="stat-item">
<span class="stat-label">工器具库</span>
<span class="stat-value">88</span>
</div> -->
</div>
<!-- 操作按钮 -->
<div class="enterprise-actions">
<div @click="handleEnterpriseKnowledge(enterprise)">
<div @click="handleEnterpriseKnowledge(item)">
<img :src="EnterpriseKnowledge" alt="企业知识库" />
<span>企业知识库</span>
</div>
<div v-hasPermi="['enterpriseLibrary:enterprise:detail']" @click="handleDetail(enterprise)">
<div v-hasPermi="['enterpriseLibrary:enterprise:detail']" @click="handleDetail(item)">
<img :src="EnterpriseDetail" alt="详情" />
<span>详情</span>
</div>
<div v-hasPermi="['enterpriseLibrary:enterprise:edit']">
<div v-hasPermi="['enterpriseLibrary:enterprise:edit']" @click="handleEdit(item)">
<img :src="EnterpriseEdit" alt="编辑" />
<span>编辑</span>
</div>
@ -121,6 +114,7 @@ import EnterpriseDetail from '@/assets/enterpriseLibrary/enterprise/enterprise-d
import EnterpriseEdit from '@/assets/enterpriseLibrary/enterprise/enterprise-edit.png';
import EnterpriseDelete from '@/assets/enterpriseLibrary/enterprise/enterprise-delete.png';
import { encryptWithSM4 } from '@/utils/sm'
import { listAPI } from '@/api/enterpriseLibrary/enterprise/enterprise'
export default {
name: 'Enterprise',
components: {
@ -139,86 +133,8 @@ export default {
pageSize: 10,
},
total: 1000,
enterpriseList: [
{
name: '中电鸿信信息科技有限公司',
legalRepresentative: '沈宇',
creditCode: '91320000668382125',
rating: 'D',
expiredDocs: ['【身份证】已过期', '【营业执照】已过期']
},
{
name: '中电鸿信信息科技有限公司',
legalRepresentative: '沈宇',
creditCode: '91320000668382125',
rating: 'D',
expiredDocs: []
},
{
name: '中电鸿信信息科技有限公司',
legalRepresentative: '沈宇',
creditCode: '91320000668382125',
rating: 'D',
expiredDocs: []
},
{
name: '中电鸿信信息科技有限公司',
legalRepresentative: '沈宇',
creditCode: '91320000668382125',
rating: 'D',
expiredDocs: []
},
{
name: '中电鸿信信息科技有限公司',
legalRepresentative: '沈宇',
creditCode: '91320000668382125',
rating: 'D',
expiredDocs: []
},
{
name: '中电鸿信信息科技有限公司',
legalRepresentative: '沈宇',
creditCode: '91320000668382125',
rating: 'D',
expiredDocs: []
},
{
name: '中电鸿信信息科技有限公司',
legalRepresentative: '沈宇',
creditCode: '91320000668382125',
rating: 'D',
expiredDocs: []
},
{
name: '中电鸿信信息科技有限公司',
legalRepresentative: '沈宇',
creditCode: '91320000668382125',
rating: 'D',
expiredDocs: []
},
{
name: '中电鸿信信息科技有限公司',
legalRepresentative: '沈宇',
creditCode: '91320000668382125',
rating: 'D',
expiredDocs: []
},
{
name: '中电鸿信信息科技有限公司',
legalRepresentative: '沈宇',
creditCode: '91320000668382125',
rating: 'D',
expiredDocs: []
},
{
name: '中电鸿信信息科技有限公司',
legalRepresentative: '沈宇',
creditCode: '91320000668382125',
rating: 'D',
expiredDocs: []
}
]
total: 0,
enterpriseList: []
}
},
@ -229,8 +145,12 @@ export default {
methods: {
//
getList() {
// API
console.log('获取企业列表')
listAPI(this.queryParams).then(res => {
if(res.code === 200){
this.enterpriseList = res.rows;
this.total = res.total;
}
})
},
//
@ -251,7 +171,27 @@ export default {
name: 'EnterpriseForm',
query: {
type: encryptWithSM4('add'),
id: encryptWithSM4(''),
enterpriseId: encryptWithSM4(''),
}
})
},
//
handleEdit(item){
this.$router.push({
name: 'EnterpriseForm',
query: {
type: encryptWithSM4('edit'),
enterpriseId: encryptWithSM4(item.enterpriseId + '' || '0'),
}
})
},
//
handleDetail(enterprise){
this.$router.push({
name: 'EnterpriseDetail',
query: {
type: encryptWithSM4('detail'),
enterpriseId: encryptWithSM4(enterprise.enterpriseId + '' || '0'),
}
})
},
@ -266,16 +206,7 @@ export default {
})
},
//
handleDetail(enterprise){
this.$router.push({
name: 'EnterpriseDetail',
query: {
type: encryptWithSM4('detail'),
id: encryptWithSM4(enterprise.id ?? '0'),
}
})
},
//
handleSizeChange(val) {