jinlin
2024-03-19 b04b1f186c4250e6894823f990189950508d877d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<template>
  <div>
    <el-row :gutter="10">
      <el-col :span="6">
        <div class="fa-card-a">
          <task @onTaskSelected="onTaskSelected"/>
        </div>
      </el-col>
      <el-col :span="12">
        <div class="mod-taskReliability-taskPhase}">
          <zt-table-wraper ref="tableObj" defaultNotQuery="true" query-url="/taskReliability/TaskPhase/page"
                           delete-url="/taskReliability/TaskPhase/"
                           :paging='false' v-slot="{ table }">
            <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()">
              <el-form-item>
                <zt-button type="add" @click="add()"/>
                <zt-button type="delete" @click="table.deleteHandle()"/>
              </el-form-item>
            </el-form>
            <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" v-adaptive="{bottomOffset:70}"
                      border @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="phaseSpeed" label="阶段时速"/>
              <el-table-column prop="phaseSort" label="阶段顺序"/>
              <zt-table-column-handle :table="table"
                                      delete-perm="taskReliability::delete"/>
            </el-table>
            <!-- 弹窗, 新增 / 修改 -->
            <add-or-update @refreshDataList="table.query" ref="AddOrUpdate"/>
          </zt-table-wraper>
        </div>
      </el-col>
      <el-col :span="6">
        <div class="fa-card-a">
          <task-phase-model ref="model"/>
        </div>
      </el-col>
    </el-row>
  </div>
</template>
 
<script>
  import AddOrUpdate from './TaskPhase-AddOrUpdate'
  import Task from "./Task";
  import TaskPhaseModel from "./TaskPhaseModel";
 
  export default {
    data() {
      return {
        dataForm: {
          taskId: '',
          productId: ''
        }
      }
    },
    components: {
      TaskPhaseModel,
      Task,
      AddOrUpdate
    },
    methods: {
      add() {
        this.$refs.AddOrUpdate.$refs.dialog.init(null, {
          taskId: this.dataForm.taskId,
          productId: this.dataForm.productId
        })
      },
      onTaskSelected(row) {
        this.dataForm.taskId = row.id
        this.dataForm.productId = row.productId
        this.$refs.tableObj.query()
      },
      selectPhase(row) {
        this.$emit('selectPhase', row)
        let param = {
          row: row,
          productId: this.dataForm.productId
        }
        this.$refs.model.init(param)
      },
    }
  }
</script>