From e260fd0a8474fe4fe4550baaec2a643121ed778a Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期一, 02 二月 2026 11:41:35 +0800
Subject: [PATCH] 事故上报分页
---
src/views/safeProduction/dangerInvestigation/index.vue | 66 +++++++++++++++++++++++++++++++--
1 files changed, 62 insertions(+), 4 deletions(-)
diff --git a/src/views/safeProduction/dangerInvestigation/index.vue b/src/views/safeProduction/dangerInvestigation/index.vue
index 0fa284b..7ff2a64 100644
--- a/src/views/safeProduction/dangerInvestigation/index.vue
+++ b/src/views/safeProduction/dangerInvestigation/index.vue
@@ -125,6 +125,7 @@
<el-button link
type="primary"
size="small"
+ :disabled="!isPeople(scope.row.rectifyUserId)"
@click="openForm('edit2', scope.row)">鏁存敼</el-button>
<el-button link
type="primary"
@@ -267,10 +268,11 @@
</el-col>
</el-row>
</el-form>
+ <div v-if="operationType === 'edit2' || operationType === 'edit3'"
+ class="classtitle">闅愭偅璇︽儏</div>
<el-descriptions :column="2"
style="margin-bottom: 20px;"
v-if="operationType === 'edit2' || operationType === 'edit3'"
- title="闅愭偅璇︽儏"
border>
<el-descriptions-item label="闅愭偅缂栧彿">
<span class="detail-title">{{ form.hiddenCode }}</span>
@@ -306,10 +308,12 @@
<span class="detail-title">{{ form.rectifyTime }}</span>
</el-descriptions-item>
</el-descriptions>
+ <div class="classtitle"
+ v-if="operationType === 'edit3'"
+ style="margin-top: 40px;">鏁存敼璇︽儏</div>
<el-descriptions :column="2"
style="margin-bottom: 20px;"
v-if="operationType === 'edit3'"
- title="鏁存敼璇︽儏"
border>
<el-descriptions-item label="鏁存敼鍏蜂綋鎺柦"
:span="2">
@@ -319,6 +323,9 @@
<span class="detail-title">{{ form2.rectifyActualTime }}</span>
</el-descriptions-item>
</el-descriptions>
+ <div class="classtitle"
+ v-if="operationType === 'edit2' || operationType === 'edit3'"
+ style="margin-top: 40px;margin-bottom: 30px;">楠屾敹鎯呭喌</div>
<el-form :model="form2"
v-if="operationType === 'edit2'"
label-width="140px"
@@ -413,8 +420,11 @@
v-model="fileListDialogVisible"
:show-upload-button="true"
:show-delete-button="true"
+ :is-show-pagination="true"
+ :page="filePagination"
:upload-method="handleUpload"
:delete-method="handleFileDelete"
+ @pagination="paginationSearch"
title="闄勪欢鍒楄〃" />
</div>
</template>
@@ -883,6 +893,9 @@
proxy.$modal.msg("宸插彇娑�");
});
};
+ const isPeople = row => {
+ return row.rectifyUserId === Number(currentUserId.value);
+ };
/**
* 鍒ゆ柇鏄惁鍙互鍙戣揣
@@ -907,6 +920,11 @@
const statusStr = shippingStatus ? String(shippingStatus).trim() : "";
return statusStr === "寰呭彂璐�" || statusStr === "瀹℃牳鎷掔粷";
};
+ const filePagination = ref({
+ current: 1,
+ size: 10,
+ total: 0,
+ });
/**
* 涓嬭浇鏂囦欢
@@ -918,9 +936,15 @@
const currentFileRow = ref(null);
const downLoadFile = row => {
currentFileRow.value = row;
- fileListPage({ safeHiddenId: row.id }).then(res => {
+ fileListPage({
+ safeHiddenId: row.id,
+ current: filePagination.value.current,
+ size: filePagination.value.size,
+ }).then(res => {
if (fileListRef.value) {
- fileListRef.value.open(res.data.records);
+ fileListRef.value.open(res.data.records || []);
+ console.log("res.data", res.data);
+ filePagination.value.total = res.data.total || 0;
}
});
};
@@ -1006,6 +1030,8 @@
// 閲嶆柊鍔犺浇鏂囦欢鍒楄〃
const listRes = await fileListPage({
safeHiddenId: currentFileRow.value.id,
+ current: filePagination.value.current,
+ size: filePagination.value.size,
});
if (listRes.code === 200 && fileListRef.value) {
const fileList = (listRes.data?.records || []).map(item => ({
@@ -1015,6 +1041,7 @@
...item,
}));
fileListRef.value.setList(fileList);
+ filePagination.value.total = listRes.data?.total || 0;
}
// 杩斿洖鏂版枃浠朵俊鎭�
resolve({
@@ -1042,6 +1069,26 @@
input.click();
});
};
+ // 鍒嗛〉鏌ヨ鏂囦欢鍒楄〃
+ const paginationSearch = async (page, size) => {
+ filePagination.value.current = page;
+ filePagination.value.size = size;
+ const listRes = await fileListPage({
+ safeHiddenId: currentFileRow.value.id,
+ current: filePagination.value.current,
+ size: filePagination.value.size,
+ });
+ if (listRes.code === 200) {
+ const fileList = (listRes.data?.records || []).map(item => ({
+ name: item.name,
+ url: item.url,
+ id: item.id,
+ ...item,
+ }));
+ fileListRef.value.setList(fileList);
+ filePagination.value.total = listRes.data?.total || 0;
+ }
+ };
// 鍒犻櫎闄勪欢
const handleFileDelete = async row => {
try {
@@ -1052,6 +1099,8 @@
if (currentFileRow.value && fileListRef.value) {
const listRes = await fileListPage({
safeHiddenId: currentFileRow.value.id,
+ current: filePagination.value.current,
+ size: filePagination.value.size,
});
if (listRes.code === 200) {
const fileList = (listRes.data?.records || []).map(item => ({
@@ -1061,6 +1110,7 @@
...item,
}));
fileListRef.value.setList(fileList);
+ filePagination.value.total = listRes.data?.total || 0;
}
}
return true; // 杩斿洖 true 琛ㄧず鍒犻櫎鎴愬姛锛岀粍浠朵細鏇存柊鍒楄〃
@@ -1272,4 +1322,12 @@
page-break-after: avoid;
}
}
+ .classtitle {
+ font-size: 16px;
+ font-weight: 600;
+ color: #303133;
+ border-left: 4px solid #409eff;
+ padding-left: 12px;
+ margin-bottom: 12px;
+ }
</style>
--
Gitblit v1.9.3