loulijun2021
2023-05-30 c4cbb29fd3dd2f43da4f9af9967936edb86d1dcc
src/views/qualityManager/processCheckRecord.vue
@@ -178,6 +178,7 @@
    >
      <div class="elTableDiv">
        <el-table
          ref="tableDataRef2"
          :data="tableDataDialog"
          :height="(tableHeight-100)+'px'"
          border
@@ -199,63 +200,135 @@
            fixed
          />
          <el-table-column
            prop="checkitem_code"
            show-tooltip-when-overflow
            label="检验项目编号"
            width="120"
          />
          <!--          <el-table-column-->
          <!--            prop="checkitem_code"-->
          <!--            show-tooltip-when-overflow-->
          <!--            label="检验项目编号"-->
          <!--            width="120"-->
          <!--          />-->
          <el-table-column
            prop="checkitem_name"
            label="检验项目名称"
            fixed
            show-tooltip-when-overflow
          />
          <el-table-column
            prop="checkitem_descr"
            label="检验项目描述"
            show-tooltip-when-overflow
          />
          <el-table-column
            prop="check_result"
            label="检验结果"
            show-tooltip-when-overflow
            width="120"
          >
            <template slot-scope="{row}">
              <div v-if="row.check_result==='NG'">
                <i class="el-icon-info" style="margin-right: 2px" />
                不良
              </div>
              <div v-if="row.check_result==='OK'">
                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
                合格
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop="lm_user"
            label="检验人员"
            show-tooltip-when-overflow
            width="120"
          />
          <el-table-column
            prop="lm_date"
            label="检验时间"
            show-tooltip-when-overflow
            width="160"
          />
          <!--          <el-table-column-->
          <!--            label="操作"-->
          <!--            fixed="right"-->
          <!--            width="120"-->
          <!--          >-->
          <!--            <template slot-scope="{row}">-->
          <!--              <div class="operationClass">-->
          <!--                <el-button v-waves type="text" @click="check(row)">查看</el-button>-->
          <!--                &lt;!&ndash;                <el-button v-waves type="text" @click="del(row)">删除</el-button>&ndash;&gt;-->
          <!--              </div>-->
          <!--            </template>-->
          <!--          </el-table-column>-->
          <!--            prop="checkitem_descr"-->
          <!--            label="检验项目描述"-->
          <!--            show-tooltip-when-overflow-->
          <!--          />-->
          <el-table-column
            prop="standvalue"
            label="标准要求"
            fixed
            min-width="120"
            show-tooltip-when-overflow
          >
            <template slot-scope="{row}">
              <!--        ~当三个值都有    -->
              <div v-if="row.standvalue&&row.uppervalue&&row.lowervalue">{{ row.standvalue }}({{
                row.lowervalue
              }}~{{ row.uppervalue }})
              </div>
              <!--            ~当只有标准值和上限值时  -->
              <div v-else-if="row.standvalue&&row.uppervalue">{{ row.standvalue }}(~{{ row.uppervalue }})</div>
              <!--            ~当只有标准值和下限值时-->
              <div v-else-if="row.standvalue&&row.lowervalue">{{ row.standvalue }}({{ row.lowervalue }}~)</div>
              <!--            ~当只有上限值和下限值时-->
              <div v-else-if="row.uppervalue&&row.lowervalue">({{ row.lowervalue }}~{{ row.uppervalue }})</div>
              <!--            ~当只有标准值时     -->
              <div v-else-if="row.standvalue">{{ row.standvalue }}</div>
              <!--            ~当只有上限值时       -->
              <div v-else-if="row.uppervalue">(~{{ row.uppervalue }})</div>
              <!--            ~当只有下限值时      -->
              <div v-else-if="row.lowervalue">({{ row.lowervalue }}~)</div>
              <div v-else>/</div>
            </template>
          </el-table-column>
          <el-table-column
            v-for="(item,index) in dialogTableArrayCol"
            :key="item"
            :prop="(index+1)+'/'+ dialogTableNumberCol"
            :label="'第'+(index+1)+'件'"
            show-tooltip-when-overflow
            min-width="100"
          >
            <template slot-scope="{row}">
              <div style="display: flex;align-items: center">
                <i
                  :class="row.check_result==='OK'?'el-icon-success':'el-icon-error'"
                  :style="{color:row.check_result==='OK'?$store.state.settings.theme:'red'}"
                  style="margin-right: 2px"
                />
                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}
              </div>
              <!--            &lt;!&ndash;        ~当三个值都有    &ndash;&gt;-->
              <!--            <div v-if="row.standvalue&&row.uppervalue&&row.lowervalue&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])>=parseFloat(row.lowervalue)&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])<=parseFloat(row.uppervalue)">-->
              <!--              &lt;!&ndash;            <div v-if="row[(index + 1) + '/' + dialogTableNumberCol]>=row.lowervalue&&row[(index + 1) + '/' + dialogTableNumberCol]<=row.uppervalue">&ndash;&gt;-->
              <!--              <div style="display: flex;align-items: center">-->
              <!--                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />-->
              <!--                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}-->
              <!--              </div>-->
              <!--            </div>-->
              <!--            &lt;!&ndash;            ~当只有标准值和上限值时  &ndash;&gt;-->
              <!--            <div v-else-if="row.standvalue&&row.uppervalue&&row.lowervalue===''&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])<=parseFloat(row.uppervalue)">-->
              <!--              <div style="display: flex;align-items: center">-->
              <!--                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />-->
              <!--                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}-->
              <!--              </div>-->
              <!--            </div>-->
              <!--            &lt;!&ndash;            ~当只有标准值和下限值时&ndash;&gt;-->
              <!--            <div v-else-if="row.standvalue&&row.lowervalue&&row.uppervalue===''&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])>=parseFloat(row.lowervalue)">-->
              <!--              <div style="display: flex;align-items: center">-->
              <!--                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />-->
              <!--                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}-->
              <!--              </div>-->
              <!--            </div>-->
              <!--            &lt;!&ndash;            ~当只有上限值和下限值时&ndash;&gt;-->
              <!--            <div v-else-if="row.uppervalue&&row.lowervalue&&row.standvalue===''&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])>=parseFloat(row.lowervalue)&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])<=parseFloat(row.uppervalue)">-->
              <!--              <div style="display: flex;align-items: center">-->
              <!--                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />-->
              <!--                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}-->
              <!--              </div>-->
              <!--            </div>-->
              <!--            &lt;!&ndash;            ~当只有标准值时     &ndash;&gt;-->
              <!--            <div v-else-if="row.standvalue&&row.uppervalue===''&&row.lowervalue===''&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])===parseFloat(row.standvalue)">-->
              <!--              <div style="display: flex;align-items: center">-->
              <!--                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />-->
              <!--                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}-->
              <!--              </div>-->
              <!--            </div>-->
              <!--            &lt;!&ndash;            ~当只有上限值时       &ndash;&gt;-->
              <!--            <div v-else-if="row.uppervalue&&row.lowervalue===''&&row.standvalue===''&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])<=parseFloat(row.uppervalue)">-->
              <!--              <div style="display: flex;align-items: center">-->
              <!--                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />-->
              <!--                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}-->
              <!--              </div>-->
              <!--            </div>-->
              <!--            &lt;!&ndash;            ~当只有下限值时      &ndash;&gt;-->
              <!--            <div v-else-if="row.lowervalue&& row.uppervalue===''&&row.standvalue===''&&parseFloat(row[(index + 1) + '/' + dialogTableNumberCol])>=parseFloat(row.lowervalue)">-->
              <!--              <div style="display: flex;align-items: center">-->
              <!--                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />-->
              <!--                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}-->
              <!--              </div></div>-->
              <!--            <div v-else>-->
              <!--              <div style="display: flex;align-items: center">-->
              <!--                <i class="el-icon-error" style="color: red;margin-right: 2px" />-->
              <!--                {{ row[(index + 1) + '/' + dialogTableNumberCol] }}-->
              <!--              </div>-->
              <!--            </div>-->
            </template>
          </el-table-column>
        </el-table>
      </div>
      <span slot="footer" class="dialog-footer">
