fcx
2025-12-02 a177ad6532fcdc1e9d2b3910276bd88d04791469
1.XJ新增照片查看,不良描述

2.巡检单明细页重新开发
3.巡检项目明细新增上传图片
4.巡检单页面新增关闭此次检验
已修改5个文件
已添加2个文件
1590 ■■■■■ 文件已修改
pages.json 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/QC/SJ/List.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/QC/SJ/detail.vue 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/QC/XJ/Add.vue 1144 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/QC/XJ/Blms.vue 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/QC/XJ/ImageItemALL.vue 248 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/QC/XJ/detail.vue 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json
@@ -328,6 +328,20 @@
            }
        },
        {
            "path": "pages/QC/XJ/ImageItemALL",
            "style": {
                "navigationBarTitleText": "照片查看",
                "enablePullDownRefresh": false
            }
        },
        {
            "path": "pages/QC/XJ/Blms",
            "style": {
                "navigationBarTitleText": "不良描述",
                "enablePullDownRefresh": false
            }
        },
        {
            "path": "pages/QC/Suspend/Suspend",
            "style": {
                "navigationBarTitleText": "线体巡检暂停",
pages/QC/SJ/List.vue
@@ -38,12 +38,12 @@
          <view :class="{
                  'status-pending': !item.result && current === 0,
                  'status-assigned': current === 0 && item.statusUser && !item.result,
                  'status-pass': item.result === '合格',
                  'status-fail': item.result === '不合格',
                  'status-pass': item.result === '合格'&& current === 1,
                  'status-fail': item.result === '不合格'&& current === 1,
                  'status-submitted': !item.result && current === 1
                }"
                class="status">
            {{ current === 0 ? (item.result ? item.result : '未提交') : (item.result ? item.result : '已提交') }}
            {{ current === 0 ? ('' ? item.result : '未提交') : (item.result ? item.result : '已提交') }}
          </view>
        </view>
@@ -512,7 +512,7 @@
}
.status-fail {
  background: linear-gradient(135deg, #3498db, #2980b9);
  background: linear-gradient(135deg, #ff0000, #ff0000);
  color: white;
}
pages/QC/SJ/detail.vue
@@ -102,7 +102,7 @@
              </button>
              <input v-if="(tableData.length < formData.levelNum)" v-model="formData.fcheckResu" class="result-input"
                     placeholder="请输入检验结果..." type="number"/>
              <button v-if="(tableData.length < formData.levelNum)" class="btn primary-btn" @click="submit">保存结果
              <button v-if="(tableData.length < formData.levelNum)" class="btn primary-btn" @click="submit" style="margin: 0px;">保存结果
              </button>
            </view>
          </view>
@@ -110,20 +110,21 @@
          <!-- å“åº”式设计的第二个输入组 -->
          <view class="input-group input2">
            <view class="input-wrapper">
              <button class="btn upload-btn" @click="chooseImage">
              <button class="btn upload-btn" @click="chooseImage ">
                <uni-icons type="upload" size="16" color="#fff"></uni-icons>
                ä¸Šä¼ /查看图片
              </button>
              <button v-if="current" class="btn upload-btn" @click="saveRemarks">
              <button v-if="current" class="btn upload-btn" @click="saveRemarks  ">
                <uni-icons type="compose" size="16" color="#fff"></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"
              <input v-if="(tableData.length < formData.levelNum)" v-model="formData.fcheckResu" class="result-input"
                     placeholder="请输入检验结果..." type="number"/>
              <button v-if="(tableData.length < formData.levelNum) && current" class="btn primary-btn" @click="submit">保存结果
              </button>
              <button v-if="tableData.length < formData.levelNum" class="btn primary-btn" @click="submit" style="margin: 0px;" >保存结果
              </button>
            </view>
          </view>
        </view>
@@ -653,6 +654,15 @@
      border: none;
      border-radius: 4px;
    }
    .primary-btn {
      height: 45px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: none;
      border-radius: 4px;
    }
  }
}
@@ -721,6 +731,13 @@
    &.primary-btn {
      background-color: $primary-color;
      color: #fff;
      height: 45px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: none;
      border-radius: 4px;
      padding: 0 20px;
    }
    &.cancel-btn {
pages/QC/XJ/Add.vue
@@ -3,47 +3,37 @@
    <!-- å¤´éƒ¨ä¿¡æ¯ -->
    <view class="sheet-header">
      <h1>巡检单</h1>
      <view class="inspection-number">检验单号:{{ formData.releaseNo }}</view>
      <view class="inspection-number">检验单号:{{ formData.billNo }}</view>
    </view>
    <!-- åŸºæœ¬ä¿¡æ¯åŒº -->
    <view class="basic-info">
      <view class="info-row">
        <span class="info-label">创建人:</span>
        <span class="info-value">{{ formData.createBy }}</span>
        <span class="info-label">创建时间:</span>
        <span class="info-value">{{ formData.createDate }}</span>
        <span class="info-value">{{ formData.createTime }}</span>
        <span class="info-label">检验人:</span>
        <span class="info-value">{{ formData.statusUser }}</span>
      </view>
    </view>
    <!-- ç‰©æ–™ä¿¡æ¯åŒº -->
    <view class="material-info">
      <view class="info-block">
        <view class="info-label">线体编号:</view>
        <view class="info-label">生产线别:</view>
        <view v-if="!isUpdate" class="info-value">{{ formData.daa020 }}</view>
        <picker v-if="isUpdate" :range="DAA020List" class="picker info-value-input" name="selector"
                @change="onDaa020Change">
          <view>{{ DAA020List[DAA020Index] }}</view>
        </picker>
        <superwei-combox v-else v-model="formData.daa020" :candidates="DAA020List"
                         class="picker info-value-input" placeholder="请选择或输入"
                         @select="onDaa020Change"></superwei-combox>
      </view>
      <view class="info-block">
        <view class="info-label">物料编码:</view>
        <view v-if="!isUpdate" class="info-value">{{ formData.itemNo }}</view>
        <picker v-if="isUpdate" :range="ItemList" class="picker info-value-input" name="selector"
                @change="onItemChange">
          <view>{{ ItemList[ItemIndex] }}</view>
        </picker>
        <superwei-combox v-else v-model="formData.itemNo" :candidates="boardItems" :isJSON="true"
                         class="picker info-value-input" keyName="itemName" placeholder="请选择或输入"
                         @select="onItemChange"></superwei-combox>
      </view>
      <view class="info-block">
        <view class="info-label">计划编号:</view>
        <view v-if="!isUpdate" class="info-value">{{ formData.billNo }}</view>
        <picker v-if="isUpdate" :range="DAA001List" class="picker info-value-input" name="selector"
                @change="onDaa001Change">
          <view>{{ DAA001List[DAA001Index] }}</view>
        </picker>
      </view>
      <view class="info-block">
        <view class="info-label">物料名称:</view>
        <view class="info-label">产品名称:</view>
        <view class="info-value">{{ formData.itemName }}</view>
      </view>
      <view class="info-block">
@@ -51,43 +41,32 @@
        <view class="info-value">{{ formData.itemModel }}</view>
      </view>
      <view class="info-block">
        <view class="info-label">工单编号:</view>
        <view v-if="!isUpdate" class="info-value">{{ formData.billNo }}</view>
        <picker v-else :range="DAA001List" class="picker info-value-input" name="selector"
                @change="onDaa001Change">
          <view>{{ DAA001List[DAA001Index] }}</view>
        </picker>
        <view class="info-label">项目:</view>
        <view class="info-value">{{ formData.projecT_CODE }}</view>
        <view class="info-label">工单数量:</view>
        <view class="info-value highlight">{{ formData.planQty }}</view>
      </view>
      <view v-if="formData.remarks" class="info-block">
        <view class="info-label">不合格描述:</view>
      <view v-if="formData.remarks && current" class="info-block">
        <view class="info-label">备注:</view>
        <view class="info-value">{{ formData.remarks }}</view>
      </view>
    </view>
    <!-- æ“ä½œæŒ‰é’®åŒº - æ£€éªŒé¡¹ç›®èŽ·å– -->
    <view v-if="isUpdate" class="action-buttons">
      <button class="secondary-btn" @click="getTable">获取检验项目</button>
    <!-- æ“ä½œæŒ‰é’®åŒº -->
    <view class="action-buttons">
      <button v-if="current" class="secondary-btn" @click="getTable">获取检验项目</button>
      <button v-if="formData.billNo" class="secondary-btn" @click="closeInspection">关闭此次检验</button>
    <!-- <button v-if="isShowTable && isUpdate" class="primary-btn" @click="saveTable">生成检验项目</button> -->
    </view>
    <!-- æ£€éªŒé¡¹ç›®è¡¨æ ¼ -->
    <view v-if="tableData.length > 0" class="inspection-table">
      <!-- è¡¨æ ¼å¤´éƒ¨ç»Ÿè®¡ä¿¡æ¯ -->
      <view class="table-header-stats">
        <view class="stats-left">
          <view class="stats-title">检验项目清单</view>
          <view class="stats-subtitle">共 {{ tableData.length }} ä¸ªæ£€éªŒé¡¹ç›®</view>
        </view>
        <view class="stats-right">
          <view class="stat-item passed">
            <span class="stat-count">{{ getPassedCount() }}</span>
            <span class="stat-label">已合格</span>
          </view>
          <view class="stat-item failed">
            <span class="stat-count">{{ getFailedCount() }}</span>
            <span class="stat-label">不合格</span>
          </view>
          <view class="stat-item pending">
            <span class="stat-count">{{ getPendingCount() }}</span>
            <span class="stat-label">待检验</span>
          </view>
        </view>
      </view>
      <table>
        <thead>
        <tr>
@@ -98,35 +77,21 @@
        </thead>
        <tbody>
        <tr v-for="(item, index) in tableData" :key="index">
          <td>{{ item.projName }}</td>
          <td>
            <view class="project-name-wrapper">
                                <span :class="{
                                    'status-approved': item.result=='合格',
                                    'status-rejected': item.result=='不合格',
                                    'status-pending': item.result=='未完成'
                                }" class="status-indicator"></span>
              <span>{{ item.projName }}</span>
            </view>
          </td>
          <td>
            <view v-if="item.result=='合格'" class="watermark approved">
              åˆæ ¼
            </view>
            <view v-if="item.result=='不合格'" class="watermark rejected">
              ä¸åˆæ ¼
            </view>
            <view v-if="item.result=='未完成'" class="watermark pending">
              å¾…检验
            </view>
            <view v-if="item.result=='合格'" class="watermark approved">合格</view>
            <view v-if="item.result=='不合格'" class="watermark rejected">不合格</view>
            <view v-if="item.result=='未完成'" class="watermark pending">待确认</view>
            <view class="description-text">{{ item.itemMod }}</view>
          </td>
          <td>
            <button v-if="item.isCheck < item.levelNum" class="record-btn record-btn-fill"
             <button v-if="item.isCheck < item.levelNum" class="record-btn record-btn-fill"
                    @click="toDetail(item)">
              å¡«å†™ ({{ item.isCheck }}/{{ item.levelNum }})
              å¡«å†™ <!--({{ item.isCheck }}/{{ item.levelNum }})-->
            </button>
            <button v-else class="record-btn record-btn-view" @click="toDetail(item)">
              æŸ¥çœ‹ ({{ item.isCheck }}/{{ item.levelNum }})
             <button v-else class="record-btn record-btn-view" @click="toDetail(item, index)">
              æŸ¥çœ‹<!--({{ item.isCheck }}/{{ item.levelNum }})-->
            </button>
          </td>
        </tr>
