| | |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <!-- 添加项目名称搜索框 --> |
| | | <el-form-item label="项目名称" prop="everyProjectName"> |
| | | <el-select |
| | | v-model="queryParams.everyProjectName" |
| | | placeholder="请选择项目名称" |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="item in projectOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="项目编号" prop="projectNumber"> |
| | | <el-input |
| | | v-model="queryParams.projectNumber" |
| | |
| | | >批量提交</el-button> |
| | | </el-col> |
| | | |
| | | <el-col :span="1.5"> |
| | | <el-col v-if="userId==1" :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | |
| | | 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="" |
| | |
| | | v-model="form.recordZone" |
| | | placeholder="选择地区" |
| | | @change="handleRecordTypeChange" |
| | | :disabled="userId!=1" > |
| | | disabled |
| | | > |
| | | <el-option |
| | | v-for="item in zoneTypeOptions" |
| | | :key="item.value" |
| | |
| | | |
| | | <div v-if="vis"> |
| | | <el-form-item label="案卷题名" prop="caseTitle"> |
| | | <el-input v-model="form.caseTitle" placeholder="请输入案卷题名" /> |
| | | <el-input v-model="form.caseTitle" placeholder="自动生成" :readonly="true" /> |
| | | </el-form-item> |
| | | <el-form-item label="公开属性" prop="publicAttribute"> |
| | | |
| | |
| | | <el-input v-model="form.constructionAddress" placeholder="请输入建设地址" /> |
| | | </el-form-item> |
| | | <el-form-item label="建设项目名称" prop="projectName"> |
| | | <el-input v-model="form.projectName" placeholder="请输入建设项目名称" :disabled="userId!=1"/> |
| | | <el-input v-model="form.projectName" placeholder="请输入建设项目名称" /> |
| | | <!-- <el-input v-model="form.projectName" placeholder="请输入建设项目名称" :disabled="userId!=1"/> --> |
| | | </el-form-item> |
| | | <el-form-item label="项目编号" prop="projectNumber"> |
| | | <el-input v-model="form.projectNumber" placeholder="请输入项目编号" /> |
| | |
| | | </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" |
| | |
| | | { required: true, message: "档案号不能为空", trigger: "blur" } |
| | | ], |
| | | inquiryNumber: [ |
| | | { required: true, message: "发问号不能为空", trigger: "blur" } |
| | | { required: true, message: "发文号不能为空", trigger: "blur" } |
| | | ], |
| | | everyProjectName: [ |
| | | { required: true, message: "项目名称不能为空", trigger: ['change', 'blur']} |
| | | ], |
| | | caseTitle: [ |
| | | { required: true, message: "案卷题名不能为空", trigger: "blur" } |
| | | ], |
| | | constructionUnit: [ |
| | | { required: true, message: "建设单位不能为空", trigger: "blur" } |
| | | ], |
| | | projectName: [ |
| | | { required: true, message: "建设项目名称不能为空", trigger: "blur" } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | |
| | | this.getZoneOptions() |
| | | this.fetchProjectOptions() |
| | | this.getList() |
| | | }, |
| | | watch: { |
| | | 'form.constructionUnit': { |
| | | handler() { |
| | | this.generateCaseTitle(); |
| | | }, |
| | | immediate: true |
| | | }, |
| | | 'form.constructionAddress': { |
| | | handler() { |
| | | this.generateCaseTitle(); |
| | | }, |
| | | immediate: true |
| | | }, |
| | | 'form.projectName': { |
| | | handler() { |
| | | this.generateCaseTitle(); |
| | | }, |
| | | immediate: true |
| | | } |
| | | }, |
| | | methods: { |
| | | getId() |
| | |
| | | // alert(this.maxId) |
| | | }) |
| | | }, |
| | | // 生成案卷题名 |
| | | generateCaseTitle() { |
| | | let titleParts = []; |
| | | |
| | | if (this.form.constructionUnit) { |
| | | titleParts.push(this.form.constructionUnit); |
| | | } |
| | | |
| | | if (this.form.constructionAddress) { |
| | | titleParts.push(this.form.constructionAddress); |
| | | } |
| | | |
| | | if (this.form.projectName) { |
| | | titleParts.push(this.form.projectName); |
| | | } |
| | | |
| | | this.form.caseTitle = titleParts.join(''); |
| | | }, |
| | | async getZoneOptions() |
| | | { |
| | | try { |
| | | const response = await listAllPlaceName() |
| | | console.log(response.data) |
| | | this.zoneTypeOptions = response.data.map(item => ({ |
| | | console.log("1111111333333",response.data) |
| | | this.zoneTypeOptions = response.data.data.map(item => ({ |
| | | value: item.nnumber, |
| | | label: item.name |
| | | })) |
| | |
| | | async fetchProjectOptions() { |
| | | try { |
| | | const response = await listAllProjectName() |
| | | console.log(response) |
| | | this.projectOptions = response.data.map(item => ({ |
| | | console.log("1111111",response) |
| | | this.projectOptions = response.data.data.map(item => ({ |
| | | value: item.name, |
| | | label: item.name |
| | | })) |
| | |
| | | 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(this.recordTypeOptions.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 = "修改档案记录" |
| | |
| | | if(this.recordTypeOptions.length > 0) { |
| | | const recordParts = response.data.recordId.split('-') |
| | | this.$set(this.form, 'recordType', recordParts[0]) |
| | | if(this.recordTypeOptions.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 = "查看档案记录" |
| | |
| | | |
| | | /** 提交按钮 */ |
| | | submitForm() { |
| | | console.log(this.form) |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | if (this.form.id != null) { |
| | |
| | | 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> |
| | | |
| | | <style scoped> |
| | | /* 加宽表格底部滚动条 */ |
| | | ::v-deep .el-table__body-wrapper::-webkit-scrollbar { |
| | | height: 20px; /* 横向滚动条高度 */ |
| | | } |
| | | |
| | | /* 滚动条轨道 */ |
| | | ::v-deep .el-table__body-wrapper::-webkit-scrollbar-track { |
| | | background: #f1f1f1; |
| | | border-radius: 10px; |
| | | } |
| | | |
| | | /* 滚动条滑块 */ |
| | | ::v-deep .el-table__body-wrapper::-webkit-scrollbar-thumb { |
| | | background: #c1c1c1; |
| | | border-radius: 10px; |
| | | } |
| | | |
| | | /* 滚动条滑块悬停效果 */ |
| | | ::v-deep .el-table__body-wrapper::-webkit-scrollbar-thumb:hover { |
| | | background: #2f91ec; |
| | | } |
| | | </style> |