From a1faa94fbf85553f22da934a1abc745d89dd8667 Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期一, 19 十月 2026 17:23:49 +0800
Subject: [PATCH] fix: 取消设备核查/比对的身份限制与三张设备计划的审批功能
---
src/views/CNAS/resourceDemand/device/component/equipmentAcceptance.vue | 31 ++++++++++++++++++++++++-------
1 files changed, 24 insertions(+), 7 deletions(-)
diff --git a/src/views/CNAS/resourceDemand/device/component/equipmentAcceptance.vue b/src/views/CNAS/resourceDemand/device/component/equipmentAcceptance.vue
index e20c4e3..3b01892 100644
--- a/src/views/CNAS/resourceDemand/device/component/equipmentAcceptance.vue
+++ b/src/views/CNAS/resourceDemand/device/component/equipmentAcceptance.vue
@@ -26,7 +26,7 @@
</template>
</el-table-column>
</el-table>
- <el-pagination :current-page="1" :page-size="pagination1.size" :page-sizes="[10, 20, 30, 50, 100]"
+ <el-pagination :current-page="pagination1.current" :page-size="pagination1.size" :page-sizes="[10, 20, 30, 50, 100]"
:total="pagination1.total" layout="->,total, sizes, prev, pager, next, jumper" background
@size-change="handleSizeChange1" @current-change="handleCurrentChange1">
</el-pagination>
@@ -45,7 +45,7 @@
</div>
<div>
<limsTable ref="yearTable" :column="columnData" :height="'calc(100vh - 30em)'" :highlightCurrentRow="true"
- :table-data="tableData" :table-loading="tableLoading" style="margin-top: 0.5em;" :page="pagination1">
+ :table-data="tableData" :table-loading="tableLoading" style="margin-top: 0.5em;" :page="filePage">
</limsTable>
</div>
</el-dialog>
@@ -67,6 +67,7 @@
exportDeviceAcceptance,
delDeviceAcceptance,
} from '@/api/cnas/resourceDemand/device.js'
+import { saveBlobOrShowError } from '@/utils/saveBlob'
export default {
name: "equipment-acceptance",
// import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
@@ -82,6 +83,11 @@
// 杩欓噷瀛樻斁鏁版嵁
return {
pagination1: {
+ size: 10,
+ current: 1,
+ total: 0,
+ },
+ filePage: {
size: 10,
current: 1,
total: 0,
@@ -171,6 +177,7 @@
record(row) {
this.filesDialogVisible = true
this.acceptanceId = row.acceptanceId
+ this.filePage.current = 1
this.searchTableList()
},
// 鏌ヨ闄勪欢鍒楄〃
@@ -178,7 +185,8 @@
this.tableLoading = true
getDeviceAcceptanceFileList({ acceptanceId: this.acceptanceId }).then(res => {
this.tableLoading = false
- this.tableData = res.data
+ this.tableData = res.data || []
+ this.filePage.total = this.tableData.length
}).catch(err => {
this.tableLoading = false
console.log('err---', err);
@@ -197,7 +205,14 @@
},
// 涓嬭浇
upload(row) {
- this.$download.saveAs(row.fileUrl, row.fileName)
+ if (!row.fileUrl) {
+ this.$message.warning('鏈笂浼犳枃浠讹紒')
+ return
+ }
+ // 鍥剧墖瀛� /img/锛屽叾浠栨枃妗e瓨 /word/
+ const isImage = /\.(jpg|jpeg|png|gif|bmp|webp)$/i.test(row.fileUrl)
+ const url = this.javaApi + (isImage ? '/img/' : '/word/') + row.fileUrl
+ this.$download.saveAs(url, row.fileName || row.fileUrl)
},
// 鍒犻櫎
delete(row) {
@@ -239,10 +254,11 @@
this.$refs.upload.clearFiles()
},
handleSuccessUp(response,) {
- this.upLoading = false;
if (response.code == 200) {
this.$message.success('涓婁紶鎴愬姛');
this.searchTableList()
+ } else {
+ this.$message.error(response.message || response.msg || '涓婁紶澶辫触')
}
},
closeFilesLook() {
@@ -263,8 +279,9 @@
this.outLoading = true
exportDeviceAcceptance({ acceptanceId: id }).then(res => {
this.outLoading = false
- const blob = new Blob([res], { type: 'application/octet-stream' });
- this.$download.saveAs(blob, '璁惧楠屾敹.doc')
+ saveBlobOrShowError(res, '璁惧楠屾敹.doc', 'application/msword')
+ }).catch(() => {
+ this.outLoading = false
})
},
// 鍒犻櫎
--
Gitblit v1.9.3