From b7ce4df611c11605aef94dac1b7056be5138b792 Mon Sep 17 00:00:00 2001 From: tian <3072314689@qq.com> Date: 星期二, 23 九月 2025 19:38:31 +0800 Subject: [PATCH] Merge branch 'master' of http://47.93.189.255:8099/r/archiveFrontEnd --- src/views/archiveManager/index.vue | 135 ++++++++++++++++++++++++++++++++++++++------ 1 files changed, 115 insertions(+), 20 deletions(-) diff --git a/src/views/archiveManager/index.vue b/src/views/archiveManager/index.vue index a3f7aa2..9d92a36 100644 --- a/src/views/archiveManager/index.vue +++ b/src/views/archiveManager/index.vue @@ -230,6 +230,49 @@ v-hasPermi="['system:records:export']" >瀵煎嚭</el-button> </el-col> + + <el-col :span="1.5"> + <el-button + type="warning" + plain + icon="el-icon-download" + size="mini" + @click="handleBatchSubmit" + v-hasPermi="['system:records:export']" + >鎵归噺鎻愪氦</el-button> + </el-col> + + <el-col :span="1.5"> + <el-button + type="warning" + plain + icon="el-icon-download" + size="mini" + @click="handleExportTemplate" + v-hasPermi="['system:materials:edit']" + >瀵煎叆妯℃澘涓嬭浇</el-button> + </el-col> + + <el-col :span="1.5"> + + <el-upload + action="" + + class="upload-demo" + :show-file-list="false" + :http-request="handleImportData" + accept=".xlsx,.xls" + + > + <el-button size="mini" type="primary" + plain + icon="el-icon-top">瀵煎叆</el-button> + + </el-upload> + </el-col> + + + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-row> @@ -290,7 +333,7 @@ @click="handleCheck(scope.row)" >鏌ョ湅</el-button> <el-button - v-if="userId!==1" + v-if="userId!==1&&scope.row.ownData" size="mini" type="text" @@ -355,7 +398,24 @@ /> </el-select> </el-col> - <el-col :span="6"> + + + <el-col :span="6"> + <el-select + + v-model="form.recordZone" + placeholder="閫夋嫨鍦板尯" + @change="handleRecordTypeChange" + :disabled="userId!=1" > + <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="form.recordYear" placeholder="杈撳叆骞翠唤" @@ -365,7 +425,7 @@ @input="generateRecordId" /> </el-col> - <el-col :span="6"> + <el-col :span="4"> <el-input v-model="form.recordSeq" placeholder="鑷姩鐢熸垚" @@ -482,16 +542,19 @@ <el-col :span="4"> <el-input v-model="form.recordYear" + @input="generateRecordId" + placeholder="杈撳叆骞翠唤" - @input="generateRecordId" :disabled="userId!=1" /> </el-col> <el-col :span="4"> <el-input v-model="form.recordSeq" - placeholder="鑷姩鐢熸垚" - disabled + :disabled="userId!=1" + @input="generateRecordId" + + placeholder="杈撳叆妗f搴忓彿" /> </el-col> </el-row> @@ -623,10 +686,10 @@ </template> <script> -import { updateStatusById,listRecords,getMaxId, getRecords, delRecords, addRecords, updateRecords } from "@/api/system/records" +import { batchSubmitRecords,updateStatusById,listRecords,getMaxId, getRecords, delRecords, addRecords, updateRecords } from "@/api/system/records" import { listAllCategory } from "@/api/system/category" -import { listName } from "@/api/system/projectName" -import { listPlaceName } from "@/api/system/placeName" +import { listAllProjectName } from "@/api/system/projectName" +import { listPlaceName, listAllPlaceName } from "@/api/system/placeName" export default { name: "Records", data() { @@ -733,7 +796,7 @@ this.userId = this.$store.state.user.id; // 鑾峰彇鐢ㄦ埛瑙掕壊 - this.getId() + // this.getId() this.getRecordTypes() this.getZoneOptions() this.fetchProjectOptions() @@ -794,10 +857,9 @@ async getZoneOptions() { try { - const response = await listPlaceName() - console.log(response) - // alert(134) - this.zoneTypeOptions = response.data.data.map(item => ({ + const response = await listAllPlaceName() + console.log(response.data) + this.zoneTypeOptions = response.data.map(item => ({ value: item.nnumber, label: item.name })) @@ -807,9 +869,9 @@ }, async fetchProjectOptions() { try { - const response = await listName() + const response = await listAllProjectName() console.log(response) - this.projectOptions = response.data.data.map(item => ({ + this.projectOptions = response.data.map(item => ({ value: item.name, label: item.name })) @@ -838,7 +900,7 @@ /** 鐢熸垚妗f鍙� */ generateRecordId() { - if (this.form.recordType && this.form.recordZone && this.form.recordYear) { + if (this.form.recordType && this.form.recordZone && this.form.recordYear && this.form.recordSeq) { // getNextRecordId({ // type: this.form.recordType, @@ -914,7 +976,7 @@ /** 鏂板鎸夐挳鎿嶄綔 */ handleAdd() { this.reset() - this.form.recordSeq = this.maxId + // this.form.recordSeq = this.maxId this.open = true this.vis = false; this.title = "娣诲姞妗f璁板綍" @@ -934,7 +996,7 @@ // handleSubmit(row) { - alert(row.id) + // alert(row.id) var id = row.id updateStatusById(id).then(response=>{ this.$modal.msgSuccess("鎻愪氦鎴愬姛") @@ -963,6 +1025,34 @@ } this.open = true this.title = "淇敼妗f璁板綍" + }) + }, + /** 鎵归噺鎻愪氦 */ + 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)); + + if (invalidIds.length > 0) { + this.$message.error(`鍖呭惈鏃犳潈鎿嶄綔鐨処D: ${invalidIds.join(',')}`); + return false; + } + //濡傛灉id鍏ㄩ儴鏈夋晥鎵嶇户缁彁浜� + batchSubmitRecords( this.ids ).then(response => { + if (response.code === 0) { + this.$modal.msgSuccess('鎵归噺鎻愪氦鎴愬姛') + this.getList() + this.ids = [] + } else { + this.$modal.msgError(response.msg || '鎵归噺鎻愪氦澶辫触') + } }) }, /** 淇敼鎸夐挳鎿嶄綔 */ @@ -999,11 +1089,16 @@ }) } else { console.log(this.form) + addRecords(this.form).then(response => { + console.log(response) + if(response.code==0) + this.$modal.msgError(response.msg) + else{ this.$modal.msgSuccess("鏂板鎴愬姛") this.open = false this.getId() - this.getList() + this.getList()} }) -- Gitblit v1.9.1