From b76e716ff4656191d73eba398e9eb39ee975e13b Mon Sep 17 00:00:00 2001 From: xwt <2740516069@qq.com> Date: 星期五, 04 七月 2025 12:58:09 +0800 Subject: [PATCH] 来料检优化,首检巡检 --- pages/QC/LLJ/Add.vue | 676 ++++++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 528 insertions(+), 148 deletions(-) diff --git a/pages/QC/LLJ/Add.vue b/pages/QC/LLJ/Add.vue index d4a9f86..3edd803 100644 --- a/pages/QC/LLJ/Add.vue +++ b/pages/QC/LLJ/Add.vue @@ -4,9 +4,10 @@ <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 style="text-align: right;" class="action-buttons"> + <a class="sysLike" v-if="this.current" @click="toSysSubmitFrom(formData.releaseNo)">瀹為獙瀹ら�佹</a> + </view> </view> <!-- 鍩烘湰淇℃伅鍖� --> @@ -30,11 +31,6 @@ <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"> @@ -50,11 +46,11 @@ <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">{{formData.projectCodes}}</view> + <view class="info-label">鏁伴噺锛�</view> <view class="info-value highlight">{{formData.fcovertQty}}</view> + </view> <view class="info-block" v-if="formData.fngDesc!=null"> <view class="info-label">涓嶈壇鎻忚堪锛�</view> @@ -93,26 +89,37 @@ </select> </view> - <view class="dropdown-row"> - <view class="info-label">澶囨敞锛�</view> - <input type="text" id="remark" v-model="REMARK" placeholder="璇疯緭鍏ュ娉ㄤ俊鎭�" /> + <view class="info-block" style="margin-top: 10px;"> + <view class="info-label">澶囨敞锛�</view> + <input type="text" id="lotNo1" v-model="formData.lotNo1" + placeholder="璇疯緭鍏ュ娉ㄤ俊鎭�" + style="color: red; font-weight: bold;"/> </view> + <view class="info-block" style="margin-top: 10px;"> + <view class="info-label">鐮村潖瀹為獙鏁伴噺锛�</view> + <view class="info-value highlight">{{formData.phsy}}</view> + </view> + <!-- 鎿嶄綔鎸夐挳鍖� --> <view class="action-buttons" v-if="this.current"> - <button class="secondary-btn" @click="getInspectionItems">鑾峰彇妫�楠岄」鐩�</button> + <button class="secondary-btn" @click="handleEmergencyRelease">绱ф�ユ斁琛�</button> + <button class="secondary-btn" @click="handleWithdraw">鎾ゅ洖</button> + <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="20%" style="text-align: center;">妫�楠岄」鐩�</th> <th width="50%" style="text-align: center;">妫�楠屾弿杩�</th> - <th width="20%" style="text-align: center;">璁板綍(鐐瑰嚮)</th> + <th width="15%" style="text-align: center;">璁板綍(鐐瑰嚮)</th> </tr> </thead> <tbody> @@ -134,6 +141,7 @@ <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> @@ -141,6 +149,7 @@ <!-- 鎿嶄綔鎸夐挳鍖� --> <view class="action-buttons"> + <button class="secondary-btn" @click="addDestruction" v-if="this.current">鐮村潖瀹為獙</button> <button class="secondary-btn" @click="uploadImages">涓婁紶/鏌ョ湅鍥剧墖</button> <button class="secondary-btn" @click="fetchDrawingNumber">璋冨彇PLM鍥剧焊</button> <button class="secondary-btn" @click="addDefectDescription" v-if="this.current">娣诲姞涓嶈壇鎻忚堪</button> @@ -160,7 +169,23 @@ <button @click="remarksPopup = !remarksPopup">鍙栨秷</button> </view> </view> - + + <view v-if="destructionPopup" 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="PHSY" placeholder="鐣欑┖琛ㄧず娓呴櫎鏁伴噺" /> + </view> + </form> + <div v-if="!isInteger" class="error-message">璇疯緭鍏ユ暣鏁板�兼垨鐣欑┖</div> + <button class="updateBut" @click="editDestruction">淇敼</button> + <button @click="clearDestruction">娓呴櫎</button> + <button @click="destructionPopup = !destructionPopup">鍙栨秷</button> + </view> + </view> + <view class="barcode"> <u-modal :show="drawingShow" title="鍥剧焊鏄庣粏" @confirm="drawingConfirm" @cancel="drawingCancel" showCancelButton> @@ -188,8 +213,8 @@ </uni-table> </u-modal> </view> - </view> + </template> <script> @@ -211,10 +236,22 @@ boardModel: "", planQty: "", mocode: "", - boardStyle: "" + boardStyle: "", + itemId: "", + emergencyStatus: false, + lotNo1: '', + emergency:'', + permissionModalVisible: false, + permissionAccount: '', + hasEmergencyPermission: false, + showPopup: false, + PHSY:'', + EMERGENCY: '0', + }, tableData: [], remarksPopup: false, + meomPopup: false, current: true, drawing: [], drawingShow: false, @@ -223,18 +260,29 @@ WORKSHOP: '', REMARK: '', checkState: false, - writeStatu: true + writeStatu: true, + fileName:'', + originalRemarks: '', + hasEmergencyPermission: false, + destructionPopup: false, + PHSY: '', + isInteger: 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"]; + this.emergency = params["emergency"] + this.meom = params["meom"] if (params["current"] === 'A') { this.current = true; @@ -257,6 +305,7 @@ }); } + if (this.$loginInfo.account === 'PL017') {this.hasEmergencyPermission = true;} }, methods: { @@ -280,9 +329,10 @@ this.$post({ url: "/LLJ/setJYItem", data: { - itemNo: this.formData.itemNo, + itemNo: this.formData.itemId, quantity: this.formData.fcovertQty, - releaseNo: this.formData.releaseNo + releaseNo: this.formData.releaseNo, + PHSY: this.formData.PHSY } }).then(res => { if (res.status == 0) { @@ -309,6 +359,7 @@ } }); }, + fillRecord(item, index) { // 濉啓璁板綍鐨勯�昏緫 uni.navigateTo({ @@ -349,7 +400,7 @@ if (this.formData.fngDesc == '' || this.writeStatu == false) { uni.showToast({ - title: '鏈~鍐欎笉鑹弿杩版垨涓変釜閫夋嫨妗嗘湭閫夋嫨瀹�', + title: '鏈~鍐欎笉鑹弿杩版垨涓嶈壇鍘熷洜鎴栨墍灞炶溅闂存垨璇勫鐘舵��', icon: 'none' }); } else { @@ -363,25 +414,48 @@ }).then(res => { if (res.status == 0) { - this.QcIssueResultDetailes = { - fbatchQty: this.formData.fbatchQty, - itemName: this.formData.itemName, - itemNo: this.formData.itemNo, - suppName: this.formData.suppName, - appicationReason: this.formData.fngDesc, - badReason: this.badreason, - remark: this.REMARK, - releaseNo: this.formData.releaseNo, - staffNo: 'HMCS', - // staffNo: this.formData.userNo, - iqcStatus: this.PSTYPE, - department: this.DEPARTMENT - }; + if(this.$loginInfo.account == 'PL017'){ + this.QcIssueResultDetailes = { + fbatchQty: this.formData.fbatchQty, + itemName: this.formData.itemName, + itemNo: this.formData.itemNo, + suppName: this.formData.suppName, + appicationReason: this.formData.fngDesc, + badReason: this.badreason, + remark: this.REMARK, + workShop: this.WORKSHOP, + releaseNo: this.formData.releaseNo, + staffNo: 'HMCS', + // staffNo: this.$loginInfo.account, + iqcStatus: this.PSTYPE, + department: this.DEPARTMENT, + EMERGENCY: this.formData.emergencyStatus ? "1" : "0" // 纭繚绱ф�ユ斁琛岀姸鎬佹纭紶閫� + }; + } + else{ + this.QcIssueResultDetailes = { + fbatchQty: this.formData.fbatchQty, + itemName: this.formData.itemName, + itemNo: this.formData.itemNo, + suppName: this.formData.suppName, + appicationReason: this.formData.fngDesc, + badReason: this.badreason, + remark: this.REMARK, + workShop: this.WORKSHOP, + releaseNo: this.formData.releaseNo, + // staffNo: 'HMCS', + staffNo: this.$loginInfo.account, + iqcStatus: this.PSTYPE, + department: this.DEPARTMENT, + EMERGENCY: this.formData.emergencyStatus ? "1" : "0" // 纭繚绱ф�ユ斁琛岀姸鎬佹纭紶閫� + }; + } - console.log(this.QcIssueResultDetailes) + console.log("鎻愪氦鐨勭揣鎬ユ斁琛岀姸鎬侊細", this.formData.emergencyStatus ? "1" : "0"); + console.log("瀹屾暣鐨勬彁浜ゆ暟鎹細", this.QcIssueResultDetailes); - const url = `http://192.168.1.22:10054/api/QcIssueResult/GetProcessNo`; - // 鍙戦�� POST 璇锋眰 + const url = this.$store.state.serverInfo.serverAPI+`/QcIssueResult/GetProcessNo`; + if (this.PSTYPE === '鐗归噰/璁╂浣跨敤') {// 鍙戦�� POST 璇锋眰 uni.request({ url: url, // 璇锋眰鍦板潃 method: 'POST', // 璇锋眰鏂规硶 @@ -413,7 +487,7 @@ }); } }); - + } uni.showToast({ title: res.message.toString(), icon: 'success', @@ -491,8 +565,16 @@ }).then(res => { let data = res.data.tbBillList[0]; if (data) { - this.formData = data; - + this.formData = { + ...data, + emergencyStatus: data.emergency === 1 || data.emergency === "1" || data.emergency === true + }; + + // 纭繚PHSY瀛楁琚纭缃� + this.formData.PHSY = data.PHSY; + + console.log("鍔犺浇鐨勭揣鎬ユ斁琛岀姸鎬�:", this.formData.emergencyStatus); + this.$post({ url: "/LLJ/getJYItem", data: { @@ -503,9 +585,9 @@ let tableData = res1.data.tbBillList //褰撳凡妫�楠屼釜鏁伴兘涓嶄负绌烘椂鎸夌収妫�娴嬬粨鏋勬帓搴� tableData.sort((a, b) => { - if (a.result === '鏈畬鎴�' && b.result === '鍚堟牸') { + if (a.result === '鍚堟牸' && b.result === '鏈畬鎴�') { return -1; - } else if (a.result === '鍚堟牸' && b.result === '鏈畬鎴�') { + } else if (a.result === '鏈畬鎴�' && b.result === '鍚堟牸') { return 1; } else { return 0; @@ -545,58 +627,25 @@ }); }, 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("淇濆瓨鎴愬姛"); - setTimeout(() => { - let pages = getCurrentPages(); - let beforePage = pages[pages.length - 2]; - uni.navigateBack({ - delta: 1, //杩斿洖鐨勯〉闈㈡暟锛屽鏋滀负1琛ㄧず杩斿洖涓婁竴椤� - success: (event) => { - beforePage.$vm.reload() - } - }); - }, 2000); - } - }) - } 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("淇濆瓨鎴愬姛"); - setTimeout(() => { - let pages = getCurrentPages(); - let beforePage = pages[pages.length - 2]; - uni.navigateBack({ - delta: 1, //杩斿洖鐨勯〉闈㈡暟锛屽鏋滀负1琛ㄧず杩斿洖涓婁竴椤� - success: (event) => { - beforePage.$vm.reload() - } - }); - }, 2000); - } - }) - } + // 淇濆瓨涓嶈壇鎻忚堪 + 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() { @@ -611,26 +660,28 @@ }, fetchDrawingNumber() { - const item = '83070100066' - // const item = this.formData.itemNo; - // console.log(this.formData.itemNo) + // const item = '83040700101' + const item = this.formData.itemNo; + console.log(this.formData.itemNo) // console.log(item) - const url = "http://192.168.1.22:10054/api/PLM/RetrieveDrawings?ItemNo=" + 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 = null + _this.drawing = null } else { - this.drawing = response.data.data + _this.drawing = response.data.data // 閬嶅巻鏁版嵁锛屽垽鏂枃浠跺悗缂�骞舵坊鍔犲瓧娈� - this.drawing.forEach((file) => { + _this.drawing.forEach((file) => { // 鑾峰彇鏂囦欢鍚嶇殑鍚庣紑 const fileExtension = file.fName.split('.').pop() .toLowerCase(); @@ -661,14 +712,123 @@ openDrawings(item) { console.log("jkjoi", item) if (item.fRelevantObject.length > 2) { - const url = "http://192.168.1.22:10054/api/PLM/OpenDrawings?fileId=" + item.fRelevantObject + - '&fName=' + encodeURIComponent(item.fName.replace(/\%/g, '%25').replace(/\ /g, '%20') - .replace( - /\#/g, '%23').replace(/\?/g, '%3F').replace(/\+/g, '%2B').replace(/\//g, '%2F') - .replace( - /\&/g, '%26')) - console.log('jpgurl锛� ' + url); + // 鐢熸垚璇锋眰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.downloadFile({ + // url: url, + // responseType: 'arraybuffer', // 鍏抽敭锛氭寚瀹氬搷搴旀暟鎹被鍨嬩负 ArrayBuffer + // success: (res) => { + // console.log(res) + // if (res.statusCode === 200) { + // // 鑾峰彇 ArrayBuffer 鏁版嵁 + // const arrayBuffer = res.data; + // // 鍙�夛細楠岃瘉鏂囦欢绫诲瀷锛堜緥濡傛鏌� PDF 鏂囦欢澶达級 + // const header = new Uint8Array(arrayBuffer).subarray(0, 4); + // const headerStr = Array.from(header).map(byte => byte.toString(16).padStart(2, + // '0')).join('').toUpperCase(); + // if (headerStr !== '25504446') { // PDF 鏂囦欢澶翠负 "%PDF" 鐨勫崄鍏繘鍒惰〃绀� + // console.error('鏂囦欢鏍煎紡鏃犳晥锛岄潪 PDF 鏂囦欢'); + // return; + // } + + // // 淇濆瓨涓轰复鏃舵枃浠讹紙纭繚鎵╁睍鍚嶄负 .pdf锛� + // const tempPath = `${wx.env.USER_DATA_PATH}/${Date.now()}.pdf`; // 寰俊灏忕▼搴忚矾寰� + // uni.saveFile({ + // tempFilePath: arrayBuffer, // 娉ㄦ剰锛氶儴鍒嗗钩鍙板彲鑳介渶瑕佽浆鎹� ArrayBuffer 涓� Base64 + // filePath: tempPath, + // success: () => { + // uni.openDocument({ + // filePath: tempPath, + // fileType: 'pdf', + // success: () => console.log('鏂囨。鎵撳紑鎴愬姛'), + // fail: (err) => console.error('鎵撳紑澶辫触:', err) + // }); + // }, + // fail: (saveErr) => console.error('淇濆瓨鏂囦欢澶辫触:', saveErr) + // }); + // } else { + // console.error('涓嬭浇澶辫触锛岀姸鎬佺爜:', res.statusCode); + // } + // }, + // fail: (error) => { + // console.error('涓嬭浇璇锋眰澶辫触:', error.errMsg); + // } + // }); uni.request({ url: url, method: 'POST', @@ -681,19 +841,32 @@ duration: 2000 }); } - const base64Data = uni.arrayBufferToBase64(response.data); + + + + // const base64Data = uni.arrayBufferToBase64(response.data); - // 鏋勯�犱竴涓彲浠ョ敤浜庨瑙堢殑 Data URL - const pdfUrl = `data:application/pdf;base64,${base64Data}`; + // // 鏋勯�犱竴涓彲浠ョ敤浜庨瑙堢殑 Data URL + // const pdfUrl = `data:application/pdf;base64,${base64Data}`; - // 浣跨敤 pdfUrl 浣滀负棰勮璺緞 - console.log("PDF 棰勮璺緞锛�", pdfUrl); + // // 浣跨敤 pdfUrl 浣滀负棰勮璺緞 + // console.log("PDF 棰勮璺緞锛�", pdfUrl); - // 灏� Base64 鏁版嵁浼犻�掔粰鍙︿竴涓〉闈㈣繘琛岄瑙� - // 娉ㄦ剰锛氱洿鎺ヤ紶閫� pdfUrl 鍙兘浼氬鑷� URL 杩囬暱锛屽缓璁娇鐢ㄥ叾浠栨柟寮忎紶閫� - uni.navigateTo({ - url: `/pages/fileView/pdfView?url=${encodeURIComponent(pdfUrl)}` - }); + // // 灏� Base64 鏁版嵁浼犻�掔粰鍙︿竴涓〉闈㈣繘琛岄瑙� + // // 娉ㄦ剰锛氱洿鎺ヤ紶閫� pdfUrl 鍙兘浼氬鑷� URL 杩囬暱锛屽缓璁娇鐢ㄥ叾浠栨柟寮忎紶閫� + // uni.navigateTo({ + // url: `/pages/fileView/pdfView?url=${encodeURIComponent(pdfUrl)}` + // }); + + // const base64Data = uni.arrayBufferToBase64(response.data); + + // // 瀛樺偍鍒板叏灞�鍙橀噺锛堝湪App.vue涓畾涔夛級 + // getApp().globalData.tempPDF = base64Data; + + // uni.navigateTo({ + // url: '/pages/fileView/pdfView' + // }); + }, fail: (error) => { console.log(error) @@ -706,7 +879,8 @@ } else if (item.fName && item.fName.toLowerCase().endsWith('.jpg')) { const url = "http://192.168.1.22:10054/api/PLM/OpenDrawings?fileId=" + item.fFileId + '&fName=' + - encodeURIComponent(item.fName.replace(/\%/g, '%25').replace(/\ /g, '%20').replace(/\#/g, + encodeURIComponent(item.fName.replace(/\%/g, '%25').replace(/\ /g, '%20').replace( + /\#/g, '%23') .replace(/\?/g, '%3F').replace(/\+/g, '%2B').replace(/\//g, '%2F').replace(/\&/g, '%26')) @@ -749,7 +923,8 @@ console.log(item); const url = "http://192.168.1.22:10054/api/PLM/OpenDrawings?fileId=" + item.fFileId + '&fName=' + - encodeURIComponent(item.fName.replace(/\%/g, '%25').replace(/\ /g, '%20').replace(/\#/g, + encodeURIComponent(item.fName.replace(/\%/g, '%25').replace(/\ /g, '%20').replace( + /\#/g, '%23') .replace(/\?/g, '%3F').replace(/\+/g, '%2B').replace(/\//g, '%2F').replace(/\&/g, '%26')) @@ -843,7 +1018,204 @@ // title: '鏃犲搴擯DF鏂囦欢锛屾墦寮�澶辫触', // icon: 'none' // }); // } - } + }, + // 澶勭悊绱ф�ユ斁琛� + handleEmergencyRelease() { + if (this.formData.emergencyStatus) { + uni.showModal({ + title: "鎻愮ず", + content: '璇ュ崟宸茬揣鎬ユ斁琛岋紝璇峰嬁閲嶅鎿嶄綔', + showCancel: false + }); + return; + } + + uni.showModal({ + title: '纭', + content: '纭畾瑕佹墽琛岀揣鎬ユ斁琛屽悧锛�', + success: (res) => { + if (res.confirm) { + // 璋冪敤鏂扮殑鍚庣鎺ュ彛 + this.$post({ + url: "/LLJ/EmergencyRelease", + data: { + id: this.formData.id + } + }).then(res => { + if (res.data && res.status === 0) { + const result = res.data.tbBillList[0]; + const message = res.data.tbBillList[1]; + const lotNo1 = res.data.tbBillList[2] || ""; + + if (result === "0") { + this.formData.emergencyStatus = true; + this.originalLotNo1 = lotNo1; + this.formData.lotNo1 = lotNo1; + // 鏇存柊绱ф�ユ斁琛岀姸鎬侊紝纭繚鎻愪氦鏃惰兘姝g‘浼犻�� + this.formData.EMERGENCY = "1"; + + uni.showToast({ + title: message || '绱ф�ユ斁琛屾垚鍔�', + icon: 'success', + duration: 2000 + }); + this.init(); + } else { + uni.showModal({ + title: "鎻愮ず", + content: message || '鎿嶄綔澶辫触', + showCancel: false + }); + } + } + }).catch(error => { + uni.showModal({ + title: "閿欒", + content: '缃戠粶閿欒锛岃妫�鏌ョ綉缁滆繛鎺�', + showCancel: false + }); + }); + } + } + }); + }, + + // 澶勭悊鎾ゅ洖 + handleWithdraw() { + uni.showModal({ + title: '纭', + content: '纭畾瑕佹挙鍥炵揣鎬ユ斁琛屽悧锛�', + success: (res) => { + if (res.confirm) { + // 璋冪敤鏂扮殑鍚庣鎺ュ彛 + this.$post({ + url: "/LLJ/WithdrawEmergencyRelease", + data: { + id: this.formData.id + } + }).then(res => { + if (res.data && res.status === 0) { + const result = res.data.tbBillList[0]; + const message = res.data.tbBillList[1]; + + if (result === "0") { + this.formData.emergencyStatus = false; + // 鏇存柊绱ф�ユ斁琛岀姸鎬侊紝纭繚鎻愪氦鏃惰兘姝g‘浼犻�� + this.formData.EMERGENCY = "0"; + + uni.showToast({ + title: message || '鎾ゅ洖鎴愬姛', + icon: 'success', + duration: 2000 + }); + this.init(); + } else { + uni.showModal({ + title: "鎻愮ず", + content: message || '鎿嶄綔澶辫触', + showCancel: false + }); + } + } + }).catch(error => { + uni.showModal({ + title: "閿欒", + content: '缃戠粶閿欒锛岃妫�鏌ョ綉缁滆繛鎺�', + showCancel: false + }); + }); + } + } + }); + }, + 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); + } + }) + }, + addDestruction() { + // 娣诲姞鐮村潖瀹為獙鐨勯�昏緫 + this.destructionPopup = !this.destructionPopup; + this.PHSY = this.formData.PHSY || ''; + this.isInteger = true; + }, + editDestruction() { + // 楠岃瘉杈撳叆鏄惁涓烘暣鏁� + if(this.PHSY === '') { + this.isInteger = true; + // 濡傛灉涓虹┖锛屼紶閫掔┖瀛楃涓诧紝鍚庣浼氬鐞嗕负null + } else { + const isInteger = /^-?\d+$/.test(this.PHSY); + this.isInteger = isInteger; + if (!isInteger) { + return; + } + } + + // 淇濆瓨鐮村潖瀹為獙鏁伴噺 + this.$post({ + url: "/LLJ/saveRemarksGid", + data: { + gid: this.formData.id, + releaseNo: this.formData.releaseNo, + PHSY: this.PHSY // 鍙互鏄┖瀛楃涓叉垨鏈夋晥鏁存暟 + // 涓嶅啀鍖呭惈remarks瀛楁 + } + }).then(res => { + if (res.data.tbBillList > 0) { + // 濡傛灉杈撳叆涓虹┖锛岃缃负null浠ヤ究涓嶆樉绀� + this.formData.PHSY = this.PHSY === '' ? null : this.PHSY; + this.destructionPopup = false; + this.$showMessage("淇濆瓨鎴愬姛"); + setTimeout(() => { + // 璺宠浆鍒板垪琛ㄩ〉闈� + uni.navigateTo({ + url: 'List' + }); + }, 2000); + } + }) + }, + clearDestruction() { + // 娓呴櫎鐮村潖瀹為獙鏁伴噺 + this.PHSY = ''; + this.$post({ + url: "/LLJ/saveRemarksGid", + data: { + gid: this.formData.id, + releaseNo: this.formData.releaseNo, + PHSY: '' // 绌哄瓧绗︿覆锛屽悗绔細澶勭悊涓簄ull + } + }).then(res => { + if (res.data.tbBillList > 0) { + this.formData.PHSY = null; // 纭繚鍓嶇涔熶负null锛屼笉鏄剧ず + this.destructionPopup = false; + this.$showMessage("娓呴櫎鎴愬姛"); + setTimeout(() => { + // 璺宠浆鍒板垪琛ㄩ〉闈� + uni.navigateTo({ + url: 'List' + }); + }, 2000); + } + }) + }, } } </script> @@ -937,12 +1309,9 @@ } .sysLike { - color: #3498db; + color: #1890ff; text-decoration: none; - margin-left: 15px; - padding: 3px 8px; - border-radius: 3px; - font-size: 12px; + cursor: pointer; } .doc-link:hover { @@ -983,13 +1352,31 @@ /* 鎸夐挳鏍峰紡 */ .action-buttons { display: flex; - justify-content: flex-end; gap: 10px; - margin-top: 20px; + margin: 15px 0; + justify-content: flex-end; } - .primary-btn, .secondary-btn { + background-color: #ecf0f1; + color: #7f8c8d; + padding: 8px 15px; + border: none; + border-radius: 4px; + cursor: pointer; + } + + .secondary-btn:hover { + background-color: #d5dbdb; + } + + .secondary-btn:disabled { + background-color: #d9d9d9; + cursor: not-allowed; + opacity: 0.7; + } + + .primary-btn { padding: 10px 20px; border: none; border-radius: 4px; @@ -998,22 +1385,8 @@ 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 { @@ -1140,4 +1513,11 @@ } } + + .error-message { + color: #e74c3c; + font-size: 14px; + margin-top: 5px; + margin-bottom: 10px; + } </style> \ No newline at end of file -- Gitblit v1.9.3