zjh
2025-04-23 8b34fa36bfc735e53460159ac13814ff073c908a
pages/QC/LLJ/Add.vue
@@ -1,620 +1,614 @@
<template>
   <view>
      <view class="form-container">
         <form :modelValue="formData">
  <view class="inspection-sheet">
    <!-- 头部信息 -->
    <view class="sheet-header">
      <h1>来料检验单</h1>
      <view class="inspection-number">检验单号:{{formData.releaseNo}}</view>
      <view style="text-align: right;" v-if="this.current"><a class="sysLike" @click="toSysSubmitFrom(formData.releaseNo)">实验室送检</a></view>
    </view>
    <!-- 基本信息区 -->
    <view class="basic-info">
      <view class="info-row">
        <span class="info-label">到货单号:</span>
        <span class="info-value">{{formData.lotNo}}</span>
        <span class="info-label">创建人:</span>
        <span class="info-value">{{formData.createBy}}</span>
      </view>
      <view class="info-row">
        <span class="info-label">创建时间:</span>
        <span class="info-value">{{formData.createDate}}</span>
        <span class="info-label">&nbsp;负责人:</span>
        <span class="info-value">{{formData.userName}}</span>
      </view>
    </view>
    <!-- 物料信息区 -->
    <view class="material-info">
      <view class="info-block">
        <view class="info-label">物料编码:</view>
        <view class="info-value">{{formData.itemNo}}</view>
        <view class="doc-links">
          <a class="doc-link" @click="toFileUrlByU9List(1,formData.itemNo)">图纸规格书</a>
          <a class="doc-link" @click="toFileUrlByU9List(2,formData.itemNo)">进料检验文件</a>
        </view>
      </view>
      <view class="info-block">
        <view class="info-label">物料名称:</view>
        <view class="info-value">{{formData.itemName}}</view>
      <view class="info-label">项目:</view>
      <view class="info-value">{{formData.projectCodes}}</view>
      <view class="info-label" v-if="formData.extendNo1!=null">技改状态:</view>
      <view class="info-value" v-if="formData.extendNo1!=null">{{formData.extendNo1}}</view>
      <view class="info-label">数量:</view>
      <view class="info-value highlight">{{formData.fcovertQty}}</view>
      </view>
     <view class="info-block">
      <view class="info-label">规格型号:</view>
      <view class="info-value">{{formData.itemModel}}</view>
     </view>
      <view class="info-block" v-if="formData.fngDesc!=null">
        <view class="info-label">不良描述:</view>
        <view class="info-value">{{formData.fngDesc}}</view>
      </view>
     <view class="info-block"  v-if="formData.newFngDesc!=null">
       <view class="info-label">上次不良:</view>
       <view class="info-value">{{formData.newFngDesc}}</view>
     </view>
    </view>
    <!-- 操作按钮区 -->
    <view class="action-buttons" v-if="this.current" >
      <button class="secondary-btn" @click="getInspectionItems">获取检验项目</button>
    </view>
    <!-- 检验项目表格 -->
    <view class="inspection-table">
      <table>
        <thead>
          <tr>
            <th width="15%" style="text-align: center;">检验项目</th>
            <th width="50%" style="text-align: center;">检验描述</th>
            <th width="20%" style="text-align: center;">记录(点击)</th>
          </tr>
        </thead>
        <tbody>
          <tr v-for="(item, index) in tableData" :key="index">
            <td>{{ item.fcheckItem }}</td>
            <td>
              <view v-if="item.fcheckResu=='合格'" class="watermark approved">{{ getStatusText(item.fcheckResu) }}</view>
            <view v-if="item.fcheckResu=='不合格'" class="watermark rejected">{{ getStatusText(item.fcheckResu) }}</view>
             <view v-if="item.fcheckResu==null" class="watermark pending">{{ getStatusText(item.fcheckResu) }}</view>
              <view class="description-text">{{ item.fcheckItemDesc }}</view>
            </td>
            <td>
            <button v-if="item.current" class="record-btn" @click="fillRecord(item,index)">填写记录</button>
            <button v-if="!item.current" class="record-btn" @click="fillRecord(item,index)">查看</button>
         </td>
          </tr>
        </tbody>
      </table>
    </view>
    <!-- 操作按钮区 -->
    <view class="action-buttons">
      <button class="secondary-btn" @click="uploadImages">上传/查看图片</button>
      <button class="secondary-btn" @click="addDefectDescription" v-if="this.current">添加不良描述</button>
      <button class="primary-btn" @click="submitInspection" v-if="this.current">检验提交</button>
    </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" disabled="true" type="text" v-model="formData.releaseNo" />
               <button v-if="!isUpdate && current==0" type="default" style="background-color: #04d007; color: white;" @click="toSysSubmitFrom(formData.releaseNo)">
                    实验室送检
               </button>
               <label class="form-label">不合格描述:</label>
               <input class="form-input" type="text" v-model="remarks" />
            </view>
            <view class="form-group">
               <label class="form-label">到货单号:</label>
               <input class="form-input" disabled="true" type="text" v-model="formData.lotNo" />
            </view>
            <view class="form-group">
               <label class="form-label">创建人:</label>
               <input class="form-input" disabled="true" type="text" v-model="formData.createBy" />
            </view>
            <view class="form-group">
               <label class="form-label">负责人:</label>
               <input class="form-input" disabled="true" type="text" v-model="formData.userName" />
               <button v-if="!isUpdate&& current==0 &&this.IQCJL"  type="default" style="background-color: #04d007; color: white;" @click="toUpdateCheckBy(formData.releaseNo,formData.userName)">
                    变更负责人
               </button>
            </view>
            <view class="form-group">
               <label class="form-label">创建时间:</label>
               <input class="form-input" disabled="true" type="text" v-model="formData.createDate" />
            </view>
            <view class="form-group">
               <label class="form-label">物料编码:</label>
               <input class="form-input" disabled="true" type="text" v-model="formData.itemNo" />
               <button  type="primary" @click="toFileUrlByU9List(1,formData.itemNo)">
                    图纸规格书
               </button>
               <button  type="primary" @click="toFileUrlByU9List(2,formData.itemNo)">
                    进料检验文件
               </button>
            </view>
            <view class="form-group">
               <label class="form-label">物料名称:</label>
               <input class="form-input" disabled="true" type="text" v-model="formData.itemName" />
            
            </view>
            <view class="form-group">
               <label class="form-label">规格型号:</label>
               <input class="form-input" disabled="true" type="text" v-model="formData.itemModel" />
            </view>
            <view class="form-group">
               <label class="form-label">数量:</label>
               <input class="form-input" disabled="true" type="text" v-model="formData.fcovertQty" />
            </view>
            <view class="form-group">
               <label class="form-label">不良描述:</label>
               <input class="form-input" disabled="true" type="text" v-model="formData.fngDesc" />
            </view>
            <view class="form-group">
               <label class="form-label">上次不良:</label>
               <input class="form-input" disabled="true" type="text" v-model="formData.newFngDesc" />
            </view>
            <view class="form-group">
               <label class="form-label">项目:</label>
               <input class="form-input" disabled="true" type="text" v-model="formData.projectCodes" />
            </view>
         </form>
         <button class="updateBut" @click="editRemarks">修改</button>
         <button @click="remarksPopup = !remarksPopup">取消</button>
      </view>
      <view class="list-container">
         <uni-table ref="table" border emptyText="暂无更多数据">
            <uni-tr>
               <uni-th align="center" class="th" width="100" style="color: #FFFFFF;">检验项目</uni-th>
               <uni-th align="center" class="th"   style="color: #FFFFFF;">检验描述</uni-th>
               <uni-th align="center" class="th" width="100" style="color: #FFFFFF">是否合格</uni-th>
               <uni-th align="center" class="th" width="50"  style="color: #FFFFFF">记录(点击)</uni-th>
            </uni-tr>
            <uni-tr v-for="(item, index) in tableData" :key="index">
               <uni-td align="center">
                  <input class="form-input" disabled="true" type="text" v-model="item.fcheckItem" />
               </uni-td>
               <uni-td align="center">
                  <input class="form-input" disabled="true" type="text" v-model="item.fcheckItemDesc" />
               </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  v-if="item.fenterQty >=item.checkQyt" type="default" @click="toDetail(item)">
                        {{ item.checkQyt + '/' + item.fenterQty }}
                     </button>
                     <button  v-else type="warn" @click="toDetail(item)">
                        {{ item.checkQyt + '/' + item.fenterQty }}
                     </button>
                  </view>
               </uni-td>
            </uni-tr>
         </uni-table>
      </view>
      <!-- <view class="dif">
         <view class="plus-button">
            <button type="warn" v-if="!isUpdate && !isShowTable" @click="submit">检验提交</button>
         </view>
         <view class="plus-button">
            <button type="warn" v-if="isUpdate && !isShowTable" @click="getItem">创建检验单并生成部分默认值</button>
         </view>
         <view class="plus-button">
            <button type="warn" v-if="!isUpdate && !isShowTable" @click="toImage">上传/查看图片</button>
         </view>
         <!-- 移动端先注销,有需求再放出来 -->
      <!-- <view class="plus-button">
            <button type="warn" v-if="!isUpdate && !formData.fcheckResu && !isShowTable" @click="removeXJ">删除单据</button>
         </view> -->
      <!-- <view class="plus-button">
            <button type="warn" v-if="!isUpdate && !isShowTable" @click="saveRemarks">添加不良描述</button>
         </view>
         <view class="plus-button">
            <button type="warn" v-if="isShowTable" @click="getTable">获取检验项目</button>
         </view>
         <view class="plus-button">
            <button type="warn" v-if="isShowTable && isUpdate" @click="saveTable">生成检验项目</button>
         </view>
      </view> -->
      <view class="fixed-buttons">
         <button type="warn" v-if="!isUpdate && !isShowTable && current==0" @click="submit">检验提交</button>
         <button type="warn" v-if="isUpdate && !isShowTable" @click="getItem">创建检验单并生成部分默认值</button>
         <button type="warn" v-if="!isUpdate && !isShowTable" @click="toImage">上传/查看图片</button>
         <button type="warn" v-if="!isUpdate && !isShowTable" @click="saveRemarks">添加不良描述</button>
         <button type="warn" v-if="!isUpdate && !isShowTable && current==0" @click="getTable">获取检验项目</button>
         <button type="warn" v-if="isShowTable && isUpdate" @click="saveTable">生成检验项目</button>
      </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" />
               </view>
               <button type="warn" @click="editRemarks">修改</button>
               <button @click="remarksPopup = !remarksPopup">取消</button>
            </form>
         </view>
      </view>
   </view>
  </view>
