|
@@ -4064,6 +4064,31 @@ export default {
|
|
|
// },
|
|
|
mixins: [echartMixins],
|
|
|
methods: {
|
|
|
+ /** 校验用户输入是否为数字 */
|
|
|
+ isNumberInput() {
|
|
|
+ let flag = true;
|
|
|
+ let inputNodes = document.getElementsByClassName("el-input__inner");
|
|
|
+ for (let i = 0; i < inputNodes.length; i++) {
|
|
|
+ let value = inputNodes[i].value;
|
|
|
+ if (value.indexOf("%") == -1 &&
|
|
|
+ value != this.reportData.reportDate &&
|
|
|
+ value != this.reportData.plantModeIs &&
|
|
|
+ value != this.analysisQueryParams.startDate &&
|
|
|
+ value != this.analysisQueryParams.endDate &&
|
|
|
+ value != this.chemicalChosen
|
|
|
+ ) {
|
|
|
+ if (isNaN(Number(value)) == true) {
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (flag == true) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ this.$message.info("输入值不合法,必须为数值类型。");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
/** 处理趋势图对话框对比指标change事件 */
|
|
|
handleAddChemicals() {
|
|
|
if (this.chemicalChosen != null && this.chemicalChosen != "") { // 选中对比指标
|
|
@@ -4283,6 +4308,9 @@ export default {
|
|
|
},
|
|
|
/** 确定修改按钮操作 */
|
|
|
handleConfirmUpdate(row) {
|
|
|
+ if (this.isNumberInput() == false) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
this.updating = false;
|
|
|
updateReport(this.reportData).then(response => {
|
|
|
if (response.code == 200) {
|