wente
2024-10-28 3b3521961c246eda35cde1fde685e3931f8af529
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
175
176
177
178
179
<template>
  <div class="fa-card-b">
    <el-table ref="table" :data="tjDataList" height="230px" border>
      <el-table-column align="center" prop="tjlx" 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==='不限定检验上限查询'"></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"
                     :disabled="row.tjlx==='不限定生产方风险查询'">
            <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">
            <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==='按风险名义值查询'"></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)">{{row.btnName}}</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="specifiedValue" 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: '按风险名义值查询',
          btnName: '查询一',
          specifiedValue: null,
          minAccepValue: null,
          productionRisk: null,
          userRisk: null,
          showFailureTime: null
        },
          {
            tjlx: '不限定生产方风险查询',
            btnName: '查询二',
            specifiedValue: null,
            minAccepValue: null,
            productionRisk: null,
            userRisk: null,
            showFailureTime: 10
          },
          {
            tjlx: '不限定检验上限查询',
            btnName: '查询三',
            specifiedValue: null,
            minAccepValue: null,
            productionRisk: null,
            userRisk: null,
            showFailureTime: 10
          }
        ],
        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;
        console.log(row)
        if (parseInt(row.specifiedValue) && parseInt(row.specifiedValue) < row.minAccepValue) {
          this.$tip.alert("检验下限不能大于检验上限")
          flag = false
        }
        if (row.tjlx === "按风险名义值查询") {
          if (!row.specifiedValue || !row.minAccepValue || !row.productionRisk || !row.userRisk) {
            this.$tip.alert("有未填写的值")
            flag = false
          }
        }
        if (row.tjlx === "不限定生产方风险查询") {
          if (!row.specifiedValue || !row.minAccepValue || !row.showFailureTime || !row.userRisk) {
            this.$tip.alert("有未填写的值")
            flag = false
          }
        }
        if (row.tjlx === "不限定检验上限查询") {
          if (!row.showFailureTime || !row.minAccepValue || !row.productionRisk || !row.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 === "不限定检验上限查询") {
          this.isShow = true
        } else {
          this.isShow = false
        }
      }
    }
  }
</script>
<style>
  .el-table .select-row {
    background: rgba(23, 179, 163, 0.2) !important;
  }
</style>