工地直转输入小数

This commit is contained in:
bb_pan 2025-09-24 15:58:46 +08:00
parent b48471f9d7
commit 9d0e1d5842
1 changed files with 7 additions and 2 deletions

View File

@ -295,10 +295,10 @@
v-model="scope.row.directNum" v-model="scope.row.directNum"
:value="scope.row.directNum || ''" :value="scope.row.directNum || ''"
controls-position="right" controls-position="right"
:precision="0" :precision="scope.row.unitValue == 1 ? 3 : 0"
style="width: 100%" style="width: 100%"
:disabled="isDetail || !scope.row.isActive" :disabled="isDetail || !scope.row.isActive"
:min="1" :min="scope.row.unitValue == 1 ? 0.001 : 1"
@change="directNumChange(scope.row)" @change="directNumChange(scope.row)"
></el-input-number> ></el-input-number>
</template> </template>
@ -915,6 +915,11 @@ export default {
// //
directNumChange(row) { directNumChange(row) {
if (row.unitValue == 1) {
row.directNum = Number(String(row.directNum).replace(/[^\d.]/g, ''))
} else {
row.directNum = Number(String(row.directNum).replace(/[^\d]/g, ''))
}
if (row.directNum > row.useNum) { if (row.directNum > row.useNum) {
this.$message.error('直转数量不能大于领料数量') this.$message.error('直转数量不能大于领料数量')
this.$nextTick(() => { this.$nextTick(() => {