From 08dfaa8824d174bae7a84f7f99a3db4d76542471 Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期六, 11 五月 2024 08:31:46 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 web/src/views/modules/taskReliability/TaskPhaseModel.vue |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/web/src/views/modules/taskReliability/TaskPhaseModel.vue b/web/src/views/modules/taskReliability/TaskPhaseModel.vue
index 00c182c..516193a 100644
--- a/web/src/views/modules/taskReliability/TaskPhaseModel.vue
+++ b/web/src/views/modules/taskReliability/TaskPhaseModel.vue
@@ -6,15 +6,15 @@
                      delete-url="/taskReliability/TaskPhaseModel/" v-slot="{ table }">
       <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()">
         <el-form-item>
-          <zt-button type="warning" @click="handleSaveRows">淇濆瓨</zt-button>
+          <zt-button v-if="dataForm.phaseId" type="warning" @click="handleSaveRows">淇濆瓨</zt-button>
         </el-form-item>
       </el-form>
       <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px"
                 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="宸ュ喌鏃堕暱姣�">
+        <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')
+        /*console.log(time, 'async handleSaveRows')
         if (time > 1) {
-          this.$alert("鏃堕暱姣斿拰宸茶秴杩囷紝璇烽噸鏂拌缃�")
+          this.$alert("璇烽噸鏂拌缃綋鍓嶆椂闀挎瘮鍒嗛厤")
           return
-        }
+        }*/
         if (!flag) {
           return
         }
@@ -100,6 +107,7 @@
           this.originalData = null
           this.dataForm.dataThreeList = null
           this.$refs.tableObj.query()
+          this.$emit('getList')
           this.originalTableData = JSON.parse(JSON.stringify(this.dataList)); // 鏇存柊鍒濆鏁版嵁涓哄綋鍓嶆暟鎹�
           console.log(this.originalTableData, 'this.originalTableData 褰撳墠琛ㄦ牸json鏁版嵁')
         }

--
Gitblit v1.9.1