| | |
| | | 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> |
| | | |
| | |
| | | <!-- <el-table-column label="${comment}" align="center" prop="id" /> --> |
| | | <el-table-column label="档案号" align="center" prop="recordId" /> |
| | | <el-table-column label="发文号" align="center" prop="inquiryNumber" /> |
| | | <el-table-column label="案卷题名" align="center" prop="caseTitle" /> |
| | | <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="publicAttribute" /> |
| | | <el-table-column label="编制单位" align="center" prop="preparationUnit" /> |
| | | <el-table-column label="编制日期" align="center" prop="preparationDate" width="180"> |
| | |
| | | <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="recordStatus"> |
| | | <template slot-scope="scope"> |
| | | <el-button :type="scope.row.recordStatus === '未录入' ? 'danger' : 'success'" size="mini"> |
| | | {{ scope.row.recordStatus }} |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | |
| | | <el-table-column label="操作" align="center" width="190" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | |
| | | >案卷详细信息</el-button> |
| | | |
| | | <el-button |
| | | |
| | | |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleCheck(scope.row)" |
| | | >查看</el-button> |
| | | <el-button |
| | | v-if="userId!==1&&scope.row.ownData" |
| | | |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleSubmit(scope.row)" |
| | | v-hasPermi="['system:records:edit']" |
| | | >提交案卷</el-button> |
| | | <el-button |
| | | v-if="scope.row.ownData||userId===1" |
| | | |
| | |
| | | /> |
| | | </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="输入年份" |
| | |
| | | @input="generateRecordId" |
| | | /> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-col :span="4"> |
| | | <el-input |
| | | v-model="form.recordSeq" |
| | | placeholder="自动生成" |
| | |
| | | </el-row> |
| | | </el-form-item> |
| | | <el-form-item label="发文号" prop="inquiryNumber"> |
| | | <el-input v-model="form.inquiryNumber" placeholder="请输入发问号" disabled/> |
| | | <el-input v-model="form.inquiryNumber" placeholder="请输入发文号" disabled/> |
| | | </el-form-item> |
| | | <el-form-item label="建设项目名称" prop="projectName"> |
| | | <el-input v-model="form.projectName" placeholder="请输入建设项目名称" disabled/> |
| | |
| | | <!-- 添加或修改档案记录对话框 --> |
| | | <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="120px"> |
| | | <el-form-item label="档案号" > |
| | | <el-form-item label="档案号" prop="recordId"> |
| | | |
| | | <el-row :gutter="8"> |
| | | <el-col :span="6"> |
| | | <el-select |
| | | |
| | | |
| | | v-model="form.recordType" |
| | | placeholder="选择档案类型" |
| | | @change="handleRecordTypeChange" |
| | |
| | | /> |
| | | </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" |
| | | @input="generateRecordId" |
| | | |
| | | placeholder="输入年份" |
| | | @input="generateRecordId" |
| | | :disabled="userId!=1" |
| | | /> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-col :span="4"> |
| | | <el-input |
| | | v-model="form.recordSeq" |
| | | placeholder="自动生成" |
| | | disabled |
| | | :disabled="userId!=1" |
| | | @input="generateRecordId" |
| | | |
| | | placeholder="输入档案序号" |
| | | /> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form-item> |
| | | <el-form-item label="发文号" prop="inquiryNumber"> |
| | | <el-input v-model="form.inquiryNumber" placeholder="请输入发问号" :disabled="userId!=1" |
| | | <el-input v-model="form.inquiryNumber" placeholder="请输入发文号" :disabled="userId!=1" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="建设项目名称" prop="projectName"> |
| | | <el-input v-model="form.projectName" placeholder="请输入建设项目名称" :disabled="userId!=1"/> |
| | | <el-form-item label="项目名称" prop="everyProjectName"> |
| | | <el-select |
| | | v-model="form.everyProjectName" |
| | | placeholder="请选择项目名称" |
| | | |
| | | :disabled="userId!=1" |
| | | > |
| | | <el-option |
| | | v-for="item in projectOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | |
| | | |
| | | <div v-if="vis"> |
| | | <el-form-item label="案卷题名" prop="caseTitle"> |
| | | <el-input v-model="form.caseTitle" placeholder="请输入案卷题名" /> |
| | | </el-form-item> |
| | | <el-form-item label="公开属性" prop="publicAttribute"> |
| | | |
| | | |
| | | |
| | | <el-select |
| | | v-model="form.publicAttribute" |
| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | |
| | | <el-form-item label="编制单位" prop="preparationUnit"> |
| | | <el-input v-model="form.preparationUnit" placeholder="请输入编制单位" /> |
| | | </el-form-item> |
| | |
| | | <el-form-item label="建设地址" prop="constructionAddress"> |
| | | <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-form-item> |
| | | <el-form-item label="项目编号" prop="projectNumber"> |
| | | <el-input v-model="form.projectNumber" placeholder="请输入项目编号" /> |
| | | </el-form-item> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { 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 { listAllProjectName } from "@/api/system/projectName" |
| | | import { listPlaceName, listAllPlaceName } from "@/api/system/placeName" |
| | | export default { |
| | | name: "Records", |
| | | data() { |
| | |
| | | { value: '普通', label: '普通' } |
| | | ], |
| | | maxId: 0, |
| | | // 档案类型选项 |
| | | recordTypeOptions: [], |
| | | // 保管期限选项 |
| | | retentionPeriodOptions: [ |
| | | // 项目名称选项 |
| | | projectOptions: [], |
| | | // 档案类型选项 |
| | | recordTypeOptions: [], |
| | | //地区类型 |
| | | zoneTypeOptions: [], |
| | | // 保管期限选项 |
| | | retentionPeriodOptions: [ |
| | | { value: "10年", label: "10年" }, |
| | | { value: "30年", label: "30年" }, |
| | | { value: "永久", label: "永久" } |
| | |
| | | pageSize: 10, |
| | | recordId: null, |
| | | inquiryNumber: null, |
| | | everyProjectName: null, |
| | | caseTitle: null, |
| | | publicAttribute: null, |
| | | preparationUnit: null, |
| | |
| | | inquiryNumber: [ |
| | | { required: true, message: "发问号不能为空", trigger: "blur" } |
| | | ], |
| | | projectName: [ |
| | | { required: true, message: "项目名称不能为空", trigger: "blur" } |
| | | everyProjectName: [ |
| | | { required: true, message: "项目名称不能为空", trigger: ['change', 'blur']} |
| | | ], |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.getList() |
| | | |
| | | this.userId = this.$store.state.user.id; |
| | | |
| | | // 获取用户角色 |
| | | this.getId() |
| | | // this.getId() |
| | | this.getRecordTypes() |
| | | |
| | | |
| | | this.getZoneOptions() |
| | | this.fetchProjectOptions() |
| | | this.getList() |
| | | }, |
| | | methods: { |
| | | getId() |
| | |
| | | getMaxId().then(response=>{ |
| | | // alert(213) |
| | | console.log(response) |
| | | _this.maxId = String(response.data).padStart(5, '0') |
| | | _this.maxId = String(response.data).padStart(4, '0') |
| | | |
| | | _this.$set(_this.form, 'recordSeq', _this.maxId) // |
| | | |
| | | // alert(this.maxId) |
| | | }) |
| | | }, |
| | | async getZoneOptions() |
| | | { |
| | | try { |
| | | const response = await listAllPlaceName() |
| | | console.log(response.data) |
| | | this.zoneTypeOptions = response.data.map(item => ({ |
| | | value: item.nnumber, |
| | | label: item.name |
| | | })) |
| | | } catch (error) { |
| | | console.error('获取项目名称列表失败:', error) |
| | | } |
| | | }, |
| | | async fetchProjectOptions() { |
| | | try { |
| | | const response = await listAllProjectName() |
| | | console.log(response) |
| | | this.projectOptions = response.data.map(item => ({ |
| | | value: item.name, |
| | | label: item.name |
| | | })) |
| | | } catch (error) { |
| | | console.error('获取项目名称列表失败:', error) |
| | | } |
| | | }, |
| | | /** 获取档案类型列表 */ |
| | | getRecordTypes() { |
| | |
| | | /** 生成档案号 */ |
| | | generateRecordId() { |
| | | |
| | | if (this.form.recordType && this.form.recordYear) { |
| | | if (this.form.recordType && this.form.recordZone && this.form.recordYear && this.form.recordSeq) { |
| | | |
| | | // getNextRecordId({ |
| | | // type: this.form.recordType, |
| | | // year: this.form.recordYear |
| | | // }).then(response => { |
| | | // this.form.recordSeq = response.data.seq |
| | | this.form.recordId = `${this.form.recordType}-${this.form.recordYear}-${this.form.recordSeq}` |
| | | this.form.recordId = `${this.form.recordType}-${this.form.recordZone}-${this.form.recordYear}-${this.form.recordSeq}` |
| | | // }) |
| | | } |
| | | }, |
| | |
| | | id: null, |
| | | recordId: null, |
| | | inquiryNumber: null, |
| | | everyProjectName: null, |
| | | caseTitle: null, |
| | | publicAttribute: null, |
| | | preparationUnit: null, |
| | |
| | | /** 新增按钮操作 */ |
| | | handleAdd() { |
| | | this.reset() |
| | | this.form.recordSeq = this.maxId |
| | | // this.form.recordSeq = this.maxId |
| | | this.open = true |
| | | this.vis = false; |
| | | this.title = "添加档案记录" |
| | |
| | | this.$router.push("/archiveManager/infoManagerAu/archiveMaterialManager/" + recordId) |
| | | |
| | | }, |
| | | // |
| | | handleSubmit(row) |
| | | { |
| | | // alert(row.id) |
| | | var id = row.id |
| | | updateStatusById(id).then(response=>{ |
| | | this.$modal.msgSuccess("提交成功") |
| | | this.getList() |
| | | }) |
| | | }, |
| | | /** 修改按钮操作 */ |
| | | handleUpdate(row) { |
| | | |
| | |
| | | if(this.recordTypeOptions.length > 0) { |
| | | const recordParts = response.data.recordId.split('-') |
| | | this.$set(this.form, 'recordType', recordParts[0]) |
| | | this.$set(this.form, 'recordYear', recordParts[1]) |
| | | this.$set(this.form, 'recordSeq', recordParts[2]) |
| | | this.$set(this.form, 'recordZone', recordParts[1]) |
| | | |
| | | this.$set(this.form, 'recordYear', recordParts[2]) |
| | | this.$set(this.form, 'recordSeq', recordParts[3]) |
| | | } |
| | | this.open = true |
| | | this.title = "修改档案记录" |
| | | }) |
| | | }, |
| | | /** 批量提交 */ |
| | | handleBatchSubmit() { |
| | | // alert(this.ids) |
| | | if (this.ids.length === 0) { |
| | | this.$modal.msgWarning('请选择要提交的档案记录') |
| | | return |
| | | } |
| | | const myValidIds = this.recordsList |
| | | .filter(item => item.ownData === true) |
| | | .map(item => item.id); |
| | | // 检查选中的ID是否全部属于自己 |
| | | const invalidIds = this.ids.filter(id => !myValidIds.includes(id)); |
| | | |
| | | if (invalidIds.length > 0) { |
| | | this.$message.error(`包含无权操作的ID: ${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 || '批量提交失败') |
| | | } |
| | | }) |
| | | }, |
| | | /** 修改按钮操作 */ |
| | |
| | | if(this.recordTypeOptions.length > 0) { |
| | | const recordParts = response.data.recordId.split('-') |
| | | this.$set(this.form, 'recordType', recordParts[0]) |
| | | this.$set(this.form, 'recordYear', recordParts[1]) |
| | | this.$set(this.form, 'recordSeq', recordParts[2]) |
| | | this.$set(this.form, 'recordZone', recordParts[1]) |
| | | |
| | | this.$set(this.form, 'recordYear', recordParts[2]) |
| | | this.$set(this.form, 'recordSeq', recordParts[3]) |
| | | } |
| | | this.open_check = true |
| | | this.title = "查看档案记录" |
| | |
| | | this.getList() |
| | | }) |
| | | } 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.getList() |
| | | this.getId() |
| | | this.getList()} |
| | | |
| | | |
| | | }) |
| | | } |