</template>
<script>
   import { compile } from "vue";
import {
      msgRead
   } from "../../../utils/message";
   export default {
      data() {
         return {
            formData: {
               id: "",
               releaseNo: "",
               createBy: "",
               createDate: "",
               lotNo: "",
               itemNo: "",
               billNo: "",
               fcovertQty: "",
               detailMem: "",
               taskNo: "",
               fcheckResu: "",
               boardModel: "",
               planQty: "",
               mocode: "",
               boardStyle: ""
            },
            DAA020List: [],
            DAA020Index: -1,
            DAA001List: [],
            DAA001Index: -1,
            schemeResult: [],
            isShowTable: false,
            ItemList: [],
            ItemIndex: -1,
            boardItems: [],
            lineList: [],
            lineNo: "",
            tableData: [],
            isSubmit: true,
            isUpdate: true,
            remarks: "",
            remarksPopup: false,
            msgId: 0
         };
export default {
  data() {
    return {
      formData: {
         id: "",
         releaseNo: "",
         createBy: "",
         createDate: "",
         lotNo: "",
         itemNo: "",
         billNo: "",
         fcovertQty: "",
         detailMem: "",
         taskNo: "",
         fcheckResu: "",
         boardModel: "",
         planQty: "",
         mocode: "",
         boardStyle: ""
      },
      onLoad(options) {
         //options中包含了url附带的参数
         let params = options;
         if (params["id"]) {
            this.isUpdate = false;
            this.formData.id = params["id"];
            this.formData.releaseNo = params["releaseNo"];
            this.formData.lotNo = params["lotNo"];
            this.msgId = params["msgId"];
            this.current=params["current"];
            if(this.$loginInfo.roleid.indexOf("87638") != -1 || this.$loginInfo.account=="PL017")
            {
               this.IQCJL=true;
            }else
            {
               this.IQCJL=false;
            }
      tableData: [],
     remarksPopup: false,
     current:true
    }
  },
  onLoad(options) {
     //options中包含了url附带的参数
     let params = options;
     if (params["id"]) {
        this.formData.id = params["id"];
        this.formData.releaseNo = params["releaseNo"];
        this.formData.lotNo = params["lotNo"];
        this.msgId = params["msgId"];
      if(params["current"]==='A')
      {
         this.current=true;
      }else if(params["current"]==='B'){
         this.current=false;
      }
       
            //getQaItemXj02
            //this.init();
            if (this.msgId > 0) {
               this.msgRead();
            }
         } else {
            //初始化检验单号
            this.$post({
               url: "/LLJ/getMaxReleaseNo"
            }).then(res => {
               this.formData.releaseNo = res.data.tbBillList;
               this.formData.createBy = this.$loginInfo.account;
               this.formData.createDate = this.$getDate("yyyy-mm-dd");
            });
        if (this.msgId > 0) {
           this.msgRead();
        }
     } else {
        //初始化检验单号
        this.$post({
           url: "/LLJ/getMaxReleaseNo"
        }).then(res => {
           this.formData.releaseNo = res.data.tbBillList;
           this.formData.createBy = this.$loginInfo.account;
           this.formData.createDate = this.$getDate("yyyy-mm-dd");
        });
     }
  },
  methods: {
    getStatusText(status) {
      const statusMap = {
        approved: '合格',
        rejected: '不合格',
        pending: '待确认'
      }
     if(status==null){
         return statusMap['pending'] || ''
     }else if(status=='合格'){
         return statusMap['approved'] || ''
     }else{
        return statusMap['rejected'] || ''
     }
    },
    getInspectionItems() {
      // 获取检验项目的逻辑
       this.$post({
          url: "/LLJ/setJYItem",
          data: {
             itemNo: this.formData.itemNo,
             quantity: this.formData.fcovertQty,
             releaseNo: this.formData.releaseNo
          }
       }).then(res => {
          if (res.status==0) {
             uni.showToast({
                title: res.message.toString(),
                //将值设置为 success 或者直接不用写icon这个参数
                icon: 'success',
                //显示持续时间为 2秒
                duration: 2000
             })
              // 如果有页面跳转,需要用定时器延迟
                     setTimeout(() => {
                         this.init();
                     }, 2000);
          } else {
             uni.showToast({
                title: res.message.toString(),
                //将值设置为 success 或者直接不用写icon这个参数
                icon: 'error',
                //显示持续时间为 2秒
                duration: 2000
             })
          }
       });
    },
    fillRecord(item,index) {
      // 填写记录的逻辑
          uni.navigateTo({
             url: 'detail?mainId=' + item.id+'&formID='+this.formData.id+'&releaseNo='+this.formData.releaseNo+'&index='+index+'&current='+this.current
          });
    },
    uploadImages() {
      // 上传/查看图片的逻辑
     uni.navigateTo({
        url: 'ImageItem?id=' + this.formData.id
     });
    },
    addDefectDescription() {
      // 添加不良描述的逻辑
     this.remarksPopup = !this.remarksPopup;
     this.remarks = this.formData.remarks;
    },
    submitInspection() {
      // 检验提交的逻辑
    this.$post({
       url: "/LLJ/IqcQaSubmit",
       data: {
          userNo: this.$loginInfo.account,
          releaseNo: this.formData.releaseNo
       }
    }).then(res => {
     if (res.status==0) {
        uni.showToast({
           title: res.message.toString(),
           icon: 'success',
           duration: 2000
        })
         // 如果有页面跳转,需要用定时器延迟
                setTimeout(() => {
                    uni.navigateTo({
                       url: 'List'
                    });
                }, 2000); // 保持与 duration 相同的时长
     } else {
        uni.showModal({
           title: "提示",
           content: res.message.toString(),
           confirmText: "确定",
           showCancel: false,
           success: (res) => {
           }
        })
     }
    })
    },
   onShow() {
      //每次进入页面都会执行的方法
      if (this.formData.id) {
         this.init();
      }
   },
   init() {
      let userName = this.$loginInfo.account;
      this.$post({
         url: "/LLJ/getPage",
         data: {
            id: this.formData.id,
            createUser: userName,
            pageIndex: 1,
            limit: 1,
         }
      },
      methods: {
         removeXJ() {
            if (this.formData.id) {
               this.$post({
                  url: "/LLJ/removeXJ",
                  data: {
                     releaseNo: this.formData.releaseNo
                  }
               }).then(res => {
                  if (res.data.tbBillList > 0) {
                     this.$showMessage("删除成功");
                     //关闭当前页面,返回上一页面或多级页面
                     uni.navigateBack();
                  } else {
                     this.$showMessage("删除失败");
                  }
               });
            } else {
               this.$showMessage("请先选择检验单号");
            }
         },
         getItem() {
            if (this.isSubmit) {
               this.$showMessage("此物料无启用的检验项目,请维护!");
               return;
            }
            if (!this.formData.billNo) {
               this.$showMessage("请选择计划编号");
               return;
            }
      }).then(res => {
         let data = res.data.tbBillList[0];
         if (data) {
            this.formData = data;
            this.$post({
               url: "/XJ/save",
               data: {
                  from: this.formData,
                  userNo: this.$loginInfo.account,
                  items: this.tableData
               }
            }).then(res => {
               this.formData.id = res.data.tbBillList;
               this.$showMessage("生成检验项目成功");
               this.init();
               this.isUpdate = false;
            });
         },
         submit() {
            this.$post({
               url: "/LLJ/IqcQaSubmit",
               data: {
                  userNo: this.$loginInfo.account,
                  releaseNo: this.formData.releaseNo
               }
            }).then(res => {
             if (res.status==0) {
                uni.showToast({
                   title: res.message.toString(),
                   icon: 'success',
                   duration: 2000
                })
                 // 如果有页面跳转,需要用定时器延迟
                        setTimeout(() => {
                            uni.navigateTo({
                               url: 'List'
                            });
                        }, 2000); // 保持与 duration 相同的时长
             } else {
                uni.showToast({
                   title: res.message.toString(),
                   icon: 'error',
                   duration: 2000
                })
             }
            })
         },
         msgRead() {
            msgRead(this.msgId, this.$loginInfo.account);
         },
         init() {
            let userName = this.$loginInfo.account;
            this.$post({
               url: "/LLJ/getPage",
               url: "/LLJ/getJYItem",
               data: {
                  id: this.formData.id,
                  createUser: userName,
                  pageIndex: 1,
                  limit: 1,
               }
            }).then(res => {
               let data = res.data.tbBillList[0];
               if (data) {
                  this.formData = data;
                  this.$post({
                     url: "/LLJ/getJYItem",
                     data: {
                        id: this.formData.id,
                        releaseNo: this.formData.releaseNo
                     }
                  }).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;
                     }
                  })
               }
            });
         },
         toDetail(item) {
            if (this.isUpdate) {
               uni.showToast({
                  icon: "none",
                  title: "请先生成检验项目",
                  duration: 2000,
               });
            } else {
               uni.navigateTo({
                  url: 'detail?mainId=' + item.id
               });
            }
         },
         saveRemarks() {
            this.remarksPopup = !this.remarksPopup;
            this.remarks = this.formData.remarks;
         },
         editRemarks() {
            if (this.remarks) {
               //saveRemarksGid
               this.$post({
                  url: "/LLJ/saveRemarksGid",
                  data: {
                     gid: this.formData.id,
                     remarks: this.remarks,
                     releaseNo: this.formData.releaseNo,
                  }
               }).then(res => {
                  if (res.data.tbBillList > 0) {
                     this.formData.remarks = this.remarks;
                     this.remarksPopup = !this.remarksPopup;
                     this.$showMessage("保存成功");
                  }
               })
            }
         },
         toImage() {
            uni.navigateTo({
               url: 'ImageItem?id=' + this.formData.id
            });
         },
         getTable() {
            this.$post({
               url: "/LLJ/setJYItem",
               data: {
                  itemNo: this.formData.itemNo,
                  quantity: this.formData.fcovertQty,
                  releaseNo: this.formData.releaseNo
               }
            }).then(res => {
               if (res.status==0) {
                  uni.showToast({
                     title: res.message.toString(),
                     //将值设置为 success 或者直接不用写icon这个参数
                     icon: 'success',
                     //显示持续时间为 2秒
                     duration: 2000
                  })
                   // 如果有页面跳转,需要用定时器延迟
                          setTimeout(() => {
                              this.init();
                          }, 2000); // 保持与 duration 相同的时长
               } else {
                  // this.$showMessage("此物料没有启用的检验项目,请维护!");
                  // this.isShowTable = true;
                  // this.isUpdate = false;
                  // this.tableData = [];
                  uni.showToast({
                     title: res.message.toString(),
                     //将值设置为 success 或者直接不用写icon这个参数
                     icon: 'error',
                     //显示持续时间为 2秒
                     duration: 2000
                  })
            }).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;
               }
            });
         },
         saveTable() {
            if (this.tableData.length === 0) {
               return;
            }
            this.$post({
               url: "/LLJ/saveItem",
               data: {
                  releaseNo: this.formData.releaseNo,
                  items: this.tableData,
                  userNo: this.$loginInfo.account,
                  gid: this.formData.id
               }
            }).then(res => {
               this.formData.id = res.data.tbBillList;
               this.isShowTable = false;
               this.isUpdate = false;
               this.init();
               this.tableData.forEach((item, index) => {
                         this.$set(item, 'current', this.current);
                       });
            })
         },
         //去文件列表页面(文件类型,物料编号)
         toFileUrlByU9List(type,u9No){
            if(type===1){
               uni.navigateTo({
                  url: 'FileUrlByU9List?type=' + type+'&itemID='+u9No
               });
            }else{
               uni.navigateTo({
                  url: 'FileUrlByU9List2?type=' + type+'&itemID='+u9No
               });
         }
      });
   },
   msgRead() {
      msgRead(this.msgId, this.$loginInfo.account);
   },
   //去文件列表页面(文件类型,物料编号)
   toFileUrlByU9List(type,u9No){
      if(type===1){
         uni.navigateTo({
            url: 'FileUrlByU9List?type=' + type+'&itemID='+u9No
         });
      }else{
         uni.navigateTo({
            url: 'FileUrlByU9List2?type=' + type+'&itemID='+u9No
         });
      }
   },
   toSysSubmitFrom(releaseNo){
      uni.navigateTo({
         url: 'SysSubmitFrom?releaseNo=' + releaseNo+'&userID='+this.$loginInfo.account
      });
   },
   editRemarks() {
      if (this.remarks) {
         //saveRemarksGid
         this.$post({
            url: "/LLJ/saveRemarksGid",
            data: {
               gid: this.formData.id,
               remarks: this.remarks,
               releaseNo: this.formData.releaseNo,
            }
         },
         toSysSubmitFrom(releaseNo){
            uni.navigateTo({
               url: 'SysSubmitFrom?releaseNo=' + releaseNo+'&userID='+this.$loginInfo.account
            });
         },
         toUpdateCheckBy(releaseNo,userName){
            //console.log(this.$loginInfo)
            uni.navigateTo({
               url: 'UpdateCheckBy?releaseNo=' + releaseNo+'&userID='+this.$loginInfo.account+'&staffName='+userName
            });
         }
      },
      onShow() {
         //每次进入页面都会执行的方法
         if (this.formData.id) {
            this.init();
         }
         }).then(res => {
            if (res.data.tbBillList > 0) {
               this.formData.remarks = this.remarks;
               this.remarksPopup = !this.remarksPopup;
               this.$showMessage("保存成功");
            }
         })
      }else{
         this.$post({
            url: "/LLJ/saveRemarksGid",
            data: {
               gid: this.formData.id,
               remarks: '',
               releaseNo: this.formData.releaseNo,
            }
         }).then(res => {
            if (res.data.tbBillList > 0) {
               this.formData.remarks = this.remarks;
               this.remarksPopup = !this.remarksPopup;
               this.$showMessage("保存成功");
            }
         })
      }
   };
   },
  }
}
</script>
<style>
   .form-group {
      display: flex;
      align-items: center;
      border-bottom: 1px solid #c9c9c9;
   }
