From ba6ea01d3fe185f760f6c847a5dceaf14c01ef05 Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期三, 14 一月 2026 21:16:24 +0800
Subject: [PATCH] 修改了代码
---
src/utils/request.js | 2
src/views/archiveManager/archiveMaterial/index.vue | 176 ++++++++++++++++++++++-------
src/views/archiveManager/index.vue | 113 ++++++++++++++++--
src/router/index.js | 2
src/api/system/records.js | 9 +
5 files changed, 240 insertions(+), 62 deletions(-)
diff --git a/src/api/system/records.js b/src/api/system/records.js
index f28d5f6..025172e 100644
--- a/src/api/system/records.js
+++ b/src/api/system/records.js
@@ -87,3 +87,12 @@
data: ids
})
}
+
+export function getIdFileCounts(ids)
+{
+ return request({
+ url: '/system/records/getAllFilesCounts',
+ method: 'post',
+ data: ids
+ })
+}
diff --git a/src/router/index.js b/src/router/index.js
index aa846e7..75992fc 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -123,7 +123,7 @@
},
//妗堝嵎璇︾粏淇℃伅绠$悊
{
- path: 'archiveMaterialManager/:recordId/:pageCount/:sho',
+ path: 'archiveMaterialManager/:recordId/:pageCount/:sho/:recordStrId/:inquiryNumber',
component: () => import('@/views/archiveManager/archiveMaterial/index'),
name: 'ArchiveMaterialManager',
meta: { title: '璇︾粏淇℃伅', activeMenu: '/archiveManager/infoManager' }
diff --git a/src/utils/request.js b/src/utils/request.js
index 25e2e89..a2e5d1e 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -17,7 +17,7 @@
// axios涓姹傞厤缃湁baseURL閫夐」锛岃〃绀鸿姹俇RL鍏叡閮ㄥ垎
baseURL: process.env.VUE_APP_BASE_API,
// 瓒呮椂
- timeout: 30000
+ timeout: 100000
})
// request鎷︽埅鍣�
diff --git a/src/views/archiveManager/archiveMaterial/index.vue b/src/views/archiveManager/archiveMaterial/index.vue
index fa1d883..0ca1e00 100644
--- a/src/views/archiveManager/archiveMaterial/index.vue
+++ b/src/views/archiveManager/archiveMaterial/index.vue
@@ -2,7 +2,7 @@
<div class="app-container">
<div v-if="sho">
- <h2 class="title-border">娣诲姞妗堝嵎璇︾粏璁板綍 {褰撳墠褰曞叆浜唟{total}}鏉</h2>
+ <h2 class="title-border">娣诲姞妗堝嵎璇︾粏璁板綍 {褰撳墠褰曞叆浜唟{total}}鏉 {褰撳墠妗e彿涓猴細 {{recordStrId}} } {褰撳墠鏂囧彿涓猴細 {{inquiryNumber}} } </h2>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
@@ -26,7 +26,11 @@
placeholder="璇疯緭鍏ヨ矗浠昏��"
@input="handleCreatorInput"
@focus="showCreatorSuggestions = true"
- @blur="handleCreatorBlur"
+
+ @keydown.up.prevent="handleKeyUp"
+ @keydown.down.prevent="handleKeyDown"
+ @keydown.enter.prevent="handleKeyEnter"
+ ref="creatorInput"
/>
<!-- 涓嬫媺寤鸿妗� -->
<div
@@ -37,7 +41,7 @@
v-for="(item, index) in creatorSuggestions"
:key="index"
class="suggestion-item"
- @mousedown="selectCreatorSuggestion(item)"
+ @mousedown.prevent="selectCreatorSuggestion(item)"
>
{{ item }}
</div>
@@ -308,43 +312,7 @@
>鍒犻櫎</el-button>
</el-col>
- <el-col :span="1.5">
- <el-button
- v-if="sho"
- type="success"
- plain
- icon="el-icon-edit"
- size="mini"
- @click="handleImport"
- v-hasPermi="['system:materials:edit']"
- >鍏ㄩ儴闄勪欢瀵煎叆</el-button>
-
- <!-- 鍦ㄦ寜閽笅鏂规坊鍔犲鍏ュ璇濇 -->
- <el-dialog title="鎵归噺瀵煎叆闄勪欢" :visible.sync="importDialogVisible" width="50%">
- <el-upload
- class="upload-demo"
- ref="upload"
- :action="uploadUrl"
- :headers="headers"
- :data="uploadParams"
- :on-success="handleSuccess"
- :on-error="handleError"
- :on-preview="handlePreview"
- :on-remove="handleRemove"
- :file-list="fileList"
- :on-change="handleFileChange"
- :auto-upload="false"
- multiple
- accept=".jpg,.png"
- >
- <el-button slot="trigger" size="small" type="primary">閫夋嫨鏂囦欢</el-button>
- <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">涓婁紶鍒版湇鍔″櫒</el-button>
- <el-button style="margin-left: 10px;" size="small" type="danger" @click="clearFileList">娓呯┖鍒楄〃</el-button>
- <div slot="tip" class="el-upload__tip">鍙笂浼燡PG绛夋牸寮忔枃浠讹紝鍗曚釜鏂囦欢涓嶈秴杩�50MB</div>
- </el-upload>
- </el-dialog>
- </el-col>
<el-col :span="1.5">
<el-button
type="warning"
@@ -373,6 +341,44 @@
</el-upload>
</el-col>
+ <el-col :span="1.5">
+ <el-button
+ v-if="sho"
+ type="success"
+ plain
+ icon="el-icon-edit"
+ size="mini"
+ @click="handleImport"
+ v-hasPermi="['system:materials:edit']"
+ >鍏ㄩ儴闄勪欢瀵煎叆</el-button>
+ 宸茬粡涓婁紶浜� {{this.fileCut}} 寮犻檮浠讹紝杩樿涓婁紶 {{this.totalPageCount-this.fileCut}} 寮犻檮浠�
+
+
+ <!-- 鍦ㄦ寜閽笅鏂规坊鍔犲鍏ュ璇濇 -->
+ <el-dialog title="鎵归噺瀵煎叆闄勪欢" :visible.sync="importDialogVisible" width="50%">
+ <el-upload
+ class="upload-demo"
+ ref="upload"
+ :action="uploadUrl"
+ :headers="headers"
+ :data="uploadParams"
+ :on-success="handleSuccess"
+ :on-error="handleError"
+ :on-preview="handlePreview"
+ :on-remove="handleRemove"
+ :file-list="fileList"
+ :on-change="handleFileChange"
+ :auto-upload="false"
+ multiple
+ accept=".jpg,.png"
+ >
+ <el-button slot="trigger" size="small" type="primary">閫夋嫨鏂囦欢</el-button>
+ <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">涓婁紶鍒版湇鍔″櫒</el-button>
+ <el-button style="margin-left: 10px;" size="small" type="danger" @click="clearFileList">娓呯┖鍒楄〃</el-button>
+ <div slot="tip" class="el-upload__tip">鍙笂浼燡PG绛夋牸寮忔枃浠讹紝鍗曚釜鏂囦欢涓嶈秴杩�50MB</div>
+ </el-upload>
+ </el-dialog>
+ </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@@ -404,17 +410,17 @@
</template>
</el-table-column>
<el-table-column label="鏂囦欢鏉愭枡搴忓彿" align="center" prop="fileNumber" />
- <el-table-column label="鏂囦欢缂栧彿" align="center" prop="documentNumber" />
+ <el-table-column label="鏂囦欢缂栧彿" align="center" prop="documentNumber" width="180"/>
- <el-table-column label="璐d换鑰�" align="center" prop="creator" />
- <el-table-column label="鏂囦欢棰樺悕" align="center" prop="title" />
+ <el-table-column label="璐d换鑰�" align="center" prop="creator" width="180"/>
+ <el-table-column label="鏂囦欢棰樺悕" align="center" prop="title" width="220"/>
<el-table-column label="鏃ユ湡" align="center" prop="date" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.date, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="椤靛彿" sortable align="center" prop="pageNumber" />
- <el-table-column label="澶囨敞" align="center" prop="remarks" />
+ <el-table-column label="澶囨敞" align="center" prop="remarks" width="180"/>
<!-- <el-table-column label="椤垫" sortable align="center" prop="pageOrder" />
--->
<el-table-column label="鎵�澶勯樁娈�" sortable align="center" width="180" prop="stage" />
@@ -820,6 +826,8 @@
name: "Materials",
data() {
return {
+ //闄勪欢鏁伴噺
+ fileCut: 0,
//鏄惁鏄剧ず鐩稿叧鍐呭
sho: true,
totalPageCount: 0,
@@ -885,6 +893,8 @@
{ value: '06-涓氬姟鏁版嵁', label: '06-涓氬姟鏁版嵁' },
],
recordId: null,
+ inquiryNumber: '',
+ recordStrId: '',
// 閬僵灞�
loading: true,
// 閫変腑鏁扮粍
@@ -1029,7 +1039,8 @@
created() {
//const roleId = this.$route.params && this.$route.params.roleId
const recordId = this.$route.params && this.$route.params.recordId
-
+ this.recordStrId = this.$route.params && this.$route.params.recordStrId
+ this.inquiryNumber = this.$route.params && this.$route.params.inquiryNumber
this.totalPageCount = this.$route.params && this.$route.params.pageCount
this.sho = this.$route.params && this.$route.params.sho
@@ -1052,9 +1063,44 @@
this.queryParams.recordId = recordId
this.getList()
+ getFileCount(recordId).then(response=>{
+ this.fileCut = response.length
+ // alert(this.fileCut)
+ })
}
},
methods: {
+ // 杈撳叆浜嬩欢锛堢ず渚嬶細鍙牴鎹緭鍏ュ唴瀹硅繃婊ゅ缓璁垪琛級
+ handleCreatorInput(val) {
+ // 閲嶇疆閫変腑绱㈠紩
+ this.selectedIndex = -1;
+ // 杩欓噷鏇挎崲鎴愪綘鐨勫疄闄呭缓璁垪琛ㄨ幏鍙栭�昏緫
+ // this.creatorSuggestions = ['寮犱笁', '鏉庡洓', '鐜嬩簲', '璧靛叚'].filter(item =>
+ // item.includes(val)
+ // );
+ },
+ // 涓婃柟鍚戦敭閫昏緫
+ handleKeyUp() {
+ if (!this.showCreatorSuggestions || this.creatorSuggestions.length === 0) return;
+ // 鍚戜笂鍒囨崲锛屽埌椤跺垯鍥炲埌鏈�鍚庝竴椤�
+ this.selectedIndex = this.selectedIndex <= 0
+ ? this.creatorSuggestions.length - 1
+ : this.selectedIndex - 1;
+ },
+ // 涓嬫柟鍚戦敭閫昏緫
+ handleKeyDown() {
+ if (!this.showCreatorSuggestions || this.creatorSuggestions.length === 0) return;
+ // 鍚戜笅鍒囨崲锛屽埌搴曞垯鍥炲埌绗竴椤�
+ this.selectedIndex = this.selectedIndex >= this.creatorSuggestions.length - 1
+ ? 0
+ : this.selectedIndex + 1;
+ },
+ // 鍥炶溅閫変腑褰撳墠楂樹寒椤�
+ handleKeyEnter() {
+ if (this.selectedIndex >= 0 && this.selectedIndex < this.creatorSuggestions.length) {
+ this.selectCreatorSuggestion(this.creatorSuggestions[this.selectedIndex]);
+ }
+ },
// 涓婁紶澶辫触鍥炶皟
handleError(err, file, fileList) {
// 澶辫触璁℃暟+1
@@ -1090,6 +1136,10 @@
// 鍏抽棴涓婁紶瀵硅瘽妗�
this.importDialogVisible = false;
// 鍒锋柊鍒楄〃鏁版嵁
+ getFileCount(recordId).then(response=>{
+ this.fileCut = response.length
+ // alert(this.fileCut)
+ })
this.getList();
}
},
@@ -1122,6 +1172,7 @@
this.$modal.msgWarning('璇峰厛閫夋嫨鏂囦欢鍐嶄笂浼�')
return
}
+
// alert(this.recordId)
@@ -1138,11 +1189,38 @@
// }
// else
{
+
+ // 瀹氫箟鍏佽鐨勬渶澶у��
+ const maxValue = this.totalPageCount;
+
+ // 杩囨护fileList鏁扮粍锛屼繚鐣欐暟瀛楅儴鍒嗕笉瓒呰繃maxValue鐨勫厓绱�
+ this.fileList = this.fileList.filter(item => {
+ // 姝ラ1锛氭娴嬫槸鍚﹀寘鍚腑鏂囷紙[\u4e00-\u9fa5]鏄腑鏂囩殑Unicode鑼冨洿锛�
+ const hasChinese = /[\u4e00-\u9fa5]/.test(item.name);
+ // 鏈変腑鏂囩洿鎺ヨ繑鍥瀎alse锛屽垹闄よ鍏冪礌
+ if (hasChinese) return false;
+
+ // 姝ラ1锛氭彁鍙杗ame涓殑绾暟瀛楅儴鍒�
+ // 姝e垯琛ㄨ揪寮忚В閲婏細\d+ 鍖归厤涓�涓垨澶氫釜鏁板瓧
+ const numStr = item.name.match(/\d+/);
+
+ // 澶勭悊娌℃湁鏁板瓧鐨勬儏鍐碉紙杩斿洖false锛屼細琚繃婊ゆ帀锛�
+ if (!numStr) return false;
+
+ // 姝ラ2锛氬皢鏁板瓧瀛楃涓茶浆涓烘暟瀛�
+ const num = parseInt(numStr[0], 10);
+
+ // 姝ラ3锛氬垽鏂槸鍚﹀皬浜庣瓑浜庢渶澶у��
+ return num <= maxValue;
+ });
+
+
// 鍒濆鍖栦笂浼犵姸鎬佽鏁�
this.uploadSuccessCount = 0;
this.uploadFailCount = 0;
this.totalUploadFiles = fileCount;
// 鎵ц涓婁紶
+ console.log(this.fileList)
this.$refs.upload.submit()
// this.getList()
}
@@ -1332,6 +1410,16 @@
selectCreatorSuggestion(creator) {
this.form.creator = creator;
this.showCreatorSuggestions = false;
+ // 鎵嬪姩瑙﹀彂 input 浜嬩欢锛岀‘淇濊〃鍗曢獙璇佺瓑閫昏緫姝e父
+ this.$nextTick(() => {
+ const inputElement = this.$el.querySelector('textarea');
+ if (inputElement) {
+ inputElement.focus();
+ // 灏嗗厜鏍囧畾浣嶅埌鏂囨湰鏈熬
+ const length = inputElement.value.length;
+ inputElement.setSelectionRange(length, length);
+ }
+ });
},
// 澶勭悊鏉愭枡绫诲瀷鍙樺寲
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