jinlin
2024-04-01 652ec7d6dfdee121704961847fae3a3a5be3f5b6
web/src/views/modules/taskReliability/TaskPhase.vue
@@ -10,6 +10,7 @@
        <div class="mod-taskReliability-taskPhase fa-card-a" style="margin-left: 5px;margin-right: 5px;">
          <zt-table-wraper ref="tableObj" defaultNotQuery="true" query-url="/taskReliability/TaskPhase/page"
                           delete-url="/taskReliability/TaskPhase/"
                           @dataLoaded="dataLoaded"
                           :paging='false' v-slot="{ table }">
            <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()">
              <el-form-item>
@@ -18,10 +19,11 @@
              </el-form-item>
            </el-form>
            <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" v-adaptive="{bottomOffset:30}"
                       @row-click="selectPhase" @selection-change="table.selectionChangeHandle">
                      @row-click="selectPhase" @selection-change="table.selectionChangeHandle">
              <el-table-column type="selection" width="40" align="center"/>
              <el-table-column prop="phaseName" label="任务阶段名称"/>
              <el-table-column prop="phaseDuration" label="阶段时长"/>
              <el-table-column prop="phaseDurationRate" label="阶段时长比"/>
              <el-table-column prop="phaseSpeed" label="阶段时速"/>
              <el-table-column prop="phaseSort" label="阶段顺序"/>
              <zt-table-column-handle :table="table"
@@ -33,7 +35,7 @@
        </div>
      </el-col>
      <el-col :span="7">
          <task-phase-model ref="model"/>
        <task-phase-model ref="model"/>
      </el-col>
    </el-row>
  </div>
@@ -50,7 +52,9 @@
        dataForm: {
          taskId: '',
          productId: ''
        }
        },
        dataList: [],
        time: null
      }
    },
    components: {
@@ -59,10 +63,22 @@
      AddOrUpdate
    },
    methods: {
      dataLoaded(data) {
        this.time = null
        this.dataList = data
        for (let i = 0; i < this.dataList.length; i++) {
          this.time = this.time + Number(this.dataList[i].phaseDurationRate)
        }
        console.log( this.time,'dataLoaded')
        if (this.time>1){
          this.$alert("当前运行时长比已超出,请重新设置")
        }
      },
      add() {
        this.$refs.AddOrUpdate.$refs.dialog.init(null, {
          taskId: this.dataForm.taskId,
          productId: this.dataForm.productId
          productId: this.dataForm.productId,
          time: this.time
        })
      },
      onTaskSelected(row) {