啊鑫
5 天以前 97af26e2ad64d7974367df80a900c1f680bd19c5
pages/QC/RKJ/detail.vue
@@ -1,147 +1,254 @@
<template>
  <view>
    <view class="form-container">
      <form :modelValue="formData">
        <view class="form-group">
          <label class="form-label">项目名称:</label>
          <input class="form-input" disabled="true" type="text" v-model="formData.projName"/>
        </view>
        <view class="form-group">
          <label class="form-label">质量要求:</label>
          <input class="form-input" disabled="true" type="text" v-model="formData.itemMod"/>
        </view>
        <view class="form-group">
          <label class="form-label">检验方法:</label>
          <input class="form-input" disabled="true" type="text" v-model="formData.inspectionMethod"/>
        </view>
        <view class="form-group">
          <label class="form-label">使用仪表:</label>
          <input class="form-input" disabled="true" type="text" v-model="formData.usingInstruments"/>
        </view>
        <view class="form-group">
          <label class="form-label">检验数:</label>
          <input class="form-input" disabled="true" type="text" v-model="formData.levelNum"/>
        </view>
        <view class="form-group">
          <label class="form-label">检验标准编码:</label>
          <input class="form-input" disabled="true" type="text" v-model="formData.qsCode"/>
        </view>
        <view class="form-group">
          <label class="form-label">检验标准名称:</label>
          <input class="form-input" disabled="true" type="text" v-model="formData.qsName"/>
        </view>
        <view class="form-group">
          <label class="form-label">检验水平:</label>
          <input class="form-input" disabled="true" type="text" v-model="formData.fcheckLevel"/>
        </view>
        <view class="form-group">
          <label class="form-label">接收水平:</label>
          <input class="form-input" disabled="true" type="text" v-model="formData.facLevel"/>
        </view>
        <view class="form-group">
          <label class="form-label">下限:</label>
          <input class="form-input" disabled="true" type="text" v-model="formData.minValue"/>
        </view>
        <view class="form-group">
          <label class="form-label">标准值:</label>
          <input class="form-input" disabled="true" type="text" v-model="formData.standardValue"/>
        </view>
        <view class="form-group">
          <label class="form-label">上限:</label>
          <input class="form-input" disabled="true" type="text" v-model="formData.maxValue"/>
        </view>
        <view class="form-group">
          <label class="form-label">AC数:</label>
          <input class="form-input" disabled="true" type="text" v-model="formData.freQty - 1"/>
        </view>
        <view class="form-group">
          <label class="form-label">RE数:</label>
          <input class="form-input" disabled="true" type="text" v-model="formData.freQty"/>
        </view>
        <view class="form-group">
          <label class="form-label">不合格数:</label>
          <input class="form-input" disabled="true" type="text" v-model="formData.unqualified"/>
        </view>
        <view class="form-group">
          <label class="form-label">预览结果:</label>
          <input class="form-input" disabled="true" type="text" v-model="formData.result"/>
        </view>
        <view class="form-group">
          <label class="form-label">不合格描述:</label>
          <input class="form-input" disabled="true" type="text" v-model="formData.remarks"/>
        </view>
        <view class="form-group edit">
          <input class="form-input" style="color: red" disabled="true" type="text"
                 value="没有最大值和最小值时填写0(未通过检验)或1(通过检验)"/>
        </view>
        <view class="form-group edit">
          <label class="form-label">检测结果:</label>
          <input class="form-input" type="number" v-model="formData.fcheckResu"/>
        </view>
        <button type="primary" v-if="tableData.length < formData.levelNum" @click="submit">保存</button>
      </form>
  <view class="container">
    <!-- 头部 -->
    <view class="header">
      <view class="title">入库检验项目明细</view>
      <view class="order-number">当前检验单号: {{ formData.billNo }}</view>
    </view>
    <view>
      <img v-if="isShowImg" :src="base64Image" style="width:100%" @click="previewImage"/>
    <!-- 标签栏 -->
    <view class="tabs-container">
      <scroll-view :show-scrollbar="false" class="tabs-scroll" scroll-x="true">
        <view class="tabs">
          <view v-for="(tab, index) in tabs" :key="index" :class="{active: currentTab === index}" class="tab"
                @tap="switchTab(index, tab.id)">
            <view class="tab-text">{{ tab.projName || tab.fcheckItem || '项目' + (index + 1) }}</view>
          </view>
        </view>
      </scroll-view>
    </view>
    <view class="list-container">
      <uni-table ref="table" border emptyText="暂无更多数据">
        <uni-tr>
          <uni-th align="center" style="color: #FFFFFF;background-color: lightskyblue;">编号</uni-th>
          <uni-th align="center" style="color: #FFFFFF;background-color: lightskyblue;">判定标识</uni-th>
          <uni-th align="center" style="color: #FFFFFF;background-color: lightskyblue;">检验结果</uni-th>
          <uni-th width="150" align="center"
                  style="color: #FFFFFF;background-color: lightskyblue;">修改
          </uni-th>
        </uni-tr>
        <uni-tr v-for="(item, index) in tableData" :key="index">
          <uni-td align="center">
            {{ index + 1 }}
          </uni-td>
          <uni-td align="center">
            <input class="form-input" disabled="true" type="text" v-model="item.fstand"/>
          </uni-td>
          <uni-td align="center">
            <input class="form-input" disabled="true" type="text" v-model="item.fcheckResu"/>
          </uni-td>
          <uni-td>
            <view class="uni-group">
              <button type="warn" v-if="isNumber" @click="toDetail(item)">修改</button>
              <button type="warn" v-if="!isNumber" @click="numberEdit(item)">{{ editResult(item.fcheckResu) }}</button>
    <view class="tab-content">
      <!-- 基本信息 -->
      <view class="section">
        <view class="section-header">项目信息</view>
        <view class="section-body">
          <view class="info-grid">
            <view class="info-item">
              <view class="info-label">项目名称</view>
              <view class="info-value">{{ formData.projName }}</view>
            </view>
          </uni-td>
        </uni-tr>
      </uni-table>
            <view class="info-item">
              <view class="info-label">质量要求</view>
              <view class="info-value">{{ formData.itemMod }}</view>
            </view>
            <view class="info-item">
              <view class="info-label">检验方法</view>
              <view class="info-value">{{ formData.inspectionMethod }}</view>
            </view>
            <view class="info-item">
              <view class="info-label">使用仪表</view>
              <view class="info-value">{{ formData.usingInstruments }}</view>
            </view>
            <view class="info-item">
              <view class="info-label">检验数</view>
              <view class="info-value">{{ formData.levelNum }}</view>
            </view>
            <view class="info-item">
              <view class="info-label">检验标准编码</view>
              <view class="info-value">{{ formData.qsCode }}</view>
            </view>
          </view>
        </view>
      </view>
      <!-- 检验标准 -->
      <view class="section">
        <view class="section-header">检验标准</view>
        <view class="section-body">
          <view class="info-grid">
            <view class="info-item">
              <view class="info-label">检验标准名称</view>
              <view class="info-value">{{ formData.qsName }}</view>
            </view>
            <view class="info-item">
              <view class="info-label">检验水平</view>
              <view class="info-value">{{ formData.fcheckLevel }}</view>
            </view>
            <view class="info-item">
              <view class="info-label">接收水平</view>
              <view class="info-value">{{ formData.facLevel }}</view>
            </view>
            <view v-if="formData.minValue" class="info-item">
              <view class="info-label">下限</view>
              <view class="info-value">{{ formData.minValue }}</view>
            </view>
            <view v-if="formData.standardValue" class="info-item">
              <view class="info-label">标准值</view>
              <view class="info-value">{{ formData.standardValue }}</view>
            </view>
            <view v-if="formData.maxValue" class="info-item">
              <view class="info-label">上限</view>
              <view class="info-value">{{ formData.maxValue }}</view>
            </view>
          </view>
        </view>
      </view>
      <!-- 结果信息 -->
      <view class="section">
        <view class="section-header">结果信息</view>
        <view class="section-body">
          <view class="info-grid">
            <view class="info-item">
              <view class="info-label">AC数</view>
              <view class="info-value">{{ formData.freQty ? (formData.freQty - 1) : '' }}</view>
            </view>
            <view class="info-item">
              <view class="info-label">RE数</view>
              <view class="info-value">{{ formData.freQty }}</view>
            </view>
            <view class="info-item">
              <view class="info-label">不合格数</view>
              <view class="info-value">{{ formData.unqualified }}</view>
            </view>
            <view class="info-item">
              <view class="info-label">预览结果</view>
              <view :class="{danger: formData.result === '不合格'}" class="info-value">{{ formData.result }}</view>
            </view>
          </view>
          <view v-if="formData.remarks" class="result-remarks">
            <view class="info-label">不合格描述</view>
            <view class="info-value danger">{{ formData.remarks }}</view>
          </view>
          <view v-if="!formData.maxValue || !formData.minValue" class="hint-text">
            <view class="danger">没有最大值和最小值时填写0(未通过检验)或1(通过检验)</view>
          </view>
        </view>
      </view>
      <!-- 检验结果录入 -->
      <view class="section">
        <view class="section-header">检验结果录入</view>
        <view class="section-body">
          <view class="input-group input1">
            <view class="input-wrapper">
              <button class="btn upload-btn" @tap="chooseImage">
                <uni-icons color="#fff" size="16" type="upload"></uni-icons>
                上传/查看图片
              </button>
              <button v-if="this.current" class="btn upload-btn" @tap="saveRemarks">
                <uni-icons color="#fff" size="16" type="compose"></uni-icons>
                不合格描述
              </button>
              <input v-if="(tableData.length < formData.levelNum)"
                     v-model="formData.fcheckResu" class="result-input" placeholder="请输入检验结果..."
                     type="text"/>
              <button v-if="(tableData.length < formData.levelNum)"
                      class="btn primary-btn"
                      style="margin: 0px;background-color: #3498db;color:#ffffff ;" @tap="submit">保存结果
              </button>
            </view>
          </view>
          <!-- 移动端适配的输入区 -->
          <view class="input-group input2">
            <view class="input-wrapper">
              <button class="btn upload-btn" @tap="chooseImage">
                <uni-icons color="#fff" size="16" type="upload"></uni-icons>
                上传/查看图片
              </button>
              <button v-if="this.current" class="btn upload-btn" @tap="saveRemarks">
                <uni-icons color="#fff" size="16" type="compose"></uni-icons>
                不合格描述
              </button>
            </view>
            <view class="input-wrapper" style="margin-top: 15px;">
              <input v-if="(tableData.length < formData.levelNum)"
                     v-model="formData.fcheckResu" class="result-input" placeholder="请输入检验结果..."
                     type="text"/>
              <button v-if="(tableData.length < formData.levelNum)"
                      class="btn primary-btn"
                      style="margin: 0px;background-color: #3498db;color:#ffffff ;" @tap="submit">保存结果
              </button>
            </view>
          </view>
        </view>
      </view>
      <!-- 结果表格 -->
      <view v-if="tableData.length>0" class="simple-table-container">
        <view class="simple-table-header">
          <view class="simple-title">检验记录 ({{ tableData.length }}/{{ formData.levelNum }})</view>
          <view :class="{'completed': !(tableData.length < formData.levelNum)}" class="simple-status">
            {{ tableData.length < formData.levelNum ? '进行中' : '已完成' }}
          </view>
        </view>
        <view class="simple-table">
          <view class="simple-header-row">
            <view class="simple-header-cell">编号</view>
            <view class="simple-header-cell">检验结果</view>
            <view v-if="current" class="simple-header-cell">操作</view>
          </view>
          <view v-for="(item, index) in tableData" :key="index" class="simple-data-row">
            <view class="simple-data-cell simple-index">
              {{ index + 1 }}
            </view>
            <view class="simple-data-cell simple-result">
              <!-- 数字结果样式 -->
              <view v-if="isNumber && !isNaN(parseFloat(item.fstand))" class="simple-number-result">
                <view class="result-value">{{ item.fstand }}</view>
                <view v-if="formData.unitName" class="result-unit">{{ formData.unitName }}</view>
                <view :class="{'pass': isInRange(item.fstand), 'fail': !isInRange(item.fstand)}" class="result-status">
                  {{ isInRange(item.fstand) ? '合格' : '不合格' }}
                </view>
              </view>
              <!-- NG/OK状态样式 -->
              <view v-else class="simple-status-result">
                <view :class="{'pass': item.fcheckResu === '1', 'fail': item.fcheckResu !== '1'}" class="simple-status">
                  {{ item.fcheckResu === '1' ? '合格' : '不合格' }}
                </view>
              </view>
            </view>
            <view v-if="current" class="simple-data-cell simple-action">
              <button v-if="!isNumber" class="simple-btn" @tap="numberEdit(item)">
                {{ editResult(item.fcheckResu) }}
              </button>
              <button v-if="isNumber" class="simple-btn" @tap="toDetail(item)">
                修改
              </button>
            </view>
          </view>
        </view>
      </view>
    </view>
    <view class="plus-button">
      <button type="warn" @click="saveRemarks">添加不合格描述</button>
    </view>
    <!-- 弹出层 - 修改检验结果 -->
    <view v-if="showPopup" class="overlay">
      <view class="popup">
        <h3>修改检验结果</h3>
        <form :modelValue="editData">
          <view class="form-group">
            <label class="form-label">检验结果:</label>
            <input class="form-input" type="text" v-model="editData.fcheckResu"/>
            <input v-model="editData.fcheckResu" class="form-input" type="text"/>
          </view>
          <button type="warn" @click="eidt">修改</button>
          <button @click="showPopup = !showPopup">取消</button>
          <view class="popup-buttons">
            <button class="btn primary-btn" @click="eidt">修改</button>
            <button class="btn cancel-btn" @click="showPopup = !showPopup">取消</button>
          </view>
        </form>
      </view>
    </view>
    <!-- 弹出层 - 不合格描述 -->
    <view v-if="remarksPopup" class="overlay">
      <view class="popup">
        <h3>修改不合格描述</h3>
        <form>
          <view class="form-group">
            <label class="form-label">不合格描述:</label>
            <input class="form-input" type="text" v-model="remarks"/>
            <input v-model="remarks" class="form-input" type="text"/>
          </view>
          <button type="warn" @click="editRemarks">修改</button>
          <button @click="remarksPopup = !remarksPopup">取消</button>
          <view class="popup-buttons">
            <button class="btn primary-btn" @click="editRemarks">修改</button>
            <button class="btn cancel-btn" @click="remarksPopup = !remarksPopup">取消</button>
          </view>
        </form>
      </view>
    </view>