/* 基础样式 */
.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);
}
   .form-label {
      margin-bottom: 0;
      padding: 5px;
   }
/* 头部样式 */
.sheet-header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e0e0e0;
}
   .form-input {
      flex: 1;
      margin-bottom: 0;
      padding: 5px;
   }
.sheet-header h1 {
  color: #2c3e50;
  font-size: 24px;
  margin-bottom: 5px;
}
   .picker {
      flex: 1;
      margin-bottom: 0;
      padding: 5px;
      font-size: 12px;
   }
.inspection-number {
  font-size: 16px;
  font-weight: bold;
  color: #3498db;
}
   .uni-form-item {
      display: flex;
      border-bottom: 1px solid #c9c9c9;
   }
/* 基本信息区样式 */
.basic-info, .material-info {
  margin-bottom: 20px;
}
   .edit {
      background-color: white;
   }
.info-row {
  display: flex;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
   /* 默认样式 */
   /* .list-container {
      height: 60vh;
      /* 设置列表容器的高度为剩余空间,并减去表单容器的高度 */
      /* overflow-y: auto; */
      /* 允许列表容器垂直滚动 */
      /* padding: 10px; */
      /* 可选:添加一些内边距,使列表内容更美观 */
   /* }  */
   .fixed-buttons {
         position: fixed;
         bottom: 0;
         left: 0;
         right: 0;
         display: flex;
         flex-wrap: wrap;
         padding: 10px;
         background-color: #ffffff;
         box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
         z-index: 1000;
         max-height: 30vh; /* 限制按钮容器最大高度 */
         overflow-y: auto; /* 按钮过多时自身可滚动 */
      }
      .fixed-buttons button {
         margin: 5px;
         flex: 1 1 calc(50% - 20px); /* 两列布局 */
      }
      /* 为内容区域添加底部 padding 防止被固定按钮遮挡 */
      .list-container {
         height: calc(100vh - 400px); /* 动态高度计算 */
         overflow-y: auto;
         padding: 10px;
         padding-bottom: 300px; /* 根据按钮高度调整 */
      }
      @media (max-width: 768px) {
         .list-container {
            height: calc(100vh - 376px);
            padding-bottom: 300px;
         }
         .fixed-buttons {
            flex-direction: column;
            padding: 10px;
         }
         .fixed-buttons button {
            flex: none;
            width: 100%;
            margin: 5px 0;
         }
      }
   .form-container {
      padding: 10px;
      /* 可选:添加一些内边距,使表单内容更美观 */
   }
.info-label {
  font-weight: bold;
  color: #34495e;
  min-width: 80px;
  margin-right: 5px;
}
   .th {
      background-color: lightskyblue;
      color: #FFFFFF;
   }
.info-value {
  color: #2c3e50;
  margin-right: 20px;
}
   .plus-button {
      line-height: 59px;
      font-size: 24px;
      cursor: pointer;
      z-index: 1000;
      margin-bottom: 10px;
   }
.highlight {
  font-weight: bold;
  color: #e74c3c;
}
/* 物料信息区样式 */
.material-info {
  border: 1px solid #eee;
  padding: 15px;
  border-radius: 5px;
}
.info-block {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
   .plus-button button {
      margin: 5px 0;
      /* 按钮之间的垂直间距 */
   }
.doc-links {
  margin-left: auto;
}
   .overlay {
.doc-link {
  color: #3498db;
  text-decoration: none;
  margin-left: 15px;
  padding: 3px 8px;
  border: 1px solid #3498db;
  border-radius: 3px;
  font-size: 12px;
}
.sysLike{
  color: #3498db;
  text-decoration: none;
  margin-left: 15px;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 12px;
}
.doc-link:hover {
  background-color: #f0f8ff;
}
/* 表格样式 */
.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;
}
/* 按钮样式 */
.action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.primary-btn, .secondary-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}
.primary-btn {
  background-color: #3498db;
  color: white;
}
.primary-btn:hover {
  background-color: #2980b9;
}
.secondary-btn {
  background-color: #ecf0f1;
  color: #7f8c8d;
}
.secondary-btn:hover {
  background-color: #d5dbdb;
}
.record-btn {
  padding: 6px 12px;
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  /* border-radius: 3px; */
  cursor: pointer;
  transition: all 0.2s;
}
.record-btn:hover {
  background-color: #e9ecef;
}
/* 水印样式 */
.watermark {
  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; /* 绿色 */
}
.watermark.rejected {
  color: #e74c3c; /* 红色 */
}
.watermark.pending {
  color: #f39c12; /* 橙色 */
}
/* 描述文本容器 */
.description-text {
  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;
}
.overlay {
      position: fixed;
      top: 0;
      left: 0;
@@ -624,8 +618,8 @@
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 10;
   }
   .popup {
      background-color: #fff;
      padding: 20px;
@@ -636,4 +630,34 @@
      height: 25vh;
      /* 设置高度为视口高度的80% */
   }
   .form-group {
      display: flex;
      align-items: center;
      border-bottom: 1px solid #c9c9c9;
   }
   .updateBut{
      background-color: #3498db;
      color: white;
   }
/* 响应式设计 */
@media (max-width: 700px) {
  .info-row, .info-block {
    flex-direction: column;
    align-items: flex-start;
  }
  .doc-links {
    margin-left: 0;
    margin-top: 10px;
  }
  .action-buttons {
    flex-direction: column;
  }
  .inspection-table table {
    display: block;
    overflow-x: auto;
  }
}
</style>