修改数字提交逻辑处理

master
于肖磊 2025-07-18 18:21:57 +08:00
parent 6842ce0bc0
commit f7375d4421
2 changed files with 8 additions and 16 deletions

View File

@ -247,12 +247,6 @@ export default {
}
},
watch: {
propValue: {
handler(newVal) {
this.init();
},
deep: true
},
propKey(val) {
this.init();
}

View File

@ -82,10 +82,11 @@
});
},
blur_input(e){
let num = '';
if (!isEmpty(e.detail.value)) {
let all_list = e.detail.value.replace(/[^0-9.]/g, '');
// .
let num = Number(formatNumber(all_list, false)).toFixed(this.decimal_num);
num = Number(formatNumber(all_list, false)).toFixed(this.decimal_num);
//
if (this.format == 'num' && this.is_thousandths_symbol == '1') {
// ..
@ -96,16 +97,13 @@
}
num = formatNumber(Number(formatNumber(all_list, false)).toFixed(this.decimal_num).toString(), true)
}
this.data_check(num);
this.setData({
form_value: num,
});
} else {
this.setData({
form_value: '',
});
this.data_check('');
}
this.data_check(num);
this.setData({
form_value: num,
});
this.$emit('dataChange', { value: num, id: this.propDataId });
},
data_check(val) {
const { is_error = '0', error_text = '' } = get_format_checks(this.com_data, val, true, 'number');