基本配置修改 优化

This commit is contained in:
lizhenhua 2025-08-07 16:18:49 +08:00
parent aa81840f1c
commit f214efc8f7
1 changed files with 46 additions and 5 deletions

View File

@ -85,11 +85,23 @@
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
<el-table-column label="货品规格" align="center" prop="size" :show-overflow-tooltip="true">
</el-table-column>
<el-table-column label="采购数量" align="center" prop="purNum" :show-overflow-tooltip="true">
<!-- <el-table-column label="采购数量" align="center" prop="purNum" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-input v-model.number="scope.row.purNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.purNum=v.replace(/[^\d]/g,''))"/>
</template>
</el-table-column> -->
<el-table-column label="采购数量" align="center" prop="purNum" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-input
v-model.number="scope.row.purNum"
placeholder="请输入"
clearable
maxlength="11"
@input="(v) => limitDecimalInput(v, scope.row, 'purNum')"
/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="notes" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-input v-model="scope.row.notes" placeholder="请输入备注" maxlength="20" clearable/>
@ -268,6 +280,35 @@ export default {
},
},
methods: {
limitDecimalInput(value, row, key) {
//
let val = value.replace(/[^\d.]/g, '');
// 0
val = val.replace(/^0+(\d)/, '$1');
val = val.replace(/^\./, '');
//
val = val.replace('.', '#').replace(/\./g, '').replace('#', '.');
// 73
if (val.includes('.')) {
let [intPart, decPart] = val.split('.');
intPart = intPart.slice(0, 7);
decPart = decPart.slice(0, 3);
val = intPart + '.' + decPart;
} else {
val = val.slice(0, 7); // 7
}
// 9999999.999
const max = 9999999.999;
if (parseFloat(val) > max) {
val = max.toString();
}
row[key] = val;
},
//
jumpList() {
const obj = { path: "/foodManage/purchaseManage/goodsInquiryEdit" };