@@ -471,7 +544,9 @@
      tableDataDialog: [],
      title_value: '数据导入 / 点检部位',
      code: '4',
      shows: false
      shows: false,
      dialogTableNumberCol: 0, // 对话框动态的列数
      dialogTableArrayCol: []// 对话框动态的数组
    }
  },
@@ -542,10 +617,29 @@
    async check(row) {
      // this.operation = operation
      this.dialogVisible = true
      console.log(row, 1)
      const res = await StepCheckTableSubSearch({ id: row.id })
      this.tableDataDialog = res.data
      this.dialogVisible = true
      this.tableDataDialog.forEach((item, index) => {
        for (const it in item) {
          if (it.indexOf('/') !== -1) {
            const i = it.split('/')[1]
            this.dialogTableNumberCol = i
          }
        }
      })
      this.dialogTableArrayCol = []
      for (let i = 0; i < this.dialogTableNumberCol; i++) {
        this.dialogTableArrayCol.push(i)
      }
      this.$nextTick(() => {
        this.$refs.tableDataRef2.doLayout()
      })
    },
    // 新增按钮
@@ -586,11 +680,7 @@
    },
    // 对话框关闭事件
    handleClose() {
      this.dialogForm.OrgType = ''
      this.dialogForm.OrgCode = ''
      this.dialogForm.OrgName = ''
      this.dialogForm.SupUnit = ''
      this.$refs.dialogForm.clearValidate()
      this.tableDataDialog = []
    },
    // 对话框取消
    dialogVisibleCancel() {