jinlin
2024-04-09 4d2033854f0770dba993bff26ea09a0a523682fc
web/src/views/modules/taskReliability/TaskPhase.vue
@@ -27,8 +27,12 @@
              <el-table-column prop="phaseSpeed" label="阶段时速" align="right"/>
              <!--<el-table-column prop="phaseSort" label="阶段顺序" align="center"/>-->
              <el-table-column prop="operatConditDuration" label="工况时长分配" align="center"/>
              <zt-table-column-handle :table="table"
                                      delete-perm="taskReliability::delete"/>
              <zt-table-column-handle :table="table" edit-perm="testReviewComment:update"
                                      delete-perm="taskReliability::delete">
                <template v-slot="{row}">
                  <zt-table-button type="primary"  @click="openEditWin(row)">修改</zt-table-button>
                </template>
              </zt-table-column-handle>
            </el-table>
            <!-- 弹窗, 新增 / 修改 -->
            <add-or-update @refreshDataList="refreshData" ref="AddOrUpdate"/>
@@ -75,17 +79,24 @@
        for (let i = 0; i < this.dataList.length; i++) {
          this.time = this.time + Number(this.dataList[i].phaseDurationRate)
        }
        if (this.time>1){
          this.$alert("当前运行时长比已超出,请重新设置")
        }
        console.log(this.time)
      },
      add() {
        console.log(this.time)
        this.$refs.AddOrUpdate.$refs.dialog.init(null, {
          taskId: this.dataForm.taskId,
          productId: this.dataForm.productId,
          time: this.time
        })
      },
      openEditWin(row){
        console.log(row)
        this.$refs.AddOrUpdate.$refs.dialog.init(row.id, {
          taskId: this.dataForm.taskId,
          productId: this.dataForm.productId,
          time: this.time
        })
      },
      onTaskSelected(row) {
        this.dataForm.taskId = row.id
        this.dataForm.productId = row.productId