cnf
2025-09-17 2565d78042b7cc5ac500c4bac5edefdb7a046af5
Merge branch 'master' of http://43.142.96.171:8080/r/~cnf/HM_StandardPda-Browse
已修改4个文件
898 ■■■■■ 文件已修改
pages/QC/SJ/Add.vue 607 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/QC/SJ/List.vue 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/QC/SJ/detail.vue 233 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/QC/XJ/Add.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/QC/SJ/Add.vue
@@ -96,53 +96,34 @@
                            <view v-if="item.result==null || item.result==''" class="watermark pending">
                                {{ getStatusText(item.result) }}
                            </view>
                            <view class="description-text">检验项目详情</view>
                            <view class="description-text">{{ getInspectionDescription(item) }}</view>
                        </td>
                        <td>
                            <button class="record-btn" @click="toDetail(item)">
                                {{ item.levelNum + '/' + item.isCheck }}
                                {{ getTotalCount(item) + '/' + item.isCheck }}
                            </button>
                        </td>
                    </tr>
                </tbody>
            </table>
        </view>
        <!-- 操作按钮区 -->
        <view class="action-buttons">
            <button class="action-btn primary" v-if="isUpdate && !isShowTable" @click="save">
                创建检验单并生成部分默认值
            </button>
            <button class="action-btn secondary" v-if="!isUpdate && !isShowTable" @click="toImage">
                上传/查看图片
            </button>
            <button class="action-btn secondary" v-if="!isUpdate && !isShowTable" @click="fetchDrawingNumber(formData.itemNo)">
                调取PLM图纸
            </button>
            <button class="action-btn secondary" v-if="!isUpdate && !isShowTable" @click="getBom">
                Bom用料清单
            </button>
            <button class="action-btn secondary" v-if="!isUpdate && !isShowTable && formData.xjGenFlag == 0"
                @click="saveXJ">
                生成巡检
            </button>
            <button class="action-btn danger" v-if="!isUpdate && formData.result == '未完成' && !isShowTable" @click="removeXJ">
                删除单据
            </button>
            <button class="action-btn secondary" v-if="!isUpdate &&  !isShowTable" @click="saveRemarks">
                添加不合格描述
            </button>
            <button class="action-btn primary" v-if="isShowTable" @click="getTable">
                获取检验项目
            </button>
            <button class="action-btn primary" v-if="isShowTable && isUpdate" @click="saveTable">
                生成检验项目
            </button>
            <button class="action-btn success" v-if="!isUpdate && formData.fsubmit == 0 && !isShowTable" @click="getGenUpdate">
                获取检验项目
            </button>
            <button class="action-btn success" v-if="!isUpdate && formData.fsubmit ==0 && !isShowTable" @click="submitInspection">
                提交检验
            </button>
        <!-- 表单上方操作按钮区 -->
        <view class="top-action-buttons">
            <button class="action-btn" v-if="isUpdate && !isShowTable" @click="save">创建检验单并生成部分默认值</button>
            <button class="action-btn" v-if="isShowTable" @click="getTable">获取检验项目</button>
            <button class="action-btn" v-if="isShowTable && isUpdate" @click="saveTable">生成检验项目</button>
        </view>
        <!-- 表单下方操作按钮区 -->
        <view class="bottom-action-buttons">
            <button class="action-btn small" v-if="!isUpdate && !isShowTable" @click="toImage">上传/查看图片</button>
            <button class="action-btn small" v-if="!isUpdate && !isShowTable" @click="fetchDrawingNumber(formData.itemNo)">调取PLM图纸</button>
            <button class="action-btn small" v-if="!isUpdate && !isShowTable" @click="getBom">Bom用料清单</button>
            <button class="action-btn small" v-if="!isUpdate && !isShowTable && formData.xjGenFlag == 0" @click="saveXJ">生成巡检</button>
            <button class="action-btn small" v-if="false" @click="removeXJ">删除单据</button>
            <button class="action-btn small" v-if="!isUpdate && !isShowTable" @click="saveRemarks">添加不合格描述</button>
            <button class="action-btn small" v-if="!isUpdate && formData.fsubmit == 0 && !isShowTable" @click="getGenUpdate">获取检验项目</button>
            <button class="action-btn small primary" v-if="!isUpdate && formData.fsubmit ==0 && !isShowTable" @click="submitInspection">提交检验</button>
        </view>
        
        <view class="barcode">
