From 98807ef72ab512f867da14386e8fb680c6ad701f Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期三, 19 二月 2025 11:45:56 +0800 Subject: [PATCH] 项目新增修改后关闭当前标签 --- src/views/projectEngineering/projectLibrary/component/BasicInfo.vue | 194 ++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 152 insertions(+), 42 deletions(-) diff --git a/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue b/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue index 7b6c23b..3ae3195 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"> @@ -209,28 +226,50 @@ </el-form-item> </el-col> </el-row> - <el-row :gutter="20"> - <el-col :span="6"> - <el-form-item label="涓爣鍗曚綅" label-width="100px" prop="setTime" style="width: 100%"> - <el-input v-model.trim="projectForm.winUnit" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�"/> - </el-form-item> - </el-col> - <el-col :span="6"> - <el-form-item label="涓爣閲戦" label-width="100px" style="width: 100%"> - <el-input v-model.trim="projectForm.winAmount" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" - type="number"/> - </el-form-item> - </el-col> - <el-col :span="6"> - <el-form-item label="涓爣鏃堕棿" label-width="100px" style="width: 100%"> - <el-date-picker v-model="projectForm.winTime" - placeholder="閫夋嫨鏃堕棿" - style="width: 100%" - type="date" - value-format="yyyy-MM-dd HH:mm:ss"/> - </el-form-item> - </el-col> - </el-row> + <div style="width: 100%;position: relative;border: 1px solid #d7d7d7;margin-bottom: 15px;padding: 4px;min-height: 45px"> + <div style="font-size: small;margin-bottom: 5px">涓爣鍗曚綅锛�</div> + <div> + <el-row :gutter="20" v-for="(winUnit,index) in projectForm.winUnitList" :key="'zb' + index"> + <el-col :span="4"> + <el-form-item label="鍗曚綅鍚嶇О" label-width="100px" prop="setTime" style="width: 100%"> + <el-input v-model.trim="winUnit.winUnit" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�"/> + </el-form-item> + </el-col> + <el-col :span="4"> + <el-form-item label="涓爣閲戦" label-width="100px" style="width: 100%"> + <el-input v-model.trim="winUnit.winAmount" class="item" clearable maxlength="255" placeholder="璇疯緭鍏�" + type="number"/> + </el-form-item> + </el-col> + <el-col :span="4"> + <el-form-item label="涓爣鏃堕棿" label-width="100px" style="width: 100%"> + <el-date-picker v-model="winUnit.winTime" + placeholder="閫夋嫨鏃堕棿" + style="width: 100%" + type="date" + value-format="yyyy-MM-dd HH:mm:ss"/> + </el-form-item> + </el-col> + <el-col :span="4"> + <el-form-item label="鍗曚綅鑱旂郴浜�" label-width="100px" style="width: 100%"> + <el-input v-model.trim="winUnit.contacts" class="item" clearable maxlength="20" placeholder="璇疯緭鍏�"/> + </el-form-item> + </el-col> + <el-col :span="4"> + <el-form-item label="鑱旂郴鐢佃瘽" label-width="100px" style="width: 100%"> + <el-input v-model.trim="winUnit.phone" class="item" clearable maxlength="20" placeholder="璇疯緭鍏�"/> + </el-form-item> + </el-col> + <el-col :span="1"> + <el-button type="danger" icon="el-icon-delete" v-show="projectForm.winUnitList.length > 1" @click="removeWinUnit(index)" circle></el-button> + </el-col> + </el-row> + </div> + <div style="position: absolute; top: 2px; right: 2px"> + <el-button type="primary" @click="addWinUnit" icon="el-icon-plus"></el-button> + </div> + </div> + <el-row :gutter="20"> <el-col :span="6"> <el-form-item label="骞村害鎶曡祫璁″垝" label-width="100px" prop="year" style="width: 100%"> @@ -250,6 +289,19 @@ <el-input v-model.trim="projectForm.yearInvestAmount" clearable maxlength="255" placeholder="璇疯緭鍏�" style="width: 90%" type="number"/> <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> @@ -294,6 +346,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'; @@ -304,10 +357,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 }, @@ -328,7 +383,7 @@ projectName: '', projectCode: '', projectType: '', - projectStatus: 'working', + projectStatus: 'pendding', fundType: '', investType: '', importanceType: '', @@ -347,14 +402,19 @@ setTime: '', assignmentStatus: '', area: '', - winTime: '', - winUnit: '', - winAmount: '', + winUnitList: [{ + winUnit: '', + winTime: null, + winAmount: '', + contacts: '', + phone: '' + }], projectAddress: '', engineeringIdList: [], content: '', + constructionNature: '', contact: '', - projectOwnerUnit: '', + projectOwnerUnit: null, planStartTime: '', planCompleteTime: '', projectContactPerson: '', @@ -364,6 +424,7 @@ yearInvestAmount: '', competentDepartmentList: [], managementCentralizationList: [], + remark: '' }, subclass: '', largeCategory: '', @@ -407,20 +468,43 @@ if (this.projectForm.id) { this.getProjectInfo(this.projectForm.id); } else { - this.getProjectCodeApi(); + // this.getProjectCodeApi(); this.$emit('updateIsShow', true); } // this.handleLoadMore(1); } }, beforeDestroy() { - localStorage.setItem("projectForm", JSON.stringify(this.projectForm)); + // localStorage.setItem("projectForm", JSON.stringify(this.projectForm)); }, methods: { + addWinUnit() { + this.projectForm.winUnitList.push({ + winUnit: '', + winTime: null, + winAmount: '', + contacts: '', + phone: '' + }) + }, + removeWinUnit(index) { + this.projectForm.winUnitList.splice(index, 1) + }, + 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() { @@ -428,9 +512,10 @@ this.approvalList = res.data; }); }, - submit() { + submit(usedStatus) { this.$refs["projectForm"].validate(valid => { if (valid) { + this.projectForm.usedStatus = usedStatus; if (this.projectForm.id) { updateProject(this.projectForm).then(response => { this.$modal.msgSuccess("淇敼鎴愬姛"); @@ -530,6 +615,7 @@ this.largeCategory = labels.join(','); } }, 1000); + this.$emit('basicInfoForm', newVal) }, deep: true } @@ -570,4 +656,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