cnf
3 天以前 7c803e1ce6c6d9765a99203544bf200ecd52aa2d
pages/QC/SJ/Add.vue
@@ -157,10 +157,10 @@
               </uni-tr>
               <uni-tr v-for="(item,index) in (drawing || [])" style="height: 100px;">
                  <uni-td align="center">{{item.itemNo}}</uni-td>
                  <uni-td align="center" style="font-size:25px;">
                  <uni-td align="center" >
                     <div >{{item.itemName}}</div>
                  </uni-td>
                  <uni-td align="center" style="font-size:25px;">
                  <uni-td align="center" >
                     <div>{{item.itemModel}}</div>
                  </uni-td>
                  <uni-td align="center" class="click-wd">
@@ -622,10 +622,76 @@
            this.drawingShow = false
            this.imageShow = false
            this.productionShow = false
               // const item = '83040700101'
               const item = this.formData.billNo;
               console.log(this.formData.billNo );
               console.log('daa001:', item);
               console.log('ItemNo:', this.formData.itemNo);
               const url = this.$store.state.serverInfo.serverAPI + "/LLJ/getWomdab";
               // 或者如果路径不同,请使用正确的端点
               // const url = "http://192.168.0.100:10054/api/getWomdab"
               let _this = this;
               uni.request({
                   url: url,
                   method: 'POST',
                   header: {
                       'Content-Type': 'application/json'
                   },
                   data: {
                         daa001: item,  // 根据DTO属性名传递
                         ItemNo: this.formData.itemNo   // 注意大小写匹配
                   },
                   success: (response) => {
                       console.log(response);
                       console.log("-------------------------------------");
                       // 根据后端返回的数据结构进行调整
                       if (response.data.status === 1) {
                           // 状态为1表示没有数据
                           _this.drawing = [];
                       } else if (response.data.status === 0) {
                           // 状态为0表示成功
                           if (response.data.data && response.data.data.tbBillList) {
                               _this.drawing = response.data.data.tbBillList;
                               // 遍历数据,判断文件后缀并添加字段
                               _this.drawing.forEach((file) => {
                                   // 获取文件名的后缀
                                   const fileExtension = file.fName ? file.fName.split('.').pop().toLowerCase() : '';
                                   // 定义支持的文件类型
                                   const supportedExtensions = ['jpg', 'pdf', 'xlsx', 'doc', 'docx', 'xls'];
                                   // 判断是否支持该文件类型
                                   file.isSupported = supportedExtensions.includes(fileExtension);
                               });
                           } else {
                               _this.drawing = [];
                           }
                       } else {
                           // 其他状态码处理
                           _this.drawing = [];
                           uni.showToast({
                               title: response.data.message || '请求失败',
                               icon: 'none'
                           });
                       }
                   },
                   fail: (error) => {
                       uni.showToast({
                           title: '请求图纸链接失败',
                           icon: 'none'
                       });
                       console.error('请求失败:', error);
                   }
               });
         },
         itemCancel() {
            this.itemShow=false
         },
         
         fetchDrawingNumber(itemNo) {
            // const item = '83040700101'
@@ -748,10 +814,10 @@
            this.itemShow = true
         },
         
      //图纸相关文档
      openDrawings(item) {
         console.log("jkjoi", item)
         if (item.fRelevantObject.length > 2) {
          //图纸相关文档
          openDrawings(item) {
           console.log("jkjoi", item)
           if (item.fRelevantObject.length > 2) {
            // 生成请求URL(简化编码逻辑)
            const encodedName = encodeURIComponent(item.fName); 
            const url = this.$store.state.serverInfo.serverAPI+`/PLM/OpenDrawingsGet?fileId=${item.fRelevantObject}&fName=${encodedName}`;
@@ -849,14 +915,15 @@
               }
            });
         }
         else
         {
           else
           {
            uni.showToast({
               title: '请求预览链接失败',
               icon: 'none'
            });
         }
      },
           }
          },
         
         getGenUpdate() {
            if (!this.formData.id || !this.formData.billNo) {