@@ -137,18 +102,13 @@
    <!-- æ“ä½œæŒ‰é’®åŒº -->
    <view class="action-buttons">
      <button v-if="isUpdate && !isShowTable" class="secondary-btn" @click="getItem">创建检验单并生成部分默认值</button>
        <!-- <button class="secondary-btn" @click="toYzxSubmitFrom(formData.releaseNo)">一致性核对</button> -->
       <button v-if="!isUpdate && !isShowTable" class="secondary-btn" @click="toYzxSubmitFrom(formData.releaseNo)">一致性核对</button>
      <button v-if="!isUpdate && !isShowTable" class="secondary-btn" @click="toImage">上传/查看图片</button>
      <button v-if="!isUpdate && !formData.fsubmit && !isShowTable" class="secondary-btn" @click="removeXJ">
      <button v-if="!isUpdate && !isShowTable" class="secondary-btn" @click="uploadImages">查看所有图片</button>
      <button v-if="!isUpdate && !isShowTable" class="secondary-btn" @click="addDefectDescription">查看不良描述</button>
      <!--  <button v-if="!isUpdate && !formData.statusUser && !isShowTable" class="secondary-btn" @click="removeXJ">
        åˆ é™¤å•据
      </button>
      <button v-if="!isUpdate && !isShowTable" class="secondary-btn" @click="saveRemarks">添加备注</button>
      <button v-if="!isUpdate && !isShowTable && formData.fsubmit !== 1 && getPendingCount() === 0 && tableData.length > 0" class="primary-btn" @click="submit">审核单据</button>
      <button v-if="isShowTable" class="secondary-btn" @click="getTable">获取检验项目</button>
      <button v-if="isShowTable && isUpdate" class="primary-btn" @click="saveTable">生成检验项目</button>
      </button> -->
      <!-- <button v-if="!isUpdate && !isShowTable" class="secondary-btn" @click="saveRemarks">添加备注</button> -->
      <button v-if="!isUpdate && !isShowTable && current" class="primary-btn" @click="submit">检验提交</button>
    </view>
    <!-- ä¸åˆæ ¼æè¿°å¼¹çª— -->
