jinlin
2024-10-22 26ebef24f023a80f5be5ff27c93585f70688f6ee
web/src/views/modules/taskReliability/PlanMake.vue
@@ -3,12 +3,12 @@
    <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="已知规定值">
      <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>
          <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="最低可接受值">
      <el-table-column align="center" prop="minAccepValue" label="检验下限">
        <template v-slot="{ row }">
          <el-input v-model="row.minAccepValue" style="width:100%"></el-input>
        </template>
@@ -37,7 +37,7 @@
      </el-table-column>
      <el-table-column align="center" width="100" label="操作">
        <template v-slot="{ row }">
          <el-button type="primary" @click="check(row)">查询</el-button>
          <el-button type="primary" @click="check(row)">{{row.btnName}}</el-button>
        </template>
      </el-table-column>
    </el-table>
@@ -47,7 +47,7 @@
      </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 v-if="isShow" align="center" prop="specifiedValue" label="检验上限">
      </el-table-column>
      <el-table-column align="center" prop="productionRiskReal" label="生产方风险实际值(%)">
      </el-table-column>
@@ -69,6 +69,7 @@
        isShow: false,
        tjDataList: [{
          tjlx: '按风险名义值查询',
          btnName: '查询一',
          specifiedValue: null,
          minAccepValue: null,
          productionRisk: null,
@@ -77,19 +78,21 @@
        },
          {
            tjlx: '不限定生产方风险查询',
            btnName: '查询二',
            specifiedValue: null,
            minAccepValue: null,
            productionRisk: null,
            userRisk: null,
            showFailureTime: null
            showFailureTime: 10
          },
          {
            tjlx: '不限定规定值查询',
            tjlx: '不限定检验上限查询',
            btnName: '查询三',
            specifiedValue: null,
            minAccepValue: null,
            productionRisk: null,
            userRisk: null,
            showFailureTime: null
            showFailureTime: 10
          }
        ],
        riskList: [
@@ -132,35 +135,38 @@
    methods: {
      async check(row) {
        let flag = true;
        if (row.specifiedValue < row.minAccepValue && row.specifiedValue) {
          this.$tip.alert("最低可接受值不能大于规定值")
          flag =false
        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) {
        if (row.tjlx === "按风险名义值查询") {
          if (!row.specifiedValue || !row.minAccepValue || !row.productionRisk || !row.userRisk) {
            this.$tip.alert("有未填写的值")
            flag =false
            flag = false
          }
        }
        if (row.tjlx === "不限定生产方风险查询"){
          if (!row.specifiedValue ||!row.minAccepValue || !row.showFailureTime||!row.userRisk) {
        if (row.tjlx === "不限定生产方风险查询") {
          if (!row.specifiedValue || !row.minAccepValue || !row.showFailureTime || !row.userRisk) {
            this.$tip.alert("有未填写的值")
            flag =false
            flag = false
          }
        }
        if (row.tjlx === "不限定规定值查询"){
          if (!row.showFailureTime ||!row.minAccepValue || !row.productionRisk||!row.userRisk) {
        if (row.tjlx === "不限定检验上限查询") {
          if (!row.showFailureTime || !row.minAccepValue || !row.productionRisk || !row.userRisk) {
            this.$tip.alert("有未填写的值")
            flag =false
            flag = false
          }
        }
        if (!flag){
        if (!flag) {
          return
        }
        let res = await this.$http.get(`/TestScheme/TestScheme/condition`, {params: row})
        this.dataList = res.data
        if (row.tjlx === "不限定规定值查询") {
        if (row.tjlx === "不限定检验上限查询") {
          this.isShow = true
        } else {
          this.isShow = false
        }
      }
    }