@@ -158,7 +265,6 @@
      checkItem: "",
      id: 0,
      gid: 0,
      itemInId: 0,
      billNo: "",
      showPopup: false,
      editData: {},
@@ -167,10 +273,17 @@
      base64Image: "",
      remarks: "",
      remarksPopup: false,
     fcheckResu: null
      currentTab: 0,
      tabs: [],
      current: true // 添加current属性,默认为true
    }
  },
  methods: {
    switchTab(index, id) {
      this.currentTab = index;
      this.id = id;
      this.refreshResult();
    },
    previewImage() {
      uni.previewImage({
@@ -265,7 +378,6 @@
    toDetail(item) {
      this.showPopup = !this.showPopup;
      this.editData = item;
     this.fcheckResu = this.editData.fcheckResu;
    },
    eidt() {
@@ -279,7 +391,7 @@
      }
      let fstand = "√";
      if (this.formData.maxValue && this.formData.minValue) {
        if (!this.editData.fcheckResu) {
@@ -318,20 +430,14 @@
          id: this.editData.id,
          pid: this.id,
          gid: this.gid,
          itemInId: this.itemInId,
          fstand: fstand,
          fcheckResu: this.editData.fcheckResu,
          updateBy: this.editData.updater,
        }
      }).then(res => {
        this.showPopup = !this.showPopup;
      if(res.status == 0){
         this.$showMessage("修改成功");
         this.refreshResult(); //刷新页面
      }else{
         this.$showMessage(res.message);
         this.editData.fcheckResu = this.fcheckResu;
      }
        this.$showMessage("修改成功");
        this.refreshResult(); //刷新页面
      })
    },
@@ -351,18 +457,13 @@
          id: item.id,
          pid: item.pid,
          gid: item.gid,
          itemInId: this.itemInId,
          fstand: fstand,
          fcheckResu: fcheckResu,
          updateBy: this.$loginInfo.account,
        }
      }).then(res => {
        if(res.status == 0){
           this.$showMessage("修改成功");
           this.refreshResult(); //刷新页面
        }else{
           this.$showMessage(res.message);
        }
        this.$showMessage("修改成功");
        this.refreshResult(); //刷新页面
      })
    },
    saveRemarks() {
@@ -386,6 +487,55 @@
          }
        })
      }
    },
    // 加载检验项目列表
    loadTabItems() {
      this.$post({
        url: "/RKJ/getItems",
        data: {
          pid: this.gid,
        }
      }).then(res => {
        if (res.data && res.data.tbBillList) {
          this.tabs = res.data.tbBillList;
          // 按检测结果排序,未完成的排在前面
          this.tabs.sort((a, b) => {
            if (a.result === '未完成' && b.result !== '未完成') {
              return -1;
            } else if (a.result !== '未完成' && b.result === '未完成') {
              return 1;
            } else {
              return 0;
            }
          });
        } else {
          // 没有项目时至少添加当前项目到标签
          this.tabs = [{id: this.id, projName: this.formData.projName || '当前项目'}];
        }
      })
    },
    // 判断数字是否在范围内
    isInRange(value) {
      if (!this.formData.maxValue || !this.formData.minValue) return true;
      const numValue = parseFloat(value);
      return numValue >= parseFloat(this.formData.minValue) &&
          numValue <= parseFloat(this.formData.maxValue);
    },
    // 获取数字结果的样式类
    getNumberResultClass(value) {
      if (!this.formData.maxValue || !this.formData.minValue) return 'number-normal';
      return this.isInRange(value) ? 'number-pass' : 'number-fail';
    },
    // 获取状态结果的样式类
    getStatusClass(status) {
      return status === '1' ? 'status-pass' : 'status-fail';
    },
    // 图片查看
    chooseImage() {
      uni.navigateTo({
        url: 'ImageItem?id=' + this.formData.id
      });
    }
  },
  onLoad(options) {
@@ -395,57 +545,539 @@
    this.id = params["id"];
    this.billNo = params["billNo"];
    this.gid = params["gid"];
    this.itemInId = params["itemInId"];
    this.currentTab = parseInt(params["index"] || 0);
    // 处理权限参数
    if (params["current"] === 'true' || params["current"] === true) {
      this.current = true;
    } else if (params["current"] === 'false' || params["current"] === false) {
      this.current = false;
    }
    this.refreshResult();
    this.loadTabItems();
  }
}
</script>
<style>
.form-group {
  display: flex;
  align-items: center;
  border: 1px solid #c9c9c9;
  background-color: #d4d4d4;
<style lang="scss">
$primary-color: #409EFF;
$success-color: #67C23A;
$danger-color: #F56C6C;
$border-color: #DCDFE6;
$bg-color: #f5f7fa;
.container {
  padding: 20px;
  background-color: #fff;
}
.form-label {
  margin-bottom: 0;
  padding: 5px;
}
.header {
  padding: 20px;
  border-bottom: 1px solid $border-color;
  background: linear-gradient(90deg, #f0f7ff, #e1f0ff);
.form-input {
  flex: 1;
  margin-bottom: 0;
  padding: 5px;
}
  .title {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
  }
/* 默认样式 */
.list-container {
  height: calc(100vh - 750px);
  /* 设置列表容器的高度为剩余空间,并减去表单容器的高度 */
  overflow-y: auto;
  /* 允许列表容器垂直滚动 */
  padding: 10px;
  /* 可选:添加一些内边距,使列表内容更美观 */
}
/* 在小屏幕设备上,重置高度为适应屏幕 */
@media (max-width: 768px) {
  .list-container {
    height: calc(100vh - 485px);
    /* 适当调整高度 */
  .order-number {
    color: #666;
    font-size: 14px;
  }
}
.form-container {
  /* 设置表单容器的高度,使其可以滚动 */
  overflow-y: auto;
  /* 允许表单容器垂直滚动 */
  padding: 10px;
  /* 可选:添加一些内边距,使表单内容更美观 */
.tabs-container {
  background-color: $bg-color;
  border-bottom: 1px solid $border-color;
  position: relative;
}
.tabs-scroll {
  width: 100%;
  white-space: nowrap;
}
.tabs {
  display: flex;
  background-color: $bg-color;
  min-width: 100%;
  width: max-content;
  .tab {
    flex-shrink: 0;
    min-width: 120px;
    max-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-right: 1px solid $border-color;
    color: #666;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    &:last-child {
      border-right: none;
    }
    &:hover {
      background-color: rgba($primary-color, 0.05);
    }
    &.active {
      background-color: #fff;
      color: $primary-color;
      font-weight: bold;
      position: relative;
      &::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 60%;
        height: 3px;
        background: linear-gradient(90deg, transparent, $primary-color, transparent);
        border-radius: 2px;
      }
    }
    .tab-text {
      text-align: center;
      line-height: 1.4;
      word-break: break-word;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      font-size: 14px;
      z-index: 1;
      position: relative;
    }
  }
}
.section {
  margin: 20px 0;
  border: 1px solid $border-color;
  border-radius: 4px;
  &-header {
    padding: 12px 16px;
    background-color: $bg-color;
    border-bottom: 1px solid $border-color;
    font-weight: bold;
  }
  &-body {
    padding: 16px;
  }
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  .info-item {
    margin-bottom: 12px;
    .info-label {
      color: #909399;
      font-size: 14px;
      margin-bottom: 4px;
    }
    .info-value {
      color: #333;
      font-weight: 500;
    }
  }
}
.hint-text {
  margin-top: 16px;
  padding: 8px;
  background-color: rgba(231, 76, 60, 0.1);
  border-radius: 4px;
}
.result-remarks {
  margin-top: 16px;
  padding: 12px;
  background-color: rgba(231, 76, 60, 0.05);
  border-radius: 4px;
}
.input-group {
  margin: 16px 0;
}
.input-wrapper {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.result-input {
  flex: 1;
  height: 45px;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  min-width: 0; /* 防止flex子项溢出 */
}
.result-input:focus {
  outline: none;
  border-color: #409EFF;
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}
.btn {
  padding: 8px 20px;
  border-radius: 6px;
  margin: 0;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.primary-btn {
  background-color: var(--primary-color);
  color: #000000;
  min-width: 80px;
  white-space: nowrap;
}
.secondary-btn {
  background-color: #909399;
  color: #fff;
}
.danger-btn {
  background-color: $danger-color;
  color: #fff;
  padding: 6px 12px;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  min-width: 60px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  border-radius: 4px;
}
/* 移动端卡片样式 */
.result-card {
  background: #fff;
  border: 1px solid #e4e7ed;
  border-radius: 8px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-bottom: 1px solid #e4e7ed;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: #303133;
}
.card-action {
  padding: 4px 8px;
  font-size: 11px;
  min-width: 50px;
}
.card-body {
  padding: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.upload-btn {
  background-color: #909399;
  color: #fff;
}
.table-container {
  border: 1px solid $border-color;
  border-radius: 4px;
  margin-top: 20px;
  .table-header {
    display: flex;
    background-color: $bg-color;
    border-bottom: 1px solid $border-color;
    .th {
      flex: 1;
      padding: 12px;
      font-weight: bold;
    }
  }
  .table-row {
    display: flex;
    border-bottom: 1px solid $border-color;
    padding: 12px;
    &:last-child {
      border-bottom: none;
    }
    .td {
      flex: 1;
      display: flex;
      align-items: center;
    }
  }
}
.table-header {
  display: flex;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}
.th {
  flex: 1;
  padding: 12px 8px;
  font-weight: bold;
  text-align: center;
  font-size: 14px;
  color: #606266;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table-row {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s ease;
}
.table-row:hover {
  background-color: rgba(64, 158, 255, 0.05);
}
.table-row:nth-child(even) {
  background-color: rgba(248, 249, 250, 0.5);
}
.table-row:last-child {
  border-bottom: none;
}
.td {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  word-break: break-word;
  min-width: 0;
}
.result-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
}
.result-badge.OK {
  background-color: rgba(46, 204, 113, 0.1);
  color: var(--success-color);
}
.result-badge.NG {
  background-color: rgba(231, 76, 60, 0.1);
  color: var(--danger-color);
}
// 新的结果显示样式
.result-display {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 40px;
}
// 数字结果样式
.number-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  min-width: 60px;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  &.number-pass {
    background: linear-gradient(135deg, #e8f5e8, #f0f9f0);
    border: 2px solid #67C23A;
  }
  &.number-fail {
    background: linear-gradient(135deg, #fdeaea, #fef0f0);
    border: 2px solid #F56C6C;
  }
  &.number-normal {
    background: linear-gradient(135deg, #f5f7fa, #fafbfc);
    border: 2px solid #909399;
  }
  .number-value {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 2px;
  }
  .number-unit {
    font-size: 10px;
    color: #666;
    margin-bottom: 4px;
  }
  .number-status {
    position: absolute;
    top: -4px;
    right: -4px;
    background: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  }
}
// 状态结果样式
.status-result {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  &.status-pass {
    background: linear-gradient(135deg, #67C23A, #85ce61);
    color: white;
  }
  &.status-fail {
    background: linear-gradient(135deg, #F56C6C, #f78989);
    color: white;
  }
  .status-icon {
    margin-right: 6px;
    display: flex;
    align-items: center;
  }
  .status-text {
    font-size: 14px;
    letter-spacing: 0.5px;
  }
  &:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }
}
// 保留原有样式作为备用
.result-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  &.OK {
    background-color: rgba($success-color, 0.1);
    color: $success-color;
  }
  &.NG {
    background-color: rgba($danger-color, 0.1);
    color: $danger-color;
  }
}
.danger {
  color: var(--danger-color);
}
.image-preview {
  width: 120px;
  height: 120px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.image-preview:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.image-preview image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.overlay {
  position: fixed;
@@ -465,12 +1097,361 @@
  border: 1px solid #ccc;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  width: 68vw;
  /* 设置宽度为视口宽度的80% */
  height: 25vh;
  /* 设置高度为视口高度的80% */
}
.edit {
  background-color: white;
.form-group {
  margin-bottom: 16px;
  .form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
  }
  .form-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid $border-color;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    &:focus {
      border-color: $primary-color;
      outline: none;
    }
  }
}
.input1 {
  display: block;
}
.input2 {
  display: none;
}
.input-group {
  margin: 16px 0;
  .input-wrapper {
    display: flex;
    gap: 12px;
    .result-input {
      flex: 1;
      height: 45px;
      padding: 0 12px;
      border: 1px solid $border-color;
      border-radius: 4px;
      font-size: 14px;
    }
    .upload-btn {
      background-color: #909399;
      color: #fff;
      padding: 0 10px;
      margin: 0;
    }
  }
}
.result-preview {
  .info-label {
    font-weight: bold;
    color: #333;
  }
  .info-value {
    color: #333;
    font-weight: 500;
  }
}
.result-ng {
  .info-label {
    font-weight: bold;
    color: #333;
  }
  .info-value {
    color: $danger-color;
    font-weight: 500;
  }
}
.danger {
  color: $danger-color;
}
/* 简洁表格样式 - 适合年长用户 */
.simple-table-container {
  margin: 20px 0;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: #fff;
}
.simple-table-header {
  padding: 15px 20px;
  background: #f5f7fa;
  border-bottom: 2px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.simple-title {
  font-size: 18px;
  font-weight: bold;
  color: #333;
}
.simple-status {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  background: #ffc107;
  color: #333;
}
.simple-status.completed {
  background: #28a745;
  color: #fff;
}
.simple-table {
  width: 100%;
}
.simple-header-row {
  display: flex;
  background: #e9ecef;
  border-bottom: 2px solid #ddd;
}
.simple-header-cell {
  flex: 1;
  padding: 15px 20px;
  font-size: 16px;
  font-weight: bold;
  color: #333;
  text-align: center;
  border-right: 1px solid #ddd;
}
.simple-header-cell:first-child {
  flex: 0 0 80px;
}
.simple-header-cell:last-child {
  border-right: none;
  flex: 0 0 120px;
}
.simple-data-row {
  display: flex;
  border-bottom: 1px solid #ddd;
}
.simple-data-row:nth-child(even) {
  background: #f8f9fa;
}
.simple-data-cell {
  flex: 1;
  padding: 15px 20px;
  text-align: center;
  border-right: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
}
.simple-index {
  flex: 0 0 80px;
  font-size: 18px;
  font-weight: bold;
  color: #333;
}
.simple-result {
  text-align: left;
  justify-content: flex-start;
}
.simple-action {
  border-right: none;
  flex: 0 0 120px;
}
.simple-number-result {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.result-value {
  font-size: 20px;
  font-weight: bold;
  color: #333;
}
.result-unit {
  font-size: 14px;
  color: #666;
}
.result-status {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  margin-left: auto;
}
.result-status.pass {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}
.result-status.fail {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}
.simple-status-result {
  width: 100%;
}
.simple-status {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  display: inline-block;
}
.simple-status.pass {
  background: #28a745;
  color: #fff;
}
.simple-status.fail {
  background: #dc3545;
  color: #fff;
}
.simple-btn {
  padding: 10px 16px;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  min-width: 80px;
}
.simple-btn:active {
  background: #0056b3;
}
/* 响应式设计 */
@media (max-width: 768px) {
  .simple-table-header {
    padding: 12px 16px;
  }
  .simple-title {
    font-size: 16px;
  }
  .simple-header-cell,
  .simple-data-cell {
    padding: 12px 16px;
    font-size: 14px;
  }
  .simple-index {
    flex: 0 0 60px;
  }
  .simple-action {
    flex: 0 0 100px;
  }
  .result-value {
    font-size: 18px;
  }
}
@media (max-width: 500px) {
  .input1 {
    display: none;
  }
  .input2 {
    display: block;
  }
  .simple-table-container {
    margin: 16px -10px;
    border-radius: 0;
  }
  .simple-table-header {
    padding: 10px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .simple-title {
    font-size: 14px;
  }
  .simple-status {
    font-size: 12px;
    padding: 6px 12px;
  }
  .simple-header-cell,
  .simple-data-cell {
    padding: 10px 8px;
    font-size: 12px;
  }
  .simple-index {
    flex: 0 0 50px;
  }
  .simple-action {
    flex: 0 0 80px;
  }
  .simple-btn {
    padding: 8px 10px;
    font-size: 12px;
    min-width: 60px;
  }
  .result-value {
    font-size: 16px;
  }
  .simple-status {
    font-size: 14px;
  }
}
</style>