From eac6b7989a6cbb9d09b20a1c46f51bb68d9f5ae7 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期三, 19 二月 2025 10:01:50 +0800 Subject: [PATCH] 项目信息一对多的情况列表不显示、相关文书不要了 --- src/views/projectEngineering/projectLibrary/component/BasicInfo.vue | 203 +++++++++++++++++++++++++++++++++++--------------- 1 files changed, 143 insertions(+), 60 deletions(-) diff --git a/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue b/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue index 1319e34..22b8c0f 100644 --- a/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue +++ b/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue @@ -9,12 +9,23 @@ </el-col> <el-col :span="6"> <el-form-item class="item" label="椤圭洰浠g爜" label-width="100px" prop="projectCode"> - <el-input v-model.trim="projectForm.projectCode" class="item" clearable disabled maxlength="255" + <el-input v-model.trim="projectForm.projectCode" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�"/> </el-form-item> </el-col> <el-col :span="12" style="position: relative"> - <div style="width: 150px; position: absolute;"><img alt="" src="../../../../assets/images/s.png"/></div> + <div style="width: 100%; height: 100%; position: absolute;"> + <el-form-item class="item" label="璧嬬爜" label-width="50px" prop="coding"> + <template slot-scope="scope"> + <!-- <div class="yellow-dot" v-if="scope.row.coding === 'yellow'"></div>--> + <!-- <div class="green-dot" v-if="scope.row.coding === 'green'"></div>--> + <!-- <div class="red-dot" v-if="scope.row.coding === 'red'"></div>--> + <div class="red-dot"></div> + <tag-list></tag-list> + </template> + </el-form-item> + <!-- <img alt="" src="../../../../assets/images/s.png"/>--> + </div> </el-col> </el-row> <el-row :gutter="20"> @@ -43,10 +54,10 @@ </el-form-item> </el-col> <el-col :span="6"> - <el-form-item label="椤圭洰闃舵" label-width="100px" prop="fundsType" style="width: 100%"> - <el-input v-model.trim="projectForm.projectPhase" class="item" clearable disabled maxlength="255" - placeholder="璇疯緭鍏�"/> - </el-form-item> +<!-- <el-form-item label="椤圭洰闃舵" label-width="100px" prop="fundsType" style="width: 100%">--> +<!-- <el-input v-model.trim="projectForm.projectPhase" class="item" clearable disabled maxlength="255"--> +<!-- placeholder="璇疯緭鍏�"/>--> +<!-- </el-form-item>--> </el-col> </el-row> <el-row :gutter="20"> @@ -60,18 +71,24 @@ </el-col> <el-col :span="6"> <el-form-item label="椤圭洰鐘舵��" label-width="100px" prop="projectstatus" style="width: 100%"> - <el-select v-model="projectForm.projectStatus" clearable placeholder="璇烽�夋嫨" style="width: 100%"> + <el-select v-model="projectForm.projectStatus" clearable placeholder="璇烽�夋嫨" @change="handleProjectStatusChange" style="width: 100%"> <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-col :span="6"> - <el-form-item label="椤圭洰涓氫富鍗曚綅" label-width="100px" prop="projectOwnerUnit" style="width: 100%"> - <el-input v-model.trim="projectForm.projectOwnerUnit" class="item" clearable maxlength="255" - placeholder="璇疯緭鍏�"/> - </el-form-item> + <el-form-item label="椤圭洰闃舵" label-width="100px" prop="fundsType" style="width: 100%"> + <el-input v-model.trim="projectForm.projectPhase" class="item" clearable disabled maxlength="255" + placeholder="璇疯緭鍏�"/> + </el-form-item> </el-col> +<!-- <el-col :span="6">--> +<!-- <el-form-item label="椤圭洰涓氫富鍗曚綅" label-width="100px" prop="projectOwnerUnit" style="width: 100%">--> +<!-- <el-input v-model.trim="projectForm.projectOwnerUnit" class="item" clearable maxlength="255"--> +<!-- placeholder="璇疯緭鍏�"/>--> +<!-- </el-form-item>--> +<!-- </el-col>--> </el-row> <el-row :gutter="20"> <el-col :span="6"> @@ -107,7 +124,7 @@ placeholder="璇烽�夋嫨" style="width: 100%" collapse-tags - @change="changeDepartment"> + > <el-option v-for="item in approvalList" :key="item.id" @@ -139,7 +156,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"/> @@ -253,6 +269,19 @@ <span style="margin-left: 2px">鍏�</span> </el-form-item> </el-col> + <el-col :span="6"> + <el-form-item label="寤鸿鎬ц川" label-width="100px" prop="constructionNature" style="width: 100%; min-width: 260px"> + <el-select + v-model="projectForm.constructionNature" + clearable + placeholder="璇烽�夋嫨" + style="width: 100%" + > + <el-option v-for="item in dict.type.construction_nature" :key="item.value" :label="item.label" + :value="item.value"/> + </el-select> + </el-form-item> + </el-col> </el-row> <el-row :gutter="0"> <el-col :span="18"> @@ -295,6 +324,7 @@ <script> // import Upload from '@element-plus/icons-vue/dist/Upload.vue'; import Map from '@/views/components/Map/index.vue'; +import TagList from "./TagList.vue"; // import MapMouseEvent from '@/views/components/Map/types'; // import UploadStandard from '@/components/uploadStandard.vue'; // import { usePlanLibrary } from '@/hooks/detailsInformation'; @@ -305,10 +335,12 @@ import {approvalList} from "@/api/system/dept"; export default { + name: 'BasicInfo', dicts: ['sys_funding_type', 'sys_investment_type', 'sys_project_type', 'sys_project_status', 'sys_competent_department' - , 'sys_administrative_divisions', 'sys_centralized_management', 'sys_approval_type', 'sys_key_categories', 'sys_annual_plan'], + , 'sys_administrative_divisions', 'sys_centralized_management', 'sys_approval_type', 'sys_key_categories', 'sys_annual_plan', 'construction_nature'], components: { Map, + TagList, // UploadStandard, // RemoteSelect }, @@ -316,7 +348,11 @@ disabled: { type: Boolean, default: false - } + }, + isShow: { + type: Boolean, + required: true, + }, }, data() { return { @@ -325,7 +361,7 @@ projectName: '', projectCode: '', projectType: '', - projectStatus: 'working', + projectStatus: 'pendding', fundType: '', investType: '', importanceType: '', @@ -350,8 +386,9 @@ projectAddress: '', engineeringIdList: [], content: '', + constructionNature: '', contact: '', - projectOwnerUnit: '', + projectOwnerUnit: null, planStartTime: '', planCompleteTime: '', projectContactPerson: '', @@ -360,8 +397,11 @@ year: '', yearInvestAmount: '', competentDepartmentList: [], - managementCentralizationList: [] + managementCentralizationList: [], + remark: '' }, + subclass: '', + largeCategory: '', approvalList: [], setTime: '', planStartTime: '', @@ -373,8 +413,6 @@ hasMore: true, selectOptions: [], accept: ['pdf', 'docx', 'xlsx', 'jpg', 'jpeg'], - largeCategory: '', - subclass: '', mapCreateInfo: {}, demoFormRef: null, rules: { @@ -392,28 +430,43 @@ }, 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.getProjectCodeApi(); + this.$emit('updateIsShow', true); } // this.handleLoadMore(1); } }, beforeDestroy() { - Cookies.set("projectForm", JSON.stringify(this.projectForm)); + localStorage.setItem("projectForm", JSON.stringify(this.projectForm)); }, methods: { + handleProjectStatusChange(value) { + // 鏍规嵁閫変腑鐨� projectStatus 淇敼 anotherField 鐨勫�� + if (value === 'working' || value === 'stop') { + this.projectForm.projectPhase = '瀹炴柦闃舵'; + } else if (value === 'finish') { + this.projectForm.projectPhase = '绔e伐鎶曠敤闃舵'; + } else if (value === 'pendding') { + this.projectForm.projectPhase = '鍌ㄥ瑙勫垝闃舵'; + } + }, getProjectInfo(id) { getProject(id).then(res => { this.projectForm = res.data; + this.$emit('updateIsShow', true); + }); }, getApprovalList() { @@ -421,10 +474,11 @@ this.approvalList = res.data; }); }, - submit() { + submit(usedStatus) { this.$refs["projectForm"].validate(valid => { if (valid) { - if (this.projectForm.id != null) { + this.projectForm.usedStatus = usedStatus; + if (this.projectForm.id) { updateProject(this.projectForm).then(response => { this.$modal.msgSuccess("淇敼鎴愬姛"); //璺宠浆鍒颁笅涓粍浠� @@ -446,22 +500,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; @@ -500,28 +555,32 @@ this.$message.success('鑾峰彇鍦板潃鎴愬姛'); this.dialogMap = false; } else { - this.$message.error('鑾峰彇鍧愭爣澶辫触'); + this.$message.error('璇峰厛鐐瑰嚮鍦板浘閫夋嫨鍦板潃'); } }, }, 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); + this.$emit('basicInfoForm', newVal) + }, + deep: true + } } }; </script> @@ -559,4 +618,28 @@ width: 20px; } } + +.yellow-dot { + width: 10px; /* 鍦嗙偣鐨勫搴� */ + height: 10px; /* 鍦嗙偣鐨勯珮搴� */ + background-color: yellow; /* 鍦嗙偣鐨勯鑹� */ + border-radius: 50%; /* 浣垮厓绱犲彉鎴愬渾褰� */ + display: inline-block; /* 纭繚鍏冪礌鍙互鍜屽叾浠栧唴鑱斿厓绱犱竴璧锋樉绀� */ +} + +.red-dot { + width: 10px; /* 鍦嗙偣鐨勫搴� */ + height: 10px; /* 鍦嗙偣鐨勯珮搴� */ + background-color: red; /* 鍦嗙偣鐨勯鑹� */ + border-radius: 50%; /* 浣垮厓绱犲彉鎴愬渾褰� */ + display: inline-block; /* 纭繚鍏冪礌鍙互鍜屽叾浠栧唴鑱斿厓绱犱竴璧锋樉绀� */ +} + +.green-dot { + width: 10px; /* 鍦嗙偣鐨勫搴� */ + height: 10px; /* 鍦嗙偣鐨勯珮搴� */ + background-color: green; /* 鍦嗙偣鐨勯鑹� */ + border-radius: 50%; /* 浣垮厓绱犲彉鎴愬渾褰� */ + display: inline-block; /* 纭繚鍏冪礌鍙互鍜屽叾浠栧唴鑱斿厓绱犱竴璧锋樉绀� */ +} </style> -- Gitblit v1.8.0