From 749f897a11e711199c6b1677accf2f6e46895315 Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期六, 22 十一月 2025 16:01:26 +0800
Subject: [PATCH] 新增了代码
---
src/views/archiveManager/index.vue | 224 ++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 195 insertions(+), 29 deletions(-)
diff --git a/src/views/archiveManager/index.vue b/src/views/archiveManager/index.vue
index 690a203..443ddbf 100644
--- a/src/views/archiveManager/index.vue
+++ b/src/views/archiveManager/index.vue
@@ -17,6 +17,64 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
+ <el-form-item label="绫诲埆鍙�" prop="categoryNumber">
+ <el-row :gutter="8">
+ <el-col :span="6">
+ <el-select
+ v-model="queryParams.categoryType"
+ placeholder="閫夋嫨绫诲埆绫诲瀷"
+ clearable
+ @change="handleQuery"
+ >
+ <el-option
+ v-for="item in recordTypeOptions"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ />
+ </el-select>
+ </el-col>
+ <el-col :span="6">
+ <el-select
+ v-model="queryParams.categoryZone"
+ placeholder="閫夋嫨鍦板尯"
+ clearable
+ @change="handleQuery"
+ >
+ <el-option
+ v-for="item in zoneTypeOptions"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ />
+ </el-select>
+ </el-col>
+ <el-col :span="4">
+ <el-input
+ v-model="queryParams.categoryYear"
+ placeholder="骞翠唤"
+ clearable
+ @keyup.enter.native="handleQuery"
+ />
+ </el-col>
+ <el-col :span="4">
+ <el-input
+ v-model="queryParams.categorySeq"
+ placeholder="寮�濮嬪簭鍙�"
+ clearable
+ @keyup.enter.native="handleQuery"
+ />
+ </el-col>
+ <el-col :span="4">
+ <el-input
+ v-model="queryParams.categorySeqEnd"
+ placeholder="缁撴潫搴忓彿"
+ clearable
+ @keyup.enter.native="handleQuery"
+ />
+ </el-col>
+ </el-row>
+ </el-form-item>
<el-form-item label="妗堝嵎棰樺悕" prop="caseTitle">
<el-input
v-model="queryParams.caseTitle"
@@ -300,7 +358,7 @@
icon="el-icon-edit"
@click="handleInfo(scope.row)"
v-hasPermi="['system:records:edit']"
- >妗堝嵎璇︾粏淇℃伅</el-button>
+ >缂栬緫鍗峰唴鐩綍</el-button>
<el-button
size="mini"
@@ -362,9 +420,9 @@
<!-- <el-table-column label="${comment}" align="center" prop="id" /> -->
<el-table-column label="妗f鍙�" align="center" prop="recordId" />
<el-table-column label="鍙戞枃鍙�" align="center" prop="inquiryNumber" />
- <el-table-column label="椤圭洰鍚嶇О" align="center" prop="everyProjectName" />
- <el-table-column label="妗堝嵎棰樺悕" align="center" prop="caseTitle" show-overflow-tooltip />
+
+ <el-table-column label="妗堝嵎棰樺悕" align="center" prop="caseTitle" />
<el-table-column label="鍏紑灞炴��" align="center" prop="publicAttribute" />
<el-table-column label="缂栧埗鍗曚綅" align="center" prop="preparationUnit" />
<el-table-column label="缂栧埗鏃ユ湡" align="center" prop="preparationDate" width="180">
@@ -385,7 +443,7 @@
<el-table-column label="缂╁井鍙�" align="center" prop="microfilmNumber" />
<el-table-column label="澶囨敞" align="center" prop="remarks" />
<el-table-column label="鍘嗗彶鐩稿叧鍙戞枃鍙�" align="center" prop="historicalReferenceNumber" />
-
+<el-table-column label="椤圭洰鍚嶇О" align="center" prop="everyProjectName" />
</el-table>
<pagination
@@ -411,7 +469,7 @@
<div class="option-group">
<label class="option-label">
<input type="checkbox" v-model="excelOptions.includeQrCode">
- <span>鍖呭惈浜岀淮鐮�</span>
+ <span>鍖呭惈鏉″舰鐮�</span>
</label>
</div>
@@ -419,10 +477,11 @@
<div class="option-group">
<div class="option-label">閫夋嫨娉ㄨВ:</div>
<div class="annotation-options">
- <label v-for="i in 5" :key="i" class="annotation-checkbox">
- <input type="checkbox" v-model="excelOptions.selectedAnnotations" :value="i">
- <span>娉ㄨВ{{ i }}</span>
- </label>
+ <label v-for="(annotation, index) in excelOptions.selectedAnnotations" :key="index" class="signature-checkbox">
+ <input type="checkbox" v-model="excelOptions.subselectedAnnotations" :value="index">
+ <span>{{ annotation }}
+ </span>
+ </label>
</div>
</div>
@@ -431,10 +490,13 @@
<div class="option-label">绛惧悕鏍忚缃�:</div>
<div class="signature-options">
<div class="signature-checkboxes">
- <label v-for="i in 3" :key="i" class="signature-checkbox">
- <input type="checkbox" v-model="excelOptions.selectedSignatures" :value="i">
- <span>绛惧悕鏍弡{ i }}</span>
+ <label v-for="(signature, index) in excelOptions.selectedSignatures" :key="index" class="signature-checkbox">
+ <input type="checkbox" v-model="excelOptions.subselectedSignatures" :value="index">
+ <span>{{ signature }}</span>
</label>
+
+
+
</div>
<!-- <p v-if="excelOptions.selectedSignatures.length === 0" class="option-tip">璇烽�夋嫨鑷冲皯涓�涓鍚嶆爮</p> -->
</div>
@@ -442,7 +504,8 @@
</div>
</div>
<!-- 浼樺寲鐨凟xcel棰勮缁勪欢 -->
- <div class="excel-preview-wrapper" v-if="excelDialogVisible">
+ <el-dialog class="excel-preview-wrapper" :visible.sync="showExcelPreview" :modal="false" width="80%" :show-close="true" @click="closeExcelPreviewDialog">
+ <div @click.stop>
<!-- 涓昏棰勮缁勪欢 -->
<vue-office-excel
v-if="currentExcelUrl"
@@ -464,7 +527,7 @@
<button class="excel-dialog-btn download-btn" @click="handleDownloadClick">涓嬭浇Excel鏂囦欢</button>
</div>
</div>
-
+</el-dialog>
<div class="excel-dialog-footer">
<button class="excel-dialog-btn preview-btn" @click="handlePreviewClick">棰勮</button>
<button class="excel-dialog-btn print-btn" @click="handlePrintClick">鎵撳嵃</button>
@@ -802,6 +865,7 @@
name: "Records",
data() {
return {
+ showExcelPreview: false,
excel: 'http://localhost:8080/profile/upload/12.xls', //璁剧疆鏂囨。缃戠粶鍦板潃锛屽彲浠ユ槸鐩稿鍦板潃
open_check: false,
@@ -855,6 +919,11 @@
pageSize: 10,
recordId: null,
inquiryNumber: null,
+ categoryType: null, // 绫诲埆绫诲瀷
+ categoryZone: null, // 绫诲埆鍦板尯
+ categoryYear: null, // 绫诲埆骞翠唤
+ categorySeq: null, // 寮�濮嬪簭鍙�
+ categorySeqEnd: null, // 缁撴潫搴忓彿
everyProjectName: null,
caseTitle: null,
publicAttribute: null,
@@ -885,8 +954,15 @@
// Excel閫夐」閰嶇疆
excelOptions: {
includeQrCode: false, // 鏄惁鍖呭惈浜岀淮鐮�
- selectedAnnotations: [], // 閫変腑鐨勬敞瑙e垪琛�
+ selectedAnnotations: ["鏈竻鍗曠敱妗f褰㈡垚閮ㄩ棬瀹屾垚",
+ "鏂囦欢绫诲瀷蹇呴』褰曞叆锛屽寘鎷粨璁烘潗鏂欍�佽繃绋嬫潗鏂欍�佺敵璇锋潗鏂欙紝鍏朵粬鏉愭枡",
+ "鍏紑灞炴�у繀椤诲綍鍏ワ紝涓诲姩鍏紑銆佷緷鐢宠鍏紑銆佸厤浜堝叕寮�",
+ "淇濈鏈熼檺:30骞存垨姘镐箙",
+ "椤靛彿鎸夌収姝e紡褰曞叆椤电爜涓哄噯"], // 閫変腑鐨勬敞瑙e垪琛�
includeSignature: false, // 鏄惁鍖呭惈绛惧悕鏍�
+ selectedSignatures: ['涓氬姟绉戝绉讳氦浜�:', '瀹℃壒绉戠Щ浜や汉:', '妗f鏁寸悊鍏徃:'], // 閫変腑鐨勭鍚嶆爮鍒楄〃
+ subselectedSignatures: [],
+ subselectedAnnotations: [],
signaturePosition: 'bottom' // 绛惧悕鏍忎綅缃細top/bottom
},
// 琛ㄥ崟鍙傛暟
@@ -1022,7 +1098,7 @@
console.log("1111111333333",response.data)
this.zoneTypeOptions = response.data.data.map(item => ({
value: item.nnumber,
- label: item.name
+ label: item.nnumber
}))
} catch (error) {
console.error('鑾峰彇椤圭洰鍚嶇О鍒楄〃澶辫触:', error)
@@ -1046,7 +1122,7 @@
listAllCategory().then(response => {
this.recordTypeOptions = response.data.map(item => ({
value: item.numb,
- label: item.nname
+ label: item.numb
}))
resolve()
})
@@ -1077,7 +1153,37 @@
this.loading = true
console.log(this.queryParams)
console.log("--------------")
- listRecords(this.queryParams).then(response => {
+ // 鍒涘缓queryParams鐨勫壇鏈紝閬垮厤鐩存帴淇敼鍘熷璞�
+ const queryParams = { ...this.queryParams }
+
+ // 澶勭悊绫诲埆鍙锋悳绱�
+ if (queryParams.categoryType || queryParams.categoryZone || queryParams.categoryYear || queryParams.categorySeq || queryParams.categorySeqEnd) {
+ // 鏋勫缓鍩虹閮ㄥ垎
+ const baseParts = []
+ if (queryParams.categoryType) baseParts.push(queryParams.categoryType)
+ if (queryParams.categoryZone) baseParts.push(queryParams.categoryZone)
+ if (queryParams.categoryYear) baseParts.push(queryParams.categoryYear)
+ const baseCategory = baseParts.join('-')
+
+ // 鍒ゆ柇鏄崟涓簭鍙锋悳绱㈣繕鏄寖鍥存悳绱�
+ if (queryParams.categorySeq && queryParams.categorySeqEnd) {
+ // 鑼冨洿鎼滅储锛氭瀯寤哄紑濮嬪拰缁撴潫绫诲埆鍙�
+ queryParams.categoryNumberStart = baseCategory ? baseCategory + '-' + queryParams.categorySeq : queryParams.categorySeq
+ queryParams.categoryNumberEnd = baseCategory ? baseCategory + '-' + queryParams.categorySeqEnd : queryParams.categorySeqEnd
+ } else if (queryParams.categorySeq) {
+ // 鍗曚釜搴忓彿鎼滅储锛氭瀯寤哄畬鏁寸殑绫诲埆鍙�
+ queryParams.categoryNumber = baseCategory ? baseCategory + '-' + queryParams.categorySeq : queryParams.categorySeq
+ }
+
+ // 鍒犻櫎鍗曠嫭鐨勫瓧娈碉紝閬垮厤閲嶅鎼滅储
+ delete queryParams.categoryType
+ delete queryParams.categoryZone
+ delete queryParams.categoryYear
+ delete queryParams.categorySeq
+ delete queryParams.categorySeqEnd
+ }
+
+ listRecords(queryParams).then(response => {
console.log(response)
this.recordsList = response.data.data
@@ -1157,9 +1263,10 @@
//
handleSubmit(row)
{
- // alert(row.id)
+ //alert(row.id)
var id = row.id
- updateStatusById(id).then(response=>{
+ var status = '褰曞叆瀹屾垚'
+ updateStatusById(status, id).then(response=>{
this.$modal.msgSuccess("鎻愪氦鎴愬姛")
this.getList()
})
@@ -1302,7 +1409,7 @@
handleAuthUser: function(row) {
const roleId = 2
var archiveRecordsId = row.recordId
- alert(roleId)
+
this.$router.push("/archiveManager/infoManagerAu/user/" + roleId+"/"+archiveRecordsId)
},
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
@@ -1336,6 +1443,8 @@
/** 鏌ョ湅骞舵墦鍗癊xcel鏂囦欢 */
viewAndPrintExcel(row) {
const id = row.id || this.ids;
+ // alert(id)
+ this.recordId = id;
this.$modal.loading('姝e湪鑾峰彇Excel鏂囦欢锛岃绋嶅��...');
// 浠庡悗绔幏鍙朎xcel鏂囦欢
@@ -1364,6 +1473,7 @@
/** 鍏抽棴Excel寮圭獥骞舵竻鐞嗚祫婧� */
closeExcelDialog() {
this.excelDialogVisible = false;
+ // alert(this.excelDialogVisible)
if (this.excelPreviewTimeout) {
clearTimeout(this.excelPreviewTimeout);
this.excelPreviewTimeout = null;
@@ -1374,12 +1484,32 @@
}
this.currentExcelBlob = null;
},
+closeExcelPreviewDialog()
+{
+ this.showExcelPreview = false;
+},
/** 澶勭悊棰勮鎸夐挳鐐瑰嚮 */
handlePreviewClick() {
- this.excelLoading = true;
+ this.showExcelPreview = true;
this.excelRenderError = '';
+ var id = this.recordId ;
+ this.$modal.loading('姝e湪鑾峰彇Excel鏂囦欢锛岃绋嶅��...');
+ // 浠庡悗绔幏鍙朎xcel鏂囦欢
+ this.getExcelFile(id).then(blob => {
+ this.$modal.closeLoading();
+ // 淇濆瓨鏂囦欢淇℃伅骞舵樉绀洪潤鎬佸脊绐�
+ this.currentExcelUrl = URL.createObjectURL(blob);
+ this.currentExcelBlob = blob;
+ this.currentExcelId = id;
+ this.excelDialogVisible = true;
+ this.excelLoading = false;
+ }).catch(error => {
+ this.$modal.closeLoading();
+ console.error('鑾峰彇Excel鏂囦欢澶辫触:', error);
+ this.$modal.msgError('鑾峰彇Excel鏂囦欢澶辫触锛岃绋嶅悗閲嶈瘯');
+ });
// 閲嶇疆vue-office-excel缁勪欢
if (this.currentExcelUrl) {
const tempUrl = this.currentExcelUrl;
@@ -1549,9 +1679,9 @@
// 鏋勫缓鏂囦欢鍚嶏紝鍖呭惈閫夐」淇℃伅
let filename = `record_${this.currentExcelId}`;
if (includeQrCode) filename += '_qr';
- if (selectedAnnotations.length > 0) {
- filename += `_anno${selectedAnnotations.join('')}`;
- }
+ // if (selectedAnnotations.length > 0) {
+ // filename += `_anno${selectedAnnotations.join('')}`;
+ // }
filename += `_${new Date().getTime()}.xlsx`;
link.download = filename;
@@ -1587,7 +1717,7 @@
});
},
- /** 娓呯悊Excel棰勮鐩稿叧璧勬簮 */
+ /** 娓呯悊Excel棰勮鐩稿叧璧勬簮骞跺叧闂璇濇 */
cleanupExcelPreview(iframe, url) {
setTimeout(() => {
if (iframe && iframe.parentNode) {
@@ -1597,18 +1727,43 @@
URL.revokeObjectURL(url);
}
this.excelRenderError = '';
+ this.showExcelPreview = false; // 鍏抽棴棰勮瀵硅瘽妗�
}, 1000);
},
/** 浠庡悗绔幏鍙朎xcel鏂囦欢 */
getExcelFile(id) {
+ var includeQrCode = this.excelOptions.includeQrCode;
+ var urls = `${process.env.VUE_APP_BASE_API}/system/records/recordFileList`+"/"+includeQrCode;
+
+
+ if(this.excelOptions.subselectedSignatures.length!=0)
+ {
+ var selectedSignatures = this.excelOptions.subselectedSignatures
+ urls = urls +'/'+ selectedSignatures
+ }
+ if(this.excelOptions.subselectedAnnotations.length!=0)
+ {
+ var selectedAnnotations = this.excelOptions.subselectedAnnotations
+ urls = urls+"/"+selectedAnnotations
+ }
+
return new Promise((resolve, reject) => {
// 棣栧厛灏濊瘯浣跨敤axios锛堥」鐩凡鏈夌殑HTTP瀹㈡埛绔級
try {
+ // 鑾峰彇鐢ㄦ埛閫夋嫨鐨勬敞瑙�
+ const { selectedAnnotations } = this.excelOptions;
+
+ // 鏋勫缓鍙傛暟锛屽寘鍚敞瑙e唴瀹�
+ const params = {
+ recordId: id,
+
+ };
+
axios({
method: 'Post',
- url: `${process.env.VUE_APP_BASE_API}/system/records/model`,
- params: { id: id },
+ url: urls,
+ params: params,
responseType: 'blob',
headers: { 'Authorization': 'Bearer ' + getToken() }
}).then(response => {
@@ -1629,9 +1784,20 @@
fallbackGetExcelFile(id, resolve, reject) {
try {
const xhr = new XMLHttpRequest();
+
+ // 鏋勫缓鏌ヨ鍙傛暟锛屽寘鍚敞瑙e唴瀹�
+ const queryParams = new URLSearchParams({
+ id: id,
+ annotation1: "鏈竻鍗曠敱妗f褰㈡垚閮ㄩ棬瀹屾垚",
+ annotation2: "鏂囦欢绫诲瀷蹇呴』褰曞叆锛屽寘鎷粨璁烘潗鏂欍�佽繃绋嬫潗鏂欍�佺敵璇锋潗鏂欙紝鍏朵粬鏉愭枡",
+ annotation3: "鍏紑灞炴�у繀椤诲綍鍏ワ紝涓诲姩鍏紑銆佷緷鐢宠鍏紑銆佸厤浜堝叕寮�",
+ annotation4: "淇濈鏈熼檺:30骞存垨姘镐箙",
+ annotation5: "椤靛彿鎸夌収姝e紡褰曞叆椤电爜涓哄噯"
+ }).toString();
+
// 灏濊瘯涓嶅悓鐨凙PI璺緞锛屼互閫傚簲鍙兘鐨勫悗绔疄鐜�
const apiUrls = [
- `${process.env.VUE_APP_BASE_API}/system/records/model?id=${id}`,
+ `${process.env.VUE_APP_BASE_API}/system/records/model?${queryParams}`,
`${process.env.VUE_APP_BASE_API}/system/records/model`
];
--
Gitblit v1.9.1