| | |
| | | <view class="section-title">选择信息</view> |
| | | <view class="form-row"> |
| | | <label class="form-label required">工作车间:</label> |
| | | <superwei-combox :candidates="departmentList" placeholder="请选择车间" |
| | | v-model="formData.workShop" |
| | | @select="onDepartmentChange" |
| | | class="form-select"></superwei-combox> |
| | | <superwei-combox :candidates="departmentList" placeholder="请选择车间" v-model="formData.workShop" |
| | | @select="onDepartmentChange" class="form-select"></superwei-combox> |
| | | </view> |
| | | |
| | | <view class="form-row"> |
| | | <label class="form-label required">生产线别:</label> |
| | | <superwei-combox v-if="formData.workShop" :candidates="DAA020List" placeholder="请选择线体" |
| | | v-model="formData.lineName" |
| | | @select="onDaa020Change" |
| | | class="form-select"></superwei-combox> |
| | | v-model="formData.lineName" @select="onDaa020Change" class="form-select"></superwei-combox> |
| | | <span v-else class="form-hint">请先选择工作车间</span> |
| | | </view> |
| | | |
| | | <view class="form-row"> |
| | | <label class="form-label required">生产工单:</label> |
| | | <superwei-combox v-if="formData.lineName" :candidates="DAA001List" placeholder="请选择工单" |
| | | v-model="formData.rBillNo" |
| | | @select="onDaa001Change" |
| | | class="form-select"></superwei-combox> |
| | | v-model="formData.rBillNo" @select="onDaa001Change" class="form-select"></superwei-combox> |
| | | <span v-else class="form-hint">请先选择生产线别</span> |
| | | </view> |
| | | |
| | | <view class="form-row"> |
| | | <label class="form-label required">送检数量:</label> |
| | | <input type="number" |
| | | v-model="formData.quantity" |
| | | placeholder="请输入送检数量" |
| | | class="large-quantity-input" |
| | | <input type="number" v-model="formData.quantity" placeholder="请输入送检数量" class="large-quantity-input" |
| | | @input="onQuantityChange"/> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- 产品信息 --> |
| | | <view class="form-section" v-if="formData.itemName || formData.itemNo || formData.itemModel || formData.planQty"> |
| | | <view class="form-section" |
| | | v-if="formData.itemName || formData.itemNo || formData.itemModel || formData.planQty"> |
| | | <view class="section-title">产品信息</view> |
| | | <view class="form-row" v-if="formData.itemName"> |
| | | <label class="form-label">产品名称:</label> |
| | |
| | | <text class="btn-icon">✓</text> |
| | | 生成检验单 |
| | | </button> |
| | | <button class="btn-primary" |
| | | v-if="isShowTable && isUpdate" |
| | | @click="saveTable"> |
| | | <button class="btn-primary" v-if="isShowTable && isUpdate" @click="saveTable"> |
| | | <text class="btn-icon">✓</text> |
| | | 生成检验项目 |
| | | </button> |
| | |
| | | </view> |
| | | <view class="dropdown-row"> |
| | | <view class="info-label">不良描述:</view> |
| | | <input v-if="!isUpdate" v-model="formData.fngDesc" placeholder="请输入不良描述" class="input-field" @blur="saveFngDesc" /> |
| | | <input v-if="!isUpdate" v-model="formData.fngDesc" placeholder="请输入不良描述" class="input-field" |
| | | @blur="saveFngDesc" /> |
| | | <view v-else class="info-value">{{ formData.fngDesc }}</view> |
| | | </view> |
| | | |
| | |
| | | <view class="description-text">{{ item.projName }}</view> |
| | | </td> |
| | | <td> |
| | | <button v-if="item.isCheck >= item.levelNum || formData.fsubmit == 1" class="record-btn" @click="toDetail(item)">查看</button> |
| | | <button v-if="item.isCheck >= item.levelNum || formData.fsubmit == 1" class="record-btn" |
| | | @click="toDetail(item)">查看</button> |
| | | <button v-else class="record-btn" @click="toDetail(item)">填写</button> |
| | | </td> |
| | | </tr> |
| | |
| | | <!-- 表单下方操作按钮区 --> |
| | | <view class="bottom-action-buttons"> |
| | | <button class="action-btn small" @click="toImage">上传/查看图片</button> |
| | | <button class="action-btn small" @click="fetchDrawingNumber(formData.itemNo)"> |
| | | 调取PLM图纸 |
| | | </button> |
| | | <button class="action-btn small" @click="getBom"> |
| | | Bom用料清单 |
| | | </button> |
| | | <button class="action-btn small" @click="viewAttachmentInfo">查看附件信息</button> |
| | | <button class="action-btn small" @click="saveRemarks" v-if="formData.fsubmit != 1">添加不合格描述</button> |
| | | <button class="action-btn small primary" @click="submitInspection" v-if="formData.fsubmit != 1 && tableData.length > 0">提交检验</button> |
| | | <button class="action-btn small primary" @click="submitInspection" |
| | | v-if="formData.fsubmit != 1 && tableData.length > 0">提交检验</button> |
| | | </view> |
| | | |
| | | <!-- 修改不合格描述弹出框 --> |
| | |
| | | <h3 class="attachment-popup-title">附件详情</h3> |
| | | <div class="attachment-popup-divider"></div> |
| | | <div v-if="selectedAttachment" class="attachment-detail-content"> |
| | | <div class="attachment-detail-row"><span class="attachment-label">ID:</span><span>{{ Math.trunc(selectedAttachment.id) }}</span></div> |
| | | <div class="attachment-detail-row"><span class="attachment-label">附件名:</span><span>{{ selectedAttachment.fattach }}</span></div> |
| | | <div class="attachment-detail-row"><span class="attachment-label">类型:</span><span>{{ selectedAttachment.ftype }}</span></div> |
| | | <div class="attachment-detail-row"><span class="attachment-label">版本:</span><span>{{ selectedAttachment.fversion }}</span></div> |
| | | <div class="attachment-detail-row"><span class="attachment-label">受控日期:</span><span>{{ selectedAttachment.fdate }}</span></div> |
| | | <div class="attachment-detail-row"><span class="attachment-label">上传人:</span><span>{{ selectedAttachment.createBy }}</span></div> |
| | | <div class="attachment-detail-row"><span class="attachment-label">上传时间:</span><span>{{ selectedAttachment.createDate }}</span></div> |
| | | <div class="attachment-detail-row"><span |
| | | class="attachment-label">ID:</span><span>{{ Math.trunc(selectedAttachment.id) }}</span> |
| | | </div> |
| | | <div class="attachment-detail-row"><span |
| | | class="attachment-label">附件名:</span><span>{{ selectedAttachment.fattach }}</span></div> |
| | | <div class="attachment-detail-row"><span |
| | | class="attachment-label">类型:</span><span>{{ selectedAttachment.ftype }}</span></div> |
| | | <div class="attachment-detail-row"><span |
| | | class="attachment-label">版本:</span><span>{{ selectedAttachment.fversion }}</span></div> |
| | | <div class="attachment-detail-row"><span |
| | | class="attachment-label">受控日期:</span><span>{{ selectedAttachment.fdate }}</span></div> |
| | | <div class="attachment-detail-row"><span |
| | | class="attachment-label">上传人:</span><span>{{ selectedAttachment.createBy }}</span></div> |
| | | <div class="attachment-detail-row"><span |
| | | class="attachment-label">上传时间:</span><span>{{ selectedAttachment.createDate }}</span></div> |
| | | <div class="attachment-actions-detail"> |
| | | <button class="attachment-action-btn preview-btn" |
| | | @click="previewFtpFile(selectedAttachment)" |
| | | <button class="attachment-action-btn preview-btn" @click="previewFtpFile(selectedAttachment)" |
| | | v-if="isPreviewable(selectedAttachment.fattach)"> |
| | | 🔍 在线预览 |
| | | </button> |
| | |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | <view class="barcode"> |
| | | <u-modal :show="itemShow" title="物料明细" @confirm="drawingConfirm" @cancel="itemCancel" showCancelButton |
| | | :z-index="1000"> |
| | | <uni-table border stripe emptyText="暂无更多数据" |
| | | style="margin-left: 5px;margin-right: 5px;height: 400px;max-height: 60vh;overflow-y: auto;"> |
| | | <uni-tr> |
| | | <uni-th align="center">料号</uni-th> |
| | | <uni-th align="center" width="90">名称</uni-th> |
| | | <uni-th align="center" width="90">规格型号</uni-th> |
| | | <uni-th align="center" width="150">调取PLM图纸</uni-th> |
| | | </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"> |
| | | <div>{{item.itemName}}</div> |
| | | </uni-td> |
| | | <uni-td align="center"> |
| | | <div>{{item.itemModel}}</div> |
| | | </uni-td> |
| | | <uni-td align="center" class="click-wd"> |
| | | <div @click="fetchDrawingNumber(item.itemNo)">调取图纸</div> |
| | | </uni-td> |
| | | </uni-tr> |
| | | </uni-table> |
| | | </u-modal> |
| | | </view> |
| | | |
| | | <view class="barcode"> |
| | | <u-modal :show="drawingShow" title="图纸明细" @confirm="drawingConfirm" @cancel="drawingCancel" showCancelButton |
| | | :z-index="1000"> |
| | | <uni-table border stripe emptyText="暂无更多数据" |
| | | style="margin-left: 5px;margin-right: 5px;height: 400px;max-height: 60vh;overflow-y: auto;"> |
| | | <uni-tr> |
| | | <uni-th align="center">相关文档</uni-th> |
| | | <uni-th align="center" width="90">有无关联PDF文件</uni-th> |
| | | <uni-th align="center" width="90">能否打开文件</uni-th> |
| | | <uni-th align="center" width="150">操作(点击)</uni-th> |
| | | </uni-tr> |
| | | <uni-tr v-for="(item,index) in (drawing || [])" style="height: 100px;"> |
| | | <uni-td align="center">{{item.fName}}</uni-td> |
| | | <uni-td align="center" style="font-size:25px;"> |
| | | <div v-if="item.fRelevantObject==' '" style="color: #E47470;">×</div> |
| | | <div style="color: #90BA87;" v-else>√</div> |
| | | </uni-td> |
| | | <uni-td align="center" style="font-size:25px;"> |
| | | <div v-if="item.isSupported || item.fRelevantObject!=' '" style="color: #90BA87;">√</div> |
| | | <div style="color: #E47470;" v-else>×</div> |
| | | </uni-td> |
| | | <uni-td align="center" class="click-wd"> |
| | | <div @click="openDrawings(item)">打开文档</div> |
| | | </uni-td> |
| | | </uni-tr> |
| | | </uni-table> |
| | | </u-modal> |
| | | </view> |
| | | |
| | | <!-- 文件预览弹窗 --> |
| | | <view v-if="showFilePreviewPopup" class="overlay"> |
| | | <view class="popup file-preview-popup"> |
| | |
| | | |
| | | <!-- 图片内容预览 --> |
| | | <view v-else-if="previewType === 'image'" class="image-preview-container"> |
| | | <image |
| | | :src="previewContent" |
| | | mode="aspectFit" |
| | | class="preview-image-clickable" |
| | | @click="previewImageInPopup" |
| | | style="width: 100%; max-height: 400px; cursor: pointer;" |
| | | /> |
| | | <image :src="previewContent" mode="aspectFit" class="preview-image-clickable" |
| | | @click="previewImageInPopup" style="width: 100%; max-height: 400px; cursor: pointer;" /> |
| | | <div class="image-zoom-hint">点击图片可放大查看</div> |
| | | </view> |
| | | |
| | |
| | | </view> |
| | | </div> |
| | | <div class="file-preview-actions"> |
| | | <button v-if="previewType !== 'text'" class="file-preview-btn download-btn" @click="downloadPreviewFile">📥 下载文件</button> |
| | | <button v-if="previewType !== 'text'" class="file-preview-btn download-btn" |
| | | @click="downloadPreviewFile">📥 下载文件</button> |
| | | <button class="file-preview-btn close-btn" @click="closeFilePreview">关闭</button> |
| | | </div> |
| | | </view> |
| | |
| | | lineNo: "", |
| | | |
| | | tableData: [], |
| | | drawing: [], |
| | | |
| | | isSubmit: true, |
| | | |
| | | isUpdate: true, |
| | | |
| | | isShowTable: false, |
| | | |
| | | drawingShow: false, |
| | | itemShow: false, |
| | | |
| | | remarks: "", |
| | | |
| | |
| | | this.departmentList = deptRes.data.tbBillList.map(item => item.departmentname); |
| | | |
| | | if (this.formData.workShop) { |
| | | const department = deptRes.data.tbBillList.find(item => item.departmentname === this.formData.workShop); |
| | | const department = deptRes.data.tbBillList.find(item => item.departmentname === this |
| | | .formData.workShop); |
| | | if (department) { |
| | | this.selectedDepartmentId = department.departmentid; |
| | | this.loadLineInfo(); |
| | |
| | | } |
| | | }) |
| | | } |
| | | },getInspectionItems() { |
| | | }, |
| | | getInspectionItems() { |
| | | // 获取检验项目的逻辑 - 调用存储过程 |
| | | this.$post({ |
| | | url: "/RKJ/genUpdate", |
| | |
| | | this.attachments = []; |
| | | this.$post({ |
| | | url: "/RKJ/getAttachments", |
| | | data: { itemNo: this.formData.itemNo } |
| | | data: { |
| | | itemNo: this.formData.itemNo |
| | | } |
| | | }).then(res => { |
| | | this.attachmentsLoading = false; |
| | | if (res.status === 0) { |
| | |
| | | this.$set(item, 'checking', false); |
| | | }); |
| | | } else if (res.status === 1 && res.message === "该检验单未上传附件信息!") { |
| | | uni.showToast({ title: res.message, icon: "none" }); |
| | | uni.showToast({ |
| | | title: res.message, |
| | | icon: "none" |
| | | }); |
| | | } else { |
| | | uni.showToast({ title: "获取附件失败", icon: "none" }); |
| | | uni.showToast({ |
| | | title: "获取附件失败", |
| | | icon: "none" |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | |
| | | // 去除所有空格、全角空格、回车、换行 |
| | | const fileName = item.fattach.replace(/[\s\u3000\r\n]+/g, '').trim(); |
| | | // 使用配置的服务器地址和FTP服务器地址 |
| | | const url = this.$store.state.serverInfo.serverAPI + "/RKJ/DownloadFtpFile?itemNo=" + encodeURIComponent(item.itemNo) + "&fileName=" + encodeURIComponent(fileName) + "&ftpServer=" + encodeURIComponent(this.$store.state.serverInfo.ftpServer); |
| | | const url = this.$store.state.serverInfo.serverAPI + "/RKJ/DownloadFtpFile?itemNo=" + encodeURIComponent( |
| | | item.itemNo) + "&fileName=" + encodeURIComponent(fileName) + "&ftpServer=" + encodeURIComponent( |
| | | this.$store.state.serverInfo.ftpServer); |
| | | |
| | | // 检查运行环境 |
| | | // #ifdef H5 |
| | |
| | | }, |
| | | // 在浏览器中下载文件 |
| | | downloadFileInBrowser(url, fileName) { |
| | | uni.showLoading({ title: '正在准备下载...' }); |
| | | uni.showLoading({ |
| | | title: '正在准备下载...' |
| | | }); |
| | | |
| | | // 方法1:创建隐藏的a标签下载 |
| | | try { |
| | |
| | | // 在APP中下载文件 |
| | | downloadFileInApp(url, fileName) { |
| | | // #ifdef APP-PLUS |
| | | uni.showLoading({ title: '从FTP服务器下载中...' }); |
| | | uni.showLoading({ |
| | | title: '从FTP服务器下载中...' |
| | | }); |
| | | |
| | | // Android 获取存储路径 |
| | | const saveDir = plus.os.name === 'Android' ? plus.io.convertLocalFileSystemURL('_downloads/') : plus.io.convertLocalFileSystemURL('_documents/'); |
| | | const saveDir = plus.os.name === 'Android' ? plus.io.convertLocalFileSystemURL('_downloads/') : plus.io |
| | | .convertLocalFileSystemURL('_documents/'); |
| | | const filePath = `${saveDir}${fileName}`; |
| | | |
| | | const downloadTask = uni.downloadFile({ |
| | |
| | | |
| | | // #ifdef MP |
| | | // 小程序环境的简化实现 |
| | | uni.showLoading({ title: '下载中...' }); |
| | | uni.showLoading({ |
| | | title: '下载中...' |
| | | }); |
| | | uni.downloadFile({ |
| | | url: url, |
| | | success: (res) => { |
| | | uni.hideLoading(); |
| | | if (res.statusCode === 200) { |
| | | uni.showToast({ title: '下载完成', icon: 'success' }); |
| | | uni.showToast({ |
| | | title: '下载完成', |
| | | icon: 'success' |
| | | }); |
| | | } |
| | | }, |
| | | fail: (error) => { |
| | | uni.hideLoading(); |
| | | uni.showModal({ title: '下载失败', content: error.errMsg, showCancel: false }); |
| | | uni.showModal({ |
| | | title: '下载失败', |
| | | content: error.errMsg, |
| | | showCancel: false |
| | | }); |
| | | } |
| | | }); |
| | | // #endif |
| | |
| | | return; |
| | | } |
| | | |
| | | const previewUrl = this.$store.state.serverInfo.serverAPI + "/RKJ/PreviewFtpFile?itemNo=" + encodeURIComponent(item.itemNo) + "&fileName=" + encodeURIComponent(fileName) + "&ftpServer=" + encodeURIComponent(this.$store.state.serverInfo.ftpServer); |
| | | const previewUrl = this.$store.state.serverInfo.serverAPI + "/RKJ/PreviewFtpFile?itemNo=" + |
| | | encodeURIComponent(item.itemNo) + "&fileName=" + encodeURIComponent(fileName) + "&ftpServer=" + |
| | | encodeURIComponent(this.$store.state.serverInfo.ftpServer); |
| | | |
| | | // 根据文件类型进行不同的预览处理 |
| | | if (['pdf'].includes(fileExt)) { |
| | |
| | | previewImageFile(url, fileName) { |
| | | // #ifdef APP-PLUS |
| | | // APP环境:先下载到本地再预览,避免网络图片加载问题 |
| | | uni.showLoading({ title: '加载图片...' }); |
| | | uni.showLoading({ |
| | | title: '加载图片...' |
| | | }); |
| | | uni.downloadFile({ |
| | | url: url, |
| | | success: (res) => { |
| | |
| | | // 预览文本文件 |
| | | previewTextFile(url, fileName) { |
| | | // 文本文件直接显示在弹窗中 |
| | | uni.showLoading({ title: '加载文件内容...' }); |
| | | uni.showLoading({ |
| | | title: '加载文件内容...' |
| | | }); |
| | | uni.request({ |
| | | url: url, |
| | | method: 'GET', |
| | |
| | | |
| | | // 下载预览文件 |
| | | downloadPreviewFile() { |
| | | const item = { fattach: this.previewTitle, itemNo: this.previewItemNo }; |
| | | const item = { |
| | | fattach: this.previewTitle, |
| | | itemNo: this.previewItemNo |
| | | }; |
| | | this.downloadAttachment(item); |
| | | this.closeFilePreview(); |
| | | }, |
| | |
| | | } else if (['doc', 'docx'].includes(fileExt)) { |
| | | // Word文件,尝试使用Word预览页面或者微软在线预览 |
| | | try { |
| | | const officePreviewUrl = `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(url)}`; |
| | | const officePreviewUrl = |
| | | `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(url)}`; |
| | | // 如果有webView页面,使用webView预览 |
| | | this.previewGenericFile(officePreviewUrl, fileName); |
| | | } catch (error) { |
| | |
| | | } |
| | | } else { |
| | | // 其他Office文件,使用微软在线预览服务 |
| | | const officePreviewUrl = `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(url)}`; |
| | | const officePreviewUrl = |
| | | `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(url)}`; |
| | | this.previewGenericFile(officePreviewUrl, fileName); |
| | | } |
| | | }, |
| | |
| | | cancelText: '取消', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | const item = { fattach: fileName, itemNo: this.selectedAttachment.itemNo }; |
| | | const item = { |
| | | fattach: fileName, |
| | | itemNo: this.selectedAttachment.itemNo |
| | | }; |
| | | this.downloadAttachment(item); |
| | | } |
| | | } |
| | |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | // 用户选择下载文件 |
| | | const item = { fattach: fileName, itemNo: this.selectedAttachment.itemNo }; |
| | | const item = { |
| | | fattach: fileName, |
| | | itemNo: this.selectedAttachment.itemNo |
| | | }; |
| | | this.downloadAttachment(item); |
| | | } |
| | | } |
| | |
| | | url: "/RKJ/saveDropdownFields", |
| | | data: requestData |
| | | }).then(res => { |
| | | if (res && res.data && res.data.data && res.data.data.tbBillList && res.data.data.tbBillList.length > 0) { |
| | | if (res && res.data && res.data.data && res.data.data.tbBillList && res.data.data.tbBillList |
| | | .length > 0) { |
| | | // 延迟重新加载数据,确保数据库更新完成 |
| | | setTimeout(() => { |
| | | this.init(); |
| | |
| | | console.error('保存失败:', err); |
| | | }); |
| | | }, |
| | | |
| | | |
| | | |
| | | drawingConfirm() { |
| | | this.drawingShow = false |
| | | this.imageShow = false |
| | | this.productionShow = false |
| | | this.itemShow=false |
| | | }, |
| | | drawingCancel() { |
| | | 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 = []; |
| | | uni.showToast({ |
| | | title: response.data.message || '该检验单未上传附件信息', |
| | | icon: 'none' |
| | | }); |
| | | } 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' |
| | | const item = itemNo; |
| | | console.log(itemNo) |
| | | // console.log(item) |
| | | const url = this.$store.state.serverInfo.serverAPI +"/PLM/RetrieveDrawings?ItemNo=" + item |
| | | |
| | | // const item = '5.06.04.4002'; |
| | | // const url = "http://192.168.0.100:10054/api/PLM/RetrieveDrawings?ItemNo=" + item |
| | | |
| | | let _this = this; |
| | | |
| | | uni.request({ |
| | | url: url, |
| | | method: 'POST', |
| | | success: (response) => { |
| | | console.log(response) |
| | | if (response.data.data == '返回结果为空') { |
| | | _this.drawing = [] |
| | | } else { |
| | | _this.drawing = response.data.data |
| | | // 遍历数据,判断文件后缀并添加字段 |
| | | _this.drawing.forEach((file) => { |
| | | // 获取文件名的后缀 |
| | | const fileExtension = file.fName.split('.').pop() |
| | | .toLowerCase(); |
| | | |
| | | // 定义支持的文件类型 |
| | | const supportedExtensions = ['jpg', 'pdf', 'xlsx', 'doc', |
| | | 'docx', |
| | | 'xls' |
| | | ]; |
| | | |
| | | // 判断是否支持该文件类型 |
| | | file.isSupported = supportedExtensions.includes(fileExtension); |
| | | }); |
| | | } |
| | | }, |
| | | fail: (error) => { |
| | | uni.showToast({ |
| | | title: '请求图纸链接失败', |
| | | icon: 'none' |
| | | }); |
| | | } |
| | | }); |
| | | this.drawingShow = true |
| | | }, |
| | | |
| | | getBom(){ |
| | | // 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 = []; |
| | | uni.showToast({ |
| | | title: response.data.message || '该检验单未上传附件信息', |
| | | icon: 'none' |
| | | }); |
| | | } 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); |
| | | } |
| | | }); |
| | | this.itemShow = true |
| | | }, |
| | | |
| | | //图纸相关文档 |
| | | 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}`; |
| | | console.log('请求URL:', url); |
| | | |
| | | const now = new Date(); |
| | | const timestamp = [ |
| | | now.getFullYear(), |
| | | String(now.getMonth() + 1).padStart(2, '0'), |
| | | String(now.getDate()).padStart(2, '0'), |
| | | String(now.getHours()).padStart(2, '0'), |
| | | String(now.getMinutes()).padStart(2, '0'), |
| | | String(now.getSeconds()).padStart(2, '0') |
| | | ].join(''); |
| | | |
| | | // 生成新文件名(基础名_时间戳.后缀) |
| | | this.fileName = `${item.fName}_${timestamp}.pdf`; |
| | | console.log('新文件名:', this.fileName); |
| | | |
| | | uni.downloadFile({ |
| | | url: url, |
| | | success: (res) => { |
| | | console.log(res); |
| | | let fileName = this.fileName; |
| | | let fileExt = fileName.split('.').pop(); |
| | | // let newFilePath = "_doc/uniapp_temp_1742877118745/download" + "/" + fileName; |
| | | // console.log('newFilePath', newFilePath) |
| | | if (fileExt === 'xls' || fileExt === 'xlsx' || fileExt === 'pdf'|| fileExt === 'jpg'|| fileExt === 'png') { |
| | | plus.io.resolveLocalFileSystemURL(res.tempFilePath, (entry) => { |
| | | // 获取文件所在的目录 |
| | | entry.getParent((parentEntry) => { |
| | | let newFileName = this.fileName; // 新的文件名 |
| | | |
| | | // 移动并重命名文件 |
| | | entry.moveTo( |
| | | parentEntry, |
| | | newFileName, |
| | | (newEntry) => { |
| | | console.log('重命名成功:', newEntry.fullPath); |
| | | |
| | | // 打开 Excel 文件 |
| | | plus.runtime.openFile(newEntry.fullPath, {}, (e) => { |
| | | console.error('无法打开 Excel 文件:', e); |
| | | }); |
| | | |
| | | // let pages = getCurrentPages(); |
| | | // let beforePage = pages[pages.length - 2]; |
| | | // uni.navigateBack({ |
| | | // delta: 1, //返回的页面数,如果为1表示返回上一页 |
| | | // success: (event) => { |
| | | // beforePage.$vm.reload() |
| | | // } |
| | | // }); |
| | | |
| | | }, |
| | | (err) => { |
| | | console.error('重命名失败:', err); |
| | | } |
| | | ); |
| | | }, (err) => { |
| | | console.error('获取父目录失败:', err); |
| | | }); |
| | | }, (err) => { |
| | | console.error('获取文件失败:', err); |
| | | }); |
| | | } else { |
| | | console.error('文件格式不匹配:', fileExt); |
| | | uni.showToast({ |
| | | title: '文件格式不支持', |
| | | icon: 'none' |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | uni.request({ |
| | | url: url, |
| | | method: 'POST', |
| | | responseType: 'arraybuffer', |
| | | success: (response) => { |
| | | console.log(response.data) |
| | | if (!response) { |
| | | uni.showToast({ |
| | | title: "协议预览失败", |
| | | duration: 2000 |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | fail: (error) => { |
| | | console.log(error) |
| | | uni.showToast({ |
| | | title: '请求预览链接失败', |
| | | icon: 'none' |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | uni.showToast({ |
| | | title: '请求预览链接失败', |
| | | icon: 'none' |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | saveFngDesc() { |
| | | // 保存不良描述到数据库 |
| | | this.$post({ |
| | |
| | | font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif; |
| | | max-width: 1000px; |
| | | margin: 0 auto; |
| | | padding: 20px 20px 100px 20px; /* 底部增加内边距为固定按钮留空间 */ |
| | | padding: 20px 20px 100px 20px; |
| | | /* 底部增加内边距为固定按钮留空间 */ |
| | | background-color: #fff; |
| | | box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); |
| | | min-height: 100vh; |
| | |
| | | padding: 12px; |
| | | flex-wrap: wrap; |
| | | align-items: center; |
| | | position: fixed; /* 固定在屏幕底部 */ |
| | | bottom: 0; /* 距离底部0px */ |
| | | left: 0; /* 距离左边0px */ |
| | | right: 0; /* 距离右边0px */ |
| | | background-color: #fff; /* 背景色 */ |
| | | border-top: 1px solid #e9ecef; /* 顶部边框 */ |
| | | z-index: 1000; /* 确保在最上层 */ |
| | | box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); /* 顶部阴影 */ |
| | | position: fixed; |
| | | /* 固定在屏幕底部 */ |
| | | bottom: 0; |
| | | /* 距离底部0px */ |
| | | left: 0; |
| | | /* 距离左边0px */ |
| | | right: 0; |
| | | /* 距离右边0px */ |
| | | background-color: #fff; |
| | | /* 背景色 */ |
| | | border-top: 1px solid #e9ecef; |
| | | /* 顶部边框 */ |
| | | z-index: 1000; |
| | | /* 确保在最上层 */ |
| | | box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); |
| | | /* 顶部阴影 */ |
| | | } |
| | | |
| | | .action-btn { |