From ca0c2cd9dcece8b67ee6d74161d183be10048d1d Mon Sep 17 00:00:00 2001
From: yaowanxin <3588231647@qq.com>
Date: 星期四, 18 九月 2025 13:52:36 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_script' into ywx
---
src/views/qualityManagement/rawMaterialInspection/components/filesDia.vue | 70 ++++++++++++++++++++++++-----------
1 files changed, 48 insertions(+), 22 deletions(-)
diff --git a/src/views/qualityManagement/rawMaterialInspection/components/filesDia.vue b/src/views/qualityManagement/rawMaterialInspection/components/filesDia.vue
index efed304..9907fbe 100644
--- a/src/views/qualityManagement/rawMaterialInspection/components/filesDia.vue
+++ b/src/views/qualityManagement/rawMaterialInspection/components/filesDia.vue
@@ -3,7 +3,7 @@
<el-dialog
v-model="dialogFormVisible"
title="涓婁紶闄勪欢"
- width="70%"
+ width="50%"
@close="closeDia"
>
<div style="margin-bottom: 10px;text-align: right">
@@ -29,27 +29,30 @@
:tableLoading="tableLoading"
:isSelection="true"
@selection-change="handleSelectionChange"
- height="600"
+ height="500"
>
</PIMTable>
+ <pagination
+ style="margin: 10px 0"
+ v-show="total > 0"
+ @pagination="paginationSearch"
+ :total="total"
+ :page="page.current"
+ :limit="page.size"
+ />
<template #footer>
<div class="dialog-footer">
<el-button @click="closeDia">鍙栨秷</el-button>
</div>
</template>
</el-dialog>
+ <filePreview ref="filePreviewRef" />
</div>
</template>
<script setup>
import {ref} from "vue";
-import {getStaffJoinInfo, staffJoinAdd, staffJoinUpdate} from "@/api/personnelManagement/onboarding.js";
-import {Search} from "@element-plus/icons-vue";
-import {
- qualityInspectParamDel,
- qualityInspectParamInfo,
- qualityInspectParamUpdate
-} from "@/api/qualityManagement/qualityInspectParam.js";
+import filePreview from '@/components/filePreview/index.vue'
import {ElMessageBox} from "element-plus";
import {getToken} from "@/utils/auth.js";
import {
@@ -57,6 +60,7 @@
qualityInspectFileDel,
qualityInspectFileListPage
} from "@/api/qualityManagement/qualityInspectFile.js";
+import Pagination from "@/components/PIMTable/Pagination.vue";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
@@ -69,14 +73,6 @@
prop: "name",
},
{
- label: "涓婁紶浜�",
- prop: "unit",
- },
- {
- label: "涓婁紶鏃堕棿",
- prop: "standardValue",
- },
- {
dataType: "action",
label: "鎿嶄綔",
align: "center",
@@ -85,19 +81,32 @@
name: "涓嬭浇",
type: "text",
clickFun: (row) => {
- openForm("edit", row);
+ downLoadFile(row);
},
- }
+ },
+ {
+ name: "棰勮",
+ type: "text",
+ clickFun: (row) => {
+ lookFile(row);
+ },
+ }
],
},
]);
+const page = reactive({
+ current: 1,
+ size: 100,
+});
+const total = ref(0);
const tableData = ref([]);
const fileList = ref([]);
const tableLoading = ref(false);
+const filePreviewRef = ref()
const headers = ref({
Authorization: "Bearer " + getToken(),
});
-const uploadUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); // 涓婁紶鐨勫浘鐗囨湇鍔″櫒鍦板潃
+const uploadUrl = ref(import.meta.env.VITE_APP_BASE_API + "/file/upload"); // 涓婁紶鐨勫浘鐗囨湇鍔″櫒鍦板潃
// 鎵撳紑寮规
const openDialog = (row) => {
@@ -105,9 +114,15 @@
currentId.value = row.id;
getList()
}
+const paginationSearch = (obj) => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
+};
const getList = () => {
- qualityInspectFileListPage(currentId.value).then(res => {
+ qualityInspectFileListPage({inspectId: currentId.value, ...page}).then(res => {
tableData.value = res.data.records;
+ total.value = res.data.total;
})
}
// 琛ㄦ牸閫夋嫨鏁版嵁
@@ -124,7 +139,10 @@
function handleUploadSuccess(res, file) {
// 濡傛灉涓婁紶鎴愬姛
if (res.code == 200) {
- uploadFile(res)
+ const fileRow = {}
+ fileRow.name = res.data.originalName
+ fileRow.url = res.data.tempPath
+ uploadFile(fileRow)
} else {
proxy.$modal.msgError("鏂囦欢涓婁紶澶辫触");
}
@@ -140,6 +158,14 @@
function handleUploadError() {
proxy.$modal.msgError("鏂囦欢涓婁紶澶辫触");
}
+// 涓嬭浇闄勪欢
+const downLoadFile = (row) => {
+ proxy.$download.name(row.url);
+}
+// 棰勮闄勪欢
+const lookFile = (row) => {
+ filePreviewRef.value.open(row.url)
+}
// 鍒犻櫎
const handleDelete = () => {
let ids = [];
--
Gitblit v1.9.3