From 0c3ea5f8246b22ad945e4086a9507c30d6245a8b Mon Sep 17 00:00:00 2001 From: xwt <2740516069@qq.com> Date: 星期三, 03 九月 2025 14:57:14 +0800 Subject: [PATCH] 来料检排序,巡检FTP附件 --- pages/QC/LLJ/Add.vue | 195 +++++++++++++++++++++++++++++++++++------------- 1 files changed, 140 insertions(+), 55 deletions(-) diff --git a/pages/QC/LLJ/Add.vue b/pages/QC/LLJ/Add.vue index 4492c63..1b1d505 100644 --- a/pages/QC/LLJ/Add.vue +++ b/pages/QC/LLJ/Add.vue @@ -1,14 +1,14 @@ <template> <view class="inspection-sheet"> - <!-- 澶撮儴淇℃伅 --> - <view class="sheet-header"> - <h1>鏉ユ枡妫�楠屽崟</h1> - <view class="inspection-number">妫�楠屽崟鍙凤細{{formData.releaseNo}}</view> - <!--瀹為獙瀹ら�佹 --> - <view style="text-align: right;" class="action-buttons"> - <a class="sysLike" v-if="this.current" @click="toSysSubmitFrom(formData.releaseNo)">瀹為獙瀹ら�佹</a> + <!-- 澶撮儴淇℃伅 --> + <view class="sheet-header"> + <h1>鏉ユ枡妫�楠屽崟</h1> + <view class="inspection-number">妫�楠屽崟鍙凤細{{formData.releaseNo}}</view> + <!--瀹為獙瀹ら�佹 --> + <view style="text-align: right;" class="action-buttons"> + <a class="sysLike" v-if="this.current" @click="toSysSubmitFrom(formData.releaseNo)">瀹為獙瀹ら�佹</a> + </view> </view> - </view> <!-- 鍩烘湰淇℃伅鍖� --> <view class="basic-info"> @@ -56,10 +56,6 @@ <view class="info-label">涓嶈壇鎻忚堪锛�</view> <view class="info-value">{{formData.fngDesc}}</view> </view> - <view class="info-block" v-if="formData.newFngDesc!=null"> - <view class="info-label">涓婃涓嶈壇锛�</view> - <view class="info-value">{{formData.newFngDesc}}</view> - </view> </view> <view class="dropdown-row"> <view class="info-label">涓嶈壇鍘熷洜锛�</view> @@ -90,7 +86,7 @@ </view> <view class="info-block" style="margin-top: 10px;"> <view class="info-label">鐮村潖瀹為獙鏁伴噺锛�</view> - <view class="info-value highlight">{{formData.phsy}}</view> + <view class="info-value highlight">{{formData.PHSY || formData.phsy || ''}}</view> </view> <!-- 琛ㄥ崟涓婃柟鎿嶄綔鎸夐挳鍖� --> @@ -374,6 +370,19 @@ } }, + computed: { + isUnmaintainedAndNotEmergency() { + // 鍒ゆ柇琛ㄥ崟鏄惁鏈淮鎶や笖涓嶆槸绱ф�ユ斁琛� + // 鏈淮鎶ょ殑鏉′欢锛歵ableData涓虹┖鎴栨墍鏈夋楠岄」鐩兘鏈畬鎴� + const isUnmaintained = this.tableData.length === 0 || + this.tableData.every(item => item.fcheckResu === null || item.fcheckResu === ''); + + // 涓嶆槸绱ф�ユ斁琛岀殑鏉′欢锛歟mergencyStatus涓篺alse + const isNotEmergency = !this.formData.emergencyStatus; + + return isUnmaintained && isNotEmergency; + } + }, onLoad(options) { //options涓寘鍚簡url闄勫甫鐨勫弬鏁� let params = options; @@ -575,42 +584,22 @@ }).then(res => { if (res.status == 0) { - 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.remarks || '', - workShop: this.WORKSHOP, - releaseNo: this.formData.releaseNo, - staffNo: 'HMCS', - // staffNo: this.$loginInfo.account, - iqcStatus: this.PSTYPE, - department: this.WORKSHOP, // 浣跨敤WORKSHOP鏇夸唬鏈畾涔夌殑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.remarks || '', - workShop: this.WORKSHOP, - releaseNo: this.formData.releaseNo, - // staffNo: 'HMCS', - staffNo: this.$loginInfo.account, - iqcStatus: this.PSTYPE, - department: this.WORKSHOP, // 浣跨敤WORKSHOP鏇夸唬鏈畾涔夌殑DEPARTMENT - EMERGENCY: this.formData.emergencyStatus ? "1" : "0" // 纭繚绱ф�ユ斁琛岀姸鎬佹纭紶閫� - }; - } + // 缁熶竴鎺ㄩ�佺粰HMCS锛屼笉绠″摢涓处鍙� + this.QcIssueResultDetailes = { + fbatchQty: this.formData.fcovertQty, + itemName: this.formData.itemName, + itemNo: this.formData.itemNo, + suppName: this.formData.suppName, + appicationReason: this.formData.fngDesc, + badReason: this.badreason, + remark: this.remarks || '', + workShop: this.WORKSHOP, + releaseNo: this.formData.releaseNo, + staffNo: 'HMCS', // 缁熶竴鎺ㄩ�佺粰HMCS + iqcStatus: this.PSTYPE, + department: this.WORKSHOP, // 浣跨敤WORKSHOP鏇夸唬鏈畾涔夌殑DEPARTMENT + EMERGENCY: this.formData.emergencyStatus ? "1" : "0" // 纭繚绱ф�ユ斁琛岀姸鎬佹纭紶閫� + }; console.log("鎻愪氦鐨勭揣鎬ユ斁琛岀姸鎬侊細", this.formData.emergencyStatus ? "1" : "0"); console.log("瀹屾暣鐨勬彁浜ゆ暟鎹細", this.QcIssueResultDetailes); @@ -745,9 +734,9 @@ this.pstypeIndex = this.pstypeOptions.indexOf(this.PSTYPE); - // 纭繚PHSY瀛楁琚纭缃� - this.formData.PHSY = data.PHSY; - this.PHSY = data.PHSY || ''; // 鍚屾椂璁剧疆椤甸潰缁戝畾鐨凱HSY鍙橀噺 + // 纭繚PHSY瀛楁琚纭缃紙鍏煎澶у皬鍐欙級 + this.formData.PHSY = data.PHSY || data.phsy; + this.PHSY = (data.PHSY || data.phsy || '').toString(); // 鍚屾椂璁剧疆椤甸潰缁戝畾鐨凱HSY鍙橀噺 console.log("鍔犺浇鐨勭揣鎬ユ斁琛岀姸鎬�:", this.formData.emergencyStatus); this.$post({ @@ -760,6 +749,16 @@ let tableData = res1.data.tbBillList //褰撳凡妫�楠屼釜鏁伴兘涓嶄负绌烘椂鎸夌収妫�娴嬬粨鏋勬帓搴� tableData.sort((a, b) => { + // 棣栧厛鎸塅stand鎺掑簭锛欶stand涓嶄负绌虹殑鎺掑湪鍓嶉潰 + const aHasFstand = a.fstand !== null && a.fstand !== undefined; + const bHasFstand = b.fstand !== null && b.fstand !== undefined; + if (aHasFstand && !bHasFstand) { + return -1; + } else if (!aHasFstand && bHasFstand) { + return 1; + } + + // 鐒跺悗鎸夋楠岀粨鏋滄帓搴� if (a.result === '鍚堟牸' && b.result === '鏈畬鎴�') { return -1; } else if (a.result === '鏈畬鎴�' && b.result === '鍚堟牸') { @@ -1307,19 +1306,31 @@ addDestruction() { // 娣诲姞鐮村潖瀹為獙鐨勯�昏緫 this.destructionPopup = !this.destructionPopup; + // 淇锛氱‘淇漃HSY鍙橀噺姝g‘鍒濆鍖� this.PHSY = this.formData.PHSY || ''; this.isInteger = true; }, editDestruction() { + // 楠岃瘉杈撳叆鏄惁涓烘暣鏁版垨绌哄瓧绗︿覆 if(this.PHSY === '') { this.isInteger = true; } else { const isInteger = /^-?\d+$/.test(this.PHSY); this.isInteger = isInteger; if (!isInteger) { + uni.showToast({ + title: '璇疯緭鍏ユ暣鏁板�兼垨鐣欑┖', + icon: 'none', + duration: 2000 + }); return; } } + + // 鏄剧ず鍔犺浇鎻愮ず + uni.showLoading({ + title: '淇濆瓨涓�...' + }); this.$post({ url: "/LLJ/savePhsyGid", @@ -1329,20 +1340,42 @@ PHSY: this.PHSY } }).then(res => { - if (res.data.tbBillList > 0) { + uni.hideLoading(); + if (res.data && res.data.tbBillList > 0) { this.formData.PHSY = this.PHSY === '' ? null : this.PHSY; this.destructionPopup = false; + uni.showToast({ + title: '淇濆瓨鎴愬姛', + icon: 'success', + duration: 2000 + }); // 绔嬪嵆閲嶆柊鍔犺浇鏁版嵁纭繚鍚屾 setTimeout(() => { this.init(); }, 500); + } else { + uni.showToast({ + title: '淇濆瓨澶辫触', + icon: 'none', + duration: 2000 + }); } }).catch(err => { + uni.hideLoading(); console.error('淇濆瓨澶辫触锛�', err); + uni.showToast({ + title: '淇濆瓨澶辫触锛岃閲嶈瘯', + icon: 'none', + duration: 2000 + }); }) }, clearDestruction() { - this.PHSY = ''; + // 鏄剧ず鍔犺浇鎻愮ず + uni.showLoading({ + title: '娓呴櫎涓�...' + }); + this.$post({ url: "/LLJ/savePhsyGid", data: { @@ -1351,16 +1384,35 @@ PHSY: '' } }).then(res => { - if (res.data.tbBillList > 0) { + uni.hideLoading(); + if (res.data && res.data.tbBillList > 0) { this.formData.PHSY = null; + this.PHSY = ''; this.destructionPopup = false; + uni.showToast({ + title: '娓呴櫎鎴愬姛', + icon: 'success', + duration: 2000 + }); // 绔嬪嵆閲嶆柊鍔犺浇鏁版嵁纭繚鍚屾 setTimeout(() => { this.init(); }, 500); + } else { + uni.showToast({ + title: '娓呴櫎澶辫触', + icon: 'none', + duration: 2000 + }); } }).catch(err => { + uni.hideLoading(); console.error('娓呴櫎澶辫触锛�', err); + uni.showToast({ + title: '娓呴櫎澶辫触锛岃閲嶈瘯', + icon: 'none', + duration: 2000 + }); }) }, viewAttachmentInfo() { @@ -1944,6 +1996,39 @@ box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); min-height: 100vh; position: relative; + transition: all 0.3s ease; + } + + /* 鏈淮鎶や笖闈炵揣鎬ユ斁琛岃〃鍗曠殑绱壊鏍峰紡 */ + .inspection-sheet.unmaintained-form { + background: linear-gradient(135deg, #f8f4ff 0%, #f0e6ff 100%); + border: 2px solid #9c27b0; + box-shadow: 0 0 20px rgba(156, 39, 176, 0.2); + } + + .inspection-sheet.unmaintained-form .sheet-header { + border-bottom: 2px solid #9c27b0; + } + + .inspection-sheet.unmaintained-form .sheet-header h1 { + color: #6a1b9a; + } + + .inspection-sheet.unmaintained-form .inspection-number { + color: #9c27b0; + } + + .inspection-sheet.unmaintained-form .material-info { + border: 1px solid #e1bee7; + background-color: rgba(156, 39, 176, 0.05); + } + + .inspection-sheet.unmaintained-form .info-label { + color: #6a1b9a; + } + + .inspection-sheet.unmaintained-form .info-value { + color: #4a148c; } /* 澶撮儴鏍峰紡 */ -- Gitblit v1.9.3