From 2fda34643bc22e25f6c569415da5f955c81536bf Mon Sep 17 00:00:00 2001 From: Houjie <714924425@qq.com> Date: 星期二, 03 六月 2025 09:37:08 +0800 Subject: [PATCH] 设备详情通过ID过滤/设备详情增加上传附件 --- pages/checkList/checkList.vue | 171 ++++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 108 insertions(+), 63 deletions(-) diff --git a/pages/checkList/checkList.vue b/pages/checkList/checkList.vue index 8dcfa39..feebc11 100644 --- a/pages/checkList/checkList.vue +++ b/pages/checkList/checkList.vue @@ -95,7 +95,7 @@ mixins: [MescrollMixin], // 浣跨敤mixin data() { return { - equipmentList:[], + equipmentList: [], type: 'top', scrollLeft: 0, formData: { @@ -131,7 +131,8 @@ announcement1: [], msg1Count: 0, msg2Count: 0, - msg1Title: "" + msg1Title: "", + equipmentId: '' } }, computed: { @@ -152,7 +153,11 @@ this.mescroll.resetUpScroll() } }, - + onLoad: function(options) { + this.equipmentId = options.equipmentId ? + decodeURIComponent(options.equipmentId) : + ''; + }, created() { this.getEquipment() }, @@ -164,8 +169,9 @@ pageSize: 9999, order: 'desc', column: 'createTime' + }, - + }).then(res => { //璁剧疆鍒楄〃鏁版嵁 if (res.data.success) { @@ -176,7 +182,7 @@ title: res.data.message, duration: 2000 }); - + } }).catch(() => { this.$tip.error("鑱旂綉澶辫触") @@ -240,19 +246,108 @@ search() { this.$refs.popup.open(); }, - - upCallback(page) { + // 纭繚 equipmentId 濮嬬粓浣滀负鍙傛暟浼犻�掞紝鍊间负鏈夋晥瀛楃涓叉垨绌哄瓧绗︿覆 + const params = { + pageNo: page.num, + pageSize: page.size, + order: 'desc', + column: 'createTime', + inspectionStatus: 'WAIT_INSPECTION', + equipmentId: this.equipmentId || '' + }; + + this.$http.get(this.url.stallList, { + params + }) + .then(res => { + if (!res.data.success) { + throw new Error('鑾峰彇鏁版嵁澶辫触: ' + res.data.message); + } + + const records = res.data.result.records || []; + const total = res.data.result.total || 0; + + // 鏇存柊娑堟伅璁℃暟鍜屾爣棰� + this.msg1Count = total; + this.msg1Title = `閫氱煡(${total})`; + + // 鏇存柊鍒楄〃鏁版嵁 + this.msgList = page.num === 1 ? [...records] : [...this.msgList, ...records]; + + // 缁撴潫鍔犺浇鐘舵�� + this.mescroll.endSuccess(records.length); + console.log('璇锋眰鎴愬姛', res.data); + }) + .catch(error => { + console.error('璇锋眰澶辫触', error); + this.mescroll.endErr(); + }); + }, + + + // upCallback(page) { + // this.$http.get(this.url.stallList, { + // params: { + // pageNo: page.num, + // pageSize: page.size, + // order: 'desc', + // column: 'createTime', + // inspectionStatus: 'WAIT_INSPECTION', + // equipmentId:this.equipmentId || '' + // }, + + // }).then(res => { + // this.announcement1 = res.data.result.records + // this.mescroll.endSuccess(this.announcement1.length); + // console.log("url", res) + // //璁剧疆鍒楄〃鏁版嵁 + // if (res.data.success) { + // console.log("res", res.data) + // this.msg1Count = res.data.result.total + // this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + // for (let annItem of this.announcement1) { + // this.msgList.push(annItem) + // } + // } + // if (page.num == 1) { + // this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + // this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + // } + + // }).catch(() => { + // //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + // this.mescroll.endErr(); + // }) + + // }, + + + resetTask() { + this.formData.orderNum = '' + this.formData.num = '' + this.$refs.popup.close(); + this.mescroll.resetUpScroll() + + }, + /* 妫�绱� */ + getSera() { + this.$refs.popup.close(); + this.msgList = []; this.$http.get(this.url.stallList, { params: { - pageNo: page.num, - pageSize: page.size, - order: 'desc', - column: 'createTime', - inspectionStatus: 'WAIT_INSPECTION' - }, + pageNo: 1, + pageSize: 999, + order: "desc", + column: "createTime", + inspectionStatus: 'WAIT_INSPECTION', + equipmentId: this.formData.num, + orderNum: this.formData.orderNum + } }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + this.announcement1 = res.data.result.records this.mescroll.endSuccess(this.announcement1.length); console.log("url", res) @@ -274,56 +369,6 @@ //鑱旂綉澶辫触, 缁撴潫鍔犺浇 this.mescroll.endErr(); }) - - }, - - - resetTask() { - this.formData.orderNum = '' - this.formData.num = '' - this.$refs.popup.close(); - this.mescroll.resetUpScroll() - - }, - /* 妫�绱� */ - getSera() { - this.$refs.popup.close(); - this.msgList = []; - this.$http.get(this.url.stallList, { - params: { - pageNo: 1, - pageSize: 999, - order: "desc", - column: "createTime", - inspectionStatus: 'WAIT_INSPECTION', - equipmentId: this.formData.num, - orderNum: this.formData.orderNum - - } - }).then(res => { - //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; - - this.announcement1 = res.data.result.records - this.mescroll.endSuccess(this.announcement1.length); - console.log("url", res) - //璁剧疆鍒楄〃鏁版嵁 - if (res.data.success) { - console.log("res", res.data) - this.msg1Count = res.data.result.total - this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; - for (let annItem of this.announcement1) { - this.msgList.push(annItem) - } - } - if (page.num == 1) { - this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 - this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� - } - - }).catch(() => { - //鑱旂綉澶辫触, 缁撴潫鍔犺浇 - this.mescroll.endErr(); - }) }, -- Gitblit v1.9.3