From 27294f1626cdb785fe4c7401dde3266db188ccf4 Mon Sep 17 00:00:00 2001 From: xwt <2740516069@qq.com> Date: 星期四, 07 八月 2025 21:42:44 +0800 Subject: [PATCH] 来料检修改,附件图片放大 --- pages/fileView/jpgView.vue | 95 +++++++++++++++ manifest.json | 2 pages/fileView/imageView.vue | 97 +++++++++++++++ pages/QC/LLJ/Add.vue | 129 +++++++++++++-------- store/index.js | 4 5 files changed, 271 insertions(+), 56 deletions(-) diff --git a/manifest.json b/manifest.json index 6aa82a6..d7929e2 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name" : "GS-MES-AP", "appid" : "__UNI__F08FAE3", "description" : "", - "versionName" : "1.1.2.9", + "versionName" : "1.1.3.0", "versionCode" : 1, "transformPx" : false, /* 5+App鐗规湁鐩稿叧 */ 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 diff --git a/pages/fileView/imageView.vue b/pages/fileView/imageView.vue index 1a7764f..d46327b 100644 --- a/pages/fileView/imageView.vue +++ b/pages/fileView/imageView.vue @@ -1,7 +1,18 @@ <template> <view class="container"> - <!-- 浣跨敤 <image> 缁勪欢鏄剧ず鍥剧墖 --> - <image :src="imageUrl" mode="widthFix" style="width: 100%;"></image> + <!-- 浣跨敤 <image> 缁勪欢鏄剧ず鍥剧墖锛屾坊鍔犵偣鍑讳簨浠� --> + <image + :src="imageUrl" + mode="aspectFit" + class="preview-image" + @click="previewImage" + :style="{ width: '100%', height: '100%' }" + /> + + <!-- 鏀惧ぇ鎻愮ず --> + <view class="zoom-hint"> + <text class="hint-text">鐐瑰嚮鍥剧墖鍙斁澶ф煡鐪�</text> + </view> </view> </template> @@ -9,13 +20,44 @@ export default { data() { return { - imageUrl: "" ,// 鐢ㄤ簬瀛樺偍鍥剧墖鐨� URL + imageUrl: "", // 鐢ㄤ簬瀛樺偍鍥剧墖鐨� URL }; }, onLoad(options) { // 浠庨〉闈㈣烦杞殑鍙傛暟涓幏鍙栧浘鐗� URL if (options.url) { this.imageUrl = decodeURIComponent(options.url); + } + }, + methods: { + // 鍥剧墖鏀惧ぇ棰勮 + previewImage() { + // 浣跨敤uni.previewImage API瀹炵幇鍥剧墖鏀惧ぇ棰勮 + uni.previewImage({ + current: this.imageUrl, // 褰撳墠鏄剧ず鍥剧墖鐨勯摼鎺� + urls: [this.imageUrl], // 闇�瑕侀瑙堢殑鍥剧墖閾炬帴鍒楄〃 + 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' + }); + } + }); } } }; @@ -24,8 +66,57 @@ <style scoped> .container { display: flex; + flex-direction: column; justify-content: center; align-items: center; height: 100vh; + background-color: #000; + position: relative; +} + +.preview-image { + max-width: 100%; + max-height: 80vh; + object-fit: contain; + cursor: pointer; + transition: transform 0.2s ease; +} + +.preview-image:hover { + transform: scale(1.02); +} + +.zoom-hint { + position: absolute; + bottom: 20px; + left: 50%; + transform: translateX(-50%); + background-color: rgba(0, 0, 0, 0.7); + color: white; + padding: 8px 16px; + border-radius: 20px; + font-size: 14px; + z-index: 10; +} + +.hint-text { + color: #fff; + font-size: 12px; +} + +/* 鍝嶅簲寮忚璁� */ +@media (max-width: 768px) { + .preview-image { + max-height: 70vh; + } + + .zoom-hint { + bottom: 10px; + padding: 6px 12px; + } + + .hint-text { + font-size: 11px; + } } </style> \ No newline at end of file diff --git a/pages/fileView/jpgView.vue b/pages/fileView/jpgView.vue index 565bee1..62095c6 100644 --- a/pages/fileView/jpgView.vue +++ b/pages/fileView/jpgView.vue @@ -1,7 +1,18 @@ <template> <view class="container"> - <!-- 浣跨敤 <image> 缁勪欢鏄剧ず鍥剧墖 --> - <image :src="imageUrl" mode="widthFix" style="width: 100%;"></image> + <!-- 浣跨敤 <image> 缁勪欢鏄剧ず鍥剧墖锛屾坊鍔犵偣鍑讳簨浠� --> + <image + :src="imageUrl" + mode="aspectFit" + class="preview-image" + @click="previewImage" + :style="{ width: '100%', height: '100%' }" + /> + + <!-- 鏀惧ぇ鎻愮ず --> + <view class="zoom-hint"> + <text class="hint-text">鐐瑰嚮鍥剧墖鍙斁澶ф煡鐪�</text> + </view> </view> </template> @@ -17,6 +28,37 @@ if (options.url) { this.imageUrl = decodeURIComponent(options.url); } + }, + methods: { + // 鍥剧墖鏀惧ぇ棰勮 + previewImage() { + // 浣跨敤uni.previewImage API瀹炵幇鍥剧墖鏀惧ぇ棰勮 + uni.previewImage({ + current: this.imageUrl, // 褰撳墠鏄剧ず鍥剧墖鐨勯摼鎺� + urls: [this.imageUrl], // 闇�瑕侀瑙堢殑鍥剧墖閾炬帴鍒楄〃 + 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' + }); + } + }); + } } }; </script> @@ -24,8 +66,57 @@ <style scoped> .container { display: flex; + flex-direction: column; justify-content: center; align-items: center; height: 100vh; + background-color: #000; + position: relative; +} + +.preview-image { + max-width: 100%; + max-height: 80vh; + object-fit: contain; + cursor: pointer; + transition: transform 0.2s ease; +} + +.preview-image:hover { + transform: scale(1.02); +} + +.zoom-hint { + position: absolute; + bottom: 20px; + left: 50%; + transform: translateX(-50%); + background-color: rgba(0, 0, 0, 0.7); + color: white; + padding: 8px 16px; + border-radius: 20px; + font-size: 14px; + z-index: 10; +} + +.hint-text { + color: #fff; + font-size: 12px; +} + +/* 鍝嶅簲寮忚璁� */ +@media (max-width: 768px) { + .preview-image { + max-height: 70vh; + } + + .zoom-hint { + bottom: 10px; + padding: 6px 12px; + } + + .hint-text { + font-size: 11px; + } } </style> \ No newline at end of file diff --git a/store/index.js b/store/index.js index d50ed24..3fb8f02 100644 --- a/store/index.js +++ b/store/index.js @@ -10,9 +10,9 @@ networkFlag:'鍐呯綉', serverURLInt:'http://192.168.11.251:10055',//鏈嶅姟鍣ㄤ綋妫� 10.0.1.104:10054 serverURL:'http://localhost:10055',//鏈湴璋冭瘯鍦板潃 - //serverAPI:'http://localhost:5184/api',//褰撳墠姝e湪浣跨敤鐨勬湇鍔″櫒,榛樿涓哄缃� localhost + serverAPI:'http://localhost:5184/api',//褰撳墠姝e湪浣跨敤鐨勬湇鍔″櫒,榛樿涓哄缃� localhost //serverAPI:'http://192.168.1.22:10054/api',//鍐呯綉 - serverAPI:'http://36.26.21.214:10055/api', + //serverAPI:'http://36.26.21.214:10055/api', ftpServer:'ftp://36.26.21.214',//FTP鏈嶅姟鍣ㄥ湴鍧� } }, -- Gitblit v1.9.3