输入框

This commit is contained in:
‘huanghaiixia’
2026-03-02 17:59:37 +08:00
parent 0501b3babc
commit a25d62807a
17 changed files with 85 additions and 95 deletions

View File

@ -85,10 +85,10 @@
<a-col :span="24">
<a-form-item label="开机方式" name="" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
<div style="display: flex;">
<div class="dot"><span style="background:#04F21C"></span>连运<a-input-number v-model:value="formState.powerCont" :class="diffResultList.includes('powerCont')?'changeStyle':''" :disabled="disable" :precision="0"/></div>
<div class="dot"><span style="background:#FFFF00"></span>调峰<a-input-number v-model:value="formState.powerPeak" :class="diffResultList.includes('powerPeak')?'changeStyle':''" :disabled="disable" :precision="0"/></div>
<div class="dot"><span style="background:#D9001B"></span>停机<a-input-number v-model:value="formState.powerStop" :class="diffResultList.includes('powerStop')?'changeStyle':''" :disabled="disable" :precision="0"/></div>
<div class="dot"><span style="background:#CA90FF"></span>其他<a-input-number v-model:value="formState.powerOther" :class="diffResultList.includes('powerOther')?'changeStyle':''" :disabled="disable" :precision="0"/></div>
<div class="dot"><span style="background:#04F21C"></span>连运<input-number v-model:value="formState.powerCont" :class="diffResultList.includes('powerCont')?'changeStyle':''" :disabled="disable" :min="0" :digits="0" style="width: 100px;margin: 0 5px"/></div>
<div class="dot"><span style="background:#FFFF00"></span>调峰<input-number v-model:value="formState.powerPeak" :class="diffResultList.includes('powerPeak')?'changeStyle':''" :disabled="disable" :min="0" :digits="0" style="width: 100px;margin: 0 5px"/></div>
<div class="dot"><span style="background:#D9001B"></span>停机<input-number v-model:value="formState.powerStop" :class="diffResultList.includes('powerStop')?'changeStyle':''" :disabled="disable" :min="0" :digits="0" style="width: 100px;margin: 0 5px"/></div>
<div class="dot"><span style="background:#CA90FF"></span>其他<input-number v-model:value="formState.powerOther" :class="diffResultList.includes('powerOther')?'changeStyle':''" :disabled="disable" :min="0" :digits="0" style="width: 100px;margin: 0 5px"/></div>
</div>
</a-form-item>
</a-col>
@ -128,15 +128,15 @@
</div>
</template>
<template v-if="column.dataIndex === 'qtyDemandGj'">
<a-input-number v-model:value="record.qtyDemandGj" v-if="!disable"
:formatter="value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')" :class="diffResultList.includes('lngPngDemandPurList[' + index + '].qtyDemandGj')?'changeStyle':''" :disabled="disable" :min="0" @blur="numBlur(record)" @change="numChange('qtyDemandGj', record)" style="width: 100%" />
<input-number v-model:value="record.qtyDemandGj" v-if="!disable"
:class="diffResultList.includes('lngPngDemandPurList[' + index + '].qtyDemandGj')?'changeStyle':''" :disabled="disable" :min="0" :digits="3" @blur="numBlur(record)" @change="numChange('qtyDemandGj', record)" style="width: 100%" />
<div v-else :class="diffResultList.includes('lngPngDemandPurList[' + index + '].qtyDemandGj')?'changeStyle':''">
{{ Number.format(Number.parse(record.qtyDemandGj ),numFormat)}}
</div>
</template>
<template v-if="column.dataIndex === 'qtyDemandM3'">
<a-input-number v-model:value="record.qtyDemandM3" v-if="!disable"
:formatter="value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')" :class="diffResultList.includes('lngPngDemandPurList[' + index + '].qtyDemandM3')?'changeStyle':''" :disabled="disable" :min="0" @blur="numBlur(record)" @change="numChange('qtyDemandM3', record)" style="width: 100%" />
<input-number v-model:value="record.qtyDemandM3" v-if="!disable"
:class="diffResultList.includes('lngPngDemandPurList[' + index + '].qtyDemandM3')?'changeStyle':''" :disabled="disable" :min="0" :digits="3" @blur="numBlur(record)" @change="numChange('qtyDemandM3', record)" style="width: 100%" />
<div v-else :class="diffResultList.includes('lngPngDemandPurList[' + index + '].qtyDemandM3')?'changeStyle':''">
{{ Number.format(Number.parse(record.qtyDemandM3 ),numFormat)}}
</div>
@ -224,8 +224,8 @@
})
function numBlur(record) {
record.qtyDemandM3 = record.qtyDemandM3 ? record.qtyDemandM3.toFixed(3) : ''
record.qtyDemandGj = record.qtyDemandGj ? record.qtyDemandGj.toFixed(3) : ''
// record.qtyDemandM3 = record.qtyDemandM3 ? record.qtyDemandM3.toFixed(3) : ''
// record.qtyDemandGj = record.qtyDemandGj ? record.qtyDemandGj.toFixed(3) : ''
}
async function numChange (k, record) {
if (k == 'qtyDemandGj') {
@ -418,4 +418,7 @@
.changeStyle {
color: red !important;
}
:deep(.changeStyle .ant-input) {
color: red !important;
}
</style>

View File

@ -113,18 +113,12 @@
</div>
</template>
<template v-if="column.dataIndex === 'qtySalesGj'">
<div v-if="record.alterSign=='D' || disable" :class="diffResultList.includes('lngPngApproPurList[' + index + '].qtySalesGj') ? 'changeStyle': ''">
{{ Number.format(Number.parse(record.qtySalesGj || 0),numFormat) }}
</div>
<a-input-number v-else :class="diffResultList.includes('lngPngApproPurList[' + index + '].qtySalesGj') ? 'changeStyle': ''"
v-model:value="record.qtySalesGj" :precision="3" :formatter="value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')" :disabled="record.alterSign=='D' || disable" :min="0" @change="numChange" style="width: 100%" />
<input-number :class="diffResultList.includes('lngPngApproPurList[' + index + '].qtySalesGj') ? 'changeStyle': ''"
v-model:value="record.qtySalesGj" :digits="3" :disabled="record.alterSign=='D' || disable" :min="0" @change="numChange" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'qtySalesM3'">
<div v-if="record.alterSign=='D' || disable" :class="diffResultList.includes('lngPngApproPurList[' + index + '].qtySalesM3') ? 'changeStyle': ''">
{{ Number.format(Number.parse(record.qtySalesM3 || 0),numFormat) }}
</div>
<a-input-number v-else :class="diffResultList.includes('lngPngApproPurList[' + index + '].qtySalesM3') ? 'changeStyle': ''"
v-model:value="record.qtySalesM3" :precision="3" :formatter="value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')" :disabled="record.alterSign=='D' || disable" :min="0" @change="numChange" style="width: 100%" />
<input-number :class="diffResultList.includes('lngPngApproPurList[' + index + '].qtySalesM3') ? 'changeStyle': ''"
v-model:value="record.qtySalesM3" :digits="3" :disabled="record.alterSign=='D' || disable" :min="0" @change="numChange" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'note'" >
<div v-if="record.alterSign=='D' || disable" :class="diffResultList.includes('lngPngApproPurList[' + index + '].note') ? 'changeStyle': ''">{{ record.note }}</div>
@ -237,4 +231,7 @@
.changeStyle {
color: red !important;
}
:deep(.changeStyle .ant-input) {
color: red !important;
}
</style>

View File

@ -28,14 +28,12 @@
{{ Number.format(Number.parse(record.qtySalesM3),numFormat) }}
</template>
<template v-if="column.dataIndex === 'qtyMeaGj'">
<a-input-number v-model:value="record.qtyMeaGj"
:precision="3" :formatter="value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
<input-number v-model:value="record.qtyMeaGj":digits="3"
v-if="record.statusCode==='N'|| record.statusCode==='JLZ'" @change="numChange(record, index)" :min="0" style="width: 100%" />
<div v-else>{{ Number.format(Number.parse(record.qtyMeaGj),numFormat) }}</div>
</template>
<template v-if="column.dataIndex === 'qtyMeaM3'">
<a-input-number v-model:value="record.qtyMeaM3"
:precision="3" :formatter="value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
<input-number v-model:value="record.qtyMeaM3" :digits="3"
v-if="record.statusCode==='N'|| record.statusCode==='JLZ'" @change="numChange(record, index)" :min="0" style="width: 100%" />
<div v-else>{{ Number.format(Number.parse(record.qtyMeaM3),numFormat) }}</div>
</template>

View File

@ -33,11 +33,11 @@
</template> -->
<template #bodyCell="{ column, record, index }">
<template v-if="column.dataIndex === 'qtyMeaGj'">
<a-input-number v-model:value="record.qtyMeaGj" v-if="statusCode==='N'|| statusCode==='JLZ'" @change="numChange(record)" :min="0" style="width: 100%" />
<input-number v-model:value="record.qtyMeaGj" v-if="statusCode==='N'|| statusCode==='JLZ'" @change="numChange(record)" :min="0" style="width: 100%" />
<div v-else>{{ record.qtyMeaGj }}</div>
</template>
<template v-if="column.dataIndex === 'qtyMeaM3'">
<a-input-number v-model:value="record.qtyMeaM3" v-if="statusCode==='N'|| statusCode==='JLZ'" @change="numChange(record)" :min="0" style="width: 100%" />
<input-number v-model:value="record.qtyMeaM3" v-if="statusCode==='N'|| statusCode==='JLZ'" @change="numChange(record)" :min="0" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'lngFileUploadList'">
<div>