|
@@ -193,7 +193,7 @@
|
|
|
<span
|
|
|
v-if="dialogTitle == '新建工单' || fromList.taskName == '起草' || (fromList.taskName == '发起考核' && fromList.assessmentTemplate == '1')">
|
|
|
<el-input size="mini" type="text" :precision="0" v-model="scope.row.score"
|
|
|
- oninput="value=value.replace(/[^\d.]/g,'')"
|
|
|
+ @input="numDxsCheck(fromList.content1.tableData1[scope.$index], 1, 'score')"
|
|
|
@blur="onInputFocus1(scope.$index, scope.row.score)"></el-input>
|
|
|
</span>
|
|
|
<span v-else>{{ scope.row.score }}</span>
|
|
@@ -275,7 +275,7 @@
|
|
|
<span
|
|
|
v-if="dialogTitle == '新建工单' || fromList.taskName == '起草' || (fromList.taskName == '发起考核' && fromList.assessmentTemplate == '1')">
|
|
|
<el-input size="mini" type="text" :precision="0" v-model="scope.row.score"
|
|
|
- oninput="value=value.replace(/[^\d.]/g,'')"
|
|
|
+ @input="numDxsCheck(fromList.content1.tableData2[scope.$index], 1, 'score')"
|
|
|
@blur="onInputFocus2(scope.$index, scope.row.score)"></el-input>
|
|
|
</span>
|
|
|
<span v-else>{{ scope.row.score }}</span>
|
|
@@ -309,7 +309,7 @@
|
|
|
<span
|
|
|
v-if="dialogTitle == '新建工单' || fromList.taskName == '起草' || (fromList.taskName == '发起考核' && fromList.assessmentTemplate == '1')">
|
|
|
<el-input size="mini" type="text" :precision="0" v-model="scope.row.score"
|
|
|
- oninput="value=value.replace(/[^\d.]/g,'')"
|
|
|
+ @input="numDxsCheck(fromList.content1.tableData3[scope.$index], 1, 'score')"
|
|
|
@blur="onInputFocus3(scope.$index, scope.row.score)"></el-input>
|
|
|
</span>
|
|
|
<span v-else>{{ scope.row.score }}</span>
|
|
@@ -331,7 +331,7 @@
|
|
|
<span
|
|
|
v-if="dialogTitle == '新建工单' || fromList.taskName == '起草' || (fromList.taskName == '发起考核' && fromList.assessmentTemplate == '1')">
|
|
|
<el-input size="mini" type="text" :precision="0" v-model="scope.row.score"
|
|
|
- oninput="value=value.replace(/[^\d.]/g,'')"
|
|
|
+ @input="numDxsCheck(fromList.content1.tableData4[scope.$index], 1, 'score')"
|
|
|
@blur="onInputFocus4(scope.$index, scope.row.score)"></el-input>
|
|
|
</span>
|
|
|
<span v-else>{{ scope.row.score }}</span>
|
|
@@ -353,7 +353,7 @@
|
|
|
<span
|
|
|
v-if="dialogTitle == '新建工单' || fromList.taskName == '起草' || (fromList.taskName == '发起考核' && fromList.assessmentTemplate == '1')">
|
|
|
<el-input size="mini" type="text" :precision="0" v-model="scope.row.score"
|
|
|
- oninput="value=value.replace(/[^\d.]/g,'')"
|
|
|
+ @input="numDxsCheck(fromList.content1.tableData5[scope.$index], 1, 'score')"
|
|
|
@blur="onInputFocus5(scope.$index, scope.row.score)"></el-input>
|
|
|
</span>
|
|
|
<span v-else>{{ scope.row.score }}</span>
|
|
@@ -1447,16 +1447,15 @@ export default {
|
|
|
this.fromList.content1.tableData5.map((item, index) => {
|
|
|
a -= parseFloat(item.score)
|
|
|
})
|
|
|
- console.log(a);
|
|
|
}
|
|
|
- this.$set(this.fromList, 'currentScore', a)
|
|
|
+ Math.floor(a * 100) / 100
|
|
|
+ this.$set(this.fromList, 'currentScore', Math.floor(a * 100) / 100)
|
|
|
},
|
|
|
onInputFocus1(i, v) {
|
|
|
if (v == '') {
|
|
|
this.fromList.content1.tableData1.map((item, index) => {
|
|
|
if (i == index) {
|
|
|
item.score = 0
|
|
|
-
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -1566,16 +1565,67 @@ export default {
|
|
|
},
|
|
|
addNewHost1() {
|
|
|
this.fromList.content1.tableData1.push({
|
|
|
+ item: '',
|
|
|
+ detailed: '',
|
|
|
+ content: '',
|
|
|
+ principle: '',
|
|
|
+ deductMarks: '',
|
|
|
+ require: '',
|
|
|
show: true,
|
|
|
score: 0
|
|
|
})
|
|
|
},
|
|
|
addNewHost2() {
|
|
|
this.fromList.content1.tableData2.push({
|
|
|
+ item: '',
|
|
|
+ detailed: '',
|
|
|
+ content: '',
|
|
|
+ principle: '',
|
|
|
+ deductMarks: '',
|
|
|
+ require: '',
|
|
|
show: true,
|
|
|
score: 0
|
|
|
})
|
|
|
},
|
|
|
+ numDxsCheck(form, ws, key) {
|
|
|
+ // console.log(form);
|
|
|
+ // console.log(key);
|
|
|
+ if (key === undefined) {
|
|
|
+ key = "cost";
|
|
|
+ }
|
|
|
+ form[key] = form[key] + "";
|
|
|
+
|
|
|
+ //先把非数字的都替换掉,除了数字和.
|
|
|
+ form[key] = form[key].replace(/[^\d.]/g, "");
|
|
|
+ //必须保证第一个为数字而不是.
|
|
|
+ form[key] = form[key].replace(/^\./g, "");
|
|
|
+ //保证只有出现一个.而没有多个.
|
|
|
+ form[key] = form[key].replace(/\.{2,}/g, ".");
|
|
|
+ //保证.只出现一次,而不能出现两次以上
|
|
|
+ form[key] = form[key].replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
|
|
|
+
|
|
|
+ //只能输入4个小数
|
|
|
+ // let c = null;
|
|
|
+ let c = /^(\-)*(\d+)\.(\d{1}).*$/;
|
|
|
+ // switch (ws) {
|
|
|
+ // case 1:
|
|
|
+ // c = /^(\-)*(\d+)\.(\d).*$/;
|
|
|
+ // case 2:
|
|
|
+ // c = /^(\-)*(\d+)\.(\d\d).*$/;
|
|
|
+ // break;
|
|
|
+ // case 3:
|
|
|
+ // c = /^(\-)*(\d+)\.(\d\d\d).*$/;
|
|
|
+ // break;
|
|
|
+ // case 4:
|
|
|
+ // c = /^(\-)*(\d+)\.(\d\d\d\d).*$/;
|
|
|
+ // break;
|
|
|
+ // default:
|
|
|
+ // c = /^(\-)*(\d+)\.(\d\d).*$/;
|
|
|
+ // }
|
|
|
+ //只能输入两个小数
|
|
|
+ form[key] = form[key].replace(c, '$1$2.$3');
|
|
|
+ // console.log(form[key]);
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
}
|