From cae62ab1f60bc87a5c573eb4635426cdfa07fc7b Mon Sep 17 00:00:00 2001 From: luohairen <3399054449@qq.com> Date: 星期五, 29 十一月 2024 07:49:58 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/projectEngineering/projectLibrary/component/investmentFunds.vue | 71 +- src/views/projectEngineering/projectLibrary/index.vue | 105 ++- src/views/projectEngineering/projectLibrary/component/legalPerson.vue | 102 ++- src/views/projectEngineering/projectLibrary/component/FileDialog.vue | 29 + src/views/projectEngineering/abnormalProject/components/FileDialog.vue | 204 +++++++ src/views/projectEngineering/projectLibrary/component/DocumentsInfo.vue | 32 src/views/projectEngineering/projectLibrary/component/PolicyInfo.vue | 60 +- src/views/projectEngineering/projectLibrary/component/BasicInfo.vue | 97 ++- src/views/projectEngineering/projectLibrary/component/InvestInfo.vue | 69 +- src/views/projectEngineering/abnormalProject/index.vue | 570 +++++++++++++++++++++ src/views/projectEngineering/projectLibrary/projectDetails.vue | 12 src/views/projectEngineering/abnormalProject/list.js | 176 ++++++ src/views/projectProcess/index.vue | 2 13 files changed, 1,275 insertions(+), 254 deletions(-) diff --git a/src/views/projectEngineering/abnormalProject/components/FileDialog.vue b/src/views/projectEngineering/abnormalProject/components/FileDialog.vue new file mode 100644 index 0000000..357d39e --- /dev/null +++ b/src/views/projectEngineering/abnormalProject/components/FileDialog.vue @@ -0,0 +1,204 @@ + +<template> + <div> + <el-dialog + :visible.sync="fileDialogVisible" + ref="formDialogRef" + width="35%" + append-to-body + close-on-click-modal + @close="closeDialog" + > + <template slot="title"> + <span style="padding-bottom: 18px"> + {{ isImportOrExport ? '璇锋寜鐓ч渶姹傚鍑虹洰鏍囧唴瀹�' : '璇锋寜鐓фā鏉挎牱寮忎笂浼犻」鐩枃浠�' }} + </span> + </template> + <template slot="default"> + <div v-if="!isImportOrExport" class="dialog-content"> + <el-upload + ref="uploadRef" + class="upload-demo" + :action="uploadUrl" + :limit="1" + :accept="accept" + :headers="uploadHeaders" + :disabled="uploadIsUploading" + :on-progress="handleFileUploadProgress" + :on-success="handleFileSuccess" + :auto-upload="false" + drag + > + <i class="el-icon-upload"></i> + <div class="el-upload__text">璇蜂笂浼�<em>Zip</em>鏂囦欢锛屽ぇ灏忓湪<em>100M</em>浠ュ唴</div> + </el-upload> + <span>浠呭厑璁稿鍏ip鏍煎紡鏂囦欢銆�</span> + <el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="handleDownloadFile">涓嬭浇妯℃澘</el-link> + </div> + <div v-else-if="isImportOrExport" class="dialog-content"> + <el-button class="export-button" @click="handleDownloadTargetList">瀵煎嚭鐩爣鍒楄〃鍐呭</el-button> + <el-button class="export-button">瀵煎嚭鎵�鏈夊垪琛ㄥ唴瀹�</el-button> + <el-button class="export-button">瀵煎嚭鐩爣椤圭洰璇︽儏</el-button> + <el-button class="export-button">瀵煎嚭鎵�鏈夐」鐩鎯�</el-button> + </div> + </template> + <template slot="footer"> + <div v-if="!isImportOrExport" class="dialog-footer"> + <el-button type="primary" @click="submitFileForm">纭� 瀹�</el-button> + <el-button @click="closeDialog">鍙� 娑�</el-button> + </div> + <div v-else-if="isImportOrExport"></div> + </template> + </el-dialog> + </div> +</template> + +<script> +import { globalHeaders } from '@/utils/request'; +import {getToken} from "@/utils/auth"; + +export default { + name: 'FileDialog', + props: { + isImportOrExport: { + type: Boolean, + default: false + }, + fileDialogVisible: { + type: Boolean, + default: false + }, + currentColumns: { + type: Array, + default: function () { + return []; + } + } + }, + data() { + return { + uploadRef: null, + targetColumn: [], + accept: `.zip`, + uploadUrl: '/project/import', + uploadHeaders: {}, + uploadIsUploading: false + }; + }, + methods: { + submit() { + console.log("瀛愮粍浠秙ubmit") + }, + handleFileUploadProgress() { + this.uploadIsUploading = true; + }, + handleFileSuccess(response, file) { + this.uploadIsUploading = false; + if (this.uploadRef) { + this.uploadRef.handleRemove(file); + } + if (response.code === 200) { + this.$emit('fileDialogCancel'); + this.$message({ + message: response.msg, + type: 'success' + }); + } else { + this.$message.error(response.msg); + } + }, + handleDownloadFile() { + // fetch(`${process.env.VITE_APP_BASE_API}/project/info/export/template`, { + // method: 'GET', + // headers: self.upload.headers + // }) + // .then(response => response.blob()) + // .then(blob => { + // const url = window.URL.createObjectURL(blob); + // const a = document.createElement('a'); + // a.style.display = 'none'; + // a.href = url; + // a.download = `椤圭洰鏂囦欢妯℃澘_${new Date().getTime()}.zip`; + // document.body.appendChild(a); + // a.click(); + // window.URL.revokeObjectURL(url); + // }) + // .catch(error => { + // console.error('鏂囦欢涓嬭浇澶辫触:', error); + // }); + + const url = process.env.VUE_APP_BASE_API + '/project/info/export/template'; + axios.post(url, [], { // 鍙戦�佷竴涓┖鏁扮粍鑰屼笉鏄┖瀵硅薄 + responseType: 'blob', // 鍛婅瘔axios鏈熸湜鏈嶅姟鍣ㄨ繑鍥炵殑鏄痓lob绫诲瀷 + headers: { + 'Content-Type': 'application/json', + Authorization: "Bearer " + getToken() + } + }) + .then(response => { + // 澶勭悊鏂囦欢涓嬭浇 + const blob = new Blob([response.data], { type: 'application/zip' }); // 鎸囧畾MIME绫诲瀷涓簔ip + const url = window.URL.createObjectURL(blob); + const a = document.createElement('a'); + a.style.display = 'none'; + a.href = url; + a.download = `椤圭洰鏂囦欢妯℃澘_${new Date().getTime()}.zip`; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + window.URL.revokeObjectURL(url); + }) + .catch(error => { + console.error('There was an error!', error); + }); + }, + submitFileForm() { + if (this.uploadRef) { + this.uploadRef.submit(); + } + }, + closeDialog() { + this.$emit('fileDialogCancel'); + }, + handleDownloadTargetList() { + console.log('瀵煎嚭鐩爣鍒楄〃鍐呭', this.currentColumns); + this.targetColumn = this.currentColumns.filter(item => item.visible); + } + }, + mounted() { + this.uploadRef = this.$refs.uploadRef; + }, + created() { + + this.isFileDialogVisible = this.fileDialogVisible; + } +}; +</script> + +<style scoped lang="scss"> +.dialog-content { + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + height: 300px; + + .export-button { + margin-left: 0; + margin-bottom: 10px; + } +} +.dialog-footer { + display: flex; + justify-content: center; +} +.upload-demo { + width: 100%; +} +::v-deep .el-upload{ + width: 100%; +} +::v-deep .el-upload .el-upload-dragger{ + width: 100%; +} +</style> diff --git a/src/views/projectEngineering/abnormalProject/index.vue b/src/views/projectEngineering/abnormalProject/index.vue new file mode 100644 index 0000000..3e8245b --- /dev/null +++ b/src/views/projectEngineering/abnormalProject/index.vue @@ -0,0 +1,570 @@ +<template> + <div class="app-container"> + <el-form :model="queryParams" ref="queryParamsRef" size="small" :inline="true" v-show="showSearch" + label-width="68px"> + <div class="slot"> + <div class="left-section"> + <el-form-item label="椤圭洰鍚嶇О" prop="projectName"> + <el-input + style="width: 190px;margin-right: 20px" + size="small" + v-model="queryParams.projectName" + placeholder="璇疯緭鍏ラ」鐩悕绉�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="椤圭洰浠g爜" prop="projectCode"> + <el-input + style="width: 190px;margin-right: 20px" + size="small" + v-model="queryParams.projectCode" + placeholder="璇疯緭鍏ラ」鐩唬鐮�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + + <el-form-item label="椤圭洰骞撮檺" prop="timeRange"> + <el-date-picker + style="width: 270px" + size="small" + v-model="timeRange" + type="daterange" + range-separator="-" + value-format="yyyy-MM-dd HH:mm:ss" + start-placeholder="寮�濮嬫棩鏈�" + end-placeholder="缁撴潫鏃ユ湡" + @change="handleQuery" + clearable + > + </el-date-picker> + </el-form-item> + <el-form-item> + <el-button icon="el-icon-search" size="small" @click="handleQuery">鏌ヨ</el-button> + <el-button icon="el-icon-refresh" size="small" @click="resetQuery">閲嶇疆</el-button> + </el-form-item> + <el-popover :value="popoverValue" trigger="click" :width="700" placement="bottom"> + <span>绛涢�夋潯浠�</span> + <el-form ref="moreQueryParamsRef" label-width="68px" label-position="right" :model="queryParams"> + <el-row> + <el-col :span="12"> + <el-form-item label="椤圭洰绫诲瀷"> + <el-select v-model="queryParams.projectType" clearable placeholder="璇烽�夋嫨" class="select-option" + @change="handleQuery" + size="small"> + <el-option v-for="item in dict.type.sys_project_type" :key="item.value" :label="item.label" + :value="item.value"/> + </el-select> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="閲嶇偣鍒嗙被"> + <el-select v-model="queryParams.importanceType" clearable placeholder="璇烽�夋嫨" class="select-option" + @change="handleQuery"> + <el-option v-for="item in dict.type.sys_key_categories" :key="item.value" :label="item.label" + :value="item.value"/> + </el-select> + </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="12"> + <el-form-item label="椤圭洰鏍囩"> + <el-select v-model="queryParams.tag" clearable placeholder="璇烽�夋嫨" class="select-option" + @change="handleQuery"> + <el-option v-for="item in dict.type.sys_project_tags" :key="item.value" :label="item.label" + :value="item.value"/> + </el-select> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="椤圭洰鐘舵��"> + <el-select v-model="queryParams.projectStatus" :disabled="isProjectCategory" clearable + @change="handleQuery" + placeholder="璇烽�夋嫨" class="select-option"> + <el-option v-for="item in dict.type.sys_project_status" :key="item.value" :label="item.label" + :value="item.value"/> + </el-select> + </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="12"> + <el-form-item label="椤圭洰鐮�"> + <el-select v-model="queryParams.projectColorCode" clearable placeholder="璇烽�夋嫨" class="select-option" + @change="handleQuery"> + <el-option v-for="item in dict.type.sys_project_code" :key="item.value" :label="item.label" + :value="item.value"/> + </el-select> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鍏宠仈鐘舵��"> + <el-select v-model="queryParams.assignmentStatus" clearable placeholder="璇烽�夋嫨" class="select-option" + @change="handleQuery"> + <el-option v-for="item in dict.type.sys_association_status" :key="item.value" :label="item.label" + :value="item.value"/> + </el-select> + </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="12"> + <el-form-item label="璧勯噾绫诲瀷"> + <el-select v-model="queryParams.investmentType" clearable placeholder="璇烽�夋嫨" class="select-option" + @change="handleQuery"> + <el-option v-for="item in dict.type.sys_funding_type" :key="item.value" :label="item.label" + :value="item.value"/> + </el-select> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="椤圭洰闃舵"> + <el-select v-model="queryParams.projectPhase" clearable placeholder="璇烽�夋嫨" class="select-option" + @change="handleQuery"> + <el-option v-for="item in dict.type.sys_project_phases" :key="item.value" :label="item.label" + :value="item.value"/> + </el-select> + </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="12"> + <el-form-item label="鎶曡祫绫诲埆"> + <el-select v-model="queryParams.investType" clearable placeholder="璇烽�夋嫨" class="select-option" + @change="handleQuery"> + <el-option v-for="item in dict.type.sys_investment_type" :key="item.value" :label="item.label" + :value="item.value"/> + </el-select> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="琛屾斂鍖哄垝"> + <el-select v-model="queryParams.area" clearable placeholder="璇烽�夋嫨" class="select-option" + @change="handleQuery"> + <el-option v-for="item in dict.type.sys_administrative_divisions" :key="item.value" + :label="item.label" + :value="item.value"/> + </el-select> + </el-form-item> + </el-col> + </el-row> + </el-form> + <el-button style="margin-right: 16px; margin-top: 1px; color: #3369ff" slot="reference" + size="small"> + 鏇村绛涙煡鏉′欢 + <span style="margin-left: 5px"> + <el-icon v-if="!popoverValue" class="el-icon-arrow-down"></el-icon> + <el-icon v-else-if="popoverValue" class="el-icon-arrow-up"></el-icon> + </span> + </el-button> + </el-popover> + </div> + <div class="right-section"> + + <VisibilityToolbar + v-model:showSearch="showSearch" + :columns="defaultColumns" + @queryTable="handleQuery" + @update:sort="handleUpdateSort" + @update:columns="handleUpdateColumns" + @update:resetSort="handleResetSort" + ></VisibilityToolbar> + </div> + </div> + </el-form> + + <el-table + :key="tableKey" + ref="elTable" + style="margin-top: 20px" + v-loading="loading" + :data="projectInfoList" + @selection-change="handleSelectionChange" + height="60vh" + sortable="custom" + :show-overflow-tooltip="true"> + <el-table-column type="selection" width="55" align="center"/> + <!-- 鍔ㄦ�佸垪 --> + <el-table-column + v-for="item in columns" + v-if="item.visible" + :prop="item.id" + :label="item.label" + :min-width="item.minWidth" + > + <template slot-scope="scope"> + <!-- 浣跨敤鍏峰悕鎻掓Ы --> + <template v-if="item.slotName"> + <!-- projectStatus鎻掓Ы --> + <template v-if="item.slotName === 'projectStatus'"> + <dict-tag :options="dict.type.sys_project_status" :value="scope.row.projectStatus"/> + </template> + <!-- projectColorCode鎻掓Ы --> + <template v-if="item.slotName === 'projectColorCode'"> + <dict-tag :options="dict.type.sys_project_code" :value="scope.row.projectColorCode"/> + </template> + <!-- projectType鎻掓Ы --> + <template v-if="item.slotName === 'projectType'"> + <dict-tag :options="dict.type.sys_project_type" :value="scope.row.projectType"/> + </template> + <!-- investType鎻掓Ы --> + <template v-if="item.slotName === 'investType'"> + <dict-tag :options="dict.type.sys_investment_type" :value="scope.row.investType"/> + </template> + <!-- planStartTime --> + <template v-if="item.slotName === 'planStartTime'"> + {{ scope.row.planStartTime ? scope.row.planStartTime.split('-')[0] + '骞�' : '' }} + </template> + </template> + <!-- 榛樿鏄剧ず --> + <span v-else>{{ scope.row[item.id] }}</span> + </template> + </el-table-column> + + <!-- 鎿嶄綔鍒� --> + <el-table-column label="鎿嶄綔" width="140" align="center"> + <template slot-scope="scope"> + <el-button + size="medium" + type="text" + icon="el-icon-view" + @click="handleDetail(scope.row)" + > + </el-button> + <el-button + v-if="isReserve" + size="medium" + type="text" + icon="el-icon-edit" + @click="handleUpdate(scope.row)" + > + </el-button> + <el-button + v-if="isReserve" + size="medium" + type="text" + icon="el-icon-delete" + @click="handleDelete(scope.row)" + > + </el-button> + </template> + </el-table-column> + </el-table> + + <pagination + v-show="total>0" + :total="total" + :page.sync="queryParams.pageNum" + :limit.sync="queryParams.pageSize" + @pagination="getList" + /> + + <FileDialog + :fileDialogVisible.sync="fileDialogVisible" + :isImportOrExport="isImportOrExport" + @fileDialogCancel="fileDialogCancel" + :currentColumns="columns" + /> + </div> +</template> + +<script> +import {listProject, getProject, delProject, addProject, updateProject} from "@/api/projectEngineering/projectInfo"; +import {current, currentRest} from '@/views/projectEngineering/projectLibrary/list'; +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: "AbnormalProject", + components: { + FileDialog + }, + data() { + return { + isImportOrExport: false, + fileDialogVisible: false, + //鏄惁闇�瑕佹柊澧炴寜閽�(鍌ㄨ搫椤圭洰闇�瑕�) + isReserve: false, + //椤圭洰鐘舵�佺瓫閫夋潯浠� + isProjectCategory: false, + //琛ㄥご + columns: [], + defaultColumns: [], + //鎺у埗鏇村绛涢�夋樉闅� + popoverValue: false, + // 閬僵灞� + loading: true, + // 閫変腑鏁扮粍 + ids: [], + // 闈炲崟涓鐢� + single: true, + // 闈炲涓鐢� + multiple: true, + // 鏄剧ず鎼滅储鏉′欢 + showSearch: true, + // 鎬绘潯鏁� + total: 0, + // 椤圭洰绠$悊鍩虹淇℃伅琛ㄦ牸鏁版嵁 + projectInfoList: [], + // 寮瑰嚭灞傛爣棰� + title: "", + // 鏄惁鏄剧ず寮瑰嚭灞� + tableKey: 0, + open: false, + timeRange: [], + // 鏌ヨ鍙傛暟 + queryParams: { + pageNum: 1, + pageSize: 10, + projectCategory: '5', + projectName: null, + projectCode: null, + projectStartTime: null, + projectEndTime: null, + }, + moreQueryParams: { + projectType: '', // 椤圭洰绫诲瀷 + importanceType: '', // 閲嶇偣鍒嗙被 + projectStatus: '', // 椤圭洰鐘舵�� + projectColorCode: '', // 椤圭洰鐮� + investmentType: '', // 璧勯噾绫诲瀷 + projectPhase: '', // 椤圭洰闃舵 + investType: '', // 鎶曡祫绫诲埆 + area: '', // 琛屾斂鍖哄垝 + assignmentStatus: '', //鍏宠仈鐘舵�� + tag: '' //椤圭洰鏍囩 + }, + // 琛ㄥ崟鍙傛暟 + form: {}, + // 琛ㄥ崟鏍¢獙 + rules: { + projectName: [ + {required: true, message: "椤圭洰鍚嶇О涓嶈兘涓虹┖", trigger: "blur"} + ], + projectStatus: [ + {required: true, message: "椤圭洰鐘舵�佷笉鑳戒负绌�", trigger: "change"} + ], + } + }; + }, + created() { + const columns = current.map((item, index) => { + item.index = index + 1; + item.key = index; + item.serialNumber = index + 1; + return item; + }); + this.columns = columns; + 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.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() { + this.defaultColumns = currentRest.map((item, index) => { + item.index = index + 1; + item.key = index; + item.serialNumber = index + 1 + return item; + }); + this.columns = currentRest.map((item, index) => { + item.index = index + 1; + item.key = index; + item.serialNumber = index + 1 + return item; + }); + //寮哄埗table娓叉煋 + this.tableKey = this.tableKey + 1; + }, + // 鏇存柊鍒楃殑鏂规硶 + handleUpdateColumns(row) { + // this.currentColumns = row; + this.columns = this.columns.map(item => { + if (item.key === row.key) { + return row; + } + return item; + }); + }, + handleUpdateSort(row) { + console.log(this.columns, '鎺掑簭鍓嶇殑鍒�'); + this.columns = this.columns.map(item => { + if (item.key === row.key) { + return row; + } + return item; + }); + this.defaultColumns = JSON.parse(JSON.stringify(this.columns)).sort((a, b) => a.index - b.index); + this.columns.sort((a, b) => a.serialNumber - b.serialNumber); + //寮哄埗table娓叉煋 + this.tableKey = this.tableKey + 1; + console.log(this.columns, '鎺掑簭鍚庣殑鍒�'); + }, + // 鍏抽棴鏂囦欢澶勭悊寮规鐨勬柟娉� + fileDialogCancel() { + this.tableLoading = true; + this.fileDialogVisible = false; + // this.getList(); + this.tableLoading = false; + }, + handlePopover() { + this.popoverValue = true; + }, + closePopover() { + this.popoverValue = false; + }, + /** 鏌ヨ椤圭洰绠$悊鍩虹淇℃伅鍒楄〃 */ + getList() { + this.loading = true; + this.queryParams.projectCategory = '5'; + 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; + }); + }, + // 鍙栨秷鎸夐挳 + cancel() { + this.open = false; + this.reset(); + }, + // 琛ㄥ崟閲嶇疆 + reset() { + this.form = { + id: null, + projectName: null, + projectCode: null, + content: null, + projectType: null, + projectStatus: null, + fundType: null, + investType: null, + projectPhase: null, + tag: null, + competentDepartment: null, + areaCode: null, + managementCentralization: null, + projectApprovalType: null, + investmentCatalogue: null, + importanceType: null, + year: null, + yearInvestAmount: null, + createProjectTime: null, + planStartTime: null, + planCompleteTime: null, + winUnit: null, + winAmount: null, + winTime: null, + projectAddress: null, + longitude: null, + latitude: null, + projectOwnerUnit: null, + projectContactPerson: null, + contact: null, + gmtCreateTime: null, + gmtUpdateTime: null, + updateBy: null, + createBy: null, + deleted: null + }; + this.resetForm("form"); + }, + /** 鎼滅储鎸夐挳鎿嶄綔 */ + handleQuery() { + this.queryParams.pageNum = 1; + this.getList(); + }, + /** 閲嶇疆鎸夐挳鎿嶄綔 */ + resetQuery() { + this.resetForm("queryForm"); + this.handleQuery(); + }, + // 澶氶�夋閫変腑鏁版嵁 + handleSelectionChange(selection) { + this.ids = selection.map(item => item.id) + this.single = selection.length !== 1 + this.multiple = !selection.length + }, + + /** 鍒犻櫎鎸夐挳鎿嶄綔 */ + handleDelete(row) { + const ids = row.id || this.ids; + this.$modal.confirm('鏄惁纭鍒犻櫎椤圭洰绠$悊鍩虹淇℃伅缂栧彿涓�"' + ids + '"鐨勬暟鎹」锛�').then(function () { + return delInfo(ids); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }).catch(() => { + }); + }, + /** 瀵煎叆鎸夐挳鎿嶄綔 */ + handleImport() { + this.isImportOrExport = false; + this.fileDialogVisible = true; + }, + /** 瀵煎嚭鎸夐挳鎿嶄綔 */ + handleExport() { + this.isImportOrExport = true; + this.fileDialogVisible = true; + } + } +}; +</script> +<style lang="scss" scoped> +.select-option { + width: 100%; +} + +.slot { + display: flex; +} + +.left-section { + flex-grow: 1; +} + +.right-section { + display: flex; + margin-left: auto; + + .add-btn { + margin: 0 10px; + } +} + +</style> diff --git a/src/views/projectEngineering/abnormalProject/list.js b/src/views/projectEngineering/abnormalProject/list.js new file mode 100644 index 0000000..d187287 --- /dev/null +++ b/src/views/projectEngineering/abnormalProject/list.js @@ -0,0 +1,176 @@ +export const current = [ + {id: 'projectName', label: '椤圭洰鍚嶇О', visible: true}, + {id: 'projectOwnerUnit', label: '涓氫富鍗曚綅', visible: true}, + {id: 'projectColorCode', label: '椤圭洰鐮�', slotName: 'projectColorCode', visible: true}, + {id: 'projectCode', label: '椤圭洰浠g爜', visible: true}, + {id: 'projectType', label: '椤圭洰绫诲瀷', slotName: 'projectType', visible: true}, + {id: 'projectPhase', label: '椤圭洰闃舵', visible: true}, + {id: 'totalInvestment', label: '鎬绘姇璧勯', visible: true}, + {id: 'yearInvestAmount', label: '鏈勾璁″垝鎶曡祫', visible: true}, + {id: 'planStartTime', label: '椤圭洰骞翠唤', slotName: 'planStartTime', visible: true}, + {id: 'projectStatus', label: '椤圭洰鐘舵��', slotName: 'projectStatus', visible: true}, + {id: 'investType', label: '鎶曡祫绫诲埆', slotName: 'investType', visible: true}, + {id: 'content', label: '寤鸿鍐呭', visible: false}, + {id: 'fundType', label: '璧勯噾绫诲瀷', visible: false}, + {id: 'projectContactPerson', label: '椤圭洰鑱旂郴浜�', visible: false}, + {id: 'contact', label: '鑱旂郴鏂瑰紡', visible: false}, + {id: 'engineeringIdList', label: '鍏宠仈宸ョ▼', visible: false}, + {id: 'competentDepartmentList', label: '涓荤閮ㄩ棬', visible: false}, + {id: 'area', label: '琛屾斂鍖哄垝', visible: false}, + {id: 'managementCentralizationList', label: '绠$悊褰掑彛', visible: false}, + {id: 'projectApprovalType', label: '椤圭洰瀹℃壒绫诲瀷', visible: false}, + {id: 'importanceType', label: '閲嶇偣鍒嗙被', visible: false}, + {id: 'setTime', label: '绔嬮」鏃堕棿', visible: false}, + {id: 'planCompleteTime', label: '璁″垝绔e伐鏃堕棿', visible: false}, + {id: 'winUnit', label: '涓爣鍗曚綅', visible: false}, + {id: 'winAmount', label: '涓爣閲戦', visible: false}, + {id: 'winTime', label: '涓爣鏃堕棿', visible: false}, + {id: 'year', label: '骞村害鎶曡祫璁″垝', visible: false}, + {id: 'address', label: '椤圭洰鍦板潃', visible: false}, + {id: 'projectBudget', label: '椤圭洰棰勭畻', visible: false}, + {id: 'beCrossRegion', label: '寤鸿鍦扮偣鏄惁璺ㄥ煙', visible: false}, + {id: 'constructionLocation', label: '椤圭洰寤鸿鍦扮偣', visible: false}, + {id: 'detailedAddress', label: '寤鸿璇︾粏鍦板潃', visible: false}, + {id: 'beCompensationProject', label: '鏄惁鏄ˉ鐮侀」鐩�', visible: false}, + {id: 'compensationReason', label: '琛ョ爜鍘熷洜', visible: false}, + {id: 'plannedStartDate', label: '璁″垝寮�宸ユ椂闂�', visible: false}, + {id: 'expectedCompletionDate', label: '鎷熷缓鎴愭椂闂�', visible: false}, + {id: 'nationalIndustryClassification', label: '鍥介檯琛屼笟鍒嗙被', visible: false}, + {id: 'industryClassification', label: '鎵�灞炶涓氬垎绫�', visible: false}, + {id: 'projectNature', label: '椤圭洰寤烘垚鎬ц川', visible: false}, + {id: 'projectAttribute', label: '椤圭洰灞炴��', visible: false}, + {id: 'useEarth', label: '鏄惁浣跨敤鍦熷湴', visible: false}, + {id: 'contentScale', label: '涓昏寤鸿鍐呭鍙婅妯�', visible: false}, + {id: 'code', label: '寤虹骞冲彴浠g爜', visible: false}, + {id: 'projectUnit', label: '椤圭洰鍗曚綅', visible: false}, + {id: 'projectUnitType', label: '椤圭洰鍗曚綅绫诲瀷', visible: false}, + {id: 'registrationType', label: '鐧昏娉ㄥ唽绫诲瀷', visible: false}, + {id: 'holdingSituation', label: '鎺ц偂鎯呭喌', visible: false}, + {id: 'certificateType', label: '璇佺収绫诲瀷', visible: false}, + {id: 'certificateNumber', label: '璇佷欢鍙风爜', visible: false}, + {id: 'registeredAddress', label: '娉ㄥ唽鍦板潃', visible: false}, + {id: 'registeredCapital', label: '娉ㄥ唽璧勯噾', visible: false}, + {id: 'legal_representative', label: '娉曚汉浠h〃', visible: false}, + {id: 'fixedPhone', label: '鍥哄畾鐢佃瘽', visible: false}, + {id: 'legalPersonIdcard', label: '娉曚汉韬唤璇佸彿', visible: false}, + {id: 'projectContactPerson', label: '椤圭洰鑱旂郴浜�', visible: false}, + {id: 'phone', label: '绉诲姩鐢佃瘽', visible: false}, + {id: 'contactIdcard', label: '鑱旂郴浜鸿韩浠借瘉鍙�', visible: false}, + {id: 'wechat', label: '寰俊鍙�', visible: false}, + {id: 'contactAddress', label: '鑱旂郴浜洪�氳鍦板潃', visible: false}, + {id: 'postCode', label: '閭斂缂栫爜', visible: false}, + {id: 'email', label: '鐢靛瓙閭', visible: false}, + {id: 'totalInvestment', label: '椤圭洰鎬绘姇璧勯', visible: false}, + {id: 'principal', label: '椤圭洰鏈噾', visible: false}, + {id: 'governmentInvestmentTotal', label: '鏀垮簻鎶曡祫', visible: false}, + {id: 'centralInvestmentTotal', label: '涓ぎ鎶曡祫', visible: false}, + {id: 'centralBudgetInvestment', label: '涓ぎ棰勭畻鎶曡祫', visible: false}, + {id: 'centralFiscalInvestment', label: '涓ぎ璐㈡斂', visible: false}, + {id: 'centralSpecialBondInvestment', label: '涓ぎ涓撻」鍊哄埜绛归泦鐨勪笓椤瑰缓璁捐祫閲�', visible: false}, + {id: 'centralSpecialFundInvestment', label: '涓ぎ涓撻」寤鸿鍩洪噾', visible: false}, + {id: 'provincialInvestmentTotal', label: '鐪佺骇鎶曡祫', visible: false}, + {id: 'provincialBudgetInvestment', label: '鐪侀绠楀唴鎶曡祫', visible: false}, + {id: 'provincialFiscalInvestment', label: '鐪佽储鏀挎�у缓璁炬姇璧�', visible: false}, + {id: 'provincialSpecialFundInvestment', label: '鐪佷笓椤瑰缓璁捐祫閲�', visible: false}, + {id: 'cityInvestmentTotal', label: '甯�(宸�)鎶曡祫', visible: false}, + {id: 'cityBudgetInvestment', label: '甯�(宸�)棰勭畻鍐呮姇璧�', visible: false}, + {id: 'cityFiscalInvestment', label: '甯�(宸�)璐㈡斂鎬ф姇璧�', visible: false}, + {id: 'citySpecialFundInvestment', label: '甯�(宸�)涓撻」璧勯噾', visible: false}, + {id: 'countyInvestmentTotal', label: '鍘�(甯傘�佸尯)鎶曡祫', visible: false}, + {id: 'countyBudgetInvestment', label: '鍖�(鍘�)棰勭畻鍐呮姇璧�', visible: false}, + {id: 'countyFiscalInvestment', label: '鍖猴紙鍘匡級璐㈡斂鎬у缓璁捐祫閲�', visible: false}, + {id: 'countySpecialFundInvestment', label: '鍖�(鍘�)涓撻」璧勯噾', visible: false}, + {id: 'domesticLoanTotal', label: '鍥藉唴璐锋', visible: false}, + {id: 'bankLoan', label: '閾惰璐锋', visible: false}, + {id: 'foreignInvestmentTotal', label: '澶栧晢鎶曡祫', visible: false}, + {id: 'enterpriseSelfRaisedTotal', label: '浼佷笟鑷', visible: false}, + {id: 'otherInvestmentTotal', label: '鍏朵粬鎶曡祫', visible: false} +]; +export const currentRest = [ + { id: 'projectName', label: '椤圭洰鍚嶇О', visible: true }, + { id: 'projectOwnerUnit', label: '涓氫富鍗曚綅', visible: true }, + { id: 'projectColorCode', label: '椤圭洰鐮�', slotName: 'projectColorCode', visible: true }, + { id: 'projectCode', label: '椤圭洰浠g爜', visible: true }, + { id: 'projectType', label: '椤圭洰绫诲瀷', slotName: 'projectType', visible: true }, + { id: 'projectPhase', label: '椤圭洰闃舵', visible: true }, + { id: 'totalInvestment', label: '鎬绘姇璧勯', visible: true }, + { id: 'yearInvestAmount', label: '鏈勾璁″垝鎶曡祫', visible: true }, + { id: 'planStartTime', label: '椤圭洰骞翠唤', slotName: 'planStartTime', visible: true }, + { id: 'projectStatus', label: '椤圭洰鐘舵��', slotName: 'projectStatus', visible: true }, + { id: 'investType', label: '鎶曡祫绫诲埆', slotName: 'investType', visible: true }, + { id: 'content', label: '寤鸿鍐呭', visible: false }, + { id: 'fundType', label: '璧勯噾绫诲瀷', visible: false }, + { id: 'projectContactPerson', label: '椤圭洰鑱旂郴浜�', visible: false }, + { id: 'contact', label: '鑱旂郴鏂瑰紡', visible: false }, + { id: 'engineeringIdList', label: '鍏宠仈宸ョ▼', visible: false }, + { id: 'competentDepartmentList', label: '涓荤閮ㄩ棬', visible: false }, + { id: 'area', label: '琛屾斂鍖哄垝', visible: false }, + { id: 'managementCentralizationList', label: '绠$悊褰掑彛', visible: false }, + { id: 'projectApprovalType', label: '椤圭洰瀹℃壒绫诲瀷', visible: false }, + { id: 'importanceType', label: '閲嶇偣鍒嗙被', visible: false }, + { id: 'setTime', label: '绔嬮」鏃堕棿', visible: false }, + { id: 'planCompleteTime', label: '璁″垝绔e伐鏃堕棿', visible: false }, + { id: 'winUnit', label: '涓爣鍗曚綅', visible: false }, + { id: 'winAmount', label: '涓爣閲戦', visible: false }, + { id: 'winTime', label: '涓爣鏃堕棿', visible: false }, + { id: 'year', label: '骞村害鎶曡祫璁″垝', visible: false }, + { id: 'address', label: '椤圭洰鍦板潃', visible: false }, + { id: 'projectBudget', label: '椤圭洰棰勭畻', visible: false }, + { id: 'beCrossRegion', label: '寤鸿鍦扮偣鏄惁璺ㄥ煙', visible: false }, + { id: 'constructionLocation', label: '椤圭洰寤鸿鍦扮偣', visible: false }, + { id: 'detailedAddress', label: '寤鸿璇︾粏鍦板潃', visible: false }, + { id: 'beCompensationProject', label: '鏄惁鏄ˉ鐮侀」鐩�', visible: false }, + { id: 'compensationReason', label: '琛ョ爜鍘熷洜', visible: false }, + { id: 'plannedStartDate', label: '璁″垝寮�宸ユ椂闂�', visible: false }, + { id: 'expectedCompletionDate', label: '鎷熷缓鎴愭椂闂�', visible: false }, + { id: 'nationalIndustryClassification', label: '鍥介檯琛屼笟鍒嗙被', visible: false }, + { id: 'industryClassification', label: '鎵�灞炶涓氬垎绫�', visible: false }, + { id: 'projectNature', label: '椤圭洰寤烘垚鎬ц川', visible: false }, + { id: 'projectAttribute', label: '椤圭洰灞炴��', visible: false }, + { id: 'useEarth', label: '鏄惁浣跨敤鍦熷湴', visible: false }, + { id: 'contentScale', label: '涓昏寤鸿鍐呭鍙婅妯�', visible: false }, + { id: 'code', label: '寤虹骞冲彴浠g爜', visible: false }, + { id: 'projectUnit', label: '椤圭洰鍗曚綅', visible: false }, + { id: 'projectUnitType', label: '椤圭洰鍗曚綅绫诲瀷', visible: false }, + { id: 'registrationType', label: '鐧昏娉ㄥ唽绫诲瀷', visible: false }, + { id: 'holdingSituation', label: '鎺ц偂鎯呭喌', visible: false }, + { id: 'certificateType', label: '璇佺収绫诲瀷', visible: false }, + { id: 'certificateNumber', label: '璇佷欢鍙风爜', visible: false }, + { id: 'registeredAddress', label: '娉ㄥ唽鍦板潃', visible: false }, + { id: 'registeredCapital', label: '娉ㄥ唽璧勯噾', visible: false }, + { id: 'legal_representative', label: '娉曚汉浠h〃', visible: false }, + { id: 'fixedPhone', label: '鍥哄畾鐢佃瘽', visible: false }, + { id: 'legalPersonIdcard', label: '娉曚汉韬唤璇佸彿', visible: false }, + { id: 'projectContactPerson', label: '椤圭洰鑱旂郴浜�', visible: false }, + { id: 'phone', label: '绉诲姩鐢佃瘽', visible: false }, + { id: 'contactIdcard', label: '鑱旂郴浜鸿韩浠借瘉鍙�', visible: false }, + { id: 'wechat', label: '寰俊鍙�', visible: false }, + { id: 'contactAddress', label: '鑱旂郴浜洪�氳鍦板潃', visible: false }, + { id: 'postCode', label: '閭斂缂栫爜', visible: false }, + { id: 'email', label: '鐢靛瓙閭', visible: false }, + { id: 'totalInvestment', label: '椤圭洰鎬绘姇璧勯', visible: false }, + { id: 'principal', label: '椤圭洰鏈噾', visible: false }, + { id: 'governmentInvestmentTotal', label: '鏀垮簻鎶曡祫', visible: false }, + { id: 'centralInvestmentTotal', label: '涓ぎ鎶曡祫', visible: false }, + { id: 'centralBudgetInvestment', label: '涓ぎ棰勭畻鎶曡祫', visible: false }, + { id: 'centralFiscalInvestment', label: '涓ぎ璐㈡斂', visible: false }, + { id: 'centralSpecialBondInvestment', label: '涓ぎ涓撻」鍊哄埜绛归泦鐨勪笓椤瑰缓璁捐祫閲�', visible: false }, + { id: 'centralSpecialFundInvestment', label: '涓ぎ涓撻」寤鸿鍩洪噾', visible: false }, + { id: 'provincialInvestmentTotal', label: '鐪佺骇鎶曡祫', visible: false }, + { id: 'provincialBudgetInvestment', label: '鐪侀绠楀唴鎶曡祫', visible: false }, + { id: 'provincialFiscalInvestment', label: '鐪佽储鏀挎�у缓璁炬姇璧�', visible: false }, + { id: 'provincialSpecialFundInvestment', label: '鐪佷笓椤瑰缓璁捐祫閲�', visible: false }, + { id: 'cityInvestmentTotal', label: '甯�(宸�)鎶曡祫', visible: false }, + { id: 'cityBudgetInvestment', label: '甯�(宸�)棰勭畻鍐呮姇璧�', visible: false }, + { id: 'cityFiscalInvestment', label: '甯�(宸�)璐㈡斂鎬ф姇璧�', visible: false }, + { id: 'citySpecialFundInvestment', label: '甯�(宸�)涓撻」璧勯噾', visible: false }, + { id: 'countyInvestmentTotal', label: '鍘�(甯傘�佸尯)鎶曡祫', visible: false }, + { id: 'countyBudgetInvestment', label: '鍖�(鍘�)棰勭畻鍐呮姇璧�', visible: false }, + { id: 'countyFiscalInvestment', label: '鍖猴紙鍘匡級璐㈡斂鎬у缓璁捐祫閲�', visible: false }, + { id: 'countySpecialFundInvestment', label: '鍖�(鍘�)涓撻」璧勯噾', visible: false }, + { id: 'domesticLoanTotal', label: '鍥藉唴璐锋', visible: false }, + { id: 'bankLoan', label: '閾惰璐锋', visible: false }, + { id: 'foreignInvestmentTotal', label: '澶栧晢鎶曡祫', visible: false }, + { id: 'enterpriseSelfRaisedTotal', label: '浼佷笟鑷', visible: false }, + { id: 'otherInvestmentTotal', label: '鍏朵粬鎶曡祫', visible: false } +]; diff --git a/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue b/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue index 1319e34..cd47875 100644 --- a/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue +++ b/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue @@ -107,7 +107,7 @@ placeholder="璇烽�夋嫨" style="width: 100%" collapse-tags - @change="changeDepartment"> + > <el-option v-for="item in approvalList" :key="item.id" @@ -139,7 +139,6 @@ placeholder="璇烽�夋嫨" style="width: 100%" collapse-tags - @change="changePutUnder" > <el-option v-for="item in dict.type.sys_centralized_management" :key="item.value" :label="item.label" :value="item.value"/> @@ -316,7 +315,11 @@ disabled: { type: Boolean, default: false - } + }, + isShow: { + type: Boolean, + required: true, + }, }, data() { return { @@ -360,8 +363,10 @@ year: '', yearInvestAmount: '', competentDepartmentList: [], - managementCentralizationList: [] + managementCentralizationList: [], }, + subclass: '', + largeCategory: '', approvalList: [], setTime: '', planStartTime: '', @@ -373,8 +378,6 @@ hasMore: true, selectOptions: [], accept: ['pdf', 'docx', 'xlsx', 'jpg', 'jpeg'], - largeCategory: '', - subclass: '', mapCreateInfo: {}, demoFormRef: null, rules: { @@ -392,28 +395,32 @@ }, mounted() { this.projectForm.id = this.$route.query.projectId; - const projectForm = Cookies.get("projectForm"); + const projectForm = localStorage.getItem("projectForm"); + //鍒濆鍖栦富绠¢儴闂ㄤ笅鎷夋 + this.getApprovalList(); if (projectForm) { this.projectForm = JSON.parse(projectForm); + this.$emit('updateIsShow', true); } else { - //鍒濆鍖栦富绠¢儴闂ㄤ笅鎷夋 - this.getApprovalList(); + this.projectForm.id = this.$route.query.projectId; // 鍦ㄧ粍浠跺垱寤烘椂鑾峰彇椤圭洰淇℃伅锛屽鏋� projectId 瀛樺湪 if (this.projectForm.id) { this.getProjectInfo(this.projectForm.id); } else { this.getProjectCodeApi(); + this.$emit('updateIsShow', true); } // this.handleLoadMore(1); } }, beforeDestroy() { - Cookies.set("projectForm", JSON.stringify(this.projectForm)); + localStorage.setItem("projectForm", JSON.stringify(this.projectForm)); }, methods: { getProjectInfo(id) { getProject(id).then(res => { this.projectForm = res.data; + this.$emit('updateIsShow', true); }); }, getApprovalList() { @@ -424,7 +431,7 @@ submit() { this.$refs["projectForm"].validate(valid => { if (valid) { - if (this.projectForm.id != null) { + if (this.projectForm.id) { updateProject(this.projectForm).then(response => { this.$modal.msgSuccess("淇敼鎴愬姛"); //璺宠浆鍒颁笅涓粍浠� @@ -446,22 +453,23 @@ this.projectForm.projectCode = res.data; }); }, - changeDepartment(val) { - if (!val.length) { - this.largeCategory = ''; - return; - } - const labels = this.approvalList.filter(item => val.includes(item.id)).map(item => item.value); - this.largeCategory = labels.join(','); - }, - changePutUnder(val) { - if (!val.length) { - this.subclass = ''; - return; - } - const labels = this.dict.type.sys_centralized_management.filter(item => val.includes(item.value)).map(item => item.label); - this.subclass = labels.join(','); - }, + // changeDepartment(val) { + // console.log("瑙﹀彂浜嬩欢" + val + this.approvalList) + // if (!val.length) { + // this.largeCategory = ''; + // return; + // } + // const labels = this.approvalList.filter(item => val.includes(item.id)).map(item => item.value); + // this.largeCategory = labels.join(','); + // }, + // changePutUnder(val) { + // if (!val.length) { + // this.subclass = ''; + // return; + // } + // const labels = this.dict.type.sys_centralized_management.filter(item => val.includes(item.value)).map(item => item.label); + // this.subclass = labels.join(','); + // }, async loadDataList(newPage) { try { this.loading = true; @@ -506,22 +514,25 @@ }, watch: { - 'projectForm.managementCentralizationList'(val) { - if (val) { - const labels = this.dict.type.sys_centralized_management - .filter(item => val.includes(item.value)) - .map(item => item.label); - this.subclass = labels.join(','); - } - }, - 'projectForm.competentDepartmentList'(val) { - if (val) { - const labels = this.approvalList - .filter(item => val.includes(item.id)) - .map(item => item.value); - this.largeCategory = labels.join(','); - } - }, + 'projectForm': { + handler(newVal, oldVal) { + setTimeout(() => { + if (newVal.managementCentralizationList) { + const labels = this.dict.type.sys_centralized_management + .filter(item => newVal.managementCentralizationList.includes(item.value)) + .map(item => item.label); + this.subclass = labels.join(','); + } + if (newVal.competentDepartmentList) { + const labels = this.approvalList + .filter(item => newVal.competentDepartmentList.includes(item.id)) + .map(item => item.value); + this.largeCategory = labels.join(','); + } + }, 1000); + }, + deep: true + } } }; </script> diff --git a/src/views/projectEngineering/projectLibrary/component/DocumentsInfo.vue b/src/views/projectEngineering/projectLibrary/component/DocumentsInfo.vue index de37951..43b95c1 100644 --- a/src/views/projectEngineering/projectLibrary/component/DocumentsInfo.vue +++ b/src/views/projectEngineering/projectLibrary/component/DocumentsInfo.vue @@ -5,10 +5,10 @@ <el-col :span="20"> <el-form-item label="闄勪欢:" label-width="100px" prop="appendix" style="width: 100%"> <div style="display: flex;gap: 10px"> - <file-upload v-model="documentsInfoForm.fileList" + <file-upload v-model="fileList" :fileType="accept" :isShowTip="false"/> - <div v-if="documentsInfoForm.fileList.length === 0" style="color: #a9afbc">鏀寔涓婁紶PDF鏍煎紡鏂囦欢</div> + <div v-if="fileList.length === 0" style="color: #a9afbc">鏀寔涓婁紶PDF鏍煎紡鏂囦欢</div> </div> </el-form-item> </el-col> @@ -19,12 +19,6 @@ <script> -import { - addProjectInvestmentFunding, - editProjectInvestmentFunding, - getProjectInvestmentFundingById -} from "@/api/projectEngineering/projectInvestmentFunding"; -import Cookies from "js-cookie"; import {addDocumentInfo, getDocumentInfoById} from "@/api/projectEngineering/projectInfo"; export default { @@ -38,20 +32,19 @@ data() { return { documentsInfoForm: { - fileList: [], - projectId: '' + // fileList: [], + // projectId: '' }, + fileList: [], projectForm: {}, accept: ['pdf'], }; }, methods: { getDocumentsInfo() { - getDocumentInfoById(this.documentsInfoForm.projectId).then(res => { + getDocumentInfoById(this.$route.query.projectId).then(res => { this.documentsInfoForm = res.data; - if(!this.documentsInfoForm.fileList) { - this.documentsInfoForm.fileList = [] - } + this.fileList = this.documentsInfoForm.fileList }); }, submit() { @@ -59,6 +52,7 @@ this.$message.error("璇峰厛淇濆瓨鎶曡祫绠$悊鍩烘湰淇℃伅") } else { this.documentsInfoForm.projectId = this.projectForm.id; + this.documentsInfoForm.fileList = this.fileList addDocumentInfo(this.documentsInfoForm).then(response => { this.$modal.msgSuccess("鎻愪氦鎴愬姛"); }); @@ -66,25 +60,25 @@ }, }, mounted() { - this.documentsInfoForm.projectId = this.$route.query.projectId; - const documentsInfoForm = Cookies.get("documentsInfoForm"); - const projectForm = Cookies.get("projectForm"); + const documentsInfoForm = localStorage.getItem("documentsInfoForm"); + const projectForm = localStorage.getItem("projectForm"); const parsedDocumentsInfoForm = documentsInfoForm ? JSON.parse(documentsInfoForm) : null; const parsedProjectForm = projectForm ? JSON.parse(projectForm) : null; if (parsedDocumentsInfoForm) { this.documentsInfoForm = parsedDocumentsInfoForm + if(this.documentsInfoForm.fileList) this.fileList = this.documentsInfoForm.fileList } if (parsedProjectForm) { this.projectForm = parsedProjectForm } // 濡傛灉璺敱瀛樺湪id涓旀病鏈夌紦瀛�,瑙嗕负缂栬緫鎴栨煡鐪嬶紝璋冪敤api - if (this.documentsInfoForm.projectId && !parsedDocumentsInfoForm) { + if (this.$route.query.projectId && !parsedDocumentsInfoForm) { this.getDocumentsInfo(); } }, beforeDestroy() { - Cookies.set("documentsInfoForm", JSON.stringify(this.documentsInfoForm)); + if(Object.keys(this.documentsInfoForm).length !==0) localStorage.setItem("documentsInfoForm", JSON.stringify(this.documentsInfoForm)); }, }; diff --git a/src/views/projectEngineering/projectLibrary/component/FileDialog.vue b/src/views/projectEngineering/projectLibrary/component/FileDialog.vue index 15b09ec..357d39e 100644 --- a/src/views/projectEngineering/projectLibrary/component/FileDialog.vue +++ b/src/views/projectEngineering/projectLibrary/component/FileDialog.vue @@ -55,6 +55,7 @@ <script> import { globalHeaders } from '@/utils/request'; +import {getToken} from "@/utils/auth"; export default { name: 'FileDialog', @@ -107,8 +108,7 @@ } }, handleDownloadFile() { - const self = this; - // fetch(`${process.env.VITE_APP_BASE_API}/project/export/template`, { + // fetch(`${process.env.VITE_APP_BASE_API}/project/info/export/template`, { // method: 'GET', // headers: self.upload.headers // }) @@ -126,6 +126,31 @@ // .catch(error => { // console.error('鏂囦欢涓嬭浇澶辫触:', error); // }); + + const url = process.env.VUE_APP_BASE_API + '/project/info/export/template'; + axios.post(url, [], { // 鍙戦�佷竴涓┖鏁扮粍鑰屼笉鏄┖瀵硅薄 + responseType: 'blob', // 鍛婅瘔axios鏈熸湜鏈嶅姟鍣ㄨ繑鍥炵殑鏄痓lob绫诲瀷 + headers: { + 'Content-Type': 'application/json', + Authorization: "Bearer " + getToken() + } + }) + .then(response => { + // 澶勭悊鏂囦欢涓嬭浇 + const blob = new Blob([response.data], { type: 'application/zip' }); // 鎸囧畾MIME绫诲瀷涓簔ip + const url = window.URL.createObjectURL(blob); + const a = document.createElement('a'); + a.style.display = 'none'; + a.href = url; + a.download = `椤圭洰鏂囦欢妯℃澘_${new Date().getTime()}.zip`; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + window.URL.revokeObjectURL(url); + }) + .catch(error => { + console.error('There was an error!', error); + }); }, submitFileForm() { if (this.uploadRef) { diff --git a/src/views/projectEngineering/projectLibrary/component/InvestInfo.vue b/src/views/projectEngineering/projectLibrary/component/InvestInfo.vue index beda437..d1f5d7f 100644 --- a/src/views/projectEngineering/projectLibrary/component/InvestInfo.vue +++ b/src/views/projectEngineering/projectLibrary/component/InvestInfo.vue @@ -164,7 +164,6 @@ </template> <script> -import Cookies from "js-cookie"; import { addProjectInvestmentInfo, editProjectInvestmentInfo, @@ -179,28 +178,28 @@ type: Boolean, default: false, required: true - } + }, }, data() { return { projectForm: {}, investmentForm: { - id: '', - beCrossRegion: '', - constructionLocation: '', - detailedAddress: '', - beCompensationProject: '', - compensationReason: '', - plannedStartDate: '', - expectedCompletionDate: '', - nationalIndustryClassification: '', - industryClassification: '', - projectNature: '', - projectAttribute: '', - useEarth: '', - contentScale: '', - code: '', - projectId: '', + // id: '', + // beCrossRegion: '', + // constructionLocation: '', + // detailedAddress: '', + // beCompensationProject: '', + // compensationReason: '', + // plannedStartDate: '', + // expectedCompletionDate: '', + // nationalIndustryClassification: '', + // industryClassification: '', + // projectNature: '', + // projectAttribute: '', + // useEarth: '', + // contentScale: '', + // code: '', + // projectId: '', }, plannedStartDate: '', expectedCompletionDate: '', @@ -213,15 +212,14 @@ }; }, mounted() { - this.investmentForm.projectId = this.$route.query.projectId // 浠嶤ookies涓幏鍙栫紦瀛樻暟鎹� - const investmentForm = Cookies.get("investmentForm"); - const projectForm = Cookies.get("projectForm"); + const investmentForm = localStorage.getItem("investmentForm"); + const projectForm = localStorage.getItem("projectForm"); // 灏濊瘯瑙f瀽JSON鏁版嵁 const parsedInvestmentForm = investmentForm ? JSON.parse(investmentForm) : null; const parsedProjectForm = projectForm ? JSON.parse(projectForm) : null; - + console.log(parsedInvestmentForm) // 璁剧疆investment鍜宲rojectForm瀵硅薄 if(parsedInvestmentForm) { this.investmentForm = parsedInvestmentForm; @@ -230,25 +228,28 @@ this.projectForm = parsedProjectForm; } // 濡傛灉璺敱瀛樺湪id涓旀病鏈夌紦瀛橈紝瑙嗕负缂栬緫鎴栨煡鐪嬶紝璋冪敤api - if (this.investmentForm.projectId && !investmentForm) { + if (this.$route.query.projectId && !investmentForm) { this.getInvestment(); + }else { + this.investmentForm.constructionLocation = this.projectForm.area; + this.investmentForm.detailedAddress = this.projectForm.projectAddress; + this.investmentForm.plannedStartDate = this.projectForm.planStartTime; + this.investmentForm.expectedCompletionDate = this.projectForm.planCompleteTime; } - this.investmentForm.constructionLocation = this.projectForm.area; - this.investmentForm.detailedAddress = this.projectForm.projectAddress; - this.investmentForm.plannedStartDate = this.projectForm.planStartTime; - this.investmentForm.expectedCompletionDate = this.projectForm.planCompleteTime; }, beforeDestroy() { - Cookies.set("investmentForm", JSON.stringify(this.investmentForm)); + if(Object.keys(this.investmentForm).length !==0) localStorage.setItem("investmentForm", JSON.stringify(this.investmentForm)); }, methods: { getInvestment() { - getProjectInvestmentInfoById(this.investmentForm.projectId ).then(res => { + getProjectInvestmentInfoById(this.$route.query.projectId).then(res => { this.investmentForm = res.data; - this.investmentForm.constructionLocation = this.projectForm.area; - this.investmentForm.detailedAddress = this.projectForm.projectAddress; - this.investmentForm.plannedStartDate = this.projectForm.planStartTime; - this.investmentForm.expectedCompletionDate = this.projectForm.planCompleteTime; + this.$nextTick(() => { + this.investmentForm.constructionLocation = this.projectForm.area; + this.investmentForm.detailedAddress = this.projectForm.projectAddress; + this.investmentForm.plannedStartDate = this.projectForm.planStartTime; + this.investmentForm.expectedCompletionDate = this.projectForm.planCompleteTime; + }) }); }, submit() { @@ -256,7 +257,7 @@ this.$message.error("璇峰厛淇濆瓨鎶曡祫绠$悊鍩烘湰淇℃伅") } else { this.investmentForm.projectId = this.projectForm.id; - if (this.investmentForm.id != null) { + if (this.investmentForm.id) { editProjectInvestmentInfo(this.investmentForm).then(response => { this.$modal.msgSuccess("淇敼鎴愬姛"); //璺宠浆鍒颁笅涓粍浠� diff --git a/src/views/projectEngineering/projectLibrary/component/PolicyInfo.vue b/src/views/projectEngineering/projectLibrary/component/PolicyInfo.vue index 815c2dc..344a6c5 100644 --- a/src/views/projectEngineering/projectLibrary/component/PolicyInfo.vue +++ b/src/views/projectEngineering/projectLibrary/component/PolicyInfo.vue @@ -10,10 +10,10 @@ <el-col :span="20"> <el-form-item label="绗﹀悎琛屼笟鏀跨瓥:" label-width="180px" prop="industryPolicy" style="width: 100%"> <div style="display: flex"> - <file-upload v-model="policyInfoForm.fileList" + <file-upload v-model="fileList" :fileType="accept" :isShowTip="false"/> - <div v-if="policyInfoForm.fileList.length === 0" style="color: #a9afbc; margin-left: 10px"> + <div v-if="fileList.length === 0" style="color: #a9afbc; margin-left: 10px"> 鏀寔涓婁紶PDF鏍煎紡鏂囦欢 </div> </div> @@ -159,7 +159,6 @@ <script> -import Cookies from "js-cookie"; import { addProjectInvestmentPolicyCompliance, editProjectInvestmentPolicyCompliance, @@ -173,25 +172,26 @@ type: Boolean, default: false, required: true - } + }, }, data() { return { policyInfoForm: { - id: '', - projectId: '', - fileList: [], - belongsToIndustryAdjustmentDirectory: null, - belongsToWesternEncouragedDirectory: null, - notBannedOrControlledProject: true, - informationIsTrue: true, - specialPlanningCompliance: '', - energyCheck: null, - annualEnergyConsumption: '', - annualElectricityConsumption: '', - noOnlyCheckType: null, - remarks: '' + // id: '', + // projectId: '', + // fileList: [], + // belongsToIndustryAdjustmentDirectory: null, + // belongsToWesternEncouragedDirectory: null, + // notBannedOrControlledProject: true, + // informationIsTrue: true, + // specialPlanningCompliance: '', + // energyCheck: null, + // annualEnergyConsumption: '', + // annualElectricityConsumption: '', + // noOnlyCheckType: null, + // remarks: '' }, + fileList: [], accept: ['pdf'], rules: { industrialPolicyProhibition: [{required: true, message: '璇烽�夋嫨', trigger: 'change'}], @@ -200,35 +200,36 @@ }; }, mounted() { - this.policyInfoForm.projectId = this.$route.query.projectId; - const policyInfoForm = Cookies.get("policyInfoForm"); - const projectForm = Cookies.get("projectForm"); + const policyInfoForm = localStorage.getItem("policyInfoForm"); + const projectForm = localStorage.getItem("projectForm"); const parsedPolicyInfoForm = policyInfoForm ? JSON.parse(policyInfoForm) : null; const parsedProjectForm = projectForm ? JSON.parse(projectForm) : null; if (parsedPolicyInfoForm) { this.policyInfoForm = parsedPolicyInfoForm + if(this.policyInfoForm.fileList) this.fileList = this.policyInfoForm.fileList } if (parsedProjectForm) { this.projectForm = parsedProjectForm } // 濡傛灉璺敱瀛樺湪id涓旀病鏈夌紦瀛�,瑙嗕负缂栬緫鎴栨煡鐪嬶紝璋冪敤api - if (this.policyInfoForm.projectId && !parsedPolicyInfoForm) { + if (this.$route.query.projectId && !parsedPolicyInfoForm) { this.getProjectInvestmentPolicyCompliance(); + } else { + this.policyInfoForm.informationIsTrue= true; + this.policyInfoForm.notBannedOrControlledProject = true; } }, beforeDestroy() { - Cookies.set("policyInfoForm", JSON.stringify(this.policyInfoForm)); + if(Object.keys(this.policyInfoForm).length !==0) localStorage.setItem("policyInfoForm", JSON.stringify(this.policyInfoForm)); }, methods: { getProjectInvestmentPolicyCompliance() { - getProjectInvestmentPolicyComplianceById(this.policyInfoForm.projectId).then(res => { + getProjectInvestmentPolicyComplianceById(this.$route.query.projectId).then(res => { this.policyInfoForm = res.data; - if(!this.policyInfoForm.fileList) { - this.policyInfoForm.fileList = [] - } - this.policyInfoForm.notBannedOrControlledProject =true - this.policyInfoForm.informationIsTrue =true + this.policyInfoForm.notBannedOrControlledProject = true + this.policyInfoForm.informationIsTrue = true + this.fileList =this.policyInfoForm.fileList }); }, submit() { @@ -238,7 +239,8 @@ this.$refs["policyInfoFormRef"].validate(valid => { if (valid) { this.policyInfoForm.projectId = this.projectForm.id; - if (this.policyInfoForm.id != null) { + this.policyInfoForm.fileList = this.fileList + if (this.policyInfoForm.id) { editProjectInvestmentPolicyCompliance(this.policyInfoForm).then(response => { this.$modal.msgSuccess("淇敼鎴愬姛"); //璺宠浆鍒颁笅涓粍浠� diff --git a/src/views/projectEngineering/projectLibrary/component/investmentFunds.vue b/src/views/projectEngineering/projectLibrary/component/investmentFunds.vue index 6149bb8..7f6ee41 100644 --- a/src/views/projectEngineering/projectLibrary/component/investmentFunds.vue +++ b/src/views/projectEngineering/projectLibrary/component/investmentFunds.vue @@ -205,45 +205,45 @@ type: Boolean, default: false, required: true - } + }, }, data() { return { projectForm: {}, investmentFundsForm: { - id: '', - projectId: '', - totalInvestment: '', - principal: '', - governmentInvestmentTotal: '', - centralInvestmentTotal: '', - centralBudgetInvestment: '', - centralFiscalInvestment: '', - centralSpecialBondInvestment: '', - centralSpecialFundInvestment: '', - provincialInvestmentTotal: '', - provincialBudgetInvestment: '', - provincialFiscalInvestment: '', - provincialSpecialFundInvestment: '', - cityInvestmentTotal: '', - cityBudgetInvestment: '', - cityFiscalInvestment: '', - citySpecialFundInvestment: '', - countyInvestmentTotal: '', - countyBudgetInvestment: '', - countyFiscalInvestment: '', - countySpecialFundInvestment: '', - domesticLoanTotal: '', - bankLoan: '', - foreignInvestmentTotal: '', - enterpriseSelfRaisedTotal: '', - otherInvestmentTotal: '' + // id: '', + // projectId: '', + // totalInvestment: '', + // principal: '', + // governmentInvestmentTotal: '', + // centralInvestmentTotal: '', + // centralBudgetInvestment: '', + // centralFiscalInvestment: '', + // centralSpecialBondInvestment: '', + // centralSpecialFundInvestment: '', + // provincialInvestmentTotal: '', + // provincialBudgetInvestment: '', + // provincialFiscalInvestment: '', + // provincialSpecialFundInvestment: '', + // cityInvestmentTotal: '', + // cityBudgetInvestment: '', + // cityFiscalInvestment: '', + // citySpecialFundInvestment: '', + // countyInvestmentTotal: '', + // countyBudgetInvestment: '', + // countyFiscalInvestment: '', + // countySpecialFundInvestment: '', + // domesticLoanTotal: '', + // bankLoan: '', + // foreignInvestmentTotal: '', + // enterpriseSelfRaisedTotal: '', + // otherInvestmentTotal: '' } }; }, methods: { getInvestmentFunds() { - getProjectInvestmentFundingById(this.investmentFundsForm.projectId ).then(res => { + getProjectInvestmentFundingById(this.$route.query.projectId).then(res => { this.investmentFundsForm = res.data; }); }, @@ -252,7 +252,7 @@ this.$message.error("璇峰厛淇濆瓨鎶曡祫绠$悊鍩烘湰淇℃伅") } else { this.investmentFundsForm.projectId = this.projectForm.id; - if (this.investmentFundsForm.id != null) { + if (this.investmentFundsForm.id) { editProjectInvestmentFunding(this.investmentFundsForm).then(response => { this.$modal.msgSuccess("淇敼鎴愬姛"); //璺宠浆鍒颁笅涓粍浠� @@ -270,25 +270,24 @@ }, }, mounted() { - this.investmentFundsForm.projectId = this.$route.query.projectId; - const investmentFundsForm = Cookies.get("investmentFundsForm"); - const projectForm = Cookies.get("projectForm"); + const investmentFundsForm = localStorage.getItem("investmentFundsForm"); + const projectForm = localStorage.getItem("projectForm"); const parsedInvestmentFundsForm = investmentFundsForm ? JSON.parse(investmentFundsForm) : null; const parsedProjectForm = projectForm ? JSON.parse(projectForm) : null; if (parsedInvestmentFundsForm) { this.investmentFundsForm = parsedInvestmentFundsForm } - if (parsedProjectForm){ + if (parsedProjectForm) { this.projectForm = parsedProjectForm } // 濡傛灉璺敱瀛樺湪id涓旀病鏈夌紦瀛�,瑙嗕负缂栬緫鎴栨煡鐪嬶紝璋冪敤api - if (this.investmentFundsForm.projectId && !parsedInvestmentFundsForm) { + if (this.$route.query.projectId&& !parsedInvestmentFundsForm) { this.getInvestmentFunds(); } }, beforeDestroy() { - Cookies.set("investmentFundsForm", JSON.stringify(this.investmentFundsForm)); + if(Object.keys(this.investmentFundsForm).length !==0) localStorage.setItem("investmentFundsForm", JSON.stringify(this.investmentFundsForm)); }, } </script> diff --git a/src/views/projectEngineering/projectLibrary/component/legalPerson.vue b/src/views/projectEngineering/projectLibrary/component/legalPerson.vue index 219626f..b2ffd25 100644 --- a/src/views/projectEngineering/projectLibrary/component/legalPerson.vue +++ b/src/views/projectEngineering/projectLibrary/component/legalPerson.vue @@ -4,12 +4,13 @@ <el-row :gutter="20"> <el-col :span="6"> <el-form-item label="椤圭洰鎬绘姇棰�" label-width="120px" prop="investmentType" style="width: 100%"> - <el-input v-model="legalPersonForm.totalInvestment" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" /> + <el-input v-model="legalPersonForm.totalInvestment" class="item" clearable maxlength="255" + placeholder="璇疯緭鍏�"/> </el-form-item> </el-col> <el-col :span="6"> <el-form-item label="椤圭洰鍗曚綅" label-width="120px" prop="investmentType" style="width: 100%"> - <el-input v-model="legalPersonForm.projectUnit" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" /> + <el-input v-model="legalPersonForm.projectUnit" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�"/> </el-form-item> </el-col> <el-col :span="6"> @@ -70,75 +71,84 @@ <el-row :gutter="20"> <el-col :span="6"> <el-form-item label="璇佷欢鍙风爜" label-width="120px" prop="investmentType" style="width: 100%"> - <el-input v-model.trim="legalPersonForm.certificateNumber" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" /> + <el-input v-model.trim="legalPersonForm.certificateNumber" class="item" clearable maxlength="255" + placeholder="璇疯緭鍏�"/> </el-form-item> </el-col> <el-col :span="6"> <el-form-item label="娉ㄥ唽鍦板潃" label-width="120px" prop="investmentType" style="width: 100%"> - <el-input v-model.trim="legalPersonForm.registeredAddress" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" /> + <el-input v-model.trim="legalPersonForm.registeredAddress" class="item" clearable maxlength="255" + placeholder="璇疯緭鍏�"/> </el-form-item> </el-col> <el-col :span="6"> <el-form-item label="娉ㄥ唽璧勯噾" label-width="120px" prop="projectType" style="width: 100%"> - <el-input v-model.trim="legalPersonForm.registeredCapital" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" /> + <el-input v-model.trim="legalPersonForm.registeredCapital" class="item" clearable maxlength="255" + placeholder="璇疯緭鍏�"/> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="6"> <el-form-item label="娉曚汉浠h〃" label-width="120px" prop="investmentType" style="width: 100%"> - <el-input v-model.trim="legalPersonForm.legalRepresentative" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" /> + <el-input v-model.trim="legalPersonForm.legalRepresentative" class="item" clearable maxlength="255" + placeholder="璇疯緭鍏�"/> </el-form-item> </el-col> <el-col :span="6"> <el-form-item label="鍥哄畾鐢佃瘽" label-width="120px" prop="investmentType" style="width: 100%"> - <el-input v-model.trim="legalPersonForm.fixedPhone" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" /> + <el-input v-model.trim="legalPersonForm.fixedPhone" class="item" clearable maxlength="255" + placeholder="璇疯緭鍏�"/> </el-form-item> </el-col> <el-col :span="6"> <el-form-item label="娉曚汉韬唤璇佸彿" label-width="120px" prop="projectType" style="width: 100%"> - <el-input v-model.trim="legalPersonForm.legalPersonIdcard" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" /> + <el-input v-model.trim="legalPersonForm.legalPersonIdcard" class="item" clearable maxlength="255" + placeholder="璇疯緭鍏�"/> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="6"> <el-form-item label="椤圭洰鑱旂郴浜�" label-width="120px" prop="investmentType" style="width: 100%"> - <el-input v-model.trim="legalPersonForm.projectContactPerson" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" /> + <el-input v-model.trim="legalPersonForm.projectContactPerson" class="item" clearable maxlength="255" + placeholder="璇疯緭鍏�"/> </el-form-item> </el-col> <el-col :span="6"> <el-form-item label="绉诲姩鐢佃瘽" label-width="120px" prop="investmentType" style="width: 100%"> - <el-input v-model.trim="legalPersonForm.phone" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" /> + <el-input v-model.trim="legalPersonForm.phone" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�"/> </el-form-item> </el-col> <el-col :span="6"> <el-form-item label="鑱旂郴浜鸿韩浠借瘉鍙�" label-width="120px" prop="projectType" style="width: 100%"> - <el-input v-model.trim="legalPersonForm.contactIdcard" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" /> + <el-input v-model.trim="legalPersonForm.contactIdcard" class="item" clearable maxlength="255" + placeholder="璇疯緭鍏�"/> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="6"> <el-form-item label="寰俊鍙�" label-width="120px" prop="investmentType" style="width: 100%"> - <el-input v-model.trim="legalPersonForm.wechat" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" /> + <el-input v-model.trim="legalPersonForm.wechat" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�"/> </el-form-item> </el-col> <el-col :span="6"> <el-form-item label="鑱旂郴浜洪�氳鍦板潃" label-width="120px" prop="investmentType" style="width: 100%"> - <el-input v-model.trim="legalPersonForm.contactAddress" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" /> + <el-input v-model.trim="legalPersonForm.contactAddress" class="item" clearable maxlength="255" + placeholder="璇疯緭鍏�"/> </el-form-item> </el-col> <el-col :span="6"> <el-form-item label="閭斂缂栫爜" label-width="120px" prop="projectType" style="width: 100%"> - <el-input v-model.trim="legalPersonForm.postCode" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" /> + <el-input v-model.trim="legalPersonForm.postCode" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�"/> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="6"> <el-form-item label="鐢靛瓙閭" label-width="120px" prop="investmentType" style="width: 100%"> - <el-input v-model="legalPersonForm.email" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" /> + <el-input v-model="legalPersonForm.email" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�"/> </el-form-item> </el-col> </el-row> @@ -156,66 +166,66 @@ } from "@/api/projectEngineering/projectUnitRegistrationInfo"; export default { - dicts: ['sys_unit_type','sys_registration_type','sys_holding_situation','sys_license_type'], + dicts: ['sys_unit_type', 'sys_registration_type', 'sys_holding_situation', 'sys_license_type'], name: 'LegalPersonForm', props: { disabled: { type: Boolean, default: false, required: true - } + }, }, data() { return { legalPersonForm: { - id: '', - totalInvestment: '', - projectUnit: '', - projectUnitType: '', - registrationType: '', - holdingSituation: '', - certificateType: '', - certificateNumber: '', - registeredAddress: '', - registeredCapital: '', - projectId: '', - legalRepresentative: '', - fixedPhone: '', - legalPersonIdcard: '', - projectContactPerson: '', - phone: '', - contactIdcard: '', - wechat: '', - contactAddress: '', - postCode: '', - email: '' + // id: '', + // totalInvestment: '', + // projectUnit: '', + // projectUnitType: '', + // registrationType: '', + // holdingSituation: '', + // certificateType: '', + // certificateNumber: '', + // registeredAddress: '', + // registeredCapital: '', + // projectId: '', + // legalRepresentative: '', + // fixedPhone: '', + // legalPersonIdcard: '', + // projectContactPerson: '', + // phone: '', + // contactIdcard: '', + // wechat: '', + // contactAddress: '', + // postCode: '', + // email: '' }, } }, mounted() { - this.legalPersonForm.projectId = this.$route.query.projectId; - const legalPersonForm = Cookies.get("legalPersonForm"); - const projectForm = Cookies.get("projectForm"); + const legalPersonForm = localStorage.getItem("legalPersonForm"); + const projectForm = localStorage.getItem("projectForm"); const parsedLegalPersonForm = legalPersonForm ? JSON.parse(legalPersonForm) : null; const parsedProjectForm = projectForm ? JSON.parse(projectForm) : null; if (parsedLegalPersonForm) { this.legalPersonForm = parsedLegalPersonForm } - if (parsedProjectForm){ + if (parsedProjectForm) { this.projectForm = parsedProjectForm } // 濡傛灉璺敱瀛樺湪id涓旀病鏈夌紦瀛�,瑙嗕负缂栬緫鎴栨煡鐪嬶紝璋冪敤api - if (this.legalPersonForm.projectId && !parsedLegalPersonForm) { + if (this.$route.query.projectId && !parsedLegalPersonForm) { this.getProjectUnitRegistrationInfo(); } + }, beforeDestroy() { - Cookies.set("legalPersonForm", JSON.stringify(this.legalPersonForm)); + if(Object.keys(this.legalPersonForm).length !==0) localStorage.setItem("legalPersonForm", JSON.stringify(this.legalPersonForm)); }, methods: { getProjectUnitRegistrationInfo() { - getProjectUnitRegistrationInfoById(this.legalPersonForm.projectId ).then(res => { + getProjectUnitRegistrationInfoById(this.$route.query.projectId).then(res => { this.legalPersonForm = res.data; }); }, @@ -224,7 +234,7 @@ this.$message.error("璇峰厛淇濆瓨鎶曡祫绠$悊鍩烘湰淇℃伅") } else { this.legalPersonForm.projectId = this.projectForm.id; - if (this.legalPersonForm.id != null) { + if (this.legalPersonForm.id) { editProjectUnitRegistrationInfo(this.legalPersonForm).then(response => { this.$modal.msgSuccess("淇敼鎴愬姛"); //璺宠浆鍒颁笅涓粍浠� diff --git a/src/views/projectEngineering/projectLibrary/index.vue b/src/views/projectEngineering/projectLibrary/index.vue index f2db159..1a6a439 100644 --- a/src/views/projectEngineering/projectLibrary/index.vue +++ b/src/views/projectEngineering/projectLibrary/index.vue @@ -29,10 +29,10 @@ <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" @@ -50,7 +50,8 @@ <el-row> <el-col :span="12"> <el-form-item label="椤圭洰绫诲瀷"> - <el-select v-model="queryParams.projectType" clearable placeholder="璇烽�夋嫨" class="select-option" @change="handleQuery" + <el-select v-model="queryParams.projectType" clearable placeholder="璇烽�夋嫨" class="select-option" + @change="handleQuery" size="small"> <el-option v-for="item in dict.type.sys_project_type" :key="item.value" :label="item.label" :value="item.value"/> @@ -59,7 +60,8 @@ </el-col> <el-col :span="12"> <el-form-item label="閲嶇偣鍒嗙被"> - <el-select v-model="queryParams.importanceType" clearable placeholder="璇烽�夋嫨" class="select-option" @change="handleQuery"> + <el-select v-model="queryParams.importanceType" clearable placeholder="璇烽�夋嫨" class="select-option" + @change="handleQuery"> <el-option v-for="item in dict.type.sys_key_categories" :key="item.value" :label="item.label" :value="item.value"/> </el-select> @@ -69,7 +71,8 @@ <el-row> <el-col :span="12"> <el-form-item label="椤圭洰鏍囩"> - <el-select v-model="queryParams.tag" clearable placeholder="璇烽�夋嫨" class="select-option" @change="handleQuery"> + <el-select v-model="queryParams.tag" clearable placeholder="璇烽�夋嫨" class="select-option" + @change="handleQuery"> <el-option v-for="item in dict.type.sys_project_tags" :key="item.value" :label="item.label" :value="item.value"/> </el-select> @@ -77,7 +80,8 @@ </el-col> <el-col :span="12"> <el-form-item label="椤圭洰鐘舵��"> - <el-select v-model="queryParams.projectStatus" :disabled="isProjectCategory" clearable @change="handleQuery" + <el-select v-model="queryParams.projectStatus" :disabled="isProjectCategory" clearable + @change="handleQuery" placeholder="璇烽�夋嫨" class="select-option"> <el-option v-for="item in dict.type.sys_project_status" :key="item.value" :label="item.label" :value="item.value"/> @@ -88,7 +92,8 @@ <el-row> <el-col :span="12"> <el-form-item label="椤圭洰鐮�"> - <el-select v-model="queryParams.projectColorCode" clearable placeholder="璇烽�夋嫨" class="select-option" @change="handleQuery"> + <el-select v-model="queryParams.projectColorCode" clearable placeholder="璇烽�夋嫨" class="select-option" + @change="handleQuery"> <el-option v-for="item in dict.type.sys_project_code" :key="item.value" :label="item.label" :value="item.value"/> </el-select> @@ -96,7 +101,8 @@ </el-col> <el-col :span="12"> <el-form-item label="鍏宠仈鐘舵��"> - <el-select v-model="queryParams.assignmentStatus" clearable placeholder="璇烽�夋嫨" class="select-option" @change="handleQuery"> + <el-select v-model="queryParams.assignmentStatus" clearable placeholder="璇烽�夋嫨" class="select-option" + @change="handleQuery"> <el-option v-for="item in dict.type.sys_association_status" :key="item.value" :label="item.label" :value="item.value"/> </el-select> @@ -106,7 +112,8 @@ <el-row> <el-col :span="12"> <el-form-item label="璧勯噾绫诲瀷"> - <el-select v-model="queryParams.investmentType" clearable placeholder="璇烽�夋嫨" class="select-option" @change="handleQuery"> + <el-select v-model="queryParams.investmentType" clearable placeholder="璇烽�夋嫨" class="select-option" + @change="handleQuery"> <el-option v-for="item in dict.type.sys_funding_type" :key="item.value" :label="item.label" :value="item.value"/> </el-select> @@ -114,7 +121,8 @@ </el-col> <el-col :span="12"> <el-form-item label="椤圭洰闃舵"> - <el-select v-model="queryParams.projectPhase" clearable placeholder="璇烽�夋嫨" class="select-option" @change="handleQuery"> + <el-select v-model="queryParams.projectPhase" clearable placeholder="璇烽�夋嫨" class="select-option" + @change="handleQuery"> <el-option v-for="item in dict.type.sys_project_phases" :key="item.value" :label="item.label" :value="item.value"/> </el-select> @@ -124,7 +132,8 @@ <el-row> <el-col :span="12"> <el-form-item label="鎶曡祫绫诲埆"> - <el-select v-model="queryParams.investType" clearable placeholder="璇烽�夋嫨" class="select-option" @change="handleQuery"> + <el-select v-model="queryParams.investType" clearable placeholder="璇烽�夋嫨" class="select-option" + @change="handleQuery"> <el-option v-for="item in dict.type.sys_investment_type" :key="item.value" :label="item.label" :value="item.value"/> </el-select> @@ -132,15 +141,17 @@ </el-col> <el-col :span="12"> <el-form-item label="琛屾斂鍖哄垝"> - <el-select v-model="queryParams.area" clearable placeholder="璇烽�夋嫨" class="select-option" @change="handleQuery"> - <el-option v-for="item in dict.type.sys_administrative_divisions" :key="item.value" :label="item.label" + <el-select v-model="queryParams.area" clearable placeholder="璇烽�夋嫨" class="select-option" + @change="handleQuery"> + <el-option v-for="item in dict.type.sys_administrative_divisions" :key="item.value" + :label="item.label" :value="item.value"/> </el-select> </el-form-item> </el-col> </el-row> </el-form> - <el-button style="margin-right: 16px; margin-top: 1px; color: #3369ff" slot="reference" + <el-button style="margin-right: 16px; margin-top: 1px; color: #3369ff" slot="reference" size="small"> 鏇村绛涙煡鏉′欢 <span style="margin-left: 5px"> @@ -192,7 +203,6 @@ <!-- 鍔ㄦ�佸垪 --> <el-table-column v-for="item in columns" - :key="item.id" v-if="item.visible" :prop="item.id" :label="item.label" @@ -217,6 +227,10 @@ <template v-if="item.slotName === 'investType'"> <dict-tag :options="dict.type.sys_investment_type" :value="scope.row.investType"/> </template> + <!-- planStartTime --> + <template v-if="item.slotName === 'planStartTime'"> + {{ scope.row.planStartTime ? scope.row.planStartTime.split('-')[0] + '骞�' : '' }} + </template> </template> <!-- 榛樿鏄剧ず --> <span v-else>{{ scope.row[item.id] }}</span> @@ -224,7 +238,7 @@ </el-table-column> <!-- 鎿嶄綔鍒� --> - <el-table-column label="鎿嶄綔" width="140" align="center" > + <el-table-column label="鎿嶄綔" width="140" align="center"> <template slot-scope="scope"> <el-button size="medium" @@ -275,11 +289,12 @@ import {current, currentRest} from '@/views/projectEngineering/projectLibrary/list'; 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 }, @@ -322,6 +337,8 @@ pageSize: 10, projectName: null, projectCode: null, + projectStartTime: null, + projectEndTime: null, }, moreQueryParams: { projectType: '', // 椤圭洰绫诲瀷 @@ -350,10 +367,10 @@ }, created() { const projectCategory = this.$route.query.projectCategory; - if(!projectCategory || projectCategory === '1'){ + if (!projectCategory || projectCategory === '1') { this.isReserve = true; } - if(projectCategory){ + if (projectCategory) { this.isProjectCategory = true; } const columns = current.map((item, index) => { @@ -366,29 +383,32 @@ this.defaultColumns = JSON.parse(JSON.stringify(columns)); this.getList(); }, + beforeDestroy() { + this.removeStore(); + }, methods: { /** 淇敼鎸夐挳鎿嶄綔 */ handleUpdate(row) { - this.removeCookie(); - this.$router.push({ path: '/projectEngineering/project/ProjectDetails', query: { projectId: row.id }}); + this.removeStore(); + this.$router.push({path: '/projectEngineering/project/ProjectDetails', query: {projectId: row.id}}); }, handleDetail(row) { - this.removeCookie(); - this.$router.push({ path: '/projectEngineering/project/ProjectDetails', query: { projectId: row.id }}); + this.removeStore(); + this.$router.push({path: '/projectEngineering/project/ProjectDetails', query: {projectId: row.id}}); }, // 鏂板椤甸潰 add() { - this.removeCookie(); - this.$router.push({ path: '/projectEngineering/project/ProjectDetails' }); + this.removeStore(); + this.$router.push({path: '/projectEngineering/project/ProjectDetails'}); }, //娓呯悊缂撳瓨 - removeCookie() { - Cookies.remove("projectForm") - Cookies.remove("investmentForm") - Cookies.remove("investmentFundsForm") - Cookies.remove("legalPersonForm") - Cookies.remove("policyInfoForm") - Cookies.remove("documentsInfoForm") + removeStore() { + localStorage.removeItem("projectForm") + localStorage.removeItem("investmentForm") + localStorage.removeItem("investmentFundsForm") + localStorage.removeItem("legalPersonForm") + localStorage.removeItem("policyInfoForm") + localStorage.removeItem("documentsInfoForm") }, // 閲嶇疆鎺掑簭鐨勬柟娉� handleResetSort() { @@ -405,7 +425,7 @@ return item; }); //寮哄埗table娓叉煋 - this.tableKey = this.tableKey +1; + this.tableKey = this.tableKey + 1; }, // 鏇存柊鍒楃殑鏂规硶 handleUpdateColumns(row) { @@ -418,7 +438,7 @@ }); }, handleUpdateSort(row) { - console.log( this.columns, '鎺掑簭鍓嶇殑鍒�'); + console.log(this.columns, '鎺掑簭鍓嶇殑鍒�'); this.columns = this.columns.map(item => { if (item.key === row.key) { return row; @@ -428,8 +448,8 @@ this.defaultColumns = JSON.parse(JSON.stringify(this.columns)).sort((a, b) => a.index - b.index); this.columns.sort((a, b) => a.serialNumber - b.serialNumber); //寮哄埗table娓叉煋 - this.tableKey = this.tableKey +1; - console.log( this.columns, '鎺掑簭鍚庣殑鍒�'); + this.tableKey = this.tableKey + 1; + console.log(this.columns, '鎺掑簭鍚庣殑鍒�'); }, // 鍏抽棴鏂囦欢澶勭悊寮规鐨勬柟娉� fileDialogCancel() { @@ -447,11 +467,16 @@ /** 鏌ヨ椤圭洰绠$悊鍩虹淇℃伅鍒楄〃 */ getList() { this.loading = true; + 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() { @@ -516,7 +541,6 @@ this.multiple = !selection.length }, - /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { const ids = row.id || this.ids; @@ -535,9 +559,8 @@ }, /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { - this.download('code/info/export', { - ...this.queryParams - }, `info_${new Date().getTime()}.xlsx`) + this.isImportOrExport = true; + this.fileDialogVisible = true; } } }; diff --git a/src/views/projectEngineering/projectLibrary/projectDetails.vue b/src/views/projectEngineering/projectLibrary/projectDetails.vue index 59ca747..593af4b 100644 --- a/src/views/projectEngineering/projectLibrary/projectDetails.vue +++ b/src/views/projectEngineering/projectLibrary/projectDetails.vue @@ -1,7 +1,7 @@ <template> - <el-card class="card-container"> + <el-card class="card-container" > <div class="flex-container mb-4"> - <el-tabs v-model="currentTab" @tab-click="handleClick"> + <el-tabs v-model="currentTab" @tab-click="handleClick" v-show="isShow"> <el-tab-pane v-for="item in TABS_DATA" :key="item.value" @@ -19,6 +19,8 @@ ref="childRef" :disabled="disabled" @toNext="changeTable" + @updateIsShow="updateIsShow" + :isShow="isShow" class="full-width custom-height" /> <div v-if="!disabled" class="button-container"> @@ -41,6 +43,7 @@ name: 'ProjectDetails', data() { return { + isShow: false, currentTab: '椤圭洰绠$悊鍩虹淇℃伅', disabled: false, projectForm:{}, @@ -81,8 +84,11 @@ }; }, methods: { + updateIsShow(newValue) { + this.isShow = newValue; + }, handleClick(tabTarget) { - this.componentName = this.TABS_DATA[tabTarget.index].componentName; + this.componentName = this.TABS_DATA[tabTarget.index].componentName; }, changeTable(index) { this.componentName = this.TABS_DATA[index].componentName; diff --git a/src/views/projectProcess/index.vue b/src/views/projectProcess/index.vue index 18f76a8..d83c1cd 100644 --- a/src/views/projectProcess/index.vue +++ b/src/views/projectProcess/index.vue @@ -477,8 +477,8 @@ getProjectProcess(this.queryParams).then(response => { this.projectInfoList = response.data; this.total = response.total; + this.loading = false; }); - this.loading = false; }, // 鍙栨秷鎸夐挳 cancel() { -- Gitblit v1.8.0