| | |
| | | @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" |
| | |
| | | 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> |
| | | |
| | |
| | | @click="handleCheck(scope.row)" |
| | | >查看</el-button> |
| | | <el-button |
| | | v-if="userId!==1" |
| | | v-if="userId!==1&&scope.row.ownData" |
| | | |
| | | size="mini" |
| | | type="text" |
| | |
| | | /> |
| | | </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-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="输入档案序号" |
| | | /> |
| | | </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="everyProjectName"> |
| | |
| | | |
| | | <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 { 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() { |
| | |
| | | { 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.userId = this.$store.state.user.id; |
| | | |
| | | // 获取用户角色 |
| | | this.getId() |
| | | // this.getId() |
| | | this.getRecordTypes() |
| | | 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 listPlaceName() |
| | | console.log(response) |
| | | // alert(134) |
| | | const response = await listAllPlaceName() |
| | | console.log("1111111333333",response.data) |
| | | this.zoneTypeOptions = response.data.data.map(item => ({ |
| | | value: item.nnumber, |
| | | label: item.name |
| | |
| | | }, |
| | | async fetchProjectOptions() { |
| | | try { |
| | | const response = await listName() |
| | | console.log(response) |
| | | const response = await listAllProjectName() |
| | | console.log("1111111",response) |
| | | this.projectOptions = response.data.data.map(item => ({ |
| | | value: item.name, |
| | | label: item.name |
| | |
| | | /** 生成档案号 */ |
| | | 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, |
| | |
| | | /** 新增按钮操作 */ |
| | | handleAdd() { |
| | | this.reset() |
| | | this.form.recordSeq = this.maxId |
| | | // this.form.recordSeq = this.maxId |
| | | this.open = true |
| | | this.vis = false; |
| | | this.title = "添加档案记录" |
| | |
| | | // |
| | | handleSubmit(row) |
| | | { |
| | | alert(row.id) |
| | | // alert(row.id) |
| | | var id = row.id |
| | | updateStatusById(id).then(response=>{ |
| | | this.$modal.msgSuccess("提交成功") |
| | |
| | | } |
| | | 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 || '批量提交失败') |
| | | } |
| | | }) |
| | | }, |
| | | /** 修改按钮操作 */ |
| | |
| | | }) |
| | | } 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()} |
| | | |
| | | |
| | | }) |
| | |
| | | } |
| | | } |
| | | </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> |