wente
2024-08-08 e5429b2cabdd39fa6de9193dd250788302f9be51
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<template>
  <div class="fa-card-b">
    <el-table ref="table" :data="tjDataList" height="230px" border>
      <el-table-column align="center" prop="tjlx" width="100" label="条件类型">
      </el-table-column>
      <el-table-column align="center" prop="specifiedValue" label="已知规定值">
        <template v-slot="{ row }">
          <el-input v-model="row.specifiedValue" style="width:100%" :disabled="row.tjlx==='条件3'"></el-input>
        </template>
      </el-table-column>
      <el-table-column align="center" prop="minAccepValue" label="最低可接受值">
        <template v-slot="{ row }">
          <el-input v-model="row.minAccepValue" style="width:100%"></el-input>
        </template>
      </el-table-column>
      <el-table-column align="center" prop="productionRisk" label="生产方风险">
        <template v-slot="{ row }">
          <el-select style="width: 100%" :value-key="key" v-model="row.productionRisk"
                     @change="onChange()" :disabled="row.tjlx==='条件2'">
            <el-option v-for="item in riskList" :key="item.value" :label="item.label"
                       :value="item.value"></el-option>
          </el-select>
        </template>
      </el-table-column>
      <el-table-column align="center" prop="userRisk" label="使用方风险">
        <template v-slot="{ row }">
          <el-select style="width: 100%" :value-key="key" v-model="row.userRisk"
                     @change="onChange()">
            <el-option v-for="item in riskList" :key="item.value" :label="item.label"
                       :value="item.value"></el-option>
          </el-select>
        </template>
      </el-table-column>
      <el-table-column align="center" prop="showFailureTime" label="故障接受值最大显示">
        <template v-slot="{ row }">
          <el-input v-model="row.showFailureTime" style="width:100%" :disabled="row.tjlx==='条件1'"></el-input>
        </template>
      </el-table-column>
      <el-table-column align="center" width="100" label="操作">
        <template v-slot="{ row }">
          <el-button type="primary" @click="check(row)">查询</el-button>
        </template>
      </el-table-column>
    </el-table>
 
    <el-table ref="tableObj" height="570px" :data="dataList" border v-adaptive="{bottomOffset:30}">
      <el-table-column align="center" prop="acceptNumber" label="故障接受值">
      </el-table-column>
      <el-table-column align="center" prop="totalTestTime" label="总试验时间(h)">
      </el-table-column>
      <el-table-column v-if="isShow" align="center" prop="number" label="规定值">
      </el-table-column>
      <el-table-column align="center" prop="productionRiskReal" label="生产方风险实际值(%)">
      </el-table-column>
      <el-table-column align="center" prop="userRiskReal" label="使用方风险实际值(%)">
      </el-table-column>
    </el-table>
  </div>
</template>
 
<script>
  import AddOrUpdate from './Task-AddOrUpdate'
  import TaskBinoParam from "./TaskBinoParam";
  import TaskRepairParam from "./TaskRepairParam";
 
  export default {
    data() {
      return {
        dataList: [],
        isShow: false,
        tjDataList: [{
          tjlx: '条件1',
          specifiedValue: null,
          minAccepValue: null,
          productionRisk: null,
          userRisk: null,
          showFailureTime: null
        },
          {
            tjlx: '条件2',
            specifiedValue: null,
            minAccepValue: null,
            productionRisk: null,
            userRisk: null,
            showFailureTime: null
          },
          {
            tjlx: '条件3',
            specifiedValue: null,
            minAccepValue: null,
            productionRisk: null,
            userRisk: null,
            showFailureTime: null
          }
        ],
        riskList: [
          {
            value: 0.1,
            label: '10%'
          }, {
            value: 0.2,
            label: '20%'
          }, {
            value: 0.3,
            label: '30%'
          }, {
            value: 0.4,
            label: '40%'
          }, {
            value: 0.5,
            label: '50%'
          }, {
            value: 0.6,
            label: '60%'
          }, {
            value: 0.7,
            label: '70%'
          }, {
            value: 0.8,
            label: '80%'
          }, {
            value: 0.9,
            label: '90%'
          }
        ],
 
      }
    },
    components: {},
    mounted() {
 
    },
    methods: {
      async check(row) {
        let flag = true;
        if (row.specifiedValue < row.minAccepValue && row.specifiedValue) {
          this.$tip.alert("最低可接受值不能大于规定值")
          flag =false
        }
        if (row.tjlx === "条件1"){
          if (!row.specifiedValue ||!row.minAccepValue || !row.productionRisk||!userRisk) {
            this.$tip.alert("有未填写的值")
            flag =false
          }
        }
        if (row.tjlx === "条件2"){
          if (!row.specifiedValue ||!row.minAccepValue || !row.showFailureTime||!row.userRisk) {
            this.$tip.alert("有未填写的值")
            flag =false
          }
        }
        if (row.tjlx === "条件3"){
          if (!row.showFailureTime ||!row.minAccepValue || !row.productionRisk||!userRisk) {
            this.$tip.alert("有未填写的值")
            flag =false
          }
        }
        if (!flag){
          return
        }
        let res = await this.$http.get(`/TestScheme/TestScheme/condition`, {params: row})
        this.dataList = res.data
        if (row.tjlx === "条件3") {
          this.isShow = true
        }
      }
    }
  }
</script>
<style>
  .el-table .select-row {
    background: rgba(23, 179, 163, 0.2) !important;
  }
</style>