|
@@ -511,13 +511,8 @@
|
|
|
v-else
|
|
v-else
|
|
|
v-model="row.count"
|
|
v-model="row.count"
|
|
|
placeholder="请输入"
|
|
placeholder="请输入"
|
|
|
- @input="
|
|
|
|
|
- (value) =>
|
|
|
|
|
- (row.count = value.replace(
|
|
|
|
|
- /^(-)*(\d+)\.(\d\d\d\d\d\d).*$/,
|
|
|
|
|
- '$1$2.$3'
|
|
|
|
|
- ))
|
|
|
|
|
- "
|
|
|
|
|
|
|
+ style="width: 90px"
|
|
|
|
|
+ @input="handleInput(row)"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -1218,6 +1213,26 @@
|
|
|
console.log(this.unitList, 'this.unitList');
|
|
console.log(this.unitList, 'this.unitList');
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ handleInput(item) {
|
|
|
|
|
+ let newVal = item.count.replace(/[^\d.]/g, '');
|
|
|
|
|
+
|
|
|
|
|
+ // 2. 不能以点开头
|
|
|
|
|
+ if (newVal.startsWith('.')) {
|
|
|
|
|
+ newVal = '';
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 3. 只允许出现一个小数点
|
|
|
|
|
+ const firstDotIndex = newVal.indexOf('.');
|
|
|
|
|
+ if (firstDotIndex !== -1) {
|
|
|
|
|
+ newVal =
|
|
|
|
|
+ newVal.slice(0, firstDotIndex + 1) +
|
|
|
|
|
+ newVal.slice(firstDotIndex + 1).replace(/\./g, '');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 4. 更新数据
|
|
|
|
|
+ item.count = newVal;
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
async detailsList() {
|
|
async detailsList() {
|
|
|
console.log(this.rowData, 'this.rowData');
|
|
console.log(this.rowData, 'this.rowData');
|
|
|
await getDetailList({
|
|
await getDetailList({
|