From 27294f1626cdb785fe4c7401dde3266db188ccf4 Mon Sep 17 00:00:00 2001 From: xwt <2740516069@qq.com> Date: 星期四, 07 八月 2025 21:42:44 +0800 Subject: [PATCH] 来料检修改,附件图片放大 --- pages/QC/LLJ/Add.vue | 129 +++++++++++++++++++++++++++---------------- 1 files changed, 81 insertions(+), 48 deletions(-) diff --git a/pages/QC/LLJ/Add.vue b/pages/QC/LLJ/Add.vue index 12abf50..45778cf 100644 --- a/pages/QC/LLJ/Add.vue +++ b/pages/QC/LLJ/Add.vue @@ -284,7 +284,14 @@ <!-- 鍥剧墖鍐呭棰勮 --> <view v-else-if="previewType === 'image'" class="image-preview-container"> - <image :src="previewContent" mode="widthFix" style="width: 100%; max-height: 400px;"></image> + <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> <!-- Excel 绛� Office 鏂囦欢鎻愮ず --> @@ -484,7 +491,8 @@ addDefectDescription() { // 娣诲姞涓嶈壇鎻忚堪鐨勯�昏緫 this.remarksPopup = !this.remarksPopup; - this.remarks = this.formData.remarks; + this.remarks = this.formData.remarks || this.remarks || ''; + console.log('鎵撳紑寮圭獥鏃剁殑remarks鍊�:', this.remarks); }, submitInspection() { if (this.PSTYPE == '') { @@ -684,10 +692,12 @@ this.badreason = data.blyy || ''; this.PSTYPE = data.pszt || ''; this.WORKSHOP = data.sscj || ''; - console.log('璧嬪�煎悗', this.badreason, this.PSTYPE, this.WORKSHOP); + this.remarks = data.remarks || ''; // 璁剧疆remarks鍙橀噺 + // 纭繚PHSY瀛楁琚纭缃� this.formData.PHSY = data.PHSY; + this.PHSY = data.PHSY || ''; // 鍚屾椂璁剧疆椤甸潰缁戝畾鐨凱HSY鍙橀噺 console.log("鍔犺浇鐨勭揣鎬ユ斁琛岀姸鎬�:", this.formData.emergencyStatus); this.$post({ @@ -741,27 +751,7 @@ url: 'SysSubmitFrom?releaseNo=' + releaseNo + '&userID=' + this.$loginInfo.account }); }, - editRemarks() { - // 淇濆瓨涓嶈壇鎻忚堪 - this.$post({ - url: "/LLJ/saveRemarksGid", - data: { - gid: this.formData.id, - remarks: this.remarks || '', - releaseNo: this.formData.releaseNo - // 涓嶅啀鍖呭惈PHSY瀛楁 - } - }).then(res => { - if (res.data.tbBillList > 0) { - this.formData.remarks = this.remarks; - this.remarksPopup = !this.remarksPopup; - this.$showMessage("淇濆瓨鎴愬姛"); - setTimeout(() => { - this.init(); - }, 2000); - } - }) - }, + drawingConfirm() { this.drawingShow = false @@ -1244,14 +1234,12 @@ }); }, editRemarks() { - // 淇濆瓨涓嶈壇鎻忚堪 this.$post({ url: "/LLJ/saveRemarksGid", data: { gid: this.formData.id, remarks: this.remarks || '', releaseNo: this.formData.releaseNo - // 涓嶅啀鍖呭惈PHSY瀛楁 } }).then(res => { if (res.data.tbBillList > 0) { @@ -1271,10 +1259,8 @@ this.isInteger = true; }, editDestruction() { - // 楠岃瘉杈撳叆鏄惁涓烘暣鏁� if(this.PHSY === '') { this.isInteger = true; - // 濡傛灉涓虹┖锛屼紶閫掔┖瀛楃涓诧紝鍚庣浼氬鐞嗕负null } else { const isInteger = /^-?\d+$/.test(this.PHSY); this.isInteger = isInteger; @@ -1282,21 +1268,16 @@ return; } } - - // 淇濆瓨鐮村潖瀹為獙鏁伴噺锛屽苟甯︿笂涓嶈壇鍘熷洜銆佹墍灞炶溅闂淬�佽瘎瀹$姸鎬� + this.$post({ - url: "/LLJ/saveRemarksGid", + url: "/LLJ/savePhsyGid", data: { gid: this.formData.id, releaseNo: this.formData.releaseNo, - PHSY: this.PHSY, // 鍙互鏄┖瀛楃涓叉垨鏈夋晥鏁存暟 - BLYY: this.badreason, - SSCJ: this.WORKSHOP, - PSZT: this.PSTYPE + PHSY: this.PHSY } }).then(res => { if (res.data.tbBillList > 0) { - // 濡傛灉杈撳叆涓虹┖锛岃缃负null浠ヤ究涓嶆樉绀� this.formData.PHSY = this.PHSY === '' ? null : this.PHSY; this.destructionPopup = false; this.$showMessage("淇濆瓨鎴愬姛"); @@ -1307,21 +1288,17 @@ }) }, clearDestruction() { - // 娓呴櫎鐮村潖瀹為獙鏁伴噺 this.PHSY = ''; this.$post({ - url: "/LLJ/saveRemarksGid", + url: "/LLJ/savePhsyGid", data: { gid: this.formData.id, releaseNo: this.formData.releaseNo, - PHSY: '', // 绌哄瓧绗︿覆锛屽悗绔細澶勭悊涓簄ull - BLYY: this.badreason, - SSCJ: this.WORKSHOP, - PSZT: this.PSTYPE + PHSY: '' } }).then(res => { if (res.data.tbBillList > 0) { - this.formData.PHSY = null; // 纭繚鍓嶇涔熶负null锛屼笉鏄剧ず + this.formData.PHSY = null; this.destructionPopup = false; this.$showMessage("娓呴櫎鎴愬姛"); setTimeout(() => { @@ -1557,6 +1534,36 @@ const item = { fattach: this.previewTitle, itemNo: this.previewItemNo }; this.downloadAttachment(item); this.closeFilePreview(); + }, + + // 鍦ㄥ脊绐椾腑棰勮鍥剧墖锛堟斁澶у姛鑳斤級 + previewImageInPopup() { + // 浣跨敤uni.previewImage API瀹炵幇鍥剧墖鏀惧ぇ棰勮 + uni.previewImage({ + current: this.previewContent, // 褰撳墠鏄剧ず鍥剧墖鐨勯摼鎺� + urls: [this.previewContent], // 闇�瑕侀瑙堢殑鍥剧墖閾炬帴鍒楄〃 + loop: false, // 鏄惁寮�鍚浘鐗囪疆鎾� + indicator: 'default', // 鍥剧墖鎸囩ず鍣ㄧ被鍨� + longPressActions: { + itemList: ['鍙戦�佺粰鏈嬪弸', '淇濆瓨鍥剧墖', '鏀惰棌'], + success: function (data) { + console.log('閫変腑浜嗙' + (data.tapIndex + 1) + '涓寜閽�'); + }, + fail: function (err) { + console.log(err.errMsg); + } + }, + success: () => { + console.log('鍥剧墖棰勮鎴愬姛'); + }, + fail: (err) => { + console.error('鍥剧墖棰勮澶辫触:', err); + uni.showToast({ + title: '鍥剧墖棰勮澶辫触', + icon: 'none' + }); + } + }); }, // 棰勮Office鏂囦欢 @@ -1867,14 +1874,13 @@ }, saveRemarksGid() { this.$post({ - url: "/LLJ/saveRemarksGid", + url: "/LLJ/saveDropdownFields", data: { gid: this.formData.id, releaseNo: this.formData.releaseNo, - BLYY: this.badreason, - SSCJ: this.WORKSHOP, - PSZT: this.PSTYPE, - PHSY: this.PHSY // 鏂板锛屼繚璇佺牬鍧忓疄楠屾暟涓嶄細琚埛鎺� + BLYY: this.badreason || '', + SSCJ: this.WORKSHOP || '', + PSZT: this.PSTYPE || '' } }).then(res => { if (res.data.tbBillList > 0) { @@ -2578,4 +2584,31 @@ overflow-x: auto; } } + + /* 鍥剧墖鏀惧ぇ棰勮鐩稿叧鏍峰紡 */ + .preview-image-clickable { + transition: transform 0.2s ease; + border-radius: 8px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); + } + + .preview-image-clickable:hover { + transform: scale(1.02); + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); + } + + .image-zoom-hint { + text-align: center; + margin-top: 8px; + font-size: 12px; + color: #666; + font-style: italic; + } + + .image-preview-container { + position: relative; + display: flex; + flex-direction: column; + align-items: center; + } </style> \ No newline at end of file -- Gitblit v1.9.3