From fc98e676332302c4b835f8fa4ed42d72e177801f Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期二, 14 十月 2025 16:57:02 +0800
Subject: [PATCH] 增加了对应的代码
---
src/views/archiveManager/index.vue | 102 +++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 91 insertions(+), 11 deletions(-)
diff --git a/src/views/archiveManager/index.vue b/src/views/archiveManager/index.vue
index 51f93be..3db1b54 100644
--- a/src/views/archiveManager/index.vue
+++ b/src/views/archiveManager/index.vue
@@ -231,7 +231,7 @@
>瀵煎嚭</el-button>
</el-col>
- <el-col :span="1.5">
+ <el-col v-if="userId!=1" :span="1.5">
<el-button
type="warning"
plain
@@ -242,7 +242,7 @@
>鎵归噺鎻愪氦</el-button>
</el-col>
- <el-col :span="1.5">
+ <el-col v-if="userId==1" :span="1.5">
<el-button
type="warning"
plain
@@ -252,8 +252,17 @@
v-hasPermi="['system:materials:edit']"
>瀵煎叆妯℃澘涓嬭浇</el-button>
</el-col>
-
- <el-col :span="1.5">
+ <el-col v-if="userId!=1" :span="1.5">
+ <el-button
+ type="warning"
+ plain
+ icon="el-icon-download"
+ size="mini"
+ @click="handleExportTemplateOther"
+ v-hasPermi="['system:materials:edit']"
+ >瀵煎叆妯℃澘涓嬭浇</el-button>
+ </el-col>
+ <el-col :span="1.5">
<el-upload
action=""
@@ -305,7 +314,7 @@
<el-table-column label="澶囨敞" align="center" prop="remarks" />
<el-table-column label="鍘嗗彶鐩稿叧鍙戞枃鍙�" align="center" prop="historicalReferenceNumber" />
- <el-table-column label="鐘舵��" align="center" prop="recordStatus">
+ <el-table-column label="鐘舵��" align="center" width="105" prop="recordStatus">
<template slot-scope="scope">
<el-button :type="scope.row.recordStatus === '鏈綍鍏�' ? 'danger' : 'success'" size="mini">
{{ scope.row.recordStatus }}
@@ -333,7 +342,7 @@
@click="handleCheck(scope.row)"
>鏌ョ湅</el-button>
<el-button
- v-if="userId!==1&&scope.row.ownData"
+ v-if="userId!==1&&scope.row.ownData&&scope.row.recordStatus!=='褰曞叆瀹屾垚'"
size="mini"
type="text"
@@ -406,7 +415,8 @@
v-model="form.recordZone"
placeholder="閫夋嫨鍦板尯"
@change="handleRecordTypeChange"
- :disabled="userId!=1" >
+ disabled
+ >
<el-option
v-for="item in zoneTypeOptions"
:key="item.value"
@@ -686,7 +696,7 @@
</template>
<script>
-import { batchSubmitRecords,updateStatusById,listRecords,getMaxId, getRecords, delRecords, addRecords, updateRecords } from "@/api/system/records"
+import { enload, 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"
@@ -998,7 +1008,8 @@
{
// alert(row.id)
var id = row.id
- updateStatusById(id).then(response=>{
+ var status = '褰曞叆瀹屾垚'
+ updateStatusById(status, id).then(response=>{
this.$modal.msgSuccess("鎻愪氦鎴愬姛")
this.getList()
})
@@ -1018,10 +1029,18 @@
if(this.recordTypeOptions.length > 0) {
const recordParts = response.data.recordId.split('-')
this.$set(this.form, 'recordType', recordParts[0])
- this.$set(this.form, 'recordZone', recordParts[1])
+ if(recordParts.length==4)
+ {
+ this.$set(this.form, 'recordZone', recordParts[1])
this.$set(this.form, 'recordYear', recordParts[2])
this.$set(this.form, 'recordSeq', recordParts[3])
+ }
+ else
+ {
+ this.$set(this.form, 'recordYear', recordParts[1])
+ this.$set(this.form, 'recordSeq', recordParts[2])
+ }
}
this.open = true
this.title = "淇敼妗f璁板綍"
@@ -1067,10 +1086,18 @@
if(this.recordTypeOptions.length > 0) {
const recordParts = response.data.recordId.split('-')
this.$set(this.form, 'recordType', recordParts[0])
+ if(recordParts.length==4)
+ {
this.$set(this.form, 'recordZone', recordParts[1])
this.$set(this.form, 'recordYear', recordParts[2])
this.$set(this.form, 'recordSeq', recordParts[3])
+ }
+ else
+ {
+ this.$set(this.form, 'recordYear', recordParts[1])
+ this.$set(this.form, 'recordSeq', recordParts[2])
+ }
}
this.open_check = true
this.title = "鏌ョ湅妗f璁板綍"
@@ -1079,6 +1106,7 @@
/** 鎻愪氦鎸夐挳 */
submitForm() {
+ console.log(this.form)
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
@@ -1123,7 +1151,8 @@
/** 鍒嗛厤鐢ㄦ埛鎿嶄綔 */
handleAuthUser: function(row) {
const roleId = 2
- var archiveRecordsId = row.recordId
+ // row.i
+ var archiveRecordsId = row.id
// alert(roleId)
this.$router.push("/archiveManager/infoManagerAu/user/" + roleId+"/"+archiveRecordsId)
},
@@ -1142,7 +1171,58 @@
this.download('system/records/export', {
...this.queryParams
}, `records_${new Date().getTime()}.xlsx`)
+ },
+ /** 瀵煎叆妯℃澘涓嬭浇鎿嶄綔*/
+ handleExportTemplate()
+ {
+ this.download('/system/records/model', {
+
+ }, `records_${new Date().getTime()}.xlsx`)
+ },
+ handleExportTemplateOther()
+ {
+ this.download('/system/records/modelOther', {
+
+ }, `records_${new Date().getTime()}.xlsx`)
+ },
+ /** 瀵煎叆鎿嶄綔*/
+ async handleImportData({file}){
+ // 妫�鏌ユ枃浠剁被鍨嬫槸鍚︿负xlsx
+ // if (!params.file.name.endsWith('.xlsx')) {
+ // this.$message.error('璇蜂笂浼�.xlsx鏍煎紡鐨勬枃浠�');
+ // return;
+ // }
+ const formData = new FormData();
+ formData.append('excelImport', file);
+ // formData.append('recordId', this.recordId)
+ // alert(this.recordId)
+ console.log(file)
+
+ // 鏄剧ず鍔犺浇涓姸鎬�
+ const loading = this.$loading({
+ lock: true,
+ text: '涓婁紶涓�...',
+ spinner: 'el-icon-loading',
+ background: 'rgba(0, 0, 0, 0.7)'
+ });
+
+ enload(formData, {
+ headers: {
+ 'Content-Type': 'multipart/form-data'
}
+ }).then(response => {
+ loading.close();
+ this.$message.success('瀵煎叆鎴愬姛');
+ this.getList();
+ }).catch(error => {
+ loading.close();
+ this.$message.error('瀵煎叆澶辫触: ' + (error.message || '鏈煡閿欒'));
+ });
+
+ }
+
+
+
}
}
</script>
--
Gitblit v1.9.1