From ba6ea01d3fe185f760f6c847a5dceaf14c01ef05 Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期三, 14 一月 2026 21:16:24 +0800
Subject: [PATCH] 修改了代码
---
src/views/archiveManager/index.vue | 113 ++++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 97 insertions(+), 16 deletions(-)
diff --git a/src/views/archiveManager/index.vue b/src/views/archiveManager/index.vue
index da1e8ea..950aa35 100644
--- a/src/views/archiveManager/index.vue
+++ b/src/views/archiveManager/index.vue
@@ -1,5 +1,6 @@
<template>
<div class="app-container">
+ <el-dialog title="鎼滅储" :visible.sync="openSearch" width="1200px" top="5vh" append-to-body>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="妗f鍙�" prop="recordId">
<el-input
@@ -251,8 +252,18 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button>
</el-form-item>
</el-form>
-
+</el-dialog>
<el-row :gutter="10" class="mb8">
+ <el-col :span="1.5">
+ <el-button
+ type="primary"
+ plain
+ icon="el-icon-plus"
+ size="mini"
+ @click="handleSearch"
+
+ >鎼滅储</el-button>
+ </el-col>
<el-col :span="1.5">
<el-button
type="primary"
@@ -296,7 +307,7 @@
>瀵煎嚭</el-button>
</el-col>
- <el-col :span="1.5">
+ <el-col v-if="userId!=1" :span="1.5">
<el-button
type="warning"
plain
@@ -955,7 +966,7 @@
import axios from 'axios'
import { getToken } from '@/utils/auth'
-import { enload, batchSubmitRecords,updateStatusById,listRecords,getMaxId, getRecords, delRecords, addRecords, updateRecords } from "@/api/system/records"
+import { enload, getIdFileCounts,batchSubmitRecords,updateStatusById,listRecords,getMaxId, getRecords, delRecords, addRecords, updateRecords } from "@/api/system/records"
import { listAllCategory } from "@/api/system/category"
import { listAllProjectName } from "@/api/system/projectName"
import { listPlaceName, listAllPlaceName } from "@/api/system/placeName"
@@ -970,6 +981,7 @@
name: "Records",
data() {
return {
+ openSearch: false,
totalUser: 0,
visibleUser:false,
userList:[],
@@ -1162,6 +1174,10 @@
}
},
methods: {
+ handleSearch()
+ {
+ this.openSearch = true;
+ },
/** 閫夋嫨鎺堟潈鐢ㄦ埛鎿嶄綔 */
handleSelectUser() {
// const archiveRecordsId = this.queryParams.archiveRecordsId
@@ -1481,15 +1497,22 @@
CheckInfo(row)
{
+ if(row.pageCount==null)
+ {
+ this.$modal.msgWarning("璇峰厛琛ュ厖椤电爜淇℃伅锛�")
+ return;
+ }
var mid = row.id
const roleId = 2
// alert(mid)
var recordId = mid
var pageCount = row.pageCount
+ var recordStrId = row.recordId
+ var inquiryNumber = row.inquiryNumber
var sho = false
// this.$router.push("/archiveManager/infoManagerAu/user/" + roleId+"/"+recordId)
- this.$router.push("/archiveManager/infoManagerAu/archiveMaterialManager/" + recordId+"/"+pageCount+"/"+sho)
+ this.$router.push("/archiveManager/infoManagerAu/archiveMaterialManager/" + recordId+"/"+pageCount+"/"+sho+"/"+recordStrId+"/"+inquiryNumber)
},
/*瀵煎嚭澶囪�冭〃*/
@@ -1510,7 +1533,12 @@
JuanInfo(row)
{
var id = row.id
-
+ console.log(row.pageCount)
+ if(row.pageCount==null)
+ {
+ this.$modal.msgWarning("璇峰厛琛ュ厖椤电爜淇℃伅锛�")
+ return;
+ }
id = Number(id)
var recordId = row.recordId
@@ -1536,6 +1564,8 @@
//鍒ゆ柇蹇呴』淇敼鐨勫瓧娈垫槸鍚﹁ˉ鍏呭畬鏁翠簡
var valid = false;
var pageCount = row.pageCount
+ var recordStrId = row.recordId
+ var inquiryNumber = row.inquiryNumber
if(row.projectName!=null&&row.pageCount!=null&&row.caseTitle!=null&&row.constructionUnit)
valid = true;
if (valid) {
@@ -1547,7 +1577,7 @@
var sho = true
// this.$router.push("/archiveManager/infoManagerAu/user/" + roleId+"/"+recordId)
- this.$router.push("/archiveManager/infoManagerAu/archiveMaterialManager/" + recordId+"/"+pageCount+"/"+sho)
+ this.$router.push("/archiveManager/infoManagerAu/archiveMaterialManager/" + recordId+"/"+pageCount+"/"+sho+"/"+recordStrId+"/"+inquiryNumber)
}else
{
this.$modal.msgWarning("璇疯ˉ鍏呴〉鍙风瓑鐩稿叧淇℃伅锛屽啀缂栬緫鍗峰唴鐩綍锛�")
@@ -1633,24 +1663,75 @@
this.getUserList()
},
/** 鎵归噺鎻愪氦 */
- handleBatchSubmit() {
+ async handleBatchSubmit() {
// alert(this.ids)
if (this.ids.length === 0) {
this.$modal.msgWarning('璇烽�夋嫨瑕佹彁浜ょ殑妗f璁板綍')
return
}
- const myValidIds = this.recordsList
- .filter(item => item.ownData === true)
- .map(item => item.id);
- // 妫�鏌ラ�変腑鐨処D鏄惁鍏ㄩ儴灞炰簬鑷繁
- const invalidIds = this.ids.filter(id => !myValidIds.includes(id));
+ const validRecords = this.recordsList
+ // .filter(item => item.ownData === true)
+ // 1. 杞崲recordsList涓簆ageCount鏄犲皠锛堟牳蹇冩楠わ級
+ const recordPageCountMap = this.recordsList.reduce((map, item) => {
+ map[String(item.id)] = item.pageCount || item.totalpageCount || 0;
+ return map;
+ }, {});
- if (invalidIds.length > 0) {
- this.$message.error(`鍖呭惈鏃犳潈鎿嶄綔鐨処D: ${invalidIds.join(',')}`);
- return false;
+
+ console.log("-------")
+
+ let recordFileCountMap = {};
+ try {
+ // 璋冪敤鎺ュ彛锛氬叆鍙備负鏈夋潈鎿嶄綔鐨処D鍒楄〃锛岃繑鍥� { recordId: 闄勪欢鏁�, ... }
+ const response = await getIdFileCounts(this.ids)
+ // 鍋囪鎺ュ彛杩斿洖鏍煎紡锛歿 code: 0, data: { "1001": 5, "1002": 8 } }
+ if (response.code === 200) {
+ recordFileCountMap = response.data;
+ // alert(434343)
+ } else {
+ this.$modal.msgError('鑾峰彇闄勪欢鏁伴噺澶辫触锛�' + response.msg);
+ return;
}
+ } catch (error) {
+ this.$modal.msgError('鎺ュ彛璋冪敤澶辫触锛�' + error.message);
+ return;
+ }
+
+ // 3. 鏍稿績锛氱瓫閫夊嚭銆岄檮浠舵暟绛変簬鑷韩totalpageCount銆嶇殑鏈夋晥ID
+ const submitAbleIds = []; // 瀛樺偍鎵�鏈夌鍚堟潯浠剁殑ID
+ const invalidAttachIds = []; // 瀛樺偍闄勪欢鏁颁笉鍖归厤鐨処D锛堢敤浜庢彁绀猴級
+
+ for (const id of this.ids) {
+ // 鏇挎崲涓洪」鐩疄闄呭瓧娈靛悕
+ const attachmentCount = recordFileCountMap[id] || 0;
+ const recordTotalPage = recordPageCountMap[id] || 0;
+ if (attachmentCount === recordTotalPage) {
+ submitAbleIds.push(id); // 绗﹀悎鏉′欢锛屽姞鍏ユ彁浜ゅ垪琛�
+ } else {
+ invalidAttachIds.push({
+ id: id,
+
+ required: recordTotalPage
+ });
+ }
+ }
+
+ // 4. 鎻愮ず闄勪欢鏁颁笉鍖归厤鐨勮褰�
+ if (invalidAttachIds.length > 0) {
+ const tipMsg = invalidAttachIds.map(item =>
+ `(ID:${item.id}) 锛岃姹�${item.required}涓猔
+ ).join('锛�');
+ this.$modal.msgWarning(`浠ヤ笅璁板綍闄勪欢鏁伴噺涓嶅尮閰嶏紝灏嗚烦杩囨彁浜わ細${tipMsg}`);
+ }
+
+ // 5. 妫�鏌ユ槸鍚︽湁鍙彁浜ょ殑ID
+ if (submitAbleIds.length === 0) {
+ this.$modal.msgWarning('鏆傛棤绗﹀悎鎵�鏈夋潯浠剁殑璁板綍鍙彁浜�');
+ return;
+ }
+
//濡傛灉id鍏ㄩ儴鏈夋晥鎵嶇户缁彁浜�
- batchSubmitRecords( this.ids ).then(response => {
+ batchSubmitRecords( submitAbleIds ).then(response => {
if (response.code === 0) {
this.$modal.msgSuccess('鎵归噺鎻愪氦鎴愬姛')
this.getList()
--
Gitblit v1.9.1