| | |
| | | <el-date-picker |
| | | style="width: 270px" |
| | | size="small" |
| | | v-model="queryParams[timeRange]" |
| | | v-model="timeRange" |
| | | type="daterange" |
| | | range-separator="-" |
| | | value-format="yyyy-MM-dd" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | @change="handleQuery" |
| | |
| | | <!-- 动态列 --> |
| | | <el-table-column |
| | | v-for="item in columns" |
| | | :key="item.id" |
| | | v-if="item.visible" |
| | | :prop="item.id" |
| | | :label="item.label" |
| | |
| | | <template v-if="item.slotName"> |
| | | <!-- projectStatus插槽 --> |
| | | <template v-if="item.slotName === 'projectStatus'"> |
| | | <div class="mx-1">{{ '自定义样式' }}</div> |
| | | <dict-tag :options="dict.type.sys_project_status" :value="scope.row.projectStatus"/> |
| | | </template> |
| | | <!-- projectColorCode插槽 --> |
| | | <template v-if="item.slotName === 'projectColorCode'"> |
| | | <div class="mx-1 has-dot">{{ '自定义样式' }}<span class="dot" style="margin-left: 5px"></span></div> |
| | | <dict-tag :options="dict.type.sys_project_code" :value="scope.row.projectColorCode"/> |
| | | </template> |
| | | <!-- projectType插槽 --> |
| | | <template v-if="item.slotName === 'projectType'"> |
| | | <div class="mx-1">{{ '自定义样式' }}</div> |
| | | <dict-tag :options="dict.type.sys_project_type" :value="scope.row.projectType"/> |
| | | </template> |
| | | <!-- investType插槽 --> |
| | | <template v-if="item.slotName === 'investType'"> |
| | | <div class="mx-1">{{ '自定义样式' }}</div> |
| | | <dict-tag :options="dict.type.sys_investment_type" :value="scope.row.investType"/> |
| | | </template> |
| | | <!-- planStartTime插槽 --> |
| | | <!-- planStartTime --> |
| | | <template v-if="item.slotName === 'planStartTime'"> |
| | | {{ '自定义样式' }} |
| | | {{ scope.row.planStartTime ? scope.row.planStartTime.split('-')[0] + '年' : '' }} |
| | | </template> |
| | | </template> |
| | | <!-- 默认显示 --> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {listInfo, getInfo, delInfo, addInfo, updateInfo} from "@/api/projectInfo"; |
| | | import {listProject, getProject, delProject, addProject, updateProject} from "@/api/projectEngineering/projectInfo"; |
| | | import {current, currentRest} from '@/views/projectEngineering/projectLibrary/list'; |
| | | import FileDialog from '@/views/projectEngineering/component/FileDialog'; |
| | | |
| | | import FileDialog from '@/views/projectEngineering/projectLibrary/component/FileDialog'; |
| | | import Cookies from "js-cookie"; |
| | | export default { |
| | | dicts: ['sys_administrative_divisions', 'sys_investment_type', 'sys_project_phases', |
| | | 'sys_funding_type', 'sys_association_status', 'sys_project_status', 'sys_project_code', |
| | | 'sys_project_tags', 'sys_key_categories', 'sys_project_type'], |
| | | name: "projectInfo", |
| | | name: "ProjectInfo", |
| | | components: { |
| | | FileDialog |
| | | }, |
| | |
| | | pageSize: 10, |
| | | projectName: null, |
| | | projectCode: null, |
| | | projectStartTime: null, |
| | | projectEndTime: null, |
| | | }, |
| | | moreQueryParams: { |
| | | projectType: '', // 项目类型 |
| | |
| | | this.defaultColumns = JSON.parse(JSON.stringify(columns)); |
| | | this.getList(); |
| | | }, |
| | | beforeDestroy() { |
| | | this.removeStore(); |
| | | }, |
| | | methods: { |
| | | /** 修改按钮操作 */ |
| | | handleUpdate(row) { |
| | | this.removeStore(); |
| | | this.$router.push({ path: '/projectEngineering/project/ProjectDetails', query: { projectId: row.id }}); |
| | | }, |
| | | handleDetail(row) { |
| | | this.removeStore(); |
| | | this.$router.push({ path: '/projectEngineering/project/ProjectDetails', query: { projectId: row.id }}); |
| | | }, |
| | | // 新增页面 |
| | | add() { |
| | | this.$router.push({ path: '/projectEngineering/project/projectDetails' }); |
| | | this.removeStore(); |
| | | this.$router.push({ path: '/projectEngineering/project/ProjectDetails' }); |
| | | }, |
| | | //清理缓存 |
| | | removeStore() { |
| | | localStorage.removeItem("projectForm") |
| | | localStorage.removeItem("investmentForm") |
| | | localStorage.removeItem("investmentFundsForm") |
| | | localStorage.removeItem("legalPersonForm") |
| | | localStorage.removeItem("policyInfoForm") |
| | | localStorage.removeItem("documentsInfoForm") |
| | | }, |
| | | // 重置排序的方法 |
| | | handleResetSort() { |
| | |
| | | /** 查询项目管理基础信息列表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listInfo(this.queryParams).then(response => { |
| | | this.queryParams.projectCategory = this.$route.query.projectCategory; |
| | | if(this.timeRange){ |
| | | this.queryParams.projectStartTime = this.timeRange[0] |
| | | this.queryParams.projectEndTime = this.timeRange[1] |
| | | } |
| | | listProject(this.queryParams).then(response => { |
| | | this.projectInfoList = response.data; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | this.loading = false; |
| | | }, |
| | | // 取消按钮 |
| | | cancel() { |
| | |
| | | this.single = selection.length !== 1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | /** 新增按钮操作 */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.open = true; |
| | | this.title = "添加项目管理基础信息"; |
| | | }, |
| | | /** 修改按钮操作 */ |
| | | handleUpdate(row) { |
| | | this.reset(); |
| | | const id = row.id || this.ids |
| | | getInfo(id).then(response => { |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.title = "修改项目管理基础信息"; |
| | | }); |
| | | }, |
| | | /** 提交按钮 */ |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | if (this.form.id != null) { |
| | | updateInfo(this.form).then(response => { |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addInfo(this.form).then(response => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | |
| | | /** 删除按钮操作 */ |
| | | handleDelete(row) { |
| | | const ids = row.id || this.ids; |