bug修复

This commit is contained in:
LHD_HY 2025-11-26 17:56:45 +08:00
parent 7b20aec4fd
commit 14f8ebe30a
14 changed files with 209 additions and 112 deletions

View File

@ -653,6 +653,20 @@ export const dynamicRoutes = [
}
]
},
{
path: '/analysisRule',
component: Layout,
hidden: true,
permissions: ['analysis:rule:list'],
children: [
{
path: 'index',
component: () => import('@/views/template/templateInfo/components/AnalysisRule'),
name: 'AnalysisRule',
meta: { title: '解析规则', activeMenu: '/template', noCache: true }
}
]
},
]
// 防止连续点击多次路由报错

View File

@ -133,7 +133,6 @@ export default {
formData.files.push(...statementFiles) //
}
console.log('123',formData.files)
//
if (financialStatementData.delFileList && financialStatementData.delFileList.length) {
@ -141,10 +140,9 @@ export default {
}
if (this.type === 'add') {
console.log('asdad',formData)
await addFinance(formData)
} else {
console.log('年份编辑',formData)
console.log('编辑内容',formData)
await updateFinance(formData)
}

View File

@ -40,7 +40,7 @@
placeholder="文件上传后自动提取"
class="form-control"
show-word-limit
maxlength="32"
maxlength="64"
></el-input>
</el-form-item>
</el-col>
@ -86,7 +86,8 @@ export default {
},
rules: {
fileList: [
{ required: true, message: '请上传财务报告附件', trigger: 'change' }
{ required: true, message: '请上传财务报告附件', trigger: 'change' },
{ type: 'string', max: 64, message: '长度不能超过64个字符', trigger: 'blur' },
],
fileName: [
{ required: true, message: '文件名需等待文件上传后自动提取', trigger: 'blur' }
@ -116,13 +117,8 @@ export default {
methods: {
handleUploadFail() {
//
this.formData.fileName = '';
this.formData.reportYear = '';
},
handleDocxContent(text) {
@ -176,7 +172,7 @@ export default {
setFormData(data) {
// uid
//
const financeFiles = Array.isArray(data.fileList)
? data.fileList.filter(file => file && file.businessType === 'finance_report')
.map(file => ({

View File

@ -40,6 +40,7 @@
class="form-control auto-input"
show-word-limit
maxlength="16"
@input="handleNumberInput('operatingIncome', 2)"
></el-input>
</el-form-item>
</el-col>
@ -51,6 +52,7 @@
class="form-control auto-input"
show-word-limit
maxlength="16"
@input="handleNumberInput('currentAssets', 2)"
></el-input>
</el-form-item>
</el-col>
@ -62,6 +64,7 @@
class="form-control auto-input"
show-word-limit
maxlength="16"
@input="handleNumberInput('currentLiabilities', 2)"
></el-input>
</el-form-item>
</el-col>
@ -76,6 +79,7 @@
class="form-control auto-input"
show-word-limit
maxlength="16"
@input="handleNumberInput('currentRatio', 2)"
></el-input>
</el-form-item>
</el-col>
@ -87,8 +91,7 @@
class="form-control auto-input"
show-word-limit
maxlength="16"
:precision="2"
@change="handleNumberInput('netProfit')"
@input="handleNumberInput('netProfit', 2)"
></el-input>
</el-form-item>
</el-col>
@ -100,6 +103,7 @@
class="form-control auto-input"
show-word-limit
maxlength="16"
@input="handleNumberInput('shareholdersEquity', 2)"
></el-input>
</el-form-item>
</el-col>
@ -114,6 +118,7 @@
class="form-control auto-input"
show-word-limit
maxlength="16"
@input="handleNumberInput('returnOnNetAssets', 2)"
></el-input>
</el-form-item>
</el-col>
@ -125,6 +130,8 @@
class="form-control auto-input"
show-word-limit
maxlength="16"
@input="handleNumberInput('totalLiabilities', 2)"
></el-input>
</el-form-item>
</el-col>
@ -134,10 +141,9 @@
v-model="formData.totalAssets"
placeholder="自动提取"
class="form-control auto-input"
:precision="2"
@change="handleNumberInput('totalAssets')"
show-word-limit
maxlength="16"
@input="handleNumberInput('totalAssets', 2)"
></el-input>
</el-form-item>
</el-col>
@ -152,6 +158,8 @@
class="form-control auto-input"
show-word-limit
maxlength="16"
@input="handleNumberInput('assetLiabilityRatio', 2)"
></el-input>
</el-form-item>
</el-col>
@ -204,37 +212,47 @@ export default {
{ required: true, message: '请上传财务报表附件', trigger: 'change' }
],
operatingIncome: [
{ required: true, message: '营业收入为必填项', trigger: 'change' }
{ required: true, message: '营业收入为必填项', trigger: 'change' },
{ type: 'string', max: 16, message: '长度不能超过16个字符', trigger: 'blur' },
],
netProfit: [
{ required: true, message: '净利润为必填项', trigger: 'change' }
{ required: true, message: '净利润为必填项', trigger: 'change' },
{ type: 'string', max: 16, message: '长度不能超过16个字符', trigger: 'blur' },
],
returnOnNetAssets: [
{ required: true, message: '净资产收益率为必填项', trigger: 'change' },
{ pattern: /^\d+(\.\d+)?%?$/, message: '请输入有效的净资产收益率如1或1%', trigger: 'blur' }
{ pattern: /^\d+(\.\d+)?%?$/, message: '请输入有效的净资产收益率如1或1%', trigger: 'blur' },
{ type: 'string', max: 16, message: '长度不能超过16个字符', trigger: 'blur' },
],
currentAssets: [
{ required: true, message: '流动资产为必填项', trigger: 'blur' }
{ required: true, message: '流动资产为必填项', trigger: 'blur' },
{ type: 'string', max: 16, message: '长度不能超过16个字符', trigger: 'blur' },
],
currentLiabilities: [
{ required: true, message: '流动负债为必填项', trigger: 'blur' }
{ required: true, message: '流动负债为必填项', trigger: 'blur' },
{ type: 'string', max: 16, message: '长度不能超过16个字符', trigger: 'blur' },
],
currentRatio: [
{ required: true, message: '流动比率为必填项', trigger: 'blur' },
{ pattern: /^\d+(\.\d+)?%?$/, message: '请输入有效的流动比率如1或1%', trigger: 'blur' }
{ pattern: /^\d+(\.\d+)?%?$/, message: '请输入有效的流动比率如1或1%', trigger: 'blur' },
{ type: 'string', max: 16, message: '长度不能超过16个字符', trigger: 'blur' },
],
shareholdersEquity: [
{ required: true, message: '股东权益为必填项', trigger: 'blur' }
{ required: true, message: '股东权益为必填项', trigger: 'blur' },
{ type: 'string', max: 16, message: '长度不能超过16个字符', trigger: 'blur' },
],
totalLiabilities: [
{ required: true, message: '负债总额为必填项', trigger: 'blur' }
{ required: true, message: '负债总额为必填项', trigger: 'blur' },
{ type: 'string', max: 16, message: '长度不能超过16个字符', trigger: 'blur' },
],
totalAssets: [
{ required: true, message: '资产总额为必填项', trigger: 'blur' }
{ required: true, message: '资产总额为必填项', trigger: 'blur' },
{ type: 'string', max: 16, message: '长度不能超过16个字符', trigger: 'blur' },
],
assetLiabilityRatio: [
{ required: true, message: '资产负债率为必填项', trigger: 'blur' },
{ pattern: /^\d+(\.\d+)?%?$/, message: '请输入有效的资产负债率如1或1%', trigger: 'blur' }
{ pattern: /^\d+(\.\d+)?%?$/, message: '请输入有效的资产负债率如1或1%', trigger: 'blur' },
{ type: 'string', max: 16, message: '长度不能超过16个字符', trigger: 'blur' },
]
},
isReplacingFile: false //
@ -517,10 +535,39 @@ export default {
* 处理数字输入框的change事件确保格式正确
* @param {string} fieldName - 表单字段名
*/
handleNumberInput(fieldName) {
this.formData[fieldName] = this.formatToTwoDecimalPlaces(this.formData[fieldName]);
}
handleNumberInput(fieldName, decimalPlaces) {
let value = this.formData[fieldName];
if (value === null || value === undefined) {
value = '';
}
// 1.
// % /[^\d.%]/g
value = value.toString().replace(/[^\d.]/g, '');
// 2.
const parts = value.split('.');
if (parts.length > 2) {
value = parts[0] + '.' + parts.slice(1).join('');
}
// 3.
if (decimalPlaces > 0 && parts.length === 2) {
value = parts[0] + '.' + parts[1].substring(0, decimalPlaces);
} else if (decimalPlaces === 0) {
//
value = parts[0];
}
// 4. maxlength (16)
if (value.length > 16) {
value = value.substring(0, 16);
}
// 5. v-model
this.formData[fieldName] = value;
},
}
}
</script>

View File

@ -81,6 +81,7 @@
<script>
import UploadFile from '@/views/common/UploadFile.vue'
import {convertChineseDate} from '@/utils/bonus'
export default {
name: 'CompletionAndBidInfo',
@ -237,7 +238,11 @@ export default {
Object.keys(chatRes).forEach(key => {
const field = this.ocrResultParams[key]
if (field && chatRes[key]) {
this.formData[field] = chatRes[key]
if (field === 'completionTime' || field === 'startTime') {
this.formData[field] = convertChineseDate(chatRes[key]);
} else {
this.formData[field] = chatRes[key];
}
}
})
this.$message.success('竣工信息识别成功,已自动填充')

View File

@ -38,7 +38,7 @@
placeholder="请输入项目名称"
class="form-control"
show-word-limit
maxlength="32"
maxlength="64"
@input="handleInputTest"
></el-input>
</el-form-item>
@ -115,6 +115,7 @@
<script>
import UploadFile from '@/views/common/UploadFile.vue'
import {convertChineseDate} from '@/utils/bonus'
export default {
name: 'ContractInfo',
components: { UploadFile },
@ -131,7 +132,7 @@ export default {
"合同金额": "contractAmount",
"建设地点": "constructionSite",
"建设单位": "constructionUnit",
"建设单位联系方式": "constructionPhone"
"建设单位电话": "constructionPhone"
},
formData: {
fileList: [],
@ -282,6 +283,9 @@ export default {
if (formField === 'contractAmount') {
value = value.replace(/[^\d.]/g, '')
}
if (formField === 'contractSigningTime') {
value = convertChineseDate(value);
}
this.formData[formField] = value
}
})

View File

@ -86,7 +86,7 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="建设单位联系方式">
<el-form-item label="建设单位电话">
<el-input
v-model="detailData.constructionPhone"
class="form-control"

View File

@ -1,5 +1,5 @@
<template>
<div class="app-container" :class="{ 'no-pointer-events': showUploadAnimation || showSaveAnimation }">
<div class="drawer-content-wrapper" :class="{ 'no-pointer-events': showUploadAnimation || showSaveAnimation }">
<!-- 文件上传动画 -->
<div v-if="showUploadAnimation" class="global-upload-animation">
<div class="animation-mask"></div>
@ -20,11 +20,14 @@
</div>
</div>
<div class="content-body">
<QualificationFormChild ref="qualificationFormChild" />
<!-- 可滚动的内容区域 -->
<div class="drawer-scrollable-content">
<div class="content-body">
<QualificationFormChild ref="qualificationFormChild" />
</div>
</div>
<!-- 操作栏 -->
<!-- 固定在底部的操作栏 -->
<div class="action-footer">
<el-button class="reset-btn" @click="$emit('cancel')" :disabled="showSaveAnimation">取消</el-button>
<el-button class="search-btn" @click="handleSave()" :loading="showSaveAnimation">保存</el-button>
@ -81,17 +84,12 @@ export default {
// 2. fileRes
const fileList = safeGetArray(formData.files);
const completeFiles = fileList.map(file => {
const fileRes = file.response?.fileRes || {};
return {
...fileRes,
businessType: 'qualification_certificate',
};
}).filter(Boolean); //
const completeFiles = fileList.map(file =>
file.response?.fileRes ? {...file.response.fileRes} : null
).filter(Boolean)
// 3.
const delFiles = [...new Set(safeGetArray(formData.delFileList))];
console.log('删除', delFiles)
// 4.
const submitData = {
@ -101,8 +99,6 @@ export default {
delFileList: undefined //
};
console.log('1123123',submitData.files)
// 5. /
if (this.type === 'add') {
await addDataAPI(submitData);
@ -205,15 +201,51 @@ export default {
</script>
<style scoped lang="scss">
.app-container {
// flex
.drawer-content-wrapper {
display: flex;
flex-direction: column;
height: 100%;
padding: 24px;
background: #fff;
min-height: 100%;
position: relative;
position: relative; //
}
//
.drawer-scrollable-content {
flex: 1;
overflow-y: auto;
padding-right: 12px; //
//
&::-webkit-scrollbar {
width: 6px;
}
&::-webkit-scrollbar-track {
background: #f5f5f5;
border-radius: 3px;
}
&::-webkit-scrollbar-thumb {
background: #c0c4cc;
border-radius: 3px;
&:hover {
background: #909399;
}
}
}
//
.action-footer {
display: flex;
justify-content: flex-end;
gap: 12px;
padding-top: 16px;
margin-top: 16px;
border-top: 1px solid #f5f5f5; // 线
flex-shrink: 0; //
}
.global-upload-animation {
position: fixed;
position: absolute; // drawer-content-wrapper
top: 0;
left: 0;
right: 0;
@ -292,7 +324,7 @@ export default {
}
.content-body {
padding-bottom: 50px;
padding-bottom: 20px; //
}
.content-row {
@ -312,16 +344,6 @@ export default {
min-width: 300px;
}
//
.action-footer {
position: absolute;
bottom: 24px;
right: 24px;
display: flex;
gap: 12px;
z-index: 20;
}
.search-btn {
background: #409EFF;
border-color: #409EFF;
@ -368,6 +390,11 @@ export default {
}
}
//
.no-pointer-events {
pointer-events: none;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }

View File

@ -99,6 +99,7 @@
<script>
import UploadFile from '@/views/common/UploadFile.vue'
import {convertChineseDate} from '@/utils/bonus'
//
const safeGetArray = (value) => Array.isArray(value) ? value : []
@ -201,24 +202,16 @@ export default {
//
setFormData(data) {
// 1.
const qualificationFiles = safeGetArray(data.fileList)
.filter(file => file && file.businessType === 'qualification_certificate')
.map(file => ({
...file,
uid: file.uid || Date.now() + Math.random().toString(36).substr(2, 9), // ID
name: file.fileName || file.name || '未命名文件',
lsFilePath: file.lsFilePath || file.fileUrl || '', //
filePath: file.filePath || file.uploadPath || '', //
status: 'success', //
//
response: {
fileRes: {
uploadPath: file.filePath || file.uploadPath || '',
filePath: file.filePath || file.uploadPath || ''
}
}
}));
const qualificationFiles = Array.isArray(data.fileList)
? data.fileList.filter(file => file && file.businessType === 'qualification_certificate')
.map(file => ({
name: file.name || file.fileName || '未知文件',
filePath: file.filePath,
lsFilePath: file.lsFilePath,
fileType: file.fileType,
businessType: 'qualification_certificate'
}))
: [];
// 2.
this.formData = {
...data,
@ -367,7 +360,12 @@ export default {
Object.keys(chat_res).forEach(key => {
const formField = this.ocrResultParams[key];
if (formField && chat_res[key]) {
this.formData[formField] = chat_res[key];
if (formField === 'certificateDate' || formField === 'certificateEndDate') {
//
this.formData[formField] = convertChineseDate(chat_res[key]);
} else {
this.formData[formField] = chat_res[key];
}
}
});
this.$message.success('OCR识别成功已自动填充证书信息');

View File

@ -140,7 +140,7 @@
direction="rtl"
size="40%"
:before-close="handleDrawerClose"
custom-class="custom-qualification-drawer"
custom-class="custom-qualification-drawer qualification-drawer"
>
<QualificationForm
ref="qualificationForm"
@ -160,7 +160,7 @@
direction="rtl"
size="40%"
:before-close="handleDetailDrawerClose"
custom-class="custom-qualification-drawer"
custom-class="custom-qualification-drawer qualification-drawer"
>
<QualificationDetailComp
ref="qualificationDetail"
@ -362,14 +362,35 @@ export default {
.app-container {
padding: 20px;
background: linear-gradient(180deg, #F1F6FF 20%, #E5EFFF 100%);
min-height: calc(100vh - 85px);
height: calc(100vh - 85px); /* 占满可视区高度,减去顶部导航栏高度 */
display: flex;
flex-direction: column;
overflow: hidden; /* 禁止整体页面滚动 */
}
// flex
::v-deep .qualification-drawer {
.el-drawer__header {
padding: 20px 24px;
border-bottom: 1px solid #f5f5f5;
.el-drawer__title {
font-size: 18px;
font-weight: 600;
color: #333;
}
}
.el-drawer__body {
padding: 0; //
display: flex;
flex-direction: column;
height: 100%; //
overflow: hidden; //
}
}
//
::v-deep .custom-qualification-drawer {
.el-drawer__body {
padding: 0;
background: #fff;
}
.el-drawer__header {
@ -460,24 +481,23 @@ export default {
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 24px;
margin-bottom: 30px;
max-height: calc(100vh - 280px);
overflow-y: auto;
margin-bottom: 20px; /* 与分页保持间距 */
padding: 20px 6px 20px 0px;
align-items: start;
flex: 1; /* 自动填充剩余高度 */
overflow-y: auto; /* 仅纵向滚动 */
overflow-x: hidden; /* 禁止横向滚动 */
/* 滚动条样式保持不变 */
&::-webkit-scrollbar {
width: 6px;
}
&::-webkit-scrollbar-track {
background: transparent;
}
&::-webkit-scrollbar-thumb {
background: rgba(0, 0, 0, 0.2);
border-radius: 3px;
&:hover {
background: rgba(0, 0, 0, 0.3);
}
@ -700,21 +720,4 @@ export default {
}
}
}
::v-deep .qualification-drawer {
.el-drawer__header {
padding: 20px 24px;
border-bottom: 1px solid #f5f5f5;
.el-drawer__title {
font-size: 18px;
font-weight: 600;
color: #333;
}
}
.el-drawer__body {
padding: 24px;
overflow-y: auto;
max-height: calc(100vh - 100px);
}
}
</style>

View File

@ -157,7 +157,7 @@ export default {
}
}).catch(error => {
this.loading.close()
this.$modal.msgError('操作失败:' + error)
this.$modal.msgError('废标项已存在')
})
}
})

View File

@ -309,8 +309,9 @@ export default {
<style scoped lang="scss">
.rejection-item-container {
height: calc(100vh - 84px);
overflow: hidden;
overflow: auto;
background: linear-gradient(180deg, #F1F6FF 20%, #E5EFFF 100%);
padding: 20px;
}
.back-container {

View File

@ -262,7 +262,6 @@ export default {
handleTreeNodeClick(data) {
const allNodeIds = this.collectAllNodeIds(data)
this.tableSendParams.nodeIds = allNodeIds //
console.log(666,this.tableSendParams.nodeIds)
this.$nextTick(() => {
this.handleQuery()
})

View File

@ -22,7 +22,7 @@
type="card"
class="file-tabs"
@tab-remove="handleRemoveTab"
@tab-click="handleTabChange"
v-on="isEditMode ? { 'tab-click': handleTabChange } : {}"
>
<el-tab-pane
v-for="(tab, index) in fileTabs"
@ -103,6 +103,11 @@ export default {
title: {
type: String,
default: '模板组成-项目文件'
},
isEditMode: {
type: Boolean,
default: false
}
},
data() {