@@ -316,6 +297,24 @@
                if (status === '合格') return '合格';
                if (status === '不合格') return '不合格';
                return '未完成';
            },
            getTotalCount(item) {
                // 如果有穴号信息,使用穴号信息的总数量减去堵穴数量
                if (item.holeNumbers && item.holeNumbers.length > 0) {
                    // 计算非堵穴的数量
                    const nonBlockedCount = item.holeNumbers.filter(hole => !hole.isBlocked).length;
                    return nonBlockedCount;
                }
                // 否则使用levelNum
                return item.levelNum || 0;
            },
            getInspectionDescription(item) {
                // 直接取ITEM_MOD字段的值
                if (item.itemMod && item.itemMod.trim() !== '') {
                    return item.itemMod;
                } else {
                    return '检验项目详情';
                }
            },
            removeXJ() {
                if (this.formData.id) {
@@ -597,16 +596,28 @@
            },
            submitInspection() {
                if (this.formData.id) {
                    this.$post({
                        url: "/SJ/SjSubmit",
                        data: {
                            id: this.formData.id,
                            userNo: this.$loginInfo.account
                        }
                    }).then(res => {
                        if (res.data.tbBillList) {
                            this.$showMessage("提交成功");
                            this.init();
                    // 显示确认提示框
                    uni.showModal({
                        title: '确认提交',
                        content: '确定要提交检验结果吗?提交后将无法修改。',
                        confirmText: '确定提交',
                        cancelText: '取消',
                        success: (res) => {
                            if (res.confirm) {
                                // 用户确认后执行提交
                                this.$post({
                                    url: "/SJ/SjSubmit",
                                    data: {
                                        id: this.formData.id,
                                        userNo: this.$loginInfo.account
                                    }
                                }).then(res => {
                                    if (res.data.tbBillList) {
                                        this.$showMessage("提交成功");
                                        this.init();
                                    }
                                });
                            }
                        }
                    });
                }
@@ -930,19 +941,57 @@
                    this.$showMessage("请先保存检验单!");
                    return;
                }
                // 先获取检验单的详细信息,包含mnum和dnum
                this.$post({
                    url: "/SJ/GenUpdate",
                    url: "/SJ/getQSItems",
                    data: {
                        id: this.formData.id,
                        no: this.formData.billNo,
                        user: this.$loginInfo.account
                        pid: this.formData.id
                    }
                }).then(res => {
                    if (res.data.result === 0) {
                        this.$showMessage("获取检验项目成功");
                        this.init();
                    if (res.data.tbBillList && res.data.tbBillList.length > 0) {
                        // 从第一个检验项目中获取mnum和dnum
                        const firstItem = res.data.tbBillList[0];
                        const mnum = firstItem.mnum || 1;
                        const dnum = firstItem.dnum || "";
                        // 调用GenUpdate
                        this.$post({
                            url: "/SJ/GenUpdate",
                            data: {
                                id: this.formData.id,
                                no: this.formData.billNo,
                                user: this.$loginInfo.account,
                                mnum: mnum,
                                dnum: dnum
                            }
                        }).then(genRes => {
                            if (genRes.data.result === 0) {
                                this.$showMessage("获取检验项目成功");
                                this.init();
                            } else {
                                this.$showMessage(genRes.data.message || "获取失败");
                            }
                        });
                    } else {
                        this.$showMessage(res.data.message || "获取失败");
                        // 如果没有检验项目,使用默认值
                        this.$post({
                            url: "/SJ/GenUpdate",
                            data: {
                                id: this.formData.id,
                                no: this.formData.billNo,
                                user: this.$loginInfo.account,
                                mnum: 1,
                                dnum: ""
                            }
                        }).then(genRes => {
                            if (genRes.data.result === 0) {
                                this.$showMessage("获取检验项目成功");
                                this.init();
                            } else {
                                this.$showMessage(genRes.data.message || "获取失败");
                            }
                        });
                    }
                });
            }
@@ -957,328 +1006,382 @@
<style scoped>
/* 基础样式 */
.inspection-sheet {
  padding: 10px;
  background-color: #f5f7fa;
  min-height: 100vh;
    font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 20px 100px 20px; /* 底部增加内边距为固定按钮留空间 */
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    min-height: 100vh;
    position: relative;
    transition: all 0.3s ease;
}
/* 头部样式 */
.sheet-header {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}
.sheet-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 10px;
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 5px;
}
.inspection-number {
  font-size: 16px;
  color: #3498db;
  font-weight: 500;
    font-size: 16px;
    font-weight: bold;
    color: #3498db;
}
/* 基本信息区 */
.basic-info {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
/* 基本信息区样式 */
.basic-info,
.material-info {
    margin-bottom: 20px;
}
.info-row {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
    display: flex;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.info-label {
  font-size: 14px;
  color: #7f8c8d;
  margin-right: 10px;
  min-width: 80px;
    font-weight: bold;
    color: #34495e;
    min-width: 80px;
    margin-right: 5px;
}
.info-value {
  font-size: 14px;
  color: #2c3e50;
  margin-right: 20px;
    color: #2c3e50;
    margin-right: 20px;
}
.info-picker {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
  font-size: 14px;
  margin-right: 20px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    margin-right: 20px;
}
/* 物料信息区 */
/* 物料信息区样式 */
.material-info {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 5px;
}
.info-block {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.info-block .info-label {
  min-width: 100px;
  font-size: 14px;
  color: #7f8c8d;
    min-width: 100px;
    font-size: 14px;
    color: #7f8c8d;
}
.info-block .info-value {
  font-size: 14px;
  color: #2c3e50;
  flex: 1;
    font-size: 14px;
    color: #2c3e50;
    flex: 1;
}
.info-picker-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
  font-size: 14px;
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
}
.info-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
  font-size: 14px;
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
}
.highlight {
  font-weight: 600;
  color: #e74c3c;
  font-size: 16px;
    font-weight: bold;
    color: #e74c3c;
}
/* 检验项目表格 */
/* 表格样式 */
.inspection-table {
  margin: 25px 0;
    margin: 25px 0;
}
.inspection-table table {
  width: 100%;
  border-collapse: collapse;
    width: 100%;
    border-collapse: collapse;
}
.inspection-table th,
.inspection-table td {
  padding: 12px 15px;
  border: 1px solid #ddd;
  text-align: left;
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
}
.inspection-table th {
  background-color: #f8f9fa;
  font-weight: bold;
  color: #34495e;
    background-color: #f8f9fa;
    font-weight: bold;
    color: #34495e;
}
.inspection-table tr:nth-child(even) {
  background-color: #f9f9f9;
    background-color: #f9f9f9;
}
.inspection-table tr:hover {
  background-color: #f1f5f9;
    background-color: #f1f5f9;
}
/* 水印样式 */
.watermark {
  position: absolute;
  font-size: 40px;
  font-weight: bold;
  opacity: 1;
  z-index: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
    position: absolute;
    font-size: 40px;
    font-weight: bold;
    opacity: 1;
    z-index: 1;
    pointer-events: none;
    transform: rotate(-15deg);
    width: 100%;
    text-align: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
}
.watermark.approved {
  color: #2ecc71;
    color: #2ecc71;
    /* 绿色 */
}
.watermark.rejected {
  color: #e74c3c;
    color: #e74c3c;
    /* 红色 */
}
.watermark.pending {
  color: #f39c12;
    color: #f39c12;
    /* 橙色 */
}
/* 描述文本容器 */
.description-text {
  position: relative;
  z-index: 2;
  background-color: rgba(255, 255, 255, 0.7);
  padding: 10px;
  font-size: 14px;
  color: #2c3e50;
    position: relative;
    z-index: 2;
    padding: 25px;
    background-color: rgba(255, 255, 255, 0.7);
}
/* 调整表格单元格 */
.inspection-table td:nth-child(2) {
  position: relative;
  overflow: hidden;
  padding: 0;
    position: relative;
    overflow: hidden;
    padding: 0;
}
/* 按钮样式 */
.record-btn {
  padding: 6px 12px;
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
/* 表单上方操作按钮区样式 */
.top-action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}
.record-btn:hover {
  background-color: #e9ecef;
}
/* 操作按钮区 */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
/* 表单下方操作按钮区样式 */
.bottom-action-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    flex-wrap: wrap;
    align-items: center;
    position: fixed; /* 固定在屏幕底部 */
    bottom: 0; /* 距离底部0px */
    left: 0; /* 距离左边0px */
    right: 0; /* 距离右边0px */
    background-color: #fff; /* 背景色 */
    border-top: 1px solid #e9ecef; /* 顶部边框 */
    z-index: 1000; /* 确保在最上层 */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); /* 顶部阴影 */
}
.action-btn {
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
    background-color: #ecf0f1;
    color: #34495e;
    padding: 12px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.action-btn:hover {
    background-color: #d5dbdb;
    transform: translateY(-1px);
}
.action-btn.primary {
  background-color: #3498db;
  color: white;
    background-color: #3498db;
    color: #fff;
}
.action-btn.primary:hover {
  background-color: #2980b9;
    background-color: #2980b9;
}
.action-btn.secondary {
  background-color: #95a5a6;
  color: white;
/* 小尺寸按钮样式 */
.action-btn.small {
    padding: 10px 12px;
    font-size: 14px;
    min-height: 44px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 80px;
    max-width: 120px;
    flex: 1;
}
.action-btn.secondary:hover {
  background-color: #7f8c8d;
/* 原有按钮样式保持兼容 */
.action-buttons {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    justify-content: flex-end;
}
.action-btn.danger {
  background-color: #e74c3c;
  color: white;
.record-btn {
    padding: 6px 12px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    /* border-radius: 3px; */
    cursor: pointer;
    transition: all 0.2s;
}
.action-btn.danger:hover {
  background-color: #c0392b;
.record-btn:hover {
    background-color: #e9ecef;
}
.action-btn.success {
  background-color: #2ecc71;
  color: white;
}
.action-btn.success:hover {
  background-color: #27ae60;
}
/* 弹出框样式 */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* 提高层级,确保在固定按钮上方 */
}
/* 弹窗整体美化 */
.popup {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(60,60,60,0.18);
    padding: 28px 28px 18px 28px;
    border: none;
    position: relative;
    min-width: 260px;
    z-index: 1001; /* 确保弹窗内容在最上层 */
    max-height: 80vh; /* 限制最大高度,避免被底部按钮遮挡 */
    overflow-y: auto; /* 内容过多时可滚动 */
}
.popup-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
    padding: 20px;
    border-bottom: 1px solid #eee;
}
.popup-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
  margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}
.popup-content {
  padding: 20px;
    padding: 20px;
}
.popup-actions {
  padding: 20px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
/* 响应式设计 */
@media (max-width: 768px) {
  .info-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .info-label {
    margin-bottom: 5px;
  }
  .project-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .project-actions {
    margin-top: 10px;
    width: 100%;
  }
@media (max-width: 500px) {
    .info-row,
    .info-block {
        flex-direction: column;
        align-items: flex-start;
    }
    .top-action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    .bottom-action-buttons {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        padding: 8px;
        gap: 6px;
        position: fixed; /* 保持固定在屏幕底部 */
        bottom: 0;
        left: 0;
        right: 0;
        background-color: #fff;
        border-top: 1px solid #e9ecef;
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
    .action-btn.small {
        min-width: 70px;
        max-width: 100px;
        padding: 8px 10px;
        font-size: 13px;
        min-height: 40px;
    }
    .inspection-table table {
        display: block;
        overflow-x: auto;
    }
}
</style>
pages/QC/SJ/List.vue
@@ -22,10 +22,10 @@
        <!-- 状态切换标签 -->
        <view class="status-tabs">
          <button :class="['tab-button', current === 0 ? 'active' : '']" @click="onClickItem({currentIndex: 0})">
            {{items[0]}}
            未完成({{uncheckedCount}})
          </button>
          <button :class="['tab-button', current === 1 ? 'active' : '']" @click="onClickItem({currentIndex: 1})">
            {{items[1]}}
            {{checkedCount}}
          </button>
        </view>
      </view>
@@ -36,11 +36,19 @@
      <!-- 检验单卡片 -->
      <view class="inspection-card" v-for="item in data" :key="item.id" @click="navigateToDetail(item)">
        <view class="card-header">
          <text class="badge normal" v-if="item.SJ_MJ">{{item.SJ_MJ}}</text>
          <text class="card-title">检验单号: {{item.billNo}}</text>
          <text class="status pass" v-if="item.result === '合格'">合格</text>
          <text class="status unqualified" v-if="item.result === '不合格'">不合格</text>
          <text class="status pending" v-if="!item.result">待检验</text>
          <view class="header-left">
            <text class="badge normal" v-if="item.SJ_MJ">{{item.SJ_MJ}}</text>
            <text class="card-title">检验单号: {{item.billNo}}</text>
          </view>
          <view class="header-right">
            <!-- 未完成标签页的状态显示 -->
            <text class="status pending" v-if="current === 0 && (!item.result || item.result === '未完成')">待检验</text>
            <text class="status pass" v-if="current === 0 && item.result === '合格'">合格</text>
            <text class="status unqualified" v-if="current === 0 && item.result === '不合格'">不合格</text>
            <!-- 已完成标签页的状态显示 -->
            <text class="status pass" v-if="current === 1 && item.result === '合格'">合格</text>
            <text class="status unqualified" v-if="current === 1 && item.result === '不合格'">不合格</text>
          </view>
        </view>
        <view class="card-body">
@@ -124,7 +132,10 @@
      // ===== 新增搜索功能相关数据 =====
      optionsIndex: 0, // 当前选择的查询条件索引
      options: ['工单', '检验单号', '产线', '物料编码', '物料名称'], // 查询条件选项
      selectedField: 'daa001' // 当前选择的查询字段,默认为工单
      selectedField: 'daa001', // 当前选择的查询字段,默认为工单
      // ===== 新增数量统计变量 =====
      uncheckedCount: 0, // 未完成数量
      checkedCount: '已检验' // 已完成数量显示文本
    };
  },
  onLoad() {
@@ -175,6 +186,12 @@
        }
      }).then(res => {
        this.data = res.data.tbBillList;
        // 设置数量统计
        if (this.current === 1) {
          this.checkedCount = '已检验(' + res.totalCount + ')';
        } else {
          this.uncheckedCount = res.totalCount;
        }
      })
    },
    handleFabClick() {
@@ -329,12 +346,24 @@
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.header-left {
  display: flex;
  align-items: center;
  flex: 1;
}
.header-right {
  display: flex;
  align-items: center;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
  margin: 0 8px;
}
pages/QC/SJ/detail.vue
@@ -159,14 +159,16 @@
            </view>
          </view>
          <view class="td">
            <!-- 修改按钮 - 已填写后显示 -->
            <button v-if="!isHoleBlocked(index) && item.fcheckResu && !isNumber" class="btn danger-btn" @tap="numberEdit(item)">
              {{ editResult(item.fcheckResu) }}
            </button>
            <button v-if="!isHoleBlocked(index) && item.fcheckResu && isNumber" class="btn danger-btn" @tap="toDetail(item)">
              修改
            </button>
            <!-- 状态显示 -->
            <span v-if="isHoleBlocked(index)" class="blocked-text">已堵穴</span>
            <span v-else-if="!item.fcheckResu" class="no-data-text">待填写</span>
            <span v-else-if="!item.fcheckResu" class="ready-text">可填写</span>
          </view>
        </view>
      </view>
@@ -219,6 +221,7 @@
        </view>
      </view>
    </view>
  </view>
</template>
@@ -249,13 +252,23 @@
    displayTableData() {
      const result = [];
      
      console.log('displayTableData - formData:', this.formData);
      console.log('displayTableData - tableData:', this.tableData);
      // 如果有穴号信息,使用穴号信息生成数据
      if (this.formData.holeNumbers && this.formData.holeNumbers.length > 0) {
        // 对数据库记录按创建时间排序,确保顺序稳定
        const sortedTableData = [...this.tableData].sort((a, b) => {
          if (a.id && b.id) return a.id - b.id;
          if (a.createDate && b.createDate) return new Date(a.createDate) - new Date(b.createDate);
          return 0;
        });
        console.log('displayTableData - sortedTableData:', sortedTableData);
        this.formData.holeNumbers.forEach((holeInfo, index) => {
          // 查找是否有对应的实际数据
          const actualData = this.tableData.find(item => {
            return this.tableData.indexOf(item) === index;
          });
          // 直接通过索引获取对应的数据库记录
          const actualData = sortedTableData[index];
          
          if (actualData) {
            // 如果有实际数据,使用实际数据
@@ -281,10 +294,17 @@
        // 如果没有穴号信息,使用原来的逻辑
        const levelNum = this.formData.levelNum || 0;
        
        // 按照创建时间或ID排序,确保顺序稳定
        const sortedTableData = [...this.tableData].sort((a, b) => {
          if (a.id && b.id) return a.id - b.id;
          if (a.createDate && b.createDate) return new Date(a.createDate) - new Date(b.createDate);
          return 0;
        });
        console.log('displayTableData - sortedTableData (no holes):', sortedTableData);
        for (let i = 0; i < levelNum; i++) {
          const actualData = this.tableData.find(item => {
            return this.tableData.indexOf(item) === i;
          });
          const actualData = sortedTableData[i];
          
          if (actualData) {
            result.push({
@@ -304,12 +324,21 @@
        }
      }
      
      console.log('displayTableData - result:', result);
      return result;
    },
    
    // 判断是否所有检验都已完成
    isAllCompleted() {
      return this.displayTableData.every(item => item.fcheckResu !== null && item.fcheckResu !== undefined);
      // 只检查非堵穴的行是否都已填写
      return this.displayTableData.every(item => {
        // 如果是堵穴,跳过检查
        if (item.holeInfo && item.holeInfo.isBlocked) {
          return true;
        }
        // 非堵穴的行必须有检验结果
        return item.fcheckResu !== null && item.fcheckResu !== undefined;
      });
    }
  },
  methods: {
@@ -324,29 +353,7 @@
        return 'PENDING';
      }
      
      // 根据检验结果和判定标识确定样式类
      if (fstand === '√' || fcheckResu === 'OK') {
        return 'OK';
      } else if (fstand === '×' || fcheckResu === 'NG') {
        return 'NG';
      } else {
        // 对于数字结果,根据fstand判断
        return fstand === '√' ? 'OK' : 'NG';
      }
    },
    getResultText(fcheckResu, fstand, index) {
      // 检查是否被堵穴
      if (this.isHoleBlocked(index)) {
        return '/';
      }
      // 如果没有记录值,显示未检验
      if (!fcheckResu) {
        return '未检验';
      }
      // 根据记录值判断检验结果是否OK
      // 优先根据fstand判断
      if (fstand === '√') {
        return 'OK';
      } else if (fstand === '×') {
@@ -369,6 +376,47 @@
              }
            }
          }
          // 默认返回OK样式
          return 'OK';
        }
      }
    },
    getResultText(fcheckResu, fstand, index) {
      // 检查是否被堵穴
      if (this.isHoleBlocked(index)) {
        return '/';
      }
      // 如果没有记录值,显示未检验
      if (!fcheckResu) {
        return '未检验';
      }
      // 优先根据fstand判断
      if (fstand === '√') {
        return '合格';
      } else if (fstand === '×') {
        return '不合格';
      } else {
        // 如果没有fstand,根据fcheckResu的值判断
        if (fcheckResu === '1' || fcheckResu === 1) {
          return '合格';
        } else if (fcheckResu === '0' || fcheckResu === 0) {
          return '不合格';
        } else {
          // 对于有上下限的数值检验,根据fcheckResu是否在范围内判断
          if (this.formData.maxValue && this.formData.minValue) {
            const value = parseFloat(fcheckResu);
            if (!isNaN(value)) {
              if (value >= this.formData.minValue && value <= this.formData.maxValue) {
                return '合格';
              } else {
                return '不合格';
              }
            }
          }
          // 如果是有数值的检验结果,直接显示数值
          return fcheckResu || '未检测';
        }
      }
@@ -405,6 +453,7 @@
      }
      return false;
    },
    previewImage() {
      uni.previewImage({
@@ -445,23 +494,39 @@
        if (this.formData.fcheckResu == 0 || this.formData.fcheckResu == 1) {
          this.formData.isPass = this.formData.fcheckResu
          // 根据fcheckResu设置fstand
          if (this.formData.fcheckResu == 1) {
            fstand = "√";  // 合格
          } else {
            fstand = "×";  // 不合格
          }
        } else {
          this.$showMessage("无标准值时,检验结果只能为0或1!");
          return;
        }
        count = 1; // 每次只填写一个记录
        // 计算实际需要填写的数量(考虑穴号信息)
        if (this.formData.holeNumbers && this.formData.holeNumbers.length > 0) {
          // 如果有穴号信息,计算非堵穴的数量
          const nonBlockedCount = this.formData.holeNumbers.filter(hole => !hole.isBlocked).length;
          count = nonBlockedCount;
        } else {
          // 否则使用levelNum
          count = this.formData.levelNum || 1;
        }
      }
      this.formData.updater = this.$loginInfo.account;
      // 直接执行保存,不显示确认弹窗
      this.$post({
        url: "/SJ/SetQSItemDetail",
        data: {
          pid: this.id,
          gid: this.gid,
          fstand: fstand,
          fcheckResu: this.formData.fcheckResu,
          updateBy: this.formData.updater,
          Fstand: fstand,
          FcheckResu: this.formData.fcheckResu,
          UpdateBy: this.formData.updater,
          count: count
        }
      }).then(res => {
@@ -472,9 +537,11 @@
    },
    refreshResult() {
      // 先获取检验项目基本信息
      this.$post({
        url: "/SJ/getQSItems",
        data: {
          pid: this.gid,
          id: this.id
        }
      }).then(res => {
@@ -487,17 +554,21 @@
        if (this.formData.maxValue && this.formData.minValue && this.formData.standardValue) {
          this.isNumber = true;
        }
      })
      this.$post({
        url: "/SJ/getQSItemDetail",
        data: {
          pid: this.id,
          gid: this.gid
        }
        // 然后获取检验详情数据
        return this.$post({
          url: "/SJ/getQSItemDetail",
          data: {
            pid: this.id,
            gid: this.gid
          }
        });
      }).then(res => {
        this.tableData = res.data.tbBillList;
      })
        console.log('刷新后的tableData:', this.tableData);
      }).catch(error => {
        console.error('刷新数据失败:', error);
      });
    },
    toDetail(item) {
      this.showPopup = !this.showPopup;
@@ -547,21 +618,33 @@
      this.editData.updater = this.$loginInfo.account;
      this.$post({
        url: "/SJ/UpdateQSItemDetail",
        data: {
          id: this.editData.id,
          pid: this.id,
          gid: this.gid,
          fstand: fstand,
          fcheckResu: this.editData.fcheckResu,
          updateBy: this.editData.updater,
      // 显示确认提示框
      uni.showModal({
        title: '确认修改',
        content: '确定要修改检验结果吗?',
        confirmText: '确定修改',
        cancelText: '取消',
        success: (res) => {
          if (res.confirm) {
            // 用户确认后执行修改
            this.$post({
              url: "/SJ/UpdateQSItemDetail",
              data: {
                id: this.editData.id,
                pid: this.id,
                gid: this.gid,
                fstand: fstand,
                fcheckResu: this.editData.fcheckResu,
                updateBy: this.editData.updater,
              }
            }).then(res => {
              this.showPopup = !this.showPopup;
              this.$showMessage("修改成功");
              this.refreshResult();//刷新页面
            })
          }
        }
      }).then(res => {
        this.showPopup = !this.showPopup;
        this.$showMessage("修改成功");
        this.refreshResult();//刷新页面
      })
      });
    },
    numberEdit(item) {
@@ -836,6 +919,19 @@
  font-style: italic;
}
.waiting-text {
  color: #E6A23C;
  font-size: 12px;
  font-style: italic;
}
.ready-text {
  color: #67C23A;
  font-size: 12px;
  font-weight: bold;
}
.spec-text {
  font-size: 14px;
  color: #333;
@@ -943,6 +1039,12 @@
    color: #2c3e50;
    margin: 0;
  }
  .popup-subtitle {
    font-size: 14px;
    color: #7f8c8d;
    margin: 5px 0 0 0;
  }
}
.popup-content {
@@ -967,6 +1069,19 @@
      background-color: white;
    }
  }
  .input-hint {
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #409EFF;
    text {
      font-size: 12px;
      color: #666;
    }
  }
}
.popup-actions {
pages/QC/XJ/Add.vue
@@ -97,7 +97,7 @@
                    <view v-if="item.result==null || item.result=='未完成'" class="watermark pending">
                      {{ getStatusText(item.result) }}
                    </view>
                    <view class="description-text">{{ item.projName }}</view>
                    <view class="description-text">{{ getInspectionDescription(item) }}</view>
                  </td>
                  <td>
                    <button v-if="item.isCheck >= item.levelNum" class="record-btn" @click="toDetail(item)">查看</button>
@@ -513,6 +513,15 @@
        }
      },
      
      getInspectionDescription(item) {
        // 取ITEM_MOD字段的值
        if (item.itemMod && item.itemMod.trim() !== '') {
          return item.itemMod;
        } else {
          return '检验项目详情';
        }
      },
      removeXJ() {
        if (this.formData.id) {
          this.$post({