From 4d2033854f0770dba993bff26ea09a0a523682fc Mon Sep 17 00:00:00 2001 From: jinlin <jinlin> Date: 星期二, 09 四月 2024 11:48:54 +0800 Subject: [PATCH] 修改 --- web/src/views/modules/taskReliability/TaskPhaseModel.vue | 23 +++++++++++++++-------- 1 files changed, 15 insertions(+), 8 deletions(-) diff --git a/web/src/views/modules/taskReliability/TaskPhaseModel.vue b/web/src/views/modules/taskReliability/TaskPhaseModel.vue index 2b9b5a8..516193a 100644 --- a/web/src/views/modules/taskReliability/TaskPhaseModel.vue +++ b/web/src/views/modules/taskReliability/TaskPhaseModel.vue @@ -13,8 +13,8 @@ v-adaptive="{bottomOffset:30}" border @cell-click="handleCellClick" @selection-change="table.selectionChangeHandle"> - <el-table-column prop="operatConditName" label="宸ュ喌鍚嶇О" width="160"/> - <el-table-column prop="operatConditDurationRate" label="鏃堕暱姣�" align="right" width="100"> + <el-table-column prop="operatConditName" label="宸ュ喌鍚嶇О" width="100"/> + <el-table-column prop="operatConditDurationRate" label="宸ュ喌鏃堕暱姣�" align="right" width="160"> <template slot-scope="scope"> <span v-if="editingCell && editingCell.row === scope.row && editingCell.column.property === scope.column.property"> @@ -67,10 +67,18 @@ //鎵归噺淇濆瓨 async handleSaveRows() { let time = null + let operatConditDurationRate = null let flag = true let list = [] + let reg = /^(-?\d+)\.?(\d*)$/; this.dataForm.dataThreeList = this.$refs.tableObj.dataList for (let i = 0; i < this.dataForm.dataThreeList.length; i++) { + operatConditDurationRate = this.dataForm.dataThreeList[i].operatConditDurationRate + console.log(operatConditDurationRate) + if (String(operatConditDurationRate).match(reg) == null && operatConditDurationRate !== null) { + this.$alert("杈撳叆鐨勬暟鎹牸寮忔湁璇�") + flag = false + } time = time + Number(this.dataForm.dataThreeList[i].operatConditDurationRate) if (this.dataForm.dataThreeList[i].isCheck === '0' && this.dataForm.dataThreeList[i].operatConditDurationRate != null) { this.$alert("鏈夋湭鍕鹃�夌殑宸ュ喌") @@ -79,17 +87,16 @@ this.$alert("鏈夋湭濉啓鐨勫伐鍐垫椂闀�") flag = false } - - if (this.dataForm.dataThreeList[i].isCheck==='1'){ + if (this.dataForm.dataThreeList[i].isCheck === '1') { list.push(this.dataForm.dataThreeList[i]) } } this.dataForm.dataThreeList = list - console.log(time, 'async handleSaveRows') - if (time> 1) { + /*console.log(time, 'async handleSaveRows') + if (time > 1) { this.$alert("璇烽噸鏂拌缃綋鍓嶆椂闀挎瘮鍒嗛厤") return - } + }*/ if (!flag) { return } @@ -100,7 +107,7 @@ this.originalData = null this.dataForm.dataThreeList = null this.$refs.tableObj.query() - this.$emit('getList') + this.$emit('getList') this.originalTableData = JSON.parse(JSON.stringify(this.dataList)); // 鏇存柊鍒濆鏁版嵁涓哄綋鍓嶆暟鎹� console.log(this.originalTableData, 'this.originalTableData 褰撳墠琛ㄦ牸json鏁版嵁') } -- Gitblit v1.9.1