备注、红绿功能优化
This commit is contained in:
@@ -228,7 +228,7 @@
|
||||
<el-input-number
|
||||
v-model="formData.drawingSetFactor"
|
||||
:min="0"
|
||||
:precision="4"
|
||||
:precision="2"
|
||||
:step="0.01"
|
||||
class="!w-1/1"
|
||||
controls-position="right"
|
||||
@@ -240,7 +240,7 @@
|
||||
<el-input-number
|
||||
v-model="formData.scaleFactor"
|
||||
:min="0"
|
||||
:precision="4"
|
||||
:precision="2"
|
||||
:step="0.01"
|
||||
class="!w-1/1"
|
||||
controls-position="right"
|
||||
@@ -254,7 +254,7 @@
|
||||
<el-input-number
|
||||
v-model="formData.modificationFactor"
|
||||
:min="0"
|
||||
:precision="4"
|
||||
:precision="2"
|
||||
:step="0.01"
|
||||
class="!w-1/1"
|
||||
controls-position="right"
|
||||
@@ -312,31 +312,49 @@
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="建筑类型" min-width="140" fixed="left">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.buildingType" maxlength="100" placeholder="建筑类型" />
|
||||
<el-tooltip
|
||||
:content="row.buildingType"
|
||||
:disabled="!hasValue(row.buildingType)"
|
||||
placement="top"
|
||||
>
|
||||
<el-input v-model="row.buildingType" maxlength="100" placeholder="建筑类型" />
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- 2. 取消 controls 的核心数值列 -->
|
||||
<el-table-column align="center" label="指导单价(元)" min-width="110">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
v-model="row.internalGuidanceUnitPrice"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
:controls="false"
|
||||
class="!w-1/1"
|
||||
/>
|
||||
<el-tooltip
|
||||
:content="formatAmountText(row.internalGuidanceUnitPrice)"
|
||||
:disabled="!hasValue(row.internalGuidanceUnitPrice)"
|
||||
placement="top"
|
||||
>
|
||||
<el-input-number
|
||||
v-model="row.internalGuidanceUnitPrice"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
:controls="false"
|
||||
class="!w-1/1"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="设计面积(m²)" min-width="110">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
v-model="row.designArea"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
:controls="false"
|
||||
class="!w-1/1"
|
||||
/>
|
||||
<el-tooltip
|
||||
:content="formatAmountText(row.designArea)"
|
||||
:disabled="!hasValue(row.designArea)"
|
||||
placement="top"
|
||||
>
|
||||
<el-input-number
|
||||
v-model="row.designArea"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
:controls="false"
|
||||
class="!w-1/1"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="楼栋/户型数" min-width="100">
|
||||
@@ -355,17 +373,17 @@
|
||||
<el-table-column label="调整系数配置" align="center">
|
||||
<el-table-column align="center" label="套图" min-width="85">
|
||||
<template #default="{ row }">
|
||||
<el-input-number v-model="row.drawingSetFactor" :min="0" :precision="4" :controls="false" class="!w-1/1" />
|
||||
<el-input-number v-model="row.drawingSetFactor" :min="0" :precision="2" :controls="false" class="!w-1/1" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="规模" min-width="85">
|
||||
<template #default="{ row }">
|
||||
<el-input-number v-model="row.scaleFactor" :min="0" :precision="4" :controls="false" class="!w-1/1" />
|
||||
<el-input-number v-model="row.scaleFactor" :min="0" :precision="2" :controls="false" class="!w-1/1" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="修改" min-width="85">
|
||||
<template #default="{ row }">
|
||||
<el-input-number v-model="row.modificationFactor" :min="0" :precision="4" :controls="false" class="!w-1/1" />
|
||||
<el-input-number v-model="row.modificationFactor" :min="0" :precision="2" :controls="false" class="!w-1/1" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="复杂(%)" min-width="90">
|
||||
@@ -412,9 +430,34 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" label="备注" min-width="130">
|
||||
<el-table-column align="left" label="备注" min-width="260">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.remark" maxlength="500" placeholder="备注信息" />
|
||||
<div class="remark-cell">
|
||||
<el-tooltip
|
||||
:disabled="!hasGuideDetailRemark(row.remark)"
|
||||
effect="dark"
|
||||
placement="top-start"
|
||||
popper-class="guide-remark-tooltip"
|
||||
>
|
||||
<template #content>
|
||||
<div class="remark-tooltip-content">{{ row.remark }}</div>
|
||||
</template>
|
||||
<div
|
||||
class="remark-preview"
|
||||
:class="{ 'is-empty': !hasGuideDetailRemark(row.remark) }"
|
||||
>
|
||||
{{ formatGuideDetailRemarkPreview(row.remark) }}
|
||||
</div>
|
||||
</el-tooltip>
|
||||
<el-button
|
||||
class="remark-edit-button !h-auto !p-0"
|
||||
link
|
||||
type="primary"
|
||||
@click="openGuideDetailRemarkDialog(row)"
|
||||
>
|
||||
{{ hasGuideDetailRemark(row.remark) ? '编辑' : '填写' }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" label="操作" width="70">
|
||||
@@ -526,6 +569,35 @@
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
|
||||
<Dialog v-model="remarkDialogVisible" title="指导价法明细备注" width="720">
|
||||
<el-descriptions v-if="activeRemarkRow" :column="2" border class="mb-16px">
|
||||
<el-descriptions-item label="序号">
|
||||
{{ activeRemarkRow.sortNo || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="设计部位">
|
||||
{{ activeRemarkRow.designPart || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="建筑类型">
|
||||
{{ activeRemarkRow.buildingType || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="考核产值(元)">
|
||||
{{ formatAmountText(getGuideDetailAssessmentOutputValue(activeRemarkRow)) }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-input
|
||||
v-model="remarkDraft"
|
||||
:autosize="{ minRows: 8, maxRows: 14 }"
|
||||
maxlength="500"
|
||||
placeholder="请输入备注,例如计价说明、图纸版本说明、附加系数说明等"
|
||||
show-word-limit
|
||||
type="textarea"
|
||||
/>
|
||||
<template #footer>
|
||||
<el-button type="primary" @click="saveGuideDetailRemark">确定</el-button>
|
||||
<el-button @click="remarkDialogVisible = false">取消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
@@ -619,6 +691,9 @@ const createFormData = (): PlanningApi.ProjectPlanningVO => ({
|
||||
|
||||
const formData = ref<PlanningApi.ProjectPlanningVO>(createFormData())
|
||||
const guideDetails = ref<GuideDetailRow[]>([])
|
||||
const remarkDialogVisible = ref(false)
|
||||
const activeRemarkRow = ref<GuideDetailRow>()
|
||||
const remarkDraft = ref('')
|
||||
|
||||
const planningStartYearValue = computed({
|
||||
get: () => (formData.value.planningStartYear ? String(formData.value.planningStartYear) : undefined),
|
||||
@@ -743,6 +818,28 @@ const resetGuideDetailSortNo = () => {
|
||||
}))
|
||||
}
|
||||
|
||||
const hasGuideDetailRemark = (remark?: string) => Boolean(remark && remark.trim())
|
||||
|
||||
const formatGuideDetailRemarkPreview = (remark?: string) => {
|
||||
if (!hasGuideDetailRemark(remark)) {
|
||||
return '暂无备注'
|
||||
}
|
||||
return remark!.trim()
|
||||
}
|
||||
|
||||
const openGuideDetailRemarkDialog = (row: GuideDetailRow) => {
|
||||
activeRemarkRow.value = row
|
||||
remarkDraft.value = row.remark || ''
|
||||
remarkDialogVisible.value = true
|
||||
}
|
||||
|
||||
const saveGuideDetailRemark = () => {
|
||||
if (activeRemarkRow.value) {
|
||||
activeRemarkRow.value.remark = remarkDraft.value
|
||||
}
|
||||
remarkDialogVisible.value = false
|
||||
}
|
||||
|
||||
const getGuideDetailTotalAdjustmentFactor = (row: GuideDetailRow) => {
|
||||
if (
|
||||
row.drawingSetFactor === undefined ||
|
||||
@@ -1157,4 +1254,45 @@ const submitForm = async () => {
|
||||
:deep(.text-primary) {
|
||||
color: var(--el-color-primary);
|
||||
}
|
||||
|
||||
.remark-cell {
|
||||
display: flex;
|
||||
min-height: 32px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.remark-preview {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
color: var(--el-text-color-regular);
|
||||
font-size: 13px;
|
||||
line-height: 20px;
|
||||
text-align: left;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.remark-preview.is-empty {
|
||||
color: var(--el-text-color-placeholder);
|
||||
}
|
||||
|
||||
.remark-edit-button {
|
||||
flex: none;
|
||||
}
|
||||
|
||||
:global(.guide-remark-tooltip) {
|
||||
max-width: 640px;
|
||||
}
|
||||
|
||||
:global(.guide-remark-tooltip .remark-tooltip-content) {
|
||||
max-height: 260px;
|
||||
overflow-y: auto;
|
||||
line-height: 22px;
|
||||
white-space: pre-line;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -407,10 +407,10 @@ const submitProfitForm = async () => {
|
||||
|
||||
const profitLossClass = (value?: number) => {
|
||||
if ((value || 0) > 0) {
|
||||
return 'text-[var(--el-color-success)] font-600'
|
||||
return 'text-[var(--el-color-danger)] font-600'
|
||||
}
|
||||
if ((value || 0) < 0) {
|
||||
return 'text-[var(--el-color-danger)] font-600'
|
||||
return 'text-[var(--el-color-success)] font-600'
|
||||
}
|
||||
return 'text-[var(--el-text-color-primary)]'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user