From a3dbb8fe40e06f9abd9718f14aaa7311bddbc150 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 13 二月 2025 21:46:05 +0800
Subject: [PATCH] 除了项目中心,其它项目页面都不显示审核状态
---
src/views/projectEngineering/projectLibrary/component/BasicInfo.vue | 189 ++++++++++++++++++++++++++++++++---------------
1 files changed, 129 insertions(+), 60 deletions(-)
diff --git a/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue b/src/views/projectEngineering/projectLibrary/component/BasicInfo.vue
index 11e6cbf..5256d81 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"/>
@@ -295,6 +311,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 +322,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'],
components: {
Map,
+ TagList,
// UploadStandard,
// RemoteSelect
},
@@ -316,7 +335,11 @@
disabled: {
type: Boolean,
default: false
- }
+ },
+ isShow: {
+ type: Boolean,
+ required: true,
+ },
},
data() {
return {
@@ -325,7 +348,7 @@
projectName: '',
projectCode: '',
projectType: '',
- projectStatus: 'working',
+ projectStatus: 'pendding',
fundType: '',
investType: '',
importanceType: '',
@@ -351,7 +374,7 @@
engineeringIdList: [],
content: '',
contact: '',
- projectOwnerUnit: '',
+ projectOwnerUnit: null,
planStartTime: '',
planCompleteTime: '',
projectContactPerson: '',
@@ -360,8 +383,11 @@
year: '',
yearInvestAmount: '',
competentDepartmentList: [],
- managementCentralizationList: []
+ managementCentralizationList: [],
+ remark: ''
},
+ subclass: '',
+ largeCategory: '',
approvalList: [],
setTime: '',
planStartTime: '',
@@ -373,8 +399,6 @@
hasMore: true,
selectOptions: [],
accept: ['pdf', 'docx', 'xlsx', 'jpg', 'jpeg'],
- largeCategory: '',
- subclass: '',
mapCreateInfo: {},
demoFormRef: null,
rules: {
@@ -390,30 +414,45 @@
}];
},
},
- created() {
+ 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 +460,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 +486,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 +541,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 +604,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