From 7015cc59316ba711978387cb1b63c55bf782c071 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期一, 03 三月 2025 01:10:25 +0800
Subject: [PATCH] 判断是项目还是工程
---
src/views/engineering/index.vue | 6 ++++++
src/views/projectProcess/index.vue | 3 ++-
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/src/views/engineering/index.vue b/src/views/engineering/index.vue
index 48a2cf7..2551425 100644
--- a/src/views/engineering/index.vue
+++ b/src/views/engineering/index.vue
@@ -140,12 +140,14 @@
size="mini"
type="text"
icon="el-icon-edit"
+ v-if="!isProject(scope.row.id)"
@click="handleUpdate(scope.row)"
>淇敼</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
+ v-if="!isProject(scope.row.id)"
@click="deleteById(scope.row)"
>鍒犻櫎</el-button>
</template>
@@ -305,6 +307,10 @@
this.getDeptList();
},
methods: {
+ isProject(id) {
+ const numericPattern = /^\d+(\.\d+)?$/;
+ return numericPattern.test(id)
+ },
getProjectOwnerUnit(unitId) {
console.log(unitId)
// if (deptId) {
diff --git a/src/views/projectProcess/index.vue b/src/views/projectProcess/index.vue
index 6383405..218df77 100644
--- a/src/views/projectProcess/index.vue
+++ b/src/views/projectProcess/index.vue
@@ -401,7 +401,8 @@
openOpProcess(row) {
this.nowProcessDefId = row.processDefId ? row.processDefId : '';
this.nowProcessInsId = row.processInsId ? row.processInsId : '';
- if (isNaN(parseFloat(row.id))) {
+ const numericPattern = /^\d+(\.\d+)?$/;
+ if (numericPattern.test(row.id)) {
this.projectType = "ENGINEERING"
} else {
this.projectType = "PROJECT"
--
Gitblit v1.8.0