@@ -173,40 +133,32 @@
  data() {
    return {
      formData: {
        createTime: "",
        id: "",
        releaseNo: "",
        createBy: "",
        createDate: "",
        daa020: "",
        itemNo: "",
        billNo: "",
        catQty: "",
        detailMem: "",
        taskNo: "",
        fcheckResu: 0,
        boardModel: "",
        planQty: "",
        mocode: "",
        boardStyle: "",
        fSubmit: 0
        itemNo: "",
        itemName: "",
        workshopCode: "",
        workshopName: "",
        line: "",
        lineName: "",
        comments: "",
        statusUser: "",
        itemId: "",
        fSubmit: 0,
      },
      DAA020List: [],
      DAA020Index: -1,
      DAA001List: [],
      DAA001Index: -1,
      schemeResult: [],
      isShowTable: false,
      DAA001Index: -1,
      ItemList: [],
      ItemIndex: -1,
      boardItems: [],
      lineList: [],
      lineNo: "",
      womdaaList: [],
      tableData: [],
@@ -214,45 +166,69 @@
      isUpdate: true,
      isShowTable: false,
      remarks: "",
      remarksPopup: false,
      comments: "",
      commentsPopup: false,
      current: true,
    };
  },
  onLoad(options) {
    //options中包含了url附带的参数
    let params = options;
if(params["current"]==='A')
        {
            this.current=true;
        }else if(params["current"]==='B'){
            this.current=false;
        }
    if (params["id"]) {
      this.isUpdate = false;
      this.formData.id = params["id"];
      this.formData.releaseNo = params["releaseNo"];
      //getQaItemXj02
      this.init();
    } else {
      //初始化检验单号
      this.$post({
        url: "/XJ/getMaxReleaseNo"
      }).then(res => {
        this.formData.releaseNo = res.data.tbBillList;
        this.formData.createBy = this.$loginInfo.account;
        this.formData.createDate = this.$getDate("yyyy-mm-dd");
      });
      //车间下拉框的初始化
      this.$post({
        url: "/XJ/getLineAll"
      }).then(res => {
        this.lineList = res.data.tbBillList;
        this.DAA020List = res.data.tbBillList.map(item => item.lineName);
      })
    let params = options;
    // tab çŠ¶æ€è¯†åˆ«
    if(params["current"] === 'A') {
        this.current = true;
    } else if(params["current"] === 'B') {
        this.current = false;
    }
  },
    if (params["id"]) {
        this.isUpdate = false;
        // â­â­â­ æ–°å¢žï¼šå¿…须保存到 this.id,后续接口才能使用
        this.id = params["id"];         // â†â†â† å¿…须加这一句!!!
        // åŽŸæ¥ä½ çš„é€»è¾‘ä¿æŒä¸åŠ¨
        this.formData.id = params["id"];
        this.formData.billNo = params["billNo"];
        // åˆå§‹åŒ–明细
        this.init();
    } else {
        // åˆå§‹åŒ–检验单号
        this.$post({
            url: "/XJ/getMaxReleaseNo"
        }).then(res => {
            this.formData.billNo = res.data.tbBillList;
            this.formData.createTime = this.$getDate("yyyy-mm-dd");
        });
        // äº§å“ç¼–码下拉框初始化
        this.$post({
            url: "/XJ/getLineAll"
        }).then(res => {
            this.lineList = res.data.tbBillList;
            this.DAA020List = res.data.tbBillList.map(item => item.lineName);
            this.formData.itemNo = "";
            this.formData.itemName = "";
            this.formData.workshopCode = "";
            this.formData.workshopName = "";
            this.formData.line = "";
            this.formData.lineName = "";
            this.formData.pbaid = null;
        })
    }
}
,
  methods: {
    // èŽ·å–åˆæ ¼é¡¹ç›®æ•°é‡
    getPassedCount() {
@@ -266,49 +242,26 @@
    getPendingCount() {
      return this.tableData.filter(item => item.result === '未完成').length;
    },
    submit() {
      // åŒé‡ä¿é™©ï¼šæ£€æŸ¥æ˜¯å¦è¿˜æœ‰æœªå®Œæˆçš„æ£€éªŒé¡¹ç›®
      const pendingCount = this.getPendingCount();
      if (pendingCount > 0) {
        this.$showMessage(`还有 ${pendingCount} ä¸ªæ£€éªŒé¡¹ç›®æœªå®Œæˆï¼Œè¯·å®Œæˆæ‰€æœ‰æ£€éªŒé¡¹ç›®åŽå†æäº¤å®¡æ ¸`);
        return;
    // å…³é—­æ­¤æ¬¡æ£€éªŒå¹¶ä¼ å·¡æ£€å•号给后端
    closeInspection() {
      if (this.formData.billNo) {
        this.$post({
          url: "/XJ/closeInspection",
          data: {
            billNo: this.formData.billNo,
            id: this.formData.id
          }
        }).then(res => {
          this.$showMessage("检验已关闭");
          // å…³é—­å½“前页面,返回上一页面
          uni.navigateBack();
        }).catch(err => {
          this.$showMessage("关闭检验失败,请重试");
        });
      } else {
        this.$showMessage("巡检单号不存在");
      }
      // æ£€æŸ¥æ˜¯å¦æœ‰æ£€éªŒé¡¹ç›®
      if (this.tableData.length === 0) {
        this.$showMessage("没有检验项目,无法提交审核");
        return;
      }
      this.$post({
        url: "/XJ/XJQaSubmit",
        data: {
          userNo: this.$loginInfo.account,
          gid: this.formData.id
        }
      }).then(res => {
        console.log("完整响应数据:", res);
        console.log("Status Code的值:", res.statusCode);
        console.log("返回的数据:", res.data);
        // æ£€æŸ¥å¤šç§æˆåŠŸæ¡ä»¶
        if (res.statusCode === 200 || res.status === 0 || res.data === true || res.data.tbBillList === true) {
          this.$showMessage("成功提交检验");
          // æäº¤æˆåŠŸåŽè·³è½¬åˆ°åˆ—è¡¨é¡µé¢
          setTimeout(() => {
            uni.navigateTo({
              url: '/pages/QC/XJ/List'
            });
          }, 1500); // 1.5秒后跳转,让用户看到成功提示
        } else {
          this.$showMessage(res.data.message || res.message || "提交失败");
        }
      }).catch(err => {
        console.log("提交出错:", err);
        this.$showMessage("提交失败,请重试");
      })
    },
    removeXJ() {
      if (this.formData.id) {
        this.$post({
@@ -329,38 +282,105 @@
        this.$showMessage("请先选择检验单号");
      }
    },
    getItem() {
      if (this.isSubmit) {
        this.$showMessage("此物料无启用的检验项目,请维护!");
        return;
      }
      if (!this.formData.billNo) {
        this.$showMessage("请选择计划编号");
        return;
      }
    submit() {
      this.$post({
        url: "/XJ/save",
        url: "/XJ/XJQaSubmit",
        data: {
          from: this.formData,
          userNo: this.$loginInfo.account,
          items: this.tableData
          gid: this.formData.id
        }
      }).then(res => {
        this.formData.id = res.data.tbBillList;
        this.$showMessage("生成检验项目成功");
        this.init();
        this.isUpdate = false;
      });
        //2024-11-28 kyy æ ¡éªŒåˆæ ¼æäº¤å¢žåŠ æç¤º
        console.log("完整响应数据:", res);
        console.log("Status Code的值:", res.statusCode);
        console.log("返回的数据:", res.data);
        // æ£€æŸ¥å¤šç§æˆåŠŸæ¡ä»¶
        if (res.statusCode === 200 || res.status === 0 || res.data === true || res.data.tbBillList === true) {
          this.$showMessage("成功提交检验");
          // æäº¤æˆåŠŸåŽè·³è½¬åˆ°åˆ—è¡¨é¡µé¢
          setTimeout(() => {
            uni.navigateTo({
              url: '/pages/QC/XJ/List'
            });
          }, 1500); // 1.5秒后跳转,让用户看到成功提示
        } else {
          this.$showMessage(res.data.message || res.message || "提交失败");
        }
      }).catch(err => {
        console.log("提交出错:", err);
        this.$showMessage("提交失败,请重试");
      })
    },
    //生产线别选择并初始话工单号
    init() {
      if (this.formData.id) {
        this.$post({
          url: "/XJ/getPage",
          data: {
            pageIndex: 1,
            limit: 1,
            id: this.formData.id
          }
        }).then(res => {
          let tbBillListElement = res.data.tbBillList[0];
          if (tbBillListElement) {
            // ä¿å­˜åŽŸæœ‰çš„ID值
            const originalId = this.formData.id;
            // ä¿å­˜åŽŸæœ‰çš„billNo值
            const originalBillNo = this.formData.billNo;
            // å°†æœåŠ¡å™¨è¿”å›žçš„æ•°æ®åˆå¹¶åˆ°çŽ°æœ‰æ•°æ®ä¸­ï¼Œè€Œä¸æ˜¯ç›´æŽ¥æ›¿æ¢
            Object.assign(this.formData, tbBillListElement);
            // ç¡®ä¿å…³é”®å­—段值不被覆盖
            if ((!this.formData.id || this.formData.id === null || this.formData.id === undefined || this.formData.id === "") && originalId) {
              this.formData.id = originalId;
            }
            if ((!this.formData.billNo || this.formData.billNo === null || this.formData.billNo === undefined || this.formData.billNo === "") && originalBillNo) {
              this.formData.billNo = originalBillNo;
            }
            this.$post({
              url: "/XJ/getJYItem",
              data: {
                pid: this.formData.id
              }
            }).then(res => {
              this.tableData.splice(0, this.tableData.length, ...res.data.tbBillList);
              this.tableData.sort((a, b) => {
                if (a.result === '未完成' && b.result === '合格') {
                  return -1;
                } else if (a.result === '合格' && b.result === '未完成') {
                  return 1;
                } else {
                  return 0;
                }
              });
              if (this.tableData.length === 0) {
                this.isShowTable = true;
              }
              console.log('init完成后tableData长度:', this.tableData.length, 'isShowTable:', this.isShowTable);
            })
          }
        })
      }
    },
    onDaa020Change(event) {
      //获取生产线别的下标地址
      this.DAA020Index = event.mp.detail.value;
      //this.formData.line = event;
      this.lineNo = this.lineList[this.DAA020Index].lineNo;
      this.lineNo = this.lineList[this.DAA020List.indexOf(event)].lineNo;
      this.formData.line = this.lineNo;
      this.$post({
        url: "/XJ/getBoardItem",
@@ -370,18 +390,15 @@
      }).then(res => {
        //填充工单号的数据源
        this.boardItems = res.data.tbBillList;
        this.ItemList = this.boardItems.map(item => item.itemName);
        //变为默认空值的状态
        this.ItemIndex = -1;
      })
    },
    onItemChange(event) {
      this.ItemIndex = event.mp.detail.value;
      this.formData.itemNo = this.boardItems[this.ItemIndex].itemNo;//主要是改这里
      this.formData.itemId = this.boardItems[this.ItemIndex].id;//主要是改这里
      this.formData.itemName = this.boardItems[this.ItemIndex].itemName;//主要是改这里
      this.formData.itemModel = this.boardItems[this.ItemIndex].itemModel;//主要是改这里
      this.formData.itemNo = event.itemNo;
      this.$post({
        url: "/XJ/getDaa001",
        data: {
@@ -394,107 +411,253 @@
        this.DAA001List = this.schemeResult.map(s => s.daa001);
        //变为默认空值的状态
        this.DAA001Index = -1;
        this.formData.billNo = "";
        this.formData.daa001 = "";
      })
    },
    //选取工单填充物料号和其他信息
    onDaa001Change(event) {
      this.DAA001Index = event.mp.detail.value;
      this.formData.billNo = this.schemeResult[this.DAA001Index].daa001;
      this.formData.planQty = this.schemeResult[this.DAA001Index].daa008;
      this.formData.daa001 = this.schemeResult[this.DAA001Index].daa001;
      //表单中的部分字段赋值
      this.$post({
        url: "/XJ/getItem",
        data: {
          daa001: this.formData.billNo
          daa001: this.formData.daa001
        }
      }).then(res => {
        let data = res.data.tbBillList[0];
        //当返回的结果集为空时置空原有的值
        if (!data) {
          this.formData.billNo = "";
          this.formData.taskNo = "";
          this.formData.itemNo = "";
          this.formData.planQty = "";
          this.tableData = [];
          this.tableData.splice(0, this.tableData.length);
          return;
        }
        //不为空时赋值
        this.formData.daa001 = data.daa001;
        this.formData.daa003 = data.daa003;
        this.formData.daa004 = data.daa004;
        this.formData.daa008 = data.daa008;
        this.formData.projecT_CODE = data.projecT_CODE;
        this.formData.itemId = data.itemId;
        this.formData.pbaid = data.pbaid;
        this.formData.remarks = data.remarks;
      })
    },
    toDetail(item, index) {
  // æ£€æŸ¥æ£€éªŒå•是否存在
  if (!this.formData.id) {
    this.$showMessage("检验单数据不完整,请先获取检验项目或重新加载页面");
    return;
  }
        this.$post({
          url: "/XJ/setJYItem",
          data: {
            itemNo: this.formData.itemNo
          }
        }).then(res => {
          if (res.data.tbBillList.length > 0) {
            this.tableData = res.data.tbBillList; // åœ¨ç®­å¤´å‡½æ•°ä¸­ï¼Œthis æŒ‡å‘外层作用域的 this
            this.isSubmit = false;
          } else {
            this.$showMessage("此物料没有启用的检验项目,请维护!");
            this.isSubmit = true;
            this.tableData = [];
          }
        });
  if (this.isUpdate) {
    uni.showToast({
      icon: "none",
      title: "请先生成检验项目",
      duration: 2000,
    });
    return;
  }
  // å¦‚æžœ item.id ä¸å­˜åœ¨ï¼Œå°±ä¼ ç©ºå­—符串或者特殊标识
  const itemId = item.id != null ? item.id : '';
  const billNo = this.formData.billNo || '';
  const gid = this.formData.id || '';
  const itemIndex = index != null ? index : 0;
  uni.navigateTo({
    url: 'detail?id=' + encodeURIComponent(itemId) +
         '&billNo=' + encodeURIComponent(billNo) +
         '&gid=' + encodeURIComponent(gid) +
         '&index=' + encodeURIComponent(itemIndex)
  });
},
    getTable() {
      // åœ¨å¼€å§‹æ—¶æ¸…空现有数据,避免累加
      this.tableData.splice(0, this.tableData.length);
      // ç¡®ä¿itemNo存在
      if (!this.formData || !this.formData.itemNo) {
        this.$showMessage("请先选择物料编码");
        return;
      }
      // æ˜¾ç¤ºåŠ è½½æç¤ºï¼Œé˜²æ­¢ç”¨æˆ·åœ¨ä¿å­˜è¿‡ç¨‹ä¸­ç‚¹å‡»å¡«å†™æŒ‰é’®
      uni.showLoading({
        title: '正在获取检验项目...'
      });
    },    toYzxSubmitFrom(releaseNo){
        uni.navigateTo({
            url: 'yzxFrom?id=' +this.formData.id+'&current='+this.current
        });
    },
    init() {
      this.$post({
        url: "/XJ/getPage",
        url: "/XJ/setJYItem",
        data: {
          id: this.formData.id,
          pageIndex: 1,
          limit: 1,
          itemNo: this.formData.itemNo
        }
      }).then(res => {
        let data = res.data.tbBillList[0];
        if (data) {
          this.formData = data;
        if (res.data && res.data.tbBillList && res.data.tbBillList.length > 0) {
          // ç›´æŽ¥èµ‹å€¼ï¼Œé¿å…ç´¯åŠ 
          this.tableData.splice(0, this.tableData.length, ...res.data.tbBillList);
          // è®¾ç½®çŠ¶æ€ä»¥æ˜¾ç¤ºç”Ÿæˆæ£€éªŒé¡¹ç›®æŒ‰é’®
          this.isShowTable = true;
          this.isUpdate = true;  // æ³¨æ„è¿™é‡Œæ˜¯true,表示可以生成检验项目
          console.log('getTable完成后的状态:', {
            isShowTable: this.isShowTable,
            isUpdate: this.isUpdate,
            tableDataLength: this.tableData.length
          });
          // æ˜¾ç¤ºæˆåŠŸæ¶ˆæ¯
          this.$showMessage("检验项目获取成功");
          this.$post({
            url: "/XJ/getJYItem",
            data: {
              pid: this.formData.id
            }
          }).then(res1 => {
            let tableData = res1.data.tbBillList
            //当已检验个数都不为空时按照检测结构排序
            tableData.sort((a, b) => {
              if (a.result === '未完成' && b.result === '合格') {
                return -1;
              } else if (a.result === '合格' && b.result === '未完成') {
                return 1;
              } else {
                return 0;
              }
            });
            this.tableData = tableData;
            if (this.tableData.length === 0) {
              this.isShowTable = true;
            }
          })
//生成检验项目的逻辑(根据规范已注释)
       this.saveTable();
      // è‡ªåŠ¨åˆ·æ–°é€»è¾‘(根据规范已注释)
      // èŽ·å–å½“å‰é¡µé¢è·¯å¾„å’Œå‚æ•°
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
const route = '/' + currentPage.route;
const options = currentPage.options; // é¡µé¢å‚数对象
// æ‹¼æŽ¥å‚æ•°
let query = '';
for (let key in options) {
  query += `${key}=${options[key]}&`;
}
query = query.slice(0, -1);
// åˆ·æ–°å½“前页面
uni.redirectTo({
  url: query ? `${route}?${query}` : route
});
location.reload()
        } else {
          this.$showMessage("此物料没有启用的检验项目,请维护!");
          this.tableData.splice(0, this.tableData.length);
        }
        // éšè—åŠ è½½æç¤ºï¼Œå…è®¸ç”¨æˆ·æ“ä½œ
        uni.hideLoading();
      }).catch(err => {
        console.error("获取检验项目失败:", err);
        this.$showMessage("获取检验项目失败,请检查网络连接");
        uni.hideLoading();
      });
    },
    toDetail(item) {
      if (this.isUpdate) {
        uni.showToast({
          icon: "none",
          title: "请先生成检验项目",
          duration: 2000,
        });
      } else {
        uni.navigateTo({
          url: 'detail?id=' + item.id + '&billNo=' + this.formData.billNo + '&gid=' + this.formData
              .id
        });
    saveTable() {
      if (this.tableData.length === 0) {
        return;
      }
    }, saveRemarks() {
      // æ˜¾ç¤ºåŠ è½½æç¤º
      uni.showLoading({
        title: '正在保存...'
      });
      this.$post({
        url: "/XJ/saveItem",
        data: {
          gid: this.formData.id,
          items: this.tableData,
          statusUser: this.$loginInfo.account,
          ItemNo:this.formData.itemNo
        }
      }).then(res => {
        // åªåœ¨éœ€è¦æ—¶æ›´æ–°tableData,避免重复累加
        if (res.data && res.data.tbBillList && res.data.tbBillList.items) {
          // ç¡®ä¿å®Œå…¨æ›¿æ¢è€Œä¸æ˜¯ç´¯åŠ 
          this.tableData.splice(0, this.tableData.length, ...res.data.tbBillList.items);
        }
        // é‡è¦ï¼šç¡®ä¿formData.id不被覆盖
        if (!this.formData.id) {
          this.$showMessage("警告:检验单ID丢失,请重新加载页面");
        }
        // è®¾ç½®çŠ¶æ€ä»¥æ˜¾ç¤ºæ£€éªŒæäº¤æŒ‰é’®
        this.isShowTable = false;
        this.isUpdate = false;
        console.log('saveTable完成后的状态:', {
          isShowTable: this.isShowTable,
          isUpdate: this.isUpdate,
          tableDataLength: this.tableData.length
        });
        // æ˜¾ç¤ºæˆåŠŸæ¶ˆæ¯
        this.$showMessage("生成检验项目成功");
        // éšè—åŠ è½½æç¤ºï¼Œå…è®¸ç”¨æˆ·æ“ä½œ
        uni.hideLoading();
      }).catch(err => {
        console.error("保存检验项目失败:", err);
        this.$showMessage("保存检验项目失败,请重试");
        uni.hideLoading();
      })
    },
    toYzxSubmitFrom(releaseNo){
      uni.navigateTo({
        url: 'yzxFrom?id=' +this.formData.id+'&current='+(this.current ? 'true' : 'false')
      });
    },
    toSNScanCode(releaseNo){
      uni.navigateTo({
        url: 'ScanCode?id=' +this.formData.id+'&current='+(this.current ? 'true' : 'false')
      });
    },
    save() {
      // if (this.tableData.length === 0) {
      //     this.$showMessage(this.formData.itemNo + "物料没有检验项目");
      //     return;
      // }
      if (!this.formData.daa001) {
        this.$showMessage("请选择计划编号");
        return;
      }
      this.formData.statusUser = this.$loginInfo.account;
      this.$post({
        url: "/XJ/save",
        data: {
          from: this.formData,
          userNo: this.$loginInfo.account,
          items: this.tableData
        }
      }).then(res => {
        // ä¿å­˜åŽŸæœ‰çš„ID值
        const originalId = this.formData.id;
        // è®¾ç½®æ–°çš„ID值(如果返回的是ID)
        if (res.data.tbBillList && typeof res.data.tbBillList === 'string' && res.data.tbBillList !== null && res.data.tbBillList !== undefined && res.data.tbBillList !== "") {
          this.formData.id = res.data.tbBillList;
        }
        // å¦‚果没有返回新的ID,则保持原有的ID
        if (!this.formData.id && originalId) {
          this.formData.id = originalId;
        }
        this.$showMessage("生成检验项目成功");
        this.init();
        this.isUpdate = false;
      });
    },
    saveRemarks() {
      this.remarksPopup = !this.remarksPopup;
      this.remarks = this.formData.remarks;
    },
    saveComments() {
      this.commentsPopup = !this.commentsPopup;
      this.comments = this.formData.comments;
    },
    editRemarks() {
      if (this.remarks) {
@@ -514,54 +677,42 @@
        })
      }
    },
    toImage() {
      uni.navigateTo({
        url: 'ImageItem?id=' + this.formData.id
      });
    },
    getTable() {
      this.$post({
        url: "/XJ/setJYItem",
        data: {
          itemNo: this.formData.itemNo
        }
      }).then(res => {
        if (res.data.tbBillList.length > 0) {
          this.tableData = res.data.tbBillList; // åœ¨ç®­å¤´å‡½æ•°ä¸­ï¼Œthis æŒ‡å‘外层作用域的 this
          this.isShowTable = true;
          this.isUpdate = true;
        } else {
          this.$showMessage("此物料没有启用的检验项目,请维护!");
          this.isShowTable = true;
          this.isUpdate = false;
          this.tableData = [];
        }
      });
    },
    saveTable() {
      if (this.tableData.length === 0) {
        return;
    editComments() {
      if (this.comments) {
        //saveRemarksGid
        this.$post({
          url: "/XJ/saveCommentGid",
          data: {
            gid: this.formData.id,
            comments: this.comments
          }
        }).then(res => {
          if (res.data.tbBillList > 0) {
            this.formData.comments = this.comments;
            this.commentsPopup = !this.commentsPopup;
            this.$showMessage("保存成功");
          }
        })
      }
      this.$post({
        url: "/XJ/saveItem",
        data: {
          gid: this.formData.id,
          items: this.tableData,
          userNo: this.$loginInfo.account
        }
      }).then(res => {
        this.formData.id = res.data.tbBillList;
        this.isShowTable = false;
        this.isUpdate = false;
        this.init();
      })
    }
    },
    uploadImages() {
      // æŸ¥çœ‹æ‰€æœ‰å›¾ç‰‡çš„逻辑
      console.log('点击了查看所有图片按钮,billNo:', this.formData.billNo);
      uni.navigateTo({
        url: 'ImageItemALL?id=' + this.formData.id
      });
    },
    addDefectDescription() {
      // æŸ¥çœ‹æ‰€æœ‰ä¸è‰¯æè¿°çš„逻辑
      console.log('点击了查看不良描述按钮,billNo:', this.formData.billNo);
      uni.navigateTo({
        url: 'Blms?id=' + this.formData.id
      });
    },
  },
  onShow() {
    //每次进入页面都会执行的方法
    if (this.formData.id) {
      this.init();
    }
    this.init();
  }
};
</script>
@@ -663,125 +814,6 @@
/* è¡¨æ ¼æ ·å¼ */
.inspection-table {
  margin: 25px 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background: #fff;
}
/* è¡¨æ ¼å¤´éƒ¨ç»Ÿè®¡ä¿¡æ¯ */
.table-header-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-bottom: 1px solid #e0e0e0;
}
.stats-left .stats-title {
  font-size: 18px;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 4px;
}
.stats-left .stats-subtitle {
  font-size: 14px;
  color: #7f8c8d;
}
.stats-right {
  display: flex;
  gap: 16px;
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  min-width: 60px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.stat-item.passed {
  background: linear-gradient(135deg, rgba(39, 174, 96, 0.1), rgba(39, 174, 96, 0.2));
  border: 1px solid rgba(39, 174, 96, 0.3);
}
.stat-item.failed {
  background: linear-gradient(135deg, rgba(230, 126, 34, 0.1), rgba(230, 126, 34, 0.2));
  border: 1px solid rgba(230, 126, 34, 0.3);
}
.stat-item.pending {
  background: linear-gradient(135deg, rgba(243, 156, 18, 0.1), rgba(243, 156, 18, 0.2));
  border: 1px solid rgba(243, 156, 18, 0.3);
}
.stat-count {
  font-size: 20px;
  font-weight: bold;
  line-height: 1;
  margin-bottom: 2px;
}
.stat-item.passed .stat-count {
  color: #27ae60;
}
.stat-item.failed .stat-count {
  color: #e67e22;
}
.stat-item.pending .stat-count {
  color: #f39c12;
}
.stat-label {
  font-size: 12px;
  color: #7f8c8d;
  font-weight: 500;
}
/* ç§»åŠ¨ç«¯è¡¨æ ¼å¤´éƒ¨ç»Ÿè®¡ */
@media (max-width: 500px) {
  .table-header-stats {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 16px;
  }
  .stats-right {
    width: 100%;
    justify-content: space-around;
    gap: 8px;
  }
  .stat-item {
    flex: 1;
    min-width: auto;
    padding: 6px 8px;
  }
  .stat-count {
    font-size: 16px;
  }
  .stat-label {
    font-size: 11px;
  }
  .stats-left .stats-title {
    font-size: 16px;
  }
  .stats-left .stats-subtitle {
    font-size: 13px;
  }
}
.inspection-table table {
@@ -790,82 +822,30 @@
}
.inspection-table th, .inspection-table td {
  padding: 16px 20px;
  border: none;
  padding: 12px 15px;
  border: 1px solid #ddd;
  text-align: left;
  border-bottom: 1px solid #eee;
}
.inspection-table th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  font-weight: 600;
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.5px;
  position: relative;
  background-color: #f8f9fa;
  font-weight: bold;
  color: #34495e;
}
.inspection-table tbody tr {
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
.inspection-table tr:nth-child(even) {
  background-color: #f9f9f9;
}
.inspection-table tbody tr:nth-child(even) {
  background-color: #f8fafc;
}
.inspection-table tbody tr:hover {
  background-color: #e8f4fd;
  border-left-color: #3498db;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}
/* æ£€éªŒé¡¹ç›®åˆ—样式 */
.inspection-table td:first-child {
  font-weight: 600;
  color: #2c3e50;
  font-size: 15px;
}
/* é¡¹ç›®åç§°åŒ…装器 */
.project-name-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* çŠ¶æ€æŒ‡ç¤ºå™¨ */
.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}
.status-indicator.status-approved {
  background-color: #27ae60;
  box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.3);
}
.status-indicator.status-rejected {
  background-color: #e67e22;
  box-shadow: 0 0 0 2px rgba(230, 126, 34, 0.3);
}
.status-indicator.status-pending {
  background-color: #f39c12;
  box-shadow: 0 0 0 2px rgba(243, 156, 18, 0.3);
.inspection-table tr:hover {
  background-color: #f1f5f9;
}
/* æ£€éªŒæè¿°åˆ—特殊样式 */
.inspection-table td:nth-child(2) {
  position: relative;
  min-height: 80px;
  vertical-align: top;
  padding: 16px 20px;
  overflow: hidden;
  padding: 0;
}
/* æŒ‰é’®æ ·å¼ */
@@ -905,99 +885,74 @@
}
.record-btn {
  padding: 8px 16px;
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 13px;
  box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
  transition: all 0.2s;
}
.record-btn:hover {
  background: linear-gradient(135deg, #2980b9, #1f618d);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(52, 152, 219, 0.4);
}
.record-btn:active {
  transform: translateY(0);
  background-color: #e9ecef;
}
/* å¡«å†™çŠ¶æ€æŒ‰é’® */
.record-btn-fill {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  box-shadow: 0 2px 4px rgba(46, 204, 113, 0.3);
  background-color: #f8f9fa;
  border: 1px solid #ddd;
}
.record-btn-fill:hover {
  background: linear-gradient(135deg, #27ae60, #229954);
  box-shadow: 0 4px 8px rgba(46, 204, 113, 0.4);
  background-color: #e9ecef;
}
/* æŸ¥çœ‹çŠ¶æ€æŒ‰é’® */
.record-btn-view {
  background: linear-gradient(135deg, #95a5a6, #7f8c8d);
  box-shadow: 0 2px 4px rgba(149, 165, 166, 0.3);
  background-color: #f8f9fa;
  border: 1px solid #ddd;
}
.record-btn-view:hover {
  background: linear-gradient(135deg, #7f8c8d, #6c7b7d);
  box-shadow: 0 4px 8px rgba(149, 165, 166, 0.4);
  background-color: #e9ecef;
}
/* æ°´å°æ ·å¼ */
.watermark {
  position: absolute;
  font-size: 32px;
  font-size: 40px;
  font-weight: bold;
  opacity: 0.4;
  z-index: 3;
  opacity: 1;
  z-index: 1;
  pointer-events: none;
  bottom: 8px;
  right: 8px;
  transform: rotate(-15deg);
  transform-origin: bottom right;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
  min-width: 60px;
  width: 100%;
  text-align: center;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
}
.watermark.approved {
  color: #27ae60; /* æ›´æ·¡çš„绿色 */
  color: #2ecc71; /* ç»¿è‰² */
}
.watermark.rejected {
  color: #e67e22; /* æ›´æ·¡çš„红色 */
  color: #e74c3c; /* çº¢è‰² */
}
.watermark.pending {
  color: #f39c12; /* æ©™è‰² */
}
/* æè¿°æ–‡æœ¬æ ·å¼ */
/* æè¿°æ–‡æœ¬å®¹å™¨ */
.description-text {
  position: relative;
  z-index: 2;
  padding: 12px 16px;
  background: transparent;
  line-height: 1.6;
  font-size: 14px;
  color: #555;
  margin: 0;
  word-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
  /* ç¡®ä¿æ–‡å­—不会太长遮挡水印 */
  padding-right: 80px;
  min-height: 20px;
  display: block;
  padding: 25px;
  background-color: rgba(255, 255, 255, 0.7);
}
/* å¼¹å‡ºå±‚样式 */
/* å¼¹çª—样式 */
.overlay {
  position: fixed;
  top: 0;
@@ -1008,74 +963,55 @@
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  z-index: 1000;
}
.popup {
  background-color: #fff;
  background-color: white;
  padding: 20px;
  border: 1px solid #ccc;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  width: 85vw;
  min-height: 35vh;
  max-height: 60vh;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  width: 90%;
}
.popup h3 {
  margin-top: 0;
  color: #2c3e50;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 15px;
  font-size: 16px;
  text-align: center;
  color: #333;
}
.popup .form-group {
.form-group {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
}
.popup .form-label {
.form-label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  font-size: 14px;
  color: #555;
}
.popup .form-input {
.form-input {
  width: 100%;
  padding: 8px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}
.popup .form-textarea {
  min-height: 120px;
.form-textarea {
  height: 100px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}
.popup-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.updateBut {
  background-color: #3498db;
  color: white;
  padding: 10px 20px;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  margin-right: 10px;
  cursor: pointer;
  transition: all 0.3s;
  margin-right: 10px;
}
.updateBut:hover {
@@ -1083,32 +1019,26 @@
}
/* å“åº”式设计 */
@media (max-width: 500px) {
  .info-row,
  .info-block {
    flex-direction: column;
    align-items: flex-start;
@media (max-width: 768px) {
  .inspection-sheet {
    padding: 10px;
  }
  .info-row {
    flex-direction: column;
  }
  .info-label, .info-value {
    margin-bottom: 5px;
  }
  .action-buttons {
    flex-direction: column;
  }
  .inspection-table table {
    display: block;
    overflow-x: auto;
  }
  /* ç§»åŠ¨ç«¯å¼¹å‡ºæ¡†ä¼˜åŒ– */
  .popup {
    width: 95vw;
    min-height: 40vh;
    max-height: 70vh;
    padding: 15px;
  }
  .popup .form-textarea {
    min-height: 100px;
  .primary-btn, .secondary-btn {
    width: 100%;
    margin-bottom: 10px;
  }
}
</style>
pages/QC/XJ/Blms.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,112 @@
<template>
  <view class="inspection-sheet">
    <!-- ä¸è‰¯æè¿°è¡¨æ ¼ -->
    <view class="inspection-table">
      <table>
        <thead>
          <tr>
            <th width="35%" style="text-align: center;">检验项目</th>
            <th width="50%" style="text-align: center;">不良描述</th>
          </tr>
        </thead>
        <tbody>
          <tr v-for="(item, index) in tableData" :key="index">
            <td>{{ item.proJ_NAME }}</td>
            <td>
              <view class="description-text">{{ item.remarks }}</view>
            </td>
          </tr>
        </tbody>
      </table>
    </view>
  </view>
</template>
<script>
export default {
  data() {
    return {
      formData: {
        id: ""
      },
      tableData: []
    }
  },
  onLoad(options) {
    let params = options;
    this.formData.id = params["id"];
  },
  methods: {
    onShow() {
      if (this.formData.id) {
        this.init();
      }
    },
    init() {
      let userName = this.$loginInfo.account;
      this.$post({
        url: "/XJ/getJYBlmsItem",
        data: {
          id: this.formData.id
        }
      }).then(res => {
         this.tableData=res.data;
      });
    }
  }
}
</script>
<style>
.inspection-sheet {
  font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.inspection-table {
  margin: 25px 0;
}
.inspection-table table {
  width: 100%;
  border-collapse: collapse;
}
.inspection-table th, .inspection-table td {
  padding: 12px 15px;
  border: 1px solid #ddd;
  text-align: left;
}
.inspection-table th {
  background-color: #f8f9fa;
  font-weight: bold;
  color: #34495e;
}
.inspection-table tr:nth-child(even) {
  background-color: #f9f9f9;
}
.inspection-table tr:hover {
  background-color: #f1f5f9;
}
.description-text {
  position: relative;
  z-index: 2;
  padding: 25px;
  background-color: rgba(255, 255, 255, 0.7);
}
@media (max-width: 500px) {
  .inspection-table table {
    display: block;
    overflow-x: auto;
  }
}
</style>
pages/QC/XJ/ImageItemALL.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,248 @@
<template>
  <!-- #ifdef APP -->
  <scroll-view class="page-scroll-view">
    <!-- #endif -->
    <view>
      <view class="uni-common-mt">
        <view class="uni-list list-pd" style="padding: 15px;">
          <view class="uni-flex" style="margin-bottom: 10px;">
            <view class="uni-list-cell-left">点击可预览选好的图片</view>
            <view style="margin-left: auto;">
              <text class="click-t">共有{{ qsImage.length }}张图片</text>
            </view>
          </view>
          <view class="uni-flex" style="flex-wrap: wrap;">
            <view v-for="(image,index) in qsImage" :key="index" class="uni-uploader__input-box"
                  style="position: relative; border: 0;">
              <image :src="image.img" :data-src="image.img"
                     @tap="previewImage(index)"></image>
              <!-- <image src="/static/plus.png" class="image-remove" @click="removeImage(index,image.id)"></image> -->
            </view>
            <!-- <image class="uni-uploader__input-box" @tap="chooseImage" src="/static/plus.png"></image> -->
          </view>
        </view>
      </view>
      <view class="plus-button">
        <!-- <button type="primary" class="upImg" @click="save">上传图片</button> -->
      </view>
    </view>
    <!-- #ifdef APP -->
  </scroll-view>
  <!-- #endif -->
</template>
<script>
import {pathToBase64, base64ToPath} from '../../../js_sdk/mmmm-image-tools/index'
var sourceTypeArray = [
  ['camera'],
  ['album'],
  ['camera', 'album']
]
var sizeTypeArray = [
  ['compressed'],
  ['original'],
  ['compressed', 'original']
]
export default {
  data() {
    return {
      title: 'choose/previewImage',
      sourceTypeIndex: 2,
      sourceType: ['拍照', '相册', '拍照或相册'],
      sizeTypeIndex: 2,
      sizeType: ['压缩', '原图', '压缩或原图'],
      countIndex: 8,
      count: [1, 2, 3, 4, 5, 6, 7, 8, 9],
      isCrop: false,
      cropPercent: 80,
      cropWidth: 100,
      cropHeight: 100,
      cropResize: false,
      qsImage: [],
      fid: 0,
    }
  },
  onLoad(options) {
    //options中包含了url附带的参数
    let params = options;
    if (params["id"]) {
      this.fid = params["id"];
      //getQaItemXj02
      this.init();
    }
  },
  onUnload() {
    this.qsImage = [];
    this.sourceTypeIndex = 2
    this.sourceType = ['拍照', '相册', '拍照或相册']
    this.sizeTypeIndex = 2
    this.sizeType = ['压缩', '原图', '压缩或原图']
    this.countIndex = 8
  },
  methods: {
    removeImage(index, id) {
      this.qsImage.splice(index, 1);
      if (id) {
        this.$post({
          url: "/Base/removeImage",
          data: {
            id: id
          }
        }).then(res => {
        });
      }
    },
    chooseImage() {
      if (this.qsImage.length >= 9) {
        uni.showToast({
          position: "bottom",
          title: "已经有9张图片了,请删除部分图片之后重新选择"
        });
        return;
      }
      uni.chooseImage({
        sourceType: sourceTypeArray[this.sourceTypeIndex],
        //sizeType: sizeTypeArray[this.sizeTypeIndex],
         sizeType: ['compressed'], // å¼ºåˆ¶ä½¿ç”¨åŽ‹ç¼©æ¨¡å¼
        crop: this.isCrop ? {
          "quality": this.cropPercent,
          "width": this.cropWidth,
          "height": this.cropHeight,
          "resize": this.cropResize
        } : null,
        count: this.qsImage.length + this.count[this.countIndex] > 9 ? 9 - this.qsImage.length : this.count[this.countIndex],
        success: (res) => {
          pathToBase64(url)
              .then(base64 => {
                // æ‰¾åˆ°æœ€åŽä¸€ä¸ªæ–œæ çš„位置
                let lastSlashIndex = url.lastIndexOf("/");
                // æå–文件名
                let fileName = url.substring(lastSlashIndex + 1);
                let entity = {};
                entity.img = base64;
                entity.Picturename = fileName;
                entity.fid = this.fid;
                entity.qsType = 4;
                entity.base64Date = base64.split(',')[1];
                this.qsImage.push(entity);
              })
              .catch(error => {
                console.error(error)
              })
        },
        fail: (err) => {
          console.log("err: ", JSON.stringify(err));
        }
      });
    },
    previewImage(index) {
        // console.log(this.qsImage.map(s=>s.img)[0])
        let imagesArry = [];
        base64ToPath(this.qsImage.map(s=>s.img)[index]).then(path => {
                        uni.hideLoading();
                         imagesArry[0] = path
                        console.log(path);
                        uni.previewImage({
                            current: 0,
                            urls: imagesArry
                        })
                    })
      // uni.previewImage({
      //   current: '0', // è®¾ç½®å½“前显示图片的链接
      //   urls: this.qsImage.map(s=>s.img), // éœ€è¦é¢„览的图片链接列表
      //   loop: false, // æ˜¯å¦å¼€å¯å›¾ç‰‡è½®æ’­ï¼Œé»˜è®¤ä¸º false
      //   indicator: 'pointer',// å›¾ç‰‡æŒ‡ç¤ºå™¨ç±»åž‹ï¼Œå¯é€‰å€¼ä¸º "default"、"number"、"pointer",默认为 "default"
      // });
    },
    init() {
      this.$post({
        url: "/Base/getXjAllImgByFid",
        data: {
          id: this.fid,
          qsType: 4
        }
      }).then(res => {
        let tableData = res.data.tbBillList;
        this.qsImage = tableData;
        this.qsImage.forEach(s => {
          s.img = 'data:image/png;base64,' + s.base64Date;
        });
      });
    },
    save() {
      this.$post({
        url: "/Base/saveImage",
        data: {
          entity: this.qsImage
        }
      }).then(res => {
        this.init();
        this.$showMessage("保存成功");
      });
    }
  }
}
</script>
<style>
.click-t {
  color: darkgray;
}
.list-pd {
  margin-top: 25px;
}
.uni-uploader__input-box {
  margin: 5px;
  border: 1px solid #D9D9D9;
}
.image-remove {
  transform: rotate(45deg);
  width: 25px;
  height: 25px;
  position: absolute;
  top: 0;
  right: 0;
  border-radius: 13px;
  background-color: #FF0000;
}
.uni-common-mt {
  background-color: #ffffff;
  /* çº¢è‰²èƒŒæ™¯ */
}
.plus-button {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  background-color: #ffffff; /* èƒŒæ™¯é¢œè‰² */
  /* padding: 10px; */
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1); /* æ·»åŠ åº•éƒ¨é˜´å½±æ•ˆæžœ */
  z-index: 999; /* ç¡®ä¿æŒ‰é’®ä½äºŽé¡¶å±‚ */
}
.uni-flex {
  max-height: calc(100vh - 240px); /* å±å¹•高度减去上传按钮高度 */
  overflow-y: auto; /* å½“内容超出高度时出现垂直滚动条 */
}
.upImg{
      background-color: #3498db;
      color: white;
}
</style>
pages/QC/XJ/detail.vue
@@ -94,9 +94,14 @@
          <view class="input-group input1">
            <view class="input-wrapper">
              <button class="btn upload-btn" @click="chooseImage">
                <uni-icons type="upload" size="16" color="#fff"></uni-icons>
                ä¸Šä¼ /查看图片
              </button>
              <input v-if="tableData.length < formData.levelNum" v-model="formData.fcheckResu" class="result-input"
                     placeholder="请输入检验结果..." type="number"/>
              <button v-if="tableData.length < formData.levelNum" class="btn primary-btn" @click="submit">保存结果
              <button v-if="tableData.length < formData.levelNum" class="btn primary-btn" @click="submit" style="margin: 0;">保存结果
              </button>
              <button v-if="isShowImg" class="btn upload-btn" @click="previewImage">
                <uni-icons color="#fff" size="16" type="image"></uni-icons>
@@ -112,6 +117,10 @@
          <!-- å“åº”式设计的第二个输入组 -->
          <view class="input-group input2">
            <view class="input-wrapper">
              <button class="btn upload-btn" @click="chooseImage">
                <uni-icons type="upload" size="16" color="#fff"></uni-icons>
                ä¸Šä¼ /查看图片
              </button>
              <button v-if="isShowImg" class="btn upload-btn" @click="previewImage">
                <uni-icons color="#fff" size="16" type="image"></uni-icons>
                æŸ¥çœ‹å›¾ç‰‡
@@ -356,6 +365,10 @@
        }
      }).then(res => {
        this.formData = res.data.tbBillList.itemXj01;
        // ç¡®ä¿formData包含id属性,用于图片上传功能
        if (!this.formData.id && this.id) {
          this.formData.id = this.id;
        }
        this.tableData = res.data.tbBillList.itemXj02s;
@@ -443,7 +456,6 @@
      })
    },
    numberEdit(item) {
      let fstand = "√";
      let fcheckResu = 1;
@@ -466,6 +478,12 @@
        this.$showMessage("修改成功");
        this.refreshResult(); //刷新页面
      })
    },
    // ä¸Šä¼ å›¾ç‰‡
    chooseImage() {
      uni.navigateTo({
        url: 'ImageItem?id=666' + this.formData.id + '&gid=' + this.gid
      });
    },
    saveRemarks() {
      this.remarksPopup = !this.remarksPopup;
@@ -661,6 +679,12 @@
      color: #fff;
      padding: 0 10px;
      margin: 0;
      height: 45px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: none;
      border-radius: 4px;
    }
  }
}
@@ -971,6 +995,13 @@
  &.primary-btn {
    background-color: $primary-color;
    color: #fff;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 4px;
    padding: 0 20px;
  }
  &.danger-btn {