|
|
@@ -168,9 +168,8 @@
|
|
|
v-if="showArrange == '1'"
|
|
|
>
|
|
|
<el-input
|
|
|
- type="number"
|
|
|
:min="0"
|
|
|
- @input="limitation('qualifiedNumber')"
|
|
|
+ @input="limitation('qualifiedNumber', form.qualifiedNumber)"
|
|
|
@blur="quantityCalculation('qualifiedNumber')"
|
|
|
v-model="form.qualifiedNumber"
|
|
|
placeholder="请输入"
|
|
|
@@ -184,9 +183,8 @@
|
|
|
v-if="showArrange == '1'"
|
|
|
>
|
|
|
<el-input
|
|
|
- type="number"
|
|
|
:min="0"
|
|
|
- @input="limitation('noQualifiedNumber')"
|
|
|
+ @input="limitation('noQualifiedNumber', form.noQualifiedNumber)"
|
|
|
@blur="quantityCalculation('noQualifiedNumber')"
|
|
|
v-model="form.noQualifiedNumber"
|
|
|
placeholder="请输入"
|
|
|
@@ -511,9 +509,30 @@
|
|
|
});
|
|
|
},
|
|
|
// *** 只能输入大于0的数字
|
|
|
- limitation(val) {
|
|
|
- this.form[val] =
|
|
|
- this.form[val].replace(/[^\d]/g, '').replace(/^0+/, '') || '0';
|
|
|
+ limitation(val, num) {
|
|
|
+ let newVal = num.replace(/[^\d.]/g, '');
|
|
|
+
|
|
|
+ if (newVal.startsWith('.')) {
|
|
|
+ newVal = '';
|
|
|
+ }
|
|
|
+
|
|
|
+ const firstDotIndex = newVal.indexOf('.');
|
|
|
+ if (firstDotIndex !== -1) {
|
|
|
+ newVal =
|
|
|
+ newVal.slice(0, firstDotIndex + 1) +
|
|
|
+ newVal.slice(firstDotIndex + 1).replace(/\./g, '');
|
|
|
+ }
|
|
|
+
|
|
|
+ const match = newVal.match(/^(\d+)(\.\d{0,9})?/);
|
|
|
+ if (val == 'qualifiedNumber') {
|
|
|
+ this.form.qualifiedNumber = match ? match[0] : '';
|
|
|
+ }
|
|
|
+
|
|
|
+ if (val == 'noQualifiedNumber') {
|
|
|
+ this.form.noQualifiedNumber = match ? match[0] : '';
|
|
|
+ }
|
|
|
+ // this.form[val] =
|
|
|
+ // this.form[val].replace(/[^\d]/g, '').replace(/^0+/, '') || '0';
|
|
|
},
|
|
|
// *** 计算合格数 不合格数
|
|
|
quantityCalculation(e, noSetSampleList) {
|
|
|
@@ -710,7 +729,7 @@
|
|
|
},
|
|
|
//抽检需要重新计算
|
|
|
selectResult() {
|
|
|
- console.log(this.form.qualityMode,'this.form.qualityMode')
|
|
|
+ console.log(this.form.qualityMode, 'this.form.qualityMode');
|
|
|
if (this.form.qualityMode == 2) {
|
|
|
this.$emit('quantityAssignment');
|
|
|
}
|